text:
package org.elasticsearch.index.mapper;

import com.google.common.collect.ImmutableMap;

import org.elasticsearch.Version;
import org.elasticsearch.action.admin.indices.mapping.get.GetMappingsResponse;
import org.elasticsearch.cluster.metadata.IndexMetaData;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.ToXContent;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentFactory;
import org.elasticsearch.common.xcontent.XContentHelper;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.index.IndexService;
import org.elasticsearch.test.ElasticsearchSingleNodeTest;

import java.io.IOException;

import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.nullValue;

public class DynamicMappingTests extends ElasticsearchSingleNodeTest {

    public void testDynamicTrue() throws IOException {
        String mapping = jsonBuilder().startObject().startObject("type")
                .field("dynamic", "true")
                .startObject("properties")
                .startObject("field1").field("type", "string").endObject()
                .endObject()
                .endObject().endObject().string();

        DocumentMapper defaultMapper = createIndex("test").mapperService().documentMapperParser().parse(mapping);

        ParsedDocument doc = defaultMapper.parse("type", "1", jsonBuilder()
                .startObject()
                .field("field1", "value1")
                .field("field2", "value2")
                .bytes());

        assertThat(doc.rootDoc().get("field1"), equalTo("value1"));
        assertThat(doc.rootDoc().get("field2"), equalTo("value2"));
    }

    public void testDynamicFalse() throws IOException {
        String mapping = jsonBuilder().startObject().startObject("type")
                .field("dynamic", "false")
                .startObject("properties")
                .startObject("field1").field("type", "string").endObject()
                .endObject()
                .endObject().endObject().string();

        DocumentMapper defaultMapper = createIndex("test").mapperService().documentMapperParser().parse(mapping);

        ParsedDocument doc = defaultMapper.parse("type", "1", jsonBuilder()
                .startObject()
                .field("field1", "value1")
                .field("field2", "value2")
                .bytes());

        assertThat(doc.rootDoc().get("field1"), equalTo("value1"));
        assertThat(doc.rootDoc().get("field2"), nullValue());
    }

    public void testDynamicStrict() throws IOException {
        String mapping = jsonBuilder().startObject().startObject("type")
                .field("dynamic", "strict")
                .startObject("properties")
                .startObject("field1").field("type", "string").endObject()
                .endObject()
                .endObject().endObject().string();

        DocumentMapper defaultMapper = createIndex("test").mapperService().documentMapperParser().parse(mapping);

        try {
            defaultMapper.parse("type", "1", jsonBuilder()
                    .startObject()
                    .field("field1", "value1")
                    .field("field2", "value2")
                    .bytes());
            fail();
        } catch (StrictDynamicMappingException e) {
            // all is well
        }

        try {
            defaultMapper.parse("type", "1", XContentFactory.jsonBuilder()
                    .startObject()
                    .field("field1", "value1")
                    .field("field2", (String) null)
                    .bytes());
            fail();
        } catch (StrictDynamicMappingException e) {
            // all is well
        }
    }

    public void testDynamicFalseWithInnerObjectButDynamicSetOnRoot() throws IOException {
        String mapping = jsonBuilder().startObject().startObject("type")
                .field("dynamic", "false")
                .startObject("properties")
                .startObject("obj1").startObject("properties")
                .startObject("field1").field("type", "string").endObject()
                .endObject().endObject()
                .endObject()
                .endObject().endObject().string();

        DocumentMapper defaultMapper = createIndex("test").mapperService().documentMapperParser().parse(mapping);

        ParsedDocument doc = defaultMapper.parse("type", "1", jsonBuilder()
                .startObject().startObject("obj1")
                .field("field1", "value1")
                .field("field2", "value2")
                .endObject()
                .bytes());

        assertThat(doc.rootDoc().get("obj1.field1"), equalTo("value1"));
        assertThat(doc.rootDoc().get("obj1.field2"), nullValue());
    }

    public void testDynamicStrictWithInnerObjectButDynamicSetOnRoot() throws IOException {
        String mapping = jsonBuilder().startObject().startObject("type")
                .field("dynamic", "strict")
                .startObject("properties")
                .startObject("obj1").startObject("properties")
                .startObject("field1").field("type", "string").endObject()
                .endObject().endObject()
                .endObject()
                .endObject().endObject().string();

        DocumentMapper defaultMapper = createIndex("test").mapperService().documentMapperParser().parse(mapping);

        try {
            defaultMapper.parse("type", "1", jsonBuilder()
                    .startObject().startObject("obj1")
                    .field("field1", "value1")
                    .field("field2", "value2")
                    .endObject()
                    .bytes());
            fail();
        } catch (StrictDynamicMappingException e) {
            // all is well
        }
    }

    public void testDynamicMappingOnEmptyString() throws Exception {
        IndexService service = createIndex("test");
        client().prepareIndex("test", "type").setSource("empty_field", "").get();
        FieldMapper mapper = service.mapperService().fullName("empty_field");
        assertNotNull(mapper);
    }

    public void testTypeNotCreatedOnIndexFailure() throws IOException, InterruptedException {
        XContentBuilder mapping = jsonBuilder().startObject().startObject("_default_")
                .field("dynamic", "strict")
                .endObject().endObject();

        IndexService indexService = createIndex("test", Settings.EMPTY, "_default_", mapping);

        try {
            client().prepareIndex().setIndex("test").setType("type").setSource(jsonBuilder().startObject().field("test", "test").endObject()).get();
            fail();
        } catch (StrictDynamicMappingException e) {

        }

        GetMappingsResponse getMappingsResponse = client().admin().indices().prepareGetMappings("test").get();
        assertNull(getMappingsResponse.getMappings().get("test").get("type"));
    }

    private String serialize(ToXContent mapper) throws Exception {
        XContentBuilder builder = XContentFactory.jsonBuilder().startObject();
        mapper.toXContent(builder, new ToXContent.MapParams(ImmutableMap.<String, String>of()));
        return builder.endObject().string();
    }

    private Mapper parse(DocumentMapper mapper, DocumentMapperParser parser, XContentBuilder builder) throws Exception {
        Settings settings = Settings.builder().put(IndexMetaData.SETTING_VERSION_CREATED, Version.CURRENT).build();
        ParseContext.InternalParseContext ctx = new ParseContext.InternalParseContext("test", settings, parser, mapper, new ContentPath(0));
        SourceToParse source = SourceToParse.source(builder.bytes());
        ctx.reset(XContentHelper.createParser(source.source()), new ParseContext.Document(), source);
        assertEquals(XContentParser.Token.START_OBJECT, ctx.parser().nextToken());
        ctx.parser().nextToken();
        return DocumentParser.parseObject(ctx, mapper.root());
    }

    public void testDynamicMappingsNotNeeded() throws Exception {
        IndexService indexService = createIndex("test");
        DocumentMapperParser parser = indexService.mapperService().documentMapperParser();
        String mapping = XContentFactory.jsonBuilder().startObject().startObject("type")
                .startObject("properties").startObject("foo").field("type", "string").endObject().endObject()
                .endObject().string();

        DocumentMapper mapper = parser.parse(mapping);
        Mapper update = parse(mapper, parser, XContentFactory.jsonBuilder().startObject().field("foo", "bar").endObject());
        // foo is already defined in the mappings
        assertNull(update);
    }

    public void testField() throws Exception {
        IndexService indexService = createIndex("test");
        DocumentMapperParser parser = indexService.mapperService().documentMapperParser();
        String mapping = XContentFactory.jsonBuilder().startObject()
                .startObject("type").endObject()
                .endObject().string();

        DocumentMapper mapper = parser.parse(mapping);
        assertEquals(mapping, serialize(mapper));

        Mapper update = parse(mapper, parser, XContentFactory.jsonBuilder().startObject().field("foo", "bar").endObject());
        assertNotNull(update);
        // original mapping not modified
        assertEquals(mapping, serialize(mapper));
        // but we have an update
        assertEquals("{\"type\":{\"properties\":{\"foo\":{\"type\":\"string\"}}}}", serialize(update));
    }

