text:
package org.apache.drill.exec.store.mapr.db;

import org.apache.calcite.plan.RelOptRuleCall;
import org.apache.calcite.plan.RelOptRuleOperand;
import org.apache.calcite.plan.RelOptUtil;
import org.apache.calcite.rel.RelNode;
import org.apache.calcite.rex.RexNode;
import org.apache.drill.common.expression.LogicalExpression;
import org.apache.drill.exec.planner.logical.DrillOptiq;
import org.apache.drill.exec.planner.logical.DrillParseContext;
import org.apache.drill.exec.planner.logical.RelOptHelper;
import org.apache.drill.exec.planner.physical.FilterPrel;
import org.apache.drill.exec.planner.physical.PrelUtil;
import org.apache.drill.exec.planner.physical.ProjectPrel;
import org.apache.drill.exec.planner.physical.ScanPrel;
import org.apache.drill.exec.store.StoragePluginOptimizerRule;
import org.apache.drill.exec.store.hbase.HBaseScanSpec;
import org.apache.drill.exec.store.mapr.db.binary.BinaryTableGroupScan;
import org.apache.drill.exec.store.mapr.db.binary.MapRDBFilterBuilder;
import org.apache.drill.exec.store.mapr.db.json.JsonConditionBuilder;
import org.apache.drill.exec.store.mapr.db.json.JsonScanSpec;
import org.apache.drill.exec.store.mapr.db.json.JsonTableGroupScan;

import com.google.common.collect.ImmutableList;

public abstract class MapRDBPushFilterIntoScan extends StoragePluginOptimizerRule {
  static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(MapRDBPushFilterIntoScan.class);

  private MapRDBPushFilterIntoScan(RelOptRuleOperand operand, String description) {
    super(operand, description);
  }

  public static final StoragePluginOptimizerRule FILTER_ON_SCAN = new MapRDBPushFilterIntoScan(RelOptHelper.some(FilterPrel.class, RelOptHelper.any(ScanPrel.class)), "MapRDBPushFilterIntoScan:Filter_On_Scan") {

    @Override
    public void onMatch(RelOptRuleCall call) {
      final ScanPrel scan = (ScanPrel) call.rel(1);
      final FilterPrel filter = (FilterPrel) call.rel(0);
      final RexNode condition = filter.getCondition();

      if (scan.getGroupScan() instanceof BinaryTableGroupScan) {
        BinaryTableGroupScan groupScan = (BinaryTableGroupScan)scan.getGroupScan();
        doPushFilterIntoBinaryGroupScan(call, filter, null, scan, groupScan, condition);
      } else {
        assert(scan.getGroupScan() instanceof JsonTableGroupScan);
        JsonTableGroupScan groupScan = (JsonTableGroupScan)scan.getGroupScan();
        doPushFilterIntoJsonGroupScan(call, filter, null, scan, groupScan, condition);
      }
    }

    @Override
    public boolean matches(RelOptRuleCall call) {
      final ScanPrel scan = (ScanPrel) call.rel(1);
      if (scan.getGroupScan() instanceof BinaryTableGroupScan ||
          scan.getGroupScan() instanceof JsonTableGroupScan) {
        return super.matches(call);
      }
      return false;
    }
  };

  public static final StoragePluginOptimizerRule FILTER_ON_PROJECT = new MapRDBPushFilterIntoScan(RelOptHelper.some(FilterPrel.class, RelOptHelper.some(ProjectPrel.class, RelOptHelper.any(ScanPrel.class))), "MapRDBPushFilterIntoScan:Filter_On_Project") {

    @Override
    public void onMatch(RelOptRuleCall call) {
      final ScanPrel scan = (ScanPrel) call.rel(2);
      final ProjectPrel project = (ProjectPrel) call.rel(1);
      final FilterPrel filter = (FilterPrel) call.rel(0);

      // convert the filter to one that references the child of the project
      final RexNode condition =  RelOptUtil.pushPastProject(filter.getCondition(), project);

      if (scan.getGroupScan() instanceof BinaryTableGroupScan) {
        BinaryTableGroupScan groupScan = (BinaryTableGroupScan)scan.getGroupScan();
        doPushFilterIntoBinaryGroupScan(call, filter, project, scan, groupScan, condition);
      } else {
        assert(scan.getGroupScan() instanceof JsonTableGroupScan);
        JsonTableGroupScan groupScan = (JsonTableGroupScan)scan.getGroupScan();
        doPushFilterIntoJsonGroupScan(call, filter, project, scan, groupScan, condition);
      }
    }

    @Override
    public boolean matches(RelOptRuleCall call) {
      final ScanPrel scan = (ScanPrel) call.rel(2);
      if (scan.getGroupScan() instanceof BinaryTableGroupScan ||
          scan.getGroupScan() instanceof JsonTableGroupScan) {
        return super.matches(call);
      }
      return false;
    }
  };

  protected void doPushFilterIntoJsonGroupScan(RelOptRuleCall call,
      FilterPrel filter, final ProjectPrel project, ScanPrel scan,
      JsonTableGroupScan groupScan, RexNode condition) {

    if (groupScan.isDisablePushdown() // Do not pushdown filter if it is disabled in plugin configuration
        || groupScan.isFilterPushedDown()) { // see below
      /*
       * The rule can get triggered again due to the transformed "scan => filter" sequence
       * created by the earlier execution of this rule when we could not do a complete
       * conversion of Optiq Filter's condition to HBase Filter. In such cases, we rely upon
       * this flag to not do a re-processing of the rule on the already transformed call.
       */
      return;
    }

    LogicalExpression conditionExp = null;
    try {
      conditionExp = DrillOptiq.toDrill(new DrillParseContext(PrelUtil.getPlannerSettings(call.getPlanner())), scan, condition);
    } catch (ClassCastException e) {
      // MD-771 bug in DrillOptiq.toDrill() causes filter condition on ITEM operator to throw ClassCastException
      // For such cases, we return without pushdown
      return;
    }
    final JsonConditionBuilder jsonConditionBuilder = new JsonConditionBuilder(groupScan, conditionExp);
    final JsonScanSpec newScanSpec = jsonConditionBuilder.parseTree();
    if (newScanSpec == null) {
      return; //no filter pushdown ==> No transformation.
    }

    // clone the groupScan with the newScanSpec.
    final JsonTableGroupScan newGroupsScan = groupScan.clone(newScanSpec);
    newGroupsScan.setFilterPushedDown(true);

    final ScanPrel newScanPrel = ScanPrel.create(scan, filter.getTraitSet(), newGroupsScan, scan.getRowType());

    // Depending on whether is a project in the middle, assign either scan or copy of project to childRel.
    final RelNode childRel = project == null ? newScanPrel : project.copy(project.getTraitSet(), ImmutableList.of((RelNode)newScanPrel));;

    if (jsonConditionBuilder.isAllExpressionsConverted()) {
        /*
         * Since we could convert the entire filter condition expression into an HBase filter,
         * we can eliminate the filter operator altogether.
         */
      call.transformTo(childRel);
    } else {
      call.transformTo(filter.copy(filter.getTraitSet(), ImmutableList.of(childRel)));
    }
  }

