// LiveExample live例子
191625
func LiveExample() {

	cert := aliyun.NewCredentials(AccessKeyID, AccessKeySecret)
	liveM := live.NewLive(cert, DomainName, AppName, nil).SetDebug(false)
	resp := make(map[string]interface{})
	err := liveM.StreamsPublishList(time.Now().Add(-time.Hour*24*10), time.Now(), &resp)
	fmt.Println(resp)

	resp1 := live.OnlineInfoResponse{}
	err = liveM.StreamOnlineUserNum("test-video-name", &resp1)
	fmt.Println(err, resp1)

	resp2 := live.StreamListResponse{}
	err = liveM.StreamsBlockList(&resp2)
	fmt.Println(err, resp2)

	resp = make(map[string]interface{})
	err = liveM.StreamsControlHistory(time.Now().Add(-time.Hour*12), time.Now(), &resp)
	fmt.Println(err, resp)

	resp = make(map[string]interface{})
	err = liveM.ForbidLiveStreamWithPublisher("test-video-name", nil, &resp)
	fmt.Println(err, resp)

	resp = make(map[string]interface{})
	err = liveM.ResumeLiveStreamWithPublisher("test-video-name", &resp)
	fmt.Println(err, resp)

	stream := liveM.GetStream("test-video-name")
	fmt.Println(stream.RtmpPublishUrl())
	fmt.Println(stream.String())

	// 录制

	oss := live.OssInfo{
		OssBucket:       OssBucket,
		OssEndpoint:     OssEndpoint,
		OssObject:       OssObject,
		OssObjectPrefix: OssObjectPrefix,
	}

	resp = make(map[string]interface{})
	err = liveM.AddLiveAppRecordConfig(oss, &resp)
	fmt.Println(err, resp)

	resp = make(map[string]interface{})
	err = liveM.CreateLiveStreamRecordIndexFiles("test-video-name", oss, time.Now().Add(-time.Hour*24*10), time.Now(), &resp)
	fmt.Println(err, resp)

	resp = make(map[string]interface{})
	err = liveM.DescribeLiveRecordConfig(&resp)
	fmt.Println(err, resp)

	resp = make(map[string]interface{})
	err = liveM.DescribeLiveStreamRecordContent("test-video-name", time.Now().Add(-time.Hour*24*10), time.Now(), &resp)
	fmt.Println(err, resp)

	resp = make(map[string]interface{})
	err = liveM.DescribeLiveStreamRecordIndexFiles("test-video-name", time.Now().Add(-time.Hour*24*10), time.Now(), &resp)
	fmt.Println(err, resp)

	resp = make(map[string]interface{})
	err = liveM.DescribeLiveStreamsFrameRateAndBitRateData("test-video-name", &resp)
	fmt.Println(err, resp)

	StreamExample()
}
1011130
func (t *TCB) IsAlive() bool {
	return !t.inbound.rstSeen && !t.outbound.rstSeen && (!t.inbound.closed() || !t.outbound.closed())
}
553868
func (c *FakeExamples) Delete(name string, options *v1.DeleteOptions) error {
	_, err := c.Fake.
		Invokes(testing.NewDeleteAction(examplesResource, c.ns, name), &crv1.Example{})

	return err
}
311206
func (c *FakeExamples) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *crv1.Example, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewPatchSubresourceAction(examplesResource, c.ns, name, pt, data, subresources...), &crv1.Example{})

	if obj == nil {
		return nil, err
	}
	return obj.(*crv1.Example), err
}
541827
func (t Term) Sample(args ...interface{}) Term {
	return constructMethodTerm(t, "Sample", p.Term_SAMPLE, args, map[string]interface{}{})
}
313726
func (s *ExpDecaySample) Clear() {
	s.mutex.Lock()
	defer s.mutex.Unlock()
	s.count = 0
	s.t0 = time.Now()
	s.t1 = s.t0.Add(rescaleThreshold)
	s.values.Clear()
}
1053886
func NewSampleJSONBuilder() *SampleJSONBuilder {
	jb := &SampleJSONBuilder{
		_properties:        map[string]*SamplePropertyInfo{},
		_jsonPropertyMap:   map[string]*SamplePropertyInfo{},
		_structPropertyMap: map[string]*SamplePropertyInfo{},
		A1: &SamplePropertyInfo{
			fieldName: "A1",
			jsonName:  "a1",
			Encoder: func(src *Sample, dest *SampleJSON) error {
				if src == nil {
					return nil
				}
				d, err := NewInnerJSONBuilder().AddAll().Convert(&src.A1)
				if err != nil {
					return err
				}
				dest.A1 = *d
				return nil
			},
			Decoder: func(src *SampleJSON, dest *Sample) error {
				if src == nil {
					return nil
				}
				d, err := src.A1.Convert()
				if err != nil {
					return err
				}
				dest.A1 = *d
				return nil
			},
		},
		A2: &SamplePropertyInfo{
			fieldName: "A2",
			jsonName:  "a2",
			Encoder: func(src *Sample, dest *SampleJSON) error {
				if src == nil {
					return nil
				} else if src.A2 == nil {
					return nil
				}
				d, err := NewInnerJSONBuilder().AddAll().Convert(src.A2)
				if err != nil {
					return err
				}
				dest.A2 = d
				return nil
			},
			Decoder: func(src *SampleJSON, dest *Sample) error {
				if src == nil {
					return nil
				} else if src.A2 == nil {
					return nil
				}
				d, err := src.A2.Convert()
				if err != nil {
					return err
				}
				dest.A2 = d
				return nil
			},
		},
		As1: &SamplePropertyInfo{
			fieldName: "As1",
			jsonName:  "as1",
			Encoder: func(src *Sample, dest *SampleJSON) error {
				if src == nil {
					return nil
				}
				b := NewInnerJSONBuilder().AddAll()
				list := make([]InnerJSON, len(src.As1))
				for idx, obj := range src.As1 {
					d, err := b.Convert(&obj)
					if err != nil {
						return err
					}
					list[idx] = *d
				}
				dest.As1 = list
				return nil
			},
			Decoder: func(src *SampleJSON, dest *Sample) error {
				if src == nil {
					return nil
				}
				list := make([]Inner, len(src.As1))
				for idx, obj := range src.As1 {
					d, err := obj.Convert()
					if err != nil {
						return err
					}
					list[idx] = *d
				}
				dest.As1 = list
				return nil
			},
		},
		As2: &SamplePropertyInfo{
			fieldName: "As2",
			jsonName:  "as2",
			Encoder: func(src *Sample, dest *SampleJSON) error {
				if src == nil {
					return nil
				}
				list, err := NewInnerJSONBuilder().AddAll().ConvertList(src.As2)
				if err != nil {
					return err
				}
				dest.As2 = ([]*InnerJSON)(list)
				return nil
			},
			Decoder: func(src *SampleJSON, dest *Sample) error {
				if src == nil {
					return nil
				}
				list := make([]*Inner, len(src.As2))
				for idx, obj := range src.As2 {
					if obj == nil {
						continue
					}
					d, err := obj.Convert()
					if err != nil {
						return err
					}
					list[idx] = d
				}
				dest.As2 = list
				return nil
			},
		},
		As3: &SamplePropertyInfo{
			fieldName: "As3",
			jsonName:  "as3",
			Encoder: func(src *Sample, dest *SampleJSON) error {
				if src == nil {
					return nil
				} else if src.As3 == nil {
					return nil
				}
				b := NewInnerJSONBuilder().AddAll()
				list := make([]InnerJSON, len(*src.As3))
				for idx, obj := range *src.As3 {
					d, err := b.Convert(&obj)
					if err != nil {
						return err
					}
					list[idx] = *d
				}
				dest.As3 = &list
				return nil
			},
			Decoder: func(src *SampleJSON, dest *Sample) error {
				if src == nil {
					return nil
				} else if src.As3 == nil {
					return nil
				}
				list := make([]Inner, len(*src.As3))
				for idx, obj := range *src.As3 {
					d, err := obj.Convert()
					if err != nil {
						return err
					}
					list[idx] = *d
				}
				dest.As3 = &list
				return nil
			},
		},
		As4: &SamplePropertyInfo{
			fieldName: "As4",
			jsonName:  "as4",
			Encoder: func(src *Sample, dest *SampleJSON) error {
				if src == nil {
					return nil
				} else if src.As4 == nil {
					return nil
				}
				list, err := NewInnerJSONBuilder().AddAll().ConvertList(*src.As4)
				if err != nil {
					return err
				}
				dest.As4 = (*[]*InnerJSON)(&list)
				return nil
			},
			Decoder: func(src *SampleJSON, dest *Sample) error {
				if src == nil {
					return nil
				} else if src.As4 == nil {
					return nil
				}
				list := make([]*Inner, len(*src.As4))
				for idx, obj := range *src.As4 {
					if obj == nil {
						continue
					}
					d, err := obj.Convert()
					if err != nil {
						return err
					}
					list[idx] = d
				}
				dest.As4 = &list
				return nil
			},
		},
	}
	jb._structPropertyMap["A1"] = jb.A1
	jb._jsonPropertyMap["a1"] = jb.A1
	jb._structPropertyMap["A2"] = jb.A2
	jb._jsonPropertyMap["a2"] = jb.A2
	jb._structPropertyMap["As1"] = jb.As1
	jb._jsonPropertyMap["as1"] = jb.As1
	jb._structPropertyMap["As2"] = jb.As2
	jb._jsonPropertyMap["as2"] = jb.As2
	jb._structPropertyMap["As3"] = jb.As3
	jb._jsonPropertyMap["as3"] = jb.As3
	jb._structPropertyMap["As4"] = jb.As4
	jb._jsonPropertyMap["as4"] = jb.As4
	return jb
}
819428
func Examples(s string) string {
	if len(s) == 0 {
		return s
	}
	return normalizer{s}.Trim().Indent().string
}
498173
func ParseSampleFormat(s string) SampleFormat {
	cstr := C.CString(s)
	defer C.free(unsafe.Pointer(cstr))
	return SampleFormat(C.pa_parse_sample_format(cstr))
}
1235897
func GetLiveCounts(doneRefs map[ID]map[RefNonce]int) map[ID]int {
	liveCounts := make(map[ID]int)
	for id, nonces := range doneRefs {
		for _, count := range nonces {
			if existing, ok := liveCounts[id]; !ok || existing > count {
				liveCounts[id] = count
			}
		}
	}
	return liveCounts
}
1049729
func (wav *Reader) ReadRawSample() ([]byte, error) {
	if wav.samplesRead > wav.numSamples {
		return nil, io.EOF
	}

	buf := make([]byte, wav.bytesPerSample)
	n, err := wav.input.Read(buf)
	if err != nil {
		return nil, err
	}

	if n != int(wav.bytesPerSample) {
		return nil, fmt.Errorf("Read %d bytes, should have read %d", n, wav.bytesPerSample)
	}

	wav.samplesRead++

	return buf, nil
}
107542
func Convert_v1_PodSpec_To_example_PodSpec(in *PodSpec, out *example.PodSpec, s conversion.Scope) error {
	return autoConvert_v1_PodSpec_To_example_PodSpec(in, out, s)
}
796117
func (c *Command) AddExample(newExample Example) {
	c.Examples = append(c.Examples, newExample)
}
833999
func hasLivenessProbe(podSpecNode *kubegraph.PodSpecNode) bool {
	for _, container := range podSpecNode.PodSpec.Containers {
		if container.LivenessProbe != nil {
			return true
		}
	}
	return false
}
772192
func Examples(s string) string {
	if len(s) == 0 {
		return s
	}
	return normalizer{s}.trim().indent().string
}
1300672
func NewExampleDevice(log log.Logger) *FsDevice {
	return &FsDevice{
		logger:  log.Named(pluginName),
		devices: make(map[string]bool),
	}
}
715678
func NewSampleQueryBuilderWithKind(kind string) *SampleQueryBuilder {
	q := datastore.NewQuery(kind)
	bldr := &SampleQueryBuilder{q: q}
	bldr.ID = &SampleQueryProperty{
		bldr: bldr,
		name: "__key__",
	}
	bldr.FooUrl = &SampleQueryProperty{
		bldr: bldr,
		name: "FooURL",
	}
	bldr.StartAt = &SampleQueryProperty{
		bldr: bldr,
		name: "Start",
	}
	bldr.LimitProperty = &SampleQueryProperty{
		bldr: bldr,
		name: "Limit",
	}
	bldr.CreatedAt = &SampleQueryProperty{
		bldr: bldr,
		name: "CreatedAt",
	}

	if plugger, ok := interface{}(bldr).(qbgutils.Plugger); ok {
		bldr.plugin = plugger.Plugin()
		bldr.plugin.Init("Sample")
	}

	return bldr
}