text:
<?xml version="1.0" encoding="utf-8"?>

<menu xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto">

    <item android:id="@+id/menu_save_data"
          android:icon="@android:drawable/ic_menu_save"
          android:title="@string/save_data"
          app:showAsAction="never"
          />

    <item android:id="@+id/menu_first_person"
        android:title="@string/first_person"
        app:showAsAction="never"
        />

    <item android:id="@+id/menu_third_person"
        android:title="@string/third_person"
        app:showAsAction="never"
        />

</menu>


text:
package io.siddhi.core.query.output.ratelimit.snapshot;

import io.siddhi.core.config.SiddhiQueryContext;
import io.siddhi.core.event.ComplexEvent;
import io.siddhi.core.event.ComplexEventChunk;
import io.siddhi.core.event.GroupedComplexEvent;
import io.siddhi.core.event.stream.StreamEventFactory;
import io.siddhi.core.util.Scheduler;
import io.siddhi.core.util.parser.SchedulerParser;
import io.siddhi.core.util.snapshot.state.State;
import io.siddhi.core.util.snapshot.state.StateFactory;

import java.util.Arrays;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;

/**
 * Implementation of {@link PerSnapshotOutputRateLimiter} for queries with Windows.
 */
public class WindowedPerSnapshotOutputRateLimiter
        extends SnapshotOutputRateLimiter<WindowedPerSnapshotOutputRateLimiter.RateLimiterState> {
    private final Long value;
    private Comparator comparator;
    private Scheduler scheduler;

    public WindowedPerSnapshotOutputRateLimiter(Long value,
                                                WrappedSnapshotOutputRateLimiter wrappedSnapshotOutputRateLimiter,
                                                boolean groupBy, SiddhiQueryContext siddhiQueryContext) {
        super(wrappedSnapshotOutputRateLimiter, siddhiQueryContext, groupBy);
        this.value = value;
        this.comparator = (Comparator<ComplexEvent>) (event1, event2) -> {
            if (Arrays.equals(event1.getOutputData(), event2.getOutputData())) {
                return 0;
            } else {
                return 1;
            }
        };
    }

    @Override
    protected StateFactory<RateLimiterState> init() {
        this.scheduler = SchedulerParser.parse(this, siddhiQueryContext);
        this.scheduler.setStreamEventFactory(new StreamEventFactory(0, 0, 0));
        this.scheduler.init(lockWrapper, siddhiQueryContext.getName());
        return () -> new RateLimiterState();
    }

    @Override
    public void process(ComplexEventChunk complexEventChunk) {
        List<ComplexEventChunk> outputEventChunks = new LinkedList<>();
        complexEventChunk.reset();
        RateLimiterState state = stateHolder.getState();
        try {
            synchronized (state) {
                while (complexEventChunk.hasNext()) {
                    ComplexEvent event = complexEventChunk.next();
                    if (event instanceof GroupedComplexEvent) {
                        event = ((GroupedComplexEvent) event).getComplexEvent();
                    }
                    if (event.getType() == ComplexEvent.Type.TIMER) {
                        tryFlushEvents(outputEventChunks, event, state);
                    } else if (event.getType() == ComplexEvent.Type.CURRENT) {
                        complexEventChunk.remove();
                        tryFlushEvents(outputEventChunks, event, state);
                        state.eventList.add(event);
                    } else if (event.getType() == ComplexEvent.Type.EXPIRED) {
                        tryFlushEvents(outputEventChunks, event, state);
                        for (Iterator<ComplexEvent> iterator = state.eventList.iterator(); iterator.hasNext(); ) {
                            ComplexEvent currentEvent = iterator.next();
                            if (comparator.compare(currentEvent, event) == 0) {
                                iterator.remove();
                                break;
                            }
                        }
                    } else if (event.getType() == ComplexEvent.Type.RESET) {
                        tryFlushEvents(outputEventChunks, event, state);
                        state.eventList.clear();
                    }
                }
            }
        } finally {
            stateHolder.returnState(state);
        }
        sendToCallBacks(outputEventChunks);
    }

    private void tryFlushEvents(List<ComplexEventChunk> outputEventChunks, ComplexEvent event,
                                RateLimiterState state) {
        if (event.getTimestamp() >= state.scheduledTime) {
            ComplexEventChunk<ComplexEvent> outputEventChunk = new ComplexEventChunk<>();
            for (ComplexEvent complexEvent : state.eventList) {
                outputEventChunk.add(cloneComplexEvent(complexEvent));
            }
            outputEventChunks.add(outputEventChunk);
            state.scheduledTime = state.scheduledTime + value;
            scheduler.notifyAt(state.scheduledTime);
        }
    }

    @Override
    public void partitionCreated() {
        RateLimiterState state = stateHolder.getState();
        try {
            synchronized (state) {
                long currentTime = System.currentTimeMillis();
                state.scheduledTime = currentTime + value;
                scheduler.notifyAt(state.scheduledTime);
            }
        } finally {
            stateHolder.returnState(state);
        }
    }

    class RateLimiterState extends State {

        private List<ComplexEvent> eventList = new LinkedList<>();
        private long scheduledTime;

        @Override
        public boolean canDestroy() {
            return eventList.isEmpty() && scheduledTime == 0;
        }

        @Override
        public Map<String, Object> snapshot() {
            Map<String, Object> state = new HashMap<>();
            state.put("EventList", eventList);
            state.put("ScheduledTime", scheduledTime);
            return state;
        }

        @Override
        public void restore(Map<String, Object> state) {
            eventList = (List<ComplexEvent>) state.get("EventList");
            scheduledTime = (Long) state.get("ScheduledTime");
        }
    }

}

redpajama_set_name: RedPajamaGithub


text:
Change-Log
===============
> Regular configuration update: _01.11.2018_

More **detailed changelog** for each respective version may be viewed by pressing on a desired _version's name_.

## Version 1.x ##

### [1.4.0](https://github.com/universum-studios/android_fragments/releases/tag/v1.4.0) ###
> 15.11.2018

- Regular **dependencies update** (mainly to use new artifacts from **Android Jetpack**).
- Small updates and improvements.

### [1.3.4](https://github.com/universum-studios/android_fragments/releases/tag/v1.3.4) ###
> 05.11.2018

- Small updates and improvements.

### [1.3.3](https://github.com/universum-studios/android_fragments/releases/tag/v1.3.3) ###
> 19.07.2018

- Small updates and code quality improvements.

### [1.3.2](https://github.com/universum-studios/android_fragments/releases/tag/v1.3.2) ###
> 27.02.2018

- Stability improvements.

### [1.3.1](https://github.com/universum-studios/android_fragments/releases/tag/v1.3.1) ###
> 22.12.2017

- `FragmentController` now does not attach **custom animations** to `FragmentTransaction` also when
  a device is in **power save mode**.
- Removed deprecated elements from previous versions.

### [1.3.0](https://github.com/universum-studios/android_fragments/releases/tag/v1.3.0) ###
> 21.08.2017