  protected void doPushFilterIntoBinaryGroupScan(final RelOptRuleCall call,
                                                 final FilterPrel filter,
                                                 final ProjectPrel project,
                                                 final ScanPrel scan,
                                                 final BinaryTableGroupScan groupScan,
                                                 final RexNode condition) {

    if (groupScan.isFilterPushedDown()) {
      /*
       * The rule can get triggered again due to the transformed "scan => filter" sequence
       * created by the earlier execution of this rule when we could not do a complete
       * conversion of Optiq Filter's condition to HBase Filter. In such cases, we rely upon
       * this flag to not do a re-processing of the rule on the already transformed call.
       */
      return;
    }

    final LogicalExpression conditionExp = DrillOptiq.toDrill(new DrillParseContext(PrelUtil.getPlannerSettings(call.getPlanner())), scan, condition);
    final MapRDBFilterBuilder maprdbFilterBuilder = new MapRDBFilterBuilder(groupScan, conditionExp);
    final HBaseScanSpec newScanSpec = maprdbFilterBuilder.parseTree();
    if (newScanSpec == null) {
      return; //no filter pushdown ==> No transformation.
    }

    // Pass tableStats from old groupScan so we do not go and fetch stats (an expensive operation) again from MapR DB client.
    final BinaryTableGroupScan newGroupsScan = new BinaryTableGroupScan(groupScan.getUserName(), groupScan.getStoragePlugin(),
                                                                        groupScan.getFormatPlugin(), newScanSpec, groupScan.getColumns(),
                                                                        groupScan.getTableStats());
    newGroupsScan.setFilterPushedDown(true);

    final ScanPrel newScanPrel = ScanPrel.create(scan, filter.getTraitSet(), newGroupsScan, scan.getRowType());

    // Depending on whether is a project in the middle, assign either scan or copy of project to childRel.
    final RelNode childRel = project == null ? newScanPrel : project.copy(project.getTraitSet(), ImmutableList.of((RelNode)newScanPrel));;

    if (maprdbFilterBuilder.isAllExpressionsConverted()) {
        /*
         * Since we could convert the entire filter condition expression into an HBase filter,
         * we can eliminate the filter operator altogether.
         */
      call.transformTo(childRel);
    } else {
      call.transformTo(filter.copy(filter.getTraitSet(), ImmutableList.of(childRel)));
    }
  }

}


text:
FROM ubuntu:14.04

RUN \
    apt-get update && \
    apt-get -y -q install netcat dnsutils emacs vim mysql-client libmysqlclient-dev mysql-common software-properties-common python python-dev python-pip

RUN \
  add-apt-repository ppa:openjdk-r/ppa && \
  apt-get update && \
  apt-get install -y openjdk-8-jdk && \
  rm -rf /var/lib/apt/lists/*

# Define commonly used JAVA_HOME variable
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64

RUN pip install kafka-python MySQL-python

ENV SELDON_HOME /home/seldon
RUN mkdir -p  "$SELDON_HOME"
WORKDIR $SELDON_HOME

ARG SELDON_STREAM_VERSION
COPY ./seldon-stream-${SELDON_STREAM_VERSION}-jar-with-dependencies.jar $SELDON_HOME/libs/

RUN ln -s $SELDON_HOME/libs/seldon-stream-${SELDON_STREAM_VERSION}-jar-with-dependencies.jar $SELDON_HOME/libs/seldon-stream.jar

COPY scripts/itemsim-kafka-to-mysql.py $SELDON_HOME/python/

redpajama_set_name: RedPajamaGithub


text:
package com.github.codepain.mediadownload.reader;

import java.io.IOException;
import java.net.URL;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;

import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;

import com.github.codepain.mediadownload.download.Downloadable;
import com.github.codepain.mediadownload.download.DownloadedItem;
import com.github.codepain.mediadownload.listener.Event;
import com.github.codepain.mediadownload.listener.EventType;
import com.github.codepain.mediadownload.music.Album;
import com.github.codepain.mediadownload.music.Discography;
import com.github.codepain.mediadownload.music.Track;

/**
 *

 * A {@link Reader} for web pages on {@code bandcamp.com}.
 *

 *
 * @author codepain
 *
 */
public class BandcampReader extends Reader {

	/**
	 *

	 * Constructs a {@link BandcampReader}.
	 *

	 *
	 * @param url
	 *            The {@link URL} of the Bandcamp page
	 */
	public BandcampReader(final URL url) {
		super(url);
	}

	@Override
	public Downloadable fetchDownloadable() throws IOException {
		trigger(EventType.READER_STATUS, "reading " + url);
		final Document document = Jsoup.connect(url.toString()).get();

		final Element albumList = document.body().select("ol.music-grid").first();
		if (albumList != null) {
			final Discography discography = readDiscography(url);
			if (discography.albums().isEmpty()) {
				throw new IOException(Discography.class.getSimpleName() + " is empty");
			}

			return discography;
		} else {
			final Album album = readAlbum(url);
			if (album == null) {
				throw new IOException(Album.class.getSimpleName() + " is disqualified, because it is a sampler");
			}

			return album;
		}
	}

	private Discography readDiscography(final URL url) throws IOException {
		trigger(EventType.READER_STATUS, "reading discography [" + url + "]");
		final Discography discography = new Discography(url);

		final Document document = Jsoup.connect(url.toString()).get();
		final Elements albumList = document.body().select("ol.music-grid").first().select("li a");
		trigger(EventType.READER_STATUS, "reading " + albumList.size() + " album(s)");
		int index = 0;
		for (final Element albumItem : albumList) {
			index++;
			final URL albumUrl = new URL(albumItem.attr("abs:href"));
			trigger(EventType.READER_STATUS, "reading album " + index + "/" + albumList.size() + " [" + albumUrl + "]");
			final Album album = readAlbum(albumUrl);
			if (album != null) {
				discography.add(album);
			}
		}

		trigger(EventType.SUB_ITEMS_FOUND, discography);
		return discography;
	}

