text:
import { useEffect, useRef, useState } from 'react'
import { load as safeLoad } from 'js-yaml'
import { useForm } from 'react-hook-form'
import Input from '../Input'
import TextArea from '../TextArea'
import Button from '../Button'
import ErrorMessages from '../ErrorMessages'
import PageHeader from '../PageHeader'
import { useMutateApi } from '../../utils'

export default function ServerForm ({ onFinished, query, parseVariables, serverTables, defaults = {} }) {
  const errorRef = useRef(null)
  const [yamlState, setYamlState] = useState('')
  const { handleSubmit, formState, register, setValue } = useForm({ defaultValues: { ...defaults, console: defaults?.console?.id } })
  const { isSubmitting } = formState

  const { load, loading, data, errors } = useMutateApi({ query })

  useEffect(() => {
    if (!data) return
    if (Object.keys(data).some(key => data[key] && data[key].id)) onFinished()
  }, [data])
  useEffect(() => {
    if (errors) errorRef.current.scrollIntoView()
  }, [errors])

  const onSubmit = (data) => {
    const { id, ...input } = data

    load(parseVariables(input))
  }
  const handleYamlConfig = async (e, { value }) => {
    if (!value) return

    const config = safeLoad(value)

    if (!config || typeof config === 'string' || typeof config === 'number') {
      // Ignore invalid YAML
      setYamlState('')
      return
    }

    // Pick only web used tables
    // const tables = pick(config.databases.local.tables, serverTables)

    setValue('host', config.databases.local.host)
    setValue('port', config.databases.local.port)
    setValue('database', config.databases.local.name)
    setValue('user', config.databases.local.user)
    setValue('password', config.databases.local.password)

    serverTables.forEach(table => setValue(`tables.${table}`, config.databases.local.tables[table]))
  }
  const tableInputs = serverTables.map(name => (
    <Input
      key={'server-table-' + name}
      required
      placeholder={name}
      {...register(`tables.${name}`)}
    />
  ))

  return (
    <form onSubmit={handleSubmit(onSubmit)} className='mx-auto'>
      <ErrorMessages ref={errorRef} errors={errors} />

          <PageHeader title='Info' />
          <Input
            required
            placeholder='Name'
            {...register('name')}
          />
          <Input
            required
            placeholder='Console UUID (BanManager/console.yml)'
            minLength={16}
            {...register('console')}
          />
          <TextArea
            placeholder='Paste YAML BanManager/config.yml (Optional)'
            value={yamlState}
            name='yaml'
            onChange={handleYamlConfig}
          />

          <PageHeader title='Database' />
          <Input
            required
            placeholder='Host'
            {...register('host')}
          />
          <Input
            required
            placeholder='Port'
            {...register('port', { valueAsNumber: true })}
          />
          <Input
            required
            placeholder='Database Name'
            {...register('database')}
          />
          <Input
            required
            placeholder='User'
            {...register('user')}
          />
          <Input
            placeholder='Password'
            type='password'
            {...register('password')}
          />

      <PageHeader title='Database Tables' />
      {tableInputs}
      <Button data-cy='submit-server-form' disabled={isSubmitting} loading={loading}>Save</Button>
    </form>
  )
}


text:
/* */
'use strict';
var ReactRef = require("./ReactRef");
function attachRefs() {
  ReactRef.attachRefs(this, this._currentElement);
}
var ReactReconciler = {
  mountComponent: function(internalInstance, rootID, transaction, context) {
    var markup = internalInstance.mountComponent(rootID, transaction, context);
    if (internalInstance._currentElement && internalInstance._currentElement.ref != null) {
      transaction.getReactMountReady().enqueue(attachRefs, internalInstance);
    }
    return markup;
  },
  unmountComponent: function(internalInstance) {
    ReactRef.detachRefs(internalInstance, internalInstance._currentElement);
    internalInstance.unmountComponent();
  },
  receiveComponent: function(internalInstance, nextElement, transaction, context) {
    var prevElement = internalInstance._currentElement;
    if (nextElement === prevElement && context === internalInstance._context) {
      return ;
    }
    var refsChanged = ReactRef.shouldUpdateRefs(prevElement, nextElement);
    if (refsChanged) {
      ReactRef.detachRefs(internalInstance, prevElement);
    }
    internalInstance.receiveComponent(nextElement, transaction, context);
    if (refsChanged && internalInstance._currentElement && internalInstance._currentElement.ref != null) {
      transaction.getReactMountReady().enqueue(attachRefs, internalInstance);
    }
  },
  performUpdateIfNecessary: function(internalInstance, transaction) {
    internalInstance.performUpdateIfNecessary(transaction);
  }
};
module.exports = ReactReconciler;

redpajama_set_name: RedPajamaGithub


text:
#pragma once

#include "ClusteringSettings.hpp"
#include "EventClusterer.hpp"

#include <limits>

namespace vx {
namespace t3r {

class ClusterXRFCorrector {
 public:
  ClusterXRFCorrector(XRFCorrectionSettings settings);

  void performXRFCorrection(
      std::vector<EventClusterer::Cluster>& clusters, std::size_t minIndex = 0,
      std::size_t maxIndex = std::numeric_limits<std::size_t>::max());

 private:
  XRFCorrectionSettings settings;
};

}  // namespace t3r
}  // namespace vx


text:
package com.qiuqp.mybill.adapter;

import java.text.ParseException;
import java.util.List;

import com.qiuqp.mybill.R;
import com.qiuqp.mybill.adapter.base.ViewHolder;
import com.qiuqp.mybill.bean.Bill;
import com.qiuqp.mybill.bean.BillTotal;
import com.qiuqp.mybill.common.DoubleUtils;
import com.qiuqp.mybill.common.StringUtils;
import com.qiuqp.mybill.common.TimeUtils;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseExpandableListAdapter;
import android.widget.RelativeLayout;
import android.widget.TextView;

public class ListViewBillDetailAdapter extends  BaseExpandableListAdapter  {
	private Context 					context;//运行上下文
	private List<BillTotal> 					groupArray;//数据集合
	private  List<List<Bill>> childArray;
	private LayoutInflater 				listContainer;//视图容器
	private DoubleUtils dUtils;

	    public  ListViewBillDetailAdapter(Context context, List<BillTotal> _groupArray,List<List<Bill>> _childArray)
	    {
	    	this.context = context;
			this.listContainer = LayoutInflater.from(context);	//创建视图容器并设置上下文
			this.groupArray = _groupArray;
			this.childArray=_childArray;
		    dUtils=new DoubleUtils();
	    }
	    @Override
	    public  Object getChild(int  groupPosition, int  childPosition)
	    {
	        return  childArray.get(groupPosition).get(childPosition);
	    }
	    @Override
	    public  long  getChildId(int  groupPosition, int  childPosition)
	    {
	        return  childPosition;
	    }
	    @Override
	    public  int  getChildrenCount(int  groupPosition)
	    {
	        return  childArray.get(groupPosition).size();
	    }
	    @Override
	    public  View getChildView(int  groupPosition, int  childPosition,
	            boolean  isLastChild, View convertView, ViewGroup parent)
	    {
	    	if(convertView==null)
	    	{
	    		convertView = listContainer.inflate(R.layout.list_item_detail_child, null);
	    	}
	    	TextView date = ViewHolder.get(convertView, R.id.view_time);
	    	TextView week = ViewHolder.get(convertView, R.id.view_week);

	    	TextView protect = ViewHolder.get(convertView, R.id.view_feetype);
	    	TextView type = ViewHolder.get(convertView, R.id.view_type);

	    	TextView price = ViewHolder.get(convertView, R.id.view_amount);
	    	RelativeLayout rel_child= ViewHolder.get(convertView, R.id.rel_child);
	    	TextView txt_child_empty = ViewHolder.get(convertView, R.id.txt_child_empty);

			//设置文字和图片
			Bill b = childArray.get(groupPosition).get(childPosition);
			if(b.getFlag()==1)
	    	{
				rel_child.setVisibility(View.GONE);
				txt_child_empty.setVisibility(View.VISIBLE);
				type.setTag(null);
				return convertView;
	    	}
			else
			{
				rel_child.setVisibility(View.VISIBLE);
				txt_child_empty.setVisibility(View.GONE);
			}
			String castPrice;
			String feeType;
			if(b.getFeeType()==1)
			{
				price.setTextColor(context.getResources().getColor(R.color.green));
				castPrice="-"+b.getPrice().toString();
				feeType="支出";
			}
			else
			{
				price.setTextColor(context.getResources().getColor(R.color.red));
				castPrice="+"+b.getPrice().toString();
				feeType="收入";
			}
			try {
				date.setText(TimeUtils.dayForMonth(b.getDate()));
				week.setText(TimeUtils.dayForWeek(b.getDate()));
			} catch (ParseException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			protect.setText(b.getType());
			type.setText("["+feeType+"]");
			type.setTag(b);//设置隐藏参数(实体类)
			price.setText(castPrice);

			return convertView;
	    }
	    // group method stub
	    @Override
	    public  Object getGroup(int  groupPosition)
	    {
	        return  groupArray.get(groupPosition);
	    }
	    @Override
	    public  int  getGroupCount()
	    {
	        return  groupArray.size();
	    }
	    @Override
	    public  long  getGroupId(int  groupPosition)
	    {
	        return  groupPosition;
	    }
	    @Override
	    public  View getGroupView(int  groupPosition, boolean  isExpanded,
	            View convertView, ViewGroup parent)
	    {
	    	//自定义视图
			if (convertView == null) {
				//获取list_item布局文件的视图
				convertView = listContainer.inflate(R.layout.list_item_detail_parent, null);
			}
			//获取list_item布局文件的视图
			TextView month = ViewHolder.get(convertView, R.id.view_month);
			TextView date = ViewHolder.get(convertView, R.id.view_time);
			TextView income =ViewHolder.get(convertView, R.id.view_income);
			TextView consume= ViewHolder.get(convertView, R.id.view_consume);
			TextView balance= ViewHolder.get(convertView, R.id.view_balance);

			//设置文字和图片
			BillTotal b =  groupArray.get(groupPosition);

			month.setText(String.valueOf(b.getMonth())+"月");
			month.setTag(b);//设置隐藏参数(实体类)
			String strmonth=StringUtils.flushRight('0',2,String.valueOf(b.getMonth()));
			date.setText(strmonth+"-01."+strmonth+"-"+TimeUtils.getLastDayByMonth(b.getYear(),b.getMonth()));
			income.setText(b.getIncome());
			income.setTextColor(context.getResources().getColor(R.color.red));
			consume.setText(b.getConsume());
			consume.setTextColor(context.getResources().getColor(R.color.green));
			//Double balance=StringUtils.toDouble(b.getIncome())-StringUtils.toDouble(b.getConsume());
			Double dobbalance=dUtils.sub(StringUtils.toDouble(b.getIncome()), StringUtils.toDouble(b.getConsume()));
			balance.setText(StringUtils.subZeroAndDot(String.valueOf(dobbalance)));
			return convertView;
	    }
	    @Override
	    public  boolean  hasStableIds()
	    {
	        return  false ;
	    }
	    @Override
	    public  boolean  isChildSelectable(int  groupPosition, int  childPosition)
	    {
	        return  true ;
	    }
		 public void refresh(List<BillTotal> _groupArray,List<List<Bill>> _childArray) {
			    groupArray = _groupArray;
			    childArray=_childArray;
		        notifyDataSetChanged();
		    }
}


text:
from __future__ import unicode_literals

import sys
from unittest import skipIf, skipUnless

from django.conf import settings
from django.contrib.staticfiles.storage import staticfiles_storage
from django.test import TestCase
from django.test.client import RequestFactory
from django.utils.encoding import smart_bytes

from pipeline.collector import default_collector
from pipeline.compilers import Compiler, CompilerBase, SubProcessCompiler
from pipeline.exceptions import CompilerError
from pipeline.utils import to_class

from tests.utils import _, pipeline_settings

class FailingCompiler(SubProcessCompiler):
    output_extension = 'junk'

