<commit_before>// Copyright 2015 tsuru authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package service

import (
	"encoding/json"
	stderrors "errors"
	"gopkg.in/mgo.v2"
	"io"
	"net/http"
	"regexp"
	"strconv"

	"github.com/tsuru/tsuru/action"
	"github.com/tsuru/tsuru/app/bind"
	"github.com/tsuru/tsuru/auth"
	"github.com/tsuru/tsuru/db"
	"github.com/tsuru/tsuru/errors"
	"github.com/tsuru/tsuru/log"
	"github.com/tsuru/tsuru/rec"
	"gopkg.in/mgo.v2/bson"
)

var (
	ErrServiceInstanceNotFound   = stderrors.New("service instance not found")
	ErrInvalidInstanceName       = stderrors.New("invalid service instance name")
	ErrInstanceNameAlreadyExists = stderrors.New("instance name already exists.")
	ErrAccessNotAllowed          = stderrors.New("user does not have access to this service instance")
	ErrMultipleTeams             = stderrors.New("user is member of multiple teams, please specify the team that owns the service instance")
	ErrUnitAlreadyBound          = stderrors.New("unit is already bound to this service instance")
	ErrUnitNotBound              = stderrors.New("unit is not bound to this service instance")

	instanceNameRegexp = regexp.MustCompile(`^[A-Za-z][-a-zA-Z0-9_]+$`)
)<commit_msg>service: fix imports order<commit_after>// Copyright 2015 tsuru authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package service

import (
	"encoding/json"
	stderrors "errors"
	"io"
	"net/http"
	"regexp"
	"strconv"

	"github.com/tsuru/tsuru/action"
	"github.com/tsuru/tsuru/app/bind"
	"github.com/tsuru/tsuru/auth"
	"github.com/tsuru/tsuru/db"
	"github.com/tsuru/tsuru/errors"
	"github.com/tsuru/tsuru/log"
	"github.com/tsuru/tsuru/rec"
	"gopkg.in/mgo.v2"
	"gopkg.in/mgo.v2/bson"
)

var (
	ErrServiceInstanceNotFound   = stderrors.New("service instance not found")
	ErrInvalidInstanceName       = stderrors.New("invalid service instance name")
	ErrInstanceNameAlreadyExists = stderrors.New("instance name already exists.")
	ErrAccessNotAllowed          = stderrors.New("user does not have access to this service instance")
	ErrMultipleTeams             = stderrors.New("user is member of multiple teams, please specify the team that owns the service instance")
	ErrUnitAlreadyBound          = stderrors.New("unit is already bound to this service instance")
	ErrUnitNotBound              = stderrors.New("unit is not bound to this service instance")

	instanceNameRegexp = regexp.MustCompile(`^[A-Za-z][-a-zA-Z0-9_]+$`)
)
{'fraction_non_alphanumeric': 0.11427472104655637, 'fraction_numerical': 0.0061562139284340135, 'mean_word_length': 3.9056603773584904, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1976703', 'n_tokens_mistral': 877, 'n_tokens_neox': 869, 'n_words': 219}