	private Album readAlbum(final URL url) throws IOException {
		trigger(EventType.READER_STATUS, "reading album [" + url + "]");
		final Document document = Jsoup.connect(url.toString()).get();

		// check whether it is a sampler
		if (!options.loadSamplers()) {
			// on bandcamp there is no really safe way to identify a sampler,
			// only indicators ... we assume that one indicator is enough to
			// qualify an album as a sampler

			// does it contain a tag "compilation"?
			if (!document.select(".tag:containsOwn(compilation)").isEmpty()) {
				trigger(EventType.ITEM_DISQUALIFIED, Album.class.getSimpleName() + " with URL [" + url
						+ "] is disqualified, because it is a sampler");
				return null;
			}
		}

		final Album album = new Album(url);
		final DateFormat df = new SimpleDateFormat("dd MMM yyyy HH:mm:ss zzz", Locale.ENGLISH);
		final Elements scripts = document.select("script");
		for (final Element script : scripts) {
			final String js = script.html();
			if (js.contains("var TralbumData")) {
				final String[] lines = js.split("\n", -1);
				final StringBuilder sb = new StringBuilder();
				boolean gather = false;
				for (final String line : lines) {
					if (line.contains("var TralbumData")) {
						sb.append(line);
						sb.append("\n");
						gather = true;
					} else if (gather) {
						if (line.contains("};")) {
							sb.append(line.substring(0, line.indexOf(';')));
							break;
						} else if (!line.trim().startsWith("//")) {
							sb.append(line);
							sb.append("\n");
						}
					}
				}

				final ScriptEngine engine = new ScriptEngineManager().getEngineByName("nashorn");
				try {
					engine.eval(sb.toString());
					album.title((String) engine.eval("TralbumData.current.title"));
					final String artist = (String) engine.eval("TralbumData.artist");
					album.artist(artist);

					// read year of release date
					String year = null;
					try {
						final Date releaseDate = df.parse((String) engine.eval("TralbumData.current.release_date"));
						final Calendar cal = Calendar.getInstance();
						cal.setTime(releaseDate);
						year = "" + cal.get(Calendar.YEAR);
					} catch (final NullPointerException | ParseException e) {
						// nevermind, it's just the year
					}

					// album art
					try {
						final URL albumArt = new URL((String) engine.eval("TralbumData.artFullsizeUrl"));
						final DownloadedItem downloadedItem = download(albumArt);
						album.albumArt(downloadedItem);
					} catch (final NullPointerException | IOException e) {
						// okay, let's at least try to get the thumb
						try {
							final URL albumArtThumb = new URL((String) engine.eval("TralbumData.artThumbURL"));
							final DownloadedItem downloadedItem = download(albumArtThumb);
							album.albumArt(downloadedItem);
						} catch (final NullPointerException | IOException e1) {
							// nevermind, it's just meta information
						}
					}

					for (int i = 0; i < (long) engine.eval("TralbumData.trackinfo.length"); i++) {
						try {
							final String title = (String) engine.eval("TralbumData.trackinfo[" + i + "].title");
							final URL trackUrl = new URL(album.url().getProtocol() + ":"
									+ (String) engine.eval("TralbumData.trackinfo[" + i + "].file['mp3-128']"));

							final Track track = new Track(title, trackUrl);
							track.artist(artist);
							final Object trackNum = engine.eval("TralbumData.trackinfo[" + i + "].track_num");
							if (trackNum != null) {
								track.index((int) trackNum);
							}
							track.year(year);

							album.add(track);
						} catch (final ScriptException e) {
							trigger(EventType.ERROR, "Unable to interpret track #" + i + " (" + e.getMessage() + ")");
						}
					}
				} catch (final ScriptException e) {
					throw new IOException("Unable to read album: " + url, e);
				}

				break;
			}
		}

		trigger(EventType.SUB_ITEMS_FOUND, album);
		return album;
	}

	@Override
	protected void onEvent(final Event event) {
		// doing nothing for now
	}

}


text:
package com.timgroup.jpa.insert;

import javax.persistence.EntityManager;
import javax.persistence.TypedQuery;

import com.timgroup.jpa.Author;
import com.timgroup.jpa.Company;
import com.timgroup.jpa.Idea;
import com.timgroup.jpa.PersistenceUnit;
import com.timgroup.jpa.PersistenceUnit.UnitOfWork;

public class DumpData {

    public static void main(String... args) {
        PersistenceUnit.execute(new UnitOfWork() {
            @Override
            public void perform(EntityManager em) {
                dump(em, Company.class);
                dump(em, Author.class);
                dump(em, Idea.class);
            }

            private <T> void dump(EntityManager em, Class<T> entityClass) {
                TypedQuery<T> all = em.createQuery("select e from " + entityClass.getName() + " e", entityClass);
                PersistenceUnit.dumpQueryResults(all);
            }

        });
    }

}


text:
var config = require("../../config/config.js");
console.log(config);


text:
package org.apache.hadoop.hbase.regionserver;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.hbase.Cell;
import org.apache.hadoop.hbase.CellUtil;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.HBaseTestCase;
import org.apache.hadoop.hbase.HBaseTestingUtility;
import org.apache.hadoop.hbase.HColumnDescriptor;
import org.apache.hadoop.hbase.HRegionInfo;
import org.apache.hadoop.hbase.HTableDescriptor;
import org.apache.hadoop.hbase.testclassification.MediumTests;
import org.apache.hadoop.hbase.testclassification.RegionServerTests;
import org.apache.hadoop.hbase.TableName;
import org.apache.hadoop.hbase.client.Delete;
import org.apache.hadoop.hbase.client.Durability;
import org.apache.hadoop.hbase.client.Get;
import org.apache.hadoop.hbase.client.Put;
import org.apache.hadoop.hbase.client.Scan;
import org.apache.hadoop.hbase.io.hfile.BlockCache;
import org.apache.hadoop.hbase.io.hfile.CacheConfig;
import org.apache.hadoop.hbase.io.hfile.HFile;
import org.apache.hadoop.hbase.util.Bytes;
import org.apache.hadoop.hbase.util.EnvironmentEdgeManagerTestHelper;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.experimental.categories.Category;