    def match_file(self, path):
        return path.endswith('.coffee')

    def compile_file(self, infile, outfile, outdated=False, force=False):
        command = (("/usr/bin/env", "false",),)
        return self.execute_command(command)

class InvalidCompiler(SubProcessCompiler):
    output_extension = 'junk'

    def match_file(self, path):
        return path.endswith('.coffee')

    def compile_file(self, infile, outfile, outdated=False, force=False):
        command = (
            ("this-exists-nowhere-as-a-command-and-should-fail",),
            infile,
            outfile
        )
        return self.execute_command(command)

class CopyingCompiler(SubProcessCompiler):
    output_extension = 'junk'

    def match_file(self, path):
        return path.endswith('.coffee')

    def compile_file(self, infile, outfile, outdated=False, force=False):
        command = (
            "cp",
            infile,
            outfile
        )
        return self.execute_command(command)

class LineNumberingCompiler(SubProcessCompiler):
    output_extension = 'junk'

    def match_file(self, path):
        return path.endswith('.coffee')

    def compile_file(self, infile, outfile, outdated=False, force=False):
        command = (("/usr/bin/env", "cat"), ("-n",), infile,)
        return self.execute_command(command, stdout_captured=outfile)

class DummyCompiler(CompilerBase):
    output_extension = 'js'

    def match_file(self, path):
        return path.endswith('.coffee')

    def compile_file(self, infile, outfile, outdated=False, force=False):
        return

@pipeline_settings(COMPILERS=['tests.tests.test_compiler.DummyCompiler'])
class DummyCompilerTest(TestCase):
    def setUp(self):
        default_collector.collect()
        self.compiler = Compiler()

    def test_output_path(self):
        compiler_class = self.compiler.compilers[0]
        compiler = compiler_class(verbose=self.compiler.verbose, storage=self.compiler.storage)
        output_path = compiler.output_path("js/helpers.coffee", "js")
        self.assertEqual(output_path, "js/helpers.js")

    def test_compilers_class(self):
        compilers_class = self.compiler.compilers
        self.assertEqual(compilers_class[0], DummyCompiler)

    def test_compile(self):
        paths = self.compiler.compile([
            _('pipeline/js/dummy.coffee'),
            _('pipeline/js/application.js'),
        ])
        self.assertEqual([_('pipeline/js/dummy.js'), _('pipeline/js/application.js')], list(paths))

    def tearDown(self):
        default_collector.clear()

@skipIf(sys.platform.startswith("win"), "requires posix platform")
@pipeline_settings(COMPILERS=['tests.tests.test_compiler.LineNumberingCompiler'])
class CompilerStdoutTest(TestCase):
    def setUp(self):
        default_collector.collect()
        self.compiler = Compiler()

    def test_output_path(self):
        compiler_class = self.compiler.compilers[0]
        compiler = compiler_class(verbose=self.compiler.verbose, storage=self.compiler.storage)
        output_path = compiler.output_path("js/helpers.coffee", "js")
        self.assertEqual(output_path, "js/helpers.js")

    def test_compile(self):
        paths = self.compiler.compile([_('pipeline/js/dummy.coffee')])
        self.assertEqual([_('pipeline/js/dummy.junk')], list(paths))

    def tearDown(self):
        default_collector.clear()

@skipIf(sys.platform.startswith("win"), "requires posix platform")
@pipeline_settings(COMPILERS=['tests.tests.test_compiler.CopyingCompiler'])
class CompilerSelfWriterTest(TestCase):
    def setUp(self):
        default_collector.collect()
        self.compiler = Compiler()

    def test_output_path(self):
        compiler_class = self.compiler.compilers[0]
        compiler = compiler_class(verbose=self.compiler.verbose, storage=self.compiler.storage)
        output_path = compiler.output_path("js/helpers.coffee", "js")
        self.assertEqual(output_path, "js/helpers.js")

    def test_compile(self):
        paths = self.compiler.compile([_('pipeline/js/dummy.coffee')])
        default_collector.collect()
        self.assertEqual([_('pipeline/js/dummy.junk')], list(paths))

    def tearDown(self):
        default_collector.clear()

@pipeline_settings(COMPILERS=['tests.tests.test_compiler.InvalidCompiler'])
class InvalidCompilerTest(TestCase):
    def setUp(self):
        default_collector.collect()
        self.compiler = Compiler()

    def test_compile(self):
        with self.assertRaises(CompilerError) as cm:
            self.compiler.compile([_('pipeline/js/dummy.coffee')])

            e = cm.exception
            self.assertEqual(
                e.command,
                ['this-exists-nowhere-as-a-command-and-should-fail',
                 'pipeline/js/dummy.coffee',
                 'pipeline/js/dummy.junk'])
            self.assertEqual(e.error_output, '')

    def tearDown(self):
        default_collector.clear()

@skipIf(sys.platform.startswith("win"), "requires posix platform")
@pipeline_settings(COMPILERS=['tests.tests.test_compiler.FailingCompiler'])
class FailingCompilerTest(TestCase):
    def setUp(self):
        default_collector.collect()
        self.compiler = Compiler()

    def test_compile(self):
        with self.assertRaises(CompilerError) as cm:
            self.compiler.compile([_('pipeline/js/dummy.coffee')])

            e = cm.exception
            self.assertEqual(e.command, ['/usr/bin/env', 'false'])
            self.assertEqual(e.error_output, '')

    def tearDown(self):
        default_collector.clear()

@skipUnless(settings.HAS_NODE, "requires node")
class CompilerImplementation(TestCase):

    def setUp(self):
        self.compiler = Compiler()
        default_collector.collect(RequestFactory().get('/'))

    def tearDown(self):
        default_collector.clear()

    def _test_compiler(self, compiler_cls_str, infile, expected):
        compiler_cls = to_class(compiler_cls_str)
        compiler = compiler_cls(verbose=False, storage=staticfiles_storage)
        infile_path = staticfiles_storage.path(infile)
        outfile_path = compiler.output_path(infile_path, compiler.output_extension)
        compiler.compile_file(_(infile_path), _(outfile_path), force=True)
        with open(outfile_path) as f:
            result = f.read()
        with staticfiles_storage.open(expected) as f:
            expected = f.read()
        self.assertEqual(smart_bytes(result), expected)

    def test_sass(self):
        self._test_compiler('pipeline.compilers.sass.SASSCompiler',
            'pipeline/compilers/scss/input.scss',
            'pipeline/compilers/scss/expected.css')

    def test_coffeescript(self):
        self._test_compiler('pipeline.compilers.coffee.CoffeeScriptCompiler',
            'pipeline/compilers/coffee/input.coffee',
            'pipeline/compilers/coffee/expected.js')