- **Dropped support** for _Android_ versions **below** _API Level 14_ for both versions of the library.
- Fixed [Issue #29](https://github.com/universum-studios/android_fragments/issues/29).

### [1.2.0](https://github.com/universum-studios/android_fragments/releases/tag/v1.2.0) ###
> 09.05.2017

- **Annotations processing via reflection is by default DISABLED**. If desired, may be enabled via
  `FragmentAnnotations.setEnabled(true)`.
- If **Animator duration scale** developer setting is set to **off** the custom fragment animations
  specified via desired `FragmentTransition` are not set to `FragmentTransaction` as such animations
  would not be actually played by the **Android** animation framework. This concerns only **animator**
  based animations used for **not support** library version. This check has been added due to problem
  with **translate** animations. When these animations (animators) are used to transition between
  fragments and the animator duration scale setting is set to off, views of those fragments are just
  not shown/drawn even thought the fragments are properly added/shown.

### [1.1.1](https://github.com/universum-studios/android_fragments/releases/tag/v1.1.1) ###
> 03.03.2017

- Deprecated some not properly named methods of `FragmentRequest` and replaced with better named ones.
- Updated implementation of `FragmentController.newRequest(int)` and of `FragmentController.executeRequest(...)`.
  See **[Issue #3](https://github.com/universum-studios/android_fragments/issues/3)** for more info.

### [1.1.0](https://github.com/universum-studios/android_fragments/releases/tag/v1.1.0) ###
> 19.01.2017

- `FragmentTransition` interface now extends `Parcelable`, this extension relation has been before
  declared for `BasicFragmentTransition` which implements `FragmentTransition`.

### [1.0.1](https://github.com/universum-studios/android_fragments/releases/tag/v1.0.1) ###
> 17.01.2017

- Removed interpolator from **alpha** animations/transitions.
- Updated **JavaDoc** for annotations.

### [1.0.0](https://github.com/universum-studios/android_fragments/releases/tag/v1.0.0) ###
> 02.01.2017

- First production release.


text:
package types

// FileSystemTotal type.
//
// https://github.com/elastic/elasticsearch-specification/blob/4ca0cc05d3ae3fa06c2cd7be91905b656a474334/specification/nodes/_types/Stats.ts#L301-L308
type FileSystemTotal struct {
	Available        *string `json:"available,omitempty"`
	AvailableInBytes *int64  `json:"available_in_bytes,omitempty"`
	Free             *string `json:"free,omitempty"`
	FreeInBytes      *int64  `json:"free_in_bytes,omitempty"`
	Total            *string `json:"total,omitempty"`
	TotalInBytes     *int64  `json:"total_in_bytes,omitempty"`
}

// NewFileSystemTotal returns a FileSystemTotal.
func NewFileSystemTotal() *FileSystemTotal {
	r := &FileSystemTotal{}

	return r
}


text:
zeit.cms.Clipboard = Class.extend({

    construct: function(base_url, tree_url, clipboard_id) {
        this.base_url = base_url;
        this.contentElement = getElement(clipboard_id);
        this.tree = new Tree(tree_url, clipboard_id);
        this.dragging = false;

        connect(
            this.tree, 'zeit.cms.BeforeTreeChangeEvent',
            this, 'handleBeforeTreeChange');
        connect(
            this.tree, 'zeit.cms.TreeChangedEvent',
            this, 'handleTreeChanged');

        MochiKit.Position.includeScrollOffsets = true;

        // Removing
        connect(clipboard_id, 'onclick', this, 'removeClip');
    },

    enableAdding: function() {
        // Adding
        connect('clip-add-folder-link', 'onclick', this, 'showAddBox');
        connect('clip-add-folder-submit', 'onclick', this, 'addClip');
        connect('clip-add-folder-cancel', 'onclick', this, 'hideAddBox');
    },

    connectDNDHandlers: function() {
        var elements = this.contentElement.getElementsByTagName('li');
        var dnd = this;
        forEach(elements, function(node) {
            new MochiKit.DragAndDrop.Droppable(node, {
                hoverclass: 'TreeHover',
                ondrop: function(element, last_active_element, event) {
                            dnd.handleDrop(
                                node.getAttribute('uniqueid'), element);
                    },
            });
            if (node.getAttribute('uniqueid')) {
                zeit.cms.createDraggableContentObject(node);
            }
        });

        // Disable click event while dragging.
        MochiKit.Signal.connect(
            this.contentElement, 'onclick', function(event) {
                if (event.target().nodeName == 'A' && dnd.dragging == true) {
                    event.stop();
                }
        });
    },

    handleDrop: function(dropped_on, element) {
        this.dragging = true;
        var url;
        var dnd = this;
        var options = {}

        var source_element = element.source_element;
        if (isUndefinedOrNull(source_element)) {
            return;
        }

        var panel = null;
        panel = MochiKit.DOM.getFirstParentByTagAndClassName(
            source_element, 'div', 'panel');
        if (!isNull(panel) && panel.id == 'ClipboardPanel') {
            url = '/@@moveContent';
            options['object_path'] = source_element.getAttribute('uniqueid');
        } else {
            url = '/@@addContent';
            options['unique_id'] = element.uniqueId;
        }

        if (isEmpty(MochiKit.Base.items(options))) {
            return
        }
        options['add_to'] = dropped_on;
        log(repr(MochiKit.Base.items(options)));

        element.drag_successful = true;
        var d = doSimpleXMLHttpRequest(this.base_url + url, options);
        d.addCallbacks(
            function(result) {
                dnd.dragging = false;
                dnd.tree.replaceTree(result.responseText);
            },
            function(error) {
                alert("Could not finish drop: " + repr(MochiKit.Base.items(error.req)))
                return error
            });

    },

    handleBeforeTreeChange: function(event) {
        signal('sidebar', 'zeit.cms.RememberScrollStateEvent');
    },

    handleTreeChanged: function(event) {
        this.connectDNDHandlers();
        signal('sidebar', 'zeit.cms.RestoreScrollState');
        signal('sidebar', 'panel-content-changed');
    },

    // Adding

    showAddBox: function(event) {
        hideElement('clip-add-folder-link');
        showElement('clip-add-folder-box');
        signal('sidebar', 'panel-content-changed');
    },

    hideAddBox: function(event) {
        hideElement('clip-add-folder-box');
        showElement('clip-add-folder-link');
        signal('sidebar', 'panel-content-changed');
    },

    addClip: function(event) {
        var dnd = this;
        var title = getElement('clip-add-folder-title').value;
        if (!title.match(/\w.+/))
            return

        signal('sidebar', 'zeit.cms.RememberScrollStateEvent');
        var d = doSimpleXMLHttpRequest(
            this.base_url + '/@@addContainer', {
                'title': title});
        d.addCallbacks(
            function(result) {
                dnd.tree.replaceTree(result.responseText);
                dnd.hideAddBox();
                signal('sidebar', 'zeit.cms.RestoreScrollState');
            },
            alert
        );
        event.stop();
    },

    removeClip: function(event) {
        var element = event.target();
        var dnd = this;
        if (element == undefined) return;
        try {
            var anchor = getFirstParentByTagAndClassName(element, 'a');
        } catch(e) {
            return
        }

        if (hasElementClass(anchor, 'deleteLink')) {
            event.stop();
            signal('sidebar', 'zeit.cms.RememberScrollStateEvent');
            var url = anchor.getAttribute('href')
            var d = doSimpleXMLHttpRequest(url);
            d.addCallbacks(
                function(result) {
                    dnd.tree.replaceTree(result.responseText);
                    signal('sidebar', 'zeit.cms.RestoreScrollState');
                });
        }
    },
});

zeit.cms.CopyFromClipboard = Class.extend({

    construct: function(clipboard, copy_url, form) {
        this.clipboard = clipboard;
        this.copy_url = copy_url;

        connect(this.clipboard.contentElement, 'onclick',
                this, 'handleClick');
    },

    handleClick: function(event) {
        var othis = this;
        if (event.target().nodeName == 'A') {
            event.stop();
            var url = event.target().href;
            var d = this.getUniqueId(url);
            d.addCallbacks(
                function(result) {
                    var unique_id = result.responseText;
                    othis.copy(unique_id);
                },
                function(error) {
                    log(error);
                });
        }
    },

    getUniqueId: function(base_url) {
        var url = base_url + '/@@ajax.get_unique_id';
        var d = doSimpleXMLHttpRequest(url);
        return d
    },

    copy: function(unique_id) {
        var query = 'unique_id=' + encodeURIComponent(unique_id);
        var url = this.copy_url + '?' + query
        signal(window, 'zeit.cms.LightboxReload');
        window.location = url;
    },
});


text:
package org.apache.accumulo.core.client.admin;

/**
 * The type of ordering to use for the table's entries (default is MILLIS)
 */
public enum TimeType {
  /**
   * Used to guarantee ordering of data sequentially as inserted
   */
  LOGICAL,

  /**
   * This is the default. Tries to ensure that inserted data is stored with the timestamp closest to
   * the machine's time to the nearest millisecond, without going backwards to guarantee insertion
   * sequence. Note that using this time type can cause time to "skip" forward if a machine has a
   * time that is too far off. NTP is recommended when using this type.
   */
  MILLIS
}


text:
<?php
require_once './bootstrap.php';

// check if we have the auth cookie and device cookie
$authCookie = \Webiny\Component\Http\Cookie::getInstance()->get('auth-token');
$deviceToken = \Webiny\Component\Http\Cookie::getInstance()->get('device-token');

$msg = '';
if ($authCookie) {
    try {
        $user = $login->getUser($authCookie, $deviceToken);
        if($user){
            die('You are logged in');
        }
    } catch (\Webiny\Login\LoginException $le) {
        $msg = $le->getMessage();
        die(print_r($le));
    } catch (\Exception $e) {
        die(print_r($e));
    }
}
?>
<!doctype html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>Login page</title>

    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">

    <form class="form-signin">

Please sign in

        Email address
        <input type="email" id="username" value="admin" class="form-control" placeholder="Email address" required
               autofocus>
        Password
        <input type="password" id="password" value="login123" class="form-control" placeholder="Password" required>

                <input type="checkbox" value="remember-me" id="remember-me"> Remember me

        <input type="hidden" name="device-token" id="device-token" value="<?php echo $deviceToken; ?>"/>
        <button class="btn btn-lg btn-primary btn-block" type="button" onclick="submitLogin();">Sign in</button>

    </form>


text:
using System;
using System.Runtime.InteropServices;

namespace Tailviewer.BusinessLogic.FileExplorer
{
	static class NativeMethods
	{
		[DllImport("shell32.dll", ExactSpelling = true)]
		public static extern int SHOpenFolderAndSelectItems(
			 IntPtr pidlFolder,
			 uint cidl,
			 [In, MarshalAs(UnmanagedType.LPArray)] IntPtr[] apidl,
			 uint dwFlags);

		[DllImport("shell32.dll", CharSet = CharSet.Auto)]
		public static extern IntPtr ILCreateFromPath([MarshalAs(UnmanagedType.LPTStr)] string pszPath);

		public static void OpenFolderAndSelectFiles(string folder, params string[] filesToSelect)
		{
			IntPtr dir = ILCreateFromPath(folder);

			var filesToSelectIntPtrs = new IntPtr[filesToSelect.Length];
			for (int i = 0; i < filesToSelect.Length; i++)
			{
				filesToSelectIntPtrs[i] = ILCreateFromPath(filesToSelect[i]);
			}

			SHOpenFolderAndSelectItems(dir, (uint)filesToSelect.Length, filesToSelectIntPtrs, 0);
			ReleaseComObject(dir);
			ReleaseComObject(filesToSelectIntPtrs);
		}

		private static void ReleaseComObject(params object[] comObjs)
		{
			foreach (object obj in comObjs)
			{
				if (obj != null && Marshal.IsComObject(obj))
					Marshal.ReleaseComObject(obj);
			}
		}
	}
}


text:
from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException
from thrift.protocol.TProtocol import TProtocolException
import sys

from thrift.transport import TTransport

class Error(TException):
    """
    Attributes:
     - message
    """

    thrift_spec = (
        None,  # 0
        (1, TType.STRING, 'message', 'UTF8', None, ),  # 1
    )

    def __init__(self, message=None,):
        self.message = message

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec))
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.STRING:
                    self.message = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec)))
            return
        oprot.writeStructBegin('Error')
        if self.message is not None:
            oprot.writeFieldBegin('message', TType.STRING, 1)
            oprot.writeString(self.message.encode('utf-8') if sys.version_info[0] == 2 else self.message)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __str__(self):
        return repr(self)

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)

