text:
"""Configurable settings module."""

import ConfigParser
import importlib
import logging
import os
import re
import sys
import types

from simian.auth import x509

# If True, all domain users have (readonly) access to web UI. If False, only
# define admins, support, security, etc. users have access.
# TODO(user): move setting to Datastore.
ALLOW_ALL_DOMAIN_USERS_READ_ACCESS = False
ALLOW_SELF_REPORT = True

# Automatic values:
# True if running in debug mode.
DEBUG = False
# True if running in dev_appserver.
DEV_APPSERVER = False
# True if running in Google App Engine.
GAE = False
# True if running in unit testing environment.
TESTING = False
# True if running in unit testing environment and settings_test is under test.
SETTINGS_TESTING = False

if (os.environ.get('SERVER_SOFTWARE', '').startswith('Development') and
    'testbed' not in os.environ.get('SERVER_SOFTWARE', '')):
  logging.getLogger().setLevel(logging.DEBUG)
  DEBUG = True
  DEV_APPSERVER = True
  GAE = True
elif os.environ.get('SERVER_SOFTWARE', '').startswith('Google App Engine'):
  GAE = True

# If unit tests for this module are running, set SETTINGS_TEST to True.
if os.environ.get('____TESTING_SETTINGS_MODULE'):
  SETTINGS_TESTING = True

# If unit tests are running, set TESTING to True.
if 'unittest2' in sys.modules or 'unittest' in sys.modules:
  TESTING = True

if GAE:
  SERVER_HOSTNAME = os.environ.get('DEFAULT_VERSION_HOSTNAME')

# To require a second administrator to approve changes set this to True.
APPROVAL_REQUIRED = False

# To allow a group of non-admin users to make proposals set this to True.
ENABLE_PROPOSALS_GROUP = False

class BaseSettings(types.ModuleType):
  """Base class for a settings container that acts like a module.

  An instance of this class can replace a loaded module to provide read and
  write access to settings variables via attribute access.

  Don't use this class directly, use a child class.

  Child classes should implement:
    - _Get()
    - _Set()
    - _Dir()

  Child classes can optionally implement:
    - _Initialize()
    - _PopulateGlobals()
    - _CheckValidation()

  Child classes can use these helper functions to configure themselves:
    - _SetValidation()

  This class will do a few things upon initialization:
    - Copy attributes from the module e.g. __author__
    - Run _PopulateGlobals(), which will:
      - Copy already defined CONSTANTS into the settings
      - Override this method in subclasses if this feature is undesired.
    - Call _Initialize() which provides for per-class initialization.

  Due to code style requirements where constants should be UPPERCASE,
  BaseSettings is very specific about attribute and key name case handling.

  No matter how subclass underlying code stores key/value pairs, the
  settings attributes will always be made available via "UPPER_CASE_NAME".
  The _Get() and _Set() methods will always receive the corresponding
  "upper_case_name".

  e.g.
    settings.FOO          =>  _Get('foo')
    settings.FOO = 'bar'  =>  _Set('foo', 'bar')
  """

  # These constant values should match the method names that perform
  # the validation.
  _VALIDATION_REGEX = '_CheckValueRegex'
  _VALIDATION_FUNC = '_CheckValueFunc'
  _VALIDATION_PEM_X509_CERT = 'CheckValuePemX509Cert'
  _VALIDATION_PEM_RSA_PRIVATE_KEY = 'CheckValuePemRsaPrivateKey'
  _VALIDATION_TYPES = [
      _VALIDATION_REGEX, _VALIDATION_FUNC,
      _VALIDATION_PEM_X509_CERT, _VALIDATION_PEM_RSA_PRIVATE_KEY]

  def __init__(self, module, *args, **kwargs):
    """Init.

    Args:
      module: module, the module that this class instance is replacing.
    """
    # pylint: disable=non-parent-init-called
    types.ModuleType.__init__(self, module.__name__, *args, **kwargs)
    self._module = module
    if hasattr(module, '__doc__'):
      self.__doc__ = module.__doc__
    if hasattr(module, '__author__'):
      self.__author__ = module.__author__
    self._is_class = 1
    self._validation = {}
    self._Initialize()
    self._PopulateGlobals()

  def _Initialize(self):
    """Initialize the class.

    Example usage: set up the storage that will be used for settings.

    DO NOT call superclass _Initialize() methods!
    This method will remain specific to each class.
    """
    pass  # intentional

  def _Globals(self):
    """Return globals() or an overridden value."""
    return globals()

  def _PopulateGlobals(self, set_func=None, globals_=None):
    """Find global VARIABLES and load them as settings, if possible.

    Args:
      set_func: function, otherwise defaults to self._Set. Replacement
        function should follow the same interface.
      globals_: function, default globals, return all global variables
        as dict.
    """
    if set_func is None:
      set_func = self._Set
    if globals_ is None:
      globals_ = self._Globals
    for k in globals_():
      if k.upper() == k and not callable(globals_()[k]):
        try:
          set_func(k.lower(), globals_()[k])
        except NotImplementedError:
          break

  def _Get(self, k):
    """Get one settings item.

    Args:
      k: str, name to get. The name will always be in lowercase.
    Returns:
      any settings value
    Raises:
      NotImplementedError: if this method is not implemented.
      AttributeError(k): if this settings item does not exist.
    """
    raise NotImplementedError

  def _Set(self, k, v):
    """Set one settings item.

    Args:
      k: str, name to set. The name will always be in lowercase.
      v: str, value to set.
    Raises:
      NotImplementedError: if this method is not implemented.
    """
    raise NotImplementedError

  def _Dir(self):
    """Returns directory of all settings names as a list.

    Raises:
      NotImplementedError: if this method is not implemented.
    """
    raise NotImplementedError

  def _CheckValueRegex(self, k, v, regex):
    """Check whether v meets regex validation for setting k.

    Args:
      k: str, settings name.
      v: any value.
      regex: str or compiled re.RegexObject.
    Returns:
      None if the value is appropriate and can be set.
    Raises:
      ValueError: if the value is not appropriately formed to be set for k.
    """
    if isinstance(regex, basestring):
      regex = re.compile(regex)

    m = regex.search(str(v))
    if m is None:
      raise ValueError('Invalid value "%s" for %s' % (v, k))

  def _CheckValueFunc(self, k, v, func):
    """Check whether v meets func validation for setting k.

    Args:
      k: str, name.
      v: any value.
      func: func, callable, call and expect True/False.
    Returns:
      None if the value is appropriate and can be set.
    Raises:
      ValueError: if the value is not appropriately formed to be set for k.
    """
    if not callable(func):
      raise TypeError('func is not callable')

    b = func(k, v)

    if b == True:
      return

    raise ValueError('value "%s" for %s' % (v, k))

  def CheckValuePemX509Cert(self, _, v):
    """Check whether v meets PEM cert validation for setting k.

    Args:
      _: str, name, unused.
      v: any value.
    Returns:
      None if the value is appropriate and can be set.
    Raises:
      ValueError: if the value is not appropriately formed to be set for k.
    """
    try:
      _ = x509.LoadCertificateFromPEM(v)
    except x509.Error, e:
      raise ValueError(str(e))

  def CheckValuePemRsaPrivateKey(self, _, v):
    """Check whether v meets PEM RSA priv key validation for settings k.

    Args:
      _: str, name, unused..
      v: any value.
    Returns:
      None if the value is appropriate and can be set.
    Raises:
      ValueError: if the value is not appropriately formed to be set for k.
    """
    try:
      _ = x509.LoadRSAPrivateKeyFromPEM(v)
    except x509.Error, e:
      raise ValueError(str(e))

  def _CheckValidation(self, k, v):
    """Check whether v is an appropriate value for settings k.

    Args:
      k: str, name.
      v: any value.
    Returns:
      None if the value is appropriate and can be set.
    Raises:
      ValueError: if the value is not appropriately formed to be set for k.
    """
    if k not in self._validation:
      return

    for validation_type in self._validation[k]:
      # The validation_type str is also the name of the method to call
      # to perform the value check.
      getattr(self, validation_type)(
          k, v, *self._validation[k][validation_type])

  def _SetValidation(self, k, t, *validation):
    """Set validation on setting k.

    Args:
      k: str, name.
      t: str, type of validation, in self._VALIDATION_TYPES
      *validation: data to supply as validation data to validation func.
    Raises:
      ValueError: if t is invalid.
    """
    if t not in self._VALIDATION_TYPES:
      raise ValueError(t)

    if k not in self._validation:
      self._validation[k] = {}

    self._validation[k][t] = validation

  def GetValidationRegex(self, k):
    """Get regex validation for setting k.

    Args:
      k: str, name.
    Returns:
      str regex validation if one exists, otherwise None.
    """
    if k not in self._validation:
      return None

    return self._validation[k].get(self._VALIDATION_REGEX, [None])[0]

  def CheckValidation(self, k=None):
    """Check validation for setting k, or default all.

    Args:
      k: str, optional, name.
    Returns:
      None if all settings values are OK.
    Raises:
      ValueError: if setting value is invalid.
    """
    if k is not None:
      if k not in self._settings:
        return
      settings_keys = [k]
    else:
      settings_keys = self._settings.keys()
    for k in settings_keys:
      self._CheckValidation(k, self._settings[k])

  def __getattr__(self, k):
    """Returns value for attribute with name k.

    Args:
      k: str, name.
    Returns:
      value at k.
    Raises:
      AttributeError: if this attribute does not exist.
    """
    if k.startswith('_'):
      if k in self.__dict__:
        return self.__dict__[k]
      else:
        raise AttributeError(k)
    else:
      try:
        return self._Get(str(k).lower())
      except AttributeError, e:
        if e.args[0] == k:
          raise AttributeError(str(k).upper())
        raise

  def __setattr__(self, k, v):
    """Sets attribute value at name k with value v.

    Args:
      k: str, name.
      v: any value, value.
    """
    if k.startswith('_'):
      self.__dict__[k] = v
    else:
      self._Set(str(k).lower(), v)

  def __dir__(self):
    """Returns list of all attribute names."""
    return [x.upper() for x in self._Dir()]

