text:
package github.hellocsl.smartmonitor.state.Impl;

import android.app.Notification;
import android.os.Parcelable;
import android.text.TextUtils;
import android.util.Log;
import android.view.KeyEvent;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityNodeInfo;

import java.util.List;

import github.hellocsl.smartmonitor.AppApplication;
import github.hellocsl.smartmonitor.BuildConfig;
import github.hellocsl.smartmonitor.state.IMonitorService;
import github.hellocsl.smartmonitor.state.MonitorState;
import github.hellocsl.smartmonitor.utils.AppUtils;
import github.hellocsl.smartmonitor.utils.Constant;
import github.hellocsl.smartmonitor.utils.Privacy;
import github.hellocsl.smartmonitor.utils.RootCmd;
import github.hellocsl.smartmonitor.utils.UnLockUtils;

import static android.view.accessibility.AccessibilityEvent.TYPE_NOTIFICATION_STATE_CHANGED;
import static android.view.accessibility.AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED;
import static github.hellocsl.smartmonitor.utils.Constant.MONITOR_TAG;

/**
 * 初始状态,等待来电处理
 * change to monitor QQ new message (LockScreen, Notification , QQ App)
 * Created by chensuilun on 16-10-9.
 */
public class IdleState extends MonitorState {
    private static final String TAG = "IdleState";

    public IdleState(IMonitorService contextService) {
        super(contextService);
    }

    @Override
    public void handle(AccessibilityEvent accessibilityEvent) {
        AccessibilityNodeInfo nodeInfo = mContextService.getWindowNode();
        if (nodeInfo == null) {
            if (BuildConfig.DEBUG) {
                Log.v(TAG, "handle: null nodeInfo");
            }
            return;
        }
        if (BuildConfig.DEBUG) {
            Log.v(TAG, "handle:");
        }
        if (isLockScreenMonitorMsg(nodeInfo, accessibilityEvent) || isNotificationMonitorMsg(nodeInfo, accessibilityEvent)) {
            if (BuildConfig.DEBUG) {
                Log.d(TAG, "handle: monitor msg");
            }
            if (AppUtils.isInLockScreen()) {
                if (BuildConfig.DEBUG) {
                    Log.d(TAG, "handle: unlock screen");
                }
                //back press
                RootCmd.execRootCmd("input keyevent " + KeyEvent.KEYCODE_BACK);
                RootCmd.execRootCmd("sleep 0.1 && input keyevent " + KeyEvent.KEYCODE_HOME);
                unlockScreen(nodeInfo);
            }
            final String qqNumber = retrieveQQNumber(nodeInfo, accessibilityEvent);
            mContextService.setState(new QQChatState(mContextService));
            AppApplication.postDelay(new Runnable() {
                @Override
                public void run() {
                    AppUtils.openQQChat(qqNumber);
                }
            }, 1000);
        }
    }

    /**
     * retract monitor cmd from notification
     *
     * @param nodeInfo
     * @param accessibilityEvent
     * @return
     */
    private boolean isNotificationMonitorMsg(AccessibilityNodeInfo nodeInfo, AccessibilityEvent accessibilityEvent) {
        if (accessibilityEvent.getEventType() == TYPE_NOTIFICATION_STATE_CHANGED) {
            if (BuildConfig.DEBUG) {
                Log.d(TAG, "isNotificationMonitorMsg: ");
            }
            Parcelable data = accessibilityEvent.getParcelableData();
            if (data instanceof Notification) {
                if (((Notification) data).tickerText != null) {
                    return (((Notification) data).tickerText.toString().startsWith(MONITOR_TAG)
                            && ((Notification) data).tickerText.toString().endsWith(Constant.MONITOR_CMD_VIDEO));
                }
            }
        }
        return false;
    }

    /**
     * @param nodeInfo
     * @param accessibilityEvent
     * @return If from notification ,msg format :{@link Constant#MONITOR_TAG} + ":real QQ No: "+{@link Constant#MONITOR_CMD_VIDEO}
     */
    private String retrieveQQNumber(AccessibilityNodeInfo nodeInfo, AccessibilityEvent accessibilityEvent) {
        if (accessibilityEvent.getEventType() == TYPE_NOTIFICATION_STATE_CHANGED) {
            Parcelable data = accessibilityEvent.getParcelableData();
            if (data instanceof Notification) {
                if (((Notification) data).tickerText != null) {
                    return ((Notification) data).tickerText.toString().split(":")[1];
                }
            }
        } else {
            List<AccessibilityNodeInfo> nodeInfos = nodeInfo.findAccessibilityNodeInfosByText(MONITOR_TAG);
            if (!AppUtils.isListEmpty(nodeInfos)) {
                String tag;
                for (AccessibilityNodeInfo info : nodeInfos) {
                    if (BuildConfig.DEBUG) {
                        Log.d(TAG, "retrieveQQNumber: " + info.getText());
                    }
                    tag = (String) info.getText();
                    if (!TextUtils.isEmpty(tag) && tag.contains(MONITOR_TAG)) {
                        return tag.substring(Constant.MONITOR_TAG.length());
                    }
                }
            }
        }
        return Privacy.QQ_NUMBER;
    }

    /**
     * receive monitor cmd in LockScreen
     *
     * @param nodeInfo
     * @param accessibilityEvent
     * @return
     */
    private boolean isLockScreenMonitorMsg(AccessibilityNodeInfo nodeInfo, AccessibilityEvent accessibilityEvent) {
        if (BuildConfig.DEBUG) {
            Log.d(TAG, "isMonitorMsg: pkg:" + nodeInfo.getPackageName());
        }
        if (AppUtils.isInLockScreen() && Constant.QQ_PKG.equals(nodeInfo.getPackageName()) && TYPE_WINDOW_CONTENT_CHANGED == accessibilityEvent.getEventType()) {
            if (!AppUtils.isListEmpty(nodeInfo.findAccessibilityNodeInfosByText(MONITOR_TAG))
                    && !AppUtils.isListEmpty(nodeInfo.findAccessibilityNodeInfosByText(Constant.MONITOR_CMD_VIDEO))) {
                return true;
            }
        }
        return false;
    }

    /**
     * 解锁魅族
     *
     * @param nodeInfo
     */
    private void unlockScreen(AccessibilityNodeInfo nodeInfo) {
        UnLockUtils.unlock();
    }

}


text:
```js
// Usage:
// [].say.evening
// 100.say.day
// true.say.night
// '100'.say.morning

function SayClass() {}
SayClass.prototype.day = function() {console.log('Have a Good Day!');}
SayClass.prototype.morning = function() {console.log('Good morning!');}
SayClass.prototype.evening = function() {console.log('Good evening!');}
SayClass.prototype.night = function() {console.log('Good night!');}

Object.defineProperty(Object.prototype, 'say', {

    get: function() { return new SayClass(this) },
    set: function(value) {

        Object.defineProperty(this, 'say', {
            value: value,
            configurable: true,
            writable: true
        });
    },

    // enumerable will be false default similar to built-in properties
    configurable: true
});
```

redpajama_set_name: RedPajamaGithub


text:
#pragma once

#include <drivers/device/integrator.h>
#include <drivers/drv_gyro.h>
#include <drivers/drv_hrt.h>
#include <lib/cdev/CDev.hpp>
#include <lib/conversion/rotation.h>
#include <mathlib/math/filter/LowPassFilter2pVector3f.hpp>
#include <px4_module_params.h>
#include <uORB/uORB.h>
#include <uORB/PublicationMulti.hpp>
#include <uORB/topics/sensor_gyro.h>
#include <uORB/topics/sensor_gyro_control.h>

class PX4Gyroscope : public cdev::CDev, public ModuleParams
{

public:
	PX4Gyroscope(uint32_t device_id, uint8_t priority = ORB_PRIO_DEFAULT, enum Rotation rotation = ROTATION_NONE);
	~PX4Gyroscope() override;

	int	ioctl(cdev::file_t *filp, int cmd, unsigned long arg) override;

