text:
' Licensed to the .NET Foundation under one or more agreements.
' The .NET Foundation licenses this file to you under the MIT license.
' See the LICENSE file in the project root for more information.

Imports Microsoft.CodeAnalysis.Text
Imports Microsoft.CodeAnalysis.VisualBasic.Symbols
Imports Microsoft.CodeAnalysis.VisualBasic.Syntax

Namespace Microsoft.CodeAnalysis.VisualBasic.Syntax

    Partial Public Class DirectiveTriviaSyntax

        Public Function GetRelatedDirectives() As List(Of DirectiveTriviaSyntax)
            Dim list = New List(Of DirectiveTriviaSyntax)()
            Me.GetRelatedDirectives(list)
            Return list
        End Function

        Private Sub GetRelatedDirectives(list As List(Of DirectiveTriviaSyntax))
            list.Clear()
            Dim p = Me.GetPreviousRelatedDirective()
            While p IsNot Nothing
                list.Add(p)
                p = p.GetPreviousRelatedDirective()
            End While

            list.Reverse()
            list.Add(Me)
            Dim n = Me.GetNextRelatedDirective()
            While n IsNot Nothing
                list.Add(n)
                n = n.GetNextRelatedDirective()
            End While
        End Sub

        Private Function GetNextRelatedDirective() As DirectiveTriviaSyntax
            Dim d As DirectiveTriviaSyntax = Me
            Select Case d.Kind
                Case SyntaxKind.IfDirectiveTrivia
                    While d IsNot Nothing
                        Select Case d.Kind
                            Case SyntaxKind.ElseIfDirectiveTrivia, SyntaxKind.ElseDirectiveTrivia, SyntaxKind.EndIfDirectiveTrivia
                                Return d
                        End Select

                        d = d.GetNextPossiblyRelatedDirective()
                    End While

                Case SyntaxKind.ElseIfDirectiveTrivia
                    While d IsNot Nothing
                        Select Case d.Kind
                            Case SyntaxKind.ElseDirectiveTrivia, SyntaxKind.EndIfDirectiveTrivia
                                Return d
                        End Select

                        d = d.GetNextPossiblyRelatedDirective()
                    End While

                Case SyntaxKind.ElseDirectiveTrivia
                    While d IsNot Nothing
                        If d.Kind = SyntaxKind.EndIfDirectiveTrivia Then
                            Return d
                        End If

                        d = d.GetNextPossiblyRelatedDirective()
                    End While

                Case SyntaxKind.RegionDirectiveTrivia
                    While d IsNot Nothing
                        If d.Kind = SyntaxKind.EndRegionDirectiveTrivia Then
                            Return d
                        End If

                        d = d.GetNextPossiblyRelatedDirective()
                    End While

            End Select

            Return Nothing
        End Function

        Private Function GetNextPossiblyRelatedDirective() As DirectiveTriviaSyntax
            Dim d As DirectiveTriviaSyntax = Me
            While d IsNot Nothing
                d = d.GetNextDirective()
                If d IsNot Nothing Then
                    Select Case d.Kind
                        Case SyntaxKind.IfDirectiveTrivia
                            While d IsNot Nothing AndAlso d.Kind <> SyntaxKind.EndIfDirectiveTrivia
                                d = d.GetNextRelatedDirective()
                            End While

                            Continue While
                        Case SyntaxKind.RegionDirectiveTrivia
                            While d IsNot Nothing AndAlso d.Kind <> SyntaxKind.EndRegionDirectiveTrivia
                                d = d.GetNextRelatedDirective()
                            End While

                            Continue While
                    End Select
                End If

                Return d
            End While

            Return Nothing
        End Function

        Private Function GetPreviousRelatedDirective() As DirectiveTriviaSyntax
            Dim d As DirectiveTriviaSyntax = Me
            Select Case d.Kind
                Case SyntaxKind.EndIfDirectiveTrivia
                    While d IsNot Nothing
                        Select Case d.Kind
                            Case SyntaxKind.IfDirectiveTrivia, SyntaxKind.ElseIfDirectiveTrivia, SyntaxKind.ElseDirectiveTrivia
                                Return d
                        End Select

                        d = d.GetPreviousPossiblyRelatedDirective()
                    End While

                Case SyntaxKind.ElseIfDirectiveTrivia
                    While d IsNot Nothing
                        If d.Kind = SyntaxKind.IfDirectiveTrivia Then
                            Return d
                        End If

                        d = d.GetPreviousPossiblyRelatedDirective()
                    End While

                Case SyntaxKind.ElseDirectiveTrivia
                    While d IsNot Nothing
                        Select Case d.Kind
                            Case SyntaxKind.IfDirectiveTrivia, SyntaxKind.ElseIfDirectiveTrivia
                                Return d
                        End Select

                        d = d.GetPreviousPossiblyRelatedDirective()
                    End While

                Case SyntaxKind.EndRegionDirectiveTrivia
                    While d IsNot Nothing
                        If d.Kind = SyntaxKind.RegionDirectiveTrivia Then
                            Return d
                        End If

                        d = d.GetPreviousPossiblyRelatedDirective()
                    End While

            End Select

            Return Nothing
        End Function

        Private Function GetPreviousPossiblyRelatedDirective() As DirectiveTriviaSyntax
            Dim d As DirectiveTriviaSyntax = Me
            While d IsNot Nothing
                d = d.GetPreviousDirective()
                If d IsNot Nothing Then
                    Select Case d.Kind
                        Case SyntaxKind.EndIfDirectiveTrivia
                            While d IsNot Nothing AndAlso d.Kind <> SyntaxKind.IfDirectiveTrivia
                                d = d.GetPreviousRelatedDirective()
                            End While

                            Continue While
                        Case SyntaxKind.EndRegionDirectiveTrivia
                            While d IsNot Nothing AndAlso d.Kind <> SyntaxKind.RegionDirectiveTrivia
                                d = d.GetPreviousRelatedDirective()
                            End While

                            Continue While
                    End Select
                End If

                Return d
            End While

            Return Nothing
        End Function

    End Class

End Namespace


text:
class Api::V1::TradeController < Api::V1::BaseController
  before_filter :auth_token

  expose(:user) { Token.get_tokenable(token) }
  expose(:projects) { Project.for_user(user) }

  def index
    render json: projects, each_serializer: Api::V1::TradeSerializer, root: 'projects'
  end

  private

  def auth_token
    deny_access unless token && user.present? && user.instance_of?(User)
  end

  def token
    params[:token]
  end
end

redpajama_set_name: RedPajamaGithub


text:
IMAGE_NAME="jboss/kie-server-showcase"
IMAGE_TAG="latest"

# Build the container image.
echo "Building the Docker container for $IMAGE_NAME:$IMAGE_TAG.."
docker build --rm -t $IMAGE_NAME:$IMAGE_TAG .
echo "Build done"


text:
<!DOCTYPE html>

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

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

        <title>MixItUp Demo - Sorting by Multiple Attributes</title>

            <button type="button" class="control" data-sort="published-date:desc name:asc">Desc</button>
            <button type="button" class="control" data-sort="published-date:asc name:asc">Asc</button>

Oscar

Charlie

Lima

Alpha

Mike

Zulu

Tango

Sierra

Bravo


text:
@extends('layouts.app')

@section('page_title')
    {{ trans('auth.register.register') }}
@endsection

@section('content')

{{ trans('auth.register.register') }}

                        <form class="form-horizontal" role="form" method="POST" action="{{ route('register') }}">
                            {{ csrf_field() }}

has('name') ? ' has-error' : '' }}">
                                {{ trans('auth.register.name') }}

                                    <input id="name" type="text" class="form-control" name="name" value="{{ old('name') }}" required autofocus>
                                    @if ($errors->has('name'))

                                            {{ $errors->first('name') }}

                                    @endif

has('email') ? ' has-error' : '' }}">
                                {{ trans('auth.register.email_address') }}

                                    <input id="email" type="email" class="form-control" name="email" value="{{ old('email') }}" required>
                                    @if ($errors->has('email'))

                                            {{ $errors->first('email') }}

                                    @endif

has('password') ? ' has-error' : '' }}">
                                {{ trans('auth.register.password') }}

                                    <input id="password" type="password" class="form-control" name="password" required>

                                    @if ($errors->has('password'))

                                        {{ $errors->first('password') }}

                                    @endif

                                {{ trans('auth.register.confirm_password') }}

                                    <input id="password-confirm" type="password" class="form-control" name="password_confirmation" required>

                                    <button type="submit" class="btn btn-primary">
                                        {{ trans('auth.register.register') }}
                                    </button>

                        </form>

@endsection


text:
/* ###
 * IP: GHIDRA
 *
 * 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 ghidra.app.plugin.core.decompile;

import java.util.function.Consumer;

import ghidra.app.services.*;
import ghidra.program.model.data.DataType;
import ghidra.program.model.listing.Program;
import ghidra.util.exception.CancelledException;
import ghidra.util.task.TaskMonitor;

/**
 * A simple spy to report when and how the finder service is called.
 */
public class StubDataTypeReferenceFinder implements DataTypeReferenceFinder {

	@Override
	public void findReferences(Program program, DataType dataType,
			Consumer<DataTypeReference> callback, TaskMonitor monitor) throws CancelledException {
		// stub
	}

	@Override
	public void findReferences(Program program, DataType dataType, String fieldName,
			Consumer<DataTypeReference> callback, TaskMonitor monitor) throws CancelledException {
		// stub
	}

	@Override
	public void findReferences(Program program, FieldMatcher fieldMatcher,
			Consumer<DataTypeReference> callback, TaskMonitor monitor) throws CancelledException {
		// stub
	}
}


text:
www.eric-vidal.com
==================

This project it the Octopress project for my personnal web site.
I've used the Boostrap theme that I have customized.


text:
package org.pentaho.di.trans.steps.parallelgzipcsv;

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

import org.apache.commons.vfs.FileObject;
import org.pentaho.di.core.CheckResult;
import org.pentaho.di.core.CheckResultInterface;
import org.pentaho.di.core.Const;
import org.pentaho.di.core.database.DatabaseMeta;
import org.pentaho.di.core.exception.KettleException;
import org.pentaho.di.core.exception.KettleStepException;
import org.pentaho.di.core.exception.KettleXMLException;
import org.pentaho.di.core.row.RowMetaInterface;
import org.pentaho.di.core.row.ValueMeta;
import org.pentaho.di.core.row.ValueMetaInterface;
import org.pentaho.di.core.row.value.ValueMetaFactory;
import org.pentaho.di.core.variables.VariableSpace;
import org.pentaho.di.core.vfs.KettleVFS;
import org.pentaho.di.core.xml.XMLHandler;
import org.pentaho.di.i18n.BaseMessages;
import org.pentaho.di.repository.ObjectId;
import org.pentaho.di.repository.Repository;
import org.pentaho.di.resource.ResourceDefinition;
import org.pentaho.di.resource.ResourceEntry;
import org.pentaho.di.resource.ResourceEntry.ResourceType;
import org.pentaho.di.resource.ResourceNamingInterface;
import org.pentaho.di.resource.ResourceReference;
import org.pentaho.di.trans.Trans;
import org.pentaho.di.trans.TransMeta;
import org.pentaho.di.trans.step.BaseStepMeta;
import org.pentaho.di.trans.step.StepDataInterface;
import org.pentaho.di.trans.step.StepInterface;
import org.pentaho.di.trans.step.StepMeta;
import org.pentaho.di.trans.step.StepMetaInjectionInterface;
import org.pentaho.di.trans.step.StepMetaInterface;
import org.pentaho.di.trans.steps.textfileinput.InputFileMetaInterface;
import org.pentaho.di.trans.steps.textfileinput.TextFileInputField;
import org.pentaho.di.trans.steps.textfileinput.TextFileInputMeta;
import org.pentaho.metastore.api.IMetaStore;
import org.w3c.dom.Node;

