text:
<?php

namespace phpFastCache\Core;

use phpFastCache\Exceptions\phpFastCacheCoreException;
use phpFastCache\Exceptions\phpFastCacheDriverException;

trait PathSeekerTrait
{
    /**
     * @var array
     */
    public $tmp = [];

    /**
     * @param bool $skip_create_path
     * @param $config
     * @return string
     * @throws \Exception
     */
    public function getPath($getBasePath = false)
    {
        $tmp_dir = rtrim(ini_get('upload_tmp_dir') ? ini_get('upload_tmp_dir') : sys_get_temp_dir(), '\\/') . DIRECTORY_SEPARATOR . 'phpfastcache';

        if (!isset($this->config[ 'path' ]) || $this->config[ 'path' ] == '') {
            if (self::isPHPModule()) {
                $path = $tmp_dir;
            } else {
                $document_root_path = rtrim($_SERVER[ 'DOCUMENT_ROOT' ], '/') . '/../';
                $path = isset($_SERVER[ 'DOCUMENT_ROOT' ]) && is_writable($document_root_path) ? $document_root_path : rtrim(__DIR__, '/') . '/';
            }

            if ($this->config[ 'path' ] != '') {
                $path = $this->config[ 'path' ];
            }

        } else {
            $path = $this->config[ 'path' ];
        }

        if ($getBasePath === true) {
            return $path;
        }

        $securityKey = array_key_exists('securityKey', $this->config) ? $this->config[ 'securityKey' ] : '';
        if (!$securityKey || $securityKey === 'auto') {
            if (isset($_SERVER[ 'HTTP_HOST' ])) {
                $securityKey = preg_replace('/^www./', '', strtolower(str_replace(':', '_', $_SERVER[ 'HTTP_HOST' ])));
            } else {
                $securityKey = ($this->isPHPModule() ? 'web' : 'cli');
            }
        }

        if ($securityKey !== '') {
            $securityKey .= '/';
        }

        $securityKey = static::cleanFileName($securityKey);

        $full_path = rtrim($path, '/') . '/' . $securityKey;
        $full_pathx = md5($full_path);

        if (!isset($this->tmp[ $full_pathx ])) {

            if (!@file_exists($full_path) || !@is_writable($full_path)) {
                if (!@file_exists($full_path)) {
                    @mkdir($full_path, $this->setChmodAuto(), true);
                }
                if (!@is_writable($full_path)) {
                    @chmod($full_path, $this->setChmodAuto());
                }
                if (!@is_writable($full_path)) {
                    // switch back to tmp dir again if the path is not writeable
                    $full_path = rtrim($tmp_dir, '/') . '/' . $securityKey;
                    if (!@file_exists($full_path)) {
                        @mkdir($full_path, $this->setChmodAuto(), true);
                    }
                    if (!@is_writable($full_path)) {
                        @chmod($full_path, $this->setChmodAuto());
                    }
                }
                if (!@file_exists($full_path) || !@is_writable($full_path)) {
                    throw new phpFastCacheCoreException('PLEASE CREATE OR CHMOD ' . $full_path . ' - 0777 OR ANY WRITABLE PERMISSION!', 92);
                }
            }

            $this->tmp[ $full_pathx ] = true;
            $this->htaccessGen($full_path, array_key_exists('htaccess', $this->config) ? $this->config[ 'htaccess' ] : false);
        }

        return realpath($full_path);
    }

    /**
     * @param $keyword
     * @return string
     */
    protected function encodeFilename($keyword)
    {
        return md5($keyword);
    }

    /**
     * @return bool
     */
    public function isExpired()
    {
        trigger_error(__FUNCTION__ . '() is deprecated, use ExtendedCacheItemInterface::isExpired() instead.', E_USER_DEPRECATED);

        return true;
    }

    /**
     * @return string
     * @throws \phpFastCache\Exceptions\phpFastCacheCoreException
     */
    public function getFileDir()
    {
        return $this->getPath() . DIRECTORY_SEPARATOR . self::FILE_DIR;
    }

    /**
     * @param $keyword
     * @param bool $skip
     * @return string
     * @throws phpFastCacheDriverException
     */
    private function getFilePath($keyword, $skip = false)
    {
        $path = $this->getFileDir();

        if ($keyword === false) {
            return $path;
        }

        $filename = $this->encodeFilename($keyword);
        $folder = substr($filename, 0, 2);
        $path = rtrim($path, '/') . '/' . $folder;
        /**
         * Skip Create Sub Folders;
         */
        if ($skip == false) {
            if (!file_exists($path)) {
                if (@!mkdir($path, $this->setChmodAuto(), true)) {
                    throw new phpFastCacheDriverException('PLEASE CHMOD ' . $this->getPath() . ' - ' . $this->setChmodAuto() . ' OR ANY WRITABLE PERMISSION!');
                }
            }
        }

        return $path . '/' . $filename . '.txt';
    }

    /**
     * @param $this ->config
     * @return int
     */
    public function setChmodAuto()
    {
        if (!isset($this->config[ 'default_chmod' ]) || $this->config[ 'default_chmod' ] == '' || is_null($this->config[ 'default_chmod' ])) {
            return 0777;
        } else {
            return $this->config[ 'default_chmod' ];
        }
    }

    /**
     * @param $filename
     * @return mixed
     */
    protected static function cleanFileName($filename)
    {
        $regex = [
          '/[\?\[\]\/\\\=\<\>\:\;\,\'\"\&\$\#\*\(\)\|\~\`\!\{\}]/',
          '/\.$/',
          '/^\./',
        ];
        $replace = ['-', '', ''];

        return trim(preg_replace($regex, $replace, trim($filename)), '-');
    }

    /**
     * @param $path
     * @param bool $create
     * @throws \Exception
     */
    protected function htaccessGen($path, $create = true)
    {
        if ($create === true) {
            if (!is_writable($path)) {
                try {
                    if(!chmod($path, 0777)){
                        throw new phpFastCacheDriverException('Chmod failed on : ' . $path);
                    }
                } catch (phpFastCacheDriverException $e) {
                    throw new phpFastCacheDriverException('PLEASE CHMOD ' . $path . ' - 0777 OR ANY WRITABLE PERMISSION!', 0, $e);
                }
            }

            if (!file_exists($path . "/.htaccess")) {
                $html = "order deny, allow \r\n
deny from all \r\n
allow from 127.0.0.1";

                $file = @fopen($path . '/.htaccess', 'w+');
                if (!$file) {
                    throw new phpFastCacheDriverException('PLEASE CHMOD ' . $path . ' - 0777 OR ANY WRITABLE PERMISSION!');
                }
                fwrite($file, $html);
                fclose($file);
            }
        }
    }
}


text:
package org.kuali.rice.krad.data.metadata;

/**
 * Metadata exception handling
 *
 * @author Kuali Rice Team (rice.collab@kuali.org)
 */
public class MetadataConfigurationException extends RuntimeException {
	private static final long serialVersionUID = 3518029933066928419L;

    /**
    * Metadata exception.
    *
    * @return exception
    */
	public MetadataConfigurationException() {
		super();
	}

    /**
    * Metadata config exception.
    *
    * @param message error message
    * @return exception
    */
	public MetadataConfigurationException(String message) {
		super(message);
	}

    /**
    * Metadata config exception.
    *
    * @param message error message
    * @param cause error cause
    * @return exception
    */
	public MetadataConfigurationException(String message, Throwable cause) {
		super(message, cause);
	}

    /**
    * Metadata config exception.
    *
    * @param cause error cause
    * @return exception
    */
	public MetadataConfigurationException(Throwable cause) {
		super(cause);
	}
}

redpajama_set_name: RedPajamaGithub


text:
package com.techalpino.quartz;

import java.util.concurrent.Executor;
import java.util.concurrent.Executors;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.SchedulingConfigurer;
import org.springframework.scheduling.config.ScheduledTaskRegistrar;
import org.springframework.stereotype.Component;

/*@Configuration
@EnableScheduling
@Component*/
public class AppConfig implements SchedulingConfigurer {

    @Bean
    public MyBean bean() {
        return new MyBean();
    }

    @Override
    public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
        taskRegistrar.setScheduler(taskExecutor());
    }

    @Bean(destroyMethod="shutdown")
    public Executor taskExecutor() {
        return Executors.newScheduledThreadPool(10);
    }

}


text:
<?php

//## NextScripts FriendFeed Connection Class
$nxs_snapAPINts[] = array('code'=>'TG', 'lcode'=>'tg', 'name'=>'Pinterest');

if (!class_exists("nxs_class_SNAP_TG")) { class nxs_class_SNAP_TG {

	var $ntCode = 'TG';
	var $ntLCode = 'tg';

	function doPost($options, $message){ if (!is_array($options)) return false; $out = array();
	  foreach ($options as $ii=>$ntOpts) $out[$ii] = $this->doPostToNT($ntOpts, $message);
	  return $out;
	}
	function nxs_getHeaders($ref, $post=false){ $hdrsArr = array();
	  $hdrsArr['X-Requested-With']='XMLHttpRequest'; $hdrsArr['Connection']='keep-alive'; $hdrsArr['Referer']=$ref;
	  $hdrsArr['User-Agent']='Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.22 Safari/537.11';
	  if($post) $hdrsArr['Content-Type']='application/x-www-form-urlencoded'; $hdrsArr['Accept']='application/json, text/javascript, */*; q=0.01';
	  $hdrsArr['Accept-Encoding']='gzip,deflate,sdch'; $hdrsArr['Accept-Language']='en-US,en;q=0.8'; $hdrsArr['Accept-Charset']='ISO-8859-1,utf-8;q=0.7,*;q=0.3'; return $hdrsArr;
	}
	function doPostToNT($options, $message){ global $nxs_gCookiesArr; $badOut = array('pgID'=>'', 'isPosted'=>0, 'pDate'=>date('Y-m-d H:i:s'), 'Error'=>'');
	  //## Check settings
	  if (!is_array($options)) { $badOut['Error'] = 'No Options'; return $badOut; } if (empty($options['botTkn'])) { $badOut['Error'] = 'Not Configured'; return $badOut; }
	  //## Format
	  if (!empty($message['pText'])) $msg = $message['pText']; else $msg = nxs_doFormatMsg($options['msgFormat'], $message); if (empty($options['imgSize'])) $options['imgSize'] = '';
	  if (isset($message['imageURL'])) $imgURL = trim(nxs_getImgfrOpt($message['imageURL'], $options['imgSize'])); else $imgURL = '';
	  $urlToGo = (!empty($message['url']))?$message['url']:'';

      if (substr($options['whToPost'],0,1)=='g') $options['whToPost'] = substr_replace($options['whToPost'], '-',0,1); //## Fix for Groups ID
      //## Attach Image
      if ($options['attchImg']=='1') { $url = 'https://api.telegram.org/bot'.$options['botTkn'].'/sendPhoto';
	    $fields = array( 'chat_id' => $options['whToPost'],'photo' =>'@photo;filename=' . $imgURL, 'caption' => '' );
        $imgRes = nxs_curlUploadImg($imgURL, $url, $fields, 'photo'); if (is_array($imgRes) && !empty($imgRes['err'])) { $options['attchImg'] = 0;
            nxs_addToLogN('E','Error','TG','Could not get image ( '.$imgURL.' ), will post without it - ', print_r($imgRes['err'], true));
        }//  $contents = $imgRes['body']; $resp = json_decode($contents, true);     prr($resp);
      }	 $msg = nsTrnc(strip_tags($msg), 3000); $url = 'https://api.telegram.org/bot'.$options['botTkn'].'/sendMessage';
	  $flds = array('chat_id' => $options['whToPost'], 'text' => $msg, 'parse_mode' => 'Markdown', 'disable_web_page_preview' => false); $hdrsArr = $this->nxs_getHeaders('https://api.telegram.org', true);
	  $advSet = nxs_mkRemOptsArr($hdrsArr, '', $flds); $ret = wp_remote_post( $url, $advSet); if (is_nxs_error($ret)) {  $badOut = print_r($ret, true)." - ERROR"; return $badOut; }
	  $contents = $ret['body']; $resp = json_decode($contents, true);	//  prr($resp);
	  if (is_array($resp) && !empty($resp['ok']) && $resp['ok'] == 1 ) { if (empty($resp['result']['chat']['username'])) $purl = 'https://web.telegram.org/#/im?p='.str_replace('-','g',$resp['result']['chat']['id']); else $purl = 'http://telegram.me/'.$resp['result']['chat']['username'];
          return array('postID'=>$resp['result']['message_id'], 'isPosted'=>1, 'postURL'=>$purl, 'pDate'=>date('Y-m-d H:i:s'));
      } else $badOut['Error'] .= 'Something went wrong - '.print_r($ret, true);
	  return $badOut;
   }
}}

?>


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Annls mycol. 23(1/2): 103 (1925)

