text:
#include "stdafx.h"

#include <sstream>

#include <zorba/diagnostic_list.h>
#include <zorba/internal/cxx_util.h>
#include <zorba/store_consts.h>

#include "runtime/json/json.h"
#include "store/api/item_factory.h"
#include "system/globalenv.h"
#include "types/root_typemanager.h"
#include "types/typeops.h"
#include "util/stl_util.h"
#include "zorbautils/store_util.h"

#include "common.h"
#include "jsonml_common.h"
#include "jsonml_object.h"

// JsonML ("object form") grammar.
//
// Note: there is no "object form" of JsonML.  In a JSON user group thread [1],
// Douglas Crockford incorrectly used the term "JsonML" to describe two
// variants: the "array form" and "object form."  This was a misuse of the term
// JsonML which has always *only* stood to mean what Crockford referred to as
// the "array form."
//
// [1]: <http://groups.yahoo.com/neo/groups/json/conversations/topics/1115>
//
// element
//    = '{' tag-name ',' attribute-list ',' elements '}'
//    | '{' tag-name ',' attribute-list '}'
//    | '{' tag-name ',' elements '}'
//    | '{' tag-name '}'
//    ;
// tag-name
//    "tagName" ':' string
//    ;
// attribute-list
//    = attribute ',' attribute-list
//    | attribute
//    ;
// attribute
//    = attribute-name ':' attribute-value
//    ;
// attribute-name
//    = string
//    ;
// attribute-value
//    = string
//    | number
//    | 'true'
//    | 'false'
//    | 'null'
//    ;
// elements
//    = "childNodes" : '[' element-list ']'
//    = "childNodes" : '[' ']'
//    ;
// element-list
//    = element ',' element-list
//    = element
//    ;

using namespace std;

namespace zorba {
namespace jsonml_object {

///////////////////////////////////////////////////////////////////////////////

// forward declaration
static store::Item_t j2x_object( store::Item_t const &object_item,
                                 store::Item *parent_xml_item );

static void j2x_array( store::Item_t const &array_item,
                       store::Item *parent_xml_item ) {
  store::Item_t item, junk_item;
  zstring value_str;

  store::Iterator_t i( array_item->getArrayValues() );
  i->open();
  while ( i->next( item ) ) {
    switch ( item->getKind() ) {
      case store::Item::ATOMIC:
        value_str = item->getStringValue();
        GENV_ITEMFACTORY->createTextNode(
          junk_item, parent_xml_item, value_str
        );
        break;
      case store::Item::OBJECT:
        j2x_object( item, parent_xml_item );
        break;
      default:
        throw XQUERY_EXCEPTION(
          zerr::ZJ2X0002_JSONML_OBJECT_BAD_JSON,
          ERROR_PARAMS( ZED( ZJ2X0002_BadElement ), item->getKind() )
        );
    } // switch
  } // while
  i->close();
}

static store::Item_t j2x_object( store::Item_t const &object_item,
                                 store::Item *parent_xml_item ) {
  zstring base_uri;
  store::NsBindings ns_bindings;
  store::Item_t element_name, key_item, type_name, xml_item;

  store::Item_t name_item( get_json_value( object_item, "tagName" ) );
  if ( !name_item )
    throw XQUERY_EXCEPTION(
      zerr::ZJ2X0002_JSONML_OBJECT_BAD_JSON,
      ERROR_PARAMS( ZED( ZJ2X0002_tagNameRequired ) )
    );
  GENV_ITEMFACTORY->createQName(
    element_name, "", "", name_item->getStringValue()
  );
  type_name = GENV_TYPESYSTEM.XS_UNTYPED_QNAME;
  GENV_ITEMFACTORY->createElementNode(
    xml_item, parent_xml_item,
    element_name, type_name, false, false, ns_bindings, base_uri
  );

  store::Iterator_t k( object_item->getObjectKeys() );
  k->open();
  while ( k->next( key_item ) ) {
    zstring const key_str( key_item->getStringValue() );
    if ( key_str == "tagName" )
      continue; // already handled
    store::Item_t value_item( object_item->getObjectValue( key_item ) );
    if ( key_str == "childNodes" ) {
      if ( value_item->getKind() != store::Item::ARRAY )
        throw XQUERY_EXCEPTION(
          zerr::ZJ2X0002_JSONML_OBJECT_BAD_JSON,
          ERROR_PARAMS( ZED( ZJ2X0002_childNodesArrayRequired ) )
        );
      j2x_array( value_item, xml_item.get() );
    } else {
      store::Item_t att_name, junk_item;
      GENV_ITEMFACTORY->createQName( att_name, "", "", key_str );
      type_name = GENV_TYPESYSTEM.XS_UNTYPED_QNAME;
      GENV_ITEMFACTORY->createAttributeNode(
        junk_item, xml_item, att_name, type_name, value_item
      );
    }
  } // while
  k->close();
  return xml_item;
}

void json_to_xml( store::Item_t const &json_item, store::Item_t *xml_item ) {
  ZORBA_ASSERT( xml_item );
  switch ( json_item->getKind() ) {
    case store::Item::ARRAY:
      throw XQUERY_EXCEPTION(
        zerr::ZJ2X0002_JSONML_OBJECT_BAD_JSON,
        ERROR_PARAMS( ZED( ZJ2X0002_ObjectRequired ) )
      );
    case store::Item::OBJECT:
      *xml_item = j2x_object( json_item, nullptr );
      break;
    default:
      ZORBA_ASSERT( false );
  }
}

///////////////////////////////////////////////////////////////////////////////

static void x2j_attributes( store::Item_t const &element,
                            vector<store::Item_t> *keys,
                            vector<store::Item_t> *values ) {
  ZORBA_ASSERT( keys );
  ZORBA_ASSERT( values );

  store::Iterator_t i( element->getAttributes() );
  store::Item_t att_item;
  i->open();
  while ( i->next( att_item ) ) {
    zstring const name( name_of( att_item ) );
    if ( name != "xmlns" ) {
      push_back( keys, name );
      push_back( values, att_item->getStringValue() );
    }
  } // while
  i->close();
}

// forward declaration
static void x2j_element( store::Item_t const &element,
                         store::Item_t *json_item );

static void x2j_children( store::Item_t const &parent,
                          vector<store::Item_t> *children ) {
  ZORBA_ASSERT( children );
  store::Iterator_t i( parent->getChildren() );
  i->open();
  store::Item_t child_item, temp_item;
  while ( i->next( child_item ) ) {
    if ( !x2j_map_atomic( child_item, &temp_item ) ) {
      if ( !child_item->isNode() )
        throw XQUERY_EXCEPTION(
          zerr::ZJ2X0002_JSONML_OBJECT_BAD_JSON,
          ERROR_PARAMS( ZED( ZJ2X0002_BadElement ), child_item->getKind() )
        );
      switch ( child_item->getNodeKind() ) {
        case store::StoreConsts::elementNode:
          x2j_element( child_item, &temp_item );
          break;
        case store::StoreConsts::textNode: {
          zstring s( child_item->getStringValue() );
          GENV_ITEMFACTORY->createString( temp_item, s );
          break;
        }
        default:
          continue;
      } // switch
    } // if
    children->push_back( temp_item );
  } // while
  i->close();
}

static void x2j_element( store::Item_t const &element,
                         store::Item_t *json_item ) {
  ZORBA_ASSERT( json_item );
  vector<store::Item_t> keys, values, children;

  push_back( &keys, "tagName" );
  push_back( &values, name_of( element ) );
  x2j_attributes( element, &keys, &values );
  x2j_children( element, &children );
  if ( !children.empty() ) {
    push_back( &keys, "childNodes" );
    store::Item_t temp;
    GENV_ITEMFACTORY->createJSONArray( temp, children );
    values.push_back( temp );
  }
  GENV_ITEMFACTORY->createJSONObject( *json_item, keys, values );
}

void xml_to_json( store::Item_t const &xml_item, store::Item_t *json_item ) {
  ZORBA_ASSERT( json_item );
  switch ( xml_item->getNodeKind() ) {
    case store::StoreConsts::elementNode:
      x2j_element( xml_item, json_item );
      break;
    default:
      throw XQUERY_EXCEPTION( zerr::ZJSE0001_NOT_ELEMENT_NODE );
  }
}

///////////////////////////////////////////////////////////////////////////////

} // namespace jsonml_object
} // namespace zorba
/* vim:set et sw=2 ts=2: */