    public void testIncremental() throws Exception {
        IndexService indexService = createIndex("test");
        DocumentMapperParser parser = indexService.mapperService().documentMapperParser();
        // Make sure that mapping updates are incremental, this is important for performance otherwise
        // every new field introduction runs in linear time with the total number of fields
        String mapping = XContentFactory.jsonBuilder().startObject().startObject("type")
                .startObject("properties").startObject("foo").field("type", "string").endObject().endObject()
                .endObject().string();

        DocumentMapper mapper = parser.parse(mapping);
        assertEquals(mapping, serialize(mapper));

        Mapper update = parse(mapper, parser, XContentFactory.jsonBuilder().startObject().field("foo", "bar").field("bar", "baz").endObject());
        assertNotNull(update);
        // original mapping not modified
        assertEquals(mapping, serialize(mapper));
        // but we have an update
        assertEquals(XContentFactory.jsonBuilder().startObject().startObject("type").startObject("properties")
                // foo is NOT in the update
                .startObject("bar").field("type", "string").endObject()
                .endObject().endObject().string(), serialize(update));
    }

    public void testIntroduceTwoFields() throws Exception {
        IndexService indexService = createIndex("test");
        DocumentMapperParser parser = indexService.mapperService().documentMapperParser();
        String mapping = XContentFactory.jsonBuilder().startObject()
                .startObject("type").endObject()
                .endObject().string();

        DocumentMapper mapper = parser.parse(mapping);
        assertEquals(mapping, serialize(mapper));

        Mapper update = parse(mapper, parser, XContentFactory.jsonBuilder().startObject().field("foo", "bar").field("bar", "baz").endObject());
        assertNotNull(update);
        // original mapping not modified
        assertEquals(mapping, serialize(mapper));
        // but we have an update
        assertEquals(XContentFactory.jsonBuilder().startObject().startObject("type").startObject("properties")
                .startObject("bar").field("type", "string").endObject()
                .startObject("foo").field("type", "string").endObject()
                .endObject().endObject().string(), serialize(update));
    }

    public void testObject() throws Exception {
        IndexService indexService = createIndex("test");
        DocumentMapperParser parser = indexService.mapperService().documentMapperParser();
        String mapping = XContentFactory.jsonBuilder().startObject()
                .startObject("type").endObject()
                .endObject().string();

        DocumentMapper mapper = parser.parse(mapping);
        assertEquals(mapping, serialize(mapper));

        Mapper update = parse(mapper, parser, XContentFactory.jsonBuilder().startObject().startObject("foo").startObject("bar").field("baz", "foo").endObject().endObject().endObject());
        assertNotNull(update);
        // original mapping not modified
        assertEquals(mapping, serialize(mapper));
        // but we have an update
        assertEquals(XContentFactory.jsonBuilder().startObject().startObject("type").startObject("properties")
                .startObject("foo").startObject("properties").startObject("bar").startObject("properties").startObject("baz").field("type", "string").endObject().endObject().endObject().endObject().endObject()
                .endObject().endObject().endObject().string(), serialize(update));
    }

    public void testArray() throws Exception {
        IndexService indexService = createIndex("test");
        DocumentMapperParser parser = indexService.mapperService().documentMapperParser();
        String mapping = XContentFactory.jsonBuilder().startObject()
                .startObject("type").endObject()
                .endObject().string();

        DocumentMapper mapper = parser.parse(mapping);
        assertEquals(mapping, serialize(mapper));

        Mapper update = parse(mapper, parser, XContentFactory.jsonBuilder().startObject().startArray("foo").value("bar").value("baz").endArray().endObject());
        assertNotNull(update);
        // original mapping not modified
        assertEquals(mapping, serialize(mapper));
        // but we have an update
        assertEquals(XContentFactory.jsonBuilder().startObject().startObject("type").startObject("properties")
                .startObject("foo").field("type", "string").endObject()
                .endObject().endObject().endObject().string(), serialize(update));
    }

    public void testInnerDynamicMapping() throws Exception {
        IndexService indexService = createIndex("test");
        DocumentMapperParser parser = indexService.mapperService().documentMapperParser();
        String mapping = XContentFactory.jsonBuilder().startObject().startObject("type") .startObject("properties")
                .startObject("foo").field("type", "object").endObject()
                .endObject().endObject().endObject().string();

        DocumentMapper mapper = parser.parse(mapping);
        assertEquals(mapping, serialize(mapper));

        Mapper update = parse(mapper, parser, XContentFactory.jsonBuilder().startObject().startObject("foo").startObject("bar").field("baz", "foo").endObject().endObject().endObject());
        assertNotNull(update);
        // original mapping not modified
        assertEquals(mapping, serialize(mapper));
        // but we have an update
        assertEquals(XContentFactory.jsonBuilder().startObject().startObject("type").startObject("properties")
                .startObject("foo").startObject("properties").startObject("bar").startObject("properties").startObject("baz").field("type", "string").endObject().endObject().endObject().endObject().endObject()
                .endObject().endObject().endObject().string(), serialize(update));
    }

    public void testComplexArray() throws Exception {
        IndexService indexService = createIndex("test");
        DocumentMapperParser parser = indexService.mapperService().documentMapperParser();
        String mapping = XContentFactory.jsonBuilder().startObject()
                .startObject("type").endObject()
                .endObject().string();

        DocumentMapper mapper = parser.parse(mapping);
        assertEquals(mapping, serialize(mapper));

        Mapper update = parse(mapper, parser, XContentFactory.jsonBuilder().startObject().startArray("foo")
                .startObject().field("bar", "baz").endObject()
                .startObject().field("baz", 3).endObject()
                .endArray().endObject());
        assertEquals(mapping, serialize(mapper));
        assertEquals(XContentFactory.jsonBuilder().startObject().startObject("type").startObject("properties")
                .startObject("foo").startObject("properties")
                .startObject("bar").field("type", "string").endObject()
                .startObject("baz").field("type", "long").endObject()
                .endObject().endObject()
                .endObject().endObject().endObject().string(), serialize(update));
    }
}


text:
package mesoslib

import (
	"io/ioutil"
	"net/http"

	"code.google.com/p/goprotobuf/proto"

	"github.com/Sirupsen/logrus"
	"github.com/VoltFramework/volt/mesosproto"
	"github.com/gorilla/mux"
)

func (m *MesosLib) initAPI() {
	m.Router.NotFoundHandler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		m.Log.WithFields(logrus.Fields{"from": r.RemoteAddr}).Warnf("[%s] %s: Not implemented", r.Method, r.RequestURI)
		w.WriteHeader(http.StatusNotFound)
	})
	endpoints := map[string]map[string]func(w http.ResponseWriter, r *http.Request, data []byte) error{
		"POST": {
			"/{scheduler}/mesos.internal.FrameworkRegisteredMessage": m.FrameworkRegisteredMessage,
			"/{scheduler}/mesos.internal.ResourceOffersMessage":      m.ResourceOffersMessage,
			"/{scheduler}/mesos.internal.StatusUpdateMessage":        m.StatusUpdateMessage,
			"/{scheduler}/mesos.internal.FrameworkErrorMessage":      m.FrameworkErrorMessage,
		},
	}

	for method, routes := range endpoints {
		for route, fct := range routes {
			_route := route
			_fct := fct
			_method := method

			m.Log.WithFields(logrus.Fields{"method": _method, "route": _route}).Debug("Registering MesosLib-API route...")
			m.Router.Path(_route).Methods(_method).HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
				m.Log.WithFields(logrus.Fields{"from": r.RemoteAddr, "scheduler": mux.Vars(r)["scheduler"]}).Debugf("[%s] %s", _method, _route)

				// extract request body
				data, err := ioutil.ReadAll(r.Body)
				if err != nil {
					w.WriteHeader(http.StatusInternalServerError)
					m.Log.Warn(err)
					return
				}
				r.Body.Close()

				if err := _fct(w, r, data); err != nil {
					w.WriteHeader(http.StatusInternalServerError)
					m.Log.Warn(err)
				}
			})
		}
	}
}

// Endpoint called by the master upon error
func (m *MesosLib) FrameworkErrorMessage(w http.ResponseWriter, r *http.Request, data []byte) error {
	message := new(mesosproto.FrameworkErrorMessage)
	if err := proto.Unmarshal(data, message); err != nil {
		return err
	}

	m.Log.Warn(message.GetMessage())

	w.WriteHeader(http.StatusOK)
	return nil
}

