text:
              Atención y contacto: 52 (33) 3125-2200

            <a class="uppr-logo" href="<?=base_url()?>">
              <img class="center-block" src="<?=base_url()?>img/logos/intermed.png">

                Para:

                MEDICOS

                PACIENTES

                INSTITUCIONES

                PROVEEDORES

                ASEGURADORAS

Terminos y Condiciones

1. Introducción

Las presentes condiciones generales de uso de la página web, regulan los términos y condiciones de acceso y uso de www.intermed.online, propiedad de New Channel Media S.A. de C.V., en adelante, «la Empresa», que el usuario del Portal deberá de leer y aceptar para usar todos los servicios e información que se facilitan desde el portal.
                  El mero acceso y/o utilización del portal, de todos o parte de sus contenidos y/o servicios significa la plena aceptación de las presentes condiciones generales de uso.

2. Condiciones de uso

Las presentes condiciones generales de uso del portal regulan el acceso y la utilización del portal, incluyendo los contenidos y los servicios puestos a disposición de los usuarios en y/o a través del portal, bien por el portal, bien por sus
                  usuarios, bien por terceros. No obstante, el acceso y la utilización de ciertos contenidos y/o servicios puede encontrarse sometido a determinadas condiciones específicas.

3. Modificaciones

La empresa se reserva la facultad de modificar en cualquier momento las condiciones generales de uso del portal. En todo caso, se recomienda que consulte periódicamente los presentes términos de uso del portal, ya que pueden ser modificados.

4. Obligaciones del Usuario

El usuario deberá respetar en todo momento los términos y condiciones establecidos en las presentes condiciones generales de uso del portal. De forma expresa el usuario manifiesta que utilizará el portal de forma diligente y asumiendo cualquier
                  responsabilidad que pudiera derivarse del incumplimiento de las normas.

Así mismo, el usuario no podrá utilizar el portal para transmitir, almacenar, divulgar promover o distribuir datos o contenidos que sean portadores de virus o cualquier otro código informático, archivos o programas diseñados para interrumpir,
                  destruir o perjudicar el funcionamiento de cualquier programa o equipo informático o de telecomunicaciones.

5. Responsabilidad del portal

El usuario conoce y acepta que el portal no otorga ninguna garantía de cualquier naturaleza, ya sea expresa o implícita, sobre los datos, contenidos, información y servicios que se incorporan y ofrecen desde el Portal.

Exceptuando los casos que la Ley imponga expresamente lo contrario, y exclusivamente con la medida y extensión en que lo imponga, el Portal no garantiza ni asume responsabilidad alguna respecto a los posibles daños y perjuicios causados por
                  el uso y utilización de la información, datos y servicios del Portal.

En todo caso, el Portal excluye cualquier responsabilidad por los daños y perjuicios que puedan deberse a la información y/o servicios prestados o suministrados por terceros diferentes de la Empresa. Toda responsabilidad será del tercero ya
                  sea proveedor o colaborador.

6. Propiedad intelectual e industrial

Todos los contenidos, marcas, logos, dibujos, documentación, programas informáticos o cualquier otro elemento susceptible de protección por la legislación de propiedad intelectual o industrial, que sean accesibles en el portal corresponden
                  exclusivamente a la empresa o a sus legítimos titulares y quedan expresamente reservados todos los derechos sobre los mismos. Queda expresamente prohibida la creación de enlaces de hipertexto (links) a cualquier elemento integrante de las
                  páginas web del Portal sin la autorización de la empresa, siempre que no sean a una página web del Portal que no requiera identificación o autenticación para su acceso, o el mismo esté restringido.

En cualquier caso, el portal se reserva todos los derechos sobre los contenidos, información datos y servicios que ostente sobre los mismos. El portal no concede ninguna licencia o autorización de uso al usuario sobre sus contenidos, datos
                  o servicios, distinta de la que expresamente se detalle en las presentes condiciones generales de uso del portal.

Política de Privacidad

En www.intermed.online, respetamos su información personal y en vista de cumplir con las políticas de seguridad respectivas concernientes a todo sitio web, que deberían ser obligatorias, informamos a ustedes lo siguiente.

1. Privacidad de los datos personales:

Sus datos personales le corresponden solo a usted y este sitio web es responsable de no revelar ninguna clase de información que le pertenezca (como email, números de ip, etc.), salvo su expresa autorización o fuerzas de naturaleza mayor de tipo legal que lo involucren, como hackeos o suplantaciones.

2. Seguridad de su información personal:

Este sitio web se hace responsable de velar por su seguridad, por la privacidad de su información y por el respeto a sus datos, de acuerdo con las limitaciones que la actual Internet nos provee, siendo conscientes que no estamos excluídos de sufrir algún ataque por parte de crackers o usuarios malintencionados que ejerzan la delincuencia informática.

3. Obtención de su información:

Todos sus datos personales consignados en este sitio son suministrados por usted mismo, haciendo uso entero de su libertad. La información aqui almacenada solo comprende datos básicos ingresados mediante formularios de contacto, comentarios u otros similares.

4. Uso de la información:

Al proporcionarnos sus datos personales, estando de acuerdo con la Política de Privacidad aquí consignada, nos autoriza para el siguiente uso de su información:

 a) para el fin mismo por lo cual se ha suministrado.

 b) para considerarlo dentro de nuestras estadísticas de tráfico, incrementando así nuestra oferta publicitaria y de mercado.

 c) para orientar mejor los servicios aquí ofrecidos y valorarlos a su criterio.

 d) para enviar e-mails con nuestros boletines, responder inquietudes o comentarios, y mantener informado a nuestros usuarios.

5. Modificaciones a nuestras Políticas de Privacidad:

El sitio web se reserva el derecho de modificar, rectificar, alterar, agregar o eliminar cualquier punto del presente escrito en cualquier momento y sin previo aviso, siendo su responsabilidad el mantenerse informado del mismo para una adecuada administración de su información.

redpajama_set_name: RedPajamaGithub


text:
package net.rocketeer.jbl.model.variable.set;

import net.rocketeer.jbl.model.distribution.DiscreteUniformDistribution;
import net.rocketeer.jbl.model.variable.DiscreteVariable;
import net.rocketeer.jbl.model.variable.Variable;
import net.rocketeer.jbl.compute.Sampler;

import java.util.Collections;
import java.util.HashSet;
import java.util.Set;

public class DiscreteStateSpace<T extends Enum> implements StateSpace<T> {
  private final Set<T> values = new HashSet<>();

  public DiscreteStateSpace(T...values) {
    Collections.addAll(this.values, values);
  }

  @Override
  public boolean contains(T value) {
    return this.values.contains(value);
  }

  @Override
  public T read(Object object) {
    return (T) object;
  }

  @Override
  public Sampler createUniformSampler(Variable variable) {
    if (!(variable.stateSpace() instanceof DiscreteStateSpace))
      throw new IllegalArgumentException("Variable has to be in same state space!");
    DiscreteVariable<T> x = new DiscreteVariable<>(this, variable.id());
    return new DiscreteUniformDistribution<>(x);
  }

  public Set<T> elements() {
    return this.values;
  }

  @Override
  public boolean equals(Object other) {
    if (!(other instanceof DiscreteStateSpace))
      return false;
    DiscreteStateSpace<?> stateSpace = (DiscreteStateSpace<?>) other;
    if (stateSpace.values.size() != this.values.size())
      return false;
    for (Object o : stateSpace.values)
      if (!this.values.contains(o))
        return false;
    return true;
  }
}


text:
import * as clc from "colorette";
import { FirebaseError } from "./error";
import { getDefaultDatabaseInstance } from "./getDefaultDatabaseInstance";

/**
 * Error message to be returned when the default database instance is found to be missing.
 */
export const MISSING_DEFAULT_INSTANCE_ERROR_MESSAGE = `It looks like you haven't created a Realtime Database instance in this project before. Please run ${clc.bold(
  clc.underline("firebase init database")
)} to create your default Realtime Database instance.`;

/**
 * Ensures that the supplied options have an instance set. If not, tries to fetch the default instance.
 * @param options command options
 * @return void promise.
 */
export async function requireDatabaseInstance(options: any): Promise<void> {
  if (options.instance) {
    return;
  }
  let instance;
  try {
    instance = await getDefaultDatabaseInstance(options);
  } catch (err: any) {
    throw new FirebaseError(`Failed to get details for project: ${options.project}.`, {
      original: err,
    });
  }
  if (instance === "") {
    throw new FirebaseError(MISSING_DEFAULT_INSTANCE_ERROR_MESSAGE);
  }
  options.instance = instance;
}


text:
'''This file generates shell code for the setup.SHELL scripts to set environment variables'''

from __future__ import print_function
import argparse
import copy
import os
import platform
import sys

