text:
import sys

# Backwards compatibility
# Support `from avalon.tools import cbloader`
from . import (
    sceneinventory as cbsceneinventory,
    loader as cbloader,
)

from .lib import (
    application,
)

# Support `import avalon.tools.cbloader`
sys.modules[__name__ + ".cbsceneinventory"] = cbsceneinventory
sys.modules[__name__ + ".cbloader"] = cbloader

__all__ = [
    "application",

    "cbsceneinventory",
    "cbloader",
]

redpajama_set_name: RedPajamaGithub


text:
Updates existing manga in authenticated user's list.

### Parameters

| Type | Name | Description |
| ---- | ---- | ----------- |
| [MangaEntry] | newMangaInfo | The updated manga object. |
| System.Int32 | mangaId | The ID of the manga you want to update. |

### Returns
System.String represnting the state of Updating "Updated" or detailed error message.

------

## UpdateMangaAsync
Updates existing manga in authenticated user's list asynchronously.

### Parameters

| Type | Name | Description |
| ---- | ---- | ----------- |
| [MangaEntry] | newMangaInfo | The updated manga object. |
| System.Int32 | mangaId | The ID of the manga you want to update. |

### Returns
System.String represnting the state of Updating "Updated" or detailed error message.

[MangaEntry]: <https://github.com/i3dprogrammer/myanimelistAPI-wrapper/blob/master/docs/Dto/MangaEntry.md#mangaentry>


text:
from collections import Counter

import numpy as np

def info_gain(x, y, ft, separate_max):
    return info_gain_nominal(x, y, separate_max) if ft == "d" else info_gain_numeric(x, y)

def nominal_splits(x, y, x_vals, y_dist, separate_max):
    """
    Function uses heuristic to find best binary split of nominal values. Heuristic is described in (1) and it is
    originally defined for binary classes. We extend it to work with multiple classes by comparing label with least
    samples to others.

    x: numpy array - nominal feature
    y: numpy array - label
    x_vals: numpy array - unique nominal values of x
    y_dist: dictionary - distribution of labels

    Reference:
    (1) Classification and Regression Trees by Breiman, Friedman, Olshen, and Stone, pages 101- 102.
    """
    # select a label with least samples
    y_val = max(y_dist, key=y_dist.get) if separate_max else min(y_dist, key=y_dist.get)

    prior = y_dist[y_val] / float(len(y))  # prior distribution of selected label

    values, dist, splits = [], [], []
    for x_val in x_vals:  # for every unique nominal value
        dist.append(Counter(y[x == x_val]))  # distribution of labels at selected nominal value
        splits.append(x_val)
        suma = sum([prior * dist[-1][y_key] for y_key in y_dist.keys()])
        # estimate probability
        values.append(prior * dist[-1][y_val] / float(suma))
    indices = np.array(values).argsort()[::-1]

    # distributions and splits are sorted according to probabilities
    return np.array(dist)[indices], np.array(splits)[indices].tolist()

def h(values):
    """
    Function calculates entropy.

    values: list of integers
    """
    ent = np.true_divide(values, np.sum(values))
    return -np.sum(np.multiply(ent, np.log2(ent)))

def info_gain_nominal(x, y, separate_max):
    """
    Function calculates information gain for discrete features. If feature is continuous it is firstly discretized.

    x: numpy array - numerical or discrete feature
    y: numpy array - labels
    ft: string - feature type ("c" - continuous, "d" - discrete)
    split_fun: function - function for discretization of numerical features
    """
    x_vals = np.unique(x)  # unique values
    if len(x_vals) < 3:  # if there is just one unique value
        return None
    y_dist = Counter(y)  # label distribution
    h_y = h(y_dist.values())  # class entropy

    # calculate distributions and splits in accordance with feature type

    dist, splits = nominal_splits(x, y, x_vals, y_dist, separate_max)

    indices, repeat = (range(1, len(dist)), 1) if len(dist) < 50 else (range(1, len(dist), len(dist) / 10), 3)
    interval = len(dist) / 10

    max_ig, max_i, iteration = 0, 1, 0
    while iteration < repeat:
        for i in indices:
            dist0 = np.sum([el for el in dist[:i]])  # iter 0: take first distribution
            dist1 = np.sum([el for el in dist[i:]])  # iter 0: take the other distributions without first
            coef = np.true_divide([np.sum(dist0.values()), np.sum(dist1.values())], len(y))
            ig = h_y - np.dot(coef, [h(dist0.values()), h(dist1.values())])  # calculate information gain
            if ig > max_ig:
                max_ig, max_i = ig, i  # store index and value of maximal information gain
        iteration += 1
        if repeat > 1:
            interval = int(interval * 0.5)
            if max_i in indices and interval > 0:
                middle_index = indices.index(max_i)
            else:
                break
            min_index = middle_index if middle_index == 0 else middle_index - 1
            max_index = middle_index if middle_index == len(indices) - 1 else middle_index + 1
            indices = range(indices[min_index], indices[max_index], interval)

    # store splits of maximal information gain in accordance with feature type
    return float(max_ig), [splits[:max_i], splits[max_i:]]

def info_gain_numeric(x, y):
    x_unique = list(np.unique(x))
    if len(x_unique) == 1:
        return None
    indices = x.argsort()  # sort numeric attribute
    x, y = x[indices], y[indices]  # save sorted features with sorted labels

    right_dist = Counter(y)
    left_dist = Counter()

    diffs = np.nonzero(y[:-1] != y[1:])[0] + 1  # different neighbor classes have value True
    intervals = np.array((np.concatenate(([0], diffs[:-1])), diffs)).T

    if len(diffs) < 2:
        return None

    max_ig, max_i, max_j = 0, 0, 0
    prior_h = h(right_dist.values())  # calculate prior entropy

    for i, j in intervals:
        dist = Counter(y[i:j])
        left_dist += dist
        right_dist -= dist
        coef = np.true_divide((np.sum(left_dist.values()), np.sum(right_dist.values())), len(y))
        ig = prior_h - np.dot(coef, [h(left_dist.values()), h(right_dist.values())])
        if ig > max_ig:
            max_ig, max_i, max_j = ig, i, j

    if x[max_i] == x[max_j]:
        ind = x_unique.index(x[max_i])
        mean = np.float32(np.mean((x_unique[1 if ind == 0 else ind - 1], x_unique[ind])))
    else:
        mean = np.float32(np.mean((x[max_i], x[max_j])))

    return float(max_ig), [mean, mean]


text:
package org.ogcs.app;

/**
 * Releasable
 */
public interface Releasable {

    /**
     * Release object
     */
    void release();
}


text:
#pragma once

#include <Voxie/Node/FilterNode.hpp>
#include <Voxie/Node/NodePrototype.hpp>
#include <VoxieBackend/IO/Operation.hpp>

#include <QtCore/QList>
#include <QtCore/QSharedPointer>

#include <Voxie/IO/RunFilterOperation.hpp>

namespace vx {
namespace io {

class RunMultipleFilterOperationBase : public vx::io::Operation {
  Q_OBJECT
  REFCOUNTEDOBJ_DECL(RunMultipleFilterOperationBase)

 public:
  RunMultipleFilterOperationBase();
  ~RunMultipleFilterOperationBase();
  void filterFinished();

 protected:
  void runFilters(QList<vx::FilterNode*> filterList, bool skipUnchanged);

 private:
  int totalFilters = 0;
  int filterFinishedCount = 0;
};

class RunFilterNode : public QObject {
  Q_OBJECT

 public:
  RunFilterNode(vx::FilterNode* filter) { this->filter = filter; }
  ~RunFilterNode() {}

  QSharedPointer<bool> isFailed = createQSharedPointer<bool>(false);
  bool isFilterFinished = false;
  bool isFilterCancelled = false;
  vx::FilterNode* filter;
  int numParents = 0;
  QSharedPointer<RunMultipleFilterOperationBase> operation;
  QSharedPointer<RunFilterNode> rootNode;
  QList<QSharedPointer<RunFilterNode>> children;

  int numParentsProcessed = 0;

  void clearChildren() {
    for (QSharedPointer<RunFilterNode> child : children) {
      child->clearChildren();
    }
    clear();
  }

  /**
   * @brief Start this filter.
   *
   * @param parentHasChanged Should be set to true if the parent of this filter
   * has changed. This will force the filter to be re-run even if the filter
   * itself hasn't changed. The filter will always be re-run when it has
   * changed.
   */
  void startFilterIfNecessary(bool parentHasChanged) {
    if (!parentHasChanged && !filter->needsRecalculation()) {
      operation->filterFinished();
      this->isFilterFinished = true;
      startChildren(false);
      clear();
      return;
    }

    QSharedPointer<RunFilterOperation> filterOp = filter->run();

    // when this filter is finished call operationFinished()
    filterOp->onFinished(
        this, [this](const QSharedPointer<Operation::ResultError>& error) {
          this->operationFinished(error);
        });
    // TODO: This probably should not connect to QObject::destroyed but to some
    // Operation-specific signal
    connect(filterOp.data(), &QObject::destroyed, this,
            &RunFilterNode::operationStopped);
    connect(operation.data(), &Operation::cancelled, filterOp.data(),
            &Operation::cancel);
  }

  void startChildren(bool parentHasChanged) {
    for (QSharedPointer<RunFilterNode> child : children) {
      child->numParentsProcessed++;
      if (child->numParents == child->numParentsProcessed) {
        child->startFilterIfNecessary(parentHasChanged);
      }
    }
  }

 public Q_SLOTS:
  void operationFinished(const QSharedPointer<Operation::ResultError>& error) {
    isFilterFinished = true;
    // TODO: clean up
    if (error) {
      isFilterCancelled = true;
      *isFailed = true;
      *rootNode->isFailed = true;
      clearChildren();
    }

    // if the filter finished successfully run the child filters afterwards
    if (!isFilterCancelled) {
      startChildren(true);
    }
    clear();
  }

