text:
__author__ = 'jtodea, phil'

from obtain_access_token import FakeUser
from osiam import connector
import argparse
import group
import logging
import measuring
import prefill_osiam
import user
import utils
from multiprocessing import Process

logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)

parser = argparse.ArgumentParser(description='This script interpret the test' +
                                             'case definition and runs all' +
                                             'defined test cases.')
parser.add_argument('--server', help='The server host name',
                    default='localhost')
parser.add_argument('--client', help='The client host name.',
                    default='localhost')
parser.add_argument('--client_id', help='The client ID',
                    default='example-client')
parser.add_argument('--client_secret', help='The client secret',
                    default='secret')
parser.add_argument('--iterations', help='The number of repeating runs.',
                    default=5, type=int)
parser.add_argument('-p', '--parallel', help='The number of parallel runs.',
                    default=10, type=int)
parser.add_argument('-t', '--timeout', help='If this timeout is reached a ' +
                    'request is considered as unsuccessful.', default=500,
                    type=int)
parser.add_argument('-l', '--log-directory', help='The directory to ' +
                    'storage the log output.', default='/tmp')
parser.add_argument("tests", nargs='+', help='Test files to execute.')

scim = None

def create_method(test):
    """ creates a method based on the test configuration.
    Either User or Group."""
    res = test['resource']
    method_name = test['method']
    module = __import__(res)
    return getattr(module, method_name)

def execute_case(testcases, serial, parallel):
    """ Executes the defined testscases of a test sequence."""
    complete_duration = []
    print "executing {}".format(testcases)
    for test in testcases['tests']:
        method = create_method(test)
        result = method(serial, parallel)
        result['method'] = test['resource'] + "." + method.__name__
        complete_duration.append(result)
    return complete_duration

def write_log_header(testcases):
    logger.handlers = []
    logger.addHandler(measuring.create_filehandler(
        args.log_directory,
        testcases['name']))
    logger.info('# Results of {}'.format(testcases["name"]))
    logger.info('# {}'.format(testcases.get('description')))

def calculate_auto_generated_resource_amount():
    """Calculates the amount of auto generated resources. Auto generated
    resources are defined in the configuration part by per_call"""
    def calc(m):
        result = 1
        for s in xrange(m + 1):
            result = result + s
        return result
    serial = calc(args.iterations)
    parallel = calc(args.parallel)
    return serial * parallel

def insert_data(config):
    """ Loads the configuration block and insert the needed user, groups
    into OSIAM"""
    def get_amount(key):
        result = 0
        obj = create.get(key)
        if obj == 'per_call':
            result = calculate_auto_generated_resource_amount()
        elif obj is not None:
            result = obj
        return result

    create = config["create"]
    user_amount = get_amount('user')
    group_amount = get_amount('group')
    logger.info('# This test is based on: {} users {} groups'.
                format(user_amount, group_amount))
    prefill_osiam.PrefillOsiam(scim).prefill(user_amount, group_amount, 0)

def determine_configuration(testcases):
    """ Loads the configuration block, inserts_data and get needed ids """
    config = testcases.get("configuration")
    if config is not None:
        insert_data(config)
        amount = calculate_auto_generated_resource_amount()
        user.get_all_user_ids(amount * len(testcases))
        group.get_all_group_ids(amount * len(testcases))

def execute_sequence(max_serial, max_parallel, test):
    """ Identify the testcases of a sequence, executes them and prints the
    log files. """
    testcases = {}
    execfile(test, testcases)
    write_log_header(testcases)
    determine_configuration(testcases)
    # durchsatz fehlt ..
    logger.info('serial*parallel;min;max;avg;timeout;error')
    print "executing sequence {}".format(test)
    for i in range(max_serial):
        for j in range(max_parallel):
            serial = i + 1
            parallel = j + 1
            result = execute_case(testcases, serial, parallel)
            if print_result(result, serial, parallel) is False:
                break
    delete_all(scim.search_with_get_on_groups, scim.delete_group)
    delete_all(scim.search_with_get_on_users, scim.delete_user)