@Category({RegionServerTests.class, MediumTests.class})
public class TestBlocksRead extends HBaseTestCase {
  private static final Log LOG = LogFactory.getLog(TestBlocksRead.class);
  static final BloomType[] BLOOM_TYPE = new BloomType[] { BloomType.ROWCOL,
      BloomType.ROW, BloomType.NONE };

  private static BlockCache blockCache;

  private HBaseConfiguration getConf() {
    HBaseConfiguration conf = new HBaseConfiguration();

    // disable compactions in this test.
    conf.setInt("hbase.hstore.compactionThreshold", 10000);
    return conf;
  }

  Region region = null;
  private HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
  private final String DIR = TEST_UTIL.getDataTestDir("TestBlocksRead").toString();

  /**
   * @see org.apache.hadoop.hbase.HBaseTestCase#setUp()
   */
  @SuppressWarnings("deprecation")
  @Before
  protected void setUp() throws Exception {
    super.setUp();
  }

  @SuppressWarnings("deprecation")
  @After
  protected void tearDown() throws Exception {
    super.tearDown();
    EnvironmentEdgeManagerTestHelper.reset();
  }

  /**
   * Callers must afterward call {@link HBaseTestingUtility#closeRegionAndWAL(HRegion)}
   * @param tableName
   * @param callingMethod
   * @param conf
   * @param family
   * @throws IOException
   * @return created and initialized region.
   */
  private Region initHRegion(byte[] tableName, String callingMethod,
      HBaseConfiguration conf, String family) throws IOException {
    HTableDescriptor htd = new HTableDescriptor(TableName.valueOf(tableName));
    HColumnDescriptor familyDesc;
    for (int i = 0; i < BLOOM_TYPE.length; i++) {
      BloomType bloomType = BLOOM_TYPE[i];
      familyDesc = new HColumnDescriptor(family + "_" + bloomType)
          .setBlocksize(1)
          .setBloomFilterType(BLOOM_TYPE[i]);
      htd.addFamily(familyDesc);
    }

    HRegionInfo info = new HRegionInfo(htd.getTableName(), null, null, false);
    Path path = new Path(DIR + callingMethod);
    Region r = HBaseTestingUtility.createRegionAndWAL(info, path, conf, htd);
    blockCache = new CacheConfig(conf).getBlockCache();
    return r;
  }

  private void putData(String family, String row, String col, long version)
      throws IOException {
    for (int i = 0; i < BLOOM_TYPE.length; i++) {
      putData(Bytes.toBytes(family + "_" + BLOOM_TYPE[i]), row, col, version,
          version);
    }
  }

  // generates a value to put for a row/col/version.
  private static byte[] genValue(String row, String col, long version) {
    return Bytes.toBytes("Value:" + row + "#" + col + "#" + version);
  }

  private void putData(byte[] cf, String row, String col, long versionStart,
      long versionEnd) throws IOException {
    byte columnBytes[] = Bytes.toBytes(col);
    Put put = new Put(Bytes.toBytes(row));
    put.setDurability(Durability.SKIP_WAL);

    for (long version = versionStart; version <= versionEnd; version++) {
      put.add(cf, columnBytes, version, genValue(row, col, version));
    }
    region.put(put);
  }

  private Cell[] getData(String family, String row, List<String> columns,
      int expBlocks) throws IOException {
    return getData(family, row, columns, expBlocks, expBlocks, expBlocks);
  }

  private Cell[] getData(String family, String row, List<String> columns,
      int expBlocksRowCol, int expBlocksRow, int expBlocksNone)
      throws IOException {
    int[] expBlocks = new int[] { expBlocksRowCol, expBlocksRow, expBlocksNone };
    Cell[] kvs = null;

    for (int i = 0; i < BLOOM_TYPE.length; i++) {
      BloomType bloomType = BLOOM_TYPE[i];
      byte[] cf = Bytes.toBytes(family + "_" + bloomType);
      long blocksStart = getBlkAccessCount(cf);
      Get get = new Get(Bytes.toBytes(row));

      for (String column : columns) {
        get.addColumn(cf, Bytes.toBytes(column));
      }

      kvs = region.get(get).rawCells();
      long blocksEnd = getBlkAccessCount(cf);
      if (expBlocks[i] != -1) {
        assertEquals("Blocks Read Check for Bloom: " + bloomType, expBlocks[i],
            blocksEnd - blocksStart);
      }
      System.out.println("Blocks Read for Bloom: " + bloomType + " = "
          + (blocksEnd - blocksStart) + "Expected = " + expBlocks[i]);
    }
    return kvs;
  }

  private Cell[] getData(String family, String row, String column,
      int expBlocks) throws IOException {
    return getData(family, row, Arrays.asList(column), expBlocks, expBlocks,
        expBlocks);
  }

  private Cell[] getData(String family, String row, String column,
      int expBlocksRowCol, int expBlocksRow, int expBlocksNone)
      throws IOException {
    return getData(family, row, Arrays.asList(column), expBlocksRowCol,
        expBlocksRow, expBlocksNone);
  }

  private void deleteFamily(String family, String row, long version)
      throws IOException {
    Delete del = new Delete(Bytes.toBytes(row));
    del.deleteFamily(Bytes.toBytes(family + "_ROWCOL"), version);
    del.deleteFamily(Bytes.toBytes(family + "_ROW"), version);
    del.deleteFamily(Bytes.toBytes(family + "_NONE"), version);
    region.delete(del);
  }

  private static void verifyData(Cell kv, String expectedRow,
      String expectedCol, long expectedVersion) {
    assertTrue("RowCheck", CellUtil.matchingRow(kv,  Bytes.toBytes(expectedRow)));
    assertTrue("ColumnCheck", CellUtil.matchingQualifier(kv, Bytes.toBytes(expectedCol)));
    assertEquals("TSCheck", expectedVersion, kv.getTimestamp());
    assertTrue("ValueCheck", CellUtil.matchingValue(kv, genValue(expectedRow, expectedCol, expectedVersion)));
  }

  private static long getBlkAccessCount(byte[] cf) {
      return HFile.dataBlockReadCnt.get();
  }

  private static long getBlkCount() {
    return blockCache.getBlockCount();
  }