  void operationStopped() {
    isFilterCancelled = true;
    // dont clear if QObject::destroyed emitted after
    // RunFilterOperation::finished
    if (!isFilterFinished) {
      // TODO: Is this ever reached? It should not be because
      // operationFinished() should always be called before this
      qWarning() << "RunMultipleFilterOperationBase::operationStopped() called "
                    "without "
                    "operationFinished";
      *isFailed = true;
      *rootNode->isFailed = true;
      clearChildren();
    }
  }

  void clear() {
    if (!operation.isNull()) {
      operation->filterFinished();
    }
    operation.clear();
    // clear reference to allow delete, once all rootNodes are cleared,
    // QSharedPointer will delete everything else
    rootNode.clear();
  }
};

class FilterGraph {
 public:
  FilterGraph(
      QSharedPointer<RunMultipleFilterOperationBase> runMultipleFilterOperation,
      QList<vx::FilterNode*> filterList) {
    this->root = QSharedPointer<RunFilterNode>(new RunFilterNode(nullptr));
    this->operation = runMultipleFilterOperation;
    for (vx::FilterNode* filter : filterList) {
      // add top level filter to root
      if (!hasFilterParents(filter, filterList)) {
        // dont add filters which are not allowed to run (e.g. filters w/o
        // parent Nodes)
        if (canFilterRun(filter)) {
          QSharedPointer<RunFilterNode> node(new RunFilterNode(filter));
          node->rootNode = root;
          node->operation = operation;
          root->children.append(node);
        }
      }
    }
    // add rest of graph recursively
    for (QSharedPointer<RunFilterNode> node : root->children) {
      addChildren(node, node->filter, filterList);
    }

    // TODO: This probably should not be use QObject::destroyed
    // the operation is finished when the root object is destroyed
    // this means we have to call RunFilterNode::clear() when a filter is done
    // so that the objects get destroyed and the operation can finish
    QObject::connect(
        root.data(), &QObject::destroyed, operation.data(),
        [isFailed = root->isFailed, operation = operation]() {
          if (!operation->isFinished()) {
            if (*isFailed)
              operation->finish(createQSharedPointer<Operation::ResultError>(
                  createQSharedPointer<Exception>(
                      "de.uni_stuttgart.Voxie.RunAllFilterFailed",
                      "One or more filters failed or were cancelled")));
            else
              operation->finish(
                  createQSharedPointer<Operation::ResultSuccess>());
          }
        });
  }

  /**
   * @brief Run the filters in the graph.
   *
   * @param forceRerunAll If set to true all filters in the graph will be run.
   * If set to false only filters which need updating (they themselves or their
   * parents changed) will be run.
   */
  void runFilters(bool forceRerunAll) {
    for (QSharedPointer<RunFilterNode> node : root->children) {
      node->startFilterIfNecessary(forceRerunAll);
    }
  }

 private:
  QSharedPointer<RunFilterNode> root;
  QSharedPointer<RunMultipleFilterOperationBase> operation;

  bool canFilterRun(vx::FilterNode* filter) {
    if (filter->prototype()->allowedInputTypes().empty()) {
      return true;
    }
    for (QSharedPointer<NodePrototype> allowedType :
         filter->prototype()->allowedInputTypes()) {
      for (vx::Node* parent : filter->parentNodes()) {
        if (parent->prototype() == allowedType) {
          return true;
        }
      }
    }
    return false;
  }

  void addChildren(QSharedPointer<RunFilterNode> nodeToAddTo,
                   FilterNode* parentFilter,
                   QList<vx::FilterNode*> filterList) {
    QList<vx::Node*> nodeList;
    QList<vx::FilterNode*> childFilters;
    nodeList.append(parentFilter->childNodes());
    while (nodeList.size() != 0) {
      vx::Node* obj = nodeList.takeLast();
      if (obj->nodeKind() == NodeKind::Filter) {
        childFilters.append(dynamic_cast<vx::FilterNode*>(obj));
      } else {
        nodeList.append(obj->childNodes());
      }
    }
    for (vx::FilterNode* childFilter : childFilters) {
      QSharedPointer<RunFilterNode> child = getOrCreateNode(childFilter);
      // only add the child to the graph if it is part of filterList, because
      // only then it should be run
      if (filterList.contains(childFilter)) {
        nodeToAddTo->children.append(child);
        child->numParents++;
      }
      // check if the children of the child may need to be added to the graph
      addChildren(nodeToAddTo, childFilter, filterList);
    }
  }

  QSharedPointer<RunFilterNode> getOrCreateNode(vx::FilterNode* filterNode) {
    QSharedPointer<RunFilterNode> node = getNodeInChildren(filterNode, root);
    if (node.isNull()) {
      node = QSharedPointer<RunFilterNode>(new RunFilterNode(filterNode));
      node->rootNode = root;
      node->operation = operation;
    }
    return node;
  }

  QSharedPointer<RunFilterNode> getNodeInChildren(
      vx::FilterNode* filterNode, QSharedPointer<RunFilterNode> currentNode) {
    QSharedPointer<RunFilterNode> node;
    for (QSharedPointer<RunFilterNode> child : currentNode->children) {
      if (child->filter == filterNode) {
        return child;
      }
      node = getNodeInChildren(filterNode, child);
      if (!node.isNull()) {
        return node;
      }
    }
    return node;
  }

  bool hasFilterParents(vx::FilterNode* filter,
                        QList<vx::FilterNode*> filterList) {
    QList<vx::Node*> nodeList;
    nodeList.append(filter->parentNodes());
    // depth-first search trough filter's parent-nodes and parent-nodes'
    // parents if there are any filter nodes that come before this one
    while (nodeList.size() != 0) {
      vx::Node* obj = nodeList.takeLast();
      // if we have found a filter node that is an (indirect) parent of the
      // filter, check if it is even part of the filter list that was
      // passed to the operation. If it isn't just keep searching...
      if (obj->nodeKind() == NodeKind::Filter &&
          filterList.contains(dynamic_cast<vx::FilterNode*>(obj))) {
        return true;
      } else {
        nodeList.append(obj->parentNodes());
      }
    }
    return false;
  }
};

}  // namespace io
}  // namespace vx


text:
/**
 * @author yangyanzhan
 * @email yangyanzhan@gmail.com
 * @github_project https://github.com/yangyanzhan/cpp-master
 * @online_judge hackerrank
 * @problem_name 30-more-exceptions
 * @problem_url https://www.hackerrank.com/challenges/30-more-exceptions
 */

#include <set>
#include <map>
#include <cmath>
#include <deque>
#include <cstdio>
#include <limits>
#include <string>
#include <vector>
#include <iomanip>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <exception>

using namespace std;

class c_exception: public exception {
    public:
        const char * what() const noexcept {
            return "n and p should be non-negative";
        }
};

class Calculator {
    public:
        int power(int n, int p) {
            if (n < 0 || p < 0) {
                throw c_exception();
            }
            int res = 1;
            for (int i = 0; i < p; i++) {
                res *= n;
            }
            return res;
        }
};

int main() {
    return 0;
}


text:
layout: page
title: "About"
description: ""
header-img: ""
---


text:
package com.wroclawstudio.weddinggame.models.envioremnt;

import android.graphics.Rect;
import android.graphics.drawable.Drawable;

public abstract class BaseGameObject {
    private final int y;
    private final Drawable drawable;
    private final Rect rect;

    public BaseGameObject(Drawable drawable, int y) {
        this.y = y;
        this.drawable = drawable;
        this.rect = new Rect();
    }

    public Drawable getDrawable() {
        return drawable;
    }

    public int getY() {
        return y;
    }

    public Rect getBounds() {
        return rect;
    }

    public void setBounds(int left, int top, int right, int bottom) {
        rect.bottom = bottom;
        rect.top = top;
        rect.right = right;
        rect.left = left;
        getDrawable().setBounds(rect);
    }

    public boolean isSolid() {
        return true;
    }

    public boolean isLeathal() {
        return false;
    }
}


text:
bright = angular.module('bright');
bright.service('ContentService', function($q, $http) {
	return {
		getContent : function() {
			return null;
		}
	};
});


text:
package v4

import (
	"net/http"
	"net/url"
	"strconv"
	"testing"

	"github.com/apache/trafficcontrol/lib/go-tc"
)

type topologiesQueueUpdateTestCase struct {
	Description string
	tc.TopologiesQueueUpdateRequest
}

func TestTopologiesQueueUpdate(t *testing.T) {
	WithObjs(t, []TCObj{CDNs, Types, Tenants, Users, Parameters, Profiles, Statuses, Divisions, Regions, PhysLocations, CacheGroups, Servers, Topologies, DeliveryServices}, func() {
		const topologyName = "mso-topology"
		cdnId, dsId := getCdnIdAndDsId(t)
		InvalidCDNIDIsRejected(t, topologyName)
		InvalidActionIsRejected(t, topologyName, cdnId)
		NonexistentTopologyIsRejected(t, cdnId)
		UpdatesAreQueued(t, topologyName, cdnId, dsId)
	})
}

func getCdnIdAndDsId(t *testing.T) (int64, int) {
	xmlId := "ds-top"
	params := url.Values{}
	params.Set("xmlId", xmlId)
	dses, _, err := TOSession.GetDeliveryServicesV30WithHdr(nil, params)
	if err != nil {
		t.Fatalf("unable to get deliveryservice %s: %s", xmlId, err)
	}
	if len(dses) < 1 {
		t.Fatalf("deliveryservice with xmlId %s not found!", xmlId)
	}
	ds := dses[0]
	return int64(*ds.CDNID), *ds.ID
}