class ModuleSettings(BaseSettings):
  """Settings that uses another module for storage.

  Don't use this class directly, use a child class.
  """

  def _LoadSettingsModule(self):
    """Load the module used for settings storage and return its full name."""
    raise NotImplementedError

  def _Initialize(self):
    """Initialize the settings storage.

    Raises:
      NotImplementedError: if module access fails.
    """
    self._module_name = self._LoadSettingsModule()
    try:
      self._module = sys.modules[self._module_name]
    except (KeyError, AttributeError), e:
      raise NotImplementedError(
          'ModuleSettings not implemented correctly: %s' % str(e))

  def _Get(self, k):
    """Get one settings item.

    Args:
      k: str, name to get. The name will always be in lowercase.
    Returns:
      any settings value
    Raises:
      AttributeError: if this settings item does not exist.
    """
    if hasattr(self._module, k.upper()):
      return getattr(self._module, k.upper())
    else:
      raise AttributeError(k)

  def _Set(self, k, v):
    """Set one settings item.

    Args:
      k: str, name to set. The name will always be in lowercase.
      v: str, value to set.
    """
    self._CheckValidation(k, v)
    setattr(self._module, k.upper(), v)

class TestModuleSettings(ModuleSettings):  # pylint: disable=abstract-method
  """Settings that uses the test_settings module for storage."""

  def _LoadSettingsModule(self):
    """Load the test_settings module and return its name.

    Returns:
      str, fully qualified module name.
    Raises:
      ImportError: if the test_settings module could not be loaded.
    """
    try:
      # pylint: disable=g-importing-member
      # pylint: disable=g-import-not-at-top
      # pylint: disable=no-name-in-module
      from tests.simian import test_settings as unused_foo
    except ImportError:
      raise ImportError(
          'Missing test_settings, check dependencies')
    return 'tests.simian.test_settings'

class DictSettings(BaseSettings):
  """Settings that uses a dictionary for storage."""

  def _Initialize(self):
    self._settings = {}

  def _Get(self, k):
    """Get one settings item.

    Args:
      k: str, name to get. The name will always be in lowercase.
    Returns:
      any settings value
    Raises:
      AttributeError: if this settings item does not exist.
    """
    if k in self._settings:
      return self._settings[k]
    else:
      raise AttributeError(k)

  def _Set(self, k, v):
    """Set one settings item.

    Args:
      k: str, name to set. The name will always be in lowercase.
      v: str, value to set.
    """
    self._CheckValidation(k, v)
    self._settings[k] = v

  def _Dir(self):
    """Returns directory of all settings names as a list."""
    return self._settings.keys()

class SimianDictSettings(DictSettings):  # pylint: disable=abstract-method
  """Settings stored in a dictionary for Simian."""

  def _IsCaIdValid(self, _, v):
    """Is this settings ca_id value valid?

    Args:
      _: str, key being checked. See _VALIDATION_FUNC interface. Unused.
      v: unknown type (probably None or str), check this ca_id value.
    Returns:
      True if valid, False if not.
    """
    # TODO(user): Refactor. This regex is also @ simian/auth:util.CA_ID_RE
    return v is None or re.search(r'^[A-Z][0-9A-Z]+$', str(v)) is not None

  def _Initialize(self):
    """Initialize."""
    # We do this to initialize underlying DictSettings, nothing more:
    super(SimianDictSettings, self)._Initialize()
    mail_regex = (
        r'\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}\b')
    # Common settings
    self._SetValidation(
        'ca_public_cert_pem', self._VALIDATION_PEM_X509_CERT)
    self._SetValidation(
        'server_public_cert_pem', self._VALIDATION_PEM_X509_CERT)
    # Note: One should add other CA_ID based parameter validation here.

    # Client specific settings
    self._SetValidation('ca_id', self._VALIDATION_FUNC, self._IsCaIdValid)
    # Server specific settings
    self._SetValidation(
        'apple_auto_promote_enabled', self._VALIDATION_REGEX,
        r'^(True|False)$')
    self._SetValidation(
        'apple_auto_promote_stable_weekday', self._VALIDATION_REGEX,
        r'^[0-6]$')
    self._SetValidation(
        'apple_auto_unattended_enabled', self._VALIDATION_REGEX,
        r'^(True|False)$')
    self._SetValidation(
        'apple_unstable_grace_period_days', self._VALIDATION_REGEX,
        r'^[0-9]+$')
    self._SetValidation(
        'apple_testing_grace_period_days', self._VALIDATION_REGEX,
        r'^[0-9]+$')
    self._SetValidation(
        'email_admin_list', self._VALIDATION_REGEX,
        r'^%s' % mail_regex)
    self._SetValidation(
        'email_domain', self._VALIDATION_REGEX,
        r'^\w+(\.\w+)*(\.[a-z]{2,4})$')
    self._SetValidation(
        'email_on_every_change', self._VALIDATION_REGEX,
        r'^(True|False)$')
    self._SetValidation(
        'email_sender', self._VALIDATION_REGEX,
        r'^([\w ]+ <%s>|%s)$' % (mail_regex, mail_regex))
    self._SetValidation(
        'email_reply_to', self._VALIDATION_REGEX,
        r'^([\w ]+ <%s>|%s)$' % (mail_regex, mail_regex))
    self._SetValidation(
        'hour_start', self._VALIDATION_REGEX,
        r'^[0-9]+$')
    self._SetValidation(
        'hour_stop', self._VALIDATION_REGEX,
        r'^[0-9]+$')
    self._SetValidation(
        'uuid_lookup_url', self._VALIDATION_REGEX,
        r'^https?\:\/\/[a-zA-Z0-9\-\.]+(\.[a-zA-Z]{2,3})?(\/\S*)?$')
    self._SetValidation(
        'owner_lookup_url', self._VALIDATION_REGEX,
        r'^https?\:\/\/[a-zA-Z0-9\-\.]+(\.[a-zA-Z]{2,3})?(\/\S*)?$')
    self._SetValidation(
        'server_private_key_pem', self._VALIDATION_PEM_RSA_PRIVATE_KEY)

class FilesystemSettings(SimianDictSettings):
  """Settings that uses the filesystem for read-only storage."""

  _path = os.environ.get('SIMIAN_CONFIG_PATH') or '/etc/simian/'

  def _PopulateGlobals(self, set_func=None, globals_=None):
    """Populate global variables into the settings dict."""
    self._Set('server_port', 443)

  def _TranslateValue(self, value):
    """Translate incoming str value into other types.

    Args:
      value: str, e.g. 'hello' or '1' or 'True'
    Returns:
      e.g. (str)'hello', (int)1, (bool)True
    """
    try:
      i = int(value)
      return i
    except ValueError:
      pass

    if value.lower() in ['true', 'false']:
      return value.lower() == 'true'

    try:
      if value[0] == '\'' and value[-1] == '\'':
        value = value[1:-1]
      elif value[0] == '\"' and value[-1] == '\"':
        value = value[1:-1]
      elif value[0] == '[' and value[-1] == ']':
        value = re.split(r'\s*,\s*', value[1:-1])
    except IndexError:
      pass

    return value

  def _GetExternalConfiguration(
      self, name, default=None, path=None, as_file=False, open_=open,
      isdir_=os.path.isdir, join_=os.path.join):
    """Get configuration from external config files.

    Args:
      name: str, name of configuration file.
      default: object, default None, default value.
      path: str, default self.path, path to config file.
      as_file: bool, default False, if True read the entire file contents
        and return the contents as a string. If False, interpret the file
        as a config file per ConfigParser.
      open_: func, default open, function to open files with, for tests.
      isdir_: func, default os.path.isdir, for tests.
      join_: func, default os.path.join, for tests.
    Returns:
      if as_file=True, string contents of entire file.
      if as_file=False, dictionary of settings loaded from file.
    """
    logging.debug('_GetExternalConfiguration(%s)', name)
    if path is None:
      path = self._path

    config = {}

    if not isdir_(path):
      logging.error('Configuration directory not found: %s', path)
      value = None
    elif as_file:
      filepath = join_(path, name)
      try:
        f = open_(filepath, 'r')
        value = f.read()
        if value:
          value = value.strip()
        f.close()
      except IOError:
        value = None
    else:
      filepath = '%s.cfg' % join_(path, name)
      config = {}
      try:
        f = open_(filepath, 'r')
        cp = ConfigParser.ConfigParser()
        cp.readfp(f)
        f.close()
        for i, v in cp.items('settings'):
          config[i] = self._TranslateValue(v)
        value = config
      except (IOError, ConfigParser.Error):
        value = None

    if value is None:
      value = default

    if value is None:
      logging.error('Configuration not found: %s', name)

    return value

  def _GetExternalPem(self, k):
    """Get an external PEM value from config.

    Args:
      k: str, name to retrieve.
    Returns:
      value
    Raises:
      AttributeError: if the name does not exist in external settings.
    """
    logging.debug('_GetExternalPem(%s)', k)
    if k in self._settings:
      return self._settings[k]
    pem_file = '%s.pem' % k[:-4]
    path = os.path.join(self._path, 'ssl')
    pem = self._GetExternalConfiguration(pem_file, as_file=True, path=path)
    if pem:
      self._settings[k] = pem
    else:
      raise AttributeError(k)
    return pem

  def _GetExternalValue(self, k):
    """Get an external name/value from config.

    Args:
      k: str, name to retrieve.
    Returns:
      value
    Raises:
      AttributeError: if the name does not exist in external settings.
    """
    logging.debug('_GetExternalValue(%s)', k)
    if k in self._settings:
      return self._settings[k]
    config = self._GetExternalConfiguration('settings')
    if config is not None:
      for j in config:
        self._settings[j] = config[j]
      if k not in self._settings:
        raise AttributeError(k)
    else:
      raise AttributeError(k)
    return self._settings[k]

  def _Get(self, k):
    """Get one settings item.

    Args:
      k: str, name to get. The name will always be in lowercase.
    Returns:
      any settings value
    Raises:
      AttributeError: if this settings item does not exist.
    """
    # oss config have domain/subdomain instead of server_hostname
    if k == 'server_hostname':
      try:
        return self._GetExternalValue(k)
      except AttributeError:
        return '%s.%s' % (
            self._GetExternalValue('subdomain'),
            self._GetExternalValue('domain')
        )
    logging.debug('_Get(%s)', k)
    if k.endswith('_pem'):
      v = self._GetExternalPem(k)
    else:
      v = self._GetExternalValue(k)

    return v

  def _Dir(self):
    """Returns directory of all settings names as a list.

    Raises:
      NotImplementedError: if this method is not implemented.
    """
    raise NotImplementedError