  /**
   * Test # of blocks read for some simple seek cases.
   *
   * @throws Exception
   */
  @Test
  public void testBlocksRead() throws Exception {
    byte[] TABLE = Bytes.toBytes("testBlocksRead");
    String FAMILY = "cf1";
    Cell kvs[];
    HBaseConfiguration conf = getConf();
    this.region = initHRegion(TABLE, getName(), conf, FAMILY);

    try {
      putData(FAMILY, "row", "col1", 1);
      putData(FAMILY, "row", "col2", 2);
      putData(FAMILY, "row", "col3", 3);
      putData(FAMILY, "row", "col4", 4);
      putData(FAMILY, "row", "col5", 5);
      putData(FAMILY, "row", "col6", 6);
      putData(FAMILY, "row", "col7", 7);
      region.flush(true);

      // Expected block reads: 1
      // The top block has the KV we are
      // interested. So only 1 seek is needed.
      kvs = getData(FAMILY, "row", "col1", 1);
      assertEquals(1, kvs.length);
      verifyData(kvs[0], "row", "col1", 1);

      // Expected block reads: 2
      // The top block and next block has the KVs we are
      // interested. So only 2 seek is needed.
      kvs = getData(FAMILY, "row", Arrays.asList("col1", "col2"), 2);
      assertEquals(2, kvs.length);
      verifyData(kvs[0], "row", "col1", 1);
      verifyData(kvs[1], "row", "col2", 2);

      // Expected block reads: 3
      // The first 2 seeks is to find out col2. [HBASE-4443]
      // One additional seek for col3
      // So 3 seeks are needed.
      kvs = getData(FAMILY, "row", Arrays.asList("col2", "col3"), 2);
      assertEquals(2, kvs.length);
      verifyData(kvs[0], "row", "col2", 2);
      verifyData(kvs[1], "row", "col3", 3);

      // Expected block reads: 1. [HBASE-4443]&[HBASE-7845]
      kvs = getData(FAMILY, "row", Arrays.asList("col5"), 1);
      assertEquals(1, kvs.length);
      verifyData(kvs[0], "row", "col5", 5);
    } finally {
      HBaseTestingUtility.closeRegionAndWAL(this.region);
      this.region = null;
    }
  }

  /**
   * Test # of blocks read (targeted at some of the cases Lazy Seek optimizes).
   *
   * @throws Exception
   */
  @Test
  public void testLazySeekBlocksRead() throws Exception {
    byte[] TABLE = Bytes.toBytes("testLazySeekBlocksRead");
    String FAMILY = "cf1";
    Cell kvs[];
    HBaseConfiguration conf = getConf();
    this.region = initHRegion(TABLE, getName(), conf, FAMILY);

    try {
      // File 1
      putData(FAMILY, "row", "col1", 1);
      putData(FAMILY, "row", "col2", 2);
      region.flush(true);

      // File 2
      putData(FAMILY, "row", "col1", 3);
      putData(FAMILY, "row", "col2", 4);
      region.flush(true);

      // Expected blocks read: 1.
      // File 2's top block is also the KV we are
      // interested. So only 1 seek is needed.
      kvs = getData(FAMILY, "row", Arrays.asList("col1"), 1);
      assertEquals(1, kvs.length);
      verifyData(kvs[0], "row", "col1", 3);

      // Expected blocks read: 2
      // File 2's top block has the "col1" KV we are
      // interested. We also need "col2" which is in a block
      // of its own. So, we need that block as well.
      kvs = getData(FAMILY, "row", Arrays.asList("col1", "col2"), 2);
      assertEquals(2, kvs.length);
      verifyData(kvs[0], "row", "col1", 3);
      verifyData(kvs[1], "row", "col2", 4);

      // File 3: Add another column
      putData(FAMILY, "row", "col3", 5);
      region.flush(true);

      // Expected blocks read: 1
      // File 3's top block has the "col3" KV we are
      // interested. So only 1 seek is needed.
      kvs = getData(FAMILY, "row", "col3", 1);
      assertEquals(1, kvs.length);
      verifyData(kvs[0], "row", "col3", 5);

      // Get a column from older file.
      // For ROWCOL Bloom filter: Expected blocks read: 1.
      // For ROW Bloom filter: Expected blocks read: 2.
      // For NONE Bloom filter: Expected blocks read: 2.
      kvs = getData(FAMILY, "row", Arrays.asList("col1"), 1, 2, 2);
      assertEquals(1, kvs.length);
      verifyData(kvs[0], "row", "col1", 3);

      // File 4: Delete the entire row.
      deleteFamily(FAMILY, "row", 6);
      region.flush(true);

      // For ROWCOL Bloom filter: Expected blocks read: 2.
      // For ROW Bloom filter: Expected blocks read: 3.
      // For NONE Bloom filter: Expected blocks read: 3.
      kvs = getData(FAMILY, "row", "col1", 2, 3, 3);
      assertEquals(0, kvs.length);
      kvs = getData(FAMILY, "row", "col2", 2, 3, 3);
      assertEquals(0, kvs.length);
      kvs = getData(FAMILY, "row", "col3", 2);
      assertEquals(0, kvs.length);
      kvs = getData(FAMILY, "row", Arrays.asList("col1", "col2", "col3"), 4);
      assertEquals(0, kvs.length);

      // File 5: Delete
      deleteFamily(FAMILY, "row", 10);
      region.flush(true);

      // File 6: some more puts, but with timestamps older than the
      // previous delete.
      putData(FAMILY, "row", "col1", 7);
      putData(FAMILY, "row", "col2", 8);
      putData(FAMILY, "row", "col3", 9);
      region.flush(true);

      // Baseline expected blocks read: 6. [HBASE-4532]
      kvs = getData(FAMILY, "row", Arrays.asList("col1", "col2", "col3"), 6, 7, 7);
      assertEquals(0, kvs.length);

      // File 7: Put back new data
      putData(FAMILY, "row", "col1", 11);
      putData(FAMILY, "row", "col2", 12);
      putData(FAMILY, "row", "col3", 13);
      region.flush(true);

      // Expected blocks read: 8. [HBASE-4585, HBASE-13109]
      kvs = getData(FAMILY, "row", Arrays.asList("col1", "col2", "col3"), 8, 9, 9);
      assertEquals(3, kvs.length);
      verifyData(kvs[0], "row", "col1", 11);
      verifyData(kvs[1], "row", "col2", 12);
      verifyData(kvs[2], "row", "col3", 13);
    } finally {
      HBaseTestingUtility.closeRegionAndWAL(this.region);
      this.region = null;
    }
  }