func InvalidCDNIDIsRejected(t *testing.T, topologyName tc.TopologyName) {
	testCase := topologiesQueueUpdateTestCase{
		Description:                  "invalid CDN ID",
		TopologiesQueueUpdateRequest: tc.TopologiesQueueUpdateRequest{Action: "queue", CDNID: -1},
	}
	_, reqInf, _ := TOSession.TopologiesQueueUpdate(topologyName, testCase.TopologiesQueueUpdateRequest)
	if reqInf.StatusCode != http.StatusBadRequest {
		t.Fatalf("expected status code %d for request with %s, got status code %d", http.StatusBadRequest, testCase.Description, reqInf.StatusCode)
	}
}

func InvalidActionIsRejected(t *testing.T, topologyName tc.TopologyName, cdnId int64) {
	testCase := topologiesQueueUpdateTestCase{
		Description:                  "invalid update action",
		TopologiesQueueUpdateRequest: tc.TopologiesQueueUpdateRequest{Action: "requeue", CDNID: cdnId},
	}
	_, reqInf, _ := TOSession.TopologiesQueueUpdate(topologyName, testCase.TopologiesQueueUpdateRequest)
	if reqInf.StatusCode != http.StatusBadRequest {
		t.Fatalf("expected status code %d for request with %s, got status code %d", http.StatusBadRequest, testCase.Description, reqInf.StatusCode)
	}
}

func NonexistentTopologyIsRejected(t *testing.T, cdnId int64) {
	const topologyName = "nonexistent"
	testCase := topologiesQueueUpdateTestCase{
		Description:                  "nonexistent topology",
		TopologiesQueueUpdateRequest: tc.TopologiesQueueUpdateRequest{Action: "queue", CDNID: cdnId},
	}
	_, reqInf, _ := TOSession.TopologiesQueueUpdate(topologyName, testCase.TopologiesQueueUpdateRequest)
	if reqInf.StatusCode != http.StatusBadRequest {
		t.Fatalf("expected status code %d for request with %s, got status code %d", http.StatusBadRequest, testCase.Description, reqInf.StatusCode)
	}
}

func UpdatesAreQueued(t *testing.T, topologyName tc.TopologyName, cdnId int64, dsId int) {
	const action = "queue"
	testCase := topologiesQueueUpdateTestCase{
		Description:                  "invalid update action",
		TopologiesQueueUpdateRequest: tc.TopologiesQueueUpdateRequest{Action: action, CDNID: cdnId},
	}
	resp, _, err := TOSession.TopologiesQueueUpdate(topologyName, testCase.TopologiesQueueUpdateRequest)
	if err != nil {
		t.Fatalf("received error queueing server updates on topology %s: %s", topologyName, err)
	}
	if resp.Action != action {
		t.Fatalf("expected action %s, received action %s", action, resp.Action)
	}
	if resp.CDNID != cdnId {
		t.Fatalf("expected CDN ID %d, received CDN ID %d", cdnId, resp.CDNID)
	}
	if topologyName != resp.Topology {
		t.Fatalf("expected topology %s, received topology %s", topologyName, resp.Topology)
	}
	params := url.Values{}
	dsIdString := strconv.Itoa(dsId)
	params.Set("dsId", dsIdString)
	serversResponse, _, err := TOSession.GetServersWithHdr(&params, nil)
	if err != nil {
		t.Fatalf("getting servers for delivery service with id %s: %s", dsIdString, err)
	}
	servers := serversResponse.Response
	for _, server := range servers {
		if *server.CDNID != int(cdnId) {
			continue
		}
		if !*server.UpdPending {
			t.Fatalf("expected UpdPending = %t for server with hostname %s, got UpdPending = %t", true, *server.HostName, *server.UpdPending)
		}
	}
}


text:
<?php
/////////////////////////////////////////////////////////////////////////////////////
// xbtit - Bittorrent tracker/frontend
//
// Copyright (C) 2004 - 2015  Btiteam
//
//    This file is part of xbtit DT FM.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
//   1. Redistributions of source code must retain the above copyright notice,
//      this list of conditions and the following disclaimer.
//   2. Redistributions in binary form must reproduce the above copyright notice,
//      this list of conditions and the following disclaimer in the documentation
//      and/or other materials provided with the distribution.
//   3. The name of the author may not be used to endorse or promote products
//      derived from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
// TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
////////////////////////////////////////////////////////////////////////////////////

if (!defined("IN_BTIT"))
      die("non direct access!");

if (!defined("IN_ACP"))
      die("non direct access!");

$admintpl->set("add_new",false,true);
$admintpl->set("smf_in_use_1", ((substr($FORUMLINK,0,3)=="smf")?true:false), true);
$admintpl->set("smf_in_use_2", ((substr($FORUMLINK,0,3)=="smf")?true:false), true);
$admintpl->set("smf_in_use_3", ((substr($FORUMLINK,0,3)=="smf")?true:false), true);
$admintpl->set("ipb_in_use_1", (($FORUMLINK=="ipb")?true:false), true);
$admintpl->set("ipb_in_use_2", (($FORUMLINK=="ipb")?true:false), true);
$admintpl->set("ipb_in_use_3", (($FORUMLINK=="ipb")?true:false), true);