class DatastoreSettings(SimianDictSettings):
  """Settings stored in GAE datastore and dictionary.

  All globals are loaded into the dictionary storage, but not _Set() into
  the datastore.

  All future _Get() operations check both the dictionary and datastore.
  All future _Set() operations only affect the datastore.
  """

  def _Initialize(self):
    SimianDictSettings._Initialize(self)

    self._module.models = importlib.import_module(
        'simian.mac.models')

  def _PopulateGlobals(self, set_func=None, globals_=None):
    """Populate global variables into the settings dict."""
    # Populate the global variables into the dictionary backed settings via
    # this specific set_func. Without this specific usage the global settings
    # would be populated back into datastore via _Set() calls.
    # pylint: disable=protected-access
    set_func = lambda k, v: DictSettings._Set(self, k, v)
    DictSettings._PopulateGlobals(self, set_func=set_func, globals_=globals_)

  def _Get(self, k):
    """Get one settings item.

    Args:
      k: str, name to get. The name will always be in lowercase.
    Returns:
      any settings value
    Raises:
      AttributeError: if this settings item does not exist.
    """
    # Try the dictionary of settings first.
    try:
      v = DictSettings._Get(self, k)  # pylint: disable=protected-access
      return v
    except AttributeError:
      pass  # Not a problem, keep trying.

    item, unused_mtime = self._module.models.Settings.GetItem(k)
    if item is None:
      raise AttributeError(k)
    return item

  def _Set(self, k, v):
    """Set one settings item.

    Args:
      k: str, name to set. The name will always be in lowercase.
      v: str, value to set.
    """
    self._CheckValidation(k, v)
    self._module.models.Settings.SetItem(k, v)

  def _Dir(self):
    """Returns directory of all settings names as a list.

    Returns:
      list of all settings names.
    Raises:
      NotImplementedError: if this method is not implemented.
    """
    a = self._module.models.Settings.GetAll()
    return list(set(DictSettings._Dir(self) + [x for x in a]))  # pylint: disable=protected-access

def Setup():
  if __name__ != '__main__':
    if not hasattr(sys.modules[__name__], 'is_class'):
      settings_class = None

      if GAE:
        settings_class = DatastoreSettings
      elif DEV_APPSERVER:
        settings_class = DatastoreSettings
      elif TESTING:
        if not SETTINGS_TESTING:
          settings_class = TestModuleSettings
      else:
        settings_class = FilesystemSettings

      if settings_class is not None:
        sys.modules[__name__] = settings_class(sys.modules[__name__])

Setup()


