text:
<?php

namespace Yajra\CMS\Repositories\Category;

use Illuminate\Contracts\Cache\Repository as Cache;

class CacheRepository implements Repository
{
    /**
     * @var \Yajra\CMS\Repositories\Category\Repository
     */
    protected $repository;

    /**
     * @var \Illuminate\Contracts\Cache\Repository
     */
    protected $cache;

    /**
     * CacheRepository constructor.
     *
     * @param \Yajra\CMS\Repositories\Category\Repository $repository
     * @param \Illuminate\Contracts\Cache\Repository $cache
     */
    public function __construct(Repository $repository, Cache $cache)
    {
        $this->repository = $repository;
        $this->cache      = $cache;
    }

    /**
     * Get all published categories.
     *
     * @return \Illuminate\Database\Eloquent\Collection
     */
    public function getAllPublished()
    {
        return $this->cache->rememberForever('categories.published', function () {
            return $this->repository->getAllPublished();
        });
    }
}


text:
from __future__ import division

from pycho.world_objects import WorldObject
from pycho.world.navigation import DIRECTIONS

from pycho.gl.color import COLORS

from pycho.core.blocking import into_sections
from pycho.gl.drawing import sectioned_vbo, draw_color_vbo

import OpenGL.GL as gl

try:
    xrange(1)
except NameError:
    xrange = range

class Wall(WorldObject):
    def __init__(self,
        x,
        y,
        width=5,
        gaps=None,
        color=COLORS['grey'],
        facing=DIRECTIONS['up'],
        speed=0,
        *args,
        **kwargs):
        WorldObject.__init__(self, x, y, color, facing, damagable=False, moveable=False, *args, **kwargs)

        if gaps is None:
            gaps = []

        self.gaps = gaps
        self.speed = speed
        self.width = width
        self.height = 2
        self.health = 1

        self.vbo, self.number_of_points = sectioned_vbo(
            into_sections(self.populated_squares))

    def vbo_points(self):
        populated = self.populated_at()

        min_x = self.x
        min_y = self.y

        max_x = 0
        max_y = 0

        for (x, y, _) in populated:
            if x > max_x:
                max_x = x
            if y > max_y:
                max_y = y

            if x < min_x:
                min_x = x
            if y < min_y:
                min_y = y

        if max_x < min_x:
            max_x, min_x = min_x, max_x

        if max_y < min_y:
            max_y, min_y = min_y, max_y

        return (min_x, min_y, max_x - min_x, max_y - min_y)

    def tick(self, world):
        pass

    def take_damage(self, damage, world):
        pass

    def draw(self):

        gl.glPushMatrix()

        draw_color_vbo(self.vbo, number=self.number_of_points)

        gl.glPopMatrix()

    def populated_at(self, *args):
        populated = []
        populate = lambda x, y: populated.append((x, y, self.color))
        x, y = self.x, self.y

        if self.facing == DIRECTIONS['down']:
            for i in xrange(x):
                if i not in self.gaps:
                    for w in xrange(self.width):
                        populate(i, w)
        elif self.facing == DIRECTIONS['up']:
            for i in xrange(x):
                if i not in self.gaps:
                    for w in xrange(y - self.width, y):
                        populate(i, w)
        elif self.facing == DIRECTIONS['left']:
            for j in xrange(y):
                if j not in self.gaps:
                    for w in xrange(self.width):
                        populate(w, j)
        elif self.facing == DIRECTIONS['right']:
            for j in xrange(y):
                if j not in self.gaps:
                    for w in xrange(x - self.width, x):
                        populate(w, j)

        return populated

redpajama_set_name: RedPajamaGithub


text:
package com.airbnb.scheduler.jobs

import org.joda.time.{DateTimeZone, Hours, Minutes, DateTime}
import com.airbnb.scheduler.graph.JobGraph
import com.airbnb.scheduler.state.PersistenceStore
import org.specs2.mock.Mockito
import org.specs2.mutable._
import java.util.concurrent.ScheduledThreadPoolExecutor
import com.google.common.util.concurrent.MoreExecutors
import com.codahale.metrics.MetricRegistry
import com.airbnb.scheduler.mesos.MesosDriverFactory
import com.airbnb.scheduler.api.{Iso8601JobResource, DependentJobResource}
import org.joda.time.format.ISODateTimeFormat

class JobSchedulerIntegrationTest extends SpecificationWithJUnit with Mockito {