/**
 * @since 2009-03-06
 * @author matt
 * @version 3.2
 */

public class ParGzipCsvInputMeta extends BaseStepMeta implements StepMetaInterface, InputFileMetaInterface {
  private static Class<?> PKG = ParGzipCsvInputMeta.class; // for i18n purposes, needed by Translator2!!

  private String filename;

  private String filenameField;

  private boolean includingFilename;

  private String rowNumField;

  private boolean headerPresent;

  private String delimiter;
  private String enclosure;

  private String bufferSize;

  private boolean lazyConversionActive;

  private TextFileInputField[] inputFields;

  private boolean isaddresult;

  private boolean runningInParallel;

  private String encoding;

  public ParGzipCsvInputMeta() {
    super(); // allocate BaseStepMeta
    allocate( 0 );
  }

  public void loadXML( Node stepnode, List<DatabaseMeta> databases, IMetaStore metaStore )
    throws KettleXMLException {
    readData( stepnode );
  }

  public Object clone() {
    Object retval = super.clone();
    return retval;
  }

  public void setDefault() {
    delimiter = ",";
    enclosure = "\"";
    headerPresent = true;
    lazyConversionActive = true;
    isaddresult = false;
    bufferSize = "50000";
  }

  private void readData( Node stepnode ) throws KettleXMLException {
    try {
      filename = XMLHandler.getTagValue( stepnode, "filename" );
      filenameField = XMLHandler.getTagValue( stepnode, "filename_field" );
      rowNumField = XMLHandler.getTagValue( stepnode, "rownum_field" );
      includingFilename = "Y".equalsIgnoreCase( XMLHandler.getTagValue( stepnode, "include_filename" ) );
      delimiter = XMLHandler.getTagValue( stepnode, "separator" );
      enclosure = XMLHandler.getTagValue( stepnode, "enclosure" );
      bufferSize = XMLHandler.getTagValue( stepnode, "buffer_size" );
      headerPresent = "Y".equalsIgnoreCase( XMLHandler.getTagValue( stepnode, "header" ) );
      lazyConversionActive = "Y".equalsIgnoreCase( XMLHandler.getTagValue( stepnode, "lazy_conversion" ) );
      isaddresult = "Y".equalsIgnoreCase( XMLHandler.getTagValue( stepnode, "add_filename_result" ) );
      runningInParallel = "Y".equalsIgnoreCase( XMLHandler.getTagValue( stepnode, "parallel" ) );
      encoding = XMLHandler.getTagValue( stepnode, "encoding" );

      Node fields = XMLHandler.getSubNode( stepnode, "fields" );
      int nrfields = XMLHandler.countNodes( fields, "field" );

      allocate( nrfields );

      for ( int i = 0; i < nrfields; i++ ) {
        inputFields[i] = new TextFileInputField();

        Node fnode = XMLHandler.getSubNodeByNr( fields, "field", i );

        inputFields[i].setName( XMLHandler.getTagValue( fnode, "name" ) );
        inputFields[i].setType( ValueMeta.getType( XMLHandler.getTagValue( fnode, "type" ) ) );
        inputFields[i].setFormat( XMLHandler.getTagValue( fnode, "format" ) );
        inputFields[i].setCurrencySymbol( XMLHandler.getTagValue( fnode, "currency" ) );
        inputFields[i].setDecimalSymbol( XMLHandler.getTagValue( fnode, "decimal" ) );
        inputFields[i].setGroupSymbol( XMLHandler.getTagValue( fnode, "group" ) );
        inputFields[i].setLength( Const.toInt( XMLHandler.getTagValue( fnode, "length" ), -1 ) );
        inputFields[i].setPrecision( Const.toInt( XMLHandler.getTagValue( fnode, "precision" ), -1 ) );
        inputFields[i].setTrimType( ValueMeta.getTrimTypeByCode( XMLHandler.getTagValue( fnode, "trim_type" ) ) );
      }
    } catch ( Exception e ) {
      throw new KettleXMLException( "Unable to load step info from XML", e );
    }
  }

  public void allocate( int nrFields ) {
    inputFields = new TextFileInputField[nrFields];
  }

  public String getXML() {
    StringBuffer retval = new StringBuffer( 500 );

    retval.append( "    " ).append( XMLHandler.addTagValue( "filename", filename ) );
    retval.append( "    " ).append( XMLHandler.addTagValue( "filename_field", filenameField ) );
    retval.append( "    " ).append( XMLHandler.addTagValue( "rownum_field", rowNumField ) );
    retval.append( "    " ).append( XMLHandler.addTagValue( "include_filename", includingFilename ) );
    retval.append( "    " ).append( XMLHandler.addTagValue( "separator", delimiter ) );
    retval.append( "    " ).append( XMLHandler.addTagValue( "enclosure", enclosure ) );
    retval.append( "    " ).append( XMLHandler.addTagValue( "header", headerPresent ) );
    retval.append( "    " ).append( XMLHandler.addTagValue( "buffer_size", bufferSize ) );
    retval.append( "    " ).append( XMLHandler.addTagValue( "lazy_conversion", lazyConversionActive ) );
    retval.append( "    " ).append( XMLHandler.addTagValue( "add_filename_result", isaddresult ) );
    retval.append( "    " ).append( XMLHandler.addTagValue( "parallel", runningInParallel ) );
    retval.append( "    " ).append( XMLHandler.addTagValue( "encoding", encoding ) );

    retval.append( "    <fields>" ).append( Const.CR );
    for ( int i = 0; i < inputFields.length; i++ ) {
      TextFileInputField field = inputFields[i];

      retval.append( "      <field>" ).append( Const.CR );
      retval.append( "        " ).append( XMLHandler.addTagValue( "name", field.getName() ) );
      retval.append( "        " ).append(
        XMLHandler.addTagValue( "type", ValueMeta.getTypeDesc( field.getType() ) ) );
      retval.append( "        " ).append( XMLHandler.addTagValue( "format", field.getFormat() ) );
      retval.append( "        " ).append( XMLHandler.addTagValue( "currency", field.getCurrencySymbol() ) );
      retval.append( "        " ).append( XMLHandler.addTagValue( "decimal", field.getDecimalSymbol() ) );
      retval.append( "        " ).append( XMLHandler.addTagValue( "group", field.getGroupSymbol() ) );
      retval.append( "        " ).append( XMLHandler.addTagValue( "length", field.getLength() ) );
      retval.append( "        " ).append( XMLHandler.addTagValue( "precision", field.getPrecision() ) );
      retval.append( "        " ).append(
        XMLHandler.addTagValue( "trim_type", ValueMeta.getTrimTypeCode( field.getTrimType() ) ) );
      retval.append( "      </field>" ).append( Const.CR );
    }
    retval.append( "    </fields>" ).append( Const.CR );

    return retval.toString();
  }