# environment at generation time
CMAKE_PREFIX_PATH = '/opt/ros/groovy'.split(';')
setup_dir = '/usr/local'
if setup_dir not in CMAKE_PREFIX_PATH:
    CMAKE_PREFIX_PATH.insert(0, setup_dir)
CMAKE_PREFIX_PATH = os.pathsep.join(CMAKE_PREFIX_PATH)

CATKIN_MARKER_FILE = '.catkin'

system = platform.system()
IS_DARWIN = (system == 'Darwin')
IS_WINDOWS = (system == 'Windows')

# subfolder of workspace prepended to CMAKE_PREFIX_PATH
ENV_VAR_SUBFOLDERS = {
    'CMAKE_PREFIX_PATH': '',
    'CPATH': 'include',
    'LD_LIBRARY_PATH' if not IS_DARWIN else 'DYLD_LIBRARY_PATH': 'lib',
    'PATH': 'bin',
    'PKG_CONFIG_PATH': 'lib/pkgconfig',
    'PYTHONPATH': 'lib/python2.7/dist-packages',
}

def rollback_env_variables(environ, env_var_subfolders):
    '''
    Generate shell code to reset environment variables
    by unrolling modifications based on all workspaces in CMAKE_PREFIX_PATH.
    This does not cover modifications performed by environment hooks.
    '''
    lines = []
    unmodified_environ = copy.copy(environ)
    for key in sorted(env_var_subfolders.keys()):
        subfolder = env_var_subfolders[key]
        value = _rollback_env_variable(unmodified_environ, key, subfolder)
        if value is not None:
            environ[key] = value
            lines.append(assignment(key, value))
    if lines:
        lines.insert(0, comment('reset environment variables by unrolling modifications based on all workspaces in CMAKE_PREFIX_PATH'))
    return lines

def _rollback_env_variable(environ, name, subfolder):
    '''
    For each catkin workspace in CMAKE_PREFIX_PATH remove the first entry from env[NAME] matching workspace + subfolder.

    :param subfolder: str '' or subfoldername that may start with '/'
    :returns: the updated value of the environment variable.
    '''
    value = environ[name] if name in environ else ''
    env_paths = [path for path in value.split(os.pathsep) if path]
    value_modified = False
    if subfolder:
        if subfolder.startswith(os.path.sep) or (os.path.altsep and subfolder.startswith(os.path.altsep)):
            subfolder = subfolder[1:]
        if subfolder.endswith(os.path.sep) or (os.path.altsep and subfolder.endswith(os.path.altsep)):
            subfolder = subfolder[:-1]
    for ws_path in _get_workspaces(environ, include_fuerte=True):
        path_to_find = os.path.join(ws_path, subfolder) if subfolder else ws_path
        path_to_remove = None
        for env_path in env_paths:
            env_path_clean = env_path[:-1] if env_path and env_path[-1] in [os.path.sep, os.path.altsep] else env_path
            if env_path_clean == path_to_find:
                path_to_remove = env_path
                break
        if path_to_remove:
            env_paths.remove(path_to_remove)
            value_modified = True
    new_value = os.pathsep.join(env_paths)
    return new_value if value_modified else None

def _get_workspaces(environ, include_fuerte=False):
    '''
    Based on CMAKE_PREFIX_PATH return all catkin workspaces.

    :param include_fuerte: The flag if paths starting with '/opt/ros/fuerte' should be considered workspaces, ``bool``
    '''
    # get all cmake prefix paths
    env_name = 'CMAKE_PREFIX_PATH'
    value = environ[env_name] if env_name in environ else ''
    paths = [path for path in value.split(os.pathsep) if path]
    # remove non-workspace paths
    workspaces = [path for path in paths if os.path.isfile(os.path.join(path, CATKIN_MARKER_FILE)) or (include_fuerte and path.startswith('/opt/ros/fuerte'))]
    return workspaces

def prepend_env_variables(environ, env_var_subfolders, workspaces):
    '''
    Generate shell code to prepend environment variables
    for the all workspaces.
    '''
    lines = []
    lines.append(comment('prepend folders of workspaces to environment variables'))

    paths = [path for path in workspaces.split(os.pathsep) if path]

    prefix = _prefix_env_variable(environ, 'CMAKE_PREFIX_PATH', paths, '')
    lines.append(prepend(environ, 'CMAKE_PREFIX_PATH', prefix))

    for key in sorted([key for key in env_var_subfolders.keys() if key != 'CMAKE_PREFIX_PATH']):
        subfolder = env_var_subfolders[key]
        prefix = _prefix_env_variable(environ, key, paths, subfolder)
        lines.append(prepend(environ, key, prefix))
    return lines

def _prefix_env_variable(environ, name, paths, subfolder):
    '''
    Return the prefix to prepend to the environment variable NAME, adding any path in NEW_PATHS_STR without creating duplicate or empty items.
    '''
    value = environ[name] if name in environ else ''
    environ_paths = [path for path in value.split(os.pathsep) if path]
    checked_paths = []
    for path in paths:
        if subfolder:
            path = os.path.join(path, subfolder)
        # exclude any path already in env and any path we already added
        if path not in environ_paths and path not in checked_paths:
            checked_paths.append(path)
    prefix_str = os.pathsep.join(checked_paths)
    if prefix_str != '' and environ_paths:
        prefix_str += os.pathsep
    return prefix_str

def assignment(key, value):
    if not IS_WINDOWS:
        return 'export %s="%s"' % (key, value)
    else:
        return 'set %s=%s' % (key, value)

def comment(msg):
    if not IS_WINDOWS:
        return '# %s' % msg
    else:
        return 'REM %s' % msg

def prepend(environ, key, prefix):
    if key not in environ or not environ[key]:
        return assignment(key, prefix)
    if not IS_WINDOWS:
        return 'export %s="%s$%s"' % (key, prefix, key)
    else:
        return 'set %s=%s%%%s%%' % (key, prefix, key)

def find_env_hooks(environ, cmake_prefix_path):
    '''
    Generate shell code with found environment hooks
    for the all workspaces.
    '''
    lines = []
    lines.append(comment('found environment hooks in workspaces'))

    generic_env_hooks = []
    specific_env_hooks = []
    generic_env_hooks_by_filename = {}
    specific_env_hooks_by_filename = {}
    generic_env_hook_ext = 'bat' if IS_WINDOWS else 'sh'
    specific_env_hook_ext = environ['CATKIN_SHELL'] if not IS_WINDOWS and 'CATKIN_SHELL' in environ and environ['CATKIN_SHELL'] else None
    # remove non-workspace paths
    workspaces = [path for path in cmake_prefix_path.split(os.pathsep) if path and os.path.isfile(os.path.join(path, CATKIN_MARKER_FILE))]
    for workspace in reversed(workspaces):
        env_hook_dir = os.path.join(workspace, 'etc', 'catkin', 'profile.d')
        if os.path.isdir(env_hook_dir):
            for filename in sorted(os.listdir(env_hook_dir)):
                if filename.endswith('.%s' % generic_env_hook_ext):
                    generic_env_hooks.append(os.path.join(env_hook_dir, filename))
                    # remove previous env hook with same name if present
                    if filename in generic_env_hooks_by_filename:
                        generic_env_hooks.remove(generic_env_hooks_by_filename[filename])
                    generic_env_hooks_by_filename[filename] = generic_env_hooks[-1]
                elif specific_env_hook_ext is not None and filename.endswith('.%s' % specific_env_hook_ext):
                    specific_env_hooks.append(os.path.join(env_hook_dir, filename))
                    # remove previous env hook with same name if present
                    if filename in specific_env_hooks_by_filename:
                        specific_env_hooks.remove(specific_env_hooks_by_filename[filename])
                    specific_env_hooks_by_filename[filename] = specific_env_hooks[-1]
    lines.append(assignment('_CATKIN_ENVIRONMENT_HOOKS', os.pathsep.join(generic_env_hooks + specific_env_hooks)))
    return lines

def _parse_arguments(args=None):
    parser = argparse.ArgumentParser(description='Generates code blocks for the setup.SHELL script.')
    parser.add_argument('--extend', action='store_true', help='Skip unsetting previous environment variables to extend context')
    return parser.parse_known_args(args=args)[0]

if __name__ == '__main__':
    try:
        args = _parse_arguments()
    except Exception as e:
        print(e, file=sys.stderr)
        exit(1)

    environ = dict(os.environ)
    lines = []
    if not args.extend:
        lines += rollback_env_variables(environ, ENV_VAR_SUBFOLDERS)
    lines += prepend_env_variables(environ, ENV_VAR_SUBFOLDERS, CMAKE_PREFIX_PATH)
    lines += find_env_hooks(environ, CMAKE_PREFIX_PATH)
    print('\n'.join(lines))
    sys.exit(0)