#### Original name
Sphaeria ulmi C.-J. Duval, 1809

### Remarks
null


text:
'use strict';

angular.module('imagesGalleryMocks.imageService', [])
  .run(function($httpBackend, urlParser, MOCKED_IMAGES) {

    function getImages(method, request) {
      var images = [],
        results = Number(urlParser.getQueryParamByName(request, 'results')) || 10,
        pageIndex = Number(urlParser.getQueryParamByName(request, 'page')) || 0;
      images = MOCKED_IMAGES.images.slice(pageIndex * results, pageIndex * results + results);
      return [200, {
        'images': images
      }, {}];
    }

    $httpBackend.whenGET(/\/services\/images/)
      .respond(getImages);
    // $httpBackend.whenGET().respond([200, MOCKED_IMAGES,{}]);
  });

angular.module('imagesGalleryMocks.imageService')
  .constant('MOCKED_IMAGES', {
    images: [{
      owner: 'Lorem.',
      description: 'Lorem ipsum dolor.',
      imageUrl: '/images/image-service/1.jpg'
    }, {
      owner: 'Nostrum',
      description: 'Unde voluptate, aliquid.',
      imageUrl: '/images/image-service/2.jpg'
    }, {
      owner: 'Tempore',
      description: 'Delectus, iure, optio.',
      imageUrl: '/images/image-service/3.jpg'
    }, {
      owner: 'Cumque',
      description: 'Magni, amet, cupiditate.',
      imageUrl: '/images/image-service/4.jpg'
    }, {
      owner: 'Sapiente',
      description: 'Libero, dolorem corporis.',
      imageUrl: '/images/image-service/5.jpg'
    }, {
      owner: 'Laboriosam',
      description: 'Sunt, recusandae, molestiae!',
      imageUrl: '/images/image-service/6.jpg'
    }, {
      owner: 'Ratione.',
      description: 'Natus et, temporibus.',
      imageUrl: '/images/image-service/7.jpg'
    }, {
      owner: 'Iusto',
      description: 'Omnis, quidem delectus.',
      imageUrl: '/images/image-service/8.jpg'
    }, {
      owner: 'Aut.',
      description: 'Facilis, repellendus dolorum?',
      imageUrl: '/images/image-service/9.jpg'
    }, {
      owner: 'Voluptas.',
      description: 'Est, autem, voluptatum!',
      imageUrl: '/images/image-service/10.jpg'
    }, {
      owner: 'Pariatur.',
      description: 'Enim, est, sequi!',
      imageUrl: '/images/image-service/11.jpg'
    }, {
      owner: 'Fugiat.',
      description: 'Aut ex, molestiae!',
      imageUrl: '/images/image-service/12.jpg'
    }, {
      owner: 'Possimus!',
      description: 'Perspiciatis, maiores animi!',
      imageUrl: '/images/image-service/13.jpg'
    }, {
      owner: 'Error!',
      description: 'Neque, aperiam, dicta?',
      imageUrl: '/images/image-service/14.jpg'
    }, {
      owner: 'Vel.',
      description: 'Omnis, ipsa, magnam.',
      imageUrl: '/images/image-service/15.jpg'
    }, {
      owner: 'Ex.',
      description: 'Veniam, autem, aliquam!',
      imageUrl: '/images/image-service/16.jpg'
    }, {
      owner: 'Ex.',
      description: 'Repudiandae, laborum est.',
      imageUrl: '/images/image-service/17.jpg'
    }, {
      owner: 'Possimus?',
      description: 'Doloremque, esse praesentium?',
      imageUrl: '/images/image-service/18.jpg'
    }, {
      owner: 'Ipsum.',
      description: 'Quis fugit, dolore!',
      imageUrl: '/images/image-service/19.jpg'
    }, {
      owner: 'Sint.',
      description: 'Quis, ipsa, consectetur?',
      imageUrl: '/images/image-service/20.jpg'
    }, {
      owner: 'Deserunt.',
      description: 'Sint, ut, libero.',
      imageUrl: '/images/image-service/21.jpg'
    }, {
      owner: 'Nihil.',
      description: 'Ab, ducimus, ipsa.',
      imageUrl: '/images/image-service/22.jpg'
    }, {
      owner: 'Inventore!',
      description: 'Distinctio, amet ut!',
      imageUrl: '/images/image-service/23.jpg'
    }, {
      owner: 'Repellat?',
      description: 'Consequatur qui, libero!',
      imageUrl: '/images/image-service/24.jpg'
    }, {
      owner: 'Iusto.',
      description: 'Asperiores harum, sint.',
      imageUrl: '/images/image-service/25.jpg'
    }, {
      owner: 'Provident.',
      description: 'Neque, enim, distinctio.',
      imageUrl: '/images/image-service/26.jpg'
    }, {
      owner: 'Sunt.',
      description: 'Numquam sed, inventore.',
      imageUrl: '/images/image-service/27.jpg'
    }, {
      owner: 'Obcaecati!',
      description: 'Molestiae deleniti, itaque.',
      imageUrl: '/images/image-service/28.jpg'
    }, {
      owner: 'Nesciunt!',
      description: 'Itaque, ex expedita?',
      imageUrl: '/images/image-service/29.jpg'
    }, {
      owner: 'Nulla!',
      description: 'Odio, distinctio, officia!',
      imageUrl: '/images/image-service/30.jpg'
    }, {
      owner: 'Sit!',
      description: 'Impedit, minima, magni.',
      imageUrl: '/images/image-service/31.jpg'
    }, {
      owner: 'Sequi?',
      description: 'Enim, laboriosam earum.',
      imageUrl: '/images/image-service/32.jpg'
    }, {
      owner: 'Minima?',
      description: 'Sapiente, odio, repellendus?',
      imageUrl: '/images/image-service/33.jpg'
    }, {
      owner: 'Veritatis.',
      description: 'Ducimus, et? Consequatur.',
      imageUrl: '/images/image-service/34.jpg'
    }, {
      owner: 'Sapiente.',
      description: 'Beatae, nostrum. Asperiores?',
      imageUrl: '/images/image-service/35.jpg'
    }, {
      owner: 'Sed!',
      description: 'Corporis, dolorem, ducimus?',
      imageUrl: '/images/image-service/36.jpg'
    }, {
      owner: 'Hic.',
      description: 'Natus, iusto, voluptatem!',
      imageUrl: '/images/image-service/37.jpg'
    }, {
      owner: 'Suscipit.',
      description: 'Voluptate, voluptates laboriosam.',
      imageUrl: '/images/image-service/38.jpg'
    }, {
      owner: 'Fuga!',
      description: 'Temporibus, illo dolore.',
      imageUrl: '/images/image-service/39.jpg'
    }, {
      owner: 'Praesentium.',
      description: 'Deleniti pariatur, dolores?',
      imageUrl: '/images/image-service/40.jpg'
    }, {
      owner: 'Perspiciatis!',
      description: 'Ducimus, nemo, animi!',
      imageUrl: '/images/image-service/41.jpg'
    }, {
      owner: 'Culpa.',
      description: 'Odit, amet, rem.',
      imageUrl: '/images/image-service/42.jpg'
    }, {
      owner: 'Quasi.',
      description: 'Similique obcaecati, eos.',
      imageUrl: '/images/image-service/43.jpg'
    }, {
      owner: 'Quos.',
      description: 'Velit, unde, quidem.',
      imageUrl: '/images/image-service/44.jpg'
    }, {
      owner: 'Sed.',
      description: 'Quas, voluptatem, deleniti!',
      imageUrl: '/images/image-service/45.jpg'
    }, {
      owner: 'Repudiandae!',
      description: 'Repudiandae, veritatis, quis.',
      imageUrl: '/images/image-service/46.jpg'
    }, {
      owner: 'Aliquid?',
      description: 'Ullam, odit, dolore.',
      imageUrl: '/images/image-service/47.jpg'
    }, {
      owner: 'Ipsa.',
      description: 'Exercitationem, voluptatum, nesciunt.',
      imageUrl: '/images/image-service/48.jpg'
    }, {
      owner: 'Rerum.',
      description: 'Cupiditate, quasi officia.',
      imageUrl: '/images/image-service/49.jpg'
    }, {
      owner: 'Eum.',
      description: 'Dolorem, earum, non.',
      imageUrl: '/images/image-service/50.jpg'
    }, {
      owner: 'Minima.',
      description: 'Animi, error, ipsam.',
      imageUrl: '/images/image-service/51.jpg'
    }, {
      owner: 'Rerum?',
      description: 'Alias, dicta, impedit.',
      imageUrl: '/images/image-service/52.jpg'
    }, {
      owner: 'Ratione!',
      description: 'Ipsum, eaque, officia!',
      imageUrl: '/images/image-service/53.jpg'
    }, {
      owner: 'Rerum',
      description: 'Assumenda, placeat, id.',
      imageUrl: '/images/image-service/54.jpg'
    }]
  });


text:
DGR2_NP_BEGIN
struct DGR2_API Logger : public DGRObject
{
    DGR_OBJECT(Logger)
    void destroy();
    void setFilter(Filter* filter) { filter_ = filter; }
    Filter* getFilter() const { return filter_; }
    const std::xStrT& getName()const { return name_; }
    void addAppender(Appender& appender);
    void removeAppender(Appender& appender);
    void publish(Log& log);
    void publish(const Level& level, const xCharT* fmt, ...);
    void publish(const Level& level, const xCharT* file, const xCharT* func, unsigned int lineno, const xCharT* fmt, ...);
    template <typename T>
    Logger& operator<<(T val)
    {
        xostream_ << val;
        return *this;
    }
    Logger& operator<<(const Log& log);
    Logger& operator<<(LogTag tag);
    Logger(const std::xStrT& name);

private:
    ~Logger();
    void onEndLog();
    typedef std::vector<Appender*> AppenderListType;
    AppenderListType appenders_;
    std::basic_ostringstream<xCharT> xostream_;
    Log* target_log_;
    std::xStrT name_;
    Filter* filter_;
};
NP_END
#endif


text:
package blue.lapis.pore.impl.entity;

import blue.lapis.pore.converter.wrapper.WrapperConverter;

import org.apache.commons.lang.NotImplementedException;
import org.bukkit.entity.EntityType;
import org.bukkit.inventory.meta.FireworkMeta;
import org.spongepowered.api.entity.projectile.Firework;

public class PoreFirework extends PoreEntity implements org.bukkit.entity.Firework {

    public static PoreFirework of(Firework handle) {
        return WrapperConverter.of(PoreFirework.class, handle);
    }

    protected PoreFirework(Firework handle) {
        super(handle);
    }

    @Override
    public Firework getHandle() {
        return (Firework) super.getHandle();
    }

    @Override
    public EntityType getType() {
        return EntityType.FIREWORK;
    }

    @Override
    public FireworkMeta getFireworkMeta() {
        throw new NotImplementedException(); //TODO
    }

    @Override
    public void setFireworkMeta(FireworkMeta meta) {
        throw new NotImplementedException(); //TODO
    }

    @Override
    public void detonate() {
        getHandle().detonate();
    }
}


text:
package es.tid.cosmos.api.task.inmemory

import es.tid.cosmos.api.task.{MutableTask, Running, TaskStatus}

class InMemoryTask(val id: Int) extends MutableTask {
  @volatile override var status: TaskStatus = Running
  @volatile override var usersWithAccess: Seq[String] = Seq.empty
  @volatile override var metadata: Any = ()
  @volatile override var resource: String = ""
}


text:
require_relative '../../spec_helper'
require_relative '../../factories/organizations_contexts'
require_relative '../../../app/models/carto/invitation'
require_relative '../../../app/controllers/carto/api/user_creations_controller'
require_relative '../../../lib/resque/user_jobs'