  public void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases )
    throws KettleException {
    try {
      filename = rep.getStepAttributeString( id_step, "filename" );
      filenameField = rep.getStepAttributeString( id_step, "filename_field" );
      rowNumField = rep.getStepAttributeString( id_step, "rownum_field" );
      includingFilename = rep.getStepAttributeBoolean( id_step, "include_filename" );
      delimiter = rep.getStepAttributeString( id_step, "separator" );
      enclosure = rep.getStepAttributeString( id_step, "enclosure" );
      headerPresent = rep.getStepAttributeBoolean( id_step, "header" );
      bufferSize = rep.getStepAttributeString( id_step, "buffer_size" );
      lazyConversionActive = rep.getStepAttributeBoolean( id_step, "lazy_conversion" );
      isaddresult = rep.getStepAttributeBoolean( id_step, "add_filename_result" );
      runningInParallel = rep.getStepAttributeBoolean( id_step, "parallel" );
      encoding = rep.getStepAttributeString( id_step, "encoding" );

      int nrfields = rep.countNrStepAttributes( id_step, "field_name" );

      allocate( nrfields );

      for ( int i = 0; i < nrfields; i++ ) {
        inputFields[i] = new TextFileInputField();

        inputFields[i].setName( rep.getStepAttributeString( id_step, i, "field_name" ) );
        inputFields[i].setType( ValueMeta.getType( rep.getStepAttributeString( id_step, i, "field_type" ) ) );
        inputFields[i].setFormat( rep.getStepAttributeString( id_step, i, "field_format" ) );
        inputFields[i].setCurrencySymbol( rep.getStepAttributeString( id_step, i, "field_currency" ) );
        inputFields[i].setDecimalSymbol( rep.getStepAttributeString( id_step, i, "field_decimal" ) );
        inputFields[i].setGroupSymbol( rep.getStepAttributeString( id_step, i, "field_group" ) );
        inputFields[i].setLength( (int) rep.getStepAttributeInteger( id_step, i, "field_length" ) );
        inputFields[i].setPrecision( (int) rep.getStepAttributeInteger( id_step, i, "field_precision" ) );
        inputFields[i].setTrimType( ValueMeta.getTrimTypeByCode( rep.getStepAttributeString(
          id_step, i, "field_trim_type" ) ) );
      }
    } catch ( Exception e ) {
      throw new KettleException( "Unexpected error reading step information from the repository", e );
    }
  }

  public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step )
    throws KettleException {
    try {
      rep.saveStepAttribute( id_transformation, id_step, "filename", filename );
      rep.saveStepAttribute( id_transformation, id_step, "filename_field", filenameField );
      rep.saveStepAttribute( id_transformation, id_step, "rownum_field", rowNumField );
      rep.saveStepAttribute( id_transformation, id_step, "include_filename", includingFilename );
      rep.saveStepAttribute( id_transformation, id_step, "separator", delimiter );
      rep.saveStepAttribute( id_transformation, id_step, "enclosure", enclosure );
      rep.saveStepAttribute( id_transformation, id_step, "buffer_size", bufferSize );
      rep.saveStepAttribute( id_transformation, id_step, "header", headerPresent );
      rep.saveStepAttribute( id_transformation, id_step, "lazy_conversion", lazyConversionActive );
      rep.saveStepAttribute( id_transformation, id_step, "add_filename_result", isaddresult );
      rep.saveStepAttribute( id_transformation, id_step, "parallel", runningInParallel );
      rep.saveStepAttribute( id_transformation, id_step, "encoding", encoding );

      for ( int i = 0; i < inputFields.length; i++ ) {
        TextFileInputField field = inputFields[i];

        rep.saveStepAttribute( id_transformation, id_step, i, "field_name", field.getName() );
        rep.saveStepAttribute( id_transformation, id_step, i, "field_type", ValueMeta
          .getTypeDesc( field.getType() ) );
        rep.saveStepAttribute( id_transformation, id_step, i, "field_format", field.getFormat() );
        rep.saveStepAttribute( id_transformation, id_step, i, "field_currency", field.getCurrencySymbol() );
        rep.saveStepAttribute( id_transformation, id_step, i, "field_decimal", field.getDecimalSymbol() );
        rep.saveStepAttribute( id_transformation, id_step, i, "field_group", field.getGroupSymbol() );
        rep.saveStepAttribute( id_transformation, id_step, i, "field_length", field.getLength() );
        rep.saveStepAttribute( id_transformation, id_step, i, "field_precision", field.getPrecision() );
        rep.saveStepAttribute( id_transformation, id_step, i, "field_trim_type", ValueMeta.getTrimTypeCode( field
          .getTrimType() ) );
      }
    } catch ( Exception e ) {
      throw new KettleException( "Unable to save step information to the repository for id_step=" + id_step, e );
    }
  }

  public void getFields( RowMetaInterface rowMeta, String origin, RowMetaInterface[] info, StepMeta nextStep,
    VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException {
    try {
      rowMeta.clear(); // Start with a clean slate, eats the input

      for ( int i = 0; i < inputFields.length; i++ ) {
        TextFileInputField field = inputFields[i];

        ValueMetaInterface valueMeta = ValueMetaFactory.createValueMeta( field.getName(), field.getType() );
        valueMeta.setConversionMask( field.getFormat() );
        valueMeta.setLength( field.getLength() );
        valueMeta.setPrecision( field.getPrecision() );
        valueMeta.setConversionMask( field.getFormat() );
        valueMeta.setDecimalSymbol( field.getDecimalSymbol() );
        valueMeta.setGroupingSymbol( field.getGroupSymbol() );
        valueMeta.setCurrencySymbol( field.getCurrencySymbol() );
        valueMeta.setTrimType( field.getTrimType() );
        if ( lazyConversionActive ) {
          valueMeta.setStorageType( ValueMetaInterface.STORAGE_TYPE_BINARY_STRING );
        }
        valueMeta.setStringEncoding( space.environmentSubstitute( encoding ) );

        // In case we want to convert Strings...
        // Using a copy of the valueMeta object means that the inner and outer representation format is the same.
        // Preview will show the data the same way as we read it.
        // This layout is then taken further down the road by the metadata through the transformation.
        //
        ValueMetaInterface storageMetadata =
          ValueMetaFactory.cloneValueMeta( valueMeta, ValueMetaInterface.TYPE_STRING );
        storageMetadata.setStorageType( ValueMetaInterface.STORAGE_TYPE_NORMAL );
        storageMetadata.setLength( -1, -1 ); // we don't really know the lengths of the strings read in advance.
        valueMeta.setStorageMetadata( storageMetadata );

        valueMeta.setOrigin( origin );

        rowMeta.addValueMeta( valueMeta );
      }

      if ( !Const.isEmpty( filenameField ) && includingFilename ) {
        ValueMetaInterface filenameMeta = new ValueMeta( filenameField, ValueMetaInterface.TYPE_STRING );
        filenameMeta.setOrigin( origin );
        if ( lazyConversionActive ) {
          filenameMeta.setStorageType( ValueMetaInterface.STORAGE_TYPE_BINARY_STRING );
          filenameMeta.setStorageMetadata( new ValueMeta( filenameField, ValueMetaInterface.TYPE_STRING ) );
        }
        rowMeta.addValueMeta( filenameMeta );
      }

      if ( !Const.isEmpty( rowNumField ) ) {
        ValueMetaInterface rowNumMeta = new ValueMeta( rowNumField, ValueMetaInterface.TYPE_INTEGER );
        rowNumMeta.setLength( 10 );
        rowNumMeta.setOrigin( origin );
        rowMeta.addValueMeta( rowNumMeta );
      }
    } catch ( Exception e ) {
      throw new KettleStepException( e );
    }

  }

  public void check( List<CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepMeta,
    RowMetaInterface prev, String[] input, String[] output, RowMetaInterface info, VariableSpace space,
    Repository repository, IMetaStore metaStore ) {
    CheckResult cr;
    if ( prev == null || prev.size() == 0 ) {
      cr =
        new CheckResult( CheckResultInterface.TYPE_RESULT_OK, BaseMessages.getString(
          PKG, "ParGzipCsvInputMeta.CheckResult.NotReceivingFields" ), stepMeta );
      remarks.add( cr );
    } else {
      cr =
        new CheckResult( CheckResultInterface.TYPE_RESULT_ERROR, BaseMessages.getString(
          PKG, "ParGzipCsvInputMeta.CheckResult.StepRecevingData", prev.size() + "" ), stepMeta );
      remarks.add( cr );
    }

    // See if we have input streams leading to this step!
    if ( input.length > 0 ) {
      cr =
        new CheckResult( CheckResultInterface.TYPE_RESULT_ERROR, BaseMessages.getString(
          PKG, "ParGzipCsvInputMeta.CheckResult.StepRecevingData2" ), stepMeta );
      remarks.add( cr );
    } else {
      cr =
        new CheckResult( CheckResultInterface.TYPE_RESULT_OK, BaseMessages.getString(
          PKG, "ParGzipCsvInputMeta.CheckResult.NoInputReceivedFromOtherSteps" ), stepMeta );
      remarks.add( cr );
    }
  }

  public StepInterface getStep( StepMeta stepMeta, StepDataInterface stepDataInterface, int cnr, TransMeta tr,
    Trans trans ) {
    return new ParGzipCsvInput( stepMeta, stepDataInterface, cnr, tr, trans );
  }

  public StepDataInterface getStepData() {
    return new ParGzipCsvInputData();
  }

  /**
   * @return the delimiter
   */
  public String getDelimiter() {
    return delimiter;
  }

  /**
   * @param delimiter
   *          the delimiter to set
   */
  public void setDelimiter( String delimiter ) {
    this.delimiter = delimiter;
  }

  /**
   * @return the filename
   */
  public String getFilename() {
    return filename;
  }

  /**
   * @param filename
   *          the filename to set
   */
  public void setFilename( String filename ) {
    this.filename = filename;
  }

  /**
   * @return the bufferSize
   */
  public String getBufferSize() {
    return bufferSize;
  }

  /**
   * @param bufferSize
   *          the bufferSize to set
   */
  public void setBufferSize( String bufferSize ) {
    this.bufferSize = bufferSize;
  }

  /**
   * @return true if lazy conversion is turned on: conversions are delayed as long as possible, perhaps to never occur
   *         at all.
   */
  public boolean isLazyConversionActive() {
    return lazyConversionActive;
  }

  /**
   * @param lazyConversionActive
   *          true if lazy conversion is to be turned on: conversions are delayed as long as possible, perhaps to never
   *          occur at all.
   */
  public void setLazyConversionActive( boolean lazyConversionActive ) {
    this.lazyConversionActive = lazyConversionActive;
  }

  /**
   * @return the headerPresent
   */
  public boolean isHeaderPresent() {
    return headerPresent;
  }

  /**
   * @param headerPresent
   *          the headerPresent to set
   */
  public void setHeaderPresent( boolean headerPresent ) {
    this.headerPresent = headerPresent;
  }

  /**
   * @return the enclosure
   */
  public String getEnclosure() {
    return enclosure;
  }

  /**
   * @param enclosure
   *          the enclosure to set
   */
  public void setEnclosure( String enclosure ) {
    this.enclosure = enclosure;
  }

  @Override
  public List<ResourceReference> getResourceDependencies( TransMeta transMeta, StepMeta stepInfo ) {
    List<ResourceReference> references = new ArrayList<ResourceReference>( 5 );

    ResourceReference reference = new ResourceReference( stepInfo );
    references.add( reference );
    if ( !Const.isEmpty( filename ) ) {
      // Add the filename to the references, including a reference to this
      // step meta data.
      //
      reference.getEntries().add(
        new ResourceEntry( transMeta.environmentSubstitute( filename ), ResourceType.FILE ) );
    }
    return references;
  }

  /**
   * @return the inputFields
   */
  public TextFileInputField[] getInputFields() {
    return inputFields;
  }

  /**
   * @param inputFields
   *          the inputFields to set
   */
  public void setInputFields( TextFileInputField[] inputFields ) {
    this.inputFields = inputFields;
  }

  public int getFileFormatTypeNr() {
    return TextFileInputMeta.FILE_FORMAT_MIXED; // TODO: check this
  }

  public String[] getFilePaths( VariableSpace space ) {
    return new String[] { space.environmentSubstitute( filename ), };
  }

  public int getNrHeaderLines() {
    return 1;
  }

  public boolean hasHeader() {
    return isHeaderPresent();
  }

  public String getErrorCountField() {
    return null;
  }

  public String getErrorFieldsField() {
    return null;
  }

  public String getErrorTextField() {
    return null;
  }

  public String getEscapeCharacter() {
    return null;
  }

  public String getFileType() {
    return "CSV";
  }

  public String getSeparator() {
    return delimiter;
  }

  public boolean includeFilename() {
    return false;
  }

  public boolean includeRowNumber() {
    return false;
  }

  public boolean isErrorIgnored() {
    return false;
  }

  public boolean isErrorLineSkipped() {
    return false;
  }

  /**
   * @return the filenameField
   */
  public String getFilenameField() {
    return filenameField;
  }

  /**
   * @param filenameField
   *          the filenameField to set
   */
  public void setFilenameField( String filenameField ) {
    this.filenameField = filenameField;
  }

  /**
   * @return the includingFilename
   */
  public boolean isIncludingFilename() {
    return includingFilename;
  }

  /**
   * @param includingFilename
   *          the includingFilename to set
   */
  public void setIncludingFilename( boolean includingFilename ) {
    this.includingFilename = includingFilename;
  }

  /**
   * @return the rowNumField
   */
  public String getRowNumField() {
    return rowNumField;
  }

  /**
   * @param rowNumField
   *          the rowNumField to set
   */
  public void setRowNumField( String rowNumField ) {
    this.rowNumField = rowNumField;
  }

  /**
   * @param isaddresult
   *          The isaddresult to set.
   */
  public void setAddResultFile( boolean isaddresult ) {
    this.isaddresult = isaddresult;
  }

  /**
   * @return Returns isaddresult.
   */
  public boolean isAddResultFile() {
    return isaddresult;
  }

  /**
   * @return the runningInParallel
   */
  public boolean isRunningInParallel() {
    return runningInParallel;
  }

  /**
   * @param runningInParallel
   *          the runningInParallel to set
   */
  public void setRunningInParallel( boolean runningInParallel ) {
    this.runningInParallel = runningInParallel;
  }

  /**
   * @return the encoding
   */
  public String getEncoding() {
    return encoding;
  }

  /**
   * @param encoding
   *          the encoding to set
   */
  public void setEncoding( String encoding ) {
    this.encoding = encoding;
  }

  /**
   * Since the exported transformation that runs this will reside in a ZIP file, we can't reference files relatively. So
   * what this does is turn the name of files into absolute paths OR it simply includes the resource in the ZIP file.
   * For now, we'll simply turn it into an absolute path and pray that the file is on a shared drive or something like
   * that.
   *
   * @param space
   *          the variable space to use
   * @param definitions
   * @param resourceNamingInterface
   * @param repository
   *          The repository to optionally load other resources from (to be converted to XML)
   * @param metaStore
   *          the metaStore in which non-kettle metadata could reside.
   *
   * @return the filename of the exported resource
   */
  public String exportResources( VariableSpace space, Map<String, ResourceDefinition> definitions,
    ResourceNamingInterface resourceNamingInterface, Repository repository, IMetaStore metaStore )
    throws KettleException {
    try {
      // The object that we're modifying here is a copy of the original!
      // So let's change the filename from relative to absolute by grabbing the file object...
      // In case the name of the file comes from previous steps, forget about this!
      //
      if ( Const.isEmpty( filenameField ) ) {
        // From : ${Internal.Transformation.Filename.Directory}/../foo/bar.csv
        // To : /home/matt/test/files/foo/bar.csv
        //
        FileObject fileObject = KettleVFS.getFileObject( space.environmentSubstitute( filename ), space );

        // If the file doesn't exist, forget about this effort too!
        //
        if ( fileObject.exists() ) {
          // Convert to an absolute path...
          //
          filename = resourceNamingInterface.nameResource( fileObject, space, true );
          return filename;
        }
      }
      return null;
    } catch ( Exception e ) {
      throw new KettleException( e );
    }
  }

  @Override
  public StepMetaInjectionInterface getStepMetaInjectionInterface() {
    return new ParGzipCsvInputMetaInjection( this );
  }

}