text:
package test.dataprovider.issue2255;

import static org.assertj.core.api.Assertions.assertThat;

import org.testng.TestNG;
import org.testng.annotations.Test;
import test.SimpleBaseTest;

public class IssueTest extends SimpleBaseTest {

  @Test(description = "GITHUB-2255")
  public void runTest() {
    TestNG testNG = create(SampleTestCase.class);
    testNG.run();
    assertThat(SampleTestCase.data).containsExactly(100, 200);
  }
}


text:
#region License

#endregion

using System.Collections;
using System.EnterpriseServices;
using System.Reflection;
using System.Reflection.Emit;
using Spring.Core.TypeResolution;
using Spring.Objects.Factory;
using Spring.Proxy;

namespace Spring.EnterpriseServices
{
    ///
    /// Encapsulates information necessary to create ServicedComponent
    /// wrapper around target class.
    ///
    /// <remarks>
    /// <para>
    /// Instances of this class should be used as elements in the Components
    /// list of the <see cref="EnterpriseServicesExporter"/> class, which will
    /// register them with COM+ Services. For a full description on how to export
    /// and use services with COM+, see the <see cref="EnterpriseServicesExporter"/> reference.
    /// </para>
    /// </remarks>
    /// <seealso cref="EnterpriseServicesExporter"/>
    /// <author>Aleksandar Seovic</author>
    /// <author>Erich Eichinger</author>
    public class ServicedComponentExporter : IInitializingObject, IObjectNameAware
    {
        #region Fields

        private string _objectName;
        private string _targetName;
        private string[] _interfaces;
        private IList _typeAttributes = new ArrayList();
        private IDictionary _memberAttributes = new Hashtable();

        #endregion

        #region Constructor(s) / Destructor

        ///
        /// Creates a new instance of the
        /// <see cref="ServicedComponentExporter"/> class.
        ///
        public ServicedComponentExporter()
        {}

        #endregion

        #region Properties

        ///
        /// Gets or sets name of the target object that should be exposed as a serviced component.
        ///
        public string TargetName
        {
            get { return _targetName; }
            set { _targetName = value; }
        }

        ///
        /// Gets or sets the list of interfaces whose methods should be exported.
        ///
        /// <remarks>
        /// The default value of this property is all the interfaces
        /// implemented or inherited by the target type.
        /// </remarks>
        /// <value>The interfaces to export.</value>
        public string[] Interfaces
        {
            get { return _interfaces; }
            set { _interfaces = value; }
        }

        ///
        /// Gets or sets a list of custom attributes
        /// that should be applied to a proxy class.
        ///
        public IList TypeAttributes
        {
            get { return _typeAttributes; }
            set { _typeAttributes = value; }
        }

        ///
        /// Gets or sets a dictionary of custom attributes
        /// that should be applied to proxy members.
        ///
        /// <remarks>
        /// Map key is an expression that members can be matched against. Value is a list
        /// of attributes that should be applied to each member that matches expression.
        /// </remarks>
        public IDictionary MemberAttributes
        {
            get { return _memberAttributes; }
            set { _memberAttributes = value; }
        }

        #endregion

        #region IInitializingObject Members

        ///
        /// Validate configuration.
        ///
        public void AfterPropertiesSet()
        {
            ValidateConfiguration();
        }

        #endregion

        #region IObjectNameAware Members

        ///
        /// Set the name of the object in the object factory
        /// that created this object.
        ///
        public string ObjectName
        {
            set { _objectName = value; }
        }

        #endregion

        #region Methods

        private void ValidateConfiguration()
        {
            if (TargetName == null)
            {
                throw new ArgumentException("The TargetName property is required.");
            }
        }

        ///
        /// Creates ServicedComponent wrapper around target class.
        ///
        /// <param name="module">Dynamic module builder to use</param>
        /// <param name="baseType"></param>
        /// <param name="targetType">Type of the exported object.</param>
        /// <param name="springManagedLifecycle">whether to generate lookups in ContextRegistry for each service method call or use a 'new'ed target instance</param>
        /// <remarks>
        /// if <paramref name="springManagedLifecycle"/> is <c>true</c>, each ServicedComponent method call will look similar to
        ///
        /// class MyServicedComponent {
        ///   void MethodX() {
        ///     ContextRegistry.GetContext().GetObject("TargetName").MethodX();
        ///   }
        /// }
        ///
        ///

        /// if <paramref name="springManagedLifecycle"/> is <c>false</c>, the instance will be simply created at component activation using 'new':
        ///
        /// class MyServicedComponent {
        ///   TargetType target = new TargetType();
        ///
        ///   void MethodX() {
        ///     target.MethodX();
        ///   }
        /// }
        ///
        ///

        /// The differences are of course that in the former case, the target lifecycle is entirely managed by Spring, thus avoiding
        /// issues with ServiceComponent activation/deactivation as well as removing the need for default constructors.
        /// </remarks>
        public Type CreateWrapperType(ModuleBuilder module, Type baseType, Type targetType, bool springManagedLifecycle)
        {
            ValidateConfiguration();

            // create wrapper using appropriate proxy builder
            IProxyTypeBuilder proxyBuilder;
            if (springManagedLifecycle)
            {
                proxyBuilder = new SpringManagedServicedComponentProxyTypeBuilder(module, baseType, this);
            }
            else
            {
                proxyBuilder = new SimpleServicedComponentProxyTypeBuilder(module, baseType);
            }

            proxyBuilder.Name = _objectName;
            proxyBuilder.TargetType = targetType;
            if (_interfaces != null && _interfaces.Length > 0)
            {
                proxyBuilder.Interfaces = TypeResolutionUtils.ResolveInterfaceArray(_interfaces);
            }
            proxyBuilder.TypeAttributes = TypeAttributes;
            proxyBuilder.MemberAttributes = MemberAttributes;

            Type componentType = proxyBuilder.BuildProxyType();

            // create and register client-side proxy factory for component

            return componentType;
        }

        #endregion

        #region ServicedComponentProxyTypeBuilder inner class definition

        private class ServicedComponentTargetProxyMethodBuilder : TargetProxyMethodBuilder
        {
            public ServicedComponentTargetProxyMethodBuilder(TypeBuilder typeBuilder, IProxyTypeGenerator proxyGenerator, bool explicitImplementation) : base(typeBuilder, proxyGenerator, explicitImplementation)
            {}

            ///
            /// Suppress output to avoid Spring.Core dependency
            ///
            protected override void CallAssertUnderstands(ILGenerator il, MethodInfo method, string targetName)
            {
//                base.CallAssertUnderstands(il, method, targetRef, targetName);
            }
        }

        private class ServicedComponentProxyTypeBuilder : CompositionProxyTypeBuilder
        {
            ///
            /// Implements default constructor for the proxy class.
            ///
            protected override void ImplementConstructors(TypeBuilder builder)
            {
                MethodAttributes attributes = MethodAttributes.Public |
                    MethodAttributes.HideBySig | MethodAttributes.SpecialName |
                    MethodAttributes.RTSpecialName;
                ConstructorBuilder cb = builder.DefineConstructor(attributes,
                  CallingConventions.Standard, Type.EmptyTypes);

                ILGenerator il = cb.GetILGenerator();
                il.Emit(OpCodes.Ldarg_0);
                il.Emit(OpCodes.Call, builder.BaseType.GetConstructor(Type.EmptyTypes));
                il.Emit(OpCodes.Ret);
            }

            protected override IProxyMethodBuilder CreateTargetProxyMethodBuilder(TypeBuilder typeBuilder)
            {
                return new ServicedComponentTargetProxyMethodBuilder(typeBuilder, this,
                                                                     this.ExplicitInterfaceImplementation);
            }
        }

        private sealed class SimpleServicedComponentProxyTypeBuilder : ServicedComponentProxyTypeBuilder
        {
            private readonly ModuleBuilder module;

            #region Constructor(s) / Destructor

            public SimpleServicedComponentProxyTypeBuilder(ModuleBuilder module, Type baseType)
            {
                this.module = module;
                BaseType = baseType;
            }

            #endregion

            #region Protected Methods

            protected override TypeBuilder CreateTypeBuilder(string name, Type baseType)
            {
                return module.DefineType(name, System.Reflection.TypeAttributes.Public, baseType);
            }

            #endregion
        }

        private sealed class SpringManagedServicedComponentProxyTypeBuilder : ServicedComponentProxyTypeBuilder
        {
            #region Fields

            private delegate object GetTargetDelegate(ServicedComponent component, string name);
            private static readonly MethodInfo ServicedComponentExporter_GetTarget =  new GetTargetDelegate(ServicedComponentHelper.GetObject).Method;

            #endregion

            #region Fields