	void set_device_type(uint8_t devtype);
	void set_error_count(uint64_t error_count) { _sensor_gyro_pub.get().error_count = error_count; }
	void set_scale(float scale) { _sensor_gyro_pub.get().scaling = scale; }
	void set_temperature(float temperature) { _sensor_gyro_pub.get().temperature = temperature; }

	void set_sample_rate(unsigned rate);

	void update(hrt_abstime timestamp, float x, float y, float z);

	void print_status();

private:

	void configure_filter(float cutoff_freq) { _filter.set_cutoff_frequency(_sample_rate, cutoff_freq); }

	uORB::PublicationMultiData<sensor_gyro_s>		_sensor_gyro_pub;
	uORB::PublicationMultiData<sensor_gyro_control_s>	_sensor_gyro_control_pub;

	math::LowPassFilter2pVector3f _filter{1000, 100};
	Integrator _integrator{4000, true};

	const enum Rotation	_rotation;

	matrix::Vector3f	_calibration_scale{1.0f, 1.0f, 1.0f};
	matrix::Vector3f	_calibration_offset{0.0f, 0.0f, 0.0f};

	int			_class_device_instance{-1};

	unsigned		_sample_rate{1000};

	DEFINE_PARAMETERS(
		(ParamFloat<px4::params::IMU_GYRO_CUTOFF>) _param_imu_gyro_cutoff
	)

};


text:
<?php

namespace Frozensheep\Synthesize\Tests\Type\Fixtures;

use Frozensheep\Synthesize\Synthesizer;

class ObjectArrayFixture implements \JsonSerializable {

	//include the Sythesizer trait
	use Synthesizer;

	//set the synthesized variables
	protected $arrSynthesize = array(
		'objectarray' => array('type' => 'objectarray'),
		'objectarray1' => array('type' => 'objectarray', 'class' => '\DateTime'),
		'objectarray2' => array('type' => 'objectarray', 'max' => 3),
		'objectarray3' => array('type' => 'objectarray', 'jsonnull' => true),
		'objectarray4' => array('type' => 'objectarray', 'json' => false)
	);
}


text:
<?php

namespace Resources;

use Plivo\Http\PlivoRequest;
use Plivo\Http\PlivoResponse;
use Plivo\Tests\BaseTestCase;

class ZentrunkCallTest extends BaseTestCase{
    function testZentrunkCallList(){
        $request = new PlivoRequest(
            'GET',
            'Account/MAXXXXXXXXXXXXXXXXXX/Call/',
            [
                'limit' => 2,
                'offset' => 2
            ]
        );
        $body = file_get_contents(__DIR__ . '/../Mocks/zentrunkCallsListResponse.json');

        $this->mock(new PlivoResponse($request,200, $body));

        $actual = $this->client->ZentrunkCalls->list([
            'limit' => 2,
            'offset' => 2
        ]);

        $this->assertRequest($request);

        self::assertNotNull($actual);
    }
}


text:
package com.rackspacecloud.blueflood.http;

import org.jboss.netty.channel.ChannelHandlerContext;
import org.jboss.netty.handler.codec.http.*;

import java.util.Set;

public class UnsupportedMethodHandler implements HttpRequestHandler {
    private final RouteMatcher routeMatcher;
    private final HttpResponse response;

    public UnsupportedMethodHandler(RouteMatcher router) {
        this.routeMatcher = router;
        this.response = new DefaultHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.METHOD_NOT_ALLOWED);
    }

    @Override
    public void handle(ChannelHandlerContext context, HttpRequest request) {
        final Set<String> supportedMethods = routeMatcher.getSupportedMethodsForURL(request.getUri());

        StringBuilder result = new StringBuilder();
        for(String string : supportedMethods) {
            result.append(string);
            result.append(",");
        }
        final String methodsAllowed =  result.length() > 0 ? result.substring(0, result.length() - 1): "";
        response.setHeader("Allow", methodsAllowed);
        HttpResponder.respond(context, request, response);
    }
}


text:
require 'require_all'
require 'her'
require_rel "."

module CompaniesHouseClient
  API_URL = "https://api.companieshouse.gov.uk"
  DOCUMENT_URL = "https://beta.companieshouse.gov.uk"

  class << self

    #access the configuration class
    attr_accessor :configuration

    #block for configuration.
    def configure
      self.configuration ||= Configuration.new
      yield(configuration)
      self.configuration.configure_connection
    end
  end

  class Configuration
    attr_accessor :api_key, :url, :ssl_options, :proxy
    attr_reader :connection

    def initialize
      @connection ||= Her::API.new
      @api_key = ""
      @url = CompaniesHouseClient::API_URL
      @ssl_options = {
        ca_path: CompaniesHouseClient::CAPath.platform_path
      }
      @proxy
    end

    def configure_connection

      @connection.setup url: @url, ssl: @ssl_options, proxy: @proxy do |c|

        #Auth
        c.use Faraday::Request::BasicAuthentication, @api_key, ''

        # Request
        c.use Faraday::Request::UrlEncoded

        # Parse collections
        c.use CompaniesHouseClient::CollectionParser
        # c.use Her::Middleware::DefaultParseJSON

        # Adapter
        c.use Faraday::Adapter::NetHttp
      end
    end
  end
end


text:
'use strict';

var _ = require('lodash'),
	errors = require('../../app/utils/errors');

function addModelCallback(model, res) {
	return function(err) {
		if (err) {
			return res.send(400, {
				message: errors.getErrorMessage(err)
			});
		} else {
			res.jsonp(model);
		}
	};
}
exports.build = function (Model, modelName, additionalFields) {
	additionalFields = additionalFields || [];
	additionalFields.push('user');
	var populateFields = additionalFields.join(' ');

	return {
		create:function(req, res) {
			var model = new Model(req.body);
			model.user = req.user;
			model.save(addModelCallback(model, res));
		},

		read: function(req, res) {
			res.jsonp(req.model);
		},

		update: function(req, res) {
			var model = req.model;
			model = _.extend(model, req.body);
			model.save(addModelCallback(model, res));
		},

		delete: function(req, res) {
			var model = req.model;
			model.remove(addModelCallback(model, res));
		},

		list: function(req, res) {
			Model.find().sort('-created').populate(populateFields).exec(function(err, models) {
				if (err) {
					return res.send(400, {
						message: errors.getErrorMessage(err)
					});
				} else {
					res.jsonp(models);
				}
			});
		},

		findById: function(req, res, next, id) {
			Model.findById(id).populate(populateFields).exec(function(err, model) {
				if (err) return next(err);
				if (!model) return next(new Error('Failed to load ' + modelName + id));
				req.model = model;
				next();
			});
		}
	};
};


text:
class AssignmentPipeline
  attr_accessor :all_statuses

  module AssignmentStatuses
    NOT_YET_STARTED = 'not_yet_started'
    IN_PROGRESS = 'in_progress'
    READY_FOR_REVIEW = 'ready_for_review'
    READY_FOR_MAINSPACE = 'ready_for_mainspace'
    ASSIGNMENT_COMPLETED = 'assignment_completed'
  end

  module ReviewStatuses
    READING_ARTICLE = 'reading_the_article'
    PROVIDING_FEEDBACK = 'providing_feedback'
    POST_TO_TALK = 'post_to_talk'
    PEER_REVIEW_COMPLETED = 'peer_review_completed'
  end

  PIPELINES = {
    assignment: [
      AssignmentStatuses::NOT_YET_STARTED,
      AssignmentStatuses::IN_PROGRESS,
      AssignmentStatuses::READY_FOR_REVIEW,
      AssignmentStatuses::READY_FOR_MAINSPACE,
      AssignmentStatuses::ASSIGNMENT_COMPLETED
    ].freeze,
    review: [
      ReviewStatuses::READING_ARTICLE,
      ReviewStatuses::PROVIDING_FEEDBACK,
      ReviewStatuses::POST_TO_TALK,
      ReviewStatuses::PEER_REVIEW_COMPLETED
    ].freeze
  }.freeze

  def initialize(assignment:)
    @assignment = assignment
    @flags = assignment.flags
    @key = assignment.editing? ? :assignment : :review
    @all_statuses = PIPELINES[@key]
  end

  def status
    return @all_statuses.first unless @flags[@key]
    @flags[@key][:status]
  end

  def update_status(new_status)
    return unless @all_statuses.include?(new_status)
    @flags[@key] = {} unless @flags[@key]
    @flags[@key][:status] = new_status
    @flags[@key][:updated_at] = Time.zone.now
    @assignment.save
  end