redpajama_set_name: RedPajamaGithub


text:
"use strict";

module.exports = class SkillClearContext {
    constructor(){
        this.clear_context_on_finish = true;
    }

    async finish(bot, event, context){
    }
}


text:
//
//  RCRecallNotificationMessage.h
//  RongIMLib
//
//  Created by litao on 16/7/15.
//  Copyright © 2016年 RongCloud. All rights reserved.
//

#import <RongIMLib/RongIMLib.h>

/*!
 撤回通知消息的类型名
 */
#define RCRecallNotificationMessageIdentifier @"RC:RcNtf"

/*!
 撤回通知消息类
 */
@interface RCRecallNotificationMessage : RCMessageContent<NSCoding>

/*!
 发起撤回操作的用户ID
 */
@property(nonatomic, strong) NSString *operatorId;

/*!
 撤回的时间(毫秒)
 */
@property(nonatomic, assign) long long recallTime;

/*!
 原消息的消息类型名
 */
@property(nonatomic, strong) NSString *originalObjectName;

@end


text:
ListTree = function(config){
	ListTree.superclass.constructor.call(this, Ext.apply({
		id:'list-tree',
		animate:false,
		//rootVisible:false,
		region:'west',
		width:200,
		split:true,
		title:'My Lists',
		autoScroll:true,
		margins: '3 0 3 3',
		cmargins: '3 3 3 3',
		useArrows:true,
		collapsible:true,
		minWidth:120
	}, config));

	this.on('contextmenu', this.onContextMenu, this);
}
Ext.extend(ListTree, Ext.tree.TreePanel, {

	initComponent : function(){
		this.bbar = [
			tx.actions.newList,
			tx.actions.deleteList,
			'-',
			tx.actions.newFolder,
			tx.actions.deleteFolder
		];

		this.loader = new ListLoader({
			store: tx.data.lists
		});
		ListTree.superclass.initComponent.call(this);

		var root = new Ext.tree.AsyncTreeNode({
	        text: 'All Lists',
			id: 'root',
			leaf: false,
			iconCls: 'icon-folder',
			expanded: true,
			isFolder: true,
			editable: false
	    });
	    this.setRootNode(root);

		this.editor = new Ext.tree.TreeEditor(this, {
	        allowBlank:false,
	        blankText:'A name is required',
	        selectOnFocus:true
	    });
        this.editor.shadow = false;

        this.editor.on('beforecomplete', function(ed, value, startValue){
			var node = ed.editNode;
			value = Ext.util.Format.htmlEncode(value);
			var r = this.store.getById(node.id);
			r.set('listName', value);
			//ed.editing = false;
            //ed.hide();
			//return false;
		}, this);

		this.sorter = new Ext.tree.TreeSorter(this, {
			folderSort: true
		});
	},

	getActiveFolderId : function(){
		var sm = this.selModel;
		var n = sm.getSelectedNode();
		if(n){
			return n.attributes.isFolder ? n.id : n.attributes.parentId;
		}
		return 'root';
	},

	onContextMenu : function(node, e){
        if(!this.menu){ // create context menu on first right click
            this.menu = new Ext.menu.Menu({
                id:'lists-ctx',
				listWidth: 200,
                items: [{
                    iconCls:'icon-edit',
                    text:'New Task',
                    scope: this,
                    handler:function(){
						this.ctxNode.select();
						tx.actions.newTask.execute();
                    }
                },{
                    iconCls:'icon-list-new',
                    text:'New List',
                    scope: this,
                    handler:function(){
						this.ctxNode.select();
						tx.actions.newList.execute();
                    }
                },{
                    iconCls:'icon-folder-new',
                    text:'New Folder',
                    scope: this,
                    handler:function(){
						this.ctxNode.select();
						tx.actions.newFolder.execute();
                    }
                },'-',{
					text:'Delete',
                    iconCls:'icon-list-delete',
                    scope: this,
                    handler:function(){
                        this.removeList(this.ctxNode);
                    }
                }]
            });
            this.menu.on('hide', this.onContextHide, this);
        }
        if(this.ctxNode){
            this.ctxNode.ui.removeClass('x-node-ctx');
            this.ctxNode = null;
        }
        this.ctxNode = node;
        this.ctxNode.ui.addClass('x-node-ctx');

		this.menu.items.get(1).setVisible(!!node.attributes.isFolder);
		this.menu.items.get(2).setVisible(!!node.attributes.isFolder);
		this.menu.items.get(0).setVisible(!node.attributes.isFolder);

		this.menu.showAt(e.getXY());
    },

    onContextHide : function(){
        if(this.ctxNode){
            this.ctxNode.ui.removeClass('x-node-ctx');
            this.ctxNode = null;
        }
    },

	startEdit : function(node, select){
		if(typeof node == 'string'){
			node = this.getNodeById(node);
		}
		if(select === true){
			node.select();
		}
		var ed = this.editor;
		setTimeout(function(){
			ed.editNode = node;
			ed.startEdit(node.ui.textNode);
		}, 10);
	},

	removeList : function(s){
		if (s && s.attributes.editable) {
			Ext.Msg.confirm('Confirm', 'Are you sure you want to delete "' + Ext.util.Format.htmlEncode(s.text) + '"?', function(btn){
				if (btn == 'yes') {
					if (s.nextSibling) {
						s.nextSibling.select();
					}
					else
						if (s.previousSibling) {
							s.previousSibling.select();
						}
					s.parentNode.removeChild(s);
					tx.data.lists.remove(this.store.getById(s.id));
					tx.data.tasks.removeList(s.id);
				}
			}, this);
		}
	}
});