switch ($action)
    {

        case 'delete':
          $id=max(0,$_GET["id"]);
          // controle if this level can be cancelled
          $rcanc=do_sqlquery("SELECT can_be_deleted FROM {$TABLE_PREFIX}users_level WHERE id=$id");
          if (!$rcanc || mysqli_num_rows($rcanc)==0)
            {
             err_msg($language["ERROR"], $language["ERR_CANT_FIND_GROUP"]);
             stdfoot(false,false,true);
             die;
            }
          $rcancanc=mysqli_fetch_array($rcanc);
          if ($rcancanc["can_be_deleted"]=="yes")
             {
             do_sqlquery("DELETE FROM {$TABLE_PREFIX}users_level WHERE id=$id",true);
             do_sqlquery("DELETE FROM {$TABLE_PREFIX}categories_perm WHERE levelid=$id",true);
             success_msg($language["SUCCESS"],$language["GROUP_DELETED"]."
\n".$language["ACP_USER_GROUP"]."");
             stdfoot(false,false,true);
             die;
             }
          else
             {
              err_msg($language["ERROR"],$language["CANT_DELETE_GROUP"]);
              stdfoot(false,false,true);
              die;
             }
          break;

        case 'edit':
          $block_title=$language["GROUP_EDIT_GROUP"];
          $gid=max(0,$_GET["id"]);
          $admintpl->set("list",false,true);
          $admintpl->set("frm_action","index.php?page=admin&user=".$CURUSER["uid"]."&code=".$CURUSER["random"]."&do=groups&action=save&id=$gid");
          $admintpl->set("language",$language);
          $rgroup=get_result("SELECT * FROM {$TABLE_PREFIX}users_level WHERE id=$gid",true);
          $current_group=$rgroup[0];
          unset($rgroup);
          $current_group["prefixcolor"]=unesc($current_group["prefixcolor"]);
          $current_group["suffixcolor"]=unesc($current_group["suffixcolor"]);
          $current_group["level"]=unesc($current_group["level"]);
          $current_group["view_torrents"]=($current_group["view_torrents"]=="yes"?"checked=\"checked\"":"");
          $current_group["edit_torrents"]=($current_group["edit_torrents"]=="yes"?"checked=\"checked\"":"");
          $current_group["delete_torrents"]=($current_group["delete_torrents"]=="yes"?"checked=\"checked\"":"");
          $current_group["view_users"]=($current_group["view_users"]=="yes"?"checked=\"checked\"":"");
          $current_group["edit_users"]=($current_group["edit_users"]=="yes"?"checked=\"checked\"":"");
          $current_group["delete_users"]=($current_group["delete_users"]=="yes"?"checked=\"checked\"":"");
          $current_group["view_news"]=($current_group["view_news"]=="yes"?"checked=\"checked\"":"");
          $current_group["edit_news"]=($current_group["edit_news"]=="yes"?"checked=\"checked\"":"");
		  $current_group["trusted"]=($current_group["trusted"]=="yes"?"checked=\"checked\"":"");
		  $current_group["moderate_trusted"]=($current_group["moderate_trusted"]=="yes"?"checked=\"checked\"":"");
          $current_group["delete_news"]=($current_group["delete_news"]=="yes"?"checked=\"checked\"":"");
          $current_group["view_forum"]=($current_group["view_forum"]=="yes"?"checked=\"checked\"":"");
          $current_group["edit_forum"]=($current_group["edit_forum"]=="yes"?"checked=\"checked\"":"");
          $current_group["delete_forum"]=($current_group["delete_forum"]=="yes"?"checked=\"checked\"":"");
          $current_group["sfdownload"]=($current_group["sfdownload"]=="yes"?"checked=\"checked\"":"");
          $current_group["show_ad"]=($current_group["show_ad"]=="yes"?"checked=\"checked\"":"");
          $current_group["fstyle"]=($current_group["fstyle"]=="yes"?"checked=\"checked\"":"");
          $current_group["speers"]=($current_group["speers"]=="yes"?"checked=\"checked\"":"");
          #######################################################
          # view/edit/delete shout, comments

          $current_group["view_shout"]=($current_group["view_shout"]=="yes"?"checked=\"checked\"":"");
          $current_group["edit_shout"]=($current_group["edit_shout"]=="yes"?"checked=\"checked\"":"");
          $current_group["delete_shout"]=($current_group["delete_shout"]=="yes"?"checked=\"checked\"":"");

          $current_group["view_comments"]=($current_group["view_comments"]=="yes"?"checked=\"checked\"":"");
          $current_group["edit_comments"]=($current_group["edit_comments"]=="yes"?"checked=\"checked\"":"");
          $current_group["delete_comments"]=($current_group["delete_comments"]=="yes"?"checked=\"checked\"":"");

          # End
          #######################################################
          $current_group["can_upload"]=($current_group["can_upload"]=="yes"?"checked=\"checked\"":"");
          $current_group["can_download"]=($current_group["can_download"]=="yes"?"checked=\"checked\"":"");
          $current_group["ssl_announce"]=($current_group["ssl_announce"]=="yes"?"checked=\"checked\"":"");
          $current_group["admin_access"]=($current_group["admin_access"]=="yes"?"checked=\"checked\"":"");
$artype ="\n<option ".(($current_group["autorank_state"]=="Enabled")?" selected=\"selected\" ":"")." value='Enabled'>Enabled</option>";
$artype.="\n<option ".(($current_group["autorank_state"]=="Disabled")?" selected=\"selected\" ":"")." value='Disabled'>Disabled</option>";

$current_group["autorank_state"]=$artype;
$current_group["forumlist"]="";

if($FORUMLINK=="smf")
{
    $current_group["forumlist"].=$language['AUTORANK_SMF_LIST'];
    $res=mysqli_query($GLOBALS["___mysqli_ston"], "SELECT `ID_GROUP`, `groupName` FROM `{$db_prefix}membergroups` ORDER BY `ID_GROUP` ASC");
    if(@mysqli_num_rows($res)>0)
    {
        while($row=mysqli_fetch_assoc($res))
        {
            $current_group["forumlist"].=$row["groupName"] . " = " . $row["ID_GROUP"] . "
";
        }
    }
}

      $current_group["auto_prune"]=($current_group["auto_prune"]=="yes"?"checked=\"checked\"":"");

          if(substr($FORUMLINK,0,3)=="smf")
          {
              $current_group["forumlist"]=$language["SMF_LIST"];
              $res=get_result("SELECT ".(($FORUMLINK=="smf")?"`ID_GROUP` `idg`, `groupName` `gn`":"`id_group` `idg`, `group_name` `gn`")." FROM `{$db_prefix}membergroups` ORDER BY `idg` ASC", true, $btit_settings["cache_duration"]);
              if(count($res)>0)
              {
                  foreach($res as $row)
                  {
                      $current_group["forumlist"].=$row["gn"] . " = " . $row["idg"] . "
";
                  }
              }
              $current_group["smf_group_mirror"]=unesc($current_group["smf_group_mirror"]);
          }
          elseif($FORUMLINK=="ipb")
          {
              $current_group["forumlist"].=$language["IPB_LIST"];
              $res=do_sqlquery("SELECT * FROM `{$ipb_prefix}forum_perms` ORDER BY `perm_id` ASC",true);
              if(@mysqli_num_rows($res)>0)
              {
                  while($row=mysqli_fetch_assoc($res))
                  {
                      $current_group["forumlist"].=$row["perm_name"] . " = " . $row["perm_id"] . "
";
                  }
              }
              $current_group["ipb_group_mirror"]=unesc($current_group["ipb_group_mirror"]);
          }
          $admintpl->set("group",$current_group);
          break;

        case 'add':
          $admintpl->set("add_new",true,true);
          $block_title=$language["GROUP_ADD_NEW"];
          $admintpl->set("list",false,true);
          $admintpl->set("frm_action","index.php?page=admin&user=".$CURUSER["uid"]."&code=".$CURUSER["random"]."&do=groups&action=save&mode=new");
          $admintpl->set("language",$language);
          $frm_dropdown="\n<select name=\"base_group\" size=\"1\">";
          $rlevel=do_sqlquery("SELECT DISTINCT id_level,predef_level FROM {$TABLE_PREFIX}users_level ORDER BY id_level",true);
          while($level=mysqli_fetch_array($rlevel))
                $frm_dropdown.="\n<option value=\"".$level["id_level"]."\">".$level["predef_level"]."</option>";
          $frm_dropdown.="\n</select>";
          $admintpl->set("groups_combo",$frm_dropdown);
          break;

        case 'save':
          if ($_POST["write"]==$language["FRM_CONFIRM"])
            {
              if (isset($_GET["mode"]) && $_GET["mode"]=="new")
                 {
                   $gid=max(0,$_POST["base_group"]);
                   $gname=sqlesc($_POST["gname"]);
                   $rfields=get_result("SELECT * FROM {$TABLE_PREFIX}users_level WHERE id=$gid",true);
                   // we have unique record, set the first and unique to our array
                   $rfields=$rfields[0];
                   unset($rfields["autorank_state"]);
                   unset($rfields["autorank_position"]);
                   unset($rfields["autorank_min_upload"]);
                   unset($rfields["autorank_minratio"]);
                   unset($rfields["autorank_smf_group_mirror"]);

                   foreach($rfields as $key=>$value)
                          if ($key!="id" && $key!="level" && $key!="can_be_deleted") $fields[]=$key;
                   do_sqlquery("INSERT INTO {$TABLE_PREFIX}users_level (can_be_deleted,level,".implode(",",$fields).") SELECT 'yes',$gname,".implode(",",$fields)." FROM {$TABLE_PREFIX}users_level WHERE id=$gid",true);
                    $lid=((is_null($___mysqli_res = mysqli_insert_id($GLOBALS["___mysqli_ston"]))) ? false : $___mysqli_res);
                   $cres=do_sqlquery("SELECT id from {$TABLE_PREFIX}categories",true);
                   while ($crow = mysqli_fetch_row($cres))
                        do_sqlquery("INSERT INTO {$TABLE_PREFIX}categories_perm SET catid='$crow[0]',levelid=$lid,viewcat='no',viewtorrlist='no',viewtorrdet='no',downtorr='no'",true);
                   unset($crow);
                   ((mysqli_free_result($cres) || (is_object($cres) && (get_class($cres) == "mysqli_result"))) ? true : false);
                   unset($fields);
                   unset($rfields);
                 }
              else
                 {
                   $gid=max(0,$_GET["id"]);
                   $update=array();
                   $update[]="level=".sqlesc($_POST["gname"]);
                   $update[]="view_torrents=".sqlesc(isset($_POST["vtorrents"])?"yes":"no");
                   $update[]="edit_torrents=".sqlesc(isset($_POST["etorrents"])?"yes":"no");
                   $update[]="delete_torrents=".sqlesc(isset($_POST["dtorrents"])?"yes":"no");
                   $update[]="view_users=".sqlesc(isset($_POST["vusers"])?"yes":"no");
                   $update[]="edit_users=".sqlesc(isset($_POST["eusers"])?"yes":"no");
                   $update[]="delete_users=".sqlesc(isset($_POST["dusers"])?"yes":"no");
                   $update[]="view_news=".sqlesc(isset($_POST["vnews"])?"yes":"no");
                   $update[]="edit_news=".sqlesc(isset($_POST["enews"])?"yes":"no");
                   $update[]="delete_news=".sqlesc(isset($_POST["dnews"])?"yes":"no");
                   $update[]="view_forum=".sqlesc(isset($_POST["vforum"])?"yes":"no");
                   $update[]="edit_forum=".sqlesc(isset($_POST["eforum"])?"yes":"no");
                   $update[]="delete_forum=".sqlesc(isset($_POST["dforum"])?"yes":"no");
				   $update[]="trusted=".sqlesc(isset($_POST["trusted"])?"yes":"no");
	               $update[]="moderate_trusted=".sqlesc(isset($_POST["moderate_trusted"])?"yes":"no");
                   #######################################################
                   # view/edit/delete shout, comments

                   $update[]="view_shout=".sqlesc(isset($_POST["vshout"])?"yes":"no");
                   $update[]="edit_shout=".sqlesc(isset($_POST["eshout"])?"yes":"no");
                   $update[]="delete_shout=".sqlesc(isset($_POST["dshout"])?"yes":"no");

                   $update[]="view_comments=".sqlesc(isset($_POST["vcomments"])?"yes":"no");
                   $update[]="edit_comments=".sqlesc(isset($_POST["ecomments"])?"yes":"no");
                   $update[]="delete_comments=".sqlesc(isset($_POST["dcomments"])?"yes":"no");

                   # End
                   #######################################################
                   $update[]="can_upload=".sqlesc(isset($_POST["upload"])?"yes":"no");
                   $update[]="can_download=".sqlesc(isset($_POST["down"])?"yes":"no");
                   $update[]="admin_access=".sqlesc(isset($_POST["admincp"])?"yes":"no");
                   $update[]="auto_prune=".sqlesc(isset($_POST["auto_prune"])?"yes":"no");
                   $update[]="sfdownload=".sqlesc(isset($_POST["sfdownload"])?"yes":"no");
                   $update[]="show_ad=".sqlesc(isset($_POST["show_ad"])?"yes":"no");

                   $update[]="fstyle=".sqlesc(isset($_POST["fstyle"])?"yes":"no");
                   $update[]="speers=".sqlesc(isset($_POST["speers"])?"yes":"no");
                   $update[]="WT=".sqlesc($_POST["waiting"]);
				   #######################################################
                   # max torrents

                   $update[]="maxtorrents=".sqlesc($_POST["maxtorrents"]);

                   # End
                   #######################################################
                   $update[]="picture=".sqlesc($_POST["uimage"]);

                   $update[]="prefixcolor=".sqlesc($_POST["pcolor"]);
                   $update[]="suffixcolor=".sqlesc($_POST["scolor"]);
                   $update[]="autorank_state=".sqlesc($_POST["arstate"]);
                   $update[]="autorank_position=".((isset($_POST["arpos"]) && is_numeric($_POST["arpos"]))?$_POST["arpos"]:0);
                   $update[]="autorank_min_upload=".((isset($_POST["arminup"]) && is_numeric($_POST["arminup"]))?$_POST["arminup"]:0);
                   $update[]="autorank_minratio=".((isset($_POST["arminratio"]) && is_numeric($_POST["arminratio"]))?$_POST["arminratio"]:"0.00");
                   $update[]="autorank_smf_group_mirror=".((isset($_POST["arsmfmirr"]) && is_numeric($_POST["arsmfmirr"]))?$_POST["arsmfmirr"]:0);

                   if(substr($FORUMLINK,0,3)=="smf")
                       $update[]="smf_group_mirror=".((int)0+$_POST["smf_group_mirror"]);
                   elseif($FORUMLINK=="ipb")
                       $update[]="ipb_group_mirror=".((int)0+$_POST["ipb_group_mirror"]);
                   $strupdate=implode(",",$update);
                   do_sqlquery("UPDATE {$TABLE_PREFIX}users_level SET $strupdate WHERE id=$gid",true);
                   unset($update);
                   unset($strupdate);
                 }

            }

            // we don't break, so now we read ;)

        case '':
        case 'read':
        default:

          $block_title=$language["USER_GROUPS"];
          $admintpl->set("list",true,true);
          $admintpl->set("group_add_new","".$language["INSERT_USER_GROUP"]."");
          $admintpl->set("language",$language);
          $rlevel=do_sqlquery("SELECT * from {$TABLE_PREFIX}users_level ORDER BY id ASC",true);
          $groups=array();
          $i=0;
          while ($level=mysqli_fetch_array($rlevel))
            {
                $groups[$i]["user"]="".unesc($level["prefixcolor"]).unesc($level["level"]).unesc($level["suffixcolor"])."";
                $groups[$i]["torrent_aut"]=$level["view_torrents"]."/".$level["edit_torrents"]."/".$level["delete_torrents"];
                $groups[$i]["users_aut"]=$level["view_users"]."/".$level["edit_users"]."/".$level["delete_users"];
                $groups[$i]["news_aut"]=$level["view_news"]."/".$level["edit_news"]."/".$level["delete_news"];
                $groups[$i]["forum_aut"]=$level["view_forum"]."/".$level["edit_forum"]."/".$level["delete_forum"];
                #######################################################
                # view/edit/delete shout, comments

                $groups[$i]["shout_aut"]=$level["view_shout"]."/".$level["edit_shout"]."/".$level["delete_shout"];
                $groups[$i]["comments_aut"]=$level["view_comments"]."/".$level["edit_comments"]."/".$level["delete_comments"];

                # End
                #######################################################
                $groups[$i]["can_upload"]=$level["can_upload"];
                $groups[$i]["can_download"]=$level["can_download"];
				$groups[$i]["trusted"]=$level["trusted"];
	            $groups[$i]["moderate_trusted"]=$level["moderate_trusted"];
                $groups[$i]["admin_access"]=$level["admin_access"];
                $groups[$i]["auto_prune"]=$level["auto_prune"];
                $groups[$i]["stat_count"]=$level["sfdownload"];
                $groups[$i]["show_ad"]=$level["show_ad"];

                $groups[$i]["fstyle"]=$level["fstyle"];
                $groups[$i]["speers"]=$level["speers"];
                $groups[$i]["WT"]=$level["WT"];
	            #######################################################
                # max torrents

                $groups[$i]["maxtorrents"]=$level["maxtorrents"];

                # end
                #######################################################
                $groups[$i]["picture"]=$level["picture"];

                if(substr($FORUMLINK,0,3)=="smf")
                    $groups[$i]["smf_group_mirror"]=$level["smf_group_mirror"];
                elseif($FORUMLINK=="ipb")
                    $groups[$i]["ipb_group_mirror"]=$level["ipb_group_mirror"];
                $groups[$i]["delete"]=($level["can_be_deleted"]=="no"?"No":"".image_or_link("$STYLEPATH/images/delete.png","",$language["DELETE"])."");
                $groups[$i]["arpos"]=(($level["autorank_state"]=="Disabled")?$language["NA"]:$level["autorank_position"]);
                $groups[$i]["arstate"]=$level["autorank_state"];
                $groups[$i]["arupdowntrig"]=(($level["autorank_state"]=="Disabled")?$language["NA"]:makesize($level["autorank_min_upload"]));
                $groups[$i]["arratiotrig"]=(($level["autorank_state"]=="Disabled")?$language["NA"]:$level["autorank_minratio"]);
                $groups[$i]["arsmfmirr"]=$level["autorank_smf_group_mirror"];

                $i++;
          }

          unset($level);
          ((mysqli_free_result($rlevel) || (is_object($rlevel) && (get_class($rlevel) == "mysqli_result"))) ? true : false);

          $admintpl->set("groups",$groups);

}

?>


text:
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;

// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409

namespace NotAllTransparentAreEqual
{
    /// <summary>
    /// An empty page that can be used on its own or navigated to within a Frame.
    /// </summary>
    public sealed partial class MainPage : Page
    {
        public MainPage()
        {
            this.InitializeComponent();
        }

        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);
            BlinkingDefaultStoryboard.Begin();
            BlinkingSpecificStoryboard.Begin();
        }
    }
}


