// New returns a Rope representing a given string.
3054
func New(arg string) Rope {
	if len(arg) == 0 {
		return emptyRope
	}
	return Rope{
		node: leaf(arg),
	}
}
208687
func (s *Scheme) New(versionName, typeName string) (Object, error) {
	obj, err := s.raw.NewObject(versionName, typeName)
	if err != nil {
		return nil, err
	}
	return obj.(Object), nil
}
122901
func New(apiroot, user, pass string) *PPE {
	return &PPE{
		apiroot: fmt.Sprintf("https://%s/api", apiroot),
		user:    user,
		pass:    pass,
	}
}
555586
func New(writer http.ResponseWriter, httpStatus int, message string) {
	response := &response{
		Response: message,
	}

	jsonResponse, err := json.Marshal(response)
	if err != nil {
		http.Error(writer, err.Error(), http.StatusInternalServerError)
	}

	writer.Header().Set("Content-Type", "application/json")
	writer.WriteHeader(httpStatus)
	writer.Write(jsonResponse)
}
597436
func New(lockerConfig config.Locker) error {
	var err error
	switch handlerName(lockerConfig.Handler) {
	case zookeeperHandler:
		handler, err = zookeeper.NewLocker(lockerConfig)
		return err
	case redisHandler:
		handler, err = redis.NewLocker(lockerConfig)
		return err
	default:
		handler = memlock.NewLocker()
	}
	return nil
}
417409
func New(errMsg string) Error {
	uidv4, _ := uuid.NewV4() // skip error.
	return Error{
		ID:      uidv4.String(),
		Message: Prefix + errMsg,
	}
}
531672
func New(s string, pool *Pool) (*Expr, error) {
	s = strings.TrimSpace(s)
	if pool == nil {
		pool = defaultPool
	}
	if e, ok := pool.get(s); ok {
		return e, nil
	}
	e := new(Expr)
	e.pool = pool
	if err := e.parse(s); err != nil {
		return nil, err
	}
	pool.set(s, e)
	return e, nil
}
326746
func New(query string, distance int) (*Levenshtein, error) {
	lev := &dynamicLevenshtein{
		query:    query,
		distance: uint(distance),
	}
	dfabuilder := newDfaBuilder(lev)
	dfa, err := dfabuilder.build()
	if err != nil {
		return nil, err
	}
	return &Levenshtein{
		prog: lev,
		dfa:  dfa,
	}, nil
}
268408
func New(alg string, signKey interface{}, verifyKey interface{}) *JWTAuth {
	return NewWithParser(alg, &jwt.Parser{}, signKey, verifyKey)
}
787711
func New(r io.Reader) (*Tree, error) {
	n, err := html.Parse(r)
	if err != nil {
		return nil, err
	}
	if n == nil {
		return nil, fmt.Errorf("Error parsing html from reader")
	}
	return &Tree{n}, nil
}
711406
func (c Client) New(params *stripe.WebhookEndpointParams) (*stripe.WebhookEndpoint, error) {
	endpoint := &stripe.WebhookEndpoint{}
	err := c.B.Call(http.MethodPost, "/v1/webhook_endpoints", c.Key, params, endpoint)
	return endpoint, err
}
354109
func New(name, version string) *Kite {
	return NewWithConfig(name, version, config.New())
}
926578
func New(message string, keyValues ...interface{}) error {
	len := len(keyValues)
	if len == 0 {
		return errors.New(message)
	}
	buffer := bytes.NewBuffer(nil)
	if message != "" {
		_, _ = buffer.WriteString(message)
		_ = buffer.WriteByte(' ')
	}
	if len%2 != 0 {
		keyValues = append(keyValues, "MISSING")
		len++
	}
	for i := 0; i < len; i += 2 {
		if i != 0 {
			_ = buffer.WriteByte(' ')
		}
		_, _ = buffer.WriteString(fmt.Sprintf("%v", keyValues[i]))
		_ = buffer.WriteByte('=')
		_, _ = buffer.WriteString(fmt.Sprintf("%v", keyValues[i+1]))
	}
	return errors.New(buffer.String())
}
218245
func New(httpReq *http.Request, info metadata.ClientInfo, handlers Handlers, params interface{}, data interface{}) *Request {
	r := &Request{
		ClientInfo:  info,
		HTTPClient:  http.DefaultClient,
		Handlers:    handlers.Copy(),
		Time:        time.Now(),
		HTTPRequest: httpReq,
		Params:      params,
		Data:        data,
	}

	return r
}
878944
func New() string {
	var id [8 + 12]byte
	mu.Lock()
	timeMs := time.Now().UTC().UnixNano() / 1e6
	if timeMs == lastPushTimeMs {
		// increment lastRandChars
		for i := 0; i < 12; i++ {
			lastRandChars[i]++
			if lastRandChars[i] < 64 {
				break
			}
			// increment the next byte
			lastRandChars[i] = 0
		}
	} else {
		genRandPart()
	}
	lastPushTimeMs = timeMs
	// put random as the second part
	for i := 0; i < 12; i++ {
		id[19-i] = pushChars[lastRandChars[i]]
	}
	mu.Unlock()

	// put current time at the beginning
	for i := 7; i >= 0; i-- {
		n := int(timeMs % 64)
		id[i] = pushChars[n]
		timeMs = timeMs / 64
	}
	return string(id[:])
}
570407
func New(key, secret string) (api *API) {
	api = &API{
		APIKey:    key,
		APISecret: secret,
	}
	return api
}
478592
func New(m string, a ...interface{}) error {
	return errors.Wrap(fmt.Errorf(m, a...), 1)
}