def print_result(result, serial, parallel):
    for r in result:
        logger.info("{}x{}-{};{};{};{};{}%;{}%".format(serial, parallel,
                                                       r["method"],
                    r["min"],
                    r["max"],
                    r["avg"],
                    r["timeout"],
                    r["error"]))
        if r["timeout"] >= 50:
            logger.info("# {}% of requests reached the timeout of {}ms.".
                        format(r["timeout"], args.timeout))
            return False
    return True

def init_scim(server, client_id, client_secret, username='marissa', password='koala',
              timeout=500):
    """ Getting access token and initializes profiling """
    fakeUser = FakeUser(username, password, client_id,
                        'http://' + server + ':8080/osiam-auth-server',
                        client_secret)

    access_token = fakeUser.get_access_token()
    global scim, max_response_time
    scim = connector.SCIM('http://{}:8080/osiam-resource-server'.format(server),
                          access_token)
    measuring.max_response_time = timeout
    user.scim = scim
    group.scim = scim

def chunks(l, n):
        """ Yield successive n-sized chunks from l.
            """
        for i in xrange(0, len(l), n):
            yield l[i:i + n]

def delete_all(search_function, delete_function):
    all_ids = utils.get_all_ids(search_function)
    to_delete = list(chunks(all_ids, 10))
    for l in to_delete:
        procs = []
        for id in l:
            p = Process(target=delete_function, args=(id,))
            procs.append(p)
            p.start()
            print "{} deleted.".format(id)
        for p in procs:
            p.join()

if __name__ == '__main__':

    args = parser.parse_args()
    init_scim(args.server, args.client_id, args.client_secret,
              timeout=args.timeout)
    for t in args.tests:
        execute_sequence(args.iterations, args.parallel, t)


text:
namespace Srl { namespace Lib { namespace Aux {

    #define srl_unlikely(expr) __builtin_expect((expr), 0)
    #define srl_likely(expr)   __builtin_expect((expr), 1)

    #define srl_noinline __attribute__ ((noinline))

    template<class T>
    T read (const uint8_t* address)
    {
        if((size_t)address % sizeof(T) == 0) {
            return *reinterpret_cast<const T*>(address);

        } else {
            T t;
            memcpy(reinterpret_cast<uint8_t*>(&t), address, sizeof(T));
            return t;
        }
    }

    template<class = void>
    constexpr size_t max_len (size_t max) { return max; }

    template<class Sub, class Token, class... Tail>
    constexpr size_t max_len (size_t max = 0)
    {
        return max_len<Tail...>(std::tuple_size<Token>::value > max ? std::tuple_size<Token>::value : max);
    }

    constexpr size_t dec_saturate(size_t n)
    {
        return n > 0 ? n - 1 : 0;
    }

    template<size_t N, class T> bool comp (const uint8_t* a, const T* b)
    {
        return N == 0 || (*a == *b && comp<dec_saturate(N)>(a + 1, b + 1));
    }

    template<size_t N> void copy (const uint8_t* src, uint8_t* dst)
    {
        *dst = *src;
        copy<N - 1>(src + 1, dst + 1);
    }

    template<> inline void copy<0> (const uint8_t*, uint8_t*) { }

    inline void copy_to_vec (std::vector<uint8_t>& vec, const uint8_t* src, size_t n)
    {
        if(vec.size() < n) vec.resize(n);
        memcpy(vec.data(), src, n);
    }

    inline void copy_to_vec (std::vector<uint8_t>& vec, const MemBlock& block)
    {
        copy_to_vec(vec, block.ptr, block.size);
    }

    inline MemBlock copy (std::vector<uint8_t>& vec, const MemBlock& block)
    {
        copy_to_vec(vec, block);
        return { vec.data(), block.size };
    }

    inline MemBlock copy (Heap& heap, const MemBlock& block)
    {
        if(block.size < 1) return block;

        auto* mem = heap.get_mem(block.size);
        memcpy(mem, block.ptr, block.size);

        return { mem, block.size };
    }