text:
angular
  .module('volunteers.shared')
  .constant('AppConfig', <%= APP_CONFIG %>)
;


text:
package otto

import (
	"fmt"
	"regexp"

	"github.com/robertkrimen/otto/ast"
	"github.com/robertkrimen/otto/file"
	"github.com/robertkrimen/otto/token"
)

var trueLiteral = &_nodeLiteral{value: toValue_bool(true)}
var falseLiteral = &_nodeLiteral{value: toValue_bool(false)}
var nullLiteral = &_nodeLiteral{value: nullValue}
var emptyStatement = &_nodeEmptyStatement{}

func (cmpl *_compiler) parseExpression(in ast.Expression) _nodeExpression {
	if in == nil {
		return nil
	}

	switch in := in.(type) {

	case *ast.ArrayLiteral:
		out := &_nodeArrayLiteral{
			value: make([]_nodeExpression, len(in.Value)),
		}
		for i, value := range in.Value {
			out.value[i] = cmpl.parseExpression(value)
		}
		return out

	case *ast.AssignExpression:
		return &_nodeAssignExpression{
			operator: in.Operator,
			left:     cmpl.parseExpression(in.Left),
			right:    cmpl.parseExpression(in.Right),
		}

	case *ast.BinaryExpression:
		return &_nodeBinaryExpression{
			operator:   in.Operator,
			left:       cmpl.parseExpression(in.Left),
			right:      cmpl.parseExpression(in.Right),
			comparison: in.Comparison,
		}

	case *ast.BooleanLiteral:
		if in.Value {
			return trueLiteral
		}
		return falseLiteral

	case *ast.BracketExpression:
		return &_nodeBracketExpression{
			idx:    in.Left.Idx0(),
			left:   cmpl.parseExpression(in.Left),
			member: cmpl.parseExpression(in.Member),
		}

	case *ast.CallExpression:
		out := &_nodeCallExpression{
			callee:       cmpl.parseExpression(in.Callee),
			argumentList: make([]_nodeExpression, len(in.ArgumentList)),
		}
		for i, value := range in.ArgumentList {
			out.argumentList[i] = cmpl.parseExpression(value)
		}
		return out

	case *ast.ConditionalExpression:
		return &_nodeConditionalExpression{
			test:       cmpl.parseExpression(in.Test),
			consequent: cmpl.parseExpression(in.Consequent),
			alternate:  cmpl.parseExpression(in.Alternate),
		}

	case *ast.DotExpression:
		return &_nodeDotExpression{
			idx:        in.Left.Idx0(),
			left:       cmpl.parseExpression(in.Left),
			identifier: in.Identifier.Name,
		}

	case *ast.EmptyExpression:
		return nil

	case *ast.FunctionLiteral:
		name := ""
		if in.Name != nil {
			name = in.Name.Name
		}
		out := &_nodeFunctionLiteral{
			name:   name,
			body:   cmpl.parseStatement(in.Body),
			source: in.Source,
			file:   cmpl.file,
		}
		if in.ParameterList != nil {
			list := in.ParameterList.List
			out.parameterList = make([]string, len(list))
			for i, value := range list {
				out.parameterList[i] = value.Name
			}
		}
		for _, value := range in.DeclarationList {
			switch value := value.(type) {
			case *ast.FunctionDeclaration:
				out.functionList = append(out.functionList, cmpl.parseExpression(value.Function).(*_nodeFunctionLiteral))
			case *ast.VariableDeclaration:
				for _, value := range value.List {
					out.varList = append(out.varList, value.Name)
				}
			default:
				panic(fmt.Errorf("Here be dragons: parseProgram.declaration(%T)", value))
			}
		}
		return out

	case *ast.Identifier:
		return &_nodeIdentifier{
			idx:  in.Idx,
			name: in.Name,
		}

	case *ast.NewExpression:
		out := &_nodeNewExpression{
			callee:       cmpl.parseExpression(in.Callee),
			argumentList: make([]_nodeExpression, len(in.ArgumentList)),
		}
		for i, value := range in.ArgumentList {
			out.argumentList[i] = cmpl.parseExpression(value)
		}
		return out

	case *ast.NullLiteral:
		return nullLiteral

	case *ast.NumberLiteral:
		return &_nodeLiteral{
			value: toValue(in.Value),
		}

	case *ast.ObjectLiteral:
		out := &_nodeObjectLiteral{
			value: make([]_nodeProperty, len(in.Value)),
		}
		for i, value := range in.Value {
			out.value[i] = _nodeProperty{
				key:   value.Key,
				kind:  value.Kind,
				value: cmpl.parseExpression(value.Value),
			}
		}
		return out

	case *ast.RegExpLiteral:
		return &_nodeRegExpLiteral{
			flags:   in.Flags,
			pattern: in.Pattern,
		}

	case *ast.SequenceExpression:
		out := &_nodeSequenceExpression{
			sequence: make([]_nodeExpression, len(in.Sequence)),
		}
		for i, value := range in.Sequence {
			out.sequence[i] = cmpl.parseExpression(value)
		}
		return out

	case *ast.StringLiteral:
		return &_nodeLiteral{
			value: toValue_string(in.Value),
		}

	case *ast.ThisExpression:
		return &_nodeThisExpression{}

	case *ast.UnaryExpression:
		return &_nodeUnaryExpression{
			operator: in.Operator,
			operand:  cmpl.parseExpression(in.Operand),
			postfix:  in.Postfix,
		}

	case *ast.VariableExpression:
		return &_nodeVariableExpression{
			idx:         in.Idx0(),
			name:        in.Name,
			initializer: cmpl.parseExpression(in.Initializer),
		}

	}

	panic(fmt.Errorf("Here be dragons: cmpl.parseExpression(%T)", in))
}