    def test_less(self):
        self._test_compiler('pipeline.compilers.less.LessCompiler',
            'pipeline/compilers/less/input.less',
            'pipeline/compilers/less/expected.css')

    def test_es6(self):
        self._test_compiler('pipeline.compilers.es6.ES6Compiler',
            'pipeline/compilers/es6/input.es6',
            'pipeline/compilers/es6/expected.js')

    def test_stylus(self):
        self._test_compiler('pipeline.compilers.stylus.StylusCompiler',
            'pipeline/compilers/stylus/input.styl',
            'pipeline/compilers/stylus/expected.css')

    def test_livescript(self):
        self._test_compiler('pipeline.compilers.livescript.LiveScriptCompiler',
            'pipeline/compilers/livescript/input.ls',
            'pipeline/compilers/livescript/expected.js')


text:
package com.google.dataflow.sample.timeseriesflow.metrics;

import com.google.common.collect.ImmutableList;
import com.google.dataflow.sample.timeseriesflow.TimeSeriesData.TSAccum;
import com.google.dataflow.sample.timeseriesflow.TimeSeriesData.TSDataPoint;
import com.google.dataflow.sample.timeseriesflow.TimeSeriesData.TSKey;
import com.google.dataflow.sample.timeseriesflow.common.CommonUtils;
import com.google.dataflow.sample.timeseriesflow.graph.GenerateComputations;
import com.google.dataflow.sample.timeseriesflow.metrics.core.complex.fsi.vwap.VWAPGFn;
import com.google.dataflow.sample.timeseriesflow.metrics.core.complex.fsi.vwap.VWAPGFn.AccumVWAPBuilder;
import com.google.dataflow.sample.timeseriesflow.metrics.core.complex.fsi.vwap.VWAPGFn.VWAPOptions;
import com.google.dataflow.sample.timeseriesflow.metrics.core.complex.rule.ValueInBoundsGFn;
import com.google.dataflow.sample.timeseriesflow.metrics.core.complex.rule.ValueInBoundsGFn.ValueInBoundsOptions;
import com.google.dataflow.sample.timeseriesflow.metrics.core.typeone.Max;
import com.google.dataflow.sample.timeseriesflow.metrics.core.typeone.Min;
import com.google.dataflow.sample.timeseriesflow.metrics.core.typeone.Sum;
import com.google.dataflow.sample.timeseriesflow.test.TSDataTestUtils;
import com.google.gson.stream.JsonReader;
import common.TSTestData;
import java.io.File;
import java.io.FileReader;
import java.util.List;
import java.util.Optional;
import org.apache.beam.sdk.testing.PAssert;
import org.apache.beam.sdk.testing.TestPipeline;
import org.apache.beam.sdk.testing.TestStream;
import org.apache.beam.sdk.transforms.Filter;
import org.apache.beam.sdk.transforms.MapElements;
import org.apache.beam.sdk.transforms.Values;
import org.apache.beam.sdk.transforms.windowing.IntervalWindow;
import org.apache.beam.sdk.values.PCollection;
import org.apache.beam.sdk.values.TypeDescriptors;
import org.joda.time.Duration;
import org.joda.time.Instant;
import org.junit.Rule;
import org.junit.Test;

public class IntegrationMetricTest {

  static final TSKey PRIMARY_MINOR_KEY =
      TSKey.newBuilder().setMajorKey("MajorKey").setMinorKeyString("PRICE").build();
  static final TSKey LOWER_MINOR_KEY =
      TSKey.newBuilder().setMajorKey("MajorKey").setMinorKeyString("BID").build();
  static final TSKey UPPER_MINOR_KEY =
      TSKey.newBuilder().setMajorKey("MajorKey").setMinorKeyString("ASK").build();

  static final String PRIMARY_METRIC = "VWAP";

  static final Instant START = Instant.parse("2000-01-01T00:00:00Z");

  private static final String PRICE = "PRICE";

  @Rule public final transient TestPipeline p = TestPipeline.create();

  static final Instant NOW = Instant.parse("2000-01-01T00:00:00Z");

  @Test
  public void testVWAPWithinBounds() throws Exception {

    String resourceName = "VWAPWithinBoundTest.json";
    ClassLoader classLoader = getClass().getClassLoader();
    File file = new File(classLoader.getResource(resourceName).getFile());
    String absolutePath = file.getAbsolutePath();

    List<String> majorKeys =
        ImmutableList.of(
            TSDataTestUtils.KEY_A_A.getMajorKey(), TSDataTestUtils.KEY_B_A.getMajorKey());

    VWAPOptions vwapOptions = p.getOptions().as(VWAPOptions.class);
    vwapOptions.setVWAPKeyNamePattern("Key-(.*)");
    vwapOptions.setVWAPPriceName(PRICE);
    vwapOptions.setTypeOneComputationsLengthInSecs(5);
    vwapOptions.setTypeTwoComputationsLengthInSecs(5);

    ValueInBoundsOptions options = vwapOptions.as(ValueInBoundsOptions.class);

    options.setValueInBoundsPrimaryMinorKeyName(PRIMARY_MINOR_KEY.getMinorKeyString());
    options.setValueInBoundsPrimaryMetricName(PRIMARY_METRIC);

    options.setValueInBoundsLowerBoundaryMinorKeyName(LOWER_MINOR_KEY.getMinorKeyString());
    options.setValueInBoundsUpperBoundaryMinorKeyName(UPPER_MINOR_KEY.getMinorKeyString());

    options.setValueInBoundsOutputMetricName("OUTPUT");

    options.setValueInBoundsMajorKeyName(majorKeys);

    TSTestData tsTestData =
        TSTestData.toBuilder()
            .setInputTSDataFromJSON(
                new JsonReader(new FileReader(absolutePath)),
                Duration.standardSeconds(5),
                Duration.standardSeconds(5))
            .build();

    TestStream<TSDataPoint> stream = tsTestData.inputTSData();

    options.setGapFillEnabled(true);
    options.setAbsoluteStopTimeMSTimestamp(NOW.plus(Duration.standardSeconds(15)).getMillis());
    options.setEnableHoldAndPropogateLastValue(true);

    GenerateComputations generateComputations =
        GenerateComputations.fromPiplineOptions(vwapOptions)

            //            .setPerfectRectangles(
            //                PerfectRectangles.withWindowAndAbsoluteStop(
            //
            // Duration.standardSeconds(vwapOptions.getTypeOneComputationsLengthInSecs()),
            //                        NOW.plus(Duration.standardSeconds(15)))
            //                    .enablePreviousValueFill())
            .setBasicType1Metrics(ImmutableList.of(Sum.class, Min.class, Max.class))
            .setComplexType2Metrics(ImmutableList.of(VWAPGFn.class))
            .setPostProcessRules(ValueInBoundsGFn.class)
            .build();

    /*
        Key A - 2000-01-01T00:00:00Z PriceVol 10.0
        Key A - 2000-01-01T00:00:00Z QTY 2.0
        VWAP 2000-01-01T00:00:00Z-> 2000-01-01T00:00:05Z = (10*2)/2 = 10

        Key - A GapFill
        ASK 2000-01-01T00:00:05Z-> 2000-01-01T00:00:10Z = 8
        BID 2000-01-01T00:00:05Z-> 2000-01-01T00:00:10Z = 6
        VWAP 2000-01-01T00:00:05Z-> 2000-01-01T00:00:10Z = ZERO
        OUTPUT Check if last VWAP ( 10 ) is within 8-6 bound = 8

        Key A - 2000-01-01T00:00:11Z PriceVol 10.0
        Key A - 2000-01-01T00:00:11Z QTY 2.0
        VWAP 2000-01-01T00:00:10Z-> 2000-01-01T00:00:15Z = (10*2)/2 = 10

    */

    PCollection<TSAccum> testStream =
        p.apply(stream)
            .apply(generateComputations)
            .apply(Values.create())
            .apply(Filter.by(x -> x.getKey().getMinorKeyString().equals(PRICE)));

    String outputName = options.getValueInBoundsOutputMetricName();

    PCollection<String> vwapresult =
        testStream.apply(
            "MapElement_T1",
            MapElements.into(TypeDescriptors.strings())
                .via(
                    x ->
                        x.getKey().getMajorKey()
                            + "::"
                            + Optional.ofNullable(x.getDataStoreMap().get(AccumVWAPBuilder.VWAP))
                                .orElse(CommonUtils.createNumData(999D))
                                .getDoubleVal()));

    PCollection<String> ruleResult =
        testStream.apply(
            "MapElement_T2",
            MapElements.into(TypeDescriptors.strings())
                .via(
                    x ->
                        x.getKey().getMajorKey()
                            + "::"
                            + outputName
                            + "::"
                            + Optional.ofNullable(x.getDataStoreMap().get(outputName))
                                .orElse(CommonUtils.createNumData(999D))
                                .getDoubleVal()));

    PAssert.that(vwapresult)
        .inWindow(
            new IntervalWindow(new Instant("2000-01-01T00:00:00Z"), Duration.standardSeconds(5)))
        .containsInAnyOrder("Key-A::10.0")
        .inWindow(
            new IntervalWindow(new Instant("2000-01-01T00:00:05Z"), Duration.standardSeconds(5)))
        .containsInAnyOrder("Key-A::0.0")
        .inWindow(
            new IntervalWindow(new Instant("2000-01-01T00:00:10Z"), Duration.standardSeconds(5)))
        .containsInAnyOrder("Key-A::10.0");

    PAssert.that(ruleResult)
        .inWindow(
            new IntervalWindow(new Instant("2000-01-01T00:00:00Z"), Duration.standardSeconds(5)))
        .containsInAnyOrder("Key-A::OUTPUT::10.0")
        .inWindow(
            new IntervalWindow(new Instant("2000-01-01T00:00:05Z"), Duration.standardSeconds(5)))
        .containsInAnyOrder("Key-A::OUTPUT::8.0")
        .inWindow(
            new IntervalWindow(new Instant("2000-01-01T00:00:10Z"), Duration.standardSeconds(5)))
        .containsInAnyOrder("Key-A::OUTPUT::10.0");

    p.run();
  }
}


text:
          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse">
            Toggle navigation