class PricePerUnit(object):
    """
    Attributes:
     - amount
     - currencyCode
    """

    thrift_spec = (
        None,  # 0
        (1, TType.I32, 'amount', None, None, ),  # 1
        (2, TType.STRING, 'currencyCode', 'UTF8', None, ),  # 2
    )

    def __init__(self, amount=None, currencyCode=None,):
        self.amount = amount
        self.currencyCode = currencyCode

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec))
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.I32:
                    self.amount = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.currencyCode = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec)))
            return
        oprot.writeStructBegin('PricePerUnit')
        if self.amount is not None:
            oprot.writeFieldBegin('amount', TType.I32, 1)
            oprot.writeI32(self.amount)
            oprot.writeFieldEnd()
        if self.currencyCode is not None:
            oprot.writeFieldBegin('currencyCode', TType.STRING, 2)
            oprot.writeString(self.currencyCode.encode('utf-8') if sys.version_info[0] == 2 else self.currencyCode)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)

class Price(object):
    """
    Attributes:
     - id
     - description
     - pricePerUnit
     - unitId
     - unitDescription
    """

    thrift_spec = (
        None,  # 0
        (1, TType.I32, 'id', None, None, ),  # 1
        (2, TType.STRING, 'description', 'UTF8', None, ),  # 2
        (3, TType.STRUCT, 'pricePerUnit', (PricePerUnit, PricePerUnit.thrift_spec), None, ),  # 3
        (4, TType.I32, 'unitId', None, None, ),  # 4
        (5, TType.STRING, 'unitDescription', 'UTF8', None, ),  # 5
    )

    def __init__(self, id=None, description=None, pricePerUnit=None, unitId=None, unitDescription=None,):
        self.id = id
        self.description = description
        self.pricePerUnit = pricePerUnit
        self.unitId = unitId
        self.unitDescription = unitDescription

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec))
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.I32:
                    self.id = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.description = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.STRUCT:
                    self.pricePerUnit = PricePerUnit()
                    self.pricePerUnit.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.I32:
                    self.unitId = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.STRING:
                    self.unitDescription = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec)))
            return
        oprot.writeStructBegin('Price')
        if self.id is not None:
            oprot.writeFieldBegin('id', TType.I32, 1)
            oprot.writeI32(self.id)
            oprot.writeFieldEnd()
        if self.description is not None:
            oprot.writeFieldBegin('description', TType.STRING, 2)
            oprot.writeString(self.description.encode('utf-8') if sys.version_info[0] == 2 else self.description)
            oprot.writeFieldEnd()
        if self.pricePerUnit is not None:
            oprot.writeFieldBegin('pricePerUnit', TType.STRUCT, 3)
            self.pricePerUnit.write(oprot)
            oprot.writeFieldEnd()
        if self.unitId is not None:
            oprot.writeFieldBegin('unitId', TType.I32, 4)
            oprot.writeI32(self.unitId)
            oprot.writeFieldEnd()
        if self.unitDescription is not None:
            oprot.writeFieldBegin('unitDescription', TType.STRING, 5)
            oprot.writeString(self.unitDescription.encode('utf-8') if sys.version_info[0] == 2 else self.unitDescription)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)

class Service(object):
    """
    Attributes:
     - id
     - name
     - description
     - prices
    """

    thrift_spec = (
        None,  # 0
        (1, TType.I32, 'id', None, None, ),  # 1
        (2, TType.STRING, 'name', 'UTF8', None, ),  # 2
        (3, TType.STRING, 'description', 'UTF8', None, ),  # 3
        (4, TType.MAP, 'prices', (TType.I32, None, TType.STRUCT, (Price, Price.thrift_spec), False), None, ),  # 4
    )

    def __init__(self, id=None, name=None, description=None, prices=None,):
        self.id = id
        self.name = name
        self.description = description
        self.prices = prices

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec))
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.I32:
                    self.id = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.name = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.STRING:
                    self.description = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.MAP:
                    self.prices = {}
                    (_ktype1, _vtype2, _size0) = iprot.readMapBegin()
                    for _i4 in range(_size0):
                        _key5 = iprot.readI32()
                        _val6 = Price()
                        _val6.read(iprot)
                        self.prices[_key5] = _val6
                    iprot.readMapEnd()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec)))
            return
        oprot.writeStructBegin('Service')
        if self.id is not None:
            oprot.writeFieldBegin('id', TType.I32, 1)
            oprot.writeI32(self.id)
            oprot.writeFieldEnd()
        if self.name is not None:
            oprot.writeFieldBegin('name', TType.STRING, 2)
            oprot.writeString(self.name.encode('utf-8') if sys.version_info[0] == 2 else self.name)
            oprot.writeFieldEnd()
        if self.description is not None:
            oprot.writeFieldBegin('description', TType.STRING, 3)
            oprot.writeString(self.description.encode('utf-8') if sys.version_info[0] == 2 else self.description)
            oprot.writeFieldEnd()
        if self.prices is not None:
            oprot.writeFieldBegin('prices', TType.MAP, 4)
            oprot.writeMapBegin(TType.I32, TType.STRUCT, len(self.prices))
            for kiter7, viter8 in self.prices.items():
                oprot.writeI32(kiter7)
                viter8.write(oprot)
            oprot.writeMapEnd()
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)