            private readonly ServicedComponentExporter exporter;
            private readonly ModuleBuilder module;

            #endregion

            #region Constructor(s) / Destructor

            public SpringManagedServicedComponentProxyTypeBuilder(ModuleBuilder module, Type baseType, ServicedComponentExporter exporter)
            {
                this.module = module;
                this.exporter = exporter;
                BaseType = baseType;
            }

            #endregion

            #region Protected Methods

            protected override TypeBuilder CreateTypeBuilder(string name, Type baseType)
            {
                return module.DefineType(name, System.Reflection.TypeAttributes.Public, baseType);
            }

            protected override void DeclareTargetInstanceField(TypeBuilder builder)
            {
                //base.DeclareTargetInstanceField(builder);
            }

            #endregion

            #region IProxyTypeGenerator Members

            ///
            /// Generates the IL instructions that pushes
            /// the target instance on which calls should be delegated to.
            ///
            /// <param name="il">The IL generator to use.</param>
            public override void PushTarget( ILGenerator il )
            {
                FieldInfo getObjectRef = BaseType.GetField("getObject", BindingFlags.NonPublic|BindingFlags.Static);
                il.Emit(OpCodes.Ldsfld, getObjectRef);
                il.Emit(OpCodes.Ldarg_0);
                il.Emit( OpCodes.Ldstr, this.exporter.TargetName );
                il.Emit( OpCodes.Callvirt,  getObjectRef.FieldType.GetMethod("Invoke"));
            }
            #endregion

        }

        #endregion
    }
}


text:
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Serialization;
using Xunit;

namespace System.Reflection.Tests
{
    public static class ParameterInfoTests
    {
        [Fact]
        public static void RawDefaultValue()
        {
            MethodInfo m =  GetMethod(typeof(ParameterInfoTests), "Foo1");
            ParameterInfo p = m.GetParameters()[0];
            object raw = p.RawDefaultValue;
            Assert.Equal(typeof(int), raw.GetType());
            Assert.Equal<int>((int)raw, (int)BindingFlags.DeclaredOnly);
        }

        [Fact]
        public static void RawDefaultValueFromAttribute()
        {
            MethodInfo m = GetMethod(typeof(ParameterInfoTests), "Foo2");
            ParameterInfo p = m.GetParameters()[0];
            object cooked = p.DefaultValue;
            object raw = p.RawDefaultValue;

            Assert.Equal(typeof(int), raw.GetType());
            Assert.Equal<int>((int)raw, (int)BindingFlags.IgnoreCase);
        }

        [Fact]
        public static void RawDefaultValue_MetadataTrumpsAttribute()
        {
            MethodInfo m = GetMethod(typeof(ParameterInfoTests), "Foo3");
            ParameterInfo p = m.GetParameters()[0];
            object cooked = p.DefaultValue;
            object raw = p.RawDefaultValue;

            Assert.Equal(typeof(int), raw.GetType());
            Assert.Equal<int>((int)raw, (int)BindingFlags.FlattenHierarchy);
        }

        [Fact]
        public static void VerifyGetCustomAttributesData()
        {
            MethodInfo m = GetMethod(typeof(MyClass), "Method1");
            ParameterInfo p = m.GetParameters()[0];

            foreach (CustomAttributeData cad in p.GetCustomAttributesData())
            {
                if(cad.AttributeType == typeof(MyAttribute))
                {
                    ConstructorInfo c = cad.Constructor;
                    Assert.False(c.IsStatic);
                    Assert.False(c.IsPublic);
                    ParameterInfo[] paramInfo = c.GetParameters();
                    Assert.Equal(1, paramInfo.Length);
                    Assert.Equal(typeof(int), paramInfo[0].ParameterType);
                    return;
                }
            }

            Assert.True(false, "Expected to find MyAttribute");
        }

        [Theory]
        [MemberData(nameof(VerifyParameterInfoGetRealObjectWorks_TestData))]
        public static void VerifyParameterInfoGetRealObjectWorks(MemberInfo pretendMember, int pretendPosition, string expectedParameterName)
        {
            // Regression test for https://github.com/dotnet/corefx/issues/20574
            //
            // It's easy to forget that ParameterInfo's and runtime-implemented ParameterInfo's are different objects and just because the
            // latter doesn't support serialization doesn't mean other providers won't either.
            //
            // For historical reasons, ParameterInfo contains some serialization support that subtypes can optionally hang off. This
            // test ensures that support doesn't get vaporized.

            // Just pretend that we're BinaryFormatter and are deserializing a Parameter...
            IObjectReference podParameter = new PodPersonParameterInfo(pretendMember, pretendPosition);
            StreamingContext sc = new StreamingContext(StreamingContextStates.Clone);
            ParameterInfo result = (ParameterInfo)(podParameter.GetRealObject(sc));

            Assert.Equal(pretendPosition, result.Position);
            Assert.Equal(expectedParameterName, result.Name);
            Assert.Equal(pretendMember.Name, result.Member.Name);
        }

        public static IEnumerable<object[]> VerifyParameterInfoGetRealObjectWorks_TestData
        {
            get
            {
                Type t = typeof(PretendParent);
                ConstructorInfo ctor = t.GetConstructor(new Type[] { typeof(int), typeof(int) });
                MethodInfo method = t.GetMethod(nameof(PretendParent.PretendMethod));
                PropertyInfo property = t.GetProperty("Item");

                yield return new object[] { ctor, 0, "a" };
                yield return new object[] { ctor, 1, "b" };
                yield return new object[] { method, -1, null };
                yield return new object[] { method, 0, "x" };
                yield return new object[] { method, 1, "y" };
                yield return new object[] { property, 0, "index1" };
                yield return new object[] { property, 1, "index2" };
            }
        }

        private sealed class PretendParent
        {
            public PretendParent(int a, int b) { }
            public void PretendMethod(int x, int y) { }
            public int this[int index1, int index2] { get { throw null; } }
        }

        private sealed class PodPersonParameterInfo : MockParameterInfo
        {
            public PodPersonParameterInfo(MemberInfo pretendMember, int pretendPosition)
            {
                // Serialization can recreate a ParameterInfo from just these two pieces of data. Of course, this is just a test and no one
                // ever told this Member that it was adopting a counterfeit Parameter, but this is just a test...
                MemberImpl = pretendMember;
                PositionImpl = pretendPosition;
            }
        }

        private static void Foo1(BindingFlags bf = BindingFlags.DeclaredOnly) { }

        private static void Foo2([CustomBindingFlags(Value = BindingFlags.IgnoreCase)] BindingFlags bf) { }

        private static void Foo3([CustomBindingFlags(Value = BindingFlags.DeclaredOnly)] BindingFlags bf = BindingFlags.FlattenHierarchy ) { }

        //Gets MethodInfo object from a Type
        public static MethodInfo GetMethod(Type t, string method)
        {
            TypeInfo ti = t.GetTypeInfo();
            IEnumerator<MethodInfo> alldefinedMethods = ti.DeclaredMethods.GetEnumerator();
            MethodInfo mi = null;

            while (alldefinedMethods.MoveNext())
            {
                if (alldefinedMethods.Current.Name.Equals(method))
                {
                    //found method
                    mi = alldefinedMethods.Current;
                    break;
                }
            }
            return mi;
        }

        // Class For Reflection Metadata
        public class MyClass
        {
            public void Method1([My(2)]String str, int iValue, long lValue)
            {
            }
        }

        private class MyAttribute : Attribute
        {
            internal MyAttribute(int i) { }
        }
    }

    internal sealed class CustomBindingFlagsAttribute : UsableCustomConstantAttribute
    {
        public new object Value { get { return RealValue; } set { RealValue = value; } }
    }

    internal abstract class UsableCustomConstantAttribute : CustomConstantAttribute
    {
        public sealed override object Value => RealValue;
        protected object RealValue { get; set; }
    }
}


text:
body
{
	/* Font */
	font-family: Arial, Verdana, sans-serif;
	font-size: 12px;

	/* Text color */
	color: #222;

	/* Remove the background color to make it transparent */
	background-color: #fff;
}

ol,ul,dl
{
	/* IE7: reset rtl list margin. (#7334) */
	*margin-right:0px;
	/* preserved spaces for list items with text direction other than the list. (#6249,#8049)*/
    padding:0 40px;
}


text:
#include <aws/fsx/model/DescribeDataRepositoryAssociationsRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>

#include <utility>

using namespace Aws::FSx::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;

DescribeDataRepositoryAssociationsRequest::DescribeDataRepositoryAssociationsRequest() :
    m_associationIdsHasBeenSet(false),
    m_filtersHasBeenSet(false),
    m_maxResults(0),
    m_maxResultsHasBeenSet(false),
    m_nextTokenHasBeenSet(false)
{
}

