text:
chrome.app.runtime.onLaunched.addListener(function(){
  var main_window = chrome.app.window.get('main');
  if(main_window){
    main_window.show();
  }else{
    chrome.app.window.create('main.html',{
      'id': 'main',
      'frame':'none',
      'innerBounds':{
        'minWidth': 930,
        'minHeight': 102,
        'maxWidth': 930,
        'maxHeight': 102
      }
    });
  }
});

chrome.app.window.onFullscreened.addListener(function(){
  // do something when the window is set to fullsreeen;
});

chrome.app.window.onMaximized.addListener(function(){
  // do something when the window is set to maximized;
});

chrome.app.window.onMinimized.addListener(function(){
  // do something when the window is set to minimized;
});

chrome.app.window.onRestored.addListener(function(){
  // do something when the window is set to restored;
});

chrome.app.window.onBoundsChanged.addListener(function(){
  // do something when the window is set to resized;
});

chrome.app.window.onClosed.addListener(function(){
  // do something when the window is set to closed;
});


text:
<!DOCTYPE html>

	<link rel="stylesheet" href="bootstrap.min.css">
	<link rel="stylesheet" href="dialpad.css">
	<link rel="stylesheet" href="candybar.css">

Codec<select id="codec"><option value="OPUS">OPUS</option><option value="PCMU">PCMU (Ulaw)</option></select>

    Loading...

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace Symfony\Component\Serializer\Normalizer;

use Symfony\Component\PropertyAccess\Exception\InvalidArgumentException;
use Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException;
use Symfony\Component\PropertyAccess\Exception\UninitializedPropertyException;
use Symfony\Component\PropertyInfo\PropertyTypeExtractorInterface;
use Symfony\Component\PropertyInfo\Type;
use Symfony\Component\Serializer\Encoder\CsvEncoder;
use Symfony\Component\Serializer\Encoder\JsonEncoder;
use Symfony\Component\Serializer\Encoder\XmlEncoder;
use Symfony\Component\Serializer\Exception\ExtraAttributesException;
use Symfony\Component\Serializer\Exception\LogicException;
use Symfony\Component\Serializer\Exception\MissingConstructorArgumentsException;
use Symfony\Component\Serializer\Exception\NotNormalizableValueException;
use Symfony\Component\Serializer\Mapping\AttributeMetadataInterface;
use Symfony\Component\Serializer\Mapping\ClassDiscriminatorFromClassMetadata;
use Symfony\Component\Serializer\Mapping\ClassDiscriminatorResolverInterface;
use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface;
use Symfony\Component\Serializer\NameConverter\NameConverterInterface;

/**
 * Base class for a normalizer dealing with objects.
 *
 * @author Kévin Dunglas <dunglas@gmail.com>
 */
abstract class AbstractObjectNormalizer extends AbstractNormalizer
{
    /**
     * Set to true to respect the max depth metadata on fields.
     */
    public const ENABLE_MAX_DEPTH = 'enable_max_depth';

    /**
     * How to track the current depth in the context.
     */
    public const DEPTH_KEY_PATTERN = 'depth_%s::%s';

    /**
     * While denormalizing, we can verify that types match.
     *
     * You can disable this by setting this flag to true.
     */
    public const DISABLE_TYPE_ENFORCEMENT = 'disable_type_enforcement';

    /**
     * Flag to control whether fields with the value `null` should be output
     * when normalizing or omitted.
     */
    public const SKIP_NULL_VALUES = 'skip_null_values';

    /**
     * Flag to control whether uninitialized PHP>=7.4 typed class properties
     * should be excluded when normalizing.
     */
    public const SKIP_UNINITIALIZED_VALUES = 'skip_uninitialized_values';

    /**
     * Callback to allow to set a value for an attribute when the max depth has
     * been reached.
     *
     * If no callback is given, the attribute is skipped. If a callable is
     * given, its return value is used (even if null).
     *
     * The arguments are:
     *
     * - mixed  $attributeValue value of this field
     * - object $object         the whole object being normalized
     * - string $attributeName  name of the attribute being normalized
     * - string $format         the requested format
     * - array  $context        the serialization context
     */
    public const MAX_DEPTH_HANDLER = 'max_depth_handler';

    /**
     * Specify which context key are not relevant to determine which attributes
     * of an object to (de)normalize.
     */
    public const EXCLUDE_FROM_CACHE_KEY = 'exclude_from_cache_key';

    /**
     * Flag to tell the denormalizer to also populate existing objects on
     * attributes of the main object.
     *
     * Setting this to true is only useful if you also specify the root object
     * in OBJECT_TO_POPULATE.
     */
    public const DEEP_OBJECT_TO_POPULATE = 'deep_object_to_populate';

    /**
     * Flag to control whether an empty object should be kept as an object (in
     * JSON: {}) or converted to a list (in JSON: []).
     */
    public const PRESERVE_EMPTY_OBJECTS = 'preserve_empty_objects';

    private $propertyTypeExtractor;
    private $typesCache = [];
    private $attributesCache = [];

    private $objectClassResolver;

    /**
     * @var ClassDiscriminatorResolverInterface|null
     */
    protected $classDiscriminatorResolver;

    public function __construct(ClassMetadataFactoryInterface $classMetadataFactory = null, NameConverterInterface $nameConverter = null, PropertyTypeExtractorInterface $propertyTypeExtractor = null, ClassDiscriminatorResolverInterface $classDiscriminatorResolver = null, callable $objectClassResolver = null, array $defaultContext = [])
    {
        parent::__construct($classMetadataFactory, $nameConverter, $defaultContext);

        if (isset($this->defaultContext[self::MAX_DEPTH_HANDLER]) && !\is_callable($this->defaultContext[self::MAX_DEPTH_HANDLER])) {
            throw new InvalidArgumentException(sprintf('The "%s" given in the default context is not callable.', self::MAX_DEPTH_HANDLER));
        }

        $this->defaultContext[self::EXCLUDE_FROM_CACHE_KEY] = array_merge($this->defaultContext[self::EXCLUDE_FROM_CACHE_KEY] ?? [], [self::CIRCULAR_REFERENCE_LIMIT_COUNTERS]);

        $this->propertyTypeExtractor = $propertyTypeExtractor;

        if (null === $classDiscriminatorResolver && null !== $classMetadataFactory) {
            $classDiscriminatorResolver = new ClassDiscriminatorFromClassMetadata($classMetadataFactory);
        }
        $this->classDiscriminatorResolver = $classDiscriminatorResolver;
        $this->objectClassResolver = $objectClassResolver;
    }

    /**
     * @param array $context
     */
    public function supportsNormalization(mixed $data, string $format = null /* , array $context = [] */)
    {
        return \is_object($data) && !$data instanceof \Traversable;
    }

    public function normalize(mixed $object, string $format = null, array $context = [])
    {
        if (!isset($context['cache_key'])) {
            $context['cache_key'] = $this->getCacheKey($format, $context);
        }

        $this->validateCallbackContext($context);

        if ($this->isCircularReference($object, $context)) {
            return $this->handleCircularReference($object, $format, $context);
        }

        $data = [];
        $stack = [];
        $attributes = $this->getAttributes($object, $format, $context);
        $class = $this->objectClassResolver ? ($this->objectClassResolver)($object) : $object::class;
        $attributesMetadata = $this->classMetadataFactory?->getMetadataFor($class)->getAttributesMetadata();
        if (isset($context[self::MAX_DEPTH_HANDLER])) {
            $maxDepthHandler = $context[self::MAX_DEPTH_HANDLER];
            if (!\is_callable($maxDepthHandler)) {
                throw new InvalidArgumentException(sprintf('The "%s" given in the context is not callable.', self::MAX_DEPTH_HANDLER));
            }
        } else {
            $maxDepthHandler = null;
        }

        foreach ($attributes as $attribute) {
            $maxDepthReached = false;
            if (null !== $attributesMetadata && ($maxDepthReached = $this->isMaxDepthReached($attributesMetadata, $class, $attribute, $context)) && !$maxDepthHandler) {
                continue;
            }

            $attributeContext = $this->getAttributeNormalizationContext($object, $attribute, $context);

            try {
                $attributeValue = $this->getAttributeValue($object, $attribute, $format, $attributeContext);
            } catch (UninitializedPropertyException $e) {
                if ($context[self::SKIP_UNINITIALIZED_VALUES] ?? $this->defaultContext[self::SKIP_UNINITIALIZED_VALUES] ?? true) {
                    continue;
                }
                throw $e;
            } catch (\Error $e) {
                if (($context[self::SKIP_UNINITIALIZED_VALUES] ?? $this->defaultContext[self::SKIP_UNINITIALIZED_VALUES] ?? true) && $this->isUninitializedValueError($e)) {
                    continue;
                }
                throw $e;
            }

            if ($maxDepthReached) {
                $attributeValue = $maxDepthHandler($attributeValue, $object, $attribute, $format, $attributeContext);
            }

            $attributeValue = $this->applyCallbacks($attributeValue, $object, $attribute, $format, $attributeContext);

            if (null !== $attributeValue && !\is_scalar($attributeValue)) {
                $stack[$attribute] = $attributeValue;
            }

            $data = $this->updateData($data, $attribute, $attributeValue, $class, $format, $attributeContext);
        }

        foreach ($stack as $attribute => $attributeValue) {
            if (!$this->serializer instanceof NormalizerInterface) {
                throw new LogicException(sprintf('Cannot normalize attribute "%s" because the injected serializer is not a normalizer.', $attribute));
            }

            $attributeContext = $this->getAttributeNormalizationContext($object, $attribute, $context);
            $childContext = $this->createChildContext($attributeContext, $attribute, $format);

            $data = $this->updateData($data, $attribute, $this->serializer->normalize($attributeValue, $format, $childContext), $class, $format, $attributeContext);
        }

        $preserveEmptyObjects = $context[self::PRESERVE_EMPTY_OBJECTS] ?? $this->defaultContext[self::PRESERVE_EMPTY_OBJECTS] ?? false;
        if ($preserveEmptyObjects && !\count($data)) {
            return new \ArrayObject();
        }

        return $data;
    }