  "JobScheduler" should {
    "A job creates a failed task and then a successful task from a synchronous job" in {
      val epsilon = Hours.hours(2).toPeriod
      val job1 = new ScheduleBasedJob("R5/2012-01-01T00:00:00.000Z/P1D", "job1", "CMD", epsilon)

      val exec = MoreExecutors.listeningDecorator(new ScheduledThreadPoolExecutor(1))

      val jobGraph = new JobGraph
      val persistenceStore = mock[PersistenceStore]
      val taskManager = new TaskManager(exec, persistenceStore, jobGraph, mesosDriver = mock[MesosDriverFactory], registry = mock[MetricRegistry])

      val scheduler = new JobScheduler(epsilon, taskManager, jobGraph, persistenceStore, jobMetrics = mock[JobMetrics], jobStats = mock[JobStats])
      val startTime = DateTime.parse("2012-01-01T01:00:00.000Z")
      scheduler.leader.set(true)
      scheduler.registerJob(job1, true, startTime)

      val newStreams = scheduler.iteration(startTime, scheduler.streams)
      newStreams(0).schedule must_== "R4/2012-01-02T00:00:00.000Z/P1D"
      taskManager.queues(1).size must_== 1

      val taskId1 = taskManager.queues(1).poll

      scheduler.handleFailedTask(TaskUtils.getTaskStatus(job1, startTime, 0))

      taskManager.queues(1).size must_== 1

      val taskId2 = taskManager.queues(1).poll

      scheduler.handleFailedTask(TaskUtils.getTaskStatus(job1, startTime, 0))
      there was one(persistenceStore)
        .persistJob(new ScheduleBasedJob("R5/2012-01-01T00:00:00.000Z/P1D", "job1", "CMD", epsilon))

      there was one(persistenceStore)
        .persistJob(new ScheduleBasedJob("R4/2012-01-02T00:00:00.000Z/P1D", "job1", "CMD", epsilon))
    }

    "Executing a job updates the job counts and errors" in {
      val epsilon = Minutes.minutes(20).toPeriod
      val jobName = "FOO"
      val job1 = new ScheduleBasedJob(schedule = "R/2012-01-01T00:00:00.000Z/PT1M",
        name = jobName, command = "fooo", epsilon = epsilon, retries = 0)

      val horizon = Minutes.minutes(5).toPeriod
      val mockTaskManager = mock[TaskManager]
      val graph = new JobGraph()
      val mockPersistenceStore = mock[PersistenceStore]
      val mockJobStats = mock[JobStats]

      val scheduler = new JobScheduler(horizon, mockTaskManager, graph, mockPersistenceStore, jobMetrics = mock[JobMetrics], jobStats = mockJobStats)
      scheduler.leader.set(true)
      scheduler.registerJob(job1, true, DateTime.parse("2011-01-01T00:05:01.000Z"))
      scheduler.run(() => { DateTime.parse("2012-01-01T00:05:01.000Z")})

      scheduler.handleFinishedTask(TaskUtils.getTaskStatus(job1, DateTime.parse("2012-01-03T00:00:01.000Z"), 0))
      val job2 = graph.lookupVertex(jobName).get
      scheduler.handleFinishedTask(TaskUtils.getTaskStatus(job1, DateTime.parse("2012-01-03T00:00:01.000Z"), 0))
      val job3 = graph.lookupVertex(jobName).get
      scheduler.handleFailedTask(TaskUtils.getTaskStatus(job1, DateTime.parse("2012-01-03T00:00:01.000Z"), 0))

      graph.lookupVertex(jobName).get.successCount must_== 2
      graph.lookupVertex(jobName).get.errorCount must_== 1

      there was one(mockJobStats).jobFinished(job1, TaskUtils.getTaskStatus(job1, DateTime.parse("2012-01-03T00:00:01.000Z"), 0), 0)
      there was one(mockJobStats).jobFinished(job2, TaskUtils.getTaskStatus(job1, DateTime.parse("2012-01-03T00:00:01.000Z"), 0), 0)
      there was one(mockJobStats).jobFailed(job3, TaskUtils.getTaskStatus(job1, DateTime.parse("2012-01-03T00:00:01.000Z"), 0), 0)
    }

    "Tests that a disabled job does not run and does not execute dependant children." in {
      val epsilon = Minutes.minutes(20).toPeriod
      val job1 = new ScheduleBasedJob(schedule = "R/2012-01-01T00:00:00.000Z/PT1M",
        name = "job1", command = "fooo", epsilon = epsilon, disabled=true)
      val job2 = new DependencyBasedJob(Set("job1"), name = "job2", command = "CMD", disabled=true)

      val horizon = Minutes.minutes(5).toPeriod
      val mockTaskManager = mock[TaskManager]
      val graph = new JobGraph()
      val mockPersistenceStore = mock[PersistenceStore]

      val scheduler = new JobScheduler(horizon, mockTaskManager, graph, mockPersistenceStore, jobMetrics = mock[JobMetrics], jobStats = mock[JobStats])
      scheduler.leader.set(true)
      scheduler.registerJob(job1, true, DateTime.parse("2011-01-01T00:05:01.000Z"))
      scheduler.registerJob(job2, true, DateTime.parse("2011-01-01T00:05:01.000Z"))
      scheduler.run(() => { DateTime.parse("2012-01-01T00:05:01.000Z")})
      /*
            scheduler.handleFinishedTask(TaskUtils.getTaskId(job1, DateTime.parse("2012-01-03T00:00:01.000Z"), 0))
            scheduler.handleFinishedTask(TaskUtils.getTaskId(job1, DateTime.parse("2012-01-03T00:00:01.000Z"), 0))
            scheduler.handleFailedTask(TaskUtils.getTaskId(job1, DateTime.parse("2012-01-03T00:00:01.000Z"), 0))
      */
      graph.lookupVertex("job1").get.successCount must_== 0
      graph.lookupVertex("job1").get.errorCount must_== 0
      graph.lookupVertex("job2").get.successCount must_== 0
      graph.lookupVertex("job2").get.errorCount must_== 0
    }

    "Tests that dependent jobs runs when they should" in {
      val epsilon = Minutes.minutes(20).toPeriod
      val job1 = new ScheduleBasedJob(schedule = "R/2012-01-01T00:00:00.000Z/PT1M",
        name = "job1", command = "fooo", epsilon = epsilon, disabled=false)
      val job2 = new ScheduleBasedJob(schedule = "R/2012-01-01T00:00:00.000Z/PT1M",
        name = "job2", command = "fooo", epsilon = epsilon, disabled=false)

      val job3 = new DependencyBasedJob(Set("job1"), name = "job3", command = "CMD", disabled=false)
      val job4 = new DependencyBasedJob(Set("job1", "job2"), name = "job4", command = "CMD", disabled=false)
      val job5 = new DependencyBasedJob(Set("job1", "job2", "job3"), name = "job5", command = "CMD", disabled=false)

      val horizon = Minutes.minutes(5).toPeriod
      val mockTaskManager = mock[TaskManager]
      val graph = new JobGraph()
      val mockPersistenceStore = mock[PersistenceStore]

      val scheduler = new JobScheduler(horizon, mockTaskManager, graph, mockPersistenceStore, jobMetrics = mock[JobMetrics], jobStats = mock[JobStats])
      scheduler.leader.set(true)
      val date = DateTime.parse("2011-01-01T00:05:01.000Z")
      scheduler.registerJob(job1, true, date)
      scheduler.registerJob(job2, true, date)
      scheduler.registerJob(job3, true, date)
      scheduler.registerJob(job4, true, date)
      scheduler.registerJob(job5, true, date)
      scheduler.run(() => { date })

      val finishedDate = date.plus(1)

      scheduler.handleFinishedTask(TaskUtils.getTaskStatus(job1, date, 0), Some(finishedDate))
      scheduler.handleFinishedTask(TaskUtils.getTaskStatus(job2, date, 0), Some(finishedDate))

      graph.lookupVertex("job1").get.successCount must_== 1
      graph.lookupVertex("job1").get.errorCount must_== 0

      graph.lookupVertex("job2").get.successCount must_== 1
      graph.lookupVertex("job2").get.errorCount must_== 0

      there was one(mockTaskManager).enqueue(TaskUtils.getTaskId(job3, finishedDate, 0), false)
      scheduler.handleFinishedTask(TaskUtils.getTaskStatus(job3, finishedDate, 0), Some(finishedDate))

      graph.lookupVertex("job3").get.successCount must_== 1
      graph.lookupVertex("job3").get.errorCount must_== 0

      there was one(mockTaskManager).enqueue(TaskUtils.getTaskId(job4, finishedDate, 0), false)
      scheduler.handleFinishedTask(TaskUtils.getTaskStatus(job4, finishedDate, 0), Some(finishedDate))

      graph.lookupVertex("job4").get.successCount must_== 1
      graph.lookupVertex("job4").get.errorCount must_== 0

      there was one(mockTaskManager).enqueue(TaskUtils.getTaskId(job5, finishedDate, 0), false)
      scheduler.handleFinishedTask(TaskUtils.getTaskStatus(job5, finishedDate, 0), Some(finishedDate))

      graph.lookupVertex("job5").get.successCount must_== 1
      graph.lookupVertex("job5").get.errorCount must_== 0
    }

    "Tests that dependent jobs run even if their parents fail but have softError enabled" in {
      val epsilon = Minutes.minutes(20).toPeriod
      val job1 = new ScheduleBasedJob(schedule = "R/2012-01-01T00:01:00.000Z/PT1M",
        name = "job1", command = "fooo", epsilon = epsilon, disabled = false)
      val job2 = new ScheduleBasedJob(schedule = "R/2012-01-01T00:01:00.000Z/PT1M",
        name = "job2", command = "fooo", epsilon = epsilon, disabled = false, retries = 0, softError = true)

      val job3 = new DependencyBasedJob(Set("job1", "job2"), name = "job3", command = "CMD", disabled = false)

      val horizon = Minutes.minutes(5).toPeriod
      val mockTaskManager = mock[TaskManager]
      val graph = new JobGraph()
      val mockPersistenceStore = mock[PersistenceStore]

      val scheduler = new JobScheduler(horizon, mockTaskManager, graph, mockPersistenceStore, jobMetrics = mock[JobMetrics], jobStats = mock[JobStats])
      scheduler.leader.set(true)
      val date = DateTime.now(DateTimeZone.UTC)
      scheduler.registerJob(job1, true, date)
      scheduler.registerJob(job2, true, date)
      scheduler.registerJob(job3, true, date)
      scheduler.run(() => {
        date
      })

      val finishedDate = date.plusMinutes(1)

      scheduler.handleFinishedTask(TaskUtils.getTaskStatus(job1, date, 0), Some(finishedDate))
      scheduler.handleFailedTask(TaskUtils.getTaskStatus(job2, date, 0))

      graph.lookupVertex("job1").get.successCount must_== 1
      graph.lookupVertex("job1").get.errorCount must_== 0

      val vJob2 = graph.lookupVertex("job2").get
      vJob2.successCount must_== 0
      vJob2.errorCount must_== 1

      there was one(mockTaskManager).enqueue(TaskUtils.getTaskId(job3, DateTime.parse(vJob2.lastError), 0), false)

      scheduler.handleFinishedTask(TaskUtils.getTaskStatus(job3, date, 0), Some(DateTime.parse(vJob2.lastError)))
      graph.lookupVertex("job3").get.successCount must_== 1
      graph.lookupVertex("job3").get.errorCount must_== 0
    }

    "Tests that dependent jobs don't run if their parents fail without softError enabled" in {
      val epsilon = Minutes.minutes(20).toPeriod
      val job1 = new ScheduleBasedJob(schedule = "R/2012-01-01T00:01:00.000Z/PT1M",
        name = "job1", command = "fooo", epsilon = epsilon, disabled = false)
      val job2 = new ScheduleBasedJob(schedule = "R/2012-01-01T00:01:00.000Z/PT1M",
        name = "job2", command = "fooo", epsilon = epsilon, disabled = false, retries = 0, softError = false)

      val job3 = new DependencyBasedJob(Set("job1", "job2"), name = "job3", command = "CMD", disabled = false)

      val horizon = Minutes.minutes(5).toPeriod
      val mockTaskManager = mock[TaskManager]
      val graph = new JobGraph()
      val mockPersistenceStore = mock[PersistenceStore]

      val scheduler = new JobScheduler(horizon, mockTaskManager, graph, mockPersistenceStore, jobMetrics = mock[JobMetrics], jobStats = mock[JobStats])
      scheduler.leader.set(true)
      val date = DateTime.now(DateTimeZone.UTC)
      scheduler.registerJob(job1, true, date)
      scheduler.registerJob(job2, true, date)
      scheduler.registerJob(job3, true, date)
      scheduler.run(() => {
        date
      })

      val finishedDate = date.plusMinutes(1)

      scheduler.handleFinishedTask(TaskUtils.getTaskStatus(job1, date, 0), Some(finishedDate))
      scheduler.handleFailedTask(TaskUtils.getTaskStatus(job2, date, 0))

      graph.lookupVertex("job1").get.successCount must_== 1
      graph.lookupVertex("job1").get.errorCount must_== 0

      val vJob2 = graph.lookupVertex("job2").get
      vJob2.successCount must_== 0
      vJob2.errorCount must_== 1

      there was no(mockTaskManager).enqueue(TaskUtils.getTaskId(job3, DateTime.parse(vJob2.lastError), 0), false)
    }

    "Tests that dependent jobs runs when they should after changing the jobgraph" in {
      val epsilon = Minutes.minutes(20).toPeriod
      val job1 = new ScheduleBasedJob(schedule = "R/2012-01-01T00:01:00.000Z/PT1M",
        name = "job1", command = "fooo", epsilon = epsilon, disabled=false)
      val job2 = new ScheduleBasedJob(schedule = "R/2012-01-01T00:01:00.000Z/PT1M",
        name = "job2", command = "fooo", epsilon = epsilon, disabled=false)

      val job3 = new DependencyBasedJob(Set("job1"), name = "job3", command = "CMD", disabled=false)
      val job4 = new DependencyBasedJob(Set("job1", "job2"), name = "job4", command = "CMD", disabled=false)
      val job5_1 = new DependencyBasedJob(Set("job1", "job2"), name = "job5", command = "CMD", disabled=false)
      val job5_2 = new DependencyBasedJob(Set("job1", "job2", "job3"), name = "job5", command = "CMD", disabled=false)

      val horizon = Minutes.minutes(5).toPeriod
      val mockTaskManager = mock[TaskManager]
      val graph = new JobGraph()
      val mockPersistenceStore = mock[PersistenceStore]

      val scheduler = new JobScheduler(horizon, mockTaskManager, graph, mockPersistenceStore, jobMetrics = mock[JobMetrics], jobStats = mock[JobStats])
      scheduler.leader.set(true)
      val date = DateTime.parse("2012-01-01T00:00:00.000Z")
      scheduler.registerJob(job1, true, date)
      scheduler.registerJob(job2, true, date)
      scheduler.registerJob(job3, true, date)
      scheduler.registerJob(job4, true, date)
      scheduler.registerJob(job5_1, true, date)

      scheduler.run(() => { date })

      val finishedDate = date.plusMinutes(1)

      scheduler.handleFinishedTask(TaskUtils.getTaskStatus(job1, date, 0), Some(finishedDate))
      scheduler.handleFinishedTask(TaskUtils.getTaskStatus(job2, date, 0), Some(finishedDate))

      graph.lookupVertex("job1").get.successCount must_== 1
      graph.lookupVertex("job1").get.errorCount must_== 0

      graph.lookupVertex("job2").get.successCount must_== 1
      graph.lookupVertex("job2").get.errorCount must_== 0

      there was one(mockTaskManager).enqueue(TaskUtils.getTaskId(job3, finishedDate, 0), false)
      scheduler.handleFinishedTask(TaskUtils.getTaskStatus(job3, finishedDate, 0), Some(finishedDate))

      graph.lookupVertex("job3").get.successCount must_== 1
      graph.lookupVertex("job3").get.errorCount must_== 0

      there was one(mockTaskManager).enqueue(TaskUtils.getTaskId(job4, finishedDate, 0), false)
      scheduler.handleFinishedTask(TaskUtils.getTaskStatus(job4, finishedDate, 0), Some(finishedDate))

      graph.lookupVertex("job4").get.successCount must_== 1
      graph.lookupVertex("job4").get.errorCount must_== 0

      there was one(mockTaskManager).enqueue(TaskUtils.getTaskId(job5_1, finishedDate, 0), false)
      scheduler.handleFinishedTask(TaskUtils.getTaskStatus(job5_1, finishedDate, 0), Some(finishedDate))

      graph.lookupVertex("job5").get.successCount must_== 1
      graph.lookupVertex("job5").get.errorCount must_== 0

      val jobResource = new DependentJobResource(jobScheduler = scheduler, jobGraph = graph)
      jobResource.handleRequest(job5_2)

      scheduler.run(() => { date })

      scheduler.handleFinishedTask(TaskUtils.getTaskStatus(job1, date, 0), Some(finishedDate))
      scheduler.handleFinishedTask(TaskUtils.getTaskStatus(job2, date, 0), Some(finishedDate))

      graph.lookupVertex("job1").get.successCount must_== 2
      graph.lookupVertex("job1").get.errorCount must_== 0

      graph.lookupVertex("job2").get.successCount must_== 2
      graph.lookupVertex("job2").get.errorCount must_== 0

      there was two(mockTaskManager).enqueue(TaskUtils.getTaskId(job3, finishedDate, 0), false)
      scheduler.handleFinishedTask(TaskUtils.getTaskStatus(job3, finishedDate, 0), Some(finishedDate))

      graph.lookupVertex("job3").get.successCount must_== 2
      graph.lookupVertex("job3").get.errorCount must_== 0

      there was two(mockTaskManager).enqueue(TaskUtils.getTaskId(job4, finishedDate, 0), false)
      scheduler.handleFinishedTask(TaskUtils.getTaskStatus(job4, finishedDate, 0), Some(finishedDate))

      graph.lookupVertex("job4").get.successCount must_== 2
      graph.lookupVertex("job4").get.errorCount must_== 0

      there was two(mockTaskManager).enqueue(TaskUtils.getTaskId(job5_2, finishedDate, 0), false)
      scheduler.handleFinishedTask(TaskUtils.getTaskStatus(job5_2, finishedDate, 0), Some(finishedDate))

      graph.lookupVertex("job5").get.successCount must_== 1
      graph.lookupVertex("job5").get.errorCount must_== 0
    }

    "Tests that complex dependent jobs run when they should" in {
      val epsilon = Minutes.minutes(20).toPeriod
      val job1 = new ScheduleBasedJob(schedule = "R/2012-01-01T00:00:00.000Z/PT1M",
        name = "job1", command = "fooo", epsilon = epsilon, disabled=false)
      val job2 = new ScheduleBasedJob(schedule = "R/2012-01-01T00:00:00.000Z/PT1M",
        name = "job2", command = "fooo", epsilon = epsilon, disabled=false)

      val job3 = new DependencyBasedJob(Set("job1"), name = "job3", command = "CMD", disabled=false)
      val job4 = new DependencyBasedJob(Set("job1", "job2"), name = "job4", command = "CMD", disabled=false)
      val job5 = new DependencyBasedJob(Set("job1", "job2", "job3"), name = "job5", command = "CMD", disabled=false)
      val job6 = new DependencyBasedJob(Set("job4", "job5", "job1"), name = "job6", command = "CMD", disabled=false)

      val horizon = Minutes.minutes(5).toPeriod
      val mockTaskManager = mock[TaskManager]
      val graph = new JobGraph()
      val mockPersistenceStore = mock[PersistenceStore]

      val scheduler = new JobScheduler(horizon, mockTaskManager, graph, mockPersistenceStore, jobMetrics = mock[JobMetrics], jobStats = mock[JobStats])
      scheduler.leader.set(true)
      val date = DateTime.parse("2011-01-01T00:05:01.000Z")
      scheduler.registerJob(job1, true, date)
      scheduler.registerJob(job2, true, date)
      scheduler.registerJob(job3, true, date)
      scheduler.registerJob(job4, true, date)
      scheduler.registerJob(job5, true, date)
      scheduler.registerJob(job6, true, date)
      scheduler.run(() => { date })

      val finishedDate = date.plus(1)

      scheduler.handleFinishedTask(TaskUtils.getTaskStatus(job1, date, 0), Some(finishedDate))
      scheduler.handleFinishedTask(TaskUtils.getTaskStatus(job2, date, 0), Some(finishedDate))

      graph.lookupVertex("job1").get.successCount must_== 1
      graph.lookupVertex("job1").get.errorCount must_== 0

      graph.lookupVertex("job2").get.successCount must_== 1
      graph.lookupVertex("job2").get.errorCount must_== 0

      there was one(mockTaskManager).enqueue(TaskUtils.getTaskId(job3, finishedDate, 0), false)
      scheduler.handleFinishedTask(TaskUtils.getTaskStatus(job3, finishedDate, 0), Some(finishedDate))

      scheduler.run(() => { date })

      scheduler.handleFinishedTask(TaskUtils.getTaskStatus(job1, date, 0), Some(finishedDate))
      scheduler.handleFinishedTask(TaskUtils.getTaskStatus(job2, date, 0), Some(finishedDate))

      graph.lookupVertex("job1").get.successCount must_== 2
      graph.lookupVertex("job1").get.errorCount must_== 0

      graph.lookupVertex("job2").get.successCount must_== 2
      graph.lookupVertex("job2").get.errorCount must_== 0

      graph.lookupVertex("job3").get.successCount must_== 1
      graph.lookupVertex("job3").get.errorCount must_== 0

      there was two(mockTaskManager).enqueue(TaskUtils.getTaskId(job4, finishedDate, 0), false)
      scheduler.handleFinishedTask(TaskUtils.getTaskStatus(job4, finishedDate, 0), Some(finishedDate))

      graph.lookupVertex("job4").get.successCount must_== 1
      graph.lookupVertex("job4").get.errorCount must_== 0

      there was one(mockTaskManager).enqueue(TaskUtils.getTaskId(job5, finishedDate, 0), false)
      scheduler.handleFinishedTask(TaskUtils.getTaskStatus(job5, finishedDate, 0), Some(finishedDate))

      graph.lookupVertex("job5").get.successCount must_== 1
      graph.lookupVertex("job5").get.errorCount must_== 0

      there was one(mockTaskManager).enqueue(TaskUtils.getTaskId(job6, finishedDate, 0), false)
      scheduler.handleFinishedTask(TaskUtils.getTaskStatus(job6, finishedDate, 0), Some(finishedDate))

      graph.lookupVertex("job6").get.successCount must_== 1
      graph.lookupVertex("job6").get.errorCount must_== 0
    }

    "Tests that dependent jobs run when parents are updated" in {
      val epsilon = Minutes.minutes(20).toPeriod
      val date = DateTime.now(DateTimeZone.UTC)
      val fmt = ISODateTimeFormat.dateTime()
      val job1 = new ScheduleBasedJob(schedule = s"R/${fmt.print(date)}/PT1M",
        name = "job1", command = "fooo", epsilon = epsilon, disabled=false)
      val job2 = new ScheduleBasedJob(schedule = s"R/${fmt.print(date)}/PT1M",
        name = "job2", command = "fooo", epsilon = epsilon, disabled=false)

      val job3 = new DependencyBasedJob(Set("job1"), name = "job3", command = "CMD", disabled=false)
      val job4 = new DependencyBasedJob(Set("job1", "job2"), name = "job4", command = "CMD", disabled=false)
      val job5_1 = new DependencyBasedJob(Set("job1", "job2"), name = "job5", command = "CMD", disabled=false)
      val job5_2 = new DependencyBasedJob(Set("job1", "job2", "job3"), name = "job5", command = "CMD", disabled=false)

      val horizon = Minutes.minutes(5).toPeriod
      val mockTaskManager = mock[TaskManager]
      val graph = new JobGraph()
      val mockPersistenceStore = mock[PersistenceStore]

      val scheduler = new JobScheduler(horizon, mockTaskManager, graph, mockPersistenceStore, jobMetrics = mock[JobMetrics], jobStats = mock[JobStats])
      scheduler.leader.set(true)
      scheduler.registerJob(job1, true, date)
      scheduler.registerJob(job2, true, date)
      scheduler.registerJob(job3, true, date)
      scheduler.registerJob(job4, true, date)
      scheduler.registerJob(job5_1, true, date)

      scheduler.run(() => { date })

      val finishedDate = date.plus(1)

      scheduler.handleFinishedTask(TaskUtils.getTaskStatus(job1, date, 0), Some(finishedDate))
      scheduler.handleFinishedTask(TaskUtils.getTaskStatus(job2, date, 0), Some(finishedDate))

      graph.lookupVertex("job1").get.successCount must_== 1
      graph.lookupVertex("job1").get.errorCount must_== 0

      graph.lookupVertex("job2").get.successCount must_== 1
      graph.lookupVertex("job2").get.errorCount must_== 0

      there was one(mockTaskManager).enqueue(TaskUtils.getTaskId(job3, finishedDate, 0), false)
      scheduler.handleFinishedTask(TaskUtils.getTaskStatus(job3, finishedDate, 0), Some(finishedDate))

      graph.lookupVertex("job3").get.successCount must_== 1
      graph.lookupVertex("job3").get.errorCount must_== 0

      there was one(mockTaskManager).enqueue(TaskUtils.getTaskId(job4, finishedDate, 0), false)
      scheduler.handleFinishedTask(TaskUtils.getTaskStatus(job4, finishedDate, 0), Some(finishedDate))

      graph.lookupVertex("job4").get.successCount must_== 1
      graph.lookupVertex("job4").get.errorCount must_== 0

      there was one(mockTaskManager).enqueue(TaskUtils.getTaskId(job5_1, finishedDate, 0), false)
      scheduler.handleFinishedTask(TaskUtils.getTaskStatus(job5_1, finishedDate, 0), Some(finishedDate))

      graph.lookupVertex("job5").get.successCount must_== 1
      graph.lookupVertex("job5").get.errorCount must_== 0

      val jobResource = new Iso8601JobResource(jobScheduler = scheduler, jobGraph = graph)
      jobResource.handleRequest(job1)
      jobResource.handleRequest(job2)

      scheduler.run(() => { date })

      scheduler.handleFinishedTask(TaskUtils.getTaskStatus(job1, date, 0), Some(finishedDate))
      scheduler.handleFinishedTask(TaskUtils.getTaskStatus(job2, date, 0), Some(finishedDate))

      graph.lookupVertex("job1").get.successCount must_== 1
      graph.lookupVertex("job1").get.errorCount must_== 0

      graph.lookupVertex("job2").get.successCount must_== 1
      graph.lookupVertex("job2").get.errorCount must_== 0

      there was two(mockTaskManager).enqueue(TaskUtils.getTaskId(job3, finishedDate, 0), false)
      scheduler.handleFinishedTask(TaskUtils.getTaskStatus(job3, finishedDate, 0), Some(finishedDate))

      graph.lookupVertex("job3").get.successCount must_== 2
      graph.lookupVertex("job3").get.errorCount must_== 0

      there was two(mockTaskManager).enqueue(TaskUtils.getTaskId(job4, finishedDate, 0), false)
      scheduler.handleFinishedTask(TaskUtils.getTaskStatus(job4, finishedDate, 0), Some(finishedDate))

      graph.lookupVertex("job4").get.successCount must_== 2
      graph.lookupVertex("job4").get.errorCount must_== 0

      there was two(mockTaskManager).enqueue(TaskUtils.getTaskId(job5_2, finishedDate, 0), false)
      scheduler.handleFinishedTask(TaskUtils.getTaskStatus(job5_2, finishedDate, 0), Some(finishedDate))

      graph.lookupVertex("job5").get.successCount must_== 2
      graph.lookupVertex("job5").get.errorCount must_== 0
    }
  }
}