text:
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: tensorflow/core/framework/allocation_description.proto

#ifndef PROTOBUF_tensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto__INCLUDED
#define PROTOBUF_tensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto__INCLUDED

#include <string>

#include <google/protobuf/stubs/common.h>

#if GOOGLE_PROTOBUF_VERSION < 3003000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers.  Please update
#error your headers.
#endif
#if 3003001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers.  Please
#error regenerate this file with a newer version of protoc.
#endif

#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/arena.h>
#include <google/protobuf/arenastring.h>
#include <google/protobuf/generated_message_table_driven.h>
#include <google/protobuf/generated_message_util.h>
#include <google/protobuf/metadata.h>
#include <google/protobuf/message.h>
#include <google/protobuf/repeated_field.h>  // IWYU pragma: export
#include <google/protobuf/extension_set.h>  // IWYU pragma: export
#include <google/protobuf/unknown_field_set.h>
// @@protoc_insertion_point(includes)
namespace tensorflow {
class AllocationDescription;
class AllocationDescriptionDefaultTypeInternal;
extern AllocationDescriptionDefaultTypeInternal _AllocationDescription_default_instance_;
}  // namespace tensorflow

namespace tensorflow {

namespace protobuf_tensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto {
// Internal implementation detail -- do not call these.
struct TableStruct {
  static const ::google::protobuf::internal::ParseTableField entries[];
  static const ::google::protobuf::internal::AuxillaryParseTableField aux[];
  static const ::google::protobuf::internal::ParseTable schema[];
  static const ::google::protobuf::uint32 offsets[];
  static void InitDefaultsImpl();
  static void Shutdown();
};
void AddDescriptors();
void InitDefaults();
}  // namespace protobuf_tensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto

// ===================================================================

class AllocationDescription : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:tensorflow.AllocationDescription) */ {
 public:
  AllocationDescription();
  virtual ~AllocationDescription();

  AllocationDescription(const AllocationDescription& from);

  inline AllocationDescription& operator=(const AllocationDescription& from) {
    CopyFrom(from);
    return *this;
  }

  inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL {
    return GetArenaNoVirtual();
  }
  inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL {
    return MaybeArenaPtr();
  }
  static const ::google::protobuf::Descriptor* descriptor();
  static const AllocationDescription& default_instance();

  static inline const AllocationDescription* internal_default_instance() {
    return reinterpret_cast<const AllocationDescription*>(
               &_AllocationDescription_default_instance_);
  }
  static PROTOBUF_CONSTEXPR int const kIndexInFileMessages =
    0;

  void UnsafeArenaSwap(AllocationDescription* other);
  void Swap(AllocationDescription* other);

  // implements Message ----------------------------------------------

  inline AllocationDescription* New() const PROTOBUF_FINAL { return New(NULL); }

  AllocationDescription* New(::google::protobuf::Arena* arena) const PROTOBUF_FINAL;
  void CopyFrom(const ::google::protobuf::Message& from) PROTOBUF_FINAL;
  void MergeFrom(const ::google::protobuf::Message& from) PROTOBUF_FINAL;
  void CopyFrom(const AllocationDescription& from);
  void MergeFrom(const AllocationDescription& from);
  void Clear() PROTOBUF_FINAL;
  bool IsInitialized() const PROTOBUF_FINAL;

  size_t ByteSizeLong() const PROTOBUF_FINAL;
  bool MergePartialFromCodedStream(
      ::google::protobuf::io::CodedInputStream* input) PROTOBUF_FINAL;
  void SerializeWithCachedSizes(
      ::google::protobuf::io::CodedOutputStream* output) const PROTOBUF_FINAL;
  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(
      bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL;
  int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; }
  private:
  void SharedCtor();
  void SharedDtor();
  void SetCachedSize(int size) const PROTOBUF_FINAL;
  void InternalSwap(AllocationDescription* other);
  protected:
  explicit AllocationDescription(::google::protobuf::Arena* arena);
  private:
  static void ArenaDtor(void* object);
  inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
  private:
  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
    return _internal_metadata_.arena();
  }
  inline void* MaybeArenaPtr() const {
    return _internal_metadata_.raw_arena_ptr();
  }
  public:

  ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL;

  // nested types ----------------------------------------------------

  // accessors -------------------------------------------------------

  // string allocator_name = 3;
  void clear_allocator_name();
  static const int kAllocatorNameFieldNumber = 3;
  const ::std::string& allocator_name() const;
  void set_allocator_name(const ::std::string& value);
  void set_allocator_name(const char* value);
  void set_allocator_name(const char* value, size_t size);
  ::std::string* mutable_allocator_name();
  ::std::string* release_allocator_name();
  void set_allocated_allocator_name(::std::string* allocator_name);
  ::std::string* unsafe_arena_release_allocator_name();
  void unsafe_arena_set_allocated_allocator_name(
      ::std::string* allocator_name);

  // int64 requested_bytes = 1;
  void clear_requested_bytes();
  static const int kRequestedBytesFieldNumber = 1;
  ::google::protobuf::int64 requested_bytes() const;
  void set_requested_bytes(::google::protobuf::int64 value);

  // int64 allocated_bytes = 2;
  void clear_allocated_bytes();
  static const int kAllocatedBytesFieldNumber = 2;
  ::google::protobuf::int64 allocated_bytes() const;
  void set_allocated_bytes(::google::protobuf::int64 value);

  // int64 allocation_id = 4;
  void clear_allocation_id();
  static const int kAllocationIdFieldNumber = 4;
  ::google::protobuf::int64 allocation_id() const;
  void set_allocation_id(::google::protobuf::int64 value);

  // uint64 ptr = 6;
  void clear_ptr();
  static const int kPtrFieldNumber = 6;
  ::google::protobuf::uint64 ptr() const;
  void set_ptr(::google::protobuf::uint64 value);

  // bool has_single_reference = 5;
  void clear_has_single_reference();
  static const int kHasSingleReferenceFieldNumber = 5;
  bool has_single_reference() const;
  void set_has_single_reference(bool value);

  // @@protoc_insertion_point(class_scope:tensorflow.AllocationDescription)
 private:

  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
  friend class ::google::protobuf::Arena;
  typedef void InternalArenaConstructable_;
  typedef void DestructorSkippable_;
  ::google::protobuf::internal::ArenaStringPtr allocator_name_;
  ::google::protobuf::int64 requested_bytes_;
  ::google::protobuf::int64 allocated_bytes_;
  ::google::protobuf::int64 allocation_id_;
  ::google::protobuf::uint64 ptr_;
  bool has_single_reference_;
  mutable int _cached_size_;
  friend struct protobuf_tensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto::TableStruct;
};
// ===================================================================

// ===================================================================

#if !PROTOBUF_INLINE_NOT_IN_HEADERS
// AllocationDescription

// int64 requested_bytes = 1;
inline void AllocationDescription::clear_requested_bytes() {
  requested_bytes_ = GOOGLE_LONGLONG(0);
}
inline ::google::protobuf::int64 AllocationDescription::requested_bytes() const {
  // @@protoc_insertion_point(field_get:tensorflow.AllocationDescription.requested_bytes)
  return requested_bytes_;
}
inline void AllocationDescription::set_requested_bytes(::google::protobuf::int64 value) {

  requested_bytes_ = value;
  // @@protoc_insertion_point(field_set:tensorflow.AllocationDescription.requested_bytes)
}

// int64 allocated_bytes = 2;
inline void AllocationDescription::clear_allocated_bytes() {
  allocated_bytes_ = GOOGLE_LONGLONG(0);
}
inline ::google::protobuf::int64 AllocationDescription::allocated_bytes() const {
  // @@protoc_insertion_point(field_get:tensorflow.AllocationDescription.allocated_bytes)
  return allocated_bytes_;
}
inline void AllocationDescription::set_allocated_bytes(::google::protobuf::int64 value) {

  allocated_bytes_ = value;
  // @@protoc_insertion_point(field_set:tensorflow.AllocationDescription.allocated_bytes)
}