    protected function instantiateObject(array &$data, string $class, array &$context, \ReflectionClass $reflectionClass, array|bool $allowedAttributes, string $format = null)
    {
        if ($this->classDiscriminatorResolver && $mapping = $this->classDiscriminatorResolver->getMappingForClass($class)) {
            if (!isset($data[$mapping->getTypeProperty()])) {
                throw NotNormalizableValueException::createForUnexpectedDataType(sprintf('Type property "%s" not found for the abstract object "%s".', $mapping->getTypeProperty(), $class), null, ['string'], isset($context['deserialization_path']) ? $context['deserialization_path'].'.'.$mapping->getTypeProperty() : $mapping->getTypeProperty(), false);
            }

            $type = $data[$mapping->getTypeProperty()];
            if (null === ($mappedClass = $mapping->getClassForType($type))) {
                throw NotNormalizableValueException::createForUnexpectedDataType(sprintf('The type "%s" is not a valid value.', $type), $type, ['string'], isset($context['deserialization_path']) ? $context['deserialization_path'].'.'.$mapping->getTypeProperty() : $mapping->getTypeProperty(), true);
            }

            if ($mappedClass !== $class) {
                return $this->instantiateObject($data, $mappedClass, $context, new \ReflectionClass($mappedClass), $allowedAttributes, $format);
            }
        }

        return parent::instantiateObject($data, $class, $context, $reflectionClass, $allowedAttributes, $format);
    }

    /**
     * Gets and caches attributes for the given object, format and context.
     *
     * @return string[]
     */
    protected function getAttributes(object $object, ?string $format, array $context): array
    {
        $class = $this->objectClassResolver ? ($this->objectClassResolver)($object) : $object::class;
        $key = $class.'-'.$context['cache_key'];

        if (isset($this->attributesCache[$key])) {
            return $this->attributesCache[$key];
        }

        $allowedAttributes = $this->getAllowedAttributes($object, $context, true);

        if (false !== $allowedAttributes) {
            if ($context['cache_key']) {
                $this->attributesCache[$key] = $allowedAttributes;
            }

            return $allowedAttributes;
        }

        $attributes = $this->extractAttributes($object, $format, $context);

        if ($this->classDiscriminatorResolver && $mapping = $this->classDiscriminatorResolver->getMappingForMappedObject($object)) {
            array_unshift($attributes, $mapping->getTypeProperty());
        }

        if ($context['cache_key'] && \stdClass::class !== $class) {
            $this->attributesCache[$key] = $attributes;
        }

        return $attributes;
    }

    /**
     * Extracts attributes to normalize from the class of the given object, format and context.
     *
     * @return string[]
     */
    abstract protected function extractAttributes(object $object, string $format = null, array $context = []);

    /**
     * Gets the attribute value.
     *
     * @return mixed
     */
    abstract protected function getAttributeValue(object $object, string $attribute, string $format = null, array $context = []);

    /**
     * @param array $context
     */
    public function supportsDenormalization(mixed $data, string $type, string $format = null /* , array $context = [] */)
    {
        return class_exists($type) || (interface_exists($type, false) && $this->classDiscriminatorResolver && null !== $this->classDiscriminatorResolver->getMappingForClass($type));
    }

    public function denormalize(mixed $data, string $type, string $format = null, array $context = [])
    {
        if (!isset($context['cache_key'])) {
            $context['cache_key'] = $this->getCacheKey($format, $context);
        }

        $this->validateCallbackContext($context);

        if (null === $data && isset($context['value_type']) && $context['value_type'] instanceof Type && $context['value_type']->isNullable()) {
            return null;
        }

        $allowedAttributes = $this->getAllowedAttributes($type, $context, true);
        $normalizedData = $this->prepareForDenormalization($data);
        $extraAttributes = [];

        $reflectionClass = new \ReflectionClass($type);
        $object = $this->instantiateObject($normalizedData, $type, $context, $reflectionClass, $allowedAttributes, $format);
        $resolvedClass = $this->objectClassResolver ? ($this->objectClassResolver)($object) : $object::class;

        foreach ($normalizedData as $attribute => $value) {
            if ($this->nameConverter) {
                $attribute = $this->nameConverter->denormalize($attribute, $resolvedClass, $format, $context);
            }

            $attributeContext = $this->getAttributeDenormalizationContext($resolvedClass, $attribute, $context);

            if ((false !== $allowedAttributes && !\in_array($attribute, $allowedAttributes)) || !$this->isAllowedAttribute($resolvedClass, $attribute, $format, $context)) {
                if (!($context[self::ALLOW_EXTRA_ATTRIBUTES] ?? $this->defaultContext[self::ALLOW_EXTRA_ATTRIBUTES])) {
                    $extraAttributes[] = $attribute;
                }

                continue;
            }

            if ($attributeContext[self::DEEP_OBJECT_TO_POPULATE] ?? $this->defaultContext[self::DEEP_OBJECT_TO_POPULATE] ?? false) {
                try {
                    $attributeContext[self::OBJECT_TO_POPULATE] = $this->getAttributeValue($object, $attribute, $format, $attributeContext);
                } catch (NoSuchPropertyException) {
                }
            }

            $types = $this->getTypes($resolvedClass, $attribute);

            if (null !== $types) {
                try {
                    $value = $this->validateAndDenormalize($types, $resolvedClass, $attribute, $value, $format, $attributeContext);
                } catch (NotNormalizableValueException $exception) {
                    if (isset($context['not_normalizable_value_exceptions'])) {
                        $context['not_normalizable_value_exceptions'][] = $exception;
                        continue;
                    }
                    throw $exception;
                }
            }

            $value = $this->applyCallbacks($value, $resolvedClass, $attribute, $format, $attributeContext);

            try {
                $this->setAttributeValue($object, $attribute, $value, $format, $attributeContext);
            } catch (InvalidArgumentException $e) {
                $exception = NotNormalizableValueException::createForUnexpectedDataType(
                    sprintf('Failed to denormalize attribute "%s" value for class "%s": '.$e->getMessage(), $attribute, $type),
                    $data,
                    ['unknown'],
                    $context['deserialization_path'] ?? null,
                    false,
                    $e->getCode(),
                    $e
                );
                if (isset($context['not_normalizable_value_exceptions'])) {
                    $context['not_normalizable_value_exceptions'][] = $exception;
                    continue;
                }
                throw $exception;
            }
        }

        if ($extraAttributes) {
            throw new ExtraAttributesException($extraAttributes);
        }

        return $object;
    }

    /**
     * Sets attribute value.
     */
    abstract protected function setAttributeValue(object $object, string $attribute, mixed $value, string $format = null, array $context = []);