text:
package eu.leads.processor.infinispan;

import org.infinispan.distexec.mapreduce.Collector;
import org.vertx.java.core.json.JsonObject;

/**
 * Created by vagvaz on 2/18/15.
 */
public class LeadsSQLMapper extends LeadsMapper<String, String, String, String> {
  public LeadsSQLMapper(JsonObject configuration) {
    super(configuration);
  }

  public LeadsSQLMapper(String configString) {
    super(configString);
  }

  public LeadsSQLMapper() {
  }

  @Override public void map(String key, String value, Collector<String, String> collector) {

  }
}


text:
<?php

$base = \Config::load('noviusos_blognews::controller/admin/inspector/author', true);
return $base;


text:
package apple.foundation.enums;

import org.moe.natj.general.ann.Generated;
import org.moe.natj.general.ann.NUInt;

/**
 * Options arguments of type NSLinguisticTaggerOptions may include the following flags, which allow clients interested
 * only in certain general types of tokens to specify that tokens of other types should be omitted from the returned
 * results.
 */
@Generated
public final class NSLinguisticTaggerOptions {
    /**
     * Omit tokens of type NSLinguisticTagWord.
     */
    @Generated @NUInt public static final long OmitWords = 0x0000000000000001L;
    /**
     * Omit tokens of type NSLinguisticTagPunctuation.
     */
    @Generated @NUInt public static final long OmitPunctuation = 0x0000000000000002L;
    /**
     * Omit tokens of type NSLinguisticTagWhitespace.
     */
    @Generated @NUInt public static final long OmitWhitespace = 0x0000000000000004L;
    /**
     * Omit tokens of type NSLinguisticTagOther.
     */
    @Generated @NUInt public static final long OmitOther = 0x0000000000000008L;
    /**
     * Join tokens of tag scheme NSLinguisticTagSchemeNameType.
     */
    @Generated @NUInt public static final long JoinNames = 0x0000000000000010L;

