text:
/**
 * @author Oleg V. Khaschansky
 *
 * @date: Jun 14, 2005
 */

package org.apache.harmony.awt.gl.font;

import java.awt.font.TextHitInfo;
import java.awt.font.TextLayout;
import java.awt.geom.Rectangle2D;
import java.awt.geom.GeneralPath;
import java.awt.geom.Line2D;
import java.awt.*;

import org.apache.harmony.awt.internal.nls.Messages;

/**
 * This class provides functionality for creating caret and highlight shapes
 * (bidirectional text is also supported, but, unfortunately, not tested yet).
 */
public class CaretManager {
    private TextRunBreaker breaker;

    public CaretManager(TextRunBreaker breaker) {
        this.breaker = breaker;
    }

    /**
     * Checks if TextHitInfo is not out of the text range and throws the
     * IllegalArgumentException if it is.
     * @param info - text hit info
     */
    private void checkHit(TextHitInfo info) {
        int idx = info.getInsertionIndex();

        if (idx < 0 || idx > breaker.getCharCount()) {
            // awt.42=TextHitInfo out of range
            throw new IllegalArgumentException(Messages.getString("awt.42")); //$NON-NLS-1$
        }
    }

    /**
     * Calculates and returns visual position from the text hit info.
     * @param hitInfo - text hit info
     * @return visual index
     */
    private int getVisualFromHitInfo(TextHitInfo hitInfo) {
        final int idx = hitInfo.getCharIndex();

        if (idx >= 0 && idx < breaker.getCharCount()) {
            int visual = breaker.getVisualFromLogical(idx);
            // We take next character for (LTR char + TRAILING info) and (RTL + LEADING)
            if (hitInfo.isLeadingEdge() ^ ((breaker.getLevel(idx) & 0x1) == 0x0)) {
                visual++;
            }
            return visual;
        } else if (idx < 0) {
            return breaker.isLTR() ? 0: breaker.getCharCount();
        } else {
            return breaker.isLTR() ? breaker.getCharCount() : 0;
        }
    }

    /**
     * Calculates text hit info from the visual position
     * @param visual - visual position
     * @return text hit info
     */
    private TextHitInfo getHitInfoFromVisual(int visual) {
        final boolean first = visual == 0;

        if (!(first || visual == breaker.getCharCount())) {
            int logical = breaker.getLogicalFromVisual(visual);
            return (breaker.getLevel(logical) & 0x1) == 0x0 ?
                    TextHitInfo.leading(logical) : // LTR
                    TextHitInfo.trailing(logical); // RTL
        } else if (first) {
            return breaker.isLTR() ?
                    TextHitInfo.trailing(-1) :
                    TextHitInfo.leading(breaker.getCharCount());
        } else { // Last
            return breaker.isLTR() ?
                    TextHitInfo.leading(breaker.getCharCount()) :
                    TextHitInfo.trailing(-1);
        }
    }

    /**
     * Creates caret info. Required for the getCaretInfo
     * methods of the TextLayout
     * @param hitInfo - specifies caret position
     * @return caret info, see TextLayout.getCaretInfo documentation
     */
    public float[] getCaretInfo(TextHitInfo hitInfo) {
        checkHit(hitInfo);
        float res[] = new float[2];

        int visual = getVisualFromHitInfo(hitInfo);
        float advance, angle;
        TextRunSegment seg;

        if (visual < breaker.getCharCount()) {
            int logIdx = breaker.getLogicalFromVisual(visual);
            int segmentIdx = breaker.logical2segment[logIdx];
            seg = breaker.runSegments.get(segmentIdx);
            advance = seg.x + seg.getAdvanceDelta(seg.getStart(), logIdx);
            angle = seg.metrics.italicAngle;

        } else { // Last character
            int logIdx = breaker.getLogicalFromVisual(visual-1);
            int segmentIdx = breaker.logical2segment[logIdx];
            seg = breaker.runSegments.get(segmentIdx);
            advance = seg.x + seg.getAdvanceDelta(seg.getStart(), logIdx+1);
        }

        angle = seg.metrics.italicAngle;

        res[0] = advance;
        res[1] = angle;

        return res;
    }

    /**
     * Returns the next position to the right from the current caret position
     * @param hitInfo - current position
     * @return next position to the right
     */
    public TextHitInfo getNextRightHit(TextHitInfo hitInfo) {
        checkHit(hitInfo);
        int visual = getVisualFromHitInfo(hitInfo);

        if (visual == breaker.getCharCount()) {
            return null;
        }

        TextHitInfo newInfo;

        while(visual <= breaker.getCharCount()) {
            visual++;
            newInfo = getHitInfoFromVisual(visual);

            if (newInfo.getCharIndex() >= breaker.logical2segment.length) {
                return newInfo;
            }

            if (hitInfo.getCharIndex() >= 0) { // Don't check for leftmost info
                if (
                        breaker.logical2segment[newInfo.getCharIndex()] !=
                        breaker.logical2segment[hitInfo.getCharIndex()]
                ) {
                    return newInfo; // We crossed segment boundary
                }
            }

            TextRunSegment seg = breaker.runSegments.get(breaker.logical2segment[newInfo
                    .getCharIndex()]);
            if (!seg.charHasZeroAdvance(newInfo.getCharIndex())) {
                return newInfo;
            }
        }

        return null;
    }

    /**
     * Returns the next position to the left from the current caret position
     * @param hitInfo - current position
     * @return next position to the left
     */
    public TextHitInfo getNextLeftHit(TextHitInfo hitInfo) {
        checkHit(hitInfo);
        int visual = getVisualFromHitInfo(hitInfo);

        if (visual == 0) {
            return null;
        }

        TextHitInfo newInfo;

        while(visual >= 0) {
            visual--;
            newInfo = getHitInfoFromVisual(visual);

            if (newInfo.getCharIndex() < 0) {
                return newInfo;
            }

            // Don't check for rightmost info
            if (hitInfo.getCharIndex() < breaker.logical2segment.length) {
                if (
                        breaker.logical2segment[newInfo.getCharIndex()] !=
                        breaker.logical2segment[hitInfo.getCharIndex()]
                ) {
                    return newInfo; // We crossed segment boundary
                }
            }

            TextRunSegment seg = breaker.runSegments.get(breaker.logical2segment[newInfo
                    .getCharIndex()]);
            if (!seg.charHasZeroAdvance(newInfo.getCharIndex())) {
                return newInfo;
            }
        }

        return null;
    }

    /**
     * For each visual caret position there are two hits. For the simple LTR text one is
     * a trailing of the previous char and another is the leading of the next char. This
     * method returns the opposite hit for the given hit.
     * @param hitInfo - given hit
     * @return opposite hit
     */
    public TextHitInfo getVisualOtherHit(TextHitInfo hitInfo) {
        checkHit(hitInfo);

        int idx = hitInfo.getCharIndex();

        int resIdx;
        boolean resIsLeading;

        if (idx >= 0 && idx < breaker.getCharCount()) { // Hit info in the middle
            int visual = breaker.getVisualFromLogical(idx);

            // Char is LTR + LEADING info
            if (((breaker.getLevel(idx) & 0x1) == 0x0) ^ hitInfo.isLeadingEdge()) {
                visual++;
                if (visual == breaker.getCharCount()) {
                    if (breaker.isLTR()) {
                        resIdx = breaker.getCharCount();
                        resIsLeading = true;
                    } else {
                        resIdx = -1;
                        resIsLeading = false;
                    }
                } else {
                    resIdx = breaker.getLogicalFromVisual(visual);
                    if ((breaker.getLevel(resIdx) & 0x1) == 0x0) {
                        resIsLeading = true;
                    } else {
                        resIsLeading = false;
                    }
                }
            } else {
                visual--;
                if (visual == -1) {
                    if (breaker.isLTR()) {
                        resIdx = -1;
                        resIsLeading = false;
                    } else {
                        resIdx = breaker.getCharCount();
                        resIsLeading = true;
                    }
                } else {
                    resIdx = breaker.getLogicalFromVisual(visual);
                    if ((breaker.getLevel(resIdx) & 0x1) == 0x0) {
                        resIsLeading = false;
                    } else {
                        resIsLeading = true;
                    }
                }
            }
        } else if (idx < 0) { // before "start"
            if (breaker.isLTR()) {
                resIdx = breaker.getLogicalFromVisual(0);
                resIsLeading = (breaker.getLevel(resIdx) & 0x1) == 0x0; // LTR char?
            } else {
                resIdx = breaker.getLogicalFromVisual(breaker.getCharCount() - 1);
                resIsLeading = (breaker.getLevel(resIdx) & 0x1) != 0x0; // RTL char?
            }
        } else { // idx == breaker.getCharCount()
            if (breaker.isLTR()) {
                resIdx = breaker.getLogicalFromVisual(breaker.getCharCount() - 1);
                resIsLeading = (breaker.getLevel(resIdx) & 0x1) != 0x0; // LTR char?
            } else {
                resIdx = breaker.getLogicalFromVisual(0);
                resIsLeading = (breaker.getLevel(resIdx) & 0x1) == 0x0; // RTL char?
            }
        }

        return resIsLeading ? TextHitInfo.leading(resIdx) : TextHitInfo.trailing(resIdx);
    }

    public Line2D getCaretShape(TextHitInfo hitInfo, TextLayout layout) {
        return getCaretShape(hitInfo, layout, true, false, null);
    }