  /**
   * Test # of blocks read to ensure disabling cache-fill on Scan works.
   * @throws Exception
   */
  @Test
  public void testBlocksStoredWhenCachingDisabled() throws Exception {
    byte [] TABLE = Bytes.toBytes("testBlocksReadWhenCachingDisabled");
    String FAMILY = "cf1";

    HBaseConfiguration conf = getConf();
    this.region = initHRegion(TABLE, getName(), conf, FAMILY);

    try {
      putData(FAMILY, "row", "col1", 1);
      putData(FAMILY, "row", "col2", 2);
      region.flush(true);

      // Execute a scan with caching turned off
      // Expected blocks stored: 0
      long blocksStart = getBlkCount();
      Scan scan = new Scan();
      scan.setCacheBlocks(false);
      RegionScanner rs = region.getScanner(scan);
      List<Cell> result = new ArrayList<Cell>(2);
      rs.next(result);
      assertEquals(2 * BLOOM_TYPE.length, result.size());
      rs.close();
      long blocksEnd = getBlkCount();

      assertEquals(blocksStart, blocksEnd);

      // Execute with caching turned on
      // Expected blocks stored: 2
      blocksStart = blocksEnd;
      scan.setCacheBlocks(true);
      rs = region.getScanner(scan);
      result = new ArrayList<Cell>(2);
      rs.next(result);
      assertEquals(2 * BLOOM_TYPE.length, result.size());
      rs.close();
      blocksEnd = getBlkCount();

      assertEquals(2 * BLOOM_TYPE.length, blocksEnd - blocksStart);
    } finally {
      HBaseTestingUtility.closeRegionAndWAL(this.region);
      this.region = null;
    }
  }

  @Test
  public void testLazySeekBlocksReadWithDelete() throws Exception {
    byte[] TABLE = Bytes.toBytes("testLazySeekBlocksReadWithDelete");
    String FAMILY = "cf1";
    Cell kvs[];
    HBaseConfiguration conf = getConf();
    this.region = initHRegion(TABLE, getName(), conf, FAMILY);
    try {
      deleteFamily(FAMILY, "row", 200);
      for (int i = 0; i < 100; i++) {
        putData(FAMILY, "row", "col" + i, i);
      }
      putData(FAMILY, "row", "col99", 201);
      region.flush(true);

      kvs = getData(FAMILY, "row", Arrays.asList("col0"), 2);
      assertEquals(0, kvs.length);

      kvs = getData(FAMILY, "row", Arrays.asList("col99"), 2);
      assertEquals(1, kvs.length);
      verifyData(kvs[0], "row", "col99", 201);
    } finally {
      HBaseTestingUtility.closeRegionAndWAL(this.region);
      this.region = null;
    }
  }

}


text:
<?php
return array (
  'About HumHub' => '',
  'Currently installed version: %currentVersion%' => '',
  'Licences' => '',
  'There is a new update available! (Latest version: %version%)' => '',
  'This HumHub installation is up to date!' => '',
);


text:
<?php

use yii\db\Migration;

/**
 * Handles the creation for table `table`.
 */
class m160601_073414_create_table extends Migration
{
    /**
     * @inheritdoc
     */
    public function up()
    {
        $this->renameColumn('feeds', 'last_item', 'last_modified');
        $this->alterColumn('feeds', 'last_modified', $this->dateTime());
    }

    /**
     * @inheritdoc
     */
    public function down()
    {
        $this->dropTable('feeds');
    }
}


text:
import {EventEmitter} from 'events';

import expect from 'expect.js';

import CompactLog from '../';
import Namespace from '../build/namespace';

describe('core', () => {

	let log;
	let ns;

	describe('basics', () => {

		it('create instance', () => {
			log = new CompactLog();
			expect(log).to.be.an(CompactLog);
			expect(log).to.be.an(Namespace);
			expect(log).to.be.an(EventEmitter);
		});

	});

	describe('namespaces', () => {

		it('create instance', () => {
			ns = log.createNamespace();
			expect(ns).to.be.an(Namespace);
			expect(ns.id).to.be(1);
		});

		it('create multiple instances', () => {
			for (let i = 0; i < 10; i++) {
				let ns = log.createNamespace();
				expect(ns).to.be.an(Namespace);
				expect(ns.id).to.be(i+2);
			}
		});

		it('gets parents', () => {
			expect(log.getParents()).to.eql([]);
			expect(ns.getParents()).to.eql([0]);
		});

		it('gets parents (multiple)', () => {
			let cLog = new CompactLog();
			let subNS = cLog.createNamespace();
			let sub2NS1 = subNS.createNamespace();
			let sub2NS2 = subNS.createNamespace();
			let sub2NS3 = subNS.createNamespace();
			let sub3NS = sub2NS2.createNamespace();
			let sub4NS = sub3NS.createNamespace();

			expect(cLog.getParents()).to.eql([]);
			expect(subNS.getParents()).to.eql([0]);
			expect(sub2NS1.getParents()).to.eql([1, 0]);
			expect(sub2NS2.getParents()).to.eql([1, 0]);
			expect(sub2NS3.getParents()).to.eql([1, 0]);
			expect(sub3NS.getParents()).to.eql([3, 1, 0]);
			expect(sub4NS.getParents()).to.eql([5, 3, 1, 0]);
		});

	});

});


text:
Memory Manager
==============

RAM. Can't this just be done by Go?

I guess at first implement as wrapper around new, then switch to pools as necessary.


text:
namespace ZAProxy.Schema
{
    /// <summary>
    /// Contains constants of all the well-known session management method names.
    /// </summary>
    public static class SessionManagementMethodNameConstants
    {
        /// <summary>
        /// Method name of cookie based session management.
        /// </summary>
        public const string CookieBased = "cookieBasedSessionManagement";

        /// <summary>
        /// Method name of http authentication session management.
        /// </summary>
        public const string HttpAuth = "httpAuthSessionManagement";
    }
}


text:
import { Component, OnInit } from '@angular/core';

@Component({
  selector: 'app-comp-1809',
  templateUrl: './comp-1809.component.html',
  styleUrls: ['./comp-1809.component.css']
})
export class Comp1809Component implements OnInit {

  constructor() { }

  ngOnInit() {
  }

}


text:
<?php

namespace Flugg\Responder\Tests\Feature;