    @Generated
    private NSLinguisticTaggerOptions() {
    }
}


text:
package ysitd.ircbot.java.plugin;

import java.io.IOException;
import java.io.PrintWriter;

import ysitd.ircbot.java.api.*;

public class ReJoin implements PluginListener{

	PrintWriter writer;

	public void recive(ReciveMessageEvent e){

		//:petjelinux!~petjelinu@61-230-156-86.dynamic.hinet.net KICK #petjelinuxtest javabot_ysitd :User terminated!

		//:orwell.freenode.net 433 * petjelinux :Nickname is already in use.
		//:orwell.freenode.net 451 * :You have not registered

		if(e.getALine().contains("KICK")&&e.getALine().contains(PluginMain.getNickname())){
			rejoin_kicked(e.getFrom());
		}
		else if(e.getALine().contains("433 *")){
			rejoin_notregyet(PluginMain.getNickname()+Math.round(Math.random()*100));
		}

	}

	public void rejoin_notregyet(String name){
		try {
			Thread.sleep(1000L);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		try {
			PluginMain.Login();
		} catch (IOException e) {
			e.printStackTrace();
		}
		PluginMain.setNickname( name );
	}

	public void rejoin_kicked(String from){
		try {
			Thread.sleep(1000000L); //sleep 100secs.
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		writer=PluginMain.getWriter();
		writer.println("JOIN " + from);
		writer.flush();
	}
}


text:
TSharedRef<IDetailCustomization> FSoundWaveDetails::MakeInstance()
{
	return MakeShareable(new FSoundWaveDetails);
}

void FSoundWaveDetails::CustomizeDetails(IDetailLayoutBuilder& DetailBuilder)
{
	if (!GetDefault<UEditorExperimentalSettings>()->bShowAudioStreamingOptions)
	{
		DetailBuilder.HideProperty(GET_MEMBER_NAME_CHECKED(USoundWave, bStreaming));
		DetailBuilder.HideProperty(GET_MEMBER_NAME_CHECKED(USoundWave, StreamingPriority));
	}
}


text:
@class NSString;

@interface _UXCollectionView : UXCollectionView <_UXCollectionViewOverdraw>
{
}

+ (Class)documentClass;
@property(nonatomic) BOOL overdrawEnabled;

// Remaining properties
@property(readonly, copy) NSString *debugDescription;
@property(readonly, copy) NSString *description;
@property(readonly) NSUInteger hash;
@property(readonly) Class superclass;

@end


text:
"""## Tensor Handle Operations.

TensorFlow provides several operators that allows the user to keep tensors
"in-place" across run calls.

@@get_session_handle
@@get_session_tensor
@@delete_session_tensor
"""

# pylint: disable=g-bad-name
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

from tensorflow.python.framework import device as pydev
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import ops
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import gen_data_flow_ops
from tensorflow.python.util import compat

class TensorHandle(object):
  """Represents a handle for a live tensor in a session."""

  def __init__(self, handle, dtype, session):
    """Constructs a new tensor handle.

    A tensor handle for a persistent tensor is a python string
    that has the form of "tensor_name;unique_id;device_name".

    Args:
      handle: A tensor handle.
      dtype: The data type of the tensor represented by `handle`.
      session: The session in which the tensor is produced.
    """
    self._handle = compat.as_str_any(handle)
    self._dtype = dtype
    self._session = session
    self._auto_gc_enabled = True

  def __del__(self):
    if self._auto_gc_enabled:
      self._session._register_dead_handle(self.handle)

  def __str__(self):
    return self._handle

  @property
  def handle(self):
    return self._handle

  def eval(self):
    """Return the value of the tensor represented by this handle."""
    holder, reader = _get_handle_reader(self._session.graph, self._handle,
                                        self._dtype)
    return self._session.run(reader, feed_dict={holder: self._handle})

  def get_raw_handle(self):
    """Return the raw handle of the tensor.

    Note that the method disables the automatic garbage collection of this
    persistent tensor. The caller is now responsible for managing the life
    time of the tensor.
    """
    self._auto_gc_enabled = False
    return self._handle

  @staticmethod
  def _get_device_name(handle):
    """The device name encoded in the handle."""
    handle_str = compat.as_str_any(handle)
    return pydev.canonical_name(handle_str.split(';')[-1])

  @staticmethod
  def _get_reader_key(handle):
    """The graph key for reader."""
    handle_parts = str(handle).split(';')
    return handle_parts[0] + ';' + handle_parts[-1]

  @staticmethod
  def _get_deleter_key(handle):
    """The graph key for deleter."""
    return str(handle).split(';')[-1]

  @staticmethod
  def _get_mover_key(feeder, handle):
    """The graph key for mover."""
    return feeder.op.name + ';' + TensorHandle._get_reader_key(handle)

def get_session_handle(data, name=None):
  """Return the handle of `data`.

  This is EXPERIMENTAL and subject to change.

  Keep `data` "in-place" in the runtime and create a handle that can be
  used to retrieve `data` in a subsequent run().

  Combined with `get_session_tensor`, we can keep a tensor produced in
  one run call in place, and use it as the input in a future run call.
  Below is a simple example:

  ```python
  c = tf.mul(a, b)
  h = tf.get_session_handle(c)
  h = sess.run(h)

  p, a = tf.get_session_tensor(tf.float32)
  b = tf.mul(a, 10)
  c = sess.run(b, feed_dict={p: h.handle})
  ```

  Args:
    data: A tensor to be stored in the session.
    name: Optional name prefix for the return tensor.

  Returns:
    A scalar string tensor representing a unique handle for `data`.

  Raises:
    TypeError: if `data` is not a Tensor.
  """
  if not isinstance(data, ops.Tensor):
    raise TypeError('`data` must be of type Tensor.')

  # Colocate this operation with data.
  with ops.colocate_with(data):
    return gen_data_flow_ops._get_session_handle(data, name=name)

def get_session_tensor(dtype, name=None):
  """Get the tensor of type `dtype` by feeding a tensor handle.

  This is EXPERIMENTAL and subject to change.

  Get the value of the tensor from a tensor handle. The tensor
  is produced in a previous run() and stored in the state of the
  session.

  Args:
    dtype: The type of the output tensor.
    name: Optional name prefix for the return tensor.

  Returns:
    A pair of tensors. The first is a placeholder for feeding a
    tensor handle and the second is the tensor in the session state
    keyed by the tensor handle.
  """
  with ops.device(None):
    # Commit the device when it is used the first time.
    holder = array_ops.placeholder(dtypes.string)
    _register_handle_feeder(holder.graph, holder, dtype)
    tensor = gen_data_flow_ops._get_session_tensor(holder, dtype, name=name)
  return (holder, tensor)

def delete_session_tensor(name=None):
  """Delete the tensor by feeding a tensor handle.

  This is EXPERIMENTAL and subject to change.

  Delete the tensor of a given tensor handle. The tensor is produced
  in a previous run() and stored in the state of the session.

  Args:
    name: Optional name prefix for the return tensor.

  Returns:
    A pair of graph elements. The first is a placeholder for feeding a
    tensor handle and the second is a deletion operation.
  """
  with ops.device(None):
    # We will commit the device at the time it is used.
    holder = array_ops.placeholder(dtypes.string)
  deleter = gen_data_flow_ops._delete_session_tensor(holder, name=name)
  return (holder, deleter)

def _register_handle_feeder(graph, feeder, dtype):
  graph._handle_feeders[feeder.op.name] = dtype

def _get_handle_feeder(graph, feeder):
  return graph._handle_feeders.get(feeder.op.name)

def _get_handle_reader(graph, handle, dtype):
  """Return a read subgraph for this handle."""
  graph_key = TensorHandle._get_reader_key(handle)
  result = graph._handle_readers.get(graph_key)
  if result is None:
    # Create reader if we haven't done it.
    handle_device = TensorHandle._get_device_name(handle)
    with graph.as_default(), graph.device(handle_device):
      holder = array_ops.placeholder(dtypes.string)
      _register_handle_feeder(holder.graph, holder, dtype)
      reader = gen_data_flow_ops._get_session_tensor(holder, dtype)
    result = (holder, reader)
    graph._handle_readers[graph_key] = result
  return result

def _get_handle_mover(graph, feeder, handle):
  """Return a move subgraph for this pair of feeder and handle."""
  dtype = _get_handle_feeder(graph, feeder)
  if dtype is None:
    return None
  handle_device = TensorHandle._get_device_name(handle)
  if not feeder.op.device:
    feeder.op._set_device(handle_device)
    feeder.consumers()[0]._set_device(handle_device)
    return None
  if feeder.op.device == handle_device:
    return None
  # Now we know we have to move the tensor.
  graph_key = TensorHandle._get_mover_key(feeder, handle)
  result = graph._handle_movers.get(graph_key)
  if result is None:
    # Create mover if we haven't done it.
    holder, reader = _get_handle_reader(graph, handle, dtype)
    with graph.as_default(), graph.device(feeder.op.device):
      mover = gen_data_flow_ops._get_session_handle(reader)
    result = (holder, mover)
    graph._handle_movers[graph_key] = result
  return result

def _get_handle_deleter(graph, handle):
  """Return a deletion subgraph for this handle."""
  graph_key = TensorHandle._get_deleter_key(handle)
  result = graph._handle_deleters.get(graph_key)
  if result is None:
    # Create deleter if we haven't done it.
    handle_device = TensorHandle._get_device_name(handle)
    with graph.as_default(), graph.device(handle_device):
      holder = array_ops.placeholder(dtypes.string)
      deleter = gen_data_flow_ops._delete_session_tensor(holder)
    result = (holder, deleter)
    graph._handle_deleters[graph_key] = result
  return result


text:
"""
    rot.progress
    ~~~~~~~~~~~~

    Progress indicators.

    :Copyright: © 2013, Kwpolska.
    :License: BSD (see /LICENSE).
"""

import sys
import time
from rot import throbber

__all__ = ['FrontProgress', 'FrontProgressThrobber']

class FrontProgress(object):
    """A static progress indicator with numbers.

    Usage::

        fp = Progress(2, 'Doing step 1...')
        step1()
        fp.step('Doing step 2...')
        step2()
        fp.step()

    Or (with static message)::

        fp = Progress(2, 'Performing an action...')
        step1()
        fp.step()
        step2()
        fp.step()

    """
    current = -1
    total = 1
    _pml = 0

    def __init__(self, total, msg=u'Working...', end_with_newline=True):
        """Initialize a Progress message."""
        self.total = total
        self.msg = msg
        self.end_with_newline = end_with_newline
        self.step(msg)

    def step(self, msg=None, newline=False):
        """Print a progress message."""
        if msg is None:
            msg = self.msg
        else:
            self.msg = msg
        self.current += 1
        ln = len(str(self.total))
        sys.stdout.write(u'\r' + ((ln * 2 + 4 + self._pml) * u' '))
        self._pml = len(msg)
        sys.stdout.write(u'\r')
        sys.stdout.flush()
        sys.stdout.write((u'({0:>' + str(ln) + u'}/{1}) ').format(self.current,
                                                                  self.total))
        sys.stdout.write(msg)
        sys.stdout.write(u'\r')
        sys.stdout.flush()
        if newline:
            sys.stdout.write(u'\n')
            sys.stdout.flush()
        if self.current == self.total:
            if self.end_with_newline:
                sys.stdout.write(u'\n')
                sys.stdout.flush()
            self.total = 0
            self.current = 0

class FrontProgressThrobber(FrontProgress, throbber.Throbber):
    """An animated progress throbber.

    Similar to Progress, but the / is animated.

    Usage::

        with ProgressThrobber(2, 'Doing stuff...') as pt:
            dostuff()
            pt.step('Cleaning up...')
            cleanup()
    """
    printback = True

    def __init__(self, total, msg=u'Working...', finalthrob=u'/',
                 end_with_newline=True):
        self.total = total
        self.msg = msg
        self.finalthrob = finalthrob
        self.ln = len(str(self.total))
        self.step(msg)

    def _throb(self):
        """Display a throbber."""
        self.throb = True
        i = 0
        while self.throb:
            sys.stdout.write((u'\r({0:>' + str(self.ln) +
                              u'}{1}{2}) {3}').format(self.current,
                                                      self.states[i],
                                                      self.total, self.msg))
            sys.stdout.write(u'\r')
            sys.stdout.flush()
            time.sleep(0.1)
            i += 1
            if i == len(self.states):
                i = 0

        sys.stdout.write(u'\r({0}{1}{2}) {3}'.format(self.current,
                                                     self.finalthrob,
                                                     self.total, self.msg))
        sys.stdout.flush()
        time.sleep(0.1)
        if self.printback:
            sys.stdout.write(u'\n')
            sys.stdout.flush()

    def step(self, msg=None):
        if msg is None:
            msg = self.msg
        sys.stdout.write(u'\r' + ((self.ln * 2 + 4 + self._pml) * u' '))
        self._pml = len(msg)
        self.current += 1
        self.msg = msg


text:
package com.hkm.dis;

import com.hkm.disqus.api.ApiConfig;

import retrofit.RestAdapter;

/**
 * Created by zJJ on 11/6/2015.
 */
public class DqUtil {
    public static ApiConfig genConfig() {
        ApiConfig conf = new ApiConfig(
                BuildConfig.DISQUS_API_KEY,
                BuildConfig.DISQUS_DEFAULT_ACCESS,
                RestAdapter.LogLevel.BASIC);
        /**
         * https://github.com/101medialab/Hypetrak-iOS-v2/blob/bbc3afc1349f49910c8b8f69ea2944f5440fc898/Hypetrak-iOS-v2/Model/ServerRequestManager.swift
         */

        /**
         *
         * reference from iOS configurations
         * let urlRequestLink = "https://disqus.com/api/3.0/threads/set.json?forum=\(forumShortName)&api_key=\(apiKey)&thread=ident:\(postID)%20\(domain)/?p=\(postID)"
         */

        conf
                .setForumName("hypebeast")
                .setApiSecret(BuildConfig.DISQUS_SECRET)
                .setRedirectUri(BuildConfig.DISQUS_REDIRECT_URI);

        return conf;
    }
}


text:
int
main(void)
{
	struct sched_param *const param = tail_alloc(sizeof(struct sched_param));
	long rc = syscall(__NR_sched_getscheduler, 0);
	const char *scheduler;
	switch (rc) {
		case SCHED_FIFO:
			scheduler = "SCHED_FIFO";
			break;
		case SCHED_RR:
			scheduler = "SCHED_RR";
			break;
# ifdef SCHED_BATCH
		case SCHED_BATCH:
			scheduler = "SCHED_BATCH";
			break;
# endif
# ifdef SCHED_IDLE
		case SCHED_IDLE:
			scheduler = "SCHED_IDLE";
			break;
# endif
# ifdef SCHED_ISO
		case SCHED_ISO:
			scheduler = "SCHED_ISO";
			break;
# endif
# ifdef SCHED_DEADLINE
		case SCHED_DEADLINE:
			scheduler = "SCHED_DEADLINE";
			break;
# endif
		default:
			scheduler = "SCHED_OTHER";
	}
	printf("sched_getscheduler(0) = %ld (%s)\n",
	       rc, scheduler);

	param->sched_priority = -1;
	rc = syscall(__NR_sched_setscheduler, 0, SCHED_FIFO, param);
	printf("sched_setscheduler(0, SCHED_FIFO, [%d]) = %ld %s (%m)\n",
	       param->sched_priority, rc, errno2name());

	puts("+++ exited with 0 +++");
	return 0;
}

#else

SKIP_MAIN_UNDEFINED("__NR_sched_getscheduler && __NR_sched_setscheduler")

#endif


text:
from nipype.testing import assert_equal
from nipype.interfaces.diffusion_toolkit.dti import DTITracker

def test_DTITracker_inputs():
    input_map = dict(angle_threshold=dict(argstr='-at %f',
    ),
    angle_threshold_weight=dict(argstr='-atw %f',
    ),
    args=dict(argstr='%s',
    ),
    environ=dict(nohash=True,
    usedefault=True,
    ),
    ignore_exception=dict(nohash=True,
    usedefault=True,
    ),
    input_data_prefix=dict(argstr='%s',
    position=0,
    usedefault=True,
    ),
    input_type=dict(argstr='-it %s',
    ),
    invert_x=dict(argstr='-ix',
    ),
    invert_y=dict(argstr='-iy',
    ),
    invert_z=dict(argstr='-iz',
    ),
    mask1_file=dict(argstr='-m %s',
    mandatory=True,
    position=2,
    ),
    mask1_threshold=dict(position=3,
    ),
    mask2_file=dict(argstr='-m2 %s',
    position=4,
    ),
    mask2_threshold=dict(position=5,
    ),
    output_file=dict(argstr='%s',
    position=1,
    usedefault=True,
    ),
    output_mask=dict(argstr='-om %s',
    ),
    primary_vector=dict(argstr='-%s',
    ),
    random_seed=dict(argstr='-rseed',
    ),
    step_length=dict(argstr='-l %f',
    ),
    swap_xy=dict(argstr='-sxy',
    ),
    swap_yz=dict(argstr='-syz',
    ),
    swap_zx=dict(argstr='-szx',
    ),
    tensor_file=dict(),
    terminal_output=dict(nohash=True,
    ),
    tracking_method=dict(argstr='-%s',
    ),
    )
    inputs = DTITracker.input_spec()

    for key, metadata in input_map.items():
        for metakey, value in metadata.items():
            yield assert_equal, getattr(inputs.traits()[key], metakey), value

def test_DTITracker_outputs():
    output_map = dict(mask_file=dict(),
    track_file=dict(),
    )
    outputs = DTITracker.output_spec()

    for key, metadata in output_map.items():
        for metakey, value in metadata.items():
            yield assert_equal, getattr(outputs.traits()[key], metakey), value


text:
ACCEPTED

#### According to
Interim Register of Marine and Nonmarine Genera

#### Published in
Current Science 36: -. [369-370]

#### Original name
null

### Remarks
null


text:
'use strict';

var STYLEV = STYLEV || {};

STYLEV.TOPPAGE = STYLEV.TOPPAGE || {};

STYLEV.TOPPAGE.FIRST_ANIMATION = {

	execute: function() {
		var that = STYLEV.TOPPAGE.FIRST_ANIMATION;
		that.setParameter();
		that.bindEvents();
		// that.startAnimation();
		that.animateSVG();
		that.getBookmarklet();
		document.removeEventListener('WebComponentsReady', STYLEV.TOPPAGE.FIRST_ANIMATION.execute);
		//document.querySelector('input[type="text"]').focus();
	},

	setParameter: function() {
		var that = STYLEV.TOPPAGE.FIRST_ANIMATION;

		that.html = document.documentElement;
		that.wrapper = document.querySelector('.wrapper');
		that.main = document.querySelector('.main');
		that.header = document.querySelector('.header');
		that.submitForm = document.querySelector('#validation-form');
		that.submitInput = document.querySelector('#validation-input');
		that.submitButton = document.querySelector('#validation-button');
	},

	bindEvents: function() {
		var that = STYLEV.TOPPAGE.FIRST_ANIMATION;

		// window.addEventListener('resize', that.adjustWrapperPosition);
		window.addEventListener('scroll', that.fixHeaderOnScroll);
		that.submitForm.addEventListener('submit', that.submitValidation);
	},

	submitValidation: function(event) {
		var that = STYLEV.TOPPAGE.FIRST_ANIMATION;
		event.preventDefault();

		var data = {
			url: that.submitInput.value
		};

		that.submit(data);
	},

	submit: function(data) {
		var targetURL;
		if(data.url.indexOf('http') === 0) {
			targetURL = data.url;
		} else {
			targetURL = 'http://' + data.url;
		}

		var apiURI = '/page/result.html?url=' + targetURL;
		location.href = apiURI;
	},

	throwError: function(error) {
		var that = STYLEV.TOPPAGE.FIRST_ANIMATION;
		throw new Error(error || 'Connection failed.');
	},

	startAnimation: function() {
		var that = STYLEV.TOPPAGE.FIRST_ANIMATION;

		//setTimeout(that.startFadeIn, 100);
		// setTimeout(that.adjustWrapperPosition, 0);
	},

	adjustWrapperPosition: function() {
		var that = STYLEV.TOPPAGE.FIRST_ANIMATION;

		if(that.adjustWrapperPositionTimer !== undefined) {
			clearTimeout(that.adjustWrapperPositionTimer);
		}
		that.adjustWrapperPositionTimer = setTimeout(function() {
			that.wrapper.style.setProperty('padding-top', that.header.offsetHeight + 'px', '');
		}, 0);
	},

	fixHeaderOnScroll: function() {
		var that = STYLEV.TOPPAGE.FIRST_ANIMATION;
		var isNotDefaultPosY = window.scrollY > 0;
		if(isNotDefaultPosY) {
			that.html.classList.add('is-fixed-header');
		} else {
			that.html.classList.remove('is-fixed-header');
		}
	},

	startFadeIn: function () {
		var that = STYLEV.TOPPAGE.FIRST_ANIMATION;

		that.main.classList.add('fadeIn');
	},

	animateSVG: function() {
		var that = STYLEV.TOPPAGE.FIRST_ANIMATION;

		new Vivus('vivus-kv-logo', {
			duration: 200,
			file: '/img/style-validator.logo.nopadding.svg',
			type: 'async'
		});
	},

	getBookmarklet: function() {
		var that = STYLEV.TOPPAGE.FIRST_ANIMATION;
		$.ajax({
			url: $('#bookmarklet').attr('href'),
			dataType: 'text',
			success: that.setBookmarklet
		});
	},

	setBookmarklet: function(data) {
		var that = STYLEV.TOPPAGE.FIRST_ANIMATION;
		$('#bookmarklet').attr('href', data);
	}

};

document.addEventListener('WebComponentsReady', STYLEV.TOPPAGE.FIRST_ANIMATION.execute);


text:
{% assign blocks = include.blocks %}

            {% for block in blocks %}
            {% capture thecycle %}{% cycle 'odd', 'even' %}{% endcapture %}

                {% if block.image %}

                {% endif %}

{{block.title}}

                {% if block.text!=nil%}

{{block.text | markdownify }}

                {% endif %}
                {% if block.buttons!=nil%}

                        {% for button in block.buttons %}
                            {{button.label}}
                        {% endfor %}

                {% endif %}

            {% endfor %}


text:
import './navigation';
import './commands';


text:
package com.zakgof.db.velvet.impl.entity;

import java.util.Collection;
import java.util.List;
import java.util.function.Function;

import com.zakgof.db.velvet.IVelvet;
import com.zakgof.db.velvet.IVelvet.ISortedStore;
import com.zakgof.db.velvet.IVelvet.IStoreIndexDef;
import com.zakgof.db.velvet.VelvetException;
import com.zakgof.db.velvet.entity.ISortableEntityDef;
import com.zakgof.db.velvet.query.IKeyQuery;
import com.zakgof.db.velvet.query.ISingleReturnKeyQuery;

public class SortedEntityDef<K extends Comparable<? super K>, V> extends EntityDef<K, V> implements ISortableEntityDef<K, V> {

    public SortedEntityDef(Class<K> keyClass, Class<V> valueClass, String kind, Function<V, K> keyProvider, Collection<IStoreIndexDef<?, V>> indexes) {
        super(keyClass, valueClass, kind, keyProvider, indexes);
    }

    @Override
    public ISortedStore<K, V> store(IVelvet velvet) {
        return velvet.sortedStore(getKind(), getKeyClass(), getValueClass(), indexes);
    }

    @Override
    public List<K> queryKeys(IVelvet velvet, IKeyQuery<K> query) {
        return store(velvet).keys(query);
    }

    @Override
    public K queryKey(IVelvet velvet, ISingleReturnKeyQuery<K> query) {
        List<K> keys = queryKeys(velvet, (IKeyQuery<K>)query);
        if (keys.size() > 1)
            throw new VelvetException("ISingleReturnIndexQuery returned multiple entries");
        return keys.isEmpty() ? null : keys.get(0);
    }
}


text:
package com.hxxc.user.app.ui.base;

import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.text.TextUtils;
import android.widget.TextView;

import com.baidu.mobstat.StatService;
import com.hxxc.user.app.R;
import com.hxxc.user.app.contract.presenter.RxBasePresenter;
import com.hxxc.user.app.rest.ApiManager;
import com.umeng.analytics.MobclickAgent;
import com.umeng.message.PushAgent;

import rx.Subscription;
import rx.subscriptions.CompositeSubscription;

/**
 * Created by chenqun on 2016/6/20.
 */
public class BaseActivity extends AppCompatActivity {
    public final ApiManager mApiManager = ApiManager.getInstance();

    public RxBasePresenter mPresenter;

    public void setPresenter(RxBasePresenter presenter) {
        this.mPresenter = presenter;
    }

    private CompositeSubscription mCompositeSubscription;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //友盟推送应用统计
        PushAgent.getInstance(this).onAppStart();
        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                if (null != mPresenter) {
                    mPresenter.subscribe();
                }
            }
        }, 100);
    }

    public void addSubscription(Subscription s) {
        if (this.mCompositeSubscription == null) {
            this.mCompositeSubscription = new CompositeSubscription();
        }

        this.mCompositeSubscription.add(s);
    }

    //用于友盟,百度统计
    public boolean isMobclick = true;

    @Override
    protected void onResume() {
        super.onResume();
        if (isMobclick) {
            MobclickAgent.onResume(this);
            TextView title = (TextView) findViewById(R.id.toolbar_title);
            if (null != title && !TextUtils.isEmpty(title.getText().toString()) && !"华夏信财".equals(title.getText().toString()))
                StatService.onPageStart(this, title.getText().toString());
            else
                StatService.onResume(this);
        }
    }

    @Override
    protected void onPause() {
        super.onPause();
        if (isMobclick) {
            MobclickAgent.onPause(this);
            TextView title = (TextView) findViewById(R.id.toolbar_title);
            if (null != title && !TextUtils.isEmpty(title.getText().toString()) && !"华夏信财".equals(title.getText().toString()))
                StatService.onPageEnd(this, title.getText().toString());
            else
                StatService.onPause(this);
        }
    }

    @Override
    protected void onDestroy() {
        if (null != mPresenter) {
            mPresenter.unsubscribe();
            mPresenter = null;
        }
        if (this.mCompositeSubscription != null) {
            this.mCompositeSubscription.unsubscribe();
        }
        super.onDestroy();
    }
}