text:
TOP_DIR := $(realpath $(dir $(lastword $(MAKEFILE_LIST))))

ifdef USE_SYMBIFLOW

# A pip `requirements.txt` file.
# https://pip.pypa.io/en/stable/reference/pip_install/#requirements-file-format
REQUIREMENTS_FILE := $(TOP_DIR)/conf/requirements-symbiflow.txt

# A conda `environment.yml` file.
# https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html
ENVIRONMENT_FILE := $(TOP_DIR)/conf/environment-symbiflow.yml

else

# A pip `requirements.txt` file.
# https://pip.pypa.io/en/stable/reference/pip_install/#requirements-file-format
REQUIREMENTS_FILE := $(TOP_DIR)/conf/requirements.txt

# A conda `environment.yml` file.
# https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html
ENVIRONMENT_FILE := $(TOP_DIR)/conf/environment.yml

endif

include third_party/make-env/conda.mk

# Example make target which runs commands inside the conda environment.
test-command: | $(CONDA_ENV_PYTHON)
	@$(IN_CONDA_ENV) echo "Python is $$(which python)"
	@$(IN_CONDA_ENV) python --version

info:
	@echo TOP_DIR: $(TOP_DIR)

SF_INSTALL=env/symbiflow

help:
	@echo
	@echo ================================================================
	@echo " To install SymbiFlow, type 'make install-sf'."
	@echo
	@echo " To enter the SymbiFlow environment so that you can use it,"
	@echo "   type "make enter-sf".  This puts you in a subshell with"
	@echo "   everything set up; type 'exit' to leave."
	@echo ================================================================
	@echo

F4PGA_TIMESTAMP=20220729-181657
F4PGA_HASH=7833050

install-sf:
	@if [ -d "$(SF_INSTALL)" ]; then \
		echo ; \
		echo "$(SF_INSTALL) already exists.  Remove it if you want to reinstall."; \
		echo ; \
		exit 1; \
	fi
	@mkdir -p $(SF_INSTALL)/xc7/install
	wget -qO- https://storage.googleapis.com/symbiflow-arch-defs/artifacts/prod/foss-fpga-tools/symbiflow-arch-defs/continuous/install/${F4PGA_TIMESTAMP}/symbiflow-arch-defs-install-xc7-${F4PGA_HASH}.tar.xz | tar -xJC $(SF_INSTALL)/xc7/install
	wget -qO- https://storage.googleapis.com/symbiflow-arch-defs/artifacts/prod/foss-fpga-tools/symbiflow-arch-defs/continuous/install/${F4PGA_TIMESTAMP}/symbiflow-arch-defs-xc7a50t_test-${F4PGA_HASH}.tar.xz | tar -xJC $(SF_INSTALL)/xc7/install
	wget -qO- https://storage.googleapis.com/symbiflow-arch-defs/artifacts/prod/foss-fpga-tools/symbiflow-arch-defs/continuous/install/${F4PGA_TIMESTAMP}/symbiflow-arch-defs-xc7a100t_test-${F4PGA_HASH}.tar.xz | tar -xJC $(SF_INSTALL)/xc7/install
	wget -qO- https://storage.googleapis.com/symbiflow-arch-defs/artifacts/prod/foss-fpga-tools/symbiflow-arch-defs/continuous/install/${F4PGA_TIMESTAMP}/symbiflow-arch-defs-xc7a200t_test-${F4PGA_HASH}.tar.xz | tar -xJC $(SF_INSTALL)/xc7/install
	$(MAKE) USE_SYMBIFLOW=1 env
	@echo
	@echo "Done installing SymbiFlow.  To enter the environment, type 'make enter-sf', which creates a new subshell, and 'exit' when done."
	@echo

env-sf: install-sf

enter-sf:
	-@export F4PGA_INSTALL_DIR=$(TOP_DIR)/$(SF_INSTALL) && $(MAKE) USE_SYMBIFLOW=1 enter

.PHONY: enter-sf env-sf install-sf info


text:
#include <mpmain.h>
#include <mpprodbi.h>		/* Prototypes f�r ANSI-C */

static char rcsid[]="$Header: /yafra/cvsroot/mapo/source/dbi/MenuOneItem.c,v 1.2 2008-11-02 19:55:37 mwn Exp $";