// Endpoint called by the master upon registration
func (m *MesosLib) FrameworkRegisteredMessage(w http.ResponseWriter, r *http.Request, data []byte) error {
	message := new(mesosproto.FrameworkRegisteredMessage)
	if err := proto.Unmarshal(data, message); err != nil {
		return err
	}

	m.frameworkInfo.Id = message.FrameworkId

	eventType := mesosproto.Event_REGISTERED
	m.AddEvent(eventType, &mesosproto.Event{
		Type: &eventType,
		Registered: &mesosproto.Event_Registered{
			FrameworkId: message.FrameworkId,
			MasterInfo:  message.MasterInfo,
		},
	})
	w.WriteHeader(http.StatusOK)
	return nil
}

// Endpoint called by the master upon new offers
func (m *MesosLib) ResourceOffersMessage(w http.ResponseWriter, r *http.Request, data []byte) error {
	message := new(mesosproto.ResourceOffersMessage)
	if err := proto.Unmarshal(data, message); err != nil {
		return err
	}
	eventType := mesosproto.Event_OFFERS
	m.AddEvent(eventType, &mesosproto.Event{
		Type: &eventType,
		Offers: &mesosproto.Event_Offers{
			Offers: message.Offers,
		},
	})
	w.WriteHeader(http.StatusOK)
	return nil
}

// Endpoint called by the master upon status update
func (m *MesosLib) StatusUpdateMessage(w http.ResponseWriter, r *http.Request, data []byte) error {
	message := new(mesosproto.StatusUpdateMessage)
	if err := proto.Unmarshal(data, message); err != nil {
		return err
	}

	if err := m.send(&mesosproto.StatusUpdateAcknowledgementMessage{
		FrameworkId: m.frameworkInfo.Id,
		SlaveId:     message.Update.Status.SlaveId,
		TaskId:      message.Update.Status.TaskId,
		Uuid:        message.Update.Uuid,
	}, "mesos.internal.StatusUpdateAcknowledgementMessage"); err != nil {
		return err
	}

	eventType := mesosproto.Event_UPDATE
	m.AddEvent(eventType, &mesosproto.Event{
		Type: &eventType,
		Update: &mesosproto.Event_Update{
			Uuid:   message.Update.Uuid,
			Status: message.Update.Status,
		},
	})

	w.WriteHeader(http.StatusOK)
	return nil
}

redpajama_set_name: RedPajamaGithub


text:
import React from 'react';
import {renderIntoDocument} from 'react-addons-test-utils';

import {expect} from 'chai';

import setup_fake_dom from './setup_fake_dom';

let TestUtils = require('react-addons-test-utils');
let assert = require('assert');

import {LoginForm} from '../../components/LoginForm';

// CommonJS syntax is used for importing rewire for compatibility
// with babel-loader.
//
// See https://github.com/jhnns/rewire-webpack/issues/12#issuecomment-95797024
// for an explanation
let rewire = require('rewire');

describe('LoginForm', () => {
  it('should render', () => {
    const item = renderIntoDocument(
      <LoginForm test="has a prop"/>
    );
    expect(item.props.test).to.equal("has a prop")
  });
});


text:
/*jslint browser: true, devel: true, node: true, ass: true, nomen: true, unparam: true, indent: 4 */

/**
 * @license
 * Copyright (c) 2015 The ExpandJS authors. All rights reserved.
 * This code may only be used under the BSD style license found at https://expandjs.github.io/LICENSE.txt
 * The complete set of authors may be found at https://expandjs.github.io/AUTHORS.txt
 * The complete set of contributors may be found at https://expandjs.github.io/CONTRIBUTORS.txt
 */
(function () {
    "use strict";

    var assertArgument = require('../assert/assertArgument'),
        getWidth       = require('../dom/getWidth'),
        isObject       = require('../tester/isObject');

    /**
     * Checks if the element defined by the `boundings` and `margin`
     * bleeds out on the right side of the viewport.
     *
     * ```html
     *     <style>
     *         #target {
     *             width: 100vw;
     *             margin-left: -10vw;
     *         }
     *     </style>
     *     <div id="target"></div>
     *
     *     var elem    = XP.getElement('html'),
     *         bounds  = XP.getBoundings(elem),
     *         margins = XP.getMargin(elem);
     *
     *     XP.willBleedRight(bounds, margins);
     *     // => false
     *
     *     <style>
     *         #target {
     *             width: 100vw;
     *             margin: 10vw;
     *         }
     *     </style>
     *     <div id="target"></div>
     *
     *     var elem    = XP.getElement('html'),
     *         bounds  = XP.getBoundings(elem),
     *         margins = XP.getMargin(elem);
     *
     *     XP.willBleedRight(bounds, margins);
     *     // => true
     * ```
     *
     * @function willBleedRight
     * @param {Object} boundings The bounding rect of the element
     * @param {Object} margin The margins rect of the element
     * @returns {boolean} Returns true if the element will bleed right, otherwise false
     */
    module.exports = function willBleedRight(boundings, margin) {
        assertArgument(isObject(boundings), 1, 'Object');
        assertArgument(isObject(margin), 2, 'Object');
        return boundings.left + margin.left + boundings.width + margin.right > getWidth();
    };

}());


text:
const path = require('path');
const gulp = require('gulp');
const gulpLoadPlugins = require('gulp-load-plugins');
const del = require('del');
const stylish = require('jshint-stylish');
const runSequence = require('run-sequence');

const $ = gulpLoadPlugins({
    rename: {
        'gulp-angular-filesort': 'fileSort'
    }
});

const config = {
    src: 'src',
    styles: 'css',
    fonts: 'fonts',
    images: 'img',
    scripts: 'js',
    dist: 'dist',
    module: 'u9imbase-barcode'
};

const banner =
'\n\n';

gulp.task('clean', del.bind(null, [config.dist]));

gulp.task('lint', () => {
  return gulp.src(path.join(config.src, config.scripts + '/**/*.js'))
    .pipe($.jshint())
    .pipe($.jshint.reporter(stylish));
});

gulp.task('styles', () => {
    return gulp.src(path.join(config.src, config.styles + '/**/*.css'))
        .pipe($.concat(config.module + '.css'))
        .pipe($.header(banner))
        .pipe(gulp.dest(path.join(config.dist, config.styles)));
});

gulp.task('cssnano', () => {
    return gulp.src(path.join(config.dist, config.styles + '/' + config.module + '.css'))
        .pipe($.rename(config.module + '.min.css'))
        // .pipe($.cssnano({ safe: true, autoprefixer: false }))
        .pipe(gulp.dest(path.join(config.dist, config.styles)));
});

gulp.task('images', () => {
    return gulp.src(path.join(config.src, config.images + '/**/*'))
        // .pipe($.cache($.imagemin()))
        .pipe(gulp.dest(path.join(config.dist, config.images)));
});

gulp.task('fonts', () => {
    return gulp.src(path.join(config.src, config.fonts + '/**/*'))
        // .pipe($.cache($.imagemin()))
        .pipe(gulp.dest(path.join(config.dist, config.fonts)));
});

gulp.task('scripts', () => {
    return gulp.src(path.join(config.src, config.scripts + '/**/*.js'))
        .pipe($.fileSort())
        .pipe($.concat(config.module + '.js'))
        .pipe($.header(banner))
        .pipe(gulp.dest(config.dist));
});

gulp.task('uglify', () => {
    return gulp.src(path.join(config.dist, config.module + '.js'))
        .pipe($.rename(config.module + '.min.js'))
        .pipe($.uglify())
        .pipe($.header(banner))
        .pipe(gulp.dest(config.dist));
});

gulp.task('build', () => {
    return new Promise(resolve => {
        runSequence('lint', ['styles', 'scripts', 'fonts', 'images'], ['cssnano', 'uglify'], resolve);
    });
});

gulp.task('gzip', () => {
    return gulp.src(path.join(config.dist, '/**/*')).pipe($.size({ title: 'build', gzip: true }));
});

gulp.task('dist', () => {
    return new Promise(resolve => {
        runSequence('clean', 'build', 'gzip', resolve);
    });
});