    template<class T>
    void clear_stack(std::stack<T>& st)
    {
        while(st.size() > 0) st.pop();
    }

} } }

#endif

redpajama_set_name: RedPajamaGithub


text:
FROM nodesource/node:wheezy
ENV NODE_NO_READLINE=1
CMD ["node"]


text:
package org.apache.geode.management.internal.cli.functions;

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

import java.io.File;
import java.io.IOException;

import org.apache.commons.io.FileUtils;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import org.apache.geode.cache.Cache;
import org.apache.geode.cache.execute.FunctionContext;
import org.apache.geode.cache.execute.ResultSender;
import org.apache.geode.internal.cache.GemFireCacheImpl;
import org.apache.geode.internal.cache.execute.FunctionContextImpl;
import org.apache.geode.test.dunit.rules.ServerStarterRule;
import org.apache.geode.test.junit.categories.IntegrationTest;

@Category(IntegrationTest.class)
public class ExportLogsFunctionIntegrationTest {

  @Rule
  public ServerStarterRule serverStarterRule =
      new ServerStarterRule().withWorkingDir().withAutoStart();
  private File serverWorkingDir;

  @Before
  public void setup() throws Exception {
    serverWorkingDir = serverStarterRule.getWorkingDir();
  }

  @Test
  public void exportLogsFunctionDoesNotBlowUp() throws Throwable {
    File logFile1 = new File(serverWorkingDir, "server1.log");
    FileUtils.writeStringToFile(logFile1, "some log for server1 \n some other log line");
    File logFile2 = new File(serverWorkingDir, "server2.log");
    FileUtils.writeStringToFile(logFile2, "some log for server2 \n some other log line");

    File notALogFile = new File(serverWorkingDir, "foo.txt");
    FileUtils.writeStringToFile(notALogFile, "some text");

    verifyExportLogsFunctionDoesNotBlowUp(serverStarterRule.getCache());

    Cache cache = serverStarterRule.getCache();
    assertThat(cache.getRegion(ExportLogsFunction.EXPORT_LOGS_REGION)).isEmpty();
  }

  public static void verifyExportLogsFunctionDoesNotBlowUp(Cache cache) throws Throwable {
    ExportLogsFunction.Args args =
        new ExportLogsFunction.Args(null, null, "info", false, false, false);

    CapturingResultSender resultSender = new CapturingResultSender();

    FunctionContext context = new FunctionContextImpl(cache, "functionId", args, resultSender);

    new ExportLogsFunction().execute(context);

    if (resultSender.getThrowable() != null) {
      throw resultSender.getThrowable();
    }
  }

  @Test
  public void createOrGetExistingExportLogsRegionDoesNotBlowUp() throws Exception {
    GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
    ExportLogsFunction.createOrGetExistingExportLogsRegion(false, cache);
    assertThat(cache.getRegion(ExportLogsFunction.EXPORT_LOGS_REGION)).isNotNull();
  }

  @Test
  public void destroyExportLogsRegionWorksAsExpectedForInitiatingMember()
      throws IOException, ClassNotFoundException {
    GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
    ExportLogsFunction.createOrGetExistingExportLogsRegion(true, cache);
    assertThat(cache.getRegion(ExportLogsFunction.EXPORT_LOGS_REGION)).isNotNull();

    ExportLogsFunction.destroyExportLogsRegion(cache);
    assertThat(cache.getRegion(ExportLogsFunction.EXPORT_LOGS_REGION)).isNull();
  }

  private static class CapturingResultSender implements ResultSender {
    private Throwable t;

    public Throwable getThrowable() {
      return t;
    }

    @Override
    public void sendResult(Object oneResult) {

    }

    @Override
    public void lastResult(Object lastResult) {

    }

    @Override
    public void sendException(Throwable t) {
      this.t = t;
    }
  }
}


text:
<?php

$lang = 'en';

$dir = dirname(__FILE__);
$langContents = file_get_contents($dir . '/../' . $lang . '.json');
$data = json_decode($langContents, true);

return $data['messages'];