    /**
     * Creates a caret shape.
     * @param hitInfo - hit where to place a caret
     * @param layout - text layout
     * @param useItalic - unused for now, was used to create
     * slanted carets for italic text
     * @param useBounds - true if the cared should fit into the provided bounds
     * @param bounds - bounds for the caret
     * @return caret shape
     */
    public Line2D getCaretShape(
            TextHitInfo hitInfo, TextLayout layout,
            boolean useItalic, boolean useBounds, Rectangle2D bounds
    ) {
        checkHit(hitInfo);

        float x1, x2, y1, y2;

        int charIdx = hitInfo.getCharIndex();

        if (charIdx >= 0 && charIdx < breaker.getCharCount()) {
            TextRunSegment segment = breaker.runSegments.get(breaker.logical2segment[charIdx]);
            y1 = segment.metrics.descent;
            y2 = - segment.metrics.ascent - segment.metrics.leading;

            x1 = x2 = segment.getCharPosition(charIdx) + (hitInfo.isLeadingEdge() ?
                    0 : segment.getCharAdvance(charIdx));
            // Decided that straight cursor looks better even for italic fonts,
            // especially combined with highlighting
            /*
            // Not graphics, need to check italic angle and baseline
            if (layout.getBaseline() >= 0) {
                if (segment.metrics.italicAngle != 0 && useItalic) {
                    x1 -= segment.metrics.italicAngle * segment.metrics.descent;
                    x2 += segment.metrics.italicAngle *
                        (segment.metrics.ascent + segment.metrics.leading);

                    float baselineOffset =
                        layout.getBaselineOffsets()[layout.getBaseline()];
                    y1 += baselineOffset;
                    y2 += baselineOffset;
                }
            }
            */
        } else {
            y1 = layout.getDescent();
            y2 = - layout.getAscent() - layout.getLeading();
            x1 = x2 = ((breaker.getBaseLevel() & 0x1) == 0 ^ charIdx < 0) ?
                    layout.getAdvance() : 0;
        }

        if (useBounds) {
            y1 = (float) bounds.getMaxY();
            y2 = (float) bounds.getMinY();

            if (x2 > bounds.getMaxX()) {
                x1 = x2 = (float) bounds.getMaxX();
            }
            if (x1 < bounds.getMinX()) {
                x1 = x2 = (float) bounds.getMinX();
            }
        }

        return new Line2D.Float(x1, y1, x2, y2);
    }

    /**
     * Creates caret shapes for the specified offset. On the boundaries where
     * the text is changing its direction this method may return two shapes
     * for the strong and the weak carets, in other cases it would return one.
     * @param offset - offset in the text.
     * @param bounds - bounds to fit the carets into
     * @param policy - caret policy
     * @param layout - text layout
     * @return one or two caret shapes
     */
    public Shape[] getCaretShapes(
            int offset, Rectangle2D bounds,
            TextLayout.CaretPolicy policy, TextLayout layout
    ) {
        TextHitInfo hit1 = TextHitInfo.afterOffset(offset);
        TextHitInfo hit2 = getVisualOtherHit(hit1);

        Shape caret1 = getCaretShape(hit1, layout);

        if (getVisualFromHitInfo(hit1) == getVisualFromHitInfo(hit2)) {
            return new Shape[] {caret1, null};
        }
        Shape caret2 = getCaretShape(hit2, layout);

        TextHitInfo strongHit = policy.getStrongCaret(hit1, hit2, layout);
        return strongHit.equals(hit1) ?
                new Shape[] {caret1, caret2} :
                new Shape[] {caret2, caret1};
    }

    /**
     * Connects two carets to produce a highlight shape.
     * @param caret1 - 1st caret
     * @param caret2 - 2nd caret
     * @return highlight shape
     */
    GeneralPath connectCarets(Line2D caret1, Line2D caret2) {
        GeneralPath path = new GeneralPath(GeneralPath.WIND_NON_ZERO);
        path.moveTo((float) caret1.getX1(), (float) caret1.getY1());
        path.lineTo((float) caret2.getX1(), (float) caret2.getY1());
        path.lineTo((float) caret2.getX2(), (float) caret2.getY2());
        path.lineTo((float) caret1.getX2(), (float) caret1.getY2());

        path.closePath();

        return path;
    }

    /**
     * Creates a highlight shape from given two hits. This shape
     * will always be visually contiguous
     * @param hit1 - 1st hit
     * @param hit2 - 2nd hit
     * @param bounds - bounds to fit the shape into
     * @param layout - text layout
     * @return highlight shape
     */
    public Shape getVisualHighlightShape(
            TextHitInfo hit1, TextHitInfo hit2,
            Rectangle2D bounds, TextLayout layout
    ) {
        checkHit(hit1);
        checkHit(hit2);

        Line2D caret1 = getCaretShape(hit1, layout, false, true, bounds);
        Line2D caret2 = getCaretShape(hit2, layout, false, true, bounds);

        return connectCarets(caret1, caret2);
    }

    /**
     * Suppose that the user visually selected a block of text which has
     * several different levels (mixed RTL and LTR), so, in the logical
     * representation of the text this selection may be not contigous.
     * This methods returns a set of logical ranges for the arbitrary
     * visual selection represented by two hits.
     * @param hit1 - 1st hit
     * @param hit2 - 2nd hit
     * @return logical ranges for the selection
     */
    public int[] getLogicalRangesForVisualSelection(TextHitInfo hit1, TextHitInfo hit2) {
        checkHit(hit1);
        checkHit(hit2);

        int visual1 = getVisualFromHitInfo(hit1);
        int visual2 = getVisualFromHitInfo(hit2);

        if (visual1 > visual2) {
            int tmp = visual2;
            visual2 = visual1;
            visual1 = tmp;
        }

        // Max level is 255, so we don't need more than 512 entries
        int results[] = new int[512];

        int prevLogical, logical, runStart, numRuns = 0;

        logical = runStart = prevLogical = breaker.getLogicalFromVisual(visual1);

        // Get all the runs. We use the fact that direction is constant in all runs.
        for (int i=visual1+1; i<=visual2; i++) {
            logical = breaker.getLogicalFromVisual(i);
            int diff = logical-prevLogical;

            // Start of the next run encountered
            if (diff > 1 || diff < -1) {
                results[(numRuns)*2] = Math.min(runStart, prevLogical);
                results[(numRuns)*2 + 1] = Math.max(runStart, prevLogical);
                numRuns++;
                runStart = logical;
            }

            prevLogical = logical;
        }

        // The last unsaved run
        results[(numRuns)*2] = Math.min(runStart, logical);
        results[(numRuns)*2 + 1] = Math.max(runStart, logical);
        numRuns++;

        int retval[] = new int[numRuns*2];
        System.arraycopy(results, 0, retval, 0, numRuns*2);
        return retval;
    }

    /**
     * Creates a highlight shape from given two endpoints in the logical
     * representation. This shape is not always visually contiguous
     * @param firstEndpoint - 1st logical endpoint
     * @param secondEndpoint - 2nd logical endpoint
     * @param bounds - bounds to fit the shape into
     * @param layout - text layout
     * @return highlight shape
     */
    public Shape getLogicalHighlightShape(
            int firstEndpoint, int secondEndpoint,
            Rectangle2D bounds, TextLayout layout
    ) {
        GeneralPath res = new GeneralPath();

        for (int i=firstEndpoint; i<=secondEndpoint; i++) {
            int endRun = breaker.getLevelRunLimit(i, secondEndpoint);
            TextHitInfo hit1 = TextHitInfo.leading(i);
            TextHitInfo hit2 = TextHitInfo.trailing(endRun-1);

            Line2D caret1 = getCaretShape(hit1, layout, false, true, bounds);
            Line2D caret2 = getCaretShape(hit2, layout, false, true, bounds);

            res.append(connectCarets(caret1, caret2), false);

            i = endRun;
        }

        return res;
    }
}


text:
/****** Object:  Stored Procedure dbo.JoinAlliance    Script Date: 5/1/2004 6:12:38 PM ******/
CREATE PROCEDURE dbo.JoinAlliance
	(
		@SectorID int,
		@AllianceName nvarchar(16),
		@AlliancePassword nvarchar(16),
		@Result nvarchar(600) output
	)
AS
		DECLARE @AllianceID int
		DECLARE @AllianceWait nvarchar(16)
		DECLARE @AllianceNameB nvarchar(16)
		DECLARE @Galaxy nvarchar(16)
		DECLARE @Sector nvarchar(16)
		DECLARE @SectorJoin nvarchar(512)
		DECLARE @PersonalNews nvarchar(512)
		DECLARE @AllianceAL int
		SET @Galaxy = (SELECT Galaxy FROM Sectors WHERE SectorID = @SectorID)
		SET @Sector = (SELECT Sector FROM Sectors WHERE SectorID = @SectorID)
		SET @AllianceWait = (SELECT AllianceWait FROM Sectors WHERE SectorID = @SectorID)
		SET @AllianceID = (SELECT AllianceID FROM Alliances WHERE AllianceName = @AllianceName)
		SET @AllianceNameB = (SELECT AllianceName FROM Alliances WHERE AllianceID = @AllianceID)
		SET @SectorJoin = 'Sector ' + @Galaxy + ':' + @Sector + ' has joined the alliance.'
		SET @PersonalNews = 'Sector ' + @Galaxy + ':' + @Sector + ' has joined your alliance.'
		SET @AllianceAL = (SELECT AL FROM Alliances WHERE AllianceID = @AllianceID)
		IF @AllianceWait > 0
		BEGIN
		SET @Result = 'You have to wait ' + @AllianceWait + ' hours before you can join an alliance.'
		END
		ELSE
		BEGIN
		INSERT INTO AllianceNews(AllianceID, NewsType, NewsText) VALUES(@AllianceID, 7, @SectorJoin)
		INSERT INTO PersonalNews(kdID, NewsText) VALUES (@AllianceAL, @PersonalNews)
		UPDATE Sectors SET AllianceID = @AllianceID WHERE SectorID = @SectorID
		SET @Result = 'You have joined the ' + @AllianceNameB + ' alliance.'
		END