describe Carto::Invitation do
  include_context 'organization with users helper'

  describe 'creation' do
    it 'fails for existing users' do
      invitation = Carto::Invitation.create_new(@carto_org_user_owner, [@carto_org_user_1.email], 'hi', false)
      invitation.valid?.should == false
    end

    it 'fails for non-owner users' do
      expect do
        Carto::Invitation.create_new(@carto_org_user_1, ['no@carto.com'], 'hi', false)
      end.to raise_error CartoDB::InvalidUser
    end

    it 'fails for wrong emails' do
      invitation = Carto::Invitation.create_new(@carto_org_user_owner, ['no', 'neither@'], 'hi', false)
      invitation.valid?.should == false
      invitation.errors[:users_emails].count.should == 2
    end

    it 'sends invitations' do
      ::Resque.expects(:enqueue).with(Resque::OrganizationJobs::Mail::Invitation, instance_of(String)).once
      emails = ['w_1@carto.com', 'w_2@carto.com']
      invitation = Carto::Invitation.create_new(@carto_org_user_owner, emails, 'hi', false)
      invitation.inviter_user_id.should == @carto_org_user_owner.id
      invitation.organization_id.should == @carto_org_user_owner.organization_id
    end
  end

  describe 'token' do
    before(:each) do
      @invitation = Carto::Invitation.create_new(@carto_org_user_owner, [], 'Welcome!', false)
      @invitation_2 = Carto::Invitation.create_new(@carto_org_user_owner, [], 'Welcome!', false)
    end

    it 'returns the same token for the same email' do
      email = 'myemail@carto.com'
      t1 = @invitation.token(email)
      t2 = @invitation.token(email)
      t1.should == t2
    end

    it 'returns different tokens for different emails' do
      t1 = @invitation.token('email1@carto.com')
      t2 = @invitation.token('email2@carto.com')
      t1.should_not == t2
    end

    it 'returns different tokens using the same email with different invitations' do
      email = 'myemail@carto.com'
      t1 = @invitation.token(email)
      t2 = @invitation_2.token(email)
      t1.should_not == t2
    end

    it 'has a length > 10' do
      @invitation.token('email1@carto.com').length.should > 10
    end
  end

  describe '#use' do
    before(:each) do
      @valid_email = 'email1@carto.com'
      @valid_email_2 = 'email2@carto.com'
      @invitation = Carto::Invitation.create_new(
        @carto_org_user_owner,
        [@valid_email, @valid_email_2],
        'Welcome!',
        false
      )
      @token = @invitation.token(@valid_email)
      @token_2 = @invitation.token(@valid_email_2)
    end

    it 'return true for valid emails + token' do
      @invitation.use(@valid_email, @token).should == true
    end

    it 'return false for non valid emails' do
      @invitation.use('fake@carto.com', @token).should == false
    end

    it 'return false for non valid tokens' do
      @invitation.use(@valid_email, 'fake_token').should == false
    end

    it 'triggers an AlreadyUsedInvitationError if a user uses it twice' do
      @invitation.use(@valid_email, @token)
      @invitation.use(@valid_email_2, @token_2)
      @invitation.reload
      expect { @invitation.use(@valid_email, @token) }.to raise_error AlreadyUsedInvitationError
      expect { @invitation.use(@valid_email_2, @token_2) }.to raise_error AlreadyUsedInvitationError
    end
  end
end


text:
package jflowmap.es_agg.data;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;

import java.util.Arrays;

import jflowmap.data.SeqStat;

import org.junit.Test;

public class SeqStatNormalizerTest {

  private static final double EPS = 1e-7;

  @Test
  public void test_normalizeLog_smallDiff() {
    SeqStat mm = SeqStat.createFor(Arrays.asList(7.47725554761535E-10, 1.0512433341615857));
    //mm.normalize(1.0512433341615857);
    assertEquals(1.0, mm.normalizer().normalizeLog(1.0512433341615857), EPS); // used to yield 1.0000000000000004
                                                                 // and throw an exception
  }

  @Test
  public void test_createFor_negative() {
    SeqStat minMax = SeqStat.createFor(Arrays.asList(-1.0, -1.1, -1.4, -100.0, -10.0).iterator());
    assertEquals(-100.0, minMax.getMin(), EPS);
    assertEquals(-1.0, minMax.getMax(), EPS);
  }

  @Test
  public void test_normalizeLog() {
    SeqStat minMax = SeqStat.createFor(Arrays.asList(1.0, 1.1, 1.4, 100.0, 10.0).iterator());
    assertEquals(0, minMax.normalizer().normalizeLog(1), EPS);
    assertEquals(.5, minMax.normalizer().normalizeLog(10), EPS);
    assertEquals(1.0, minMax.normalizer().normalizeLog(100), EPS);
  }

  @Test
  public void test_normalizeLog_negative() {
    SeqStat minMax = SeqStat.createFor(Arrays.asList(-1.0, -1.1, -1.4, -100.0, -10.0).iterator());
    assertEquals(0, minMax.normalizer().normalizeLog((-100)), EPS);
    assertEquals(.5, minMax.normalizer().normalizeLog((-90)), 1e-1);
    assertEquals(1.0, minMax.normalizer().normalizeLog((-1)), EPS);
  }

  @Test
  public void test_normalizeAroundZero() {
    SeqStat minMax = SeqStat.createFor(Arrays.asList(-5.0, 0.0, 0.1, 1.4, 10.0).iterator());

    assertEquals(-0.5, minMax.normalizer().normalizeAroundZero((-5)), EPS);
    assertEquals(-0.25, minMax.normalizer().normalizeAroundZero((-2.5)), EPS);
    assertEquals(0.0, minMax.normalizer().normalizeAroundZero(0.0), EPS);
    assertEquals(0.5, minMax.normalizer().normalizeAroundZero(5.0), EPS);
    assertEquals(1.0, minMax.normalizer().normalizeAroundZero(10.0), EPS);

    try {
      minMax.normalizer().normalizeAroundZero(11.0);
      fail("IllegalArgumentException was expected");
    } catch (IllegalArgumentException iae) {
      // ok
    }
  }

  @Test
  public void test_normalizeAroundZero2() {
    SeqStat minMax = SeqStat.createFor(Arrays.asList(1.0, 2.0, 10.0).iterator());

    assertEquals(0.1, minMax.normalizer().normalizeAroundZero(1.0), EPS);
    assertEquals(0.5, minMax.normalizer().normalizeAroundZero(5.0), EPS);
    assertEquals(1.0, minMax.normalizer().normalizeAroundZero(10.0), EPS);

    SeqStat minMax2 = SeqStat.createFor(Arrays.asList(-1.0, -2.0, -10.0).iterator());
    assertEquals(-0.1, minMax2.normalizer().normalizeAroundZero((-1.0)), EPS);
    assertEquals(-0.5, minMax2.normalizer().normalizeAroundZero((-5.0)), EPS);
    assertEquals(-1.0, minMax2.normalizer().normalizeAroundZero((-10.0)), EPS);
  }

  @Test
  public void test_normalizeLogAroundZero() {
    SeqStat minMax = SeqStat.createFor(Arrays.asList(-22.0, -3.0, 1.0, 2.0, 100.0).iterator());
    assertEquals(0.0, minMax.normalizer().normalizeLogAroundZero(0.0), EPS);
    assertEquals(-.5, minMax.normalizer().normalizeLogAroundZero((-10.0)), 1e-1);
    assertEquals(.5, minMax.normalizer().normalizeLogAroundZero(10.0), 1e-1);
    assertEquals(1.0, minMax.normalizer().normalizeLogAroundZero(100.0), EPS);
  }

}


text:
package com.github.ksoichiro.todo.java.springboot.domain;

import lombok.Data;

import javax.persistence.*;

@Entity
@Data
public class Todo {
    @Id
    @GeneratedValue
    private Long id;

    @Column(nullable = false)
    private String title;

    @Column(nullable = false)
    private String note;

    @Column(nullable = false)
    private Integer ownerType;

    @Column(nullable = false)
    private Long userId;

    @Column(nullable = false)
    private Long groupId;

    @Column(nullable = false)
    private Long createdAt;

    @Column(nullable = false)
    private Long updatedAt;

    @ManyToOne
    @JoinColumn(name = "todo_state_id")
    private TodoState todoState;
}


text:
import {NgModule,Directive,ElementRef,OnDestroy,HostBinding,HostListener,Input} from '@angular/core';
import {CommonModule} from '@angular/common';
import {DomHandler} from '../dom/domhandler';

@Directive({
    selector: '[pTooltip]',
    host: {
    },
    providers: [DomHandler]
})
export class Tooltip implements OnDestroy {

    @Input('pTooltip') text: string;

    @Input() tooltipPosition: string = 'right';

    @Input() tooltipEvent: string = 'hover';

    @Input() appendTo: any = 'body';

    @Input() positionStyle: string;

    @Input() tooltipStyleClass: string;

    @Input("tooltipDisabled") disabled: boolean;

    container: any;

    constructor(public el: ElementRef, public domHandler: DomHandler) {}

    @HostListener('mouseenter', ['$event'])
    onMouseEnter(e: Event) {
        if(this.tooltipEvent === 'hover') {
            this.show();
        }
    }

    @HostListener('mouseleave', ['$event'])
    onMouseLeave(e: Event) {
        if(this.tooltipEvent === 'hover') {
            this.hide();
        }
    }

    @HostListener('focus', ['$event'])
    onFocus(e: Event) {
        if(this.tooltipEvent === 'focus') {
            this.show();
        }
    }

    @HostListener('blur', ['$event'])
    onBlur(e: Event) {
        if(this.tooltipEvent === 'focus') {
            this.hide();
        }
    }

    show() {
        if(!this.text || this.disabled) {
            return;
        }

        this.create();
        let offset = (this.appendTo !== 'body') ? {left:0, top:0} : this.domHandler.getOffset(this.el.nativeElement);
        let targetTop = offset.top;
        let targetLeft = offset.left;
        let left: number;
        let top: number;

        this.container.style.display = 'block';

        switch(this.tooltipPosition) {
            case 'right':
                left = targetLeft + this.domHandler.getOuterWidth(this.el.nativeElement);
                top = targetTop + (this.domHandler.getOuterHeight(this.el.nativeElement) - this.domHandler.getOuterHeight(this.container)) / 2;
            break;

            case 'left':
                left = targetLeft - this.domHandler.getOuterWidth(this.container);
                top = targetTop + (this.domHandler.getOuterHeight(this.el.nativeElement) - this.domHandler.getOuterHeight(this.container)) / 2;
            break;

            case 'top':
                left = targetLeft + (this.domHandler.getOuterWidth(this.el.nativeElement) - this.domHandler.getOuterWidth(this.container)) / 2;
                top = targetTop - this.domHandler.getOuterHeight(this.container);
            break;

            case 'bottom':
                left = targetLeft + (this.domHandler.getOuterWidth(this.el.nativeElement) - this.domHandler.getOuterWidth(this.container)) / 2;
                top = targetTop + this.domHandler.getOuterHeight(this.el.nativeElement);
            break;
        }

        this.container.style.left = left + 'px';
        this.container.style.top = top + 'px';
        this.domHandler.fadeIn(this.container, 250);
        this.container.style.zIndex = ++DomHandler.zindex;
    }

    hide() {
        this.ngOnDestroy();
    }

    create() {
        let styleClass = 'ui-widget ui-tooltip ui-tooltip-' + this.tooltipPosition;
        this.container = document.createElement('div');
        if(this.tooltipStyleClass) {
            styleClass += ' ' + this.tooltipStyleClass;
        }

        this.container.className = styleClass;

        let tooltipArrow = document.createElement('div');
        tooltipArrow.className = 'ui-tooltip-arrow';
        this.container.appendChild(tooltipArrow);

        let tooltipText = document.createElement('div');
        tooltipText.className = 'ui-tooltip-text ui-shadow ui-corner-all';
        tooltipText.appendChild(document.createTextNode(this.text));

        if(this.positionStyle) {
            this.container.style.position = this.positionStyle;
        }

        this.container.appendChild(tooltipText);

        if(this.appendTo === 'body')
            document.body.appendChild(this.container);
        else if(this.appendTo === 'target')
            this.domHandler.appendChild(this.container, this.el.nativeElement);
        else
            this.domHandler.appendChild(this.container, this.appendTo);
    }

    ngOnDestroy() {
        if(this.container && this.container.parentElement) {
            if(this.appendTo === 'body')
                document.body.removeChild(this.container);
            else if(this.appendTo === 'target')
                this.el.nativeElement.removeChild(this.container);
            else
                this.domHandler.removeChild(this.container, this.appendTo);
        }
        this.container = null;
    }
}

@NgModule({
    imports: [CommonModule],
    exports: [Tooltip],
    declarations: [Tooltip]
})
export class TooltipModule { }


text:
package org.apache.camel.component.as2.api.entity;

import org.apache.camel.component.as2.api.util.AS2HeaderUtils.Parameter;

public class DispositionNotificationOptions {

    private Parameter signedReceiptProtocol;
    private Parameter signedReceiptMicalg;

    public DispositionNotificationOptions(Parameter signedReceiptProtocol, Parameter signedReceiptMicalg) {
        this.signedReceiptProtocol = signedReceiptProtocol;
        this.signedReceiptMicalg = signedReceiptMicalg;
    }

    public Parameter getSignedReceiptProtocol() {
        return signedReceiptProtocol;
    }

    public Parameter getSignedReceiptMicalg() {
        return signedReceiptMicalg;
    }

}


text:
import {CssTransitionEffect} from './css-transition-effect';
import {Orientation, HorizontalAlignment, VerticalAlignment} from '../utils/alignment';

export class ScaleEffect extends CssTransitionEffect {

