text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func (a *GPIOActivity) Metadata() *activity.Metadata {
return a.metadata
} | [
0.2766450047492981,
-0.6695769429206848,
0.3017789125442505,
0.7004454135894775,
0.29682114720344543,
0.0639246255159378,
0.5177221894264221,
-0.6626626253128052,
0.7913292050361633,
0.22304667532444,
1.040992259979248,
0.648727536201477,
0.1860029697418213,
-0.4496217966079712,
0.147885... |
func (a *GPIOActivity) Eval(context activity.Context) (done bool, err error) {
//getmethod
log.Debug("Running gpio activity.")
methodInput := context.GetInput(method)
ivmethod, ok := methodInput.(string)
if !ok {
return true, errors.New("Method field not set.")
}
//get pinNumber
ivPinNumber, ok := context.G... | [
-0.7871466279029846,
-0.26625457406044006,
0.9976344704627991,
-0.15000960230827332,
0.02152606099843979,
0.6837863326072693,
0.9134352207183838,
-0.6525982022285461,
0.5535308718681335,
1.2373220920562744,
0.05893068015575409,
0.1929239183664322,
-0.2640412747859955,
-0.6944625973701477,
... |
func inSignalMap(killSignal syscall.Signal) bool {
for _, v := range signal.SignalMap {
if v == killSignal {
return true
}
}
return false
} | [
0.10008026659488678,
-0.9365752935409546,
0.4705481231212616,
0.6820813417434692,
-0.7183007597923279,
0.32940608263015747,
-0.26409968733787537,
0.34192511439323425,
0.35322946310043335,
0.44646546244621277,
-0.7649909257888794,
-0.27674663066864014,
-0.021761056035757065,
0.7951446771621... |
func ExampleConv() {
conv := cnns.NewConvLayer(&tensor.TDsize{X: 9, Y: 8, Z: 1}, 1, 3, 1)
relu := cnns.NewReLULayer(conv.GetOutputSize())
maxpool := cnns.NewPoolingLayer(relu.GetOutputSize(), 2, 2, "max", "valid")
fullyconnected := cnns.NewFullyConnectedLayer(maxpool.GetOutputSize(), 3)
convCustomWeights := mat.... | [
1.1903961896896362,
-0.496715247631073,
0.7861606478691101,
0.09533460438251495,
-0.534397542476654,
0.014673340134322643,
0.48123371601104736,
0.22589054703712463,
-0.030993692576885223,
0.27670085430145264,
-0.8625979423522949,
0.5356658697128296,
0.30840757489204407,
0.16293689608573914... |
func ExampleConv2() {
conv := cnns.NewConvLayer(&tensor.TDsize{X: 5, Y: 5, Z: 3}, 1, 3, 2)
relu := cnns.NewReLULayer(conv.GetOutputSize())
maxpool := cnns.NewPoolingLayer(relu.GetOutputSize(), 2, 2, "max", "valid")
fullyconnected := cnns.NewFullyConnectedLayer(maxpool.GetOutputSize(), 2)
net := cnns.WholeNet{
... | [
0.3343937397003174,
-0.5983992218971252,
1.128858208656311,
0.8428016304969788,
-0.5441422462463379,
-0.8454833030700684,
0.14086370170116425,
-0.34323418140411377,
-0.002748870989307761,
0.4071164131164551,
-0.7008371353149414,
-0.08526436239480972,
0.2068646401166916,
1.1218479871749878,... |
func (in *SpinnakerAccount) DeepCopyInto(out *SpinnakerAccount) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
in.Status.DeepCopyInto(&out.Status)
return
} | [
1.0264959335327148,
-0.9161474704742432,
0.335174024105072,
0.4860253930091858,
-0.6852027773857117,
-0.15939825773239136,
0.5878840684890747,
0.7456316947937012,
-0.48337364196777344,
-0.41358083486557007,
-0.7010049223899841,
1.9099637269973755,
-0.21028266847133636,
-0.5692950487136841,... |
func (in *SpinnakerAccount) DeepCopy() *SpinnakerAccount {
if in == nil {
return nil
}
out := new(SpinnakerAccount)
in.DeepCopyInto(out)
return out
} | [
0.301778107881546,
-0.4473803639411926,
-0.33994898200035095,
0.8103590607643127,
-0.5665662288665771,
-0.5161483287811279,
1.1136609315872192,
0.37840574979782104,
0.618119478225708,
-0.4580700695514679,
-0.19358868896961212,
1.117425799369812,
-0.7655249238014221,
-0.5494322180747986,
... |
func (in *SpinnakerAccount) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
} | [
0.3818708062171936,
-0.6996583342552185,
0.4361434876918793,
0.7244575619697571,
-0.6148948669433594,
0.006399582605808973,
1.395866870880127,
0.5008176565170288,
0.2940734922885895,
-0.5879058241844177,
-0.24359744787216187,
0.842535138130188,
-0.294229656457901,
-0.7623424530029297,
0.... |
func (in *SpinnakerAccountList) DeepCopyInto(out *SpinnakerAccountList) {
*out = *in
out.TypeMeta = in.TypeMeta
out.ListMeta = in.ListMeta
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]SpinnakerAccount, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
} | [
0.08608799427747726,
-0.3475582003593445,
0.3271619379520416,
0.733391284942627,
-0.40835028886795044,
-0.17099864780902863,
0.30027061700820923,
1.1404184103012085,
-0.25245025753974915,
0.27329808473587036,
-0.542661190032959,
0.7517660856246948,
-0.17820417881011963,
-0.4471330940723419... |
func (in *SpinnakerAccountList) DeepCopy() *SpinnakerAccountList {
if in == nil {
return nil
}
out := new(SpinnakerAccountList)
in.DeepCopyInto(out)
return out
} | [
-0.6466493010520935,
-0.621989369392395,
-0.42134833335876465,
1.1803011894226074,
-0.4892303943634033,
-0.6299217939376831,
0.7741657495498657,
0.4465179443359375,
0.5798353552818298,
0.12223547697067261,
-0.1299826055765152,
-0.01556750014424324,
-0.2787749171257019,
-0.34705060720443726... |
func (in *SpinnakerAccountList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
} | [
-0.23340728878974915,
-0.567039430141449,
0.3149275779724121,
0.8179970383644104,
-0.42651259899139404,
0.05490955710411072,
1.0174158811569214,
0.6658511757850647,
0.2848135232925415,
-0.23553405702114105,
-0.5826106667518616,
0.23750713467597961,
-0.188913956284523,
-0.2127557396888733,
... |
func (in *SpinnakerService) DeepCopyInto(out *SpinnakerService) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
in.Status.DeepCopyInto(&out.Status)
return
} | [
0.3925263285636902,
-0.8026700019836426,
0.3288372755050659,
0.18286992609500885,
-0.71755051612854,
0.04679413512349129,
-0.06910448521375656,
0.4701294004917145,
-0.9813288450241089,
-0.41785746812820435,
-0.5823299288749695,
1.9641443490982056,
-0.3440497815608978,
0.20912805199623108,
... |
func (in *SpinnakerService) DeepCopy() *SpinnakerService {
if in == nil {
return nil
}
out := new(SpinnakerService)
in.DeepCopyInto(out)
return out
} | [
-0.03681837394833565,
-0.5357078909873962,
-0.4685988128185272,
0.5285186767578125,
-0.5231910943984985,
-0.5265098810195923,
-0.22973890602588654,
-0.35005709528923035,
-0.47129586338996887,
-0.2901378571987152,
-0.22846677899360657,
1.1475399732589722,
-1.5053884983062744,
0.355524510145... |
func (in *SpinnakerService) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
} | [
-0.039039380848407745,
-0.35658904910087585,
0.49313220381736755,
0.44563114643096924,
-0.5176730751991272,
0.08671405166387558,
0.6753706336021423,
0.3160558342933655,
-0.21153169870376587,
-0.7361222505569458,
-0.28717872500419617,
0.5428482294082642,
-0.4624163508415222,
-0.077844239771... |
func (in *SpinnakerServiceList) DeepCopyInto(out *SpinnakerServiceList) {
*out = *in
out.TypeMeta = in.TypeMeta
out.ListMeta = in.ListMeta
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]SpinnakerService, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
} | [
0.12494613975286484,
-0.027170173823833466,
0.3974839448928833,
0.312570720911026,
-0.6079663038253784,
-0.16395999491214752,
-0.14321446418762207,
0.8747416138648987,
-0.7673652768135071,
-0.20344208180904388,
-0.4104821979999542,
1.0725083351135254,
-0.5639608502388,
0.1625671535730362,
... |
func (in *SpinnakerServiceList) DeepCopy() *SpinnakerServiceList {
if in == nil {
return nil
}
out := new(SpinnakerServiceList)
in.DeepCopyInto(out)
return out
} | [
-0.24056823551654816,
-0.2660430073738098,
-0.2896266579627991,
0.42097029089927673,
-0.5528392791748047,
-0.3372853100299835,
-0.0510510690510273,
0.005821838974952698,
0.06120223179459572,
-0.4104289710521698,
-0.18637093901634216,
0.45070552825927734,
-0.8526014089584351,
0.293377578258... |
func (in *SpinnakerServiceList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
} | [
-0.3962920308113098,
-0.12033010274171829,
0.3706444501876831,
0.41539835929870605,
-0.44345930218696594,
0.02068154327571392,
0.6129406690597534,
0.3603026568889618,
-0.14751259982585907,
-0.5495730638504028,
-0.4395114481449127,
0.2214544266462326,
-0.4632514715194702,
0.1439170837402343... |
func (in *TypesFactory) DeepCopyInto(out *TypesFactory) {
*out = *in
return
} | [
0.06822188198566437,
0.0017491357866674662,
0.48356613516807556,
0.026079125702381134,
-0.5703529119491577,
0.8356040716171265,
0.427386075258255,
0.4021131098270416,
-1.1603889465332031,
-0.5259208083152771,
-0.7967720031738281,
1.0569332838058472,
0.16198506951332092,
-0.4687007665634155... |
func (in *TypesFactory) DeepCopy() *TypesFactory {
if in == nil {
return nil
}
out := new(TypesFactory)
in.DeepCopyInto(out)
return out
} | [
-0.40277737379074097,
0.09574654698371887,
0.3110889792442322,
0.6212649345397949,
-0.03706573322415352,
0.053841736167669296,
0.6165289282798767,
-0.2996319532394409,
-0.46089908480644226,
-0.7351152896881104,
-0.2667926549911499,
-0.1651536226272583,
-0.849743127822876,
-0.82048708200454... |
func (date Date) Time() (date_time time.Time) {
seconds := Integer(date[:])
date_time = time.Unix(0, int64(seconds*1000000))
return
} | [
0.23344551026821136,
1.2922940254211426,
0.4871242940425873,
0.4276459515094757,
0.26107367873191833,
-0.15287503600120544,
-1.0979639291763306,
-0.040347371250391006,
0.16836799681186676,
0.10550713539123535,
-1.1702277660369873,
-0.8757243156433105,
0.8306267261505127,
1.5789462327957153... |
func NewIRCReader(conn io.Reader) *Reader {
var reader Reader
reader.Initialize(conn, 512, 8192+1024)
return &reader
} | [
-0.12898120284080505,
-0.7679040431976318,
0.2701416611671448,
-0.5608119964599609,
-0.221235990524292,
-0.33243802189826965,
-0.5786715149879456,
-0.13686487078666687,
-0.1861807405948639,
-0.647633969783783,
0.014442376792430878,
0.852012574672699,
-0.7863683700561523,
-0.091655679047107... |
func (cc *Reader) Initialize(conn io.Reader, initialSize, maxSize int) {
*cc = Reader{}
cc.conn = conn
cc.initialSize = initialSize
cc.maxSize = maxSize
} | [
0.12155728042125702,
-0.5104086995124817,
0.5429768562316895,
-0.08814343810081482,
0.22618047893047333,
-0.7295888662338257,
-0.9829972386360168,
1.2228834629058838,
-0.6239540576934814,
-0.8530774116516113,
-0.6814610958099365,
0.3529045283794403,
-0.45413681864738464,
0.0916890352964401... |
func (cc *Reader) ReadLine() ([]byte, error) {
for {
// try to find a terminated line in the buffered data already read
nlidx := bytes.IndexByte(cc.buf[cc.searchFrom:cc.end], '\n')
if nlidx != -1 {
// got a complete line
line := cc.buf[cc.start : cc.searchFrom+nlidx]
cc.start = cc.searchFrom + nlidx + 1... | [
0.4184463620185852,
-1.0921794176101685,
0.9170831441879272,
0.3961632549762726,
-0.2469072788953781,
-0.7675672769546509,
-0.27874991297721863,
-0.41785699129104614,
-0.17590925097465515,
-1.0899403095245361,
-0.003559649456292391,
0.06914137303829193,
-0.6703450679779053,
-0.005270140245... |
func roundUpToPowerOfTwo(v int) int {
// http://graphics.stanford.edu/~seander/bithacks.html
v -= 1
v |= v >> 1
v |= v >> 2
v |= v >> 4
v |= v >> 8
v |= v >> 16
return v + 1
} | [
-0.5898572206497192,
-0.45129233598709106,
0.7720772624015808,
-0.9988679885864258,
-0.03279642388224602,
-0.42499804496765137,
0.6402263641357422,
-0.8518792986869812,
-0.9201275110244751,
0.3370436131954193,
-0.5128576159477234,
0.6825172901153564,
-0.19290873408317566,
0.174262806773185... |
func (n name) readVarint(off int) (int, int) {
v := 0
for i := 0; ; i++ {
x := *n.data(off+i, "read varint")
v += int(x&0x7f) << (7 * i)
if x&0x80 == 0 {
return i + 1, v
}
}
} | [
-0.6060070991516113,
-0.5074114799499512,
0.5736691951751709,
-0.7032090425491333,
-1.3902679681777954,
0.3050631284713745,
-0.28277552127838135,
-0.9590094685554504,
0.05314462631940842,
0.0781397819519043,
-0.17138348519802094,
0.408859521150589,
-0.6205568909645081,
0.2760140299797058,
... |
func ValueOf(i interface{}) Value {
if i == nil {
return Value{}
}
// TODO: Maybe allow contents of a Value to live on the stack.
// For now we make the contents always escape to the heap. It
// makes life easier in a few places (see chanrecv/mapassign
// comment below).
//escapes(i)
e := (*emptyInterface)(... | [
-0.23225007951259613,
0.5286296010017395,
0.4225638806819916,
-0.5433647036552429,
-0.039103664457798004,
-0.3675629198551178,
0.3374658524990082,
-1.2382487058639526,
0.3157165050506592,
0.1976323127746582,
0.21022476255893707,
0.20383766293525696,
0.3275423049926758,
0.14960181713104248,... |
func (v Value) MethodByName(name string) Value {
if v.typ == nil {
//panic(&ValueError{"reflect.Value.MethodByName", Invalid})
}
if v.flag&flagMethod != 0 {
return Value{}
}
m, ok := v.typ.MethodByName(name)
if !ok {
return Value{}
}
return v.Method(m.Index)
} | [
-0.2674121856689453,
0.35306990146636963,
0.39016714692115784,
-0.0794355645775795,
-0.5316964387893677,
-1.0100939273834229,
0.3326846957206726,
-0.9488840103149414,
-0.16374991834163666,
0.9684247374534607,
0.07633567601442337,
-0.08002326637506485,
-0.07446411997079849,
0.65258759260177... |
func ifaceIndir(t *rtype) bool {
return t.kind&kindDirectIface == 0
} | [
-1.4461393356323242,
-0.12732939422130585,
0.545794665813446,
-0.6841305494308472,
-0.017439397051930428,
0.913447380065918,
1.0767793655395508,
-0.7435978651046753,
0.6460669636726379,
0.2835566997528076,
0.9333227872848511,
0.4683506488800049,
-0.8620535731315613,
0.8947285413742065,
-... |
func packEface(v Value) any {
t := v.typ
var i any
e := (*emptyInterface)(unsafe.Pointer(&i))
// First, fill in the data portion of the interface.
switch {
case ifaceIndir(t):
if v.flag&flagIndir == 0 {
panic("bad indir")
}
// Value is indirect, and so is the interface we're making.
ptr := v.ptr
if v... | [
-0.25017765164375305,
0.5026900172233582,
0.6590491533279419,
-0.6501413583755493,
0.11514988541603088,
0.10027538985013962,
1.0452948808670044,
-0.5721403360366821,
-0.01213207095861435,
0.4799964427947998,
-0.11701487749814987,
0.1657371073961258,
-0.9603932499885559,
0.6012240648269653,... |
func (v Value) Method(i int) Value {
if v.typ == nil {
//panic(&ValueError{"reflect.Value.Method", Invalid})
}
if v.flag&flagMethod != 0 || uint(i) >= uint(v.typ.NumMethod()) {
panic("reflect: Method index out of range")
}
if v.typ.Kind() == reflect.Interface && v.IsNil() {
panic("reflect: Method on nil inte... | [
-0.9380791783332825,
0.9552383422851562,
0.47280073165893555,
-0.06254101544618607,
0.017712729051709175,
0.04259905219078064,
1.1555674076080322,
-1.1275845766067505,
-0.06105322018265724,
0.11541257053613663,
0.517538845539093,
0.3931748867034912,
-0.1915472149848938,
0.8401851654052734,... |
func (v Value) IsNil() bool {
k := v.kind()
switch k {
case reflect.Chan, reflect.Func, reflect.Map, reflect.Pointer, reflect.UnsafePointer:
if v.flag&flagMethod != 0 {
return false
}
ptr := v.ptr
if v.flag&flagIndir != 0 {
ptr = *(*unsafe.Pointer)(ptr)
}
return ptr == nil
case reflect.Interface, ... | [
0.0590742789208889,
-0.14276403188705444,
0.5606603622436523,
-0.11343707144260406,
-0.39999765157699585,
0.21153852343559265,
0.47744929790496826,
-0.5959036946296692,
0.4664856195449829,
0.7536724805831909,
-0.2707345485687256,
0.7756710052490234,
-0.4851160943508148,
0.9283327460289001,... |
func add(p unsafe.Pointer, x uintptr, whySafe string) unsafe.Pointer {
return unsafe.Pointer(uintptr(p) + x)
} | [
0.4984554350376129,
-0.1951209455728531,
0.2624486982822418,
-0.9340676665306091,
-0.28662094473838806,
1.1139955520629883,
-1.4690704345703125,
-0.252813458442688,
0.6509724855422974,
0.004923399072140455,
0.26364070177078247,
0.9959823489189148,
-0.6347066164016724,
-1.0563520193099976,
... |
func readWordList(path string) ([]string, error) {
file, err := os.Open(path)
defer file.Close()
if err != nil {
return nil, err
}
scanner := bufio.NewScanner(file)
var list []string
for scanner.Scan() {
list = append(list, scanner.Text())
}
return list, scanner.Err()
} | [
-0.31857606768608093,
-0.7167976498603821,
0.6070653796195984,
-0.5638151168823242,
-0.6386908292770386,
0.40623244643211365,
-0.7197476029396057,
0.4308431148529053,
-0.540905773639679,
1.4894254207611084,
-0.44830548763275146,
0.31262296438217163,
-0.8651295304298401,
0.9244933724403381,... |
func handleResultValues(values []interface{}) []string {
var arr []string
for _, r := range values {
b, _ := r.([]byte)
arr = append(arr, string(b))
}
return arr
} | [
-0.3267756700515747,
0.2772354781627655,
0.6127636432647705,
0.09260368347167969,
0.6252532601356506,
0.061746567487716675,
-0.8561162948608398,
-0.8454201221466064,
-0.05311480164527893,
-0.46019527316093445,
-0.13577809929847717,
-0.1945473551750183,
-0.09930355846881866,
0.6041227579116... |
func InsertMany(Docs []interface{}, collName string, wg *sync.WaitGroup) {
coll := DBConnection().C(collName)
for _, doc := range Docs {
if err := coll.Insert(doc); err != nil {
if !strings.Contains(err.Error(), "E11000") {
log.Fatal(map[string]interface{}{
"DBError": err,
}, "Database error")
}... | [
-1.0728105306625366,
0.20498031377792358,
0.8975348472595215,
0.14730072021484375,
1.0360286235809326,
-0.16894686222076416,
0.2075781226158142,
-0.25073328614234924,
-0.7469627261161804,
0.8845955729484558,
-0.5959469676017761,
-1.244097352027893,
-1.040897250175476,
1.2773991823196411,
... |
func (h HttpHeader) Add(key, value string) {
if _, ok := h[key]; !ok {
h[key] = make([]string, 0)
}
h[key] = append(h[key], value)
} | [
-0.6694130301475525,
-0.4603917598724365,
0.4867761433124542,
-0.45705166459083557,
-0.08595387637615204,
0.3497297465801239,
-1.783398985862732,
-0.0609479621052742,
-0.34357982873916626,
0.5767495632171631,
0.17044588923454285,
0.27207449078559875,
-0.5392727255821228,
0.9514590501785278... |
func (h HttpHeader) Set(key, value string) {
if _, ok := h[key]; ok {
h[key] = nil
}
h[key] = make([]string, 0)
h[key] = append(h[key], value)
} | [
-0.3525506556034088,
-0.08294378966093063,
0.39965492486953735,
-0.787259578704834,
-0.03585785627365112,
-0.13459470868110657,
-1.6616817712783813,
-0.313711017370224,
-0.7601511478424072,
0.8888960480690002,
-0.7556647658348083,
0.3675253391265869,
-0.12156058847904205,
0.707204759120941... |
func (h HttpHeader) Get(key string) string {
if v, ok := h[key]; ok && len(v) > 0 {
return v[0]
}
return ""
} | [
-0.47682222723960876,
-0.08003798127174377,
0.5854111313819885,
-0.05683926120400429,
-0.14826694130897522,
-0.21770446002483368,
-1.5683999061584473,
-0.8121994137763977,
-0.5402365326881409,
0.9005533456802368,
0.44432708621025085,
0.5771616101264954,
-0.7693237662315369,
0.0833296403288... |
func (h HttpHeader) Del(key string) {
if _, ok := h[key]; ok {
delete(h, key)
}
} | [
0.3913985788822174,
-0.09090965241193771,
0.2526152431964874,
0.10505499690771103,
-0.7000356316566467,
0.46820715069770813,
-0.929846465587616,
-0.14354054629802704,
-0.27558478713035583,
0.7992686033248901,
-0.29797470569610596,
0.2390841394662857,
-0.7763296961784363,
0.4474917948246002... |
func (r *Request) Do() *Response {
ch := make(chan *Response, 1)
Deferred{jquery.Ajax(r.makeJqConfig())}.Then(func(r *Response) {
go func() {
ch <- r
}()
})
return <-ch
} | [
-0.3764258921146393,
0.3306615650653839,
0.6605960726737976,
-0.19915276765823364,
-0.15761199593544006,
-0.422793447971344,
-0.34407123923301697,
-1.7483786344528198,
0.017074912786483765,
-0.10243428498506546,
-0.42335429787635803,
0.3940015733242035,
0.2995440661907196,
0.41424250602722... |
func (r *Request) DoSync() (resp *Response) {
conf := r.makeJqConfig()
conf["async"] = false
def := Deferred{jquery.Ajax(conf)}
setResp := func(r *Response) {
resp = r
}
def.Done(setResp)
def.Fail(setResp)
return
} | [
-0.28593766689300537,
0.014502672478556633,
0.6327295899391174,
0.6544106602668762,
-0.03622636944055557,
-0.3439454734325409,
0.34664908051490784,
-1.0808395147323608,
0.3114253878593445,
0.30385905504226685,
-0.054367102682590485,
-0.2057829350233078,
0.6449419856071472,
0.72628843784332... |
func PrepareResource(client client.Client, request reconcile.Request, resource mdbv1.AtlasCustomResource, log *zap.SugaredLogger) workflow.Result {
err := client.Get(context.Background(), request.NamespacedName, resource)
if err != nil {
if apiErrors.IsNotFound(err) {
// Request object not found, could have been... | [
-0.0775723084807396,
-0.624089241027832,
0.6170914173126221,
-0.01704084314405918,
0.38474544882774353,
-0.3505988121032715,
-0.3400890529155731,
0.1325598508119583,
0.9146472811698914,
0.43486371636390686,
0.9972350597381592,
-0.27399346232414246,
0.03801547363400459,
-0.08764009922742844... |
func MarkReconciliationStarted(client client.Client, resource mdbv1.AtlasCustomResource, log *zap.SugaredLogger) *workflow.Context {
updatedConditions := status.EnsureConditionExists(status.FalseCondition(status.ReadyType), resource.GetStatus().GetConditions())
ctx := workflow.NewContext(log, updatedConditions)
sta... | [
0.3796810507774353,
-0.7136277556419373,
0.32163336873054504,
-0.9409773945808411,
0.0297542754560709,
-0.3960151672363281,
0.681153416633606,
1.4449959993362427,
0.501239001750946,
0.22223536670207977,
0.02581871673464775,
0.31997451186180115,
0.16821922361850739,
-0.2158692181110382,
-... |
func ResourceShouldBeLeftInAtlas(resource mdbv1.AtlasCustomResource) bool {
if v, ok := resource.GetAnnotations()[ResourcePolicyAnnotation]; ok {
return v == ResourcePolicyKeep
}
return false
} | [
0.8910024762153625,
-0.664784848690033,
0.321145236492157,
-0.9939812421798706,
-0.2423931211233139,
1.4539541006088257,
-0.43830469250679016,
-0.6458472013473511,
0.7876510620117188,
-0.35718658566474915,
0.2440585345029831,
-0.2630648612976074,
-0.15837152302265167,
0.5128281712532043,
... |
func skykeycmd(cmd *cobra.Command, args []string) {
_ = cmd.UsageFunc()(cmd)
os.Exit(exitCodeUsage)
} | [
-0.33392325043678284,
-0.0994734913110733,
0.511543869972229,
-0.059584151953458786,
0.42638352513313293,
0.34427377581596375,
0.3029709756374359,
0.8892930746078491,
0.012009469792246819,
0.9570649862289429,
-0.07075197249650955,
0.6444650888442993,
-0.24821506440639496,
0.906029522418975... |
func skykeycreatecmd(name string) {
skykeyStr, err := skykeyCreate(httpClient, name, skykeyType)
if err != nil {
die(errors.AddContext(err, "Failed to create new skykey"))
}
fmt.Printf("Created new skykey: %v\n", skykeyStr)
} | [
-0.06558261811733246,
-0.035937387496232986,
0.5547953248023987,
-0.19894129037857056,
0.7772762179374695,
1.1900177001953125,
-0.29750484228134155,
-0.09758048504590988,
0.260324090719223,
0.32101085782051086,
-0.5583410859107971,
0.810849666595459,
-0.17688900232315063,
1.129948258399963... |
func skykeyCreate(c client.Client, name, skykeyTypeString string) (string, error) {
var st skykey.SkykeyType
if skykeyTypeString == "" {
// If no type is provided, default to Private
st = skykey.TypePrivateID
} else {
err := st.FromString(skykeyTypeString)
if err != nil {
return "", errors.AddContext(err,... | [
-0.7677801251411438,
0.6149369478225708,
0.427009254693985,
-0.055700428783893585,
0.007813947275280952,
0.2956196665763855,
-1.1842256784439087,
-0.4236399233341217,
0.5249784588813782,
0.8051722645759583,
-0.5977452993392944,
0.7995589971542358,
-0.8356235027313232,
0.6403857469558716,
... |
func skykeyaddcmd(skykeyString string) {
err := skykeyAdd(httpClient, skykeyString)
if err != nil && strings.Contains(err.Error(), skykey.ErrSkykeyWithNameAlreadyExists.Error()) {
die("Skykey name already used. Try using the --rename-as parameter with a different name.")
}
if err != nil {
die(errors.AddContext(... | [
0.047217320650815964,
0.3653647005558014,
0.9336593151092529,
-0.1101287379860878,
0.21376760303974152,
0.6087476015090942,
-0.5527656078338623,
-0.06744236499071121,
1.0034362077713013,
0.5862715840339661,
0.057797715067863464,
0.903639554977417,
-0.23926757276058197,
1.182891607284546,
... |
func skykeyAdd(c client.Client, skykeyString string) error {
var sk skykey.Skykey
err := sk.FromString(skykeyString)
if err != nil {
return errors.AddContext(err, "Could not decode skykey string")
}
// Rename the skykey if the --rename-as flag was provided.
if skykeyRenameAs != "" {
sk.Name = skykeyRenameAs
... | [
-0.38805004954338074,
0.5989571809768677,
0.5122950077056885,
-0.0062444210052490234,
-0.03829526528716087,
0.3603743016719818,
-0.7717363238334656,
0.4582849144935608,
1.154579520225525,
0.7620151042938232,
-0.3672439157962799,
1.16683828830719,
-0.6191942691802979,
0.726911187171936,
0... |
func skykeydeleteidcmd(id string) {
var skykeyID skykey.SkykeyID
err := skykeyID.FromString(id)
if err != nil {
die(errors.AddContext(err, "could not decode skykey ID"))
}
err = httpClient.SkykeyDeleteByIDPost(skykeyID)
if err != nil {
die(err)
}
fmt.Println("Skykey Deleted!")
} | [
0.11565438657999039,
-0.33145996928215027,
0.5576017498970032,
-0.02695450745522976,
0.5245747566223145,
0.8121052384376526,
-0.6099802851676941,
0.782421886920929,
1.1812759637832642,
0.43224355578422546,
-0.44484764337539673,
1.0789703130722046,
-0.7792212963104248,
0.8099883198738098,
... |
func skykeydeletenamecmd(name string) {
err := httpClient.SkykeyDeleteByNamePost(name)
if err != nil {
die(err)
}
fmt.Println("Skykey Deleted!")
} | [
0.13125547766685486,
-0.38624733686447144,
0.6751686334609985,
0.052561040967702866,
-0.1357036679983139,
0.5488972663879395,
-0.5992521643638611,
0.30819717049598694,
0.4648801386356354,
0.9499586224555969,
-0.72925865650177,
0.6674945950508118,
-0.44145897030830383,
0.9692252278327942,
... |
func skykeygetcmd() {
skykeyStr, err := skykeyGet(httpClient, skykeyName, skykeyID)
if err != nil {
die(err)
}
fmt.Printf("Found skykey: %v\n", skykeyStr)
} | [
-0.08896225690841675,
-0.27483898401260376,
0.6220975518226624,
-0.05662224814295769,
0.5791263580322266,
0.43113890290260315,
-0.8444478511810303,
0.4245043396949768,
-0.12464417517185211,
-0.0398995466530323,
0.35408148169517517,
1.77470064163208,
-0.3459439277648926,
0.6066722273826599,... |
func skykeyGet(c client.Client, name, id string) (string, error) {
err := validateSkyKeyNameAndIDUsage(name, id)
if err != nil {
return "", errors.AddContext(err, "cannot validate skykey name and ID usage to get skykey")
}
var sk skykey.Skykey
if name != "" {
sk, err = c.SkykeyGetByName(name)
} else {
var ... | [
-0.8877302408218384,
0.13282398879528046,
0.6113473773002625,
-0.33080247044563293,
-0.2783665359020233,
-0.6464500427246094,
-1.4079113006591797,
0.05181457847356796,
0.17733141779899597,
0.6556399464607239,
-0.015862930566072464,
1.2377159595489502,
-0.29918673634529114,
0.32508075237274... |
func skykeygetidcmd(skykeyName string) {
sk, err := httpClient.SkykeyGetByName(skykeyName)
if err != nil {
die("Failed to retrieve skykey:", err)
}
fmt.Printf("Found skykey ID: %v\n", sk.ID().ToString())
} | [
0.10474415123462677,
-0.2691095471382141,
0.6773873567581177,
-0.14686395227909088,
0.615869402885437,
0.5411797761917114,
-0.20137210190296173,
0.3640967309474945,
0.6365532279014587,
-0.021276075392961502,
-0.5425843000411987,
1.4549776315689087,
-0.9110602736473083,
0.6311034560203552,
... |
func skykeylistcmd() {
skykeysString, err := skykeyListKeys(httpClient, skykeyShowPrivateKeys)
if err != nil {
die("Failed to get all skykeys:", err)
}
fmt.Print(skykeysString)
} | [
-0.24777492880821228,
-0.11898022145032883,
0.517227053642273,
-0.08869867771863937,
-0.19766518473625183,
0.39322784543037415,
-1.2248649597167969,
0.7754254937171936,
1.1414062976837158,
0.7458053231239319,
-0.7954452037811279,
2.0803122520446777,
-0.1675768345594406,
0.7853205800056458,... |
func skykeyListKeys(c client.Client, showPrivateKeys bool) (string, error) {
skykeys, err := c.SkykeySkykeysGet()
if err != nil {
return "", err
}
var b strings.Builder
w := tabwriter.NewWriter(&b, 0, 0, 2, ' ', 0)
// Print a title row.
if showPrivateKeys {
fmt.Fprintf(w, "ID\tName\tType\tFull Skykey\n")
... | [
-0.8327429294586182,
-0.05955902859568596,
0.8485210537910461,
-0.5530267357826233,
-0.4733999967575073,
-0.1261931210756302,
-1.1177821159362793,
-0.4275952875614166,
0.3322306275367737,
1.3012380599975586,
-0.8379837870597839,
1.4484046697616577,
-0.18994487822055817,
0.5477160215377808,... |
func (s *scanner) Scan() *token.Token {
if s.cur >= len(s.toks) {
return eof
}
tok := s.toks[s.cur]
s.cur++
var typ token.Type
switch tok.Kind {
case uctoken.EOF:
typ = token.TokMap.Type("$")
case uctoken.Error:
typ = token.TokMap.Type("INVALID")
case uctoken.Comment:
// Skip comments.
return s.Scan(... | [
-0.7443090081214905,
-0.5401663780212402,
0.6872698664665222,
-0.19701533019542694,
-1.0364136695861816,
-0.3222070634365082,
0.028691422194242477,
0.488191694021225,
-0.36130422353744507,
-0.9132711887359619,
0.02418164536356926,
0.41309818625450134,
0.24020376801490784,
-0.50282365083694... |
func New(r io.Reader) (Scanner, error) {
toks, err := lexer.Parse(r)
if err != nil {
return nil, err
}
return &scanner{toks: toks}, nil
} | [
-0.18141433596611023,
-1.0360522270202637,
0.3961524963378906,
-0.2475152462720871,
-1.5710818767547607,
-0.6370469927787781,
-0.8771535754203796,
0.22370758652687073,
-0.22691597044467926,
-0.9804239869117737,
0.35317540168762207,
-0.5409058332443237,
0.033595699816942215,
0.5065607428550... |
func Open(path string) (Scanner, error) {
toks, err := lexer.ParseFile(path)
if err != nil {
return nil, err
}
return &scanner{toks: toks}, nil
} | [
-0.4132905602455139,
-0.3972167670726776,
0.4755953550338745,
-0.5683757662773132,
-1.688879370689392,
0.42400312423706055,
-0.1314108520746231,
1.062644600868225,
-0.3970862627029419,
-0.8747761249542236,
0.10145927965641022,
-0.20406687259674072,
-0.7945092916488647,
-0.13531160354614258... |
func NewFromString(input string) Scanner {
toks := lexer.ParseString(input)
return &scanner{toks: toks}
} | [
0.40956687927246094,
-1.3555355072021484,
0.1848324090242386,
-0.396268755197525,
-1.603816032409668,
-0.33883365988731384,
-1.2465245723724365,
0.06788564473390579,
0.05988933518528938,
-1.1089649200439453,
0.22491340339183807,
0.06658583134412766,
-0.2835705876350403,
-0.3790523707866668... |
func NewFromBytes(input []byte) Scanner {
toks := lexer.ParseString(string(input))
return &scanner{toks: toks}
} | [
0.2409406453371048,
-1.1383533477783203,
0.18832765519618988,
-0.8285881876945496,
-1.5299102067947388,
-0.34527307748794556,
-1.219466209411621,
0.5053583979606628,
0.6411367058753967,
-1.0853790044784546,
0.17546500265598297,
-0.07687688618898392,
-0.5765686631202698,
-0.3729231059551239... |
func GetBook(d *dao.Dao, tx *sql3.Tx, ctx context.Context) (result *Book, metadata *db.Metatada, err error) {
var (
args []interface{}
)
var querySql string
querySql, args = sql.Build(
"select * from book where ",
args,
sql.BuildConditions(sql.Condition{"id", "=", 1, "AND"}),
)
var results db.Results
va... | [
-0.6721641421318054,
0.8474040627479553,
0.6512386202812195,
1.3910315036773682,
0.08550679683685303,
0.1461399644613266,
-0.001423406065441668,
0.16548208892345428,
-0.5086802244186401,
0.05220837891101837,
0.8943362832069397,
-0.06761769950389862,
-0.3383960723876953,
0.1795366406440735,... |
func UpdateBook(d *dao.Dao, tx *sql3.Tx, ctx context.Context, name string) (result sql2.Result, err error) {
var (
args []interface{}
)
var updateSql string
updateSql, args = sql.Build(
"update book set name=? where ",
args,
sql.BuildConditions(sql.Condition{"id", "=", 1, "AND"}),
)
args = append([]inter... | [
-1.7586740255355835,
-0.706731915473938,
0.6242302060127258,
0.6851329207420349,
-1.3900409936904907,
0.3168213665485382,
-0.30255722999572754,
-0.04904978349804878,
-0.752329409122467,
1.1862813234329224,
-0.43043962121009827,
-0.3289889693260193,
-1.028870940208435,
0.39262306690216064,
... |
func CreateBook(d *dao.Dao, tx *sql3.Tx, ctx context.Context, name string) (result sql2.Result, err error) {
result, err = d.Db.ExecTx(ctx, tx, "insert book(id,name) value(?,?)", 1, name)
return
} | [
-0.8138453960418701,
0.21708950400352478,
0.7468782663345337,
0.34749487042427063,
-0.21895542740821838,
1.0641076564788818,
-0.3123325705528259,
-0.2994941771030426,
-0.6542400121688843,
0.6954282522201538,
-0.5798723697662354,
-0.901820182800293,
-1.0720051527023315,
0.1360754519701004,
... |
func (fp *FastPaxos) Run(isRunFastPathManager bool) {
fp.runLock.Lock()
defer fp.runLock.Unlock()
if fp.isRun {
return
}
fp.isRun = true
// Starts log manager
fp.lm.Run(fp.execCh)
// Starts command channel
go fp.startCmdCh()
// Starts scheduler
go fp.scheduler.Run()
// Learners starts the fast-path ma... | [
0.40747928619384766,
-0.5243744254112244,
0.5941389203071594,
0.7168861627578735,
0.10165403038263321,
0.23102252185344696,
0.14988617599010468,
0.4618947505950928,
0.14951719343662262,
-1.4113686084747314,
-0.09718837589025497,
-0.19077661633491516,
-0.1577478051185608,
0.6844702959060669... |
func (fp *FastPaxos) LeaderVote(vote *Vote) (*common.Future, *common.Future) {
return fp.fpManager.LeaderVote(vote)
} | [
0.3216550350189209,
0.2147921621799469,
0.31495851278305054,
0.2648259401321411,
-0.408683717250824,
0.15924984216690063,
-0.9880470037460327,
-0.2615056037902832,
-0.004321157932281494,
-1.065662145614624,
-0.46763482689857483,
0.1393067091703415,
-0.2762001156806946,
0.03206188604235649,... |
func GetTranslation(currency Code) Code {
val, ok := translations[currency.Item]
if !ok {
return currency
}
return val
} | [
-0.2788929045200348,
1.0695232152938843,
0.25525426864624023,
0.41869422793388367,
0.6701781749725342,
-1.6029199361801147,
0.05546589940786362,
-0.25423550605773926,
0.21398985385894775,
0.8234543204307556,
-1.0833218097686768,
-1.0856379270553589,
-0.3531835377216339,
-0.9588156938552856... |
func testMetrics(expected map[string]int, m *Metrics) error {
e := &firstErr{}
for name, cnt := range expected {
switch name {
case "incoming":
e.testCounter(m.Incoming, name, cnt)
case "fragments":
e.testCounter(m.Fragments, name, cnt)
case "defrag":
e.testCounter(m.Defrag, name, cnt)
case "invali... | [
-0.399624228477478,
0.2168251872062683,
0.7596390843391418,
-1.0382767915725708,
0.055875759571790695,
0.5709810853004456,
0.3459775745868683,
-0.2046073079109192,
-0.7184946537017822,
-0.3683377504348755,
0.3022623658180237,
-0.3774453103542328,
-0.37058666348457336,
0.24474522471427917,
... |
func (font PdfFont) GetFontDescriptor() (*PdfFontDescriptor, error) {
return font.context.getFontDescriptor(), nil
} | [
0.962761402130127,
-0.20540644228458405,
0.3438853323459625,
-0.36897748708724976,
0.24122127890586853,
-0.47801193594932556,
-0.48914211988449097,
-0.29562145471572876,
-0.0446612648665905,
-1.1374759674072266,
0.340362012386322,
0.5620009899139404,
-0.16206417977809906,
-0.07577169686555... |
func (font *PdfFont) String() string {
enc := ""
if font.context.Encoder() != nil {
enc = font.context.Encoder().String()
}
return fmt.Sprintf("FONT{%T %s %s}", font.context, font.baseFields().coreString(), enc)
} | [
0.2468765527009964,
-1.324561357498169,
0.18602120876312256,
-0.8751175999641418,
-0.35486477613449097,
-0.49910613894462585,
0.35546785593032837,
-1.2796638011932373,
0.4007207155227661,
-0.4302119016647339,
0.022272128611803055,
1.0652318000793457,
-0.27825793623924255,
-0.50007057189941... |
func (font *PdfFont) BaseFont() string {
return font.baseFields().basefont
} | [
1.0316413640975952,
-1.4294809103012085,
0.09041742235422134,
-0.8733994960784912,
0.2932409644126892,
0.2110288292169571,
0.06114267557859421,
-0.013317981734871864,
0.050335075706243515,
-0.952544093132019,
0.00372716155834496,
0.4312015473842621,
-0.5795007944107056,
-0.8241055607795715... |
func (font *PdfFont) Subtype() string {
subtype := font.baseFields().subtype
if t, ok := font.context.(*pdfFontType0); ok {
subtype = subtype + ":" + t.DescendantFont.Subtype()
}
return subtype
} | [
1.1956568956375122,
-0.2921667993068695,
0.3311437666416168,
-0.12312258034944534,
0.45858874917030334,
-0.009302503429353237,
-0.0362580269575119,
0.2911928594112396,
0.9799818396568298,
-0.21787498891353607,
-0.24637991189956665,
0.7555803060531616,
-0.057699963450431824,
-0.448382616043... |
func (font *PdfFont) IsCID() bool {
return font.baseFields().isCIDFont()
} | [
0.7463055849075317,
-1.4558801651000977,
0.23126056790351868,
-0.4065626263618469,
0.3960973024368286,
0.37750035524368286,
-0.3907153606414795,
0.17060939967632294,
0.32959580421447754,
0.1290990710258484,
-0.34745854139328003,
0.18396541476249695,
-1.1439735889434814,
0.07775196433067322... |
func (font *PdfFont) FontDescriptor() *PdfFontDescriptor {
if font.baseFields().fontDescriptor != nil {
return font.baseFields().fontDescriptor
}
if d := font.context.getFontDescriptor(); d != nil {
return d
}
common.Log.Error("All fonts have a Descriptor. font=%s", font)
return nil
} | [
0.9362838864326477,
-0.2535320818424225,
0.41713884472846985,
-0.46630269289016724,
-0.23510846495628357,
-0.6056910753250122,
-0.22567181289196014,
-0.11357695609331131,
0.5376736521720886,
-1.0116500854492188,
0.4989834129810333,
0.2976674437522888,
0.08348508179187775,
0.608819723129272... |
func (font *PdfFont) ToUnicode() string {
if font.baseFields().toUnicodeCmap == nil {
return ""
}
return font.baseFields().toUnicodeCmap.Name()
} | [
-0.0778065025806427,
-0.8305924534797668,
0.6611180305480957,
-0.7250608801841736,
0.15211041271686554,
-0.4099176824092865,
0.13733868300914764,
0.11406602710485458,
0.5925893783569336,
0.419630229473114,
-0.5765405893325806,
-0.16167417168617249,
0.06417800486087799,
-0.5490259528160095,... |
func DefaultFont() *PdfFont {
helvetica, ok := fonts.NewStdFontByName(HelveticaName)
if !ok {
panic("Helvetica should always be available")
}
std := stdFontToSimpleFont(helvetica)
return &PdfFont{context: &std}
} | [
1.019248604774475,
-0.432405561208725,
0.2302541434764862,
-0.21777038276195526,
0.17868371307849884,
-0.24549700319766998,
-0.33409106731414795,
0.5908228158950806,
0.5616311430931091,
-0.8380096554756165,
-0.3967261016368866,
-0.005889133084565401,
-0.22447308897972107,
-0.48162385821342... |
func NewStandard14Font(basefont StdFontName) (*PdfFont, error) {
std, err := newStandard14Font(basefont)
if err != nil {
return nil, err
}
if basefont != SymbolName && basefont != ZapfDingbatsName {
// Default to using WinAnsiEncoder for text generation as it spans a large number of symbols.
std.encoder = te... | [
0.07419654726982117,
-1.04083251953125,
0.12518668174743652,
0.2714102268218994,
-1.2218202352523804,
-0.7268573045730591,
-0.29876384139060974,
0.2651524841785431,
-0.20902353525161743,
-0.6914944052696228,
-0.46807053685188293,
0.552678108215332,
-0.3951258361339569,
-0.04355622082948685... |
func NewStandard14FontMustCompile(basefont StdFontName) *PdfFont {
font, err := NewStandard14Font(basefont)
if err != nil {
panic(fmt.Errorf("invalid Standard14Font %#q", basefont))
}
return font
} | [
-0.6210797429084778,
-1.2042503356933594,
0.2542952001094818,
-0.08927581459283829,
-1.2050268650054932,
-0.45869380235671997,
-0.7651498317718506,
0.43349137902259827,
-0.24767039716243744,
-0.6847345232963562,
-0.25486281514167786,
0.043623439967632294,
-0.6685430407524109,
0.18085376918... |
func NewStandard14FontWithEncoding(basefont StdFontName, alphabet map[rune]int) (*PdfFont,
textencoding.SimpleEncoder, error) {
std, err := newStandard14Font(basefont)
if err != nil {
return nil, nil, err
}
enc, ok := std.Encoder().(textencoding.SimpleEncoder)
if !ok {
return nil, nil, fmt.Errorf("only simple... | [
0.1927483230829239,
-0.4359787702560425,
0.6225252151489258,
-0.5052139163017273,
-0.5780901908874512,
-1.022874116897583,
-0.07514912635087967,
0.3166253864765167,
0.13130392134189606,
0.0470876470208168,
-0.5963908433914185,
0.0014455997152253985,
-0.5029014945030212,
0.197069451212883,
... |
func GetAlphabet(text string) map[rune]int {
alphabet := map[rune]int{}
for _, r := range text {
alphabet[r]++
}
return alphabet
} | [
-0.5453668236732483,
-0.7705633640289307,
0.44283178448677063,
-0.8979060053825378,
-0.5717101097106934,
0.2741367816925049,
0.5369609594345093,
-0.5983583331108093,
-0.6752309203147888,
0.06099821254611015,
-0.7142459750175476,
0.27039045095443726,
-0.0403989814221859,
0.23328889906406403... |
func NewPdfFontFromPdfObject(fontObj core.PdfObject) (*PdfFont, error) {
return newPdfFontFromPdfObject(fontObj, true)
} | [
0.20085570216178894,
-0.7764620780944824,
0.19971923530101776,
0.1829742044210434,
-0.9615825414657593,
-0.4558011293411255,
0.19870969653129578,
-0.6147103309631348,
0.6342589259147644,
-0.9797780513763428,
-0.9495708346366882,
-0.22985641658306122,
-0.2458595484495163,
-0.229273766279220... |
func newPdfFontFromPdfObject(fontObj core.PdfObject, allowType0 bool) (*PdfFont, error) {
d, base, err := newFontBaseFieldsFromPdfObject(fontObj)
if err != nil {
// In the case of not yet supported fonts, we attempt to return enough information in the
// font for the caller to see some font properties.
// TODO(... | [
0.2527430057525635,
-0.651873767375946,
0.6823892593383789,
-0.0632755383849144,
-0.9493080377578735,
-0.3587092459201813,
0.5630712509155273,
-0.5780472159385681,
0.5198701024055481,
-0.11077284812927246,
-0.28401893377304077,
-0.003659250447526574,
-0.5530230402946472,
-0.013093696907162... |
func (font *PdfFont) BytesToCharcodes(data []byte) []textencoding.CharCode {
common.Log.Trace("BytesToCharcodes: data=[% 02x]=%#q", data, data)
charcodes := make([]textencoding.CharCode, 0, len(data)+len(data)%2)
if font.baseFields().isCIDFont() {
if len(data) == 1 {
data = []byte{0, data[0]}
}
if len(data)... | [
-0.44827502965927124,
-0.4351292848587036,
0.4591611921787262,
-0.8352298140525818,
0.5802596807479858,
-0.8838275671005249,
-0.3726922571659088,
0.013308373279869556,
0.5220032334327698,
0.3439004421234131,
-1.0489284992218018,
-0.01652776636183262,
-0.8737010359764099,
0.3460460007190704... |
func (font *PdfFont) CharcodesToUnicode(charcodes []textencoding.CharCode) []rune {
strlist, _, _ := font.CharcodesToUnicodeWithStats(charcodes)
return strlist
} | [
-0.7514652609825134,
-0.4318235516548157,
0.5193643569946289,
-0.8866102695465088,
0.11058138310909271,
-0.9867980480194092,
-0.8825701475143433,
0.9305883646011353,
0.07526972889900208,
0.6088073253631592,
-0.6308145523071289,
0.6149371266365051,
-0.4644540846347809,
-0.574920117855072,
... |
func (font *PdfFont) CharcodesToUnicodeWithStats(charcodes []textencoding.CharCode) (runelist []rune, numHits, numMisses int) {
runes := make([]rune, 0, len(charcodes))
numMisses = 0
for _, code := range charcodes {
if font.baseFields().toUnicodeCmap != nil {
r, ok := font.baseFields().toUnicodeCmap.CharcodeToU... | [
-0.6435600519180298,
0.2055610865354538,
0.6124880313873291,
-0.8817899823188782,
0.34774377942085266,
-1.1818268299102783,
0.28787580132484436,
0.2293141484260559,
0.059543926268815994,
0.10557176172733307,
-0.6227992177009583,
-0.023777427151799202,
-0.28090137243270874,
0.16188436746597... |
func (font *PdfFont) ToPdfObject() core.PdfObject {
if font.context == nil {
common.Log.Debug("ERROR: font context is nil")
return core.MakeNull()
}
return font.context.ToPdfObject()
} | [
0.4763517677783966,
-0.9682345390319824,
0.7573583722114563,
-1.1485919952392578,
-0.5092089772224426,
-0.5746523141860962,
0.29973429441452026,
-0.6039329767227173,
0.7847370505332947,
-0.8756815791130066,
0.026724470779299736,
0.5452582240104675,
-0.08321884274482727,
-0.5529840588569641... |
func (font *PdfFont) Encoder() textencoding.TextEncoder {
t := font.actualFont()
if t == nil {
common.Log.Debug("ERROR: Encoder not implemented for font type=%#T", font.context)
// TODO: Should we return a default encoding?
return nil
}
return t.Encoder()
} | [
0.32685768604278564,
-1.069661021232605,
-0.07078038901090622,
-0.1268368661403656,
-1.0953463315963745,
-0.47605958580970764,
-0.4224604368209839,
-0.054912131279706955,
0.5975667238235474,
-0.27476605772972107,
0.7356657385826111,
-0.4687623977661133,
-0.3234745264053345,
0.4004741311073... |
func (font *PdfFont) GetRuneMetrics(r rune) (CharMetrics, bool) {
t := font.actualFont()
if t == nil {
common.Log.Debug("ERROR: GetGlyphCharMetrics Not implemented for font type=%#T", font.context)
return fonts.CharMetrics{}, false
}
if m, ok := t.GetRuneMetrics(r); ok {
return m, true
}
if desc, err := fon... | [
-0.6211755871772766,
0.6699979305267334,
0.8339314460754395,
-1.2882956266403198,
0.21083121001720428,
-0.26474860310554504,
0.0542541928589344,
-0.8213024139404297,
0.06563088297843933,
-0.03844549506902695,
0.004928592126816511,
0.3524530529975891,
-0.9645985960960388,
0.3778326213359833... |
func (font PdfFont) actualFont() pdfFont {
if font.context == nil {
common.Log.Debug("ERROR: actualFont. context is nil. font=%s", font)
}
return font.context
} | [
0.12651780247688293,
-0.9666590094566345,
0.2526540458202362,
-0.9495166540145874,
0.08818119764328003,
-0.5379558801651001,
0.27738091349601746,
-0.07602973282337189,
0.9332881569862366,
-0.019728608429431915,
0.43349140882492065,
0.4578886032104492,
-0.13524273037910461,
-0.0706864446401... |
func (font *PdfFont) baseFields() *fontCommon {
if font.context == nil {
common.Log.Debug("ERROR: baseFields. context is nil.")
return nil
}
return font.context.baseFields()
} | [
0.5732026696205139,
-0.6321479082107544,
0.429603636264801,
-0.5812024474143982,
0.36266812682151794,
0.19786407053470612,
0.20944549143314362,
-0.5360314846038818,
0.6322672367095947,
-0.14871548116207123,
-0.6618812084197998,
-0.01065441220998764,
-1.4113749265670776,
-0.9424585700035095... |
func (base fontCommon) asPdfObjectDictionary(subtype string) *core.PdfObjectDictionary {
if subtype != "" && base.subtype != "" && subtype != base.subtype {
common.Log.Debug("ERROR: asPdfObjectDictionary. Overriding subtype to %#q %s", subtype, base)
} else if subtype == "" && base.subtype == "" {
common.Log.Deb... | [
-0.4267457127571106,
-0.0007785465568304062,
0.7933979630470276,
-0.8283339142799377,
-0.7353763580322266,
-0.2640649378299713,
0.3550257384777069,
-0.5801998376846313,
-0.2475133240222931,
-0.23662801086902618,
-0.5821034908294678,
0.3554343283176422,
-0.18817637860774994,
0.6807007789611... |
func (base fontCommon) String() string {
return fmt.Sprintf("FONT{%s}", base.coreString())
} | [
0.5336300134658813,
-0.3558759391307831,
0.26948413252830505,
-0.553104817867279,
-0.3807089626789093,
0.4182227551937103,
0.9862207174301147,
-1.0817053318023682,
-0.07807953655719757,
0.0173468180000782,
-0.047589197754859924,
0.687677264213562,
-0.6367447376251221,
-0.019070109352469444... |
func (base fontCommon) isCIDFont() bool {
if base.subtype == "" {
common.Log.Debug("ERROR: isCIDFont. context is nil. font=%s", base)
}
isCID := false
switch base.subtype {
case "Type0", "CIDFontType0", "CIDFontType2":
isCID = true
}
common.Log.Trace("isCIDFont: isCID=%t font=%s", isCID, base)
return isCID
... | [
0.41771966218948364,
-0.2691604197025299,
0.49180424213409424,
-0.23191313445568085,
0.44033393263816833,
0.13626128435134888,
0.20490270853042603,
-0.33159124851226807,
0.22722619771957397,
0.23227638006210327,
-0.6976550817489624,
0.24534954130649567,
-1.897019863128662,
0.30020794272422... |
func newFontBaseFieldsFromPdfObject(fontObj core.PdfObject) (*core.PdfObjectDictionary, *fontCommon,
error) {
font := &fontCommon{}
if obj, ok := fontObj.(*core.PdfIndirectObject); ok {
font.objectNumber = obj.ObjectNumber
}
d, ok := core.GetDict(fontObj)
if !ok {
common.Log.Debug("ERROR: Font not given by ... | [
-0.4356483221054077,
-0.8259490728378296,
0.8142811059951782,
-0.22754572331905365,
-0.3011334240436554,
0.04844164103269577,
0.5355947613716125,
-0.49213147163391113,
-0.0938170850276947,
0.0756121501326561,
-1.0631155967712402,
-0.15144029259681702,
-0.4175582528114319,
0.125742509961128... |
func toUnicodeToCmap(toUnicode core.PdfObject, font *fontCommon) (*cmap.CMap, error) {
toUnicodeStream, ok := core.GetStream(toUnicode)
if !ok {
common.Log.Debug("ERROR: toUnicodeToCmap: Not a stream (%T)", toUnicode)
return nil, core.ErrTypeError
}
data, err := core.DecodeStream(toUnicodeStream)
if err != nil... | [
-0.7989447712898254,
-0.7782890796661377,
0.5272843837738037,
-0.6554832458496094,
-0.4028305411338806,
-0.7872120141983032,
0.6270062327384949,
-0.27771973609924316,
1.128408432006836,
0.15622469782829285,
-0.6140751242637634,
0.46693602204322815,
-0.5601003170013428,
-0.24447713792324066... |
func (desc *PdfFontDescriptor) GetDescent() (float64, error) {
return core.GetNumberAsFloat(desc.Descent)
} | [
0.5536213517189026,
0.5915226936340332,
0.5909140706062317,
0.26489219069480896,
0.6472955942153931,
-0.6262405514717102,
0.1948891580104828,
-0.699589192867279,
-0.9871714115142822,
-1.394047737121582,
0.021278485655784607,
0.6176658272743225,
-0.5210958123207092,
0.6981803178787231,
0.... |
func (desc *PdfFontDescriptor) GetAscent() (float64, error) {
return core.GetNumberAsFloat(desc.Ascent)
} | [
0.7689887285232544,
-0.48086267709732056,
0.5454134345054626,
-0.36517834663391113,
0.2110925167798996,
-0.7349763512611389,
0.18313638865947723,
-1.0248357057571411,
-0.9737021923065186,
-0.2959417700767517,
0.3793394863605499,
0.7827932238578796,
-0.3054284155368805,
0.6712979674339294,
... |
func (desc *PdfFontDescriptor) GetCapHeight() (float64, error) {
return core.GetNumberAsFloat(desc.CapHeight)
} | [
0.3311088979244232,
0.15955913066864014,
0.6050758361816406,
0.5876821279525757,
-0.12476815283298492,
-0.19616369903087616,
0.6664832234382629,
-0.5950046181678772,
-0.6647666096687317,
-0.1258181929588318,
-0.239981010556221,
0.4048033654689789,
0.04564444720745087,
0.19851084053516388,
... |
func (desc *PdfFontDescriptor) String() string {
var parts []string
if desc.FontName != nil {
parts = append(parts, desc.FontName.String())
}
if desc.FontFamily != nil {
parts = append(parts, desc.FontFamily.String())
}
if desc.fontFile != nil {
parts = append(parts, desc.fontFile.String())
}
if desc.font... | [
0.9248418807983398,
-0.6111893653869629,
0.5051243901252747,
-1.2848049402236938,
-0.27778035402297974,
-0.150875523686409,
-0.021985525265336037,
-0.5601428151130676,
-0.4744791090488434,
-0.16164454817771912,
0.4210156500339508,
0.793495774269104,
0.2517111003398895,
0.150074303150177,
... |
func newPdfFontDescriptorFromPdfObject(obj core.PdfObject) (*PdfFontDescriptor, error) {
descriptor := &PdfFontDescriptor{}
obj = core.ResolveReference(obj)
if ind, is := obj.(*core.PdfIndirectObject); is {
descriptor.container = ind
obj = ind.PdfObject
}
d, ok := core.GetDict(obj)
if !ok {
common.Log.Deb... | [
0.3119536340236664,
-0.7390598058700562,
0.5215499401092529,
-0.9466278553009033,
-0.6371868252754211,
-0.19133658707141876,
-0.004724852740764618,
-0.5422824621200562,
-0.07339665293693542,
-0.04596595838665962,
0.05707550048828125,
0.02635946124792099,
0.3073734641075134,
0.3748843073844... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.