text:
'''
Module: map
Author: David Frye
Description: Contains the Map class.
'''

import maze
import player

class Map:
	'''
	'''

	def __init__(self, maze=Maze(), player=Player()):
		'''
		'''

		self.m_maze = maze
		self.m_player = player


text:
@extends('apigenci::layout-admin')

@section('title') {{ \Session::get('user')->login }}' repos - apigen.ci @stop

@section('content')

<?php
$localRepos = \Apigenci\Model::dbUserRepos(\Apigenci\Model::githubId());
?>

@foreach($repos as $repo)

<?php
$encrypted = \Apigenci\Model::repoEncodeWeb($repo->id);
$localRepo = \Apigenci\Model::dbRepo($repo->id, $localRepos);
?>

                        html_url }}">

                        {{ \Session::get('user')->login }} /
                        {{ $repo->name }}
                        @if (is_object($localRepo) && $localRepo->queued)

                        @endif

                        @if ($localRepo === null || !$localRepo->enabled)
                        <button class="btn btn-default" onclick="safePost('/repo/{!! $encrypted !!}/enable')">Enable</button>
                        @else

                        @if ($localRepo->built)
                        <button class="btn btn-default" onclick="window.open('/github/{!! $repo->full_name !!}')">

                            View Docs
                        </button>
                        <?php
                        /*
                          <button class="btn btn-success" onclick="window.location.href = '/repo/{!! $encrypted !!}/manage'">

                          Manage
                          </button>
                         *
                         */
                        ?>
                        @elseif ($localRepo->failed)
                        <button class="btn btn-default" onclick="window.open('/github/{{ \Session::get('user')->login }}/{{ $repo->name }}/log.txt')">

                            View Log
                        </button>
                        <button class="btn btn-warning" onclick="safePost('/repo/{!! $encrypted !!}/enable')">

                             Retry
                        </button>
                        @endif

                        <button class="btn btn-danger" onclick="safePost('/repo/{!! $encrypted !!}/disable')">

                             Disable
                        </button>

                        @endif

@endforeach

@stop


text:
"""Test RPC commands for signing messages with private key."""

from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (
    assert_equal,
    assert_raises_rpc_error,
)

class SignMessagesWithPrivTest(BitcoinTestFramework):
    def set_test_params(self):
        self.setup_clean_chain = True
        self.num_nodes = 1

    def run_test(self):
        message = 'This is just a test message'

        self.log.info('test signing with priv_key')
        priv_key = 'cUeKHd5orzT3mz8P9pxyREHfsWtVfgsfDjiZZBcjUBAaGk1BTj7N'
        address = 'mpLQjfK79b7CCV4VMJWEWAj5Mpx8Up5zxB'
        expected_signature = 'Hx6I/QmVmh4EePAdNrPm1ud7M/w6r9Oz2FNMUz4jxTPnW3FiYTTjNWzV1ESB2NeeoAIG7hEsNVRaVFLyE3dG2VE='
        signature = self.nodes[0].signmessagewithprivkey(priv_key, message)
        assert_equal(expected_signature, signature)
        assert self.nodes[0].verifymessage(address, signature, message)

        self.log.info('test parameter validity and error codes')
        # signmessagewithprivkey has two required parameters
        for num_params in [0, 1, 3, 4, 5]:
            param_list = ["dummy"]*num_params
            assert_raises_rpc_error(-1, "signmessagewithprivkey", self.nodes[0].signmessagewithprivkey, *param_list)
        # verifymessage has three required parameters
        for num_params in [0, 1, 2, 4, 5]:
            param_list = ["dummy"]*num_params
            assert_raises_rpc_error(-1, "verifymessage", self.nodes[0].verifymessage, *param_list)
        # invalid key or address provided
        assert_raises_rpc_error(-5, "Invalid private key", self.nodes[0].signmessagewithprivkey, "invalid_key", message)
        assert_raises_rpc_error(-5, "Invalid address", self.nodes[0].verifymessage, "invalid_addr", signature, message)
        # malformed signature provided
        assert_raises_rpc_error(-3, "Malformed base64 encoding", self.nodes[0].verifymessage, 'mpLQjfK79b7CCV4VMJWEWAj5Mpx8Up5zxB', "invalid_sig", message)

if __name__ == '__main__':
    SignMessagesWithPrivTest().main()


text: google-site-verification: google449ef2a1b46b05cb.html


text:
package org.jboss.hal.meta.search;

import java.util.Set;

import org.jboss.hal.spi.Keywords;

public interface SearchIndex {

    /**
     * Returns the tokens for the given operation mode which are not excluded by {@link Keywords#exclude()}.
     *
     * @param standalone the execution mode
     *
     * @return a set of matching tokens
     */
    Set<String> getTokens(boolean standalone);

    Set<String> getResources(String token);

    Set<String> getKeywords(String token);
}


text:
package com.coursevoirture;

import com.coursevoirture.callback.Callback;

public class CarRunner implements Runnable {

	private Car car;

	private Callback callback;

	public CarRunner(Car car) {
		this(car,null);
	}

	public CarRunner(Car car, Callback callback) {
		super();
		this.car = car;
		this.callback = callback;
	}

	@Override
	public void run() {
		this.car.startRunning();
		callback.execute();
	}

}


text:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<bs3:grid xsi:schemaLocation="http://isis.apache.org/applib/layout/component http://isis.apache.org/applib/layout/component/component.xsd http://isis.apache.org/applib/layout/grid/bootstrap3 http://isis.apache.org/applib/layout/grid/bootstrap3/bootstrap3.xsd" xmlns:bs3="http://isis.apache.org/applib/layout/grid/bootstrap3" xmlns:cpt="http://isis.apache.org/applib/layout/component" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <bs3:row>
        <bs3:col span="12" unreferencedActions="true">
            <cpt:domainObject/>
            <cpt:action id="delete"/>
        </bs3:col>
    </bs3:row>
    <bs3:row>
        <bs3:col span="6">
            <cpt:fieldSet name="Document">
                <cpt:property id="document" hidden="REFERENCES_PARENT"/>
                <cpt:property id="documentDate"/>
                <cpt:property id="documentState"/>
            </cpt:fieldSet>
            <cpt:fieldSet name="Metadata" id="metadata">
                <cpt:action id="clearHints" position="PANEL_DROPDOWN"/>
                <cpt:action id="downloadLayoutXml" position="PANEL_DROPDOWN"/>
                <cpt:action id="downloadJdoMetadata" position="PANEL_DROPDOWN"/>
                <cpt:action id="rebuildMetamodel" position="PANEL_DROPDOWN"/>
                <cpt:property id="datanucleusIdLong"/>
                <cpt:property id="datanucleusVersionLong"/>
                <cpt:property id="datanucleusVersionTimestamp"/>
            </cpt:fieldSet>
            <cpt:fieldSet name="Other" unreferencedProperties="true">
            </cpt:fieldSet>
        </bs3:col>
        <bs3:col span="6">
            <cpt:fieldSet name="Attached to">
                <cpt:property id="attachedTo" hidden="REFERENCES_PARENT"/>
                <cpt:property id="roleName">
                    <cpt:action id="changeRole"/>
                </cpt:property>
            </cpt:fieldSet>
        </bs3:col>
    </bs3:row>
    <bs3:row>
        <bs3:col span="12" unreferencedCollections="true">
        </bs3:col>
    </bs3:row>
</bs3:grid>


text:
<?php

namespace AppBundle\Repository;

/**
 * ManagerRepository
 *
 * This class was generated by the Doctrine ORM. Add your own custom
 * repository methods below.
 */
class ManagerRepository extends \Doctrine\ORM\EntityRepository
{
    /**
     * @return array
     */
    public function findAll()
    {
        $query = $this->createQueryBuilder('m')
            ->select('m.id, m.name')
            ->getQuery()->getArrayResult();

        return $query;
    }
}


text:
@*
 * Copyright 2022 HM Revenue & Customs
 *
 * 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.
 *@

@import uk.gov.hmrc.helptosavefrontend.models.HtsContext
@import uk.gov.hmrc.helptosavefrontend.config.FrontendAppConfig