  private static computeValues(xOffset:HorizontalAlignment, yOffset:VerticalAlignment):Map<string, string> {
    if (xOffset === null) {
      xOffset = HorizontalAlignment.CENTER;
    }
    let xoValue:string = xOffset.value;

    if (yOffset === null) {
      yOffset = VerticalAlignment.MIDDLE;
    }
    let yoValue:string = (yOffset === VerticalAlignment.MIDDLE) ? 'center' : yOffset.value;

    return new Map<string, string>().set('-webkit-transform-origin',  `${xoValue} ${yoValue}`);
  }

  constructor(private orientation:Orientation, xOffset:HorizontalAlignment, yOffset:VerticalAlignment) {
    super('-webkit-transform', ScaleEffect.computeValues(xOffset, yOffset));
  }

  computePropertyValue(fractionComplete:number, element:HTMLElement):string {
    if (this.orientation === Orientation.VERTICAL) {
      return `scale(1, ${fractionComplete})`;
    } else if (this.orientation === Orientation.HORIZONTAL) {
      return `scale(${fractionComplete}, 1)`;
    } else {
      return `scale(${fractionComplete}, ${fractionComplete})`;
    }
  }

  computeFractionComplete(element:HTMLElement):number {
    return null;
  }
}


text:
package org.apache.geode.internal.cache.wan;

import static org.apache.geode.distributed.ConfigurationProperties.DURABLE_CLIENT_ID;
import static org.apache.geode.distributed.ConfigurationProperties.DURABLE_CLIENT_TIMEOUT;
import static org.apache.geode.distributed.ConfigurationProperties.LOCATORS;
import static org.apache.geode.distributed.ConfigurationProperties.MCAST_PORT;
import static org.apache.geode.internal.AvailablePortHelper.getRandomAvailableTCPPort;
import static org.apache.geode.test.awaitility.GeodeAwaitility.await;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;

import java.io.IOException;
import java.util.List;
import java.util.Properties;

import org.junit.Test;
import org.junit.experimental.categories.Category;

import org.apache.geode.cache.CacheFactory;
import org.apache.geode.cache.DiskStore;
import org.apache.geode.cache.EvictionAction;
import org.apache.geode.cache.EvictionAttributes;
import org.apache.geode.cache.Region;
import org.apache.geode.cache.RegionAttributes;
import org.apache.geode.cache.RegionFactory;
import org.apache.geode.cache.RegionShortcut;
import org.apache.geode.cache.Scope;
import org.apache.geode.cache.client.Pool;
import org.apache.geode.cache.client.PoolManager;
import org.apache.geode.cache.server.CacheServer;
import org.apache.geode.cache.server.ClientSubscriptionConfig;
import org.apache.geode.distributed.internal.InternalDistributedSystem;
import org.apache.geode.internal.cache.CacheServerImpl;
import org.apache.geode.internal.cache.InternalCache;
import org.apache.geode.internal.cache.InternalCacheServer;
import org.apache.geode.internal.cache.ha.HAContainerRegion;
import org.apache.geode.internal.cache.tier.sockets.CacheClientNotifier;
import org.apache.geode.internal.cache.tier.sockets.CacheServerTestUtil;
import org.apache.geode.test.dunit.LogWriterUtils;
import org.apache.geode.test.dunit.SerializableRunnable;
import org.apache.geode.test.dunit.VM;
import org.apache.geode.test.junit.categories.WanTest;

@Category({WanTest.class})
public class CacheClientNotifierDistributedTest extends WANTestBase {

  private static final int NUM_KEYS = 10;

  private int createCacheServerWithCSC(VM vm, final boolean withCSC, final int capacity,
      final String policy, final String diskStoreName) {
    final int serverPort = getRandomAvailableTCPPort();

    SerializableRunnable createCacheServer = new SerializableRunnable() {
      @Override
      public void run() throws Exception {
        CacheServerImpl server = (CacheServerImpl) cache.addCacheServer();
        server.setPort(serverPort);
        if (withCSC) {
          if (diskStoreName != null) {
            DiskStore ds = cache.findDiskStore(diskStoreName);
            if (ds == null) {
              ds = cache.createDiskStoreFactory().create(diskStoreName);
            }
          }
          ClientSubscriptionConfig csc = server.getClientSubscriptionConfig();
          csc.setCapacity(capacity);
          csc.setEvictionPolicy(policy);
          csc.setDiskStoreName(diskStoreName);
          server.setHostnameForClients("localhost");
          // server.setGroups(new String[]{"serv"});
        }
        try {
          server.start();
        } catch (IOException e) {
          org.apache.geode.test.dunit.Assert.fail("Failed to start server ", e);
        }
      }
    };
    vm.invoke(createCacheServer);
    return serverPort;
  }

  private void checkCacheServer(VM vm, final int serverPort, final boolean withCSC,
      final int capacity) {
    SerializableRunnable checkCacheServer = new SerializableRunnable() {

      @Override
      public void run() throws Exception {
        List<InternalCacheServer> cacheServers =
            ((InternalCache) cache).getCacheServersAndGatewayReceiver();
        CacheServerImpl server = null;
        for (CacheServer cs : cacheServers) {
          if (cs.getPort() == serverPort) {
            server = (CacheServerImpl) cs;
            break;
          }
        }
        assertNotNull(server);
        CacheClientNotifier ccn = server.getAcceptor().getCacheClientNotifier();
        HAContainerRegion haContainer = (HAContainerRegion) ccn.getHaContainer();
        if (server.getAcceptor().isGatewayReceiver()) {
          assertNull(haContainer);
          return;
        }
        Region internalRegion = haContainer.getMapForTest();
        RegionAttributes ra = internalRegion.getAttributes();
        EvictionAttributes ea = ra.getEvictionAttributes();
        if (withCSC) {
          assertNotNull(ea);
          assertEquals(capacity, ea.getMaximum());
          assertEquals(EvictionAction.OVERFLOW_TO_DISK, ea.getAction());
        } else {
          assertNull(ea);
        }
      }
    };
    vm.invoke(checkCacheServer);
  }

  public static void closeACacheServer(final int serverPort) {
    List<CacheServer> cacheServers = cache.getCacheServers();
    CacheServerImpl server = null;
    for (CacheServer cs : cacheServers) {
      if (cs.getPort() == serverPort) {
        server = (CacheServerImpl) cs;
        break;
      }
    }
    assertNotNull(server);
    server.stop();
  }

  private void verifyRegionSize(VM vm, final int expect) {
    SerializableRunnable verifyRegionSize = new SerializableRunnable() {
      @Override
      public void run() throws Exception {
        final Region region = cache.getRegion(getTestMethodName() + "_PR");

        await().untilAsserted(() -> assertEquals(expect, region.size()));
      }
    };
    vm.invoke(verifyRegionSize);
  }

  /**
   * The test will start several cache servers, including gateway receivers. Shutdown them and
   * verify the CacheClientNotifier for each server is correct
   */
  @Test
  public void testNormalClient2MultipleCacheServer() throws Exception {
    doMultipleCacheServer(false);
  }

  public void doMultipleCacheServer(boolean durable) throws Exception {
    /* test scenario: */
    /* create 1 GatewaySender on vm5 */
    /* create 1 GatewayReceiver on vm2 */
    /* create 2 cache servers on vm2, one with overflow. */
    /* verify if the cache server2 still has the overflow attributes */
    /* create 1 cache client1 on vm3 to register interest on cache server1 */
    /* create 1 cache client2 on vm4 to register interest on cache server1 */
    /* do some puts to GatewaySender on vm5 */

    // start locators
    Integer lnPort = vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId(1));
    Integer nyPort = vm1.invoke(() -> WANTestBase.createFirstRemoteLocator(2, lnPort));

    // create receiver and cache servers will be at ny
    vm2.invoke(() -> WANTestBase.createCache(nyPort));
    int receiverPort = vm2.invoke(WANTestBase::createReceiver);
    checkCacheServer(vm2, receiverPort, false, 0);

    // create PR for receiver
    vm2.invoke(() -> WANTestBase.createPersistentPartitionedRegion(getTestMethodName() + "_PR",
        null, 1, 100, isOffHeap()));

    // create cache server1 with overflow
    int serverPort = createCacheServerWithCSC(vm2, true, 3, "entry", "DEFAULT");
    checkCacheServer(vm2, serverPort, true, 3);

    /*
     * GEODE-6344: not to create the 2nd cacheserver on the same jvm until refix of GEODE-1183,
     * otherwise the test might be hang
     * // create cache server 2
     * final int serverPort2 = createCacheServerWithCSC(vm2, false, 0, null, null);
     * // Currently, only the first cache server's overflow attributes will take effect
     * // It will be enhanced in GEODE-1102
     * checkCacheServer(vm2, serverPort2, true, 3);
     * LogService.getLogger().info("receiverPort=" + receiverPort + ",serverPort=" + serverPort
     * + ",serverPort2=" + serverPort2);
     */

    vm3.invoke(() -> createClientWithLocator(nyPort, "localhost", getTestMethodName() + "_PR",
        "123", durable));
    vm4.invoke(() -> createClientWithLocator(nyPort, "localhost", getTestMethodName() + "_PR",
        "124", durable));

    // create sender at ln
    vm5.invoke(() -> WANTestBase.createCache(lnPort));
    vm5.invoke(() -> WANTestBase.createSender("ln", 2, false, 100, 400, false, false, null, true));
    vm5.invoke(() -> WANTestBase.createPersistentPartitionedRegion(getTestMethodName() + "_PR",
        "ln", 1, 100, isOffHeap()));
    vm5.invoke(() -> WANTestBase.startSender("ln"));
    vm5.invoke(() -> WANTestBase.doPuts(getTestMethodName() + "_PR", NUM_KEYS));

    /* verify */
    verifyRegionSize(vm5, NUM_KEYS);
    verifyRegionSize(vm2, NUM_KEYS);
    verifyRegionSize(vm4, NUM_KEYS);
    verifyRegionSize(vm3, NUM_KEYS);

    /*
     * GEODE-6344
     * // close a cache server, then re-test
     * vm2.invoke(() -> closeACacheServer(serverPort2));
     */

    vm5.invoke(() -> WANTestBase.doPuts(getTestMethodName() + "_PR", NUM_KEYS * 2));

    /* verify */
    verifyRegionSize(vm5, NUM_KEYS * 2);
    verifyRegionSize(vm2, NUM_KEYS * 2);
    verifyRegionSize(vm4, NUM_KEYS * 2);
    verifyRegionSize(vm3, NUM_KEYS * 2);

    disconnectAllFromDS();
  }

  public static void createClientWithLocator(int port0, String host, String regionName,
      String clientId, boolean isDurable) {
    WANTestBase test = new WANTestBase();
    Properties props = test.getDistributedSystemProperties();
    props.setProperty(MCAST_PORT, "0");
    props.setProperty(LOCATORS, "");
    if (isDurable) {
      props.setProperty(DURABLE_CLIENT_ID, clientId);
      props.setProperty(DURABLE_CLIENT_TIMEOUT, "" + 200);
    }

    InternalDistributedSystem ds = test.getSystem(props);
    cache = CacheFactory.create(ds);

    assertNotNull(cache);
    CacheServerTestUtil.disableShufflingOfEndpoints();
    Pool p;
    try {
      p = PoolManager.createFactory().addLocator(host, port0).setPingInterval(250)
          .setSubscriptionEnabled(true).setSubscriptionRedundancy(-1).setSocketBufferSize(1000)
          .setMinConnections(6).setMaxConnections(10).setRetryAttempts(3).create(regionName);
    } finally {
      CacheServerTestUtil.enableShufflingOfEndpoints();
    }

    RegionFactory<?, ?> factory = cache.createRegionFactory(RegionShortcut.LOCAL)
        .setScope(Scope.DISTRIBUTED_NO_ACK)
        .setPoolName(p.getName());
    region = factory.create(regionName);
    region.registerInterestForAllKeys();
    assertNotNull(region);
    if (isDurable) {
      cache.readyForEvents();
    }
    LogWriterUtils.getLogWriter()
        .info("Distributed Region " + regionName + " created Successfully :" + region.toString()
            + " in a " + (isDurable ? "durable" : "") + " client");
  }
}


text:
package com.power.action;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.util.LinkedCaseInsensitiveMap;
import org.springframework.web.bind.annotation.RequestMapping;

import com.lys.mvc.action.BaseAjaxAction;
import com.lys.system.filter.SafetyFilter;
import com.lys.utils.BizTransUtil;
import com.lys.utils.CommonUtil;
import com.lys.utils.JsonUtils;
import com.lys.utils.StringUtils;
import com.power.bean.Aa_t_sysfunction;
import com.power.biz.CommonBiz;

@Scope(value = "prototype")
@Controller("SysfunctionAction")
@RequestMapping(value="/system/sysfunction")
public class SysfunctionAction extends BaseAjaxAction{
	@Resource(name="CommonBizCache")
	public CommonBiz commonBiz;//操作数据的对象biz