redpajama_set_name: RedPajamaGithub


text:
package com.glipka.easyReactJS.reactRouter
import scala.scalajs.js
import com.glipka.easyReactJS.react._
import GlobalDefinition._

@js.native
trait RouteProps extends Props[Route] with js.Any {
  val path: RoutePattern = js.native
  val component: RouteComponent = js.native
  val components: RouteComponents = js.native
  val getComponent: (RouterState, (js.Any, RouteComponent) => Any) => Any = js.native
  val getComponents: (RouterState, (js.Any, RouteComponents) => Any) => Unit = js.native
  def onEnter: EnterHook = js.native
  def onLeave: LeaveHook = js.native
  def onChange: ChangeHook = js.native
  val getIndexRoute: (js.Any, (js.Any, RouteConfig) => Unit) => Unit = js.native
  val getChildRoutes: (js.Any, (Any, RouteConfig) => Unit) => Unit = js.native
}


text:
'use strict';

const baiji = require('baiji');

const app = baiji('app');

app.define('index', {
  description: 'index api',
  route: { path: '/', verb: 'get' }
}, function(ctx, next) {
  return ctx.done({ message: 'index api called' }, next);
});

app.define('show', {
  description: 'show api',
  route: { path: '/:id', verb: 'get' }
}, function(ctx, next) {
  return ctx.done({ message: 'show api called with id ' + ctx.args.id }, next);
});

app.define('update', {
  description: 'update api',
  route: { path: '/:id', verb: 'put' }
}, function(ctx, next) {
  return new Promise(function(resolve) {
    setTimeout(function() {
      resolve(ctx.done({ message: 'update api called with id ' + ctx.args.id }, next));
    }, 1000);
  });
});

// add baiji-gateway plugin
app.plugin(require('../'), { max: 5 });

app.listen(3003);

// Start server
// DEBUG=baiji:Adapter node examples

/**
 * Curl request example

curl -X POST localhost:3003/gateway \
-H 'Content-Type: application/json' \
-d '{
  "index": { "method": "app.index", "dependencies": ["update"] },
  "update": { "method": "app.update", "params": { "id": 1 }, "dependencies": ["show"] },
  "show": { "method": "app.show", "params": { "id": 1 } }
}'

 */


text:
"""
Cuneiform Recogniser
"""

from __future__ import absolute_import

import os
import shutil
import tempfile
import subprocess as sp

from nodetree import node

import numpy
from . import base
from .. import utils, stages, types

class AbbyyRecognizer(base.CommandLineRecognizerNode):
    """
    Recognize an image using Abbyy Finereader.
    """
    binary = "abbyyocr"
    stage = stages.RECOGNIZE
    intypes = [numpy.ndarray]
    parameters = [
        dict(name="single_column", type="bool", value=False),
        dict(name="invert_image", type="bool", value=False),
        dict(name="no_despeckle", type="bool", value=False),
    ]

    def get_command(self, outfile, image):
        """
        Cuneiform command line.  Simplified for now.
        """
        args = [self.binary]
        if self._params.get("invert_image", False):
            args.append("--invertImage")
        if self._params.get("no_despeckle", False):
            args.append("--dontDespecleImage")
        if self._params.get("single_column", False):
            args.append("--singleColumnMode")
        args.extend(["-if", image, "-f", "XML", "-of", outfile])
        return args

    def set_image_dpi(self, image):
        """
        Hack to set 300 PPI on all images.  This should hopefully
        prevent FR from using up thousands of pages of license
        if there's no resolution header available.
        """
        p = sp.Popen(["convert", "-units", "PixelsPerInch",
                "-density", "300", image, image])
        return p.wait()

    def process(self, binary):
        """
        Convert a full page.
        """
        hocr = ""
        with tempfile.NamedTemporaryFile(delete=False) as tmp:
            tmp.close()
            with tempfile.NamedTemporaryFile(delete=False, suffix=".png") as btmp:
                btmp.close()
                self.write_binary(btmp.name, binary)
                self.set_image_dpi(btmp.name)
                args = self.get_command(tmp.name, btmp.name)
                self.logger.debug("Running: '%s'", " ".join(args))
                proc = sp.Popen(args, stderr=sp.PIPE)
                err = proc.stderr.read()
                if proc.wait() != 0:
                    return "!!! %s CONVERSION ERROR %d: %s !!!" % (
                            os.path.basename(self.binary).upper(),
                            proc.returncode, err)
                hocr = utils.hocr_from_abbyy(tmp.name)
            os.unlink(tmp.name)
            os.unlink(btmp.name)
        utils.set_progress(self.logger, self.progress_func, 100, 100)
        return hocr


text:
<?php

class Package extends Main_Controller
{

    public function __construct()
    {
        parent::__construct();
        $this->load->model(array('M_Package'=>'package','M_PackagePicture'=>'picture','M_Area'=>'area','M_PackageType'=>'packageType'));
    }

    public function index(){
        $page = empty($this->uri->segment(3))?1:$this->uri->segment(3);
//        $areaId = $this->uri->segment(4);
//        $packageTypeId = $this->uri->segment(5);
        $areaId = $this->input->get("areaId");
        $packageTypeId = $this->input->get("packageTypeId");
        $criteria = array();
        $this->renderPackage($criteria,$page,$areaId,$packageTypeId);

    }

    public function renderPackage($criteria=array(), $page,$areaId,$packageTypeId){
        // Paging
        $this->load->library(array('Ajax_pagination'));

        if(!empty($areaId) && $areaId !=0){
            $criteria['p.area_id']=$areaId;
            $data['areaSelected']=$areaId;
        }

        if(!empty($packageTypeId) && $packageTypeId !=0){
            $criteria['p.package_type_id'] = $packageTypeId;
            $data['packageTypeSelected'] = $packageTypeId;
        }

        $config = $this->ajax_pagination->getConfig();
        $config['total_rows']  = $this->package->countByCriteria($criteria);
        $this->ajax_pagination->initialize($config);
        $limit = array($config['per_page'],0);

        $data['packageData'] = $this->package->getPackageList($criteria,$limit);
        $data['areaData'] = $this->generateSelectItems($this->area->getDataSpecifyField('area_id id,area_name label'),'เลือกภูมิภาค');
        $data['packageTypeData'] = $this->generateSelectItems($this->packageType->getDataSpecifyField('package_type_id id,package_type_name label'),'เลือกประเภท');
        $this->setContentPage('package/package_page',$data);
        $this->loadLayoutContent($this->template);
    }

    public function renderPackageByAjax(){
        // Paging
        $this->load->library(array('Ajax_pagination'));
        $areaId = $this->input->post("areaId");
        $packageTypeId = $this->input->post("packageTypeId");

        $page = $this->input->post('page');
        if(!$page){
            $offset = 0;
        }else{
            $offset = $page;
        }

        $criteria = array();
        if(!empty($areaId) && $areaId !=0){
            $criteria['p.area_id']=$areaId;
            $data['areaSelected']=$areaId;
        }

        if(!empty($packageTypeId) && $packageTypeId !=0){
            $criteria['p.package_type_id'] = $packageTypeId;
            $data['packageTypeSelected'] = $packageTypeId;
        }

        //-- paging
        $totalRec = $this->package->countByCriteria($criteria);
        $config = $this->ajax_pagination->getConfig();
        $config['total_rows']  = $totalRec;
        $this->ajax_pagination->initialize($config);
        $limit = array($config['per_page'],$offset);
        $data['packageData'] = $this->package->getPackageList($criteria,$limit);
        $this->setContentPage('package/package_list',$data);
        echo $this->template['content'];
    }

    public function detail(){
        $packageId = $this->uri->segment('3');
        $data['packagePicture'] = $this->picture->getDataSpecifyField('image_title,image_path',array('package_id'=>$packageId));
        $data['packageData'] = $this->package->getPackageByPackageId($packageId)[0];
        $this->setContentPage('package/package_detail',$data);
        $this->loadLayoutContent($this->template);
    }

    function __destruct()
    {}
}


text:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Rory D. Kirchner | My bits</title>
    <link>http://lpantano.github.io/author/rory-d.-kirchner/</link>
      <atom:link href="http://lpantano.github.io/author/rory-d.-kirchner/index.xml" rel="self" type="application/rss+xml" />
    <description>Rory D. Kirchner</description>
    <generator>Wowchemy (https://wowchemy.com)</generator><language>en-us</language><lastBuildDate>Wed, 01 Nov 2017 00:00:00 +0000</lastBuildDate>
    <image>
      <url>http://lpantano.github.io/images/icon_hu0b7a4cb9992c9ac0e91bd28ffd38dd00_9727_512x512_fill_lanczos_center_3.png</url>
      <title>Rory D. Kirchner</title>
      <link>http://lpantano.github.io/author/rory-d.-kirchner/</link>
    </image>

    <item>
      <title>bcbioRNASeq: R package for bcbio RNA-seq analysis</title>
      <link>http://lpantano.github.io/publication/steinbaugh-2017/</link>
      <pubDate>Wed, 01 Nov 2017 00:00:00 +0000</pubDate>
      <guid>http://lpantano.github.io/publication/steinbaugh-2017/</guid>
      <description></description>
    </item>

  </channel>
</rss>


text:
// Copyright Keith D Gregory
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package net.sf.kdgcommons.test;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;

/**
 *  Instances of this class act as factories for stub objects that always throw.
 *  It can be used in one of two ways: throwing an explicit exception instance,
 *  or creating a new exception of a given class. The latter is useful when you
 *  just need to verify that an exception was thrown, the former when you need
 *  to verify that a certain path threw (use assertSame()).
 *

 *  To use, construct around the desired exception, and call {@link #getInstance}
 *  to create the stub. Since this class does not maintain any state (other than
 *  the configured exception), you can create many stubs from a single mock.
 */
public class ExceptionMock
implements InvocationHandler
{
    private Throwable _specific;
    private Class<? extends Throwable> _generic;

    /**
     *  Creates a factory for stub objects that will always throw a specific
     *  exception.
     */
    public ExceptionMock(Throwable ex)
    {
        _specific = ex;
    }

    /**
     *  Creates a factory for stub objects that will throw new instances of the
     *  specified exception class.
     *

     *  Note: instances are created by reflection. If unable to create
     *  an exception instance (typically due to protection/missing class), will
     *  throw a reflection exception instead (and this will potentially be
     *  captured by the proxy and wrapped in a proxy exception).
     */
    public ExceptionMock(Class<? extends Throwable> klass)
    {
        _generic = klass;
    }

    public <T> T getInstance(Class<T> classToMock)
    {
        return classToMock.cast(
                Proxy.newProxyInstance(
                    this.getClass().getClassLoader(),
                    new Class[] {classToMock},
                    this));
    }

    public Object invoke(Object proxy, Method method, Object[] args)
    throws Throwable
    {
        if (_specific != null)
            throw _specific;
        else
            throw _generic.newInstance();
    }
}


text:
<?php
namespace App\Http\Controllers;

use Serverfireteam\Panel\CrudController;
use App\Product;
use App\MyFnc\Permission;
use Illuminate\Http\Request;
use App\CoopManu;

class ProdStandardController extends CrudController {

    public function all($entity) {
    	parent::edit($entity);
    	if (auth()->user()->groupId != 0) return view('panelViews::hasNoAuthority');

        return view('panelViews::editProdStandard', $this->getRequestData());
    }
    public function edit($entity) {
    	parent::edit($entity);
    	return redirect('panel/ProdStandard/all');
    }
    public function update($entity, $request) {
    	if (auth()->user()->groupId != 0) return view('panelViews::hasNoAuthority');
    	foreach ($request->except('_token', 'coopManu') as $k=>$v)
    	{
    		Product::setEnumNewValues($k, explode(",", $v));
    	}
    	$data = $this->getRequestData();
    	$data['import_message'] = trans('panel::fields.successfullEdit');
        return view('panelViews::editProdStandard', $data);
    }

    private function enumData($data) {
    	$tmp = array();
    	foreach ($data as $d)
    	{
    		array_push($tmp, ['name'=>$d, 'data'=>Product::getImplodeEnumValues($d), 'label'=>trans('panel::fields.'.$d)]);
    	}
    	return $tmp;
    }

    private function getRequestData() {
    	/*
    	 * 合作厂商:coopManu
    	 *
    	 *
    	 * {!! Form::label(Lang::get('panel::fields.coopManu')) !!}

@foreach ($coopManuItems as $item)
{!! Form::label($item['item']) !!}

<input type="text" class="form-control" data-role="tagsinput" name="coopManu[]" value="{{ $item['cname'] }}" style="display: none;">
@endforeach
    	 *
    	 */
    	$coopManuItems = array();
    	$items = array_unique(CoopManu::lists('item', 'id')->all());
    	foreach ($items as $i)
    	{
    		$tmp = array();
    		foreach (CoopManu::where('item', '=', $i)->get()->toArray() as $v) {
    			array_push($tmp, $v['cname']);
    		}
    		array_push($coopManuItems, array('item'=>$i, 'cname'=>implode(",", $tmp)));
    	}
    	/*
    	 * END
    	 */
    	return [
        				//'coopManuItems'=>$coopManuItems,
        				/* 'data'=>$this->enumData([
        						'unit', 'alloyNum', 'processStatus', 'matType',
        						'surface', 'coating', 'surPerp', 'pastMembrane', 'prodUsage', 'packForm',
        						'packPaper', 'moistureproof', 'mothProffing',
        				]), */
        				'data'=>$this->enumData([
        						'unit', 'alloyNum', 'processStatus',
        						'surface', 'coating', 'surPerp', 'pastMembrane', 'prodUsage', 'packForm',
        						'packPaper', 'moistureproof', 'mothProffing',
        				]),
        		];
    }
}


text:
package s3

import (
	"context"
	awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
	"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
	internalChecksum "github.com/aws/aws-sdk-go-v2/service/internal/checksum"
	s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations"
	"github.com/aws/aws-sdk-go-v2/service/s3/types"
	"github.com/aws/smithy-go/middleware"
	smithyhttp "github.com/aws/smithy-go/transport/http"
)

// Sets the permissions on an existing bucket using access control lists (ACL). For
// more information, see Using ACLs
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/S3_ACLs_UsingACLs.html). To set
// the ACL of a bucket, you must have WRITE_ACP permission. You can use one of the
// following two ways to set a bucket's permissions:
//
// * Specify the ACL in the
// request body
//
// * Specify permissions using request headers
//
// You cannot specify
// access permission using both the body and the request headers. Depending on your
// application needs, you may choose to set the ACL on a bucket using either the
// request body or the headers. For example, if you have an existing application
// that updates a bucket ACL using the request body, then you can continue to use
// that approach. If your bucket uses the bucket owner enforced setting for S3
// Object Ownership, ACLs are disabled and no longer affect permissions. You must
// use policies to grant access to your bucket and the objects in it. Requests to
// set ACLs or update ACLs fail and return the AccessControlListNotSupported error
// code. Requests to read ACLs are still supported. For more information, see
// Controlling object ownership
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html)
// in the Amazon S3 User Guide. Access Permissions You can set access permissions
// using one of the following methods:
//
// * Specify a canned ACL with the x-amz-acl
// request header. Amazon S3 supports a set of predefined ACLs, known as canned
// ACLs. Each canned ACL has a predefined set of grantees and permissions. Specify
// the canned ACL name as the value of x-amz-acl. If you use this header, you
// cannot use other access control-specific headers in your request. For more
// information, see Canned ACL
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#CannedACL).
//
// *
// Specify access permissions explicitly with the x-amz-grant-read,
// x-amz-grant-read-acp, x-amz-grant-write-acp, and x-amz-grant-full-control
// headers. When using these headers, you specify explicit access permissions and
// grantees (Amazon Web Services accounts or Amazon S3 groups) who will receive the
// permission. If you use these ACL-specific headers, you cannot use the x-amz-acl
// header to set a canned ACL. These parameters map to the set of permissions that
// Amazon S3 supports in an ACL. For more information, see Access Control List
// (ACL) Overview
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html). You specify
// each grantee as a type=value pair, where the type is one of the following:
//
// * id
// – if the value specified is the canonical user ID of an Amazon Web Services
// account
//
// * uri – if you are granting permissions to a predefined group
//
// *
// emailAddress – if the value specified is the email address of an Amazon Web
// Services account Using email addresses to specify a grantee is only supported in
// the following Amazon Web Services Regions:
//
// * US East (N. Virginia)
//
// * US West
// (N. California)
//
// * US West (Oregon)
//
// * Asia Pacific (Singapore)
//
// * Asia Pacific
// (Sydney)
//
// * Asia Pacific (Tokyo)
//
// * Europe (Ireland)
//
// * South America (São
// Paulo)
//
// For a list of all the Amazon S3 supported Regions and endpoints, see
// Regions and Endpoints
// (https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region) in the
// Amazon Web Services General Reference.
//
// For example, the following
// x-amz-grant-write header grants create, overwrite, and delete objects permission
// to LogDelivery group predefined by Amazon S3 and two Amazon Web Services
// accounts identified by their email addresses. x-amz-grant-write:
// uri="http://acs.amazonaws.com/groups/s3/LogDelivery", id="111122223333",
// id="555566667777"
//
// You can use either a canned ACL or specify access permissions
// explicitly. You cannot do both. Grantee Values You can specify the person
// (grantee) to whom you're assigning access rights (using request elements) in the
// following ways:
//
// * By the person's ID: <>ID<><>GranteesEmail<>  DisplayName is
// optional and ignored in the request
//
// * By URI:
// <>http://acs.amazonaws.com/groups/global/AuthenticatedUsers<>
//
// * By Email
// address: <>Grantees@email.com<>lt;/Grantee> The grantee is resolved to the
// CanonicalUser and, in a response to a GET Object acl request, appears as the
// CanonicalUser. Using email addresses to specify a grantee is only supported in
// the following Amazon Web Services Regions:
//
// * US East (N. Virginia)
//
// * US West
// (N. California)
//
// * US West (Oregon)
//
// * Asia Pacific (Singapore)
//
// * Asia Pacific
// (Sydney)
//
// * Asia Pacific (Tokyo)
//
// * Europe (Ireland)
//
// * South America (São
// Paulo)
//
// For a list of all the Amazon S3 supported Regions and endpoints, see
// Regions and Endpoints
// (https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region) in the
// Amazon Web Services General Reference.
//
// # Related Resources
//
// * CreateBucket
// (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html)
//
// *
// DeleteBucket
// (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucket.html)
//
// *
// GetObjectAcl
// (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAcl.html)
func (c *Client) PutBucketAcl(ctx context.Context, params *PutBucketAclInput, optFns ...func(*Options)) (*PutBucketAclOutput, error) {
	if params == nil {
		params = &PutBucketAclInput{}
	}

	result, metadata, err := c.invokeOperation(ctx, "PutBucketAcl", params, optFns, c.addOperationPutBucketAclMiddlewares)
	if err != nil {
		return nil, err
	}

	out := result.(*PutBucketAclOutput)
	out.ResultMetadata = metadata
	return out, nil
}

