text:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.seeyoui.kensite.framework.report.dataSource.persistence.DataSourceMapper" >
	<!-- 查询单表的字段 -->
	<sql id="tableColumns">
		T.ID AS "id",
		T.CREATE_DATE AS "createDate",
		T.CREATE_USER AS "createUser",
		T.UPDATE_DATE AS "updateDate",
		T.UPDATE_USER AS "updateUser",
		T.REMARKS AS "remarks",
		T.DEL_FLAG AS "delFlag",
		T.NAME AS "name",
		T.CODE_NUM AS "codeNum",
		T.TYPE AS "type",
		T.DESCRIBE AS "describe",
		T.CONTENT AS "content",
		T.VIEW_SQL AS "viewSql"
	</sql>
	<!-- 查询过滤条件 -->
	<sql id="whereStr">
		<where>
			1=1
			<if test="id != null and id != ''">

			</if>
			<if test="createDate != null and createDate != ''">
				AND T.CREATE_DATE = #{createDate}
			</if>
			<if test="createUser != null and createUser != ''">
				AND T.CREATE_USER LIKE '%${createUser}%'
			</if>
			<if test="updateDate != null and updateDate != ''">
				AND T.UPDATE_DATE = #{updateDate}
			</if>
			<if test="updateUser != null and updateUser != ''">
				AND T.UPDATE_USER LIKE '%${updateUser}%'
			</if>
			<if test="remarks != null and remarks != ''">
				AND T.REMARKS LIKE '%${remarks}%'
			</if>
			<if test="delFlag != null and delFlag != ''">
				AND T.DEL_FLAG LIKE '%${delFlag}%'
			</if>
			<if test="name != null and name != ''">
				AND T.NAME LIKE '%${name}%'
			</if>
			<if test="codeNum != null and codeNum != ''">
				AND T.CODE_NUM LIKE '%${codeNum}%'
			</if>
			<if test="type != null and type != ''">
				AND T.TYPE LIKE '%${type}%'
			</if>
			<if test="describe != null and describe != ''">
				AND T.DESCRIBE LIKE '%${describe}%'
			</if>
			<if test="content != null and content != ''">
				AND T.CONTENT LIKE '%${content}%'
			</if>
			<if test="viewSql != null and viewSql != ''">
				AND T.VIEW_SQL LIKE '%${viewSql}%'
			</if>
		</where>
	</sql>
	<sql id="orderBy">
		ORDER BY
		<if test="sort != null and sort != ''">
			${sort} ${order},
		</if>
		T.CREATE_DATE DESC
	</sql>

	<!-- 根据ID查询单条数据 -->
	<select id="findOne" resultType="com.seeyoui.kensite.framework.report.dataSource.domain.DataSource">
		SELECT
		<include refid="tableColumns" />
		FROM KS_DATA_SOURCE T
		WHERE T.ID = #{id}
	</select>

	<!-- 查询数据集合 -->
	<select id="findList" resultType="com.seeyoui.kensite.framework.report.dataSource.domain.DataSource">
		SELECT
		<include refid="tableColumns"/>
		FROM KS_DATA_SOURCE T
		<include refid="whereStr"/>
		<include refid="orderBy"/>
		<![CDATA[ limit #{row}, #{rows}]]>
	</select>

	<!-- 查询所有数据集合 -->
	<select id="findAll" resultType="com.seeyoui.kensite.framework.report.dataSource.domain.DataSource">
		SELECT
		<include refid="tableColumns"/>
		FROM KS_DATA_SOURCE T
		<include refid="whereStr"/>
		<include refid="orderBy"/>
	</select>

	<!-- 查询数据总数 -->
	<select id="findTotal" resultType="Integer">
		SELECT
		COUNT(1) total
		FROM KS_DATA_SOURCE T
		<include refid="whereStr"/>
	</select>

	<!-- 查询数据总数排除当前数据 -->
	<select id="findExTotal" resultType="Integer">
		SELECT
		COUNT(1) total
		FROM KS_DATA_SOURCE T
		<include refid="whereStr"/>
		AND T.ID != #{id}
	</select>

	<!-- 数据新增 -->
	<insert id="save" parameterType="com.seeyoui.kensite.framework.report.dataSource.domain.DataSource">
		INSERT INTO KS_DATA_SOURCE (

			REMARKS,
			DEL_FLAG,
			NAME,
			CODE_NUM,
			TYPE,
			DESCRIBE,
			CONTENT,
			VIEW_SQL,
			CREATE_USER,
			CREATE_DATE,
			ID
		)
		VALUES (

			#{remarks,jdbcType=VARCHAR},
			#{delFlag,jdbcType=VARCHAR},
			#{name,jdbcType=VARCHAR},
			#{codeNum,jdbcType=VARCHAR},
			#{type,jdbcType=VARCHAR},
			#{describe,jdbcType=VARCHAR},
			#{content,jdbcType=VARCHAR},
			#{viewSql,jdbcType=VARCHAR},
			#{createUser.userName},
			now(),
			#{id}
		)
	</insert>

	<!-- 数据修改 -->
	<update id="update" parameterType="com.seeyoui.kensite.framework.report.dataSource.domain.DataSource">
		UPDATE KS_DATA_SOURCE
		<set>

			<if test="remarks !=null and remarks !=''">
			REMARKS=#{remarks},
			</if>
			<if test="delFlag !=null and delFlag !=''">
			DEL_FLAG=#{delFlag},
			</if>
			<if test="name !=null and name !=''">
			NAME=#{name},
			</if>
			<if test="codeNum !=null and codeNum !=''">
			CODE_NUM=#{codeNum},
			</if>
			<if test="type !=null and type !=''">
			TYPE=#{type},
			</if>
			<if test="describe !=null and describe !=''">
			DESCRIBE=#{describe},
			</if>
			<if test="content !=null and content !=''">
			CONTENT=#{content},
			</if>
			<if test="viewSql !=null and viewSql !=''">
			VIEW_SQL=#{viewSql},
			</if>
			UPDATE_USER = #{updateUser.userName},
			UPDATE_DATE = now(),
			ID = #{id}
		</set>
		WHERE ID = #{id}
	</update>

	<!-- 数据删除 -->
	<delete id="delete">
		DELETE FROM KS_DATA_SOURCE WHERE id IN
		<foreach item="listId" collection="list"
			open="(" separator="," close=")">
			#{listId}
		</foreach>
	</delete>
</mapper>

redpajama_set_name: RedPajamaGithub


text:
Searchify
=========
Searchify provides a quick way to search your collections. Type, choose, enjoy!

Requirements
------------
* Rails 3.1
* jQuery
* jQuery UI (for the autocomplete widget)

Installation
------------
First, install the gem

    gem install searchify

Mount the engine to the desired route in `config/routes.rb`

    mount Searchify::Engine => "/searchify", :as => "searchify"

Add both jquery-ui and searchify to your `app/assets/javascripts/application.js` file

    //= require jquery-ui
    //= require searchify/searchify

Finally, call the `searchify()` method on all `.searchify` fields.

    $('.searchify').searchify();

Usage
-----
### Autocomplete search

Searchify is intended to be used on a per model basis. You type, you choose, you are redirected to the chosen resource show page.
Calling it on an index page, it infers the model to be searched with the controller name, or the `resource_class` helper, if it exists.
For example, consider the following line of code on your `/posts` page:

    <%= searchify %>

This will triggers an AJAX call to `/searchify/search/posts.json` page and jQuery will handle the response with its autocomplete widget.

If you want to specify the collection, i.e. searching for `users` on the `posts` page, just write this:

    <%= searchify :users %>

When a selection is made, you are redirected to the chosen resource show page. If you want to land on any other member action, the `action` option is for you.

    <%= searchify :action => :edit %>

If your redirect is more complex, you can always redefine the `select_url` option. The `(id)` keyword will be replaced by the id of the selected resource.

    <%= searchify :select_url => "/more/complex/path/(id)/with/custom/action" %>

### In place autocomplete

Searchify can also be used in a form. For example, let's say that a post belongs to a user of your choice:

    <%= form_for(@post) do |f| %>

            <%= f.label :user %>

            <%= f.searchify :user %>

    <% end %>

Searchify will include a `user_id` field in your form, which will be automatically populated with your search. Searchify uses the `label_method` option to display the object.

### Scopes

Searchify is by default scopes aware. Let's say you are here:

`/posts?created_by=3`

Assuming your `Post` model responds to the `created_by` method, it will be included in the search.

You may also force your own scopes into a searchify field by adding the `scopes` options, as follow:

    <%= searchify :scopes => {:created_by => 3} %>

### Configuration

You can always override the defaults with an initializer. Options are as follow:

    Searchify::Config.configure do |config|

        # Extract those keys from the params hash
        config.scope_exclusion  = %w( controller action format collection term page )

        # Default column names on which you want to do your search
        config.column_names     = %w( name title abbreviation )

        # If true, searchify will apply url scopes to your search
        config.scope_awareness  = true

        # Limit the number of results in one search
        config.limit            = 30

        # Database search key. Default is 'ILIKE' for Postgres, 'LIKE' for others.
        config.search_key       = nil

        # Method to be called on each resource
        config.label_method     = :name

        # Default action on which you want to land after a selection. Could be :show, :edit or any custom member action
        config.default_action   = :show
    end

### Search stategies

By default, Searchify does a case insensitive search on `name`, `title` and `abbreviation` fields of your models, if they exist.
To override the default search strategy, just define a class method named `search_strategy` in your model. It should accepts two arguments and returns an array of hashes.

    class User < ActiveRecord::Base
        def self.search_strategy(term, scopes)
            columns = %w( username, first_name, last_name )

            scoped = where( columns.map{ |c| "(#{c} ILIKE :term)" }.join(' OR '), :term => "%#{term}%")

            scopes.each do |key, value|
              scoped = scoped.send(key, value) if respond_to?(key)
            end

            scoped.map do |user|
              {:label => user.username, :id => user.id}
            end
        end
    end

You may also want to use a per-search search strategy, without affecting the default one. The `search_strategy` option is for you.

    <%= searchify :users, :search_strategy => :my_custom_method %>

Searchify will then try to call your `User.my_custom_method`. It must accepts two arguments, and still return an array of hashes.


text:
@class RXVersionComparator, RXWelcomeWindowController, NSButton, NSWindowController, NSWindow, NSTextField;

@interface RXApplicationDelegate : NSObject {
#if defined(DEBUG)
  NSWindowController* debugConsoleWC;
#endif

  IBOutlet NSWindow* aboutBox;
  IBOutlet NSTextField* versionField;
  IBOutlet NSTextField* copyrightField;
  IBOutlet NSButton* acknowledgmentsButton;

  IBOutlet RXVersionComparator* versionComparator;

  RXWelcomeWindowController* welcomeController;

  NSURL* autosaveURL;

  BOOL disableGameSavingAndLoading;
  BOOL missedAutosave;
  BOOL wasFullscreen;
  BOOL quicktimeGood;
}

+ (RXApplicationDelegate*)sharedApplicationDelegate;

- (IBAction)orderFrontAboutWindow:(id)sender;
- (IBAction)showAcknowledgments:(id)sender;

- (IBAction)openDocument:(id)sender;
- (IBAction)saveGame:(id)sender;
- (IBAction)saveGameAs:(id)sender;

- (BOOL)isGameLoaded;

- (BOOL)isGameLoadingAndSavingDisabled;
- (void)setDisableGameLoadingAndSaving:(BOOL)disable;

@end


text:
<?php

namespace Elcodi\Admin\CurrencyBundle\Builder;

use Elcodi\Component\Menu\Builder\Abstracts\AbstractMenuBuilder;
use Elcodi\Component\Menu\Builder\Interfaces\MenuBuilderInterface;
use Elcodi\Component\Menu\Entity\Menu\Interfaces\MenuInterface;
use Elcodi\Component\Menu\Factory\NodeFactory;
use Symfony\Component\DependencyInjection\ContainerInterface;

/**
 * Class MenuBuilder
 */
class MenuBuilder extends AbstractMenuBuilder implements MenuBuilderInterface
{
    private $permissionsRepository;
    private $currentUser;
    private $resource = "currency";
    private $permissions = [
        'canRead' => false,
        'canCreate' => false,
        'canUpdate' => false,
        'canDelete' => false
    ];

    function __construct(NodeFactory $menuNodeFactory, ContainerInterface $container)
    {
        parent::__construct($menuNodeFactory);
        $this->permissionsRepository = $container->get('elcodi.repository.permission_group');
        $this->currentUser = $container->get('security.token_storage')->getToken()->getUser();

        $this->permissions = [
            'canRead' => $this->permissionsRepository->canReadEntity($this->resource, $this->currentUser),
            'canCreate' => $this->permissionsRepository->canCreateEntity($this->resource, $this->currentUser),
            'canUpdate' => $this->permissionsRepository->canUpdateEntity($this->resource, $this->currentUser),
            'canDelete' => $this->permissionsRepository->canDeleteEntity($this->resource, $this->currentUser)
        ];
    }

    /**
     * Build the menu
     *
     * @param MenuInterface $menu Menu
     */
    public function build(MenuInterface $menu)
    {
        if ($this->permissions['canRead']) {
            $menu
                ->findSubnodeByName('admin.settings.plural')
                ->addSubnode(
                    $this
                        ->menuNodeFactory
                        ->create()
                        ->setName('admin.currency.plural')
                        ->setUrl('admin_currency_list')
                        ->setPriority(3)
                );
        }
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical">
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="3dp"
        android:background="@color/white">
        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content">
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_margin="10dp"
                android:text="@string/school"
                android:textSize="15sp"/>
            <EditText
                android:id="@+id/school_name_"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentRight="true"
                android:layout_margin="10dp"
                android:text="12"
                android:background="@android:color/transparent"/>
        </RelativeLayout>
    </LinearLayout>
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="3dp"
        android:background="@color/white">
        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content">
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/academy"
                android:layout_margin="10dp"
                android:textSize="15sp"/>
            <EditText
                android:id="@+id/academy"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentRight="true"
                android:layout_margin="10dp"
                android:text="12"
                android:background="@android:color/transparent"/>
        </RelativeLayout>
    </LinearLayout>
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="3dp"
        android:background="@color/white">
        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content">
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_margin="10dp"
                android:text="@string/student_id"
                android:textSize="15sp"/>
            <EditText
                android:id="@+id/student_id"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_margin="10dp"
                android:layout_alignParentRight="true"
                android:text="12"
                android:background="@android:color/transparent"/>
        </RelativeLayout>
    </LinearLayout>

</LinearLayout>


text:
import requests

from pypercube.event import Event
from pypercube.metric import Metric
from pypercube.time_utils import STEP_CHOICES

class Cube(object):
    def __init__(self, hostname, port=1081, api_version="1.0"):
        self.hostname = hostname
        self.port = port
        self.api_version = api_version

    ### Utility methods ###
    def get_base_url(self):
        """
        >>> c = Cube('cube.mydomain.com')
        >>> print(c.get_base_url())
        http://cube.mydomain.com:1081/1.0
        """
        return "http://{hostname}:{port}/{api}".format(
                hostname=self.hostname,
                port=self.port,
                api=self.api_version)

    ### Data access methods
    def _handle_response(self, response, obj):
        if response.ok and response.json is not None:
            return [obj.from_json(record) for record in response.json]
        elif not response.ok:
            raise InvalidQueryError({
                "status": response.status_code,
                "url": response.url})
        return response.content

    def get_event(self, event_expression, start=None, stop=None, limit=None):
        query = Query(self.get_base_url(), "event/get", start, stop, None,
                limit)
        r = query.get(event_expression)
        return self._handle_response(r, Event)

    def get_metric(self, metric_expression, start=None, stop=None, step=None,
            limit=None):
        query = Query(self.get_base_url(), "metric/get", start, stop, step,
                limit)
        r = query.get(metric_expression)
        return self._handle_response(r, Metric)

class Query(object):
    def __init__(self, base_url, path, start=None, stop=None, step=None,
            limit=None):
        self.base_url = base_url
        self.path = path
        self.params = Query._build_params(start, stop, step, limit)

    @classmethod
    def _format_time(cls, t):
        if hasattr(t, 'isoformat'):
            return t.isoformat()
        return t

    @classmethod
    def _build_params(cls, start=None, stop=None, step=None, limit=None):
        params = dict()
        if start:
            params['start'] = cls._format_time(start)
        if stop:
            params['stop'] = cls._format_time(stop)
        if step:
            if step in (q[0] for q in STEP_CHOICES):
                params['step'] = "{step}".format(step=step)
            else:
                raise ValueError("{step} is not a valid step. See "
                "{cls}.STEP_CHOICES".format(
                    step=step,
                    cls=cls.__name__))
        if limit:
            params['limit'] = limit
        return params

    def get(self, expression):
        params = self.params.copy()
        params.update(expression=expression)
        path = "{base_url}/{path}".format(
                base_url=self.base_url,
                path=self.path,
                )
        return requests.get(path, params=params)

class InvalidQueryError(Exception):
    pass


text:
<?xml version="1.0" encoding="UTF-8"?>
<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>org.jenkins-ci.plugins</groupId>
        <artifactId>plugin</artifactId>
        <version>1.509.4</version>
        <!-- which version of Jenkins is this plugin built against? -->
    </parent>

    <groupId>exactor.jenkins</groupId>
    <artifactId>exactor-jenkins</artifactId>
    <version>1.0.2-SNAPSHOT</version>
    <packaging>hpi</packaging>
    <description>Jenkins plugin to expose html reports generated with Exactor</description>
    <url>http://wiki.jenkins-ci.org/display/JENKINS/Exactor-Jenkins</url>

    <developers>
        <developer>
            <id>andoni.delolmo (ADO)</id>
            <name>Andoni del Olmo</name>
            <email>andoni.delolmo@gmail.com</email>
            <roles>
                <role>Developer</role>
            </roles>
            <timezone>+1</timezone>
        </developer>
    </developers>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.target>1.6</maven.compiler.target>
        <maven.compiler.source>1.6</maven.compiler.source>

        <version.slf4j>1.7.2</version.slf4j>

        <artifact.dist.name>${project.build.directory}/${project.artifactId}-${project.version}.hpi</artifact.dist.name>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.sonatype.sisu</groupId>
            <artifactId>sisu-guice</artifactId>
            <version>3.1.0</version>
            <exclusions>
                <exclusion>
                    <groupId>com.google.collections</groupId>
                    <artifactId>google-collections</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>${version.slf4j}</version>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>2.7</version>
        </dependency>
        <dependency>
            <groupId>commons-lang</groupId>
            <artifactId>commons-lang</artifactId>
            <version>2.4</version>
        </dependency>
        <dependency>
            <groupId>commons-codec</groupId>
            <artifactId>commons-codec</artifactId>
            <version>1.8</version>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.13.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>1.9.5</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <finalName>${project.artifactId}-${project.version}</finalName>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>de.jutzig</groupId>
                    <artifactId>github-release-plugin</artifactId>
                    <version>1.1.1</version>
                    <executions>
                        <execution>
                            <phase>install</phase>
                            <goals>
                                <goal>release</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <serverId>github</serverId>
                        <description>Release description here</description>
                        <releaseName>Exactor-Jenkins ${project.version}</releaseName>
                        <tag>exactor-jenkins-${project.version}</tag>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <artifactId>maven-release-plugin</artifactId>
                <configuration>
                    <goals>deploy</goals>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>de.jutzig</groupId>
                        <artifactId>github-release-plugin</artifactId>
                        <configuration>
                            <artifact>${artifact.dist.name}</artifact>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <!-- get every artifact through repo.jenkins-ci.org, which proxies all the artifacts that we need -->
    <repositories>
        <repository>
            <id>repo.jenkins-ci.org</id>
            <url>http://repo.jenkins-ci.org/public/</url>
        </repository>
    </repositories>

    <distributionManagement>
        <repository>
            <id>maven.jenkins-ci.org</id>
            <url>http://maven.jenkins-ci.org:8081/content/repositories/releases/</url>
        </repository>
    </distributionManagement>

    <scm>
        <url>git:git@github.com:adelolmo/exactor-jenkins.git</url>
        <connection>scm:git:git@github.com:adelolmo/exactor-jenkins.git</connection>
        <developerConnection>scm:git:git@github.com:adelolmo/exactor-jenkins.git</developerConnection>
    </scm>
</project>


text:
"""
Default settings for the ``mezzanine.forms`` app. Each of these can be
overridden in your project's settings module, just like regular
Django settings. The ``editable`` argument for each controls whether
the setting is editable via Django's admin.

Thought should be given to how a setting is actually used before
making it editable, as it may be inappropriate - for example settings
that are only read during startup shouldn't be editable, since changing
them would require an application reload.
"""
from django.utils.translation import gettext_lazy as _

from mezzanine.conf import register_setting

register_setting(
    name="FORMS_FIELD_MAX_LENGTH",
    description=_("Max length allowed for field values in the forms app."),
    editable=False,
    default=2000,
)

register_setting(
    name="FORMS_CSV_DELIMITER",
    description=_(
        "Char to use as a field delimiter when exporting form " "responses as CSV."
    ),
    editable=False,
    default=",",
)

register_setting(
    name="FORMS_UPLOAD_ROOT",
    description=_("Absolute path for storing file uploads for the forms app."),
    editable=False,
    default="",
)

register_setting(
    name="FORMS_EXTRA_FIELDS",
    description=_(
        "Extra field types for the forms app. Should contain a "
        "sequence of three-item sequences, each containing the ID, dotted "
        "import path for the field class, and field name, for each custom "
        "field type. The ID is simply a numeric constant for the field, "
        "but cannot be a value already used, so choose a high number such "
        "as 100 or greater to avoid conflicts."
    ),
    editable=False,
    default=(),
)

register_setting(
    name="FORMS_EXTRA_WIDGETS",
    description=_(
        "Extra field widgets for the forms app. Should contain a "
        "sequence of two-item sequences, each containing an existing ID "
        "for a form field, and a dotted import path for the widget class."
    ),
    editable=False,
    default=(),
)


text:
package com.planet_ink.coffee_mud.MOBS;
import com.planet_ink.coffee_mud.core.interfaces.*;
import com.planet_ink.coffee_mud.core.*;
import com.planet_ink.coffee_mud.core.collections.*;
import com.planet_ink.coffee_mud.Abilities.interfaces.*;
import com.planet_ink.coffee_mud.Areas.interfaces.*;
import com.planet_ink.coffee_mud.Behaviors.interfaces.*;
import com.planet_ink.coffee_mud.CharClasses.interfaces.*;
import com.planet_ink.coffee_mud.Commands.interfaces.*;
import com.planet_ink.coffee_mud.Common.interfaces.*;
import com.planet_ink.coffee_mud.Exits.interfaces.*;
import com.planet_ink.coffee_mud.Items.interfaces.*;
import com.planet_ink.coffee_mud.Libraries.interfaces.*;
import com.planet_ink.coffee_mud.Locales.interfaces.*;
import com.planet_ink.coffee_mud.MOBS.interfaces.*;
import com.planet_ink.coffee_mud.Races.interfaces.*;

import java.util.*;

public class Penguin extends StdMOB
{
	@Override
	public String ID()
	{
		return "Penguin";
	}

	public Penguin()
	{
		super();
		final Random randomizer = new Random(System.currentTimeMillis());

		username="a penguin";
		setDescription("It\\`s a short flightless bird with webbed feet and a short wagging tail.");
		setDisplayText("A penguin waddles here.");
		CMLib.factions().setAlignment(this,Faction.Align.NEUTRAL);
		setMoney(0);
		basePhyStats.setWeight(30 + Math.abs(randomizer.nextInt() % 55));
		setWimpHitPoint(2);

		addBehavior(CMClass.getBehavior("Follower"));
		addBehavior(CMClass.getBehavior("MudChat"));

		basePhyStats().setDamage(4);

		baseCharStats().setStat(CharStats.STAT_INTELLIGENCE,1);

		basePhyStats().setAbility(0);
		basePhyStats().setLevel(1);
		basePhyStats().setArmor(90);

		baseCharStats().setMyRace(CMClass.getRace("Penguin"));
		baseCharStats().getMyRace().startRacing(this,false);
		baseState.setHitPoints(CMLib.dice().roll(basePhyStats().level(),20,basePhyStats().level()));

		recoverMaxState();
		resetToMaxState();
		recoverPhyStats();
		recoverCharStats();
	}

}


text:
/*@internal*/
namespace ts {
    export const enum ImportKind {
        Named,
        Default,
        Namespace,
        CommonJS,
    }

    export const enum ExportKind {
        Named,
        Default,
        ExportEquals,
        UMD,
    }

    export interface SymbolExportInfo {
        readonly symbol: Symbol;
        readonly moduleSymbol: Symbol;
        /** Set if `moduleSymbol` is an external module, not an ambient module */
        moduleFileName: string | undefined;
        exportKind: ExportKind;
        targetFlags: SymbolFlags;
        /** True if export was only found via the package.json AutoImportProvider (for telemetry). */
        isFromPackageJson: boolean;
    }

    interface CachedSymbolExportInfo {
        // Used to rehydrate `symbol` and `moduleSymbol` when transient
        id: number;
        symbolName: string;
        capitalizedSymbolName: string | undefined;
        symbolTableKey: __String;
        moduleName: string;
        moduleFile: SourceFile | undefined;
        packageName: string | undefined;

        // SymbolExportInfo, but optional symbols
        readonly symbol: Symbol | undefined;
        readonly moduleSymbol: Symbol | undefined;
        moduleFileName: string | undefined;
        exportKind: ExportKind;
        targetFlags: SymbolFlags;
        isFromPackageJson: boolean;
    }

    export interface ExportInfoMap {
        isUsableByFile(importingFile: Path): boolean;
        clear(): void;
        add(importingFile: Path, symbol: Symbol, key: __String, moduleSymbol: Symbol, moduleFile: SourceFile | undefined, exportKind: ExportKind, isFromPackageJson: boolean, checker: TypeChecker): void;
        get(importingFile: Path, key: string): readonly SymbolExportInfo[] | undefined;
        search(importingFile: Path, preferCapitalized: boolean, matches: (name: string, targetFlags: SymbolFlags) => boolean, action: (info: readonly SymbolExportInfo[], symbolName: string, isFromAmbientModule: boolean, key: string) => void): void;
        releaseSymbols(): void;
        isEmpty(): boolean;
        /** @returns Whether the change resulted in the cache being cleared */
        onFileChanged(oldSourceFile: SourceFile, newSourceFile: SourceFile, typeAcquisitionEnabled: boolean): boolean;
    }

    export interface CacheableExportInfoMapHost {
        getCurrentProgram(): Program | undefined;
        getPackageJsonAutoImportProvider(): Program | undefined;
        getGlobalTypingsCacheLocation(): string | undefined;
    }

    export function createCacheableExportInfoMap(host: CacheableExportInfoMapHost): ExportInfoMap {
        let exportInfoId = 1;
        const exportInfo = createMultiMap<string, CachedSymbolExportInfo>();
        const symbols = new Map<number, [symbol: Symbol, moduleSymbol: Symbol]>();
        /**
         * Key: node_modules package name (no @types).
         * Value: path to deepest node_modules folder seen that is
         * both visible to `usableByFileName` and contains the package.
         *
         * Later, we can see if a given SymbolExportInfo is shadowed by
         * a another installation of the same package in a deeper
         * node_modules folder by seeing if its path starts with the
         * value stored here.
         */
        const packages = new Map<string, string>();
        let usableByFileName: Path | undefined;
        const cache: ExportInfoMap = {
            isUsableByFile: importingFile => importingFile === usableByFileName,
            isEmpty: () => !exportInfo.size,
            clear: () => {
                exportInfo.clear();
                symbols.clear();
                usableByFileName = undefined;
            },
            add: (importingFile, symbol, symbolTableKey, moduleSymbol, moduleFile, exportKind, isFromPackageJson, checker) => {
                if (importingFile !== usableByFileName) {
                    cache.clear();
                    usableByFileName = importingFile;
                }

                let packageName;
                if (moduleFile) {
                    const nodeModulesPathParts = getNodeModulePathParts(moduleFile.fileName);
                    if (nodeModulesPathParts) {
                        const { topLevelNodeModulesIndex, topLevelPackageNameIndex, packageRootIndex } = nodeModulesPathParts;
                        packageName = unmangleScopedPackageName(getPackageNameFromTypesPackageName(moduleFile.fileName.substring(topLevelPackageNameIndex + 1, packageRootIndex)));
                        if (startsWith(importingFile, moduleFile.path.substring(0, topLevelNodeModulesIndex))) {
                            const prevDeepestNodeModulesPath = packages.get(packageName);
                            const nodeModulesPath = moduleFile.fileName.substring(0, topLevelPackageNameIndex + 1);
                            if (prevDeepestNodeModulesPath) {
                                const prevDeepestNodeModulesIndex = prevDeepestNodeModulesPath.indexOf(nodeModulesPathPart);
                                if (topLevelNodeModulesIndex > prevDeepestNodeModulesIndex) {
                                    packages.set(packageName, nodeModulesPath);
                                }
                            }
                            else {
                                packages.set(packageName, nodeModulesPath);
                            }
                        }
                    }
                }

                const isDefault = exportKind === ExportKind.Default;
                const namedSymbol = isDefault && getLocalSymbolForExportDefault(symbol) || symbol;
                // 1. A named export must be imported by its key in `moduleSymbol.exports` or `moduleSymbol.members`.
                // 2. A re-export merged with an export from a module augmentation can result in `symbol`
                //    being an external module symbol; the name it is re-exported by will be `symbolTableKey`
                //    (which comes from the keys of `moduleSymbol.exports`.)
                // 3. Otherwise, we have a default/namespace import that can be imported by any name, and
                //    `symbolTableKey` will be something undesirable like `export=` or `default`, so we try to
                //    get a better name.
                const names = exportKind === ExportKind.Named || isExternalModuleSymbol(namedSymbol)
                    ? unescapeLeadingUnderscores(symbolTableKey)
                    : getNamesForExportedSymbol(namedSymbol, /*scriptTarget*/ undefined);

                const symbolName = typeof names === "string" ? names : names[0];
                const capitalizedSymbolName = typeof names === "string" ? undefined : names[1];

                const moduleName = stripQuotes(moduleSymbol.name);
                const id = exportInfoId++;
                const target = skipAlias(symbol, checker);
                const storedSymbol = symbol.flags & SymbolFlags.Transient ? undefined : symbol;
                const storedModuleSymbol = moduleSymbol.flags & SymbolFlags.Transient ? undefined : moduleSymbol;
                if (!storedSymbol || !storedModuleSymbol) symbols.set(id, [symbol, moduleSymbol]);

                exportInfo.add(key(symbolName, symbol, isExternalModuleNameRelative(moduleName) ? undefined : moduleName, checker), {
                    id,
                    symbolTableKey,
                    symbolName,
                    capitalizedSymbolName,
                    moduleName,
                    moduleFile,
                    moduleFileName: moduleFile?.fileName,
                    packageName,
                    exportKind,
                    targetFlags: target.flags,
                    isFromPackageJson,
                    symbol: storedSymbol,
                    moduleSymbol: storedModuleSymbol,
                });
            },
            get: (importingFile, key) => {
                if (importingFile !== usableByFileName) return;
                const result = exportInfo.get(key);
                return result?.map(rehydrateCachedInfo);
            },
            search: (importingFile, preferCapitalized, matches, action) => {
                if (importingFile !== usableByFileName) return;
                exportInfo.forEach((info, key) => {
                    const { symbolName, ambientModuleName } = parseKey(key);
                    const name = preferCapitalized && info[0].capitalizedSymbolName || symbolName;
                    if (matches(name, info[0].targetFlags)) {
                        const rehydrated = info.map(rehydrateCachedInfo);
                        const filtered = rehydrated.filter((r, i) => isNotShadowedByDeeperNodeModulesPackage(r, info[i].packageName));
                        if (filtered.length) {
                            action(filtered, name, !!ambientModuleName, key);
                        }
                    }
                });
            },
            releaseSymbols: () => {
                symbols.clear();
            },
            onFileChanged: (oldSourceFile: SourceFile, newSourceFile: SourceFile, typeAcquisitionEnabled: boolean) => {
                if (fileIsGlobalOnly(oldSourceFile) && fileIsGlobalOnly(newSourceFile)) {
                    // File is purely global; doesn't affect export map
                    return false;
                }
                if (
                    usableByFileName && usableByFileName !== newSourceFile.path ||
                    // If ATA is enabled, auto-imports uses existing imports to guess whether you want auto-imports from node.
                    // Adding or removing imports from node could change the outcome of that guess, so could change the suggestions list.
                    typeAcquisitionEnabled && consumesNodeCoreModules(oldSourceFile) !== consumesNodeCoreModules(newSourceFile) ||
                    // Module agumentation and ambient module changes can add or remove exports available to be auto-imported.
                    // Changes elsewhere in the file can change the *type* of an export in a module augmentation,
                    // but type info is gathered in getCompletionEntryDetails, which doesn't use the cache.
                    !arrayIsEqualTo(oldSourceFile.moduleAugmentations, newSourceFile.moduleAugmentations) ||
                    !ambientModuleDeclarationsAreEqual(oldSourceFile, newSourceFile)
                ) {
                    cache.clear();
                    return true;
                }
                usableByFileName = newSourceFile.path;
                return false;
            },
        };
        if (Debug.isDebugging) {
            Object.defineProperty(cache, "__cache", { get: () => exportInfo });
        }
        return cache;

        function rehydrateCachedInfo(info: CachedSymbolExportInfo): SymbolExportInfo {
            if (info.symbol && info.moduleSymbol) return info as SymbolExportInfo;
            const { id, exportKind, targetFlags, isFromPackageJson, moduleFileName } = info;
            const [cachedSymbol, cachedModuleSymbol] = symbols.get(id) || emptyArray;
            if (cachedSymbol && cachedModuleSymbol) {
                return {
                    symbol: cachedSymbol,
                    moduleSymbol: cachedModuleSymbol,
                    moduleFileName,
                    exportKind,
                    targetFlags,
                    isFromPackageJson,
                };
            }
            const checker = (isFromPackageJson
                ? host.getPackageJsonAutoImportProvider()!
                : host.getCurrentProgram()!).getTypeChecker();
            const moduleSymbol = info.moduleSymbol || cachedModuleSymbol || Debug.checkDefined(info.moduleFile
                ? checker.getMergedSymbol(info.moduleFile.symbol)
                : checker.tryFindAmbientModule(info.moduleName));
            const symbol = info.symbol || cachedSymbol || Debug.checkDefined(exportKind === ExportKind.ExportEquals
                ? checker.resolveExternalModuleSymbol(moduleSymbol)
                : checker.tryGetMemberInModuleExportsAndProperties(unescapeLeadingUnderscores(info.symbolTableKey), moduleSymbol),
                `Could not find symbol '${info.symbolName}' by key '${info.symbolTableKey}' in module ${moduleSymbol.name}`);
            symbols.set(id, [symbol, moduleSymbol]);
            return {
                symbol,
                moduleSymbol,
                moduleFileName,
                exportKind,
                targetFlags,
                isFromPackageJson,
            };
        }

        function key(importedName: string, symbol: Symbol, ambientModuleName: string | undefined, checker: TypeChecker): string {
            const moduleKey = ambientModuleName || "";
            return `${importedName}|${getSymbolId(skipAlias(symbol, checker))}|${moduleKey}`;
        }

        function parseKey(key: string) {
            const symbolName = key.substring(0, key.indexOf("|"));
            const moduleKey = key.substring(key.lastIndexOf("|") + 1);
            const ambientModuleName = moduleKey === "" ? undefined : moduleKey;
            return { symbolName, ambientModuleName };
        }

        function fileIsGlobalOnly(file: SourceFile) {
            return !file.commonJsModuleIndicator && !file.externalModuleIndicator && !file.moduleAugmentations && !file.ambientModuleNames;
        }

        function ambientModuleDeclarationsAreEqual(oldSourceFile: SourceFile, newSourceFile: SourceFile) {
            if (!arrayIsEqualTo(oldSourceFile.ambientModuleNames, newSourceFile.ambientModuleNames)) {
                return false;
            }
            let oldFileStatementIndex = -1;
            let newFileStatementIndex = -1;
            for (const ambientModuleName of newSourceFile.ambientModuleNames) {
                const isMatchingModuleDeclaration = (node: Statement) => isNonGlobalAmbientModule(node) && node.name.text === ambientModuleName;
                oldFileStatementIndex = findIndex(oldSourceFile.statements, isMatchingModuleDeclaration, oldFileStatementIndex + 1);
                newFileStatementIndex = findIndex(newSourceFile.statements, isMatchingModuleDeclaration, newFileStatementIndex + 1);
                if (oldSourceFile.statements[oldFileStatementIndex] !== newSourceFile.statements[newFileStatementIndex]) {
                    return false;
                }
            }
            return true;
        }

        function isNotShadowedByDeeperNodeModulesPackage(info: SymbolExportInfo, packageName: string | undefined) {
            if (!packageName || !info.moduleFileName) return true;
            const typingsCacheLocation = host.getGlobalTypingsCacheLocation();
            if (typingsCacheLocation && startsWith(info.moduleFileName, typingsCacheLocation)) return true;
            const packageDeepestNodeModulesPath = packages.get(packageName);
            return !packageDeepestNodeModulesPath || startsWith(info.moduleFileName, packageDeepestNodeModulesPath);
        }
    }

    export function isImportableFile(
        program: Program,
        from: SourceFile,
        to: SourceFile,
        preferences: UserPreferences,
        packageJsonFilter: PackageJsonImportFilter | undefined,
        moduleSpecifierResolutionHost: ModuleSpecifierResolutionHost,
        moduleSpecifierCache: ModuleSpecifierCache | undefined,
    ): boolean {
        if (from === to) return false;
        const cachedResult = moduleSpecifierCache?.get(from.path, to.path, preferences, {});
        if (cachedResult?.isBlockedByPackageJsonDependencies !== undefined) {
            return !cachedResult.isBlockedByPackageJsonDependencies;
        }

        const getCanonicalFileName = hostGetCanonicalFileName(moduleSpecifierResolutionHost);
        const globalTypingsCache = moduleSpecifierResolutionHost.getGlobalTypingsCacheLocation?.();
        const hasImportablePath = !!moduleSpecifiers.forEachFileNameOfModule(
            from.fileName,
            to.fileName,
            moduleSpecifierResolutionHost,
            /*preferSymlinks*/ false,
            toPath => {
                const toFile = program.getSourceFile(toPath);
                // Determine to import using toPath only if toPath is what we were looking at
                // or there doesnt exist the file in the program by the symlink
                return (toFile === to || !toFile) &&
                    isImportablePath(from.fileName, toPath, getCanonicalFileName, globalTypingsCache);
            }
        );

        if (packageJsonFilter) {
            const isAutoImportable = hasImportablePath && packageJsonFilter.allowsImportingSourceFile(to, moduleSpecifierResolutionHost);
            moduleSpecifierCache?.setBlockedByPackageJsonDependencies(from.path, to.path, preferences, {}, !isAutoImportable);
            return isAutoImportable;
        }

        return hasImportablePath;
    }

    /**
     * Don't include something from a `node_modules` that isn't actually reachable by a global import.
     * A relative import to node_modules is usually a bad idea.
     */
    function isImportablePath(fromPath: string, toPath: string, getCanonicalFileName: GetCanonicalFileName, globalCachePath?: string): boolean {
        // If it's in a `node_modules` but is not reachable from here via a global import, don't bother.
        const toNodeModules = forEachAncestorDirectory(toPath, ancestor => getBaseFileName(ancestor) === "node_modules" ? ancestor : undefined);
        const toNodeModulesParent = toNodeModules && getDirectoryPath(getCanonicalFileName(toNodeModules));
        return toNodeModulesParent === undefined
            || startsWith(getCanonicalFileName(fromPath), toNodeModulesParent)
            || (!!globalCachePath && startsWith(getCanonicalFileName(globalCachePath), toNodeModulesParent));
    }

    export function forEachExternalModuleToImportFrom(
        program: Program,
        host: LanguageServiceHost,
        preferences: UserPreferences,
        useAutoImportProvider: boolean,
        cb: (module: Symbol, moduleFile: SourceFile | undefined, program: Program, isFromPackageJson: boolean) => void,
    ) {
        const useCaseSensitiveFileNames = hostUsesCaseSensitiveFileNames(host);
        const excludePatterns = preferences.autoImportFileExcludePatterns && mapDefined(preferences.autoImportFileExcludePatterns, spec => {
            // The client is expected to send rooted path specs since we don't know
            // what directory a relative path is relative to.
            const pattern = getPatternFromSpec(spec, "", "exclude");
            return pattern ? getRegexFromPattern(pattern, useCaseSensitiveFileNames) : undefined;
        });

        forEachExternalModule(program.getTypeChecker(), program.getSourceFiles(), excludePatterns, (module, file) => cb(module, file, program, /*isFromPackageJson*/ false));
        const autoImportProvider = useAutoImportProvider && host.getPackageJsonAutoImportProvider?.();
        if (autoImportProvider) {
            const start = timestamp();
            forEachExternalModule(autoImportProvider.getTypeChecker(), autoImportProvider.getSourceFiles(), excludePatterns, (module, file) => cb(module, file, autoImportProvider, /*isFromPackageJson*/ true));
            host.log?.(`forEachExternalModuleToImportFrom autoImportProvider: ${timestamp() - start}`);
        }
    }

    function forEachExternalModule(checker: TypeChecker, allSourceFiles: readonly SourceFile[], excludePatterns: readonly RegExp[] | undefined, cb: (module: Symbol, sourceFile: SourceFile | undefined) => void) {
        const isExcluded = (fileName: string) => excludePatterns?.some(p => p.test(fileName));
        for (const ambient of checker.getAmbientModules()) {
            if (!stringContains(ambient.name, "*") && !(excludePatterns && ambient.declarations?.every(d => isExcluded(d.getSourceFile().fileName)))) {
                cb(ambient, /*sourceFile*/ undefined);
            }
        }
        for (const sourceFile of allSourceFiles) {
            if (isExternalOrCommonJsModule(sourceFile) && !isExcluded(sourceFile.fileName)) {
                cb(checker.getMergedSymbol(sourceFile.symbol), sourceFile);
            }
        }
    }

    export function getExportInfoMap(importingFile: SourceFile, host: LanguageServiceHost, program: Program, preferences: UserPreferences, cancellationToken: CancellationToken | undefined): ExportInfoMap {
        const start = timestamp();
        // Pulling the AutoImportProvider project will trigger its updateGraph if pending,
        // which will invalidate the export map cache if things change, so pull it before
        // checking the cache.
        host.getPackageJsonAutoImportProvider?.();
        const cache = host.getCachedExportInfoMap?.() || createCacheableExportInfoMap({
            getCurrentProgram: () => program,
            getPackageJsonAutoImportProvider: () => host.getPackageJsonAutoImportProvider?.(),
            getGlobalTypingsCacheLocation: () => host.getGlobalTypingsCacheLocation?.(),
        });

        if (cache.isUsableByFile(importingFile.path)) {
            host.log?.("getExportInfoMap: cache hit");
            return cache;
        }

        host.log?.("getExportInfoMap: cache miss or empty; calculating new results");
        const compilerOptions = program.getCompilerOptions();
        let moduleCount = 0;
        try {
            forEachExternalModuleToImportFrom(program, host, preferences, /*useAutoImportProvider*/ true, (moduleSymbol, moduleFile, program, isFromPackageJson) => {
                if (++moduleCount % 100 === 0) cancellationToken?.throwIfCancellationRequested();
                const seenExports = new Map<__String, true>();
                const checker = program.getTypeChecker();
                const defaultInfo = getDefaultLikeExportInfo(moduleSymbol, checker, compilerOptions);
                // Note: I think we shouldn't actually see resolved module symbols here, but weird merges
                // can cause it to happen: see 'completionsImport_mergedReExport.ts'
                if (defaultInfo && isImportableSymbol(defaultInfo.symbol, checker)) {
                    cache.add(
                        importingFile.path,
                        defaultInfo.symbol,
                        defaultInfo.exportKind === ExportKind.Default ? InternalSymbolName.Default : InternalSymbolName.ExportEquals,
                        moduleSymbol,
                        moduleFile,
                        defaultInfo.exportKind,
                        isFromPackageJson,
                        checker);
                }
                checker.forEachExportAndPropertyOfModule(moduleSymbol, (exported, key) => {
                    if (exported !== defaultInfo?.symbol && isImportableSymbol(exported, checker) && addToSeen(seenExports, key)) {
                        cache.add(
                            importingFile.path,
                            exported,
                            key,
                            moduleSymbol,
                            moduleFile,
                            ExportKind.Named,
                            isFromPackageJson,
                            checker);
                    }
                });
            });
        }
        catch (err) {
            // Ensure cache is reset if operation is cancelled
            cache.clear();
            throw err;
        }

        host.log?.(`getExportInfoMap: done in ${timestamp() - start} ms`);
        return cache;
    }

    export function getDefaultLikeExportInfo(moduleSymbol: Symbol, checker: TypeChecker, compilerOptions: CompilerOptions) {
        const exported = getDefaultLikeExportWorker(moduleSymbol, checker);
        if (!exported) return undefined;
        const { symbol, exportKind } = exported;
        const info = getDefaultExportInfoWorker(symbol, checker, compilerOptions);
        return info && { symbol, exportKind, ...info };
    }

    function isImportableSymbol(symbol: Symbol, checker: TypeChecker) {
        return !checker.isUndefinedSymbol(symbol) && !checker.isUnknownSymbol(symbol) && !isKnownSymbol(symbol) && !isPrivateIdentifierSymbol(symbol);
    }

    function getDefaultLikeExportWorker(moduleSymbol: Symbol, checker: TypeChecker): { readonly symbol: Symbol, readonly exportKind: ExportKind } | undefined {
        const exportEquals = checker.resolveExternalModuleSymbol(moduleSymbol);
        if (exportEquals !== moduleSymbol) return { symbol: exportEquals, exportKind: ExportKind.ExportEquals };
        const defaultExport = checker.tryGetMemberInModuleExports(InternalSymbolName.Default, moduleSymbol);
        if (defaultExport) return { symbol: defaultExport, exportKind: ExportKind.Default };
    }

    function getDefaultExportInfoWorker(defaultExport: Symbol, checker: TypeChecker, compilerOptions: CompilerOptions): { readonly symbolForMeaning: Symbol, readonly name: string } | undefined {
        const localSymbol = getLocalSymbolForExportDefault(defaultExport);
        if (localSymbol) return { symbolForMeaning: localSymbol, name: localSymbol.name };

        const name = getNameForExportDefault(defaultExport);
        if (name !== undefined) return { symbolForMeaning: defaultExport, name };

        if (defaultExport.flags & SymbolFlags.Alias) {
            const aliased = checker.getImmediateAliasedSymbol(defaultExport);
            if (aliased && aliased.parent) {
                // - `aliased` will be undefined if the module is exporting an unresolvable name,
                //    but we can still offer completions for it.
                // - `aliased.parent` will be undefined if the module is exporting `globalThis.something`,
                //    or another expression that resolves to a global.
                return getDefaultExportInfoWorker(aliased, checker, compilerOptions);
            }
        }

        if (defaultExport.escapedName !== InternalSymbolName.Default &&
            defaultExport.escapedName !== InternalSymbolName.ExportEquals) {
            return { symbolForMeaning: defaultExport, name: defaultExport.getName() };
        }
        return { symbolForMeaning: defaultExport, name: getNameForExportedSymbol(defaultExport, compilerOptions.target) };
    }

    function getNameForExportDefault(symbol: Symbol): string | undefined {
        return symbol.declarations && firstDefined(symbol.declarations, declaration => {
            if (isExportAssignment(declaration)) {
                return tryCast(skipOuterExpressions(declaration.expression), isIdentifier)?.text;
            }
            else if (isExportSpecifier(declaration)) {
                Debug.assert(declaration.name.text === InternalSymbolName.Default, "Expected the specifier to be a default export");
                return declaration.propertyName && declaration.propertyName.text;
            }
        });
    }
}


text:
package alluxio.worker.file;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.fail;
import static org.mockito.Mockito.any;
import static org.mockito.Mockito.anyLong;
import static org.mockito.Mockito.anyString;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

import alluxio.AlluxioURI;
import alluxio.Configuration;
import alluxio.ConfigurationTestUtils;
import alluxio.PropertyKey;
import alluxio.Sessions;
import alluxio.client.file.FileSystem;
import alluxio.client.file.URIStatus;
import alluxio.exception.BlockDoesNotExistException;
import alluxio.exception.InvalidWorkerStateException;
import alluxio.underfs.UfsManager;
import alluxio.underfs.UfsManager.UfsClient;
import alluxio.underfs.UnderFileSystem;
import alluxio.underfs.options.CreateOptions;
import alluxio.util.io.PathUtils;
import alluxio.wire.FileInfo;
import alluxio.worker.block.BlockWorker;
import alluxio.worker.block.io.BlockReader;
import alluxio.worker.block.meta.BlockMeta;

import com.google.common.base.Suppliers;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists;
import com.google.common.util.concurrent.MockRateLimiter;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.powermock.api.mockito.PowerMockito;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;

/**
 * Tests {@link FileDataManager}.
 */
public final class FileDataManagerTest {
  private UnderFileSystem mUfs;
  private UfsManager mUfsManager;
  private BlockWorker mBlockWorker;
  private MockRateLimiter mMockRateLimiter;
  private FileDataManager mManager;
  private FileSystem mMockFileSystem;
  private AtomicInteger mCopyCounter;

  @Before
  public void before() throws Exception {
    mUfs = mock(UnderFileSystem.class);
    mUfsManager = mock(UfsManager.class);
    mBlockWorker = mock(BlockWorker.class);
    mMockRateLimiter =
        new MockRateLimiter(Configuration.getBytes(PropertyKey.WORKER_FILE_PERSIST_RATE_LIMIT));
    mCopyCounter = new AtomicInteger(0);
    mManager = new FileDataManager(mBlockWorker, mMockRateLimiter.getGuavaRateLimiter(),
        mUfsManager, () -> mMockFileSystem, (r, w) -> mCopyCounter.incrementAndGet());
    mMockFileSystem = PowerMockito.mock(FileSystem.class);
    UfsClient ufsClient = new UfsClient(Suppliers.ofInstance(mUfs), AlluxioURI.EMPTY_URI);
    when(mUfs.isDirectory(anyString())).thenReturn(true);
    when(mUfsManager.get(anyLong())).thenReturn(ufsClient);
  }

  @After
  public void after() throws IOException {
    ConfigurationTestUtils.resetConfiguration();
  }

  /**
   * Tests that a file gets persisted.
   */
  @Test
  public void persistFile() throws Exception {
    long fileId = 1;
    List<Long> blockIds = Lists.newArrayList(1L, 2L);

    writeFileWithBlocks(fileId, blockIds);

    // verify file persisted
    FileDataManager.PersistedFilesInfo info = mManager.getPersistedFileInfos();
    assertEquals(Arrays.asList(fileId), info.idList());

    // verify fastCopy called twice, once per block
    assertEquals(2, mCopyCounter.get());

    // verify the file is not needed for another persistence
    assertFalse(mManager.needPersistence(fileId));
  }

  /**
   * Tests that persisted file are cleared in the manager.
   */
  @Test
  public void clearPersistedFiles() throws Exception {
    writeFileWithBlocks(1L, ImmutableList.of(2L, 3L));
    mManager.clearPersistedFiles(ImmutableList.of(1L));
    FileDataManager.PersistedFilesInfo info = mManager.getPersistedFileInfos();
    assertEquals(Collections.emptyList(), info.idList());
  }

  /**
   * Tests the rate limiting functionality for asynchronous persistence.
   */
  @Test
  public void persistFileRateLimiting() throws Exception {
    Configuration.set(PropertyKey.WORKER_FILE_PERSIST_RATE_LIMIT_ENABLED, "true");
    Configuration.set(PropertyKey.WORKER_FILE_PERSIST_RATE_LIMIT, "100");
    mMockRateLimiter =
        new MockRateLimiter(Configuration.getBytes(PropertyKey.WORKER_FILE_PERSIST_RATE_LIMIT));
    mManager = new FileDataManager(mBlockWorker, mMockRateLimiter.getGuavaRateLimiter(),
        mUfsManager, () -> mMockFileSystem, (r, w) -> mCopyCounter.incrementAndGet());

    long fileId = 1;
    List<Long> blockIds = Lists.newArrayList(1L, 2L, 3L);

    FileInfo fileInfo = new FileInfo();
    fileInfo.setPath("test");
    when(mBlockWorker.getFileInfo(fileId)).thenReturn(fileInfo);
    BlockReader reader = mock(BlockReader.class);
    for (long blockId : blockIds) {
      when(mBlockWorker.lockBlock(Sessions.CHECKPOINT_SESSION_ID, blockId))
          .thenReturn(blockId);
      when(mBlockWorker.readBlockRemote(Sessions.CHECKPOINT_SESSION_ID, blockId, blockId))
          .thenReturn(reader);
      BlockMeta mockedBlockMeta = PowerMockito.mock(BlockMeta.class);
      when(mockedBlockMeta.getBlockSize()).thenReturn(100L);
      when(mBlockWorker.getBlockMeta(Sessions.CHECKPOINT_SESSION_ID, blockId, blockId))
          .thenReturn(mockedBlockMeta);
    }

    String ufsRoot = Configuration.get(PropertyKey.MASTER_MOUNT_TABLE_ROOT_UFS);
    when(mUfs.isDirectory(ufsRoot)).thenReturn(true);

    OutputStream outputStream = new ByteArrayOutputStream();

    String dstPath = PathUtils.concatPath(ufsRoot, fileInfo.getPath());
    fileInfo.setUfsPath(dstPath);
    when(mUfs.create(dstPath)).thenReturn(outputStream);
    when(mUfs.create(anyString(), any(CreateOptions.class)))
        .thenReturn(outputStream);
    when(mMockFileSystem.getStatus(any(AlluxioURI.class))).thenReturn(
        new URIStatus(fileInfo));

    mManager.lockBlocks(fileId, blockIds);
    mManager.persistFile(fileId, blockIds);

    List<String> expectedEvents = Lists.newArrayList("R0.00", "R1.00", "R1.00");
    assertEquals(expectedEvents, mMockRateLimiter.readEventsAndClear());

    // Simulate waiting for 1 second.
    mMockRateLimiter.sleepMillis(1000);

    mManager.lockBlocks(fileId, blockIds);
    mManager.persistFile(fileId, blockIds);

    // The first write will go through immediately without throttling.
    expectedEvents = Lists.newArrayList("U1.00", "R0.00", "R1.00", "R1.00");
    assertEquals(expectedEvents, mMockRateLimiter.readEventsAndClear());

    // Repeat persistence without sleeping.
    mManager.lockBlocks(fileId, blockIds);
    mManager.persistFile(fileId, blockIds);

    expectedEvents = Lists.newArrayList("R1.00", "R1.00", "R1.00");
    assertEquals(expectedEvents, mMockRateLimiter.readEventsAndClear());
  }

  /**
   * Tests the blocks are unlocked correctly when exception is encountered in
   * {@link FileDataManager#lockBlocks(long, List)}.
   */
  @Test
  public void lockBlocksErrorHandling() throws Exception {
    long fileId = 1;
    List<Long> blockIds = Lists.newArrayList(1L, 2L, 3L);

    when(mBlockWorker.lockBlock(Sessions.CHECKPOINT_SESSION_ID, 1L)).thenReturn(1L);
    when(mBlockWorker.lockBlock(Sessions.CHECKPOINT_SESSION_ID, 2L)).thenReturn(2L);
    when(mBlockWorker.lockBlock(Sessions.CHECKPOINT_SESSION_ID, 3L))
        .thenThrow(new BlockDoesNotExistException("block 3 does not exist"));
    try {
      mManager.lockBlocks(fileId, blockIds);
      fail("the lock should fail");
    } catch (IOException e) {
      assertEquals(
          "failed to lock all blocks of file 1\n"
              + "alluxio.exception.BlockDoesNotExistException: block 3 does not exist\n",
          e.getMessage());
      // verify the locks are all unlocked
      verify(mBlockWorker).unlockBlock(1L);
      verify(mBlockWorker).unlockBlock(2L);
    }
  }

  /**
   * Tests that the correct error message is provided when persisting a file fails.
   */
  @Test
  public void errorHandling() throws Exception {
    long fileId = 1;
    List<Long> blockIds = Lists.newArrayList(1L, 2L);

    FileInfo fileInfo = new FileInfo();
    fileInfo.setPath("test");
    when(mBlockWorker.getFileInfo(fileId)).thenReturn(fileInfo);
    for (long blockId : blockIds) {
      when(mBlockWorker.lockBlock(Sessions.CHECKPOINT_SESSION_ID, blockId))
          .thenReturn(blockId);
      doThrow(new InvalidWorkerStateException("invalid worker")).when(mBlockWorker)
          .readBlockRemote(Sessions.CHECKPOINT_SESSION_ID, blockId, blockId);
    }

    String ufsRoot = Configuration.get(PropertyKey.MASTER_MOUNT_TABLE_ROOT_UFS);
    when(mUfs.isDirectory(ufsRoot)).thenReturn(true);
    OutputStream outputStream = mock(OutputStream.class);

    String dstPath = PathUtils.concatPath(ufsRoot, fileInfo.getPath());
    fileInfo.setUfsPath(dstPath);
    when(mUfs.create(dstPath)).thenReturn(outputStream);
    when(mUfs.create(anyString(), any(CreateOptions.class)))
        .thenReturn(outputStream);
    when(mMockFileSystem.getStatus(any(AlluxioURI.class))).thenReturn(
        new URIStatus(fileInfo));

    mManager.lockBlocks(fileId, blockIds);
    try {
      mManager.persistFile(fileId, blockIds);
      fail("the persist should fail");
    } catch (IOException e) {
      assertEquals("the blocks of file1 are failed to persist\n"
          + "alluxio.exception.InvalidWorkerStateException: invalid worker\n", e.getMessage());
      // verify the locks are all unlocked
      verify(mBlockWorker).unlockBlock(1L);
      verify(mBlockWorker).unlockBlock(2L);
    }
  }

  private void writeFileWithBlocks(long fileId, List<Long> blockIds) throws Exception {
    FileInfo fileInfo = new FileInfo();
    fileInfo.setPath("test");
    when(mBlockWorker.getFileInfo(fileId)).thenReturn(fileInfo);
    BlockReader reader = mock(BlockReader.class);
    for (long blockId : blockIds) {
      when(mBlockWorker.lockBlock(Sessions.CHECKPOINT_SESSION_ID, blockId))
          .thenReturn(blockId);
      when(mBlockWorker.readBlockRemote(Sessions.CHECKPOINT_SESSION_ID, blockId, blockId))
          .thenReturn(reader);
    }

    String ufsRoot = Configuration.get(PropertyKey.MASTER_MOUNT_TABLE_ROOT_UFS);
    when(mUfs.isDirectory(ufsRoot)).thenReturn(true);
    OutputStream outputStream = mock(OutputStream.class);

    String dstPath = PathUtils.concatPath(ufsRoot, fileInfo.getPath());
    fileInfo.setUfsPath(dstPath);
    when(mUfs.create(dstPath)).thenReturn(outputStream);
    when(mUfs.create(anyString(), any(CreateOptions.class)))
        .thenReturn(outputStream);
    when(mMockFileSystem.getStatus(any(AlluxioURI.class))).thenReturn(
        new URIStatus(fileInfo));

    mManager.lockBlocks(fileId, blockIds);
    mManager.persistFile(fileId, blockIds);
  }
}


text:
function varargout = lbpfliplr(varargin)
% VL_LBPFLIPLR  Flip LBP features left-right
%   F = VL_LBPFLIPLR(F) flips the LBP features F from left to
%   right.
%
%   Example::
%     The following instructions return results almost identical
%     assuming that the width of I is exactly divisible by the cell
%     size:
%       F = VL_LBP(FLIPLR(I), 8)
%       F_ = VL_LBPFLIPLR(VL_LBP(I), 8)
%
%   See also: VL_LBP(), VL_HELP().
[varargout{1:nargout}] = vl_lbpfliplr(varargin{:});


text:
/**
Filter data based on Open Schemas: http://schema.org/Recipe
**/

var _ = require("underscore");

var filter = function(body, result, chain) {
    console.log(fetchIngredients(body));
    result.ingredients = _.union(fetchIngredients(body), result.ingredients);

    if(chain.length > 0) {
        chain[0].filter(body, result, chain.slice(1));
    }
};

function fetchIngredients(body) {
    var ingredients = body("*[itemprop=ingredients]").map(function(i, el) {
        return body(this).text().trim();
    });
    return ingredients;
}

module.exports = {filter: filter};


text:
**plantcv.roi.custom**(*img, vertices*)

**returns** roi_contours, roi_hierarchies

- **Parameters:**
    - img            = Input image data.
    - vertices       = List of vertices that define the custom polygon
- **Context:**
    - Used to define a custom polygon-shaped region of interest. Polygons
    can be as simple as a triangle or complex and will work with downstream
    steps such as [pcv.roi_objects](roi_objects.md). The `vertices` input
    is a list of coordinates of the desired vertices where the desired vertices
    are tuples inside square brackets.

**Reference Image**

![Screenshot](img/documentation_images/roi_custom/rgb_img.jpg)

```python

from plantcv import plantcv as pcv

# Set global debug behavior to None (default), "print" (to file),
# or "plot" (Jupyter Notebooks or X11)
pcv.params.debug = "plot"

# Make a custom polygon ROI
roi_contour, roi_hierarchy = pcv.roi.custom(img=img,
                                            vertices=[[1190,490], [1470,830],
                                            [1565,1460], [1130,1620],
                                            [920,1430], [890,950]])

```

**Custom ROI**

![Screenshot](img/documentation_images/roi_custom/custom_roi.jpg)

**Source Code:** [Here](https://github.com/danforthcenter/plantcv/blob/master/plantcv/plantcv/roi/roi_methods.py)


text:
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

          <title>Scaladoc for org.scalatest.mock.EasyMockSugar</title>
          <meta http-equiv="content-type" content="text/html; charset=UTF-8" />

      <link href="../../../lib/template.css" rel="stylesheet" type="text/css" media="screen" />

org.scalatest.mock

EasyMockSugar

      trait

        EasyMockSugar extends AnyRef

Trait that provides some basic syntax sugar for EasyMock.

Using the EasyMock API directly, you create a mock with:

val mockCollaborator = createMock(classOf[Collaborator])

With this trait, you can shorten that to:

val mockCollaborator = mock[Collaborator]

After creating mocks, you set expectations on them, using syntax like this:

mockCollaborator.documentAdded("Document")
mockCollaborator.documentChanged("Document")
expectLastCall().times(3)

If you wish to highlight which statements are setting expectations on the mock (versus
which ones are actually using the mock), you can place them in an expectingclause, provided by this trait, like this:

expecting {
  mockCollaborator.documentAdded("Document")
  mockCollaborator.documentChanged("Document")
  lastCall.times(3)
}

Using an expecting clause is optional, because it does nothing but visually indicate
which statements are setting expectations on mocks. (Note: this trait also provides the lastCallmethod, which just calls expectLastCall.)

Once you've set expectations on the mock objects, you must invoke replay on
the mocks to indicate you are done setting expectations, and will start using the mock.
After using the mock, you must invoke verify to check to make sure the mock
was used in accordance with the expectations you set on it. Here's how that looks when you
use the EasyMock API directly:

replay(mockCollaborator)
classUnderTest.addDocument("Document", new Array[Byte](0))
classUnderTest.addDocument("Document", new Array[Byte](0))
classUnderTest.addDocument("Document", new Array[Byte](0))
classUnderTest.addDocument("Document", new Array[Byte](0))
verify(mockCollaborator)

This trait enables you to use the following, more declarative syntax instead:

whenExecuting(mockCollaborator) {
  classUnderTest.addDocument("Document", new Array[Byte](0))
  classUnderTest.addDocument("Document", new Array[Byte](0))
  classUnderTest.addDocument("Document", new Array[Byte](0))
  classUnderTest.addDocument("Document", new Array[Byte](0))
}

The whenExecuting method will pass the mockCollaborator toreplay, execute the passed function (your code that uses the mock), and
call verify, passing in the mockCollaborator. If you want to
use multiple mocks, you can pass multiple mocks to whenExecuting.

To summarize, here's what a typical test using EasyMockSugar looks like:

val mockCollaborator = mock[Collaborator]

expecting {
  mockCollaborator.documentAdded("Document")
  mockCollaborator.documentChanged("Document")
  lastCall.times(3)
}

whenExecuting(mockCollaborator) {
  classUnderTest.addDocument("Document", new Array[Byte](0))
  classUnderTest.addDocument("Document", new Array[Byte](0))
  classUnderTest.addDocument("Document", new Array[Byte](0))
  classUnderTest.addDocument("Document", new Array[Byte](0))
}

Note: As of ScalaTest 1.2.1, this trait supports EasyMock 3, with no dependencies on EasyMock class extension.

authors:

George Berger

,

Bill Venners

                Inherited

Hide All

Show all

AnyRef

Any

            Visibility

Public

All

Value Members

      def

        !=(arg0: AnyRef): Boolean

          attributes: final

          definition classes: AnyRef

      def

        !=(arg0: Any): Boolean

o != arg0 is the same as !(o == (arg0)).

o != arg0 is the same as !(o == (arg0)).

arg0

the object to compare against this object for dis-equality.

returns

false if the receiver object is equivalent to the argument; true otherwise.

          attributes: final

          definition classes: Any

      def

        ##(): Int

          attributes: final

          definition classes: AnyRef → Any

      def

        $asInstanceOf[T0](): T0

          attributes: final

          definition classes: AnyRef

      def

        $isInstanceOf[T0](): Boolean

          attributes: final

          definition classes: AnyRef

      def

        ==(arg0: AnyRef): Boolean

o == arg0 is the same as if (o eq null) arg0 eq null else o.equals(arg0).

o == arg0 is the same as if (o eq null) arg0 eq null else o.equals(arg0).

arg0

the object to compare against this object for equality.

returns

true if the receiver object is equivalent to the argument; false otherwise.

          attributes: final

          definition classes: AnyRef

      def

        ==(arg0: Any): Boolean

o == arg0 is the same as o.equals(arg0).

o == arg0 is the same as o.equals(arg0).

arg0

the object to compare against this object for equality.

returns

true if the receiver object is equivalent to the argument; false otherwise.

          attributes: final

          definition classes: Any

      def

        asInstanceOf[T0]: T0

This method is used to cast the receiver object to be of type T0.

This method is used to cast the receiver object to be of type T0.

Note that the success of a cast at runtime is modulo Scala's erasure semantics.  Therefore the expression1.asInstanceOf[String] will throw a ClassCastException at runtime, while the expressionList(1).asInstanceOf[List[String]] will not.  In the latter example, because the type argument is erased as
part of compilation it is not possible to check whether the contents of the list are of the requested typed.

returns

the receiver object.

          attributes: final

          definition classes: Any

      implicit def

        call[T](value: T): IExpectationSetters[T]

Implicit conversion that invokes the expect method on the EasyMock companion object (i.

Implicit conversion that invokes the expect method on the EasyMock companion object (i.e., the
static expect method in Java class org.easymock.EasyMock).

In a ScalaTest Suite, the expect method defined in Assertions, and inherited by Suite,
interferes with the expect method if imported from EasyMock. You can invoke it by qualifying it, i.e.,EasyMock.expect, or by changing its name on import, like this:

import org.easymock.EasyMock.{expect => easyMockExpect, _}

But if you mix in this trait, you can just invoke call instead.

You can use this method, for example, to chain expectations like this:

expecting {
  call(mock.getName).andReturn("Ben Franklin")
}

Note: the name of this methods is call, not expectCall because
"expect" appears in the surrounding expecting clause provided by this trait.

Moreover, because this method is marked implicit, you will usually be able to simply
leave it off. So long as the result of the method call you are expecting doesn't have
a method that satisfies the subsequent invocation (such as andReturn in this
example), the Scala compiler will invoke call for you
implicitly. Here's how that looks:

expecting {
  mock.getName.andReturn("Ben Franklin")
}

value

- the result of invoking a method on mock prior to invoking replay.

          attributes: implicit

      def

        clone(): AnyRef

This method creates and returns a copy of the receiver object.

This method creates and returns a copy of the receiver object.

The default implementation of the clone method is platform dependent.

returns

a copy of the receiver object.

          attributes: protected

          definition classes: AnyRef

      def

        eq(arg0: AnyRef): Boolean

This method is used to test whether the argument (arg0) is a reference to the
receiver object (this).

This method is used to test whether the argument (arg0) is a reference to the
receiver object (this).

The eq method implements an [http://en.wikipedia.org/wiki/Equivalence_relation equivalence relation] on
non-null instances of AnyRef:
 * It is reflexive: for any non-null instance x of type AnyRef, x.eq(x) returns true.
 * It is symmetric: for any non-null instances x and y of type AnyRef, x.eq(y) returns true if and
   only if y.eq(x) returns true.
 * It is transitive: for any non-null instances x, y, and z of type AnyRef if x.eq(y) returns true   and y.eq(z) returns true, then x.eq(z) returns true.

Additionally, the eq method has three other properties.
 * It is consistent: for any non-null instances x and y of type AnyRef, multiple invocations of
   x.eq(y) consistently returns true or consistently returns false.
 * For any non-null instance x of type AnyRef, x.eq(null) and null.eq(x) returns false.
 * null.eq(null) returns true.

When overriding the equals or hashCode methods, it is important to ensure that their behavior is
consistent with reference equality.  Therefore, if two objects are references to each other (o1 eq o2), they
should be equal to each other (o1 == o2) and they should hash to the same value (o1.hashCode == o2.hashCode).

arg0

the object to compare against this object for reference equality.

returns

true if the argument is a reference to the receiver object; false otherwise.

          attributes: final

          definition classes: AnyRef

      def

        equals(arg0: Any): Boolean

This method is used to compare the receiver object (this) with the argument object (arg0) for equivalence.

This method is used to compare the receiver object (this) with the argument object (arg0) for equivalence.

The default implementations of this method is an [http://en.wikipedia.org/wiki/Equivalence_relation equivalence
relation]:
 * It is reflexive: for any instance x of type Any, x.equals(x) should return true.
 * It is symmetric: for any instances x and y of type Any, x.equals(y) should return true if and
   only if y.equals(x) returns true.
 * It is transitive: for any instances x, y, and z of type AnyRef if x.equals(y) returns true and
   y.equals(z) returns true, then x.equals(z) should return true.

If you override this method, you should verify that your implementation remains an equivalence relation.
Additionally, when overriding this method it is often necessary to override hashCode to ensure that objects
that are "equal" (o1.equals(o2) returns true) hash to the same
scala.Int
(o1.hashCode.equals(o2.hashCode)).

arg0

the object to compare against this object for equality.

returns

true if the receiver object is equivalent to the argument; false otherwise.

          definition classes: AnyRef → Any

      def

        expecting(unused: Any): Unit

Provides a visual clue to readers of the code that a set of statements are expectations being
set on mocks.

Provides a visual clue to readers of the code that a set of statements are expectations being
set on mocks.

Using the EasyMock API directly, you set expectations on a mock object with syntax like:

mockCollaborator.documentAdded("Document")
mockCollaborator.documentChanged("Document")
expectLastCall().times(3)

This expecting method can make it more obvious which portion of your test code
is devoted to setting expectations on mock objects. For example:

expecting {
  mockCollaborator.documentAdded("Document")
  mockCollaborator.documentChanged("Document")
  lastCall.times(3)
}

Using an expecting clause is optional, because it does nothing besides visually indicate
which statements are setting expectations on mocks. Note: this trait also provides the lastCallmethod, which just calls expectLastCall. This allows you to avoid writing "expect" twice.
Also, the reason expecting doesn't take a by-name parameter, execute that, then callreplay is because you would then need to pass your mock object or objects intoexpecting. Since you already need to pass the mocks into whenExecuting so
that verify can be invoked on them, it yields more concise client code to havewhenExecuting invoke replay on the mocks first rather than havingexpecting invoke replay last.

      def

        finalize(): Unit

This method is called by the garbage collector on the receiver object when garbage collection determines that
there are no more references to the object.

This method is called by the garbage collector on the receiver object when garbage collection determines that
there are no more references to the object.

The details of when and if the finalize method are invoked, as well as the interaction between finalizeand non-local returns and exceptions, are all platform dependent.

          attributes: protected

          definition classes: AnyRef

      def

        getClass(): java.lang.Class[_]

Returns a representation that corresponds to the dynamic class of the receiver object.

Returns a representation that corresponds to the dynamic class of the receiver object.

The nature of the representation is platform dependent.

returns

a representation that corresponds to the dynamic class of the receiver object.

          attributes: final

          definition classes: AnyRef

      def

        hashCode(): Int

Returns a hash code value for the object.

Returns a hash code value for the object.

The default hashing algorithm is platform dependent.

Note that it is allowed for two objects to have identical hash codes (o1.hashCode.equals(o2.hashCode)) yet
not be equal (o1.equals(o2) returns false).  A degenerate implementation could always return 0.
However, it is required that if two objects are equal (o1.equals(o2) returns true) that they have
identical hash codes (o1.hashCode.equals(o2.hashCode)).  Therefore, when overriding this method, be sure
to verify that the behavior is consistent with the equals method.

returns

the hash code value for the object.

          definition classes: AnyRef → Any

      def

        isInstanceOf[T0]: Boolean

This method is used to test whether the dynamic type of the receiver object is T0.

This method is used to test whether the dynamic type of the receiver object is T0.

Note that the test result of the test is modulo Scala's erasure semantics.  Therefore the expression1.isInstanceOf[String] will return false, while the expression List(1).isInstanceOf[List[String]] will
return true.  In the latter example, because the type argument is erased as part of compilation it is not
possible to check whether the contents of the list are of the requested typed.

returns

true if the receiver object is an instance of erasure of type T0; false otherwise.

          attributes: final

          definition classes: Any

      def

        lastCall[T]: IExpectationSetters[T]

Invokes the expectLastCall method on the EasyMock companion object (i.

Invokes the expectLastCall method on the EasyMock companion object (i.e., the
static expect method in Java class org.easymock.EasyMock).

This method is provided simply to allow you to avoid repeating "expect" inside anexpecting clause. Here's an example that uses the expectLastCall directly
to express the expectation that the getName method will be invoked three times
on a mock, each time returning "Ben Franklin":

expecting {
  mock.getName.andReturn("Ben Franklin")
  expectLastCall.times(3)
}

Using this method, you can compress this to:

expecting {
  mock.getName.andReturn("Ben Franklin")
  lastCall.times(3)
}

      def

        mock[T <: AnyRef](implicit manifest: Manifest[T]): T

Invokes the createMock method on the EasyMock companion object (i.

Invokes the createMock method on the EasyMock companion object (i.e., the
static createMock method in Java class org.easymock.classextension.EasyMock).

Using the EasyMock API directly, you create a mock with:

val mockCollaborator = createMock(classOf[Collaborator])

Using this method, you can shorten that to:

val mockCollaborator = mock[Collaborator]

      def

        ne(arg0: AnyRef): Boolean

o.ne(arg0) is the same as !(o.eq(arg0)).

o.ne(arg0) is the same as !(o.eq(arg0)).

arg0

the object to compare against this object for reference dis-equality.

returns

false if the argument is not a reference to the receiver object; true otherwise.

          attributes: final

          definition classes: AnyRef

      def

        niceMock[T <: AnyRef](implicit manifest: Manifest[T]): T

Invokes the createNiceMock method on the EasyMock companion object (i.

Invokes the createNiceMock method on the EasyMock companion object (i.e., the
static createNiceMock method in Java class org.easymock.classextension.EasyMock).

Using the EasyMock API directly, you create a nice mock with:

val mockCollaborator = createNiceMock(classOf[Collaborator])

Using this trait, you can shorten that to:

val mockCollaborator = niceMock[Collaborator]

      def

        notify(): Unit

Wakes up a single thread that is waiting on the receiver object's monitor.

Wakes up a single thread that is waiting on the receiver object's monitor.

          attributes: final

          definition classes: AnyRef

      def

        notifyAll(): Unit

Wakes up all threads that are waiting on the receiver object's monitor.

Wakes up all threads that are waiting on the receiver object's monitor.

          attributes: final

          definition classes: AnyRef

      def

        strictMock[T <: AnyRef](implicit manifest: Manifest[T]): T

Invokes the createStrictMock method on the EasyMock companion object (i.

Invokes the createStrictMock method on the EasyMock companion object (i.e., the
static createStrictMock method in Java class org.easymock.classextension.EasyMock).

Using the EasyMock API directly, you create a strict mock with:

val mockCollaborator = createStrictMock(classOf[Collaborator])

Using this trait, you can shorten that to:

val mockCollaborator = strictMock[Collaborator]

      def

        synchronized[T0](arg0: T0): T0

          attributes: final

          definition classes: AnyRef

      def

        toString(): String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

returns

a string representation of the object.

          definition classes: AnyRef → Any

      def

        wait(): Unit

          attributes: final

          definition classes: AnyRef

      def

        wait(arg0: Long, arg1: Int): Unit

          attributes: final

          definition classes: AnyRef

      def

        wait(arg0: Long): Unit

          attributes: final

          definition classes: AnyRef

      def

        whenExecuting(mock: AnyRef, moreMocks: AnyRef*)(fun: ⇒ Unit): Unit

Invokes replay on the passed mock object or objects, executes the passed function, then invokesverify on the passed mock object or objects.

Invokes replay on the passed mock object or objects, executes the passed function, then invokesverify on the passed mock object or objects.

Once you've set expectations on some mock objects, you must invoke replay on
the mocks to indicate you are done setting expectations, and will start using the mocks.
After using the mocks, you must invoke verify to check to make sure the mocks
were used in accordance with the expectations you set on it. Here's how that looks when you
use the EasyMock API directly:

replay(mock)
classUnderTest.addDocument("Document", new Array[Byte](0))
classUnderTest.addDocument("Document", new Array[Byte](0))
classUnderTest.addDocument("Document", new Array[Byte](0))
classUnderTest.addDocument("Document", new Array[Byte](0))
verify(mock)

This trait enables you to use the following, more declarative syntax instead:

whenExecuting(mockCollaborator) {
  classUnderTest.addDocument("Document", new Array[Byte](0))
  classUnderTest.addDocument("Document", new Array[Byte](0))
  classUnderTest.addDocument("Document", new Array[Byte](0))
  classUnderTest.addDocument("Document", new Array[Byte](0))
}

If you are working with multiple mock objects at once, you simply pass
them all to whenExecuting, like this:

whenExecuting(mock1, mock2, mock3) {
  // ...
}

The whenExecuting method will first invoke EasyMock.replyonce for each mock you supplied, execute the passed function, then
invoke EasyMock.verify once for each mock you supplied.


text:
C    Copyright(C) 2014-2017 National Technology & Engineering Solutions of
C    Sandia, LLC (NTESS).  Under the terms of Contract DE-NA0003525 with
C    NTESS, the U.S. Government retains certain rights in this software.
C
C    Redistribution and use in source and binary forms, with or without
C    modification, are permitted provided that the following conditions are
C    met:
C
C    * Redistributions of source code must retain the above copyright
C       notice, this list of conditions and the following disclaimer.
C
C    * Redistributions in binary form must reproduce the above
C      copyright notice, this list of conditions and the following
C      disclaimer in the documentation and/or other materials provided
C      with the distribution.
C
C    * Neither the name of NTESS nor the names of its
C      contributors may be used to endorse or promote products derived
C      from this software without specific prior written permission.
C
C    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
C    "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
C    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
C    A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
C    OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
C    SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
C    LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
C    DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
C    THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
C    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
C    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
C

C $Id: putcrs.f,v 1.2 2000/11/13 15:39:05 gdsjaar Exp $
C $Log: putcrs.f,v $
C Revision 1.2  2000/11/13 15:39:05  gdsjaar
C Cleaned up unused variables and labels.
C
C Removed some real to int conversion warnings.
C
C Revision 1.1.1.1  1990/11/30 11:13:57  gdsjaar
C FASTQ Version 2.0X
C
c Revision 1.1  90/11/30  11:13:56  gdsjaar
c Initial revision
c
C
CC* FILE: [.MAIN]PUTCRS.FOR
CC* MODIFIED BY: TED BLACKER
CC* MODIFICATION DATE: 7/6/90
CC* MODIFICATION: COMPLETED HEADER INFORMATION
C
      SUBROUTINE PUTCRS (X, Y, OLDCUR)
C***********************************************************************
C
C     SUBROUTINE PUTCRS = PLACES THE CROSSHAIRS AT THE CURRENT LOCATION
C
C***********************************************************************
C
C
      DIMENSION IDUM(2)
C
      LOGICAL OLDCUR
C
      CHARACTER DUMMY*16
C
C  SELECT DECIMAL MODE
C
      DUMMY = CHAR(27)
      DUMMY(2:4) = 'OR1'
      WRITE(*,*)DUMMY
C
C  PLACE THE CROSSHAIRS AT THE RIGHT LOCATION
C
      CALL MP2PT(1, X, Y, X1, Y1, IDUM)
      IX = INT(X1*4151.)
      IY = INT(Y1*4151.)
      DUMMY(1:1) = CHAR(27)
      DUMMY(2:2) = 'P'
      WRITE(DUMMY(3:8), '(I6)')IX
      DUMMY(9:9) = ','
      WRITE(DUMMY(10:15), '(I6)')IY
      DUMMY(16:16) = ','
      WRITE(*,*)DUMMY
C
C  UNSELECT DECIMAL MODE
C
      DUMMY = CHAR(27)
      DUMMY(2:4) = 'OR0'
      WRITE(*,*)DUMMY
C
      IF(.NOT.OLDCUR)THEN
C
C  ACTIVATE THE CROSSHAIRS
C
         DUMMY = CHAR(27)
         DUMMY(2:3) = 'G1'
         WRITE(*,*)DUMMY
         OLDCUR = .TRUE.
      ENDIF
C
      WRITE(*, '(A)')' '//CHAR(27)//'[2J'
      RETURN
C
      END