          </button>
          Web Development

Home

About

Contact

Project-ZC

Login

Hello, world!

This is a template for a simple marketing or informational website.

Learn more »

					<input type="checkbox" ng-model="todo.done">
					 {{todo.text}}

Todo List

        	{{remaining() }} of {{todos.length}} remaining

            	<input type="checkbox" ng-model="todo.done">
					{{todo.text}}

              blabla

            Dapibus ac facilisis in
            Morbi leo risus
            Porta ac consectetur ac
            Vestibulum at eros

List group item heading

Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.

List group item heading

Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.

List group item heading

Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.

      	<form ng-submit="addTodo()">
			<input type="text" ng-model="todoText" size="30" placeholder="Add new todo">
			<input class="btn-primary" type="submit" value="add">
		</form>


text:
package floobits.common.protocol.buf;

import floobits.common.Encoding;
import floobits.common.OutboundRequestHandler;
import floobits.common.protocol.handlers.FlooHandler;
import floobits.common.interfaces.IContext;
import floobits.common.interfaces.IFile;
import floobits.common.protocol.FlooPatch;
import floobits.utilities.Flog;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.codec.digest.DigestUtils;

import java.nio.charset.Charset;

public class BinaryBuf extends Buf <byte[]> {

    public BinaryBuf(String path, Integer id, byte[] buf, String md5, IContext context, OutboundRequestHandler outbound) {
        super(path, id, buf, md5, context, outbound);
        this.encoding = Encoding.BASE64;
    }

    synchronized public void read () {
        IFile virtualFile = getVirtualFile();
        if (virtualFile == null) {
            Flog.warn("Couldn't get virtual file in readFromDisk %s", this);
            return;
        }

        final byte[] bytes = virtualFile.getBytes();
        if (bytes == null) {
            Flog.warn("Could not get byte array contents for file %s", this);
            return;
        }
        buf = bytes;
        md5 = DigestUtils.md5Hex(bytes);
    }

    public void write() {
        context.writeThread(new Runnable() {
            @Override
            public void run() {
                if (!isPopulated()) {
                    Flog.warn("Unable to write %s because it's not populated yet.", path);
                    return;
                }
                IFile virtualFile = getVirtualFile();
                if (virtualFile == null) {
                    virtualFile = createFile();
                    if (virtualFile == null) {
                        context.errorMessage("Unable to write file. virtualFile is null.");
                        return;
                    }
                }
                FlooHandler flooHandler = context.getFlooHandler();
                if (flooHandler == null) {
                    return;
                }
                synchronized (context) {
                    try {
                        context.setListener(false);
                        if (!virtualFile.setBytes(buf)) {
                            Flog.warn("Writing binary content to disk failed. %s", path);
                        }
                    } finally {
                        context.setListener(true);
                    }
                }
            }
        });
    }

    synchronized public void set (String s, String md5) {
        buf = s == null ? new byte[]{} : Base64.decodeBase64(s.getBytes(Charset.forName("UTF-8")));
        this.md5 = md5;
    }

    synchronized public void set (byte[] s, String md5) {
        buf = s;
        this.md5 = md5;
    }

    public String serialize() {
        return new String(Base64.encodeBase64(buf));
    }

    public void patch(FlooPatch res) {
        FlooHandler flooHandler = context.getFlooHandler();
        if (flooHandler == null) {
            return;
        }
        flooHandler.outbound.getBuf(this.id);
        set((byte[]) null, null);
    }

    public void send_patch(IFile virtualFile) {
        FlooHandler flooHandler = context.getFlooHandler();
        if (flooHandler == null) {
            return;
        }
        byte[] contents = virtualFile.getBytes();
        if (contents == null) {
            Flog.warn("Couldn't read contents of binary file. %s", virtualFile);
            return;
        }
        String after_md5 = DigestUtils.md5Hex(contents);
        if (md5.equals(after_md5)) {
            Flog.debug("Binary file change event but no change in md5 %s", virtualFile);
            return;
        }
        set(contents, after_md5);
        flooHandler.outbound.setBuf(this);
    }
}


text:
<?php

namespace app\models;

use yii\base\Model;

class Refsys extends Model{

    public static function process(Operation_OPEN $operation){

        $refsys = explode(';', \Yii::$app->settings->get('case', 'refsys'));

        $user = User::findOne(['id' => $operation->user_id]);
        foreach ($refsys as $r){
            if(!$user = $user->sponsor){
                break;
            }
            $ref_oper = Operation::create('REF');
            $ref_oper->user_id = $user->id;
            $ref_oper->sum = $operation->sum * $r / 100;
            $ref_oper->memo = 'Рефские ' . $r . '%';
            $ref_oper->setUsernameById();
            $ref_oper->confirm();
        }
    }

}


text:
package mns_open

//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.
//
// Code generated by Alibaba Cloud SDK Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.

import (
	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
)

// SetTopicAttributes invokes the mns_open.SetTopicAttributes API synchronously
func (client *Client) SetTopicAttributes(request *SetTopicAttributesRequest) (response *SetTopicAttributesResponse, err error) {
	response = CreateSetTopicAttributesResponse()
	err = client.DoAction(request, response)
	return
}

// SetTopicAttributesWithChan invokes the mns_open.SetTopicAttributes API asynchronously
func (client *Client) SetTopicAttributesWithChan(request *SetTopicAttributesRequest) (<-chan *SetTopicAttributesResponse, <-chan error) {
	responseChan := make(chan *SetTopicAttributesResponse, 1)
	errChan := make(chan error, 1)
	err := client.AddAsyncTask(func() {
		defer close(responseChan)
		defer close(errChan)
		response, err := client.SetTopicAttributes(request)
		if err != nil {
			errChan <- err
		} else {
			responseChan <- response
		}
	})
	if err != nil {
		errChan <- err
		close(responseChan)
		close(errChan)
	}
	return responseChan, errChan
}

// SetTopicAttributesWithCallback invokes the mns_open.SetTopicAttributes API asynchronously
func (client *Client) SetTopicAttributesWithCallback(request *SetTopicAttributesRequest, callback func(response *SetTopicAttributesResponse, err error)) <-chan int {
	result := make(chan int, 1)
	err := client.AddAsyncTask(func() {
		var response *SetTopicAttributesResponse
		var err error
		defer close(result)
		response, err = client.SetTopicAttributes(request)
		callback(response, err)
		result <- 1
	})
	if err != nil {
		defer close(result)
		callback(nil, err)
		result <- 0
	}
	return result
}

// SetTopicAttributesRequest is the request struct for api SetTopicAttributes
type SetTopicAttributesRequest struct {
	*requests.RpcRequest
	TopicName      string           `position:"Query" name:"TopicName"`
	MaxMessageSize requests.Integer `position:"Query" name:"MaxMessageSize"`
	EnableLogging  requests.Boolean `position:"Query" name:"EnableLogging"`
}

// SetTopicAttributesResponse is the response struct for api SetTopicAttributes
type SetTopicAttributesResponse struct {
	*responses.BaseResponse
	RequestId string `json:"RequestId" xml:"RequestId"`
	Code      int64  `json:"Code" xml:"Code"`
	Status    string `json:"Status" xml:"Status"`
	Message   string `json:"Message" xml:"Message"`
	Success   bool   `json:"Success" xml:"Success"`
	Data      Data   `json:"Data" xml:"Data"`
}

// CreateSetTopicAttributesRequest creates a request to invoke SetTopicAttributes API
func CreateSetTopicAttributesRequest() (request *SetTopicAttributesRequest) {
	request = &SetTopicAttributesRequest{
		RpcRequest: &requests.RpcRequest{},
	}
	request.InitWithApiInfo("Mns-open", "2022-01-19", "SetTopicAttributes", "mns", "openAPI")
	request.Method = requests.POST
	return
}

// CreateSetTopicAttributesResponse creates a response to parse from SetTopicAttributes response
func CreateSetTopicAttributesResponse() (response *SetTopicAttributesResponse) {
	response = &SetTopicAttributesResponse{
		BaseResponse: &responses.BaseResponse{},
	}
	return
}


text:
class InclusionRule {
public:
  virtual ~InclusionRule() = 0;

