text:
@implementation ImageLoader

-(void) downloadSymbols
{
    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *documentsDirectory = [paths firstObject];
    NSString *path = [documentsDirectory stringByAppendingPathComponent:@"/images-raw/mana"];

    [self createDir:path];

    for (NSString *mana in kManaSymbols)
    {
        NSString *dirPath = [path stringByAppendingPathComponent:[NSString stringWithFormat:@"/%@", mana]];
        [self createDir:dirPath];

        for (NSString *size in kImageSizes)
        {
            NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"http://mtgimage.com/symbol/mana/%@/%@.png", mana, size]];
            NSString *filePath = [dirPath stringByAppendingPathComponent:[NSString stringWithFormat:@"/%@.png", size]];

            if (![[NSFileManager defaultManager] fileExistsAtPath:filePath])
            {
                NSLog(@"Downloading... %@", url);
                [JJJUtil downloadResource:url toPath:filePath];
            }
        }
    }
}

-(void) downloadOtherSymbols
{
    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *documentsDirectory = [paths objectAtIndex:0];
    NSString *path = [documentsDirectory stringByAppendingPathComponent:@"/images-raw/other"];

    [self createDir:path];

    for (NSString *other in kOtherSymbols)
    {
        NSString *dirPath = [path stringByAppendingPathComponent:[NSString stringWithFormat:@"/%@", other]];
        [self createDir:dirPath];

        for (NSString *size in kImageSizes)
        {
            NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"http://mtgimage.com/symbol/other/%@/%@.png", other, size]];
            NSString *filePath = [dirPath stringByAppendingPathComponent:[NSString stringWithFormat:@"/%@.png", size]];

            if (![[NSFileManager defaultManager] fileExistsAtPath:filePath])
            {
                NSLog(@"Downloading... %@", url);
                [JJJUtil downloadResource:url toPath:filePath];
            }
        }
    }
}

-(void) downloadAllSets
{
    [[Database sharedInstance] setupDb];

    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *documentsDirectory = [paths objectAtIndex:0];
    NSString *path = [documentsDirectory stringByAppendingPathComponent:@"/images-raw/set"];
    NSArray *rarities = @[@"C", @"U", @"R", @"M", @"S"];

    [self createDir:path];

    for (DTSet *set in [DTSet MR_findAllSortedBy:@"releaseDate" ascending:YES])
    {
        NSString *setPath = [path stringByAppendingPathComponent:[NSString stringWithFormat:@"/%@", set.code]];
        [self createDir:setPath];

        for (NSString *rarity in rarities)
        {
            NSString *rarityPath = [setPath stringByAppendingPathComponent:[NSString stringWithFormat:@"/%@", rarity]];
            [self createDir:rarityPath];

            for (NSString *size in kImageSizes)
            {
                NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"http://mtgimage.com/symbol/set/%@/%@/%@.png", set.code, rarity, size]];
                NSString *filePath = [rarityPath stringByAppendingPathComponent:[NSString stringWithFormat:@"/%@.png", size]];

                if (![[NSFileManager defaultManager] fileExistsAtPath:filePath])
                {
                    NSLog(@"Downloading... %@", url);
                    [JJJUtil downloadResource:url toPath:filePath];
                }
            }

            //delete if empty
            NSArray *listOfFiles = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:rarityPath error:nil];
            if (listOfFiles.count == 0)
            {
                [[NSFileManager defaultManager] removeItemAtPath:rarityPath error:nil];
            }
        }
    }

    [[Database sharedInstance] closeDb];
}

-(void) downloadSetIcons:(NSArray*) arrSetCodes
{
    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *documentsDirectory = [paths objectAtIndex:0];
    NSString *path = [documentsDirectory stringByAppendingPathComponent:@"/images-raw/set"];
    NSArray *rarities = @[@"C", @"U", @"R", @"M", @"S"];

    [self createDir:path];

    for (NSString *setCode in arrSetCodes)
    {
        NSString *setPath = [path stringByAppendingPathComponent:[NSString stringWithFormat:@"/%@", setCode]];
        [self createDir:setPath];

        for (NSString *rarity in rarities)
        {
            NSString *rarityPath = [setPath stringByAppendingPathComponent:[NSString stringWithFormat:@"/%@", rarity]];
            [self createDir:rarityPath];

            for (NSString *size in kImageSizes)
            {
                NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"http://mtgimage.com/symbol/set/%@/%@/%@.png", setCode, rarity, size]];
                NSString *filePath = [rarityPath stringByAppendingPathComponent:[NSString stringWithFormat:@"/%@.png", size]];

                if (![[NSFileManager defaultManager] fileExistsAtPath:filePath])
                {
                    NSLog(@"Downloading... %@", url);
                    [JJJUtil downloadResource:url toPath:filePath];
                }
            }

            //delete if empty
            NSArray *listOfFiles = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:rarityPath error:nil];
            if (listOfFiles.count == 0)
            {
                [[NSFileManager defaultManager] removeItemAtPath:rarityPath error:nil];
            }
        }
    }
}

