// sendData is an auxiliary function to send data to the TM1638 module
11074
func (t *TM1638Driver) sendData(address byte, data byte) {
	t.sendCommand(TM1638DataCmd | TM1638FixedAddr)
	t.pinStrobe.Off()
	t.send(TM1638AddrCmd | address)
	t.send(data)
	t.pinStrobe.On()
}
579596
func (c *Context) BufferData(target int, data interface{}, usage int) {
	c.Call("bufferData", target, data, usage)
}
388655
func (s *PostToConnectionInput) SetData(v []byte) *PostToConnectionInput {
	s.Data = v
	return s
}
973761
func (conn *UDPConn) SendTo(addr net.Addr, p Packet) error {
	_, err := conn.WriteTo(p.Bytes(), addr)
	return err
}
358252
func LoadData(image string) (Module, error) {
	var mod Module
	cstr := C.CString(image)
	defer C.free(unsafe.Pointer(cstr))
	err := result(C.cuModuleLoadData(&mod.mod, unsafe.Pointer(cstr)))
	return mod, err
}
606273
func (a *AIP1640Driver) sendData(address byte, data byte) {
	a.sendCommand(AIP1640DataCmd | AIP1640FixedAddr)
	a.pinData.Off()
	a.send(AIP1640AddrCmd | address)
	a.send(data)
	a.pinData.On()
}
1370275
func (mj *Client) PutData(fmr *FullDataRequest, onlyFields []string, options ...RequestOptions) (err error) {
	url := buildDataURL(mj.apiBase, fmr.Info)
	req, err := createRequest("PUT", url, fmr.Payload, onlyFields, options...)
	if err != nil {
		return err
	}

	headers := map[string]string{"Content-Type": "application/json"}
	_, _, err = mj.httpClient.Send(req).With(headers).Call()

	return err
}
334418
func (m *Driver) SendPacket(packet *common.MAVLinkPacket) (err error) {
	_, err = m.adaptor().Write(packet.Pack())
	return err
}
1130545
func (a *AIP1640Driver) send(data byte) {
	for i := 0; i < 8; i++ {
		a.pinClock.Off()

		if (data & 1) > 0 {
			a.pinData.On()
		} else {
			a.pinData.Off()
		}
		data >>= 1

		a.pinClock.On()
	}
}
273368
func (j *Js) Getdata() map[string]interface{} {
	if m, ok := (j.data).(map[string]interface{}); ok {
		return m
	}
	return nil
}
978450
func (p *TemplateFormat) TransformData(data interface{}) (string, error) {
	var out io.Writer = new(bytes.Buffer)
	if len(p.tmpl) == 0 {
		return "", fmt.Errorf("template needs to be specified the golang templates.")
	}

	t, err := template.New("format").Parse(p.tmpl)
	if err != nil {
		return "", err
	}

	err = t.Execute(out, data)
	if err != nil {
		return "", err
	}
	return fmt.Sprint(out), nil
}
101116
func requestData(req *http.Request) *Request {
	var (
		scheme = "http"
		host   = req.Host
	)
	if len(req.URL.Scheme) > 0 {
		scheme = req.URL.Scheme
	}
	if len(req.URL.Host) > 0 {
		host = req.URL.Host
	}

	return &Request{
		Method:        req.Method,
		URL:           fmt.Sprintf("%s://%s%s", scheme, host, req.URL.Path),
		ClientIP:      getIP(req),
		UserAgent:     req.UserAgent(),
		ContentLength: req.ContentLength,
	}
}
373813
func (soc *Socket) SendBytes(data []byte, flags Flag) (int, error) {
	if !soc.opened {
		return 0, ErrorSocketClosed
	}
	d := data
	if len(data) == 0 {
		d = []byte{0}
	}
	size, err := C.zmq_send(soc.soc, unsafe.Pointer(&d[0]), C.size_t(len(data)), C.int(flags))
	if size < 0 {
		return int(size), errget(err)
	}
	return int(size), nil
}
689733
func (s *sender) sendData() {
	limit := s.maxPayloadSize
	if s.gso {
		limit = int(s.ep.gso.MaxSize - header.TCPHeaderMaximumSize)
	}
	// Reduce the congestion window to min(IW, cwnd) per RFC 5681, page 10.
	// "A TCP SHOULD set cwnd to no more than RW before beginning
	// transmission if the TCP has not sent data in the interval exceeding
	// the retrasmission timeout."
	if !s.fr.active && time.Now().Sub(s.lastSendTime) > s.rto {
		if s.sndCwnd > InitialCwnd {
			s.sndCwnd = InitialCwnd
		}
	}

	seg := s.writeNext
	end := s.sndUna.Add(s.sndWnd)
	var dataSent bool
	for ; seg != nil && s.outstanding < s.sndCwnd; seg = seg.Next() {
		cwndLimit := (s.sndCwnd - s.outstanding) * s.maxPayloadSize
		if cwndLimit < limit {
			limit = cwndLimit
		}
		// We abuse the flags field to determine if we have already
		// assigned a sequence number to this segment.
		if seg.flags == 0 {
			// Merge segments if allowed.
			if seg.data.Size() != 0 {
				available := int(s.sndNxt.Size(end))
				if available > limit {
					available = limit
				}

				// nextTooBig indicates that the next segment was too
				// large to entirely fit in the current segment. It would
				// be possible to split the next segment and merge the
				// portion that fits, but unexpectedly splitting segments
				// can have user visible side-effects which can break
				// applications. For example, RFC 7766 section 8 says
				// that the length and data of a DNS response should be
				// sent in the same TCP segment to avoid triggering bugs
				// in poorly written DNS implementations.
				var nextTooBig bool

				for seg.Next() != nil && seg.Next().data.Size() != 0 {
					if seg.data.Size()+seg.Next().data.Size() > available {
						nextTooBig = true
						break
					}

					seg.data.Append(seg.Next().data)

					// Consume the segment that we just merged in.
					s.writeList.Remove(seg.Next())
				}

				if !nextTooBig && seg.data.Size() < available {
					// Segment is not full.
					if s.outstanding > 0 && atomic.LoadUint32(&s.ep.delay) != 0 {
						// Nagle's algorithm. From Wikipedia:
						//   Nagle's algorithm works by combining a number of
						//   small outgoing messages and sending them all at
						//   once. Specifically, as long as there is a sent
						//   packet for which the sender has received no
						//   acknowledgment, the sender should keep buffering
						//   its output until it has a full packet's worth of
						//   output, thus allowing output to be sent all at
						//   once.
						break
					}
					if atomic.LoadUint32(&s.ep.cork) != 0 {
						// Hold back the segment until full.
						break
					}
				}
			}

			// Assign flags. We don't do it above so that we can merge
			// additional data if Nagle holds the segment.
			seg.sequenceNumber = s.sndNxt
			seg.flags = header.TCPFlagAck | header.TCPFlagPsh
		}

		var segEnd seqnum.Value
		if seg.data.Size() == 0 {
			if s.writeList.Back() != seg {
				panic("FIN segments must be the final segment in the write list.")
			}
			seg.flags = header.TCPFlagAck | header.TCPFlagFin
			segEnd = seg.sequenceNumber.Add(1)
		} else {
			// We're sending a non-FIN segment.
			if seg.flags&header.TCPFlagFin != 0 {
				panic("Netstack queues FIN segments without data.")
			}

			if !seg.sequenceNumber.LessThan(end) {
				break
			}

			available := int(seg.sequenceNumber.Size(end))
			if available > limit {
				available = limit
			}

			if seg.data.Size() > available {
				// Split this segment up.
				nSeg := seg.clone()
				nSeg.data.TrimFront(available)
				nSeg.sequenceNumber.UpdateForward(seqnum.Size(available))
				s.writeList.InsertAfter(seg, nSeg)
				seg.data.CapLength(available)
			}

			s.outstanding += s.pCount(seg)
			segEnd = seg.sequenceNumber.Add(seqnum.Size(seg.data.Size()))
		}

		if !dataSent {
			dataSent = true
			// We are sending data, so we should stop the keepalive timer to
			// ensure that no keepalives are sent while there is pending data.
			s.ep.disableKeepaliveTimer()
		}

		if !seg.xmitTime.IsZero() {
			s.ep.stack.Stats().TCP.Retransmits.Increment()
			if s.sndCwnd < s.sndSsthresh {
				s.ep.stack.Stats().TCP.SlowStartRetransmits.Increment()
			}
		}

		seg.xmitTime = time.Now()
		s.sendSegment(seg.data, seg.flags, seg.sequenceNumber)

		// Update sndNxt if we actually sent new data (as opposed to
		// retransmitting some previously sent data).
		if s.sndNxt.LessThan(segEnd) {
			s.sndNxt = segEnd
		}
	}

	// Remember the next segment we'll write.
	s.writeNext = seg

	// Enable the timer if we have pending data and it's not enabled yet.
	if !s.resendTimer.enabled() && s.sndUna != s.sndNxt {
		s.resendTimer.enable(s.rto)
	}
	// If we have no more pending data, start the keepalive timer.
	if s.sndUna == s.sndNxt {
		s.ep.resetKeepaliveTimer(false)
	}
}
359502
func (c *Connection) writeData(data []byte) error {
	_, err := c.Conn.Write(data[:])

	return err
}
711427
func SendData(client riemanngo.Client, events []riemanngo.Event) error {
	// do nothing if we are not connected
	if client == nil {
		glog.Warningf("Riemann sink not connected")
		return nil
	}
	start := time.Now()
	_, err := riemanngo.SendEvents(client, &events)
	end := time.Now()
	if err == nil {
		glog.V(4).Infof("Exported %d events to riemann in %s", len(events), end.Sub(start))
		return nil
	} else {
		glog.Warningf("There were errors sending events to Riemman, forcing reconnection. Error : %+v", err)
		return err
	}
}
1125603
func (s *RawMessage) SetData(v []byte) *RawMessage {
	s.Data = v
	return s
}