@this(main: uk.gov.hmrc.helptosavefrontend.views.html.main_template)

@()(implicit htsContext: HtsContext, request: Request[_], messages: Messages, appConfig: FrontendAppConfig)

@title = @{
  Messages("hts.privacy.title.h1")
}

@main(
  title = title,
    enableSignOutLink = false
) {

@title

@messages("hts.privacy.p1")

@messages("hts.privacy.p2")

@messages("hts.privacy.p3")

@messages("hts.privacy.ul1.li1")

@messages("hts.privacy.ul1.li2")

@Html(Messages("hts.privacy.ul1.li3"))

@messages("hts.privacy.ul1.li4")

@messages("hts.privacy.p4")

@messages("hts.privacy.p5")

@Html(Messages("hts.privacy.p6"))

@messages("hts.privacy.p7")

@Html(Messages("hts.privacy.p8"))

@messages("hts.privacy.p9")

@messages("hts.privacy.ul2.li1")

@messages("hts.privacy.ul2.li2")

@messages("hts.privacy.h2-1")

@Html(Messages("hts.privacy.p10"))

@messages("hts.privacy.h2-2")

@Html(Messages("hts.privacy.p11.1")) @Html(Messages("hts.privacy.p11.link-text")) @messages("hts.privacy.p11.2")

}


text:
#pragma once
#include <aws/securityhub/SecurityHub_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/securityhub/model/Result.h>
#include <utility>

namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;

namespace Utils
{
namespace Json
{
  class JsonValue;
} // namespace Json
} // namespace Utils
namespace SecurityHub
{
namespace Model
{
  class AWS_SECURITYHUB_API DeleteInvitationsResult
  {
  public:
    DeleteInvitationsResult();
    DeleteInvitationsResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
    DeleteInvitationsResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);

    /**
     *
The list of Amazon Web Services accounts for which the invitations were not
     * deleted. For each account, the list includes the account ID and the email
     * address.

     */
    inline const Aws::Vector<Result>& GetUnprocessedAccounts() const{ return m_unprocessedAccounts; }

    /**
     *
The list of Amazon Web Services accounts for which the invitations were not
     * deleted. For each account, the list includes the account ID and the email
     * address.

     */
    inline void SetUnprocessedAccounts(const Aws::Vector<Result>& value) { m_unprocessedAccounts = value; }

    /**
     *
The list of Amazon Web Services accounts for which the invitations were not
     * deleted. For each account, the list includes the account ID and the email
     * address.

     */
    inline void SetUnprocessedAccounts(Aws::Vector<Result>&& value) { m_unprocessedAccounts = std::move(value); }

    /**
     *
The list of Amazon Web Services accounts for which the invitations were not
     * deleted. For each account, the list includes the account ID and the email
     * address.

     */
    inline DeleteInvitationsResult& WithUnprocessedAccounts(const Aws::Vector<Result>& value) { SetUnprocessedAccounts(value); return *this;}

    /**
     *
The list of Amazon Web Services accounts for which the invitations were not
     * deleted. For each account, the list includes the account ID and the email
     * address.

     */
    inline DeleteInvitationsResult& WithUnprocessedAccounts(Aws::Vector<Result>&& value) { SetUnprocessedAccounts(std::move(value)); return *this;}

    /**
     *
The list of Amazon Web Services accounts for which the invitations were not
     * deleted. For each account, the list includes the account ID and the email
     * address.

     */
    inline DeleteInvitationsResult& AddUnprocessedAccounts(const Result& value) { m_unprocessedAccounts.push_back(value); return *this; }

    /**
     *
The list of Amazon Web Services accounts for which the invitations were not
     * deleted. For each account, the list includes the account ID and the email
     * address.

     */
    inline DeleteInvitationsResult& AddUnprocessedAccounts(Result&& value) { m_unprocessedAccounts.push_back(std::move(value)); return *this; }

  private:

    Aws::Vector<Result> m_unprocessedAccounts;
  };

} // namespace Model
} // namespace SecurityHub
} // namespace Aws


text:
#ifndef _STAT_CALC_
#define _STAT_CALC_

#include "statcalc-data-types.h"
//#include "stat-calc-tools.h"
#include <algorithm>
#include <functional>
#include "document-processor.h"
using lemmatizer::ILemmatizer;
using Tokenization::ITokenizer;
using _sentence_splitter::ISentenceSplitter;

namespace statcalc
{
/**
 * @class	StatCalc
 * @brief	Class for obsorbing word statistics from texts, saving, storing, etc...
 */
class StatCalc
{
public:

    /**
     * @brief	default constructor
     */
    StatCalc(shared_ptr<ITokenizer> i_tokenizer, shared_ptr<ILemmatizer> i_lemmatizer, shared_ptr<ISentenceSplitter> i_splitter);

    /**
     * @brief Getter for m_tdmatrix
     * @return m_tdmatrix
     */
    TDMatrix &tdmatrix(void);

    /**
     * @brief Getter for m_docID
     * @return m_docID
     */
    DocID &docID(void);

    /**
     * @brief getter for m_idCategory
     * @return m_idCategory
     */
    IDCategory &idCategory();

    /**
     * @brief Getter for m_idf
     * @return m_idf
     */
    WordDoubleStat idf();

    /**
     * @brief Getter for m_df
     * @return m_df (document freaquncy)
     */
    WordDoubleStat &df();

    /**
     * @brief Getter for m_cf
     * @return m_cf (collection freaquncy)
     */
    WordDoubleStat &cf();

    /**
     * @brief MI is getter for m_MI
     * @return m_MI
     */
    vector<WordDoubleStat> MI();

    /**
     * @brief Function for cleaning all data
     */
    void clean();

    /**
     * @brief loadFileList is function for filling structures
     * m_docID and m_idCategory
     * @param[in] i_filelist - name of file with pathes to documents and corresponding domains
     */
    void loadFileList(const string& i_filelist, const string &prefix = string(""));

    /**
     * @brief Function for storing m_tdmatrix in binary format
     * @param[in] i_filename name of file
     * @return true in case of success, false - otherwise
     */
    bool saveTDMatrix(const string& i_filename,bool withDocNames = false);

    /**
     * @brief Function for loading data from binary file
     * @param[in] i_filename name of file
     * @return true in case of success, false - otherwise
     */
    bool loadTDMatrix(const string& i_filename,bool withDocNames = false);

    bool loadOldTDMatrix(const string& i_filename, bool withDocNames = false);

    /**
     * @brief calculateTDMatrix is function for filling m_tdmatrix
     */
    void calculateTDMatrix(shared_ptr<Tools::DocumentCreator> i_docCreator);

	void calculateTDMatrix(vector<shared_ptr<Tools::Document> >& docVec);
    /**
     * @brief Calculate document freaquency (m_df). Based on m_tdmatrix data
     * @return m_df
     */
    WordDoubleStat &calculatedf(void);

    /**
     * @brief Calculate cocument freaquency for defined domain. Based on m_tdmatrix data. CF is not stored to m_cf!!!!
     * @param[in] i_domain is domain for cf calculation
     * @return m_df
     */
    WordDoubleStat &calculatecf(Category i_domain);

    /**
     * @brief calculatecf computes collection frequency of token
     * @return m_cf
     */
    WordDoubleStat &calculatecf(void);

    /**
     * @brief Calculate invert document frequency (m_idf). Based on m_df data
     */
    WordDoubleStat &calculateidf(void);

    /**
     * @brief Calculate mutual information (m_MI)
     */
    vector<WordDoubleStat> &calculateMI(void);

    Vocabulary& vocabulary();

    void set_vocabulary(const Vocabulary& i_voc);

    bool& predefinedVocabulary(void);

    /**
     * @brief calculateCentroids is function for obtaining centroids of classes
     * @return
     */
    vector<WordDoubleStat> &calculateCentroids(void);

    shared_ptr<DocumentProcessor> docProcessor()
    {
        return m_docProcessor;
    }

    friend class statcalc::DocumentProcessor;

private:
    void saveTDMatrix_(ofstream& i_oStream);
    void saveDocID_(ofstream& i_oStream);
    void saveIDCategory_(ofstream& i_oStream);
    void saveVocabulary_(ofstream& i_oStream);