type PutBucketAclInput struct {

	// The bucket to which to apply the ACL.
	//
	// This member is required.
	Bucket *string

	// The canned ACL to apply to the bucket.
	ACL types.BucketCannedACL

	// Contains the elements that set the ACL permissions for an object per grantee.
	AccessControlPolicy *types.AccessControlPolicy

	// Indicates the algorithm used to create the checksum for the object when using
	// the SDK. This header will not provide any additional functionality if not using
	// the SDK. When sending this header, there must be a corresponding x-amz-checksum
	// or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with the
	// HTTP status code 400 Bad Request. For more information, see Checking object
	// integrity
	// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html)
	// in the Amazon S3 User Guide. If you provide an individual checksum, Amazon S3
	// ignores any provided ChecksumAlgorithm parameter.
	ChecksumAlgorithm types.ChecksumAlgorithm

	// The base64-encoded 128-bit MD5 digest of the data. This header must be used as a
	// message integrity check to verify that the request body was not corrupted in
	// transit. For more information, go to RFC 1864.
	// (http://www.ietf.org/rfc/rfc1864.txt) For requests made using the Amazon Web
	// Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is
	// calculated automatically.
	ContentMD5 *string

	// The account ID of the expected bucket owner. If the bucket is owned by a
	// different account, the request fails with the HTTP status code 403 Forbidden
	// (access denied).
	ExpectedBucketOwner *string

	// Allows grantee the read, write, read ACP, and write ACP permissions on the
	// bucket.
	GrantFullControl *string

	// Allows grantee to list the objects in the bucket.
	GrantRead *string

	// Allows grantee to read the bucket ACL.
	GrantReadACP *string

	// Allows grantee to create new objects in the bucket. For the bucket and object
	// owners of existing objects, also allows deletions and overwrites of those
	// objects.
	GrantWrite *string

	// Allows grantee to write the ACL for the applicable bucket.
	GrantWriteACP *string

	noSmithyDocumentSerde
}

type PutBucketAclOutput struct {
	// Metadata pertaining to the operation's result.
	ResultMetadata middleware.Metadata

	noSmithyDocumentSerde
}

func (c *Client) addOperationPutBucketAclMiddlewares(stack *middleware.Stack, options Options) (err error) {
	err = stack.Serialize.Add(&awsRestxml_serializeOpPutBucketAcl{}, middleware.After)
	if err != nil {
		return err
	}
	err = stack.Deserialize.Add(&awsRestxml_deserializeOpPutBucketAcl{}, middleware.After)
	if err != nil {
		return err
	}
	if err = addSetLoggerMiddleware(stack, options); err != nil {
		return err
	}
	if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
		return err
	}
	if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
		return err
	}
	if err = addResolveEndpointMiddleware(stack, options); err != nil {
		return err
	}
	if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
		return err
	}
	if err = addRetryMiddlewares(stack, options); err != nil {
		return err
	}
	if err = addHTTPSignerV4Middleware(stack, options); err != nil {
		return err
	}
	if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
		return err
	}
	if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
		return err
	}
	if err = addClientUserAgent(stack); err != nil {
		return err
	}
	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
		return err
	}
	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
		return err
	}
	if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil {
		return err
	}
	if err = addOpPutBucketAclValidationMiddleware(stack); err != nil {
		return err
	}
	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutBucketAcl(options.Region), middleware.Before); err != nil {
		return err
	}
	if err = addMetadataRetrieverMiddleware(stack); err != nil {
		return err
	}
	if err = addPutBucketAclInputChecksumMiddlewares(stack, options); err != nil {
		return err
	}
	if err = addPutBucketAclUpdateEndpoint(stack, options); err != nil {
		return err
	}
	if err = addResponseErrorMiddleware(stack); err != nil {
		return err
	}
	if err = v4.AddContentSHA256HeaderMiddleware(stack); err != nil {
		return err
	}
	if err = disableAcceptEncodingGzip(stack); err != nil {
		return err
	}
	if err = addRequestResponseLogging(stack, options); err != nil {
		return err
	}
	return nil
}

func newServiceMetadataMiddleware_opPutBucketAcl(region string) *awsmiddleware.RegisterServiceMetadata {
	return &awsmiddleware.RegisterServiceMetadata{
		Region:        region,
		ServiceID:     ServiceID,
		SigningName:   "s3",
		OperationName: "PutBucketAcl",
	}
}

// getPutBucketAclRequestAlgorithmMember gets the request checksum algorithm value
// provided as input.
func getPutBucketAclRequestAlgorithmMember(input interface{}) (string, bool) {
	in := input.(*PutBucketAclInput)
	if len(in.ChecksumAlgorithm) == 0 {
		return "", false
	}
	return string(in.ChecksumAlgorithm), true
}

func addPutBucketAclInputChecksumMiddlewares(stack *middleware.Stack, options Options) error {
	return internalChecksum.AddInputMiddleware(stack, internalChecksum.InputMiddlewareOptions{
		GetAlgorithm:                     getPutBucketAclRequestAlgorithmMember,
		RequireChecksum:                  true,
		EnableTrailingChecksum:           false,
		EnableComputeSHA256PayloadHash:   true,
		EnableDecodedContentLengthHeader: true,
	})
}

// getPutBucketAclBucketMember returns a pointer to string denoting a provided
// bucket member valueand a boolean indicating if the input has a modeled bucket
// name,
func getPutBucketAclBucketMember(input interface{}) (*string, bool) {
	in := input.(*PutBucketAclInput)
	if in.Bucket == nil {
		return nil, false
	}
	return in.Bucket, true
}
func addPutBucketAclUpdateEndpoint(stack *middleware.Stack, options Options) error {
	return s3cust.UpdateEndpoint(stack, s3cust.UpdateEndpointOptions{
		Accessor: s3cust.UpdateEndpointParameterAccessor{
			GetBucketFromInput: getPutBucketAclBucketMember,
		},
		UsePathStyle:                   options.UsePathStyle,
		UseAccelerate:                  options.UseAccelerate,
		SupportsAccelerate:             true,
		TargetS3ObjectLambda:           false,
		EndpointResolver:               options.EndpointResolver,
		EndpointResolverOptions:        options.EndpointOptions,
		UseARNRegion:                   options.UseARNRegion,
		DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints,
	})
}


text:
import abc

import six

from taskflow.utils import reflection

@six.add_metaclass(abc.ABCMeta)
class Flow(object):
    """The base abstract class of all flow implementations.

    A flow is a structure that defines relationships between tasks. You can
    add tasks and other flows (as subflows) to the flow, and the flow provides
    a way to implicitly or explicitly define how they are interdependent.
    Exact structure of the relationships is defined by concrete
    implementation, while this class defines common interface and adds
    human-readable (not necessary unique) name.

    NOTE(harlowja): if a flow is placed in another flow as a subflow, a desired
    way to compose flows together, then it is valid and permissible that during
    execution the subflow & parent flow may be flattened into a new flow. Since
    a flow is just a 'structuring' concept this is typically a behavior that
    should not be worried about (as it is not visible to the user), but it is
    worth mentioning here.

    Flows are expected to provide the following methods/properties:

    - add
    - __len__
    - requires
    - provides
    """

    def __init__(self, name):
        self._name = str(name)

    @property
    def name(self):
        """A non-unique name for this flow (human readable)."""
        return self._name

    @abc.abstractmethod
    def __len__(self):
        """Returns how many items are in this flow."""

    def __str__(self):
        lines = ["%s: %s" % (reflection.get_class_name(self), self.name)]
        lines.append("%s" % (len(self)))
        return "; ".join(lines)

    @abc.abstractmethod
    def add(self, *items):
        """Adds a given item/items to this flow."""

    @abc.abstractproperty
    def requires(self):
        """Browse argument requirement names this flow requires to run."""

    @abc.abstractproperty
    def provides(self):
        """Browse argument names provided by the flow."""


text:
'''
The query Console is used to read the query input, show query results and display error information

@author: keshan
'''

import os
import psycopg2
import time
from Tkinter import * #GUI package

from pylsy import pylsytable #for print table

import GraphProcessor
from GraphProcessor import statGraphProcessor
from QueryParser import queryParser