    /**
     * Validates the submitted data and denormalizes it.
     *
     * @param Type[] $types
     *
     * @throws NotNormalizableValueException
     * @throws ExtraAttributesException
     * @throws MissingConstructorArgumentsException
     * @throws LogicException
     */
    private function validateAndDenormalize(array $types, string $currentClass, string $attribute, mixed $data, ?string $format, array $context): mixed
    {
        $expectedTypes = [];
        $isUnionType = \count($types) > 1;
        $extraAttributesException = null;
        $missingConstructorArgumentException = null;
        foreach ($types as $type) {
            if (null === $data && $type->isNullable()) {
                return null;
            }

            $collectionValueType = $type->isCollection() ? $type->getCollectionValueTypes()[0] ?? null : null;

            // Fix a collection that contains the only one element
            // This is special to xml format only
            if ('xml' === $format && null !== $collectionValueType && (!\is_array($data) || !\is_int(key($data)))) {
                $data = [$data];
            }

            // This try-catch should cover all NotNormalizableValueException (and all return branches after the first
            // exception) so we could try denormalizing all types of an union type. If the target type is not an union
            // type, we will just re-throw the catched exception.
            // In the case of no denormalization succeeds with an union type, it will fall back to the default exception
            // with the acceptable types list.
            try {
                // In XML and CSV all basic datatypes are represented as strings, it is e.g. not possible to determine,
                // if a value is meant to be a string, float, int or a boolean value from the serialized representation.
                // That's why we have to transform the values, if one of these non-string basic datatypes is expected.
                if (\is_string($data) && (XmlEncoder::FORMAT === $format || CsvEncoder::FORMAT === $format)) {
                    if ('' === $data) {
                        if (Type::BUILTIN_TYPE_ARRAY === $builtinType = $type->getBuiltinType()) {
                            return [];
                        }

                        if ($type->isNullable() && \in_array($builtinType, [Type::BUILTIN_TYPE_BOOL, Type::BUILTIN_TYPE_INT, Type::BUILTIN_TYPE_FLOAT], true)) {
                            return null;
                        }
                    }

                    switch ($builtinType ?? $type->getBuiltinType()) {
                        case Type::BUILTIN_TYPE_BOOL:
                            // according to https://www.w3.org/TR/xmlschema-2/#boolean, valid representations are "false", "true", "0" and "1"
                            if ('false' === $data || '0' === $data) {
                                $data = false;
                            } elseif ('true' === $data || '1' === $data) {
                                $data = true;
                            } else {
                                throw NotNormalizableValueException::createForUnexpectedDataType(sprintf('The type of the "%s" attribute for class "%s" must be bool ("%s" given).', $attribute, $currentClass, $data), $data, [Type::BUILTIN_TYPE_BOOL], $context['deserialization_path'] ?? null);
                            }
                            break;
                        case Type::BUILTIN_TYPE_INT:
                            if (ctype_digit('-' === $data[0] ? substr($data, 1) : $data)) {
                                $data = (int) $data;
                            } else {
                                throw NotNormalizableValueException::createForUnexpectedDataType(sprintf('The type of the "%s" attribute for class "%s" must be int ("%s" given).', $attribute, $currentClass, $data), $data, [Type::BUILTIN_TYPE_INT], $context['deserialization_path'] ?? null);
                            }
                            break;
                        case Type::BUILTIN_TYPE_FLOAT:
                            if (is_numeric($data)) {
                                return (float) $data;
                            }

                            return match ($data) {
                                'NaN' => \NAN,
                                'INF' => \INF,
                                '-INF' => -\INF,
                                default => throw NotNormalizableValueException::createForUnexpectedDataType(sprintf('The type of the "%s" attribute for class "%s" must be float ("%s" given).', $attribute, $currentClass, $data), $data, [Type::BUILTIN_TYPE_FLOAT], $context['deserialization_path'] ?? null),
                            };
                    }
                }

                if (null !== $collectionValueType && Type::BUILTIN_TYPE_OBJECT === $collectionValueType->getBuiltinType()) {
                    $builtinType = Type::BUILTIN_TYPE_OBJECT;
                    $class = $collectionValueType->getClassName().'[]';

                    if (\count($collectionKeyType = $type->getCollectionKeyTypes()) > 0) {
                        [$context['key_type']] = $collectionKeyType;
                    }

                    $context['value_type'] = $collectionValueType;
                } elseif ($type->isCollection() && \count($collectionValueType = $type->getCollectionValueTypes()) > 0 && Type::BUILTIN_TYPE_ARRAY === $collectionValueType[0]->getBuiltinType()) {
                    // get inner type for any nested array
                    [$innerType] = $collectionValueType;

                    // note that it will break for any other builtinType
                    $dimensions = '[]';
                    while (\count($innerType->getCollectionValueTypes()) > 0 && Type::BUILTIN_TYPE_ARRAY === $innerType->getBuiltinType()) {
                        $dimensions .= '[]';
                        [$innerType] = $innerType->getCollectionValueTypes();
                    }

                    if (null !== $innerType->getClassName()) {
                        // the builtinType is the inner one and the class is the class followed by []...[]
                        $builtinType = $innerType->getBuiltinType();
                        $class = $innerType->getClassName().$dimensions;
                    } else {
                        // default fallback (keep it as array)
                        $builtinType = $type->getBuiltinType();
                        $class = $type->getClassName();
                    }
                } else {
                    $builtinType = $type->getBuiltinType();
                    $class = $type->getClassName();
                }

                $expectedTypes[Type::BUILTIN_TYPE_OBJECT === $builtinType && $class ? $class : $builtinType] = true;

                if (Type::BUILTIN_TYPE_OBJECT === $builtinType) {
                    if (!$this->serializer instanceof DenormalizerInterface) {
                        throw new LogicException(sprintf('Cannot denormalize attribute "%s" for class "%s" because injected serializer is not a denormalizer.', $attribute, $class));
                    }

                    $childContext = $this->createChildContext($context, $attribute, $format);
                    if ($this->serializer->supportsDenormalization($data, $class, $format, $childContext)) {
                        return $this->serializer->denormalize($data, $class, $format, $childContext);
                    }
                }

                // JSON only has a Number type corresponding to both int and float PHP types.
                // PHP's json_encode, JavaScript's JSON.stringify, Go's json.Marshal as well as most other JSON encoders convert
                // floating-point numbers like 12.0 to 12 (the decimal part is dropped when possible).
                // PHP's json_decode automatically converts Numbers without a decimal part to integers.
                // To circumvent this behavior, integers are converted to floats when denormalizing JSON based formats and when
                // a float is expected.
                if (Type::BUILTIN_TYPE_FLOAT === $builtinType && \is_int($data) && null !== $format && str_contains($format, JsonEncoder::FORMAT)) {
                    return (float) $data;
                }

                if ((Type::BUILTIN_TYPE_FALSE === $builtinType && false === $data) || (Type::BUILTIN_TYPE_TRUE === $builtinType && true === $data)) {
                    return $data;
                }

                if (('is_'.$builtinType)($data)) {
                    return $data;
                }
            } catch (NotNormalizableValueException $e) {
                if (!$isUnionType) {
                    throw $e;
                }
            } catch (ExtraAttributesException $e) {
                if (!$isUnionType) {
                    throw $e;
                }

                $extraAttributesException ??= $e;
            } catch (MissingConstructorArgumentsException $e) {
                if (!$isUnionType) {
                    throw $e;
                }

                $missingConstructorArgumentException ??= $e;
            }
        }

        if ($extraAttributesException) {
            throw $extraAttributesException;
        }

        if ($missingConstructorArgumentException) {
            throw $missingConstructorArgumentException;
        }

        if ($context[self::DISABLE_TYPE_ENFORCEMENT] ?? $this->defaultContext[self::DISABLE_TYPE_ENFORCEMENT] ?? false) {
            return $data;
        }

        throw NotNormalizableValueException::createForUnexpectedDataType(sprintf('The type of the "%s" attribute for class "%s" must be one of "%s" ("%s" given).', $attribute, $currentClass, implode('", "', array_keys($expectedTypes)), get_debug_type($data)), $data, array_keys($expectedTypes), $context['deserialization_path'] ?? $attribute);
    }

    /**
     * @internal
     */
    protected function denormalizeParameter(\ReflectionClass $class, \ReflectionParameter $parameter, string $parameterName, mixed $parameterData, array $context, string $format = null): mixed
    {
        if ($parameter->isVariadic() || null === $this->propertyTypeExtractor || null === $types = $this->getTypes($class->getName(), $parameterName)) {
            return parent::denormalizeParameter($class, $parameter, $parameterName, $parameterData, $context, $format);
        }

        $parameterData = $this->validateAndDenormalize($types, $class->getName(), $parameterName, $parameterData, $format, $context);

        return $this->applyCallbacks($parameterData, $class->getName(), $parameterName, $format, $context);
    }

    /**
     * @return Type[]|null
     */
    private function getTypes(string $currentClass, string $attribute): ?array
    {
        if (null === $this->propertyTypeExtractor) {
            return null;
        }

        $key = $currentClass.'::'.$attribute;
        if (isset($this->typesCache[$key])) {
            return false === $this->typesCache[$key] ? null : $this->typesCache[$key];
        }

        if (null !== $types = $this->propertyTypeExtractor->getTypes($currentClass, $attribute)) {
            return $this->typesCache[$key] = $types;
        }

        if (null !== $this->classDiscriminatorResolver && null !== $discriminatorMapping = $this->classDiscriminatorResolver->getMappingForClass($currentClass)) {
            if ($discriminatorMapping->getTypeProperty() === $attribute) {
                return $this->typesCache[$key] = [
                    new Type(Type::BUILTIN_TYPE_STRING),
                ];
            }

            foreach ($discriminatorMapping->getTypesMapping() as $mappedClass) {
                if (null !== $types = $this->propertyTypeExtractor->getTypes($mappedClass, $attribute)) {
                    return $this->typesCache[$key] = $types;
                }
            }
        }

        $this->typesCache[$key] = false;

        return null;
    }