text:
package eu.bcvsolutions.idm.acc.service.impl;

import eu.bcvsolutions.idm.acc.domain.AccGroupPermission;
import eu.bcvsolutions.idm.acc.domain.SystemGroupType;
import eu.bcvsolutions.idm.acc.domain.SystemOperationType;
import eu.bcvsolutions.idm.acc.dto.SysSystemDto;
import eu.bcvsolutions.idm.acc.dto.SysSystemGroupSystemDto;
import eu.bcvsolutions.idm.acc.dto.filter.SysSystemAttributeMappingFilter;
import eu.bcvsolutions.idm.acc.dto.filter.SysSystemGroupSystemFilter;
import eu.bcvsolutions.idm.acc.entity.SysRoleSystemAttribute;
import eu.bcvsolutions.idm.acc.entity.SysRoleSystemAttribute_;
import eu.bcvsolutions.idm.acc.entity.SysRoleSystem_;
import eu.bcvsolutions.idm.acc.entity.SysSchemaAttribute_;
import eu.bcvsolutions.idm.acc.entity.SysSystemAttributeMapping_;
import eu.bcvsolutions.idm.acc.entity.SysSystemGroupSystem;
import eu.bcvsolutions.idm.acc.entity.SysSystemGroupSystem_;
import eu.bcvsolutions.idm.acc.entity.SysSystemGroup_;
import eu.bcvsolutions.idm.acc.entity.SysSystem_;
import eu.bcvsolutions.idm.acc.repository.SysSystemGroupSystemRepository;
import eu.bcvsolutions.idm.acc.service.api.SysSystemAttributeMappingService;
import eu.bcvsolutions.idm.acc.service.api.SysSystemGroupSystemService;
import eu.bcvsolutions.idm.core.api.service.AbstractEventableDtoService;
import eu.bcvsolutions.idm.core.api.service.EntityEventManager;
import eu.bcvsolutions.idm.core.model.entity.IdmRole_;
import eu.bcvsolutions.idm.core.security.api.dto.AuthorizableType;
import java.util.List;
import java.util.UUID;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Predicate;
import javax.persistence.criteria.Root;
import javax.persistence.criteria.Subquery;
import org.modelmapper.internal.util.Assert;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * System groups-system relation service
 *
 * @author Vít Švanda
 * @since 11.2.0
 *
 */