class HCECard(object):
    """
    Attributes:
     - FirstName
     - LastName
     - ExpMonth
     - ExpYear
     - CardNumber
     - Type
     - Cvc
    """

    thrift_spec = (
        None,  # 0
        (1, TType.STRING, 'FirstName', 'UTF8', None, ),  # 1
        (2, TType.STRING, 'LastName', 'UTF8', None, ),  # 2
        (3, TType.I32, 'ExpMonth', None, None, ),  # 3
        (4, TType.I32, 'ExpYear', None, None, ),  # 4
        (5, TType.STRING, 'CardNumber', 'UTF8', None, ),  # 5
        (6, TType.STRING, 'Type', 'UTF8', None, ),  # 6
        (7, TType.STRING, 'Cvc', 'UTF8', None, ),  # 7
    )

    def __init__(self, FirstName=None, LastName=None, ExpMonth=None, ExpYear=None, CardNumber=None, Type=None, Cvc=None,):
        self.FirstName = FirstName
        self.LastName = LastName
        self.ExpMonth = ExpMonth
        self.ExpYear = ExpYear
        self.CardNumber = CardNumber
        self.Type = Type
        self.Cvc = Cvc

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec))
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.STRING:
                    self.FirstName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.LastName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.I32:
                    self.ExpMonth = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.I32:
                    self.ExpYear = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.STRING:
                    self.CardNumber = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 6:
                if ftype == TType.STRING:
                    self.Type = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 7:
                if ftype == TType.STRING:
                    self.Cvc = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec)))
            return
        oprot.writeStructBegin('HCECard')
        if self.FirstName is not None:
            oprot.writeFieldBegin('FirstName', TType.STRING, 1)
            oprot.writeString(self.FirstName.encode('utf-8') if sys.version_info[0] == 2 else self.FirstName)
            oprot.writeFieldEnd()
        if self.LastName is not None:
            oprot.writeFieldBegin('LastName', TType.STRING, 2)
            oprot.writeString(self.LastName.encode('utf-8') if sys.version_info[0] == 2 else self.LastName)
            oprot.writeFieldEnd()
        if self.ExpMonth is not None:
            oprot.writeFieldBegin('ExpMonth', TType.I32, 3)
            oprot.writeI32(self.ExpMonth)
            oprot.writeFieldEnd()
        if self.ExpYear is not None:
            oprot.writeFieldBegin('ExpYear', TType.I32, 4)
            oprot.writeI32(self.ExpYear)
            oprot.writeFieldEnd()
        if self.CardNumber is not None:
            oprot.writeFieldBegin('CardNumber', TType.STRING, 5)
            oprot.writeString(self.CardNumber.encode('utf-8') if sys.version_info[0] == 2 else self.CardNumber)
            oprot.writeFieldEnd()
        if self.Type is not None:
            oprot.writeFieldBegin('Type', TType.STRING, 6)
            oprot.writeString(self.Type.encode('utf-8') if sys.version_info[0] == 2 else self.Type)
            oprot.writeFieldEnd()
        if self.Cvc is not None:
            oprot.writeFieldBegin('Cvc', TType.STRING, 7)
            oprot.writeString(self.Cvc.encode('utf-8') if sys.version_info[0] == 2 else self.Cvc)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)

class Device(object):
    """
    Attributes:
     - uid
     - name
     - description
     - services
     - ipv4Address
     - currencyCode
    """

    thrift_spec = (
        None,  # 0
        (1, TType.STRING, 'uid', 'UTF8', None, ),  # 1
        (2, TType.STRING, 'name', 'UTF8', None, ),  # 2
        (3, TType.STRING, 'description', 'UTF8', None, ),  # 3
        (4, TType.MAP, 'services', (TType.I32, None, TType.STRUCT, (Service, Service.thrift_spec), False), None, ),  # 4
        (5, TType.STRING, 'ipv4Address', 'UTF8', None, ),  # 5
        (6, TType.STRING, 'currencyCode', 'UTF8', None, ),  # 6
    )

    def __init__(self, uid=None, name=None, description=None, services=None, ipv4Address=None, currencyCode=None,):
        self.uid = uid
        self.name = name
        self.description = description
        self.services = services
        self.ipv4Address = ipv4Address
        self.currencyCode = currencyCode

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec))
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.STRING:
                    self.uid = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.name = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.STRING:
                    self.description = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.MAP:
                    self.services = {}
                    (_ktype10, _vtype11, _size9) = iprot.readMapBegin()
                    for _i13 in range(_size9):
                        _key14 = iprot.readI32()
                        _val15 = Service()
                        _val15.read(iprot)
                        self.services[_key14] = _val15
                    iprot.readMapEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.STRING:
                    self.ipv4Address = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 6:
                if ftype == TType.STRING:
                    self.currencyCode = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec)))
            return
        oprot.writeStructBegin('Device')
        if self.uid is not None:
            oprot.writeFieldBegin('uid', TType.STRING, 1)
            oprot.writeString(self.uid.encode('utf-8') if sys.version_info[0] == 2 else self.uid)
            oprot.writeFieldEnd()
        if self.name is not None:
            oprot.writeFieldBegin('name', TType.STRING, 2)
            oprot.writeString(self.name.encode('utf-8') if sys.version_info[0] == 2 else self.name)
            oprot.writeFieldEnd()
        if self.description is not None:
            oprot.writeFieldBegin('description', TType.STRING, 3)
            oprot.writeString(self.description.encode('utf-8') if sys.version_info[0] == 2 else self.description)
            oprot.writeFieldEnd()
        if self.services is not None:
            oprot.writeFieldBegin('services', TType.MAP, 4)
            oprot.writeMapBegin(TType.I32, TType.STRUCT, len(self.services))
            for kiter16, viter17 in self.services.items():
                oprot.writeI32(kiter16)
                viter17.write(oprot)
            oprot.writeMapEnd()
            oprot.writeFieldEnd()
        if self.ipv4Address is not None:
            oprot.writeFieldBegin('ipv4Address', TType.STRING, 5)
            oprot.writeString(self.ipv4Address.encode('utf-8') if sys.version_info[0] == 2 else self.ipv4Address)
            oprot.writeFieldEnd()
        if self.currencyCode is not None:
            oprot.writeFieldBegin('currencyCode', TType.STRING, 6)
            oprot.writeString(self.currencyCode.encode('utf-8') if sys.version_info[0] == 2 else self.currencyCode)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)

class ServiceMessage(object):
    """
    Attributes:
     - deviceDescription
     - hostname
     - portNumber
     - serverId
     - urlPrefix
     - scheme
    """

    thrift_spec = (
        None,  # 0
        (1, TType.STRING, 'deviceDescription', 'UTF8', None, ),  # 1
        (2, TType.STRING, 'hostname', 'UTF8', None, ),  # 2
        (3, TType.I32, 'portNumber', None, None, ),  # 3
        (4, TType.STRING, 'serverId', 'UTF8', None, ),  # 4
        (5, TType.STRING, 'urlPrefix', 'UTF8', None, ),  # 5
        (6, TType.STRING, 'scheme', 'UTF8', None, ),  # 6
    )

    def __init__(self, deviceDescription=None, hostname=None, portNumber=None, serverId=None, urlPrefix=None, scheme=None,):
        self.deviceDescription = deviceDescription
        self.hostname = hostname
        self.portNumber = portNumber
        self.serverId = serverId
        self.urlPrefix = urlPrefix
        self.scheme = scheme

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec))
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.STRING:
                    self.deviceDescription = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.hostname = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.I32:
                    self.portNumber = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.STRING:
                    self.serverId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.STRING:
                    self.urlPrefix = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 6:
                if ftype == TType.STRING:
                    self.scheme = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec)))
            return
        oprot.writeStructBegin('ServiceMessage')
        if self.deviceDescription is not None:
            oprot.writeFieldBegin('deviceDescription', TType.STRING, 1)
            oprot.writeString(self.deviceDescription.encode('utf-8') if sys.version_info[0] == 2 else self.deviceDescription)
            oprot.writeFieldEnd()
        if self.hostname is not None:
            oprot.writeFieldBegin('hostname', TType.STRING, 2)
            oprot.writeString(self.hostname.encode('utf-8') if sys.version_info[0] == 2 else self.hostname)
            oprot.writeFieldEnd()
        if self.portNumber is not None:
            oprot.writeFieldBegin('portNumber', TType.I32, 3)
            oprot.writeI32(self.portNumber)
            oprot.writeFieldEnd()
        if self.serverId is not None:
            oprot.writeFieldBegin('serverId', TType.STRING, 4)
            oprot.writeString(self.serverId.encode('utf-8') if sys.version_info[0] == 2 else self.serverId)
            oprot.writeFieldEnd()
        if self.urlPrefix is not None:
            oprot.writeFieldBegin('urlPrefix', TType.STRING, 5)
            oprot.writeString(self.urlPrefix.encode('utf-8') if sys.version_info[0] == 2 else self.urlPrefix)
            oprot.writeFieldEnd()
        if self.scheme is not None:
            oprot.writeFieldBegin('scheme', TType.STRING, 6)
            oprot.writeString(self.scheme.encode('utf-8') if sys.version_info[0] == 2 else self.scheme)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)