    /**
     * Sets an attribute and apply the name converter if necessary.
     */
    private function updateData(array $data, string $attribute, mixed $attributeValue, string $class, ?string $format, array $context): array
    {
        if (null === $attributeValue && ($context[self::SKIP_NULL_VALUES] ?? $this->defaultContext[self::SKIP_NULL_VALUES] ?? false)) {
            return $data;
        }

        if ($this->nameConverter) {
            $attribute = $this->nameConverter->normalize($attribute, $class, $format, $context);
        }

        $data[$attribute] = $attributeValue;

        return $data;
    }

    /**
     * Is the max depth reached for the given attribute?
     *
     * @param AttributeMetadataInterface[] $attributesMetadata
     */
    private function isMaxDepthReached(array $attributesMetadata, string $class, string $attribute, array &$context): bool
    {
        $enableMaxDepth = $context[self::ENABLE_MAX_DEPTH] ?? $this->defaultContext[self::ENABLE_MAX_DEPTH] ?? false;
        if (
            !$enableMaxDepth ||
            !isset($attributesMetadata[$attribute]) ||
            null === $maxDepth = $attributesMetadata[$attribute]->getMaxDepth()
        ) {
            return false;
        }

        $key = sprintf(self::DEPTH_KEY_PATTERN, $class, $attribute);
        if (!isset($context[$key])) {
            $context[$key] = 1;

            return false;
        }

        if ($context[$key] === $maxDepth) {
            return true;
        }

        ++$context[$key];

        return false;
    }

    /**
     * Overwritten to update the cache key for the child.
     *
     * We must not mix up the attribute cache between parent and children.
     *
     * @internal
     */
    protected function createChildContext(array $parentContext, string $attribute, ?string $format): array
    {
        $context = parent::createChildContext($parentContext, $attribute, $format);
        $context['cache_key'] = $this->getCacheKey($format, $context);

        return $context;
    }

    /**
     * Builds the cache key for the attributes cache.
     *
     * The key must be different for every option in the context that could change which attributes should be handled.
     */
    private function getCacheKey(?string $format, array $context): bool|string
    {
        foreach ($context[self::EXCLUDE_FROM_CACHE_KEY] ?? $this->defaultContext[self::EXCLUDE_FROM_CACHE_KEY] as $key) {
            unset($context[$key]);
        }
        unset($context[self::EXCLUDE_FROM_CACHE_KEY]);
        unset($context[self::OBJECT_TO_POPULATE]);
        unset($context['cache_key']); // avoid artificially different keys

        try {
            return md5($format.serialize([
                'context' => $context,
                'ignored' => $context[self::IGNORED_ATTRIBUTES] ?? $this->defaultContext[self::IGNORED_ATTRIBUTES],
            ]));
        } catch (\Exception) {
            // The context cannot be serialized, skip the cache
            return false;
        }
    }

    /**
     * This error may occur when specific object normalizer implementation gets attribute value
     * by accessing a public uninitialized property or by calling a method accessing such property.
     */
    private function isUninitializedValueError(\Error $e): bool
    {
        return str_starts_with($e->getMessage(), 'Typed property')
            && str_ends_with($e->getMessage(), 'must not be accessed before initialization');
    }
}


text:
SELECT c.FirstName, c.LastName FROM Rentals AS r
JOIN Inventory AS i ON r.tapeid = i.tapeid
JOIN Movies AS m ON m.movieid = i.movieid
JOIN Customers AS c ON c.custid = r.customerid
JOIN MovieSupplier AS ms ON ms.movieid = m.movieid
JOIN Suppliers AS s ON s.supplierid = ms.supplierid
WHERE m.moviename = 'Fatal Attraction 1987' OR s.SupplierName = 'VWS Video';


text:
use render::*;
use widget::*;

struct App {
    desktop_window: DesktopWindow,
    menu: Menu,
    menu_signal: Signal
}

main_app!(App);

impl App {
    pub fn proto(cx: &mut Cx) -> Self {
        let menu_signal = cx.new_signal();
        Self {
            desktop_window: DesktopWindow::proto(cx),
            menu: Menu::main(vec![
                Menu::sub("Makepad", "M", vec![
                    Menu::item("Quitter!", "q", false, menu_signal, 0),
                    Menu::line(),
                    Menu::item("Thingie", "q", false, menu_signal, 1),
                ]),
                Menu::sub("Edit", "e", vec![
                    Menu::item("Copy", "c", false, menu_signal, 2),
                    Menu::line(),
                    Menu::item("Paste", "v", false, menu_signal, 3),
                ])
            ]),
            menu_signal,
        }
    }

    fn handle_app(&mut self, cx: &mut Cx, event: &mut Event) {
        self.desktop_window.handle_desktop_window(cx, event);
        match event {
            Event::Construct => {
            },
            Event::Signal(se) => if self.menu_signal.is_signal(se){
                println!("CLICKED {}", se.value);
            },
            _ => ()
        }
    }

    fn draw_app(&mut self, cx: &mut Cx) {
        if self.desktop_window.begin_desktop_window(cx, Some(&self.menu)).is_err() {
            return
        };

        self.desktop_window.end_desktop_window(cx);
    }
}


text:
// <copyright file="Stands4ViewCell.xaml.cs" company="University of Murcia">
// Copyright © 2016 University of Murcia
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
// <author>Mattia Zago</author>
// <author>Alessandro Menti</author>

namespace TellOP.ViewModels
{
    using System;
    using DataModels.ApiModels.Stands4;
    using Xamarin.Forms;

    /// <summary>
    /// A <see cref="ViewCell"/> representing a <see cref="Stands4Word"/>.
    /// </summary>
    public partial class Stands4ViewCell : ViewCell
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="Stands4ViewCell"/> class.
        /// </summary>
        public Stands4ViewCell()
        {
            this.InitializeComponent();
        }

        /// <summary>
        /// Called when the details panel is expanded or collapsed.
        /// </summary>
        /// <param name="sender">The object sending the event.</param>
        /// <param name="e">The event parameters.</param>
        private void InvertDetailsPanel(object sender, EventArgs e)
        {
            this.DetailsPanel.IsVisible = !this.DetailsPanel.IsVisible;
            this.DictLabel.Text = this.DetailsPanel.IsVisible ? Properties.Resources.Stands4ViewCell_DictionaryName_Expanded : Properties.Resources.Stands4ViewCell_DictionaryName_Contracted;
        }
    }
}


text:
package com.netflix.zeno.util.collections.impl;

import com.netflix.zeno.util.collections.Comparators;
import com.netflix.zeno.util.collections.algorithms.Sortable;
import com.netflix.zeno.util.collections.algorithms.ArrayQuickSort;
import com.netflix.zeno.util.collections.algorithms.BinarySearch;
import com.netflix.zeno.util.collections.builder.MapBuilder;

import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.Map;
import java.util.SortedMap;

/**
 * Open Addressing hash map immutable implementation of the SortedMap interface
 *
 * @author tvaliulin
 * @author dkoszevnik
 *
 * @param <K>
 * @param <V>
 */
public class OpenAddressingSortedHashMap<K, V> extends OpenAddressingHashMap<K, V> implements MapBuilder<K, V>, SortedMap<K, V>, Sortable<K> {

    public OpenAddressingSortedHashMap() {
        setMap(Collections.<K, V> emptyMap());
    }

    public OpenAddressingSortedHashMap(Map<K, V> map) {
        setMap(map);
    }

    public OpenAddressingSortedHashMap(AbstractArrayMap<K, V> map, int start, int end) {
        super(map, start, end);
    }

    public OpenAddressingSortedHashMap(Map.Entry<K, V>[] entries) {
        setMap(entries);
    }

    @Override
    public SortedMap<K, V> builderFinish() {
        if(keysAndValues.length > size * 2)
            keysAndValues = Arrays.copyOf(keysAndValues, size * 2);

        if (comparator() != null) {
            ArrayQuickSort.sort(this, comparator());
        }
        super.builderFinish();
        return this;
    }

    @Override
    public K at(int index) {
        return key(index);
    }

    @Override
    public void swap(int x, int y) {
        Utils.Array.swap(keysAndValues, x, y);
    }

    @Override
    public int size() {
        return keysAndValues.length / 2;
    }

    @Override
    public Comparator<K> comparator() {
        return Comparators.comparableComparator();
    }

    public SortedMap<K, V> newMap(int start, int end) {
        return new OpenAddressingSortedHashMap<K, V>(this, start, end);
    }