@Service("sysSystemGroupSystemService")
public class DefaultSysSystemGroupSystemService
		extends AbstractEventableDtoService<SysSystemGroupSystemDto, SysSystemGroupSystem, SysSystemGroupSystemFilter>
		implements SysSystemGroupSystemService {

	@Autowired
	private SysSystemAttributeMappingService attributeMappingService;

	@Autowired
	public DefaultSysSystemGroupSystemService(SysSystemGroupSystemRepository repository,
											  EntityEventManager entityEventManager) {
		super(repository, entityEventManager);
	}

	@Override
	public AuthorizableType getAuthorizableType() {
		return new AuthorizableType(AccGroupPermission.SYSTEMGROUP, getEntityClass());
	}

	@Override
	@Transactional
	public SysSystemGroupSystemDto saveInternal(SysSystemGroupSystemDto dto) {
		UUID mergeAttributeId = dto.getMergeAttribute();
		UUID systemId = dto.getSystem();
		if (mergeAttributeId != null) {
			Assert.notNull(systemId, "System ID cannot be null for save a merge attribute!");
			SysSystemAttributeMappingFilter systemAttributeMappingFilter = new SysSystemAttributeMappingFilter();
			systemAttributeMappingFilter.setId(mergeAttributeId);
			systemAttributeMappingFilter.setSystemId(systemId);
			systemAttributeMappingFilter.setOperationType(SystemOperationType.PROVISIONING);
			systemAttributeMappingFilter.setEntityType(IdentitySynchronizationExecutor.SYSTEM_ENTITY_TYPE);

			long count = attributeMappingService.count(systemAttributeMappingFilter);
			Assert.isTrue(count ==1, "Merge attribute was not found for given system.");
		}
		return super.saveInternal(dto);
	}

	@Override
	public List<SysSystemGroupSystemDto> getSystemsInCrossDomainGroup(SysSystemDto system) {
		Assert.notNull(system, "System cannot be null!");
		Assert.notNull(system.getId(), "System ID cannot be null!");

		SysSystemGroupSystemFilter systemGroupSystemFilter = new SysSystemGroupSystemFilter();
		systemGroupSystemFilter.setOthersSystemsInGroupSystemId(system.getId());
		systemGroupSystemFilter.setGroupType(SystemGroupType.CROSS_DOMAIN);
		systemGroupSystemFilter.setDisabled(Boolean.FALSE);

		return this.find(systemGroupSystemFilter, null).getContent();
	}

	@Override
	protected List<Predicate> toPredicates(Root<SysSystemGroupSystem> root, CriteriaQuery<?> query, CriteriaBuilder builder, SysSystemGroupSystemFilter filter) {

		List<Predicate> predicates = super.toPredicates(root, query, builder, filter);

		// System
		if (filter.getSystemId() != null) {
			predicates.add(builder.equal(root.get(SysSystemGroupSystem_.system).get(SysSystem_.id), filter.getSystemId()));
		}

		// System group
		if (filter.getSystemGroupId() != null) {
			predicates.add(builder.equal(root.get(SysSystemGroupSystem_.systemGroup).get(SysSystemGroup_.id), filter.getSystemGroupId()));
		}

		// Disable group
		if (filter.getDisabled() != null) {
			predicates.add(builder.equal(root.get(SysSystemGroupSystem_.systemGroup).get(SysSystemGroup_.disabled), filter.getDisabled()));
		}
		// Group type
		if (filter.getGroupType() != null) {
			predicates.add(builder.equal(root.get(SysSystemGroupSystem_.systemGroup).get(SysSystemGroup_.type), filter.getGroupType()));
		}

		// Merge attribute by schema attribute code.
		if (filter.getMergeAttributeCode() != null) {
			predicates.add(builder.equal(root.get(SysSystemGroupSystem_.mergeAttribute).get(SysSystemAttributeMapping_.schemaAttribute).get(SysSchemaAttribute_.name), filter.getMergeAttributeCode()));
		}

		// Merge attribute by ID.
		if (filter.getMergeMappingAttributeId() != null) {
			predicates.add(builder.equal(root.get(SysSystemGroupSystem_.mergeAttribute).get(SysSystemAttributeMapping_.id), filter.getMergeMappingAttributeId()));
		}

		// Get all systems in same groups as given system.
		if (filter.getOthersSystemsInGroupSystemId() != null) {

			Subquery<SysSystemGroupSystem> subquery = query.subquery(SysSystemGroupSystem.class);
			Root<SysSystemGroupSystem> subRoot = subquery.from(SysSystemGroupSystem.class);
			subquery.select(subRoot);
			subquery.where(
					builder.and(
							builder.equal(root.get(SysSystemGroupSystem_.systemGroup), subRoot.get(SysSystemGroupSystem_.systemGroup)), // correlation attr
							builder.equal(subRoot.get(SysSystemGroupSystem_.system).get(SysSystem_.id), filter.getOthersSystemsInGroupSystemId())
					)
			);
			predicates.add(builder.exists(subquery));
		}

		// Get cross domains groups for given role-system (using same merge attribute).
		if (filter.getCrossDomainsGroupsForRoleSystemId() != null) {

			Subquery<SysRoleSystemAttribute> subquery = query.subquery(SysRoleSystemAttribute.class);
			Root<SysRoleSystemAttribute> subRoot = subquery.from(SysRoleSystemAttribute.class);
			subquery.select(subRoot);
			subquery.where(
					builder.and(
							builder.equal(root.get(SysSystemGroupSystem_.mergeAttribute), subRoot.get(SysRoleSystemAttribute_.systemAttributeMapping)), // correlation attr
							builder.equal(subRoot.get(SysRoleSystemAttribute_.roleSystem).get(SysRoleSystem_.id), filter.getCrossDomainsGroupsForRoleSystemId())
					)
			);
			predicates.add(builder.equal(root.get(SysSystemGroupSystem_.systemGroup).get(SysSystemGroup_.disabled), Boolean.FALSE));
			predicates.add(builder.equal(root.get(SysSystemGroupSystem_.systemGroup).get(SysSystemGroup_.type), SystemGroupType.CROSS_DOMAIN));
			predicates.add(builder.exists(subquery));
		}

		// Get cross domains groups for given role (using same merge attribute).
		if (filter.getCrossDomainsGroupsForRoleId() != null) {

			Subquery<SysRoleSystemAttribute> subquery = query.subquery(SysRoleSystemAttribute.class);
			Root<SysRoleSystemAttribute> subRoot = subquery.from(SysRoleSystemAttribute.class);
			subquery.select(subRoot);
			subquery.where(
					builder.and(
							builder.equal(root.get(SysSystemGroupSystem_.mergeAttribute), subRoot.get(SysRoleSystemAttribute_.systemAttributeMapping)), // correlation attr
							builder.equal(subRoot.get(SysRoleSystemAttribute_.roleSystem).get(SysRoleSystem_.role).get(IdmRole_.id), filter.getCrossDomainsGroupsForRoleId())
					)
			);
			predicates.add(builder.equal(root.get(SysSystemGroupSystem_.systemGroup).get(SysSystemGroup_.disabled), Boolean.FALSE));
			predicates.add(builder.equal(root.get(SysSystemGroupSystem_.systemGroup).get(SysSystemGroup_.type), SystemGroupType.CROSS_DOMAIN));
			predicates.add(builder.exists(subquery));
		}

		return predicates;
	}
}