int MenuOneitem(int *len, char *buffer)
{
	extern BUCHUNG	bch;
	extern int AnzParts;        /* im Arrangement */
	extern char userid[];

	char message[_RECORDLEN];
	char tmp_buffer[_RECORDLEN];
	char *to_buffers[MAX_MENU_ITEMS];
	char referenz[_BEZLEN];
	int status=(int)MPOK;
	int anzparts, i, offset;

	status=MPAPIdb_begintrx(SQLISOLATION_RU, SQLPRIO_NORMAL);
	if (status != (int)MPOK)
		{
		UtilMsg(status, MSGTYP_DBERROR, NULL);
		return((int)MPERROR);
		}

	status = UtilSplitMenubuffer(buffer, to_buffers, (char)NULL);
	if (status != MPOK)
		{
		UtilMsg((int)MPE_CUTBUFFERIN, MSGTYP_ERROR, NULL);
		return((int)MPERROR);
		}

	switch(MENUNR)
		{
		case (unsigned char)_KOLLEKTIV:
			(void)copyTextTo(buffer, bch.ref, (int)_CHAR30);
			break;

		case (unsigned char)_ARRANGEMENT:
			switch(FELDNR)
				{
				case (unsigned char)MARR_TEILNR:
					anzparts=atoi(to_buffers[MARR_TEILNR]);
					if (anzparts < 1)
						anzparts=(int)1;
					else
						anzparts++;
					(void)sprintf(buffer, "%d", anzparts);
					break;
				}
			break;

		case (unsigned char)_DIENSTLEISTUNG:
			switch(FELDNR)
				{
				case (unsigned char)MDL_ORD:
					anzparts=atoi(to_buffers[MDL_ORD]);
					if (anzparts < 1)
						anzparts=(int)1;
					else
						anzparts++;
					(void)sprintf(buffer, "%d", anzparts);
					break;
				}
			break;

		case (unsigned char)_DIENST_ANGEBOT:
			switch(FELDNR)
				{
				case (unsigned char)MDLA_ORD:
					anzparts=atoi(to_buffers[MDLA_ORD]);
					if (anzparts < 1)
						anzparts=(int)1;
					else
						anzparts++;
					(void)sprintf(buffer, "%d", anzparts);
					break;
				}
			break;

		case (unsigned char)_BUCHUNG:
			switch(FELDNR)
				{
				case MBCH_BCHREF:
					sprintf(referenz, "B1*%s", userid);
					(void)copyTextTo(buffer, bch.ref, (int)_CHAR30);
					break;
				}
			break;

		case (unsigned char)_AKTIONSGRP:
			anzparts=atoi(to_buffers[MAKTG_ORD]);
			if (anzparts < 1)
				anzparts=(int)1;
			else
				anzparts++;
			(void)sprintf(buffer, "%d", anzparts);
			break;

		case (unsigned char)_KONT_DETAIL:
			switch(FELDNR)
				{
				case MKOND_MENGE:
					anzparts=atoi(to_buffers[MKOND_MENGE]);
					break;
				case MKOND_MIN:
					anzparts=atoi(to_buffers[MKOND_MIN]);
					break;
				}
			if (anzparts < 1)
				anzparts=(int)1;
			else
				anzparts++;
			(void)sprintf(buffer, "%d", anzparts);
			break;

		case (unsigned char)_KOMM_DETAIL:
			anzparts=atoi(to_buffers[MKOMD_ORD]);
			if (anzparts < 1)
				anzparts=(int)1;
			else
				anzparts++;
			(void)sprintf(buffer, "%d", anzparts);
			break;

		case (unsigned char)_AKTIONS_TYP:
			switch(FELDNR)
				{
				case (unsigned char)MAKTT_PARANR:
					anzparts=atoi(to_buffers[MAKTT_PARANR]);
					if (anzparts < 1)
						anzparts=(int)1;
					else
						anzparts++;
					(void)sprintf(buffer, "%d", anzparts);
					break;
				case (unsigned char)MAKTT_PARAMUSS:
					UtilMsgGet((int)MPI_YES_TRUE, MSGTYP_INFO, message);
					(void)copyTextTo(tmp_buffer, to_buffers[MAKTT_PARAMUSS], (int)_FLAGLEN);
					if (strstr(message, tmp_buffer) != NULL)
						UtilMsgGet((int)MPI_NO_FALSE, MSGTYP_INFO, message);
					(void)strcpy(buffer, message);
					break;
				case (unsigned char)MAKTT_PARAFLAG:
					UtilMsgGet((int)MPI_YES_TRUE, MSGTYP_INFO, message);
					(void)copyTextTo(tmp_buffer, to_buffers[MAKTT_PARAFLAG], (int)_FLAGLEN);
					if (strstr(message, tmp_buffer) != NULL)
						UtilMsgGet((int)MPI_NO_FALSE, MSGTYP_INFO, message);
					(void)strcpy(buffer, message);
					break;
				}
			break;

		case (unsigned char)_DIENST_TRAEGER:
			switch(FELDNR)
				{
				case (unsigned char)MDLT_ANZ:
					anzparts=atoi(to_buffers[MDLT_ANZ]);
					if (anzparts < 1)
						anzparts=(int)1;
					else
						anzparts++;
					(void)sprintf(buffer, "%d", anzparts);
					break;
				}
			break;

		case (unsigned char)_PREIS:
			switch(FELDNR)
				{
				case (unsigned char)MPRE_UNITVON:
					anzparts=atoi(to_buffers[MPRE_UNITVON]);
					if (anzparts < 1)
						anzparts=(int)1;
					else
						anzparts++;
					(void)sprintf(buffer, "%d", anzparts);
					break;
				case (unsigned char)MPRE_UNITBIS:
					anzparts=atoi(to_buffers[MPRE_UNITBIS]);
					if (anzparts < 1)
						anzparts=(int)1;
					else
						anzparts++;
					(void)sprintf(buffer, "%d", anzparts);
					break;
				}
			break;

		case (unsigned char)_SPRACHEN:
			UtilMsgGet((int)MPI_YES_TRUE, MSGTYP_INFO, message);
			switch(FELDNR)
				{
				case (unsigned char)MSPR_DIALOG:
			      (void)copyTextTo(tmp_buffer, to_buffers[MSPR_DIALOG], (int)_FLAGLEN);
			      if (strstr(message, tmp_buffer) != NULL)
				      UtilMsgGet((int)MPI_NO_FALSE, MSGTYP_INFO, message);
			      (void)strcpy(buffer, message);
					break;
				case (unsigned char)MSPR_OUTPUT:
			      (void)copyTextTo(tmp_buffer, to_buffers[MSPR_OUTPUT], (int)_FLAGLEN);
			      if (strstr(message, tmp_buffer) != NULL)
				      UtilMsgGet((int)MPI_NO_FALSE, MSGTYP_INFO, message);
			      (void)strcpy(buffer, message);
					break;
				case (unsigned char)MSPR_GUI:
			      (void)copyTextTo(tmp_buffer, to_buffers[MSPR_GUI], (int)_FLAGLEN);
			      if (strstr(message, tmp_buffer) != NULL)
				      UtilMsgGet((int)MPI_NO_FALSE, MSGTYP_INFO, message);
			      (void)strcpy(buffer, message);
					break;
				}
			break;

		default:
			UtilMsg((int)MPE_NOSELECTTABLE, MSGTYP_ERROR, NULL);
			status=(int)MPERROR;
			break;
		}

	(void)MPAPIdb_committrx();

	UtilSplitFreeMenubuffer(to_buffers);

	return(status);
}


text:
FROM debian:jessie

RUN apt-get update && apt-get install -y php5 php5-dev php-pear phpunit


text:
@interface PodsDummy_Pods_ElemeProjectTests_Kiwi : NSObject
@end
@implementation PodsDummy_Pods_ElemeProjectTests_Kiwi
@end


text:
package com.datawizards.splot.mapper

import com.datawizards.splot.model.PlotAxisValues._
import com.datawizards.splot.model.{Plot, PlotType, PlotsGrid}
import org.knowm.xchart.XYSeries.XYSeriesRenderStyle
import org.knowm.xchart.internal.Series
import org.knowm.xchart._
import org.knowm.xchart.internal.chartpart.Chart
import org.knowm.xchart.style._

import scala.collection.JavaConversions._

object SPlotToXChartMapper {

  def mapPlotToXChart(plot: Plot): Chart[_ <: Styler, _ <: Series] = {
    plot.plotType match {
      case PlotType.Bar => mapCategoryChart(plot)
      case PlotType.Scatter => mapScatterChart(plot)
      case PlotType.Line => mapLineChart(plot)
      case PlotType.Histogram => mapCategoryChart(plot)
      case PlotType.Bubble => mapBubbleChart(plot)
      case PlotType.Pie => mapPieChart(plot)
      case PlotType.Area => mapAreaChart(plot)
      case _ => throw new Exception("Unknown plot type")
    }
  }

