text:
<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of Student_model
 *
 * @author Keshav K
 */
class Student_model extends CI_Model {

    public function add_student_m($user_information, $student_information) {

        $this->db->trans_start();

        $this->db->insert('tbl_users', $user_information);

        $user_id = $this->db->insert_id();

        $student_information['user_id'] = $user_id;

        $this->db->insert('tbl_student', $student_information);

        $this->db->trans_complete();

        if ($this->db->trans_status() === FALSE) {
            return FALSE;
        } else {
            return TRUE;
        }
    }

    public function update_student_m($user_id, $user_information, $student_information) {

        $this->db->trans_start();

        $this->db->where('user_id', $user_id);
        $this->db->update('tbl_users', $user_information);

        $this->db->where('user_id', $user_id);
        $this->db->update('tbl_student', $student_information);

        $this->db->trans_complete();

        if ($this->db->trans_status() === FALSE) {
            return FALSE;
        } else {
            return TRUE;
        }
    }

    public function delete_student($user_id) {

        $this->db->trans_start();

        $this->db->delete('tbl_student', array('user_id' => $user_id));
        $this->db->delete('tbl_users', array('user_id' => $user_id));

        $this->db->trans_complete();

        if ($this->db->trans_status() === FALSE) {
            return FALSE;
        } else {
            return TRUE;
        }

    }