class ServiceDetails(object):
    """
    Attributes:
     - serviceId
     - serviceDescription
    """

    thrift_spec = (
        None,  # 0
        (1, TType.I32, 'serviceId', None, None, ),  # 1
        (2, TType.STRING, 'serviceDescription', 'UTF8', None, ),  # 2
    )

    def __init__(self, serviceId=None, serviceDescription=None,):
        self.serviceId = serviceId
        self.serviceDescription = serviceDescription

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec))
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.I32:
                    self.serviceId = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.serviceDescription = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec)))
            return
        oprot.writeStructBegin('ServiceDetails')
        if self.serviceId is not None:
            oprot.writeFieldBegin('serviceId', TType.I32, 1)
            oprot.writeI32(self.serviceId)
            oprot.writeFieldEnd()
        if self.serviceDescription is not None:
            oprot.writeFieldBegin('serviceDescription', TType.STRING, 2)
            oprot.writeString(self.serviceDescription.encode('utf-8') if sys.version_info[0] == 2 else self.serviceDescription)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)

class TotalPriceResponse(object):
    """
    Attributes:
     - serverId
     - clientId
     - priceId
     - unitsToSupply
     - totalPrice
     - paymentReferenceId
     - merchantClientKey
     - currencyCode
    """

    thrift_spec = (
        None,  # 0
        (1, TType.STRING, 'serverId', 'UTF8', None, ),  # 1
        (2, TType.STRING, 'clientId', 'UTF8', None, ),  # 2
        (3, TType.I32, 'priceId', None, None, ),  # 3
        (4, TType.I32, 'unitsToSupply', None, None, ),  # 4
        (5, TType.I32, 'totalPrice', None, None, ),  # 5
        (6, TType.STRING, 'paymentReferenceId', 'UTF8', None, ),  # 6
        (7, TType.STRING, 'merchantClientKey', 'UTF8', None, ),  # 7
        (8, TType.STRING, 'currencyCode', 'UTF8', None, ),  # 8
    )

    def __init__(self, serverId=None, clientId=None, priceId=None, unitsToSupply=None, totalPrice=None, paymentReferenceId=None, merchantClientKey=None, currencyCode=None,):
        self.serverId = serverId
        self.clientId = clientId
        self.priceId = priceId
        self.unitsToSupply = unitsToSupply
        self.totalPrice = totalPrice
        self.paymentReferenceId = paymentReferenceId
        self.merchantClientKey = merchantClientKey
        self.currencyCode = currencyCode

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec))
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.STRING:
                    self.serverId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.clientId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.I32:
                    self.priceId = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.I32:
                    self.unitsToSupply = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.I32:
                    self.totalPrice = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 6:
                if ftype == TType.STRING:
                    self.paymentReferenceId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 7:
                if ftype == TType.STRING:
                    self.merchantClientKey = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 8:
                if ftype == TType.STRING:
                    self.currencyCode = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec)))
            return
        oprot.writeStructBegin('TotalPriceResponse')
        if self.serverId is not None:
            oprot.writeFieldBegin('serverId', TType.STRING, 1)
            oprot.writeString(self.serverId.encode('utf-8') if sys.version_info[0] == 2 else self.serverId)
            oprot.writeFieldEnd()
        if self.clientId is not None:
            oprot.writeFieldBegin('clientId', TType.STRING, 2)
            oprot.writeString(self.clientId.encode('utf-8') if sys.version_info[0] == 2 else self.clientId)
            oprot.writeFieldEnd()
        if self.priceId is not None:
            oprot.writeFieldBegin('priceId', TType.I32, 3)
            oprot.writeI32(self.priceId)
            oprot.writeFieldEnd()
        if self.unitsToSupply is not None:
            oprot.writeFieldBegin('unitsToSupply', TType.I32, 4)
            oprot.writeI32(self.unitsToSupply)
            oprot.writeFieldEnd()
        if self.totalPrice is not None:
            oprot.writeFieldBegin('totalPrice', TType.I32, 5)
            oprot.writeI32(self.totalPrice)
            oprot.writeFieldEnd()
        if self.paymentReferenceId is not None:
            oprot.writeFieldBegin('paymentReferenceId', TType.STRING, 6)
            oprot.writeString(self.paymentReferenceId.encode('utf-8') if sys.version_info[0] == 2 else self.paymentReferenceId)
            oprot.writeFieldEnd()
        if self.merchantClientKey is not None:
            oprot.writeFieldBegin('merchantClientKey', TType.STRING, 7)
            oprot.writeString(self.merchantClientKey.encode('utf-8') if sys.version_info[0] == 2 else self.merchantClientKey)
            oprot.writeFieldEnd()
        if self.currencyCode is not None:
            oprot.writeFieldBegin('currencyCode', TType.STRING, 8)
            oprot.writeString(self.currencyCode.encode('utf-8') if sys.version_info[0] == 2 else self.currencyCode)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)

class ServiceDeliveryToken(object):
    """
    Attributes:
     - key
     - issued
     - expiry
     - refundOnExpiry
     - signature
    """

    thrift_spec = (
        None,  # 0
        (1, TType.STRING, 'key', 'UTF8', None, ),  # 1
        (2, TType.STRING, 'issued', 'UTF8', None, ),  # 2
        (3, TType.STRING, 'expiry', 'UTF8', None, ),  # 3
        (4, TType.BOOL, 'refundOnExpiry', None, None, ),  # 4
        (5, TType.STRING, 'signature', 'BINARY', None, ),  # 5
    )

    def __init__(self, key=None, issued=None, expiry=None, refundOnExpiry=None, signature=None,):
        self.key = key
        self.issued = issued
        self.expiry = expiry
        self.refundOnExpiry = refundOnExpiry
        self.signature = signature

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec))
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.STRING:
                    self.key = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.issued = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.STRING:
                    self.expiry = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.BOOL:
                    self.refundOnExpiry = iprot.readBool()
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.STRING:
                    self.signature = iprot.readBinary()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec)))
            return
        oprot.writeStructBegin('ServiceDeliveryToken')
        if self.key is not None:
            oprot.writeFieldBegin('key', TType.STRING, 1)
            oprot.writeString(self.key.encode('utf-8') if sys.version_info[0] == 2 else self.key)
            oprot.writeFieldEnd()
        if self.issued is not None:
            oprot.writeFieldBegin('issued', TType.STRING, 2)
            oprot.writeString(self.issued.encode('utf-8') if sys.version_info[0] == 2 else self.issued)
            oprot.writeFieldEnd()
        if self.expiry is not None:
            oprot.writeFieldBegin('expiry', TType.STRING, 3)
            oprot.writeString(self.expiry.encode('utf-8') if sys.version_info[0] == 2 else self.expiry)
            oprot.writeFieldEnd()
        if self.refundOnExpiry is not None:
            oprot.writeFieldBegin('refundOnExpiry', TType.BOOL, 4)
            oprot.writeBool(self.refundOnExpiry)
            oprot.writeFieldEnd()
        if self.signature is not None:
            oprot.writeFieldBegin('signature', TType.STRING, 5)
            oprot.writeBinary(self.signature)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)

class PaymentResponse(object):
    """
    Attributes:
     - serverId
     - clientId
     - totalPaid
     - serviceDeliveryToken
    """

    thrift_spec = (
        None,  # 0
        (1, TType.STRING, 'serverId', 'UTF8', None, ),  # 1
        (2, TType.STRING, 'clientId', 'UTF8', None, ),  # 2
        (3, TType.I32, 'totalPaid', None, None, ),  # 3
        (4, TType.STRUCT, 'serviceDeliveryToken', (ServiceDeliveryToken, ServiceDeliveryToken.thrift_spec), None, ),  # 4
    )

    def __init__(self, serverId=None, clientId=None, totalPaid=None, serviceDeliveryToken=None,):
        self.serverId = serverId
        self.clientId = clientId
        self.totalPaid = totalPaid
        self.serviceDeliveryToken = serviceDeliveryToken

    def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec))
            return
        iprot.readStructBegin()
        while True:
            (fname, ftype, fid) = iprot.readFieldBegin()
            if ftype == TType.STOP:
                break
            if fid == 1:
                if ftype == TType.STRING:
                    self.serverId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.clientId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.I32:
                    self.totalPaid = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.STRUCT:
                    self.serviceDeliveryToken = ServiceDeliveryToken()
                    self.serviceDeliveryToken.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec)))
            return
        oprot.writeStructBegin('PaymentResponse')
        if self.serverId is not None:
            oprot.writeFieldBegin('serverId', TType.STRING, 1)
            oprot.writeString(self.serverId.encode('utf-8') if sys.version_info[0] == 2 else self.serverId)
            oprot.writeFieldEnd()
        if self.clientId is not None:
            oprot.writeFieldBegin('clientId', TType.STRING, 2)
            oprot.writeString(self.clientId.encode('utf-8') if sys.version_info[0] == 2 else self.clientId)
            oprot.writeFieldEnd()
        if self.totalPaid is not None:
            oprot.writeFieldBegin('totalPaid', TType.I32, 3)
            oprot.writeI32(self.totalPaid)
            oprot.writeFieldEnd()
        if self.serviceDeliveryToken is not None:
            oprot.writeFieldBegin('serviceDeliveryToken', TType.STRUCT, 4)
            self.serviceDeliveryToken.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)