  def mapPlotsGridToXChart(plotsGrid: PlotsGrid): List[Chart[_ <: Styler, _ <: Series]] = {
    plotsGrid.plotType match {
      case PlotType.Bar => mapCategoryChartsGrid(plotsGrid)
      case PlotType.Scatter => mapScatterChartsGrid(plotsGrid)
      case PlotType.Line => mapLineChartsGrid(plotsGrid)
      case PlotType.Histogram => mapCategoryChartsGrid(plotsGrid)
      case PlotType.Bubble => mapBubbleChartsGrid(plotsGrid)
      case PlotType.Pie => mapPieChartsGrid(plotsGrid)
      case PlotType.Area => mapAreaChartsGrid(plotsGrid)
      case _ => throw new Exception("Unknown plot type")
    }
  }

  private def mapCategoryChartsGrid(plotsGrid: PlotsGrid): List[Chart[_ <: Styler, _ <: Series]] = {
    val charts = plotsGrid.plots.map(mapCategoryChart).toList
    charts.foreach(ch => ch.getStyler.setLegendVisible(false))
    charts
  }

  private def mapScatterChartsGrid(plotsGrid: PlotsGrid): List[Chart[_ <: Styler, _ <: Series]] = {
    val charts = plotsGrid.plots.map(mapScatterChart).toList
    charts.foreach(ch => ch.getStyler.setLegendVisible(false))
    charts
  }

  private def mapLineChartsGrid(plotsGrid: PlotsGrid): List[Chart[_ <: Styler, _ <: Series]] = {
    val charts = plotsGrid.plots.map(mapLineChart).toList
    charts.foreach(ch => ch.getStyler.setLegendVisible(false))
    charts
  }

  private def mapAreaChartsGrid(plotsGrid: PlotsGrid): List[Chart[_ <: Styler, _ <: Series]] = {
    val charts = plotsGrid.plots.map(mapAreaChart).toList
    charts.foreach(ch => ch.getStyler.setLegendVisible(false))
    charts
  }

  private def mapBubbleChartsGrid(plotsGrid: PlotsGrid): List[Chart[_ <: Styler, _ <: Series]] = {
    val charts = plotsGrid.plots.map(mapBubbleChart).toList
    charts.foreach(ch => ch.getStyler.setLegendVisible(false))
    charts
  }

  private def mapPieChartsGrid(plotsGrid: PlotsGrid): List[Chart[_ <: Styler, _ <: Series]] = {
    val charts = plotsGrid.plots.map(mapPieChart).toList
    charts.foreach(ch => ch.getStyler.setLegendVisible(false))
    charts
  }

  private def mapCategoryChart(plot: Plot): CategoryChart = {
    val chart = new CategoryChartBuilder().build()

    for(series <- plot.series)
      chart.addSeries(series.name, mapXAxisValues(series.xValues), mapYAxisValues(series.yValues))

    mapPlotToChart(plot, chart)

    chart
  }

  private def mapBubbleChart(plot: Plot): BubbleChart = {
    val chart = new BubbleChartBuilder().build()

    for(series <- plot.series)
      chart.addSeries(series.name, mapXAxisValues(series.xValues), mapYAxisValues(series.yValues), mapYAxisValues(series.zValues))

    mapPlotToChart(plot, chart)

    chart
  }

  private def mapPieChart(plot: Plot): PieChart = {
    val chart = new PieChartBuilder().build()

    val seriesCount = plot.series.size
    for(series <- plot.series) {
      for((x,y) <- series.xValues.values zip series.yValues.values) {
        val name = if(seriesCount == 1) x.toString else series.name + " " + x.toString
        chart.addSeries(name, mapYAxisValueType(y))
      }
    }

    mapPlotToChart(plot, chart)

    chart
  }

  private def mapLineChart(plot: Plot): XYChart = mapXYChart(plot)

  private def mapScatterChart(plot: Plot): XYChart = {
    val chart = mapXYChart(plot)
    chart.getStyler.setDefaultSeriesRenderStyle(XYSeriesRenderStyle.Scatter)
    chart
  }

  private def mapAreaChart(plot: Plot): XYChart = {
    val chart = mapXYChart(plot)
    chart.getStyler.setDefaultSeriesRenderStyle(XYSeriesRenderStyle.Area)
    chart
  }

  private def mapXYChart(plot: Plot): XYChart = {
    val chart = new XYChartBuilder().build()

    mapPlotToChart(plot, chart)

    for(series <- plot.series)
      chart.addSeries(series.name, mapXAxisValues(series.xValues), mapYAxisValues(series.yValues))

    chart
  }

  private def mapPlotToChart(plot: Plot, chart: Chart[_, _]): Unit = {
    chart.setWidth(plot.width)
    chart.setHeight(plot.height)
    chart.setTitle(plot.title)
    chart.setXAxisTitle(plot.xTitle)
    chart.setYAxisTitle(plot.yTitle)

    plot.theme(chart)

    val styler: Styler = chart match {
      case c:XYChart => c.getStyler
      case c:CategoryChart => c.getStyler
      case c:BubbleChart => c.getStyler
      case c:PieChart => c.getStyler
    }

    plot.annotations match {
      case Some(b:Boolean) => styler.setHasAnnotations(b)
      case None => ()
    }

    plot.legendVisible match {
      case Some(b:Boolean) => styler.setLegendVisible(b)
      case None => ()
    }
  }

  private def mapXAxisValues(plotAxisValues: XAxisValues): java.util.List[_] =
    plotAxisValues.values.map(x => x.value).toList

  private def mapYAxisValues(plotAxisValues: YAxisValues): java.util.List[_ <: Number] = {
    plotAxisValues
      .values
      .map(mapYAxisValueType)
      .toList
  }

  private def mapYAxisValueType(y: YAxisValueType): Number = y.value match {
    case i:Int => new java.lang.Integer(i)
    case d:Double => new java.lang.Double(d)
    case _ => throw new Exception("Not supported type.")
  }

}


text:
module Project
    (
      Project(..)
    , ProjectCreateParams(..)
    , createProject
    ) where

import Data.UUID
import Data.UUID.V4
import Control.Monad.IO.Class (liftIO)
import Control.Monad.Trans.Reader (asks)

import DeployAppConfig (AppHandler(..), getAppName)

type ProjectID = UUID
type ProjectName = String

data Project = Project
    { projectId :: !ProjectID
    , projectName :: !ProjectName
    }

newtype ProjectCreateParams = ProjectCreateParams ProjectName

createProject :: ProjectCreateParams -> AppHandler Project
createProject (ProjectCreateParams name) = do
  appName <- asks getAppName
  uuid <- liftIO nextRandom
  return $ Project uuid appName


text:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class EnemyHealth : Health {

    protected override void OnDeath()
    {
        base.OnDeath();
        ParticleManager.Instance.EmitAt("EnemyExplosion", transform.position, 10);
		GemThrower.Instance.ThrowGem (transform.position);
        Destroy(gameObject);
    }

    protected override void OnHit()
    {
        SoundManager.PlayClip(1);
        base.OnHit();
    }
}


text:
Describe "PipxPackages" {
    $pipxToolset = (Get-ToolsetContent).pipx
    $testCases = $pipxToolset | ForEach-Object { @{package = $_.package; cmd = $_.cmd} }
    It "<package>" -TestCases $testCases {
        "$cmd" | Should -ReturnZeroExitCode
    }
}


text:
package org.hisp.dhis.trackedentity.action.dataentryform;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
import org.hisp.dhis.program.Program;
import org.hisp.dhis.program.ProgramStage;
import org.hisp.dhis.program.ProgramStageService;

import com.opensymphony.xwork2.Action;

/**
 * @author Viet Nguyen
 * @version $Id$
 */
public class SelectProgramStageDataElementAction
    implements Action
{
    // -------------------------------------------------------------------------
    // Dependency
    // -------------------------------------------------------------------------

    private ProgramStageService programStageService;

    public void setProgramStageService( ProgramStageService programStageService )
    {
        this.programStageService = programStageService;
    }

    // -------------------------------------------------------------------------
    // Getters & Setters
    // -------------------------------------------------------------------------

    private int programStageId;

    public void setProgramStageId( int programStageId )
    {
        this.programStageId = programStageId;
    }

    private List<ProgramStage> programStages;

    public List<ProgramStage> getProgramStages()
    {
        return programStages;
    }

    private ProgramStage programStage;

    public ProgramStage getProgramStage()
    {
        return programStage;
    }

    // -------------------------------------------------------------------------
    // Action implementation
    // -------------------------------------------------------------------------

    @Override
    public String execute()
        throws Exception
    {
        programStage = programStageService.getProgramStage( programStageId );

        if ( programStage != null )
        {

            Program program = programStage.getProgram();

            if ( program != null )
            {

                programStages = new ArrayList<>( program.getProgramStages() );
                for ( ProgramStage ps : programStages )
                {
                    if ( ps.equals( programStage ) )
                    {
                        programStages.remove( ps );
                        break;
                    }
                }

                Collections.sort( programStages, IdentifiableObjectNameComparator.INSTANCE );
            }
        }

        return SUCCESS;
    }
}


text:
// Import
'use strict';

Object.defineProperty(exports, '__esModule', {
	value: true
});
var fsUtil = require('graceful-fs');
var pathUtil = require('path');

// =====================================
// Define Module

var safefs = {

	// =====================================
	// Our own custom functions

	// Get the parent path
	getParentPathSync: function getParentPathSync(path) {
		return path
		// remove trailing slashes
		.replace(/[\/\\]$/, '')
		// remove last directory
		.replace(/[\/\\][^\/\\]+$/, '');
	},

	// Ensure path exists
	// next(err, existed)
	ensurePath: function ensurePath(path, opts, next) {
		// Prepare
		if (next == null) {
			next = opts;
			opts = null;
		}
		opts = opts || {};

		// Check
		safefs.exists(path, function (exists) {
			// Error
			if (exists) return next(null, true);

			// Success
			var parentPath = safefs.getParentPathSync(path);
			safefs.ensurePath(parentPath, opts, function (err) {
				// Error
				if (err) return next(err, false);

				// Success
				safefs.mkdir(path, opts.mode, function () {
					// ignore mkdir error, as if it already exists, then we are winning

					safefs.exists(path, function (exists) {
						// Error
						if (!exists) {
							var _err = new Error('Failed to create the directory: ' + path);
							return next(_err, false);
						}

						// Success
						next(null, false);
					});
				});
			});
		});

		// Chain
		return safefs;
	},

	// =====================================
	// Safe Wrappers for Standard Methods

	// Write File
	// next(err)
	writeFile: function writeFile(path, data, opts, next) {
		// Prepare
		if (next == null) {
			next = opts;
			opts = null;
		}

		// Ensure path
		safefs.ensurePath(pathUtil.dirname(path), opts, function (err) {
			// Error
			if (err) return next(err);

			// Write data
			fsUtil.writeFile(path, data, opts, next);
		});

		// Chain
		return safefs;
	},

	// Append File
	// next(err)
	appendFile: function appendFile(path, data, opts, next) {
		// Prepare
		if (next == null) {
			next = opts;
			opts = null;
		}

		// Ensure path
		safefs.ensurePath(pathUtil.dirname(path), opts, function (err) {
			// Error
			if (err) return next(err);

			// Write data
			fsUtil.appendFile(path, data, opts, next);
		});

		// Chain
		return safefs;
	},

	// Mkdir
	// next(err)
	mkdir: function mkdir(path, mode, next) {
		// Prepare
		if (next == null) {
			next = mode;
			mode = null;
		}
		if (mode == null) {
			mode = 511 & ~process.umask();
		}

		// Action
		fsUtil.mkdir(path, mode, next);

		// Chain
		return safefs;
	},

	// Unlink
	// don't error if the path doesn't already exist
	// next(err)
	unlink: function unlink(path, next) {
		// Stat
		safefs.exists(path, function (exists) {
			if (exists === false) return next();
			fsUtil.unlink(path, next);
		});

		// Chain
		return safefs;
	},

	// Exists
	// next(err)
	exists: function exists(path, next) {
		// Action
		(fsUtil.exists || pathUtil.exists)(path, next);

		// Chain
		return safefs;
	},

	// Exits Sync
	// next(err)
	existsSync: function existsSync(path) {
		/* eslint no-sync: 0 */
		return (fsUtil.existsSync || pathUtil.existsSync)(path);
	}
};

// Add any missing methods
Object.keys(fsUtil).forEach(function (key) {
	var value = fsUtil[key];
	// we do the `!safefs[key]` as we don't want to over-write our own enhancements
	// we do the `value.bind` check, as we may interate across trivial types
	// we do the `Function.prototype.bind` check, as underscore is a function that has it's own bind
	if (!safefs[key] && value && value.bind === Function.prototype.bind) {
		safefs[key] = value.bind(fsUtil);
	}
});

// Export
exports['default'] = safefs;
module.exports = exports['default'];


text:
package org.guvnor.ala.runtime;

import org.guvnor.ala.exceptions.RuntimeOperationException;

/*
 * This interface provides a way to interact with the existing runtimes.
 * It exposes the common lifecycle operations. An implementation of this interface
 * must be provided for each different Runtime Provider.
*/
public interface RuntimeManager {

    /*
    * Checks if the RuntimeId provided as argument is supported by the instance of the RuntimeManager
    * @param RuntimeId
    * @return boolean true if the RuntimeId supplied represent a
    *  Runtime that is supported by this RuntimeManager
    */
    boolean supports( final RuntimeId runtimeId );