// string allocator_name = 3;
inline void AllocationDescription::clear_allocator_name() {
  allocator_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
inline const ::std::string& AllocationDescription::allocator_name() const {
  // @@protoc_insertion_point(field_get:tensorflow.AllocationDescription.allocator_name)
  return allocator_name_.Get();
}
inline void AllocationDescription::set_allocator_name(const ::std::string& value) {

  allocator_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
  // @@protoc_insertion_point(field_set:tensorflow.AllocationDescription.allocator_name)
}
inline void AllocationDescription::set_allocator_name(const char* value) {
  GOOGLE_DCHECK(value != NULL);

  allocator_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),
              GetArenaNoVirtual());
  // @@protoc_insertion_point(field_set_char:tensorflow.AllocationDescription.allocator_name)
}
inline void AllocationDescription::set_allocator_name(const char* value,
    size_t size) {

  allocator_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
      reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
  // @@protoc_insertion_point(field_set_pointer:tensorflow.AllocationDescription.allocator_name)
}
inline ::std::string* AllocationDescription::mutable_allocator_name() {

  // @@protoc_insertion_point(field_mutable:tensorflow.AllocationDescription.allocator_name)
  return allocator_name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
inline ::std::string* AllocationDescription::release_allocator_name() {
  // @@protoc_insertion_point(field_release:tensorflow.AllocationDescription.allocator_name)

  return allocator_name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
inline ::std::string* AllocationDescription::unsafe_arena_release_allocator_name() {
  // @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.AllocationDescription.allocator_name)
  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);

  return allocator_name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
      GetArenaNoVirtual());
}
inline void AllocationDescription::set_allocated_allocator_name(::std::string* allocator_name) {
  if (allocator_name != NULL) {

  } else {

  }
  allocator_name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), allocator_name,
      GetArenaNoVirtual());
  // @@protoc_insertion_point(field_set_allocated:tensorflow.AllocationDescription.allocator_name)
}
inline void AllocationDescription::unsafe_arena_set_allocated_allocator_name(
    ::std::string* allocator_name) {
  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
  if (allocator_name != NULL) {

  } else {

  }
  allocator_name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
      allocator_name, GetArenaNoVirtual());
  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.AllocationDescription.allocator_name)
}

// int64 allocation_id = 4;
inline void AllocationDescription::clear_allocation_id() {
  allocation_id_ = GOOGLE_LONGLONG(0);
}
inline ::google::protobuf::int64 AllocationDescription::allocation_id() const {
  // @@protoc_insertion_point(field_get:tensorflow.AllocationDescription.allocation_id)
  return allocation_id_;
}
inline void AllocationDescription::set_allocation_id(::google::protobuf::int64 value) {

  allocation_id_ = value;
  // @@protoc_insertion_point(field_set:tensorflow.AllocationDescription.allocation_id)
}

// bool has_single_reference = 5;
inline void AllocationDescription::clear_has_single_reference() {
  has_single_reference_ = false;
}
inline bool AllocationDescription::has_single_reference() const {
  // @@protoc_insertion_point(field_get:tensorflow.AllocationDescription.has_single_reference)
  return has_single_reference_;
}
inline void AllocationDescription::set_has_single_reference(bool value) {

  has_single_reference_ = value;
  // @@protoc_insertion_point(field_set:tensorflow.AllocationDescription.has_single_reference)
}

// uint64 ptr = 6;
inline void AllocationDescription::clear_ptr() {
  ptr_ = GOOGLE_ULONGLONG(0);
}
inline ::google::protobuf::uint64 AllocationDescription::ptr() const {
  // @@protoc_insertion_point(field_get:tensorflow.AllocationDescription.ptr)
  return ptr_;
}
inline void AllocationDescription::set_ptr(::google::protobuf::uint64 value) {

  ptr_ = value;
  // @@protoc_insertion_point(field_set:tensorflow.AllocationDescription.ptr)
}

#endif  // !PROTOBUF_INLINE_NOT_IN_HEADERS

// @@protoc_insertion_point(namespace_scope)

}  // namespace tensorflow

// @@protoc_insertion_point(global_scope)

#endif  // PROTOBUF_tensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto__INCLUDED


text:
package final_cdio_11.java.data.dto;

/*
 * Role data transfer object.
 * This class is used to store information about database entities.
 */
public class RoleDTO {

	private int oprId;
	private String roleName;

	public RoleDTO(int oprId, String roleName) {
		this.oprId = oprId;
		this.roleName = roleName;
	}

	public int getOprId() {
		return oprId;
	}

	public String getRoleName() {
		return roleName;
	}

	@Override
	public String toString() {
		return "RoleDTO [oprId=" + oprId + ", roleName=" + roleName + "]";
	}

}


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

<TITLE>
OneBoxProvider (OneBox Servlet API)
</TITLE>

<META NAME="keywords" CONTENT="com.google.enterprise.sdk.onebox.OneBoxProvider class">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">

      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

com.google.enterprise.sdk.onebox

Class OneBoxProvider

java.lang.Object
  javax.servlet.GenericServlet
      javax.servlet.http.HttpServlet
          com.google.enterprise.sdk.onebox.OneBoxProvider

All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public abstract class OneBoxProvider
extends javax.servlet.http.HttpServlet

Abstract base class servlet for providing OneBox results.

 Services GET method requests from OneBox clients by unpacking their
 request parameters and delegating to one of the overloaded
 provideOneBoxResults() methods depending on the
 authType parameter.

 Providers need to extend this class and override one or more
 of its provideOneBoxResults methods.  The base class
 implementation of those methods will all throw
 UnsupportedOperationException.

See Also:
OneBoxResults,
Serialized Form

Field Summary

protected  java.lang.String
webAppBaseURL

Constructor Summary

OneBoxProvider()

Method Summary

 void
doGet(javax.servlet.http.HttpServletRequest request,
      javax.servlet.http.HttpServletResponse response)

          Called by the application server's servlet runner when GET method
 requests are made for this servlet.

protected  void
logHeaders(javax.servlet.http.HttpServletRequest request)

          Convenience method for logging the HTTP headers sent in the request.

protected  void
processRequest(javax.servlet.http.HttpServletRequest request,
               javax.servlet.http.HttpServletResponse response)

          Top level request processor for this OneBox provider.

protected  IOneBoxResults
provideOneBoxResults(java.lang.String apiMaj,
                     java.lang.String apiMin,
                     java.lang.String oneboxName,
                     java.lang.String dateTime,
                     java.lang.String ipAddr,
                     javax.servlet.http.Cookie ssoCookie,
                     java.lang.String lang,
                     java.lang.String query,
                     java.lang.String[] matchGroups)

          Method to handle OneBox requests where forms based (Single Sign-On) authentication
 of the end user is required.

protected  IOneBoxResults
provideOneBoxResults(java.lang.String apiMaj,
                     java.lang.String apiMin,
                     java.lang.String oneboxName,
                     java.lang.String dateTime,
                     java.lang.String ipAddr,
                     java.lang.String lang,
                     java.lang.String query,
                     java.lang.String[] matchGroups)

          Method to handle OneBox requests where no user authentication is required.

protected  IOneBoxResults
provideOneBoxResults(java.lang.String apiMaj,
                     java.lang.String apiMin,
                     java.lang.String oneboxName,
                     java.lang.String dateTime,
                     java.lang.String ipAddr,
                     java.lang.String distinguishedName,
                     java.lang.String lang,
                     java.lang.String query,
                     java.lang.String[] matchGroups)

          Method to handle OneBox requests where LDAP based authentication of the
 end user is required.

protected  IOneBoxResults
provideOneBoxResults(java.lang.String apiMaj,
                     java.lang.String apiMin,
                     java.lang.String oneboxName,
                     java.lang.String dateTime,
                     java.lang.String ipAddr,
                     java.lang.String userName,
                     java.lang.String password,
                     java.lang.String lang,
                     java.lang.String query,
                     java.lang.String[] matchGroups)

          Method to handle OneBox requests where simple username / password based
 authentication of the end user is required.

Methods inherited from class javax.servlet.http.HttpServlet

doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service

Methods inherited from class javax.servlet.GenericServlet

destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

webAppBaseURL

protected java.lang.String webAppBaseURL

Constructor Detail

OneBoxProvider

public OneBoxProvider()

Method Detail

doGet

public void doGet(javax.servlet.http.HttpServletRequest request,
                  javax.servlet.http.HttpServletResponse response)
           throws javax.servlet.ServletException,
                  java.io.IOException

Called by the application server's servlet runner when GET method
 requests are made for this servlet.  OneBox clients (such as the
 Google Search Appliance) make HTTP requests to OneBox providers
 exclusivley using the GET method.

Throws:

javax.servlet.ServletException

java.io.IOException

logHeaders

protected void logHeaders(javax.servlet.http.HttpServletRequest request)

Convenience method for logging the HTTP headers sent in the request.  This
 will log to the application server's log channel set up for this servlet
 and is purely meant for use during debugging.

processRequest

protected void processRequest(javax.servlet.http.HttpServletRequest request,
                              javax.servlet.http.HttpServletResponse response)
                       throws javax.servlet.ServletException,
                              java.io.IOException

Top level request processor for this OneBox provider.

 Unpacks the HTTP request's parameters and passes them into one of the
 provideOneBoxResults methods, based on the value of
 the authType parameter, for further processing.

 Returns an HTTP response with XML that adhere's to the Google DTD
 defining the schema for OneBox for Enterprise provider results.

Throws:

javax.servlet.ServletException

java.io.IOException

provideOneBoxResults

protected IOneBoxResults provideOneBoxResults(java.lang.String apiMaj,
                                              java.lang.String apiMin,
                                              java.lang.String oneboxName,
                                              java.lang.String dateTime,
                                              java.lang.String ipAddr,
                                              java.lang.String lang,
                                              java.lang.String query,
                                              java.lang.String[] matchGroups)

Method to handle OneBox requests where no user authentication is required.

Parameters:
apiMaj - the OneBox for Enterprise API major version
apiMin - the OneBox for Enterprise API minor version
oneboxName - the name of the OneBox module
dateTime - the date and time of the OneBox query
ipAddr - the IP address of the end user as determined by the OneBox client
lang - the language of the user's browser, two character language code
query - the end user's query, UTF-8 encoded and URL-escaped
matchGroups - reqular expression evaluation match groups

Returns:
IOneBoxResults

provideOneBoxResults

protected IOneBoxResults provideOneBoxResults(java.lang.String apiMaj,
                                              java.lang.String apiMin,
                                              java.lang.String oneboxName,
                                              java.lang.String dateTime,
                                              java.lang.String ipAddr,
                                              java.lang.String userName,
                                              java.lang.String password,
                                              java.lang.String lang,
                                              java.lang.String query,
                                              java.lang.String[] matchGroups)

Method to handle OneBox requests where simple username / password based
 authentication of the end user is required.

Parameters:
apiMaj - the OneBox for Enterprise API major version
apiMin - the OneBox for Enterprise API minor version
oneboxName - the name of the OneBox module
dateTime - the date and time of the OneBox query
ipAddr - the IP address of the end user as determined by the OneBox client
userName - the username entered by the end user
password - the password entered by the end user
lang - the language of the user's browser, two character language code
query - the end user's query, UTF-8 encoded and URL-escaped
matchGroups - reqular expression evaluation match groups

Returns:
IOneBoxResults

provideOneBoxResults