text:
(function() {
  var __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

  define("kopi/demos/main", function(require, exports, module) {
    var DemoApp, Navbar, ViewSwitcher, app;
    app = require("kopi/app");
    Navbar = require("kopi/ui/navigation").Navbar;
    ViewSwitcher = require("kopi/ui/viewswitchers").ViewSwitcher;
    require("kopi/demos/routes");
    require("kopi/demos/settings");
    DemoApp = (function(_super) {

      __extends(DemoApp, _super);

      function DemoApp() {
        return DemoApp.__super__.constructor.apply(this, arguments);
      }

      DemoApp.prototype.onstart = function() {
        DemoApp.__super__.onstart.apply(this, arguments);
        this.navbar = new Navbar({
          position: Navbar.POS_TOP_FIXED
        }).skeletonTo(this.viewport.element).render();
        return this.viewSwitcher = new ViewSwitcher().skeletonTo(this.viewport.element).render();
      };

      DemoApp.prototype.onstop = function() {
        DemoApp.__super__.onstop.apply(this, arguments);
        this.navbar.destroy();
        return this.viewSwitcher.destroy();
      };

      return DemoApp;

    })(app.App);
    return $(function() {
      return new DemoApp().start();
    });
  });

}).call(this);


text:
//go:build !ignore_autogenerated
// +build !ignore_autogenerated

// Code generated by deepcopy-gen. DO NOT EDIT.

package v1alpha1