text:
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright 2020 Google LLC
  ~
  ~ 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
  ~
  ~      https://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.
  ~
  -->

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:orientation="vertical"
  android:accessibilityPaneTitle="@string/not_shared_confirm_title"
  >

  <View
    android:layout_width="match_parent"
    android:layout_height="?attr/actionBarSize"/>

  <androidx.core.widget.NestedScrollView
    android:layout_width="match_parent"
    android:layout_height="0dp"
    android:layout_weight="1"
    android:isScrollContainer="false"
    android:fillViewport="true">

    <LinearLayout
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:orientation="vertical"
      android:paddingHorizontal="@dimen/padding_large">

      <TextView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:text="@string/not_shared_confirm_title"
        android:layout_marginBottom="@dimen/padding_huge"
        android:textAppearance="?attr/textAppearanceHeadline5" />

      <TextView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="@dimen/padding_normal"
        android:text="@string/not_shared_confirm_detail"
        android:textAppearance="?attr/textAppearanceBody1" />

    </LinearLayout>

  </androidx.core.widget.NestedScrollView>

  <RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginVertical="@dimen/padding_normal"
    android:orientation="horizontal">

      <Button
        android:id="@+id/share_done_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginHorizontal="@dimen/padding_normal"
        android:layout_alignParentEnd="true"
        style="@style/Widget.ExposureNotifications.Button.TextButton"
        android:text="@android:string/ok" />

  </RelativeLayout>

</LinearLayout>


text:
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';

@Injectable()
export class UserService {

  constructor(private http: HttpClient) { }

  getUser() {
    return 'Jean';
  }

  getUserGithub(id) {
    return this.http.get(`http://api.github.com/users/${id}`);
  }

}


text: Some dotfiles from my machines.


text:
<?php
/**
 * TOP API: taobao.promotion.mjs.get request
 *
 * @author auto create
 * @since 1.0, 2016.03.05
 */
class PromotionMjsGetRequest
{

	private $apiParas = array();

	public function getApiMethodName()
	{
		return "taobao.promotion.mjs.get";
	}

	public function getApiParas()
	{
		return $this->apiParas;
	}

	public function check()
	{

	}

	public function putOtherTextParam($key, $value) {
		$this->apiParas[$key] = $value;
		$this->$key = $value;
	}
}


text:
title: Getting Started
page_title: Getting Started - RadWizard
description: Check our Web Forms article about Getting Started.
slug: wizard/getting-started
tags: getting,started
published: True
position: 1
---

# Getting Started with the Telerik WebForms Wizard

The following tutorial demonstrates how you can add a **RadWizard** control with three steps. The end result will be similar to **Figure 1**:
>caption Figure 1: RadWizard with three steps.

![Getting Started with the Telerik WebForms Wizard](images/wizard-getting-started.png "Getting Started with the Telerik WebForms Wizard")

##

1. Add a **ScriptManager** control on a Web Form.

1. Add a **RadWizard** control on this AJAX-enabled Web Form: **Example 1**: Declaration of a **RadWizard** control:

````ASPNET
 <telerik:RadWizard RenderMode="Lightweight" ID="RadWizard2" runat="server" Width="550px">
	<WizardSteps>
		<telerik:RadWizardStep Title="Personal Infor">
			<telerik:RadTextBox RenderMode="Lightweight" ID="FirstNameTextBox" Label="First Name:" runat="server"></telerik:RadTextBox>
			<br />
			<telerik:RadTextBox RenderMode="Lightweight" ID="LastNameTextBox" Label="Last Name:" runat="server"></telerik:RadTextBox>
		</telerik:RadWizardStep>
		<telerik:RadWizardStep Title="Contact Details">
		</telerik:RadWizardStep>
		<telerik:RadWizardStep Title="Additional Information">
		</telerik:RadWizardStep>
	</WizardSteps>
</telerik:RadWizard>
````


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.SharePoint.Client;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using OfficeDevPnP.Core.Tests;
namespace Microsoft.SharePoint.Client.Tests
{
    [TestClass()]
    public class JavaScriptExtensionsTests
    {
        const string KEY = "TEST_KEY";

        [TestMethod()]
        public void AddJsLinkTest()
        {
            using (var clientContext = TestCommon.CreateClientContext())
            {
                // Test
                clientContext.Web.AddJsLink(KEY, "/jquery-2.1.1.min.js"); // Dummy link

                var customActions = clientContext.Web.GetCustomActions();
                var existingAction = customActions.Where(a => a.Name == KEY).FirstOrDefault();
                Assert.IsNotNull(existingAction, "Existing Action not found");

                // Teardown
                if (existingAction != null)
                {
                    clientContext.Web.DeleteCustomAction(existingAction.Id);
                }
            }
        }

        [TestMethod()]
        public void AddJsLinkIEnumerableTest()
        {
            using (var clientContext = TestCommon.CreateClientContext())
            {
                // Test
                clientContext.Web.AddJsLink(KEY, new List<string> { "/jquery-2.1.1.min.js", "/anotherjslink.js" }); // Dummy link

                var customActions = clientContext.Web.GetCustomActions();
                var existingAction = customActions.Where(a => a.Name == KEY).FirstOrDefault();

                Assert.IsNotNull(existingAction, "Existing Action not found");

                // Teardown
                if (existingAction != null)
                {
                    clientContext.Web.DeleteCustomAction(existingAction.Id);
                }
            }
        }

        [TestMethod()]
        public void DeleteJsLinkTest()
        {
            using (var clientContext = TestCommon.CreateClientContext())
            {
                // Setup
                clientContext.Web.AddJsLink(KEY, "/jquery-2.1.1.min.js"); // Dummy link

                // Test
                clientContext.Web.DeleteJsLink(KEY);

                var customActions = clientContext.Web.GetCustomActions();
                var existingAction = customActions.Where(a => a.Name == KEY).FirstOrDefault();
                Assert.IsNull(existingAction, "Existing Action found");
            }
        }

        [TestMethod()]
        public void AddJsBlockTest()
        {
            using (var clientContext = TestCommon.CreateClientContext())
            {
                // Test
                clientContext.Web.AddJsBlock(KEY, "<script>alert('Testing')</script>");

                var customActions = clientContext.Web.GetCustomActions();
                var existingAction = customActions.Where(a => a.Name == KEY).FirstOrDefault();

                Assert.IsNotNull(existingAction, "Existing Action not found");

                // Teardown
                if (existingAction != null)
                {
                    clientContext.Web.DeleteCustomAction(existingAction.Id);
                }
            }
        }
    }
}


text:
using System;
using System.Linq;
using System.Runtime.Serialization;
using System.Threading.Tasks;
using Newtonsoft.Json;
using NJsonSchema.CodeGeneration.CSharp;
using NJsonSchema.Converters;
using Xunit;

namespace NJsonSchema.CodeGeneration.Tests.CSharp
{
    public class InheritanceInterfaceTests
    {
        public class MyContainer
        {
            public Banana Item { get; set; }
        }

        public interface ITour
        {
            Int64 ID { get; set; }
        }

        [DataContract]
        [JsonConverter(typeof(JsonInheritanceConverter))]
        public class Fruit : ITour
        {
            [DataMember]
            public Int64 ID { get; set; }
        }

        public interface IBanana : ITour
        {
            char Amember { get; set; }
        }

        [DataContract]
        public class Banana : Fruit, IBanana
        {
            [DataMember]
            public char Amember { get; set; }
        }

        [Fact]
        public async Task When_schema_has_base_schema_then_it_is_referenced()
        {
            //// Arrange
            var json = JsonSchema.FromType<MyContainer>();
            var data = json.ToJson();

            var generator = new CSharpGenerator(json, new CSharpGeneratorSettings());

            //// Act
            var code = generator.GenerateFile();

            //// Assert
            Assert.True(json.Properties["Item"].ActualTypeSchema.AllOf.First().HasReference);
            Assert.Contains("[Newtonsoft.Json.JsonConverter(typeof(JsonInheritanceConverter), \"discriminator\")]", code);
            Assert.Contains("[JsonInheritanceAttribute(\"Banana\", typeof(Banana))]", code);
        }
    }
}