  // Compares sequence to consensus and returns true if
  // they are similar enough and false otherwise.
  virtual bool Check(Seq *seq, Seq *cons) = 0;
};

#endif


text:
//
//  Downloader.m
//  EasyAR3D
//
//  Created by Qinsi on 9/20/16.
//
//

#import "Downloader.h"
#import "Auth.h"
#import "SPARUtil.h"

@interface Downloader () <NSURLSessionDownloadDelegate>
@property (nonatomic, copy) void (^completionHandler)(NSError *error);
/**
 设置进度条的blcok
 */
@property (nonatomic, copy) void (^progressHandler)(NSString *taskName, float progress);

/**
 加载本地数据的url
 */
@property (nonatomic, retain) NSURL *targetURL;
@end

@implementation Downloader

static NSString *kTaskName = @"Download";
static NSString *kPackagesPath = @"packages";
static NSString *kTargetsPath = @"targets";

/**
 返回字符串"packages"
 */
+ (NSString *)packagesPath {
    return kPackagesPath;
}

/**
 返回字符串"targets"
 */
+ (NSString *)targetsPath {
    return kTargetsPath;
}

/**
 返回加密之后的文件名

 @param url  - 本地文件名
 return 加密后的文件名
 */
+ (NSString *)getLocalNameForURL:(NSString *)url {
    return [Auth sha1Hex:url];
}

/**
 返回support路径下的某一个目录的全路径

 @param path - 路径名
 @return Support目录下的某一个目录的全路径
 */
+ (NSString *)getDownloadPath:(NSString *)path {
    NSString *dir = [SPARUtil getSupportDirectory];
    NSString *targetPath = [dir stringByAppendingPathComponent:path];
    [SPARUtil ensureDirectory:targetPath];
    return targetPath;
}

/**
 下载操作,将下载文件移到指定目录

 @param url - 下载的url
 @param dst - 文件的目标路径
 @param force - Yes:判断文件是否存在,如果存在则将文件删除;No:文件存在时则不下载该文件
 @param completionHandler - 下载完成将出错信息作为block的传入参数
 @param progressHandler - 可以得到下载的进度,设置UI的进度
 */
- (void)download:(NSString *) url to:(NSString *) dst force:(bool) force
completionHandler:(void (^)(NSError *err)) completionHandler progressHandler:(void (^)(NSString *taskName, float progress)) progressHandler {
    NSError *error;
    NSFileManager *fm = [NSFileManager defaultManager];
    bool fileExists = [fm fileExistsAtPath:dst];
    if (fileExists) {
        if (!force) {
            completionHandler(nil);
            return;
        }
        [fm removeItemAtPath:dst error:&error];
        if (error) {
            completionHandler(error);
            return;
        }
    }
    NSString *path = [dst stringByDeletingLastPathComponent];
    // 文件的上一级路径是否存在
    bool pathExists = [fm fileExistsAtPath:path];
    if (!pathExists) {
        [fm createDirectoryAtPath:path withIntermediateDirectories:YES attributes:nil error:&error];
        if (error) {
            completionHandler(error);
            return;
        }
    }
    self.targetURL = [NSURL fileURLWithPath:dst];
    self.completionHandler = completionHandler;
    self.progressHandler = progressHandler;

    if ([url hasPrefix:@"assets://"]) {//add by liugang
        [self copyFileAsync:url dest:dst];
    }else{
        NSURLSession *session = [NSURLSession sessionWithConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration]
                                                              delegate:self
                                                         delegateQueue:nil];
        NSURLSessionDownloadTask *task = [session downloadTaskWithURL:[NSURL URLWithString:url]];
        [task resume];
    }
}

/**
 将文件复制到目标路径

 @param sourceAssertPath - 原路径
 @param destPath - 目标路径
 */
- (void)copyFileAsync:(NSString*)sourceAssertPath dest:(NSString*)destPath{
    __weak Downloader * weak_self = self;
    UInt64 recordTime = [[NSDate date] timeIntervalSince1970]*1000;

    dispatch_async(dispatch_get_global_queue(0, 0), ^{
        //load your data here.
        UInt64 recordTime2 = [[NSDate date] timeIntervalSince1970]*1000;
        __strong Downloader * strong_self = weak_self;

        //  assert://aaa.dmg
        NSString* fn;
        NSString* ofType;
        if ([sourceAssertPath hasPrefix:@"assets://"]) {
            NSRange range = NSMakeRange(@"assets://".length, sourceAssertPath.length-@"assets://".length);
            NSString* temp=[sourceAssertPath substringWithRange:range];
            range = [temp rangeOfString:@"."];
            if (range.location != NSNotFound){
                fn=[temp substringToIndex:range.location];
                ofType=[temp substringFromIndex:range.location+1];
            }
        }
        NSString* sourcePath =[[NSBundle mainBundle] pathForResource:fn ofType:ofType];
        NSFileManager*fileManager =[NSFileManager defaultManager];
        NSError*error;
      //  NSArray *paths = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES);
      //  NSString* destPath= [[paths firstObject] stringByAppendingPathComponent:@"genymotion.dmg"];
        NSLog(@"%@", destPath);
        //[ViewController ensureDirectory:[paths firstObject] ];
        [fileManager copyItemAtPath:sourcePath toPath:destPath error:&error];

        UInt64 endTime2 = [[NSDate date] timeIntervalSince1970]*1000;
        NSLog(@"gcd copy file cost %llu ms",endTime2-recordTime2);
        dispatch_async(dispatch_get_main_queue(), ^{
            //update UI in main thread.
            strong_self.completionHandler(error);
        });
    });

    UInt64 endTime = [[NSDate date] timeIntervalSince1970]*1000;

    NSLog(@"copy file cost %llu ms",endTime-recordTime);
}

#pragma mark -NSURLSessionDownloadDelegate
/**
 下载过程中调用,将taskName和下载进度传给progressHandler

 @param session - 会话
 @param downloadTask - 下载任务
 @param bytesWritten - 已经写入的数据
 @param totalBytesWritten - 下载过的字节大小
 @param totalBytesExpectedToWrite - 要下载文件全部字节大小
 */
- (void)URLSession:(NSURLSession *)session downloadTask:(NSURLSessionDownloadTask *)downloadTask didWriteData:(int64_t)bytesWritten totalBytesWritten:(int64_t)totalBytesWritten totalBytesExpectedToWrite:(int64_t)totalBytesExpectedToWrite {
#pragma unused (session, downloadTask, bytesWritten)
    float prog = totalBytesWritten / (float)totalBytesExpectedToWrite;
    if (totalBytesExpectedToWrite < 0) {
        prog = 0;
    }
    self.progressHandler(kTaskName, prog);
}

/**
  当下载完成时调用,能够处理下载出错时的情况,URLSession:downloadTask:didFinishDownloadingToURL:之后调用,将错误信息传给completionHandler

 @param session - 会话
 @param task - 任务
 @param error - 错误信息
 */
- (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didCompleteWithError:(NSError *)error {
#pragma unused (session, task)
    if (error) {
        self.completionHandler(error);
        [session finishTasksAndInvalidate];
    }
}

#pragma mark -NSURLSessionTaskDelegate
/**
 下载操作完成调用,将文件移到指定的目录 targer.url,将错误信息传给completionHandler
 */
- (void)URLSession:(NSURLSession *)session downloadTask:(NSURLSessionDownloadTask *)downloadTask didFinishDownloadingToURL:(NSURL *)location {
#pragma unused (session, downloadTask)
    NSFileManager *fm = [NSFileManager defaultManager];
    NSError *error;
    [fm moveItemAtURL:location toURL:self.targetURL error:&error];
    self.completionHandler(error);
    [session finishTasksAndInvalidate];
}

@end


text:
function _load_golden_bash_files() {
  subdirectory="$1"
  if [ ! -d "${GOLDEN_BASH}/${subdirectory}/enabled" ]
  then
    continue
  fi
  FILES="${GOLDEN_BASH}/${subdirectory}/enabled/*.bash"
  for config_file in $FILES
  do
    if [ -e "${config_file}" ]; then
      source $config_file
    fi
  done
}

function reload_aliases() {
  _load_golden_bash_files "aliases"
}

function reload_completion() {
  _load_golden_bash_files "completions"
}

function reload_plugins() {
  _load_golden_bash_files "plugins"
}

golden-bash() {
  about 'golden-bash help and maintenance'
  param '1: verb [one of: help | show | enable | disable ]'
  param '2: component type [one of: plugin(s) | alias(es) | completion(s) ]'
  param '3: specific component [optional]'
  example '$ golden-bash show plugins'
  example '$ golden-bash help aliases'
  example '$ golden-bash enable plugin git'
  example '$ golden-bash disable alias hg'

  typeset verb=${1:-}
  shift
  typeset component=${1:-}
  shift
  typeset func
  case $verb in
    show)
      func=_golden-bash-$component;;
    enable)
      func=_enable-$component;;
    disable)
      func=_disable-$component;;
    help)
      func=_help-$component;;
    *)
      reference golden-bash
      return;;
  esac

  # pluralize component if necessary
  if ! _is_function $func; then
    if _is_function ${func}s; then
      func=${func}s
    else
      if _is_function ${func}es; then
        func=${func}es
      else
        echo "oops! $component is not a valid option!"
        reference golden-bash
        return
      fi
    fi
  fi
  $func $*
}

function _is_function() {
  _about 'sets $? to true if parameter is the name of a function'
  _param '1: name of alleged function'
  _group 'lib'
  [ -n "$(type -a $1 2>/dev/null | grep 'is a function')" ]
}

_golden-bash-plugins() {
  _about 'summarizes available golden-bash plugins'
  _group 'lib'
  _golden_bash_describe "plugins" "a" "plugin" "Plugin"
}