use Flugg\Responder\Contracts\Responder;
use Flugg\Responder\Facades\Responder as ResponderFacade;
use Flugg\Responder\Http\MakesResponses;
use Flugg\Responder\Tests\TestCase;
use Illuminate\Http\JsonResponse;
use Illuminate\Support\Collection;

/**
 * Feature tests asserting that you can create responses in various ways.
 *
 * @package flugger/laravel-responder
 * @author  Alexander Tømmerås <flugged@gmail.com>
 * @license The MIT License
 */
class CreateResponseTest extends TestCase
{
    /**
     * Assert that you can create responses using an injected responder service.
     */
    public function testCreateResponses()
    {
        $responder = resolve(Responder::class);

        $successResponse = $responder->success()->respond();
        $errorResponse = $responder->error()->respond();

        $this->assertInstanceOf(JsonResponse::class, $successResponse);
        $this->assertInstanceOf(JsonResponse::class, $errorResponse);
    }

    /**
     * Assert that you can create responses using the responder helper function.
     */
    public function testCreateResponsesWithHelper()
    {
        $successResponse = responder()->success()->respond();
        $errorResponse = responder()->error()->respond();

        $this->assertInstanceOf(JsonResponse::class, $successResponse);
        $this->assertInstanceOf(JsonResponse::class, $errorResponse);
    }

    /**
     * Assert that you can create responses using the responder helper function.
     */
    public function testCreateResponsesWithFacade()
    {
        $successResponse = ResponderFacade::success()->respond();
        $errorResponse = ResponderFacade::error()->respond();

        $this->assertInstanceOf(JsonResponse::class, $successResponse);
        $this->assertInstanceOf(JsonResponse::class, $errorResponse);
    }

    /**
     * Assert that you can create responses using the responder helper function.
     */
    public function testCreateResponsesWithTrait()
    {
        $trait = $this->getObjectForTrait(MakesResponses::class);

        $successResponse = $trait->success()->respond();
        $errorResponse = $trait->error()->respond();

        $this->assertInstanceOf(JsonResponse::class, $successResponse);
        $this->assertInstanceOf(JsonResponse::class, $errorResponse);
    }

    /**
     * Assert that you can set the status code for the response.
     */
    public function testSetStatusCode()
    {
        $successResponse = responder()->success()->respond(201);
        $errorResponse = responder()->error()->respond(404);

        $this->assertEquals(201, $successResponse->status());
        $this->assertEquals(404, $errorResponse->status());
    }

    /**
     * Assert that you can set headers for the response.
     */
    public function testSetHeaders()
    {
        $successResponse = responder()->success()->respond(null, ['x-foo' => true]);
        $errorResponse = responder()->error()->respond(null, ['x-foo' => false]);

        $this->assertEquals(true, $successResponse->headers->get('x-foo'));
        $this->assertEquals(false, $errorResponse->headers->get('x-foo'));
    }

    /**
     * Assert that you can cast the response data to an array.
     */
    public function testCastToArray()
    {
        $success = responder()->success()->toArray();
        $error = responder()->error()->toArray();

        $this->assertIsArray($success);
        $this->assertIsArray($error);
    }

    /**
     * Assert that you can cast the response data to a collection.
     */
    public function testCastToCollection()
    {
        $success = responder()->success()->toCollection();
        $error = responder()->error()->toCollection();

        $this->assertInstanceOf(Collection::class, $success);
        $this->assertInstanceOf(Collection::class, $error);
    }

    /**
     * Assert that you can cast the response data to a JSON string.
     */
    public function testCastToJson()
    {
        $success = responder()->success()->toJson();
        $error = responder()->error()->toJson();

        $this->assertIsString($success);
        $this->assertIsString($error);
    }
}


text:
Features Supported
==================

DynamoDB supported features:

  * **Batched Operations** - the current DynamoDB API only supports batched
    fetch operations. Additionally DynamoDB makes it painful to fetch more than
    a few items at a time. Pynamo provides a useful batched operation facade.
  * **Set Operations** - DynamoDB has native support for sets of strings or
    numbers, which Pynamo supports with a much simplified API.
  * **UpdateItem** - Pynamo automatically uses `UpdateItem` when it makes sense.

Pynamo builds on the great `boto` package, whose underlying connection api
automatically uses a connection pool and supports keep-alive and timeouts.

Additionally, Pynamo comes with some features of it's own:

  * **Declaritive Schema** - Pynamo's schema goes beyond defining just a hash
    key and range key. Create a safe and consistent way of representing your
    data in DynamoDB
  * **Compound Keys** - keys that are composed of multiple keys.
  * **Synthesized Types** - attributes can be container types like `list`
    or `dict`
  * **Automated, Sortable Unique ID Generation** - Pynamo provides the
    `LexicalUUIDField` which may be used to generate hash and range keys.
  * **Validated Attributes** - attributes are validated against the type chosen
    when writing persisted classes
  * **No Overhead** The objects are backed by the same dictionaries that Boto
    uses so there is virtually no overhead to using Pynamo unlike with an
    most ORMs.

Running the tests
=================

First, you will need an Amazon AWS account. If you don't have one of those, why
are you running these tests?

Create a file: `~/.pynamo.cfg` which provides the following data (filled in)::

    [aws]
    access_key_id =
    secret_access_key =

    [dynamodb]
    table_prefix =

I use `nose` which pretty much rocks. From the main repository directy simply
run `nosetests` which will pick up all the Pynamo tests and run them.

Running the full test suite takes a very long time. It has to create and destroy
many DynamoDB tables, and at the time of writing that seems to take quite a
while.

If some tests fail, you may have to delete the tables from the AWS Console or
another command line client by hand.


text:
import java.util.List;

import com.github.sarxos.webcam.Webcam;
import com.github.sarxos.webcam.ds.vlcj.VlcjDriver;

/**
 * This class provides a simple example of how to use VLCj driver to list
 * webcams available in the system.

 *

 *
 * WARNING: It works correctly only in case when used on Linux box. Windows VLCj
 * implementation does not support webcam discovery!!!
 *
 * @author Bartosz Firyn (sarxos)
 */
public class ListWebcamsExample {

	static {
		Webcam.setDriver(new VlcjDriver());
	}

	public static void main(String[] args) {

		List<Webcam> webcams = Webcam.getWebcams();

		System.out.format("Webcams detected: %d \n", webcams.size());

		for (int i = 0; i < webcams.size(); i++) {
			System.out.format("%d: %s \n", i + 1, webcams.get(i));
		}
	}
}