	/***
	 * 进入权限主界面
	 * @param req
	 * @return
	 */
	@RequestMapping(value="initSysfunction")
	public String initSysfunction(){
		StringBuffer sb=new StringBuffer("select a.aa_st_id TREEID,a.aa_nm_openorclose  as \"open\",a.aa_st_parent TREEPID,a.aa_st_title TREENAME,a.aa_nm_jdnum  as \"aa_nm_jdnum\",a.aa_st_sysmark as \"aa_st_sysmark\" from  aa_t_sysfunction a order by a.aa_nm_orderno asc");
		String json=JsonUtils.getJsonDataFromCollection(baseBiz.queryForList(sb.toString()));
		model.addAttribute("functionTree", json);
		return "system/sysfunction/sysfunctionList";
	}

	/**
	 * 添加权限
	 * @param response
	 * @param aa_t_sysfunction
	 */
	@RequestMapping(value="sysfunctionAddorupd")
	public void sysfunctionAddorupd(Aa_t_sysfunction aa_t_sysfunction){
		String jsonData="";
		try {
			//验证
			if(!org.springframework.util.StringUtils.hasText(aa_t_sysfunction.getAa_st_parent())){
				throw new RuntimeException("父节点不能为空!");
			}
			//修改
			if(org.springframework.util.StringUtils.hasText(aa_t_sysfunction.getAa_st_id())){
				Map<String,Object>  map=new LinkedCaseInsensitiveMap<Object>();
				map.put("aa_st_mark", aa_t_sysfunction.getAa_st_mark());
				map.put("aa_st_title", aa_t_sysfunction.getAa_st_title());
				map.put("aa_st_type", aa_t_sysfunction.getAa_st_type());
				map.put("aa_st_url", aa_t_sysfunction.getAa_st_url());
				map.put("aa_st_classUrl", aa_t_sysfunction.getAa_st_classUrl());
				map.put("aa_st_active", aa_t_sysfunction.getAa_st_active());
				map.put("aa_nm_openorclose", aa_t_sysfunction.getAa_nm_openorclose());
				map.put("aa_nm_orderno", aa_t_sysfunction.getAa_nm_orderno());
				map.put("aa_st_describe", aa_t_sysfunction.getAa_st_describe());
				map.put("aa_st_image", aa_t_sysfunction.getAa_st_image());
				map.put("aa_st_sysmark", aa_t_sysfunction.getAa_st_sysmark());
				map.put("aa_nm_jdnum", aa_t_sysfunction.getAa_nm_jdnum());
				map.put("aa_st_updUserId", getcuttSysuserID());//修改人ID
				map.put("aa_dt_updDate", getcuttDate());//修改时间
				map.put("aa_st_id", aa_t_sysfunction.getAa_st_id()); //ID
				map.put("aa_st_islog", aa_t_sysfunction.getAa_st_islog()); //日志记录
				Integer c=baseBiz.updateTRANS(map, Aa_t_sysfunction.class);
				if(c==1){
					jsonData = "{success:true,msg:\"修改成功!\",result:["+JsonUtils.getJsonData(aa_t_sysfunction)+"]}";
					commonBiz.delALLfunction();
				}else {
					jsonData = "{success:false,msg:\"修改失败!\"}";
				}
			}
			//新增
			else{
				//数据构造
				aa_t_sysfunction.setAa_st_id(StringUtils.getUUID32());
				aa_t_sysfunction.setAa_dt_addDate(getcuttDate());
				aa_t_sysfunction.setAa_st_addUserId(getcuttSysuserID());
				//执行保存
				if(baseBiz.addTRANS(aa_t_sysfunction)){
					//如果权限启用,则加入权限控制范围
					if("1".equals(aa_t_sysfunction.getAa_st_active())){
						if(commonBiz.addALLfunction(aa_t_sysfunction.getAa_st_classUrl(), aa_t_sysfunction.getAa_st_mark())){
							SafetyFilter.logger.info("权限集合更新:添加了一个权限 类路径="+aa_t_sysfunction.getAa_st_classUrl()+"  唯一标识="+aa_t_sysfunction.getAa_st_mark());
						}
					}
					jsonData = "{success:true,msg:\"添加成功!\",result:["+JsonUtils.getJsonData(aa_t_sysfunction)+"]}";
				}else{
					jsonData = "{success:false,msg:\"添加失败!\"}";
				}
			}
		} catch (Exception e) {
			jsonData = "{success:false,msg:\"保存异常,"+e.getMessage()+"!\"}";
			e.printStackTrace();
		}
		this.createAjax(response,jsonData);
	}

	/**
	 * 查询权限
	 * @param response
	 * @param aa_t_sysfunction
	 */
	@RequestMapping(value="sysfunctionFind")
	public void sysfunctionFind(Aa_t_sysfunction aa_t_sysfunction){
		if(aa_t_sysfunction!=null&&org.springframework.util.StringUtils.hasText(aa_t_sysfunction.getAa_st_id())){
			StringBuffer sb=new StringBuffer(" select a.aa_st_id as \"aa_st_id\",a.aa_st_active as \"aa_st_active\",a.aa_dt_addDate as \"aa_dt_addDate\",a.aa_st_addUserId as \"aa_st_addUserId\""
					+ ",a.aa_st_describe as \"aa_st_describe\",a.aa_st_mark as \"aa_st_mark\",a.aa_nm_openorclose as \"aa_nm_openorclose\",a.aa_nm_orderno as \"aa_nm_orderno\",a.aa_st_image as \"aa_st_image\""
					+ ",a.aa_st_parent as \"aa_st_parent\",a.aa_st_title as \"aa_st_title\",a.aa_st_type as \"aa_st_type\",(select aa_st_title from aa_t_sysfunction where  aa_st_id=a.aa_st_parent)  as \"aa_st_parentName\""
					+ ",a.aa_st_url as \"aa_st_url\",a.aa_st_classUrl as \"aa_st_classUrl\",a.aa_nm_jdnum as \"aa_nm_jdnum\",a.aa_st_sysmark as \"aa_st_sysmark\",a.aa_st_islog as \"aa_st_islog\" from  aa_t_sysfunction a ");
			sb.append(" where a.aa_st_id=? ");
			Map<String, Object> map=baseBiz.queryForMap(sb.toString(), new Object[]{aa_t_sysfunction.getAa_st_id()});
			String jsonData = "{\"success\":true,result:["+JsonUtils.getJsonData(map)+"]}";
			this.createAjax(response, jsonData);
		}
	}
	/**
	 * 删除权限
	 * @param response
	 * @param sysfunction
	 */
	@RequestMapping(value="sysfunctionDelete")
	public void sysfunctionDelete(String functionid,String parentid){
		String jsonData="";
		try {
			if(functionid!=null){
				if("null".equals(parentid)||"0".equals(parentid)||!org.springframework.util.StringUtils.hasText(parentid)){
					jsonData = "{success:false,msg:\"删除失败,不能删除根节点!\"}";
				}else{
					String[] ss=functionid.split(",");
					//批量执行的--事务执行--准备数据
					 List<BizTransUtil> transList=new ArrayList<BizTransUtil>();
					 transList.add(new BizTransUtil(StringUtils.getArrayByArray(ss), Aa_t_sysfunction.class));//删除权限
					 transList.add(new BizTransUtil("delete from ad_t_sysrolefunction where aa_st_id in("+StringUtils.toStringBySqlIn(ss)+")", new Object[]{}, CommonUtil.DELETE));//删除权限角色中间表对应数据
					 if(baseBiz.executesTRANS(transList)){
						 commonBiz.delALLfunction();
						 jsonData = "{success:true,msg:\"删除成功!\"}";
					 }else{
						 jsonData = "{success:false,msg:\"删除失败!\"}";
					 }
					jsonData = "{success:true,msg:\"删除成功!\"}";
				}
			}else{
				jsonData = "{success:false,msg:\"删除失败!\"}";
			}
		}catch (Exception e) {
			jsonData = "{success:false,msg:\"删除异常,"+e.getMessage()+"!\"}";
			e.printStackTrace();
		}
		this.createAjax(response, jsonData);
	}
}


text:
from google.analytics import admin_v1alpha

def sample_list_measurement_protocol_secrets():
    # Create a client
    client = admin_v1alpha.AnalyticsAdminServiceClient()

    # Initialize request argument(s)
    request = admin_v1alpha.ListMeasurementProtocolSecretsRequest(
        parent="parent_value",
    )

    # Make the request
    page_result = client.list_measurement_protocol_secrets(request=request)

    # Handle the response
    for response in page_result:
        print(response)

# [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListMeasurementProtocolSecrets_sync]


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Zyan.Communication.Toolbox
{
	public static partial class Extensions
	{
		/// <summary>
		/// Merges two sequences by using specified selector (missing in .NET Framework 3.5).
		/// </summary>
		/// <typeparam name="TFirst">First sequence element type.</typeparam>
		/// <typeparam name="TSecond">Second sequence element type.</typeparam>
		/// <typeparam name="TResult">Resulting sequence element type.</typeparam>
		/// <param name="first">First sequence.</param>
		/// <param name="second">Second sequence.</param>
		/// <param name="resultSelector">Selector function.</param>
		/// <returns></returns>
		public static IEnumerable<TResult> Zip<TFirst, TSecond, TResult>(
			this IEnumerable<TFirst> first,
			IEnumerable<TSecond> second,
			Func<TFirst, TSecond, TResult> resultSelector)
		{
			if (first == null)
				throw new ArgumentNullException("first");

			if (second == null)
				throw new ArgumentNullException("second");

			if (resultSelector == null)
				throw new ArgumentNullException("resultSelector");

			using (var e1 = first.GetEnumerator())
			using (var e2 = second.GetEnumerator())
			{
				while (e1.MoveNext() && e2.MoveNext())
					yield return resultSelector(e1.Current, e2.Current);
			}
		}
	}
}


text:
var stockNgControllers = angular.module('stockNgControllers', []);

stockNgControllers.controller('portfolioController', [
    '$scope',
    function($scope) {

      $scope.stock = {
        name: null
      };

      $scope.stocks = [];
      $scope.order_by = "name";

      $scope.submit = function() {
        if ($scope.stock.name) {
          $scope.stocks.push({name: $scope.stock.name});
          $scope.stock.name = '';
        }
      };
    }
]);

stockNgControllers.controller('mainController', [
    '$scope',
    function($scope) {
        $scope.name="Ted";
    }
]);


text:
<?php

namespace Zephir\Documentation\File;

use Zephir\ClassDefinition;

class SourceFile extends ClassFile
{
    /**
     * @var ClassDefinition
     */
    protected $class;

    public function getTemplateName()
    {
        return "source.phtml";
    }

    public function getOutputFile()
    {
        return \Zephir\Documentation::sourceUrl($this->class);
    }
}


text:
FROM openjdk:8-jre-alpine
LABEL maintainer="finchcn@gmail.com;ameizi<sxyx2008@163.com>"

RUN echo "http://mirrors.aliyun.com/alpine/v3.8/main" > /etc/apk/repositories \
    && echo "http://mirrors.aliyun.com/alpine/v3.8/community" >> /etc/apk/repositories \
    && apk update upgrade \
    && apk add --no-cache unzip

ARG VERSION
ENV VERSION $VERSION

COPY apollo-portal-${VERSION}-github.zip /apollo-portal/apollo-portal-${VERSION}-github.zip

RUN unzip /apollo-portal/apollo-portal-${VERSION}-github.zip -d /apollo-portal \
    && rm -rf /apollo-portal/apollo-portal-${VERSION}-github.zip \
    && chmod +x /apollo-portal/scripts/startup.sh

FROM openjdk:8-jre-alpine
LABEL maintainer="finchcn@gmail.com;ameizi<sxyx2008@163.com>"

ENV APOLLO_RUN_MODE "Docker"
ENV SERVER_PORT 8070

RUN echo "http://mirrors.aliyun.com/alpine/v3.8/main" > /etc/apk/repositories \
    && echo "http://mirrors.aliyun.com/alpine/v3.8/community" >> /etc/apk/repositories \
    && apk update upgrade \
    && apk add --no-cache procps curl bash tzdata \
    && ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
    && echo "Asia/Shanghai" > /etc/timezone

COPY --from=0 /apollo-portal /apollo-portal

EXPOSE $SERVER_PORT

CMD ["/apollo-portal/scripts/startup.sh"]


text:
package modtweaker;