#starts to execute the input query
def executeQuery(connection, cursor, commandToExecute, query_Result_Text):
    lowerCaseCommand = commandToExecute.lower()

    #graph query contains rank, cluster and path operation
    if ("rank" in lowerCaseCommand) or ("cluster" in lowerCaseCommand) or ("path" in lowerCaseCommand):
        newExecuteCommand = queryParser.graphQueryManipulationAnalyzer(commandToExecute, connection, cursor)
        cursor.execute(newExecuteCommand[:]) #remove the first space
        printResult(connection, cursor, query_Result_Text)

    #query about creating or dropping a materialised graph
    elif ("create" in lowerCaseCommand or "drop" in lowerCaseCommand) and ("undirgraph" in lowerCaseCommand or "dirgraph" in lowerCaseCommand):
        newExecuteCommand = GraphProcessor.statGraphProcessor.processStatGraphCommand(commandToExecute, connection, cursor)
        cursor.execute(newExecuteCommand[:]) #remove the first space
        connection.commit()
        query_Result_Text.insert(INSERT, "Graph Manipulation is Done")
        query_Result_Text.config(state=DISABLED)

    #normal relational query without any graph functions
    else:
        #print commandToExecute[:]
        cursor.execute(commandToExecute[:])  #remove the first space
        printResult(connection, cursor, query_Result_Text)

#prints results of query execution
def printResult(connection, cursor, query_Result_Text):
    print "Results Printing"
    if(cursor.description == None):
        connection.commit()
        query_Result_Text.insert(INSERT, cursor.statusmessage)
    else:
        tabcolnames = [description[0] for description in cursor.description]
        table = pylsytable(tabcolnames)
        rows = cursor.fetchall()
        tabcol_index = 0
        row_num = 0
        for i in rows:
            row_num += 1
            for each in i:
                print str(each) + '\t',
                table.append_data(tabcolnames[tabcol_index], str(each))
                tabcol_index += 1
            print
            tabcol_index = 0

            #printing large result set using pylsytable problem is solved
            if row_num == 100:  #a new table is created to print for every 100lines
                query_Result_Text.insert(INSERT, table)
                row_num = 0
                table = pylsytable(tabcolnames)

        if row_num != 0:
            query_Result_Text.insert(INSERT, table)
        connection.commit()
        query_Result_Text.config(state=DISABLED)

#This function initiates the query console process
def start(input_Query, result_Panel_Text):

    homeDirectory = os.environ['HOME']
    dynamicDirectory = "/dev/shm"

    #folder creation where materialized graphs get created
    if os.path.exists(homeDirectory + "/IRG_Stat_Graph") == False:
        os.mkdir(homeDirectory + "/IRG_Stat_Graph")
    #folder creation where dynamic graphs get created and manipulated
    if os.path.exists(dynamicDirectory + "/IRG_Tmp_Graph") == False:
        os.mkdir(dynamicDirectory + "/IRG_Tmp_Graph")

    #Here is connect to your PostgreSQL
    db = "heft"
    dbUser = "keshan"
    dbPort = 5432
    connection = psycopg2.connect(database=db, user=dbUser, port=dbPort)
    cursor = connection.cursor()

    result_Panel_Text.config(state=NORMAL)
    start_time = time.time()
    try:
        executeQuery(connection, cursor, input_Query, result_Panel_Text)
        print "Total query time is: ", (time.time() - start_time)
        os.system("rm -fr /dev/shm/IRG_Tmp_Graph/*")  #This clears graphs created on-the-fly
        queryParser.graphQueryWithResult.clear()  #clear the dictionary of parser's for result table names and graph sub-queries
    except psycopg2.ProgrammingError as reason:
        result_Panel_Text.insert(INSERT, str(reason))
        result_Panel_Text.config(state=DISABLED)
    except psycopg2.DataError as reason:
        result_Panel_Text.insert(INSERT, str(reason))
        result_Panel_Text.config(state=DISABLED)
    except psycopg2.DatabaseError as reason:
        result_Panel_Text.insert(INSERT, str(reason))
        result_Panel_Text.config(state=DISABLED)
    finally:
        cursor.close()
        connection.close()


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="generator" content="Source Themes Academia 4.3.1">
  <meta name="generator" content="Hugo 0.74.0" />

  <meta name="author" content="Athanassios I. Hatzis, PhD">

  <meta name="description" content="Table of Contents  Introduction Business vs Technological Factors Cross-References   Introduction I was motivated to write this post from an article of Christian Kaul “Bridging the Knowledge Gap”. He is making questions about how, what is the best way to bridge the knowledge gap between data modeling experts and people from other fields ? But I think an important role that data modeling experts play is exactly that to bridge the gap between pure IT technical people like developers, database administrators, data engineers and people from other fields e.">

  <link rel="alternate" hreflang="en-us" href="https://healis.eu/en/post/20190615/">

  <meta name="theme-color" content="hsl(339, 90%, 68%)">

    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/academicons/1.8.6/css/academicons.min.css" integrity="sha256-uFVgMKfistnJAfoCUQigIl+JfUaP47GrRKjf6CTPVmw=" crossorigin="anonymous">
    <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.0/css/all.css" integrity="sha384-aOkxzJ5uQz7WBObEZcHvV5JvRW3TUc2rNPA7pe3AwnsUohiw1Vj2Rgx2KSOkF5+h" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.2.5/jquery.fancybox.min.css" integrity="sha256-ygkqlh3CYSUri3LhQxzdcm0n1EQvH2Y+U5S2idbLtxs=" crossorigin="anonymous">

        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.15.6/styles/gruvbox-dark.min.css" crossorigin="anonymous" title="hl-light">
        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.15.6/styles/gruvbox-dark.min.css" crossorigin="anonymous" title="hl-dark" disabled>

  <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato:400,700|Open+Sans|Roboto+Mono&display=swap">

  <link rel="stylesheet" href="/css/academia.min.4e3b2f408b00c06405993e164c128cb2.css">

  <link rel="manifest" href="/site.webmanifest">
  <link rel="icon" type="image/png" href="/img/icon.png">
  <link rel="apple-touch-icon" type="image/png" href="/img/icon-192.png">

  <link rel="canonical" href="https://healis.eu/en/post/20190615/">

  <meta property="twitter:card" content="summary_large_image">

  <meta property="twitter:site" content="@healiseu">
  <meta property="twitter:creator" content="@healiseu">

  <meta property="og:site_name" content="HEALIS">
  <meta property="og:url" content="https://healis.eu/en/post/20190615/">
  <meta property="og:title" content="Where is the gap in data modeling ? | HEALIS">
  <meta property="og:description" content="Table of Contents  Introduction Business vs Technological Factors Cross-References   Introduction I was motivated to write this post from an article of Christian Kaul “Bridging the Knowledge Gap”. He is making questions about how, what is the best way to bridge the knowledge gap between data modeling experts and people from other fields ? But I think an important role that data modeling experts play is exactly that to bridge the gap between pure IT technical people like developers, database administrators, data engineers and people from other fields e."><meta property="og:image" content="https://healis.eu/en/post/20190615/featured.jpeg">
  <meta property="twitter:image" content="https://healis.eu/en/post/20190615/featured.jpeg"><meta property="og:locale" content="en-us">

  <meta property="article:published_time" content="2019-06-15T00:00:00+00:00">

  <meta property="article:modified_time" content="2019-06-15T00:00:00+00:00">

  <title>Where is the gap in data modeling ? | HEALIS</title>

Search

        <input name="q" id="search-query" placeholder="Search..." autocapitalize="off"
        autocomplete="off" autocorrect="off" role="textbox" spellcheck="false" type="search">

      <button type="button" class="navbar-toggler" data-toggle="collapse" data-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
      </button>

          Home

          About

          HyperMorph

          S3DM

          Projects

          Posts

          Talks

          Terms

          Contact

Where is the gap in data modeling ?

<meta content="2019-06-15 00:00:00 +0000 UTC" itemprop="datePublished">
<meta content="2019-06-15 00:00:00 +0000 UTC" itemprop="dateModified">

  Athanassios I. Hatzis, PhD

    <time>2019-06-15</time>

    3 min read

    Semantic_Web

    Project

Table of Contents

Introduction

Business vs Technological Factors

Cross-References

Introduction

I was motivated to write this post from an article of Christian Kaul “Bridging the Knowledge Gap”. He is making questions about how, what is the best way to bridge the knowledge gap between data modeling experts and people from other fields ? But I think an important role that data modeling experts play is exactly that to bridge the gap between pure IT technical people like developers, database administrators, data engineers and people from other fields e.g. domain experts, scientists, business people, etc. A more interesting question in my opinion is how this gap is created. Get prepared because I will answer with more questions:

Do we all agree that the best way to model data-information is to create a graph ?

If yes the next question is how exactly you represent that graph ? As you probably know there are four major competing data models, (relational model - ER, labeled property graph, RDF and Topic Maps), Are you convinced that there can be no other better alternative ?

What about the building blocks, for example in RDF you have triples, in relational you have relations (tables) and tuples. Is that all ? Can we make better building blocks to connect data or information ?

And last but not least, at a physical layer, and I believe that is exactly where the gap lies between pure data modelers/architects and database engineers/developers, you have row, column, document, native graph structures. Are you totally convinced that the best way to physically implement a graph data-information model is with a native graph structure on permanent storage ?

If you ask me to answer these questions I suggest you read more information about S3DM/R3DM conceptual, computational semiotics framework and the related projects HyperMorph and TRIADB. This is what I have been involved with for the last ten years.

The nice thing with social media is that if you deserve to get some good feedback from professionals and experts of the field in a post like this one you might decide to extend it. That’s exactly what I did in the following few paragraphs to respond in a better way to comments in my post._

Business vs Technological Factors

I believe the resurgence of no-SQL movement (2009), which is highly related to data modeling, started out of the emergent need of companies-users to deal with the velocity, volume, variety and other properties of distributed data resources. That same movement pushed forward our technological boundaries to create better DBMS and BI, web/desktop applications.