    /*
    * Starts the Runtime
    * @param RuntimeId
    */
    void start( final RuntimeId runtimeId ) throws RuntimeOperationException;

    /*
    * Stops the Runtime
    * @param RuntimeId
    */
    void stop( final RuntimeId runtimeId ) throws RuntimeOperationException;

    /*
    * Restarts the Runtime
    * @param RuntimeId
    */
    void restart( final RuntimeId runtimeId ) throws RuntimeOperationException;

    /*
    * Refresh the Runtime
    * @param RuntimeId
    */
    void refresh( final RuntimeId runtimeId ) throws RuntimeOperationException;

    /*
    * Pause the Runtime
    * @param RuntimeId
    */
    void pause( final RuntimeId runtimeId ) throws RuntimeOperationException;

}


text:
/**
 * @file ModeProxy/ProxyManager.cpp
 *
 * @desc ProxyManager manages all registered listeners.
 */

#include <chrono>

#include <Logger/Logger.hpp>
#include <ModeProxy/ProxyManager.hpp>
#include <ModeProxy/ProxyListener.hpp>

namespace mct
{

ProxyManager::ProxyManager(Logger& logger)
 : m_log(logger), m_cleanup_listeners_run(true), m_cleanup_listeners(new std::thread(&ProxyManager::cleanup_listeners, this))
{
}

ProxyManager::~ProxyManager()
{
	m_cleanup_listeners_run = false;

	if (m_cleanup_listeners) {
		m_cleanup_listeners->join();
	}
}

void ProxyManager::add_listener(std::shared_ptr<ProxyListener> listener)
{
	m_log.info("Registering listener at %s:%u which will redirect to %s:%u.", listener->get_listen_host().c_str(), listener->get_listen_port(), listener->get_remote_host().c_str(), listener->get_remote_port());

	std::lock_guard<std::mutex> lock(m_listeners_access);
	m_listeners.push_back(listener);
	listener->async_listen();
}

void ProxyManager::cleanup_listeners()
{
	std::chrono::seconds sleep_duration(10);

	while (m_cleanup_listeners_run) {
		std::this_thread::sleep_for(sleep_duration);
		std::lock_guard<std::mutex> lock(m_listeners_access);

		for (auto it = m_listeners.begin(); it != m_listeners.end(); ++it) {
#if 0
			m_log.debug("cleanup_listeners(), processing %s:%u. use_count(): %u", (*it)->get_listen_host().c_str(), (*it)->get_listen_port(), (*it).use_count());
#endif
			(*it)->remove_dead_sessions();

			if ((*it)->is_dead() && (*it).unique()) {
				m_log.info("Removing dead listener %s:%u.", (*it)->get_listen_host().c_str(), (*it)->get_listen_port());
				it = m_listeners.erase(it);
			}
		}
	}
}

}


text:
package io.crate.operation.operator.any;

import io.crate.metadata.FunctionImplementation;
import io.crate.metadata.FunctionInfo;
import io.crate.operation.operator.LikeOperator;
import io.crate.operation.operator.OperatorModule;
import io.crate.planner.symbol.Function;

import java.util.regex.Pattern;

public class AnyLikeOperator extends AbstractAnyLikeOperator<AnyLikeOperator> {

    public static final String NAME = AnyOperator.OPERATOR_PREFIX + "like";

    static class AnyLikeResolver extends AnyResolver {

        @Override
        public FunctionImplementation<Function> newInstance(FunctionInfo info) {
            return new AnyLikeOperator(info);
        }

        @Override
        public String name() {
            return NAME;
        }
    }

    public static void register(OperatorModule module) {
        module.registerDynamicOperatorFunction(NAME, new AnyLikeResolver());
    }

    public AnyLikeOperator(FunctionInfo info) {
        super(info);
    }

    protected boolean matches(String expression, String pattern) {
        return Pattern.matches(
                LikeOperator.patternToRegex(pattern, LikeOperator.DEFAULT_ESCAPE, true),
                expression
        );
    }
}


text:
#ifndef LIBAMQP_AMQP_TYPES_AMQP_ARRAY_H
#define LIBAMQP_AMQP_TYPES_AMQP_ARRAY_H

#ifdef __cplusplus
extern "C" {
#endif

#include "Codec/Type/Type.h"
#include "AmqpTypes/AmqpLeader.h"

struct amqp_array_t
{
    amqp_leader_t leader;
    amqp_type_t *type;
    size_t size;
    void **elements;
};

extern void amqp_array_initialize_as_null(amqp_context_t *context, amqp_array_t *array);

static inline
int amqp_array_is_null(amqp_array_t *array)
{
    return array->type == 0 && array->elements == 0;
}

extern void amqp_array_initialize(amqp_context_t *context, amqp_array_t *array, size_t size);
extern void amqp_array_initialize_from_type(amqp_context_t *context, amqp_array_t *array, amqp_type_t *type);
extern amqp_array_t *amqp_array_create(amqp_context_t *context, size_t size);
extern amqp_array_t *amqp_array_create_from_type(amqp_context_t *context, amqp_type_t *type);

static inline
void amqp_array_cleanup(amqp_context_t *context, amqp_array_t *array)
{
    amqp_type_cleanup(context, (amqp_amqp_type_t *) array);
}

static inline
size_t amqp_array_count(amqp_array_t *array)
{
    return array->size;
}

static inline
void amqp_array_set(amqp_array_t *array, size_t index, const void *p)
{
    assert(array->type == 0);
    array->elements[index] = (void *) p;
}

static inline
void *amqp_array_get(amqp_array_t *array, size_t index)
{
    assert(array->size > index);
    return array->type ? array->type->value.array.elements[index] : array->elements[index];
}

static inline
amqp_type_t *amqp_array_get_type(amqp_array_t *array, size_t index)
{
    assert(array->type);
    return (amqp_type_t *) amqp_array_get(array, index);
}

#ifdef __cplusplus
}
#endif
#endif


text:
package de.wilhelmgym.quiz.structure;

//Luci & Wiwi

import android.text.TextUtils;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

public class Question {

    public static final int NOOB = 0;
    public static final int EASY = 1;
    public static final int MEDIUM = 2;
    public static final int ADVANCED = 3;
    public static final int HARD = 4;
    public static final int EXTREME = 5;

    private static final String KEY_QUESTION = "question";
    private static final String KEY_LEVEL = "level";
    private static final String KEY_LEVEL_NOOB = "NOOB";
    private static final String KEY_LEVEL_EASY = "EASY";
    private static final String KEY_LEVEL_MEDIUM = "MEDIUM";
    private static final String KEY_LEVEL_ADVANCED = "ADVANCED";
    private static final String KEY_LEVEL_HARD = "HARD";
    private static final String KEY_LEVEL_EXTREME = "EXTREME";
    private static final String KEY_ANSWERS = "answers";
    private static final String KEY_CATEGORY = "category";
    private static final String KEY_PREFERRED_ANSWER_POSITION = "preferredAnswerPosition";