    /// SortedMap implementation ///
    @SuppressWarnings("unchecked")
    @Override
    public SortedMap<K, V> subMap(K fromKey, K toKey) {
        int start = 0;
        if (fromKey != null) {
            start = BinarySearch.binarySearch(this, fromKey, (Comparator<Object>) comparator());
            start = ((start >= 0) ? start : (-start - 1));
            for (int i = start; i >= 0 && i < size() && comparator().compare(key(i), fromKey) >= 0; i--) {
                start = i;
            }
        }
        int end = size();
        if (toKey != null) {
            end = BinarySearch.binarySearch(this, toKey, (Comparator<Object>) comparator());
            end = ((end >= 0) ? end : (-end - 1));
            for (int i = end; i >= 0 && i < size() && comparator().compare(key(i), toKey) < 0; i++) {
                end = i;
            }
        }
        start = Math.max(start, 0);
        end = Math.min(end, size());
        return newMap(start, end);
    }

    @Override
    public SortedMap<K, V> headMap(K toKey) {
        return subMap(null, toKey);
    }

    @Override
    public SortedMap<K, V> tailMap(K fromKey) {
        return subMap(fromKey, null);
    }

    @Override
    public K firstKey() {
        return key(0);
    }

    @Override
    public K lastKey() {
        return key(size() - 1);
    }
}


text:
/*
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 */
/*
 * This code was generated by https://github.com/googleapis/google-api-java-client-services/
 * Modify at your own risk.
 */

package com.google.api.services.vision.v1p1beta1;

/**
 * Available OAuth 2.0 scopes for use with the Cloud Vision API.
 *
 * @since 1.4
 */
public class VisionScopes {

  /** View and manage your data across Google Cloud Platform services. */
  public static final String CLOUD_PLATFORM = "https://www.googleapis.com/auth/cloud-platform";

  /** Apply machine learning models to understand and label images. */
  public static final String CLOUD_VISION = "https://www.googleapis.com/auth/cloud-vision";

  /**
   * Returns an unmodifiable set that contains all scopes declared by this class.
   *
   * @since 1.16
   */
  public static java.util.Set<String> all() {
    java.util.Set<String> set = new java.util.HashSet<String>();
    set.add(CLOUD_PLATFORM);
    set.add(CLOUD_VISION);
    return java.util.Collections.unmodifiableSet(set);
  }

  private VisionScopes() {
  }
}


text:
import sys
import textwrap

names = sorted(sys.modules.keys())
name_text = ', '.join(names)

print textwrap.fill(name_text)


text:
'use strict';

const { assert, flavors, options } = require('../common.js')(__dirname);

describe('config', () => {
  it('extends and overrides parent config', () => {
    assert.deepStrictEqual(flavors('b-c', options()), { value1: 'a', value2: 'b', value3: 'c' });
  });
  it('extends multiple parent configs', () => {
    assert.deepStrictEqual(flavors('d', options()), { value1: 'a', value2: 'b', value3: 'd' });
  });
});


text:
using Orchard.Events;

namespace Orchard.Lists.Services {
    public interface IFilterProvider : IEventHandler {
        void Describe(dynamic describe);
    }
}


text:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Header><MessageHeader xmlns="http://nn.nl/XSD/Generic/MessageHeader/1">
   <From>
      <Id>Ibis4Test</Id>
   </From>
   <To>
      <Location>ESB.HumanResources.BS.AccessRightsManagement.AccessRightsManagement.1.GetUserAndOfficeDataIntermediary.1.Response</Location>
   </To>
   <HeaderFields>
      <CPAId>cpid</CPAId>
      <ConversationId>ConversationId</ConversationId>
      <MessageId>LPAB00000003980_0a5deb96--14c3c15c_14d2ddd4f0a_-7ff1</MessageId>
      <CorrelationId>MessageId</CorrelationId>
      <ExternalRefToMessageId>ExternalRefToMessageId</ExternalRefToMessageId>
      <Timestamp>2015-05-07T12:13:51</Timestamp>
   </HeaderFields>
   <Service>
      <Name>AccessRightsManagement</Name>
      <Context>AccessRightsManagement</Context>
      <Action>
         <Paradigm>Response</Paradigm>
         <Name>GetUserAndOfficeDataIntermediary</Name>
         <Version>1</Version>
      </Action>
   </Service>
</MessageHeader>
</soapenv:Header><soapenv:Body><GetUserAndOfficeDataIntermediary_Response xmlns="http://nn.nl/XSD/HumanResources/AccessRightsManagement/AccessRightsManagement/1/GetUserAndOfficeDataIntermediary/1">
	  <Body>
		    <ReturnCode>1</ReturnCode>
		    <TP>
			      <TPnummer>950</TPnummer>
			      <TPnaam>ToevgMedDt</TPnaam>
			      <Werkmap>Mijn Map</Werkmap>
			      <Postadres>
				        <Straat>Weena post</Straat>
				        <Huisnummer/>
				        <Postcode>1234AA</Postcode>
				        <Plaats>Rotterdam</Plaats>
			      </Postadres>
			      <Bezoekadres>
				        <Straat>Weena bezoek</Straat>
				        <Huisnummer/>
				        <Postcode>1234AB</Postcode>
				        <Plaats>Rotterdam</Plaats>
			      </Bezoekadres>
			      <Telefoonnummer>0104567890</Telefoonnummer>
			      <Faxnummer>0100987654</Faxnummer>
			      <Regio>
				        <Naam>tst_gfmeddet_rn</Naam>
				        <Emailadres>email@dr.es</Emailadres>
			      </Regio>
			      <IncassocodeSchade>5</IncassocodeSchade>
			      <IncassocodeLeven>3</IncassocodeLeven>
			      <FeitelijkLeider>De leider</FeitelijkLeider>
			      <Bedrijfsvorm>NV</Bedrijfsvorm>
			      <Eigenaar>De eigenaar</Eigenaar>
			      <HoofdfiliaalSchade>Schade</HoofdfiliaalSchade>
			      <HoofdfiliaalLeven>Leven</HoofdfiliaalLeven>
			      <Medewerker>
				        <Voornaam>Meneer</Voornaam>
				        <Tussenvoegsels/>
				        <Achternaam>Email</Achternaam>
				        <Emailadres>email@dr.es</Emailadres>
				        <Verkopernummer>1234</Verkopernummer>
				        <Kantoornummer>6789</Kantoornummer>
				        <Kantoornaam>Kantoornaam test</Kantoornaam>
				        <Geslacht>M</Geslacht>
			      </Medewerker>
			      <ADNPostbusNummer/>
			      <BeschikbareTPs>
				        <TP>
					          <TPnummer>950</TPnummer>
					          <TPnaam>ToevgMedDt</TPnaam>
				        </TP>
				        <TP>
					          <TPnummer>951</TPnummer>
					          <TPnaam>ToevgMedDt2</TPnaam>
				        </TP>
				        <TP>
					          <TPnummer>952</TPnummer>
					          <TPnaam>ToevgMedDt3</TPnaam>
				        </TP>
				        <TP>
					          <TPnummer>953</TPnummer>
					          <TPnaam>ToevgMedDt4</TPnaam>
				        </TP>
			      </BeschikbareTPs>
		    </TP>
	  </Body>
   <Result xmlns="http://nn.nl/XSD/Generic/MessageHeader/1">
      <Status>OK</Status>
   </Result>
</GetUserAndOfficeDataIntermediary_Response>
</soapenv:Body></soapenv:Envelope>


text:
echo "WARNING: This script is potentially dangerous. It could cause damage to your data. Use at your own risk"
while true; do
	read -p "Are you sure you want to run continue? (y/n)" yn
	case $yn in
		[Yy]* ) break;;
		[Nn]* ) exit;;
		* ) echo "Please answer y or n.";;
	esac
done

# Make sure only root can run our script
if [[ $EUID -ne 0 ]]; then
   echo "This script must be run as root" 1>&2
   exit 1
fi

# Get the users name
the_user=${SUDO_USER:-${USERNAME:-unknown}}

# The name that will be used for the VM. You may wish to change this.
vm_name="BootableOS"

# Some settings for the VM and their corresponding values. These are just what works for me.
# If you make any changes here be sure that the arrays line up!
vm_settings=(ioapic rtcuseutc mouse vram accelerate3d memory nic1 audio audiocontroller ostype)
vm_settings_values=("on" "on" "usbmultitouch" "64" "on" "1024" "nat" "coreaudio" "ac97" "Ubuntu_64")