import (
	runtime "k8s.io/apimachinery/pkg/runtime"
	v1 "knative.dev/pkg/apis/duck/v1"
)

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *AddressableService) DeepCopyInto(out *AddressableService) {
	*out = *in
	out.TypeMeta = in.TypeMeta
	in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
	out.Spec = in.Spec
	in.Status.DeepCopyInto(&out.Status)
	return
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AddressableService.
func (in *AddressableService) DeepCopy() *AddressableService {
	if in == nil {
		return nil
	}
	out := new(AddressableService)
	in.DeepCopyInto(out)
	return out
}

// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *AddressableService) DeepCopyObject() runtime.Object {
	if c := in.DeepCopy(); c != nil {
		return c
	}
	return nil
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *AddressableServiceList) DeepCopyInto(out *AddressableServiceList) {
	*out = *in
	out.TypeMeta = in.TypeMeta
	in.ListMeta.DeepCopyInto(&out.ListMeta)
	if in.Items != nil {
		in, out := &in.Items, &out.Items
		*out = make([]AddressableService, len(*in))
		for i := range *in {
			(*in)[i].DeepCopyInto(&(*out)[i])
		}
	}
	return
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AddressableServiceList.
func (in *AddressableServiceList) DeepCopy() *AddressableServiceList {
	if in == nil {
		return nil
	}
	out := new(AddressableServiceList)
	in.DeepCopyInto(out)
	return out
}

// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *AddressableServiceList) DeepCopyObject() runtime.Object {
	if c := in.DeepCopy(); c != nil {
		return c
	}
	return nil
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *AddressableServiceSpec) DeepCopyInto(out *AddressableServiceSpec) {
	*out = *in
	return
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AddressableServiceSpec.
func (in *AddressableServiceSpec) DeepCopy() *AddressableServiceSpec {
	if in == nil {
		return nil
	}
	out := new(AddressableServiceSpec)
	in.DeepCopyInto(out)
	return out
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *AddressableServiceStatus) DeepCopyInto(out *AddressableServiceStatus) {
	*out = *in
	in.Status.DeepCopyInto(&out.Status)
	if in.Address != nil {
		in, out := &in.Address, &out.Address
		*out = new(v1.Addressable)
		(*in).DeepCopyInto(*out)
	}
	return
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AddressableServiceStatus.
func (in *AddressableServiceStatus) DeepCopy() *AddressableServiceStatus {
	if in == nil {
		return nil
	}
	out := new(AddressableServiceStatus)
	in.DeepCopyInto(out)
	return out
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *SimpleDeployment) DeepCopyInto(out *SimpleDeployment) {
	*out = *in
	out.TypeMeta = in.TypeMeta
	in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
	out.Spec = in.Spec
	in.Status.DeepCopyInto(&out.Status)
	return
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SimpleDeployment.
func (in *SimpleDeployment) DeepCopy() *SimpleDeployment {
	if in == nil {
		return nil
	}
	out := new(SimpleDeployment)
	in.DeepCopyInto(out)
	return out
}

// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *SimpleDeployment) DeepCopyObject() runtime.Object {
	if c := in.DeepCopy(); c != nil {
		return c
	}
	return nil
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *SimpleDeploymentList) DeepCopyInto(out *SimpleDeploymentList) {
	*out = *in
	out.TypeMeta = in.TypeMeta
	in.ListMeta.DeepCopyInto(&out.ListMeta)
	if in.Items != nil {
		in, out := &in.Items, &out.Items
		*out = make([]SimpleDeployment, len(*in))
		for i := range *in {
			(*in)[i].DeepCopyInto(&(*out)[i])
		}
	}
	return
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SimpleDeploymentList.
func (in *SimpleDeploymentList) DeepCopy() *SimpleDeploymentList {
	if in == nil {
		return nil
	}
	out := new(SimpleDeploymentList)
	in.DeepCopyInto(out)
	return out
}

// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *SimpleDeploymentList) DeepCopyObject() runtime.Object {
	if c := in.DeepCopy(); c != nil {
		return c
	}
	return nil
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *SimpleDeploymentSpec) DeepCopyInto(out *SimpleDeploymentSpec) {
	*out = *in
	return
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SimpleDeploymentSpec.
func (in *SimpleDeploymentSpec) DeepCopy() *SimpleDeploymentSpec {
	if in == nil {
		return nil
	}
	out := new(SimpleDeploymentSpec)
	in.DeepCopyInto(out)
	return out
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *SimpleDeploymentStatus) DeepCopyInto(out *SimpleDeploymentStatus) {
	*out = *in
	in.Status.DeepCopyInto(&out.Status)
	return
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SimpleDeploymentStatus.
func (in *SimpleDeploymentStatus) DeepCopy() *SimpleDeploymentStatus {
	if in == nil {
		return nil
	}
	out := new(SimpleDeploymentStatus)
	in.DeepCopyInto(out)
	return out
}


text:
module Descriptor
  class PackageDescription
    attr_reader :package
    def initialize(package)
      @package = package
    end

    def data_set_ids
      package.package_states.map(&:ds_external_reference).compact
    end

    def data_element_group_ids
      package.package_states.map(&:deg_external_reference).compact
    end

    def main_org_unit_group_ids
      package.main_entity_groups.map(&:organisation_unit_group_ext_ref).compact
    end

    def target_org_unit_group_ids
      package.target_entity_groups.map(&:organisation_unit_group_ext_ref).compact
    end

    def activity_descriptors(activity_type)
      ActivityDescription.new(package).activity_descriptors(activity_type)
    end
  end
end


text:
#ifndef QGRAPHICSITEMANIMATION_H
#define QGRAPHICSITEMANIMATION_H

#include <QtCore/qobject.h>

#if !defined(QT_NO_GRAPHICSVIEW)

QT_BEGIN_NAMESPACE

class QGraphicsItem;
class QMatrix;
class QPointF;
class QTimeLine;
template <class T1, class T2> struct QPair;

class QGraphicsItemAnimationPrivate;
class Q_WIDGETS_EXPORT QGraphicsItemAnimation : public QObject
{
    Q_OBJECT
public:
    QGraphicsItemAnimation(QObject *parent = 0);
    virtual ~QGraphicsItemAnimation();

    QGraphicsItem *item() const;
    void setItem(QGraphicsItem *item);

    QTimeLine *timeLine() const;
    void setTimeLine(QTimeLine *timeLine);

    QPointF posAt(qreal step) const;
    QList<QPair<qreal, QPointF> > posList() const;
    void setPosAt(qreal step, const QPointF &pos);

    QMatrix matrixAt(qreal step) const;

    qreal rotationAt(qreal step) const;
    QList<QPair<qreal, qreal> > rotationList() const;
    void setRotationAt(qreal step, qreal angle);

    qreal xTranslationAt(qreal step) const;
    qreal yTranslationAt(qreal step) const;
    QList<QPair<qreal, QPointF> > translationList() const;
    void setTranslationAt(qreal step, qreal dx, qreal dy);

    qreal verticalScaleAt(qreal step) const;
    qreal horizontalScaleAt(qreal step) const;
    QList<QPair<qreal, QPointF> > scaleList() const;
    void setScaleAt(qreal step, qreal sx, qreal sy);

    qreal verticalShearAt(qreal step) const;
    qreal horizontalShearAt(qreal step) const;
    QList<QPair<qreal, QPointF> > shearList() const;
    void setShearAt(qreal step, qreal sh, qreal sv);

    void clear();

public Q_SLOTS:
    void setStep(qreal x);
    void reset();

protected:
    virtual void beforeAnimationStep(qreal step);
    virtual void afterAnimationStep(qreal step);

private:
    Q_DISABLE_COPY(QGraphicsItemAnimation)
    QGraphicsItemAnimationPrivate *d;
};

QT_END_NAMESPACE

#endif // QT_NO_GRAPHICSVIEW
#endif


text:
int Newton(cublasHandle_t cublasHandle, user_map_vector Jacobi_Axb, void *user_struct_Jacobi,  user_map_vector RHS_Axb, void *user_struct_RHS, int N, real *x, real *tol, int *iter, real tol_linsolve, int iter_linsolve, bool verbose=false, unsigned int skip=100);

#endif


text:
SYNONYM

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

#### Published in
Rhodora 4:145. 1902

#### Original name
null

### Remarks
null


text:
from django.conf.urls import patterns, include, url

urlpatterns = patterns('',
    url(r'^about/', 'StackSmash.apps.blog.views.about'),
    url(r"^add_comment/(\d+)/$", "StackSmash.apps.blog.views.add_comment", name='add_comment'),
    url(r'^$', 'StackSmash.apps.blog.views.index', name='index'),
    url(r'^(?P<year>\d{4})/(?P<month>\d{2})/(?P<slug>[\-\w]+)/', 'StackSmash.apps.blog.views.post', name='post'),
    url(r"^archive/(\d+)/(\d+)/$", "StackSmash.apps.blog.views.archive", name='archive'),
    url(r"^delete_comment/(\d+)/$", "StackSmash.apps.blog.views.delete_comment", name="delete_comment1"),
    url(r"^delete_comment/(\d+)/(\d+)/$", "StackSmash.apps.blog.views.delete_comment", name="delete_comment2"),
    url(r"^captcha/(\d+)/(\d+)/$", "StackSmash.apps.blog.views.captcha_check", name="captcha"),
    url(r"^captcha/verify/(\d+)/(\d+)/$", "StackSmash.apps.blog.views.captcha_verify", name="captcha_verify"),
#    url(r'^$', 'archive', {'num_latest': 15}),
)


text:
using MBCorpHealthTest.Dominio.ContextoAdministracaoDeAgendamentosDeExame.Contratos;
using MBCorpHealthTest.Dominio.ContextoCadastrosCorporativos.Entidades;
using NHibernate;

namespace MBCorpHealthTest.Infraestrutura.ContextoCadastrosCorporativos
{
    public class MedicosFake : IMedicos
    {
        public Medico PesquisarMedicoPorCRMEEstado(string crm, string estado)
        {
            return new Medico(crm, "fabio", estado);
        }
    }

    public class Medicos : IMedicos
    {
        private readonly ISession _session;

        public Medicos(ISession session)
        {
            _session = session;
        }

        public Medico PesquisarMedicoPorCRMEEstado(string crm, string estado)
        {
                return
                    _session.QueryOver<Medico>().Where(campo=>campo.CRM==crm).And(campo=>campo.Estado==estado)
                        .SingleOrDefault();
        }
    }
}