    private String question;
    private Answers answers;
    private String category;
    private int level;

    public Question(String question, Answers answer, String category, int level) {
        this.question = question;
        this.answers = answer;
        this.category = category;
        this.level = level;
    }

    public Question(String question, Answers answer, String category) {
        this(question, answer, category, MEDIUM);
    }

    //TODO test JSON parsing (Heini)
    public static void fromJson(String json){
        try {
            fromJson(new JSONObject(json));
        } catch (JSONException e) {
            e.printStackTrace();
        }
    }

    public static Question fromJson(JSONObject json){
        String question;
        Answers answers = new Answers();
        String category;
        int level = MEDIUM;

        if(!json.has(KEY_QUESTION) || !json.has(KEY_ANSWERS) || !json.has(KEY_CATEGORY) || !json.has(KEY_LEVEL)){
            return null;
        }

        try {

            //Question
            if(TextUtils.isEmpty(json.getString(KEY_QUESTION))){
                return null;
            }
            question = json.getString(KEY_QUESTION);

            //Answers
            JSONArray answersArray = json.getJSONArray(KEY_ANSWERS);
            if(answersArray == null || answersArray.length() < 1){
                return null;
            }
            for (int i = 0; i < answersArray.length(); i++) {
                if(TextUtils.isEmpty(answersArray.getString(i))){
                    return null;
                }
                answers.add(answersArray.getString(i));
            }

            //Category
            if(TextUtils.isEmpty(json.getString(KEY_CATEGORY))){
                return null;
            }
            category = json.getString(KEY_CATEGORY);

            //Level
            switch (json.getString(KEY_LEVEL)){
                case KEY_LEVEL_NOOB:
                    level = NOOB;
                    break;
                case KEY_LEVEL_EASY:
                    level = EASY;
                    break;
                case KEY_LEVEL_MEDIUM:
                    level = MEDIUM;
                    break;
                case KEY_LEVEL_ADVANCED:
                    level = ADVANCED;
                    break;
                case KEY_LEVEL_HARD:
                    level = HARD;
                    break;
                case KEY_LEVEL_EXTREME:
                    level = EXTREME;
                    break;
                default:
                    return null;
            }
            return new Question(question, answers, category, level);

        } catch (JSONException e) {
            e.printStackTrace();
        }
        return null;
    }

    public String getQuestion() {
        return question;
    }

    public void setQuestion(String question) {
        this.question = question;
    }

    public Answers getAnswers() {
        return answers;
    }

    public void setAnswers(Answers answers) {
        this.answers = answers;
    }

    public String getCategory() {
        return category;
    }

    public void setCategory(String category) {
        this.category = category;
    }

    public int getLevel() {
        return level;
    }

    public void setLevel(int level) {
        if (level >= NOOB && level <= EXTREME) {
            this.level = level;
        }
    }
}


text:
package org.apache.pulsar.client.api;

import java.nio.ByteBuffer;
import java.util.List;
import java.util.Map;
import org.apache.pulsar.client.impl.MessageBuilderImpl;

/**
 * Message builder factory. Use this class to create messages to be send to the Pulsar producer
 *
 * @deprecated since 2.0. Use {@link TypedMessageBuilder} as returned by {@link Producer#newMessage()} to create a new
 *             message builder.
 */
@Deprecated
public interface MessageBuilder {

    static MessageBuilder create() {
        return new MessageBuilderImpl();
    }

    /**
     * Finalize the immutable message.
     *
     * @return a {@link Message} ready to be sent through a {@link Producer}
     */
    Message<byte[]> build();

    /**
     * Set the content of the message.
     *
     * @param data
     *            array containing the payload
     */
    MessageBuilder setContent(byte[] data);

    /**
     * Set the content of the message.
     *
     * @param data
     *            array containing the payload
     * @param offset
     *            offset into the data array
     * @param length
     *            length of the payload starting from the above offset
     */
    MessageBuilder setContent(byte[] data, int offset, int length);

    /**
     * Set the content of the message.
     *
     * @param buf
     *            a {@link ByteBuffer} with the payload of the message
     */
    MessageBuilder setContent(ByteBuffer buf);

    /**
     * Sets a new property on a message.
     *
     * @param name
     *            the name of the property
     * @param value
     *            the associated value
     */
    MessageBuilder setProperty(String name, String value);

    /**
     * Add all the properties in the provided map.
     */
    MessageBuilder setProperties(Map<String, String> properties);

    /**
     * Sets the key of the message for routing policy.
     *
     * @param key
     */
    MessageBuilder setKey(String key);

    /**
     * Set the event time for a given message.
     *
     *

     * Applications can retrieve the event time by calling {@link Message#getEventTime()}.
     *
     *

     * Note: currently pulsar doesn't support event-time based index. so the subscribers can't seek the messages by
     * event time.
     *
     * @since 1.20.0
     */
    MessageBuilder setEventTime(long timestamp);

    /**
     * Specify a custom sequence id for the message being published.
     *

     * The sequence id can be used for deduplication purposes and it needs to follow these rules:
     *

     *
sequenceId >= 0
     *
Sequence id for a message needs to be greater than sequence id for earlier messages:
     * sequenceId(N+1) > sequenceId(N)
     *
It's not necessary for sequence ids to be consecutive. There can be holes between messages. Eg. the
     * sequenceId could represent an offset or a cumulative size.
     *

     *
     * @param sequenceId
     *            the sequence id to assign to the current message
     * @since 1.20.0
     */
    MessageBuilder setSequenceId(long sequenceId);

    /**
     * Override the replication clusters for this message.
     *
     * @param clusters
     */
    MessageBuilder setReplicationClusters(List<String> clusters);

    /**
     * Disable replication for this message.
     */
    MessageBuilder disableReplication();
}


text:
using System.Collections.Generic;
using System.IO;
using dotnetlint.Configuration;
using dotnetlint.Rules;
using dotnetlint.Sources;
using Octokit;

namespace dotnetlint.Outputs
{
    public class GitHubPrFormat : OutputFormat
    {
        readonly IGitHubClient _client;

        public GitHubPrFormat(IGitHubClient client)
        {
            _client = client;
        }

        public void Write(TextWriter output,
            TextAndPath sourceText,
            IEnumerable<RuleViolation> violations)
        {
            if (sourceText?.Github.PR <= 0)
            {
                return;
            }

            foreach (var v in violations)
            {
                _client.PullRequest.Comment.Create(sourceText.Github.Owner,
                           sourceText.Github.Repo,
                           sourceText.Github.PR,
                           new PullRequestReviewCommentCreate(v.Message,
                               v.Github.Sha,
                               sourceText.Path,
                               v.Line));
            }
        }
    }
}