text:
wsd [![Build Status](https://travis-ci.org/ColdenCullen/wsd.svg?branch=master)](https://travis-ci.org/ColdenCullen/wsd)
===

A whitespace-based D dialect. I should note that this a proof of concept, and no more.

### Running wsd

Running wsd is as simple as passing it the filename and any args you want to pass to `rdmd`. For example:
```
./wsd test1.wsd
```

### wsd Code

wsd code is basically D code, but with 2 fundamental changes:
1. Braces are illegal. Blocks are specified by indenting another level. Currently only hardware tabs are supported, but I'm looking into adding space support. Also, any declaration or block specifier (`if`, `while`, function declarations, etc.) must be followed by a colon. See example for details.
2. Certain keywords (currently `if`, `while`, `for`, and `foreach`) do not allow parenthesis around their conditional expression. Again, see the example for more information

### Sample Code
```d
import std.stdio

void main():
	for int i = 0; i < 10; ++i:
		writeln( i )

	writeln( "Outer code" )

		writeln( "Inside a block" )
```

This outputs the following code:

```d
import std.stdio;

void main()
{
	for( int i = 0; i < 10; ++i )
	{
		writeln( i );
	}

	writeln( "Outer code" );
	{

		writeln( "Inside a block" );
	}
}
```

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace FSi\Component\DataSource\Driver\Doctrine;

use Doctrine\ORM\QueryBuilder;
use FSi\Component\DataSource\Driver\Doctrine\ORM\DoctrineAbstractField as BaseField;
use FSi\Component\DataSource\Driver\Doctrine\ORM\Exception\DoctrineDriverException;

/**
 * @deprecated since version 1.4
 */
abstract class DoctrineAbstractField extends BaseField implements DoctrineFieldInterface
{
    /**
     * {@inheritdoc}
     *
     * @throws \FSi\Component\DataSource\Driver\Doctrine\Exception\DoctrineDriverException
     */
    public function buildQuery(QueryBuilder $qb, $alias)
    {
        try {
            parent::buildQuery($qb, $alias);
        } catch (DoctrineDriverException $e) {
            throw new \FSi\Component\DataSource\Driver\Doctrine\Exception\DoctrineDriverException(
                $e->getMessage()
            );
        }
    }
}


text:
package io.material.catalog.adaptive;

import io.material.catalog.R;

import android.os.Bundle;
import androidx.fragment.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.view.ViewCompat;
import io.material.catalog.adaptive.AdaptiveListViewDemoFragment.EmailData;
import io.material.catalog.adaptive.AdaptiveListViewDemoFragment.EmailData.Email;

/** A Fragment that displays an email's details. */
public class AdaptiveListViewDetailDemoFragment extends Fragment {

  public static final String TAG = "AdaptiveListViewDetailDemoFragment";
  private static final String EMAIL_ID_KEY = "email_id_key";

  @NonNull
  public static AdaptiveListViewDetailDemoFragment newInstance(long emailId) {
    AdaptiveListViewDetailDemoFragment fragment = new AdaptiveListViewDetailDemoFragment();
    Bundle bundle = new Bundle();
    bundle.putLong(EMAIL_ID_KEY, emailId);
    fragment.setArguments(bundle);
    return fragment;
  }

  @Nullable
  @Override
  public View onCreateView(
      @NonNull LayoutInflater layoutInflater,
      @Nullable ViewGroup viewGroup,
      @Nullable Bundle bundle) {
    return layoutInflater.inflate(
        R.layout.cat_adaptive_list_view_detail_fragment, viewGroup, false);
  }

  @Override
  public void onViewCreated(@NonNull View view, @Nullable Bundle bundle) {
    long emailId = getEmailId();
    TextView emailTitle = view.findViewById(R.id.email_title);
    emailTitle.append(" " + (emailId + 1));
    // Set transition name that matches the list item to be transitioned from for the shared element
    // transition.
    View container = view.findViewById(R.id.list_view_detail_container);
    ViewCompat.setTransitionName(container, emailTitle.toString());
  }

  @Override
  public void onDestroy() {
    super.onDestroy();
    updateEmailSelected(false);
  }

  @Override
  public void onStart() {
    super.onStart();
    updateEmailSelected(true);
  }

  private void updateEmailSelected(boolean selected) {
    Email email = EmailData.getEmailById(getEmailId());
    email.setSelected(selected);
  }

  private long getEmailId() {
    long emailId = 0L;
    if (getArguments() != null) {
      emailId = getArguments().getLong(EMAIL_ID_KEY, 0L);
    }
    return emailId;
  }
}


text:
CREATE TABLE [dbo].[aspnet_Profile] (
    [UserId]               UNIQUEIDENTIFIER NOT NULL,
    [PropertyNames]        NTEXT            NOT NULL,
    [PropertyValuesString] NTEXT            NOT NULL,
    [PropertyValuesBinary] IMAGE            NOT NULL,
    [LastUpdatedDate]      DATETIME         NOT NULL,
    PRIMARY KEY CLUSTERED ([UserId] ASC),
    FOREIGN KEY ([UserId]) REFERENCES [dbo].[aspnet_Users] ([UserId])
);

GO
EXECUTE sp_tableoption @TableNamePattern = N'[dbo].[aspnet_Profile]', @OptionName = N'text in row', @OptionValue = N'6000';


text:
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).

```ts

import { AbstractConstructor } from '@angular/material/core/common-behaviors/constructor';
import { CanColor } from '@angular/material/core';
import { Constructor } from '@angular/material/core/common-behaviors/constructor';
import { ElementRef } from '@angular/core';
import * as i0 from '@angular/core';
import * as i2 from '@angular/material/core';
import * as i3 from '@angular/common';
import { InjectionToken } from '@angular/core';
import { NumberInput } from '@angular/cdk/coercion';
import { OnInit } from '@angular/core';
import { Platform } from '@angular/cdk/platform';

// @public
export const MAT_PROGRESS_SPINNER_DEFAULT_OPTIONS: InjectionToken<MatProgressSpinnerDefaultOptions>;

// @public
export function MAT_PROGRESS_SPINNER_DEFAULT_OPTIONS_FACTORY(): MatProgressSpinnerDefaultOptions;

// @public
export class MatProgressSpinner extends _MatProgressSpinnerBase implements OnInit, CanColor {
    constructor(elementRef: ElementRef<HTMLElement>, platform: Platform, _document: any, animationMode: string, defaults?: MatProgressSpinnerDefaultOptions);
    get diameter(): number;
    set diameter(size: number);
    _getCircleRadius(): number;
    _getCircleStrokeWidth(): number;
    _getStrokeCircumference(): number;
    _getStrokeDashOffset(): number | null;
    _getViewBox(): string;
    mode: ProgressSpinnerMode;
    // (undocumented)
    static ngAcceptInputType_diameter: NumberInput;
    // (undocumented)
    static ngAcceptInputType_strokeWidth: NumberInput;
    // (undocumented)
    static ngAcceptInputType_value: NumberInput;
    // (undocumented)
    ngOnInit(): void;
    _noopAnimations: boolean;
    _spinnerAnimationLabel: string;
    get strokeWidth(): number;
    set strokeWidth(value: number);
    get value(): number;
    set value(newValue: number);
    // (undocumented)
    static ɵcmp: i0.ɵɵComponentDeclaration<MatProgressSpinner, "mat-progress-spinner", ["matProgressSpinner"], { "color": "color"; "diameter": "diameter"; "strokeWidth": "strokeWidth"; "mode": "mode"; "value": "value"; }, {}, never, never>;
    // (undocumented)
    static ɵfac: i0.ɵɵFactoryDeclaration<MatProgressSpinner, [null, null, { optional: true; }, { optional: true; }, null]>;
}

// @public
export interface MatProgressSpinnerDefaultOptions {
    diameter?: number;
    _forceAnimations?: boolean;
    strokeWidth?: number;
}

// @public (undocumented)
export class MatProgressSpinnerModule {
    // (undocumented)
    static ɵfac: i0.ɵɵFactoryDeclaration<MatProgressSpinnerModule, never>;
    // (undocumented)
    static ɵinj: i0.ɵɵInjectorDeclaration<MatProgressSpinnerModule>;
    // (undocumented)
    static ɵmod: i0.ɵɵNgModuleDeclaration<MatProgressSpinnerModule, [typeof i1.MatProgressSpinner, typeof i1.MatSpinner], [typeof i2.MatCommonModule, typeof i3.CommonModule], [typeof i1.MatProgressSpinner, typeof i1.MatSpinner, typeof i2.MatCommonModule]>;
}

// @public
export class MatSpinner extends MatProgressSpinner {
    constructor(elementRef: ElementRef<HTMLElement>, platform: Platform, document: any, animationMode: string, defaults?: MatProgressSpinnerDefaultOptions);
    // (undocumented)
    static ɵcmp: i0.ɵɵComponentDeclaration<MatSpinner, "mat-spinner", never, { "color": "color"; }, {}, never, never>;
    // (undocumented)
    static ɵfac: i0.ɵɵFactoryDeclaration<MatSpinner, [null, null, { optional: true; }, { optional: true; }, null]>;
}

// @public
export type ProgressSpinnerMode = 'determinate' | 'indeterminate';

// (No @packageDocumentation comment for this package)

```


text:
from __future__ import unicode_literals

from prompt_toolkit.layout.lexers import Lexer
from pygments.lexers import get_lexer_for_filename
from pygments.token import Token
from pygments.util import ClassNotFound

__all__ = (
    'DocumentLexer',
)

class DocumentLexer(Lexer):
    """
    Lexer that depending on the filetype, uses another pygments lexer.
    """
    def __init__(self, editor_buffer):
        self.editor_buffer = editor_buffer

    def get_tokens(self, cli, text):
        """
        Call the lexer and return the tokens.
        """
        location = self.editor_buffer.location

        if location:
            # Create an instance of the correct lexer class.
            try:
                lexer = get_lexer_for_filename(location, stripnl=False, stripall=False, ensurenl=False)
            except ClassNotFound:
                pass
            else:
                return lexer.get_tokens(text)

        return [(Token, text)]


text:
layout: post
title: HOTEL ROOM FUCK
titleinfo: pornvd
desc: Watch HOTEL ROOM FUCK. Pornhub is the ultimate xxx porn and sex site.
---

HOTEL ROOM FUCK

Watch HOTEL ROOM FUCK. Pornhub is the ultimate xxx porn and sex site.


text:
package alien4cloud.authorization;

import alien4cloud.dao.IGenericSearchDAO;
import alien4cloud.dao.model.GetMultipleDataResult;
import alien4cloud.model.orchestrators.locations.LocationResourceTemplate;
import alien4cloud.security.AbstractSecurityEnabledResource;
import alien4cloud.security.Subject;
import alien4cloud.security.event.GroupDeletedEvent;
import alien4cloud.security.event.UserDeletedEvent;
import alien4cloud.utils.TypeScanner;
import com.google.common.collect.Sets;
import org.alien4cloud.alm.events.AfterPermissionRevokedEvent;
import org.alien4cloud.alm.events.BeforeApplicationDeleted;
import org.alien4cloud.alm.events.BeforeApplicationEnvironmentDeleted;
import org.alien4cloud.alm.events.BeforeApplicationEnvironmentTypeDeleted;
import org.apache.commons.lang3.ArrayUtils;
import org.elasticsearch.index.query.FilterBuilder;
import org.elasticsearch.index.query.FilterBuilders;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.io.IOException;
import java.util.Arrays;
import java.util.Set;
import java.util.stream.Collectors;

/**
 * Listeners on events that might affects resources permissions
 */
@Component
public class ResourcePermissionEventsListener {

    @Resource(name = "alien-es-dao")
    private IGenericSearchDAO alienDAO;

    @Resource
    private ResourcePermissionService resourcePermissionService;

    @EventListener
    public void userDeletedEventListener(UserDeletedEvent event) throws IOException, ClassNotFoundException {
        deleteUserPermissionOn(event.getUser().getUsername());
    }

    @EventListener
    public void groupDeletedEventListener(GroupDeletedEvent event) throws IOException, ClassNotFoundException {
        deleteGroupPermissionOn(event.getGroup().getId());
    }

    @EventListener
    public void applicationDeletedEventListener(BeforeApplicationDeleted event) throws IOException, ClassNotFoundException {
        deleteApplicationPermissionOn(event.getApplicationId());
    }

    @EventListener
    public void environmentDeletedEventListener(BeforeApplicationEnvironmentDeleted event) throws IOException, ClassNotFoundException {
        deleteEnvironmentPermissionOn(event.getApplicationEnvironmentId());
    }

    @EventListener
    public void environmentTypeDeletedEventListener(BeforeApplicationEnvironmentTypeDeleted event) throws IOException, ClassNotFoundException {
        deleteEnvironmentTypePermissionOn(event.getApplicationEnvironmentType());
    }

    @EventListener(condition = "#event.subjectType.toString() == 'USER' && #event.on.clazz.simpleName == 'Location'")
    public void userPermissionRevokedOnLocationEventListener(AfterPermissionRevokedEvent event) throws IOException, ClassNotFoundException {
        for (String username : event.getSubjects()) {
            deleteUserPermissionOn(username, LocationResourceTemplate.class);
        }
    }

    @EventListener(condition = "#event.subjectType.toString() == 'GROUP' && #event.on.clazz.simpleName == 'Location'")
    public void groupPermissionRevokedOnLocationEventListener(AfterPermissionRevokedEvent event) throws IOException, ClassNotFoundException {
        for (String subject : event.getSubjects()) {
            deleteGroupPermissionOn(subject, LocationResourceTemplate.class);
        }
    }

    @EventListener(condition = "#event.subjectType.toString() == 'APPLICATION' && #event.on.clazz.simpleName == 'Location'")
    public void applicationPermissionRevokedOnLocationEventListener(AfterPermissionRevokedEvent event) throws IOException, ClassNotFoundException {
        for (String subject : event.getSubjects()) {
            deleteApplicationPermissionOn(subject, LocationResourceTemplate.class);
        }
    }

    @EventListener(condition = "#event.subjectType.toString() == 'ENVIRONMENT' && #event.on.clazz.simpleName == 'Location'")
    public void environmentPermissionRevokedOnLocationEventListener(AfterPermissionRevokedEvent event) throws IOException, ClassNotFoundException {
        for (String subject : event.getSubjects()) {
            deleteEnvironmentPermissionOn(subject, LocationResourceTemplate.class);
        }
    }

    @EventListener(condition = "#event.subjectType.toString() == 'ENVIRONMENT_TYPE' && #event.on.clazz.simpleName == 'Location'")
    public void environmentTypePermissionRevokedOnLocationEventListener(AfterPermissionRevokedEvent event) throws IOException, ClassNotFoundException {
        for (String subject : event.getSubjects()) {
            deleteEnvironmentTypePermissionOn(subject, LocationResourceTemplate.class);
        }
    }

    private void deleteUserPermissionOn(String username, Class<?>... resourceClasses) throws IOException, ClassNotFoundException {
        FilterBuilder resourceFilter = FilterBuilders.nestedFilter("userPermissions", FilterBuilders.termFilter("userPermissions.key", username));
        deletePermissions(resourceFilter, username, ((resource, subjectId) -> resourcePermissionService.revokePermission(resource, Subject.USER, subjectId)),
                resourceClasses);
    }

    private void deleteGroupPermissionOn(String groupId, Class<?>... resourceClasses) throws IOException, ClassNotFoundException {
        FilterBuilder resourceFilter = FilterBuilders.nestedFilter("groupPermissions", FilterBuilders.termFilter("groupPermissions.key", groupId));
        deletePermissions(resourceFilter, groupId, ((resource, subjectId) -> resourcePermissionService.revokePermission(resource, Subject.GROUP, subjectId)),
                resourceClasses);
    }

    private void deleteApplicationPermissionOn(String applicationId, Class<?>... resourceClasses) throws IOException, ClassNotFoundException {
        FilterBuilder resourceFilter = FilterBuilders.nestedFilter("applicationPermissions",
                FilterBuilders.termFilter("applicationPermissions.key", applicationId));
        deletePermissions(resourceFilter, applicationId,
                ((resource, subjectId) -> resourcePermissionService.revokePermission(resource, Subject.APPLICATION, subjectId)), resourceClasses);
    }

    private void deleteEnvironmentPermissionOn(String environmentId, Class<?>... resourceClasses) throws IOException, ClassNotFoundException {
        FilterBuilder resourceFilter = FilterBuilders.nestedFilter("environmentPermissions",
                FilterBuilders.termFilter("environmentPermissions.key", environmentId));
        deletePermissions(resourceFilter, environmentId,
                ((resource, subjectId) -> resourcePermissionService.revokePermission(resource, Subject.ENVIRONMENT, subjectId)), resourceClasses);
    }

    private void deleteEnvironmentTypePermissionOn(String environmentId, Class<?>... resourceClasses) throws IOException, ClassNotFoundException {
        FilterBuilder resourceFilter = FilterBuilders.nestedFilter("environmentTypePermissions",
                FilterBuilders.termFilter("environmentTypePermissions.key", environmentId));
        deletePermissions(resourceFilter, environmentId,
                ((resource, subjectId) -> resourcePermissionService.revokePermission(resource, Subject.ENVIRONMENT_TYPE, subjectId)), resourceClasses);
    }

    private interface ResourcePermissionCleaner {
        void cleanPermission(AbstractSecurityEnabledResource resource, String subjectId);
    }

    private void deletePermissions(FilterBuilder appFilter, String ownerId, ResourcePermissionCleaner permissionCleaner, Class<?>... onClazzes)
            throws IOException, ClassNotFoundException {
        int from = 0;
        long totalResult;

        Set<Class<?>> classes = ArrayUtils.isNotEmpty(onClazzes) ? Sets.newHashSet(onClazzes)
                : TypeScanner.scanTypes("alien4cloud.model", AbstractSecurityEnabledResource.class);
        Set<String> indices = classes.stream().map(clazz -> alienDAO.getIndexForType(clazz)).collect(Collectors.toSet());
        do {
            GetMultipleDataResult<Object> result = alienDAO.search(indices.toArray(new String[indices.size()]), classes.toArray(new Class<?>[classes.size()]),
                    null, null, appFilter, null, from, 20);
            Arrays.stream(result.getData()).forEach(resource -> permissionCleaner.cleanPermission((AbstractSecurityEnabledResource) resource, ownerId));
            from += result.getData().length;
            totalResult = result.getTotalResults();
        } while (from < totalResult);
    }
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <title>We Build SG Data</title>
    <meta name="description" content="Using data and graphs to inspire variety, openness and projects!">
    <meta name="keywords" content="Singapore, SG, open community, open source, software, hardware, programming, design, maker movement, free events, free tech events">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="publisher" href="https://plus.google.com/+WebuildSg">
    <meta property="og:title" content="We Build SG Data">
    <meta property="og:site_name" content="We Build SG Data">
    <meta property="og:url" content="http://data.webuild.sg">
    <meta property="og:description" content="Using data and graphs to inspire variety, openness and projects!">
    <meta property="og:image" content="public/img/pic.png">
    <meta property="og:type" content="website">
    <link rel="icon" href="https://webuildsg.github.io/assets/favicon.ico" type="image/x-icon">
    <link rel="stylesheet" href="//fonts.googleapis.com/css?family=Roboto+Slab:400,700">
    <link rel="stylesheet" href="https://webuildsg.github.io/assets/css/style.css">
    <link rel="apple-touch-icon" href="https://webuild.sg/public/apple-touch-icon.png">
    <link rel="apple-touch-icon" sizes="72x72" href="https://webuild.sg/public/apple-touch-icon-72x72-precomposed.png">
    <link rel="apple-touch-icon" sizes="114x114" href="https://webuild.sg/public/apple-touch-icon-114x114-precomposed.png">
    <link rel="apple-touch-icon" sizes="144x144" href="https://webuild.sg/public/apple-touch-icon-144x144-precomposed.png">

we build!

SG DATA

  main

  apps

  live

  data

  notes

  api

Using data to inspire variety, openness and projects for the design and engineering community

repositories per programming languages

                <input type="radio" name="language"> C

                <input type="radio" name="language"> C++

                <input type="radio" name="language"> Clojure

                <input type="radio" name="language"> CoffeeScript

                <input type="radio" name="language"> CSS

                <input type="radio" name="language"> Go

                <input type="radio" name="language"> Haskell

                <input type="radio" name="language"> HTML

                <input type="radio" name="language"> Java

                <input type="radio" name="language"> JavaScript

                <input type="radio" name="language"> Julia

                <input type="radio" name="language"> Objective-C

                <input type="radio" name="language"> PHP

                <input type="radio" name="language"> Python

                <input type="radio" name="language"> R

                <input type="radio" name="language"> Ruby

                <input type="radio" name="language"> Rust

                <input type="radio" name="language"> Shell

                <input type="radio" name="language"> Swift

                <input type="radio" name="language"> Tex

All graphs are generated based on
 open events data and open source data

an open event is:

curated from an api (Facebook, Meetup, Eventbrite)

manually included or queried from an ICS url

open to public and free for all

held at a valid location

engineering or design related

an open source repository has:

an open license

a remote repository on Github

"Singapore" in the owner's location

at least 50 star gazers

been updated in the last 3 months

We welcome your suggestions

Feel free to report bugs / send pull requests

Twitter

Facebook

GitHub

Calendar

RSS

iTunes


text:
@interface NumberBadgeView : UIView

// Set the number displayed by the badge. A value <=0 will cause the badge to be
// hidden.
- (void)setNumber:(NSInteger)number animated:(BOOL)animated;
// Set the color of the badge (the text is white).
- (void)setBackgroundColor:(UIColor*)backgroundColor animated:(BOOL)animated;

@end

#endif  // IOS_CHROME_BROWSER_UI_READING_LIST_NUMBER_BADGE_VIEW_H_


text:
package koopa.grammars.cobol.test;

import junit.framework.TestCase;
import koopa.parsers.Parser;
import koopa.tokenizers.cobol.SourceFormat;
import koopa.tokenizers.cobol.TestTokenizer;

import org.junit.Test;

/** This code was generated from FreeStatement.stage. */
public class FreeStatementTest extends TestCase {

  private static koopa.grammars.cobol.CobolGrammar grammar = new koopa.grammars.cobol.CobolGrammar();

    @Test
    public void testFreeStatement_1() {
      Parser parser = grammar.freeStatement();
      assertNotNull(parser);
      TestTokenizer tokenizer = new TestTokenizer(SourceFormat.FREE, " FREE ADDRESS OF A ");
      assertTrue(parser.accepts(tokenizer));
      assertTrue(tokenizer.isWhereExpected());
    }

    @Test
    public void testFreeStatement_2() {
      Parser parser = grammar.freeStatement();
      assertNotNull(parser);
      TestTokenizer tokenizer = new TestTokenizer(SourceFormat.FREE, " FREE ADDRESS A ");
      assertTrue(parser.accepts(tokenizer));
      assertTrue(tokenizer.isWhereExpected());
    }

    @Test
    public void testFreeStatement_3() {
      Parser parser = grammar.freeStatement();
      assertNotNull(parser);
      TestTokenizer tokenizer = new TestTokenizer(SourceFormat.FREE, " FREE A ");
      assertTrue(parser.accepts(tokenizer));
      assertTrue(tokenizer.isWhereExpected());
    }

    @Test
    public void testFreeStatement_4() {
      Parser parser = grammar.freeStatement();
      assertNotNull(parser);
      TestTokenizer tokenizer = new TestTokenizer(SourceFormat.FREE, " FREE\n   ADDRESS OF A\n   ADDRESS OF B ");
      assertTrue(parser.accepts(tokenizer));
      assertTrue(tokenizer.isWhereExpected());
    }

    @Test
    public void testFreeStatement_5() {
      Parser parser = grammar.freeStatement();
      assertNotNull(parser);
      TestTokenizer tokenizer = new TestTokenizer(SourceFormat.FREE, " FREE \n   ADDRESS A\n   ADDRESS B ");
      assertTrue(parser.accepts(tokenizer));
      assertTrue(tokenizer.isWhereExpected());
    }

    @Test
    public void testFreeStatement_6() {
      Parser parser = grammar.freeStatement();
      assertNotNull(parser);
      TestTokenizer tokenizer = new TestTokenizer(SourceFormat.FREE, " FREE\n   A\n   B ");
      assertTrue(parser.accepts(tokenizer));
      assertTrue(tokenizer.isWhereExpected());
    }

    @Test
    public void testFreeStatement_7() {
      Parser parser = grammar.freeStatement();
      assertNotNull(parser);
      TestTokenizer tokenizer = new TestTokenizer(SourceFormat.FREE, " FREE\n   ADDRESS OF A\n   ADDRESS B\n   C ");
      assertTrue(parser.accepts(tokenizer));
      assertTrue(tokenizer.isWhereExpected());
    }

    @Test
    public void testFreeStatement_8() {
      Parser parser = grammar.freeStatement();
      assertNotNull(parser);
      TestTokenizer tokenizer = new TestTokenizer(SourceFormat.FREE, " FREE\n   A\n   ADDRESS OF B\n   ADDRESS C ");
      assertTrue(parser.accepts(tokenizer));
      assertTrue(tokenizer.isWhereExpected());
    }

    @Test
    public void testFreeStatement_9() {
      Parser parser = grammar.freeStatement();
      assertNotNull(parser);
      TestTokenizer tokenizer = new TestTokenizer(SourceFormat.FREE, " FREE\n   ADDRESS A\n   B\n   ADDRESS OF C ");
      assertTrue(parser.accepts(tokenizer));
      assertTrue(tokenizer.isWhereExpected());
    }

    @Test
    public void testFreeStatement_10() {
      Parser parser = grammar.freeStatement();
      assertNotNull(parser);
      TestTokenizer tokenizer = new TestTokenizer(SourceFormat.FREE, " FREE ADDRESS OF FUNCTION FN ( X ) ");
      assertFalse(parser.accepts(tokenizer) && tokenizer.isWhereExpected());
    }

    @Test
    public void testFreeStatement_11() {
      Parser parser = grammar.freeStatement();
      assertNotNull(parser);
      TestTokenizer tokenizer = new TestTokenizer(SourceFormat.FREE, " FREE ADDRESS OF EXCEPTION-OBJECT ");
      assertFalse(parser.accepts(tokenizer) && tokenizer.isWhereExpected());
    }

    @Test
    public void testFreeStatement_12() {
      Parser parser = grammar.freeStatement();
      assertNotNull(parser);
      TestTokenizer tokenizer = new TestTokenizer(SourceFormat.FREE, " FREE ADDRESS OF NULL ");
      assertFalse(parser.accepts(tokenizer) && tokenizer.isWhereExpected());
    }

    @Test
    public void testFreeStatement_13() {
      Parser parser = grammar.freeStatement();
      assertNotNull(parser);
      TestTokenizer tokenizer = new TestTokenizer(SourceFormat.FREE, " FREE ADDRESS OF SELF ");
      assertFalse(parser.accepts(tokenizer) && tokenizer.isWhereExpected());
    }

    @Test
    public void testFreeStatement_14() {
      Parser parser = grammar.freeStatement();
      assertNotNull(parser);
      TestTokenizer tokenizer = new TestTokenizer(SourceFormat.FREE, " FREE ADDRESS OF SUPER ");
      assertFalse(parser.accepts(tokenizer) && tokenizer.isWhereExpected());
    }

    @Test
    public void testFreeStatement_15() {
      Parser parser = grammar.freeStatement();
      assertNotNull(parser);
      TestTokenizer tokenizer = new TestTokenizer(SourceFormat.FREE, " FREE ADDRESS OF MY-CLASS-NAME OF SUPER ");
      assertFalse(parser.accepts(tokenizer) && tokenizer.isWhereExpected());
    }

    @Test
    public void testFreeStatement_16() {
      Parser parser = grammar.freeStatement();
      assertNotNull(parser);
      TestTokenizer tokenizer = new TestTokenizer(SourceFormat.FREE, " FREE ADDRESS OF ADDRESS OF SOMETHING ");
      assertFalse(parser.accepts(tokenizer) && tokenizer.isWhereExpected());
    }
}


text:
<?php

namespace AppBundle\Entity;

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints as Assert;

/**
 * Rad
 *
 * @ORM\Table(name="rad")
 * @ORM\Entity(repositoryClass="AppBundle\Repository\RadRepository")
 */
class Rad
{
    /**
     * @var int
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var string
     *
     * @ORM\Column(name="naslov", type="string", length=100)
     */
    private $naslov;

    /**
     *
     * @ORM\Column(name="apstrakt", type="string", length=100)
     */
    private $apstrakt;

    /**
     * @var SmotraRadova
     *
     * @ORM\ManyToOne(targetEntity="SmotraRadova", inversedBy="rad", cascade={"persist", "remove"})
     * @ORM\JoinColumn(name="smotra_radova_id", referencedColumnName="id", onDelete="CASCADE")
     */
    private $smotraRadova;

    /**
     * @var Autor
     *
     * @ORM\OneToMany(targetEntity="Autor", mappedBy="rad", cascade={"persist", "remove"})
     */
    private $autor;

    public function __construct()
    {
        $this->autor = new ArrayCollection();
    }

    /**
     * Get id
     *
     * @return int
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set naslov
     *
     * @param string $naslov
     *
     * @return Rad
     */
    public function setNaslov($naslov)
    {
        $this->naslov = $naslov;

        return $this;
    }

    /**
     * Get naslov
     *
     * @return string
     */
    public function getNaslov()
    {
        return $this->naslov;
    }

    /**
     * Set apstrakt
     *
     * @param string $apstrakt
     *
     * @return Rad
     */
    public function setApstrakt($apstrakt)
    {
        $this->apstrakt = $apstrakt;

        return $this;
    }

    /**
     * Get apstrakt
     *
     * @return string
     */
    public function getApstrakt()
    {
        return $this->apstrakt;
    }

    /**
     * @return Autor
     */
    public function getAutor()
    {
        return $this->autor;
    }

    /**
     * @param Autor $autor
     */
    public function setAutor($autor)
    {
        $this->autor = $autor;
    }

    /**
     * @return SmotraRadova
     */
    public function getSmotraRadova()
    {
        return $this->smotraRadova;
    }

    /**
     * @param SmotraRadova $smotraRadova
     */
    public function setSmotraRadova($smotraRadova)
    {
        $this->smotraRadova = $smotraRadova;
    }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
in Müller & Arx, Beitr. Kryptfl. Schweiz 11(no. 2): 375 (1962)

#### Original name
Lizonia oxylobii Henn.

### Remarks
null


text:
Ext.application({
    name: 'OPF.console.documentation',

    appFolder: 'documentation',

    controllers: [
        'DocumentationController'
    ],

    launch: function() {

        Ext.QuickTips.init();

        var documentationView = Ext.create('OPF.console.documentation.view.DocumentationView');
        documentationView.init();

        OPF.console.ManagerLayout.initHeader('net.firejack.platform.console.documentation', 'doc-header');
        OPF.console.ManagerLayout.initFooter('documentation');
    }
});


text:
package org.mifos.dto.domain;

import java.io.Serializable;

import org.joda.time.LocalDate;

@SuppressWarnings("PMD")
@edu.umd.cs.findbugs.annotations.SuppressWarnings(value={"SE_NO_SERIALVERSIONID", "EI_EXPOSE_REP", "EI_EXPOSE_REP2"}, justification="should disable at filter level and also for pmd - not important for us")
public class CreateAccountNote implements Serializable {

    private final LocalDate commentDate;
    private final String comment;
    private final Integer createdById;
    private final Integer accountId;

    public CreateAccountNote(final LocalDate commentDate, final String comment, final Integer createdById, Integer accountId) {
        this.commentDate = commentDate;
        this.comment = comment;
        this.createdById = createdById;
        this.accountId = accountId;
    }

    public LocalDate getCommentDate() {
        return this.commentDate;
    }

    public String getComment() {
        return this.comment;
    }

    public Integer getCreatedById() {
        return this.createdById;
    }

    public Integer getAccountId() {
        return this.accountId;
    }
}


text:
package it.spot.android.animatorchain;

import android.animation.TimeInterpolator;
import android.view.ViewPropertyAnimator;
import android.view.animation.LinearInterpolator;

/**
 * This class represents an animation item that can be chained
 * to others in a very simple way.

 * It allows to set up the most common properties for animation
 * and can be easily extended, if needed.

 * Many of its public methods allows chaining, for a more pleasant usage.
 *
 * @author a.rinaldi
 */
public class AnimatorChainItem {

    private static final int DEFAULT_DELAY = 0;
    private static final int DEFAULT_DURATION = 500;

    private boolean mHasTranslationX;
    private float mTranslationX;
    private boolean mHasTranslationY;
    private float mTranslationY;
    private boolean mHasRotation;
    private float mRotation;
    private boolean mHasRotationX;
    private float mRotationX;
    private boolean mHasRotationY;
    private float mRotationY;
    private boolean mHasScaleX;
    private float mScaleX;
    private boolean mHasScaleY;
    private float mScaleY;
    private boolean mHasX;
    private float mX;
    private boolean mHasY;
    private float mY;
    private boolean mHasAlpha;
    private float mAlpha;

    private int mDelay;
    private int mDuration;

    private TimeInterpolator mInterpolator;

    // region Construction

    /**
     * This is the constructor.

     * It's protected because a static factory method is preferable
     * for chaining methods calls.

     */
    protected AnimatorChainItem() {
        super();

        this.mDelay = DEFAULT_DELAY;
        this.mDuration = DEFAULT_DURATION;
        this.mInterpolator = new LinearInterpolator();
    }

    /**
     * A public static factory method which returns an instance
     * of {@link AnimatorChainItem}.
     *
     * @return an item instance
     */
    public static AnimatorChainItem create() {
        return new AnimatorChainItem();
    }

    // endregion

    // region Public methods

    /**
     * Applies the properties of the item to an instance of
     * {@link ViewPropertyAnimator} without starting it.

     * It wraps many of the {@link ViewPropertyAnimator} features.
     *
     * @param animator the {@link ViewPropertyAnimator} to set up
     * @return the animator itself, allowing chaining.
     */
    public ViewPropertyAnimator apply(ViewPropertyAnimator animator) {
        synchronized (this) {
            animator.setDuration(this.mDuration)
                    .setStartDelay(this.mDelay)
                    .setInterpolator(this.mInterpolator);

            if (this.mHasAlpha) {
                animator.alpha(this.mAlpha);
            }

            if (this.mHasY) {
                animator.y(this.mY);
            }

            if (this.mHasX) {
                animator.x(this.mX);
            }

            if (this.mHasRotation) {
                animator.rotation(this.mRotation);
            }

            if (this.mHasRotationX) {
                animator.rotationX(this.mRotationX);
            }

            if (this.mHasRotationY) {
                animator.rotationY(this.mRotationY);
            }

            if (this.mHasScaleX) {
                animator.scaleX(this.mScaleX);
            }

            if (this.mHasScaleY) {
                animator.scaleY(this.mScaleY);
            }

            if (this.mHasTranslationX) {
                animator.translationX(this.mTranslationX);
            }

            if (this.mHasTranslationY) {
                animator.translationY(this.mTranslationY);
            }

            return animator;
        }
    }

    public AnimatorChainItem setY(float y) {
        synchronized (this) {
            this.mHasY = true;
            this.mY = y;
            return this;
        }
    }

    public AnimatorChainItem setX(float x) {
        synchronized (this) {
            this.mHasX = true;
            this.mX = x;
            return this;
        }
    }

    public AnimatorChainItem setRotation(float rotation) {
        synchronized (this) {
            this.mHasRotation = true;
            this.mRotation = rotation;
            return this;
        }
    }

    public AnimatorChainItem setRotationX(float rotationX) {
        synchronized (this) {
            this.mHasRotationX = true;
            this.mX = rotationX;
            return this;
        }
    }

    public AnimatorChainItem setRotationY(float rotationY) {
        synchronized (this) {
            this.mHasRotationY = true;
            this.mX = rotationY;
            return this;
        }
    }

    public AnimatorChainItem setTranslationX(float translationX) {
        synchronized (this) {
            this.mHasTranslationX = true;
            this.mTranslationX = translationX;
            return this;
        }
    }

    public AnimatorChainItem setTranslationY(float translationY) {
        synchronized (this) {
            this.mHasTranslationY = true;
            this.mTranslationY = translationY;
            return this;
        }
    }

    public AnimatorChainItem setScaleX(float scaleX) {
        synchronized (this) {
            this.mHasScaleX = true;
            this.mScaleX = scaleX;
            return this;
        }
    }

    public AnimatorChainItem setScaleY(float scaleY) {
        synchronized (this) {
            this.mHasScaleY = true;
            this.mScaleY = scaleY;
            return this;
        }
    }

    public AnimatorChainItem setStartDelay(int delay) {
        synchronized (this) {
            this.mDelay = delay;
            return this;
        }
    }

    public AnimatorChainItem setDuration(int duration) {
        synchronized (this) {
            this.mDuration = duration;
            return this;
        }
    }

    public AnimatorChainItem setAlpha(float alpha) {
        synchronized (this) {
            this.mHasAlpha = true;
            this.mAlpha = alpha;
            return this;
        }
    }

    public AnimatorChainItem setInterpolator(TimeInterpolator interpolator) {
        synchronized (this) {
            this.mInterpolator = interpolator;
            return this;
        }
    }

    // endregion

}


text:
module ThinkingSphinx
  module Deltas
    class DefaultDelta
      attr_accessor :column

      def initialize(index, options)
        @index  = index
        @column = options.delete(:delta_column) || :delta
      end

      def index(model, instance = nil)
        return true unless ThinkingSphinx.updates_enabled? &&
          ThinkingSphinx.deltas_enabled?
        return true if instance && !toggled(instance)

        update_delta_indexes model
        delete_from_core     model, instance if instance

        true
      end

      def toggle(instance)
        instance.send "#{@column}=", true
      end

      def toggled(instance)
        instance.send "#{@column}"
      end

      def reset_query(model)
        "UPDATE #{model.quoted_table_name} SET " +
        "#{model.connection.quote_column_name(@column.to_s)} = #{adapter.boolean(false)} " +
        "WHERE #{model.connection.quote_column_name(@column.to_s)} = #{adapter.boolean(true)}"
      end

      def clause(model, toggled)
        "#{model.quoted_table_name}.#{model.connection.quote_column_name(@column.to_s)}" +
        " = #{adapter.boolean(toggled)}"
      end

      private

      def update_delta_indexes(model)
        config = ThinkingSphinx::Configuration.instance
        rotate = ThinkingSphinx.sphinx_running? ? "--rotate" : ""

        output = `#{config.bin_path}#{config.indexer_binary_name} --config "#{config.config_file}" #{rotate} #{model.delta_index_names.join(' ')}`
        puts(output) unless ThinkingSphinx.suppress_delta_output?
      end

      def delete_from_core(model, instance)
        model.core_index_names.each do |index_name|
          model.delete_in_index index_name, instance.sphinx_document_id
        end
      end

      def adapter
        @adapter = @index.model.sphinx_database_adapter
      end
    end
  end
end


text:
<!DOCTYPE html>

        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <meta http-equiv="x-ua-compatible" content="IE=edge"/>
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, target-densitydpi=medium-dpi"/>
        <meta name="mobile-web-app-capable" content="yes"/>
        <meta name="apple-mobile-web-app-capable" content="yes"/>
        <link rel="icon" type="image/png" href="images/logo-64.png"/>
        <link rel="icon" type="image/png" sizes="144x144" href="images/logo-144.png"/>
        <link rel="apple-touch-icon" type="image/png" href="images/logo-144.png"/>
        <link rel="stylesheet" type="text/css" href="webjars/simonwep__pickr/1.2.6/dist/themes/monolith.min.css"/>
        <link rel="stylesheet" type="text/css" href="app.css?v=${project.version}">
        <title ng-bind="page.title | translate"></title>

                        <guac-notification notification="guacNotification.getStatus()"></guac-notification>

            <guac-login ng-show="expectedCredentials"
                        help-text="loginHelpText"
                        form="expectedCredentials"
                        values="acceptedCredentials"></guac-login>


text:
**Namespace:** [OfficeDevPnP.Core.Framework.Provisioning.Providers.Xml.V201508](OfficeDevPnP.Core.Framework.Provisioning.Providers.Xml.V201508.md)
**Assembly:** OfficeDevPnP.Core.dll
## Syntax
```C#
public string Title { get; set; }
```

### Property Value
Type: System.String

## See also
- [Site](OfficeDevPnP.Core.Framework.Provisioning.Providers.Xml.V201508.Site.md)
- [OfficeDevPnP.Core.Framework.Provisioning.Providers.Xml.V201508](OfficeDevPnP.Core.Framework.Provisioning.Providers.Xml.V201508.md)


text:
'use strict';

angular.module('core').directive('infobox',
	function($timeout) {
        return {
            restrict: 'AE',
            transclude: true,
            scope: {
                logo: '@',
                title: '@',
                position: '@'
            },
            link: function(scope, elem, attrs) {

                switch (scope.logo) {
                    case 'woman': scope.image = '/modules/core/img/brand/hibernator.png'; break;
                    case 'girl': scope.image = '/modules/core/img/brand/investigator.png'; break;
                    case 'boy': scope.image = '/modules/core/img/brand/illustrator.gif'; break;
                    case 'man': scope.image = '/modules/core/img/brand/illuminator.png'; break;
                    case 'guru': scope.image = '/modules/core/img/brand/gator-skater.png'; break;
                    case 'philosopher': scope.image = '/modules/core/img/brand/refrigerator.png'; break;
                }
            },
            templateUrl: '/modules/core/views/templates/infobox.html'
        };
	}
);


text: Special Education Advisor/Psychologist


text:
import java.text.DateFormatSymbols;
import java.util.*;
import java.util.concurrent.*;

public class AnnualSalesCalc {

    private static int NUMBER_OF_CUSTOMERS = 100;
    private static int NUMBER_OF_MONTHS = 12;
    private static int salesMatrix[][];

    private static class Summer implements Callable {

        private int companyID;

        public Summer(int companyID) {
            this.companyID = companyID;
        }

        public Integer call() {
            int sum = 0;
            for (int col = 0; col < NUMBER_OF_MONTHS; col++) {
                sum += salesMatrix[companyID][col];
            }
            System.out.printf(
                    "Totaling for client 1%02d completed%n", companyID);
            return sum;
        }
    }

    public static void main(String args[]) throws Exception {
        generateMatrix();
        printMatrix();
        ExecutorService executor = Executors.newFixedThreadPool(10);
        Set<Future<Integer>> set = new HashSet<Future<Integer>>();
        for (int row = 0; row < NUMBER_OF_CUSTOMERS; row++) {
            Callable<Integer> callable = new Summer(row);
            Future<Integer> future = executor.submit(callable);
            set.add(future);
        }
        int sum = 0;
        for (Future<Integer> future : set) {
            sum += future.get();
        }
        System.out.printf("%nThe annual turnover (bags): %s%n%n", sum);
        executor.shutdown();
    }

    private static void generateMatrix() {
        salesMatrix = new int[NUMBER_OF_CUSTOMERS][NUMBER_OF_MONTHS];
        for (int i = 0; i < NUMBER_OF_CUSTOMERS; i++) {
            for (int j = 0; j < NUMBER_OF_MONTHS; j++) {
                salesMatrix[i][j] = (int) (Math.random() * 100);
            }
        }
    }

    private static void printMatrix() {
        System.out.print("\t\t");
        String[] monthDisplayNames =
                (new DateFormatSymbols()).getShortMonths();
        for (String strName : monthDisplayNames) {
            System.out.printf("%8s", strName);
        }
        System.out.printf("%n%n");
        for (int i = 0; i < NUMBER_OF_CUSTOMERS; i++) {
            System.out.printf("Client ID: 1%02d", i);
            for (int j = 0; j < NUMBER_OF_MONTHS; j++) {
                System.out.printf("%8d", salesMatrix[i][j]);
            }
            System.out.println();
        }
        System.out.printf("%n%n");
    }
}


text:
import TabView from "./tab-view";

import CalendarView from "../cal/calendar-view";
import SessionListView from "../list/session-list-view";

import serviceClient from "../service/service-client";

export default class CalendarTab extends TabView
{
    _calendarView = null;
    _sessionListView = null;

    constructor()
    {
        super("calendarTab", {
            title: "日历",
            icon: "calendar"
        });
        this.addClass("calendar-tab");

        this._initCalendarView();
        this._initSessionView();
    }

    _initCalendarView()
    {
        this._calendarView = new CalendarView("calendar");
        this._calendarView.on("selectionchanged", _calendarView_onselectionchanged.bind(this));
        this.addSubview(this._calendarView);
    }

    _initSessionView()
    {
        this._sessionListView = new SessionListView("sessionList", true);
        this.addSubview(this._sessionListView);
    }

    activate()
    {
        super.activate();
        if (this._calendarView.date === null)
        {
            this._sessionListView.css("paddingTop", this._calendarView.height() - 1);
            this._calendarView.navigateAndSelect(new Date());
        }
    }
}

function _calendarView_onselectionchanged(e)
{
    this._sessionListView.queryByDate(this._calendarView.selection);
}


text:
package net.runelite.client.plugins.slayer;

import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.Polygon;
import java.util.List;
import javax.inject.Inject;
import net.runelite.api.NPC;
import net.runelite.client.ui.overlay.Overlay;
import net.runelite.client.ui.overlay.OverlayLayer;
import net.runelite.client.ui.overlay.OverlayPosition;

public class TargetClickboxOverlay extends Overlay
{
	private final SlayerConfig config;
	private final SlayerPlugin plugin;

	@Inject
	TargetClickboxOverlay(SlayerConfig config, SlayerPlugin plugin)
	{
		this.config = config;
		this.plugin = plugin;
		setPosition(OverlayPosition.DYNAMIC);
		setLayer(OverlayLayer.ABOVE_SCENE);
	}

	@Override
	public Dimension render(Graphics2D graphics)
	{
		if (!config.highlightTargets())
		{
			return null;
		}

		List<NPC> targets = plugin.getHighlightedTargets();
		for (NPC target : targets)
		{
			renderTargetOverlay(graphics, target, config.getTargetColor());
		}

		return null;
	}

	private void renderTargetOverlay(Graphics2D graphics, NPC actor, Color color)
	{
		Polygon objectClickbox = actor.getConvexHull();
		if (objectClickbox != null)
		{
			graphics.setColor(color);
			graphics.setStroke(new BasicStroke(2));
			graphics.draw(objectClickbox);
			graphics.setColor(new Color(color.getRed(), color.getGreen(), color.getBlue(), 20));
			graphics.fill(objectClickbox);
		}
	}
}


text:
/*
 * cpu_info_test.cpp
 *
 *  Created on: Dec 19, 2019
 *      Author: devel
 */

#include "cpu_info.hpp"

namespace license {} /* namespace license */


text:
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) > [sip.js](./sip.js.md) > [Session](./sip.js.session.md)

## Session class

A session provides real time communication between one or more participants.

<b>Signature:</b>

```typescript
export declare abstract class Session
```

## Remarks

The transport behaves in a deterministic manner according to the the state defined in [SessionState](./sip.js.sessionstate.md)<!-- -->.

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `Session` class.

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [assertedIdentity](./sip.js.session.assertedidentity.md) |  | NameAddrHeader \| undefined | The asserted identity of the remote user. |
|  [data](./sip.js.session.data.md) |  | unknown | Property reserved for use by instance owner. |
|  [delegate](./sip.js.session.delegate.md) |  | [SessionDelegate](./sip.js.sessiondelegate.md) \| undefined | The session delegate. |
|  [dialog](./sip.js.session.dialog.md) |  | SessionDialog \| undefined | The confirmed session dialog. |
|  [id](./sip.js.session.id.md) |  | string | A unique identifier for this session. |
|  [localIdentity](./sip.js.session.localidentity.md) |  | NameAddrHeader | The identity of the local user. |
|  [logger](./sip.js.session.logger.md) |  | Logger | Logger. |
|  [remoteIdentity](./sip.js.session.remoteidentity.md) |  | NameAddrHeader | The identity of the remote user. |
|  [replacee](./sip.js.session.replacee.md) |  | [Session](./sip.js.session.md) \| undefined | The session being replace by this one. |
|  [sessionDescriptionHandler](./sip.js.session.sessiondescriptionhandler.md) |  | [SessionDescriptionHandler](./sip.js.sessiondescriptionhandler.md) \| undefined | Session description handler. |
|  [sessionDescriptionHandlerFactory](./sip.js.session.sessiondescriptionhandlerfactory.md) |  | [SessionDescriptionHandlerFactory](./sip.js.sessiondescriptionhandlerfactory.md) | Session description handler factory. |
|  [sessionDescriptionHandlerModifiers](./sip.js.session.sessiondescriptionhandlermodifiers.md) |  | Array<[SessionDescriptionHandlerModifier](./sip.js.sessiondescriptionhandlermodifier.md)<!-- -->> | SDH modifiers for the initial INVITE transaction. |
|  [sessionDescriptionHandlerModifiersReInvite](./sip.js.session.sessiondescriptionhandlermodifiersreinvite.md) |  | Array<[SessionDescriptionHandlerModifier](./sip.js.sessiondescriptionhandlermodifier.md)<!-- -->> | SDH modifiers for re-INVITE transactions. |
|  [sessionDescriptionHandlerOptions](./sip.js.session.sessiondescriptionhandleroptions.md) |  | [SessionDescriptionHandlerOptions](./sip.js.sessiondescriptionhandleroptions.md) | SDH options for the initial INVITE transaction. |
|  [sessionDescriptionHandlerOptionsReInvite](./sip.js.session.sessiondescriptionhandleroptionsreinvite.md) |  | [SessionDescriptionHandlerOptions](./sip.js.sessiondescriptionhandleroptions.md) | SDH options for re-INVITE transactions. |
|  [state](./sip.js.session.state.md) |  | [SessionState](./sip.js.sessionstate.md) | Session state. |
|  [stateChange](./sip.js.session.statechange.md) |  | [Emitter](./sip.js.emitter.md)<!-- --><[SessionState](./sip.js.sessionstate.md)<!-- -->> | Session state change emitter. |
|  [userAgent](./sip.js.session.useragent.md) |  | [UserAgent](./sip.js.useragent.md) | The user agent. |

## Methods

|  Method | Modifiers | Description |
|  --- | --- | --- |
|  [bye(options)](./sip.js.session.bye.md) |  | End the [Session](./sip.js.session.md)<!-- -->. Sends a BYE. |
|  [dispose()](./sip.js.session.dispose.md) |  | Destructor. |
|  [info(options)](./sip.js.session.info.md) |  | Share [Info](./sip.js.info.md) with peer. Sends an INFO. |
|  [invite(options)](./sip.js.session.invite.md) |  | Renegotiate the session. Sends a re-INVITE. |
|  [message(options)](./sip.js.session.message.md) |  | Deliver a [Message](./sip.js.message.md)<!-- -->. Sends a MESSAGE. |
|  [refer(referTo, options)](./sip.js.session.refer.md) |  | Proffer a [Referral](./sip.js.referral.md)<!-- -->. Send a REFER. |