Aws::String DescribeDataRepositoryAssociationsRequest::SerializePayload() const
{
  JsonValue payload;

  if(m_associationIdsHasBeenSet)
  {
   Array<JsonValue> associationIdsJsonList(m_associationIds.size());
   for(unsigned associationIdsIndex = 0; associationIdsIndex < associationIdsJsonList.GetLength(); ++associationIdsIndex)
   {
     associationIdsJsonList[associationIdsIndex].AsString(m_associationIds[associationIdsIndex]);
   }
   payload.WithArray("AssociationIds", std::move(associationIdsJsonList));

  }

  if(m_filtersHasBeenSet)
  {
   Array<JsonValue> filtersJsonList(m_filters.size());
   for(unsigned filtersIndex = 0; filtersIndex < filtersJsonList.GetLength(); ++filtersIndex)
   {
     filtersJsonList[filtersIndex].AsObject(m_filters[filtersIndex].Jsonize());
   }
   payload.WithArray("Filters", std::move(filtersJsonList));

  }

  if(m_maxResultsHasBeenSet)
  {
   payload.WithInteger("MaxResults", m_maxResults);

  }

  if(m_nextTokenHasBeenSet)
  {
   payload.WithString("NextToken", m_nextToken);

  }

  return payload.View().WriteReadable();
}

Aws::Http::HeaderValueCollection DescribeDataRepositoryAssociationsRequest::GetRequestSpecificHeaders() const
{
  Aws::Http::HeaderValueCollection headers;
  headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "AWSSimbaAPIService_v20180301.DescribeDataRepositoryAssociations"));
  return headers;

}


text:
/*
 * Copyright (C) 2014 Cloudius Systems, Ltd.
 *
 * This work is open source software, licensed under the terms of the
 * BSD license as described in the LICENSE file in the top-level directory.
 */

#include <functional>
#include <unordered_map>
#include <forward_list>
#include <utility>
#include <string>
#include <map>
#include <iostream>
#include <unordered_map>

#include "scollectd.hh"
#include "core/future-util.hh"
#include "core/reactor.hh"
#include "net/api.hh"
#include "scollectd_api.hh"

bool scollectd::type_instance_id::operator<(
        const scollectd::type_instance_id& id2) const {
    auto& id1 = *this;
    return std::tie(id1.plugin(), id1.plugin_instance(), id1.type(),
            id1.type_instance())
            < std::tie(id2.plugin(), id2.plugin_instance(), id2.type(),
                    id2.type_instance());
}
bool scollectd::type_instance_id::operator==(
        const scollectd::type_instance_id & id2) const {
    auto& id1 = *this;
    return std::tie(id1.plugin(), id1.plugin_instance(), id1.type(),
            id1.type_instance())
            == std::tie(id2.plugin(), id2.plugin_instance(), id2.type(),
                    id2.type_instance());
}

namespace scollectd {

using namespace std::chrono_literals;
using clock_type = std::chrono::high_resolution_clock;

static const ipv4_addr default_addr("239.192.74.66:25826");
static const clock_type::duration default_period(1s);
const plugin_instance_id per_cpu_plugin_instance("#cpu");

future<> send_metric(const type_instance_id &, const value_list &);

class impl {
    net::udp_channel _chan;
    timer<> _timer;

    sstring _host = "localhost";
    ipv4_addr _addr = default_addr;
    clock_type::duration _period = default_period;
    uint64_t _num_packets = 0;
    uint64_t _millis = 0;
    uint64_t _bytes = 0;
    double _avg = 0;

public:
    typedef std::map<type_instance_id, shared_ptr<value_list> > value_list_map;
    typedef value_list_map::value_type value_list_pair;

    void add_polled(const type_instance_id & id,
            const shared_ptr<value_list> & values) {
        _values[id] = values;
    }
    void remove_polled(const type_instance_id & id) {
        auto i = _values.find(id);
        if (i != _values.end()) {
            i->second = nullptr;
        }
    }
    // explicitly send a type_instance value list (outside polling)
    future<> send_metric(const type_instance_id & id,
            const value_list & values) {
        if (values.empty()) {
            return make_ready_future();
        }
        cpwriter out;
        out.put(_host, clock_type::duration(), id, values);
        return _chan.send(_addr, net::packet(out.data(), out.size()));
    }
    future<> send_notification(const type_instance_id & id,
            const sstring & msg) {
        cpwriter out;
        out.put(_host, id);
        out.put(part_type::Message, msg);
        return _chan.send(_addr, net::packet(out.data(), out.size()));
    }
    // initiates actual value polling -> send to target "loop"
    void start(const sstring & host, const ipv4_addr & addr,
            const clock_type::duration period) {
        _period = period;
        _addr = addr;
        _host = host;
        _chan = engine().net().make_udp_channel();
        _timer.set_callback(std::bind(&impl::run, this));

        // dogfood ourselves
        _regs = {
            // total_bytes      value:DERIVE:0:U
            add_polled_metric(
                    type_instance_id("scollectd", per_cpu_plugin_instance,
                            "total_bytes", "sent"),
                    make_typed(data_type::DERIVE, _bytes)),
            // total_requests      value:DERIVE:0:U
            add_polled_metric(
                    type_instance_id("scollectd", per_cpu_plugin_instance,
                            "total_requests"),
                    make_typed(data_type::DERIVE, _num_packets)
            ),
            // latency          value:GAUGE:0:U
            add_polled_metric(
                    type_instance_id("scollectd", per_cpu_plugin_instance,
                            "latency"), _avg),
            // total_time_in_ms    value:DERIVE:0:U
            add_polled_metric(
                    type_instance_id("scollectd", per_cpu_plugin_instance,
                            "total_time_in_ms"),
                    make_typed(data_type::DERIVE, _millis)
            ),
            // total_values     value:DERIVE:0:U
            add_polled_metric(
                    type_instance_id("scollectd", per_cpu_plugin_instance,
                            "total_values"),
                    make_typed(data_type::DERIVE, std::bind(&value_list_map::size, &_values))
            ),
            // records          value:GAUGE:0:U
            add_polled_metric(
                    type_instance_id("scollectd", per_cpu_plugin_instance,
                            "records"),
                    make_typed(data_type::GAUGE, std::bind(&value_list_map::size, &_values))
            ),
        };

        send_notification(
                type_instance_id("scollectd", per_cpu_plugin_instance,
                        "network"), "daemon started");
        arm();
    }
    void stop() {
        _timer.cancel();
        _regs.clear();
    }

private:
    static const size_t payload_size = 1024;

    void arm() {
        if (_period != clock_type::duration()) {
            _timer.arm(_period);
        }
    }

    enum class part_type
        : uint16_t {
            Host = 0x0000, // The name of the host to associate with subsequent data values
        Time = 0x0001, // Time 	Numeric The timestamp to associate with subsequent data values, unix time format (seconds since epoch)
        TimeHr = 0x0008, // Time (high resolution) 	Numeric The timestamp to associate with subsequent data values. Time is defined in 2–30 seconds since epoch. New in Version 5.0.
        Plugin = 0x0002, // Plugin String The plugin name to associate with subsequent data values, e.g. "cpu"
        PluginInst = 0x0003, // Plugin instance String 	The plugin instance name to associate with subsequent data values, e.g. "1"
        Type = 0x0004, // Type String The type name to associate with subsequent data values, e.g. "cpu"
        TypeInst = 0x0005, // Type instance 	String 	The type instance name to associate with subsequent data values, e.g. "idle"
        Values = 0x0006, //	Values 	other 	Data values, see above
        Interval = 0x0007, // Interval Numeric Interval used to set the "step" when creating new RRDs unless rrdtool plugin forces StepSize. Also used to detect values that have timed out.
        IntervalHr = 0x0009, //	Interval (high resolution) 	Numeric 	The interval in which subsequent data values are collected. The interval is given in 2–30 seconds. New in Version 5.0.
        Message = 0x0100, // Message (notifications) String
        Severity = 0x0101, // Severity 	Numeric
        Signature = 0x0200, // Signature (HMAC-SHA-256) 	other (todo)
        Encryption = 0x0210, //	Encryption (AES-256/OFB
    };

    // "Time is defined in 2^–30 seconds since epoch. New in Version 5.0."
    typedef std::chrono::duration<uint64_t, std::ratio<1, 0x40000000>> collectd_hres_duration;

    // yet another writer type, this one to construct collectd network
    // protocol data.
    struct cpwriter {
        typedef std::array<char, payload_size> buffer_type;
        typedef buffer_type::iterator mark_type;
        typedef buffer_type::const_iterator const_mark_type;

        buffer_type _buf;
        mark_type _pos;
        bool _overflow = false;

        std::unordered_map<uint16_t, sstring> _cache;

