// New creates a new terminal reader.
14932
func (c Client) New(params *stripe.TerminalReaderParams) (*stripe.TerminalReader, error) {
	reader := &stripe.TerminalReader{}
	err := c.B.Call(http.MethodPost, "/v1/terminal/readers", c.Key, params, reader)
	return reader, err
}
153065
func (s *DirectMessageService) New(params *DirectMessageNewParams) (*DirectMessage, *http.Response, error) {
	dm := new(DirectMessage)
	apiError := new(APIError)
	resp, err := s.sling.New().Post("new.json").BodyForm(params).Receive(dm, apiError)
	return dm, resp, relevantError(err, *apiError)
}
999628
func New(r io.Reader) *Reader {
	result := &Reader{
		Reader:  r,
		Timeout: 100 * time.Millisecond,
		Ch:      make(chan string),
	}

	go result.Run()
	return result
}
177115
func New(config Config) (*Console, error) {
	// Handle unset config values gracefully
	if config.Prompter == nil {
		config.Prompter = Stdin
	}
	if config.Prompt == "" {
		config.Prompt = DefaultPrompt
	}
	if config.Printer == nil {
		config.Printer = colorable.NewColorableStdout()
	}
	// Initialize the console and return
	console := &Console{
		client:   config.Client,
		jsre:     jsre.New(config.DocRoot, config.Printer),
		prompt:   config.Prompt,
		prompter: config.Prompter,
		printer:  config.Printer,
		histPath: filepath.Join(config.DataDir, HistoryFile),
	}
	if err := os.MkdirAll(config.DataDir, 0700); err != nil {
		return nil, err
	}
	if err := console.init(config.Preload); err != nil {
		return nil, err
	}
	return console, nil
}
978803
func New(format string, args ...interface{}) error {
	return annotate(errors.New(fmt.Sprintf(format, args...)), "")
}
1335222
func New(r io.Reader) (s *Scanner) {
	s = &Scanner{}
	s.r = bufio.NewReader(r)
	s.Whitespace = datastructs.NewBitSet(256)
	s.Error = func(err error) {
		fmt.Fprintf(os.Stderr, "Scanner error: %s\n", err)
	}
	// initialize default with Whitespace variable
	s.InitWhitespace(Whitespace)
	s.token = make([]rune, MaxTokenLen)
	s.tokenIdx = 0
	return
}
513892
func New(rw *rwi.RWI, function func(string) (string, error), opts ...OptFunc) *Prompt {
	p := &Prompt{rw: rw, function: function, scanner: bufio.NewScanner(rw.Reader())}
	for _, opt := range opts {
		opt(p)
	}
	return p
}
572669
func New(cfg ...Config) *Typescript {
	c := DefaultConfig()
	if len(cfg) > 0 {
		c = cfg[0]
	}

	return &Typescript{Config: &c}
}
1049285
func New(params *stripe.TerminalLocationParams) (*stripe.TerminalLocation, error) {
	return getC().New(params)
}
1148592
func New(ctx context.Context) (*GPG, error) {
	pubfn := filepath.Join(gpgHome(ctx), "pubring.gpg")
	pubring, err := readKeyring(pubfn)
	if err != nil {
		return nil, err
	}
	secfn := filepath.Join(gpgHome(ctx), "secring.gpg")
	secring, err := readKeyring(secfn)
	if err != nil {
		return nil, err
	}
	g := &GPG{
		pubring: pubring,
		secring: secring,
		pubfn:   pubfn,
		secfn:   secfn,
	}
	return g, nil
}
398000
func New(c transport.ClientConfig, opts ...thrift.ClientOption) Interface {
	return client{
		c: thrift.New(thrift.Config{
			Service:      "Echo",
			ClientConfig: c,
		}, opts...),
	}
}
841544
func New(wr io.Writer) *Logger {
	return &Logger{
		wr:    wr,
		level: logLevelNotice,
		pid:   os.Getpid(),
		tty:   istty(wr),
		app:   'M',
	}
}
1294947
func New(s string) (noder.Noder, error) {
	return decodeDir([]byte(s), root)
}
16635
func New(r io.Reader) (*WebmKeeper, error) {
	p := webmEdtd.NewParser(r)
	header := bytes.NewBuffer(make([]byte, 0, 4096))
	body := bytes.NewBuffer(make([]byte, 0, 4096))

	for {
		el, err := next(p)
		if err != nil {
			return nil, err
		}

		if el.Name == "Cluster" {
			el.WriteTo(body)
			break
		}
		el.WriteTo(header)
	}

	return &WebmKeeper{
		p:       p,
		header:  header,
		body:    body,
		elemBuf: bytes.NewBuffer(make([]byte, 0, 1024)),
	}, nil
}
410521
func (i *identifier) new() string {
	i.m.Lock()
	defer i.m.Unlock()
	i.i++
	return strconv.Itoa(i.i)
}
639863
func New(code int, msgs Messages, args ...interface{}) error {
	return newErrorBox(nil, code, msgs, args...)
}
75161
func (c Client) New(params *stripe.TerminalLocationParams) (*stripe.TerminalLocation, error) {
	location := &stripe.TerminalLocation{}
	err := c.B.Call(http.MethodPost, "/v1/terminal/locations", c.Key, params, location)
	return location, err
}