text:
<SageTVPlugin>

	<Name>Podcast Recorder</Name>

  	<Identifier>podcastrecorderplugin</Identifier>

  	<Description>Podcast Recorder provides the ability to manually record Podcasts or select Podcasts as Favorites and automatically record them.

This plugin provides support only.  To install PodcastRecorder please go to the "UI Mod" section of the plugin manager.</Description>

	<Author>tmiranda</Author>

  	<CreationDate>2010.10.01</CreationDate>

  	<ModificationDate>2011.04.29</ModificationDate>

  	<Version beta="true">0.70</Version>

  	<Desktop>false</Desktop>

	<Dependency>

		<STV>SageTV7</STV>

		<MinVersion>7.1</MinVersion>

	</Dependency>

  	<Dependency>

    		<Plugin>sagex-api</Plugin>

    		<MinVersion>7.0.15.0</MinVersion>

  	</Dependency>

  	<Dependency>

    		<Plugin>ortus-mq</Plugin>

    		<MinVersion>1.0.10</MinVersion>

  	</Dependency>

  	<Dependency>

    		<Plugin>log4j</Plugin>

    		<MinVersion>1.2.15</MinVersion>

  	</Dependency>

	<PluginType>Standard</PluginType>

	<ImplementationClass>tmiranda.podcastrecorder.Plugin</ImplementationClass>

  	<Package>

    		<PackageType>JAR</PackageType>

    		<Location>https://github.com/OpenSageTV/sagetv-plugin-repo/releases/download/1/PodcastRecorder-0.70.zip</Location>

    		<MD5>C5CB327D26EF91112B2C572779C4D135</MD5>

  	</Package>

	<ReleaseNotes>Beta 0.70:

- Added API to manually mark or unmark an Episode as downloaded.

- Try to get Episode title from AiringID, if it's been set.

- Remove redundant database update to improve performance.

- Will now monitor the directory specified in the online options for old files that need to be cleaned up.

- Fixed problem with servialVersionUID that caused database to be invalid for each new release.

Beta 0.60:

- Added ability to record more than the default number of displayed items (usually 20) for Podcasts such as YouTube Channels.

- Start using SetManualRecordProperty() to store metadata.

- Fixed bug that would cause the Favorite status of recorded Episodes to remain the same even though the user changed the Favorite status of the Podcast.

- Fixed bug that prevented MediaFile metadata from getting the correct Favorite status.

Beta 0.50:

- Major overhaul of database routines.

- Fixed bug preventing Channel.Com items from being recorded.

- PodcastKey was not serializable which caused errors when running from a SageClient.

- Added check for downloaded files with 0 length.  Consider this a failed download.

- Added custom Airing metadata for IsPodcast and IsFavoritePodcast.

- Improvements to debugging information.

Beta 0.40:

- Fixed bug that caused excessive memory usage.

- Updated for Sage 7.1.

Beta 0.25:

- Recorded Podcasts now appear as Recordings instead of Imported Videos.

- Fixed a bug that caused the loglevel to reset to "Error".

- Fixed a bug that caused database to continually grow causing Java out of memory errors.

- Changed the way information is stored so that in the future upgrading the plugin will not result in losing all Favorite information.

- Added Configuration option to display advanced settings.

- Added an advanced setting to optionally display a system message if new Favorite Podcasts are available.

- Added an advanced setting to optionally display a system message of Favorite Podcasts have been downloaded.

- Added an advanced setting to allow manual checking for new episodes.

- Added an advanced setting that prints the entire database into the logfile.

- Updated plugin manifest to include dependency on log4j since it is missing from the ortus-mq manifest.

- Improved changing how often scan for new Podcasts occurs.

- Improved the handling of stop() and destroy().

- Improved error handling when sending messages to and from the server.

- Improved error handling if an exception happens while downloading Podcasts.

Beta 0.22 - First public release.</ReleaseNotes>

</SageTVPlugin>


text:
title: Robotics Resources
description: Learn how to access robotics resources on campus
permalink: /resources/
carousel-images:
#  - DSC_0021.JPG
#  - DSC_0007.JPG
#  - DSC_0008.JPG
#  - DSC_0010.JPG
  - DSC_0011.JPG
  - DSC_0014.JPG
  - DSC_0001.JPG
  - DSC_0003.JPG
  - DSC_0004.JPG
  - DSC_0006.JPG
  - DSC_0015.JPG
  - DSC_0016.JPG
  - DSC_0017.JPG
  - DSC_0018.JPG
  - DSC_0020.JPG
  - DSC_0023.JPG
  - DSC_0025.JPG
  - DSC_0027.JPG
  - DSC_0028.JPG
  - DSC_0029.JPG
  - DSC_0030.JPG
  - DSC_0031.JPG
  - DSC_0032.JPG
  - DSC_0033.JPG
  - DSC_0034.JPG
---

## Tempe Campus

eDroneZone Lab

      Tempe Campus

      Physical Education Building East (PEBE), Room 143

3D Print Lab

      Link

      Tempe Campus

      ECF Building, Room 103

Machine Shop

      Link

      Tempe Campus

      PSF Building, Room 64

      Contact

Nano Fab

      Link

      Tempe Campus

      ERC Building, Basement

Gait-Motion Capture Lab

      Tempe Campus

      ECC Building, Room 117

## Polytechnic Campus
The Polytechnic School, one of the six Fulton Schools of Engineering at Arizona State University, is ideally equipped to help you with your next robotics project.  Research on the Polytechnic campus  primarily takes place in the Technology Center, which is recently expanded its research capabilities to encompass an ~ 875 square-foot motion-capture lab and three new robotics lab spaces in Fall 2016.

        {% for item in page.carousel-images %}
          {% capture ii %}{{ forloop.index0 }}{% endcapture %}

        {%endfor%}

        {% for item in page.carousel-images %}
          {% capture ii %}{{ forloop.index0 }}{% endcapture %}

        {%endfor%}

        Previous

        Next

Startup Lab

      https://poly.engineering.asu.edu/research/startuplabs/

      Technology Center(TECH)

      "Making" space is available in the "Startup Lab", a 15,000 square-foot general-purpose fabrication and development area in the Technology Center which houses many of the larger shared pieces of fabrication equipment which can be used for class, project, and personal use.

      The Startup Lab has several important pieces of equipment as well, including: A Shop Bot Wood 3D Router, a 50 Watt Epilog Laser Engraver and Cutter, a 90-Watt large-bed Full Spectrum laser cutter, a multi-material Objet Connex3 350 printer, an Objet 30 printer, and several ABS plastic 3D printers including a Dimension Elite, a Fortus 450, a Fortus 250, a UPrint, and four Lulzbot Minis.  We will also use the micro scribe digitizer probe, the 3D Scanner, Vinyl Cutter, Sewing Machine, Vacuum Former, Injection Molding Press and the variety of hand tools which are also available as needed.

Motion Capture Lab

      Technology Center(TECH), Room 184

      This is an ~875 Square-foot motion capture studio outfitted with a split treadmill, a vicon vision system, a video projector, and a force platform for use with research into biomechanics and robotic systems


text:
	Version 6.7.7

	 Source

Class ContextFilter

Inherits from logging.Filter

This is a filter which injects request information (if available) into the log.

		filter
        (self, record)

No docs

		frappe.setup_logging.setup_logging
        ()

No docs


text:
<!--   Copyright (C) 2013-2014 Computer Sciences Corporation
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License. -->

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>ezbake</groupId>
    <artifactId>ezbake-parent</artifactId>
    <version>0.1-SNAPSHOT</version>
  </parent>

  <artifactId>ezbake-common</artifactId>
  <packaging>nar</packaging>

  <name>ezbake-common</name>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <native.build.skip>true</native.build.skip>
    <ezbake.version>0.1-SNAPSHOT</ezbake.version>
  </properties>

  <dependencies>
    <dependency>
        <groupId>com.google.guava</groupId>
        <artifactId>guava</artifactId>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
    </dependency>
    <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-lang3</artifactId>
    </dependency>
    <dependency>
        <groupId>org.jasypt</groupId>
        <artifactId>jasypt</artifactId>
        <version>1.9.2</version>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>ezbake</groupId>
      <artifactId>ezbake-base-thrift</artifactId>
      <version>${ezbake.version}</version>
      <exclusions>
        <exclusion>
            <groupId>org.boost</groupId>
            <artifactId>boost-includes</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
        <groupId>ezbake</groupId>
        <artifactId>ezbake-configuration-constants</artifactId>
	<version>${ezbake.version}</version>
    </dependency>
    <dependency>
        <groupId>org.boost</groupId>
        <artifactId>boost_filesystem</artifactId>
        <version>1.54</version>
        <type>nar</type>
    </dependency>
    <dependency>
        <groupId>org.boost</groupId>
        <artifactId>boost_thread</artifactId>
        <version>1.54</version>
        <type>nar</type>
        <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
        <plugin>
            <groupId>com.github.maven-nar</groupId>
            <artifactId>nar-maven-plugin</artifactId>
            <version>3.1.0</version>
            <extensions>true</extensions>
            <configuration>
                <ignore>${native.build.skip}</ignore>
                <cpp>
                    <name>g++</name>
                    <includePaths>
                        <includePath>${basedir}/src/main/cpp/include</includePath>
                    </includePaths>
                    <clearDefaultOptions>true</clearDefaultOptions>
                    <options>
                        <option>-O0</option>
                        <option>-g3</option>
                        <option>-fmessage-length=0</option>
                        <option>-std=c++0x</option>
                        <option>-Wall</option>
                        <option>-Wpointer-arith</option>
                        <option>-Wno-long-long</option>
                        <option>-fPIC</option>
                        <option>-c</option>
                    </options>
                </cpp>
                <libraries>
                    <library><type>shared</type></library>
                    <library><type>static</type></library>
                </libraries>
                <tests>
                    <test>
                        <name>${project.artifactId}-unittest</name>
                        <run>true</run>
                    </test>
                </tests>
                <linker>
                    <name>g++</name>
                    <sysLibs>
                        <sysLib>
                            <name>ssl</name>
                        </sysLib>
                        <sysLib>
                            <name>crypto</name>
                        </sysLib>
                    </sysLibs>
                </linker>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>build-helper-maven-plugin</artifactId>
            <version>1.7</version>
            <executions>
                <execution>
                    <id>attach-artifacts</id>
                    <phase>package</phase>
                    <goals>
                        <goal>attach-artifact</goal>
                    </goals>
                    <configuration>
                        <artifacts>
                            <artifact>
                                <file>${project.build.directory}/${project.artifactId}-${project.version}.jar</file>
                                <type>jar</type>
                            </artifact>
                        </artifacts>
                    </configuration>
                </execution>
            </executions>
        </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
        <activation>
            <os>
                <name>Linux</name>
                <family>UNIX</family>
                <arch>amd64</arch>
            </os>
        </activation>
        <properties>
            <native.build.skip>false</native.build.skip>
        </properties>
    </profile>
  </profiles>