        cpwriter()
                : _pos(_buf.begin()) {
        }
        mark_type mark() const {
            return _pos;
        }
        bool overflow() const {
            return _overflow;
        }
        void reset(mark_type m) {
            _pos = m;
            _overflow = false;
        }
        size_t size() const {
            return std::distance(_buf.begin(), const_mark_type(_pos));
        }
        bool empty() const {
            return _pos == _buf.begin();
        }
        void clear() {
            reset(_buf.begin());
            _cache.clear();
            _overflow = false;
        }
        const char * data() const {
            return &_buf.at(0);
        }
        char * data() {
            return &_buf.at(0);
        }
        cpwriter& check(size_t sz) {
            size_t av = std::distance(_pos, _buf.end());
            _overflow |= av < sz;
            return *this;
        }
        explicit operator bool() const {
            return !_overflow;
        }
        bool operator!() const {
            return !operator bool();
        }
        template<typename _Iter>
        cpwriter & write(_Iter s, _Iter e) {
            if (check(std::distance(s, e))) {
                _pos = std::copy(s, e, _pos);
            }
            return *this;
        }
        template<typename T>
        typename std::enable_if<std::is_integral<T>::value, cpwriter &>::type write(
                const T & t) {
            T tmp = net::hton(t);
            auto * p = reinterpret_cast<const uint8_t *>(&tmp);
            auto * e = p + sizeof(T);
            write(p, e);
            return *this;
        }
        cpwriter & write(const sstring & s) {
            write(s.begin(), s.end() + 1); // include \0
            return *this;
        }
        cpwriter & put(part_type type, const sstring & s) {
            write(uint16_t(type));
            write(uint16_t(4 + s.size() + 1)); // include \0
            write(s); // include \0
            return *this;
        }
        cpwriter & put_cached(part_type type, const sstring & s) {
            auto & cached = _cache[uint16_t(type)];
            if (cached != s) {
                put(type, s);
                cached = s;
            }
            return *this;
        }
        template<typename T>
        typename std::enable_if<std::is_integral<T>::value, cpwriter &>::type put(
                part_type type, T t) {
            write(uint16_t(type));
            write(uint16_t(4 + sizeof(t)));
            write(t);
            return *this;
        }
        cpwriter & put(part_type type, const value_list & v) {
            auto s = v.size();
            auto sz = 6 + s + s * sizeof(uint64_t);
            if (check(sz)) {
                write(uint16_t(type));
                write(uint16_t(sz));
                write(uint16_t(s));
                v.types(reinterpret_cast<data_type *>(&(*_pos)));
                _pos += s;
                v.values(reinterpret_cast<net::packed<uint64_t> *>(&(*_pos)));
                _pos += s * sizeof(uint64_t);
            }
            return *this;
        }
        cpwriter & put(const sstring & host, const type_instance_id & id) {
            const auto ts = std::chrono::system_clock::now().time_since_epoch();
            const auto lrts =
                    std::chrono::duration_cast<std::chrono::seconds>(ts).count();

            put_cached(part_type::Host, host);
            put(part_type::Time, uint64_t(lrts));
            // Seems hi-res timestamp does not work very well with
            // at the very least my default collectd in fedora (or I did it wrong?)
            // Use lo-res ts for now, it is probably quite sufficient.
            put_cached(part_type::Plugin, id.plugin());
            // Optional
            put_cached(part_type::PluginInst,
                    id.plugin_instance() == per_cpu_plugin_instance ?
                            to_sstring(engine().cpu_id()) : id.plugin_instance());
            put_cached(part_type::Type, id.type());
            // Optional
            put_cached(part_type::TypeInst, id.type_instance());
            return *this;
        }
        cpwriter & put(const sstring & host,
                const clock_type::duration & period,
                const type_instance_id & id, const value_list & v) {
            const auto ps = std::chrono::duration_cast<collectd_hres_duration>(
                    period).count();
            put(host, id);
            put(part_type::Values, v);
            if (ps != 0) {
                put(part_type::IntervalHr, ps);
            }
            return *this;
        }
    };

    void run() {
        typedef value_list_map::iterator iterator;
        typedef std::tuple<iterator, cpwriter> context;

        auto ctxt = make_lw_shared<context>();

        // note we're doing this unsynced since we assume
        // all registrations to this instance will be done on the
        // same cpu, and without interuptions (no wait-states)
        std::get<iterator>(*ctxt) = _values.begin();

        auto stop_when = [this, ctxt]() {
            auto done = std::get<iterator>(*ctxt) == _values.end();
            return done;
        };
        // append as many values as we can fit into a packet (1024 bytes)
        auto send_packet = [this, ctxt]() {
            auto start = std::chrono::high_resolution_clock::now();
            auto & i = std::get<iterator>(*ctxt);
            auto & out = std::get<cpwriter>(*ctxt);

            out.clear();

            while (i != _values.end()) {
                // nullptr value list means removed value. so remove.
                if (!i->second) {
                    i = _values.erase(i);
                    continue;
                }
                auto m = out.mark();
                out.put(_host, _period, i->first, *i->second);
                if (!out) {
                    out.reset(m);
                    break;
                }
                ++i;
            }
            if (out.empty()) {
                return make_ready_future();
            }
            return _chan.send(_addr, net::packet(out.data(), out.size())).then([start, ctxt, this]() {
                        auto & out = std::get<cpwriter>(*ctxt);
                        auto now = std::chrono::high_resolution_clock::now();
                        // dogfood stats
                        ++_num_packets;
                        _millis += std::chrono::duration_cast<std::chrono::milliseconds>(now - start).count();
                        _bytes += out.size();
                        _avg = double(_millis) / _num_packets;
                    }).then_wrapped([] (auto&& f) {
                        try {
                            f.get();
                        } catch (std::exception & ex) {
                            std::cout << "send failed: " << ex.what() << std::endl;
                        } catch (...) {
                            std::cout << "send failed: - unknown exception" << std::endl;
                        }
                    });
        };
        do_until(stop_when, send_packet).then([this]() {
            arm();
        });
    }
public:
    shared_ptr<value_list> get_values(const type_instance_id & id) {
        return _values[id];
    }

    std::vector<type_instance_id> get_instance_ids() {
        std::vector<type_instance_id> res;
        for (auto i: _values) {
            // Need to check for empty value_list, since unreg is two-stage.
            // Not an issue for most uses, but unit testing etc that would like
            // fully deterministic operation here would like us to only return
            // actually active ids
            if (i.second) {
                res.emplace_back(i.first);
            }
        }
        return res;
    }

private:
    value_list_map _values;
    registrations _regs;
};

impl & get_impl() {
    static thread_local impl per_cpu_instance;
    return per_cpu_instance;
}

void add_polled(const type_instance_id & id,
        const shared_ptr<value_list> & values) {
    get_impl().add_polled(id, values);
}

void remove_polled_metric(const type_instance_id & id) {
    get_impl().remove_polled(id);
}

future<> send_notification(const type_instance_id & id,
        const sstring & msg) {
    return get_impl().send_notification(id, msg);
}

future<> send_metric(const type_instance_id & id,
        const value_list & values) {
    return get_impl().send_metric(id, values);
}

void configure(const boost::program_options::variables_map & opts) {
    bool enable = opts["collectd"].as<bool>();
    if (!enable) {
        return;
    }
    auto addr = ipv4_addr(opts["collectd-address"].as<std::string>());
    auto period = std::chrono::duration_cast<clock_type::duration>(
            std::chrono::milliseconds(
                    opts["collectd-poll-period"].as<unsigned>()));

    auto host = opts["collectd-hostname"].as<std::string>();

    // Now create send loops on each cpu
    for (unsigned c = 0; c < smp::count; c++) {
        smp::submit_to(c, [=] () {
            get_impl().start(host, addr, period);
        });
    }
}

boost::program_options::options_description get_options_description() {
    namespace bpo = boost::program_options;
    bpo::options_description opts("COLLECTD options");
    char hostname[PATH_MAX];
    gethostname(hostname, sizeof(hostname));
    hostname[PATH_MAX-1] = '\0';
    opts.add_options()("collectd", bpo::value<bool>()->default_value(true),
            "enable collectd daemon")("collectd-address",
            bpo::value<std::string>()->default_value("239.192.74.66:25826"),
            "address to send/broadcast metrics to")("collectd-poll-period",
            bpo::value<unsigned>()->default_value(1000),
            "poll period - frequency of sending counter metrics (default: 1000ms, 0 disables)")(
            "collectd-hostname",
            bpo::value<std::string>()->default_value(hostname),
            "collectd host name");
    return opts;
}

std::vector<collectd_value> get_collectd_value(
        const scollectd::type_instance_id& id) {
    std::vector<collectd_value> res_values;
    auto raw_types = get_impl().get_values(id);
    if (raw_types == nullptr) {
        return res_values;
    }
    std::vector<data_type> types(raw_types->size());
    raw_types->types(&(*types.begin()));
    std::vector<net::packed<uint64_t>> value(raw_types->size());
    raw_types->values(&(*value.begin()));

    auto i = value.begin();
    for (auto t : types) {
        collectd_value c(t, be64toh(*i));
        res_values.push_back(c);
    }
    return res_values;
}

std::vector<data_type> get_collectd_types(
        const scollectd::type_instance_id& id) {
    auto res = get_impl().get_values(id);
    if (res == nullptr) {
        return std::vector<data_type>();
    }
    std::vector<data_type> vals(res->size());
    res->types(&(*vals.begin()));
    return vals;
}

std::vector<scollectd::type_instance_id> get_collectd_ids() {
    return get_impl().get_instance_ids();
}
}