Personally speaking I joined that movement because of my business need to manage complex medical databases. Another reason was to enrich and manage collectively and efficiently my own data resources, i.e. personal information management. Believe it or not I am still not satisfied from what exists out there and that is why I ended up researching and developing my own solution.

Apparently another critical factor has to do purely with the cost of a solution you apply to a complex data/information management problem. That is also why open-source based systems are becoming more and more popular nowadays. We need bulletproof, open-source tools with strong communities behind to support, develop and test them. Do consider also that in many cases open-source is an escape from the high cost cloud solutions and corresponding vendor-locking mechanisms.

Eventually, somehow, sometime something similar to a Linux OS, will be created for information management at a higher level. Something that will earn the consensus of developers, end users and companies emerging out of practical need for a new data modeling standard, for effective physical layer implementation, highly responsive graphical user interfaces and efficient augmented artificial intelligence tools.

Cross-References

LinkedIn - Published Post

  Abstraction_(software_engineering)

  Information

  Data_model

  Semantics

  Database

  Database_management_system

  Graph_database

  associative_semiotic_hypergraph

  Computational_semiotics

  Associative_entity

  Associative_model_of_data

  Association_(object-oriented_programming)

  Associative_array

  Query_language

  Query_by_Example

  Relational_algebra

Athanassios I. Hatzis, PhD

Software Engineer - Researcher, Founder/Independent Contractor

Related

Yet another query language, really ?

Data Modelling Topologies of a Graph Database

A Quick Guide on How to Prevail in the Graph Database Arena

Why Google shuts down Freebase ?

Atomic Information Resource (AIR)

          © HEALIS - Athanassios I. Hatzis, 2020 ·
          Powered by
          themefisher for
          Hugo.

Cite

        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          ×
        </button>

           Copy

           Download


text:
Steps to migrate code that uses Azure Management Libraries for .NET from 1.8 to 1.9 ...

> If this note missed any breaking changes, please open a pull request.

V1.9 is backwards compatible with V1.6 in the APIs intended for public use that reached the general availability (stable) stage in V1.x with a few exceptions in the SQL management library (though these changes will have minimal impact on the developer).

Some breaking changes were introduced in APIs that were still in Beta in V1.8, as indicated by their inheritance from the `IBeta` interface.

## Breaking changes

The following methods and/or types have been changed in V1.9 compared to the previous release (V1.8):

    Area/Model
    In V1.8
    In V1.9
    Remarks
    Ref

    Authentication flow
    Credentials property of RestClient class was of type ServiceClientCredentials
    Credentials property of RestClient class is now of typeAzureCredentials
    AzureCredentials has a new constructor that accepts ServiceClientCredentials parameter. This will enable handling authentication process outside Fluent SDK framework and using acuired token during Fluent SDK communication by passing in ServiceClientCredentials
    PR #195

    NetworkWatcher
    .GetTopology(string targetResourceGroup)
    .Topology().WithTargetResourceGroup(string resourceGroupName).WithTargetNetwork(string networkId).WithTargetSubnet(string subnetName).Execute() where WithTargetNetwork() and WithTargetSubnet() are optional

    PR #267

    NetworkWatcher
    .GetTopologyAsync(string targetResourceGroup)
    .Topology().WithTargetResourceGroup(string resourceGroupName).WithTargetNetwork(string networkId).WithTargetSubnet(string subnetName).ExecuteAsync() where WithTargetNetwork() and WithTargetSubnet() are optional

    PR #267

    VerificationIPFlow
    .WithProtocol(Protocol protocol)
    .WithProtocol(IpFlowProtocol)
    Updated to the latest swagger specs
    PR #267

    ExpressRouteCircuitPeering
    ExpressRouteCircuitPeeringType PeeringType
    ExpressRoutePeeringType PeeringType
    Property type changed.
    PR #267

    ExpressRouteCircuitPeering
    ExpressRouteCircuitPeeringState State
    ExpressRoutePeeringState State
    Property type changed.
    PR #267

    ExpressRouteCircuitPeering
    int PeerAsn
    long PeerAsn
    Property type changed.
    PR #267

    NetworkPeering
    NetworkPeeringState State
    VirtualNetworkPeeringState State
    Property type changed.
    PR #267

## Deprecated API's ##

    Area/Model
    In V1.8
    In V1.9
    Remarks
    Ref

    Redis Cache
    Update.WithSubnet(HasId networkResource, string subnetName)
    Deprecated
    Subnet configuration cannot be changed on existing Redis Cache instance.
    PR #240

    Redis Cache
    Update.WithStaticIP(string staticIP)
    Deprecated
    Static IP configuration cannot be changed on existing Redis Cache instance.
    PR #240


text:
layout: post
date: '2015-11-26'
title: "Wtoo by Watters Kendra 15529 Sheath Wedding Dress"
category: Wtoo by Watters
tags: [Wtoo by Watters]
---
### Wtoo by Watters Kendra 15529 Sheath Wedding Dress
Just **$334.99**
###

A modern classic, this shimmer taffeta strapless ball gown features a sweetheart neckline, twist front ruching, side pockets and a crystal beaded belt (included). Belt also sold separately as style 15900. Chapel train.

Photographed in: Ivory