protected IOneBoxResults provideOneBoxResults(java.lang.String apiMaj,
                                              java.lang.String apiMin,
                                              java.lang.String oneboxName,
                                              java.lang.String dateTime,
                                              java.lang.String ipAddr,
                                              java.lang.String distinguishedName,
                                              java.lang.String lang,
                                              java.lang.String query,
                                              java.lang.String[] matchGroups)

Method to handle OneBox requests where LDAP based authentication of the
 end user is required.

Parameters:
apiMaj - the OneBox for Enterprise API major version
apiMin - the OneBox for Enterprise API minor version
oneboxName - the name of the OneBox module
dateTime - the date and time of the OneBox query
ipAddr - the IP address of the end user as determined by the OneBox client
distinguishedName - the distinguished name from the LDAP lookup of the end user
lang - the language of the user's browser, two character language code
query - the end user's query, UTF-8 encoded and URL-escaped
matchGroups - reqular expression evaluation match groups

Returns:
IOneBoxResults

provideOneBoxResults

protected IOneBoxResults provideOneBoxResults(java.lang.String apiMaj,
                                              java.lang.String apiMin,
                                              java.lang.String oneboxName,
                                              java.lang.String dateTime,
                                              java.lang.String ipAddr,
                                              javax.servlet.http.Cookie ssoCookie,
                                              java.lang.String lang,
                                              java.lang.String query,
                                              java.lang.String[] matchGroups)

Method to handle OneBox requests where forms based (Single Sign-On) authentication
 of the end user is required.

Parameters:
apiMaj - the OneBox for Enterprise API major version
apiMin - the OneBox for Enterprise API minor version
oneboxName - the name of the OneBox module
dateTime - the date and time of the OneBox query
ipAddr - the IP address of the end user as determined by the OneBox client
ssoCookie - the cookie from the authentication system containing the trusted user identity
lang - the language of the user's browser, two character language code
query - the end user's query, UTF-8 encoded and URL-escaped
matchGroups - reqular expression evaluation match groups

Returns:
IOneBoxResults

      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD


text:
import React from 'react';
import { Provider } from 'react-redux';
import { IntlProvider } from 'react-intl';
import { addLocaleData } from 'react-intl';
import en from 'react-intl/locale-data/en';
import { getCurrentLocale, getLocaleData } from 'grommet/utils/Locale';
import { Router, browserHistory as history } from 'react-router';
import { routes } from './Routes';
import store from './store';
let locale = getCurrentLocale();
addLocaleData(en);

let messages;
try {
  // rtl driven by hardcoding languages for now
  if ('he' === locale || 'ar' === locale.slice(0, 2)) {
    document.documentElement.classList.add("rtl");
  } else {
    document.documentElement.classList.remove("rtl");
  }
  messages = require('../messages/' + locale);
} catch (e) {
  messages = require('../messages/en-US');
}
var localeData = getLocaleData(messages, locale);
export default () => (
  <Provider store={store}>
    <IntlProvider locale={localeData.locale} messages={localeData.messages}>
      <Router routes={routes} history={history} />
    </IntlProvider>
  </Provider>
);


text:
#import "MailSplitView.h"

@interface MailVerticalSplitView : MailSplitView
{
    unsigned long long _animationID;
}

- (void)setPosition:(double)arg1 ofDividerAtIndex:(long long)arg2 byAnimating:(BOOL)arg3 completionHandler:(id)arg4;

@end


text:
#pragma once
#include <aws/elasticloadbalancingv2/ElasticLoadBalancingv2_EXPORTS.h>
#include <aws/elasticloadbalancingv2/ElasticLoadBalancingv2Request.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/core/utils/memory/stl/AWSVector.h>

namespace Aws
{
namespace ElasticLoadBalancingv2
{
namespace Model
{

  /**
   *
Contains the parameters for SetSecurityGroups.

   */
  class AWS_ELASTICLOADBALANCINGV2_API SetSecurityGroupsRequest : public ElasticLoadBalancingv2Request
  {
  public:
    SetSecurityGroupsRequest();
    Aws::String SerializePayload() const override;

    /**
     *
The Amazon Resource Name (ARN) of the load balancer.

     */
    inline const Aws::String& GetLoadBalancerArn() const{ return m_loadBalancerArn; }

    /**
     *
The Amazon Resource Name (ARN) of the load balancer.

     */
    inline void SetLoadBalancerArn(const Aws::String& value) { m_loadBalancerArnHasBeenSet = true; m_loadBalancerArn = value; }

    /**
     *
The Amazon Resource Name (ARN) of the load balancer.

     */
    inline void SetLoadBalancerArn(Aws::String&& value) { m_loadBalancerArnHasBeenSet = true; m_loadBalancerArn = value; }

    /**
     *
The Amazon Resource Name (ARN) of the load balancer.

     */
    inline void SetLoadBalancerArn(const char* value) { m_loadBalancerArnHasBeenSet = true; m_loadBalancerArn.assign(value); }

    /**
     *
The Amazon Resource Name (ARN) of the load balancer.

     */
    inline SetSecurityGroupsRequest& WithLoadBalancerArn(const Aws::String& value) { SetLoadBalancerArn(value); return *this;}

    /**
     *
The Amazon Resource Name (ARN) of the load balancer.

     */
    inline SetSecurityGroupsRequest& WithLoadBalancerArn(Aws::String&& value) { SetLoadBalancerArn(value); return *this;}

    /**
     *
The Amazon Resource Name (ARN) of the load balancer.

     */
    inline SetSecurityGroupsRequest& WithLoadBalancerArn(const char* value) { SetLoadBalancerArn(value); return *this;}

    /**
     *
The IDs of the security groups.

     */
    inline const Aws::Vector<Aws::String>& GetSecurityGroups() const{ return m_securityGroups; }

    /**
     *
The IDs of the security groups.

     */
    inline void SetSecurityGroups(const Aws::Vector<Aws::String>& value) { m_securityGroupsHasBeenSet = true; m_securityGroups = value; }

    /**
     *
The IDs of the security groups.

     */
    inline void SetSecurityGroups(Aws::Vector<Aws::String>&& value) { m_securityGroupsHasBeenSet = true; m_securityGroups = value; }

    /**
     *
The IDs of the security groups.

     */
    inline SetSecurityGroupsRequest& WithSecurityGroups(const Aws::Vector<Aws::String>& value) { SetSecurityGroups(value); return *this;}

    /**
     *
The IDs of the security groups.

     */
    inline SetSecurityGroupsRequest& WithSecurityGroups(Aws::Vector<Aws::String>&& value) { SetSecurityGroups(value); return *this;}

    /**
     *
The IDs of the security groups.

     */
    inline SetSecurityGroupsRequest& AddSecurityGroups(const Aws::String& value) { m_securityGroupsHasBeenSet = true; m_securityGroups.push_back(value); return *this; }

    /**
     *
The IDs of the security groups.

     */
    inline SetSecurityGroupsRequest& AddSecurityGroups(Aws::String&& value) { m_securityGroupsHasBeenSet = true; m_securityGroups.push_back(value); return *this; }

    /**
     *
The IDs of the security groups.

     */
    inline SetSecurityGroupsRequest& AddSecurityGroups(const char* value) { m_securityGroupsHasBeenSet = true; m_securityGroups.push_back(value); return *this; }

  private:
    Aws::String m_loadBalancerArn;
    bool m_loadBalancerArnHasBeenSet;
    Aws::Vector<Aws::String> m_securityGroups;
    bool m_securityGroupsHasBeenSet;
  };

} // namespace Model
} // namespace ElasticLoadBalancingv2
} // namespace Aws


text:
"""
Classes and constants for representing thermodynamic variables.
"""

import sys
from sympy import Float, Symbol
from pycalphad.io.grammar import parse_chemical_formula

class Species(object):
    """
    A chemical species.

    Attributes
    ----------
    name : string
        Name of the specie
    constituents : dict
        Dictionary of {element: quantity} where the element is a string and the quantity a float.
    charge : int
        Integer charge. Can be positive or negative.
    """
    def __new__(cls, name, constituents=None, charge=0):
        if constituents is not None:
            new_self = object.__new__(cls)
            new_self.name = name
            new_self.constituents = constituents
            new_self.charge = charge
            return new_self
        else:
            arg = name
        # if a Species is passed in, return it
        if arg.__class__ == cls:
            return arg
        new_self = object.__new__(cls)
        if arg == '*':
            new_self = object.__new__(cls)
            new_self.name = '*'
            new_self.constituents = dict()
            new_self.charge = 0
            return new_self
        if arg is None:
            new_self = object.__new__(cls)
            new_self.name = ''
            new_self.constituents = dict()
            new_self.charge = 0
            return new_self

        if isinstance(arg, str):
            parse_list = parse_chemical_formula(arg.upper())
        else:
            parse_list = arg
        new_self.name = name
        new_self.charge = parse_list[1]
        parse_list = parse_list[0]
        new_self.constituents = dict(parse_list)
        return new_self

    def __getnewargs__(self):
        return self.name, self.constituents, self.charge

    def __eq__(self, other):
        """Two species are the same if their names and constituents are the same."""
        if isinstance(other, self.__class__):
            return (self.name == other.name) and (self.constituents == other.constituents)
        else:
            return False

    def __ne__(self, other):
        return not self.__eq__(other)

    def __lt__(self, other):
        return self.name < other.name

    def __str__(self):
        return self.name

    @property
    def escaped_name(self):
        "Name safe to embed in the variable name of complex arithmetic expressions."
        return str(self).replace('-', '_NEG').replace('+', '_POS').replace('/', 'Z')

    @property
    def number_of_atoms(self):
        "Number of atoms per formula unit. Vacancies do not count as atoms."
        return sum(value for key, value in self.constituents.items() if key != 'VA')

    @property
    def weight(self):
        "Number of grams per formula unit."
        return NotImplementedError

    def __repr__(self):
        if self.name == '*':
            return '*'
        if self.name == '':
            return 'None'
        species_constituents = ''.join(
            ['{}{}'.format(el, val) for el, val in sorted(self.constituents.items(), key=lambda t: t[0])])
        if self.charge == 0:
            repr_str = "(\'{0}\', \'{1}\')"
        else:
            repr_str = "(\'{0}\', \'{1}\', charge={2})"
        return str(self.__class__.__name__)+repr_str.format(self.name.upper(), species_constituents, self.charge)

    def __hash__(self):
        return hash(self.name)

class StateVariable(Symbol):
    """
    State variables are symbols with built-in assumptions of being real.
    """
    def __new__(cls, name, *args, **assumptions):
        return Symbol.__new__(cls, name.upper(), real=True, **assumptions)