import com.blamejared.ctgui.api.GuiRegistry;
import minetweaker.MineTweakerImplementationAPI;
import minetweaker.runtime.providers.ScriptProviderDirectory;
import modtweaker.mods.actuallyadditions.ActuallyAdditions;
import modtweaker.mods.appeng.AppliedEnergistics;
import modtweaker.mods.bloodmagic.BloodMagic;
import modtweaker.mods.botania.Botania;
import modtweaker.mods.chisel.Chisel;
import modtweaker.mods.extrautils.ExtraUtilities;
import modtweaker.mods.forestry.Forestry;
import modtweaker.mods.randomthings.RandomThings;
import modtweaker.mods.refinedstorage.RefinedStorage;
import modtweaker.mods.tconstruct.TConstruct;
import modtweaker.mods.embers.Embers;
import modtweaker.proxy.CommonProxy;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.common.*;
import net.minecraftforge.fml.common.Mod.*;
import net.minecraftforge.fml.common.event.*;
import net.minecraftforge.fml.relauncher.Side;
import org.apache.logging.log4j.*;

import java.io.File;
import java.util.Arrays;

@Mod(modid = ModProps.modid, version = ModProps.version, dependencies = ModProps.dependencies)
public class ModTweaker {

    public static Logger logger = LogManager.getLogger(ModProps.modid);

    @SidedProxy(clientSide = "modtweaker.proxy.ClientProxy", serverSide = "modtweaker.proxy.CommonProxy")
    public static CommonProxy proxy;

    @Instance(ModProps.modid)
    public ModTweaker instance;

    @EventHandler
    public void preInit(FMLPreInitializationEvent event) {
        logger.info("Starting PreInitialization for " + ModProps.modid);
        GuiRegistry.registerGui(Arrays.asList(3), new GuiHandlerMods());
    }

    @EventHandler
    public void init(FMLInitializationEvent event) {
        logger.info("Starting Initialization for " + ModProps.modid);
        TweakerPlugin.register("forestry", Forestry.class);
        TweakerPlugin.register("tconstruct", TConstruct.class);
        TweakerPlugin.register("randomthings", RandomThings.class);
        TweakerPlugin.register("Botania", Botania.class);
        TweakerPlugin.register("chisel", Chisel.class);
        TweakerPlugin.register("BloodMagic", BloodMagic.class);
        TweakerPlugin.register("actuallyadditions", ActuallyAdditions.class);
        TweakerPlugin.register("refinedstorage", RefinedStorage.class);
        TweakerPlugin.register("embers", Embers.class);

		TweakerPlugin.register("ExtraUtils2", ExtraUtilities.class);
		TweakerPlugin.register("appliedenergistics2", AppliedEnergistics.class);

        if(FMLCommonHandler.instance().getSide() == Side.CLIENT) {
            MinecraftForge.EVENT_BUS.register(new ClientEvents());
        }

        MineTweakerImplementationAPI.onReloadEvent(event1 -> proxy.registerCommands());

        File scripts = new File("scripts");
        if(!scripts.exists()) {
            scripts.mkdir();
        }
        MineTweakerImplementationAPI.setScriptProvider(new ScriptProviderDirectory(scripts));
    }

    @EventHandler
    public void postInit(FMLPostInitializationEvent event) {
        logger.info("Starting PostInitialization for " + ModProps.modid);
    }

    @EventHandler
    public void serverStart(FMLServerStartingEvent event) {
        logger.info("Starting ServerStart for " + ModProps.modid);
        proxy.registerCommands();

    }
}


text:
import java.io._
import java.util._

import scala.collection.JavaConversions._

object CIAWFBFixer extends App {

  val countriesToCoords = new HashMap[String, (Double, Double)]

  var country = ""
  for(line <- scala.io.Source.fromFile(args(0)).getLines) {
    if(line.endsWith(":")) {
      country = line.dropRight(1).toLowerCase
      if(country.equals("korea, south"))
        country = "south korea"
      else if(country.equals("korea, north"))
        country = "north korea"
      else if(line.contains(",")) {
        country = line.slice(0, line.indexOf(",")).toLowerCase
      }
      //println(country)
    }

    if(line.length >= 5 && line.startsWith(" ")) {
      val tokens = line.trim.split("[^0-9SWNE]+")
      if(tokens.length >= 6) {
        val lat = (tokens(0).toDouble + tokens(1).toDouble / 60.0) * (if(tokens(2).equals("S")) -1 else 1)
        val lon = (tokens(3).toDouble + tokens(4).toDouble / 60.0) * (if(tokens(5).equals("W")) -1 else 1)
        countriesToCoords.put(country, (lat, lon))

        if(country.contains("bosnia"))
          countriesToCoords.put("bosnia", (lat, lon))

        if(country.equals("yugoslavia"))
          countriesToCoords.put("serbia", (lat, lon))

        if(country.equals("holy see (vatican city)"))
          countriesToCoords.put("vatican", (lat, lon))
      }
    }
  }

  countriesToCoords.put("montenegro", (42.5,19.1)) // from Google

  //countriesToCoords.foreach(p => println(p._1 + " " + p._2._1 + "," + p._2._2))

  val lineRE = """^(.*lat=\")([^\"]+)(.*long=\")([^\"]+)(.*)$""".r
  //val line2RE = """^(.*long=\")([^\"]+)(.*lat=\")([^\"]+)(.*)$""".r
  //val lineRE = """^(.*lat=\")([^\"]+)(.*long=\")([^\"]+)(.*humanPath=\")([^\"]+)(.*)$""".r
  val countryNameRE = """^.*humanPath=\"([^\"]+).*$""".r

  val inDir = new File(if(args(1).endsWith("/")) args(1).dropRight(1) else args(1))
  val outDir = new File(if(args(2).endsWith("/")) args(2).dropRight(1) else args(2))
  for(file <- inDir.listFiles.filter(_.getName.endsWith(".xml"))) {

    val out = new BufferedWriter(new FileWriter(outDir+"/"+file.getName))

    /*var beg = ""
    var lat0 = ""
    var mid = ""
    var lon0 = ""
    var end = ""*/

    for(line <- scala.io.Source.fromFile(file).getLines) {
      if(line.contains("CIAWFB") && lineRE.findFirstIn(line) != None) {// && line.contains("long=\"-0\"")) {
        //line match {
          /*case lineRE => */val lineRE(beg, lat0, mid, lon0, end) = line//; beg = begr; lat0 = lat0r; mid = midr; lon0 = lon0r; end = endr;
          //case line2RE => val line2RE(begr, lon0r, midr, lat0r, endr) = line; beg = begr; lat0 = lat0r; mid = midr; lon0 = lon0r; end = endr;
        //}
        val countryNameRE(countryName) = line
        //val countryName = "hi"

        //println(line)

        var lat = lat0//.toDouble
        var lon = lon0//.toDouble
        if(countriesToCoords.contains(countryName.toLowerCase)) {
          lat = countriesToCoords(countryName.toLowerCase)._1.toString
          lon = countriesToCoords(countryName.toLowerCase)._2.toString
        }

        //if(countryName.toLowerCase.equals("vatican"))
        //  lat = countriesToCoords(countryName.toLowerCase)._1

        out.write(beg+lat+mid+lon+end+"\n")
        //println(beg+lat+mid+lon+humpath+countryName+end+"\n")
      }
      else
        out.write(line+"\n")
    }

    out.close
  }

}


text:
<TITLE>Review for Dream with the Fishes (1997)</TITLE>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/ramr.css">

Dream with the Fishes (1997)

reviewed by
David N. Butterworth

                               DREAM WITH THE FISHES
                       A film review by David N. Butterworth
          Copyright 1997 David N. Butterworth/The Summer Pennsylvanian

Rating: **1/2 (Maltin scale)

When you know you're going to die, the food looks better but you can't
smell it.

That's just one of the many bittersweet observations about death in "Dream
With the Fishes," writer Finn Taylor's offbeat directorial debut.  An
official selection at this year's Sundance Film Festival, the film can
easily be described as "promising."  Viewers with little sympathy for
missed opportunities, however, are likely to be more interested in Finn's
*next* project.

"Dream With the Fishes" is pretty quirky.  Much of its quirkiness is drawn
from the fact that its lead characters, Terry (a nervous, voyeuristic dweeb
solidly played by David Arquette) and Nick (awkwardly realized by Brad
Hunt), are both close to death.  When Nick--who's dying of some unspecified
disease--first meets Terry, Terry is about to commit suicide by jumping off
a bridge.  Rather than talking him out of it, Nick suggests a less messy
but ultimately unsuccessful alternative, and their evolving friendship
leads to a bizarre pact: if Terry will help Nick live out his fantasies
before his time is up, Nick will return the favor by killing him.

Taylor could have gone on a shopping spree with this setup.  Instead, he
tries to balance the story with a combination of offbeat and serio-tragic
episodes.  The quirky ones work: the two engage in some late night nude
bowling with a couple of hookers, for example.  The script's more serious
turns, unfortunately, don't.  When Nick returns to his childhood home in
order to make good on his estranged relationship with his father, their
conversation deteriorates into embarrassing cro-magnon hijinks.  It's
obvious that Taylor is less comfortable with these scenes of domestic
reconciliation than he is with his characters doing--and talking
about--wacky things.

A lot of the ground is familiar or just plain stolen (including a lottery
sequence lifted straight out of a "Full House" episode).  A psychic down at
Fisherman's Wharf tells Nick "you will be given the job of protecting all
the fishes."  This results in him, off-camera, stealing a fish, just the
one fish, from the local aquarium and letting it loose in the sea--huh?.
Often Nick asks Terry about fulfilling *his* fantasies too, but the best
Terry can come up with is "all you can eat Cracker Smacks."  A strange
response from a man we've already witnessed spying on Nick's tattoo artist
girlfriend, Liz (Kathryn Erbe) and other sad women through binoculars.

Grainily photographed (at least in the beginning; for some reason the
graininess disappears about halfway through the film--perhaps this is what
the Sundance people mean by a "lean style"), "Dream With the Fishes" offers
a wonderful soundtrack of tunes by the likes of the Waterboys, Squirrel Nut
Zippers, and Sun Volt that, unlike many pre-packaged indie song scores,
actually fits the mood.  Taylor also employs the splendid Cathy Moriarty as
Nick's Aunt Elise, a faded dancing queen, but her presence is another
example of unrealized promise.

Auspicious is too strong a word to describe the director's first effort,
for "Dream With the Fishes" gets by less on what might have been and more
on its implicit assurances of what's to come.

--
David N. Butterworth
dnb@mail.med.upenn.edu

The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).

The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.

Please direct comments/criticisms of the review to relevant newsgroups.

Broken URLs inthe reviews are the responsibility of the author.

The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.

Related links: index of all rec.arts.movies.reviews reviews


text:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--
  Copyright SemanticBits, Northwestern University and Akaza Research

  Distributed under the OSI-approved BSD 3-Clause License.
  See http://ncip.github.com/caaers/LICENSE.txt for details.