Buy it: [https://www.eudances.com/en/wtoo-by-watters/3983-wtoo-by-watters-kendra-15529-sheath-wedding-dress.html](https://www.eudances.com/en/wtoo-by-watters/3983-wtoo-by-watters-kendra-15529-sheath-wedding-dress.html)


text:
#ifndef FWSIGNAL_H_
#define FWSIGNAL_H_

int brcmf_fws_init(struct brcmf_pub *drvr);
void brcmf_fws_deinit(struct brcmf_pub *drvr);
bool brcmf_fws_fc_active(struct brcmf_fws_info *fws);
int brcmf_fws_hdrpull(struct brcmf_pub *drvr, int ifidx, s16 signal_len,
		      struct sk_buff *skb);
int brcmf_fws_process_skb(struct brcmf_if *ifp, struct sk_buff *skb);

void brcmf_fws_reset_interface(struct brcmf_if *ifp);
void brcmf_fws_add_interface(struct brcmf_if *ifp);
void brcmf_fws_del_interface(struct brcmf_if *ifp);
void brcmf_fws_bustxfail(struct brcmf_fws_info *fws, struct sk_buff *skb);

#endif /* FWSIGNAL_H_ */


text:
package com.framework.concurrent.countdownlatch;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class Coach {

    private void sayStartDM() {
        System.out.println("教练说开始点名。。。");
        OrderController.coachSayDM_start.countDown();
    }

    private void sayStartGame() throws InterruptedException {

        OrderController.teamMemberRaiseHand_start.await();
        System.out.println("教练说开始游戏。。。");
        OrderController.coachSayGameStart.countDown();
    }

    private void sayEndDM() throws InterruptedException {

        OrderController.teamMemberGame.await();
        System.out.println("教练说开始点名。。。");
        OrderController.coachSayDM_end.countDown();
    }

    /**
     * @param args
     * @throws InterruptedException
     */
    public static void main(String[] args) throws InterruptedException {
        Coach coach = new Coach();
        ExecutorService service = Executors.newFixedThreadPool(10);

        for (int i=1; i <= AssignNumber.getTotalNumbers(); i++) {
            try {
                service.execute(new TeamMember("SEA++_"+i, "ECE"));
            } catch (Exception e) {
                System.out.println("exc: " + i);
                e.printStackTrace();
            }
        }

        coach.sayStartDM();

        coach.sayStartGame();

        coach.sayEndDM();

        service.shutdown();
    }

}


text:
typedef struct {
  pthread_t threads[LAZYFREE_NUM_THREADS];
  pthread_mutex_t mutex;
  pthread_cond_t cond;
  list *objs;
} lazyfreeThreads;

static void *lazyfreeThreadMain(void *args) {
  lazyfreeThreads *p = args;
  while (1) {
    pthread_mutex_lock(&p->mutex);
    while (listLength(p->objs) == 0) {
      pthread_cond_wait(&p->cond, &p->mutex);
    }
    listNode *head = listFirst(p->objs);
    robj *o = listNodeValue(head);
    listDelNode(p->objs, head);
    pthread_mutex_unlock(&p->mutex);
    serverAssert(o->refcount == 1);
    decrRefCount(o);
  }
  return NULL;
}

static lazyfreeThreads *createLazyfreeThreads(void) {
  lazyfreeThreads *p = zmalloc(sizeof(*p));
  pthread_mutex_init(&p->mutex, NULL);
  pthread_cond_init(&p->cond, NULL);
  p->objs = listCreate();
  for (int i = 0; i < LAZYFREE_NUM_THREADS; i++) {
    int ret = pthread_create(&p->threads[i], NULL, lazyfreeThreadMain, p);
    if (ret != 0) {
      serverPanic("Can't create Lazyfree Threads-[%d] [%d].", i, ret);
    }
  }
  return p;
}

static lazyfreeThreads *lazyfree_threads = NULL;

void initLazyfreeThreads() { lazyfree_threads = createLazyfreeThreads(); }

void decrRefCountByLazyfreeThreads(robj *o) {
  serverAssert(o->refcount == 1 && lazyfree_threads != NULL);
  lazyfreeThreads *p = lazyfree_threads;
  pthread_mutex_lock(&p->mutex);
  if (listLength(p->objs) == 0) {
    pthread_cond_signal(&p->cond);
  }
  listAddNodeTail(p->objs, o);
  pthread_mutex_unlock(&p->mutex);
}

size_t lazyfreeObjectGetFreeEffort(robj *o) {
  if (o->refcount == 1 && lazyfree_threads != NULL) {
    switch (o->type) {
    case OBJ_LIST:
      if (o->encoding == OBJ_ENCODING_QUICKLIST) {
        return listTypeLength(o);
      }
      return 0;
    case OBJ_HASH:
      if (o->encoding == OBJ_ENCODING_HT) {
        return hashTypeLength(o) * 2;
      }
      return 0;
    case OBJ_SET:
      if (o->encoding == OBJ_ENCODING_HT) {
        return setTypeSize(o);
      }
      return 0;
    case OBJ_ZSET:
      if (o->encoding == OBJ_ENCODING_SKIPLIST) {
        return zsetLength(o) * 2;
      }
      return 0;
    }
  }
  return 0;
}


text:
package io.netty.handler.codec.http2;

import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandler;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.DefaultChannelId;
import io.netty.channel.ServerChannel;
import io.netty.channel.embedded.EmbeddedChannel;
import io.netty.handler.codec.http.DefaultFullHttpRequest;
import io.netty.handler.codec.http.DefaultHttpHeaders;
import io.netty.handler.codec.http.FullHttpRequest;
import io.netty.handler.codec.http.HttpHeaderNames;
import io.netty.handler.codec.http.HttpMethod;
import io.netty.handler.codec.http.HttpVersion;

import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;

import org.junit.Test;
import org.mockito.Mockito;

public class Http2ServerUpgradeCodecTest {

    @Test
    public void testUpgradeToHttp2ConnectionHandler() {
        testUpgrade(new Http2ConnectionHandlerBuilder().frameListener(new Http2FrameAdapter()).build(), null);
    }

    @Test
    public void testUpgradeToHttp2FrameCodec() {
        testUpgrade(new Http2FrameCodecBuilder(true).build(), null);
    }

    @Test
    public void testUpgradeToHttp2MultiplexCodec() {
        testUpgrade(new Http2MultiplexCodecBuilder(true, new HttpInboundHandler()).build(), null);
    }

    @Test
    public void testUpgradeToHttp2FrameCodecWithMultiplexer() {
        testUpgrade(new Http2FrameCodecBuilder(true).build(),
                new Http2MultiplexHandler(new HttpInboundHandler()));
    }

    private static void testUpgrade(Http2ConnectionHandler handler, ChannelHandler multiplexer) {
        FullHttpRequest request = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.OPTIONS, "*");
        request.headers().set(HttpHeaderNames.HOST, "netty.io");
        request.headers().set(HttpHeaderNames.CONNECTION, "Upgrade, HTTP2-Settings");
        request.headers().set(HttpHeaderNames.UPGRADE, "h2c");
        request.headers().set("HTTP2-Settings", "AAMAAABkAAQAAP__");

        ServerChannel parent = Mockito.mock(ServerChannel.class);
        EmbeddedChannel channel = new EmbeddedChannel(parent, DefaultChannelId.newInstance(), true, false,
                new ChannelHandler() { });
        ChannelHandlerContext ctx = channel.pipeline().firstContext();
        Http2ServerUpgradeCodec codec;
        if (multiplexer == null) {
            codec = new Http2ServerUpgradeCodec(handler);
        } else {
            codec = new Http2ServerUpgradeCodec((Http2FrameCodec) handler, multiplexer);
        }
        channel.eventLoop().execute(() -> {
            assertTrue(codec.prepareUpgradeResponse(ctx, request, new DefaultHttpHeaders()));
            codec.upgradeTo(ctx, request);
        });

        // Flush the channel to ensure we write out all buffered data
        channel.flush();

        channel.writeInbound(Http2CodecUtil.connectionPrefaceBuf());
        Http2FrameInboundWriter writer = new Http2FrameInboundWriter(channel);
        writer.writeInboundSettings(new Http2Settings());
        writer.writeInboundRstStream(Http2CodecUtil.HTTP_UPGRADE_STREAM_ID, Http2Error.CANCEL.code());

        assertSame(handler, channel.pipeline().remove(handler.getClass()));
        assertNull(channel.pipeline().get(handler.getClass()));
        assertTrue(channel.finish());

        // Check that the preface was send (a.k.a the settings frame)
        ByteBuf settingsBuffer = channel.readOutbound();
        assertNotNull(settingsBuffer);
        settingsBuffer.release();

        ByteBuf buf = channel.readOutbound();
        assertNotNull(buf);
        buf.release();

        assertNull(channel.readOutbound());
    }

    @ChannelHandler.Sharable
    private static final class HttpInboundHandler implements ChannelHandler { }
}


text:
from typing import Any, Dict

from marshmallow import fields, post_load

from azure.ai.ml._restclient.v2022_05_01.models import DatastoreType
from azure.ai.ml._schema.core.fields import NestedField, PathAwareSchema, StringTransformedEnum, UnionField
from azure.ai.ml._utils.utils import camel_to_snake

from .credentials import (
    AccountKeySchema,
    CertificateSchema,
    NoneCredentialsSchema,
    SasTokenSchema,
    ServicePrincipalSchema,
)

class AzureStorageSchema(PathAwareSchema):
    name = fields.Str(required=True)
    id = fields.Str(dump_only=True)
    account_name = fields.Str(required=True)
    endpoint = fields.Str()
    protocol = fields.Str()
    description = fields.Str()
    tags = fields.Dict(keys=fields.Str(), values=fields.Str())

class AzureFileSchema(AzureStorageSchema):
    type = StringTransformedEnum(
        allowed_values=DatastoreType.AZURE_FILE,
        casing_transform=camel_to_snake,
        required=True,
    )
    file_share_name = fields.Str(required=True)
    credentials = UnionField(
        [
            NestedField(AccountKeySchema),
            NestedField(SasTokenSchema),
        ],
        required=True,
    )

    @post_load
    def make(self, data: Dict[str, Any], **kwargs) -> "AzureFileDatastore":
        from azure.ai.ml.entities import AzureFileDatastore

        return AzureFileDatastore(**data)

class AzureBlobSchema(AzureStorageSchema):
    type = StringTransformedEnum(
        allowed_values=DatastoreType.AZURE_BLOB,
        casing_transform=camel_to_snake,
        required=True,
    )
    container_name = fields.Str(required=True)
    credentials = UnionField(
        [
            NestedField(AccountKeySchema),
            NestedField(SasTokenSchema),
            NestedField(NoneCredentialsSchema),
        ],
    )

    @post_load
    def make(self, data: Dict[str, Any], **kwargs) -> "AzureBlobDatastore":
        from azure.ai.ml.entities import AzureBlobDatastore

        return AzureBlobDatastore(**data)

class AzureDataLakeGen2Schema(AzureStorageSchema):
    type = StringTransformedEnum(
        allowed_values=DatastoreType.AZURE_DATA_LAKE_GEN2,
        casing_transform=camel_to_snake,
        required=True,
    )
    filesystem = fields.Str(required=True)
    credentials = UnionField(
        [
            NestedField(ServicePrincipalSchema),
            NestedField(CertificateSchema),
            NestedField(NoneCredentialsSchema),
        ]
    )

    @post_load
    def make(self, data: Dict[str, Any], **kwargs) -> "AzureDataLakeGen2Datastore":
        from azure.ai.ml.entities import AzureDataLakeGen2Datastore

        return AzureDataLakeGen2Datastore(**data)


text:
'use strict'; /* globals setImmediate, */

const { Writable, } = require('stream');

/**
 * Redirects writes to stdout and stderr to the port, so they can be logged by the native-ext lib
 * in the extensions console in the browser.
 * @param  {Port}  port  multiport/Port connected to the extension.
 */
module.exports = function({ channel, }) {
	const stream = name => new Writable({ write(chunk, encoding, callback) {
		if ((/^utf-?8$/i).test(encoding) && typeof chunk === 'string') { encoding = ''; }
		else if (encoding !== 'buffer') { chunk = global.Buffer.from(chunk, encoding); }
		if (typeof chunk !== 'string') { chunk = chunk.toString('base64'); }
		channel.postMessage([ name, 0, JSON.stringify([ encoding, chunk, ]), ]);
		callback && setImmediate(callback);
	}, decodeStrings: false, });
	const stdout = stream('stdout'), stderr = stream('stderr');

	// When the process is being `--inspect`ed, the functions of the global console are overwritten
	// and the arguments logged to the inspector before they are passed on tho the original global console.
	// Replacing the global console object would thus break the logging in the inspector.
	// The original console calls the public `.write()` methods on the original process.stdout/err streams,
	// so replacing those methods with the ones from the new streams prevents the console from actually writing to fd 1 or 2.
	// This should also help with all other (js) modules which already grabbed the original process.stdout/err.
	process.stdout.write = stdout.write.bind(stdout); Object.defineProperty(process, 'stdout', { value: stdout, });
	process.stderr.write = stderr.write.bind(stderr); Object.defineProperty(process, 'stderr', { value: stderr, });
};


text:
#import <Foundation/Foundation.h>

@interface DVTLineOffsetAwareStringWrapper : NSObject

@property(readonly, copy) NSString *string;

- (struct _NSRange)characterRangeFromDocumentLocation:(id)arg1;
- (id)convertLocationToUTF8EncodedLocation:(id)arg1;
- (id)convertLocationToNativeNSStringEncodedLocation:(id)arg1;
- (struct _NSRange)lineRangeForCharacterRange:(struct _NSRange)arg1;
- (struct _NSRange)characterRangeForLineRange:(struct _NSRange)arg1;
- (id)initWithString:(id)arg1;

@end