func (cmpl *_compiler) parseStatement(in ast.Statement) _nodeStatement {
	if in == nil {
		return nil
	}

	switch in := in.(type) {

	case *ast.BlockStatement:
		out := &_nodeBlockStatement{
			list: make([]_nodeStatement, len(in.List)),
		}
		for i, value := range in.List {
			out.list[i] = cmpl.parseStatement(value)
		}
		return out

	case *ast.BranchStatement:
		out := &_nodeBranchStatement{
			branch: in.Token,
		}
		if in.Label != nil {
			out.label = in.Label.Name
		}
		return out

	case *ast.DebuggerStatement:
		return &_nodeDebuggerStatement{}

	case *ast.DoWhileStatement:
		out := &_nodeDoWhileStatement{
			test: cmpl.parseExpression(in.Test),
		}
		body := cmpl.parseStatement(in.Body)
		if block, ok := body.(*_nodeBlockStatement); ok {
			out.body = block.list
		} else {
			out.body = append(out.body, body)
		}
		return out

	case *ast.EmptyStatement:
		return emptyStatement

	case *ast.ExpressionStatement:
		return &_nodeExpressionStatement{
			expression: cmpl.parseExpression(in.Expression),
		}

	case *ast.ForInStatement:
		out := &_nodeForInStatement{
			into:   cmpl.parseExpression(in.Into),
			source: cmpl.parseExpression(in.Source),
		}
		body := cmpl.parseStatement(in.Body)
		if block, ok := body.(*_nodeBlockStatement); ok {
			out.body = block.list
		} else {
			out.body = append(out.body, body)
		}
		return out

	case *ast.ForStatement:
		out := &_nodeForStatement{
			initializer: cmpl.parseExpression(in.Initializer),
			update:      cmpl.parseExpression(in.Update),
			test:        cmpl.parseExpression(in.Test),
		}
		body := cmpl.parseStatement(in.Body)
		if block, ok := body.(*_nodeBlockStatement); ok {
			out.body = block.list
		} else {
			out.body = append(out.body, body)
		}
		return out

	case *ast.FunctionStatement:
		return emptyStatement

	case *ast.IfStatement:
		return &_nodeIfStatement{
			test:       cmpl.parseExpression(in.Test),
			consequent: cmpl.parseStatement(in.Consequent),
			alternate:  cmpl.parseStatement(in.Alternate),
		}

	case *ast.LabelledStatement:
		return &_nodeLabelledStatement{
			label:     in.Label.Name,
			statement: cmpl.parseStatement(in.Statement),
		}

	case *ast.ReturnStatement:
		return &_nodeReturnStatement{
			argument: cmpl.parseExpression(in.Argument),
		}

	case *ast.SwitchStatement:
		out := &_nodeSwitchStatement{
			discriminant: cmpl.parseExpression(in.Discriminant),
			default_:     in.Default,
			body:         make([]*_nodeCaseStatement, len(in.Body)),
		}
		for i, clause := range in.Body {
			out.body[i] = &_nodeCaseStatement{
				test:       cmpl.parseExpression(clause.Test),
				consequent: make([]_nodeStatement, len(clause.Consequent)),
			}
			for j, value := range clause.Consequent {
				out.body[i].consequent[j] = cmpl.parseStatement(value)
			}
		}
		return out

	case *ast.ThrowStatement:
		return &_nodeThrowStatement{
			argument: cmpl.parseExpression(in.Argument),
		}

	case *ast.TryStatement:
		out := &_nodeTryStatement{
			body:    cmpl.parseStatement(in.Body),
			finally: cmpl.parseStatement(in.Finally),
		}
		if in.Catch != nil {
			out.catch = &_nodeCatchStatement{
				parameter: in.Catch.Parameter.Name,
				body:      cmpl.parseStatement(in.Catch.Body),
			}
		}
		return out

	case *ast.VariableStatement:
		out := &_nodeVariableStatement{
			list: make([]_nodeExpression, len(in.List)),
		}
		for i, value := range in.List {
			out.list[i] = cmpl.parseExpression(value)
		}
		return out

	case *ast.WhileStatement:
		out := &_nodeWhileStatement{
			test: cmpl.parseExpression(in.Test),
		}
		body := cmpl.parseStatement(in.Body)
		if block, ok := body.(*_nodeBlockStatement); ok {
			out.body = block.list
		} else {
			out.body = append(out.body, body)
		}
		return out

	case *ast.WithStatement:
		return &_nodeWithStatement{
			object: cmpl.parseExpression(in.Object),
			body:   cmpl.parseStatement(in.Body),
		}

	}

	panic(fmt.Errorf("Here be dragons: cmpl.parseStatement(%T)", in))
}

func cmpl_parse(in *ast.Program) *_nodeProgram {
	cmpl := _compiler{
		program: in,
	}
	return cmpl.parse()
}

func (cmpl *_compiler) _parse(in *ast.Program) *_nodeProgram {
	out := &_nodeProgram{
		body: make([]_nodeStatement, len(in.Body)),
		file: in.File,
	}
	for i, value := range in.Body {
		out.body[i] = cmpl.parseStatement(value)
	}
	for _, value := range in.DeclarationList {
		switch value := value.(type) {
		case *ast.FunctionDeclaration:
			out.functionList = append(out.functionList, cmpl.parseExpression(value.Function).(*_nodeFunctionLiteral))
		case *ast.VariableDeclaration:
			for _, value := range value.List {
				out.varList = append(out.varList, value.Name)
			}
		default:
			panic(fmt.Errorf("Here be dragons: cmpl.parseProgram.DeclarationList(%T)", value))
		}
	}
	return out
}

type _nodeProgram struct {
	body []_nodeStatement

	varList      []string
	functionList []*_nodeFunctionLiteral

	variableList []_nodeDeclaration

	file *file.File
}

type _nodeDeclaration struct {
	name       string
	definition _node
}

type _node interface {
}

type (
	_nodeExpression interface {
		_node
		_expressionNode()
	}

	_nodeArrayLiteral struct {
		value []_nodeExpression
	}

	_nodeAssignExpression struct {
		operator token.Token
		left     _nodeExpression
		right    _nodeExpression
	}

	_nodeBinaryExpression struct {
		operator   token.Token
		left       _nodeExpression
		right      _nodeExpression
		comparison bool
	}

	_nodeBracketExpression struct {
		idx    file.Idx
		left   _nodeExpression
		member _nodeExpression
	}

	_nodeCallExpression struct {
		callee       _nodeExpression
		argumentList []_nodeExpression
	}

	_nodeConditionalExpression struct {
		test       _nodeExpression
		consequent _nodeExpression
		alternate  _nodeExpression
	}

	_nodeDotExpression struct {
		idx        file.Idx
		left       _nodeExpression
		identifier string
	}

	_nodeFunctionLiteral struct {
		name          string
		body          _nodeStatement
		source        string
		parameterList []string
		varList       []string
		functionList  []*_nodeFunctionLiteral
		file          *file.File
	}

	_nodeIdentifier struct {
		idx  file.Idx
		name string
	}

	_nodeLiteral struct {
		value Value
	}

	_nodeNewExpression struct {
		callee       _nodeExpression
		argumentList []_nodeExpression
	}

	_nodeObjectLiteral struct {
		value []_nodeProperty
	}

	_nodeProperty struct {
		key   string
		kind  string
		value _nodeExpression
	}

	_nodeRegExpLiteral struct {
		flags   string
		pattern string // Value?
		regexp  *regexp.Regexp
	}

	_nodeSequenceExpression struct {
		sequence []_nodeExpression
	}

	_nodeThisExpression struct {
	}

	_nodeUnaryExpression struct {
		operator token.Token
		operand  _nodeExpression
		postfix  bool
	}

	_nodeVariableExpression struct {
		idx         file.Idx
		name        string
		initializer _nodeExpression
	}
)

type (
	_nodeStatement interface {
		_node
		_statementNode()
	}

	_nodeBlockStatement struct {
		list []_nodeStatement
	}

	_nodeBranchStatement struct {
		branch token.Token
		label  string
	}

	_nodeCaseStatement struct {
		test       _nodeExpression
		consequent []_nodeStatement
	}

	_nodeCatchStatement struct {
		parameter string
		body      _nodeStatement
	}

	_nodeDebuggerStatement struct {
	}

	_nodeDoWhileStatement struct {
		test _nodeExpression
		body []_nodeStatement
	}

	_nodeEmptyStatement struct {
	}

	_nodeExpressionStatement struct {
		expression _nodeExpression
	}

	_nodeForInStatement struct {
		into   _nodeExpression
		source _nodeExpression
		body   []_nodeStatement
	}

	_nodeForStatement struct {
		initializer _nodeExpression
		update      _nodeExpression
		test        _nodeExpression
		body        []_nodeStatement
	}

	_nodeIfStatement struct {
		test       _nodeExpression
		consequent _nodeStatement
		alternate  _nodeStatement
	}

	_nodeLabelledStatement struct {
		label     string
		statement _nodeStatement
	}

	_nodeReturnStatement struct {
		argument _nodeExpression
	}

	_nodeSwitchStatement struct {
		discriminant _nodeExpression
		default_     int
		body         []*_nodeCaseStatement
	}

	_nodeThrowStatement struct {
		argument _nodeExpression
	}

	_nodeTryStatement struct {
		body    _nodeStatement
		catch   *_nodeCatchStatement
		finally _nodeStatement
	}

	_nodeVariableStatement struct {
		list []_nodeExpression
	}

	_nodeWhileStatement struct {
		test _nodeExpression
		body []_nodeStatement
	}

	_nodeWithStatement struct {
		object _nodeExpression
		body   _nodeStatement
	}
)