class SiteFraction(StateVariable):
    """
    Site fractions are symbols with built-in assumptions of being real
    and nonnegative. The constructor handles formatting of the name.
    """
    def __new__(cls, phase_name, subl_index, species): #pylint: disable=W0221
        varname = phase_name + str(subl_index) + Species(species).escaped_name
        #pylint: disable=E1121
        new_self = StateVariable.__new__(cls, varname, nonnegative=True)
        new_self.phase_name = phase_name.upper()
        new_self.sublattice_index = subl_index
        new_self.species = Species(species)
        return new_self

    def __getnewargs__(self):
        return self.phase_name, self.sublattice_index, self.species

    def _latex(self, printer=None):
        "LaTeX representation."
        #pylint: disable=E1101
        return 'y^{\mathrm{'+self.phase_name.replace('_', '-') + \
            '}}_{'+str(self.sublattice_index)+',\mathrm{'+self.species.escaped_name+'}}'

    def __str__(self):
        "String representation."
        #pylint: disable=E1101
        return 'Y(%s,%d,%s)' % \
            (self.phase_name, self.sublattice_index, self.species.escaped_name)

class PhaseFraction(StateVariable):
    """
    Phase fractions are symbols with built-in assumptions of being real
    and nonnegative. The constructor handles formatting of the name.
    """
    def __new__(cls, phase_name): #pylint: disable=W0221
        varname = 'NP_' + str(phase_name)
        #pylint: disable=E1121
        new_self = StateVariable.__new__(cls, varname, nonnegative=True)
        new_self.phase_name = phase_name.upper()
        return new_self

    def __getnewargs__(self):
        return self.phase_name,

    def _latex(self, printer=None):
        "LaTeX representation."
        #pylint: disable=E1101
        return 'f^{'+self.phase_name.replace('_', '-')

class MoleFraction(StateVariable):
    """
    MoleFractions are symbols with built-in assumptions of being real
    and nonnegative.
    """
    def __new__(cls, *args): #pylint: disable=W0221
        new_self = None
        varname = None
        phase_name = None
        species = None
        if len(args) == 1:
            # this is an overall composition variable
            species = Species(args[0])
            varname = 'X_' + species.escaped_name.upper()
        elif len(args) == 2:
            # this is a phase-specific composition variable
            phase_name = args[0].upper()
            species = Species(args[1])
            varname = 'X_' + phase_name + '_' + species.escaped_name.upper()
        else:
            # not defined
            raise ValueError('MoleFraction not defined for args: '+args)

        #pylint: disable=E1121
        new_self = StateVariable.__new__(cls, varname, nonnegative=True)
        new_self.phase_name = phase_name
        new_self.species = species
        return new_self

    def __getnewargs__(self):
        if self.phase_name is not None:
            return self.phase_name, self.species
        else:
            return self.species,

    def _latex(self, printer=None):
        "LaTeX representation."
        #pylint: disable=E1101
        if self.phase_name:
            return 'x^{'+self.phase_name.replace('_', '-') + \
                '}_{'+self.species.escaped_name+'}'
        else:
            return 'x_{'+self.species.escaped_name+'}'

class MassFraction(StateVariable):
    """
    Weight fractions are symbols with built-in assumptions of being real and nonnegative.
    """
    def __new__(cls, *args):  # pylint: disable=W0221
        new_self = None
        varname = None
        phase_name = None
        species = None
        if len(args) == 1:
            # this is an overall composition variable
            species = Species(args[0])
            varname = 'W_' + species.escaped_name.upper()
        elif len(args) == 2:
            # this is a phase-specific composition variable
            phase_name = args[0].upper()
            species = Species(args[1])
            varname = 'W_' + phase_name + '_' + species.escaped_name.upper()
        else:
            # not defined
            raise ValueError('Weight fraction not defined for args: '+args)

        # pylint: disable=E1121
        new_self = StateVariable.__new__(cls, varname, nonnegative=True)
        new_self.phase_name = phase_name
        new_self.species = species
        return new_self

    def __getnewargs__(self):
        if self.phase_name is not None:
            return self.phase_name, self.species
        else:
            return self.species,

    def _latex(self, printer=None):
        "LaTeX representation."
        # pylint: disable=E1101
        if self.phase_name:
            return 'w^{'+self.phase_name.replace('_', '-') + \
                '}_{'+self.species.escaped_name+'}'
        else:
            return 'w_{'+self.species.escaped_name+'}'

def get_mole_fractions(mass_fractions, dependent_species, pure_element_mass_dict):
    """
    Return a mapping of MoleFractions for a point composition.

    Parameters
    ----------
    mass_fractions : Mapping[MassFraction, float]

    dependent_species : Union[Species, str]
        Dependent species not appearing in the independent mass fractions.

    pure_element_mass_dict : Union[Mapping[str, float], pycalphad.Database]
        Either a mapping from pure elements to their mass, or a Database from
        which they can be retrieved.

    Returns
    -------
    Dict[MoleFraction, float]

    """
    if not all(isinstance(mf, MassFraction) for mf in mass_fractions):
        from pycalphad.core.errors import ConditionError
        raise ConditionError("All mass_fractions must be instances of MassFraction (v.W). Got ", mass_fractions)
    dependent_species = Species(dependent_species)
    species_mass_fracs = {mf.species: frac for mf, frac in mass_fractions.items()}
    all_species = set(species_mass_fracs.keys()) | {dependent_species}
    # Check if the mass dict is a Database, which is the source of the mass_dict
    from pycalphad import Database  # Imported here to avoid circular import
    if isinstance(pure_element_mass_dict, Database):
        pure_element_mass_dict = {el: refdict['mass'] for el, refdict in pure_element_mass_dict.refstates.items()}

    species_mass_dict = {}
    for species in all_species:
        species_mass_dict[species] = sum([pure_element_mass_dict[pe]*natoms for pe, natoms in species.constituents.items()])

    # add dependent species
    species_mass_fracs[dependent_species] = 1 - sum(species_mass_fracs.values())
    # compute moles
    species_moles = {species: mass_frac/species_mass_dict[species] for species, mass_frac in species_mass_fracs.items()}
    # normalize
    total_moles = sum(species_moles.values())
    species_mole_fractions = {species: moles/total_moles for species, moles in species_moles.items()}
    # remove dependent species
    species_mole_fractions.pop(dependent_species)
    return {MoleFraction(species): fraction for species, fraction in species_mole_fractions.items()}

def get_mass_fractions(mole_fractions, dependent_species, pure_element_mass_dict):
    """
    Return a mapping of MassFractions for a point composition.

    Parameters
    ----------
    mass_fractions : Mapping[MoleFraction, float]

    dependent_species : Union[Species, str]
        Dependent species not appearing in the independent mass fractions.

    pure_element_mass_dict : Union[Mapping[str, float], pycalphad.Database]
        Either a mapping from pure elements to their mass, or a Database from
        which they can be retrieved.

    Returns
    -------
    Dict[MassFraction, float]

    """
    if not all(isinstance(mf, MoleFraction) for mf in mole_fractions):
        from pycalphad.core.errors import ConditionError
        raise ConditionError("All mole_fractions must be instances of MoleFraction (v.X). Got ", mole_fractions)
    dependent_species = Species(dependent_species)
    species_mole_fracs = {mf.species: frac for mf, frac in mole_fractions.items()}
    all_species = set(species_mole_fracs.keys()) | {dependent_species}
    # Check if the mass dict is a Database, which is the source of the mass_dict
    from pycalphad import Database  # Imported here to avoid circular import
    if isinstance(pure_element_mass_dict, Database):
        pure_element_mass_dict = {el: refdict['mass'] for el, refdict in pure_element_mass_dict.refstates.items()}

    species_mass_dict = {}
    for species in all_species:
        species_mass_dict[species] = sum([pure_element_mass_dict[pe]*natoms for pe, natoms in species.constituents.items()])

    # add dependent species
    species_mole_fracs[dependent_species] = 1 - sum(species_mole_fracs.values())
    # compute mass
    species_mass = {species: mole_frac*species_mass_dict[species] for species, mole_frac in species_mole_fracs.items()}
    # normalize
    total_mass = sum(species_mass.values())
    species_mass_fractions = {species: mass/total_mass for species, mass in species_mass.items()}
    # remove dependent species
    species_mass_fractions.pop(dependent_species)
    return {MassFraction(species): fraction for species, fraction in species_mass_fractions.items()}

class ChemicalPotential(StateVariable):
    """
    Chemical potentials are symbols with built-in assumptions of being real.
    """
    def __new__(cls, species, **assumptions):
        species = Species(species)
        varname = 'MU_' + species.escaped_name.upper()
        new_self = StateVariable.__new__(cls, varname, **assumptions)
        new_self.species = species
        return new_self

    def __getnewargs__(self):
        return self.species,

    def _latex(self, printer=None):
        "LaTeX representation."
        return '\mu_{'+self.species.escaped_name+'}'

    def __str__(self):
        "String representation."
        return 'MU_%s' % self.species.name

temperature = T = StateVariable('T')
entropy = S = StateVariable('S')
pressure = P = StateVariable('P')
volume = V = StateVariable('V')
moles = N = StateVariable('N')
site_fraction = Y = SiteFraction
X = MoleFraction
W = MassFraction
MU = ChemicalPotential
NP = PhaseFraction
si_gas_constant = R = Float(8.3145) # ideal gas constant

CONDITIONS_REQUIRING_HESSIANS = {ChemicalPotential, PhaseFraction}


text:
using System.Data.Entity;
using System.Security.Claims;
using System.Threading.Tasks;
using Microsoft.AspNet.Identity;
using Microsoft.AspNet.Identity.EntityFramework;

namespace ViprService.Models
{
    // You can add profile data for the user by adding more properties to your ApplicationUser class, please visit http://go.microsoft.com/fwlink/?LinkID=317594 to learn more.
    public class ApplicationUser : IdentityUser
    {
        public string Hometown { get; set; }

        public async Task<ClaimsIdentity> GenerateUserIdentityAsync(UserManager<ApplicationUser> manager)
        {
            // Note the authenticationType must match the one defined in CookieAuthenticationOptions.AuthenticationType
            var userIdentity = await manager.CreateIdentityAsync(this, DefaultAuthenticationTypes.ApplicationCookie);
            // Add custom user claims here
            return userIdentity;
        }
    }

    public class ApplicationDbContext : IdentityDbContext<ApplicationUser>
    {
        public ApplicationDbContext()
            : base("DefaultConnection", throwIfV1Schema: false)
        {
        }

        public static ApplicationDbContext Create()
        {
            return new ApplicationDbContext();
        }

        //protected override void OnModelCreating(DbModelBuilder modelBuilder)
        //{
        //    modelBuilder.Conventions.Remove<PluralizingTableNameConvention>();

        //    base.OnModelCreating(modelBuilder);
        //}

    }
}


text:
"""
Internal state of the device
"""

import logging
from ofagent.utils import pp
import loxi.of13 as ofp

class GroupEntry(object):
    def __init__(self, group_desc, group_stats):
        assert isinstance(group_desc, ofp.group_desc_stats_entry)
        assert isinstance(group_stats, ofp.group_stats_entry)
        self.group_desc = group_desc
        self.group_stats = group_stats