-->
<ruleSet xmlns="http://semanticbits.com/rules/brxml">
    <id>06e6ac1f-ea66-4bf1-9641-2caedcd0c5d3</id>
    <name>gov.nih.nci.cabig.caaers.rules.sponsor.aalborg_university_hospital.sae_reporting_rules</name>
    <description>SAE Reporting Rules</description>
    <subject>Sponsor rules||Aalborg University Hospital</subject>
    <coverage>Enabled</coverage>
    <import>gov.nih.nci.cabig.caaers.domain.*</import>
    <rule id="3301f5d9-64ec-4e08-9a1d-bee372ea4de1">
        <condition>
            <column display-uri="Adverse Event" object-type="gov.nih.nci.cabig.caaers.domain.AdverseEvent"
                    identifier="adverseEvent">
                <field-constraint grammer-postfix="" grammer-prefix=" Severity " display-uri="undefined"
                                  field-name="grade">
                    <literal-restriction display-uri="is " evaluator="==">
                        <value>2</value>
                        <readable-value>Grade 2</readable-value>
                    </literal-restriction>
                </field-constraint>
                <expression>
                    factResolver.assertFact(adverseEvent,'gov.nih.nci.cabig.caaers.domain.Grade','code','runTimeValue','runTimeOperator')
                </expression>
            </column>
            <column display-uri="Adverse Event" object-type="gov.nih.nci.cabig.caaers.domain.AdverseEvent"
                    identifier="adverseEvent">
                <field-constraint grammer-postfix="expected " grammer-prefix=" Adverse Event " display-uri="undefined"
                                  field-name="expectedness">
                    <literal-restriction display-uri="is " evaluator="==">
                        <value>true</value>
                        <readable-value>is</readable-value>
                    </literal-restriction>
                </field-constraint>
                <expression>factResolver.assertFact(adverseEvent,null,'expectedness','runTimeValue','runTimeOperator')
                </expression>
            </column>
            <column display-uri="Adverse Event" object-type="gov.nih.nci.cabig.caaers.domain.AdverseEvent"
                    identifier="adverseEvent">
                <field-constraint grammer-postfix="" grammer-prefix=" Hospitalization or Prolonged Hospitalization "
                                  display-uri="undefined" field-name="hospitalization">
                    <literal-restriction display-uri="is " evaluator="==">
                        <value>1</value>
                        <readable-value>Yes</readable-value>
                    </literal-restriction>
                </field-constraint>
                <expression>
                    factResolver.assertFact(adverseEvent,'gov.nih.nci.cabig.caaers.domain.Hospitalization','code','runTimeValue','runTimeOperator')
                </expression>
            </column>
            <column display-uri="Adverse Event" object-type="gov.nih.nci.cabig.caaers.domain.AdverseEvent"
                    identifier="adverseEvent">
                <field-constraint grammer-postfix=" "
                                  grammer-prefix=" Does this Adverse Event place participant at higher risk ?  "
                                  display-uri="undefined" field-name="participantAtRisk">
                    <literal-restriction display-uri="is " evaluator="==">
                        <value>true</value>
                        <readable-value>is true</readable-value>
                    </literal-restriction>
                </field-constraint>
                <expression>
                    factResolver.assertFact(adverseEvent,null,'participantAtRisk','runTimeValue','runTimeOperator')
                </expression>
            </column>
            <column display-uri="Adverse Event" object-type="gov.nih.nci.cabig.caaers.domain.AdverseEvent"
                    identifier="adverseEvent">
                <field-constraint grammer-postfix="" grammer-prefix=" Attribution " display-uri="undefined"
                                  field-name="attributionSummary">
                    <literal-restriction display-uri="is " evaluator="==">
                        <value>UNLIKELY</value>
                        <readable-value>Unlikely,</readable-value>
                    </literal-restriction>
                </field-constraint>
                <expression>
                    factResolver.assertFact(adverseEvent,'gov.nih.nci.cabig.caaers.domain.Attribution','name','runTimeValue','runTimeOperator')
                </expression>
            </column>
            <column display-uri="Adverse Event" object-type="gov.nih.nci.cabig.caaers.domain.AdverseEvent"
                    identifier="adverseEvent">
                <field-constraint grammer-postfix="" grammer-prefix=" Outcome Identifier " display-uri="undefined"
                                  field-name="outcomeIdentifier">
                    <literal-restriction display-uri="is " evaluator="==">
                        <value>2</value>
                        <readable-value>life-threatening,</readable-value>
                    </literal-restriction>
                </field-constraint>
                <expression>
                    factResolver.assertFact(adverseEvent,'gov.nih.nci.cabig.caaers.domain.OutcomeType','code','runTimeValue','runTimeOperator')
                </expression>
            </column>
        </condition>
        <action>IGNORE</action>
        <readableAction>IGNORE</readableAction>
        <metaData checkinComment="Initial Version"
                  packageName="gov.nih.nci.cabig.caaers.rules.sponsor.aalborg_university_hospital.sae_reporting_rules"
                  description="Setting Description since its mandatory by JBoss Repository config" name="Rule-1">
            <category>
                <path>CAAERS_BASE/SPONSOR/aalborg_university_hospital</path>
                <metaData name="sae_reporting_rules"/>
            </category>
        </metaData>
        <readableRule>
            <line>If</line>
            <line>     &nbsp;&nbsp;&nbsp; Severity is 'Grade 2'</line>
            <line>And</line>
            <line>     &nbsp;&nbsp;&nbsp; Adverse Event is 'is ' expected</line>
            <line>And</line>
            <line>     &nbsp;&nbsp;&nbsp; Hospitalization or Prolonged Hospitalization is 'Yes'</line>
            <line>And</line>
            <line>     &nbsp;&nbsp;&nbsp; Does this Adverse Event place participant at higher risk ? is 'is
                true'
            </line>
            <line>And</line>
            <line>     &nbsp;&nbsp;&nbsp; Attribution is 'Unlikely'</line>
            <line>And</line>
            <line>     &nbsp;&nbsp;&nbsp; Outcome Identifier is 'life-threatening'</line>
        </readableRule>
    </rule>
</ruleSet>


text:
from __future__ import annotations

from textwrap import dedent

import pytest

from pants.backend.python.dependency_inference import parse_python_dependencies
from pants.backend.python.dependency_inference.parse_python_dependencies import (
    ParsedPythonDependencies,
)
from pants.backend.python.dependency_inference.parse_python_dependencies import (
    ParsedPythonImportInfo as ImpInfo,
)
from pants.backend.python.dependency_inference.parse_python_dependencies import (
    ParsePythonDependenciesRequest,
)
from pants.backend.python.target_types import PythonSourceField, PythonSourceTarget
from pants.backend.python.util_rules import pex
from pants.backend.python.util_rules.interpreter_constraints import InterpreterConstraints
from pants.core.util_rules import stripped_source_files
from pants.engine.addresses import Address
from pants.testutil.python_interpreter_selection import (
    skip_unless_python27_present,
    skip_unless_python38_present,
    skip_unless_python39_present,
)
from pants.testutil.rule_runner import QueryRule, RuleRunner

@pytest.fixture
def rule_runner() -> RuleRunner:
    return RuleRunner(
        rules=[
            *parse_python_dependencies.rules(),
            *stripped_source_files.rules(),
            *pex.rules(),
            QueryRule(ParsedPythonDependencies, [ParsePythonDependenciesRequest]),
        ],
        target_types=[PythonSourceTarget],
    )

def assert_deps_parsed(
    rule_runner: RuleRunner,
    content: str,
    *,
    expected_imports: dict[str, ImpInfo] = {},
    expected_assets: list[str] = [],
    filename: str = "project/foo.py",
    constraints: str = ">=3.6",
    string_imports: bool = True,
    string_imports_min_dots: int = 2,
    assets: bool = True,
    assets_min_slashes: int = 1,
) -> None:
    rule_runner.set_options([], env_inherit={"PATH", "PYENV_ROOT", "HOME"})
    rule_runner.write_files(
        {
            "BUILD": f"python_source(name='t', source={repr(filename)})",
            filename: content,
        }
    )
    tgt = rule_runner.get_target(Address("", target_name="t"))
    result = rule_runner.request(
        ParsedPythonDependencies,
        [
            ParsePythonDependenciesRequest(
                tgt[PythonSourceField],
                InterpreterConstraints([constraints]),
                string_imports=string_imports,
                string_imports_min_dots=string_imports_min_dots,
                assets=assets,
                assets_min_slashes=assets_min_slashes,
            )
        ],
    )
    assert dict(result.imports) == expected_imports
    assert list(result.assets) == sorted(expected_assets)

def test_normal_imports(rule_runner: RuleRunner) -> None:
    content = dedent(
        """\
        from __future__ import print_function

        import os
        import os  # repeated to test the line number
        import os.path
        from typing import TYPE_CHECKING

        import requests

        import demo
        from project.demo import Demo
        from project.demo import OriginalName as Renamed
        import pragma_ignored  # pants: no-infer-dep
        from also_pragma_ignored import doesnt_matter  # pants: no-infer-dep
        from multiline_import1 import (
            not_ignored1,
            ignored1 as alias1,  # pants: no-infer-dep
            ignored2 as \\
                alias2,  # pants: no-infer-dep
            ignored3 as  # pants: no-infer-dep
                alias3,
            ignored4 as alias4, ignored4,  # pants: no-infer-dep
            not_ignored2, \\
            not_ignored3
        )
        from multiline_import2 import (ignored1,  # pants: no-infer-dep
            not_ignored)

        if TYPE_CHECKING:
            from project.circular_dep import CircularDep
        """
    )
    assert_deps_parsed(
        rule_runner,
        content,
        expected_imports={
            "__future__.print_function": ImpInfo(lineno=1, weak=False),
            "os": ImpInfo(lineno=3, weak=False),
            "os.path": ImpInfo(lineno=5, weak=False),
            "typing.TYPE_CHECKING": ImpInfo(lineno=6, weak=False),
            "requests": ImpInfo(lineno=8, weak=False),
            "demo": ImpInfo(lineno=10, weak=False),
            "project.demo.Demo": ImpInfo(lineno=11, weak=False),
            "project.demo.OriginalName": ImpInfo(lineno=12, weak=False),
            "multiline_import1.not_ignored1": ImpInfo(lineno=16, weak=False),
            "multiline_import1.not_ignored2": ImpInfo(lineno=23, weak=False),
            "multiline_import1.not_ignored3": ImpInfo(lineno=24, weak=False),
            "multiline_import2.not_ignored": ImpInfo(lineno=27, weak=False),
            "project.circular_dep.CircularDep": ImpInfo(lineno=30, weak=False),
        },
    )

def test_dunder_import_call(rule_runner: RuleRunner) -> None:
    content = dedent(
        """\
        __import__("pkg_resources")
        __import__("dunder_import_ignored")  # pants: no-infer-dep
        __import__(  # pants: no-infer-dep
            "not_ignored_but_looks_like_it_could_be"
        )
        __import__(
            "ignored"  # pants: no-infer-dep
        )
        __import__(
            "also_not_ignored_but_looks_like_it_could_be"
        )  # pants: no-infer-dep
        __import__(
            "ignored_too" \\
            # pants: no-infer-dep
        )
        __import__(
            "ignored_as_well" \\
        )  # pants: no-infer-dep
        """
    )
    assert_deps_parsed(
        rule_runner,
        content,
        expected_imports={
            "pkg_resources": ImpInfo(lineno=1, weak=False),
            "not_ignored_but_looks_like_it_could_be": ImpInfo(lineno=4, weak=False),
            "also_not_ignored_but_looks_like_it_could_be": ImpInfo(lineno=10, weak=False),
        },
    )

def test_try_except(rule_runner: RuleRunner) -> None:
    content = dedent(
        """\
        try: import strong1
        except AssertionError: pass

        try: import weak1
        except ImportError: pass

        try: import weak2
        except (AssertionError, ImportError): pass

        try: import weak3
        except [AssertionError, ImportError]: pass

        try: import weak4
        except {AssertionError, ImportError}: pass
        except ImportError: pass

        try: import weak5
        except AssertionError: pass
        except ImportError: pass

        try: import weak6
        except AssertionError: import strong2
        except ImportError: import strong3
        else: import strong4
        finally: import strong5

        try: pass
        except AssertionError:
            try: import weak7
            except ImportError: import strong6

        try: import strong7
        # This would be too complicated to try and handle
        except (lambda: ImportError)(): pass

        ImpError = ImportError
        try: import strong8
        # This would be too complicated to try and handle
        except ImpError: pass

        # At least one test with import on its own line
        try:
            import weak8
        except ImportError:
            import strong9
        """
    )
    assert_deps_parsed(
        rule_runner,
        content,
        expected_imports={
            "strong1": ImpInfo(lineno=1, weak=False),
            "weak1": ImpInfo(lineno=4, weak=True),
            "weak2": ImpInfo(lineno=7, weak=True),
            "weak3": ImpInfo(lineno=10, weak=True),
            "weak4": ImpInfo(lineno=13, weak=True),
            "weak5": ImpInfo(lineno=17, weak=True),
            "weak6": ImpInfo(lineno=21, weak=True),
            "strong2": ImpInfo(lineno=22, weak=False),
            "strong3": ImpInfo(lineno=23, weak=False),
            "strong4": ImpInfo(lineno=24, weak=False),
            "strong5": ImpInfo(lineno=25, weak=False),
            "weak7": ImpInfo(lineno=29, weak=True),
            "strong6": ImpInfo(lineno=30, weak=False),
            "strong7": ImpInfo(lineno=32, weak=False),
            "strong8": ImpInfo(lineno=37, weak=False),
            "weak8": ImpInfo(lineno=43, weak=True),
            "strong9": ImpInfo(lineno=45, weak=False),
        },
    )

@pytest.mark.parametrize("basename", ["foo.py", "__init__.py"])
def test_relative_imports(rule_runner: RuleRunner, basename: str) -> None:
    content = dedent(
        """\
        from . import sibling
        from .sibling import Nibling
        from .subdir.child import Child
        from ..parent import Parent
        from ..parent import (
            Parent1,
            Guardian as Parent2
        )
        """
    )
    assert_deps_parsed(
        rule_runner,
        content,
        filename=f"project/util/{basename}",
        expected_imports={
            "project.util.sibling": ImpInfo(lineno=1, weak=False),
            "project.util.sibling.Nibling": ImpInfo(lineno=2, weak=False),
            "project.util.subdir.child.Child": ImpInfo(lineno=3, weak=False),
            "project.parent.Parent": ImpInfo(lineno=4, weak=False),
            "project.parent.Parent1": ImpInfo(lineno=6, weak=False),
            "project.parent.Guardian": ImpInfo(lineno=7, weak=False),
        },
    )