// _expressionNode

func (*_nodeArrayLiteral) _expressionNode()          {}
func (*_nodeAssignExpression) _expressionNode()      {}
func (*_nodeBinaryExpression) _expressionNode()      {}
func (*_nodeBracketExpression) _expressionNode()     {}
func (*_nodeCallExpression) _expressionNode()        {}
func (*_nodeConditionalExpression) _expressionNode() {}
func (*_nodeDotExpression) _expressionNode()         {}
func (*_nodeFunctionLiteral) _expressionNode()       {}
func (*_nodeIdentifier) _expressionNode()            {}
func (*_nodeLiteral) _expressionNode()               {}
func (*_nodeNewExpression) _expressionNode()         {}
func (*_nodeObjectLiteral) _expressionNode()         {}
func (*_nodeRegExpLiteral) _expressionNode()         {}
func (*_nodeSequenceExpression) _expressionNode()    {}
func (*_nodeThisExpression) _expressionNode()        {}
func (*_nodeUnaryExpression) _expressionNode()       {}
func (*_nodeVariableExpression) _expressionNode()    {}

// _statementNode

func (*_nodeBlockStatement) _statementNode()      {}
func (*_nodeBranchStatement) _statementNode()     {}
func (*_nodeCaseStatement) _statementNode()       {}
func (*_nodeCatchStatement) _statementNode()      {}
func (*_nodeDebuggerStatement) _statementNode()   {}
func (*_nodeDoWhileStatement) _statementNode()    {}
func (*_nodeEmptyStatement) _statementNode()      {}
func (*_nodeExpressionStatement) _statementNode() {}
func (*_nodeForInStatement) _statementNode()      {}
func (*_nodeForStatement) _statementNode()        {}
func (*_nodeIfStatement) _statementNode()         {}
func (*_nodeLabelledStatement) _statementNode()   {}
func (*_nodeReturnStatement) _statementNode()     {}
func (*_nodeSwitchStatement) _statementNode()     {}
func (*_nodeThrowStatement) _statementNode()      {}
func (*_nodeTryStatement) _statementNode()        {}
func (*_nodeVariableStatement) _statementNode()   {}
func (*_nodeWhileStatement) _statementNode()      {}
func (*_nodeWithStatement) _statementNode()       {}


text: Docker repository for android build environment


text:
module V1
  module Endpoints
    class AccountsEndpoint < Grape::API
      namespace :accounts do
        desc 'List existing accounts'
        params do
          optional :page, type: Integer, default: 1, desc: 'Current page.'
          optional :size, type: Integer, default: 10, desc: 'Number of accounts to return per page.'
        end
        get do
          conditions = {}
          paginate Account, conditions: conditions, with: Presenters::AccountsPresenter
        end

        desc 'Create new account.'
        params do
          requires :account, type: Hash do
            requires :name, type: String
          end
        end
        post do
          create Account, with: Presenters::AccountPresenter, from: permitted_params[:account]
        end

        desc 'Retrieve existing account.'
        params do
          requires :id, desc: 'ID of the account'
        end
        get ':id' do
          account = Account.find params[:id]
          present account, with: Presenters::AccountPresenter
        end

        desc 'Update existing account.'
        params do
          requires :id, type: String, desc: 'Account id.'
          requires :account, type: Hash do
            optional :name, type: String
          end
        end
        patch ':id' do
          account = Account.find params[:id]
          update account, with: Presenters::AccountPresenter, from: permitted_params[:account]
        end

        desc 'Delete existing account.'
        params do
          requires :id, type: String, desc: 'Account id.'
        end
        delete ':id' do
          account = Account.find params[:id]
          delete account, with: Presenters::AccountPresenter
        end
      end
    end
  end
end


text:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html
  PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<title>Long Description</title><link rel="stylesheet" type="text/css" href="css/jbossorg.css"/><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>

A transaction is started, and some work is performed.

Once the work is finished, the two-phase commit begins.

The coordinator (transaction manager) of the transaction asks each resource taking
                                part in the
                                transaction whether it is prepared to commit.

If all resources respond positively, the coordinator instructs the resources to make
                                all work performed durable (usually committed to a database).

If not, all work performed is rolled back (undone) such that the underlying data
                                structures are
                                in their original states.


text:
v.module.whois = (config) => {

  var get = () =>
    Promise.all(['known', 'backers', 'online'].map((endpoint) =>
      Promise.race([
        // skip backers endpoint
        endpoint === 'backers' ? Promise.resolve([]) :
        m.request({
          method: 'GET',
          url: config.api[endpoint]
        }),
        new Promise((resolve, reject) => {
          setTimeout(() => resolve({error: 'Timeout'}), 3000)
        })
      ])
    ))
    .then(([known, backers, online]) => ({
        error: {
          known: !known ? 'Missing' : known.error,
          backers: !backers ? 'Missing' : backers.error,
          online: !online ? 'Missing' : online.error,
        },
        data: {
          known: known.error || !known ? [] : known,
          backers: backers.error || !backers ? [] : backers,
          online: online.error || !online ? {known: [], unknown: []} : online,
        }
      }))

  var known = ({known, backers, online}) =>
    known
      .map(({id, name, gravatar, backer, twitter, github}) => ({
        id,
        name,
        gravatar,
        avatar: 'https://gravatar.com/avatar/' + gravatar +
          '?size=48&d=monsterid',
        online: online.known.includes(id),
        backer: backers.find((s) => s.name === backer),
        twitter,
        github
      }))

  var missing = ({known, backers}) =>
    (
      (
        names = known
          .map((member) => member.backer)
      ) =>
      backers
        .filter((backer) => !names.includes(backer.name))
        .map((backer) => ({
          name: backer.name,
          backer
        }))
    )()

  var filter = {
    all: (known) =>
      known
        .sort((a, b) => (a.name > b.name ? 1 : a.name < b.name ? -1 : 0)),

    online: (known) =>
      known
        .filter((known) => known.online)
        .sort((a, b) => (a.name > b.name ? 1 : a.name < b.name ? -1 : 0)),

    backers: (known, missing) =>
      known
        .filter((known) => known.backer)
        .concat(missing)
        .sort((a, b) => (b.backer.average - a.backer.average)),

    unknown: (unknown) =>
      unknown
        .map((device) => ({
          name: device.host,
          vendor: device.vendor,
          icon: /android|i?phone/i.test(device.host) ? 'smartphone' : 'laptop'
        }))
  }

  var sort = (devices) => {
    var phones = devices
      .filter((device) => device.host && /android|i?phone/i.test(device.host))
      .sort((a, b) => (
        a.host.toLowerCase() > b.host.toLowerCase() ? 1 :
        a.host.toLowerCase() < b.host.toLowerCase() ? -1 : 0))

    var other = devices
      .filter((device) => device.host && !/android|i?phone/i.test(device.host))
      .sort((a, b) => (
        a.host.toLowerCase() > b.host.toLowerCase() ? 1 :
        a.host.toLowerCase() < b.host.toLowerCase() ? -1 : 0))

    var nohost = devices.filter((device) => !device.host)

    return phones.concat(other).concat(nohost)
  }

  return {get, known, missing, filter, sort}
}


text:
if [[ ! -x "../${PWD##*/}/gradlew" ]]; then
    echo "Please run me from the WebdavBulkDeleter Git repo"
    exit 1
fi

type -p java &>/dev/null
if (( $? != 0 )); then
    echo "No \"java\" command in path - please add the java JRE or JDK \"bin\" directory to your path variable"
    exit 1
fi

binary="build/libs/WebdavBulkDeleter-all.jar"
if [[ ! -f "$binary" ]]; then
    ./gradlew shadowJar
fi

java -Dlog4j.configuration=log4j.properties -jar "$binary" $@


text:
@interface XBaseChartConfiguration : NSObject

/// defalut is white
@property(nonatomic, strong) UIColor* chartBackgroundColor;
@property(nonatomic, assign) NSUInteger ordinateDenominator;
@property(nonatomic, assign) BOOL isScrollable;
@end


text:
import os

os.environ['FLAGS_enable_eager_mode'] = '1'

import unittest
import numpy as np

import paddle
from paddle.distributed.fleet.utils import recompute
import random

def get_fc_block(block_idx, input_size, is_last=False):
    block_name = "block_" + str(block_idx)
    block = paddle.nn.Sequential(
        (
            block_name + "_fc_0",
            paddle.nn.Linear(input_size, input_size, bias_attr=False),
        ),
        (block_name + "_dropout", paddle.nn.Dropout(p=0.5)),
        (block_name + "_relu_1", paddle.nn.ReLU()),
        (
            block_name + "_fc_1",
            paddle.nn.Linear(input_size, input_size, bias_attr=False),
        ),
        (block_name + "_relu_2", paddle.nn.ReLU()),
    )
    if is_last:
        block.add_sublayer(
            block_name + "_fc_2",
            paddle.nn.Linear(input_size, 1, bias_attr=False),
        )  # add sublayer
    else:
        block.add_sublayer(
            block_name + "_fc_2",
            paddle.nn.Linear(input_size, input_size, bias_attr=False),
        )  # add sublayer
    return block