text:
require 'spec_helper'

describe "meetings/edit" do
  before(:each) do
    @meeting = assign(:meeting, stub_model(Meeting,
      :name => "MyString"
    ))
  end

  it "renders the edit meeting form" do
    render

    # Run the generator again with the --webrat flag if you want to use webrat matchers
    assert_select "form[action=?][method=?]", meeting_path(@meeting), "post" do
      assert_select "input#meeting_name[name=?]", "meeting[name]"
    end
  end
end


text:
<!DOCTYPE html>
<html>
	<head>
		<script language="javascript" src="../../bower_components/webcomponentsjs/webcomponents-lite.js"></script>
		<link rel="import" href="strand-test-form-view.html"/>
	</head>
	<body>
		<strand-test-form-view></strand-test-form-view>
	</body>
</html>


text:
from __future__ import unicode_literals

from django.db import models, migrations

class Migration(migrations.Migration):

    dependencies = [
        ('emailApp', '0008_auto_20150403_1346'),
    ]

    operations = [
        migrations.CreateModel(
            name='Dashboard',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('data', models.TextField(null=True, blank=True)),
                ('timeStamp', models.DateTimeField()),
                ('validTill', models.DateTimeField()),
                ('source', models.OneToOneField(to='emailApp.Email')),
            ],
            options={
            },
            bases=(models.Model,),
        ),
    ]


text:
/**
 * @file
 * Form-based in-place editor. Works for any field type.
 */

(function ($, Drupal) {

  'use strict';

  /**
   * @constructor
   *
   * @augments Drupal.quickedit.EditorView
   */
  Drupal.quickedit.editors.form = Drupal.quickedit.EditorView.extend(/** @lends Drupal.quickedit.editors.form# */{

    /**
     * Tracks form container DOM element that is used while in-place editing.
     *
     * @type {jQuery}
     */
    $formContainer: null,

    /**
     * Holds the {@link Drupal.Ajax} object.
     *
     * @type {Drupal.Ajax}
     */
    formSaveAjax: null,

    /**
     * @inheritdoc
     *
     * @param {object} fieldModel
     *   The field model that holds the state.
     * @param {string} state
     *   The state to change to.
     */
    stateChange: function (fieldModel, state) {
      var from = fieldModel.previous('state');
      var to = state;
      switch (to) {
        case 'inactive':
          break;

        case 'candidate':
          if (from !== 'inactive') {
            this.removeForm();
          }
          break;

        case 'highlighted':
          break;

        case 'activating':
          // If coming from an invalid state, then the form is already loaded.
          if (from !== 'invalid') {
            this.loadForm();
          }
          break;

        case 'active':
          break;

        case 'changed':
          break;

        case 'saving':
          this.save();
          break;

        case 'saved':
          break;

        case 'invalid':
          this.showValidationErrors();
          break;
      }
    },

    /**
     * @inheritdoc
     *
     * @return {object}
     *   A settings object for the quick edit UI.
     */
    getQuickEditUISettings: function () {
      return {padding: true, unifiedToolbar: true, fullWidthToolbar: true, popup: true};
    },

    /**
     * Loads the form for this field, displays it on top of the actual field.
     */
    loadForm: function () {
      var fieldModel = this.fieldModel;

      // Generate a DOM-compatible ID for the form container DOM element.
      var id = 'quickedit-form-for-' + fieldModel.id.replace(/[\/\[\]]/g, '_');

      // Render form container.
      var $formContainer = this.$formContainer = $(Drupal.theme('quickeditFormContainer', {
        id: id,
        loadingMsg: Drupal.t('Loading…')
      }));
      $formContainer
        .find('.quickedit-form')
        .addClass('quickedit-editable quickedit-highlighted quickedit-editing')
        .attr('role', 'dialog');

      // Insert form container in DOM.
      if (this.$el.css('display') === 'inline') {
        $formContainer.prependTo(this.$el.offsetParent());
        // Position the form container to render on top of the field's element.
        var pos = this.$el.position();
        $formContainer.css('left', pos.left).css('top', pos.top);
      }
      else {
        $formContainer.insertBefore(this.$el);
      }

      // Load form, insert it into the form container and attach event handlers.
      var formOptions = {
        fieldID: fieldModel.get('fieldID'),
        $el: this.$el,
        nocssjs: false,
        // Reset an existing entry for this entity in the PrivateTempStore (if
        // any) when loading the field. Logically speaking, this should happen
        // in a separate request because this is an entity-level operation, not
        // a field-level operation. But that would require an additional
        // request, that might not even be necessary: it is only when a user
        // loads a first changed field for an entity that this needs to happen:
        // precisely now!
        reset: !fieldModel.get('entity').get('inTempStore')
      };
      Drupal.quickedit.util.form.load(formOptions, function (form, ajax) {
        Drupal.AjaxCommands.prototype.insert(ajax, {
          data: form,
          selector: '#' + id + ' .placeholder'
        });

        $formContainer
          .on('formUpdated.quickedit', ':input', function (event) {
            var state = fieldModel.get('state');
            // If the form is in an invalid state, it will persist on the page.
            // Set the field to activating so that the user can correct the
            // invalid value.
            if (state === 'invalid') {
              fieldModel.set('state', 'activating');
            }
            // Otherwise assume that the fieldModel is in a candidate state and
            // set it to changed on formUpdate.
            else {
              fieldModel.set('state', 'changed');
            }
          })
          .on('keypress.quickedit', 'input', function (event) {
            if (event.keyCode === 13) {
              return false;
            }
          });

        // The in-place editor has loaded; change state to 'active'.
        fieldModel.set('state', 'active');
      });
    },

    /**
     * Removes the form for this field, detaches behaviors and event handlers.
     */
    removeForm: function () {
      if (this.$formContainer === null) {
        return;
      }

      delete this.formSaveAjax;
      // Allow form widgets to detach properly.
      Drupal.detachBehaviors(this.$formContainer.get(0), null, 'unload');
      this.$formContainer
        .off('change.quickedit', ':input')
        .off('keypress.quickedit', 'input')
        .remove();
      this.$formContainer = null;
    },

    /**
     * @inheritdoc
     */
    save: function () {
      var $formContainer = this.$formContainer;
      var $submit = $formContainer.find('.quickedit-form-submit');
      var editorModel = this.model;
      var fieldModel = this.fieldModel;

      function cleanUpAjax() {
        Drupal.quickedit.util.form.unajaxifySaving(formSaveAjax);
        formSaveAjax = null;
      }

      // Create an AJAX object for the form associated with the field.
      var formSaveAjax = Drupal.quickedit.util.form.ajaxifySaving({
        nocssjs: false,
        other_view_modes: fieldModel.findOtherViewModes()
      }, $submit);

      // Successfully saved.
      formSaveAjax.commands.quickeditFieldFormSaved = function (ajax, response, status) {
        cleanUpAjax();
        // First, transition the state to 'saved'.
        fieldModel.set('state', 'saved');
        // Second, set the 'htmlForOtherViewModes' attribute, so that when this
        // field is rerendered, the change can be propagated to other instances
        // of this field, which may be displayed in different view modes.
        fieldModel.set('htmlForOtherViewModes', response.other_view_modes);
        // Finally, set the 'html' attribute on the field model. This will cause
        // the field to be rerendered.
        _.defer(function () {
          fieldModel.set('html', response.data);
        });
      };

      // Unsuccessfully saved; validation errors.
      formSaveAjax.commands.quickeditFieldFormValidationErrors = function (ajax, response, status) {
        editorModel.set('validationErrors', response.data);
        fieldModel.set('state', 'invalid');
      };

      // The quickeditFieldForm AJAX command is called upon attempting to save
      // the form; Form API will mark which form items have errors, if any. This
      // command is invoked only if validation errors exist and then it runs
      // before editFieldFormValidationErrors().
      formSaveAjax.commands.quickeditFieldForm = function (ajax, response, status) {
        Drupal.AjaxCommands.prototype.insert(ajax, {
          data: response.data,
          selector: '#' + $formContainer.attr('id') + ' form'
        });
      };

      // Click the form's submit button; the scoped AJAX commands above will
      // handle the server's response.
      $submit.trigger('click.quickedit');
    },

    /**
     * @inheritdoc
     */
    showValidationErrors: function () {
      this.$formContainer
        .find('.quickedit-form')
        .addClass('quickedit-validation-error')
        .find('form')
        .prepend(this.model.get('validationErrors'));
    }
  });

})(jQuery, Drupal);
;
/**
 * @file
 * ContentEditable-based in-place editor for plain text content.
 */