# Make sure VBoxManage is installed
if hash VBoxManage 2>/dev/null; then

	# List the available drives
	# Use diskutil if its available
	if hash diskutil 2>/dev/null; then
		sudo -u "${the_user}" diskutil list
	else
		fdisk -l
	fi

	# Prompt the user to choose the correct disk
	read -p "Which Disk has your bootable OS on it? (E.g. if the disk is '/dev/disk1' enter 'disk1')" driveNumber

	# Double check that hey picked the correct one
	while true; do
		read -p "You are about to unmount /dev/${driveNumber}. Are you absolutely sure? (y/n)" yn
		case $yn in
			[Yy]* ) break;;
			[Nn]* ) exit;;
			* ) echo "Please answer yes or no.";;
		esac
	done

	# if the disk is mounted we will need to unmount it.
	# Use diskutil if its available
	if hash diskutil 2>/dev/null; then
		mount | grep -q -m1 -B0 -A0 -w ^"/dev/${driveNumber}" && sudo -u "${the_user}" diskutil unmount "/dev/${driveNumber}"
	else
		mount | grep -q -m1 -B0 -A0 -w ^"/dev/${driveNumber}" && sudo -u "${the_user}" unmount "/dev/${driveNumber}"
	fi

	# VirtualBox needs the disk to be owned by the current user.
	# Make sure it really exists before chowning it.
	if [ -e "/dev/${driveNumber}" ]; then
		chown "${the_user}" "/dev/${driveNumber}"
	else
		echo "/dev/${driveNumber} was not found"
		exit
	fi

	# If there is already a VM with the same name we need to remove it and recreate it.
	sudo -u "${the_user}" VBoxManage showvminfo ${vm_name} | grep -w ^"Name:.*${vm_name}" && sudo -u "${the_user}" VBoxManage unregistervm ${vm_name} --delete
	# Create the new raw disk
	sudo -u "${the_user}" VBoxManage internalcommands createrawvmdk -filename ${vm_name}.vmdk -rawdisk "/dev/${driveNumber}"
	# Create the new VM
	sudo -u "${the_user}" VBoxManage createvm --name "${vm_name}" --register

	# Loop through the settings array and apply each one
	i=0
	let num_settings=${#vm_settings[@]}-1
	while [ $i -le ${num_settings} ]
	do
		read -p "Value for VM setting '${vm_settings[i]}'?(Press return for default '${vm_settings_values[i]}''):" user_value
		if [[ ! -z $user_value ]]; then
			vm_settings_values[i]=${user_value}
		fi
		sudo -u "${the_user}" VBoxManage modifyvm "${vm_name}" --${vm_settings[i]} "${vm_settings_values[i]}"
		((i++))
	done

	# Create an IDE Controller
	sudo -u "${the_user}" VBoxManage storagectl "${vm_name}" --name "IDE Controller" --add ide
	# Attach the raw disk to the IDE Controller
	sudo -u "${the_user}" VBoxManage storageattach "${vm_name}" --storagectl "IDE Controller"  --port 0 --device 0 --type hdd --medium ./${vm_name}.vmdk

	# Ask the user if they would like to start the VM now.
	while true; do
		read -p "Start VM now? (y/n)" yn
		case $yn in
			[Yy]* ) sudo -u "${the_user}" VBoxManage startvm ${vm_name}; break;;
			[Nn]* ) exit;;
			* ) echo "Please answer yes or no.";;
		esac
	done
else
	echo "VBoxManage not found. Exiting."
fi

exit


text:
from django import forms
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.forms import AuthenticationForm, UserCreationForm
from django.contrib.auth import get_user_model
from django.contrib.auth.forms import PasswordResetForm as PasswordResetForm_
from django.contrib.auth.hashers import UNUSABLE_PASSWORD

from .models import Relation

User = get_user_model()

class LoginForm(AuthenticationForm):
    username = forms.EmailField(label=_('e-mail'))

class RegistrationForm(UserCreationForm):
    username = forms.EmailField(label=_('e-mail'))

    class Meta:
        model = User
        fields = []

    def clean_username(self):
        username = self.cleaned_data["username"].lower()

        try:
            User._default_manager.get(**{User.USERNAME_FIELD: username})

        except User.DoesNotExist:
            return username

        raise forms.ValidationError(self.error_messages['duplicate_username'])

class UserForm(forms.ModelForm):

    class Meta:
        model = User
        fields = ('first_name', 'last_name', 'gender', 'birthdate', 'company', 'position', 'city', 'phone', 'web', 'is_active', 'is_confirmed', 'is_superuser', 'photo', 'time_zone')
        widgets = {
            'photo': forms.FileInput(),
        }

    def __init__(self, *args, **kwargs):
        super(UserForm, self).__init__(*args, **kwargs)

    def save(self, *args, **kwargs):
        instance = super(UserForm, self).save(*args, **kwargs)

        return instance

class RelationForm(forms.ModelForm):

    class Meta:
        model = Relation
        fields = ('mate', 'is_blocked', )

class RelationReverseForm(forms.ModelForm):

    class Meta:
        model = Relation
        fields = ('is_confirmed', 'is_blocked', )

class RelationCreateForm(forms.ModelForm):
    email = forms.EmailField(label=_('e-mail'))

    class Meta:
        model = Relation
        fields = ()

class PasswordResetForm(PasswordResetForm_):

    def clean_email(self):
        """
        Validates that an active user exists with the given email address.
        """
        UserModel = get_user_model()

        email = self.cleaned_data["email"].lower()

        self.users_cache = UserModel._default_manager.filter(email=email)

        if not len(self.users_cache):
            raise forms.ValidationError(self.error_messages['unknown'])

        if not any(user.is_active for user in self.users_cache):
            # none of the filtered users are active
            raise forms.ValidationError(self.error_messages['unknown'])

        if any((user.password == UNUSABLE_PASSWORD) for user in self.users_cache):
            raise forms.ValidationError(self.error_messages['unusable'])

        return email

    def save(self):
        # do nothing (overrides)
        pass


text:
<?php

/* $Id: positioner.cls.php 283 2010-07-19 17:57:40Z fabien.menager $ */

/**
 * Base Positioner class
 *
 * Defines postioner interface
 *
 * @access private
 * @package dompdf
 */
abstract class Positioner {

  // protected members
  protected $_frame;

  //........................................................................

  function __construct(Frame_Decorator $frame) {
    $this->_frame = $frame;
  }

  /**
   * Class destructor
   */
  function __destruct() {
  	clear_object($this);
  }
  //........................................................................

  abstract function position();

}


text:
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil

class TestCase(TestBase):

    mydir = TestBase.compute_mydir(__file__)

    def test(self):
        self.build()
        lldbutil.run_to_source_breakpoint(self, "// break here", lldb.SBFileSpec("main.c"))

        self.expect("statistics disable", substrs=['need to enable statistics before disabling'], error=True)

        # 'expression' should change the statistics.
        self.expect("statistics enable")
        self.expect("statistics enable", substrs=['already enabled'], error=True)
        self.expect("expr patatino", substrs=['27'])
        self.expect("statistics disable")
        self.expect("statistics dump", substrs=['expr evaluation successes : 1\n',
                                                'expr evaluation failures : 0\n'])

        self.expect("statistics enable")
        # Doesn't parse.
        self.expect("expr doesnt_exist", error=True,
                    substrs=["undeclared identifier 'doesnt_exist'"])
        # Doesn't successfully execute.
        self.expect("expr int *i = nullptr; *i", error=True)
        # Interpret an integer as an array with 3 elements is also a failure.
        self.expect("expr -Z 3 -- 1", error=True,
                    substrs=["expression cannot be used with --element-count"])
        self.expect("statistics disable")
        # We should have gotten 3 new failures and the previous success.
        self.expect("statistics dump", substrs=['expr evaluation successes : 1\n',
                                                'expr evaluation failures : 3\n'])

        # 'frame var' with disabled statistics shouldn't change stats.
        self.expect("frame var", substrs=['27'])

        self.expect("statistics enable")
        # 'frame var' with enabled statistics will change stats.
        self.expect("frame var", substrs=['27'])
        self.expect("statistics disable")
        self.expect("statistics dump", substrs=['frame var successes : 1\n',
                                                'frame var failures : 0\n'])


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

namespace Microsoft.Xml.Schema
{
    using System;
    using System.IO;
    using System.Text;
    using System.Resources;
    using System.Globalization;
    using System.Diagnostics;
    // using System.Security.Permissions;

    /// <include file='doc\XmlSchemaException.uex' path='docs/doc[@for="XmlSchemaException"]/*' />
    // [Serializable],
    public class XmlSchemaException : System.Exception
    {
        private string _res;
        private string[] _args;
        private string _sourceUri;
        private int _lineNumber;
        private int _linePosition;

        [NonSerialized]
        private XmlSchemaObject _sourceSchemaObject;

        // message != null for V1 exceptions deserialized in Whidbey
        // message == null for V2 or higher exceptions; the exception message is stored on the base class (Exception._message)
        private string _message = null;

        /// <include file='doc\XmlSchemaException.uex' path='docs/doc[@for="XmlSchemaException.XmlSchemaException1"]/*' />
        public XmlSchemaException() : this(null)
        {
        }

        /// <include file='doc\XmlSchemaException.uex' path='docs/doc[@for="XmlSchemaException.XmlSchemaException2"]/*' />
        public XmlSchemaException(String message) : this(message, ((Exception)null), 0, 0)
        {
#if DEBUG
            Debug.Assert(message == null || !message.StartsWith("Sch_", StringComparison.Ordinal), "Do not pass a resource here!");
#endif
        }

        /// <include file='doc\XmlSchemaException.uex' path='docs/doc[@for="XmlSchemaException.XmlSchemaException0"]/*' />
        public XmlSchemaException(String message, Exception innerException) : this(message, innerException, 0, 0)
        {
        }