text: import 'babel-polyfill' // This is for IE11 Babel compatibility


text:
package com.facebook.infer.models;

public class InferBuiltins {

    public static void __set_file_attribute(Object o) {
    }

    public static void __set_mem_attribute(Object o) {
    }

    public static void __set_lock_attribute(Object o) {
    }

    public static void _exit() {
    }

    public static void assume(boolean condition) {
      while (!condition) {}
    }

    public static String __split_get_nth(String s, String sep, int n) {
        return null;
    }

}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using Cachacus.Attributes;
using Fasterflect;

namespace Cachacus.Repositories.Parts.Stores.Helpers {
	public class CacheManager {
		protected static readonly Dictionary<Type, MemberGetter> primaryKeys =
			new Dictionary<Type, MemberGetter>();

		protected static readonly Dictionary<Type, Dictionary<string, MemberGetter>> secondaryKeys =
			new Dictionary<Type, Dictionary<string, MemberGetter>>();

		public static object PrimaryKey<T>(T o) {
			BuildIndexes(typeof(T));
			return primaryKeys[typeof(T)](o);
		}

		public static IEnumerable<string> IndexNames<T>() {
			BuildIndexes(typeof(T));
			return secondaryKeys[typeof(T)].Keys;
		}

		public static object KeyForIndex<T>(string indexName, T o) {
			BuildIndexes(typeof(T));
			return secondaryKeys[typeof(T)][indexName](o);
		}

		private static void BuildIndexes(Type type) {
			if (primaryKeys.ContainsKey(type)) {
				return;
			}
			lock (primaryKeys) { // Double checked lock is intentional
				if (primaryKeys.ContainsKey(type)) {
					return;
				}
				var primaryKeyProperty = type.GetProperties().SingleOrDefault(prop => Attribute.IsDefined((MemberInfo) prop, typeof(CacheKey)));
				primaryKeys[type] = type.DelegateForGetPropertyValue(primaryKeyProperty.Name);

				var secondaryKeyProperties = type.GetProperties().Where(prop => Attribute.IsDefined(prop, typeof(CacheIndex)));
				var dictionary = secondaryKeyProperties.ToDictionary(kp => kp.Name, kp => type.DelegateForGetPropertyValue(kp.Name));
				secondaryKeys[type] = dictionary;
			}
		}

		public static bool IsSame<T>(T o1, T o2) {
			return PrimaryKey<T>(o1).Equals(PrimaryKey<T>(o2));
		}

		public static IEnumerable<object> PrimaryKeys<T>(IEnumerable<T> data) {
			return data.Select(PrimaryKey);
		}
	}
}


text:
@implementation AFHTTPSessionManager (RACSupport)

- (RACSignal *)rac_GET:(NSString *)path parameters:(NSDictionary *)parameters {
	return [[self rac_requestPath:path parameters:parameters method:@"GET"]
			setNameWithFormat:@"%@ -rac_GET: %@, parameters: %@", self.class, path, parameters];
}

- (RACSignal *)rac_HEAD:(NSString *)path parameters:(NSDictionary *)parameters {
	return [[self rac_requestPath:path parameters:parameters method:@"HEAD"]
			setNameWithFormat:@"%@ -rac_HEAD: %@, parameters: %@", self.class, path, parameters];
}

- (RACSignal *)rac_POST:(NSString *)path parameters:(NSDictionary *)parameters {
	return [[self rac_requestPath:path parameters:parameters method:@"POST"]
			setNameWithFormat:@"%@ -rac_POST: %@, parameters: %@", self.class, path, parameters];
}

- (RACSignal *)rac_POST:(NSString *)path parameters:(NSDictionary *)parameters constructingBodyWithBlock:(void (^)(id <AFMultipartFormData> formData))block {
	return [[RACSignal createSignal:^(id<RACSubscriber> subscriber) {
		NSMutableURLRequest *request = [self.requestSerializer multipartFormRequestWithMethod:@"POST" URLString:[[NSURL URLWithString:path relativeToURL:self.baseURL] absoluteString] parameters:parameters constructingBodyWithBlock:block error:nil];

		NSURLSessionDataTask *task = [self dataTaskWithRequest:request completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) {
			if (error) {
				[subscriber sendError:error];
			} else {
				[subscriber sendNext:responseObject];
				[subscriber sendCompleted];
			}
		}];
		[task resume];

		return [RACDisposable disposableWithBlock:^{
			[task cancel];
		}];
	}] setNameWithFormat:@"%@ -rac_POST: %@, parameters: %@, constructingBodyWithBlock:", self.class, path, parameters];
;
}

- (RACSignal *)rac_PUT:(NSString *)path parameters:(NSDictionary *)parameters {
	return [[self rac_requestPath:path parameters:parameters method:@"PUT"]
			setNameWithFormat:@"%@ -rac_PUT: %@, parameters: %@", self.class, path, parameters];
}

- (RACSignal *)rac_PATCH:(NSString *)path parameters:(NSDictionary *)parameters {
	return [[self rac_requestPath:path parameters:parameters method:@"PATCH"]
			setNameWithFormat:@"%@ -rac_PATCH: %@, parameters: %@", self.class, path, parameters];
}

- (RACSignal *)rac_DELETE:(NSString *)path parameters:(NSDictionary *)parameters {
	return [[self rac_requestPath:path parameters:parameters method:@"DELETE"]
			setNameWithFormat:@"%@ -rac_DELETE: %@, parameters: %@", self.class, path, parameters];
}

- (RACSignal *)rac_requestPath:(NSString *)path parameters:(NSDictionary *)parameters method:(NSString *)method {
	return [RACSignal createSignal:^(id<RACSubscriber> subscriber) {
		NSURLRequest *request = [self.requestSerializer requestWithMethod:method URLString:[[NSURL URLWithString:path relativeToURL:self.baseURL] absoluteString] parameters:parameters error:nil];

		NSURLSessionDataTask *task = [self dataTaskWithRequest:request completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) {
			if (error) {
				[subscriber sendError:error];
			} else {
				[subscriber sendNext:responseObject];
				[subscriber sendCompleted];
			}
		}];
		[task resume];

		return [RACDisposable disposableWithBlock:^{
			[task cancel];
		}];
	}];
}

@end

#endif


text:
ActiveSupport::Deprecation.warn "ActionView::Helpers::AssetPaths is deprecated. Please use ActionView::AssetPaths instead."

module ActionView
  module Helpers
    AssetPaths = ::ActionView::AssetPaths
  end
end


text:
FROM php:7-alpine
LABEL maintainer="Johannes Schickling <schickling.j@gmail.com>"

ADD install.sh install.sh
RUN chmod +x install.sh
RUN ./install.sh && rm install.sh

COPY config.php /source/config.php

EXPOSE 2080
CMD sh -c 'BEANSTALK_SERVERS=$BEANSTALKD_PORT_11300_TCP_ADDR:11300 php -S 0.0.0.0:2080 -t /source/public'


text:
#import "SCViewController.h"
#import "SCNavControllerDelegate.h"

@interface SCViewController () {
    id<UINavigationControllerDelegate> _navDelegate;
}

@end

@implementation SCViewController