_golden-bash-aliases() {
  _about 'summarizes available golden-bash aliases'
  _group 'lib'
  _golden_bash_describe "aliases" "an" "alias" "Alias"
}

_golden-bash-completions() {
  _about 'summarizes available golden-bash completions'
  _group 'lib'
  _golden_bash_describe "completions" "a" "completion" "Completion"
}

function _golden_bash_describe() {
  _about 'summarizes available golden-bash components'
  _param '1: subdirectory'
  _param '2: preposition'
  _param '3: file_type'
  _param '4: column_header'
  _example '$ _golden_bash_describe "plugins" "a" "plugin" "Plugin"'

  subdirectory="$1"
  preposition="$2"
  file_type="$3"
  column_header="$4"

  typeset f
  typeset enabled
  printf "%-20s%-10s%s\n" "$column_header" 'Enabled?' 'Description'
  for f in $GOLDEN_BASH/$subdirectory/available/*.bash
  do
    if [ -e $GOLDEN_BASH/$subdirectory/enabled/$(basename $f) ]; then
      enabled='x'
    else
      enabled=' '
    fi
    printf "%-20s%-10s%s\n" "$(basename $f | cut -d'.' -f1)" "  [$enabled]" "$(cat $f | metafor about-$file_type)"
  done
  printf '\n%s\n' "to enable $preposition $file_type, do:"
  printf '%s\n' "$ golden-bash enable $file_type <$file_type name> -or- $ golden-bash enable $file_type all"
  printf '\n%s\n' "to disable $preposition $file_type, do:"
  printf '%s\n' "$ golden-bash disable $file_type <$file_type name> -or- $ golden-bash disable $file_type all"
}

_disable-plugin() {
  _about 'disables golden-bash plugin'
  _param '1: plugin name'
  _example '$ disable-plugin rvm'
  _group 'lib'
  _disable_thing "plugins" "plugin" $1
}

_disable-alias() {
  _about 'disables golden-bash alias'
  _param '1: alias name'
  _example '$ disable-alias git'
  _group 'lib'
  _disable_thing "aliases" "alias" $1
}

_disable-completion() {
  _about 'disables golden-bash completion'
  _param '1: completion name'
  _example '$ disable-completion git'
  _group 'lib'
  _disable_thing "completions" "completion" $1
}

function _disable_thing() {
  _about 'disables a golden-bash component'
  _param '1: subdirectory'
  _param '2: file_type'
  _param '3: file_entity'
  _example '$ _disable_thing "plugins" "plugin" "ssh"'

  subdirectory="$1"
  file_type="$2"
  file_entity="$3"

  if [ -z "$file_entity" ]; then
    reference "disable-$file_type"
    return
  fi

  if [ "$file_entity" = "all" ]; then
    typeset f $file_type
    for f in $GOLDEN_BASH/$subdirectory/available/*.bash
    do
      plugin=$(basename $f)
      if [ -e $GOLDEN_BASH/$subdirectory/enabled/$plugin ]; then
        rm $GOLDEN_BASH/$subdirectory/enabled/$(basename $plugin)
      fi
    done
  else
    typeset plugin=$(command ls $GOLDEN_BASH/$subdirectory/enabled/$file_entity.*bash 2>/dev/null | head -1)
    if [ -z "$plugin" ]; then
      printf '%s\n' "sorry, that does not appear to be an enabled $file_type."
      return
    fi
    rm $GOLDEN_BASH/$subdirectory/enabled/$(basename $plugin)
  fi

  printf '%s\n' "$file_entity disabled."
}

_enable-plugin() {
  _about 'enables golden-bash plugin'
  _param '1: plugin name'
  _example '$ enable-plugin rvm'
  _group 'lib'
  _enable_thing "plugins" "plugin" $1
}

_enable-alias() {
  _about 'enables golden-bash alias'
  _param '1: alias name'
  _example '$ enable-alias git'
  _group 'lib'
  _enable_thing "aliases" "alias" $1
}

_enable-completion() {
  _about 'enables golden-bash completion'
  _param '1: completion name'
  _example '$ enable-completion git'
  _group 'lib'
  _enable_thing "completions" "completion" $1
}

function _enable_thing() {
  cite _about _param _example
  _about 'enables a golden-bash component'
  _param '1: subdirectory'
  _param '2: file_type'
  _param '3: file_entity'
  _example '$ _enable_thing "plugins" "plugin" "ssh"'

  subdirectory="$1"
  file_type="$2"
  file_entity="$3"

  if [ -z "$file_entity" ]; then
    reference "enable-$file_type"
    return
  fi

  if [ "$file_entity" = "all" ]; then
    typeset f $file_type
    for f in $GOLDEN_BASH/$subdirectory/available/*.bash
    do
      plugin=$(basename $f)
      if [ ! -h $GOLDEN_BASH/$subdirectory/enabled/$plugin ]; then
        ln -s $GOLDEN_BASH/$subdirectory/available/$plugin $GOLDEN_BASH/$subdirectory/enabled/$plugin
      fi
    done
  else
    typeset plugin=$(command ls $GOLDEN_BASH/$subdirectory/available/$file_entity.*bash 2>/dev/null | head -1)
    if [ -z "$plugin" ]; then
      printf '%s\n' "sorry, that does not appear to be an available $file_type."
      return
    fi

    plugin=$(basename $plugin)
    if [ -e $GOLDEN_BASH/$subdirectory/enabled/$plugin ]; then
      printf '%s\n' "$file_entity is already enabled."
      return
    fi

    mkdir -p $GOLDEN_BASH/$subdirectory/enabled

    ln -s $GOLDEN_BASH/$subdirectory/available/$plugin $GOLDEN_BASH/$subdirectory/enabled/$plugin
  fi

  printf '%s\n' "$file_entity enabled."
}

_help-plugins() {
  _about 'summarize all functions defined by enabled golden-bash plugins'
  _group 'lib'

  # display a brief progress message...
  printf '%s' 'please wait, building help...'
  typeset grouplist=$(mktemp /tmp/grouplist.XXXX)
  typeset func
  for func in $(typeset_functions)
  do
    typeset group="$(typeset -f $func | metafor group)"
    if [ -z "$group" ]; then
      group='misc'
    fi
    typeset about="$(typeset -f $func | metafor about)"
    letterpress "$about" $func >> $grouplist.$group
    echo $grouplist.$group >> $grouplist
  done
  # clear progress message
  printf '\r%s\n' '                              '
  typeset group
  typeset gfile
  for gfile in $(cat $grouplist | sort | uniq)
  do
    printf '%s\n' "${gfile##*.}:"
    cat $gfile
    printf '\n'
    rm $gfile 2> /dev/null
  done | less
  rm $grouplist 2> /dev/null
}

_help-aliases() {
  _about 'shows help for all aliases, or a specific alias group'
  _param '1: optional alias group'
  _example '$ alias-help'
  _example '$ alias-help git'

  if [ -n "$1" ]; then
    cat $GOLDEN_BASH/aliases/available/$1.aliases.bash | metafor alias | sed "s/$/'/"
  else
    typeset f
    for f in $GOLDEN_BASH/aliases/enabled/*
    do
      typeset file=$(basename $f)
      printf '\n\n%s:\n' "${file%%.*}"
      # metafor() strips trailing quotes, restore them with sed..
      cat $f | metafor alias | sed "s/$/'/"
    done
  fi
}

all_groups() {
  about 'displays all unique metadata groups'
  group 'lib'

  typeset func
  typeset file=$(mktemp /tmp/composure.XXXX)
  for func in $(typeset_functions)
  do
    typeset -f $func | metafor group >> $file
  done
  cat $file | sort | uniq
  rm $file
}


text:
const csv = require('csvtojson');
const rp = require('request-promise');
const jsonfile = require('jsonfile');

const apiKey = process.env.GOOGLE_GEOCODE_API;
const csvFilePath = './data/locations-full.csv';
const jsonFilePath = `${csvFilePath.slice(0,-4)}.json`;
const array = [];

const createJson = () => {
  return new Promise((resolve, reject) => {
    csv()
      .fromFile(csvFilePath)
      .on('json', (result) => {
        array.push(result);
      }).on('done', (error) => {
        resolve(array);
      });
  });
};

const getLatLng = (array) => {
  return new Promise((resolve, reject) => {
    const canonical_name = array.canonical_name;
    const address = canonical_name.replace(/(\,|\s)/g, '+');
    const options = {
      uri: 'https://maps.googleapis.com/maps/api/geocode/json',
      qs: {
        address: address,
        key: apiKey
      },
      headers: {
        'User-Agent': 'Request-Promise'
      },
      json: true,
      simple: false
    };

    rp(options)
      .then((response) => {
        const object = {
          lat: response.results[0].geometry.location.lat,
          lng: response.results[0].geometry.location.lng,
        };
        array.lat = object.lat;
        array.lng = object.lng;
        resolve(array);
      })
      .catch((error) => {
        reject(error);
      });
  });
};

const getArray = (array) => {
  return new Promise((resolve, reject) => {
    const requestLimit = 10;
    let actions = [];
    const checkProgress = (length) => {
      if (length === array.length) {
        setTimeout(() => {
          const results = Promise.all(actions);
          results.then((data) => {
            resolve(data);
          })
          .catch((error) => {
            reject(error);
          });
        }, 60000);
      }
    };
    for (let i = 0; i < array.length; i += requestLimit) {
      let smallarray = array.slice(i, i + requestLimit);
      setTimeout(() => {
        smallarray.map(getLatLng);
        actions = actions.concat(smallarray);
        checkProgress(actions.length);
      }, 1000 * i);

    }
  });
};

const getGeoCode = () => {
  return createJson()
    .then(getArray)
    .then((result) => {
      jsonfile.writeFile(jsonFilePath, result, { spaces: 2 }, (error) => { console.error(error) });
    })
    .catch((error) => console.error(error));
};

getGeoCode();


text:
<!DOCTYPE html>
<meta charset="utf-8">

<link href="../src/nv.d3.css" rel="stylesheet" type="text/css">

<style>

body {
  overflow-y:scroll;
}

text {
  font: 12px sans-serif;
}

svg {
  display: block;
}

#chart1 svg {
  height: 500px;
  min-width: 100px;
  min-height: 100px;
/*
  margin: 50px;
  Minimum height and width is a good idea to prevent negative SVG dimensions...
  For example width should be =< margin.left + margin.right + 1,
  of course 1 pixel for the entire chart would not be very useful, BUT should not have errors
*/
}