        /// <include file='doc\XmlSchemaException.uex' path='docs/doc[@for="XmlSchemaException.XmlSchemaException3"]/*' />
        public XmlSchemaException(String message, Exception innerException, int lineNumber, int linePosition) :
            this((message == null ? ResXml.Sch_DefaultException : ResXml.Xml_UserException), new string[] { message }, innerException, null, lineNumber, linePosition, null)
        {
        }

        internal XmlSchemaException(string res, string[] args) :
            this(res, args, null, null, 0, 0, null)
        { }

        internal XmlSchemaException(string res, string arg) :
            this(res, new string[] { arg }, null, null, 0, 0, null)
        { }

        internal XmlSchemaException(string res, string arg, string sourceUri, int lineNumber, int linePosition) :
            this(res, new string[] { arg }, null, sourceUri, lineNumber, linePosition, null)
        { }

        internal XmlSchemaException(string res, string sourceUri, int lineNumber, int linePosition) :
            this(res, (string[])null, null, sourceUri, lineNumber, linePosition, null)
        { }

        internal XmlSchemaException(string res, string[] args, string sourceUri, int lineNumber, int linePosition) :
            this(res, args, null, sourceUri, lineNumber, linePosition, null)
        { }

        internal XmlSchemaException(string res, XmlSchemaObject source) :
            this(res, (string[])null, source)
        { }

        internal XmlSchemaException(string res, string arg, XmlSchemaObject source) :
            this(res, new string[] { arg }, source)
        { }

        internal XmlSchemaException(string res, string[] args, XmlSchemaObject source) :
            this(res, args, null, source.SourceUri, source.LineNumber, source.LinePosition, source)
        { }

        internal XmlSchemaException(string res, string[] args, Exception innerException, string sourceUri, int lineNumber, int linePosition, XmlSchemaObject source) :
            base(CreateMessage(res, args), innerException)
        {
            HResult = HResults.XmlSchema;
            _res = res;
            _args = args;
            _sourceUri = sourceUri;
            _lineNumber = lineNumber;
            _linePosition = linePosition;
            _sourceSchemaObject = source;
        }

        internal static string CreateMessage(string res, string[] args)
        {
            try
            {
                return string.Format(res, args);
            }
            catch (MissingManifestResourceException)
            {
                return "UNKNOWN(" + res + ")";
            }
        }

        internal string GetRes
        {
            get
            {
                return _res;
            }
        }

        internal string[] Args
        {
            get
            {
                return _args;
            }
        }
        /// <include file='doc\XmlSchemaException.uex' path='docs/doc[@for="XmlSchemaException.SourceUri"]/*' />
        public string SourceUri
        {
            get { return _sourceUri; }
        }

        /// <include file='doc\XmlSchemaException.uex' path='docs/doc[@for="XmlSchemaException.LineNumber"]/*' />
        public int LineNumber
        {
            get { return _lineNumber; }
        }

        /// <include file='doc\XmlSchemaException.uex' path='docs/doc[@for="XmlSchemaException.LinePosition"]/*' />
        public int LinePosition
        {
            get { return _linePosition; }
        }

        /// <include file='doc\XmlSchemaException.uex' path='docs/doc[@for="XmlSchemaException.SourceObject"]/*' />
        public XmlSchemaObject SourceSchemaObject
        {
            get { return _sourceSchemaObject; }
        }

        /*internal static XmlSchemaException Create(string res) { //Since internal overload with res string will clash with public constructor that takes in a message
            return new XmlSchemaException(res, (string[])null, null, null, 0, 0, null);
        }*/

        internal void SetSource(string sourceUri, int lineNumber, int linePosition)
        {
            _sourceUri = sourceUri;
            _lineNumber = lineNumber;
            _linePosition = linePosition;
        }

        internal void SetSchemaObject(XmlSchemaObject source)
        {
            _sourceSchemaObject = source;
        }

        internal void SetSource(XmlSchemaObject source)
        {
            _sourceSchemaObject = source;
            _sourceUri = source.SourceUri;
            _lineNumber = source.LineNumber;
            _linePosition = source.LinePosition;
        }

        internal void SetResourceId(string resourceId)
        {
            _res = resourceId;
        }

        public override string Message
        {
            get
            {
                return (_message == null) ? base.Message : _message;
            }
        }
    };
} // namespace Microsoft.Xml.Schema


text:
   value (Anything):
   An object, array, or primitive of any value.


text:
namespace Microsoft.Azure.Management.ApiManagement.Models
{

    /// <summary>
    /// Defines values for IssueType.
    /// </summary>
    public static class IssueType
    {
        public const string Unknown = "Unknown";
        public const string AgentStopped = "AgentStopped";
        public const string GuestFirewall = "GuestFirewall";
        public const string DnsResolution = "DnsResolution";
        public const string SocketBind = "SocketBind";
        public const string NetworkSecurityRule = "NetworkSecurityRule";
        public const string UserDefinedRoute = "UserDefinedRoute";
        public const string PortThrottled = "PortThrottled";
        public const string Platform = "Platform";
    }
}


text:
get '/decks' do
  @decks = Deck.order(:topic)
  erb :'/decks/index'
end

get '/decks/:deck_id/cards/:card_id' do
  @deck = Deck.find(params[:deck_id])
  @card = @deck.cards.find(params[:card_id])
  erb :'cards/show'
end

#if answer is true.  Update Guess.correct to true
#remove card from deck
#show answer is correct onpage button to go tonext question

#if wrong display wrong.  put card in back. display correc submit button question
post '/decks/:deck_id/cards/:card_id' do
  @deck = Deck.find(params([:deck_id]))
  @card = deck.cards.find(params[:card_id])
  if params[:user_guess] == @card.answer
    card.guess.correct = true

  else
    thigns are false
  end
end


text:
var fs = require('fs');
var path = require('path');
var webpack = require('webpack');
var merge = require('webpack-merge');
var ExtractTextPlugin = require("extract-text-webpack-plugin");

var TARGET = process.env.TARGET;
var ROOT_PATH = path.resolve(__dirname);

/*var nodeModules = {};
fs.readdirSync('./node_modules')
  .filter(function(x) {
    return ['.bin'].indexOf(x) === -1;
  })
  .forEach(function(mod) {
    nodeModules[mod] = 'commonjs ' + mod;
  });*/

var common = {
  entry: {
    app: path.resolve(ROOT_PATH, 'src/app/client/index.js'),
    styles: path.resolve(ROOT_PATH, 'src/styles/app.styl')
  },
  output: {
    path: path.resolve(ROOT_PATH, 'build/public'),
    filename: 'app.js',
  },
  //externals: nodeModules,
  module: {
    loaders: [
      {
        test: /\.jsx?$/,
        exclude: /node_modules/,
        loaders: ['babel?stage=0']
      },
      {
        test: /\.styl$/,
        exclude: /node_modules/,
        loader: ExtractTextPlugin.extract('style', 'css!stylus')
      },
      {
        test: /\.json$/,
        loader: 'json-loader'
      }
    ]
  },
  plugins: [
    new ExtractTextPlugin('styles.css')
  ]
};

if (TARGET === 'build') {
  module.exports = merge(common, {
    devtool: 'source-map',
    loaders: [
      { test: /\.json$/, exclude: /node_modules/, loader: 'json' }
    ],
    plugins: [
      new webpack.DefinePlugin({
        'process.env': {
          'NODE_ENV': JSON.stringify('production')
        }
      }),
      new webpack.optimize.UglifyJsPlugin({
        compress: {
          warnings: false
        }
      })
    ]
  })
}

if (TARGET === 'dev') {
  module.exports = merge(common, {
    devtool: 'eval',
    entry: [
      'webpack/hot/dev-server'
    ],
    module: {
      loaders: [{
        test: /\.jsx?$/,
        exclude: /node_modules/,
        loaders: ['react-hot', 'babel?stage=0']
      }]
    }
  })
}


text:
<?php

namespace Core\Cache;

class BlockCacheListener
{
    protected $_tags = array();
    protected $_clearedTags = array();

    public function onFlush(\Doctrine\ORM\Event\OnFlushEventArgs $eventArgs)
    {
        $em = $eventArgs->getEntityManager();
        $uow = $em->getUnitOfWork();

        foreach ($uow->getScheduledEntityInsertions() AS $entity) {
            $this->findTags($entity);
        }

        foreach ($uow->getScheduledEntityUpdates() AS $entity) {
            $this->findTags($entity);
        }

        foreach ($uow->getScheduledEntityDeletions() AS $entity) {
            $this->findTags($entity);
        }

        foreach ($uow->getScheduledCollectionDeletions() AS $col) {

        }

        foreach ($uow->getScheduledCollectionUpdates() AS $col) {

        }

        $this->clearCache();
    }