def flow_stats_entry_from_flow_mod_message(fmm):
    assert isinstance(fmm, ofp.message.flow_mod)

    # extract a flow stats entry from a flow_mod message
    kw = fmm.__dict__

    # drop these from the object
    for k in ('xid', 'cookie_mask', 'out_port', 'buffer_id', 'out_group'):
        del kw[k]
    flow = ofp.flow_stats_entry(
        duration_sec=0,
        duration_nsec=0,
        packet_count=0,
        byte_count=0,
        **kw
    )
    return flow

def group_entry_from_group_mod_message(gmm):
    assert isinstance(gmm, ofp.message.group_mod)

    kw = gmm.__dict__

    # drop these attributes from the object:
    for k in ('xid',):
        del kw[k]

    group_desc = ofp.group_desc_stats_entry(
        group_type=gmm.group_type,
        group_id=gmm.group_id,
        buckets=gmm.buckets
    )

    group_stats = ofp.group_stats_entry(
        group_id=gmm.group_id
    )

    return GroupEntry(group_desc, group_stats)

class ObjectStore(object):

    def __init__(self):
        self.ports = []  # list of ofp.common.port_desc
        self.flows = []  # list of ofp.common.flow_stats_entry
        self.groups = {} # dict of (ofp.group_desc_stats_entry, ofp.group_stats_entry) tuples,
                         # keyed by the group_id field
        self.agent = None

    def set_agent(self, agent):
        """Set agent reference"""
        self.agent = agent

    def signal_flow_mod_error(self, code, flow_mod):
        """Forward error to agent"""
        if self.agent is not None:
            agent.signal_flow_mod_error(code, flow_mod)

    def signal_flow_removal(self, flow):
        """Forward flow removal notification to agent"""
        if self.agent is not None:
            agent.signal_flow_removal(flow)

    def signal_group_mod_error(self, code, group_mod):
        if self.agent is not None:
            agent.signal_group_mod_error(code, group_mod)

    ## <=========================== PORT HANDLERS ==================================>

    def port_list(self):
        return self.ports

    def port_add(self, port):
        self.ports.append(port)

    def port_stats(self):
        logging.warn("port_stats() not yet implemented")
        return []

    ## <=========================== FLOW HANDLERS ==================================>

    def flow_add(self, flow_add):
        assert isinstance(flow_add, ofp.message.flow_add)
        assert flow_add.cookie_mask == 0

        check_overlap = flow_add.flags & ofp.OFPFF_CHECK_OVERLAP
        if check_overlap:
            if self._flow_find_overlapping_flows(flow_add, return_on_first_hit=True):
                self.signal_flow_mod_error(ofp.OFPFMFC_OVERLAP, flow_add)
            else:
                # free to add as new flow
                flow = flow_stats_entry_from_flow_mod_message(flow_add)
                self.flows.append(flow)

        else:
            flow = flow_stats_entry_from_flow_mod_message(flow_add)
            idx = self._flow_find(flow)
            if idx >= 0:
                old_flow = self.flows[idx]
                assert isinstance(old_flow, ofp.common.flow_stats_entry)
                if not (flow_add.flags & ofp.OFPFF_RESET_COUNTS):
                    flow.byte_count = old_flow.byte_count
                    flow.packet_count = old_flow.packet_count
                self.flows[idx] = flow

            else:
                self.flows.append(flow)

    def flow_delete_strict(self, flow_delete_strict):
        assert isinstance(flow_delete_strict, ofp.message.flow_delete_strict)
        flow = flow_stats_entry_from_flow_mod_message(flow_delete_strict)
        idx = self._flow_find(flow)
        if (idx >= 0):
            del self.flows[idx]
            logging.info("flow removed:\n%s" % pp(flow))
        else:
            logging.error('Requesting strict delete of:\n%s\nwhen flow table is:\n\n' % pp(flow))
            for f in self.flows:
                print pp(f)

    def flow_delete(self, flow_delete):
        assert isinstance(flow_delete, ofp.message.flow_delete)

        # build a list of what to keep vs what to delete
        to_keep = []
        to_delete = []
        for f in self.flows:
            list_to_append = to_delete if self._flow_matches_spec(f, flow_delete) else to_keep
            list_to_append.append(f)

        # replace flow table with keepers
        self.flows = to_keep

        # send notifications for discarded flows as required by OF spec
        self._announce_flows_deleted(to_delete)

    def flow_modify_strict(self, flow_obj):
        raise Exception("flow_modify_strict(): Not implemented yet")

    def flow_modify(self, flow_obj):
        raise Exception("flow_modify(): Not implemented yet")

    def flow_list(self):
        return self.flows

    def _flow_find_overlapping_flows(self, flow_mod, return_on_first_hit=False):
        """
        Return list of overlapping flow(s)
        Two flows overlap if a packet may match both and if they have the same priority.
        """

    def _flow_find(self, flow):
        for i, f in enumerate(self.flows):
            if self._flows_match(f, flow):
                return i
        return -1

    def _flows_match(self, f1, f2):
        keys_matter = ('table_id', 'priority', 'flags', 'cookie', 'match')
        for key in keys_matter:
            if getattr(f1, key) != getattr(f2, key):
                return False
        return True

    def _flow_matches_spec(self, flow, flow_mod):
        """
        Return True if a given flow (flow_stats_entry) is "covered" by the wildcarded flow
        mod or delete spec (as defined in the flow_mod or flow_delete message); otherwise
        return False.
        """
        #import pdb
        #pdb.set_trace()

        assert isinstance(flow, ofp.common.flow_stats_entry)
        assert isinstance(flow_mod, (ofp.message.flow_delete, ofp.message.flow_mod))

        # Check if flow.cookie is a match for flow_mod cookie/cookie_mask
        if (flow.cookie & flow_mod.cookie_mask) != (flow_mod.cookie & flow_mod.cookie_mask):
            return False

        # Check if flow.table_id is covered by flow_mod.table_id
        if flow_mod.table_id != ofp.OFPTT_ALL and flow.table_id != flow_mod.table_id:
            return False

        # Check out_port
        if flow_mod.out_port != ofp.OFPP_ANY and not self._flow_has_out_port(flow, flow_mod.out_port):
            return False

        # Check out_group
        if flow_mod.out_group != ofp.OFPG_ANY and not self._flow_has_out_group(flow, flow_mod.out_group):
            return False

        # Priority is ignored

        # Check match condition
        # If the flow_mod match field is empty, that is a special case and indicate the flow entry matches
        match = flow_mod.match
        assert isinstance(match, ofp.common.match_v3)
        if not match.oxm_list:
            return True # If we got this far and the match is empty in the flow spec, than the flow matches
        else:
            raise NotImplementedError("_flow_matches_spec(): No flow match analysys yet")

    def _flow_has_out_port(self, flow, out_port):
        """Return True if flow has a output command with the given out_port"""
        assert isinstance(flow, ofp.common.flow_stats_entry)
        for instruction in flow.instructions:
            assert isinstance(instruction, ofp.instruction.instruction)
            if instruction.type == ofp.OFPIT_APPLY_ACTIONS:
                assert isinstance(instruction, ofp.instruction.apply_actions)
                for action in instruction.actions:
                    assert isinstance(action, ofp.action.action)
                    if action.type == ofp.OFPAT_OUTPUT:
                        assert isinstance(action, ofp.action.output)
                        if action.port == out_port:
                            return True

        # otherwise...
        return False

    def _flow_has_out_group(self, flow, out_group):
        """Return True if flow has a output command with the given out_group"""
        assert isinstance(flow, ofp.common.flow_stats_entry)
        for instruction in flow.instructions:
            assert isinstance(instruction, ofp.instruction.instruction)
            if instruction.type == ofp.OFPIT_APPLY_ACTIONS:
                assert isinstance(instruction, ofp.instruction.apply_actions)
                for action in instruction.actions:
                    assert isinstance(action, ofp.action.action)
                    if action.type == ofp.OFPAT_GROUP:
                        assert isinstance(action, ofp.action.group)
                        if action.group_id == out_group:
                            return True

        # otherwise...
        return False

    def _flows_delete_by_group_id(self, group_id):
        """Delete any flow referring to given group id"""
        to_keep = []
        to_delete = []
        for f in self.flows:
            list_to_append = to_delete if self._flow_has_out_group(f, group_id) else to_keep
            list_to_append.append(f)

        # replace flow table with keepers
        self.flows = to_keep

        # send notifications for discarded flows as required by OF spec
        self._announce_flows_deleted(to_delete)

    def _announce_flows_deleted(self, flows):
        for f in flows:
            self._announce_flow_deleted(f)

    def _announce_flow_deleted(self, flow):
        """Send notification to controller if flow is flagged with OFPFF_SEND_FLOW_REM flag"""
        if flow.flags & ofp.OFPFF_SEND_FLOW_REM:
            raise NotImplementedError("_announce_flow_deleted()")

    ## <=========================== GROUP HANDLERS =================================>

    def group_add(self, group_add):
        assert isinstance(group_add, ofp.message.group_add)
        if group_add.group_id in self.groups:
            self.signal_group_mod_error(ofp.OFPGMFC_GROUP_EXISTS, group_add)
        else:
            group_entry = group_entry_from_group_mod_message(group_add)
            self.groups[group_add.group_id] = group_entry

    def group_modify(self, group_modify):
        assert isinstance(group_modify, ofp.message.group_modify)
        if group_modify.group_id not in self.groups:
            self.signal_group_mod_error(ofp.OFPGMFC_INVALID_GROUP, group_modify)
        else:
            # replace existing group entry with new group definition
            group_entry = group_entry_from_group_mod_message(group_modify)
            self.groups[group_modify.group_id] = group_entry

    def group_delete(self, group_delete):
        assert isinstance(group_delete, ofp.message.group_mod)
        if group_delete.group_id == ofp.OFPG_ALL:  # drop all groups
            # we must delete all flows that point to this group and signal controller as
            # requested by the flows' flag

            self.groups = {}
            logging.info("all groups deleted")

        else:
            if group_delete.group_id not in self.groups:
                # per the spec, this is silent;y ignored
                return

            else:
                self._flows_delete_by_group_id(group_delete.group_id)
                del self.groups[group_delete.group_id]
                logging.info("group %d deleted" % group_delete.group_id)

    def group_list(self):
        return [group_entry.group_desc for group_entry in self.groups.values()]

    def group_stats(self):
        return [group_entry.group_stats for group_entry in self.groups.values()]

    ## <=========================== TABLE HANDLERS =================================>

    def table_stats(self):
        """Scan through flow entries and create table stats"""
        stats = {}
        for flow in self.flows:
            table_id = flow.table_id
            entry = stats.setdefault(table_id, ofp.common.table_stats_entry(table_id))
            entry.active_count += 1
            entry.lookup_count += 1  # FIXME how to count these?
            entry.matched_count += 1  # FIXME how to count these?
            stats[table_id] = entry
        return sorted(stats.values(), key=lambda e: e.table_id)