-(void) downloadCards
{
    [[Database sharedInstance] setupDb];

    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *documentsDirectory = [paths objectAtIndex:0];
    NSString *path = [documentsDirectory stringByAppendingPathComponent:@"/images-raw/card"];

    [self createDir:path];

    for (DTSet *set in [DTSet MR_findAllSortedBy:@"releaseDate" ascending:YES])
    {
        NSString *setPath = [path stringByAppendingPathComponent:[NSString stringWithFormat:@"/%@", set.code]];

        if ([[NSFileManager defaultManager] fileExistsAtPath:setPath])
        {
            continue;
        }

        else
        {
            [self createDir:setPath];

            for (DTCard *card in set.cards)
            {

                NSString *filePath = [setPath stringByAppendingPathComponent:[NSString stringWithFormat:@"/%@.hq.jpg", card.imageName]];
                NSURL *url;

                if (![[NSFileManager defaultManager] fileExistsAtPath:filePath])
                {
                    url = [NSURL URLWithString:[[NSString stringWithFormat:@"http://mtgimage.com/set/%@/%@.hq.jpg", set.code, card.name] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];

                    NSLog(@"Downloading... %@", url);
                    [JJJUtil downloadResource:url toPath:filePath];
                }

                filePath = [setPath stringByAppendingPathComponent:[NSString stringWithFormat:@"/%@.crop.jpg", card.imageName]];
                if (![[NSFileManager defaultManager] fileExistsAtPath:filePath])
                {
                    url = [NSURL URLWithString:[[NSString stringWithFormat:@"http://mtgimage.com/set/%@/%@.crop.jpg", set.code, card.name] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];

                    NSLog(@"Downloading... %@", url);
                    [JJJUtil downloadResource:url toPath:filePath];
                }
            }

            //delete if empty
            NSArray *listOfFiles = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:setPath error:nil];
            if (listOfFiles.count == 0)
            {
                [[NSFileManager defaultManager] removeItemAtPath:setPath error:nil];
            }
        }
    }

    [[Database sharedInstance] closeDb];
}

-(void) convertCardsToLowResolution
{
    NSDate *dateStart = [NSDate date];

    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *documentsDirectory = [paths objectAtIndex:0];
    NSString *inputDir = [documentsDirectory stringByAppendingPathComponent:@"/images-raw/card"];
    NSString *cardDir = [documentsDirectory stringByAppendingPathComponent:@"/images-low/card"];

    for (NSString *dir in [[NSFileManager defaultManager] contentsOfDirectoryAtPath:inputDir error:nil])
    {
        NSString *inputPath = [inputDir stringByAppendingPathComponent:[NSString stringWithFormat:@"/%@", dir]];
        NSString *cardPath = [cardDir stringByAppendingPathComponent:[NSString stringWithFormat:@"/%@", dir]];

        for (NSString *file in [[NSFileManager defaultManager] contentsOfDirectoryAtPath:inputPath error:nil])
        {
            NSString *input = [inputPath stringByAppendingPathComponent:[NSString stringWithFormat:@"/%@", file]];
            NSImage *image = [[NSImage alloc] initWithContentsOfFile:input];
            NSString *output;
            CGFloat quality = 0;

            if ([file rangeOfString:@".hq.jpg"].location != NSNotFound)
            {
                output = [cardPath stringByAppendingPathComponent:[NSString stringWithFormat:@"/%@", [file stringByReplacingOccurrencesOfString:@".hq.jpg" withString:@".jpg"]]];
                quality = image.size.width >= 480 ? 50 : 100;
            }

            if (![[NSFileManager defaultManager] fileExistsAtPath:cardPath])
            {
                [self createDir:cardPath];
            }

            if (output && ![[NSFileManager defaultManager] fileExistsAtPath:output])
            {
                if (quality == 100)
                {
                    NSLog(@"copy %@ to %@", input, output);
                    [[NSFileManager defaultManager] copyItemAtPath:input toPath:output error:nil];
                }
                else
                {
                    [JJJUtil  runCommand:[NSString stringWithFormat:@"convert \"%@\" -strip -quality %.2f \"%@\"", input, quality, output]];
                }
            }
        }
    }

    NSDate *dateEnd = [NSDate date];
    NSTimeInterval timeDifference = [dateEnd timeIntervalSinceDate:dateStart];
    NSLog(@"Started: %@", dateStart);
    NSLog(@"Ended: %@", dateEnd);
    NSLog(@"Time Elapsed: %@",  [JJJUtil formatInterval:timeDifference]);
}

-(void) resizeCrops
{
    NSDate *dateStart = [NSDate date];

    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *documentsDirectory = [paths objectAtIndex:0];
    NSString *inputDir = [documentsDirectory stringByAppendingPathComponent:@"/images-raw/card"];
    NSString *cropDir = [documentsDirectory stringByAppendingPathComponent:@"/images-low/crop"];

    for (NSString *dir in [[NSFileManager defaultManager] contentsOfDirectoryAtPath:inputDir error:nil])
    {
        NSString *inputPath = [inputDir stringByAppendingPathComponent:[NSString stringWithFormat:@"/%@", dir]];
        NSString *cropPath = [cropDir stringByAppendingPathComponent:[NSString stringWithFormat:@"/%@", dir]];

        for (NSString *file in [[NSFileManager defaultManager] contentsOfDirectoryAtPath:inputPath error:nil])
        {
            NSString *input = [inputPath stringByAppendingPathComponent:[NSString stringWithFormat:@"/%@", file]];
            NSString *output;
            NSString *output2x;

            if ([file rangeOfString:@".crop.jpg"].location != NSNotFound)
            {
                output = [cropPath stringByAppendingPathComponent:[NSString stringWithFormat:@"/%@", [file stringByReplacingOccurrencesOfString:@".crop.jpg" withString:@".jpg"]]];
                output2x = [cropPath stringByAppendingPathComponent:[NSString stringWithFormat:@"/%@", [file stringByReplacingOccurrencesOfString:@".crop.jpg" withString:@"@2x.jpg"]]];
            }

            if (![[NSFileManager defaultManager] fileExistsAtPath:cropPath])
            {
                [self createDir:cropPath];
            }

//            if (output && ![[NSFileManager defaultManager] fileExistsAtPath:output])
//            {
//                [JJJUtil  runCommand:[NSString stringWithFormat:@"convert \"%@\" -resize 40x40 \"%@\"", input, output]];
//            }
            if (output2x && ![[NSFileManager defaultManager] fileExistsAtPath:output2x])
            {
                [JJJUtil  runCommand:[NSString stringWithFormat:@"convert \"%@\" -resize 80x80 \"%@\"", input, output2x]];
            }
        }
    }

    NSDate *dateEnd = [NSDate date];
    NSTimeInterval timeDifference = [dateEnd timeIntervalSinceDate:dateStart];
    NSLog(@"Started: %@", dateStart);
    NSLog(@"Ended: %@", dateEnd);
    NSLog(@"Time Elapsed: %@",  [JJJUtil formatInterval:timeDifference]);
}

-(BOOL) createDir:(NSString*) path
{
    NSError *error;
    if (![[NSFileManager defaultManager] fileExistsAtPath:path])
    {
        [[NSFileManager defaultManager] createDirectoryAtPath:path
                                  withIntermediateDirectories:YES
                                                   attributes:nil
                                                        error:&error];
        return YES;
    }

    return NO;
}

@end


text:
package alluxio.network.netty;

import alluxio.network.protocol.RPCProtoMessage;
import alluxio.proto.dataserver.Protocol;
import alluxio.util.proto.ProtoMessage;

import io.netty.channel.ChannelDuplexHandler;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.timeout.IdleState;
import io.netty.handler.timeout.IdleStateEvent;

/**
 * Sends a keep-alive to the server whenever the channel has been idle for a period of time.
 */
public class IdleWriteHandler extends ChannelDuplexHandler {
  /**
   * Creates a new idle write handler.
   */
  public IdleWriteHandler() {}

  @Override
  public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception {
    if (evt instanceof IdleStateEvent) {
      if (((IdleStateEvent) evt).state() == IdleState.WRITER_IDLE) {
        Protocol.Heartbeat heartbeat = Protocol.Heartbeat.newBuilder().build();
        ctx.writeAndFlush(new RPCProtoMessage(new ProtoMessage(heartbeat)));
      }
    }
  }
}

redpajama_set_name: RedPajamaGithub


text:
package txs

import (
	"fmt"
	"reflect"

	"github.com/hyperledger/burrow/acm"
	"github.com/hyperledger/burrow/acm/acmstate"
	"github.com/hyperledger/burrow/crypto"
	"github.com/hyperledger/burrow/event/query"
	"github.com/hyperledger/burrow/txs/payload"
)

type Codec interface {
	Encoder
	Decoder
}

type Encoder interface {
	EncodeTx(envelope *Envelope) ([]byte, error)
}

type Decoder interface {
	DecodeTx(txBytes []byte) (*Envelope, error)
}

// Enclose a Payload in an Envelope so it is ready to be signed by first wrapping the Payload
// as a Tx (including ChainID) and writing it to the Tx field of the Envelope
func Enclose(chainID string, payload payload.Payload) *Envelope {
	body := NewTx(payload)
	body.ChainID = chainID
	return body.Enclose()
}

func (txEnv *Envelope) String() string {
	return fmt.Sprintf("TxEnvelope{Signatures: %v, Tx: %s}", len(txEnv.Signatories), txEnv.Tx)
}

// Attempts to 'realise' the PublicKey and Address of a Signatory possibly referring to state
// in the case where the Signatory contains an Address by no PublicKey. Checks consistency in other
// cases, possibly generating the Address from the PublicKey
func (s *Signatory) RealisePublicKey(getter acmstate.AccountGetter) error {
	const errPrefix = "could not realise public key for signatory"
	if s.PublicKey == nil {
		if s.Address == nil {
			return fmt.Errorf("%s: address not provided", errPrefix)
		}
		acc, err := getter.GetAccount(*s.Address)
		if err != nil {
			return fmt.Errorf("%s: could not get account %v: %v", errPrefix, *s.Address, err)
		}
		publicKey := acc.PublicKey
		s.PublicKey = &publicKey
	}
	if !s.PublicKey.IsValid() {
		return fmt.Errorf("%s: public key %v is invalid", errPrefix, *s.PublicKey)
	}
	address := s.PublicKey.GetAddress()
	if s.Address == nil {
		s.Address = &address
	} else if address != *s.Address {
		return fmt.Errorf("address %v provided with signatory does not match address generated from "+
			"public key %v", *s.Address, address)
	}
	return nil
}

// Returns an error if Envelope has a nil transaction or zero signatures (and therefore could not possibly be valid)
func (txEnv *Envelope) Validate() error {
	if txEnv.Tx == nil {
		return fmt.Errorf("transaction envelope contains no (successfully unmarshalled) transaction")
	}
	if len(txEnv.Signatories) == 0 {
		return fmt.Errorf("transaction envelope contains no (successfully unmarshalled) signatories")
	}
	for i, sig := range txEnv.Signatories {
		err := sig.Validate()
		if err != nil {
			return fmt.Errorf("Signatory %v is invalid: %v", i, err)
		}
	}
	return nil
}

func (sig *Signatory) Validate() error {
	if sig.Address == nil {
		return fmt.Errorf("has nil Address: %v", sig)
	}
	if sig.PublicKey == nil {
		return fmt.Errorf("has nil PublicKey: %v", sig)
	}
	return nil
}

// Verifies the validity of the Signatories' Signatures in the Envelope. The Signatories must
// appear in the same order as the inputs as returned by Tx.GetInputs().
func (txEnv *Envelope) Verify(chainID string) error {
	err := txEnv.Validate()
	if err != nil {
		return err
	}
	errPrefix := fmt.Sprintf("could not verify transaction %X", txEnv.Tx.Hash())
	if txEnv.Tx.ChainID != chainID {
		return fmt.Errorf("%s: ChainID in envelope is %s but receiving chain has ID %s",
			errPrefix, txEnv.Tx.ChainID, chainID)
	}
	inputs := txEnv.Tx.GetInputs()
	if len(inputs) != len(txEnv.Signatories) {
		return fmt.Errorf("%s: number of inputs (= %v) should equal number of signatories (= %v)",
			errPrefix, len(inputs), len(txEnv.Signatories))
	}
	signBytes, err := txEnv.Tx.SignBytes()
	if err != nil {
		return fmt.Errorf("%s: could not generate SignBytes: %v", errPrefix, err)
	}
	// Expect order to match (we could build lookup but we want Verify to be quicker than Sign which does order sigs)
	for i, s := range txEnv.Signatories {
		if inputs[i].Address != *s.Address {
			return fmt.Errorf("signatory %v has address %v but input %v has address %v",
				i, *s.Address, i, inputs[i].Address)
		}
		err = s.PublicKey.Verify(signBytes, s.Signature)
		if err != nil {
			return fmt.Errorf("invalid signature in signatory %v: %v", *s.Address, err)
		}
	}
	return nil
}

// Sign the Tx Envelope by adding Signatories containing the signatures for each TxInput.
// signing accounts for each input must be provided (in any order).
func (txEnv *Envelope) Sign(signingAccounts ...acm.AddressableSigner) error {
	// Clear any existing
	txEnv.Signatories = nil
	signBytes, err := txEnv.Tx.SignBytes()
	if err != nil {
		return err
	}
	signingAccountMap := make(map[crypto.Address]acm.AddressableSigner)
	for _, sa := range signingAccounts {
		signingAccountMap[sa.GetAddress()] = sa
	}
	// Sign in order of inputs
	for i, in := range txEnv.Tx.GetInputs() {
		sa, ok := signingAccountMap[in.Address]
		if !ok {
			return fmt.Errorf("account to sign %v (position %v) not passed to Sign, passed: %v", in, i, signingAccounts)
		}
		sig, err := sa.Sign(signBytes)
		if err != nil {
			return err
		}
		address := sa.GetAddress()
		publicKey := sa.GetPublicKey()
		txEnv.Signatories = append(txEnv.Signatories, Signatory{
			Address:   &address,
			PublicKey: &publicKey,
			Signature: sig,
		})
	}
	return nil
}

func (txEnv *Envelope) Get(key string) (interface{}, bool) {
	if txEnv == nil {
		return nil, false
	}
	v, ok := query.GetReflect(reflect.ValueOf(txEnv), key)
	if ok {
		return v, true
	}
	return txEnv.Tx.Get(key)
}


text:
<?php

use Illuminate\Http\Request;
use Luminary\Exceptions\MultiException;
use Luminary\Services\ApiRequest\Exceptions\ForbiddenAttribute;
use Luminary\Services\ApiRequest\Exceptions\MissingDataAttribute;
use Luminary\Services\ApiRequest\Exceptions\MissingTypeAttribute;
use Luminary\Services\ApiRequest\Validation\Post;

class ApiRequestCreateMiddlewareTest extends TestCase
{
    /**
     * The JsonApiRequest instance
     *
     * @var \Luminary\Services\ApiRequest\Validation\Post
     */
    protected $middleware;

    /**
     * Required request headers
     *
     * @var array
     */
    protected $headers = ['CONTENT_TYPE' => 'application/vnd.api+json'];

    /**
     * Setup the test environment.
     *
     * @return void
     */
    public function setUp()
    {
        parent::setUp();
        $this->middleware = new Post;
    }

    /**
     * Test data attribute failure
     *
     * @return void
     */
    public function testDataAttributeMethodFails() :void
    {
        $this->expectException(MissingDataAttribute::class);
        $this->expectExceptionMessage('Missing data attribute for create request');

        $fail = ['datas' => []];

        $this->middleware->dataAttributeExists($fail);
    }

    /**
     * Test data attribute failure response
     *
     * @return void
     */
    public function testDataAttributeMethodFailureResponse() :void
    {
        app()->router->group(['middleware' => 'request'], function ($router) {
            $router->post('/api', function() {});
        });

        $this->json('post', '/api', ['datas' => []],$this->headers);

        $expected = [
            'errors' => [
                [
                    'status' => 400,
                    'title' => 'Bad Request',
                    'detail' => 'Missing data attribute for create request',
                    'source' => [
                        'pointer' => '/data'
                    ]
                ]
            ]
        ];

        $response = json_decode($this->response->getContent(), true);

        $this->assertEquals($expected, $response);
    }

    /**
     * Test data attribute failure
     *
     * @return void
     */
    public function testTypeAttributeMethodFails() :void
    {
        $this->expectException(MissingTypeAttribute::class);
        $this->expectExceptionMessage('Missing the required type attribute for the data object');

        $fail = ['notit' => []];

        $this->middleware->typeAttributeExists($fail);
    }

    /**
     * Test data attribute failure response
     *
     * @return void
     */
    public function testTypeAttributeMethodFailureResponse() :void
    {
        app()->router->group(['middleware' => 'request'], function ($router) {
            $router->post('/api', function() {});
        });

        $this->json('post', '/api', ['data' => []],$this->headers);

        $expected = [
            'errors' => [
                [
                    'status' => 400,
                    'title' => 'Bad Request',
                    'detail' => 'Missing the required type attribute for the data object',
                    'source' => [
                        'pointer' => '/data/type'
                    ]
                ]
            ]
        ];

        $response = json_decode($this->response->getContent(), true);

        $this->assertEquals($expected, $response);
    }

    /**
     * Test data attribute failure
     *
     * @return void
     */
    public function testAcceptedAttributesMethodFails() :void
    {
        $this->expectException(MultiException::class);

        $fail = ['notit' => []];

        $this->middleware->hasAcceptedAttributes($fail, ['type', 'attributes', 'relationships']);
    }

    /**
     * Test data attribute failure response
     *
     * @return void
     */
    public function testAcceptedAttributesMethodFailureResponse() :void
    {
        app()->router->group(['middleware' => 'request'], function ($router) {
            $router->post('/api', function() {});
        });

        $this->json('post', '/api', ['data' => ['type' => 'test', 'not-it' => '', 'unacceptable' => '']],$this->headers);

        $expected = [
            'errors' => [
                [
                    'status' => 400,
                    'title' => 'Bad Request',
                    'detail' => 'Only type, attributes, and relationships are accepted in the data object.',
                    'source' => [
                        'pointer' => '/data/not-it'
                    ]
                ],
                [
                    'status' => 400,
                    'title' => 'Bad Request',
                    'detail' => 'Only type, attributes, and relationships are accepted in the data object.',
                    'source' => [
                        'pointer' => '/data/unacceptable'
                    ]
                ]
            ]
        ];

        $response = json_decode($this->response->getContent(), true);

        $this->assertEquals($expected, $response);
    }

    /**
     * Test forbidden attribute failure
     *
     * @return void
     */
    public function testForbiddenAttributeMethodFails() :void
    {
        $this->expectException(ForbiddenAttribute::class);
        $this->expectExceptionMessage('The attribute supplied is forbidden for this request');

        $fail = ['attributes' => ['id' => '1234']];

        $this->middleware->hasForbiddenAttribute('id', $fail);
    }

    /**
     * Test forbidden attribute failure response
     *
     * @return void
     */
    public function testForbiddenAttributeMethodFailureResponse() :void
    {
        app()->router->group(['middleware' => 'request'], function ($router) {
            $router->post('/api', function() {});
        });

        $this->json('post', '/api', ['data' => [
            'type' => 'test',
            'attributes' => ['id' => '1234']
        ]],$this->headers);

        $expected = [
            'errors' => [
                [
                    'status' => 403,
                    'title' => 'Forbidden Attribute',
                    'detail' => 'The attribute supplied is forbidden for this request',
                    'source' => [
                        'pointer' => '/data/attributes/id'
                    ]
                ]
            ]
        ];

        $response = json_decode($this->response->getContent(), true);

        $this->assertEquals($expected, $response);
    }
}


text:
Firewall da attivare alla connessione

Il campo può essere usato per avare un firewall IPchains abilitato automaticamente quando la connessione ADSL viene instaurata. In ogni caso il modulo Webmin relativo al firewall di Linux può essere utilizzato per creare e personalizzare un firewall di tua scelta.


text:
"""Parse METAR-formatted data."""
# Import the necessary libraries
from collections import namedtuple
from datetime import datetime
import warnings

import numpy as np
import pandas as pd

from ._tools import open_as_needed
from .metar_parser import parse, ParseError
from .station_data import station_info
from ..calc import altimeter_to_sea_level_pressure, wind_components
from ..package_tools import Exporter
from ..plots.wx_symbols import wx_code_map
from ..units import units

exporter = Exporter(globals())

# Configure the named tuple used for storing METAR data
Metar = namedtuple('metar', ['station_id', 'latitude', 'longitude', 'elevation',
                             'date_time', 'wind_direction', 'wind_speed', 'current_wx1',
                             'current_wx2', 'current_wx3', 'skyc1', 'skylev1', 'skyc2',
                             'skylev2', 'skyc3', 'skylev3', 'skyc4', 'skylev4',
                             'cloudcover', 'temperature', 'dewpoint', 'altimeter',
                             'current_wx1_symbol', 'current_wx2_symbol',
                             'current_wx3_symbol'])

# Create a dictionary for attaching units to the different variables
col_units = {'station_id': None,
             'latitude': 'degrees',
             'longitude': 'degrees',
             'elevation': 'meters',
             'date_time': None,
             'wind_direction': 'degrees',
             'wind_speed': 'kts',
             'eastward_wind': 'kts',
             'northward_wind': 'kts',
             'current_wx1': None,
             'current_wx2': None,
             'current_wx3': None,
             'low_cloud_type': None,
             'low_cloud_level': 'feet',
             'medium_cloud_type': None,
             'medium_cloud_level': 'feet',
             'high_cloud_type': None,
             'high_cloud_level': 'feet',
             'highest_cloud_type': None,
             'highest_cloud_level:': None,
             'cloud_coverage': None,
             'air_temperature': 'degC',
             'dew_point_temperature': 'degC',
             'altimeter': 'inHg',
             'air_pressure_at_sea_level': 'hPa',
             'present_weather': None,
             'past_weather': None,
             'past_weather2': None}

@exporter.export
def parse_metar_to_dataframe(metar_text, *, year=None, month=None):
    """Parse a single METAR report into a Pandas DataFrame.

    Takes a METAR string in a text form, and creates a `pandas.DataFrame` including the
    essential information (not including the remarks)

    The parser follows the WMO format, allowing for missing data and assigning
    nan values where necessary. The WMO code is also provided for current weather,
    which can be utilized when plotting.

    Parameters
    ----------
    metar_text : str
        The METAR report
    year : int, optional
        Year in which observation was taken, defaults to current year. Keyword-only argument.
    month : int, optional
        Month in which observation was taken, defaults to current month. Keyword-only argument.

    Returns
    -------
    `pandas.DataFrame`

    Notes
    -----
    The output has the following columns:
    'station_id': Station Identifier (ex. KLOT)
    'latitude': Latitude of the observation, measured in degrees
    'longitude': Longitude of the observation, measured in degrees
    'elevation': Elevation of the observation above sea level, measured in meters
    'date_time': Date and time of the observation, datetime object
    'wind_direction': Direction the wind is coming from, measured in degrees
    'wind_spd': Wind speed, measured in knots
    'current_wx1': Current weather (1 of 3)
    'current_wx2': Current weather (2 of 3)
    'current_wx3': Current weather (3 of 3)
    'skyc1': Sky cover (ex. FEW)
    'skylev1': Height of sky cover 1, measured in feet
    'skyc2': Sky cover (ex. OVC)
    'skylev2': Height of sky cover 2, measured in feet
    'skyc3': Sky cover (ex. FEW)
    'skylev3': Height of sky cover 3, measured in feet
    'skyc4': Sky cover (ex. CLR)
    'skylev4:': Height of sky cover 4, measured in feet
    'cloudcover': Cloud coverage measured in oktas, taken from maximum of sky cover values
    'temperature': Temperature, measured in degrees Celsius
    'dewpoint': Dew point, measured in degrees Celsius
    'altimeter': Altimeter value, measured in inches of mercury, float
    'current_wx1_symbol': Current weather symbol (1 of 3), integer
    'current_wx2_symbol': Current weather symbol (2 of 3), integer
    'current_wx3_symbol': Current weather symbol (3 of 3), integer
    'sea_level_pressure': Sea level pressure, derived from temperature, elevation
    and altimeter value, float

    """
    # Defaults year and/or month to present reported date if not provided
    if year is None or month is None:
        now = datetime.now()
        year = now.year if year is None else year
        month = now.month if month is None else month

    # Use the named tuple parsing function to separate metar
    # Utilizes the station dictionary which contains elevation, latitude, and longitude
    metar_vars = parse_metar_to_named_tuple(metar_text, station_info, year, month)

    # Use a pandas dataframe to store the data
    df = pd.DataFrame({'station_id': metar_vars.station_id,
                       'latitude': metar_vars.latitude,
                       'longitude': metar_vars.longitude,
                       'elevation': metar_vars.elevation,
                       'date_time': metar_vars.date_time,
                       'wind_direction': metar_vars.wind_direction,
                       'wind_speed': metar_vars.wind_speed,
                       'current_wx1': metar_vars.current_wx1,
                       'current_wx2': metar_vars.current_wx2,
                       'current_wx3': metar_vars.current_wx3,
                       'low_cloud_type': metar_vars.skyc1,
                       'low_cloud_level': metar_vars.skylev1,
                       'medium_cloud_type': metar_vars.skyc2,
                       'medium_cloud_level': metar_vars.skylev2,
                       'high_cloud_type': metar_vars.skyc3,
                       'high_cloud_level': metar_vars.skylev3,
                       'highest_cloud_type': metar_vars.skyc4,
                       'highest_cloud_level': metar_vars.skylev4,
                       'cloud_coverage': metar_vars.cloudcover,
                       'air_temperature': metar_vars.temperature,
                       'dew_point_temperature': metar_vars.dewpoint,
                       'altimeter': metar_vars.altimeter,
                       'present_weather': metar_vars.current_wx1_symbol,
                       'past_weather': metar_vars.current_wx2_symbol,
                       'past_weather2': metar_vars.current_wx3_symbol},
                      index=[metar_vars.station_id])

    # Convert to sea level pressure using calculation in metpy.calc
    try:
        # Create a field for sea-level pressure and make sure it is a float
        df['air_pressure_at_sea_level'] = float(altimeter_to_sea_level_pressure(
            units.Quantity(df.altimeter.values, 'inHg'),
            units.Quantity(df.elevation.values, 'meters'),
            units.Quantity(df.temperature.values, 'degC')).to('hPa').magnitude)
    except AttributeError:
        df['air_pressure_at_sea_level'] = [np.nan]

    # Use get wind components and assign them to u and v variables
    df['eastward_wind'], df['northward_wind'] = wind_components(
        units.Quantity(df.wind_speed.values, 'kts'),
        units.Quantity(df.wind_direction.values, 'degree'))

    # Round the altimeter and sea-level pressure values
    df['altimeter'] = df.altimeter.round(2)
    df['air_pressure_at_sea_level'] = df.air_pressure_at_sea_level.round(2)

    # Set the units for the dataframe--filter out warning from pandas
    with warnings.catch_warnings():
        warnings.simplefilter('ignore', UserWarning)
        df.units = col_units

    return df

def parse_metar_to_named_tuple(metar_text, station_metadata, year, month):
    """Parse a METAR report in text form into a list of named tuples.

    Parameters
    ----------
    metar_text : str
        The METAR report
    station_metadata : dict
        Mapping of station identifiers to station metadata
    year : int
        Reported year of observation for constructing 'date_time'
    month : int
        Reported month of observation for constructing 'date_time'

    Returns
    -------
    metar : namedtuple
        Named tuple of parsed METAR fields

    Notes
    -----
    Returned data has named tuples with the following attributes:
    'station_id': Station Identifier (ex. KLOT)
    'latitude': Latitude of the observation, measured in degrees
    'longitude': Longitude of the observation, measured in degrees
    'elevation': Elevation of the observation above sea level, measured in meters
    'date_time': Date and time of the observation, datetime object
    'wind_direction': Direction the wind is coming from, measured in degrees
    'wind_spd': Wind speed, measured in knots
    'current_wx1': Current weather (1 of 3)
    'current_wx2': Current weather (2 of 3)
    'current_wx3': Current weather (3 of 3)
    'skyc1': Sky cover (ex. FEW)
    'skylev1': Height of sky cover 1, measured in feet
    'skyc2': Sky cover (ex. OVC)
    'skylev2': Height of sky cover 2, measured in feet
    'skyc3': Sky cover (ex. FEW)
    'skylev3': Height of sky cover 3, measured in feet
    'skyc4': Sky cover (ex. CLR)
    'skylev4:': Height of sky cover 4, measured in feet
    'cloudcover': Cloud coverage measured in oktas, taken from maximum of sky cover values
    'temperature': Temperature, measured in degrees Celsius
    'dewpoint': Dewpoint, measured in degrees Celsius
    'altimeter': Altimeter value, measured in inches of mercury, float
    'current_wx1_symbol': Current weather symbol (1 of 3), integer
    'current_wx2_symbol': Current weather symbol (2 of 3), integer
    'current_wx3_symbol': Current weather symbol (3 of 3), integer
    'sea_level_pressure': Sea level pressure, derived from temperature, elevation
    and altimeter value, float

    """
    # Decode the data using the parser (built using Canopy) the parser utilizes a grammar
    # file which follows the format structure dictated by the WMO Handbook, but has the
    # flexibility to decode the METAR text when there are missing or incorrectly
    # encoded values
    tree = parse(metar_text)

    # Station ID which is used to find the latitude, longitude, and elevation
    station_id = tree.siteid.text.strip()

    # Extract the latitude and longitude values from 'master' dictionary
    try:
        lat = station_metadata[tree.siteid.text.strip()].latitude
        lon = station_metadata[tree.siteid.text.strip()].longitude
        elev = station_metadata[tree.siteid.text.strip()].altitude
    except KeyError:
        lat = np.nan
        lon = np.nan
        elev = np.nan

    # Set the datetime, day, and time_utc
    try:
        day_time_utc = tree.datetime.text[:-1].strip()
        day = int(day_time_utc[0:2])
        hour = int(day_time_utc[2:4])
        minute = int(day_time_utc[4:7])
        date_time = datetime(year, month, day, hour, minute)
    except (AttributeError, ValueError):
        date_time = np.nan

    # Set the wind values
    try:
        # If there are missing wind values, set wind speed and wind direction to nan
        if ('/' in tree.wind.text) or (tree.wind.text == 'KT') or (tree.wind.text == ''):
            wind_dir = np.nan
            wind_spd = np.nan
        # If the wind direction is variable, set wind direction to nan but keep the wind speed
        else:
            if (tree.wind.wind_dir.text == 'VRB') or (tree.wind.wind_dir.text == 'VAR'):
                wind_dir = np.nan
                wind_spd = float(tree.wind.wind_spd.text)
            else:
                # If the wind speed and direction is given, keep the values
                wind_dir = int(tree.wind.wind_dir.text)
                wind_spd = int(tree.wind.wind_spd.text)
    # If there are any errors, return nan
    except ValueError:
        wind_dir = np.nan
        wind_spd = np.nan

    # Set the weather symbols
    # If the weather symbol is missing, set values to nan
    if tree.curwx.text == '':
        current_wx1 = np.nan
        current_wx2 = np.nan
        current_wx3 = np.nan
        current_wx1_symbol = 0
        current_wx2_symbol = 0
        current_wx3_symbol = 0
    else:
        wx = [np.nan, np.nan, np.nan]
        # Loop through symbols and assign according WMO codes
        wx[0:len((tree.curwx.text.strip()).split())] = tree.curwx.text.strip().split()
        current_wx1 = wx[0]
        current_wx2 = wx[1]
        current_wx3 = wx[2]
        try:
            current_wx1_symbol = int(wx_code_map[wx[0]])
        except (IndexError, KeyError):
            current_wx1_symbol = 0
        try:
            current_wx2_symbol = int(wx_code_map[wx[1]])
        except (IndexError, KeyError):
            current_wx2_symbol = 0
        try:
            current_wx3_symbol = int(wx_code_map[wx[3]])
        except (IndexError, KeyError):
            current_wx3_symbol = 0

    # Set the sky conditions
    if tree.skyc.text[1:3] == 'VV':
        skyc1 = 'VV'
        skylev1 = tree.skyc.text.strip()[2:]
        skyc2 = np.nan
        skylev2 = np.nan
        skyc3 = np.nan
        skylev3 = np.nan
        skyc4 = np.nan
        skylev4 = np.nan

    else:
        skyc = []
        skyc[0:len((tree.skyc.text.strip()).split())] = tree.skyc.text.strip().split()
        try:
            skyc1 = skyc[0][0:3]
            if '/' in skyc1:
                skyc1 = np.nan
        except (IndexError, ValueError, TypeError):
            skyc1 = np.nan
        try:
            skylev1 = skyc[0][3:]
            if '/' in skylev1:
                skylev1 = np.nan
            else:
                skylev1 = float(skylev1) * 100
        except (IndexError, ValueError, TypeError):
            skylev1 = np.nan
        try:
            skyc2 = skyc[1][0:3]
            if '/' in skyc2:
                skyc2 = np.nan
        except (IndexError, ValueError, TypeError):
            skyc2 = np.nan
        try:
            skylev2 = skyc[1][3:]
            if '/' in skylev2:
                skylev2 = np.nan
            else:
                skylev2 = float(skylev2) * 100
        except (IndexError, ValueError, TypeError):
            skylev2 = np.nan
        try:
            skyc3 = skyc[2][0:3]
            if '/' in skyc3:
                skyc3 = np.nan
        except (IndexError, ValueError):
            skyc3 = np.nan
        try:
            skylev3 = skyc[2][3:]
            if '/' in skylev3:
                skylev3 = np.nan
            else:
                skylev3 = float(skylev3) * 100
        except (IndexError, ValueError, TypeError):
            skylev3 = np.nan
        try:
            skyc4 = skyc[3][0:3]
            if '/' in skyc4:
                skyc4 = np.nan
        except (IndexError, ValueError, TypeError):
            skyc4 = np.nan
        try:
            skylev4 = skyc[3][3:]
            if '/' in skylev4:
                skylev4 = np.nan
            else:
                skylev4 = float(skylev4) * 100
        except (IndexError, ValueError, TypeError):
            skylev4 = np.nan

    # Set the cloud cover variable (measured in oktas)
    if ('OVC' or 'VV') in tree.skyc.text:
        cloudcover = 8
    elif 'BKN' in tree.skyc.text:
        cloudcover = 6
    elif 'SCT' in tree.skyc.text:
        cloudcover = 4
    elif 'FEW' in tree.skyc.text:
        cloudcover = 2
    elif ('SKC' in tree.skyc.text) or ('NCD' in tree.skyc.text) \
            or ('NSC' in tree.skyc.text) or 'CLR' in tree.skyc.text:
        cloudcover = 0
    else:
        cloudcover = 10

    # Set the temperature and dewpoint
    if (tree.temp_dewp.text == '') or (tree.temp_dewp.text == ' MM/MM'):
        temp = np.nan
        dewp = np.nan
    else:
        try:
            if 'M' in tree.temp_dewp.temp.text:
                temp = (-1 * float(tree.temp_dewp.temp.text[-2:]))
            else:
                temp = float(tree.temp_dewp.temp.text[-2:])
        except ValueError:
            temp = np.nan
        try:
            if 'M' in tree.temp_dewp.dewp.text:
                dewp = (-1 * float(tree.temp_dewp.dewp.text[-2:]))
            else:
                dewp = float(tree.temp_dewp.dewp.text[-2:])
        except ValueError:
            dewp = np.nan

    # Set the altimeter value and sea level pressure
    if tree.altim.text == '':
        altim = np.nan
    else:
        if (float(tree.altim.text.strip()[1:5])) > 1100:
            altim = float(tree.altim.text.strip()[1:5]) / 100
        else:
            altim = units.Quantity(int(tree.altim.text.strip()[1:5]), 'hPa').to('inHg').m

    # Returns a named tuple with all the relevant variables
    return Metar(station_id, lat, lon, elev, date_time, wind_dir, wind_spd,
                 current_wx1, current_wx2, current_wx3, skyc1, skylev1, skyc2,
                 skylev2, skyc3, skylev3, skyc4, skylev4, cloudcover, temp, dewp,
                 altim, current_wx1_symbol, current_wx2_symbol, current_wx3_symbol)

@exporter.export
def parse_metar_file(filename, *, year=None, month=None):
    """Parse a text file containing multiple METAR reports and/or text products.

    Parameters
    ----------
    filename : str or file-like object
        If str, the name of the file to be opened. If `filename` is a file-like object,
        this will be read from directly.
    year : int, optional
        Year in which observation was taken, defaults to current year. Keyword-only argument.
    month : int, optional
        Month in which observation was taken, defaults to current month. Keyword-only argument.

    Returns
    -------
    `pandas.DataFrame`

    Notes
    -----
    The returned `pandas.DataFrame` has the following columns:
    'station_id': Station Identifier (ex. KLOT)
    'latitude': Latitude of the observation, measured in degrees
    'longitude': Longitude of the observation, measured in degrees
    'elevation': Elevation of the observation above sea level, measured in meters
    'date_time': Date and time of the observation, datetime object
    'wind_direction': Direction the wind is coming from, measured in degrees
    'wind_spd': Wind speed, measured in knots
    'current_wx1': Current weather (1 of 3)
    'current_wx2': Current weather (2 of 3)
    'current_wx3': Current weather (3 of 3)
    'skyc1': Sky cover (ex. FEW)
    'skylev1': Height of sky cover 1, measured in feet
    'skyc2': Sky cover (ex. OVC)
    'skylev2': Height of sky cover 2, measured in feet
    'skyc3': Sky cover (ex. FEW)
    'skylev3': Height of sky cover 3, measured in feet
    'skyc4': Sky cover (ex. CLR)
    'skylev4:': Height of sky cover 4, measured in feet
    'cloudcover': Cloud coverage measured in oktas, taken from maximum of sky cover values
    'temperature': Temperature, measured in degrees Celsius
    'dewpoint': Dew point, measured in degrees Celsius
    'altimeter': Altimeter value, measured in inches of mercury, float
    'current_wx1_symbol': Current weather symbol (1 of 3), integer
    'current_wx2_symbol': Current weather symbol (2 of 3), integer
    'current_wx3_symbol': Current weather symbol (3 of 3), integer
    'sea_level_pressure': Sea level pressure, derived from temperature, elevation
    and altimeter value, float

    """
    # Defaults year and/or month to present reported date if not provided
    if year is None or month is None:
        now = datetime.now()
        year = now.year if year is None else year
        month = now.month if month is None else month

    # Function to merge METARs
    def merge(x, key='     '):
        tmp = []
        for i in x:
            if (i[0:len(key)] != key) and len(tmp):
                yield ' '.join(tmp)
                tmp = []
            if i.startswith(key):
                i = i[5:]
            tmp.append(i)
        if len(tmp):
            yield ' '.join(tmp)

    # Open the file
    myfile = open_as_needed(filename, 'rt')

    # Clean up the file and take out the next line (\n)
    value = myfile.read().rstrip()
    list_values = value.split('\n')
    list_values = list(filter(None, list_values))

    # Call the merge function and assign the result to the list of metars
    list_values = list(merge(list_values))

    # Remove the short lines that do not contain METAR observations or contain
    # METAR observations that lack a robust amount of data
    metars = []
    for metar in list_values:
        if len(metar) > 25:
            metars.append(metar)
        else:
            continue

    # Create a dictionary with all the station name, locations, and elevations
    master = station_info

    # Setup lists to append the data to
    station_id = []
    lat = []
    lon = []
    elev = []
    date_time = []
    wind_dir = []
    wind_spd = []
    current_wx1 = []
    current_wx2 = []
    current_wx3 = []
    skyc1 = []
    skylev1 = []
    skyc2 = []
    skylev2 = []
    skyc3 = []
    skylev3 = []
    skyc4 = []
    skylev4 = []
    cloudcover = []
    temp = []
    dewp = []
    altim = []
    current_wx1_symbol = []
    current_wx2_symbol = []
    current_wx3_symbol = []

    # Loop through the different metars within the text file
    for metar in metars:
        try:
            # Parse the string of text and assign to values within the named tuple
            metar = parse_metar_to_named_tuple(metar, master, year=year, month=month)

            # Append the different variables to their respective lists
            station_id.append(metar.station_id)
            lat.append(metar.latitude)
            lon.append(metar.longitude)
            elev.append(metar.elevation)
            date_time.append(metar.date_time)
            wind_dir.append(metar.wind_direction)
            wind_spd.append(metar.wind_speed)
            current_wx1.append(metar.current_wx1)
            current_wx2.append(metar.current_wx2)
            current_wx3.append(metar.current_wx3)
            skyc1.append(metar.skyc1)
            skylev1.append(metar.skylev1)
            skyc2.append(metar.skyc2)
            skylev2.append(metar.skylev2)
            skyc3.append(metar.skyc3)
            skylev3.append(metar.skylev3)
            skyc4.append(metar.skyc4)
            skylev4.append(metar.skylev4)
            cloudcover.append(metar.cloudcover)
            temp.append(metar.temperature)
            dewp.append(metar.dewpoint)
            altim.append(metar.altimeter)
            current_wx1_symbol.append(metar.current_wx1_symbol)
            current_wx2_symbol.append(metar.current_wx2_symbol)
            current_wx3_symbol.append(metar.current_wx3_symbol)

        except ParseError:
            continue

    df = pd.DataFrame({'station_id': station_id,
                       'latitude': lat,
                       'longitude': lon,
                       'elevation': elev,
                       'date_time': date_time,
                       'wind_direction': wind_dir,
                       'wind_speed': wind_spd,
                       'current_wx1': current_wx1,
                       'current_wx2': current_wx2,
                       'current_wx3': current_wx3,
                       'low_cloud_type': skyc1,
                       'low_cloud_level': skylev1,
                       'medium_cloud_type': skyc2,
                       'medium_cloud_level': skylev2,
                       'high_cloud_type': skyc3,
                       'high_cloud_level': skylev3,
                       'highest_cloud_type': skyc4,
                       'highest_cloud_level': skylev4,
                       'cloud_coverage': cloudcover,
                       'air_temperature': temp,
                       'dew_point_temperature': dewp,
                       'altimeter': altim,
                       'present_weather': current_wx1_symbol,
                       'past_weather': current_wx2_symbol,
                       'past_weather2': current_wx3_symbol},
                      index=station_id)

    # Calculate sea-level pressure from function in metpy.calc
    df['air_pressure_at_sea_level'] = altimeter_to_sea_level_pressure(
        units.Quantity(altim, 'inHg'),
        units.Quantity(elev, 'meters'),
        units.Quantity(temp, 'degC')).to('hPa').magnitude

    # Use get wind components and assign them to eastward and northward winds
    df['eastward_wind'], df['northward_wind'] = wind_components(
        units.Quantity(df.wind_speed.values, 'kts'),
        units.Quantity(df.wind_direction.values, 'degree'))

    # Drop duplicate values
    df = df.drop_duplicates(subset=['date_time', 'latitude', 'longitude'], keep='last')

    # Round altimeter and sea-level pressure values
    df['altimeter'] = df.altimeter.round(2)
    df['air_pressure_at_sea_level'] = df.air_pressure_at_sea_level.round(2)

    # Set the units for the dataframe--filter out warning from Pandas
    with warnings.catch_warnings():
        warnings.simplefilter('ignore', UserWarning)
        df.units = col_units

    return df


text:
package org.apache.ignite.testsuites;

import junit.framework.*;
import org.apache.ignite.*;
import org.apache.ignite.cache.*;
import org.apache.ignite.cache.affinity.*;
import org.apache.ignite.cache.affinity.fair.*;
import org.apache.ignite.cache.store.*;
import org.apache.ignite.cache.store.jdbc.*;
import org.apache.ignite.internal.processors.cache.*;
import org.apache.ignite.internal.processors.cache.context.*;
import org.apache.ignite.internal.processors.cache.distributed.*;
import org.apache.ignite.internal.processors.cache.distributed.dht.*;
import org.apache.ignite.internal.processors.cache.distributed.near.*;
import org.apache.ignite.internal.processors.cache.distributed.replicated.*;
import org.apache.ignite.internal.processors.cache.local.*;
import org.apache.ignite.internal.processors.datastreamer.*;
import org.apache.ignite.testframework.*;

import java.util.*;

/**
 * Test suite.
 */
public class IgniteCacheTestSuite extends TestSuite {
    /**
     * @return IgniteCache test suite.
     * @throws Exception Thrown in case of the failure.
     */
    public static TestSuite suite() throws Exception {
        return suite(null);
    }

    /**
     * @param ignoredTests
     * @return Test suite.
     * @throws Exception Thrown in case of the failure.
     */
    public static TestSuite suite(Set<Class> ignoredTests) throws Exception {
        TestSuite suite = new TestSuite("IgniteCache Test Suite");

        suite.addTestSuite(IgniteCacheEntryListenerAtomicTest.class);
        suite.addTestSuite(IgniteCacheEntryListenerAtomicReplicatedTest.class);
        suite.addTestSuite(IgniteCacheEntryListenerAtomicLocalTest.class);
        suite.addTestSuite(IgniteCacheEntryListenerTxTest.class);
        suite.addTestSuite(IgniteCacheEntryListenerTxReplicatedTest.class);
        suite.addTestSuite(IgniteCacheEntryListenerTxLocalTest.class);
        suite.addTestSuite(IgniteCacheEntryListenerEagerTtlDisabledTest.class);

        suite.addTestSuite(IgniteClientAffinityAssignmentSelfTest.class);

        suite.addTestSuite(IgniteCacheAtomicInvokeTest.class);
        suite.addTestSuite(IgniteCacheAtomicNearEnabledInvokeTest.class);
        suite.addTestSuite(IgniteCacheAtomicPrimaryWriteOrderInvokeTest.class);
        suite.addTestSuite(IgniteCacheAtomicPrimaryWriteOrderWithStoreInvokeTest.class);
        suite.addTestSuite(IgniteCacheAtomicLocalInvokeTest.class);
        suite.addTestSuite(IgniteCacheAtomicLocalWithStoreInvokeTest.class);
        suite.addTestSuite(IgniteCacheTxInvokeTest.class);
        suite.addTestSuite(IgniteCacheTxNearEnabledInvokeTest.class);
        suite.addTestSuite(IgniteCacheTxLocalInvokeTest.class);
        suite.addTestSuite(IgniteCrossCacheTxStoreSelfTest.class);

        suite.addTestSuite(IgnitePutAllLargeBatchSelfTest.class);
        suite.addTestSuite(IgnitePutAllUpdateNonPreloadedPartitionSelfTest.class);

        // User's class loader tests.
        suite.addTestSuite(IgniteCacheAtomicExecutionContextTest.class);
        suite.addTestSuite(IgniteCachePartitionedExecutionContextTest.class);
        suite.addTestSuite(IgniteCacheReplicatedExecutionContextTest.class);
        suite.addTestSuite(IgniteCacheTxExecutionContextTest.class);
        suite.addTestSuite(IgniteCacheContinuousExecutionContextTest.class);
        suite.addTestSuite(IgniteCacheIsolatedExecutionContextTest.class);
        suite.addTestSuite(IgniteCacheP2PDisableExecutionContextTest.class);
        suite.addTestSuite(IgniteCachePrivateExecutionContextTest.class);
        suite.addTestSuite(IgniteCacheSharedExecutionContextTest.class);

        // Warmup closure tests.
        suite.addTestSuite(IgniteWarmupClosureSelfTest.class);

        // Affinity tests.
        suite.addTestSuite(GridFairAffinityFunctionNodesSelfTest.class);
        suite.addTestSuite(GridFairAffinityFunctionSelfTest.class);
        suite.addTestSuite(IgniteFairAffinityDynamicCacheSelfTest.class);
        suite.addTestSuite(GridCacheAffinityBackupsSelfTest.class);
        suite.addTestSuite(IgniteCacheAffinitySelfTest.class);
        suite.addTestSuite(IgniteClientNodeAffinityTest.class);

        // Swap tests.
        suite.addTestSuite(GridCacheSwapPreloadSelfTest.class);
        suite.addTestSuite(GridCacheSwapReloadSelfTest.class);

        // Common tests.
        suite.addTestSuite(GridCacheConcurrentMapSelfTest.class);
        suite.addTestSuite(GridCacheAffinityMapperSelfTest.class);
        suite.addTestSuite(CacheAffinityCallSelfTest.class);
        GridTestUtils.addTestIfNeeded(suite, GridCacheAffinityRoutingSelfTest.class, ignoredTests);
        GridTestUtils.addTestIfNeeded(suite, GridCacheMvccSelfTest.class, ignoredTests);
        suite.addTestSuite(GridCacheMvccPartitionedSelfTest.class);
        suite.addTestSuite(GridCacheMvccManagerSelfTest.class);
        suite.addTestSuite(GridCacheP2PUndeploySelfTest.class);
        suite.addTestSuite(GridCacheConfigurationValidationSelfTest.class);
        suite.addTestSuite(GridCacheConfigurationConsistencySelfTest.class);
        suite.addTestSuite(GridCacheJdbcBlobStoreSelfTest.class);
        suite.addTestSuite(GridCacheJdbcBlobStoreMultithreadedSelfTest.class);
        suite.addTestSuite(CacheJdbcPojoStoreTest.class);
        suite.addTestSuite(CacheJdbcPojoStoreMultitreadedSelfTest.class);
        suite.addTestSuite(GridCacheBalancingStoreSelfTest.class);
        suite.addTestSuite(GridCacheAffinityApiSelfTest.class);
        suite.addTestSuite(GridCacheStoreValueBytesSelfTest.class);
        GridTestUtils.addTestIfNeeded(suite, DataStreamProcessorSelfTest.class, ignoredTests);
        suite.addTestSuite(DataStreamerMultiThreadedSelfTest.class);
        suite.addTestSuite(DataStreamerMultinodeCreateCacheTest.class);
        suite.addTestSuite(DataStreamerImplSelfTest.class);
        GridTestUtils.addTestIfNeeded(suite, GridCacheEntryMemorySizeSelfTest.class, ignoredTests);
        suite.addTestSuite(GridCacheClearAllSelfTest.class);
        suite.addTestSuite(GridCacheObjectToStringSelfTest.class);
        suite.addTestSuite(GridCacheLoadOnlyStoreAdapterSelfTest.class);
        suite.addTestSuite(GridCacheGetStoreErrorSelfTest.class);
        suite.addTestSuite(CacheFutureExceptionSelfTest.class);
        suite.addTestSuite(GridCacheAsyncOperationsLimitSelfTest.class);
        suite.addTestSuite(GridCacheTtlManagerSelfTest.class);
        suite.addTestSuite(GridCacheLifecycleAwareSelfTest.class);
        suite.addTestSuite(IgniteCacheAtomicStopBusySelfTest.class);
        suite.addTestSuite(IgniteCacheTransactionalStopBusySelfTest.class);
        suite.addTestSuite(GridCacheAtomicNearCacheSelfTest.class);
        suite.addTestSuite(CacheAtomicNearUpdateTopologyChangeTest.class);
        suite.addTestSuite(CacheTxNearUpdateTopologyChangeTest.class);
        suite.addTestSuite(GridCacheStorePutxSelfTest.class);
        suite.addTestSuite(GridCacheOffHeapMultiThreadedUpdateSelfTest.class);
        suite.addTestSuite(GridCacheOffHeapAtomicMultiThreadedUpdateSelfTest.class);
        suite.addTestSuite(GridCacheColocatedTxStoreExceptionSelfTest.class);
        suite.addTestSuite(GridCacheReplicatedTxStoreExceptionSelfTest.class);
        suite.addTestSuite(GridCacheLocalTxStoreExceptionSelfTest.class);
        suite.addTestSuite(GridCacheNearTxStoreExceptionSelfTest.class);
        suite.addTestSuite(GridCacheMissingCommitVersionSelfTest.class);
        suite.addTestSuite(GridCacheEntrySetIterationPreloadingSelfTest.class);
        suite.addTestSuite(GridCacheMixedPartitionExchangeSelfTest.class);
        suite.addTestSuite(IgniteCacheAtomicMessageRecoveryTest.class);
        suite.addTestSuite(IgniteCacheTxMessageRecoveryTest.class);
        GridTestUtils.addTestIfNeeded(suite, GridCacheOffHeapTieredEvictionAtomicSelfTest.class, ignoredTests);
        GridTestUtils.addTestIfNeeded(suite, GridCacheOffHeapTieredEvictionSelfTest.class, ignoredTests);
        GridTestUtils.addTestIfNeeded(suite, GridCacheOffHeapTieredAtomicSelfTest.class, ignoredTests);
        GridTestUtils.addTestIfNeeded(suite, GridCacheOffHeapTieredSelfTest.class, ignoredTests);
        suite.addTestSuite(GridCacheGlobalLoadTest.class);
        suite.addTestSuite(GridCachePartitionedLocalStoreSelfTest.class);
        suite.addTestSuite(GridCacheReplicatedLocalStoreSelfTest.class);
        suite.addTestSuite(GridCachePartitionedOffHeapLocalStoreSelfTest.class);
        suite.addTestSuite(GridCacheTxPartitionedLocalStoreSelfTest.class);
        suite.addTestSuite(IgniteCacheSystemTransactionsSelfTest.class);

        suite.addTest(IgniteCacheTcpClientDiscoveryTestSuite.suite());

        // Heuristic exception handling.
        suite.addTestSuite(GridCacheColocatedTxExceptionSelfTest.class);
        suite.addTestSuite(GridCacheReplicatedTxExceptionSelfTest.class);
        suite.addTestSuite(GridCacheLocalTxExceptionSelfTest.class);
        suite.addTestSuite(GridCacheNearTxExceptionSelfTest.class);
        suite.addTestSuite(GridCacheStopSelfTest.class);

        suite.addTestSuite(IgniteCacheNearLockValueSelfTest.class);

        return suite;
    }
}


text:
angular.module('dataGoMain')
    .controller('AuthController', function ($auth, $state, $http, $rootScope,$scope) {
    var vm = this;
    vm.loginError = false;
    vm.loginErrorText;
    $rootScope.login = login;
    $rootScope.logout = logout;
    $scope.login = login;
    $scope.homepageEmail = '';
    $scope.homepagePassword = '';
    $scope.email = '';
    $scope.password = '';

    function login(email, password)  {
        console.log('email', email, 'password', password);
        console.log($scope);
        if(typeof(email) !== 'undefined') {
            var credentials = {
                email: email,
                password: password
            }
        } else {
            var credentials = {
                email: $scope.email,
                password: $scope.password
            }
        }
        console.log('credentials:', credentials);

        $auth.login(credentials).then(function() {
            return $http.get('api/authenticate/user')
        .then(function(response) {
            var user = JSON.stringify(response.data.user);
            localStorage.setItem('user', user);
            $rootScope.authenticated = true;
            $rootScope.currentUser = response.data.user;
            });
        },
            // Handle errors
            function(error) {
            vm.loginError = true;
            vm.loginErrorText = error.data.error;
        });
    }

    function logout() {
        //$auth.logout() itself will remove satellizer_token from local storage.
        console.log('in logout function');
        $auth.logout().then(function() {
            localStorage.removeItem('user');
            $rootScope.authenticated = false;
            $rootScope.currentUser = null;

        });
    }
});


text:
//
//  CenteredView.m
//  Comparator
//
//  Created by Max on 14/12/12.
//  Copyright (c) 2012 Lis@cintosh. All rights reserved.
//

#import "CenteredView.h"

@implementation CenteredView

@synthesize horizontallyCentered = _horizontallyCentered, verticallyCentered = _verticallyCentered;
@synthesize offsetEdge = _offsetEdge;

RectEdge const RectEdgeZero = { 0., 0., 0., 0. };

RectEdge RectEdgeMake(float top, float left, float bottom, float right)
{
	RectEdge edge;
	edge.top = top; edge.left = left;
	edge.bottom = bottom; edge.right = right;
	return edge;
}

- (instancetype)initWithFrame:(NSRect)frameRect
{
	if ((self = [super initWithFrame:frameRect])) {
		_horizontallyCentered = YES;
		_verticallyCentered = NO;
		_offsetEdge = RectEdgeZero;
	}
	return self;
}

- (instancetype)initWithCoder:(NSCoder *)aDecoder
{
	if ((self = [super initWithCoder:aDecoder])) {
		_horizontallyCentered = YES;
		_verticallyCentered = NO;
		_offsetEdge = RectEdgeZero;
	}
	return self;
}

- (void)setHorizontallyCentered:(BOOL)horizontallyCentered
{
	_horizontallyCentered = horizontallyCentered;
	self.frame = self.frame; // Refresh the layout of the view
}

- (void)setVerticallyCentered:(BOOL)verticallyCentered
{
	_verticallyCentered = verticallyCentered;
	self.frame = self.frame; // Refresh the layout of the view
}

- (void)setOffsetEdge:(RectEdge)offsetEdge
{
	_offsetEdge = offsetEdge;
	self.frame = self.frame; // Refresh the layout of the view
}

- (void)viewWillDraw
{
	[super viewWillDraw];

	self.frame = self.frame; // Refresh the layout of the view
}

- (void)setFrame:(NSRect)frame
{
	/* Center the view along the x-axis and y-axis (only if the window has been attach to the view */
	if (self.window) {
		if (_horizontallyCentered) { frame.origin.x = (int)(_offsetEdge.left + (self.window.frame.size.width - (_offsetEdge.right + _offsetEdge.left) - frame.size.width) / 2. - _offsetEdge.right); }
		if (_verticallyCentered) { frame.origin.y = (int)(_offsetEdge.bottom + (self.window.frame.size.height - (_offsetEdge.top + _offsetEdge.bottom) - frame.size.height) / 2. - _offsetEdge.top); }
	}

	[super setFrame:frame];
}

@end


text:
package se.vidstige.jadb;

import java.io.*;
import java.nio.charset.StandardCharsets;

/**
 * Created by vidstige on 2014-03-19.
 */
public class SyncTransport {

    private final DataOutput output;
    private final DataInput input;

    public SyncTransport(DataOutput outputStream, DataInput inputStream) {
        output = outputStream;
        input = inputStream;
    }

    public void send(String syncCommand, String name) throws IOException {
        if (syncCommand.length() != 4) throw new IllegalArgumentException("sync commands must have length 4");
        output.writeBytes(syncCommand);
        byte[] data = name.getBytes(StandardCharsets.UTF_8);
        output.writeInt(Integer.reverseBytes(data.length));
        output.write(data);
    }

    public void sendStatus(String statusCode, int length) throws IOException {
        output.writeBytes(statusCode);
        output.writeInt(Integer.reverseBytes(length));
    }

    public void verifyStatus() throws IOException, JadbException {
        String status = readString(4);
        int length = readInt();
        if ("FAIL".equals(status)) {
            String error = readString(length);
            throw new JadbException(error);
        }
        if (!"OKAY".equals(status)) {
            throw new JadbException("Unknown error: " + status);
        }
    }

    private int readInt() throws IOException {
        return Integer.reverseBytes(input.readInt());
    }

    private String readString(int length) throws IOException {
        byte[] buffer = new byte[length];
        input.readFully(buffer);
        return new String(buffer, StandardCharsets.UTF_8);
    }

    public void sendDirectoryEntry(RemoteFile file) throws IOException {
        output.writeBytes("DENT");
        output.writeInt(Integer.reverseBytes(0666 | (file.isDirectory() ? (1 << 14) : 0)));
        output.writeInt(Integer.reverseBytes(file.getSize()));
        output.writeInt(Integer.reverseBytes(file.getLastModified()));
        byte[] pathChars = file.getPath().getBytes(StandardCharsets.UTF_8);
        output.writeInt(Integer.reverseBytes(pathChars.length));
        output.write(pathChars);
    }

    public void sendDirectoryEntryDone() throws IOException {
        output.writeBytes("DONE");
        output.writeBytes("\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"); // equivalent to the length of a "normal" dent
    }

    public RemoteFileRecord readDirectoryEntry() throws IOException {
        String id = readString(4);
        int mode = readInt();
        int size = readInt();
        int time = readInt();
        int nameLength = readInt();
        String name = readString(nameLength);

        if (!"DENT".equals(id)) return RemoteFileRecord.DONE;
        return new RemoteFileRecord(name, mode, size, time);
    }

    private void sendChunk(byte[] buffer, int offset, int length) throws IOException {
        output.writeBytes("DATA");
        output.writeInt(Integer.reverseBytes(length));
        output.write(buffer, offset, length);
    }

    private int readChunk(byte[] buffer) throws IOException, JadbException {
        String id = readString(4);
        int n = readInt();
        if ("FAIL".equals(id)) {
            throw new JadbException(readString(n));
        }
        if (!"DATA".equals(id)) return -1;
        input.readFully(buffer, 0, n);
        return n;
    }

    public void sendStream(InputStream in) throws IOException {
        byte[] buffer = new byte[1024 * 64];
        int n = in.read(buffer);
        while (n != -1) {
            sendChunk(buffer, 0, n);
            n = in.read(buffer);
        }
    }

    public void readChunksTo(OutputStream stream) throws IOException, JadbException {
        byte[] buffer = new byte[1024 * 64];
        int n = readChunk(buffer);
        while (n != -1) {
            stream.write(buffer, 0, n);
            n = readChunk(buffer);
        }
    }
}


text:
module Composition
  module Compositions
    class ComposedFrom < ::Composition::Compositions::Composition
      delegate :mapping, to: :inverse_of_composition

      # For a composition defined like:
      #
      #  class User < ActiveRecord::Base
      #    compose :credit_card,
      #            mapping: {
      #              credit_card_name: :name,
      #              credit_card_brand: :brand
      #            }
      #  end
      #
      #  class CreditCard < Composition::Base
      #    composed_from :user
      #  end
      #
      # The setter method will be in charge of implementing @credit_card.name= and @credit_card.brand=.
      #
      # If calling @credit_card.name= it will take care of updating the @name instance variable in
      # @credit_card, but also will take care of keeping @user.credit_card_name in sync with it.
      def setter(obj, setter_attr, setter_value)
        set_instance_variable(obj, setter_attr, setter_value)
        set_parent_attribute(obj, setter_attr, setter_value)
        setter_value
      end

      #TODO: Add documentation
      def attributes(obj)
        aliases.each_with_object({}) do |attr, memo|
          value = obj.send(attr)
          if value.respond_to?(:attributes)
            memo[attr] = value.send(:attributes)
          else
            memo[attr] = value
          end
        end
      end

      def aliases
        mapping.values
      end

      private

      def set_instance_variable(obj, setter_attr, setter_value)
        obj.instance_variable_set("@#{setter_attr}", setter_value)
      end

      def set_parent_attribute(obj, setter_attr, setter_value)
        parent = parent_for(obj)

        if parent
          parent_composition = parent._composition_reflections[inverse_of]
          parent.send("#{parent_composition.actual_column_for(setter_attr)}=", setter_value)
        end
      end

      def inverse_of_composition
        klass._composition_reflections[inverse_of]
      end

      # A composition class can have more than one reference, but only one parent should be not nil
      # at the same time.
      def parent_for(obj)
        obj._composition_reflections.map { |_, composition| obj.send(composition.name).presence }.compact.first
      end
    end
  end
end


text:
@interface MPViewController : UIViewController<UICollectionViewDelegateFlowLayout,UICollectionViewDelegate,UICollectionViewDataSource,UIScrollViewDelegate,MPParallaxCellDelegate>{

    UICollectionView *_collectionView;

}

@end


text:
Impressum

Diese Applikation wird betrieben durch
    <address>
    Matti Mäkitalo

    Hölderlinstraße 11-13

    61462 Königstein

    matti.maekitalo@gmail.com
    </address>

Sie dient der Nutzung zur Planung von Tippkick-Turnieren und ist nicht für die Öffentlichkeit gedacht.


text:
package qin.tinyshop8.domain8;

import qin.tinyshop8.utils.ShopBaseSupport;
import qin.tinyshop8.utils.SuperLongEntity;

import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.util.ArrayList;
import java.util.List;

/**
 * 商品实体类
 *
 * @author qinzhengying
 * @since 1.8 2017/7/19
 */
@SuppressWarnings("all")
public class Goods8
          extends SuperLongEntity
          implements ShopBaseSupport
{
    private final String classAnnotation = "商品实体类";

    //region 构造函数和toString()方法

    @Override
    public String toString()
    {
        final StringBuilder sb = new StringBuilder("Goods8{");
        sb.append(classAnnotation).append('\'');
        sb.append(", goodsAddDate='").append(goodsAddDate).append('\'').append("\n");
        sb.append(", goodsName='").append(goodsName).append('\'').append("\n");
        sb.append(", goodsSubTitle='").append(goodsSubTitle).append('\'').append("\n");
        sb.append(", goodsKeyWords='").append(goodsKeyWords).append('\'').append("\n");
        sb.append(", goodsProNo='").append(goodsProNo).append('\'').append("\n");
        sb.append(", goodsNo='").append(goodsNo).append('\'').append("\n");
        sb.append(", goodsStoreNums=").append(goodsStoreNums).append("\n");
        sb.append(", goodsWeight='").append(goodsWeight).append('\'').append("\n");
        sb.append(", goodsSellPrice=").append(goodsSellPrice).append("\n");
        sb.append(", goodsMarketPrice=").append(goodsMarketPrice).append("\n");
        sb.append(", goodsCostPrice=").append(goodsCostPrice).append("\n");
        sb.append('}').append("\n");
        return sb.toString();
    }

    /**
     * @param goodsAddDate     添加事件
     * @param goodsName        名称
     * @param goodsSubTitle    副标题
     * @param goodsProNo       编号
     * @param goodsNo          货号
     * @param goodsStoreNums   库存
     * @param goodsWeight      重量
     * @param goodsSellPrice   零售价
     * @param goodsMarketPrice 市场价
     * @param goodsCostPrice   成本
     */
    public Goods8(String goodsAddDate, String goodsName,
                  String goodsSubTitle, String goodsProNo,
                  String goodsNo, Integer goodsStoreNums,
                  String goodsWeight, Double goodsSellPrice,
                  Double goodsMarketPrice, Double goodsCostPrice)
    {
        this.goodsAddDate = goodsAddDate;
        this.goodsName = goodsName;
        this.goodsSubTitle = goodsSubTitle;
        this.goodsProNo = goodsProNo;
        this.goodsNo = goodsNo;
        this.goodsStoreNums = goodsStoreNums;
        this.goodsWeight = goodsWeight;
        this.goodsSellPrice = goodsSellPrice;
        this.goodsMarketPrice = goodsMarketPrice;
        this.goodsCostPrice = goodsCostPrice;
    }

    public Goods8() throws Exception
    {
        superLogInfo("正在初始化" + classAnnotation);
    }

    //endregion

    //region 添加时间
    /**
     * 添加时间
     */
    private String goodsAddDate;

    public String getGoodsAddDate()
    {
        return goodsAddDate;
    }

    public void setGoodsAddDate(String goodsAddDate)
    {
        this.goodsAddDate = goodsAddDate;
    }
    //endregion

    //region 读和写

    /**
     * 写方法
     *
     * @param output 需要输出对象
     * @throws IOException 直接抛出大异常
     */
    public void writeObject(ObjectOutputStream output) throws IOException
    {
    }

    /**
     * 读对象
     *
     * @param input 输入对象
     * @throws IOException 直接抛出大异常
     */
    public void readObject(ObjectInputStream input) throws IOException
    {
    }
    //endregion

    //region 商品分类
    /**
     * 商品分类
     */
    private GoodsType8 goodsType;

    public GoodsType8 getGoodsType()
    {
        return goodsType;
    }

    public void setGoodsType(GoodsType8 goodsType)
    {
        this.goodsType = goodsType;
    }
    //endregion

    //region 商品品牌
    /**
     * 商品品牌
     */
    private GoodsBrand8 goodsBrand;

    public GoodsBrand8 getGoodsBrand()
    {
        return goodsBrand;
    }

    public void setGoodsBrand(GoodsBrand8 goodsBrand)
    {
        this.goodsBrand = goodsBrand;
    }
    //endregion

    //region 商品名称
    /**
     * 商品名称
     */
    private String goodsName;

    public String getGoodsName()
    {
        return goodsName;
    }

    public void setGoodsName(String goodsName)
    {
        this.goodsName = goodsName;
    }
    //endregion

    //region 副标题
    /**
     * 副标题
     */
    private String goodsSubTitle;

    public String getGoodsSubTitle()
    {
        return goodsSubTitle;
    }

    public void setGoodsSubTitle(String goodsSubTitle)
    {
        this.goodsSubTitle = goodsSubTitle;
    }
    //endregion

    //region 关键词
    /**
     * 关键词
     */
    private String goodsKeyWords;

    public String getGoodsKeyWords()
    {
        return goodsKeyWords;
    }

    public void setGoodsKeyWords(String goodsKeyWords)
    {
        this.goodsKeyWords = goodsKeyWords;
    }
    //endregion

    //region 编号
    /**
     * 编号
     */
    private String goodsProNo;

    public String getGoodsProNo()
    {
        return goodsProNo;
    }

    public void setGoodsProNo(String goodsProNo)
    {
        this.goodsProNo = goodsProNo;
    }
    //endregion

    //region 相册
    /**
     * 相册
     */
    private List<String> goodsImgs = new ArrayList<>();

    public List<String> getGoodsImgs()
    {
        return goodsImgs;
    }

    public void setGoodsImgs(List<String> goodsImgs)
    {
        this.goodsImgs = goodsImgs;
    }
    //endregion

    //region 货号
    /**
     * 货号
     */
    private String goodsNo;

    public String getGoodsNo()
    {
        return goodsNo;
    }

    public void setGoodsNo(String goodsNo)
    {
        this.goodsNo = goodsNo;
    }
    //endregion

    //region 库存
    /**
     * 库存
     */
    private Integer goodsStoreNums;

    public Integer getGoodsStoreNums()
    {
        return goodsStoreNums;
    }

    public void setGoodsStoreNums(Integer goodsStoreNums)
    {
        this.goodsStoreNums = goodsStoreNums;
    }
    //endregion

    //region 重量
    /**
     * 重量
     */
    private String goodsWeight;

    public String getGoodsWeight()
    {
        return goodsWeight;
    }

    public void setGoodsWeight(String goodsWeight)
    {
        this.goodsWeight = goodsWeight;
    }
    //endregion

    //region 零售价
    /**
     * 零售价
     */
    private Double goodsSellPrice;

    public Double getGoodsSellPrice()
    {
        return goodsSellPrice;
    }

    public void setGoodsSellPrice(Double goodsSellPrice)
    {
        this.goodsSellPrice = goodsSellPrice;
    }
    //endregion

    //region 市场价
    /**
     * 市场价
     */
    private Double goodsMarketPrice;

    public Double getGoodsMarketPrice()
    {
        return goodsMarketPrice;
    }

    public void setGoodsMarketPrice(Double goodsMarketPrice)
    {
        this.goodsMarketPrice = goodsMarketPrice;
    }
    //endregion

    //region 成本价
    /**
     * 成本价
     */
    private Double goodsCostPrice;

    public Double getGoodsCostPrice()
    {
        return goodsCostPrice;
    }

    public void setGoodsCostPrice(Double goodsCostPrice)
    {
        this.goodsCostPrice = goodsCostPrice;
    }
    //endregion
}


text:
<?php

namespace LearnZF2Barcode;

class Module
{
    public function getConfig()
    {
        return include __DIR__.'/config/module.config.php';
    }

    public function getAutoloaderConfig()
    {
        return [
            'Zend\Loader\StandardAutoloader' => [
                'namespaces' => [
                    __NAMESPACE__ => __DIR__.'/src/'.__NAMESPACE__,
                ],
            ],
        ];
    }
}


text:
ACCEPTED

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

#### Published in
Australasian Lichenology 49: 12 (2001)

#### Original name
Parmelina pallida Elix & Kantvilas

### Remarks
null


text:
class Backup(object):
    def __init__(self, bs_node):
        self.bs_node = bs_node

    def __str__(self):
        return 'backup'


text:
// This file is automatically generated.

package adila.db;

/*
 * LG
 *
 * DEVICE: US855
 * MODEL: USCC-US855
 */
final class us855_uscc2dus855 {
    public static final String DATA = "LG||";
}


text:
package org.bouncycastle.pqc.crypto.sphincsplus;

import org.bouncycastle.crypto.params.AsymmetricKeyParameter;

public class SPHINCSPlusKeyParameters
    extends AsymmetricKeyParameter
{
    final SPHINCSPlusParameters parameters;

    protected SPHINCSPlusKeyParameters(boolean isPrivate, SPHINCSPlusParameters parameters)
    {
        super(isPrivate);
        this.parameters = parameters;
    }

    public SPHINCSPlusParameters getParameters()
    {
        return parameters;
    }
}