class Naive_fc_net(paddle.nn.Layer):
    def __init__(
        self,
        input_size=10,
        recompute_blocks=[1, 3],
        use_fleet_sq=False,
        segments=1,
        use_raw_recompute=False,
        recompute_kwargs={},
    ):
        super().__init__()
        self.recompute_blocks = recompute_blocks
        self.recompute_kwargs = recompute_kwargs
        self.use_fleet_sq = use_fleet_sq
        self.use_raw_recompute = use_raw_recompute
        self.segments = segments

        self.runfunc0 = get_fc_block(0, input_size, is_last=False)
        self.runfunc1 = get_fc_block(1, input_size, is_last=False)
        self.runfunc2 = get_fc_block(2, input_size, is_last=False)
        self.runfunc3 = get_fc_block(3, input_size, is_last=False)
        self.runfunc4 = get_fc_block(4, input_size, is_last=True)

        if self.use_fleet_sq and not use_raw_recompute:
            self.runfuncs = paddle.nn.Sequential(
                self.runfunc0,
                self.runfunc1,
                self.runfunc2,
                self.runfunc3,
                self.runfunc4,
            )

        self.layers = [
            self.runfunc0,
            self.runfunc1,
            self.runfunc2,
            self.runfunc3,
            self.runfunc4,
        ]

        # default segments = 2
        if use_raw_recompute:
            self.layers = [
                paddle.nn.Sequential(self.runfunc0, self.runfunc1),
                paddle.nn.Sequential(
                    self.runfunc2, self.runfunc3, self.runfunc4
                ),
            ]

    def forward(self, inputs):

        if self.use_fleet_sq and not self.use_raw_recompute:
            return paddle.incubate.distributed.fleet.recompute_sequential(
                {"segments": self.segments}, self.runfuncs, inputs
            )

        if self.use_raw_recompute:
            inputs = recompute(self.layers[0], inputs)
            return self.layers[1](inputs)

        for i in range(len(self.layers)):
            if i in self.recompute_blocks:
                inputs = recompute(
                    self.layers[i], inputs, **self.recompute_kwargs
                )
            else:
                inputs = self.layers[i](inputs)

        return inputs

def run_model(
    recompute_block=[],
    recompute_kwargs={},
    use_fleet_sq=False,
    use_raw_recompute=False,
    segments=1,
    enable_autocast=False,
    pure_fp16=False,
):
    gen = paddle.seed(10)
    gen.manual_seed(10)
    np.random.seed(10)
    random.seed(10)

    batch_size, input_size = 1, 10
    model = Naive_fc_net(
        input_size,
        recompute_blocks=recompute_block,
        use_fleet_sq=use_fleet_sq,
        use_raw_recompute=use_raw_recompute,
        segments=segments,
        recompute_kwargs=recompute_kwargs,
    )
    loss_fn = paddle.nn.MSELoss(reduction='mean')
    optimizer = paddle.optimizer.SGD(
        learning_rate=0.01, parameters=model.parameters()
    )

    if enable_autocast:
        scaler = paddle.amp.GradScaler()

    loss_ = []
    param_ = []
    grad_ = []
    for step in range(10):

        x_data = np.random.randn(batch_size, input_size).astype(np.float32)
        x = paddle.to_tensor(x_data)
        # x.stop_gradient = False
        level = 'O2' if pure_fp16 else 'O1'
        with paddle.amp.auto_cast(True, level=level):
            y_pred = model(x)
            loss = y_pred.mean()
        if enable_autocast:
            scaler.scale(loss).backward()
            scaler.minimize(optimizer, loss)
        else:
            loss_.append(np.asarray(loss).tolist())
            loss.backward()
            optimizer.step()

        param_.append(np.asarray(model.parameters()[9]).tolist())
        grad_.append(np.asarray(model.parameters()[3]._grad_ivar()).tolist())

        optimizer.clear_grad()
    return loss_, param_, grad_

class TestPyLayer(unittest.TestCase):
    def test_base_case(self, enable_autocast=False, pure_fp16=False):
        def check_identical(loss_ref, param_ref, grad_ref, loss, param, grad):
            self.assertEqual(loss_ref, loss)
            self.assertEqual(param_ref, param)
            self.assertEqual(grad_ref, grad)

        # without recompute
        loss_ref, param_ref, grad_ref = run_model(
            recompute_block=[],
            enable_autocast=enable_autocast,
            pure_fp16=pure_fp16,
        )

        # recompute second block
        loss, param, grad = run_model(
            recompute_block=[1],
            enable_autocast=enable_autocast,
            pure_fp16=pure_fp16,
        )
        check_identical(loss_ref, param_ref, grad_ref, loss, param, grad)

        # recompute fourth block
        loss, param, grad = run_model(
            recompute_block=[3],
            enable_autocast=enable_autocast,
            pure_fp16=pure_fp16,
        )
        check_identical(loss_ref, param_ref, grad_ref, loss, param, grad)

        # recompute second to fourth block
        loss, param, grad = run_model(
            recompute_block=[1, 2, 3],
            enable_autocast=enable_autocast,
            pure_fp16=pure_fp16,
        )
        check_identical(loss_ref, param_ref, grad_ref, loss, param, grad)

        # recompute second & fourth block
        loss, param, grad = run_model(
            recompute_block=[1, 3],
            enable_autocast=enable_autocast,
            pure_fp16=pure_fp16,
        )
        check_identical(loss_ref, param_ref, grad_ref, loss, param, grad)

        # recompute_sequential with segments=1 using fleet
        loss, param, grad = run_model(
            recompute_block=[],
            use_fleet_sq=True,
            enable_autocast=enable_autocast,
            pure_fp16=pure_fp16,
        )
        check_identical(loss_ref, param_ref, grad_ref, loss, param, grad)

        # with base recompute, and segments=2
        loss_ref, param_ref, grad_ref = run_model(
            recompute_block=[],
            enable_autocast=enable_autocast,
            use_raw_recompute=True,
            pure_fp16=pure_fp16,
        )

        # recompute using paddle.incubate.distributed.fleet.recompute_sequential, segments=2
        loss, param, grad = run_model(
            recompute_block=[],
            use_fleet_sq=True,
            segments=2,
            enable_autocast=enable_autocast,
            pure_fp16=pure_fp16,
        )
        check_identical(loss_ref, param_ref, grad_ref, loss, param, grad)

    def test_fc_net_with_dropout(self):
        self.test_base_case()

    def test_fc_net_without_restore_rng(self):
        loss_ref, param_ref, grad_ref = run_model(
            recompute_block=[2],
            recompute_kwargs={"preserve_rng_state": False},
            enable_autocast=True,
        )

    def test_fc_net_with_amp(self):
        self.test_base_case(enable_autocast=True)

    def test_fc_net_with_fp16(self):
        self.test_base_case(enable_autocast=True, pure_fp16=True)

    def test_recompute_kwargs(self):
        paddle.set_device("gpu")
        kwargs = {"is_test": False}
        with self.assertRaises(TypeError):
            loss_ref, param_ref, grad_ref = run_model(
                recompute_block=[2], recompute_kwargs=kwargs
            )

    def test_recompute_cpu_rng(self):
        paddle.set_device("cpu")
        with self.assertRaises(RuntimeError):
            loss_ref, param_ref, grad_ref = run_model(recompute_block=[2])

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


text:
package ca.uhn.fhir.rest.server.method;

import java.lang.reflect.Method;
import java.util.Collections;
import java.util.Set;

import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.rest.annotation.Delete;
import ca.uhn.fhir.rest.api.RequestTypeEnum;
import ca.uhn.fhir.rest.api.RestOperationTypeEnum;
import ca.uhn.fhir.rest.api.server.RequestDetails;

import javax.annotation.Nonnull;

public class DeleteMethodBinding extends BaseOutcomeReturningMethodBindingWithResourceIdButNoResourceBody {

	public DeleteMethodBinding(Method theMethod, FhirContext theContext, Object theProvider) {
		super(theMethod, theContext, theProvider, Delete.class, theMethod.getAnnotation(Delete.class).type());
	}

	@Nonnull
	@Override
	public RestOperationTypeEnum getRestOperationType() {
		return RestOperationTypeEnum.DELETE;
	}

	@Override
	protected Set<RequestTypeEnum> provideAllowableRequestTypes() {
		return Collections.singleton(RequestTypeEnum.DELETE);
	}

	@Override
	protected boolean allowVoidReturnType() {
		return true;
	}

	@Override
	protected void addParametersForServerRequest(RequestDetails theRequest, Object[] theParams) {
		theParams[getIdParameterIndex()] = theRequest.getId();
	}

	@Override
	protected String getMatchingOperation() {
		return null;
	}

}


text:
==============================
Provide user data to instances
==============================

*User data* is a blob of data that the user can specify when they launch an
instance. The instance can access this data through the metadata service or
config drive. Commonly used to pass a shell script that the instance runs on
boot.

For example, one application that uses user data is the
`cloud-init <https://help.ubuntu.com/community/CloudInit>`__ system,
which is an open-source package from Ubuntu that is available on various
Linux distributions and which handles early initialization of a cloud
instance.

You can place user data in a local file and pass it through the
``--user-data <user-data-file>`` parameter at instance creation.

.. code-block:: console

   $ openstack server create --image ubuntu-cloudimage --flavor 1 \
     --user-data mydata.file VM_INSTANCE


text:
FROM guusk/docker-systemc:2.3.0
MAINTAINER Pedro Cuadra <pjcuadra@gmail.com>

RUN apt-get update
RUN apt-get install -y git vim openssh-server supervisor unzip
RUN apt-get autoremove

RUN cp -r /usr/local/systemc-2.3.0/* /usr/local/
RUN update-rc.d ssh defaults

RUN echo 'root:password' | chpasswd
RUN sed -i 's/PermitRootLogin without-password/PermitRootLogin yes/' /etc/ssh/sshd_config

# SSH login fix. Otherwise user is kicked off after login
RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd

ENV NOTVISIBLE "in users profile"
RUN echo "export VISIBLE=now" >> /etc/profile

COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf

RUN mkdir -p /var/run/sshd

EXPOSE 22
CMD ["/usr/bin/supervisord"]