(function ($, _, Drupal) {

  'use strict';

  Drupal.quickedit.editors.plain_text = Drupal.quickedit.EditorView.extend(/** @lends Drupal.quickedit.editors.plain_text# */{

    /**
     * Stores the textual DOM element that is being in-place edited.
     */
    $textElement: null,

    /**
     * @constructs
     *
     * @augments Drupal.quickedit.EditorView
     *
     * @param {object} options
     *   Options for the plain text editor.
     */
    initialize: function (options) {
      Drupal.quickedit.EditorView.prototype.initialize.call(this, options);

      var editorModel = this.model;
      var fieldModel = this.fieldModel;

      // Store the original value of this field. Necessary for reverting
      // changes.
      var $textElement;
      var $fieldItems = this.$el.find('.quickedit-field');
      if ($fieldItems.length) {
        $textElement = this.$textElement = $fieldItems.eq(0);
      }
      else {
        $textElement = this.$textElement = this.$el;
      }
      editorModel.set('originalValue', $.trim(this.$textElement.text()));

      // Sets the state to 'changed' whenever the value changes.
      var previousText = editorModel.get('originalValue');
      $textElement.on('keyup paste', function (event) {
        var currentText = $.trim($textElement.text());
        if (previousText !== currentText) {
          previousText = currentText;
          editorModel.set('currentValue', currentText);
          fieldModel.set('state', 'changed');
        }
      });
    },

    /**
     * @inheritdoc
     *
     * @return {jQuery}
     *   The text element for the plain text editor.
     */
    getEditedElement: function () {
      return this.$textElement;
    },

    /**
     * @inheritdoc
     *
     * @param {object} fieldModel
     *   The field model that holds the state.
     * @param {string} state
     *   The state to change to.
     * @param {object} options
     *   State options, if needed by the state change.
     */
    stateChange: function (fieldModel, state, options) {
      var from = fieldModel.previous('state');
      var to = state;
      switch (to) {
        case 'inactive':
          break;

        case 'candidate':
          if (from !== 'inactive') {
            this.$textElement.removeAttr('contenteditable');
          }
          if (from === 'invalid') {
            this.removeValidationErrors();
          }
          break;

        case 'highlighted':
          break;

        case 'activating':
          // Defer updating the field model until the current state change has
          // propagated, to not trigger a nested state change event.
          _.defer(function () {
            fieldModel.set('state', 'active');
          });
          break;

        case 'active':
          this.$textElement.attr('contenteditable', 'true');
          break;

        case 'changed':
          break;

        case 'saving':
          if (from === 'invalid') {
            this.removeValidationErrors();
          }
          this.save(options);
          break;

        case 'saved':
          break;

        case 'invalid':
          this.showValidationErrors();
          break;
      }
    },

    /**
     * @inheritdoc
     *
     * @return {object}
     *   A settings object for the quick edit UI.
     */
    getQuickEditUISettings: function () {
      return {padding: true, unifiedToolbar: false, fullWidthToolbar: false, popup: false};
    },

    /**
     * @inheritdoc
     */
    revert: function () {
      this.$textElement.html(this.model.get('originalValue'));
    }

  });

})(jQuery, _, Drupal);
;


text:
/**
 * Linked List implementation
 */

#include <stdlib.h>
#include <string.h>

#include "list.h"

/**
 * Initializes the list pointed to by "l".  destory is a pointer to a function that is called
 * when an element from the list is freed.  This can be null if no memory management needs to take place,
 * or it could simply be free() if the data is simple
 */
void list_init(list* l, void (*destroy)(void* data))    {
    l->size = 0;
    l->destroy = destroy;

    l->head = 0;
    l->tail = 0;
}

/**
 * Destroys the entire list pointed to be "l"
 */
void list_destroy(list* l)  {
    void* data;

    while (list_size(l) > 0)    {
        if (list_remove_next(l, NULL, (void**)&data) == 0 && l->destroy)    {
            l->destroy(data);
        }
    }

    // Zero out the structure so no junk data
    memset(l, 0, sizeof(list));
}

/**
 * Inserts data into list "l" in the node after "after".  If "after" is NULL, the data is inserted
 * as the head.
 *
 * Returns 0 if successful, -1 otherwise
 */
int list_insert_next(list* l, list_element* after, const void* data)    {
    list_element* new;

    new = (list_element*)malloc(sizeof(list_element));
    new->data = (void*)data;

    if (after == 0) {
        if (list_size(l) == 0)  {
            l->tail = new;
        }

        new->next = l->head;
        l->head = new;
    } else {
        if (after->next == 0)   {
            l->tail = new;
        }

        new->next = after->next;
        after->next = new;
    }

    l->size++;
    return 0;
}

/**
 * Removes the element after the given element "after" from list "l".  "data" will contain a pointer
 * to the data managed by the removed element. list->destroy will NOT be called on this data, so it
 * is up to the caller to clean up the data item
 *
 * Returns 0 if successful, -1 otherwise
 */
int list_remove_next(list *l, list_element* after, void **data) {
    list_element *old;

    if (list_size(l) == 0)  {
        return -1;
    }

    if (after == 0) {
        *data = l->head->data;
        old = l->head;
        l->head = l->head->next;

        if (list_size(l) == 1)  {
            l->tail = NULL;
        }
    } else {

        if (after->next == 0)   {
            return -1;
        }

        *data = after->next->data;
        old = after->next;
        after->next = after->next->next;

        if (after->next == NULL)    {
            l->tail = after;
        }
    }

    free(old);

    l->size--;
    return 0;
}


text:
function maViewBatchActionsDirective($injector) {
    var $compile = $injector.get('$compile');

    return {
        restrict: 'E',
        scope: {
            'entity': '=',
            'selection': '=',
            'buttons': '&'
        },
        link: function(scope) {
            scope.isopen = false;

            scope.toggleDropdown = function($event) {
                $event.preventDefault();
                $event.stopPropagation();
                scope.isopen = !scope.isopen;
            };

            scope.buttons = scope.buttons();
            if (typeof scope.buttons === 'string') {
                scope.customTemplate = scope.buttons;
                scope.buttons = null;
            }
        },
        // the ng-class hidden is necessary to hide the inner blank space used for spacing buttons when the selection is not empty
        template:
` <button type="button" ng-if="selection.length" class="btn btn-default dropdown-toggle" dropdown-toggle >
            {{ selection.length }} Selected
        </button>

                    <ma-batch-delete-button selection="selection" entity="entity"/>

`
    };
}

maViewBatchActionsDirective.$inject = ['$injector'];

module.exports = maViewBatchActionsDirective;


text:
CELERY_IMPORTS = (
    'lunaport_worker.tasks.check',
    'lunaport_worker.tasks.pullHosts',
    'lunaport_worker.tasks.hooks',
    'lunaport_worker.schedule',
)

BROKER_URL = 'amqp://lunaport:lunamq@localhost:5672/lunaport'

CELERY_RESULT_BACKEND = 'redis://127.0.0.1:6379/2'
CELERY_TASK_RESULT_EXPIRES = 86400  # 1 day.

CELERYD_MAX_TASKS_PER_CHILD = 5

CELERY_RESULT_SERIALIZER = 'json'
CELERY_ENABLE_UTC = True

# Enables error emails.
CELERY_SEND_TASK_ERROR_EMAILS = True

# Name and email addresses of recipients
ADMINS = (
 ("Greggy", "gregory.komissarov@gmail.com"),
)

# Email address used as sender (From field).
SERVER_EMAIL = "devnull@domain.org"

## Mailserver configuration
EMAIL_HOST = "127.0.0.1"
EMAIL_PORT = 25


text:
CKEDITOR.plugins.setLang( 'mathjax', 'nb', {
	title: 'Matematikk i TeX',
	button: 'Matte',
	dialogInput: 'Skriv TeX-koden her',
	docUrl: 'http://en.wikibooks.org/wiki/LaTeX/Mathematics',
	docLabel: 'TeX-dokumentasjon',
	loading: 'laster...',
	pathName: 'matte'
} );


text:
require "test_helper"

class UsersProfileTest < ActionDispatch::IntegrationTest
  attr_reader :user

  def setup
    @user = users(:michael)
    get user_path(user)
  end

  test "profile display" do
    assert_template "users/show"
    assert_select "title", full_title(user.name)
    assert_select "h1", text: user.name
    assert_select "h1>img.gravatar"
    assert_match user.microposts.count.to_s, response.body
    assert_select "div.pagination"
    user.microposts.paginate(page: 1).each do |micropost|
      assert_match micropost.content, response.body
    end
  end
end