@pytest.mark.parametrize("min_dots", [1, 2, 3, 4])
def test_imports_from_strings(rule_runner: RuleRunner, min_dots: int) -> None:
    content = dedent(
        """\
        modules = [
            # Potentially valid strings (depending on min_dots).
            'a.b',
            'a.Foo',
            'a.b.d',
            'a.b2.d',
            'a.b.c.Foo',
            'a.b.c.d.Foo',
            'a.b.c.d.FooBar',
            'a.b.c.d.e.f.g.Baz',
            'a.b_c.d._bar',
            'a.b2.c.D',
            'a.b.c_狗',

            # Definitely invalid strings
            '..a.b.c.d',
            'a.B.d',
            'a.2b.d',
            'a..b..c',
            'a.b.c.d.2Bar',
            'a.b_c.D.bar',
            'a.b_c.D.Bar',
            'a.2b.c.D',
        ]

        for module in modules:
            importlib.import_module(module)
        """
    )

    potentially_valid = {
        "a.b": ImpInfo(lineno=3, weak=True),
        "a.Foo": ImpInfo(lineno=4, weak=True),
        "a.b.d": ImpInfo(lineno=5, weak=True),
        "a.b2.d": ImpInfo(lineno=6, weak=True),
        "a.b.c.Foo": ImpInfo(lineno=7, weak=True),
        "a.b.c.d.Foo": ImpInfo(lineno=8, weak=True),
        "a.b.c.d.FooBar": ImpInfo(lineno=9, weak=True),
        "a.b.c.d.e.f.g.Baz": ImpInfo(lineno=10, weak=True),
        "a.b_c.d._bar": ImpInfo(lineno=11, weak=True),
        "a.b2.c.D": ImpInfo(lineno=12, weak=True),
        "a.b.c_狗": ImpInfo(lineno=13, weak=True),
    }
    expected = {sym: info for sym, info in potentially_valid.items() if sym.count(".") >= min_dots}

    assert_deps_parsed(
        rule_runner, content, expected_imports=expected, string_imports_min_dots=min_dots
    )
    assert_deps_parsed(rule_runner, content, string_imports=False, expected_imports={})

def test_real_import_beats_string_import(rule_runner: RuleRunner) -> None:
    assert_deps_parsed(
        rule_runner,
        "import one.two.three; 'one.two.three'",
        expected_imports={"one.two.three": ImpInfo(lineno=1, weak=False)},
    )

def test_real_import_beats_tryexcept_import(rule_runner: RuleRunner) -> None:
    assert_deps_parsed(
        rule_runner,
        dedent(
            """\
                import one.two.three
                try: import one.two.three
                except ImportError: pass
            """
        ),
        expected_imports={"one.two.three": ImpInfo(lineno=1, weak=False)},
    )

def test_gracefully_handle_syntax_errors(rule_runner: RuleRunner) -> None:
    assert_deps_parsed(rule_runner, "x =", expected_imports={})

def test_handle_unicode(rule_runner: RuleRunner) -> None:
    assert_deps_parsed(rule_runner, "x = 'äbç'", expected_imports={})

@skip_unless_python27_present
def test_works_with_python2(rule_runner: RuleRunner) -> None:
    content = dedent(
        """\
        # -*- coding: utf-8 -*-
        print "Python 2 lives on."

        import demo
        from project.demo import Demo

        __import__(u"pkg_resources")
        __import__(b"treat.as.a.regular.import.not.a.string.import")
        __import__(u"{}".format("interpolation"))

        importlib.import_module(b"dep.from.bytes")
        importlib.import_module(u"dep.from.str")
        importlib.import_module(u"dep.from.str_狗")

        b"\\xa0 a non-utf8 string, make sure we ignore it"

        try: import weak1
        except ImportError: import strong1
        else: import strong2
        finally: import strong3
        """
    )
    assert_deps_parsed(
        rule_runner,
        content,
        constraints="==2.7.*",
        expected_imports={
            "demo": ImpInfo(lineno=4, weak=False),
            "project.demo.Demo": ImpInfo(lineno=5, weak=False),
            "pkg_resources": ImpInfo(lineno=7, weak=False),
            "treat.as.a.regular.import.not.a.string.import": ImpInfo(lineno=8, weak=False),
            "dep.from.bytes": ImpInfo(lineno=11, weak=True),
            "dep.from.str": ImpInfo(lineno=12, weak=True),
            "dep.from.str_狗": ImpInfo(lineno=13, weak=True),
            "weak1": ImpInfo(lineno=17, weak=True),
            "strong1": ImpInfo(lineno=18, weak=False),
            "strong2": ImpInfo(lineno=19, weak=False),
            "strong3": ImpInfo(lineno=20, weak=False),
        },
    )

@skip_unless_python38_present
def test_works_with_python38(rule_runner: RuleRunner) -> None:
    content = dedent(
        """\
        is_py38 = True
        if walrus := is_py38:
            print(walrus)

        import demo
        from project.demo import Demo

        __import__("pkg_resources")
        __import__("treat.as.a.regular.import.not.a.string.import")

        importlib.import_module("dep.from.str")
        """
    )
    assert_deps_parsed(
        rule_runner,
        content,
        constraints=">=3.8",
        expected_imports={
            "demo": ImpInfo(lineno=5, weak=False),
            "project.demo.Demo": ImpInfo(lineno=6, weak=False),
            "pkg_resources": ImpInfo(lineno=8, weak=False),
            "treat.as.a.regular.import.not.a.string.import": ImpInfo(lineno=9, weak=False),
            "dep.from.str": ImpInfo(lineno=11, weak=True),
        },
    )

@skip_unless_python39_present
def test_works_with_python39(rule_runner: RuleRunner) -> None:
    content = dedent(
        """\
        # This requires the new PEG parser.
        with (
            open("/dev/null") as f,
        ):
            pass

        import demo
        from project.demo import Demo

        __import__("pkg_resources")
        __import__("treat.as.a.regular.import.not.a.string.import")

        importlib.import_module("dep.from.str")
        """
    )
    assert_deps_parsed(
        rule_runner,
        content,
        constraints=">=3.9",
        expected_imports={
            "demo": ImpInfo(lineno=7, weak=False),
            "project.demo.Demo": ImpInfo(lineno=8, weak=False),
            "pkg_resources": ImpInfo(lineno=10, weak=False),
            "treat.as.a.regular.import.not.a.string.import": ImpInfo(lineno=11, weak=False),
            "dep.from.str": ImpInfo(lineno=13, weak=True),
        },
    )

@pytest.mark.parametrize("min_slashes", [1, 2, 3, 4])
def test_assets(rule_runner: RuleRunner, min_slashes: int) -> None:
    content = dedent(
        """\
        modules = [
            # Potentially valid assets (depending on min_slashes).
            'data/a.json',
            'data/a.txt',
            'data/a.tar.gz',
            'data/subdir1/a.json',
            'data/subdir1/a-b.json',
            'data/subdir1/subdir2/a.json',
            'data/subdir1/subdir2/subdir3/a.json',
            '狗/狗.狗',

            # Looks weird, but Unix and pathlib treat repeated "/" as one slash.
            # Our parsing, however considers this as multiple slashes.
            '//foo.bar',
            '//foo/////bar.txt',

            # Probably invalid assets.
            'noslashes',
            'data/database',  # Unfortunately, extenionless files don't get matched.

            # Definitely invalid assets.
            'a/........',
            '\\n/foo.json',
            'data/a.b/c.d',
            'windows\\style.txt',
        ]
        """
    )

    potentially_valid = {
        "data/a.json",
        "data/a.txt",
        "data/a.tar.gz",
        "data/subdir1/a.json",
        "data/subdir1/a-b.json",
        "data/subdir1/subdir2/a.json",
        "data/subdir1/subdir2/subdir3/a.json",
        "狗/狗.狗",
        "//foo.bar",
        "//foo/////bar.txt",
    }
    expected = [s for s in potentially_valid if s.count("/") >= min_slashes]

    assert_deps_parsed(
        rule_runner, content, expected_assets=expected, assets_min_slashes=min_slashes
    )
    assert_deps_parsed(rule_runner, content, assets=False, expected_assets=[])


text:
<GeoServerTileLayer>
  <id>LayerGroupInfoImpl--570ae188:124761b8d78:-7fab</id>
  <enabled>true</enabled>
  <name>spearfish</name>
  <mimeFormats>
    <string>image/jpeg</string>
    <string>image/png</string>
  </mimeFormats>
  <gridSubsets>
    <gridSubset>
      <gridSetName>EPSG:900913</gridSetName>
    </gridSubset>
    <gridSubset>
      <gridSetName>EPSG:4326</gridSetName>
    </gridSubset>
  </gridSubsets>
  <metaWidthHeight>
    <int>4</int>
    <int>4</int>
  </metaWidthHeight>
  <parameterFilters/>
  <gutter>0</gutter>
</GeoServerTileLayer>


text:
import tornado.web
from tornado.escape import json_encode

def web_ret(err_code=0, err_msg=''):
    d = { 'err_code': err_code,
          'err_msg': err_msg,
          'result': {}
          }
    return d

def jsonify(func):
    def wrapper(*args, **kwargs):
        handler = args[0]
        v = func(*args, **kwargs)
        handler.set_header("Content-Type", "application/json")
        handler.write(json_encode(v))

    return wrapper

class BaseHandler(tornado.web.RequestHandler):
    pass

def build_route():
    from .page import IndexHandler
    from .store import UploadHandler, GetFileHandler
    return [
        (r'/', IndexHandler),
        (r'/([\w]+)/upload/$', UploadHandler),
        (r'/([\w]+)/([\w-]+)/?$', GetFileHandler),
        ]


text:
package com.davidsoergel.dsutils;

/**
 * @author David Soergel
 * @version $Id$
 */
public interface HasReleaseableResources
	{
	public void releaseCachedResources();
	}


text:
"""The module provides constants for GGRC's roles."""

# global roles
NO_ROLE = "No role"
ADMIN = "Admin"
CREATOR = "Creator"
READER = "Reader"
EDITOR = "Editor"
ADMINISTRATOR = "Administrator"
# program roles
PROGRAM_EDITOR = "Program Editor"
PROGRAM_MANAGER = "Program Manager"
PROGRAM_READER = "Program Reader"
# workflow roles
WORKFLOW_MEMBER = "Workflow Member"
WORKFLOW_MANAGER = "Workflow Manager"
# other roles
OBJECT_OWNERS = "Object Owners"
AUDIT_LEAD = "Audit Lead"
AUDITORS = "Auditors"
PRINCIPAL_ASSIGNEE = "Principal Assignee"
SECONDARY_ASSIGNEE = "Secondary Assignee"
PRIMARY_CONTACT = "Primary Contact"
SECONDARY_CONTACT = "Secondary Contact"

# user names
DEFAULT_USER = "Example User"

# role scopes
SYSTEM = "System"
PRIVATE_PROGRAM = "Private Program"
WORKFLOW = "Workflow"
SUPERUSER = "Superuser"


text:
numpy.dtype.name
================

.. currentmodule:: numpy

.. autoattribute:: dtype.name


text:
namespace Decent.Minecraft.Client.Blocks
{
    public class Bricks : Block
    {
        public Bricks() : base(BlockType.Bricks) { }
    }
}


text:
import React, { Component, PropTypes } from 'react'
import FormGroup from 'App/components/FormGroup'

class LoginView extends Component {
  static propTypes = {
    onSubmit: PropTypes.func.isRequired,
  }

  constructor(props) {
    super(props)

    this.state = {
      username: '',
      password: '',
    }

    this.handleChangeUsername = this.handleChangeUsername.bind(this)
    this.handleChangePassword = this.handleChangePassword.bind(this)
    this.handleSubmit = this.handleSubmit.bind(this)
  }

  validateUsername = (username) => {
    if (!username.length) {
      return 'Username is required.'
    }
    return true
  }

  validatePassword = (password) => {
    if (!password.length) {
      return 'Password is required.'
    }
    return true
  }

  handleChangeUsername(username) {
    this.setState({
      username,
    })
  }

  handleChangePassword(password) {
    this.setState({
      password,
    })
  }

  handleSubmit(event) {
    event.preventDefault()

    const { username, password } = this.state
    this.props.onSubmit(username, password)
  }

  render() {
    const isUsernameValid = this.validateUsername(this.state.username)
    const isPasswordValid = this.validatePassword(this.state.password)
    const isSubmitDisabled = isUsernameValid !== true || isPasswordValid !== true

    return (

Login

              <form className="form-horizontal" onSubmit={this.handleSubmit}>
                <FormGroup
                  type="text"
                  id="username"
                  label="Username"
                  validate={this.validateUsername}
                  onChange={this.handleChangeUsername}
                />
                <FormGroup
                  type="password"
                  id="password"
                  label="Password"
                  validate={this.validatePassword}
                  onChange={this.handleChangePassword}
                />

                    <button type="submit" className="btn btn-default" disabled={isSubmitDisabled}>Login</button>

              </form>

    )
  }
}

export default LoginView