text:
<?php
declare(strict_types=1);

/**
 * Class ArticlesFixture
 *
 * @category CakePHP-Plugin
 * @package  Josegonzalez\Version\Test\Fixture
 * @author   Jose Diaz-Gonzalez <email-for-consulting@josediazgonzalez.com>
 * @license  MIT License (https://github.com/josegonzalez/cakephp-version/blob/master/LICENSE.txt)
 * @link     https://github.com/josegonzalez/cakephp-version
 */
namespace Josegonzalez\Version\Test\Fixture;

use Cake\TestSuite\Fixture\TestFixture;

/**
 * Class ArticlesFixture
 *
 * @category CakePHP-Plugin
 * @package  Josegonzalez\Version\Test\Fixture
 * @author   Jose Diaz-Gonzalez <email-for-consulting@josediazgonzalez.com>
 * @license  MIT License (https://github.com/josegonzalez/cakephp-version/blob/master/LICENSE.txt)
 * @link     https://github.com/josegonzalez/cakephp-version
 */
class ArticlesFixture extends TestFixture
{
    public $table = 'articles';

    /**
     * Fields property
     *
     * @var array
     */
    public $fields = [
        'id' => ['type' => 'integer'],
        'author_id' => ['type' => 'integer', 'null' => true],
        'version_id' => ['type' => 'integer', 'null' => true],
        'title' => ['type' => 'string', 'null' => true],
        'body' => 'text',
        'published' => ['type' => 'string', 'length' => 1, 'default' => 'N'],
        'settings' => ['type' => 'json', 'null' => true],
        '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]],
    ];

    /**
     * Records property
     *
     * @var array
     */
    public $records = [
        ['author_id' => 1, 'version_id' => 2, 'title' => 'First Article Version 2', 'body' => 'First Article Body Version 2', 'published' => 'N'],
        ['author_id' => 2, 'version_id' => 3, 'title' => 'Second Article Version 3', 'body' => 'Second Article Body Version 3', 'published' => 'N'],
    ];
}


text:
using Signum.Entities;
using Signum.Entities.Isolation;
using Signum.Utilities;
using System;
using System.Collections.Generic;
using System.Text;

namespace Signum.Entities.Dynamic
{
    [Serializable]
    public class DynamicIsolationMixin : MixinEntity
    {
        DynamicIsolationMixin(ModifiableEntity mainEntity, MixinEntity? next)
            : base(mainEntity, next)
        {
        }

        public IsolationStrategy IsolationStrategy { get; set; } = IsolationStrategy.None;

        protected override void CopyFrom(MixinEntity mixin, object[] args)
        {
            this.IsolationStrategy = ((DynamicIsolationMixin)mixin).IsolationStrategy;
        }
    }
}


text: export * from './phone.action';


text:
require 'spec_helper'

describe Swftly do
  it "shouldn't require any variables to successfully instantiate" do
    swftly = Swftly.new
    swftly.should_not be_nil
  end

  it "should be able to reassign swf_path on demand" do
    swftly = Swftly.new
    swftly.swf_path.should be_empty
    swftly.swf_path = "test/path"
    swftly.swf_path.should eql('test/path')
  end

  it "should submit the specified swf to Swiffy" do
    path = File.dirname(__FILE__) + '/fixtures/files/test.swf'
    swftly = Swftly.new path
    VCR.use_cassette('swiff_and_process') do
      swftly.swiff
    end

    #conversion (cassette or real) should work
    swftly.converter_response_code.should eql(200)
    swftly.raw.should_not be_empty

    #and since auto_process is true, we should have populated runtime and converted
    swftly.fetcher_response_code.should eql(200)
    swftly.runtime.should_not be_nil
    swftly.converted.should_not be_nil

  end

  it "should wait on post-processing if auto_process is false" do
    path = File.dirname(__FILE__) + '/fixtures/files/test.swf'
    swftly = Swftly.new path, false #no autoprocessing
    VCR.use_cassette('swiff_no_process') do
      swftly.swiff
    end

    #conversion (cassette or real) should work
    swftly.converter_response_code.should eql(200)
    swftly.raw.should_not be_empty

    #but runtime and converted should not exist yet
    swftly.runtime.should be_nil
    swftly.converted.should be_nil

    VCR.use_cassette('swiff_process!') do
      swftly.process! #trigger post-processing
    end

    #now we should have all the other stuff
    swftly.fetcher_response_code.should eql(200)
    swftly.runtime.should_not be_nil
    swftly.converted.should_not be_nil
  end
end


text:
// <copyright file="MethodDeclaration.cs" company="TypeSharp Project">
//     Apache 2.0 License
// </copyright>
// <author>Dave McKeown</author>

namespace TypeSharp.Parser.Types.TypeScript
{
    using System.Collections.Generic;
    using System.Linq;

    /// <summary>
    /// MethodDeclaration represents a class or interface method declaration
    /// </summary>
    public class MethodDeclaration
    {
        /// <summary>
        /// A list of MethodArgumentDeclaration instances that form the methods arguments
        /// </summary>
        private readonly List<MethodArgumentDeclaration> arguments = new List<MethodArgumentDeclaration>();

        /// <summary>
        /// Gets the method's arguments
        /// </summary>
        public List<MethodArgumentDeclaration> Arguments
        {
            get
            {
                return this.arguments;
            }
        }

        /// <summary>
        /// Gets or sets the name of the method
        /// </summary>
        public string Identifier { get; set; }

        /// <summary>
        /// Compares the method for equality to another method
        /// </summary>
        /// <param name="obj">Object to compare</param>
        /// <returns>True if equal</returns>
        public override bool Equals(object obj)
        {
            MethodDeclaration compare = obj as MethodDeclaration;

            if (obj == null)
            {
                return false;
            }

            if (compare != null && this.Identifier != compare.Identifier)
            {
                return false;
            }

            if (compare != null && this.Arguments.Count != compare.Arguments.Count)
            {
                return false;
            }

            return !this.Arguments.Where((t, x) => compare != null && !t.Equals(compare.Arguments[x])).Any();
        }

        /// <summary>
        /// Calculates the objects hash code
        /// </summary>
        /// <returns>The object hash code</returns>
        public override int GetHashCode()
        {
            int hash = 13;
            hash = (hash * 7) + this.Arguments.GetHashCode();
            hash = (hash * 7) + this.Identifier.GetHashCode();

            return hash;
        }
    }
}