    void loadTDMatrix_(ifstream& i_iStream);
    void loadDocID_(ifstream& i_iStream);
    void loadIDCategory_(ifstream& i_iStream);
    void loadVocabulary_(ifstream& i_iStream);
    void loadOldTDMatrix_(ifstream& i_iStream);

    shared_ptr<DocumentProcessor> m_docProcessor;

    DocID m_docID;
    DocCollectionBOW m_vecTriplets;
    Vocabulary m_vocabulary;
    IDCategory m_idCategory;
    TDMatrix m_tdmatrix;
    WordDoubleStat m_df;
    WordDoubleStat m_cf;
    WordDoubleStat m_idf;
    vector<WordDoubleStat> m_MI;
    vector<WordDoubleStat> m_centroids;
    bool m_predefinedVocabulary;
};

}
#endif //_STAT_CALC_


text:
F.Promise = F.MONAD(function (monad, initialValue) {
    var value;
    var cb;
    var chainPromise;
    monad.isPromise = true;

    monad.bind = function (fn) {
        if (value === undefined) {
            cb = fn;
            chainPromise = F.Promise();
            return chainPromise;
        } else {
            return fn(value);
        }
    };

    monad.resolve = function (v) {
        value = v;
        if (cb) {
            var mValue = cb(v);
            if (chainPromise && mValue) {
                var cbValue;
                mValue.bind(function (v) {
                    cbValue = v;
                });
                chainPromise.resolve(cbValue);
            }
        }
    };
});


text:
Shindo.tests('Fog::Compute[:vsphere] | revert_to_snapshot request', ['vsphere']) do
  compute = Fog::Compute[:vsphere]

  tests('The response should') do
    response = compute.revert_to_snapshot(Fog::Vsphere::Compute::Snapshot.new(service: 1))
    test('be a kind of Hash') { response.is_a? Hash }
    test('should have a task_state key') { response.key? 'state' }
  end

  tests('The expected options') do
    raises(ArgumentError, 'raises ArgumentError when input param is missing') { compute.revert_to_snapshot(nil) }
  end
end


text:
import React from 'react';

export const yearsOfExperience = parseInt((new Date()).getFullYear()) - 2007;

export const employmentHistory = [
  {
    from: '2018',
    description: Software Engineer, Express Scripts,
    bullets: [
      Meaningfully contributed to 22 Express Scripts projects.,
      A top contributor in regards to story (issue/ticket) count.
    ],
    isFeatured: true
  },
  {
    from: '2015',
    to: '2018',
    description: Software Engineer, Greplytix,
    bullets: [
      Letter of recommendation. (online),
      Component-based, MVC web application development.,
      Promoted to lead client-side developer.
    ]
  },
  {
    from: '2013',
    to: '2015',
    description: Webmaster, Southern Illinois University Alumni Association,
    bullets: [
      Handled all website tasks.,
      Assisted clients with technical problems.,
      Utilized analytical data for informed, money-saving decisions.
    ]
  },
  {
    from: '2011',
    to: '2012',
    description: Information Technology, Southern Illinois University IT,
    bullets: [
      Inspected thousands of code files for malicious code.,
      Trained new employees.
    ]
  },
  {
    from: '2010',
    to: '2011',
    description: Computer Lab Manager, Champaign Central High School,
    bullets: [
      Administered and networked 25 Apple iMacs.,
      Taught students web development.
    ]
  },
  {
    from: '2009',
    to: '2011',
    description: Lead Web Developer, Champaign Central High School,
    bullets: [
      Only student with expertise and trust to work on school website.,
      Edited several hundred webpages.
    ]
  }
];


text:
package org.apache.activemq.artemis.spi.core.remoting;

import io.netty.channel.ChannelFutureListener;
import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
import org.apache.activemq.artemis.api.core.TransportConfiguration;
import org.apache.activemq.artemis.core.security.ActiveMQPrincipal;
import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection;

/**
 * The connection used by a channel to write data to.
 */
public interface Connection {

   /**
    * Create a new ActiveMQBuffer of the given size.
    *
    * @param size the size of buffer to create
    * @return the new buffer.
    */
   ActiveMQBuffer createTransportBuffer(int size);

   ActiveMQBuffer createTransportBuffer(int size, boolean pooled);

   RemotingConnection getProtocolConnection();

   void setProtocolConnection(RemotingConnection connection);

   boolean isWritable(ReadyListener listener);

   void fireReady(boolean ready);

   /**
    * This will disable reading from the channel.
    * This is basically the same as blocking the reading.
    */
   void setAutoRead(boolean autoRead);

   /**
    * returns the unique id of this wire.
    *
    * @return the id
    */
   Object getID();

   /**
    * writes the buffer to the connection and if flush is true returns only when the buffer has been physically written to the connection.
    *
    * @param buffer  the buffer to write
    * @param flush   whether to flush the buffers onto the wire
    * @param batched whether the packet is allowed to batched for better performance
    */
   void write(ActiveMQBuffer buffer, boolean flush, boolean batched);

   /**
    * writes the buffer to the connection and if flush is true returns only when the buffer has been physically written to the connection.
    *
    * @param buffer  the buffer to write
    * @param flush   whether to flush the buffers onto the wire
    * @param batched whether the packet is allowed to batched for better performance
    */
   void write(ActiveMQBuffer buffer, boolean flush, boolean batched, ChannelFutureListener futureListener);

   /**
    * writes the buffer to the connection with no flushing or batching
    *
    * @param buffer the buffer to write
    */
   void write(ActiveMQBuffer buffer);

   /**
    * This should close the internal channel without calling any listeners.
    * This is to avoid a situation where the broker is busy writing on an internal thread.
    * This should close the socket releasing any pending threads.
    */
   void forceClose();

   /**
    * Closes the connection.
    */
   void close();

   /**
    * Returns a string representation of the remote address this connection is connected to.
    *
    * @return the remote address
    */
   String getRemoteAddress();

   /**
    * Returns a string representation of the local address this connection is connected to.
    * This is useful when the server is configured at 0.0.0.0 (or multiple IPs).
    * This will give you the actual IP that's being used.
    *
    * @return the local address
    */
   String getLocalAddress();

   /**
    * Called periodically to flush any data in the batch buffer
    */
   void checkFlushBatchBuffer();

   /**
    * Generates a {@link TransportConfiguration} to be used to connect to the same target this is
    * connected to.
    *
    * @return TransportConfiguration
    */
   TransportConfiguration getConnectorConfig();

   ActiveMQPrincipal getDefaultActiveMQPrincipal();

   /**
    * the InVM Connection has some special handling as it doesn't use Netty ProtocolChannel
    * we will use this method Instead of using instanceof
    *
    * @return
    */
   boolean isUsingProtocolHandling();
}


text:
#include "tensorflow/compiler/tf2xla/mlir_bridge_pass.h"

#include <string>

#include "llvm/ADT/StringRef.h"
#include "llvm/Support/raw_os_ostream.h"
#include "tensorflow/compiler/mlir/tensorflow/transforms/bridge.h"
#include "tensorflow/compiler/mlir/tensorflow/translate/export_graphdef.h"
#include "tensorflow/compiler/mlir/tensorflow/translate/import_model.h"
#include "tensorflow/compiler/mlir/tensorflow/translate/mlir_roundtrip_flags.h"
#include "tensorflow/compiler/mlir/tensorflow/utils/device_util.h"
#include "tensorflow/core/graph/graph_constructor.h"
#include "tensorflow/core/public/session_options.h"