end


text:
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class frmAddEditGrades
    Inherits ComponentFactory.Krypton.Toolkit.KryptonForm

    'Form overrides dispose to clean up the component list.
    <System.Diagnostics.DebuggerNonUserCode()> _
    Protected Overrides Sub Dispose(ByVal disposing As Boolean)
        Try
            If disposing AndAlso components IsNot Nothing Then
                components.Dispose()
            End If
        Finally
            MyBase.Dispose(disposing)
        End Try
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.
    'Do not modify it using the code editor.
    <System.Diagnostics.DebuggerStepThrough()> _
    Private Sub InitializeComponent()
        Dim DataGridViewCellStyle5 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle
        Dim DataGridViewCellStyle8 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle
        Dim DataGridViewCellStyle6 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle
        Dim DataGridViewCellStyle7 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle
        Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmAddEditGrades))
        Me.StatusStrip1 = New System.Windows.Forms.StatusStrip
        Me.ToolStripStatusLabel1 = New System.Windows.Forms.ToolStripStatusLabel
        Me.cboInsturctor = New System.Windows.Forms.ComboBox
        Me.KryptonHeader4 = New ComponentFactory.Krypton.Toolkit.KryptonHeader
        Me.dvgLoads = New System.Windows.Forms.DataGridView
        Me.KryptonHeader1 = New ComponentFactory.Krypton.Toolkit.KryptonHeader
        Me.KryptonHeader2 = New ComponentFactory.Krypton.Toolkit.KryptonHeader
        Me.dvgStudents = New System.Windows.Forms.DataGridView
        Me.SOID = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.ESSID = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.StudentID = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.StudentName = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.CourseCode = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.EnrolYear = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.FinalGrade = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.PointGrade = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.GradingRemarks = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.cboTerm = New System.Windows.Forms.ComboBox
        Me.KryptonHeader3 = New ComponentFactory.Krypton.Toolkit.KryptonHeader
        Me.cboSY = New System.Windows.Forms.ComboBox
        Me.KryptonHeader5 = New ComponentFactory.Krypton.Toolkit.KryptonHeader
        Me.cmdSave = New DevExpress.XtraEditors.SimpleButton
        Me.cmdCancel = New DevExpress.XtraEditors.SimpleButton
        Me.cmdCheckGrades = New DevExpress.XtraEditors.SimpleButton
        Me.StatusStrip1.SuspendLayout()
        CType(Me.dvgLoads, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.dvgStudents, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.SuspendLayout()
        '
        'StatusStrip1
        '
        Me.StatusStrip1.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!)
        Me.StatusStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToolStripStatusLabel1})
        Me.StatusStrip1.Location = New System.Drawing.Point(0, 653)
        Me.StatusStrip1.Name = "StatusStrip1"
        Me.StatusStrip1.RenderMode = System.Windows.Forms.ToolStripRenderMode.ManagerRenderMode
        Me.StatusStrip1.Size = New System.Drawing.Size(1154, 22)
        Me.StatusStrip1.TabIndex = 4
        Me.StatusStrip1.Text = "StatusStrip1"
        '
        'ToolStripStatusLabel1
        '
        Me.ToolStripStatusLabel1.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.ToolStripStatusLabel1.Name = "ToolStripStatusLabel1"
        Me.ToolStripStatusLabel1.Size = New System.Drawing.Size(144, 17)
        Me.ToolStripStatusLabel1.Text = " ToolStripStatusLabel1"
        '
        'cboInsturctor
        '
        Me.cboInsturctor.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend
        Me.cboInsturctor.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems
        Me.cboInsturctor.FormattingEnabled = True
        Me.cboInsturctor.Items.AddRange(New Object() {"Male", "Female"})
        Me.cboInsturctor.Location = New System.Drawing.Point(723, 25)
        Me.cboInsturctor.Name = "cboInsturctor"
        Me.cboInsturctor.Size = New System.Drawing.Size(328, 24)
        Me.cboInsturctor.TabIndex = 12
        '
        'KryptonHeader4
        '
        Me.KryptonHeader4.AutoSize = False
        Me.KryptonHeader4.HeaderStyle = ComponentFactory.Krypton.Toolkit.HeaderStyle.Secondary
        Me.KryptonHeader4.Location = New System.Drawing.Point(635, 25)
        Me.KryptonHeader4.Name = "KryptonHeader4"
        Me.KryptonHeader4.Size = New System.Drawing.Size(186, 24)
        Me.KryptonHeader4.StateCommon.Border.DrawBorders = CType(((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top Or ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom) _
                    Or ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left), ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)
        Me.KryptonHeader4.StateCommon.Content.ShortText.Font = New System.Drawing.Font("Tahoma", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.KryptonHeader4.TabIndex = 11
        Me.KryptonHeader4.Text = "Instructor:"
        Me.KryptonHeader4.Values.Description = ""
        Me.KryptonHeader4.Values.Heading = "Instructor:"
        Me.KryptonHeader4.Values.Image = Nothing
        '
        'dvgLoads
        '
        Me.dvgLoads.AllowUserToAddRows = False
        Me.dvgLoads.AllowUserToDeleteRows = False
        Me.dvgLoads.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
                    Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
        Me.dvgLoads.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
        Me.dvgLoads.Location = New System.Drawing.Point(12, 95)
        Me.dvgLoads.Name = "dvgLoads"
        Me.dvgLoads.ReadOnly = True
        Me.dvgLoads.Size = New System.Drawing.Size(416, 480)
        Me.dvgLoads.TabIndex = 13
        '
        'KryptonHeader1
        '
        Me.KryptonHeader1.AutoSize = False
        Me.KryptonHeader1.HeaderStyle = ComponentFactory.Krypton.Toolkit.HeaderStyle.Secondary
        Me.KryptonHeader1.Location = New System.Drawing.Point(12, 65)
        Me.KryptonHeader1.Name = "KryptonHeader1"
        Me.KryptonHeader1.Size = New System.Drawing.Size(416, 24)
        Me.KryptonHeader1.StateCommon.Border.DrawBorders = CType(((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top Or ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom) _
                    Or ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left), ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)
        Me.KryptonHeader1.StateCommon.Content.ShortText.Font = New System.Drawing.Font("Tahoma", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.KryptonHeader1.TabIndex = 14
        Me.KryptonHeader1.Text = "Loads:"
        Me.KryptonHeader1.Values.Description = ""
        Me.KryptonHeader1.Values.Heading = "Loads:"
        Me.KryptonHeader1.Values.Image = Nothing
        '
        'KryptonHeader2
        '
        Me.KryptonHeader2.AutoSize = False
        Me.KryptonHeader2.HeaderStyle = ComponentFactory.Krypton.Toolkit.HeaderStyle.Secondary
        Me.KryptonHeader2.Location = New System.Drawing.Point(434, 65)
        Me.KryptonHeader2.Name = "KryptonHeader2"
        Me.KryptonHeader2.Size = New System.Drawing.Size(708, 24)
        Me.KryptonHeader2.StateCommon.Border.DrawBorders = CType(((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top Or ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom) _
                    Or ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left), ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)
        Me.KryptonHeader2.StateCommon.Content.ShortText.Font = New System.Drawing.Font("Tahoma", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.KryptonHeader2.TabIndex = 16
        Me.KryptonHeader2.Text = "Students:"
        Me.KryptonHeader2.Values.Description = ""
        Me.KryptonHeader2.Values.Heading = "Students:"
        Me.KryptonHeader2.Values.Image = Nothing
        '
        'dvgStudents
        '
        Me.dvgStudents.AllowUserToAddRows = False
        Me.dvgStudents.AllowUserToDeleteRows = False
        Me.dvgStudents.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
                    Or System.Windows.Forms.AnchorStyles.Left) _
                    Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
        DataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter
        DataGridViewCellStyle5.BackColor = System.Drawing.SystemColors.Control
        DataGridViewCellStyle5.Font = New System.Drawing.Font("Tahoma", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        DataGridViewCellStyle5.ForeColor = System.Drawing.SystemColors.WindowText
        DataGridViewCellStyle5.SelectionBackColor = System.Drawing.SystemColors.Highlight
        DataGridViewCellStyle5.SelectionForeColor = System.Drawing.SystemColors.HighlightText
        DataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.[True]
        Me.dvgStudents.ColumnHeadersDefaultCellStyle = DataGridViewCellStyle5
        Me.dvgStudents.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
        Me.dvgStudents.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.SOID, Me.ESSID, Me.StudentID, Me.StudentName, Me.CourseCode, Me.EnrolYear, Me.FinalGrade, Me.PointGrade, Me.GradingRemarks})
        Me.dvgStudents.Location = New System.Drawing.Point(434, 95)
        Me.dvgStudents.Name = "dvgStudents"
        DataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter
        DataGridViewCellStyle8.BackColor = System.Drawing.SystemColors.Control
        DataGridViewCellStyle8.Font = New System.Drawing.Font("Tahoma", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        DataGridViewCellStyle8.ForeColor = System.Drawing.SystemColors.WindowText
        DataGridViewCellStyle8.SelectionBackColor = System.Drawing.SystemColors.Highlight
        DataGridViewCellStyle8.SelectionForeColor = System.Drawing.SystemColors.HighlightText
        DataGridViewCellStyle8.WrapMode = System.Windows.Forms.DataGridViewTriState.[True]
        Me.dvgStudents.RowHeadersDefaultCellStyle = DataGridViewCellStyle8
        Me.dvgStudents.Size = New System.Drawing.Size(708, 480)
        Me.dvgStudents.TabIndex = 15
        '
        'SOID
        '
        Me.SOID.HeaderText = "SOID"
        Me.SOID.Name = "SOID"
        Me.SOID.ReadOnly = True
        Me.SOID.Visible = False
        '
        'ESSID
        '
        Me.ESSID.HeaderText = "ESSID"
        Me.ESSID.Name = "ESSID"
        Me.ESSID.ReadOnly = True
        Me.ESSID.Visible = False
        '
        'StudentID
        '
        Me.StudentID.HeaderText = "StudentID"
        Me.StudentID.Name = "StudentID"
        Me.StudentID.ReadOnly = True
        Me.StudentID.Visible = False
        '
        'StudentName
        '
        Me.StudentName.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill
        Me.StudentName.HeaderText = "Student Name"
        Me.StudentName.Name = "StudentName"
        Me.StudentName.ReadOnly = True
        '
        'CourseCode
        '
        Me.CourseCode.HeaderText = "Course"
        Me.CourseCode.Name = "CourseCode"
        Me.CourseCode.ReadOnly = True
        Me.CourseCode.Width = 65
        '
        'EnrolYear
        '
        Me.EnrolYear.HeaderText = "Year"
        Me.EnrolYear.Name = "EnrolYear"
        Me.EnrolYear.ReadOnly = True
        Me.EnrolYear.Width = 55
        '
        'FinalGrade
        '
        DataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight
        DataGridViewCellStyle6.Format = "N2"
        DataGridViewCellStyle6.NullValue = "0.00"
        Me.FinalGrade.DefaultCellStyle = DataGridViewCellStyle6
        Me.FinalGrade.HeaderText = "Final Grade"
        Me.FinalGrade.Name = "FinalGrade"
        Me.FinalGrade.Width = 75
        '
        'PointGrade
        '
        DataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight
        DataGridViewCellStyle7.NullValue = "0.00"
        Me.PointGrade.DefaultCellStyle = DataGridViewCellStyle7
        Me.PointGrade.HeaderText = "Point Grade"
        Me.PointGrade.Name = "PointGrade"
        Me.PointGrade.ReadOnly = True
        Me.PointGrade.Width = 65
        '
        'GradingRemarks
        '
        Me.GradingRemarks.HeaderText = "Remarks"
        Me.GradingRemarks.Name = "GradingRemarks"
        Me.GradingRemarks.ReadOnly = True
        '
        'cboTerm
        '
        Me.cboTerm.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend
        Me.cboTerm.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems
        Me.cboTerm.FormattingEnabled = True
        Me.cboTerm.Items.AddRange(New Object() {"Second Semester"})
        Me.cboTerm.Location = New System.Drawing.Point(68, 25)
        Me.cboTerm.Name = "cboTerm"
        Me.cboTerm.Size = New System.Drawing.Size(205, 24)
        Me.cboTerm.TabIndex = 18
        '
        'KryptonHeader3
        '
        Me.KryptonHeader3.AutoSize = False
        Me.KryptonHeader3.HeaderStyle = ComponentFactory.Krypton.Toolkit.HeaderStyle.Secondary
        Me.KryptonHeader3.Location = New System.Drawing.Point(12, 25)
        Me.KryptonHeader3.Name = "KryptonHeader3"
        Me.KryptonHeader3.Size = New System.Drawing.Size(186, 24)
        Me.KryptonHeader3.StateCommon.Border.DrawBorders = CType(((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top Or ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom) _
                    Or ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left), ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)
        Me.KryptonHeader3.StateCommon.Content.ShortText.Font = New System.Drawing.Font("Tahoma", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.KryptonHeader3.TabIndex = 17
        Me.KryptonHeader3.Text = "Term:"
        Me.KryptonHeader3.Values.Description = ""
        Me.KryptonHeader3.Values.Heading = "Term:"
        Me.KryptonHeader3.Values.Image = Nothing
        '
        'cboSY
        '
        Me.cboSY.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend
        Me.cboSY.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems
        Me.cboSY.FormattingEnabled = True
        Me.cboSY.Items.AddRange(New Object() {"2011-2012"})
        Me.cboSY.Location = New System.Drawing.Point(367, 25)
        Me.cboSY.Name = "cboSY"
        Me.cboSY.Size = New System.Drawing.Size(205, 24)
        Me.cboSY.TabIndex = 20
        '
        'KryptonHeader5
        '
        Me.KryptonHeader5.AutoSize = False
        Me.KryptonHeader5.HeaderStyle = ComponentFactory.Krypton.Toolkit.HeaderStyle.Secondary
        Me.KryptonHeader5.Location = New System.Drawing.Point(279, 25)
        Me.KryptonHeader5.Name = "KryptonHeader5"
        Me.KryptonHeader5.Size = New System.Drawing.Size(186, 24)
        Me.KryptonHeader5.StateCommon.Border.DrawBorders = CType(((ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Top Or ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Bottom) _
                    Or ComponentFactory.Krypton.Toolkit.PaletteDrawBorders.Left), ComponentFactory.Krypton.Toolkit.PaletteDrawBorders)
        Me.KryptonHeader5.StateCommon.Content.ShortText.Font = New System.Drawing.Font("Tahoma", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.KryptonHeader5.TabIndex = 19
        Me.KryptonHeader5.Text = "School Year:"
        Me.KryptonHeader5.Values.Description = ""
        Me.KryptonHeader5.Values.Heading = "School Year:"
        Me.KryptonHeader5.Values.Image = Nothing
        '
        'cmdSave
        '
        Me.cmdSave.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
        Me.cmdSave.Appearance.Font = New System.Drawing.Font("Tahoma", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.cmdSave.Appearance.Options.UseFont = True
        Me.cmdSave.Image = CType(resources.GetObject("cmdSave.Image"), System.Drawing.Image)
        Me.cmdSave.Location = New System.Drawing.Point(914, 597)
        Me.cmdSave.LookAndFeel.SkinName = "iMaginary"
        Me.cmdSave.LookAndFeel.UseDefaultLookAndFeel = False
        Me.cmdSave.Name = "cmdSave"
        Me.cmdSave.Size = New System.Drawing.Size(111, 32)
        Me.cmdSave.TabIndex = 22
        Me.cmdSave.TabStop = False
        Me.cmdSave.Text = "Save [F2]"
        '
        'cmdCancel
        '
        Me.cmdCancel.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
        Me.cmdCancel.Appearance.Font = New System.Drawing.Font("Tahoma", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.cmdCancel.Appearance.Options.UseFont = True
        Me.cmdCancel.Image = CType(resources.GetObject("cmdCancel.Image"), System.Drawing.Image)
        Me.cmdCancel.Location = New System.Drawing.Point(1031, 597)
        Me.cmdCancel.LookAndFeel.SkinName = "iMaginary"
        Me.cmdCancel.LookAndFeel.UseDefaultLookAndFeel = False
        Me.cmdCancel.Name = "cmdCancel"
        Me.cmdCancel.Size = New System.Drawing.Size(111, 32)
        Me.cmdCancel.TabIndex = 23
        Me.cmdCancel.TabStop = False
        Me.cmdCancel.Text = "Cancel [Esc]"
        '
        'cmdCheckGrades
        '
        Me.cmdCheckGrades.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
        Me.cmdCheckGrades.Appearance.Font = New System.Drawing.Font("Tahoma", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.cmdCheckGrades.Appearance.Options.UseFont = True
        Me.cmdCheckGrades.Image = CType(resources.GetObject("cmdCheckGrades.Image"), System.Drawing.Image)
        Me.cmdCheckGrades.Location = New System.Drawing.Point(797, 597)
        Me.cmdCheckGrades.LookAndFeel.SkinName = "iMaginary"
        Me.cmdCheckGrades.LookAndFeel.UseDefaultLookAndFeel = False
        Me.cmdCheckGrades.Name = "cmdCheckGrades"
        Me.cmdCheckGrades.Size = New System.Drawing.Size(111, 32)
        Me.cmdCheckGrades.TabIndex = 24
        Me.cmdCheckGrades.TabStop = False
        Me.cmdCheckGrades.Text = "Check Grades"
        '
        'frmAddEditGrades
        '
        Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 16.0!)
        Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
        Me.BackColor = System.Drawing.SystemColors.GradientInactiveCaption
        Me.ClientSize = New System.Drawing.Size(1154, 675)
        Me.Controls.Add(Me.cmdCheckGrades)
        Me.Controls.Add(Me.cmdSave)
        Me.Controls.Add(Me.cmdCancel)
        Me.Controls.Add(Me.cboSY)
        Me.Controls.Add(Me.KryptonHeader5)
        Me.Controls.Add(Me.cboTerm)
        Me.Controls.Add(Me.KryptonHeader3)
        Me.Controls.Add(Me.KryptonHeader2)
        Me.Controls.Add(Me.dvgStudents)
        Me.Controls.Add(Me.KryptonHeader1)
        Me.Controls.Add(Me.dvgLoads)
        Me.Controls.Add(Me.cboInsturctor)
        Me.Controls.Add(Me.KryptonHeader4)
        Me.Controls.Add(Me.StatusStrip1)
        Me.Font = New System.Drawing.Font("Tahoma", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
        Me.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4)
        Me.Name = "frmAddEditGrades"
        Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
        Me.Text = " Add Edit Grades"
        Me.WindowState = System.Windows.Forms.FormWindowState.Maximized
        Me.StatusStrip1.ResumeLayout(False)
        Me.StatusStrip1.PerformLayout()
        CType(Me.dvgLoads, System.ComponentModel.ISupportInitialize).EndInit()
        CType(Me.dvgStudents, System.ComponentModel.ISupportInitialize).EndInit()
        Me.ResumeLayout(False)
        Me.PerformLayout()

    End Sub
    Friend WithEvents StatusStrip1 As System.Windows.Forms.StatusStrip
    Friend WithEvents ToolStripStatusLabel1 As System.Windows.Forms.ToolStripStatusLabel
    Friend WithEvents cboInsturctor As System.Windows.Forms.ComboBox
    Friend WithEvents KryptonHeader4 As ComponentFactory.Krypton.Toolkit.KryptonHeader
    Friend WithEvents dvgLoads As System.Windows.Forms.DataGridView
    Friend WithEvents KryptonHeader1 As ComponentFactory.Krypton.Toolkit.KryptonHeader
    Friend WithEvents KryptonHeader2 As ComponentFactory.Krypton.Toolkit.KryptonHeader
    Friend WithEvents dvgStudents As System.Windows.Forms.DataGridView
    Friend WithEvents cboTerm As System.Windows.Forms.ComboBox
    Friend WithEvents KryptonHeader3 As ComponentFactory.Krypton.Toolkit.KryptonHeader
    Friend WithEvents cboSY As System.Windows.Forms.ComboBox
    Friend WithEvents KryptonHeader5 As ComponentFactory.Krypton.Toolkit.KryptonHeader
    Friend WithEvents SOID As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents ESSID As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents StudentID As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents StudentName As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents CourseCode As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents EnrolYear As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents FinalGrade As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents PointGrade As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents GradingRemarks As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents cmdSave As DevExpress.XtraEditors.SimpleButton
    Friend WithEvents cmdCancel As DevExpress.XtraEditors.SimpleButton
    Friend WithEvents cmdCheckGrades As DevExpress.XtraEditors.SimpleButton
End Class


text:
<?php

namespace App\FrontModule\Presenters;

abstract class BasePresenter extends \App\Presenters\BasePresenter
{

}


text:
require 'rack'

module ToTag
  class Viewer
    def self.serve params
      dir = params.fetch :dir
      port = params.fetch :port

      app = Rack::Builder.new do
        use Rack::Static, root: dir,
          urls: [''], index: 'index.html'
        run proc { }
      end
      Rack::Server.start app: app, port: port
    end
  end
end


text:
<?php
if (isset($_GET["xhprof"]) &&  extension_loaded('xhprof')) {
  $profiler_namespace = 'myapp';  // namespace for your application
  $xhprof_data = xhprof_disable();
  $xhprof_runs = new XHProfRuns_Default();
  $run_id = $xhprof_runs->save_run($xhprof_data, $profiler_namespace);

  // url to the XHProf UI libraries (change the host name and path)
  $profiler_url = sprintf('/xhprof/xhprof_html/index.php?run=%s&source=%s', $run_id, $profiler_namespace);

	echo 'Profiler output';

}


text:
' Licensed to the .NET Foundation under one or more agreements.
' The .NET Foundation licenses this file to you under the MIT license.
' See the LICENSE file in the project root for more information.

Imports System.Collections.Concurrent
Imports System.Collections.Immutable
Imports System.Threading
Imports Microsoft.Cci
Imports Microsoft.CodeAnalysis.PooledObjects
Imports Microsoft.CodeAnalysis.VisualBasic.Symbols

Namespace Microsoft.CodeAnalysis.VisualBasic.Emit

    Partial Friend Class PEModuleBuilder

        ' TODO: Need to estimate amount of elements for this map and pass that value to the constructor.
        Protected ReadOnly m_AssemblyOrModuleSymbolToModuleRefMap As New ConcurrentDictionary(Of Symbol, Microsoft.Cci.IModuleReference)()
        Private ReadOnly _genericInstanceMap As New ConcurrentDictionary(Of Symbol, Object)()
        Private ReadOnly _translatedImportsMap As New ConcurrentDictionary(Of SourceFile, ImmutableArray(Of Cci.UsedNamespaceOrType))(ReferenceEqualityComparer.Instance)
        Private ReadOnly _reportedErrorTypesMap As New ConcurrentSet(Of TypeSymbol)()

        Private ReadOnly _embeddedTypesManagerOpt As NoPia.EmbeddedTypesManager
        Public Overrides ReadOnly Property EmbeddedTypesManagerOpt As NoPia.EmbeddedTypesManager
            Get
                Return _embeddedTypesManagerOpt
            End Get
        End Property

        ''' <summary> Stores collection of all embedded symbols referenced from IL </summary>
        Private _addedEmbeddedSymbols As ConcurrentSet(Of Symbol) = Nothing

        ''' <summary> Adds a symbol to the collection of referenced embedded symbols </summary>
        Private Sub ProcessReferencedSymbol(symbol As Symbol)
            Dim kind = symbol.EmbeddedSymbolKind
            If kind = EmbeddedSymbolKind.None Then
                Return
            End If

            Debug.Assert(symbol.ContainingModule Is Me.SourceModule)

            If _addedEmbeddedSymbols Is Nothing Then
                Interlocked.CompareExchange(_addedEmbeddedSymbols, New ConcurrentSet(Of Symbol)(ReferenceEqualityComparer.Instance), Nothing)
            End If

            Dim manager = SourceModule.ContainingSourceAssembly.DeclaringCompilation.EmbeddedSymbolManager
            manager.MarkSymbolAsReferenced(symbol.OriginalDefinition, _addedEmbeddedSymbols)
        End Sub

        Friend NotOverridable Overrides Function Translate(assembly As AssemblySymbol, diagnostics As DiagnosticBag) As Microsoft.Cci.IAssemblyReference
            If SourceModule.ContainingAssembly Is assembly Then
                Return DirectCast(Me, Microsoft.Cci.IAssemblyReference)
            End If

            Dim reference As Microsoft.Cci.IModuleReference = Nothing

            If m_AssemblyOrModuleSymbolToModuleRefMap.TryGetValue(assembly, reference) Then
                Return DirectCast(reference, Microsoft.Cci.IAssemblyReference)
            End If

            Dim asmRef = New AssemblyReference(assembly)

            Dim cachedAsmRef = DirectCast(m_AssemblyOrModuleSymbolToModuleRefMap.GetOrAdd(assembly, asmRef), AssemblyReference)

            If cachedAsmRef Is asmRef Then
                ValidateReferencedAssembly(assembly, cachedAsmRef, diagnostics)
            End If

            ' TryAdd here because whatever is associated with assembly should be associated with modules(0)
            m_AssemblyOrModuleSymbolToModuleRefMap.TryAdd(assembly.Modules(0), cachedAsmRef)

            Return cachedAsmRef
        End Function

        Friend Overloads Function Translate([module] As ModuleSymbol, diagnostics As DiagnosticBag) As Microsoft.Cci.IModuleReference
            If SourceModule Is [module] Then
                Return Me
            End If

            Dim moduleRef As Microsoft.Cci.IModuleReference = Nothing

            If m_AssemblyOrModuleSymbolToModuleRefMap.TryGetValue([module], moduleRef) Then
                Return moduleRef
            End If

            moduleRef = TranslateModule([module], diagnostics)
            moduleRef = m_AssemblyOrModuleSymbolToModuleRefMap.GetOrAdd([module], moduleRef)
            Return moduleRef
        End Function

        Protected Overridable Function TranslateModule([module] As ModuleSymbol, diagnostics As DiagnosticBag) As Microsoft.Cci.IModuleReference
            Dim container As AssemblySymbol = [module].ContainingAssembly

            If container IsNot Nothing AndAlso container.Modules(0) Is [module] Then
                Dim moduleRef As Microsoft.Cci.IModuleReference = New AssemblyReference(container)
                Dim cachedModuleRef As Microsoft.Cci.IModuleReference = m_AssemblyOrModuleSymbolToModuleRefMap.GetOrAdd(container, moduleRef)

                If cachedModuleRef Is moduleRef Then
                    ValidateReferencedAssembly(container, DirectCast(moduleRef, AssemblyReference), diagnostics)
                Else
                    moduleRef = cachedModuleRef
                End If

                Return moduleRef
            Else
                Return New ModuleReference(Me, [module])
            End If
        End Function

        Friend Overloads Function Translate(
            namedTypeSymbol As NamedTypeSymbol,
            syntaxNodeOpt As SyntaxNode,
            diagnostics As DiagnosticBag,
            Optional fromImplements As Boolean = False,
            Optional needDeclaration As Boolean = False
        ) As Microsoft.Cci.INamedTypeReference
            Debug.Assert(namedTypeSymbol Is namedTypeSymbol.OriginalDefinition OrElse
                                            Not namedTypeSymbol.Equals(namedTypeSymbol.OriginalDefinition))
            Debug.Assert(diagnostics IsNot Nothing)

            ' Anonymous type being translated
            If namedTypeSymbol.IsAnonymousType Then
                namedTypeSymbol = AnonymousTypeManager.TranslateAnonymousTypeSymbol(namedTypeSymbol)
            ElseIf namedTypeSymbol.IsTupleType Then
                Debug.Assert(Not needDeclaration)
                namedTypeSymbol = namedTypeSymbol.TupleUnderlyingType

                CheckTupleUnderlyingType(namedTypeSymbol, syntaxNodeOpt, diagnostics)
            End If

            ' Substitute error types with a special singleton object.
            ' Unreported bad types can come through NoPia embedding, for example.
            If namedTypeSymbol.OriginalDefinition.Kind = SymbolKind.ErrorType Then
                Dim errorType = DirectCast(namedTypeSymbol.OriginalDefinition, ErrorTypeSymbol)
                Dim diagInfo = If(errorType.GetUseSiteInfo().DiagnosticInfo, errorType.ErrorInfo)

                If diagInfo Is Nothing AndAlso namedTypeSymbol.Kind = SymbolKind.ErrorType Then
                    errorType = DirectCast(namedTypeSymbol, ErrorTypeSymbol)
                    diagInfo = If(errorType.GetUseSiteInfo().DiagnosticInfo, errorType.ErrorInfo)
                End If

                ' Try to decrease noise by not complaining about the same type over and over again.
                If _reportedErrorTypesMap.Add(errorType) Then
                    diagnostics.Add(New VBDiagnostic(
                                    If(diagInfo, ErrorFactory.ErrorInfo(ERRID.ERR_UnsupportedType1, String.Empty)),
                                    If(syntaxNodeOpt Is Nothing, NoLocation.Singleton, syntaxNodeOpt.GetLocation())))
                End If

                Return Microsoft.CodeAnalysis.Emit.ErrorType.Singleton
            End If

            Me.ProcessReferencedSymbol(namedTypeSymbol)

            If namedTypeSymbol IsNot namedTypeSymbol.OriginalDefinition Then
                ' generic instantiation for sure
                Debug.Assert(Not needDeclaration)

                If namedTypeSymbol.IsUnboundGenericType Then
                    namedTypeSymbol = namedTypeSymbol.OriginalDefinition
                Else
                    Return DirectCast(GetCciAdapter(namedTypeSymbol), Microsoft.Cci.INamedTypeReference)
                End If

            ElseIf Not needDeclaration Then

                Dim reference As Object = Nothing
                Dim typeRef As Microsoft.Cci.INamedTypeReference
                Dim container As NamedTypeSymbol = namedTypeSymbol.ContainingType

                If namedTypeSymbol.Arity > 0 Then

                    If _genericInstanceMap.TryGetValue(namedTypeSymbol, reference) Then
                        Return DirectCast(reference, Microsoft.Cci.INamedTypeReference)
                    End If

                    If container IsNot Nothing Then
                        If IsOrInGenericType(container) Then
                            ' Container is a generic instance too.
                            typeRef = New SpecializedGenericNestedTypeInstanceReference(namedTypeSymbol)
                        Else
                            typeRef = New GenericNestedTypeInstanceReference(namedTypeSymbol)
                        End If
                    Else
                        typeRef = New GenericNamespaceTypeInstanceReference(namedTypeSymbol)
                    End If

                    typeRef = DirectCast(_genericInstanceMap.GetOrAdd(namedTypeSymbol, typeRef), Microsoft.Cci.INamedTypeReference)
                    Return typeRef
                Else
                    If IsOrInGenericType(container) Then
                        Debug.Assert(container IsNot Nothing)

                        If _genericInstanceMap.TryGetValue(namedTypeSymbol, reference) Then
                            Return DirectCast(reference, Microsoft.Cci.INamedTypeReference)
                        End If

                        typeRef = New SpecializedNestedTypeReference(namedTypeSymbol)
                        typeRef = DirectCast(_genericInstanceMap.GetOrAdd(namedTypeSymbol, typeRef), Microsoft.Cci.INamedTypeReference)
                        Return typeRef
                    End If
                End If
            End If

            Return If(_embeddedTypesManagerOpt?.EmbedTypeIfNeedTo(namedTypeSymbol, fromImplements, syntaxNodeOpt, diagnostics), namedTypeSymbol.GetCciAdapter())
        End Function

        Private Function GetCciAdapter(symbol As Symbol) As Object
            Return _genericInstanceMap.GetOrAdd(symbol, Function(s) s.GetCciAdapter())
        End Function

        Private Sub CheckTupleUnderlyingType(namedTypeSymbol As NamedTypeSymbol, syntaxNodeOpt As SyntaxNode, diagnostics As DiagnosticBag)
            ' check that underlying type of a ValueTuple is indeed a value type (or error)
            ' this should never happen, in theory,
            ' but if it does happen we should make it a failure.
            ' NOTE: declaredBase could be null for interfaces
            Dim declaredBase = namedTypeSymbol.BaseTypeNoUseSiteDiagnostics
            If declaredBase IsNot Nothing AndAlso declaredBase.SpecialType = SpecialType.System_ValueType Then
                Return
            End If

            ' Try to decrease noise by not complaining about the same type over and over again.
            If Not _reportedErrorTypesMap.Add(namedTypeSymbol) Then
                Return
            End If

            Dim location = If(syntaxNodeOpt Is Nothing, NoLocation.Singleton, syntaxNodeOpt.GetLocation())
            If declaredBase IsNot Nothing Then
                Dim diagnosticInfo = declaredBase.GetUseSiteInfo().DiagnosticInfo
                If diagnosticInfo IsNot Nothing Then
                    diagnostics.Add(diagnosticInfo, location)
                    Return
                End If
            End If

            diagnostics.Add(
                New VBDiagnostic(
                    ErrorFactory.ErrorInfo(ERRID.ERR_PredefinedValueTupleTypeMustBeStruct, namedTypeSymbol.MetadataName),
                    location))
        End Sub

        Friend Overloads Function Translate([param] As TypeParameterSymbol) As Microsoft.Cci.IGenericParameterReference
            Debug.Assert(param Is param.OriginalDefinition)
            Return [param].GetCciAdapter()
        End Function

        Friend NotOverridable Overrides Function Translate(
            typeSymbol As TypeSymbol,
            syntaxNodeOpt As SyntaxNode,
            diagnostics As DiagnosticBag
        ) As Microsoft.Cci.ITypeReference
            Debug.Assert(diagnostics IsNot Nothing)

            Select Case typeSymbol.Kind
                Case SymbolKind.ArrayType
                    Return Translate(DirectCast(typeSymbol, ArrayTypeSymbol))
                Case SymbolKind.NamedType, SymbolKind.ErrorType
                    Return Translate(DirectCast(typeSymbol, NamedTypeSymbol), syntaxNodeOpt, diagnostics)
                Case SymbolKind.TypeParameter
                    Return Translate(DirectCast(typeSymbol, TypeParameterSymbol))
                Case Else
                    Throw ExceptionUtilities.UnexpectedValue(typeSymbol.Kind)
            End Select
        End Function

        Friend Overloads Function Translate(
            fieldSymbol As FieldSymbol,
            syntaxNodeOpt As SyntaxNode,
            diagnostics As DiagnosticBag,
            Optional needDeclaration As Boolean = False
        ) As Microsoft.Cci.IFieldReference
            Debug.Assert(fieldSymbol Is fieldSymbol.OriginalDefinition OrElse
                         Not fieldSymbol.Equals(fieldSymbol.OriginalDefinition))
            Debug.Assert(Not fieldSymbol.IsTupleField, "tuple fields should be rewritten to underlying by now")

            Me.ProcessReferencedSymbol(fieldSymbol)

            If fieldSymbol IsNot fieldSymbol.OriginalDefinition Then
                Debug.Assert(Not needDeclaration)
                Return DirectCast(GetCciAdapter(fieldSymbol), Microsoft.Cci.IFieldReference)

            ElseIf Not needDeclaration AndAlso IsOrInGenericType(fieldSymbol.ContainingType) Then

                Dim reference As Object = Nothing
                Dim fieldRef As Microsoft.Cci.IFieldReference

                If _genericInstanceMap.TryGetValue(fieldSymbol, reference) Then
                    Return DirectCast(reference, Microsoft.Cci.IFieldReference)
                End If

                fieldRef = New SpecializedFieldReference(fieldSymbol)
                fieldRef = DirectCast(_genericInstanceMap.GetOrAdd(fieldSymbol, fieldRef), Microsoft.Cci.IFieldReference)
                Return fieldRef
            End If

            If _embeddedTypesManagerOpt IsNot Nothing Then
                Return _embeddedTypesManagerOpt.EmbedFieldIfNeedTo(fieldSymbol.GetCciAdapter(), syntaxNodeOpt, diagnostics)
            End If

            Return fieldSymbol.GetCciAdapter()
        End Function

        Public Shared Function MemberVisibility(symbol As Symbol) As Microsoft.Cci.TypeMemberVisibility
            '
            ' We need to relax visibility of members in interactive submissions since they might be emitted into multiple assemblies.
            '
            ' Top-level:
            '   private                       -> public
            '   family                        -> public (compiles with a warning)
            '   public
            '   friend                        -> public
            '
            ' In a nested class:
            '
            '   private
            '   family
            '   public
            '   friend                        -> public
            '
            Select Case symbol.DeclaredAccessibility
                Case Accessibility.Public
                    Return Microsoft.Cci.TypeMemberVisibility.Public

                Case Accessibility.Private
                    If symbol.ContainingType.TypeKind = TypeKind.Submission Then
                        Return Microsoft.Cci.TypeMemberVisibility.Public
                    Else
                        Return Microsoft.Cci.TypeMemberVisibility.Private
                    End If

                Case Accessibility.Friend
                    If symbol.ContainingAssembly.IsInteractive Then
                        Return Microsoft.Cci.TypeMemberVisibility.Public
                    Else
                        Return Microsoft.Cci.TypeMemberVisibility.Assembly
                    End If

                Case Accessibility.Protected
                    If symbol.ContainingType.TypeKind = TypeKind.Submission Then
                        Return Microsoft.Cci.TypeMemberVisibility.Public
                    Else
                        Return Microsoft.Cci.TypeMemberVisibility.Family
                    End If

                Case Accessibility.ProtectedAndFriend
                    Debug.Assert(symbol.ContainingType.TypeKind <> TypeKind.Submission)
                    Return Microsoft.Cci.TypeMemberVisibility.FamilyAndAssembly

                Case Accessibility.ProtectedOrFriend
                    If symbol.ContainingAssembly.IsInteractive Then
                        Return Microsoft.Cci.TypeMemberVisibility.Public
                    Else
                        Return Microsoft.Cci.TypeMemberVisibility.FamilyOrAssembly
                    End If
                Case Else
                    Throw ExceptionUtilities.UnexpectedValue(symbol.DeclaredAccessibility)
            End Select
        End Function

        Friend Overloads Overrides Function Translate(symbol As MethodSymbol, diagnostics As DiagnosticBag, needDeclaration As Boolean) As IMethodReference
            Return Translate(symbol, Nothing, diagnostics, needDeclaration)
        End Function

        Friend Overloads Function Translate(
            methodSymbol As MethodSymbol,
            syntaxNodeOpt As SyntaxNode,
            diagnostics As DiagnosticBag,
            Optional needDeclaration As Boolean = False
        ) As Microsoft.Cci.IMethodReference
            Debug.Assert(Not methodSymbol.IsDefaultValueTypeConstructor())
            Debug.Assert(methodSymbol Is methodSymbol.OriginalDefinition OrElse
                                            Not methodSymbol.Equals(methodSymbol.OriginalDefinition))

            Dim container As NamedTypeSymbol = methodSymbol.ContainingType

            ' Method of anonymous type being translated
            If container.IsAnonymousType Then
                methodSymbol = AnonymousTypeManager.TranslateAnonymousTypeMethodSymbol(methodSymbol)

            ElseIf methodSymbol.IsTupleMethod Then
                Debug.Assert(Not needDeclaration)
                Debug.Assert(container.IsTupleType)
                container = container.TupleUnderlyingType
                methodSymbol = methodSymbol.TupleUnderlyingMethod
            End If

            Debug.Assert(Not container.IsTupleType)

            Me.ProcessReferencedSymbol(methodSymbol)

            If methodSymbol.OriginalDefinition IsNot methodSymbol Then

                Debug.Assert(Not needDeclaration)
                Return DirectCast(GetCciAdapter(methodSymbol), Microsoft.Cci.IMethodReference)

            ElseIf Not needDeclaration Then
                Dim methodIsGeneric As Boolean = methodSymbol.IsGenericMethod
                Dim typeIsGeneric As Boolean = IsOrInGenericType(container)

                If methodIsGeneric OrElse typeIsGeneric Then
                    Dim reference As Object = Nothing
                    Dim methodRef As Microsoft.Cci.IMethodReference

                    If _genericInstanceMap.TryGetValue(methodSymbol, reference) Then
                        Return DirectCast(reference, Microsoft.Cci.IMethodReference)
                    End If

                    If methodIsGeneric Then
                        If typeIsGeneric Then
                            ' Specialized and generic instance at the same time.
                            methodRef = New SpecializedGenericMethodInstanceReference(methodSymbol)
                        Else
                            methodRef = New GenericMethodInstanceReference(methodSymbol)
                        End If
                    Else
                        Debug.Assert(typeIsGeneric)
                        methodRef = New SpecializedMethodReference(methodSymbol)
                    End If

                    methodRef = DirectCast(_genericInstanceMap.GetOrAdd(methodSymbol, methodRef), Microsoft.Cci.IMethodReference)
                    Return methodRef
                End If
            End If

            If _embeddedTypesManagerOpt IsNot Nothing Then
                Return _embeddedTypesManagerOpt.EmbedMethodIfNeedTo(methodSymbol.GetCciAdapter(), syntaxNodeOpt, diagnostics)
            End If

            Return methodSymbol.GetCciAdapter()
        End Function

        Friend Overloads Function TranslateOverriddenMethodReference(methodSymbol As MethodSymbol, syntaxNodeOpt As VisualBasicSyntaxNode, diagnostics As DiagnosticBag) As Microsoft.Cci.IMethodReference
            Dim methodRef As Microsoft.Cci.IMethodReference
            Dim container As NamedTypeSymbol = methodSymbol.ContainingType

            If container.IsOrInGenericType() Then
                If methodSymbol.IsDefinition Then
                    Dim reference As Object = Nothing

                    If _genericInstanceMap.TryGetValue(methodSymbol, reference) Then
                        methodRef = DirectCast(reference, Microsoft.Cci.IMethodReference)
                    Else
                        methodRef = New SpecializedMethodReference(methodSymbol)
                        methodRef = DirectCast(_genericInstanceMap.GetOrAdd(methodSymbol, methodRef), Microsoft.Cci.IMethodReference)
                    End If
                Else
                    methodRef = New SpecializedMethodReference(methodSymbol)
                End If
            Else
                Debug.Assert(methodSymbol.IsDefinition)

                If _embeddedTypesManagerOpt IsNot Nothing Then
                    methodRef = _embeddedTypesManagerOpt.EmbedMethodIfNeedTo(methodSymbol.GetCciAdapter(), syntaxNodeOpt, diagnostics)
                Else
                    methodRef = methodSymbol.GetCciAdapter()
                End If
            End If

            Return methodRef
        End Function

        Friend Overloads Function Translate(params As ImmutableArray(Of ParameterSymbol)) As ImmutableArray(Of Microsoft.Cci.IParameterTypeInformation)
            Debug.Assert(params.All(Function(p) p.IsDefinitionOrDistinct()))

            Dim mustBeTranslated = params.Any AndAlso MustBeWrapped(params.First())
            Debug.Assert(params.All(Function(p) mustBeTranslated = MustBeWrapped(p)), "either all or no parameters need translating")

            If (Not mustBeTranslated) Then
#If DEBUG Then
                Return params.SelectAsArray(Of Cci.IParameterTypeInformation)(Function(p) p.GetCciAdapter())
#Else
                Return StaticCast(Of Microsoft.Cci.IParameterTypeInformation).From(params)
#End If
            End If

            Return TranslateAll(params)
        End Function

        Private Shared Function MustBeWrapped(param As ParameterSymbol) As Boolean
            ' we represent parameters of generic methods as definitions
            ' CCI wants them represented as IParameterTypeInformation
            ' so we need to create a wrapper of parameters iff
            ' 1) parameters are definitions And
            ' 2) container Is generic
            ' NOTE: all parameters must always agree On whether they need wrapping
            If (param.IsDefinition) Then
                Dim container = param.ContainingSymbol
                If (ContainerIsGeneric(container)) Then
                    Return True
                End If
            End If

            Return False
        End Function

        Private Function TranslateAll(params As ImmutableArray(Of ParameterSymbol)) As ImmutableArray(Of Microsoft.Cci.IParameterTypeInformation)
            Dim builder = ArrayBuilder(Of Microsoft.Cci.IParameterTypeInformation).GetInstance()
            For Each param In params
                builder.Add(CreateParameterTypeInformationWrapper(param))
            Next
            Return builder.ToImmutableAndFree
        End Function

        Private Function CreateParameterTypeInformationWrapper(param As ParameterSymbol) As Cci.IParameterTypeInformation
            Dim reference As Object = Nothing
            Dim paramRef As Microsoft.Cci.IParameterTypeInformation

            If (Me._genericInstanceMap.TryGetValue(param, reference)) Then
                Return DirectCast(reference, Microsoft.Cci.IParameterTypeInformation)
            End If

            paramRef = New ParameterTypeInformation(param)
            paramRef = DirectCast(_genericInstanceMap.GetOrAdd(param, paramRef), Microsoft.Cci.IParameterTypeInformation)

            Return paramRef
        End Function

        Private Shared Function ContainerIsGeneric(container As Symbol) As Boolean
            Return container.Kind = SymbolKind.Method AndAlso (DirectCast(container, MethodSymbol)).IsGenericMethod OrElse
                container.ContainingType.IsGenericType

        End Function

        Friend Overloads Function Translate(symbol As ArrayTypeSymbol) As Microsoft.Cci.IArrayTypeReference
            Return DirectCast(GetCciAdapter(symbol), Microsoft.Cci.IArrayTypeReference)
        End Function

        Friend Function TryGetTranslatedImports(file As SourceFile, <Runtime.InteropServices.Out> ByRef [imports] As ImmutableArray(Of Cci.UsedNamespaceOrType)) As Boolean
            Return _translatedImportsMap.TryGetValue(file, [imports])
        End Function

        Friend Function GetOrAddTranslatedImports(file As SourceFile, [imports] As ImmutableArray(Of Cci.UsedNamespaceOrType)) As ImmutableArray(Of Cci.UsedNamespaceOrType)
            Return _translatedImportsMap.GetOrAdd(file, [imports])
        End Function
    End Class
End Namespace