</style>
<body>

  <div id="chart">
    <svg style="height: 500px;"></svg>
  </div>

<script src="../lib/d3.v3.js"></script>
<script src="../lib/crossfilter.js"></script>
<script src="../nv.d3.js"></script>
<script src="../src/tooltip.js"></script>
<script src="../src/utils.js"></script>
<script src="../src/models/legend.js"></script>
<script src="../src/models/axis.js"></script>
<script src="../src/models/scatter.js"></script>
<script src="../src/models/line.js"></script>
<script src="../src/models/lineWithFocusChart.js"></script>
<script src="stream_layers.js"></script>
<script>

extend = function(destination, source) {
    for (var property in source) {
    if (property in destination) {
      if ( typeof source[property] === "object" &&
        typeof destination[property] === "object") {
          destination[property] = extend(destination[property], source[property]);
      } else {
        continue;
      }
    } else {
      destination[property] = source[property];
    };
    }
    return destination;
};

nv.addGraph(function() {
  var chart = nv.models.lineWithFocusChart();

  chart.xAxis
      .tickFormat(d3.format(',f'));
  chart.x2Axis
      .tickFormat(d3.format(',f'));

  chart.yAxis
      .tickFormat(d3.format(',.2f'));
  chart.y2Axis
      .tickFormat(d3.format(',.2f'));

  var dimension = testCrossfilterData().data;

   var data = normalizeData(dimension.top(Infinity),
        [
        {
          name: 'Stream #1',
          key: 'stream1'
        },
        {
          name: 'Stream #2',
          key: 'stream2'
        },
        {
          name: 'Stream #3',
          key: 'stream3'
        }
        ], 'x');

  d3.select('#chart svg')
      .datum(data)
    .transition().duration(500)
      .call(chart);

  nv.utils.windowResize(chart.update);

  return chart;
});

function normalizeData(data, series, xAxis)
  {
    var sort = crossfilter.quicksort.by(function(d) { return d[xAxis]; });
    var sorted = sort(data, 0, data.length);

    var result = [];

    series.forEach(function(serie, index)
    {
      result.push({key: serie.name, values: [], color: serie.color});
    });

    data.forEach(function(data, dataIndex)
    {
      series.forEach(function(serie, serieIndex)
      {
        result[serieIndex].values.push({x: data[xAxis],  y: data[serie.key]});
      });
    });

    return result;
  };

function testCrossfilterData() {
  var data = crossfilter(testData());

  try
  {
    data.data = data.dimension(function(d) { return d.y; });
  } catch (e)
  {
    console.log(e.stack);
  }

  return data;
}

function testData() {

  var data1 = [];
  var data2 = [];
  var data3 = [];

  stream_layers(3,128,.1).map(function(layer, index) {
    layer.forEach(function(item, i) {
    var object = { x: item.x };
    object['stream' + (index + 1)] = item.y;
    eval('data' + (index + 1)).push(object);
  });
  });

  var data = extend(data1, data2);
  var result = extend(data, data3);

  return result;
}

</script>


text:
<?php

    require_once "general.php";

    class Db
    {
        public function clear_hybrid_recs_db($user)
        {
            $sql = "DELETE FROM h_recommendations WHERE userid=?";
            $stat = prepareStatement($sql);
            //insert into db
            $stat->bindParam(1, $user);
            $res = $stat->execute();
        }

        public function save_hybrid_recs_to_db($item_recs, $user)
        {
            foreach($item_recs as $item => $rec_value)
            {
                $sql = "INSERT INTO h_recommendations (userid, movieid, value) VALUES($user,$item,$rec_value)";
                $stat = prepareStatement($sql);
                //insert into db
                $stat->bindParam(1, $user);
                $stat->bindParam(2, $item);
                $stat->bindParam(3, $rec_value);
                $res = $stat->execute();
            }
        }

        public function getAllUsers()
        {
            $users = array();
            $sql = "SELECT userid FROM users WHERE 1";
            $stat = prepareStatement($sql);
            $stat->execute();
            $rows = $stat->fetchAll();

            foreach ($rows as $row)
            {
                $users[] = $row['userid'];
            }
            return $users;
        }

        public function getAllItems()
        {
            $items = array();
            $sql = "SELECT movieid FROM movies WHERE 1";
            $stat = prepareStatement($sql);
            $stat->execute();
            $rows = $stat->fetchAll();

            foreach ($rows as $row)
            {
                $items[] = $row['movieid'];
            }
            return $items;
        }

        public function getItemsRecValue($user, $algo)
        {
            $sql = "SELECT y.value, y.recommendationid, y.movieid, y.position FROM (SELECT r.recommendationid, r.movieid, r.value, @rownum := @rownum + 1 AS position FROM recommendations r JOIN (SELECT @rownum := -1) x WHERE r.userid=? and r.algorithm=? ORDER BY r.value DESC, (SELECT year FROM movies m WHERE m.movieid=r.movieid) DESC) y";

            $stat = prepareStatement($sql);
            $stat->bindParam(1, $user);
            $stat->bindParam(2, $algo);
            $stat->execute();
            $rows = $stat->fetchAll();

            $items = array();

            foreach ($rows as $row)
            {
                $item = $row['movieid'];
                $recvalue = $row['value'];

                $items[$item] = $recvalue;
            }

            return $items;
        }

        public function getItemRecValue($user, $algo, $movieid)
        {
            $sql = "SELECT y.value, y.recommendationid, y.movieid, y.position FROM (SELECT r.recommendationid, r.movieid, r.value, @rownum := @rownum + 1 AS position FROM recommendations r JOIN (SELECT @rownum := -1) x WHERE r.userid=? and r.algorithm=? and r.movieid=?) y";

            $stat = prepareStatement($sql);
            $stat->bindParam(1, $user);
            $stat->bindParam(2, $algo);
            $stat->bindParam(3, $movieid);
            $stat->execute();
            $res = $stat->fetchAll();

            if (count($res) > 0 && count($res[0]) > 0){
                $value = $res[0][0];
            }else{
                $value = -1;
            }
            return $value;
        }

        public function getAlgorithmWeights(&$algos, &$counts, $user)
        {
            //get the algos and their scores

            $sql = "SELECT COUNT( * ) AS total, r.algorithm, w.weight FROM (SELECT * FROM recommendations WHERE userid = 999999) r LEFT JOIN algorithmweights w ON r.algorithm = w.algorithm  GROUP BY r.algorithm";

            $stat = prepareStatement($sql);
            $stat->bindParam(1, $user);
            $stat->execute();
            $rows = $stat->fetchAll();

            foreach ($rows as $row)
            {
                $algo = $row['algorithm'];
                $total = $row['total'];
                $weight = $row['weight'];
                if (empty($weight))
                    $weight = 0;
                $algos[$algo] = $weight;
                $counts[$algo] = $total;
            }
        }

        public function getPositionItemRecList($user, $algo, $movieid)
        {
            //get the position of the movie in the reclist linked with the feedback
            $sql = "SELECT y.position FROM (SELECT r.recommendationid, r.movieid, @rownum := @rownum + 1 AS position FROM recommendations r JOIN (SELECT @rownum := -1) x WHERE r.userid=? and r.algorithm=? ORDER BY r.value DESC, r.movieid DESC) y WHERE y.movieid=?";
            $stat = prepareStatement($sql);
            $stat->bindParam(1, $user);
            $stat->bindParam(2, $algo);
            $stat->bindParam(3, $movieid);
            $stat->execute();
            $res = $stat->fetchAll();
            if (count($res) > 0 && count($res[0]) > 0){
                $position = $res[0][0];
            }else{
                /*print $user . ' ' . $algo . ' ' . $movieid;
                print_r ($res);
                exit();*/
                return -1;
            }
            return $position;
        }

        public function saveAlgorithmWeights($algos, $user)
        {
            //clear old weights
            $sql = "DELETE FROM algorithmweights WHERE userid=?";
            $stat = prepareStatement($sql);
            $stat->bindParam(1, $user);
            $stat->execute();

            //insert new ones
            foreach ($algos as $algo => $score)
            {
                $sql = "INSERT INTO algorithmweights (algorithm, weight, userid) VALUES (?,?,?)";
                $stat = prepareStatement($sql);
                $stat->bindParam(1, $algo);
                $stat->bindParam(2, $score);
                $stat->bindParam(3, $user);
                $stat->execute();
            }
        }

    }