namespace tensorflow {

// Dumps the MLIR module to disk.
// This require the TF_DUMP_GRAPH_PREFIX to be set to a path that exist (or can
// be created).
static void DumpModule(mlir::ModuleOp module, llvm::StringRef file_prefix) {
  const char* prefix_env = getenv("TF_DUMP_GRAPH_PREFIX");
  if (!prefix_env) {
    LOG(WARNING)
        << "Failed to dump MLIR module because dump location is not "
        << " specified through TF_DUMP_GRAPH_PREFIX environment variable.";
    return;
  }
  std::string prefix = prefix_env;

  auto* env = tensorflow::Env::Default();
  auto status = env->RecursivelyCreateDir(prefix);
  if (!status.ok()) {
    LOG(WARNING) << "cannot create directory '" + prefix +
                        "': " + status.error_message();
    return;
  }
  prefix += "/" + file_prefix.str();
  if (!tensorflow::Env::Default()->CreateUniqueFileName(&prefix, ".mlir")) {
    LOG(WARNING) << "cannot create unique filename, won't dump MLIR module.";
    return;
  }

  std::unique_ptr<WritableFile> file_writer;
  status = env->NewWritableFile(prefix, &file_writer);
  if (!status.ok()) {
    LOG(WARNING) << "cannot open file '" + prefix +
                        "': " + status.error_message();
    return;
  }

  // Print the module to a string before writing to the file.
  std::string txt_module;
  {
    llvm::raw_string_ostream os(txt_module);
    module.print(os);
  }

  status = file_writer->Append(txt_module);
  if (!status.ok()) {
    LOG(WARNING) << "error writing to file '" + prefix +
                        "': " + status.error_message();
    return;
  }
  (void)file_writer->Close();
  VLOG(1) << "Dumped MLIR module to " << prefix;
}

// This runs the first phase of the "bridge", transforming the graph in a form
// that can be executed with delegation of some computations to an accelerator.
// This builds on the model of XLA where a subset of the graph is encapsulated
// and attached to a "compile" operation, whose result is fed to an "execute"
// operation. The kernel for these operations is responsible to lower the
// encapsulated graph to a particular device.
Status MlirBridgePass::Run(const GraphOptimizationPassOptions& options) {
  if (!options.session_options->config.experimental().enable_mlir_bridge()) {
    VLOG(1) << "Skipping MLIR Bridge Pass, session flag not enabled";
    return Status::OK();
  }
  GraphDebugInfo debug_info;
  mlir::MLIRContext context;
  GraphImportConfig specs;
  specs.graph_as_function = true;

  GraphExportConfig confs;
  confs.graph_as_function = true;
  TF_ASSIGN_OR_RETURN(auto module,
                      ConvertGraphToMlir(**options.graph, debug_info,
                                         *options.flib_def, specs, &context));

  AddDevicesToOp(*module, options.device_set);

  if (VLOG_IS_ON(1)) DumpModule(*module, "mlir_bridge_before_");

  // Run the bridge now
  TF_RETURN_IF_ERROR(
      mlir::TFTPU::TPUBridge(*module, /*enable_logging=*/VLOG_IS_ON(1)));

  if (VLOG_IS_ON(1)) DumpModule(*module, "mlir_bridge_after_");

  TF_RETURN_WITH_CONTEXT_IF_ERROR(
      ConvertMlirToGraph(*module, confs, options.graph, options.flib_def),
      "Error converting MLIR module back to graph");

  return Status::OK();
}

}  // namespace tensorflow


text:
package org.apache.camel.dataformat.bindy;

import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.TreeMap;

import org.apache.camel.dataformat.bindy.annotation.DataField;
import org.apache.camel.dataformat.bindy.annotation.FixedLengthRecord;
import org.apache.camel.dataformat.bindy.annotation.Link;
import org.apache.camel.dataformat.bindy.format.FormatException;
import org.apache.camel.spi.PackageScanClassResolver;
import org.apache.camel.util.ObjectHelper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * The BindyCsvFactory is the class who allows to : Generate a model associated
 * to a fixed length record, bind data from a record to the POJOs, export data of POJOs
 * to a fixed length record and format data into String, Date, Double, ... according to
 * the format/pattern defined
 */
public class BindyFixedLengthFactory extends BindyAbstractFactory implements BindyFactory {

    private static final transient Logger LOG = LoggerFactory.getLogger(BindyFixedLengthFactory.class);

    boolean isOneToMany;

    private Map<Integer, DataField> dataFields = new LinkedHashMap<Integer, DataField>();
    private Map<Integer, Field> annotatedFields = new LinkedHashMap<Integer, Field>();

    private Map<Integer, List> results;

    private int numberOptionalFields;
    private int numberMandatoryFields;
    private int totalFields;

    private boolean hasHeader;
    private boolean hasFooter;
    private char paddingChar;
    private int recordLength;

    public BindyFixedLengthFactory(PackageScanClassResolver resolver, String... packageNames) throws Exception {
        super(resolver, packageNames);

        // initialize specific parameters of the fixed length model
        initFixedLengthModel();
    }

    /**
     * method uses to initialize the model representing the classes who will
     * bind the data. This process will scan for classes according to the
     * package name provided, check the annotated classes and fields
     */
    public void initFixedLengthModel() throws Exception {

        // Find annotated fields declared in the Model classes
        initAnnotatedFields();

        // initialize Fixed length parameter(s)
        // from @FixedLengthrecord annotation
        initFixedLengthRecordParameters();
    }

    public void initAnnotatedFields() {

        for (Class<?> cl : models) {

            List<Field> linkFields = new ArrayList<Field>();

            if (LOG.isDebugEnabled()) {
                LOG.debug("Class retrieved: {}", cl.getName());
            }

            for (Field field : cl.getDeclaredFields()) {
                DataField dataField = field.getAnnotation(DataField.class);
                if (dataField != null) {
                    if (LOG.isDebugEnabled()) {
                        LOG.debug("Position defined in the class: {}, position: {}, Field: {}", new Object[]{cl.getName(), dataField.pos(), dataField});
                    }

                    if (dataField.required()) {
                        ++numberMandatoryFields;
                    } else {
                        ++numberOptionalFields;
                    }

                    dataFields.put(dataField.pos(), dataField);
                    annotatedFields.put(dataField.pos(), field);
                }

                Link linkField = field.getAnnotation(Link.class);

                if (linkField != null) {
                    if (LOG.isDebugEnabled()) {
                        LOG.debug("Class linked: {}, Field: {}", cl.getName(), field);
                    }
                    linkFields.add(field);
                }

            }

            if (!linkFields.isEmpty()) {
                annotatedLinkFields.put(cl.getName(), linkFields);
            }

            totalFields = numberMandatoryFields + numberOptionalFields;

            if (LOG.isDebugEnabled()) {
                LOG.debug("Number of optional fields: {}", numberOptionalFields);
                LOG.debug("Number of mandatory fields: {}", numberMandatoryFields);
                LOG.debug("Total: {}", totalFields);
            }

        }
    }

    // Will not be used in the case of a Fixed Length record
    // as we provide the content of the record and
    // we don't split it as this is the case for a CSV record
    @Override
    public void bind(List<String> data, Map<String, Object> model, int line) throws Exception {
        // noop
    }

    public void bind(String record, Map<String, Object> model, int line) throws Exception {

        int pos = 1;
        int counterMandatoryFields = 0;
        DataField dataField;
        String token;
        int offset;
        int length;
        Field field;
        String pattern;

        // Iterate through the list of positions
        // defined in the @DataField
        // and grab the data from the line
        Collection c = dataFields.values();
        Iterator itr = c.iterator();

        while (itr.hasNext()) {
            dataField = (DataField)itr.next();
            offset = dataField.pos();
            length = dataField.length();

            ObjectHelper.notNull(offset, "Position/offset is not defined for the field: " + dataField.toString());
            ObjectHelper.notNull(offset, "Length is not defined for the field: " + dataField.toString());

            if (offset - 1 <= -1) {
                throw new IllegalArgumentException("Offset/Position of the field " + dataField.toString()
                                                   + " cannot be negative!");
            }

            token = record.substring(offset - 1, offset + length - 1);

            if (dataField.trim()) {
                token = token.trim();
            }

            // Check mandatory field
            if (dataField.required()) {

                // Increment counter of mandatory fields
                ++counterMandatoryFields;

                // Check if content of the field is empty
                // This is not possible for mandatory fields
                if (token.equals("")) {
                    throw new IllegalArgumentException("The mandatory field defined at the position " + pos
                                                       + " is empty for the line: " + line);
                }
            }

            // Get Field to be setted
            field = annotatedFields.get(offset);
            field.setAccessible(true);

            if (LOG.isDebugEnabled()) {
                LOG.debug("Pos/Offset: {}, Data: {}, Field type: {}", new Object[]{offset, token, field.getType()});
            }

            Format<?> format;

            // Get pattern defined for the field
            pattern = dataField.pattern();

            // Create format object to format the field
            format = FormatFactory.getFormat(field.getType(), pattern, getLocale(), dataField.precision());

            // field object to be set
            Object modelField = model.get(field.getDeclaringClass().getName());

            // format the data received
            Object value = null;

            if (!token.equals("")) {
                try {
                    value = format.parse(token);
                } catch (FormatException ie) {
                    throw new IllegalArgumentException(ie.getMessage() + ", position: " + offset + ", line: " + line, ie);
                } catch (Exception e) {
                    throw new IllegalArgumentException("Parsing error detected for field defined at the position/offset: " + offset + ", line: " + line, e);
                }
            } else {
                value = getDefaultValueForPrimitive(field.getType());
            }

            field.set(modelField, value);

            ++pos;

        }

        LOG.debug("Counter mandatory fields: {}", counterMandatoryFields);

        if (pos < totalFields) {
            throw new IllegalArgumentException("Some fields are missing (optional or mandatory), line: " + line);
        }

        if (counterMandatoryFields < numberMandatoryFields) {
            throw new IllegalArgumentException("Some mandatory fields are missing, line: " + line);
        }

    }