    public function clearCache()
    {
        $blockCache = \Zend_Registry::get('serviceContainer')->getService('blockCache');
        $tagsToClear = \array_diff($this->getTags(), $this->_clearedTags);
        $blockCache->clean(\Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG, $tagsToClear);
        $this->_clearedTags = $this->getTags();
    }

    private function findTags($entity)
    {
        $class = \get_class($entity);
        $classNameArray = explode('\\', $class);
        $this->addTag($classNameArray[0]);
    }

    public function getTags()
    {
        return $this->_tags;
    }

    public function setTags($tags)
    {
        $this->_tags = $tags;
    }

    public function addTag($tag)
    {
        if(\is_string($tag) && !\in_array($tag, $this->getTags())) {
            $this->_tags[] = $tag;
        }
    }

    public function reset()
    {
        $this->_tags = array();
    }
}


text:
"""
   Copyright (c) 2012 The Ohio State University.

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.

"""

import os;
import subprocess;
import sys;

CURRENT_DIR = os.getcwd();
FRONTEND_DIR = 'SQL2XML';
BACKEND_DIR = 'XML2MapReduce';
EXEC_DIR = 'bin';

def install_frontend():
	os.mkdir(CURRENT_DIR + '/' + EXEC_DIR);
	print '--------------------------------------------------------------------';
	print 'Compiling front-end SQL queries lexer and parser ...';
	print '--------------------------------------------------------------------';
	os.chdir(CURRENT_DIR + '/' + FRONTEND_DIR);
	subprocess.check_call('tar xzvf antlr-3.3.tar.gz', shell=True);
	print '--------------------------------------------------------------------';
	print 'Generating lexer and parser ...';
	print "java -jar antlr-3.3/lib/antlr-3.3-complete.jar YSmart.g"
	print '--------------------------------------------------------------------';
	subprocess.check_call('java -jar antlr-3.3/lib/antlr-3.3-complete.jar YSmart.g', shell=True)

	os.chdir(CURRENT_DIR + '/' + FRONTEND_DIR + '/antlr-3.3/runtime/C/dist');
	subprocess.check_call(['tar', 'xzvf', 'libantlr3c-3.1.4-SNAPSHOT.tar.gz', '-C', CURRENT_DIR + '/' + FRONTEND_DIR]);

	os.chdir(CURRENT_DIR + '/' + FRONTEND_DIR + '/libantlr3c-3.1.4-SNAPSHOT');
	subprocess.check_call('./configure --prefix=/tmp/antrl_runtime_install_dir', shell=True);
	subprocess.check_call('make install', shell=True);

	os.chdir(CURRENT_DIR + '/' + FRONTEND_DIR);
	print '--------------------------------------------------------------------';
	print 'Compiling ...';
	print 'gcc -o YSmartFront.exe YSmartMain.c YSmartLexer.c YSmartParser.c /tmp/antrl_runtime_install_dir/lib/libantlr3c.a -I . -I /tmp/antrl_runtime_install_dir/include/';
	print '--------------------------------------------------------------------';
	subprocess.check_call(['gcc', '-m32', '-o', 'YSmartFront.exe', 'YSmartMain.c', 'YSmartLexer.c', 'YSmartParser.c', \
				   '/tmp/antrl_runtime_install_dir/lib/libantlr3c.a', '-I', '.', '-I', '/tmp/antrl_runtime_install_dir/include/']);
	subprocess.check_call(['mv', 'YSmartFront.exe', CURRENT_DIR + '/' + EXEC_DIR]);
	print '--------------------------------------------------------------------';
	print 'Front-end SQL queries lexer and parser have been compiled';
	print '--------------------------------------------------------------------';

	print '--------------------------------------------------------------------';
	print 'Preoparing back-end hadoop job generator';
	print '--------------------------------------------------------------------';

	#print 'TODO: make a soft link of job generation program in ./bin/';

def install_backend():
	os.chdir(CURRENT_DIR)
	subprocess.check_call(['ln', '-sf', BACKEND_DIR + '/main.py', EXEC_DIR + '/main.py']);

def uninstall():
	print '--------------------------------------------------------------------';
	print 'Cleaning front-end SQL queries lexer and parser ...'
	print '--------------------------------------------------------------------';
	os.chdir(CURRENT_DIR + '/' + FRONTEND_DIR);
	subprocess.check_call(['rm', '-rf', 'antlr-3.3', 'libantlr3c-3.1.4-SNAPSHOT', '/tmp/antrl_runtime_install_dir']);
	subprocess.check_call(['rm', 'YSmartLexer.h', 'YSmartLexer.c', 'YSmartParser.h', 'YSmartParser.c', 'YSmart.tokens']);

	print '--------------------------------------------------------------------';
	print 'Cleaning ' + EXEC_DIR + ' ...';
	print '--------------------------------------------------------------------';
	os.chdir(CURRENT_DIR);
	subprocess.check_call(['rm', '-rf', './' + EXEC_DIR]);

	print '--------------------------------------------------------------------';
	print 'Done';
	print '--------------------------------------------------------------------';

def print_usage():
	print 'usage: ./setup.py install/uninstall';

def main():
	if (len(sys.argv) != 2):
		print_usage();
		sys.exit(0);
	if (sys.argv[1] == 'install'):
		install_frontend();
#		install_backend();
	elif (sys.argv[1] == 'uninstall'):
		uninstall();
	else:
		print_usage();
		sys.exit(0);

if __name__ == "__main__":
    main();


text:
{% extends "govuk_template.html" %}

{% block head %}
  {% include "includes/head.html" %}
{% endblock %}

{% block proposition_header %}
  {% include "includes/propositional_navigation.html" %}
{% endblock %}

{% block header_class %}
  with-proposition
{% endblock %}

{% block page_title %}
  View your mortgage deed
{% endblock %}

{% block content %}

	{% include "includes/phase_banner_beta.html" %}

Sign your mortgage deed

To do this you will need:

to verify your identity using GOV.UK verify

to have the mobile phone you registered with your conveyancer ready

to have the borrower reference supplied to you by the conveyancer

					By using this service you consent to Land Registry retaining your personal details for fraud prevention
					and detection purposes. You also consent to Land Registry carrying out third party checks in relation to
					the information supplied.

					For further information please view our

						Personal Information Charter.

			Start now

					Why is the government involved in this?

The Land Registry registers any interests affecting registered land,
				such as a change of mortgage. Find out more
				here.

{% endblock %}

{% block body_end %}
  {% include "includes/scripts.html" %}

{% endblock %}


text:
package griffon.swing.support.feedicons;

import griffon.plugins.feedicons.Feed;

import javax.annotation.Nonnull;
import javax.swing.ImageIcon;
import java.awt.Toolkit;
import java.net.URL;

import static griffon.plugins.feedicons.Feed.invalidDescription;
import static griffon.plugins.feedicons.Feed.requireValidSize;
import static griffon.util.GriffonNameUtils.requireNonBlank;
import static java.util.Objects.requireNonNull;

/**
 * @author Andres Almiray
 */
public class FeedIcon extends ImageIcon {
    private static final String ERROR_FEED_NULL = "Argument 'feed' must not be null";
    private Feed feed;
    private int size;

    public FeedIcon() {
        this(Feed.findByDescription("feed:16"));
    }

    public FeedIcon(@Nonnull Feed feed) {
        this(feed, 16);
    }

    public FeedIcon(@Nonnull Feed feed, int size) {
        super(toURL(feed, size));
        this.feed = requireNonNull(feed, ERROR_FEED_NULL);
        this.size = size;
    }

    public FeedIcon(@Nonnull String description) {
        this(Feed.findByDescription(description));
        setFeed(description);
    }

    @Nonnull
    private static URL toURL(@Nonnull Feed feed, int size) {
        requireNonNull(feed, ERROR_FEED_NULL);
        String resource = feed.asResource(size);
        URL url = Thread.currentThread().getContextClassLoader().getResource(resource);
        if (url == null) {
            throw new IllegalArgumentException("Icon " + feed + " does not exist");
        }
        return url;
    }

    @Nonnull
    public Feed getFeed() {
        return feed;
    }

    public void setFeed(@Nonnull Feed feed) {
        this.feed = requireNonNull(feed, ERROR_FEED_NULL);
        setImage(Toolkit.getDefaultToolkit().getImage(toURL(feed, size)));
    }

    public void setFeed(@Nonnull String description) {
        requireNonBlank(description, "Argument 'description' must not be blank");

        String[] parts = description.split(":");
        if (parts.length == 2) {
            try {
                int s = Integer.parseInt(parts[1]);
                this.size = requireValidSize(s);
            } catch (NumberFormatException e) {
                throw invalidDescription(description, e);
            }
        } else if (size == 0) {
            size = 16;
        }

        feed = Feed.findByDescription(description);
        setImage(Toolkit.getDefaultToolkit().getImage(toURL(feed, size)));
    }

    public int getSize() {
        return size;
    }

    public void setSize(int size) {
        this.size = requireValidSize(size);
        setImage(Toolkit.getDefaultToolkit().getImage(toURL(feed, size)));
    }
}