text:
package com.marklogic.mapreduce;

import java.io.ByteArrayOutputStream;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.TransformerException;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.commons.modeler.util.DomUtil;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.io.Writable;
import org.w3c.dom.Attr;
import org.w3c.dom.Node;
import org.xml.sax.SAXException;

import com.marklogic.io.IOHelper;
import com.marklogic.xcc.ResultItem;
import com.marklogic.xcc.types.ItemType;
import com.marklogic.xcc.types.XdmAttribute;
import com.marklogic.xcc.types.XdmDocument;
import com.marklogic.xcc.types.XdmElement;
import com.marklogic.xcc.types.XdmText;
import com.marklogic.xcc.types.impl.AttributeImpl;
import com.marklogic.xcc.types.impl.DocumentImpl;
import com.marklogic.xcc.types.impl.TextImpl;

/**
 * A record returned by MarkLogic, used to represent an XML node.  Currently
 * only documents, elements and attributes are supported.  Use with
 * {@link NodeInputFormat} and {@link NodeOutputFormat}. May also be used
 * with {@link KeyValueInputFormat} and {@link ValueInputFormat}.
 *
 * @author jchen
 */
public class MarkLogicNode implements Writable {
    public static final Log LOG =
        LogFactory.getLog(MarkLogicNode.class);

    private Node node;

    private static final ThreadLocal<DocumentBuilder> builderLocal =
        new ThreadLocal<DocumentBuilder>() {
        @Override protected DocumentBuilder initialValue() {
            try {
                return
                DocumentBuilderFactory.newInstance().newDocumentBuilder();
            } catch (ParserConfigurationException e) {
                LOG.error(e);
                return null;
            }
        }
    };

    static DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();

    public MarkLogicNode() {}

    public MarkLogicNode(Node node) {
        this.node = node;
    }

    public MarkLogicNode(ResultItem item) {
        set(item);
    }

    public MarkLogicNode(String content, ContentType contentType) {
        try {
            if (contentType == ContentType.TEXT) {
                node = new TextImpl(content).asW3cText();
            } else if (contentType == ContentType.XML) {
                node = new DocumentImpl(content).asW3cDocument();
            }
        } catch (IOException e) {
            LOG.error(e);
        } catch (SAXException e) {
            LOG.error("error parsing result", e);
        } catch (ParserConfigurationException e) {
            LOG.error(e);
        }
    }

    public Node get() {
        return node;
    }

    public void set(Node node) {
        this.node = node;
    }

    public void set(ResultItem item) {
        ItemType type = item.getItemType();
        DocumentBuilder docBuilder = builderLocal.get();
        try {
            if (type == ItemType.ELEMENT) {
                node = ((XdmElement)item.getItem()).asW3cElement(docBuilder);
            } else if (type == ItemType.TEXT) {
                node = ((XdmText)item.getItem()).asW3cText(docBuilder);
            } else if (type == ItemType.DOCUMENT) {
                node = ((XdmDocument)item.getItem()).asW3cDocument(docBuilder);
            } else if (type == ItemType.ATTRIBUTE) {
                node = ((XdmAttribute)item.getItem()).asW3cAttr(docBuilder);
            } else {
                throw new UnsupportedOperationException(
                        "Unexpected item type: " + item.getItemType());
            }
        } catch (IOException e) {
            LOG.error(e);
        } catch (SAXException e) {
            LOG.error("error parsing result", e);
        }
    }

    public void readFields(DataInput in) throws IOException {
        int type = in.readInt();
        DocumentBuilder docBuilder = builderLocal.get();
        String val = Text.readString(in);
        try {
            if (type == Node.ATTRIBUTE_NODE) {
                AttributeImpl attr = new AttributeImpl(Text.readString(in),
                        Text.readString(in));
                node = attr.asW3cNode(docBuilder);
            } else {
                node = DomUtil.readXml(IOHelper.newStream(val));
            }
        } catch (SAXException e) {
            LOG.error("error parsing input", e);
            throw new IOException(e);
        } catch (ParserConfigurationException e) {
            LOG.error("error parsing input", e);
            throw new IOException(e);
        }
    }

    public void write(DataOutput out) throws IOException {
        if (node != null) {
            int type = node.getNodeType();
            out.writeInt(type);
            if (type == Node.ATTRIBUTE_NODE) {
                Text.writeString(out, node.getNodeName());
                Text.writeString(out, node.getNodeValue());
            } else {
                ByteArrayOutputStream baos = new ByteArrayOutputStream();
                try {
                    DomUtil.writeXml(node, baos);
                    Text.writeString(out, baos.toString());
                } catch (TransformerException e) {
                    LOG.error("error transforming node", e);
                    throw new IOException(e);
                }
            }
        } else {
            LOG.error("Node to write is null.");
        }
    }

    @Override
    public String toString() {
        if (node != null) {
            try {
                StringBuilder buf = new StringBuilder();
                if (node.getNodeType() == Node.ATTRIBUTE_NODE) {
                    buf.append("attribute name: ");
                    buf.append(((Attr)node).getName());
                    buf.append(", value: ");
                    buf.append(((Attr)node).getValue());
                } else {
                    ByteArrayOutputStream bos = new ByteArrayOutputStream();
                    DomUtil.writeXml(node, bos);
                    buf.append(bos.toString());
                }
                return buf.toString();
            } catch (TransformerException e) {
                LOG.error(e);
            }
        }
        return null;
    }
}


text:
package org.apache.cassandra.io.sstable;

import java.io.IOException;
import java.io.IOError;
import java.util.Iterator;
import java.util.Arrays;