    public String unbind(Map<String, Object> model) throws Exception {

        StringBuilder buffer = new StringBuilder();
        results = new HashMap<Integer, List>();

        for (Class clazz : models) {

            if (model.containsKey(clazz.getName())) {

                Object obj = model.get(clazz.getName());

                if (LOG.isDebugEnabled()) {
                    LOG.debug("Model object: {}, class: {}", obj, obj.getClass().getName());
                }

                if (obj != null) {

                    // Generate Fixed Length table
                    // containing the positions of the fields
                    generateFixedLengthPositionMap(clazz, obj);

                }
            }
        }

        // Convert Map<Integer, List> into List<List>
        TreeMap<Integer, List> sortValues = new TreeMap<Integer, List>(results);
        for (Entry<Integer, List> entry : sortValues.entrySet()) {

            // Get list of values
            List<String> val = entry.getValue();
            String value = val.get(0);

            buffer.append(value);
        }

        return buffer.toString();
    }

    /**
     *
     * Generate a table containing the data formatted and sorted with their position/offset
     * The result is placed in the Map<Integer, List> results
     */

    private void generateFixedLengthPositionMap(Class clazz, Object obj) throws Exception {

        String result = "";

        for (Field field : clazz.getDeclaredFields()) {

            field.setAccessible(true);

            DataField datafield = field.getAnnotation(DataField.class);

            if (datafield != null) {

                if (obj != null) {

                    // Retrieve the format, pattern and precision associated to
                    // the type
                    Class type = field.getType();
                    String pattern = datafield.pattern();
                    int precision = datafield.precision();

                    // Create format
                    Format format = FormatFactory.getFormat(type, pattern, getLocale(), precision);

                    // Get field value
                    Object value = field.get(obj);

                    result = formatString(format, value);

                    // trim if enabled
                    if (datafield.trim()) {
                        result = result.trim();
                    }

                    // Get length of the field, alignment (LEFT or RIGHT), pad
                    int fieldLength = datafield.length();
                    String align = datafield.align();
                    char padCharField = datafield.paddingChar();
                    char padChar;

                    if (fieldLength > 0) {

                        StringBuilder temp = new StringBuilder();

                        // Check if we must pad
                        if (result.length() < fieldLength) {

                            // No padding defined for the field
                            if (padCharField == 0) {
                                // We use the padding defined for the Record
                                padChar = paddingChar;
                            } else {
                                padChar = padCharField;
                            }

                            if (align.contains("R")) {
                                temp.append(generatePaddingChars(padChar, fieldLength, result.length()));
                                temp.append(result);
                            } else if (align.contains("L")) {
                                temp.append(result);
                                temp.append(generatePaddingChars(padChar, fieldLength, result.length()));
                            } else {
                                throw new IllegalArgumentException("Alignment for the field: " + field.getName()
                                        + " must be equal to R for RIGHT or L for LEFT !");
                            }

                            result = temp.toString();
                        } else if (result.length() > fieldLength) {
                            // we are bigger than allowed

                            // is clipped enabled? if so clip the field
                            if (datafield.clip()) {
                                result = result.substring(0, fieldLength);
                            } else {
                                throw new IllegalArgumentException("Length for the " + field.getName()
                                        + " must not be larger than allowed, was: " + result.length() + ", allowed: " + fieldLength);
                            }
                        }

                    } else {
                        throw new IllegalArgumentException("Length of the field: " + field.getName()
                                + " is a mandatory field and cannot be equal to zero or to be negative !");
                    }

                    if (LOG.isDebugEnabled()) {
                        LOG.debug("Value to be formatted: {}, position: {}, and its formatted value: {}", new Object[]{value, datafield.pos(), result});
                    }

                } else {
                    result = "";
                }

                Integer key;
                key = datafield.pos();

                if (!results.containsKey(key)) {
                    List list = new LinkedList();
                    list.add(result);
                    results.put(key, list);
                } else {
                    List list = results.get(key);
                    list.add(result);
                }

            }

        }

    }

    private String generatePaddingChars(char pad, int lengthField, int lengthString) {
        StringBuilder buffer = new StringBuilder();
        int size = lengthField - lengthString;

        for (int i = 0; i < size; i++) {
            buffer.append(Character.toString(pad));
        }
        return buffer.toString();
    }

    /**
     * Get parameters defined in @FixedLengthRecord annotation
     */
    private void initFixedLengthRecordParameters() {

        for (Class<?> cl : models) {

            // Get annotation @FixedLengthRecord from the class
            FixedLengthRecord record = cl.getAnnotation(FixedLengthRecord.class);

            if (record != null) {
                LOG.debug("Fixed length record : {}", record);

                // Get carriage return parameter
                crlf = record.crlf();
                LOG.debug("Carriage return defined for the CSV : {}", crlf);

                // Get hasHeader parameter
                hasHeader = record.hasHeader();
                LOG.debug("Has Header :  {}", hasHeader);

                // Get hasFooter parameter
                hasFooter = record.hasFooter();
                LOG.debug("Has Footer :  {}", hasFooter);

                // Get padding character
                paddingChar = record.paddingChar();
                LOG.debug("Padding char :  {}", paddingChar);

                // Get length of the record
                recordLength = record.length();
                LOG.debug("Length of the record : {}", recordLength);

                // Get length of the record
                recordLength = record.length();
                LOG.debug("Length of the record : {}", recordLength);
            }
        }
    }

    /**
     * Flag indicating if we have a header
     */
    public boolean hasHeader() {
        return hasHeader;
    }

    /**
     * Flag indicating if we have a footer
     */
    public boolean hasFooter() {
        return hasFooter;
    }

    /**
     * Padding char used to fill the field
     */
    public char paddingchar() {
        return paddingChar;
    }

    public int recordLength() {
        return recordLength;
    }

}


text:
import React, { Component } from 'react'
import {
  Image,
  View,
  StyleSheet
} from 'react-native'

export default class Background extends Component {
  constructor(props) {
    super(props)
  }

  render() {
    return (
      <View style={styles.backgroundContainer}>
        <Image
        source={this.props.imgSrouce}
        style={styles.background}/>
      </View>
    )
  }
}

const styles = StyleSheet.create({
  backgroundContainer : {
    position: 'absolute',
    top: 0,
    bottom: 0,
    left: 0,
    right: 0
  },
  background : {
    flex: 1,
    height: null,
    width: null
  }
})


text:
PACKAGE_NAME=bump
PACKAGE_VERSION=${1-"v0.8.0"}
PACKAGE_URL=https://github.com/gregorym/bump

yum install -y gcc git make ruby ruby-devel redhat-rpm-config

gem install bundle
gem install rake

mkdir -p /home/tester/output
cd /home/tester

git clone $PACKAGE_URL $PACKAGE_NAME
cd $PACKAGE_NAME
git checkout $PACKAGE_VERSION

bundle install

git config --global user.email "you@example.com"
git config --global user.name "Your Name"
bundle exec rake spec

exit 0