?>


text:
package bookshop2.supplier.incoming.shipBooks;

import java.io.Serializable;
import java.rmi.Remote;
import java.rmi.RemoteException;

import org.aries.message.Message;
import org.aries.runtime.BeanContext;
import org.aries.tx.service.rmi.AbstractRMIListener;
import org.aries.util.ExceptionUtil;

import bookshop2.ShipmentRequestMessage;
import bookshop2.supplier.SupplierContext;

public class ShipBooksListenerForRMI extends AbstractRMIListener implements Remote {

	private SupplierContext supplierContext;

	private ShipBooksInterceptor shipBooksInterceptor;

	public ShipBooksListenerForRMI() throws RemoteException {
		registerAsRMIService();
	}

	@Override
	public void initialize() throws Exception {
		registerAsRMIService();
	}

	@Override
	public String getModuleId() {
		return "bookshop2-supplier-service";
	}

	@Override
	public String getServiceId() {
		return ShipBooks.ID;
	}

	@Override
	public SupplierContext getContext() {
		if (supplierContext == null || resetRequested)
			supplierContext = BeanContext.getFromJNDI(SupplierContext.class, "SupplierContext");
		return supplierContext;
	}

	@Override
	public Object getDelegate() {
		if (shipBooksInterceptor == null || resetRequested)
			shipBooksInterceptor = BeanContext.getFromJNDI(ShipBooksInterceptor.class, "ShipBooksInterceptor");
		return shipBooksInterceptor;
	}

	@Override
	@SuppressWarnings("unchecked")
	public Serializable invoke(Serializable request, String correlationId, long timeout) throws RemoteException {
			if (!isInitialized())
				return null;

		try {
			if (request instanceof String)
				return processAsText((String) request);
			if (request instanceof Message)
				return processAsBinary((Message) request);
			throw new Exception("Unexpected payload type: "+request.getClass());

		} catch (Throwable e) {
			Throwable cause = ExceptionUtil.getRootCause(e);
			throw new RemoteException(cause.getMessage(), cause);
		}
	}

	@Override
	protected void validate(Message message) {
		ShipmentRequestMessage shipmentRequestMessage = message.getPart("shipmentRequestMessage");
		supplierContext.validate(shipmentRequestMessage);
	}

}


text:
// Type definitions for sinon-as-promised v4.0.0
// Project: https://github.com/bendrucker/sinon-as-promised
// Definitions by: igrayson <https://github.com/igrayson>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3

import * as s from "sinon";

declare module "sinon" {
    interface SinonStub {
        /**
         * Causes the stub to resolve with the provided value.
         *
         * @param value   Resolve value.
         * @remarks Any Promises/A+ compliant library will handle this object properly.
         */
        resolves<T>(value: T): SinonStub;

        /**
         * Causes the stub to reject with the provided error.
         *
         * @param error   Rejection error.
         * @returns A thenable which will return a rejected promise with the provided error.
         * @remarks If error is a string, it will be set as the message on an Error object.
         */
        rejects(error: any): SinonStub;
    }
}


text:
<template name="searchbar">

Search

    <form>

        <input type="text" name="search" class="form-control">

        <input type="submit" class="btn btn-primary btn-block" value="Search">

        <input type="checkbox" class="toogle-author" value="author">
        Author

        <input type="checkbox" class="toogle-publisher" value="publisher">
        Publisher

    </form>

  {{#if query}}
    {{>availablebooks}}
  {{/if}}
</template>


text:
namespace mirage.draft {
    import LayoutFlags = mirage.core.LayoutFlags;

    export interface IMeasureDrafter {
        prepare(): boolean;
        draft(rootSize: ISize): boolean;
    }

    export function NewMeasureDrafter(node: core.LayoutNode): IMeasureDrafter {
        var measureList: core.LayoutNode[] = [];

        return {
            prepare(): boolean {
                for (var walker = node.walkDeep(); walker.step();) {
                    var cur = walker.current;
                    if (!cur.inputs.visible) {
                        walker.skipBranch();
                        continue;
                    }

                    if ((cur.state.flags & LayoutFlags.measureHint) === 0) {
                        walker.skipBranch();
                        continue;
                    }

                    cur.state.flags &= ~LayoutFlags.measureHint;
                    if ((cur.state.flags & LayoutFlags.measure) > 0) {
                        measureList.push(cur);
                    }
                }

                return measureList.length > 0;
            },
            draft(rootSize: ISize): boolean {
                var cur: core.LayoutNode;
                while ((cur = measureList.shift()) != null) {
                    cur.doMeasure(rootSize);
                }
                return true;
            },
        };
    }
}


text:
@class DTAttributedTextContentView;
@class DTCoreTextLayoutFrame;

@protocol DTAttributedTextContentViewDelegate <NSObject>

@optional

// called after a layout frame or a part of it is drawn
- (UIView *)attributedTextContentView:(DTAttributedTextContentView *)attributedTextContentView didDrawLayoutFrame:(DTCoreTextLayoutFrame *)layoutFrame inContext:(CGContextRef)context;

// provide custom view for an attachment, e.g. an imageView for images
- (UIView *)attributedTextContentView:(DTAttributedTextContentView *)attributedTextContentView viewForAttachment:(DTTextAttachment *)attachment frame:(CGRect)frame;

// provide button to be placed over links, the identifier is used to link multiple parts of the same A tag
- (UIView *)attributedTextContentView:(DTAttributedTextContentView *)attributedTextContentView viewForLink:(NSURL *)url identifier:(NSString *)identifier frame:(CGRect)frame;

// old style
- (UIView *)attributedTextContentView:(DTAttributedTextContentView *)attributedTextContentView viewForAttributedString:(NSAttributedString *)string frame:(CGRect)frame;

@end

@interface DTAttributedTextContentView : UIView
{
	NSAttributedString *_attributedString;
	DTCoreTextLayoutFrame *_layoutFrame;

	UIEdgeInsets edgeInsets;

	NSMutableDictionary *customViewsForAttachmentsIndex;
}

- (id)initWithAttributedString:(NSAttributedString *)attributedString width:(CGFloat)width;

- (void)layoutSubviewsInRect:(CGRect)rect;
- (void)relayoutText;
- (void)removeAllCustomViews;
- (void)removeAllCustomViewsForLinks;

- (CGSize)attributedStringSizeThatFits:(CGFloat)width;
- (CGSize)suggestedFrameSizeToFitEntireStringConstraintedToWidth:(CGFloat)width; // obeys the edge insets

// properties are overwritten with locking to avoid problem with async drawing
@property (atomic, strong) DTCoreTextLayouter *layouter;
@property (atomic, strong) DTCoreTextLayoutFrame *layoutFrame;

@property (nonatomic, strong) NSMutableSet *customViews;

@property (nonatomic, copy) NSAttributedString *attributedString;
@property (nonatomic) UIEdgeInsets edgeInsets;
@property (nonatomic) BOOL drawDebugFrames;
@property (nonatomic) BOOL shouldDrawImages;
@property (nonatomic) BOOL shouldLayoutCustomSubviews;
@property (nonatomic) CGPoint layoutOffset;
@property (nonatomic) CGSize backgroundOffset;

@property (nonatomic, assign) IBOutlet id <DTAttributedTextContentViewDelegate> delegate;	// subtle simulator bug - use assign not __unsafe_unretained

@property (nonatomic, assign) dispatch_semaphore_t selfLock;

@end

@interface DTAttributedTextContentView (Tiling)

+ (void)setLayerClass:(Class)layerClass;
+ (Class)layerClass;

@end


text:
use time::{Duration, Timespec};

use error::*;
use ast::*;
use expressions::*;

pub trait Sessions {
    #[cfg(not(feature = "session_time"))]
    fn create(&mut self, session_id: &str) -> SessionResult<()>;
    #[cfg(feature = "session_time")]
    fn create(&mut self, session_id: &str, expires: Option<Duration>) -> SessionResult<()>;
    fn validate(&mut self, session_id: &str) -> SessionResult<()>;
    fn destroy(&mut self, session_id: &str) -> SessionResult<()>;
    fn execute_action(
        &mut self,
        session_id: &str,
        action_op: &ActionOp<ProcessedExpression>,
    ) -> SessionResult<()>;
}

pub trait Session {
    fn set_value(
        &mut self,
        key: &str,
        value: ExpressionValue<OutputExpression>,
        update: bool,
    ) -> SessionResult<()>;
    fn remove_value(&mut self, key: &str) -> SessionResult<()>;
    fn get_value(&self, key: &str) -> SessionResult<Option<&ExpressionValue<OutputExpression>>>;

    #[cfg(feature = "session_time")]
    fn created(&self) -> &Timespec;
    #[cfg(feature = "session_time")]
    fn expires(&self) -> Option<&Timespec>;

    fn execute_action(
        &mut self,
        session_id: &str,
        action_op: &ActionOp<ProcessedExpression>,
    ) -> SessionResult<()>;

    #[cfg(feature = "types")]
    fn set_value_with_type(
        &mut self,
        key: &str,
        value: ExpressionValue<OutputExpression>,
    ) -> SessionResult<()>;
}