    public function fetch_students($user_id = NULL) {

        if ($user_id != NULL) {
            $this->db->where('u.user_id', $user_id);
        }
        $this->db->where('u.role_id', 3);

        $this->db->join('tbl_student s', 'u.user_id = s.user_id');
        $this->db->join('tbl_departments d', 's.department = d.department_id');

        $this->db->order_by('s.semester', 'asc');
        $this->db->order_by('s.roll_number', 'asc');

        $query = $this->db->get('tbl_users u');

        if ($user_id == NULL) {
            return $query->result_array();
        } else {
            return $query->row_array();
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
/*
 * Extends the event handling code with double tap support for mobile browsers.
 */

F.extend(F.DomEvent, {

	_touchstart: F.Browser.msPointer ? 'MSPointerDown' : F.Browser.pointer ? 'pointerdown' : 'touchstart',
	_touchend: F.Browser.msPointer ? 'MSPointerUp' : F.Browser.pointer ? 'pointerup' : 'touchend',

	// inspired by Zepto touch code by Thomas Fuchs
	addDoubleTapListener: function (obj, handler, id) {
		var last, touch,
		    doubleTap = false,
		    delay = 250,
		    trackedTouches = [];

		function onTouchStart(e) {
			var count;

			if (F.Browser.pointer) {
				trackedTouches.push(e.pointerId);
				count = trackedTouches.length;
			} else {
				count = e.touches.length;
			}

			if (count > 1) { return; }

			var now = Date.now(),
			    delta = now - (last || now);

			touch = e.touches ? e.touches[0] : e;
			doubleTap = (delta > 0 && delta <= delay);
			last = now;
		}

		function onTouchEnd(e) {
			if (F.Browser.pointer) {
				var idx = trackedTouches.indexOf(e.pointerId);
				if (idx === -1) { return; }
				trackedTouches.splice(idx, 1);
			}

			if (doubleTap) {
				if (F.Browser.pointer) {
					// work around .type being readonly with MSPointer* events
					var newTouch = {},
						prop, i;

					for (i in touch) {
						prop = touch[i];
						newTouch[i] = prop && prop.bind ? prop.bind(touch) : prop;
					}
					touch = newTouch;
				}
				touch.type = 'dblclick';
				handler(touch);
				last = null;
			}
		}

		var pre = '_leaflet_',
		    touchstart = this._touchstart,
		    touchend = this._touchend;

		obj[pre + touchstart + id] = onTouchStart;
		obj[pre + touchend + id] = onTouchEnd;

		// on pointer we need to listen on the document, otherwise a drag starting on the map and moving off screen
		// will not come through to us, so we will lose track of how many touches are ongoing
		var endElement = F.Browser.pointer ? document.documentElement : obj;

		obj.addEventListener(touchstart, onTouchStart, false);

		endElement.addEventListener(touchend, onTouchEnd, false);
		if (F.Browser.pointer) {
			endElement.addEventListener(F.DomEvent.POINTER_CANCEL, onTouchEnd, false);
		}

		return this;
	},

	removeDoubleTapListener: function (obj, id) {
		var pre = '_leaflet_',
		    endElement = F.Browser.pointer ? document.documentElement : obj,
		    touchend = obj[pre + this._touchend + id];

		obj.removeEventListener(this._touchstart, obj[pre + this._touchstart + id], false);

		endElement.removeEventListener(this._touchend, touchend, false);
		if (F.Browser.pointer) {
			endElement.removeEventListener(F.DomEvent.POINTER_CANCEL, touchend, false);
		}

		return this;
	}
});


text:
package p1.p2;

public class Activity1 extends android.support.v4.app.Watson {
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        int n = R.menu.onClickIntention;
    }
}


text:
package org.switchyard.component.common.knowledge.config.model.v1;

import static org.switchyard.component.common.knowledge.config.model.OutputModel.OUTPUT;

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

import org.switchyard.common.xml.XMLHelper;
import org.switchyard.component.common.knowledge.config.model.OutputModel;
import org.switchyard.component.common.knowledge.config.model.OutputsModel;
import org.switchyard.config.Configuration;
import org.switchyard.config.model.BaseModel;
import org.switchyard.config.model.Descriptor;

/**
 * A version 1 OutputsModel.
 *
 * @author David Ward <dward@jboss.org> © 2012 Red Hat Inc.
 */
public class V1OutputsModel extends BaseModel implements OutputsModel {

    private List<OutputModel> _outputs = new ArrayList<OutputModel>();

    /**
     * Creates a new V1OutputsModel in the specified namespace.
     * @param namespace the specified namespace
     */
    public V1OutputsModel(String namespace) {
        super(XMLHelper.createQName(namespace, OUTPUTS));
        setModelChildrenOrder(OUTPUT);
    }

    /**
     * Creates a new V1OutputsModel with the specified configuration and descriptor.
     * @param config the configuration
     * @param desc the descriptor
     */
    public V1OutputsModel(Configuration config, Descriptor desc) {
        super(config, desc);
        for (Configuration output_config : config.getChildren(OUTPUT)) {
            OutputModel output = (OutputModel)readModel(output_config);
            if (output != null) {
                _outputs.add(output);
            }
        }
        setModelChildrenOrder(OUTPUT);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public synchronized List<OutputModel> getOutputs() {
        return Collections.unmodifiableList(_outputs);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public OutputsModel addOutput(OutputModel output) {
        addChildModel(output);
        _outputs.add(output);
        return this;
    }

}


text:
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "device/fido/cable/fido_cable_discovery.h"

#include <algorithm>
#include <memory>
#include <utility>

#include "base/containers/span.h"
#include "base/run_loop.h"
#include "base/test/task_environment.h"
#include "base/threading/thread_task_runner_handle.h"
#include "build/build_config.h"
#include "device/bluetooth/bluetooth_adapter_factory.h"
#include "device/bluetooth/bluetooth_advertisement.h"
#include "device/bluetooth/test/bluetooth_test.h"
#include "device/bluetooth/test/mock_bluetooth_adapter.h"
#include "device/fido/cable/fido_ble_uuids.h"
#include "device/fido/cable/fido_cable_device.h"
#include "device/fido/cable/fido_cable_handshake_handler.h"
#include "device/fido/fido_parsing_utils.h"
#include "device/fido/mock_fido_discovery_observer.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"

using ::testing::_;
using ::testing::NiceMock;
using ::testing::Sequence;

namespace device {

namespace {

constexpr auto kTestCableVersion = CableDiscoveryData::Version::V1;
#if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_CHROMEOS)
constexpr auto kTestCableVersionNumber = 1;
#endif

// Constants required for discovering and constructing a Cable device that
// are given by the relying party via an extension.
constexpr CableEidArray kClientEid = {{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06,
                                       0x07, 0x08, 0x09, 0x10, 0x11, 0x12, 0x13,
                                       0x14, 0x15}};

constexpr char kUuidFormattedClientEid[] =
    "00010203-0405-0607-0809-101112131415";

constexpr CableEidArray kAuthenticatorEid = {
    {0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
     0x01, 0x01, 0x01, 0x01}};

constexpr CableEidArray kInvalidAuthenticatorEid = {
    {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     0x00, 0x00, 0x00, 0x00}};

constexpr CableSessionPreKeyArray kTestSessionPreKey = {
    {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}};

// TODO(https://crbug.com/837088): Add support for multiple EIDs on Windows.
#if !defined(OS_WIN)
constexpr CableEidArray kSecondaryClientEid = {
    {0x15, 0x14, 0x13, 0x12, 0x11, 0x10, 0x09, 0x08, 0x07, 0x06, 0x05, 0x04,
     0x03, 0x02, 0x01, 0x00}};

constexpr char kUuidFormattedSecondaryClientEid[] =
    "15141312-1110-0908-0706-050403020100";

constexpr CableEidArray kSecondaryAuthenticatorEid = {
    {0xee, 0xee, 0xee, 0xee, 0xee, 0xee, 0xee, 0xee, 0xee, 0xee, 0xee, 0xee,
     0xee, 0xee, 0xee, 0xee}};

constexpr CableSessionPreKeyArray kSecondarySessionPreKey = {
    {0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
     0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
     0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd}};
#endif  // !defined(OS_WIN)

// Below constants are used to construct MockBluetoothDevice for testing.
constexpr char kTestBleDeviceAddress[] = "11:12:13:14:15:16";

constexpr char kTestBleDeviceName[] = "test_cable_device";

std::unique_ptr<MockBluetoothDevice> CreateTestBluetoothDevice() {
  return std::make_unique<testing::NiceMock<MockBluetoothDevice>>(
      nullptr /* adapter */, 0 /* bluetooth_class */, kTestBleDeviceName,
      kTestBleDeviceAddress, true /* paired */, true /* connected */);
}

ACTION_P(ReturnFromAsyncCall, closure) {
  closure.Run();
}

// Matcher to compare the content of advertisement data received from the
// client.
MATCHER_P2(IsAdvertisementContent,
           expected_client_eid,
           expected_uuid_formatted_client_eid,
           "") {
#if defined(OS_MAC)
  const auto uuid_list = arg->service_uuids();
  return std::any_of(uuid_list->begin(), uuid_list->end(),
                     [this](const auto& uuid) {
                       return uuid == expected_uuid_formatted_client_eid;
                     });

#elif defined(OS_WIN)
  const auto manufacturer_data = arg->manufacturer_data();
  const auto manufacturer_data_value = manufacturer_data->find(0x00E0);

  if (manufacturer_data_value == manufacturer_data->end())
    return false;

  const auto& manufacturer_data_payload = manufacturer_data_value->second;
  return manufacturer_data_payload.size() >= 4u &&
         manufacturer_data_payload[0] == manufacturer_data_payload.size() - 1 &&
         manufacturer_data_payload[1] == 0x15 &&  // Manufacturer Data Type
         manufacturer_data_payload[2] == 0x20 &&  // Cable Flags
         manufacturer_data_payload[3] == kTestCableVersionNumber &&
         std::equal(manufacturer_data_payload.begin() + 4,
                    manufacturer_data_payload.end(),
                    expected_client_eid.begin(), expected_client_eid.end());

#elif defined(OS_LINUX) || defined(OS_CHROMEOS)
  const auto service_data = arg->service_data();
  const auto service_data_with_uuid = service_data->find(kGoogleCableUUID128);

  if (service_data_with_uuid == service_data->end())
    return false;

  const auto& service_data_value = service_data_with_uuid->second;
  return (service_data_value[0] >> 5 & 1) &&
         service_data_value[1] == kTestCableVersionNumber &&
         service_data_value.size() == 18u &&
         std::equal(service_data_value.begin() + 2, service_data_value.end(),
                    expected_client_eid.begin(), expected_client_eid.end());

#endif

  return true;
}

class CableMockBluetoothAdvertisement : public BluetoothAdvertisement {
 public:
  MOCK_METHOD2(Unregister,
               void(SuccessCallback success_callback,
                    ErrorCallback error_callback));

  void ExpectUnregisterAndSucceed() {
    EXPECT_CALL(*this, Unregister(_, _))
        .WillOnce(::testing::WithArg<0>(::testing::Invoke([](auto success_cb) {
          base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE,
                                                        std::move(success_cb));
        })));
  }

 private:
  ~CableMockBluetoothAdvertisement() override = default;
};

// Mock BLE adapter that abstracts out authenticator logic with the following
// logic:
//  - Responds to BluetoothAdapter::RegisterAdvertisement() by always invoking
//    success callback.
//  - Responds to BluetoothAdapter::StartDiscoverySessionWithFilter() by
//    invoking BluetoothAdapter::Observer::DeviceAdded() on a test bluetooth
//    device that includes service data containing authenticator EID.
class CableMockAdapter : public MockBluetoothAdapter {
 public:
  static scoped_refptr<CableMockAdapter> MakePoweredOn() {
    auto mock_adapter =
        base::MakeRefCounted<::testing::NiceMock<CableMockAdapter>>();
    EXPECT_CALL(*mock_adapter, IsPresent())
        .WillRepeatedly(::testing::Return(true));
    EXPECT_CALL(*mock_adapter, IsPowered())
        .WillRepeatedly(::testing::Return(true));
    return mock_adapter;
  }
  static scoped_refptr<CableMockAdapter> MakePoweredOff() {
    auto mock_adapter =
        base::MakeRefCounted<::testing::NiceMock<CableMockAdapter>>();
    EXPECT_CALL(*mock_adapter, IsPresent())
        .WillRepeatedly(::testing::Return(true));
    EXPECT_CALL(*mock_adapter, IsPowered())
        .WillRepeatedly(::testing::Return(false));
    return mock_adapter;
  }
  static scoped_refptr<CableMockAdapter> MakeNotPresent() {
    auto mock_adapter =
        base::MakeRefCounted<::testing::NiceMock<CableMockAdapter>>();
    EXPECT_CALL(*mock_adapter, IsPresent())
        .WillRepeatedly(::testing::Return(false));
    return mock_adapter;
  }

  MOCK_METHOD3(RegisterAdvertisement,
               void(std::unique_ptr<BluetoothAdvertisement::Data>,
                    CreateAdvertisementCallback,
                    AdvertisementErrorCallback));

  void AddNewTestBluetoothDevice(
      base::span<const uint8_t, kCableEphemeralIdSize> authenticator_eid) {
    auto mock_device = CreateTestBluetoothDevice();

    std::vector<uint8_t> service_data(18);
    service_data[0] = 1 << 5;
    std::copy(authenticator_eid.begin(), authenticator_eid.end(),
              service_data.begin() + 2);
    BluetoothDevice::ServiceDataMap service_data_map;
    service_data_map.emplace(kGoogleCableUUID128, std::move(service_data));

    mock_device->UpdateAdvertisementData(
        1 /* rssi */, absl::nullopt /* flags */, BluetoothDevice::UUIDList(),
        absl::nullopt /* tx_power */, std::move(service_data_map),
        BluetoothDevice::ManufacturerDataMap());

    auto* mock_device_ptr = mock_device.get();
    AddMockDevice(std::move(mock_device));

    for (auto& observer : GetObservers())
      observer.DeviceAdded(this, mock_device_ptr);
  }

  void AddNewTestAppleBluetoothDevice(
      base::span<const uint8_t, kCableEphemeralIdSize> authenticator_eid) {
    auto mock_device = CreateTestBluetoothDevice();
    // Apple doesn't allow advertising service data, so we advertise a 16 bit
    // UUID plus the EID converted into 128 bit UUID.
    mock_device->AddUUID(BluetoothUUID("fde2"));
    mock_device->AddUUID(BluetoothUUID(
        fido_parsing_utils::ConvertBytesToUuid(authenticator_eid)));

    auto* mock_device_ptr = mock_device.get();
    AddMockDevice(std::move(mock_device));

    for (auto& observer : GetObservers())
      observer.DeviceAdded(this, mock_device_ptr);
  }

  void ExpectRegisterAdvertisementWithResponse(
      bool simulate_success,
      base::span<const uint8_t> expected_client_eid,
      base::StringPiece expected_uuid_formatted_client_eid,
      Sequence sequence = Sequence(),
      scoped_refptr<CableMockBluetoothAdvertisement> advertisement = nullptr) {
    if (!advertisement) {
      advertisement = base::MakeRefCounted<CableMockBluetoothAdvertisement>();
      EXPECT_CALL(*advertisement, Unregister(_, _))
          .WillRepeatedly(::testing::WithArg<0>(
              [](auto callback) { std::move(callback).Run(); }));
    }

    EXPECT_CALL(*this,
                RegisterAdvertisement(
                    IsAdvertisementContent(expected_client_eid,
                                           expected_uuid_formatted_client_eid),
                    _, _))
        .InSequence(sequence)
        .WillOnce(::testing::WithArgs<1, 2>(
            [simulate_success, advertisement](auto success_callback,
                                              auto failure_callback) {
              simulate_success ? std::move(success_callback).Run(advertisement)
                               : std::move(failure_callback)
                                     .Run(BluetoothAdvertisement::ErrorCode::
                                              INVALID_ADVERTISEMENT_ERROR_CODE);
            }));
  }

  void ExpectDiscoveryWithScanCallback() {
    EXPECT_CALL(*this, StartScanWithFilter_(_, _))
        .WillOnce(::testing::WithArg<1>([](auto& callback) {
          std::move(callback).Run(
              false, device::UMABluetoothDiscoverySessionOutcome::SUCCESS);
        }));
  }

  void ExpectDiscoveryWithScanCallback(
      base::span<const uint8_t, kCableEphemeralIdSize> eid,
      bool is_apple_device = false) {
    EXPECT_CALL(*this, StartScanWithFilter_(_, _))
        .WillOnce(
            ::testing::WithArg<1>([this, eid, is_apple_device](auto& callback) {
              std::move(callback).Run(
                  false, device::UMABluetoothDiscoverySessionOutcome::SUCCESS);
              if (is_apple_device) {
                AddNewTestAppleBluetoothDevice(eid);
              } else {
                AddNewTestBluetoothDevice(eid);
              }
            }));
  }

 protected:
  ~CableMockAdapter() override = default;
};

class FakeHandshakeHandler : public FidoCableV1HandshakeHandler {
 public:
  FakeHandshakeHandler(FidoCableDevice* device,
                       base::span<const uint8_t, 8> nonce,
                       base::span<const uint8_t, 32> session_pre_key)
      : FidoCableV1HandshakeHandler(device, nonce, session_pre_key) {}
  ~FakeHandshakeHandler() override = default;

  void InitiateCableHandshake(FidoDevice::DeviceCallback callback) override {
    std::move(callback).Run(std::vector<uint8_t>());
  }

  bool ValidateAuthenticatorHandshakeMessage(
      base::span<const uint8_t> response) override {
    return true;
  }
};

// Fake discovery that encapsulates exactly the same behavior as
// FidoCableDiscovery except that it uses FakeHandshakeHandler instead of
// FidoHandshakeHandler to conduct handshake with the authenticator.
class FakeFidoCableDiscovery : public FidoCableDiscovery {
 public:
  explicit FakeFidoCableDiscovery(
      std::vector<CableDiscoveryData> discovery_data)
      : FidoCableDiscovery(std::move(discovery_data)) {}
  ~FakeFidoCableDiscovery() override = default;

 private:
  std::unique_ptr<FidoCableHandshakeHandler> CreateV1HandshakeHandler(
      FidoCableDevice* device,
      const CableDiscoveryData& discovery_data,
      const CableEidArray& eid) override {
    // Nonce is embedded as first 8 bytes of client EID.
    std::array<uint8_t, 8> nonce;
    CHECK(fido_parsing_utils::ExtractArray(eid, 0, &nonce));
    return std::make_unique<FakeHandshakeHandler>(
        device, nonce, discovery_data.v1->session_pre_key);
  }
};

}  // namespace

class FidoCableDiscoveryTest : public ::testing::Test {
 public:
  std::unique_ptr<FidoCableDiscovery> CreateDiscovery() {
    std::vector<CableDiscoveryData> discovery_data;
    discovery_data.emplace_back(kTestCableVersion, kClientEid,
                                kAuthenticatorEid, kTestSessionPreKey);
    return std::make_unique<FakeFidoCableDiscovery>(std::move(discovery_data));
  }

  base::test::TaskEnvironment task_environment_{
      base::test::TaskEnvironment::TimeSource::MOCK_TIME};
};

// Tests discovery without a BLE adapter.
TEST_F(FidoCableDiscoveryTest, TestDiscoveryFails) {
  auto cable_discovery = CreateDiscovery();
  NiceMock<MockFidoDiscoveryObserver> mock_observer;
  EXPECT_CALL(mock_observer,
              DiscoveryStarted(cable_discovery.get(), false,
                               std::vector<FidoAuthenticator*>()));
  EXPECT_CALL(mock_observer, AuthenticatorAdded(_, _)).Times(0);
  cable_discovery->set_observer(&mock_observer);

  auto mock_adapter = CableMockAdapter::MakeNotPresent();
  BluetoothAdapterFactory::SetAdapterForTesting(mock_adapter);
  cable_discovery->Start();
  task_environment_.FastForwardUntilNoTasksRemain();
}

// Tests discovery with a powered-off BLE adapter.  Not calling
// DiscoveryStarted() in the case of a present-but-unpowered adapter leads to a
// deadlock between the discovery and the UI (see crbug.com/1018416).
TEST_F(FidoCableDiscoveryTest, TestDiscoveryStartedWithUnpoweredAdapter) {
  auto cable_discovery = CreateDiscovery();
  NiceMock<MockFidoDiscoveryObserver> mock_observer;
  EXPECT_CALL(mock_observer,
              DiscoveryStarted(cable_discovery.get(), true,
                               std::vector<FidoAuthenticator*>()));
  EXPECT_CALL(mock_observer, AuthenticatorAdded(_, _)).Times(0);
  cable_discovery->set_observer(&mock_observer);

  auto mock_adapter = CableMockAdapter::MakePoweredOff();
  BluetoothAdapterFactory::SetAdapterForTesting(mock_adapter);
  cable_discovery->Start();
  task_environment_.FastForwardUntilNoTasksRemain();
}

// Tests regular successful discovery flow for Cable device.
TEST_F(FidoCableDiscoveryTest, TestDiscoveryFindsNewDevice) {
  auto cable_discovery = CreateDiscovery();
  NiceMock<MockFidoDiscoveryObserver> mock_observer;
  EXPECT_CALL(mock_observer,
              DiscoveryStarted(cable_discovery.get(), true,
                               std::vector<FidoAuthenticator*>()));
  EXPECT_CALL(mock_observer, AuthenticatorAdded(_, _));
  cable_discovery->set_observer(&mock_observer);

  auto mock_adapter = CableMockAdapter::MakePoweredOn();
  mock_adapter->ExpectDiscoveryWithScanCallback(kAuthenticatorEid);
  mock_adapter->ExpectRegisterAdvertisementWithResponse(
      true /* simulate_success */, kClientEid, kUuidFormattedClientEid);

  BluetoothAdapterFactory::SetAdapterForTesting(mock_adapter);
  cable_discovery->Start();
  task_environment_.FastForwardUntilNoTasksRemain();
}

// Tests successful discovery flow for Apple Cable device.
TEST_F(FidoCableDiscoveryTest, TestDiscoveryFindsNewAppleDevice) {
  auto cable_discovery = CreateDiscovery();
  NiceMock<MockFidoDiscoveryObserver> mock_observer;
  EXPECT_CALL(mock_observer,
              DiscoveryStarted(cable_discovery.get(), true,
                               std::vector<FidoAuthenticator*>()));
  EXPECT_CALL(mock_observer, AuthenticatorAdded(_, _));
  cable_discovery->set_observer(&mock_observer);

  auto mock_adapter = CableMockAdapter::MakePoweredOn();
  mock_adapter->ExpectDiscoveryWithScanCallback(kAuthenticatorEid, true);
  mock_adapter->ExpectRegisterAdvertisementWithResponse(
      true /* simulate_success */, kClientEid, kUuidFormattedClientEid);

  BluetoothAdapterFactory::SetAdapterForTesting(mock_adapter);
  cable_discovery->Start();
  task_environment_.FastForwardUntilNoTasksRemain();
}

// Tests a scenario where upon broadcasting advertisement and scanning, client
// discovers a device with an incorrect authenticator EID. Observer::AddDevice()
// must not be called.
TEST_F(FidoCableDiscoveryTest, TestDiscoveryFindsIncorrectDevice) {
  auto cable_discovery = CreateDiscovery();
  NiceMock<MockFidoDiscoveryObserver> mock_observer;
  EXPECT_CALL(mock_observer, AuthenticatorAdded(_, _)).Times(0);
  EXPECT_CALL(mock_observer, DiscoveryStarted(cable_discovery.get(), true,
                                              testing::IsEmpty()));
  cable_discovery->set_observer(&mock_observer);

  auto mock_adapter = CableMockAdapter::MakePoweredOn();
  mock_adapter->ExpectRegisterAdvertisementWithResponse(
      true /* simulate_success */, kClientEid, kUuidFormattedClientEid);
  mock_adapter->ExpectDiscoveryWithScanCallback(kInvalidAuthenticatorEid);

  BluetoothAdapterFactory::SetAdapterForTesting(mock_adapter);
  cable_discovery->Start();
  task_environment_.FastForwardUntilNoTasksRemain();
}

// Windows currently does not support multiple EIDs, so the following tests are
// not applicable.
// TODO(https://crbug.com/837088): Support multiple EIDs on Windows and enable
// these tests.
#if !defined(OS_WIN)
// Tests Cable discovery flow when multiple(2) sets of client/authenticator EIDs
// are passed on from the relying party. We should expect 2 invocations of
// BluetoothAdapter::RegisterAdvertisement().
TEST_F(FidoCableDiscoveryTest, TestDiscoveryWithMultipleEids) {
  std::vector<CableDiscoveryData> discovery_data;
  discovery_data.emplace_back(kTestCableVersion, kClientEid, kAuthenticatorEid,
                              kTestSessionPreKey);
  discovery_data.emplace_back(kTestCableVersion, kSecondaryClientEid,
                              kSecondaryAuthenticatorEid,
                              kSecondarySessionPreKey);
  auto cable_discovery =
      std::make_unique<FakeFidoCableDiscovery>(std::move(discovery_data));
  auto mock_adapter = CableMockAdapter::MakePoweredOn();
  mock_adapter->ExpectDiscoveryWithScanCallback(kAuthenticatorEid);

  NiceMock<MockFidoDiscoveryObserver> mock_observer;
  EXPECT_CALL(mock_observer,
              DiscoveryStarted(cable_discovery.get(), true,
                               std::vector<FidoAuthenticator*>()));
  EXPECT_CALL(mock_observer, AuthenticatorAdded(_, _));
  cable_discovery->set_observer(&mock_observer);

  Sequence sequence;
  mock_adapter->ExpectRegisterAdvertisementWithResponse(
      true /* simulate_success */, kClientEid, kUuidFormattedClientEid,
      sequence);
  mock_adapter->ExpectRegisterAdvertisementWithResponse(
      true /* simulate_success */, kSecondaryClientEid,
      kUuidFormattedSecondaryClientEid, sequence);

  BluetoothAdapterFactory::SetAdapterForTesting(mock_adapter);
  cable_discovery->Start();
  task_environment_.FastForwardUntilNoTasksRemain();
}

// Tests a scenario where only one of the two client EID's are advertised
// successfully. Since at least one advertisement are successfully processed,
// scanning process should be invoked.
TEST_F(FidoCableDiscoveryTest, TestDiscoveryWithPartialAdvertisementSuccess) {
  std::vector<CableDiscoveryData> discovery_data;
  discovery_data.emplace_back(kTestCableVersion, kClientEid, kAuthenticatorEid,
                              kTestSessionPreKey);
  discovery_data.emplace_back(kTestCableVersion, kSecondaryClientEid,
                              kSecondaryAuthenticatorEid,
                              kSecondarySessionPreKey);
  auto cable_discovery =
      std::make_unique<FakeFidoCableDiscovery>(std::move(discovery_data));
  NiceMock<MockFidoDiscoveryObserver> mock_observer;
  EXPECT_CALL(mock_observer,
              DiscoveryStarted(cable_discovery.get(), true,
                               std::vector<FidoAuthenticator*>()));
  EXPECT_CALL(mock_observer, AuthenticatorAdded(_, _));
  cable_discovery->set_observer(&mock_observer);

  auto mock_adapter = CableMockAdapter::MakePoweredOn();
  Sequence sequence;
  mock_adapter->ExpectRegisterAdvertisementWithResponse(
      true /* simulate_success */, kClientEid, kUuidFormattedClientEid,
      sequence);
  mock_adapter->ExpectRegisterAdvertisementWithResponse(
      false /* simulate_success */, kSecondaryClientEid,
      kUuidFormattedSecondaryClientEid, sequence);
  mock_adapter->ExpectDiscoveryWithScanCallback(kAuthenticatorEid);

  BluetoothAdapterFactory::SetAdapterForTesting(mock_adapter);
  cable_discovery->Start();
  task_environment_.FastForwardUntilNoTasksRemain();
}

// Test the scenario when all advertisement for client EID's fails.
TEST_F(FidoCableDiscoveryTest, TestDiscoveryWithAdvertisementFailures) {
  std::vector<CableDiscoveryData> discovery_data;
  discovery_data.emplace_back(kTestCableVersion, kClientEid, kAuthenticatorEid,
                              kTestSessionPreKey);
  discovery_data.emplace_back(kTestCableVersion, kSecondaryClientEid,
                              kSecondaryAuthenticatorEid,
                              kSecondarySessionPreKey);
  auto cable_discovery =
      std::make_unique<FakeFidoCableDiscovery>(std::move(discovery_data));

  NiceMock<MockFidoDiscoveryObserver> mock_observer;
  EXPECT_CALL(mock_observer, AuthenticatorAdded(_, _)).Times(0);
  EXPECT_CALL(mock_observer, DiscoveryStarted(cable_discovery.get(), true,
                                              testing::IsEmpty()));
  cable_discovery->set_observer(&mock_observer);

  auto mock_adapter = CableMockAdapter::MakePoweredOn();
  Sequence sequence;
  mock_adapter->ExpectRegisterAdvertisementWithResponse(
      false /* simulate_success */, kClientEid, kUuidFormattedClientEid,
      sequence);
  mock_adapter->ExpectRegisterAdvertisementWithResponse(
      false /* simulate_success */, kSecondaryClientEid,
      kUuidFormattedSecondaryClientEid, sequence);
  mock_adapter->ExpectDiscoveryWithScanCallback();

  BluetoothAdapterFactory::SetAdapterForTesting(mock_adapter);
  cable_discovery->Start();
  task_environment_.FastForwardUntilNoTasksRemain();
  EXPECT_TRUE(cable_discovery->AdvertisementsForTesting().empty());
}
#endif  // !defined(OS_WIN)

TEST_F(FidoCableDiscoveryTest, TestUnregisterAdvertisementUponDestruction) {
  auto cable_discovery = CreateDiscovery();
  auto advertisement = base::MakeRefCounted<CableMockBluetoothAdvertisement>();
  advertisement->ExpectUnregisterAndSucceed();

  auto mock_adapter = CableMockAdapter::MakePoweredOn();
  mock_adapter->ExpectDiscoveryWithScanCallback();
  mock_adapter->ExpectRegisterAdvertisementWithResponse(
      true /* simulate_success */, kClientEid, kUuidFormattedClientEid,
      Sequence(), std::move(advertisement));

  BluetoothAdapterFactory::SetAdapterForTesting(mock_adapter);
  cable_discovery->Start();
  task_environment_.FastForwardUntilNoTasksRemain();

  EXPECT_EQ(1u, cable_discovery->AdvertisementsForTesting().size());
  cable_discovery.reset();
}

TEST_F(FidoCableDiscoveryTest, TestUnregisterAdvertisementUponStop) {
  auto cable_discovery = CreateDiscovery();
  auto advertisement = base::MakeRefCounted<CableMockBluetoothAdvertisement>();
  advertisement->ExpectUnregisterAndSucceed();

  auto mock_adapter = CableMockAdapter::MakePoweredOn();
  mock_adapter->ExpectDiscoveryWithScanCallback();
  mock_adapter->ExpectRegisterAdvertisementWithResponse(
      true /* simulate_success */, kClientEid, kUuidFormattedClientEid,
      Sequence(), std::move(advertisement));

  BluetoothAdapterFactory::SetAdapterForTesting(mock_adapter);
  cable_discovery->Start();
  task_environment_.FastForwardUntilNoTasksRemain();
  EXPECT_EQ(1u, cable_discovery->AdvertisementsForTesting().size());

  EXPECT_TRUE(cable_discovery->MaybeStop());
  task_environment_.FastForwardUntilNoTasksRemain();
  EXPECT_EQ(0u, cable_discovery->AdvertisementsForTesting().size());
}

TEST_F(FidoCableDiscoveryTest, TestStopWithNoAdvertisementsSucceeds) {
  auto mock_adapter = CableMockAdapter::MakePoweredOff();
  BluetoothAdapterFactory::SetAdapterForTesting(mock_adapter);

  auto cable_discovery = CreateDiscovery();
  NiceMock<MockFidoDiscoveryObserver> mock_observer;
  EXPECT_CALL(mock_observer,
              DiscoveryStarted(cable_discovery.get(), true,
                               std::vector<FidoAuthenticator*>()));
  cable_discovery->set_observer(&mock_observer);
  cable_discovery->Start();
  task_environment_.FastForwardUntilNoTasksRemain();

  EXPECT_EQ(0u, cable_discovery->AdvertisementsForTesting().size());
  EXPECT_TRUE(cable_discovery->MaybeStop());
}

// Tests that cable discovery resumes after Bluetooth adapter is powered on.
TEST_F(FidoCableDiscoveryTest, TestResumeDiscoveryAfterPoweredOn) {
  auto cable_discovery = CreateDiscovery();
  NiceMock<MockFidoDiscoveryObserver> mock_observer;
  EXPECT_CALL(mock_observer,
              DiscoveryStarted(cable_discovery.get(), true,
                               std::vector<FidoAuthenticator*>()));
  EXPECT_CALL(mock_observer, AuthenticatorAdded(_, _));
  cable_discovery->set_observer(&mock_observer);

  auto mock_adapter =
      base::MakeRefCounted<::testing::NiceMock<CableMockAdapter>>();
  EXPECT_CALL(*mock_adapter, IsPresent())
      .WillRepeatedly(::testing::Return(true));

  // After BluetoothAdapter is powered on, we expect that Cable discovery starts
  // again.
  mock_adapter->ExpectDiscoveryWithScanCallback(kAuthenticatorEid);
  mock_adapter->ExpectRegisterAdvertisementWithResponse(
      true /* simulate_success */, kClientEid, kUuidFormattedClientEid);

  // Wait until error callback for SetPowered() is invoked. Then, simulate
  // Bluetooth adapter power change by invoking
  // MockBluetoothAdapter::NotifyAdapterPoweredChanged().
  {
    base::RunLoop run_loop;
    auto quit = run_loop.QuitClosure();
    EXPECT_CALL(*mock_adapter, IsPowered)
        .WillRepeatedly(::testing::DoAll(ReturnFromAsyncCall(quit),
                                         ::testing::Return(false)));

    BluetoothAdapterFactory::SetAdapterForTesting(mock_adapter);
    cable_discovery->Start();
    run_loop.Run();
  }

  mock_adapter->NotifyAdapterPoweredChanged(true);
  task_environment_.FastForwardUntilNoTasksRemain();
}

}  // namespace device


text:
class CRagdollManager : public CBaseEntity
{
public:
	DECLARE_CLASS( CRagdollManager, CBaseEntity );
	DECLARE_SERVERCLASS();
	DECLARE_DATADESC();

	CRagdollManager();

	virtual void	Activate();
	virtual int		UpdateTransmitState();

	void InputSetMaxRagdollCount(inputdata_t &data);

	int DrawDebugTextOverlays(void);

public:

	void UpdateCurrentMaxRagDollCount();

	CNetworkVar( int,  m_iCurrentMaxRagdollCount );

	int m_iMaxRagdollCount;

	bool m_bSaveImportant;
};

IMPLEMENT_SERVERCLASS_ST_NOBASE( CRagdollManager, DT_RagdollManager )
	SendPropInt( SENDINFO( m_iCurrentMaxRagdollCount ), 6 ),
END_SEND_TABLE()

LINK_ENTITY_TO_CLASS( game_ragdoll_manager, CRagdollManager );

BEGIN_DATADESC( CRagdollManager )

	DEFINE_FIELD( m_iCurrentMaxRagdollCount, FIELD_INTEGER ),
	DEFINE_KEYFIELD( m_iMaxRagdollCount, FIELD_INTEGER,	"MaxRagdollCount" ),

	DEFINE_KEYFIELD( m_bSaveImportant, FIELD_BOOLEAN, "SaveImportant" ),

	DEFINE_INPUTFUNC( FIELD_INTEGER, "SetMaxRagdollCount",  InputSetMaxRagdollCount ),

END_DATADESC()

//-----------------------------------------------------------------------------
// Constructor
//-----------------------------------------------------------------------------
CRagdollManager::CRagdollManager( void )
{
	m_iMaxRagdollCount = -1;
	m_iCurrentMaxRagdollCount = -1;
}

//-----------------------------------------------------------------------------
// Purpose:
// Input  : *pInfo -
// Output : int
//-----------------------------------------------------------------------------
int CRagdollManager::UpdateTransmitState()
{
	return SetTransmitState( FL_EDICT_ALWAYS );
}

//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CRagdollManager::Activate()
{
	BaseClass::Activate();
	UpdateCurrentMaxRagDollCount();
}

//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
void CRagdollManager::UpdateCurrentMaxRagDollCount()
{
	m_iCurrentMaxRagdollCount = m_iMaxRagdollCount;
	s_RagdollLRU.SetMaxRagdollCount( m_iCurrentMaxRagdollCount );
}

//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
void CRagdollManager::InputSetMaxRagdollCount(inputdata_t &inputdata)
{
	m_iMaxRagdollCount = inputdata.value.Int();
	UpdateCurrentMaxRagDollCount();
}

//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
bool RagdollManager_SaveImportant( CAI_BaseNPC *pNPC )
{
#ifdef HL2_DLL
	CRagdollManager *pEnt =	(CRagdollManager *)gEntList.FindEntityByClassname( NULL, "game_ragdoll_manager" );

	if ( pEnt == NULL )
		return false;

	if ( pEnt->m_bSaveImportant )
	{
		if ( pNPC->Classify() == CLASS_PLAYER_ALLY || pNPC->Classify() == CLASS_PLAYER_ALLY_VITAL )
		{
			return true;
		}
	}
#endif

	return false;
}

//-----------------------------------------------------------------------------
// Purpose: Draw any debug text overlays
// Output : Current text offset from the top
//-----------------------------------------------------------------------------
int CRagdollManager::DrawDebugTextOverlays( void )
{
	int text_offset = BaseClass::DrawDebugTextOverlays();

	if (m_debugOverlays & OVERLAY_TEXT_BIT)
	{
		char tempstr[512];

		// print max ragdoll count
		Q_snprintf(tempstr,sizeof(tempstr),"max ragdoll count: %d", m_iCurrentMaxRagdollCount.Get());
		EntityText(text_offset,tempstr,0);
		text_offset++;
	}
	return text_offset;
}


text:
/*
 * This file is part of Nucleus, licensed under the MIT License (MIT). See the LICENSE.txt file
 * at the root of this project for more details.
 */
package io.github.nucleuspowered.nucleus.internal.docgen;

import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.reflect.TypeToken;
import io.github.nucleuspowered.nucleus.Nucleus;
import io.github.nucleuspowered.nucleus.configurate.ConfigurateHelper;
import io.github.nucleuspowered.nucleus.internal.annotations.Since;
import io.github.nucleuspowered.nucleus.internal.annotations.command.NoCooldown;
import io.github.nucleuspowered.nucleus.internal.annotations.command.NoCost;
import io.github.nucleuspowered.nucleus.internal.annotations.command.NoDocumentation;
import io.github.nucleuspowered.nucleus.internal.annotations.command.NoModifiers;
import io.github.nucleuspowered.nucleus.internal.annotations.command.NoPermissions;
import io.github.nucleuspowered.nucleus.internal.annotations.command.NoWarmup;
import io.github.nucleuspowered.nucleus.internal.annotations.command.Permissions;
import io.github.nucleuspowered.nucleus.internal.command.AbstractCommand;
import io.github.nucleuspowered.nucleus.internal.docgen.annotations.EssentialsEquivalent;
import io.github.nucleuspowered.nucleus.internal.permissions.PermissionInformation;
import io.github.nucleuspowered.nucleus.internal.permissions.SuggestedLevel;
import io.github.nucleuspowered.nucleus.internal.qsml.NucleusConfigAdapter;
import io.github.nucleuspowered.nucleus.internal.qsml.module.ConfigurableModule;
import ninja.leaping.configurate.ConfigurationNode;
import ninja.leaping.configurate.ConfigurationOptions;
import ninja.leaping.configurate.commented.CommentedConfigurationNode;
import ninja.leaping.configurate.hocon.HoconConfigurationLoader;
import ninja.leaping.configurate.objectmapping.ObjectMappingException;
import org.spongepowered.api.Sponge;
import org.spongepowered.api.text.Text;
import uk.co.drnaylor.quickstart.config.AbstractConfigAdapter;

import java.io.BufferedWriter;
import java.io.StringWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;

public class DocGenCache {

    private final List<CommandDoc> commandDocs = Lists.newArrayList();
    private final Map<String, PermissionDoc> permissionDocs = Maps.newHashMap();
    private final List<TokenDoc> tokenDocs = Lists.newArrayList();
    private final List<EssentialsDoc> essentialsDocs = Lists.newArrayList();
    private final Map<String, String> configDocs = Maps.newHashMap();

    private final org.slf4j.Logger logger;

    public DocGenCache(org.slf4j.Logger logger) {
        this.logger = logger;
    }

    public List<CommandDoc> getCommandDocs() {
        return this.commandDocs;
    }

    public Collection<PermissionDoc> getPermissionDocs() {
        return this.permissionDocs.values();
    }

    public List<TokenDoc> getTokenDocs() {
        return this.tokenDocs;
    }

    public List<EssentialsDoc> getEssentialsDocs() {
        return this.essentialsDocs;
    }

    public Map<String, String> getConfigDocs() {
        return this.configDocs;
    }

    public void addConfigurableModule(String name, ConfigurableModule<?> module) {
        try (StringWriter sw = new StringWriter(); BufferedWriter writer = new BufferedWriter(sw)) {
            HoconConfigurationLoader hcl = HoconConfigurationLoader.builder()
                    .setDefaultOptions(ConfigurateHelper.setOptions(ConfigurationOptions.defaults()))
                    .setSink(() -> writer)
                    .build();
            CommentedConfigurationNode cn = hcl.createEmptyNode(ConfigurateHelper.setOptions(hcl.getDefaultOptions()));
            AbstractConfigAdapter<?> aca = module.getConfigAdapter().get();
            if (aca instanceof NucleusConfigAdapter.StandardWithSimpleDefault) {
                NucleusConfigAdapter.StandardWithSimpleDefault<?> nca = (NucleusConfigAdapter.StandardWithSimpleDefault<?>) aca;
                Object o = nca.getDefaultObject();
                applyToNode(o.getClass(), o, cn);
            } else {
                cn.setValue(module.getConfigAdapter().get().getDefaults());
            }

            hcl.save(cn);
            this.configDocs.put(name, sw.toString());
        } catch (Exception e) {
            e.printStackTrace();
        }

    }

    private <T> void applyToNode(Class<T> c, Object object, ConfigurationNode node) {
        try {
            node.setValue(TypeToken.of(c), c.cast(object));
        } catch (ObjectMappingException e) {
            e.printStackTrace();
        }
    }

    public void addCommand(final String moduleID, final AbstractCommand<?> abstractCommand) {
        if (abstractCommand.getClass().isAnnotationPresent(NoDocumentation.class)) {
            return;
        }

        CommandDoc cmd = new CommandDoc();

        String cmdPath = abstractCommand.getCommandPath().replaceAll("\\.", " ");
        cmd.setCommandName(cmdPath);

        cmd.setAliases(String.join(", ", Lists.newArrayList(abstractCommand.getAliases())));

        if (abstractCommand.getRootCommandAliases().length > 0) {
            cmd.setRootAliases(String.join(", ", Arrays.asList(abstractCommand.getRootCommandAliases())));
        }

        cmd.setPermissionbase(abstractCommand.getPermissionHandler().getBase());

        Class<? extends AbstractCommand> cac = abstractCommand.getClass();
        Permissions s = cac.getAnnotation(Permissions.class);
        if (s == null) {
            cmd.setDefaultLevel(cac.isAnnotationPresent(NoPermissions.class) ? SuggestedLevel.USER.name() : SuggestedLevel.ADMIN.name());
        } else {
            cmd.setDefaultLevel(s.suggestedLevel().name());
        }

        cmd.setModule(moduleID);
        if (!cac.isAnnotationPresent(NoModifiers.class)) {
            cmd.setCooldown(!cac.isAnnotationPresent(NoCooldown.class));
            cmd.setCost(!cac.isAnnotationPresent(NoCost.class));
            cmd.setWarmup(!cac.isAnnotationPresent(NoWarmup.class));
        }
        cmd.setSince(cac.getAnnotation(Since.class));

        String desc = abstractCommand.getDescription();
        if (!desc.contains(" ")) {
            this.logger.warn("Cannot generate description for: " + abstractCommand.getCommandPath() + ": " + desc);
        }
        cmd.setOneLineDescription(desc);

        String extendedDescription = abstractCommand.getExtendedDescription().replace("\n", "|br|").replace("\"", """);
        if (!extendedDescription.isEmpty()) {
            cmd.setExtendedDescription(extendedDescription);
        }

        List<PermissionDoc> lp = new ArrayList<>();
        abstractCommand.getPermissionHandler().getSuggestedPermissions().forEach((k, v) -> lp.add(addPermissionDocs(moduleID, k, v)));

        cmd.setPermissions(lp);
        cmd.setUsageString(abstractCommand.getUsageString(Sponge.getServer().getConsole()));
        cmd.setSubcommands(abstractCommand.getChildrenUsage(Sponge.getServer().getConsole()).map(Text::toPlain).orElse(""));
        cmd.setSimpleUsage(abstractCommand.getSimpleUsage(Sponge.getServer().getConsole()));

        // Essentials
        EssentialsEquivalent ee = abstractCommand.getClass().getAnnotation(EssentialsEquivalent.class);
        if (ee != null) {
            List<String> ss = Arrays.asList(ee.value());
            cmd.setEssentialsEquivalents(ss);
            cmd.setEssNotes(ee.notes());
            cmd.setExactEssEquiv(ee.isExact());

            EssentialsDoc doc = new EssentialsDoc();
            doc.setEssentialsCommands(ss);

            int i = cmdPath.lastIndexOf(" ");
            String c;
            if (i > -1) {
                c = cmdPath.substring(0, i) + " ";
            } else {
                c = "";
            }

            List<String> a = Lists.newArrayList(abstractCommand.getAliases()).stream().map(x -> c + x).collect(Collectors.toList());
            if (abstractCommand.getRootCommandAliases().length > 0) {
                a.addAll(Arrays.asList(abstractCommand.getRootCommandAliases()));
            }

            doc.setNucleusEquiv(a);
            doc.setExact(ee.isExact());
            doc.setNotes(ee.notes());
            this.essentialsDocs.add(doc);
        }

        this.commandDocs.add(cmd);
    }

    public void addPermissionDocs(final String moduleID, Map<String, PermissionInformation> msp) {
        msp.forEach((k, v) -> addPermissionDocs(moduleID, k, v));
    }

    private PermissionDoc addPermissionDocs(final String moduleID, String k, PermissionInformation v) {
        PermissionDoc pd;
        if (!this.permissionDocs.containsKey(k)) {
            pd = getPermissionFrom(moduleID, k, v);
            this.permissionDocs.put(k, pd);
        } else {
            pd = this.permissionDocs.get(k);
            if (!pd.getDescription().contains(v.plainDescription)) {
                pd.setDescription(pd.getDescription().replaceAll("\\.$", "") + ", " + v.plainDescription);
            }
        }

        return pd;
    }

    public void addTokenDocs(Set<String> tokens) {
        tokens.forEach(x -> Nucleus.getNucleus().getMessageProvider().getMessageFromKey("nucleus.token." + x.toLowerCase()).ifPresent(y ->
                this.tokenDocs.add(new TokenDoc().setName(x.toLowerCase()).setDescription(y))
        ));
    }

    private PermissionDoc getPermissionFrom(String module, String k, PermissionInformation v) {
        PermissionDoc perm = new PermissionDoc();
        perm.setModule(module);
        perm.setDescription(v.plainDescription);
        perm.setPermission(k);
        perm.setDefaultLevel(v.level.name());
        perm.setOre(v.isOre).setNormal(v.isNormal);
        return perm;
    }
}


text:
var fs = require('fs')
var path = require('path')

function atomGetStorageFolder () {
  if (atom.getStorageFolder != null) {
    return atom.getStorageFolder()
  } else {
    if (atom.storageFolder != null) return atom.storageFolder

    var baseModulePath = path.dirname(path.dirname(require.resolve('atom')))
    var StorageFolder = require(baseModulePath + '/src/storage-folder')
    atom.storageFolder = new StorageFolder(atom.getConfigDirPath())

    return atom.storageFolder
  }
}

exports.getStorageFolder = atomGetStorageFolder

function saveCurrentState () {
  var paths = atom.project.getPaths()

  // Compute state key from path set
  var key = atom.getStateKey(paths)
  if (!key) return Promise.resolve(null)

  // Serialize state
  var state = atomSerialize()

  if (atom.stateStore != null) {
    // Atom 1.7+
    return atom.stateStore.save(key, state)
  } else {
    // Atom 1.5 to 1.6
    var store = atomGetStorageFolder()
    var keypath = store.pathForKey(key)
    return new Promise((resolve, reject) => {
      fs.writeFile(keypath, JSON.stringify(state), 'utf8', (err) => {
        if (err) return reject(err)
        resolve()
      })
    })
  }
}

// shim atom.packages.serialize in <= 1.6
function packageStatesSerialize () {
  if (atom.packages.serialize != null) {
    return atom.packages.serialize()
  }

  atom.packages.getActivePackages().forEach((pack) => {
    var state
    if (pack.serialize != null) state = pack.serialize()
    if (state) {
      atom.packages.setPackageState(pack.name, state)
    }
  })

  return atom.packages.packageStates
}

// shim atom.serialize in <= 1.6
function atomSerialize () {
  var options = {isUnloading: true}
  if (atom.serialize != null) return atom.serialize(options)

  // Atom <= 1.6
  return {
    version: atom.constructor.version,
    project: atom.project.serialize(options),
    workspace: atom.workspace.serialize(),
    packageStates: packageStatesSerialize(),
    grammars: {grammarOverridesByPath: atom.grammars.grammarOverridesByPath},
    fullScreen: atom.isFullScreen(),
    windowDimensions: atom.windowDimensions
  }
}

exports.atomSerialize = atomSerialize

function atomDeserialize (state) {
  // Atom >= 1.17
  // There is a new API for deserializing state into an active window
  if (atom.restoreStateIntoThisEnvironment) {
    return atom.restoreStateIntoThisEnvironment(state);
  }

  // Atom < 1.17
  if (atom.deserialize != null) return atom.deserialize(state)

  // Atom <= 1.6
  var grammarOverridesByPath = state.grammars
    ? state.grammars.grammarOverridesByPath
    : null

  if (grammarOverridesByPath) {
    atom.grammars.grammarOverridesByPath = grammarOverridesByPath
  }

  atom.setFullScreen(state.fullScreen)

  atom.packages.packageStates = state.packageStates || {}
  if (state.project != null) {
    atom.project.deserialize(state.project, atom.deserializers)
  }
  if (state.workspace != null) {
    atom.workspace.deserialize(state.workspace, atom.deserializers)
  }
}

function loadState (key) {
  if (atom.loadState != null) {
    return atom.loadState(key);
  }

  if (atom.stateStore != null) {
    // Atom 1.7+
    return atom.stateStore.load(key)
  }

  // Atom <= 1.6
  return Promise.resolve(atom.getStorageFolder().load(key))
}

function closeAllBuffers () {
  atom.project.getBuffers().forEach((buffer) => {
    if (buffer) buffer.release()
  })
}

function getTreeView () {
  var treeViewPack = atom.packages.getActivePackage('tree-view')
  var tv = (
    treeViewPack && treeViewPack.mainModule &&
    treeViewPack.mainModule.treeView)

  return tv
}

// Switch to another project (in the same window)
exports.switch = function (paths) {
  var currentStateKey = atom.getStateKey(atom.project.getPaths())
  var newStateKey = atom.getStateKey(paths)

  return new Promise((resolve, reject) => {
    // Do nothing if keys are the same
    if (currentStateKey === newStateKey) return resolve()

    // Save current state
    saveCurrentState().then(() => {
      // Load state of the new project
      loadState(newStateKey).then((state) => {
        // HACK: Unload the active projects. This is _needed_ as of
        //    Atom 1.17 but apparently it should have been done earlier as
        //    well. I don't think there was any "bad" effects but eh,
        //    here we go I guess.
        atom.project.getPaths().forEach(path => {
          atom.project.removePath(path)
        })

        // Destroy the tabs
        // Fixes memory leak that was present in <= 3.x of this package
        var tabs = atom.packages.getActivePackage('tabs')
        if (tabs) {
          for (var i = 0; i < tabs.mainModule.tabBarViews.length; i++) {
            tabs.mainModule.tabBarViews[i].destroy();
          }

          tabs.mainModule.tabBarViews.splice(0);
        }

        if (state) {
          // Deserialize state (this is what does the grunt of the work)
          atomDeserialize(state)

          // HACK: Tree view doesn't reload expansion states
          var tvState = state.packageStates['tree-view']
          if (tvState) {
            var tv = getTreeView()
            if (tv) {
              // NOTE: Re-attach the tree-view if this is an empty atom
              if (!currentStateKey && !tv.isVisible()) tv.attach()
              tv.updateRoots(tvState.directoryExpansionStates)
              tv.selectEntry(tv.roots[0])
              if (tvState.selectedPath) {
                tv.selectEntryForPath(tvState.selectedPath)
              }
              if (tvState.hasFocus) tv.focus()
              if (tvState.scrollLeft > 0) {
                tv.scroller.scrollLeft(tvState.scrollLeft)
              }
              if (tvState.scrollTop > 0) tv.scrollTop(tvState.scrollTop)
            }

            // HACK: Re-focus editor (if tree-view didn't have focus)
            if (!tvState.hasFocus) {
              atom.workspace.getActivePane().activate()
            }
          }
        } else {
          // Set project paths
          atom.project.setPaths(paths)

          // Close all buffers
          closeAllBuffers()
        }

        // HACK[Pigments]: Pigments needs to reload on project reload
        var pigments = atom.packages.getActivePackage('pigments')
        if (pigments) {
          pigments.mainModule.reloadProjectVariables()
        }

        // Done
        resolve()
      })
    }, reject)
  })
}

// Close the current project (to bring the editor back to an empty state)
exports.close = function () {
  // Save the state of the current project
  saveCurrentState().then(() => {
    // Set project paths
    atom.project.setPaths([])

    // Close all buffers
    closeAllBuffers()

    // TODO: Should we close the tree-view?
    var tv = getTreeView()
    if (tv) {
      if (tv.isVisible()) {
        tv.detach()
      }
    }
  })
}


text:
"""`main` is the top level module for your Bottle application.

Loads the Bottle framework and adds a custom error
handler.
"""

# import the Bottle framework
from bottle import Bottle,route, run, template, static_file, get, post, request, redirect, response
from antTrailsDatabase import Occupant, Spot
from google.appengine.ext import ndb
import datetime, pyimgur, time

# Run the Bottle wsgi application. We don't need to call run() since our
# application is embedded within an App Engine WSGI application server.
bottle = Bottle()

@bottle.get('/')
def home():
  query = Occupant.query()
  tmp_vendors = convertVendors(query)
  vendors = {'vendors':tmp_vendors}

  #query = Spot.query()
  #query_spots = convertSpots(query)
  tmp_spots = []

  for v in tmp_vendors:
    spot = Spot.get_by_id(v['spot_id'])
    if spot != None:
      tmp = convertOneSpot(spot,v)
      tmp_spots.append(tmp)

  spots = {'spots':tmp_spots}

  header = template('header', home="active", vendor="", edit="", about="")
  content = template('buyer', vendors, spots)
  footer = template('footer',"")
  deleted = """
  <script>
    $(window).load(function() {
    alert("The spot entered and it's information has been deleted. \\n\\nThank you!");
    });
  </script>"""
  confirmation = """
  <script>
    $(window).load(function() {
    alert("Your reservation is complete! Please note that official reservations must be made through the Student Center and not through antTrails. Also, please note that the spots reset at 12am everyday. \\n\\nThank you!");
    });
  </script>
  """

  if request.get_cookie("submittedForm") == "yes":
    response.set_cookie("submittedForm", "no")
    content = template('buyer', vendors, spots)
    return header + content + footer + confirmation
  elif request.get_cookie("deleted") == "yes":
    response.set_cookie("deleted", "no")
    content = template('buyer', vendors, spots)
    return header + content + footer + deleted
  else:
    return header + content + footer

@bottle.get('/vendor')
def home():
  header = template('header', home="", vendor="active", edit="", about="")
  content = template('vendor', message = "", sn = "", hl = "" , org = "", desc = "", pw = "")
  footer = template('footer',"")
  return header + content + footer

@bottle.post('/vendor')
def home():

  sn = request.forms.get('spotNumber')
  hl = request.forms.get('headline')
  org = request.forms.get('organization')
  desc = request.forms.get('description')
  pw = request.forms.get('password')
  img_url = request.forms.get('image_url')
  #img = uploadImage(img_url)

  if isValidSpot(sn):
    snInt = int(sn)
    snInt = str(snInt)
    snDatabase = Occupant.get_by_id(snInt)
    if snDatabase == None:
      occupant = Occupant(id = snInt, headline = hl, description = desc, date_time = datetime.datetime.now(), spot_id = snInt, organization = org, spot_image = img_url, password = pw, report = 0)
      occupant.put()

      time.sleep(2)
      response.set_cookie("submittedForm", "yes")
      redirect('/')

    else:
      header = template('header', home="", vendor="active", edit="", about="")
      content = template('vendor', message = "*Sorry, the Spot Number entered has already been taken.*", sn = "", hl = hl, org = org, desc = desc, pw = pw)
      footer = template('footer',"")

      return header + content + footer

  else:
    header = template('header', home="", vendor="active", edit="", about="")
    content = template('vendor', message = "*Sorry, the spot number must be a valid spot number.*", sn = "", hl = hl, org = org, desc = desc, pw = pw)
    footer = template('footer',"")

    return header + content + footer

@bottle.get('/edit')
def home():
  header = template('header', home="", vendor="", edit="active", about="")
  content = template('edit', message="")
  footer = template('footer',"")
  response.set_cookie("edittingForm", "no")
  return header + content + footer

@bottle.post('/edit')
def home():
  #if the user has not submitted the new editted form, it will enter this branch
  if request.get_cookie("edittingForm") == "no":
    sn = request.forms.get('spotNumber')
    pw = request.forms.get('password')

    if isValidSpot(sn):
      #gets rid of leading 0s
      snInt = int(sn)
      snInt = str(snInt)

      snDatabase = Occupant.get_by_id(snInt)

      if snDatabase == None:
        header = template('header', home="", vendor="", edit="active", about="")
        content = template('edit', message="*The entered Spot Number has not been reserved yet.")
        footer = template('footer',"")
        return header + content + footer

      else:
        if snDatabase.password == pw:
          #if the user chose to delete a spot, here they go!
          if request.forms.get("delete") == "Delete Spot":
            spot = Occupant.get_by_id(snInt)
            spot.key.delete()
            response.set_cookie("deleted", "yes")
            time.sleep(2)
            redirect('/')

          else:
            response.set_cookie("edittingForm", "yes")
            snInt = int(sn)
            snInt = str(snInt)
            response.set_cookie("originalSN", snInt)
            hl = snDatabase.headline
            org = snDatabase.organization
            desc = snDatabase.description

            header = template('header', home="", vendor="", edit="active", about="")
            content = template('vendor', message = "Spot Information has been loaded!", sn = sn, hl = hl, org = org, desc = desc, pw = pw)
            footer = template('footer',"")
            return header + content + footer

        else:
          header = template('header', home="", vendor="", edit="active", about="")
          content = template('edit', message="*Invalid Password")
          footer = template('footer',"")
          return header + content + footer

    else:
      header = template('header', home="", vendor="", edit="active", about="")
      content = template('edit', message = "*Sorry, the spot number must be a valid spot number.*")
      footer = template('footer',"")
      return header + content + footer

  #if the user has submitted a new editted spot form it will enter this branch
  #this branch is basically the check in vnedor that validates input
  else:
    sn = request.forms.get('spotNumber')
    hl = request.forms.get('headline')
    org = request.forms.get('organization')
    desc = request.forms.get('description')
    pw = request.forms.get('password')
    img_url = request.forms.get('image_url')

    if isValidSpot(sn):
      snInt = int(sn)
      snInt = str(snInt)
      snDatabase = Occupant.get_by_id(snInt)

      if snDatabase == None or snInt == str(request.get_cookie("originalSN")):
        occupant = Occupant(id = snInt, headline = hl, description = desc, date_time = datetime.datetime.now(), spot_id = snInt, organization = org, spot_image = img_url, password = pw, report = 0)
        occupant.put()

        #if the new spot number does not exist that means that changed the spot number
        #so the old can be deleted because it is being replaced
        if snDatabase == None:
          oldSpot = Occupant.get_by_id(str(request.get_cookie("originalSN")))
          oldSpot.key.delete()

        response.set_cookie("edittingForm", "no")
        response.set_cookie("originalSN", "no")

        time.sleep(2)
        response.set_cookie("submittedForm", "yes")
        redirect('/')

      else:
        header = template('header', home="", vendor="", edit="active", about="")
        content = template('vendor', message = "*Sorry, the Spot Number entered has already been taken.*", sn = "", hl = hl, org = org, desc = desc, pw = pw)
        footer = template('footer',"")

        return header + content + footer

    else:
      header = template('header', home="", vendor="", edit="active", about="")
      content = template('vendor', message = "*Sorry, the spot number must be a valid spot number.*", sn = "", hl = hl, org = org, desc = desc, pw = pw)
      footer = template('footer',"")

      return header + content + footer

@bottle.get('/about')
def home():
  header = template('header', home="", vendor="", edit="", about="active")
  content = template('about',"")
  footer = template('footer',"")
  return header + content + footer

@bottle.error(404)
def error_404(error):
  """Return a custom 404 error."""
  return 'Sorry, Nothing at this URL.'

@bottle.get('/addSpotsToDatabase')
def home():
  vendor_to_longlat('LongituteLatitutde.txt')

@bottle.get('/addOccupantData')
def home():
  o1 =  Occupant(id = "1", headline = "Selling chicken nuggets!", description = "Chicken nuggets! 5 for $1", date_time = datetime.datetime.now(), spot_id = "1", organization = "Circle K", spot_image = "", password = "", report = 0)
  o2 =  Occupant(id = "2", headline = "Free drinks!", description = "Answer a simple survey to get a free drink!", date_time = datetime.datetime.now(), spot_id = "2", organization = "Mahjong Club", spot_image = "", password = "", report = 0)
  o3 = Occupant(id = "3", headline = "Resume Critque", description = "Stop by to get your resume up in shape!", date_time = datetime.datetime.now(), spot_id = "3", organization = "Career Center", spot_image = "", password = "", report = 0)
  o4 = Occupant(id = "76", headline = "Study at our Booth!", description = "Come study with us at our booth and learn about stuff!", date_time = datetime.datetime.now(), spot_id = "76", organization = "Study Club", spot_image = "", password = "", report = 0)
  o5 = Occupant(id = "233", headline = "Boats", description = "Boats, Boats BOATS!!!", date_time = datetime.datetime.now(), spot_id = "233", organization = "Touch the Boat", spot_image = "", password = "", report = 0)
  o6 = Occupant(id = "314", headline = "Don't Smile at Strangers", description = "Have you ever wanted to see what goes on behind the Don't Smile at Strangers group meetings? Come by to find out! We're always happy to show you!", date_time = datetime.datetime.now(), spot_id = "314", organization = "INFX 151", spot_image = "", password = "", report = 0)
  o7 = Occupant(id = "106", headline = "ASUCI Elections", description = "Vote today!", date_time = datetime.datetime.now(), spot_id = "106", organization = "ASUCI", spot_image = "", password = "", report = 0)
  o1.put()
  o2.put()
  o3.put()
  o4.put()
  o5.put()
  o6.put()
  o7.put()

  return "Occupant Data successfully added!"

@bottle.get('/seasonalfruits')
def home():
  ndb.delete_multi(Occupant.query().fetch(keys_only=True))
  #ndb.delete_multi(Spot.query().fetch(keys_only=True))

@bottle.get('/imgur')
def home():
  CLIENT_ID = "023b858ecdb2d0c"
  CLIENT_SECRET = "83234b0ff6b2fce855205f69594811b671448848"
  im = pyimgur.Imgur(CLIENT_ID, CLIENT_SECRET)
  image = im.get_image('S1jmapR')
  link = "<img src="+image.link_medium_thumbnail+">"
  header = template('header',  home="active", vendor="", edit="", about="")
  footer = template('footer',"")
  return header + link + footer

def isValidSpot(s):

  spot = Spot.get_by_id(s)
  return spot != None

def convertSpots(spots):
  returner = []
  for s in spots:
    returner.append({
      'longitude' : s.longitude,
      'latitude' : s.latitude,
      'spot_id' : s.spot_id,
      'location_image' : s.location_image,
      'general_area' : s.general_area
      })

  return returner

def convertOneSpot(spot, vendor):
  returner=[{
      'longitude' : spot.longitude,
      'latitude' : spot.latitude,
      'spot_id' : spot.spot_id,
      'location_image' : spot.location_image,
      'general_area' : spot.general_area,
      'organization' : vendor['organization'],
      'description' : vendor['description'],
      'headline' : vendor['headline'],
      }]

  return returner

def convertVendors(vendors):
  returner = []
  i = 0
  for v in vendors:
    returner.append({
        'headline' : v.headline,
        'description' : v.description,
        'date_time' : v.date_time,
        'spot_id' : v.spot_id,
        'organization' : v.organization,
        'spot_image' : v.spot_image,
        'password' : v.password,
        'report' : v.report,
        'pos' : i
      })
    i += 1

  return returner

def uploadImage(img_url):
  CLIENT_ID = "023b858ecdb2d0c"
  CLIENT_SECRET = "83234b0ff6b2fce855205f69594811b671448848"
  im = pyimgur.Imgur(CLIENT_ID, CLIENT_SECRET)
  image = im.upload_image(path = img_url, title= "Test upload")
  return image.link

def vendor_to_longlat(spreadsheet):
  '''Making a dictionary from Tech Beckas spreadsheet'''
  sheet = open(spreadsheet, 'r')
  sheet = sheet.readlines()
  vendor_longlat = {}

  for item in range(len(sheet)):
    sheet[item]=sheet[item].split(',')
  for item in sheet:
    try:
      item[2] = item[2].strip('\n')
      s = Spot(id = item[0], latitude = item[1], longitude = item[2], location_image = "", spot_id =item[0], general_area ="")
      s.put()
    except:
      pass
vendor_to_longlat('LongituteLatitutde.txt')


text:
package com.rtg.vcf;

import com.rtg.util.diagnostic.NoTalkbackSlimException;

/**
 * A VCF info filter constructed from a somewhat general expression.
 */
public class ExpressionInfoFilter extends VcfInfoFilter {

  private final String mField;
  private final Operation<?> mOp;
  private final Object mValue;

  ExpressionInfoFilter(final VcfFilterStatistics stats, final String expression) {
    super(stats, VcfFilterStatistics.Stat.USER_EXPRESSION_COUNT);
    final String expr = expression.replace(" ", "");
    int k = 0;
    while (k < expr.length() && "!=<>".indexOf(expr.charAt(k)) == -1) {
      ++k;
    }
    final int opStart = k;
    mField = expr.substring(0, opStart);
    if (mField.isEmpty()) {
      throw new NoTalkbackSlimException("Could not parse field in: " + expression);
    }
    do {
      ++k;
    } while (k < expr.length() && "!=<>".indexOf(expr.charAt(k)) >= 0);
    if (opStart >= expr.length()) {
      throw new NoTalkbackSlimException("No operator found in: " + expression);
    }
    final String operator = expr.substring(opStart, k);
    final String value = expr.substring(k);
    Object tempValue;
    try {
      tempValue = Double.valueOf(value);
    } catch (final NumberFormatException e) {
      tempValue = value;
    }
    mValue = tempValue;
    mOp = ExpressionSampleFilter.selectOp(operator, mValue);
  }

  @Override
  boolean acceptCondition(VcfRecord record) {
    final String[] vals = record.getInfoSplit(mField);
    if (vals != null) {
      for (final String val : vals) {
        if (mValue instanceof Double) {
          final Double v = Double.valueOf(val);
          if (((OperationDouble) mOp).compare(v, (Double) mValue)) {
            return true;
          }
        } else if (((OperationObject) mOp).compare(val, mValue)) {
          return true;
        }
      }
    }
    return false;
  }
}


text:
<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "access_code".
 *
 * @property integer $id
 * @property string $access_code
 * @property integer $organisation_id
 * @property integer $ticket_id
 * @property integer $user_limit
 * @property integer $claim_limit
 */
class AccessCode extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'access_code';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['access_code', 'ticket_id', 'user_limit', 'claim_limit'], 'required'],
            [['ticket_id', 'user_limit', 'claim_limit'], 'integer'],
            [['access_code'], 'string', 'max' => 50],
            [['access_code', 'ticket_id'], 'unique', 'targetAttribute' => ['access_code', 'ticket_id'], 'message' => 'The combination of Access Code and Ticket ID has already been taken.']
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => Yii::t('app', 'Access Code ID'),
            'access_code' => Yii::t('app', 'Access Code'),
            'ticket_id' => Yii::t('app', 'Ticket ID'),
            'user_limit' => Yii::t('app', 'User Claim Limit'),
            'claim_limit' => Yii::t('app', 'Total Claim Limit'),
        ];
    }

    public function getTicket() {
        return $this->hasOne(Ticket::className(), ['id' => 'ticket_id']);
    }

    public function getClaims() {
        return $this->hasMany(AccessCodeClaims::className(), ['access_code_id' => 'id']);
    }
}


text:
from decimal import Decimal

TWO_DIGITS = Decimal('0.01')
FOUR_DIGITS = Decimal('0.0001')


text:
import Backbone from "backbone";
import { Step1Model, Step2Model } from "./src/js/models/signup";
import { Step1, Step2, Step3 } from "./src/js/components/signup";

const MainRouter = Backbone.Router.extend({
  routes: {
    '': 'step1',
    'step2': 'step2',
    'step3': 'step3'
  },
  step1: () => {
    const step1Model = new Step1Model;
    const Step1View = new Step1({model: step1Model});
    Step1View.render();
  },
  step2: () => {
    const step2Model = new Step2Model;
    const Step2View = new Step2({model: step2Model});
    Step2View.render();
  },
  step3: () => {
    const Step3View = new Step3;
    Step3View.render();
  }
});

window.App = {};
window.App.Router = new MainRouter();

Backbone.history.start({pushState: true, root: '/example/'});


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="colorPrimary">#f44336</color>
    <color name="colorPrimaryDark">#303F9F</color>
    <color name="colorAccent">#FF4081</color>
    <color name="colorHighlight">#FFFFFF</color>
</resources>


text:
Date: Tue, 05 Nov 1996 21:49:59 GMT
Server: NCSA/1.5
Content-type: text/html
Last-modified: Sat, 17 Aug 1996 18:29:20 GMT
Content-length: 1699

<TITLE> Viresh Ratnakar's Publications </TITLE>

Viresh Ratnakar's publications:

 (Send me a note at ratnakar@cs.wisc.edu for copies/abstracts)
 (Actually, some of the papers in Postscript are
    <!WA0>
    here)

 Ratnakar, V., Feig, E., Tiwari, P.
     Fractal Based Hybrid Compression Schemes.
      Proceedings of SPIE's VCIP'94.

 Feig, E., Peterson, H., Ratnakar, V.
     Image Compression Using Spatial Prediction.
      Proceedings of ICASSP'95.

 Ratnakar, V., Livny, M. Performance of Customized
     DCT Quantization Tables on Scientific Data.
      Science Information Management
    and Data Compression Workshop Proceedings.
    NASA Conference Publication 3277. Sept. 1994.

 Ratnakar, V., Feig, E., Viscito, E., Kalluri, S.
     Runlength encoding of quantized DCT coefficients.
      IBM RC 19693 (87318) 8/5/94 and in SPIE '95.

 Ratnakar, V., Livny, M.
     RD-OPT: An Efficient Algorithm For Optimizing DCT Quantization
     Tables.
      Computer Sciences Dept. Technical Report
     No. 1257. UW-Madison and in Proceedings of DCC'95.

 Ratnakar, V., Livny, M., Norman, J.M., Kucharik, K.
     Classification on compressed images with bounded loss.
      Proceedings of IGARSS'95.

 Ratnakar, V., Livny, M.
     Extending RD-OPT with Global Thresholding for JPEG
     Optimization.
      Proceedings of DCC'96.

 Livny, M., Ratnakar, V.
     Quality-Controlled Compression of Sets of Images.
      Proceedings of IW-MMDBMS'96


text:
module ApiKits

  autoload :Base,            'api_kits/base'
  autoload :ClassMethods,    'api_kits/class_methods'
  autoload :Collection,      'api_kits/collection'
  autoload :Configuration,   'api_kits/configuration'
  autoload :Dispatcher,      'api_kits/dispatcher'
  autoload :Errors,          'api_kits/errors'
  autoload :Exceptions,      'api_kits/exceptions'
  autoload :InstanceMethods, 'api_kits/instance_methods'
  autoload :Parser,          'api_kits/parser'
  autoload :Version,         'api_kits/version'

  # Configures global settings
  #   ApiKits.configure do |config|
  #     config.api_uri = "api.example.com"
  #   end
  # @yield Yield the configuration object
  # @yieldparam block The Configuration object
  # @yieldreturn [ApiKits::Configuration] The Configuration object
  def self.configure(&block)
    yield @config ||= ApiKits::Configuration.new
  end

  # Global settings for ApiKits
  #
  # @return [Hash] configuration attributes
  def self.config
    @config
  end

  # Parallel API requests
  #
  # @yield The requests to be made
  # @yieldparam block A block with request objects
  # @return [False] the value of the Hydra config
  def self.parallel(&block)
    raise Exceptions::NotPossible unless defined?(::Typhoeus)
    config.hydra = ::Typhoeus::Hydra.new
    yield
    config.hydra.run
    config.hydra = false
  end

  # Default Settings
  configure do |config|
    config.api_uri = ''
    config.header  = {}
    config.mock    = false
    config.hydra   = false
  end

end


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent" android:orientation="vertical">
<EditText android:layout_height="wrap_content" android:id="@+id/file_name_edittext" android:layout_width="fill_parent"></EditText>
<ListView android:id="@+id/file_name_list" android:layout_width="fill_parent" android:layout_height="wrap_content"></ListView>
</LinearLayout>


text:
require 'rails_helper'

RSpec.describe "users/sessions/new", type: :view do
  before(:each) do
    without_partial_double_verification do
      allow(view).to receive(:resource_class).and_return(devise_mapping.to)
    end
  end

  it "has the correct fields" do
    render()
    expect(rendered).to have_text(I18n.t('.start_page.register_now', :default => "Register"))
    expect(rendered).to have_text(I18n.t('.users.sessions.new.sign_in', :default => "Sign in"))
    expect(rendered).to have_text(I18n.t('devise.shared.links.sign_in_with_provider', :provider => 'HPI OpenID'))
  end
end


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

#endregion

namespace GameCore.Render.OpenGl4CSharp
{
    public class ObjObject : IDisposable
    {
        internal VBO<Vector3> vertices;
        internal VBO<Vector3> normals;
        internal VBO<Vector2> uvs;
        internal VBO<int> triangles;

        public string Name { get; internal set; }

        public ObjMaterial Material { get; set; }

        public ObjObject(Vector3[] vertexData, int[] elementData)
        {
            vertices = new VBO<Vector3>(vertexData);
            triangles = new VBO<int>(elementData, BufferTarget.ElementArrayBuffer);
            Vector3[] normalData = CalculateNormals(vertexData, elementData);

            vertices = new VBO<Vector3>(vertexData);
            normals = new VBO<Vector3>(normalData);
            triangles = new VBO<int>(elementData, BufferTarget.ElementArrayBuffer);
        }

        public ObjObject(List<string> lines, Dictionary<string, ObjMaterial> materials, int vertexOffset, int uvOffset)
        {
            // we need at least 1 line to be a valid file
            if (lines.Count == 0) return;

            // the first line should contain 'o'
            if (lines[0][0] != 'o' && lines[0][0] != 'g') return;
            Name = lines[0].Substring(2);

            List<Vector3> vertexList = new List<Vector3>();
            List<Vector2> uvList = new List<Vector2>();
            List<int> triangleList = new List<int>();
            List<Vector2> unpackedUvs = new List<Vector2>();
            List<int> normalsList = new List<int>();

            // now we read the lines
            for (int i = 1; i < lines.Count; i++)
            {
                string[] split = lines[i].Split(' ');

                switch (split[0])
                {
                    case "v":
                        vertexList.Add(
                            new Vector3(double.Parse(split[1]), double.Parse(split[2]), double.Parse(split[3]))*0.025f);
                        break;
                    case "vt":
                        uvList.Add(new Vector2(double.Parse(split[1]), double.Parse(split[2])));
                        break;
                    case "f":
                        string[] indices = new string[] {split[1], split[2], split[3]};

                        if (split[1].Contains("/"))
                        {
                            indices[0] = split[1].Substring(0, split[1].IndexOf("/"));
                            indices[1] = split[2].Substring(0, split[2].IndexOf("/"));
                            indices[2] = split[3].Substring(0, split[3].IndexOf("/"));

                            // TODO there was something wrong here.
//                            string[] uvs = new string[3];
                            string[] tempUvs = new string[3];
                            tempUvs[0] = split[1].Substring(split[1].IndexOf("/") + 1);
                            tempUvs[1] = split[2].Substring(split[2].IndexOf("/") + 1);
                            tempUvs[2] = split[3].Substring(split[3].IndexOf("/") + 1);

                            int[] triangle = new int[]
                                {
                                    int.Parse(indices[0]) - vertexOffset, int.Parse(indices[1]) - vertexOffset,
                                    int.Parse(indices[2]) - vertexOffset
                                };

                            if (unpackedUvs.Count == 0)
                                for (int j = 0; j < vertexList.Count; j++) unpackedUvs.Add(Vector2.Zero);
                            normalsList.Add(triangle[0]);
                            normalsList.Add(triangle[1]);
                            normalsList.Add(triangle[2]);

                            if (unpackedUvs[triangle[0]] == Vector2.Zero)
                                unpackedUvs[triangle[0]] = uvList[int.Parse(tempUvs[0]) - uvOffset];
                            else
                            {
                                unpackedUvs.Add(uvList[int.Parse(tempUvs[0]) - uvOffset]);
                                vertexList.Add(vertexList[triangle[0]]);
                                triangle[0] = unpackedUvs.Count - 1;
                            }

                            if (unpackedUvs[triangle[1]] == Vector2.Zero)
                                unpackedUvs[triangle[1]] = uvList[int.Parse(tempUvs[1]) - uvOffset];
                            else
                            {
                                unpackedUvs.Add(uvList[int.Parse(tempUvs[1]) - uvOffset]);
                                vertexList.Add(vertexList[triangle[1]]);
                                triangle[1] = unpackedUvs.Count - 1;
                            }

                            if (unpackedUvs[triangle[2]] == Vector2.Zero)
                                unpackedUvs[triangle[2]] = uvList[int.Parse(tempUvs[2]) - uvOffset];
                            else
                            {
                                unpackedUvs.Add(uvList[int.Parse(tempUvs[2]) - uvOffset]);
                                vertexList.Add(vertexList[triangle[2]]);
                                triangle[2] = unpackedUvs.Count - 1;
                            }

                            triangleList.Add(triangle[0]);
                            triangleList.Add(triangle[1]);
                            triangleList.Add(triangle[2]);
                        }
                        else
                        {
                            triangleList.Add(int.Parse(indices[0]) - vertexOffset);
                            triangleList.Add(int.Parse(indices[1]) - vertexOffset);
                            triangleList.Add(int.Parse(indices[2]) - vertexOffset);
                        }
                        break;
                    case "usemtl":
                        if (materials.ContainsKey(split[1])) Material = materials[split[1]];
                        break;
                }
            }

            // calculate the normals (if they didn't exist)
            Vector3[] vertexData = vertexList.ToArray();
            int[] elementData = triangleList.ToArray();
            Vector3[] normalData = CalculateNormals(vertexData, elementData);

            // now convert the lists over to vertex buffer objects to be rendered by OpenGL
            vertices = new VBO<Vector3>(vertexData);
            normals = new VBO<Vector3>(normalData);
            if (unpackedUvs.Count != 0) uvs = new VBO<Vector2>(unpackedUvs.ToArray());
            triangles = new VBO<int>(elementData, BufferTarget.ElementArrayBuffer);
        }

        public static Vector3[] CalculateNormals(Vector3[] vertexData, int[] elementData)
        {
            Vector3 b1, b2, normal;
            Vector3[] normalData = new Vector3[vertexData.Length];

            for (int i = 0; i < elementData.Length/3; i++)
            {
                int cornerA = elementData[i*3];
                int cornerB = elementData[i*3 + 1];
                int cornerC = elementData[i*3 + 2];

                b1 = vertexData[cornerB] - vertexData[cornerA];
                b2 = vertexData[cornerC] - vertexData[cornerA];

                normal = Vector3.Cross(b1, b2).Normalize();

                normalData[cornerA] += normal;
                normalData[cornerB] += normal;
                normalData[cornerC] += normal;
            }

            for (int i = 0; i < normalData.Length; i++) normalData[i] = normalData[i].Normalize();

            return normalData;
        }

        public void Draw()
        {
            if (vertices == null || triangles == null) return;

            Gl.Disable(EnableCap.CullFace);
            if (Material != null) Material.Use();

            Gl.BindBufferToShaderAttribute(vertices, Material.Program, "vertexPosition");
            Gl.BindBufferToShaderAttribute(normals, Material.Program, "vertexNormal");
            if (uvs != null) Gl.BindBufferToShaderAttribute(uvs, Material.Program, "vertexUV");
            Gl.BindBuffer(triangles);

            Gl.DrawElements(BeginMode.Triangles, triangles.Count, DrawElementsType.UnsignedInt, IntPtr.Zero);
        }

        public void Dispose()
        {
            if (vertices != null) vertices.Dispose();
            if (normals != null) normals.Dispose();
            if (triangles != null) triangles.Dispose();
            if (uvs != null) uvs.Dispose();
            if (Material != null) Material.Dispose();
        }

        public override string ToString()
        {
            string outStr = "";
            outStr += Name;
            return outStr;
        }
    }
}


text:
package noonpacific

// Config is the configuration for the noonpacific api
type Config struct {
	ClientID string `yaml:"client_id"`
}


text:
<ion-side-menus enable-menu-with-back-views="false">
    <ion-side-menu-content>
        <ion-nav-bar class="bar-assertive">
            <ion-nav-back-button class="no-text">
            </ion-nav-back-button>
            <ion-nav-buttons side="left">
                <button class="button button-icon button-clear ion-navicon" menu-toggle="left">
                </button>
            </ion-nav-buttons>

        </ion-nav-bar>

        <ion-nav-view name="menuContent"></ion-nav-view>
    </ion-side-menu-content>
    <ion-side-menu side="left">
        <ion-header-bar class="expanded">

                Its Me Padmapriya

        </ion-header-bar>
        <ion-content class="stable-bg has-expanded-header">
            <ion-list>
                <ion-item nav-clear menu-close href="#/app/aboutme">
                    Who am I
                </ion-item>
                <ion-item nav-clear menu-close href="#/app/timeline">
                    Time Line
                </ion-item>
                <ion-item nav-clear menu-close href="#/app/projects">
                    Projects
                </ion-item>
                <ion-item nav-clear menu-close href="#/app/honours">
                    Honours and Awards
                </ion-item>
                <ion-item nav-clear menu-close href="#/app/contact">
                    Contacts
                </ion-item>
            </ion-list>
        </ion-content>
    </ion-side-menu>
</ion-side-menus>


text:
import { useTheme } from '@mui/material';
import { PlaygroundResultChip } from '../../../../PlaygroundResultChip/PlaygroundResultChip';
import {
    PlaygroundStrategySchema,
    PlaygroundRequestSchema,
} from 'component/playground/Playground/interfaces/playground.model';
import { StrategyExecution } from './StrategyExecution/StrategyExecution';
import { useStyles } from './FeatureStrategyItem.styles';
import { StrategyItemContainer } from 'component/common/StrategyItemContainer/StrategyItemContainer';
import { objectId } from 'utils/objectId';

interface IFeatureStrategyItemProps {
    strategy: PlaygroundStrategySchema;
    index: number;
    input?: PlaygroundRequestSchema;
}

export const FeatureStrategyItem = ({
    strategy,
    input,
    index,
}: IFeatureStrategyItemProps) => {
    const { result } = strategy;
    const { classes: styles } = useStyles();
    const theme = useTheme();
    const label =
        result.evaluationStatus === 'incomplete'
            ? 'Unevaluated'
            : result.enabled
            ? 'True'
            : 'False';

    return (
        <StrategyItemContainer
            className={
                result.enabled && result.evaluationStatus === 'complete'
                    ? styles.successBorder
                    : undefined
            }
            strategy={{ ...strategy, id: `${objectId(strategy)}` }}
            orderNumber={index + 1}
            actions={
                <PlaygroundResultChip
                    showIcon={false}
                    enabled={result.enabled}
                    label={label}
                />
            }
        >
            <StrategyExecution
                strategyResult={strategy}
                input={input}
                percentageFill={theme.palette.tertiary.light}
            />
        </StrategyItemContainer>
    );
};


text:
/**
 * Pulse initiator
 *
 * @param {Object}  JQuery object
 * @param {Number}  radius
 * @param {String}  strokeColor x, y, z
 * @param {String}  fillColor   x, y, z
 * @param {Boolean} addLine
 * @param {Number}  startAngle
 */
function Pulse($canvas, radius, strokeColor, fillColor, addLine, startAngle) {
    "use strict";
    var ctx = $canvas.getContext('2d'),
        rings = [],
        ring = new Ring(radius, ctx, strokeColor, fillColor, addLine, startAngle),
        proxy = ring.grow;

    ring.radiusDiff = 0;
    ring.maxRings = 3;

    ring.grow = function() {
        var radiusBefore = this.radius;
        proxy.call(this);
        this.radiusDiff += this.radius - radiusBefore;

        if (this.radiusDiff > 3 && rings.length <= this.maxRings) {
            this.radiusDiff = 0;
            rings.push(new Ring(radius, ctx, strokeColor, fillColor, addLine, startAngle));
        }
    };

    rings.push(ring);
    ctx.lineWidth = 1;

    // To center on origin
    ctx.translate(25, 25);

    // So nib points straight up
    ctx.transform(Math.cos(Math.PI / 2), -Math.sin(Math.PI / 2), Math.sin(Math.PI / 2), Math.cos(Math.PI / 2), 0, 0);

    setInterval(
        function() {
            ctx.clearRect(-25, -25, 50, 50);

            var x = rings.length;
            while (x--) {
                rings[x].draw();
            }
        },
        50
    );
}

/**
 * Pulse ring
 *
 * @constructor
 * @param {Number}  radius
 * @param {Object}  ctx          Canvas rendering object
 * @param {String}  strokeColor x, y, z
 * @param {String}  fillColor   x, y, z
 * @param {Boolean} addLine
 * @param {Number}  startAngle
 */
function Ring(radius, ctx, strokeColor, fillColor, addLine, startAngle) {
    // Initial values used for resetting
    this.radiusInit = radius;
    this.opacityInit = 1;
    this.radius = radius;
    this.opacity = this.opacityInit;

    // Canvas object
    this.ctx = ctx;

    // Colors
    this.strokeColor = strokeColor;
    this.fillColor = fillColor;

    this.addLine = (typeof addLine != 'undefined') ? addLine : false;
    this.startAngle = (typeof startAngle != 'undefined') ? startAngle : 0;
}

Ring.prototype = {
    twoPi: 2 * Math.PI,

    /**
     * Increase the radius and opacity of the ring
     */
    grow: function() {
        this.radius += 0.5;
        this.opacity -= 0.075;

        // Reset?
        if (this.opacity <= 0) {
            this.radius = this.radiusInit;
            this.opacity = this.opacityInit;
        }
    },

    /**
     * Draw the ring
     */
    draw: function() {
        this.ctx.beginPath();
        this.ctx.arc(0, 0, this.radius, this.startAngle, this.twoPi + Math.abs(this.startAngle), 'clockwise');
        if (this.addLine === true) {
            this.ctx.lineTo(2 * this.radius, 0);
        }
        this.ctx.closePath();
        this.ctx.strokeStyle = 'rgba(' + this.strokeColor + ', ' + this.opacity + ')';
        this.ctx.fillStyle = 'rgba(' + this.fillColor + ', ' + this.opacity + ')';
        this.ctx.stroke();
        this.ctx.fill();

        this.ctx.beginPath();
        this.ctx.arc(0, 0, this.radius + 1, this.startAngle, this.twoPi + Math.abs(this.startAngle), 'clockwise');
        if (this.addLine === true) {
            this.ctx.lineTo((this.radius + 1) * 2, 0);
        }
        this.ctx.closePath();
        this.ctx.strokeStyle = 'rgba(255, 255, 255, ' + this.opacity + ')';
        this.ctx.stroke();

        this.grow();
    }
};


text:
"""
* Editor prompt example
"""
from __future__ import print_function, unicode_literals

from whaaaaat import style_from_dict, Token, prompt, print_json
from whaaaaat import Validator, ValidationError, default_style

questions = [
    {
        'type': 'editor',
        'name': 'bio',
        'message': 'Please write a short bio of at least 3 lines.',
        'validate': lambda text: len(text.split('\n')) >= 3 or 'Must be at least 3 lines.'
    }
]

answers = prompt(questions, style=default_style)
print_json(answers)


text:
from __future__ import unicode_literals

from django.db import migrations, models

class Migration(migrations.Migration):

    dependencies = [
        ('pedidos', '0007_auto_20170326_1857'),
    ]

    operations = [
        migrations.AddField(
            model_name='pedido',
            name='cliente',
            field=models.CharField(blank=True, max_length=100),
        ),
    ]


text:
package com.oracle.infy.wookiee.test.config

import com.typesafe.config.{Config, ConfigFactory}

// This is a test configuration for you to add any additional configuration information
object TestConfig {

  def conf: Config = conf(ConfigFactory.parseString(""))

  def conf(confStr: String): Config = conf(ConfigFactory.parseString(confStr))

  def conf(config: Config): Config = config.withFallback(ConfigFactory.load()).resolve
}


text:
"use strict";
var JournalEntry = (function () {
    function JournalEntry() {
        this.ID = 0;
        this.title = "";
    }
    return JournalEntry;
}());
exports.JournalEntry = JournalEntry;
//# sourceMappingURL=journalentry.js.map


text:
package ideal.development.functions;

import ideal.library.elements.*;
import javax.annotation.Nullable;
import ideal.library.texts.*;
import ideal.library.reflections.*;
import ideal.library.messages.*;
import ideal.runtime.elements.*;
import ideal.runtime.texts.*;
import ideal.runtime.logs.*;
import ideal.runtime.reflections.*;
import ideal.development.elements.*;
import ideal.development.actions.*;
import ideal.development.names.*;
import ideal.development.types.*;
import ideal.development.values.*;
import ideal.development.analyzers.*;
import ideal.development.flavors.*;
import ideal.development.notifications.*;

public class info_fn extends base_procedure {

  public info_fn(action_name the_name) {
    super(the_name, procedure_util.make_varags_procedure_type(false,
        library().immutable_void_type(), string_helper.readonly_stringable()));
  }

  @Override
  public entity_wrapper execute(readonly_list<entity_wrapper> args,
      execution_context context) {

    StringBuilder out = new StringBuilder();
    for (int i = 0; i < args.size(); ++i) {
      entity_wrapper arg = args.get(i);
      string as_string = string_helper.to_string(arg, context);
      out.append(utilities.s(as_string));
    }

    string line = new base_string(out.toString());
    log_message the_message = new simple_message(log_level.INFORMATIONAL, line);
    log.log_output.write(the_message);

    return library().void_instance();
  }
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../../../style.css" type="text/css" media="screen">
<link rel="stylesheet" href="../../../../print.css" type="text/css" media="print">
<meta content="DynamicRegistration,com.yahoo.astra.utils.DynamicRegistration,move,rotate,scale" name="keywords">
<title>com.yahoo.astra.utils.DynamicRegistration</title>

YUI AS Component Documentation	All Packages | All Classes | Index | FramesNo Frames

Class DynamicRegistration	Methods

Package	com.yahoo.astra.utils

Class	public class DynamicRegistration

  Allows you to manipulate display objects based on a registration point other
  than the standard (0,0).

Public Methods

 	Method	Defined by

move(target:DisplayObject, registration:Point, x:Number = 0, y:Number = 0):void

[static]
   Moves a DisplayObject to a new position (x,y) based on a registration point.

	DynamicRegistration

rotate(target:DisplayObject, registration:Point, degrees:Number = 0):void

[static]
   Rotates a DisplayObject based on a registration point.

	DynamicRegistration

scale(target:DisplayObject, registration:Point, scaleX:Number = 0, scaleY:Number = 0):void

[static]
   Scales a DisplayObject based on a registration point.

	DynamicRegistration

Method detail

move	()	method

public static function move(target:DisplayObject, registration:Point, x:Number = 0, y:Number = 0):void

   Moves a DisplayObject to a new position (x,y) based on a registration point. The
   true position of the object will be (x - registration.x, y - registration.y).

Parameters

	target:DisplayObject —    the DisplayObject to move

	registration:Point —  the registration point of the DisplayObject

	x:Number (default = 0) —     the new x position, in pixels

	y:Number (default = 0) —     the new y position, in pixels

rotate	()	method

public static function rotate(target:DisplayObject, registration:Point, degrees:Number = 0):void

   Rotates a DisplayObject based on a registration point.

Parameters

	target:DisplayObject —    the DisplayObject to move

	registration:Point —  the registration point of the DisplayObject

	degrees:Number (default = 0) —   the new rotation angle

scale	()	method

public static function scale(target:DisplayObject, registration:Point, scaleX:Number = 0, scaleY:Number = 0):void

   Scales a DisplayObject based on a registration point.

Parameters

	target:DisplayObject —    the DisplayObject to move

	registration:Point —  the registration point of the DisplayObject

	scaleX:Number (default = 0) —    the new x scaling factor

	scaleY:Number (default = 0) —    the new y scaling factor


text:
void make_args_map(struct Execution_bundle * exec_bundle, huo_ast * function);
huo_ast *get_defined_body(huo_ast * function);
huo_ast *get_defined_func(struct Scopes *defined, struct String key);
struct Value *get_letted_value(struct Scopes *defined, struct String key);

#endif