-(id)initWithCoder:(NSCoder *)aDecoder
{
    self = [super initWithCoder:aDecoder];
    if(self) {
        _navDelegate = [SCNavControllerDelegate new];
        self.delegate = _navDelegate;
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
}

@end


text:
package org.sana.android.db;

import java.io.FileNotFoundException;

import android.database.sqlite.SQLiteDatabase;
import android.net.Uri;
import android.os.ParcelFileDescriptor;

/**
 * Provides methods to open and delete files.
 *
 * @author Sana Development
 *
 */
public interface FileHelper {

	/**
	 * Opens the file for a specified row.
	 *
	 * @param database The row to open the
	 * @param id TODO
	 * @param mode The mode to open the file in.
	 * @return
	 * @throws FileNotFoundException
	 */
	ParcelFileDescriptor openFile(SQLiteDatabase database, long id, String mode) throws FileNotFoundException;

	/**
	 * Deletes a file stored as a path in one of the table columns.
	 *
	 * @param uri The row containing the file to delete.
	 * @return
	 */
	int deleteFile(Uri uri);
}


text:
"""
To run only the search tests:
    python -m unittest tests.test_diff_ref

Or to run all the tests:
    python -m unittest discover

Or to run all the tests with coverage:
    coverage run --source deepdiff setup.py test

Or using Nose:
    nosetests --with-coverage --cover-package=deepdiff

To run a specific test, run this from the root of repo:
    python -m unittest tests.test_model.DiffLevelTestCase.test_path_when_both_children_empty
"""

from unittest import TestCase
import logging
from tests import CustomClass, CustomClassMisleadingRepr
from deepdiff.model import (DiffLevel, ChildRelationship, DictRelationship,
                            SubscriptableIterableRelationship,
                            AttributeRelationship)
from deepdiff.helper import Verbose

logging.disable(logging.CRITICAL)

class WorkingChildRelationship(ChildRelationship):
    def get_param_from_obj(self, obj):
        return obj

class DictRelationshipTestCase(TestCase):
    def setUp(self):
        self.customkey = CustomClass(a=13, b=37)
        self.customkey_misleading = CustomClassMisleadingRepr(a=11, b=20)
        self.d = {
            42: 'answer',
            'vegan': 'for life',
            self.customkey: 1337,
            self.customkey_misleading: 'banana'
        }

    def test_numkey(self):
        rel = DictRelationship(parent=self.d, child=self.d[42], param=42)
        self.assertEqual(rel.get_param_repr(), "[42]")

    def test_strkey(self):
        rel = ChildRelationship.create(
            klass=DictRelationship,
            parent=self.d,
            child=self.d['vegan'],
            param='vegan')
        result = rel.get_param_repr()
        self.assertEqual(result, "['vegan']")

    def test_objkey(self):
        rel = DictRelationship(
            parent=self.d, child=self.d[self.customkey], param=self.customkey)
        self.assertIsNone(rel.get_param_repr())

    def test_objkey_misleading_repr(self):
        rel = DictRelationship(
            parent=self.d,
            child=self.d[self.customkey_misleading],
            param=self.customkey_misleading)
        self.assertIsNone(rel.get_param_repr())

    def test_get_param_from_dict(self):
        param = 42
        rel = DictRelationship(parent=self.d, child=self.d[param], param=param)
        obj = {10: 10, param: 123}
        self.assertEqual(rel.get_param_from_obj(obj), 123)

class ListRelationshipTestCase(TestCase):
    def setUp(self):
        self.custom = CustomClass(13, 37)
        self.l = [1337, 'vegan', self.custom]

    def test_min(self):
        rel = SubscriptableIterableRelationship(self.l, self.l[0], 0)
        result = rel.get_param_repr()
        self.assertEqual(result, "[0]")

    def test_max(self):
        rel = ChildRelationship.create(SubscriptableIterableRelationship,
                                       self.l, self.custom, 2)
        self.assertEqual(rel.get_param_repr(), "[2]")

    def test_get_param_from_obj(self):
        param = 0
        rel = SubscriptableIterableRelationship(parent=self.l, child=self.l[param], param=param)
        obj = ['a', 'b', 'c']
        self.assertEqual(rel.get_param_from_obj(obj), 'a')

class AttributeRelationshipTestCase(TestCase):
    def setUp(self):
        self.custom = CustomClass(13, 37)

    def test_a(self):
        rel = AttributeRelationship(self.custom, 13, "a")
        result = rel.get_param_repr()
        self.assertEqual(result, ".a")

    def test_get_param_from_obj(self):
        rel = AttributeRelationship(self.custom, 13, "a")
        self.assertEqual(rel.get_param_from_obj(self.custom), 13)

class DiffLevelTestCase(TestCase):
    def setUp(self):
        # Test data
        self.custom1 = CustomClass(a='very long text here', b=37)
        self.custom2 = CustomClass(a=313, b=37)
        self.t1 = {42: 'answer', 'vegan': 'for life', 1337: self.custom1}
        self.t2 = {
            42: 'answer',
            'vegan': 'for the animals',
            1337: self.custom2
        }

        # Manually build diff, bottom up
        self.lowest = DiffLevel(
            self.custom1.a, self.custom2.a, report_type='values_changed')

        # Test manual child relationship
        rel_int_low_t1 = AttributeRelationship(
            parent=self.custom1, child=self.custom1.a, param="a")
        rel_int_low_t2 = AttributeRelationship(
            parent=self.custom2, child=self.custom2.a, param="a")
        self.intermediate = DiffLevel(
            self.custom1,
            self.custom2,
            down=self.lowest,
            child_rel1=rel_int_low_t1,
            child_rel2=rel_int_low_t2)
        self.lowest.up = self.intermediate

        # Test automatic child relationship
        t1_child_rel = ChildRelationship.create(
            klass=DictRelationship,
            parent=self.t1,
            child=self.intermediate.t1,
            param=1337)
        t2_child_rel = ChildRelationship.create(
            klass=DictRelationship,
            parent=self.t2,
            child=self.intermediate.t2,
            param=1337)
        self.highest = DiffLevel(
            self.t1,
            self.t2,
            down=self.intermediate,
            child_rel1=t1_child_rel,
            child_rel2=t2_child_rel)
        self.intermediate.up = self.highest

    def test_all_up(self):
        self.assertEqual(self.lowest.all_up, self.highest)

    def test_all_down(self):
        self.assertEqual(self.highest.all_down, self.lowest)

    def test_automatic_child_rel(self):
        self.assertIsInstance(self.highest.t1_child_rel, DictRelationship)
        self.assertIsInstance(self.highest.t2_child_rel, DictRelationship)

        self.assertEqual(self.highest.t1_child_rel.parent, self.highest.t1)
        self.assertEqual(self.highest.t2_child_rel.parent, self.highest.t2)
        self.assertEqual(self.highest.t1_child_rel.parent, self.highest.t1)
        self.assertEqual(self.highest.t2_child_rel.parent, self.highest.t2)

        # Provides textual relationship from t1 to t1[1337]
        self.assertEqual('[1337]', self.highest.t2_child_rel.get_param_repr())

    def test_path(self):
        # Provides textual path all the way through
        self.assertEqual(self.lowest.path("self.t1"), "self.t1[1337].a")

    def test_change_of_path_root(self):
        self.assertEqual(self.lowest.path("root"), "root[1337].a")
        self.assertEqual(self.lowest.path(""), "[1337].a")

    def test_path_when_both_children_empty(self):
        """
        This is a situation that should never happen.
        But we are creating it artificially.
        """
        t1 = {1: 1}
        t2 = {1: 2}
        child_t1 = {}
        child_t2 = {}
        up = DiffLevel(t1, t2)
        down = up.down = DiffLevel(child_t1, child_t2)
        path = down.path()
        self.assertEqual(path, 'root')

    def test_repr_short(self):
        level = Verbose.level
        Verbose.level = 0
        item_repr = repr(self.lowest)
        Verbose.level = level
        self.assertEqual(item_repr, '<root[1337].a>')

    def test_repr_long(self):
        level = Verbose.level
        Verbose.level = 1
        item_repr = repr(self.lowest)
        Verbose.level = level
        self.assertEqual(item_repr,
                         "<root[1337].a t1:'very long t...', t2:313>")

    def test_repetition_attribute_and_repr(self):
        t1 = [1, 1]
        t2 = [1]
        some_repetition = 'some repetition'
        node = DiffLevel(t1, t2)
        node.additional['repetition'] = some_repetition
        self.assertEqual(node.repetition, some_repetition)
        self.assertEqual(repr(node), "<root {'repetition': 'some repetition'}>")

class ChildRelationshipTestCase(TestCase):
    def test_create_invalid_klass(self):
        with self.assertRaises(TypeError):
            ChildRelationship.create(DiffLevel, "hello", 42)

    def test_rel_repr_short(self):
        rel = WorkingChildRelationship(parent="that parent", child="this child", param="some param")
        rel_repr = repr(rel)
        expected = "<WorkingChildRelationship parent:'that parent', child:'this child', param:'some param'>"
        self.assertEqual(rel_repr, expected)

    def test_rel_repr_long(self):
        rel = WorkingChildRelationship(
            parent="that parent who has a long path",
            child="this child",
            param="some param")
        rel_repr = repr(rel)
        expected = "<WorkingChildRelationship parent:'that parent...', child:'this child', param:'some param'>"
        self.assertEqual(rel_repr, expected)