import org.apache.cassandra.db.DecoratedKey;
import org.apache.cassandra.db.filter.IColumnIterator;
import org.apache.cassandra.db.filter.QueryFilter;
import org.apache.cassandra.io.util.BufferedRandomAccessFile;
import org.apache.cassandra.service.StorageService;
import org.apache.cassandra.utils.FBUtilities;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class RowIndexedScanner extends SSTableScanner
{
    private static Logger logger = LoggerFactory.getLogger(RowIndexedScanner.class);

    private final BufferedRandomAccessFile file;
    private final SSTableReader sstable;
    private IColumnIterator row;
    private boolean exhausted = false;
    private Iterator<IColumnIterator> iterator;
    private QueryFilter filter;

    /**
     * @param sstable SSTable to scan.
     */
    RowIndexedScanner(SSTableReader sstable, int bufferSize)
    {
        try
        {
            this.file = new BufferedRandomAccessFile(sstable.getFilename(), "r", bufferSize);
        }
        catch (IOException e)
        {
            throw new IOError(e);
        }
        this.sstable = sstable;
    }

    /**
     * @param sstable SSTable to scan.
     * @param filter filter to use when scanning the columns
     */
    RowIndexedScanner(SSTableReader sstable, QueryFilter filter, int bufferSize)
    {
        try
        {
            this.file = new BufferedRandomAccessFile(sstable.getFilename(), "r", bufferSize);
        }
        catch (IOException e)
        {
            throw new IOError(e);
        }
        this.sstable = sstable;
        this.filter = filter;
    }

    public void close() throws IOException
    {
        file.close();
    }

    public void seekTo(DecoratedKey seekKey)
    {
        try
        {
            long position = sstable.getNearestPosition(seekKey);
            if (position < 0)
            {
                exhausted = true;
                return;
            }
            file.seek(position);
            row = null;
        }
        catch (IOException e)
        {
            throw new RuntimeException("corrupt sstable", e);
        }
    }

    public long getFileLength()
    {
        try
        {
            return file.length();
        }
        catch (IOException e)
        {
            throw new IOError(e);
        }
    }

    public long getFilePointer()
    {
        return file.getFilePointer();
    }

    public boolean hasNext()
    {
        if (iterator == null)
            iterator = exhausted ? Arrays.asList(new IColumnIterator[0]).iterator() : new KeyScanningIterator();
        return iterator.hasNext();
    }

    public IColumnIterator next()
    {
        if (iterator == null)
            iterator = exhausted ? Arrays.asList(new IColumnIterator[0]).iterator() : new KeyScanningIterator();
        return iterator.next();
    }

    public void remove()
    {
        throw new UnsupportedOperationException();
    }

    private class KeyScanningIterator implements Iterator<IColumnIterator>
    {
        private long dataStart;
        private long finishedAt;

        public boolean hasNext()
        {
            try
            {
                if (row == null)
                    return !file.isEOF();
                return finishedAt < file.length();
            }
            catch (IOException e)
            {
                throw new RuntimeException(e);
            }
        }

        public IColumnIterator next()
        {
            try
            {
                if (row != null)
                    file.seek(finishedAt);
                assert !file.isEOF();

                DecoratedKey key = StorageService.getPartitioner().convertFromDiskFormat(FBUtilities.readShortByteArray(file));
                int dataSize = file.readInt();
                dataStart = file.getFilePointer();
                finishedAt = dataStart + dataSize;

                if (filter == null)
                {
                    return row = new SSTableIdentityIterator(sstable, file, key, dataStart, finishedAt);
                }
                else
                {
                    return row = filter.getSSTableColumnIterator(sstable, file, key, dataStart);
                }
            }
            catch (IOException e)
            {
                throw new RuntimeException(e);
            }
        }

        public void remove()
        {
            throw new UnsupportedOperationException();
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
package com.github.uryyyyyyy.bizCalendarUtil;

import com.github.uryyyyyyy.bizCalendarUtil.impl.BusinessDayUtilImpl;
import com.github.uryyyyyyy.bizCalendarUtil.impl.BusinessHourUtilImpl;
import com.github.uryyyyyyy.bizCalendarUtil.spec.BusinessDayUtil;
import com.github.uryyyyyyy.bizCalendarUtil.spec.BusinessHourUtil;

public class BizScheduleClient {

    public static BusinessDayUtil getBusinessDayUtil(){
        return new BusinessDayUtilImpl();
    }

    public static BusinessHourUtil getBusinessHourUtil(){
        return new BusinessHourUtilImpl();
    }

    //ImplUtil.calcCron(cronPattern, from, to);
}


text:
<!DOCTYPE html>

<meta charset="UTF-8">

<title>Table</title>

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

<meta name="viewport" content="width=device-width, initial-scale=1">

Scaled Photograph


text:
from setuptools import setup, find_packages
import boardinghouse

setup(
    name="django-boardinghouse",
    version=boardinghouse.__version__,
    description="Postgres schema support in django.",
    url="https://bitbucket.org/schinckel/django-boardinghouse",
    author="Matthew Schinckel",
    author_email="matt@schinckel.net",
    packages=find_packages(),
    include_package_data=True,
    install_requires=[
        'django',
        'sqlparse',
        'pytz',
        # 'psycopg2',  # or psycopg2cffi under pypy
    ],
    classifiers=[
        'Development Status :: 4 - Beta',
        'Framework :: Django :: 1.7',
        'Framework :: Django :: 1.8',
        'Framework :: Django :: 1.9',
        'Framework :: Django :: 1.10',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: BSD License',
        'Operating System :: OS Independent',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3.3',
        'Programming Language :: Python :: 3.4',
        'Programming Language :: Python :: 3.5',
        'Programming Language :: Python :: Implementation :: CPython',
        'Programming Language :: Python :: Implementation :: PyPy',
        'Topic :: Software Development :: Libraries :: Python Modules',
    ],
    test_suite='runtests.runtests',
)


text:
import Resolver from 'ember/resolver';
import pusher from 'appkit/pusher';

var App = Ember.Application.extend({
  LOG_ACTIVE_GENERATION: true,
  LOG_MODULE_RESOLVER: true,
  LOG_TRANSITIONS: true,
  LOG_TRANSITIONS_INTERNAL: true,
  LOG_VIEW_LOOKUPS: true,
  modulePrefix: 'appkit', // TODO: loaded via config
  Resolver: Resolver['default'],
  pusher: pusher()
});

export default App;


text:
using EstimatorX.Shared.Definitions;
using EstimatorX.Shared.Models;

namespace EstimatorX.Client.Stores;

public class UserStore : StoreBase<User>, IServiceScoped
{
    public UserStore(ILoggerFactory loggerFactory) : base(loggerFactory)
    {
    }
}


text:
<?php
/*
 *  Made by Samerton
 *  https://github.com/NamelessMC/Nameless/
 *  NamelessMC version 2.0.0-pr13
 *
 *  License: MIT
 *
 *  User "following topics" page
 */

// Must be logged in
if (!$user->isLoggedIn()) {
    Redirect::to(URL::build('/'));
}

// Always define page name for navbar
const PAGE = 'cc_following_topics';
$page_title = $forum_language->get('forum', 'following_topics');
require_once(ROOT_PATH . '/core/templates/frontend_init.php');

$forum = new Forum();
$timeago = new TimeAgo(TIMEZONE);

if (Input::exists() && Input::get('action') == 'purge') {
    if (Token::check(Input::get('token'))) {
        DB::getInstance()->query('DELETE FROM nl2_topics_following WHERE user_id = ?', [$user->data()->id]);
        Session::flash('success_post', $forum_language->get('forum', 'all_topics_unfollowed'));
    }
}

$groups = '(';
foreach ($user->getAllGroupIds() as $group_id) {
    $groups .= Output::getClean($group_id) . ',';
}
$groups = rtrim($groups, ',') . ')';
$topics = DB::getInstance()->query('SELECT nl2_topics.id AS id, nl2_topics.topic_title AS topic_title, nl2_topics.topic_creator AS topic_creator, nl2_topics.topic_date AS topic_date, nl2_topics.topic_last_user AS topic_last_user, nl2_topics.topic_reply_date AS topic_reply_date, nl2_topics_following.existing_alerts AS existing_alerts FROM nl2_topics LEFT JOIN nl2_topics_following ON nl2_topics.id = nl2_topics_following.topic_id WHERE deleted = 0 AND nl2_topics.id IN (SELECT topic_id FROM nl2_topics_following WHERE user_id = ?) AND forum_id IN (SELECT forum_id FROM nl2_forums_permissions WHERE group_id IN ' . $groups . ' AND `view` = 1) ORDER BY nl2_topics.topic_reply_date DESC', [$user->data()->id])->results();

// Pagination
$p = (isset($_GET['p']) && is_numeric($_GET['p'])) ? $_GET['p'] : 1;
$paginator = new Paginator(
    $template_pagination ?? null,
    $template_pagination_left ?? null,
    $template_pagination_right ?? null
);
$results = $paginator->getLimited($topics, 10, $p, count($topics));
$pagination = $paginator->generate(7, URL::build('/user/following_topics/'));

if (count($topics)) {
    $smarty->assign('PAGINATION', $pagination);
} else {
    $smarty->assign('PAGINATION', '');
}

$template_array = [];
$authors = [];

foreach ($results->data as $nValue) {
    $topic = $nValue;

    // Topic author/last poster
    if (!array_key_exists($topic->topic_creator, $authors)) {
        $authors[$topic->topic_creator] = new User($topic->topic_creator);
    }
    if (!array_key_exists($topic->topic_last_user, $authors)) {
        $authors[$topic->topic_last_user] = new User($topic->topic_last_user);
    }

    $last_post = DB::getInstance()->query('SELECT id FROM nl2_posts WHERE deleted = 0 AND topic_id = ? ORDER BY created DESC LIMIT 1', [$topic->id])->first();

    $template_array[] = [
        'topic_title' => Output::getClean($topic->topic_title),
        'topic_date' => $timeago->inWords($topic->topic_date, $language),
        'topic_date_full' => date(DATE_FORMAT, $topic->topic_date),
        'topic_author_id' => Output::getClean($authors[$topic->topic_creator]->data()->id),
        'topic_author_nickname' => $authors[$topic->topic_creator]->getDisplayname(),
        'topic_author_username' => $authors[$topic->topic_creator]->getDisplayname(true),
        'topic_author_avatar' => $authors[$topic->topic_creator]->getAvatar(),
        'topic_author_style' => $authors[$topic->topic_creator]->getGroupStyle(),
        'topic_author_link' => URL::build('/profile/' . Output::getClean($authors[$topic->topic_creator]->getDisplayname(true))),
        'reply_author_id' => Output::getClean($authors[$topic->topic_last_user]->data()->id),
        'reply_author_nickname' => $authors[$topic->topic_last_user]->getDisplayname(),
        'reply_author_username' => $authors[$topic->topic_last_user]->getDisplayname(true),
        'reply_author_avatar' => $authors[$topic->topic_last_user]->getAvatar(),
        'reply_author_style' => $authors[$topic->topic_last_user]->getGroupStyle(),
        'reply_author_link' => URL::build('/profile/' . Output::getClean($authors[$topic->topic_last_user]->getDisplayname(true))),
        'reply_date' => $timeago->inWords($topic->topic_reply_date, $language),
        'reply_date_full' => date(DATE_FORMAT, $topic->topic_reply_date),
        'topic_link' => URL::build('/forum/topic/' . $topic->id . '-' . $forum->titleToURL($topic->topic_title)),
        'last_post_link' => URL::build('/forum/topic/' . $topic->id . '-' . $forum->titleToURL($topic->topic_title), 'pid=' . $last_post->id),
        'unread' => $topic->existing_alerts == 1,
        'unfollow_link' => URL::build('/forum/topic/' . $topic->id, 'action=unfollow&return=list')
    ];
}

if (Session::exists('success_post')) {
    $smarty->assign('SUCCESS_MESSAGE', Session::flash('success_post'));
}

// Language values
$smarty->assign([
    'USER_CP' => $language->get('user', 'user_cp'),
    'FOLLOWING_TOPICS' => $forum_language->get('forum', 'following_topics'),
    'TOPICS_LIST' => $template_array,
    'UNFOLLOW_TOPIC' => $forum_language->get('forum', 'unfollow'),
    'UNFOLLOW_ALL' => $forum_language->get('forum', 'unfollow_all_topics'),
    'CONFIRM_UNFOLLOW' => $forum_language->get('forum', 'confirm_unfollow_all_topics'),
    'CLICK_TO_VIEW' => $language->get('user', 'click_here_to_view'),
    'NO_TOPICS' => $forum_language->get('forum', 'not_following_any_topics'),
    'YES' => $language->get('general', 'yes'),
    'NO' => $language->get('general', 'no'),
    'SUCCESS' => $language->get('general', 'success'),
    'TOKEN' => Token::get()
]);

// Load modules + template
Module::loadPage($user, $pages, $cache, $smarty, [$navigation, $cc_nav, $staffcp_nav], $widgets, $template);

require(ROOT_PATH . '/core/templates/cc_navbar.php');

$template->onPageLoad();

require(ROOT_PATH . '/core/templates/navbar.php');
require(ROOT_PATH . '/core/templates/footer.php');

// Display template
$template->displayTemplate('forum/following_topics.tpl', $smarty);


text:
{{i18n.ExamplePage}}

Using a service

Your user agent is: {{userAgent}}

Using helloWorld widget with "Peter"

Handling nested views on this page:

    Load nested content


text:
Changelog
#########

1.0.7
=====
- Fix compatibility with Peewee 3

1.0.6
=====
- Make compatible with Peewee 3

1.0.5
=====
- Fixed issue with converting DecimalField.
- Fixed issue with converting IntegerField.
- Fixed issue with using a list of non-string in one_of_validator.

1.0.4
=====
- Fixed issue with ModelValidator field overrides.

1.0.3
=====
- Fixed issue coercing numeric fields.

1.0.2
=====
- Fixed issue when passing dicts and validating unique indexes.

1.0.1
=====
- Fixed issue where ``None`` values were failing validators.

1.0.0
=====
- Major rewrite and first release with proper documentation.


text:
package org.apache.commons.geometry.euclidean.threed.line;

import java.util.List;

/** Interface for objects that support linecast operations in Euclidean 3D space.
 *
 *

 * Linecasting is a process that takes a line or line convex subset and intersects it with
 * the boundaries of a region. This is similar to
 * raycasting used
 * for collision detection with the exception that the intersecting element can be a
 * line or line convex subset and not just a ray.
 *

 */
public interface Linecastable3D {

    /** Intersect the given line against the boundaries in this instance, returning a
     * list of all intersections in order of increasing distance along the line. An empty
     * list is returned if no intersections are discovered.
     * @param line line the line to intersect
     * @return a list of computed intersections in order of increasing distance
     *      along the line
     */
    default List<LinecastPoint3D> linecast(final Line3D line) {
        return linecast(line.span());
    }

    /** Intersect the given line convex subset against the boundaries in this instance, returning
     * a list of all intersections in order of increasing distance along the line. An empty list is
     * returned if no intersections are discovered.
     * @param subset line subset to intersect
     * @return a list of computed intersections in order of increasing distance
     *      along the line
     */
    List<LinecastPoint3D> linecast(LineConvexSubset3D subset);

    /** Intersect the given line against the boundaries in this instance, returning the first
     * intersection found when traveling in the direction of the line from infinity.
     * @param line the line to intersect
     * @return the first intersection found or null if no intersection
     *      is found
     */
    default LinecastPoint3D linecastFirst(final Line3D line) {
        return linecastFirst(line.span());
    }

    /** Intersect the given line convex subset against the boundaries in this instance, returning
     * the first intersection found when traveling in the direction of the line subset from its
     * start point.
     * @param subset line subset to intersect
     * @return the first intersection found or null if no intersection
     *      is found
     */
    LinecastPoint3D linecastFirst(LineConvexSubset3D subset);
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<GeocodeResponse>
 <status>OK</status>
 <result>
  <type>neighborhood</type>
  <type>political</type>
  <formatted_address>Cunninghame, Lakes Entrance VIC 3909, Australia</formatted_address>
  <address_component>
   <long_name>Cunninghame</long_name>
   <short_name>Cunninghame</short_name>
   <type>neighborhood</type>
   <type>political</type>
  </address_component>
  <address_component>
   <long_name>Lakes Entrance</long_name>
   <short_name>Lakes Entrance</short_name>
   <type>locality</type>
   <type>political</type>
  </address_component>
  <address_component>
   <long_name>East Gippsland Shire</long_name>
   <short_name>East Gippsland</short_name>
   <type>administrative_area_level_2</type>
   <type>political</type>
  </address_component>
  <address_component>
   <long_name>Victoria</long_name>
   <short_name>VIC</short_name>
   <type>administrative_area_level_1</type>
   <type>political</type>
  </address_component>
  <address_component>
   <long_name>Australia</long_name>
   <short_name>AU</short_name>
   <type>country</type>
   <type>political</type>
  </address_component>
  <address_component>
   <long_name>3909</long_name>
   <short_name>3909</short_name>
   <type>postal_code</type>
  </address_component>
  <geometry>
   <location>
    <lat>-37.8644490</lat>
    <lng>148.0278020</lng>
   </location>
   <location_type>APPROXIMATE</location_type>
   <viewport>
    <southwest>
     <lat>-37.8732573</lat>
     <lng>148.0117946</lng>
    </southwest>
    <northeast>
     <lat>-37.8556396</lat>
     <lng>148.0438094</lng>
    </northeast>
   </viewport>
  </geometry>
  <partial_match>true</partial_match>
  <place_id>ChIJqRHgZzZeJWsR0WkMXkfDYps</place_id>
 </result>
 <result>
  <type>route</type>
  <formatted_address>North St, Lakes Entrance VIC 3909, Australia</formatted_address>
  <address_component>
   <long_name>North Street</long_name>
   <short_name>North St</short_name>
   <type>route</type>
  </address_component>
  <address_component>
   <long_name>Lakes Entrance</long_name>
   <short_name>Lakes Entrance</short_name>
   <type>locality</type>
   <type>political</type>
  </address_component>
  <address_component>
   <long_name>East Gippsland Shire</long_name>
   <short_name>East Gippsland</short_name>
   <type>administrative_area_level_2</type>
   <type>political</type>
  </address_component>
  <address_component>
   <long_name>Victoria</long_name>
   <short_name>VIC</short_name>
   <type>administrative_area_level_1</type>
   <type>political</type>
  </address_component>
  <address_component>
   <long_name>Australia</long_name>
   <short_name>AU</short_name>
   <type>country</type>
   <type>political</type>
  </address_component>
  <address_component>
   <long_name>3909</long_name>
   <short_name>3909</short_name>
   <type>postal_code</type>
  </address_component>
  <geometry>
   <location>
    <lat>-37.8713464</lat>
    <lng>147.9974965</lng>
   </location>
   <location_type>GEOMETRIC_CENTER</location_type>
   <viewport>
    <southwest>
     <lat>-37.8728266</lat>
     <lng>147.9966065</lng>
    </southwest>
    <northeast>
     <lat>-37.8701286</lat>
     <lng>147.9993044</lng>
    </northeast>
   </viewport>
   <bounds>
    <southwest>
     <lat>-37.8716619</lat>
     <lng>147.9967108</lng>
    </southwest>
    <northeast>
     <lat>-37.8712933</lat>
     <lng>147.9992001</lng>
    </northeast>
   </bounds>
  </geometry>
  <partial_match>true</partial_match>
  <place_id>ChIJxyhEe3BgJWsRgFUEEniORN4</place_id>
 </result>
 <result>
  <type>route</type>
  <formatted_address>N Cunningham Ave, Urbana, IL, USA</formatted_address>
  <address_component>
   <long_name>North Cunningham Avenue</long_name>
   <short_name>N Cunningham Ave</short_name>
   <type>route</type>
  </address_component>
  <address_component>
   <long_name>Urbana</long_name>
   <short_name>Urbana</short_name>
   <type>locality</type>
   <type>political</type>
  </address_component>
  <address_component>
   <long_name>Illinois</long_name>
   <short_name>IL</short_name>
   <type>administrative_area_level_1</type>
   <type>political</type>
  </address_component>
  <address_component>
   <long_name>United States</long_name>
   <short_name>US</short_name>
   <type>country</type>
   <type>political</type>
  </address_component>
  <geometry>
   <location>
    <lat>40.1494123</lat>
    <lng>-88.1864660</lng>
   </location>
   <location_type>GEOMETRIC_CENTER</location_type>
   <viewport>
    <southwest>
     <lat>40.1162325</lat>
     <lng>-88.2051296</lng>
    </southwest>
    <northeast>
     <lat>40.1874448</lat>
     <lng>-88.1811139</lng>
    </northeast>
   </viewport>
   <bounds>
    <southwest>
     <lat>40.1162325</lat>
     <lng>-88.2051296</lng>
    </southwest>
    <northeast>
     <lat>40.1874448</lat>
     <lng>-88.1811139</lng>
    </northeast>
   </bounds>
  </geometry>
  <partial_match>true</partial_match>
  <place_id>ChIJFa_6cjvYDIgRS_UoDUVZiq8</place_id>
 </result>
 <result>
  <type>premise</type>
  <formatted_address>Cunninghame House, Irvine, North Ayrshire KA12 8EE, UK</formatted_address>
  <address_component>
   <long_name>Cunninghame House</long_name>
   <short_name>Cunninghame House</short_name>
   <type>premise</type>
  </address_component>
  <address_component>
   <long_name>Irvine</long_name>
   <short_name>Irvine</short_name>
   <type>locality</type>
   <type>political</type>
  </address_component>
  <address_component>
   <long_name>Irvine</long_name>
   <short_name>Irvine</short_name>
   <type>postal_town</type>
  </address_component>
  <address_component>
   <long_name>North Ayrshire</long_name>
   <short_name>North Ayrshire</short_name>
   <type>administrative_area_level_2</type>
   <type>political</type>
  </address_component>
  <address_component>
   <long_name>United Kingdom</long_name>
   <short_name>GB</short_name>
   <type>country</type>
   <type>political</type>
  </address_component>
  <address_component>
   <long_name>KA12 8EE</long_name>
   <short_name>KA12 8EE</short_name>
   <type>postal_code</type>
  </address_component>
  <geometry>
   <location>
    <lat>55.6131577</lat>
    <lng>-4.6741823</lng>
   </location>
   <location_type>ROOFTOP</location_type>
   <viewport>
    <southwest>
     <lat>55.6118110</lat>
     <lng>-4.6755649</lng>
    </southwest>
    <northeast>
     <lat>55.6145090</lat>
     <lng>-4.6728670</lng>
    </northeast>
   </viewport>
   <bounds>
    <southwest>
     <lat>55.6127730</lat>
     <lng>-4.6752271</lng>
    </southwest>
    <northeast>
     <lat>55.6135470</lat>
     <lng>-4.6732048</lng>
    </northeast>
   </bounds>
  </geometry>
  <partial_match>true</partial_match>
  <place_id>ChIJN27NXm_OiUgRZhTQAUjAh7w</place_id>
 </result>
 <result>
  <type>route</type>
  <formatted_address>N Cunningham Rd, Le Grand, CA 95333, USA</formatted_address>
  <address_component>
   <long_name>North Cunningham Road</long_name>
   <short_name>N Cunningham Rd</short_name>
   <type>route</type>
  </address_component>
  <address_component>
   <long_name>Le Grand</long_name>
   <short_name>Le Grand</short_name>
   <type>locality</type>
   <type>political</type>
  </address_component>
  <address_component>
   <long_name>Merced County</long_name>
   <short_name>Merced County</short_name>
   <type>administrative_area_level_2</type>
   <type>political</type>
  </address_component>
  <address_component>
   <long_name>California</long_name>
   <short_name>CA</short_name>
   <type>administrative_area_level_1</type>
   <type>political</type>
  </address_component>
  <address_component>
   <long_name>United States</long_name>
   <short_name>US</short_name>
   <type>country</type>
   <type>political</type>
  </address_component>
  <address_component>
   <long_name>95333</long_name>
   <short_name>95333</short_name>
   <type>postal_code</type>
  </address_component>
  <geometry>
   <location>
    <lat>37.3161024</lat>
    <lng>-120.2517733</lng>
   </location>
   <location_type>GEOMETRIC_CENTER</location_type>
   <viewport>
    <southwest>
     <lat>37.2872229</lat>
     <lng>-120.2629790</lng>
    </southwest>
    <northeast>
     <lat>37.3449420</lat>
     <lng>-120.2473380</lng>
    </northeast>
   </viewport>
   <bounds>
    <southwest>
     <lat>37.2872229</lat>
     <lng>-120.2629790</lng>
    </southwest>
    <northeast>
     <lat>37.3449420</lat>
     <lng>-120.2473380</lng>
    </northeast>
   </bounds>
  </geometry>
  <partial_match>true</partial_match>
  <place_id>ChIJc8lp8fVRkYARLIkNcL0_Csc</place_id>
 </result>
 <result>
  <type>route</type>
  <formatted_address>N Cunningham Rd, New Cambria, KS 67470, USA</formatted_address>
  <address_component>
   <long_name>North Cunningham Road</long_name>
   <short_name>N Cunningham Rd</short_name>
   <type>route</type>
  </address_component>
  <address_component>
   <long_name>New Cambria</long_name>
   <short_name>New Cambria</short_name>
   <type>locality</type>
   <type>political</type>
  </address_component>
  <address_component>
   <long_name>Cambria</long_name>
   <short_name>Cambria</short_name>
   <type>administrative_area_level_3</type>
   <type>political</type>
  </address_component>
  <address_component>
   <long_name>Saline County</long_name>
   <short_name>Saline County</short_name>
   <type>administrative_area_level_2</type>
   <type>political</type>
  </address_component>
  <address_component>
   <long_name>Kansas</long_name>
   <short_name>KS</short_name>
   <type>administrative_area_level_1</type>
   <type>political</type>
  </address_component>
  <address_component>
   <long_name>United States</long_name>
   <short_name>US</short_name>
   <type>country</type>
   <type>political</type>
  </address_component>
  <address_component>
   <long_name>67470</long_name>
   <short_name>67470</short_name>
   <type>postal_code</type>
  </address_component>
  <geometry>
   <location>
    <lat>38.9393921</lat>
    <lng>-97.5014191</lng>
   </location>
   <location_type>GEOMETRIC_CENTER</location_type>
   <viewport>
    <southwest>
     <lat>38.9142888</lat>
     <lng>-97.5083600</lng>
    </southwest>
    <northeast>
     <lat>38.9580314</lat>
     <lng>-97.4964160</lng>
    </northeast>
   </viewport>
   <bounds>
    <southwest>
     <lat>38.9142888</lat>
     <lng>-97.5083600</lng>
    </southwest>
    <northeast>
     <lat>38.9580314</lat>
     <lng>-97.4964160</lng>
    </northeast>
   </bounds>
  </geometry>
  <partial_match>true</partial_match>
  <place_id>ChIJJZVW7-rcvIcRdXj_vAmTU3w</place_id>
 </result>
 <result>
  <type>route</type>
  <formatted_address>N Cunningham Ave, Inverness, FL 34453, USA</formatted_address>
  <address_component>
   <long_name>North Cunningham Avenue</long_name>
   <short_name>N Cunningham Ave</short_name>
   <type>route</type>
  </address_component>
  <address_component>
   <long_name>Inverness</long_name>
   <short_name>Inverness</short_name>
   <type>locality</type>
   <type>political</type>
  </address_component>
  <address_component>
   <long_name>Citrus County</long_name>
   <short_name>Citrus County</short_name>
   <type>administrative_area_level_2</type>
   <type>political</type>
  </address_component>
  <address_component>
   <long_name>Florida</long_name>
   <short_name>FL</short_name>
   <type>administrative_area_level_1</type>
   <type>political</type>
  </address_component>
  <address_component>
   <long_name>United States</long_name>
   <short_name>US</short_name>
   <type>country</type>
   <type>political</type>
  </address_component>
  <address_component>
   <long_name>34453</long_name>
   <short_name>34453</short_name>
   <type>postal_code</type>
  </address_component>
  <geometry>
   <location>
    <lat>28.8635632</lat>
    <lng>-82.3643516</lng>
   </location>
   <location_type>GEOMETRIC_CENTER</location_type>
   <viewport>
    <southwest>
     <lat>28.8574830</lat>
     <lng>-82.3659668</lng>
    </southwest>
    <northeast>
     <lat>28.8693232</lat>
     <lng>-82.3632688</lng>
    </northeast>
   </viewport>
   <bounds>
    <southwest>
     <lat>28.8574830</lat>
     <lng>-82.3649430</lng>
    </southwest>
    <northeast>
     <lat>28.8693232</lat>
     <lng>-82.3642926</lng>
    </northeast>
   </bounds>
  </geometry>
  <partial_match>true</partial_match>
  <place_id>ChIJictddO1y6IgRR7woe23pMhI</place_id>
 </result>
 <result>
  <type>route</type>
  <formatted_address>Co Rte 10/10, North, WV 26440, USA</formatted_address>
  <address_component>
   <long_name>Cunningham</long_name>
   <short_name>Co Rte 10/10</short_name>
   <type>route</type>
  </address_component>
  <address_component>
   <long_name>North</long_name>
   <short_name>North</short_name>
   <type>administrative_area_level_3</type>
   <type>political</type>
  </address_component>
  <address_component>
   <long_name>Barbour County</long_name>
   <short_name>Barbour County</short_name>
   <type>administrative_area_level_2</type>
   <type>political</type>
  </address_component>
  <address_component>
   <long_name>West Virginia</long_name>
   <short_name>WV</short_name>
   <type>administrative_area_level_1</type>
   <type>political</type>
  </address_component>
  <address_component>
   <long_name>United States</long_name>
   <short_name>US</short_name>
   <type>country</type>
   <type>political</type>
  </address_component>
  <address_component>
   <long_name>26440</long_name>
   <short_name>26440</short_name>
   <type>postal_code</type>
  </address_component>
  <geometry>
   <location>
    <lat>39.2228826</lat>
    <lng>-79.9614391</lng>
   </location>
   <location_type>GEOMETRIC_CENTER</location_type>
   <viewport>
    <southwest>
     <lat>39.2208800</lat>
     <lng>-79.9626341</lng>
    </southwest>
    <northeast>
     <lat>39.2255674</lat>
     <lng>-79.9599361</lng>
    </northeast>
   </viewport>
   <bounds>
    <southwest>
     <lat>39.2208800</lat>
     <lng>-79.9625590</lng>
    </southwest>
    <northeast>
     <lat>39.2255674</lat>
     <lng>-79.9600112</lng>
    </northeast>
   </bounds>
  </geometry>
  <partial_match>true</partial_match>
  <place_id>ChIJ4X-rfymNSogR6tKTi6H2iGI</place_id>
 </result>
 <result>
  <type>route</type>
  <formatted_address>N Cunningham St, Rayne, LA 70578, USA</formatted_address>
  <address_component>
   <long_name>North Cunningham Street</long_name>
   <short_name>N Cunningham St</short_name>
   <type>route</type>
  </address_component>
  <address_component>
   <long_name>Rayne</long_name>
   <short_name>Rayne</short_name>
   <type>locality</type>
   <type>political</type>
  </address_component>
  <address_component>
   <long_name>5</long_name>
   <short_name>5</short_name>
   <type>administrative_area_level_3</type>
   <type>political</type>
  </address_component>
  <address_component>
   <long_name>Acadia Parish</long_name>
   <short_name>Acadia Parish</short_name>
   <type>administrative_area_level_2</type>
   <type>political</type>
  </address_component>
  <address_component>
   <long_name>Louisiana</long_name>
   <short_name>LA</short_name>
   <type>administrative_area_level_1</type>
   <type>political</type>
  </address_component>
  <address_component>
   <long_name>United States</long_name>
   <short_name>US</short_name>
   <type>country</type>
   <type>political</type>
  </address_component>
  <address_component>
   <long_name>70578</long_name>
   <short_name>70578</short_name>
   <type>postal_code</type>
  </address_component>
  <geometry>
   <location>
    <lat>30.2389420</lat>
    <lng>-92.2659081</lng>
   </location>
   <location_type>GEOMETRIC_CENTER</location_type>
   <viewport>
    <southwest>
     <lat>30.2358680</lat>
     <lng>-92.2672141</lng>
    </southwest>
    <northeast>
     <lat>30.2419567</lat>
     <lng>-92.2645161</lng>
    </northeast>
   </viewport>
   <bounds>
    <southwest>
     <lat>30.2358680</lat>
     <lng>-92.2662730</lng>
    </southwest>
    <northeast>
     <lat>30.2419567</lat>
     <lng>-92.2654572</lng>
    </northeast>
   </bounds>
  </geometry>
  <partial_match>true</partial_match>
  <place_id>ChIJvfuTmNOlJIYR8Y97_633Uuk</place_id>
 </result>
</GeocodeResponse>


text:
namespace lomse
{

template <typename T> class Functor
{
public:
	virtual ~Functor() {}
	virtual T operator ()() = 0;
};

}   //namespace lomse

#endif      //__LOMSE_FUNCTOR_H__


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>generator.db</title>
<meta name="date" content="2014-01-14">
<link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style">

generator.db

Classes

Constants

DBField

DBFieldGenerator

DBForeignKey

DBGeneratorDefinition

DBMetaDataManager

DBTable

DBTableGenerator

DBUtils

Err

ResultsData

SQLJavaMapping


text:
// Copyright (c) Microsoft.  All Rights Reserved.  Licensed under the Apache License, Version 2.0.  See License.txt in the project root for license information.

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CodeGeneration;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Extensions;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Formatting;
using Microsoft.CodeAnalysis.Shared.Extensions;
using Roslyn.Utilities;

using static Microsoft.CodeAnalysis.CodeGeneration.CodeGenerationHelpers;

namespace Microsoft.CodeAnalysis.CSharp.CodeGeneration
{
    internal static class CSharpCodeGenerationHelpers
    {
        public static TDeclarationSyntax ConditionallyAddFormattingAnnotationTo<TDeclarationSyntax>(
            TDeclarationSyntax result,
            SyntaxList<MemberDeclarationSyntax> members) where TDeclarationSyntax : MemberDeclarationSyntax
        {
            return members.Count == 1
                ? result.WithAdditionalAnnotations(Formatter.Annotation)
                : result;
        }

        internal static void AddAccessibilityModifiers(
            Accessibility accessibility,
            IList<SyntaxToken> tokens,
            CodeGenerationOptions options,
            Accessibility defaultAccessibility)
        {
            options = options ?? CodeGenerationOptions.Default;
            if (!options.GenerateDefaultAccessibility && accessibility == defaultAccessibility)
            {
                return;
            }

            switch (accessibility)
            {
                case Accessibility.Public:
                    tokens.Add(SyntaxFactory.Token(SyntaxKind.PublicKeyword));
                    break;
                case Accessibility.Protected:
                    tokens.Add(SyntaxFactory.Token(SyntaxKind.ProtectedKeyword));
                    break;
                case Accessibility.Private:
                    tokens.Add(SyntaxFactory.Token(SyntaxKind.PrivateKeyword));
                    break;
                case Accessibility.ProtectedAndInternal:
                    tokens.Add(SyntaxFactory.Token(SyntaxKind.PrivateKeyword));
                    tokens.Add(SyntaxFactory.Token(SyntaxKind.ProtectedKeyword));
                    break;
                case Accessibility.Internal:
                    tokens.Add(SyntaxFactory.Token(SyntaxKind.InternalKeyword));
                    break;
                case Accessibility.ProtectedOrInternal:
                    tokens.Add(SyntaxFactory.Token(SyntaxKind.ProtectedKeyword));
                    tokens.Add(SyntaxFactory.Token(SyntaxKind.InternalKeyword));
                    break;
            }
        }

        public static TypeDeclarationSyntax AddMembersTo(
            TypeDeclarationSyntax destination, SyntaxList<MemberDeclarationSyntax> members)
        {
            destination = ReplaceUnterminatedConstructs(destination);

            return ConditionallyAddFormattingAnnotationTo(
                destination.EnsureOpenAndCloseBraceTokens().WithMembers(members),
                members);
        }

        private static TypeDeclarationSyntax ReplaceUnterminatedConstructs(TypeDeclarationSyntax destination)
        {
            const string MultiLineCommentTerminator = "*/";
            var lastToken = destination.GetLastToken();
            var updatedToken = lastToken.ReplaceTrivia(lastToken.TrailingTrivia,
                (t1, t2) =>
                {
                    if (t1.Kind() == SyntaxKind.MultiLineCommentTrivia)
                    {
                        var text = t1.ToString();
                        if (!text.EndsWith(MultiLineCommentTerminator, StringComparison.Ordinal))
                        {
                            return SyntaxFactory.SyntaxTrivia(SyntaxKind.MultiLineCommentTrivia, text + MultiLineCommentTerminator);
                        }
                    }
                    else if (t1.Kind() == SyntaxKind.SkippedTokensTrivia)
                    {
                        return ReplaceUnterminatedConstructs(t1);
                    }

                    return t1;
                });

            return destination.ReplaceToken(lastToken, updatedToken);
        }

        private static SyntaxTrivia ReplaceUnterminatedConstructs(SyntaxTrivia skippedTokensTrivia)
        {
            var syntax = (SkippedTokensTriviaSyntax)skippedTokensTrivia.GetStructure();
            var tokens = syntax.Tokens;

            var updatedTokens = SyntaxFactory.TokenList(tokens.Select(ReplaceUnterminatedConstruct));
            var updatedSyntax = syntax.WithTokens(updatedTokens);

            return SyntaxFactory.Trivia(updatedSyntax);
        }

        private static SyntaxToken ReplaceUnterminatedConstruct(SyntaxToken token)
        {
            if (token.IsVerbatimStringLiteral())
            {
                var tokenText = token.ToString();
                if (tokenText.Length <= 2 || tokenText.Last() != '"')
                {
                    tokenText += '"';
                    return SyntaxFactory.Literal(token.LeadingTrivia, tokenText, token.ValueText, token.TrailingTrivia);
                }
            }
            else if (token.IsRegularStringLiteral())
            {
                var tokenText = token.ToString();
                if (tokenText.Length <= 1 || tokenText.Last() != '"')
                {
                    tokenText += '"';
                    return SyntaxFactory.Literal(token.LeadingTrivia, tokenText, token.ValueText, token.TrailingTrivia);
                }
            }

            return token;
        }

        public static MemberDeclarationSyntax FirstMember(SyntaxList<MemberDeclarationSyntax> members)
        {
            return members.FirstOrDefault();
        }

        public static MemberDeclarationSyntax FirstMethod(SyntaxList<MemberDeclarationSyntax> members)
        {
            return members.FirstOrDefault(m => m is MethodDeclarationSyntax);
        }

        public static MemberDeclarationSyntax LastField(SyntaxList<MemberDeclarationSyntax> members)
        {
            return members.LastOrDefault(m => m is FieldDeclarationSyntax);
        }

        public static MemberDeclarationSyntax LastConstructor(SyntaxList<MemberDeclarationSyntax> members)
        {
            return members.LastOrDefault(m => m is ConstructorDeclarationSyntax);
        }

        public static MemberDeclarationSyntax LastMethod(SyntaxList<MemberDeclarationSyntax> members)
        {
            return members.LastOrDefault(m => m is MethodDeclarationSyntax);
        }

        public static MemberDeclarationSyntax LastOperator(SyntaxList<MemberDeclarationSyntax> members)
        {
            return members.LastOrDefault(m => m is OperatorDeclarationSyntax || m is ConversionOperatorDeclarationSyntax);
        }

        public static SyntaxList<TDeclaration> Insert<TDeclaration>(
            SyntaxList<TDeclaration> declarationList,
            TDeclaration declaration,
            CodeGenerationOptions options,
            IList<bool> availableIndices,
            Func<SyntaxList<TDeclaration>, TDeclaration> after = null,
            Func<SyntaxList<TDeclaration>, TDeclaration> before = null)
            where TDeclaration : SyntaxNode
        {
            var index = GetInsertionIndex(
                declarationList, declaration, options, availableIndices,
                CSharpDeclarationComparer.WithoutNamesInstance,
                CSharpDeclarationComparer.WithNamesInstance,
                after, before);

            if (availableIndices != null)
            {
                availableIndices.Insert(index, true);
            }

            if (index != 0 && declarationList[index - 1].ContainsDiagnostics && AreBracesMissing(declarationList[index - 1]))
            {
                return declarationList.Insert(index, declaration.WithLeadingTrivia(SyntaxFactory.ElasticCarriageReturnLineFeed));
            }

            return declarationList.Insert(index, declaration);
        }

        private static bool AreBracesMissing<TDeclaration>(TDeclaration declaration) where TDeclaration : SyntaxNode
        {
            return declaration.ChildTokens().Where(t => t.IsKind(SyntaxKind.OpenBraceToken, SyntaxKind.CloseBraceToken) && t.IsMissing).Any();
        }

        public static SyntaxNode GetContextNode(
            Location location, CancellationToken cancellationToken)
        {
            var contextLocation = location as Location;

            var contextTree = contextLocation != null && contextLocation.IsInSource
                ? contextLocation.SourceTree
                : null;

            return contextTree == null
                ? null
                : contextTree.GetRoot(cancellationToken).FindToken(contextLocation.SourceSpan.Start).Parent;
        }

        public static ExplicitInterfaceSpecifierSyntax GenerateExplicitInterfaceSpecifier(
            IEnumerable<ISymbol> implementations)
        {
            var implementation = implementations.FirstOrDefault();
            if (implementation == null)
            {
                return null;
            }

            var name = implementation.ContainingType.GenerateTypeSyntax() as NameSyntax;
            if (name == null)
            {
                return null;
            }

            return SyntaxFactory.ExplicitInterfaceSpecifier(name);
        }

        public static CodeGenerationDestination GetDestination(SyntaxNode destination)
        {
            if (destination != null)
            {
                switch (destination.Kind())
                {
                    case SyntaxKind.ClassDeclaration:
                        return CodeGenerationDestination.ClassType;
                    case SyntaxKind.CompilationUnit:
                        return CodeGenerationDestination.CompilationUnit;
                    case SyntaxKind.EnumDeclaration:
                        return CodeGenerationDestination.EnumType;
                    case SyntaxKind.ConceptDeclaration: //@t-mawind
                        return CodeGenerationDestination.ConceptType;
                    case SyntaxKind.InterfaceDeclaration:
                        return CodeGenerationDestination.InterfaceType;
                    case SyntaxKind.NamespaceDeclaration:
                        return CodeGenerationDestination.Namespace;
                    case SyntaxKind.StructDeclaration:
                        return CodeGenerationDestination.StructType;
                    default:
                        return CodeGenerationDestination.Unspecified;
                }
            }

            return CodeGenerationDestination.Unspecified;
        }

        public static TSyntaxNode ConditionallyAddDocumentationCommentTo<TSyntaxNode>(
            TSyntaxNode node,
            ISymbol symbol,
            CodeGenerationOptions options,
            CancellationToken cancellationToken = default)
            where TSyntaxNode : SyntaxNode
        {
            if (!options.GenerateDocumentationComments || node.GetLeadingTrivia().Any(t => t.IsDocComment()))
            {
                return node;
            }

            var result = TryGetDocumentationComment(symbol, "///", out var comment, cancellationToken)
                ? node.WithPrependedLeadingTrivia(SyntaxFactory.ParseLeadingTrivia(comment))
                      .WithPrependedLeadingTrivia(SyntaxFactory.ElasticMarker)
                : node;
            return result;
        }
    }
}


text:
import subprocess
from io import StringIO

from ruamel.yaml import YAML
yaml = YAML()

from . import common, jsonnet

def apply(path: str, rc: common.RuntimeConfig) -> None:
  cfg = common.get_config(path, rc)
  data = cfg.run()
  val = common.dump_yaml(data)
  nsargs = []
  if cfg.namespace:
    nsargs += ['-n', cfg.namespace]
  if rc.kubeconfig:
    nsargs += ['--kubeconfig', rc.kubeconfig]

  subprocess.run(['kubectl', 'apply', *nsargs, '-f', '-'], input=val.encode('utf-8'))


text:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Sales_po extends Root_Controller
{
    private  $message;
    public $permissions;
    public $controller_url;
    public $locations;
    public function __construct()
    {
        parent::__construct();
        $this->message="";
        $this->permissions=User_helper::get_permission('Sales_po');
        $this->locations=User_helper::get_locations();
        if(!is_array($this->locations))
        {
            if($this->locations=='wrong')
            {
                $ajax['status']=false;
                $ajax['system_message']=$this->lang->line('MSG_LOCATION_INVALID');
                $this->jsonReturn($ajax);
            }
            else
            {
                $ajax['status']=false;
                $ajax['system_message']=$this->lang->line('MSG_LOCATION_NOT_ASSIGNED');
                $this->jsonReturn($ajax);
            }

        }
        $this->permissions['request_approve']=1;
        if($this->locations['territory_id']>0)
        {
            $this->permissions['request_approve']=0;
        }
        $this->controller_url='sales_po';
        //$this->load->model("sys_module_task_model");
    }

    public function index($action="list",$id=0)
    {
        if($action=="list")
        {
            $this->system_list();
        }
        elseif($action=="add")
        {
            $this->system_add();
        }
        elseif($action=="edit")
        {
            $this->system_edit($id);
        }
        elseif($action=="details")
        {
            $this->system_details($id);
        }
        elseif($action=="request_approve")
        {
            $this->system_request_approve($id);
        }
        elseif($action=="save")
        {
            $this->system_save();
        }
        else
        {
            $this->system_list();
        }
    }

    private function system_list()
    {
        if(isset($this->permissions['view'])&&($this->permissions['view']==1))
        {
            $data['title']="Purchase Order List";
            $ajax['status']=true;
            $ajax['system_content'][]=array("id"=>"#system_content","html"=>$this->load->view("sales_po/list",$data,true));
            if($this->message)
            {
                $ajax['system_message']=$this->message;
            }
            $ajax['system_page_url']=site_url($this->controller_url);
            $this->jsonReturn($ajax);
        }
        else
        {
            $ajax['status']=false;
            $ajax['system_message']=$this->lang->line("YOU_DONT_HAVE_ACCESS");
            $this->jsonReturn($ajax);
        }

    }

    private function system_add()
    {
        if(isset($this->permissions['add'])&&($this->permissions['add']==1))
        {
            $data['title']="Create New Purchase";
            $data["po"] = Array(
                'id' => 0,
                'division_id'=>$this->locations['division_id'],
                'zone_id'=>$this->locations['zone_id'],
                'territory_id'=>$this->locations['territory_id'],
                'district_id'=>$this->locations['district_id'],
                'customer_id'=>'',
                //'warehouse_id' => '',
                'warehouse_id' => 1,//head office
                'date_po' => time()
            );
            $data['remarks']='';
            $data['divisions']=Query_helper::get_info($this->config->item('table_setup_location_divisions'),array('id value','name text'),array('status ="'.$this->config->item('system_status_active').'"'));
            $data['zones']=array();
            $data['territories']=array();
            $data['districts']=array();
            $data['customers']=array();
            if($this->locations['division_id']>0)
            {
                $data['zones']=Query_helper::get_info($this->config->item('table_setup_location_zones'),array('id value','name text'),array('division_id ='.$this->locations['division_id']));
                if($this->locations['zone_id']>0)
                {
                    $data['territories']=Query_helper::get_info($this->config->item('table_setup_location_territories'),array('id value','name text'),array('zone_id ='.$this->locations['zone_id']));
                    if($this->locations['territory_id']>0)
                    {
                        $data['districts']=Query_helper::get_info($this->config->item('table_setup_location_districts'),array('id value','name text'),array('territory_id ='.$this->locations['territory_id']));
                        if($this->locations['district_id']>0)
                        {
                            $data['customers']=Query_helper::get_info($this->config->item('table_csetup_customers'),array('id value','name text'),array('district_id ='.$this->locations['district_id'],'status ="'.$this->config->item('system_status_active').'"'));
                        }
                    }
                }
            }
            $data['warehouses']=Query_helper::get_info($this->config->item('table_basic_setup_warehouse'),array('id value','name text'),array('status ="'.$this->config->item('system_status_active').'"'));
            $this->db->from($this->config->item('table_basic_setup_warehouse_crops').' wc');
            $this->db->select('wc.crop_id value,c.name text');
            $this->db->join($this->config->item('table_setup_classification_crops').' c','c.id =wc.crop_id','INNER');
            $this->db->where('wc.warehouse_id',1);//head office
            $this->db->where('wc.revision',1);
            $this->db->order_by('c.ordering');
            $data['crops']=$this->db->get()->result_array();

            $data['po_varieties']=array();
            $ajax['system_page_url']=site_url($this->controller_url."/index/add");

            $ajax['status']=true;
            $ajax['system_content'][]=array("id"=>"#system_content","html"=>$this->load->view("sales_po/add_edit",$data,true));
            if($this->message)
            {
                $ajax['system_message']=$this->message;
            }
            $this->jsonReturn($ajax);
        }
        else
        {
            $ajax['status']=false;
            $ajax['system_message']=$this->lang->line("YOU_DONT_HAVE_ACCESS");
            $this->jsonReturn($ajax);
        }
    }
    private function system_edit($id)
    {
        if(isset($this->permissions['edit'])&&($this->permissions['edit']==1))
        {
            if(($this->input->post('id')))
            {
                $po_id=$this->input->post('id');
            }
            else
            {
                $po_id=$id;
            }

            $this->db->from($this->config->item('table_sales_po').' po');
            //$this->db->from($this->config->item('table_csetup_other_customers').' cus');
            $this->db->select('po.*');
            $this->db->select('cus.district_id');
            $this->db->select('d.territory_id');
            $this->db->select('t.zone_id zone_id');
            $this->db->select('zone.division_id division_id');
            $this->db->join($this->config->item('table_csetup_customers').' cus','cus.id = po.customer_id','INNER');
            $this->db->join($this->config->item('table_setup_location_districts').' d','d.id = cus.district_id','INNER');
            $this->db->join($this->config->item('table_setup_location_territories').' t','t.id = d.territory_id','INNER');
            $this->db->join($this->config->item('table_setup_location_zones').' zone','zone.id = t.zone_id','INNER');
            $this->db->where('po.id',$po_id);
            $data['po']=$this->db->get()->row_array();

            if(!$data['po'])
            {
                System_helper::invalid_try($this->config->item('system_edit_not_exists'),$po_id);
                $ajax['status']=false;
                $ajax['system_message']=$this->lang->line("YOU_DONT_HAVE_ACCESS");
                $this->jsonReturn($ajax);
            }
            if(!$this->check_my_editable($data['po']))
            {
                System_helper::invalid_try($this->config->item('system_edit_others'),$po_id);
                $ajax['status']=false;
                $ajax['system_message']=$this->lang->line("YOU_DONT_HAVE_ACCESS");
                $this->jsonReturn($ajax);
            }
            if($data['po']['status_requested']==$this->config->item('system_status_po_request_requested'))
            {
                $ajax['status']=false;
                $ajax['system_message']=$this->lang->line("MSG_PO_EDIT_UNABLE");
                $this->jsonReturn($ajax);
            }

            $data['divisions']=Query_helper::get_info($this->config->item('table_setup_location_divisions'),array('id value','name text'),array('status ="'.$this->config->item('system_status_active').'"'));
            $data['zones']=Query_helper::get_info($this->config->item('table_setup_location_zones'),array('id value','name text'),array('division_id ='.$data['po']['division_id']));
            $data['territories']=Query_helper::get_info($this->config->item('table_setup_location_territories'),array('id value','name text'),array('zone_id ='.$data['po']['zone_id']));
            $data['districts']=Query_helper::get_info($this->config->item('table_setup_location_districts'),array('id value','name text'),array('territory_id ='.$data['po']['territory_id']));
            $data['customers']=Query_helper::get_info($this->config->item('table_csetup_customers'),array('id value','name text'),array('district_id ='.$data['po']['district_id'],'status ="'.$this->config->item('system_status_active').'"'));
            $data['warehouses']=Query_helper::get_info($this->config->item('table_basic_setup_warehouse'),array('id value','name text'),array('status ="'.$this->config->item('system_status_active').'"'));

            $this->db->from($this->config->item('table_basic_setup_warehouse_crops').' wc');
            $this->db->select('wc.crop_id value,c.name text');
            $this->db->join($this->config->item('table_setup_classification_crops').' c','c.id =wc.crop_id','INNER');
            $this->db->where('wc.warehouse_id',$data['po']['warehouse_id']);
            $this->db->where('wc.revision',1);
            $this->db->order_by('c.ordering');
            $data['crops']=$this->db->get()->result_array();

            $this->db->from($this->config->item('table_sales_po_details').' spd');
            $this->db->select('spd.*');
            $this->db->select('v.name variety_name');
            $this->db->select('crop_type.name crop_type_name');
            $this->db->select('crop.name crop_name');
            $this->db->join($this->config->item('table_setup_classification_varieties').' v','v.id =spd.variety_id','INNER');
            $this->db->join($this->config->item('table_setup_classification_crop_types').' crop_type','crop_type.id =v.crop_type_id','INNER');
            $this->db->join($this->config->item('table_setup_classification_crops').' crop','crop.id =crop_type.crop_id','INNER');
            $this->db->where('spd.sales_po_id',$data['po']['id']);
            $this->db->where('spd.revision',1);
            $data['po_varieties']=$this->db->get()->result_array();
            $data['remarks']=$data['po_varieties'][0]['remarks'];
            $data['title']="Edit PO (".str_pad($data['po']['id'],$this->config->item('system_po_no_length'),'0',STR_PAD_LEFT).')';
            $ajax['status']=true;
            $ajax['system_content'][]=array("id"=>"#system_content","html"=>$this->load->view("sales_po/add_edit",$data,true));
            if($this->message)
            {
                $ajax['system_message']=$this->message;
            }
            $ajax['system_page_url']=site_url($this->controller_url.'/index/edit/'.$po_id);
            $this->jsonReturn($ajax);
        }
        else
        {
            $ajax['status']=false;
            $ajax['system_message']=$this->lang->line("YOU_DONT_HAVE_ACCESS");
            $this->jsonReturn($ajax);
        }
    }
    private function system_details($id)
    {
        if(isset($this->permissions['view'])&&($this->permissions['view']==1))
        {
            if(($this->input->post('id')))
            {
                $po_id=$this->input->post('id');
            }
            else
            {
                $po_id=$id;
            }

            $this->db->from($this->config->item('table_sales_po').' po');
            //$this->db->from($this->config->item('table_csetup_other_customers').' cus');
            $this->db->select('po.*');
            $this->db->select('cus.district_id,d.name district_name,cus.name customer_name');
            $this->db->select('d.territory_id,t.name territory_name');
            $this->db->select('t.zone_id zone_id,zone.name zone_name');
            $this->db->select('zone.division_id division_id,division.name division_name');
            $this->db->select('warehouse.name warehouse_name');

            $this->db->join($this->config->item('table_csetup_customers').' cus','cus.id = po.customer_id','INNER');
            $this->db->join($this->config->item('table_setup_location_districts').' d','d.id = cus.district_id','INNER');
            $this->db->join($this->config->item('table_setup_location_territories').' t','t.id = d.territory_id','INNER');
            $this->db->join($this->config->item('table_setup_location_zones').' zone','zone.id = t.zone_id','INNER');
            $this->db->join($this->config->item('table_setup_location_divisions').' division','division.id = zone.division_id','INNER');
            $this->db->join($this->config->item('table_basic_setup_warehouse').' warehouse','warehouse.id = po.warehouse_id','INNER');
            $this->db->where('po.id',$po_id);
            $data['po']=$this->db->get()->row_array();

            if(!$data['po'])
            {
                System_helper::invalid_try($this->config->item('system_view_not_exists'),$po_id);
                $ajax['status']=false;
                $ajax['system_message']=$this->lang->line("YOU_DONT_HAVE_ACCESS");
                $this->jsonReturn($ajax);
            }
            if(!$this->check_my_editable($data['po']))
            {
                System_helper::invalid_try($this->config->item('system_view_others'),$po_id);
                $ajax['status']=false;
                $ajax['system_message']=$this->lang->line("YOU_DONT_HAVE_ACCESS");
                $this->jsonReturn($ajax);
            }
            $user_ids=array();
            $user_ids[$data['po']['user_created']]=$data['po']['user_created'];
            if($data['po']['user_requested']>0)
            {
                $user_ids[$data['po']['user_requested']]=$data['po']['user_requested'];
            }
            if($data['po']['user_approved']>0)
            {
                $user_ids[$data['po']['user_approved']]=$data['po']['user_approved'];
            }
            if($data['po']['user_delivered']>0)
            {
                $user_ids[$data['po']['user_delivered']]=$data['po']['user_delivered'];
            }
            if($data['po']['user_received']>0)
            {
                $user_ids[$data['po']['user_received']]=$data['po']['user_received'];
            }

            $this->db->from($this->config->item('table_sales_po_details').' spd');
            $this->db->select('spd.*');
            $this->db->select('v.name variety_name');
            $this->db->select('crop_type.name crop_type_name');
            $this->db->select('crop.name crop_name');
            $this->db->join($this->config->item('table_setup_classification_varieties').' v','v.id =spd.variety_id','INNER');
            $this->db->join($this->config->item('table_setup_classification_crop_types').' crop_type','crop_type.id =v.crop_type_id','INNER');
            $this->db->join($this->config->item('table_setup_classification_crops').' crop','crop.id =crop_type.crop_id','INNER');
            $this->db->where('spd.sales_po_id',$po_id);
            $this->db->order_by('spd.revision ASC');
            $this->db->order_by('spd.id DESC');

            $po_varieties=$this->db->get()->result_array();
            $data['po_details']=array();
            foreach($po_varieties as $po_variety)
            {
                $data['po_details'][$po_variety['revision']][]=$po_variety;
                $user_ids[$po_variety['user_created']]=$po_variety['user_created'];
            }
            //get user info from login site
            $data['users']=System_helper::get_users_info($user_ids);

            $data['title']="Details of PO (".str_pad($data['po']['id'],$this->config->item('system_po_no_length'),'0',STR_PAD_LEFT).')';
            $ajax['status']=true;
            $ajax['system_content'][]=array("id"=>"#system_content","html"=>$this->load->view("sales_po/details",$data,true));
            if($this->message)
            {
                $ajax['system_message']=$this->message;
            }
            $ajax['system_page_url']=site_url($this->controller_url.'/index/details/'.$po_id);
            $this->jsonReturn($ajax);
        }
        else
        {
            $ajax['status']=false;
            $ajax['system_message']=$this->lang->line("YOU_DONT_HAVE_ACCESS");
            $this->jsonReturn($ajax);
        }
    }
    private function system_request_approve($id)
    {
        if(isset($this->permissions['request_approve'])&&($this->permissions['request_approve']==1))
        {
            if(($this->input->post('id')))
            {
                $po_id=$this->input->post('id');
            }
            else
            {
                $po_id=$id;
            }

            $this->db->from($this->config->item('table_sales_po').' po');
            //$this->db->from($this->config->item('table_csetup_other_customers').' cus');
            $this->db->select('po.*');
            $this->db->select('cus.district_id');
            $this->db->select('d.territory_id');
            $this->db->select('t.zone_id zone_id');
            $this->db->select('zone.division_id division_id');
            $this->db->join($this->config->item('table_csetup_customers').' cus','cus.id = po.customer_id','INNER');
            $this->db->join($this->config->item('table_setup_location_districts').' d','d.id = cus.district_id','INNER');
            $this->db->join($this->config->item('table_setup_location_territories').' t','t.id = d.territory_id','INNER');
            $this->db->join($this->config->item('table_setup_location_zones').' zone','zone.id = t.zone_id','INNER');
            $this->db->where('po.id',$po_id);
            $data['po']=$this->db->get()->row_array();

            if(!$data['po'])
            {
                System_helper::invalid_try('Not exiting id to send for request approval',$po_id);
                $ajax['status']=false;
                $ajax['system_message']=$this->lang->line("YOU_DONT_HAVE_ACCESS");
                $this->jsonReturn($ajax);
            }
            if(!$this->check_my_editable($data['po']))
            {
                System_helper::invalid_try('Trying to send request other id fro approval',$po_id);
                $ajax['status']=false;
                $ajax['system_message']=$this->lang->line("YOU_DONT_HAVE_ACCESS");
                $this->jsonReturn($ajax);
            }
            if($data['po']['status_requested']==$this->config->item('system_status_po_request_requested'))
            {
                $ajax['status']=false;
                $ajax['system_message']=$this->lang->line("MSG_PO_REQUESTED_UNABLE");
                $this->jsonReturn($ajax);
            }
            $time=time();
            $user = User_helper::get_user();
            $request=array();
            $request['status_requested']=$this->config->item('system_status_po_request_requested');
            $request['user_requested'] = $user->user_id;
            $request['date_requested'] = $time;

            $this->db->trans_start();  //DB Transaction Handle START
            Query_helper::update($this->config->item('table_sales_po'),$request,array("id = ".$po_id));

            $this->db->trans_complete();   //DB Transaction Handle END
            if ($this->db->trans_status() === TRUE)
            {
                $this->message=$this->lang->line("MSG_SAVED_SUCCESS");
                $this->system_list();
            }
            else
            {
                $ajax['status']=false;
                $ajax['system_message']=$this->lang->line("MSG_SAVED_FAIL");
                $this->jsonReturn($ajax);
            }
        }
        else
        {
            $ajax['status']=false;
            $ajax['system_message']=$this->lang->line("YOU_DONT_HAVE_ACCESS");
            $this->jsonReturn($ajax);
        }
    }

    private function system_save()
    {
        $id = $this->input->post("id");
        $user = User_helper::get_user();
        if($id>0)
        {
            if(!(isset($this->permissions['edit'])&&($this->permissions['edit']==1)))
            {
                $ajax['status']=false;
                $ajax['system_message']=$this->lang->line("YOU_DONT_HAVE_ACCESS");
                $this->jsonReturn($ajax);
                die();
            }
        }
        else
        {
            if(!(isset($this->permissions['add'])&&($this->permissions['add']==1)))
            {
                $ajax['status']=false;
                $ajax['system_message']=$this->lang->line("YOU_DONT_HAVE_ACCESS");
                $this->jsonReturn($ajax);
                die();

            }
        }
        if(!$this->check_validation())
        {
            $ajax['status']=false;
            $ajax['system_message']=$this->message;
            $this->jsonReturn($ajax);
        }
        else
        {
            $time=time();
            $po=$this->input->post('po');
            $po['date_po']=System_helper::get_time($po['date_po']);
            $po_varieties=$this->input->post('po_varieties');
            /*echo '<PRE>';
            print_r($po);
            print_r($po_varieties);
            echo '</PRE>';
            die();*/
            $this->db->trans_start();  //DB Transaction Handle START
            if($id>0)
            {
                $po['user_updated'] = $user->user_id;
                $po['date_updated'] = $time;
                Query_helper::update($this->config->item('table_sales_po'),$po,array("id = ".$id));

            }
            else
            {
                $po['user_created'] = $user->user_id;
                $po['date_created'] = $time;
                $po_id=Query_helper::add($this->config->item('table_sales_po'),$po);
                if($po_id===false)
                {
                    $this->db->trans_complete();
                    $ajax['status']=false;
                    $ajax['system_message']=$this->lang->line("MSG_SAVED_FAIL");
                    $this->jsonReturn($ajax);
                    die();
                }
                else
                {
                    $id=$po_id;
                }
            }
            $this->db->where('sales_po_id',$id);
            $this->db->set('revision', 'revision+1', FALSE);
            $this->db->update($this->config->item('table_sales_po_details'));
            $remarks=$this->input->post('remarks');
            foreach($po_varieties as $data)
            {
                $data['sales_po_id']=$id;
                $data['remarks']=$remarks;
                $data['revision']=1;
                $data['user_created'] = $user->user_id;
                $data['date_created'] = $time;
                Query_helper::add($this->config->item('table_sales_po_details'),$data);
            }

            $this->db->trans_complete();   //DB Transaction Handle END
            if ($this->db->trans_status() === TRUE)
            {
                $save_and_new=$this->input->post('system_save_new_status');
                $this->message=$this->lang->line("MSG_SAVED_SUCCESS");
                if($save_and_new==1)
                {
                    $this->system_add();
                }
                else
                {
                    $this->system_list();
                }
            }
            else
            {
                $ajax['status']=false;
                $ajax['system_message']=$this->lang->line("MSG_SAVED_FAIL");
                $this->jsonReturn($ajax);
            }
        }
    }
    private function check_my_editable($customer)
    {
        if(($this->locations['division_id']>0)&&($this->locations['division_id']!=$customer['division_id']))
        {
            return false;
        }
        if(($this->locations['zone_id']>0)&&($this->locations['zone_id']!=$customer['zone_id']))
        {
            return false;
        }
        if(($this->locations['territory_id']>0)&&($this->locations['territory_id']!=$customer['territory_id']))
        {
            return false;
        }
        if(($this->locations['district_id']>0)&&($this->locations['district_id']!=$customer['district_id']))
        {
            return false;
        }
        return true;
    }

    private function check_validation()
    {
        $this->load->library('form_validation');
        $this->form_validation->set_rules('po[customer_id]',$this->lang->line('LABEL_CUSTOMER_NAME'),'required');
        $this->form_validation->set_rules('po[warehouse_id]',$this->lang->line('LABEL_WAREHOUSE_NAME'),'required');
        if($this->form_validation->run() == FALSE)
        {
            $this->message=validation_errors();
            return false;
        }
        $po_varieties=$this->input->post('po_varieties');
        if(!(sizeof($po_varieties)>0))
        {
            $this->message=$this->lang->line('MSG_MIN_ONE_PO_REQUIRED');
            return false;
        }
        else
        {
            foreach($po_varieties as $po)
            {
                if(!(($po['variety_id']>0)&&($po['pack_size_id']>0)&&($po['quantity']>0)&& isset($po['variety_price'])&& isset($po['variety_price_net'])))
                {
                    $this->message=$this->lang->line('MSG_UNFINISHED_PO');
                    return false;
                }
            }
        }
        $id = $this->input->post("id");
        if($id>0)
        {
            $po_info=Query_helper::get_info($this->config->item('table_sales_po'),'*',array('id ='.$id),1);
            if($po_info['status_requested']==$this->config->item('system_status_po_request_requested'))
            {
                $this->message=$this->lang->line('MSG_PO_EDIT_UNABLE');
                return false;
            }
        }
        return true;
    }
    public function get_bonus_and_total()
    {
        $variety_id=$this->input->post('variety_id');
        $pack_size_id=$this->input->post('pack_size_id');
        $quantity=$this->input->post('quantity');
        $active_id=$this->input->post('active_id');
        $this->db->from($this->config->item('table_setup_classification_variety_price').' vp');
        $this->db->select('vp.price variety_price,vp.price_net variety_price_net,vp.id variety_price_id');
        $this->db->select('vp_size.name pack_size');
        $this->db->join($this->config->item('table_setup_classification_vpack_size').' vp_size','vp_size.id = vp.pack_size_id','INNER');
        $this->db->where('vp.variety_id',$variety_id);
        $this->db->where('vp.pack_size_id',$pack_size_id);
        $this->db->where('vp.revision',1);
        $price_info=$this->db->get()->row_array();
        if(!$price_info)
        {
            $ajax['status']=false;
            $ajax['system_message']=$this->lang->line('MSG_PRICE_NOT_SET');
            $this->jsonReturn($ajax);
            die();
        }
        elseif((is_null($price_info['variety_price'])||is_null($price_info['variety_price_net'])))
        {
            $ajax['status']=false;
            $ajax['system_message']='Full '.$this->lang->line('MSG_PRICE_NOT_SET');;
            $this->jsonReturn($ajax);
            die();
        }
        $ajax['status']=true;
        $weight_html='<span>'.number_format($quantity*$price_info['pack_size']/1000,3, '.', '').'</span>';
        $weight_html.='<input type="hidden" name="po_varieties['.$active_id.'][pack_size]" value="'.$price_info['pack_size'].'" />';
        $ajax['system_content'][]=array("id"=>"#total_weight_".$active_id,"html"=>$weight_html);

        $price_html='<span>'.number_format($quantity*$price_info['variety_price'],2).'</span>';
        $price_html.='<input type="hidden" name="po_varieties['.$active_id.'][variety_price]" value="'.$price_info['variety_price'].'" />';
        $price_html.='<input type="hidden" name="po_varieties['.$active_id.'][variety_price_net]" value="'.$price_info['variety_price_net'].'" />';
        $price_html.='<input type="hidden" name="po_varieties['.$active_id.'][variety_price_id]" value="'.$price_info['variety_price_id'].'" />';
        $ajax['system_content'][]=array("id"=>"#total_price_".$active_id,"html"=>$price_html);

        $bonus=System_helper::get_bonus_info($variety_id,$pack_size_id,$quantity);
        $html_quantity_bonus='<span>'.$bonus['quantity_bonus'].'</span>';
        $html_quantity_bonus.='<input type="hidden" name="po_varieties['.$active_id.'][quantity_bonus]" value="'.$bonus['quantity_bonus'].'" />';
        $html_quantity_bonus.='<input type="hidden" name="po_varieties['.$active_id.'][bonus_details_id]" value="'.$bonus['bonus_details_id'].'" />';
        if($bonus['bonus_details_id']>0)
        {
            $html_quantity_bonus.='<input type="hidden" name="po_varieties['.$active_id.'][bonus_pack_size]" value="'.$bonus['bonus_pack_size_name'].'" />';

        }
        else
        {
            $html_quantity_bonus.='<input type="hidden" name="po_varieties['.$active_id.'][bonus_pack_size]" value="0" />';
        }
        $html_quantity_bonus.='<input type="hidden" name="po_varieties['.$active_id.'][bonus_pack_size_id]" value="'.$bonus['bonus_pack_size_id'].'" />';

        $ajax['system_content'][]=array("id"=>"#bonus_quantity_".$active_id,"html"=>$html_quantity_bonus);
        $ajax['system_content'][]=array("id"=>"#bonus_pack_size_name_".$active_id,"html"=>$bonus['bonus_pack_size_name']);
        $ajax['system_content'][]=array("id"=>"#bonus_total_weight_".$active_id,"html"=>'<span>'.number_format($bonus['total_weight'],3,'.','').'</span>');

            //$ajax['system_message']=$this->message;

        $this->jsonReturn($ajax);

    }
    public function get_items()
    {
        $current_records = $this->input->post('total_records');
        if(!$current_records)
        {
            $current_records=0;
        }
        $pagesize = $this->input->post('pagesize');
        if(!$pagesize)
        {
            $pagesize=40;
        }
        else
        {
            $pagesize=$pagesize*2;
        }

        $this->db->from($this->config->item('table_sales_po_details').' pod');

        $this->db->select('SUM(pod.quantity) quantity_total');
        $this->db->select('SUM(pod.quantity*pod.pack_size) quantity_weight');
        $this->db->select('SUM(pod.quantity*pod.variety_price) price_total');

        //$this->db->from($this->config->item('table_sales_po').' po');
        $this->db->select('po.*');
        $this->db->select('cus.name,cus.customer_code');
        $this->db->select('d.name district_name');
        $this->db->select('t.name territory_name');
        $this->db->select('zone.name zone_name');
        $this->db->select('division.name division_name');
        $this->db->join($this->config->item('table_sales_po').' po','po.id = pod.sales_po_id','INNER');
        $this->db->join($this->config->item('table_csetup_customers').' cus','cus.id = po.customer_id','INNER');
        $this->db->join($this->config->item('table_setup_location_districts').' d','d.id = cus.district_id','INNER');
        $this->db->join($this->config->item('table_setup_location_territories').' t','t.id = d.territory_id','INNER');
        $this->db->join($this->config->item('table_setup_location_zones').' zone','zone.id = t.zone_id','INNER');
        $this->db->join($this->config->item('table_setup_location_divisions').' division','division.id = zone.division_id','INNER');
        if($this->locations['division_id']>0)
        {
            $this->db->where('division.id',$this->locations['division_id']);
            if($this->locations['zone_id']>0)
            {
                $this->db->where('zone.id',$this->locations['zone_id']);
                if($this->locations['territory_id']>0)
                {
                    $this->db->where('t.id',$this->locations['territory_id']);
                    if($this->locations['district_id']>0)
                    {
                        $this->db->where('d.id',$this->locations['district_id']);
                    }
                }
            }
        }
        $this->db->where('pod.revision',1);
        $this->db->group_by('po.id');
        $this->db->order_by('po.id','DESC');
        $this->db->limit($pagesize,$current_records);
        $items=$this->db->get()->result_array();
        foreach($items as &$item)
        {
            $item['po_no']=str_pad($item['id'],$this->config->item('system_po_no_length'),'0',STR_PAD_LEFT);
            $item['quantity_weight']=number_format($item['quantity_weight']/1000,3,'.','');
            $item['price_total']=number_format($item['price_total'],2);
            $item['date_po']=System_helper::display_date($item['date_po']);

        }
        $this->jsonReturn($items);
    }

}


text: README: customproduct


text:
package v1

import (
	"context"
	v1pb "go-common/app/interface/live/web-room/api/http/v1"
	"go-common/app/interface/live/web-room/conf"
	"go-common/app/interface/live/web-room/dao"
	"go-common/library/log"
)

// RoomAdminService struct
type RoomAdminService struct {
	conf *conf.Config
	// optionally add other properties here, such as dao
	// dao *dao.Dao
	dao *dao.Dao
}

//NewRoomAdminService init
func NewRoomAdminService(c *conf.Config) (s *RoomAdminService) {
	s = &RoomAdminService{
		conf: c,
		dao:  dao.New(c),
	}
	return s
}

// History 相关服务

// GetByRoom implementation
// 获取主播拥有的的所有房管, 无需登录态
// `method:"GET"
func (s *RoomAdminService) GetByRoom(ctx context.Context, req *v1pb.RoomAdminGetByRoomReq) (resp *v1pb.RoomAdminGetByRoomResp, err error) {
	// 默认值
	resp = &v1pb.RoomAdminGetByRoomResp{
		Page: &v1pb.RoomAdminGetByRoomResp_Page{
			Page:       1,
			PageSize:   1,
			TotalPage:  1,
			TotalCount: 0,
		},
		Data: []*v1pb.RoomAdminGetByRoomResp_Data{},
	}

	roomID := req.GetRoomid()
	page := req.GetPage()
	pageSize := req.GetPageSize()

	if page <= 0 {
		page = 1
	}

	if pageSize <= 0 || pageSize > 100 {
		pageSize = int64(10)
	}

	ret, err := s.dao.GetByRoomIDPage(ctx, roomID, page, pageSize)
	if ret == nil {
		log.Info("call GetByAnchor nil mid(%v) err (%v)", roomID, err)
		return
	}

	if err != nil {
		return
	}

	if nil != ret.Page {
		resp.Page = ret.Page
	}
	if nil != ret.Data {
		resp.Data = ret.Data
	}

	return
}


text:
<x-meta id="polymer-grid-layout" label="Polymer Grid Layout" isContainer>
  <template>
    <polymer-grid-layout></polymer-grid-layout-menu>
  </template>
  <property name="layout" kind="json"></property>
  <template id="imports">
    <link rel="import" href="polymer-grid-layout.html">
  </template>
</x-meta>


text:
package com.b2international.index.query;

/**
 * @since 4.7
 */
public interface Buildable<T> {
	T build();
}


text:
import snsim.xmlloader
import snsim.policy
import snsim.generator
import snsim.bouncer

def launch():
    loader = snsim.xmlloader.XMLScenarioLoader('../scenarios/scenario_03.xml')

    scenario = loader.getScenario()
    scenario.setGenerator(snsim.generator.JobGenerator)
    scenario.setBouncer(snsim.bouncer.Bouncer)
    it = 5000

    scenario.setPolicy(snsim.policy.PenaltyBasedPolicy)
    scenario.bouncer.debugSetAcceptAll(True)
    scenario.start(maxIterations = it)
    scenario.bouncer.exportTrace('../reports/trace_bouncer_inactive.out')
    scenario.exportTrace('../reports/trace_scenario_inactive.out')

    scenario.bouncer.debugSetAcceptAll(False)
    scenario.start(maxIterations = it)
    scenario.bouncer.exportTrace('../reports/trace_bouncer_active.out')
    scenario.exportTrace('../reports/trace_scenario_active.out')

if __name__ == '__main__':
    launch()
    #profile.run('launch()')


text:
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/pci.h>
#include <linux/hw_random.h>
#include <linux/delay.h>
#include <asm/io.h>

#define PFX	KBUILD_MODNAME ": "

#define GEODE_RNG_DATA_REG   0x50
#define GEODE_RNG_STATUS_REG 0x54

/*
 * Data for PCI driver interface
 *
 * This data only exists for exporting the supported
 * PCI ids via MODULE_DEVICE_TABLE.  We do not actually
 * register a pci_driver, because someone else might one day
 * want to register another driver on the same PCI id.
 */
static const struct pci_device_id pci_tbl[] = {
	{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_LX_AES), 0, },
	{ 0, },	/* terminate list */
};
MODULE_DEVICE_TABLE(pci, pci_tbl);

static int geode_rng_data_read(struct hwrng *rng, u32 *data)
{
	void __iomem *mem = (void __iomem *)rng->priv;

	*data = readl(mem + GEODE_RNG_DATA_REG);

	return 4;
}

static int geode_rng_data_present(struct hwrng *rng, int wait)
{
	void __iomem *mem = (void __iomem *)rng->priv;
	int data, i;

	for (i = 0; i < 20; i++) {
		data = !!(readl(mem + GEODE_RNG_STATUS_REG));
		if (data || !wait)
			break;
		udelay(10);
	}
	return data;
}

static struct hwrng geode_rng = {
	.name		= "geode",
	.data_present	= geode_rng_data_present,
	.data_read	= geode_rng_data_read,
};

static int __init mod_init(void)
{
	int err = -ENODEV;
	struct pci_dev *pdev = NULL;
	const struct pci_device_id *ent;
	void __iomem *mem;
	unsigned long rng_base;

	for_each_pci_dev(pdev) {
		ent = pci_match_id(pci_tbl, pdev);
		if (ent)
			goto found;
	}
	/* Device not found. */
	goto out;

found:
	rng_base = pci_resource_start(pdev, 0);
	if (rng_base == 0)
		goto out;
	err = -ENOMEM;
	mem = ioremap(rng_base, 0x58);
	if (!mem)
		goto out;
	geode_rng.priv = (unsigned long)mem;

	printk(KERN_INFO "AMD Geode RNG detected\n");
	err = hwrng_register(&geode_rng);
	if (err) {
		printk(KERN_ERR PFX "RNG registering failed (%d)\n",
		       err);
		goto err_unmap;
	}
out:
	return err;

err_unmap:
	iounmap(mem);
	goto out;
}

static void __exit mod_exit(void)
{
	void __iomem *mem = (void __iomem *)geode_rng.priv;

	hwrng_unregister(&geode_rng);
	iounmap(mem);
}

module_init(mod_init);
module_exit(mod_exit);

MODULE_DESCRIPTION("H/W RNG driver for AMD Geode LX CPUs");
MODULE_LICENSE("GPL");


text:
package com.onegini.sdk.model;

import com.neovisionaries.i18n.CountryCode;

/**
 * Represents the notion of postal address of a person
 */
public interface Address extends CollectionField {

  static final String ALTERNATIVE_ADDRESS_TAG = "ALTERNATIVE";

  /**
   * @return Numeric part of the house number, e.g. {@literal 9}
   */
  Integer getHouseNumber();

  /**
   * @return Any addition that further clarifies the house number, e.g. {@literal 2nd floor}, {@literal unit 101}
   */
  String getHouseNumberAddition();

  /**
   * @return name of the street, e.g. {@literal Main Street}
   */
  String getStreetName();

  /**
   * @return name of the city, e.g. {@literal Amsterdam}
   */
  String getCity();

  /**
   * @return postal code, e.g. {@literal 1000 AA} or {@literal 12345-6789}
   */
  String getPostalCode();

  /**
   * @return name of the region, province or state, e.g. {@literal California}
   */
  String getRegion();

  /**
   * @return {@link com.neovisionaries.i18n.CountryCode}
   */
  CountryCode getCountry();

  /**
   * In case of multiple addresses with different purposes, this flag indicates whether this address is used for the
   * "alternative" purpose.
   * <p>
   * Examples are: billing/shipping, postal/residential.
   *
   * @return {@literal true} if this address is used for the "alternative" purpose
   */
  boolean isAlternative();

  /**
   * @return name of the company, e.g. {@literal Acme Inc.}
   * @since {@literal 4.04.00}
   */
  String getCompanyName();

  /**
   * @return 'To attention of' field in an address, e.g. {@literal John Doe}
   * @since {@literal 4.04.00}
   */
  String getAttention();
}