</project>


text:
package org.flyingfortress.exception.txn;

/**
 * Created with IntelliJ IDEA.
 * User: vishnuhr
 * Date: 15/12/13
 * Time: 12:03 PM
 */
public class TransactionException extends  Exception {

    private final String txnId;

    public TransactionException(String txnId, String msg) {
        super("Error in transaction:"+txnId+"."+msg);
        this.txnId = txnId;
    }

    public TransactionException(String txnId, String msg, Throwable cause) {
        super("Error in transaction:"+txnId+"."+msg,cause);
        this.txnId = txnId;
    }

    public String getTxnId() {
        return txnId;
    }
}


text:
int arch_timer_of_register(void);
int arch_timer_sched_clock_init(void);
#else
static inline int arch_timer_of_register(void)
{
	return -ENXIO;
}

static inline int arch_timer_sched_clock_init(void)
{
	return -ENXIO;
}
#endif

#endif


text:
"""
VPool module
"""
from ovs.dal.dataobject import DataObject
from ovs.dal.structures import Dynamic, Property, Relation
from ovs.extensions.storageserver.storagedriver import StorageDriverClient
from ovs.dal.hybrids.backendtype import BackendType
import time

class VPool(DataObject):
    """
    The VPool class represents a vPool. A vPool is a Virtual Storage Pool, a Filesystem, used to
    deploy vMachines. a vPool can span multiple Storage Drivers and connects to a single Storage BackendType.
    """
    __properties = [Property('name', str, doc='Name of the vPool'),
                    Property('description', str, mandatory=False, doc='Description of the vPool'),
                    Property('size', int, mandatory=False, doc='Size of the vPool expressed in Bytes. Set to zero if not applicable.'),
                    Property('login', str, mandatory=False, doc='Login/Username for the Storage BackendType.'),
                    Property('password', str, mandatory=False, doc='Password for the Storage BackendType.'),
                    Property('connection', str, mandatory=False, doc='Connection (IP, URL, Domainname, Zone, ...) for the Storage BackendType.'),
                    Property('metadata', dict, mandatory=False, doc='Metadata for the backend, as used by the Storage Drivers.')]
    __relations = [Relation('backend_type', BackendType, 'vpools', doc='Type of storage backend.')]
    __dynamics = [Dynamic('status',      str, 10),
                  Dynamic('statistics',  dict, 0),
                  Dynamic('stored_data', int, 60)]

    def _status(self):
        """
        Fetches the Status of the vPool.
        """
        _ = self
        return None

    def _statistics(self):
        """
        Aggregates the Statistics (IOPS, Bandwidth, ...) of each vDisk served by the vPool.
        """
        vdiskstatsdict = {}
        for key in StorageDriverClient.stat_keys:
            vdiskstatsdict[key] = 0
            vdiskstatsdict['{0}_ps'.format(key)] = 0
        for vdisk in self.vdisks:
            for key, value in vdisk.statistics.iteritems():
                if key != 'timestamp':
                    vdiskstatsdict[key] += value
        vdiskstatsdict['timestamp'] = time.time()
        return vdiskstatsdict

    def _stored_data(self):
        """
        Aggregates the Stored Data of each vDisk served by the vPool.
        """
        return sum([disk.info['stored'] for disk in self.vdisks])


text:
package proguard.classfile.util;

import proguard.classfile.*;
import proguard.classfile.visitor.*;

/**
 * This utility class provides methods to find class members in a given class
 * or in its hierarchy.
 *
 * @author Eric Lafortune
 */
public class MemberFinder
extends      SimplifiedVisitor
implements   MemberVisitor
{
    private static class MemberFoundException extends RuntimeException {}
    private static final MemberFoundException MEMBER_FOUND = new MemberFoundException();

    private final boolean searchHierarchy;

    private Clazz  clazz;
    private Member member;

    /**
     * Creates a new MemberFinder that looks in the class hierarchy.
     */
    public MemberFinder()
    {
        this(true);
    }

    /**
     * Creates a new MemberFinder that looks in the class hierarchy if
     * specified.
     */
    public MemberFinder(boolean searchHierarchy)
    {
        this.searchHierarchy = searchHierarchy;
    }

    /**
     * Finds the field with the given name and descriptor in the given
     * class or its hierarchy. The name and descriptor may contain wildcards.
     */
    public Field findField(Clazz  clazz,
                           String name,
                           String descriptor)
    {
        return findField(null, clazz, name, descriptor);
    }

    /**
     * Finds the field with the given name and descriptor in the given
     * class or its hierarchy. The name and descriptor may contain wildcards.
     */
    public Field findField(Clazz  referencingClass,
                           Clazz  clazz,
                           String name,
                           String descriptor)
    {
        return (Field)findMember(referencingClass, clazz, name, descriptor, true);
    }

    /**
     * Finds the method with the given name and descriptor in the given
     * class or its hierarchy. The name and descriptor may contain wildcards.
     */
    public Method findMethod(Clazz  clazz,
                             String name,
                             String descriptor)
    {
        return findMethod(null, clazz, name, descriptor);
    }

    /**
     * Finds the method with the given name and descriptor in the given
     * class or its hierarchy. The name and descriptor may contain wildcards.
     */
    public Method findMethod(Clazz  referencingClass,
                             Clazz  clazz,
                             String name,
                             String descriptor)
    {
        return (Method)findMember(referencingClass, clazz, name, descriptor, false);
    }

    /**
     * Finds the class member with the given name and descriptor in the given
     * class or its hierarchy. The name and descriptor may contain wildcards.
     */
    public Member findMember(Clazz   clazz,
                             String  name,
                             String  descriptor,
                             boolean isField)
    {
        return findMember(null, clazz, name, descriptor, isField);
    }

    /**
     * Finds the class member with the given name and descriptor in the given
     * class or its hierarchy, referenced from the optional given class.
     * The name and descriptor may contain wildcards.
     */
    public Member findMember(Clazz   referencingClass,
                             Clazz   clazz,
                             String  name,
                             String  descriptor,
                             boolean isField)
    {
        try
        {
            boolean containsWildcards =
                (name       != null && (name.indexOf('*')       >= 0 || name.indexOf('?')       >= 0)) ||
                (descriptor != null && (descriptor.indexOf('*') >= 0 || descriptor.indexOf('?') >= 0));

            this.clazz  = null;
            this.member = null;

            // The class member may be in a different class, as of Java 1.2.
            // The class member may be private in a nest member, as of Java 11.
            // Check the accessibility from the referencing class, if any
            // (non-dummy), taking into account access flags and nests.
            MemberVisitor memberVisitor =
                referencingClass           != null &&
                referencingClass.getName() != null ?
                    new MemberClassAccessFilter(referencingClass, this) :
                    this;

            // We'll return with a MemberFoundException as soon as we've found
            // the class member.
            clazz.hierarchyAccept(true,
                                  searchHierarchy,
                                  searchHierarchy,
                                  false,
                                  containsWildcards ?
                    isField ?
                        new AllFieldVisitor(
                        new MemberNameFilter(name,
                        new MemberDescriptorFilter(descriptor,
                        memberVisitor))) :

                        new AllMethodVisitor(
                        new MemberNameFilter(name,
                        new MemberDescriptorFilter(descriptor,
                        memberVisitor))) :
                   isField ?
                        new NamedFieldVisitor(name, descriptor,
                        memberVisitor) :

                        new NamedMethodVisitor(name, descriptor,
                        memberVisitor));
        }
        catch (MemberFoundException ex)
        {
            // We've found the member we were looking for.
        }

        return member;
    }

    /**
     * Returns the corresponding class of the most recently found class
     * member.
     */
    public Clazz correspondingClass()
    {
        return clazz;
    }

    /**
     * Returns whether the given method is overridden anywhere down the class
     * hierarchy.
     */
    public boolean isOverriden(Clazz  clazz,
                               Method method)
    {
        String name       = method.getName(clazz);
        String descriptor = method.getDescriptor(clazz);

        // Go looking for the method down the class hierarchy.
        try
        {
            this.clazz  = null;
            this.member = null;

            clazz.hierarchyAccept(false, false, false, true,
                new NamedMethodVisitor(name, descriptor,
                new MemberAccessFilter(0, ClassConstants.ACC_PRIVATE, this)));
        }
        catch (MemberFoundException ex)
        {
            // We've found an overriding method.
            return true;
        }

        return false;
    }

    /**
     * Returns whether the given field is shadowed anywhere down the class
     * hierarchy.
     */
    public boolean isShadowed(Clazz clazz,
                              Field field)
    {
        String name       = field.getName(clazz);
        String descriptor = field.getDescriptor(clazz);

        // Go looking for the field down the class hierarchy.
        try
        {
            this.clazz  = null;
            this.member = null;
            clazz.hierarchyAccept(false, false, false, true,
                new NamedFieldVisitor(name, descriptor,
                new MemberAccessFilter(0, ClassConstants.ACC_PRIVATE, this)));
        }
        catch (MemberFoundException ex)
        {
            // We've found a shadowing field.
            return true;
        }

        return false;
    }

//    // Implementations for ClassVisitor.
//
//    private void visitAnyClass(Clazz clazz)
//    {
//        if (member == null)
//        {
//            member = isField ?
//                (Member)clazz.findField(name, descriptor) :
//                (Member)clazz.findMethod(name, descriptor);
//
//            if (member != null)
//            {
//                this.clazz = clazz;
//            }
//        }
//    }

    // Implementations for MemberVisitor.

    public void visitAnyMember(Clazz clazz, Member member)
    {
        this.clazz  = clazz;
        this.member = member;

        throw MEMBER_FOUND;
    }
}