Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 11 for read_source (0.24 sec)

  1. scripts/mkdocs_hooks.py

                if isinstance(first_child, Page):
                    if first_child.file.src_path.endswith("index.md"):
                        # Read the source so that the title is parsed and available
                        first_child.read_source(config=config)
                        new_title = first_child.title or new_title
                # Creating a new section makes it render it collapsed by default
                # no idea why, so, let's just modify the existing one
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Tue Oct 24 20:26:06 UTC 2023
    - 5.1K bytes
    - Viewed (0)
  2. src/go/parser/interface.go

    	"errors"
    	"go/ast"
    	"go/token"
    	"io"
    	"io/fs"
    	"os"
    	"path/filepath"
    	"strings"
    )
    
    // If src != nil, readSource converts src to a []byte if possible;
    // otherwise it returns an error. If src == nil, readSource returns
    // the result of reading the file specified by filename.
    func readSource(filename string, src any) ([]byte, error) {
    	if src != nil {
    		switch s := src.(type) {
    		case string:
    			return []byte(s), nil
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 12:02:03 UTC 2023
    - 7.5K bytes
    - Viewed (0)
  3. istioctl/pkg/analyze/analyze.go

    		}
    	}
    	return readers, nil
    }
    
    func gatherFile(f string) (local.ReaderSource, error) {
    	r, err := os.Open(f)
    	if err != nil {
    		return local.ReaderSource{}, err
    	}
    	runtime.SetFinalizer(r, func(x *os.File) {
    		err = x.Close()
    		if err != nil {
    			log.Infof("file : %s is not closed: %v", f, err)
    		}
    	})
    	return local.ReaderSource{Name: f, Reader: r}, nil
    }
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue Apr 02 08:32:06 UTC 2024
    - 17K bytes
    - Viewed (0)
  4. tests/fuzz/analyzer_fuzzer.go

    		return "nofile", err
    	}
    	return tmpfile.Name(), nil
    }
    
    // createRandomConfigFiles creates a slice of ReaderSources
    func createRandomConfigFiles(f *fuzz.ConsumeFuzzer) ([]local.ReaderSource, error) {
    	var files []local.ReaderSource
    
    	numberOfFiles, err := f.GetInt()
    	if err != nil {
    		return files, err
    	}
    	maxFiles := numberOfFiles % 10
    
    	// Gather test files
    	for i := 0; i < maxFiles; i++ {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue May 23 17:08:31 UTC 2023
    - 4.1K bytes
    - Viewed (0)
  5. pkg/config/analysis/local/istiod_analyze.go

    func (sa *IstiodAnalyzer) AddTestReaderKubeSource(readers []ReaderSource) error {
    	return sa.addReaderKubeSourceInternal(readers, true)
    }
    
    // AddReaderKubeSource adds a source based on the specified k8s yaml files to the current IstiodAnalyzer
    func (sa *IstiodAnalyzer) AddReaderKubeSource(readers []ReaderSource) error {
    	return sa.addReaderKubeSourceInternal(readers, false)
    }
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue Apr 02 21:06:13 UTC 2024
    - 21.6K bytes
    - Viewed (0)
  6. tensorflow/compiler/mlir/tensorflow/tests/localize_var_handles.mlir

        return
      }
    }
    
    // -----
    
    // CHECK-LABEL: module
    module attributes {tf_saved_model.semantics} {
      // CHECK-LABEL: @read_resource
      func.func private @read_resource(%arg0: tensor<!tf_type.resource<tensor<10xf32>>>) -> tensor<10xf32> {
        // CHECK: [[name:%.*]] = "tf.VarHandleOp"
        // CHECK: "tf.ReadVariableOp"([[name]]
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed Aug 23 21:12:02 UTC 2023
    - 10.3K bytes
    - Viewed (0)
  7. pkg/config/analysis/local/analyze_test.go

    	g := NewWithT(t)
    
    	sa := NewSourceAnalyzer(blankCombinedAnalyzer, "", "", nil)
    
    	tmpfile := tempFileFromString(t, YamlN1I1V1)
    	defer os.Remove(tmpfile.Name())
    
    	err := sa.AddReaderKubeSource([]ReaderSource{{Reader: tmpfile}})
    	g.Expect(err).To(BeNil())
    	assert.Equal(t, sa.meshCfg, mesh.DefaultMeshConfig()) // Base default meshcfg
    	g.Expect(sa.stores).To(HaveLen(0))
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue Jan 09 07:43:43 UTC 2024
    - 9.6K bytes
    - Viewed (0)
  8. operator/pkg/helmreconciler/reconciler.go

    		objYAML, err := object.NewK8sObject(&obj, nil, nil).YAML()
    		if err != nil {
    			return err
    		}
    		whReaderSource := local.ReaderSource{
    			Name:   fmt.Sprintf("in-cluster-webhook-%d", i),
    			Reader: strings.NewReader(string(objYAML)),
    		}
    		err = sa.AddReaderKubeSource([]local.ReaderSource{whReaderSource})
    		if err != nil {
    			return err
    		}
    	}
    
    	err = sa.AddReaderKubeSource(localWebhookYAMLReaders)
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Feb 22 08:32:23 UTC 2024
    - 22K bytes
    - Viewed (0)
  9. src/go/parser/error_test.go

    			t.Errorf("%s: %s\n", fset.Position(pos), msg)
    		}
    	}
    }
    
    func checkErrors(t *testing.T, filename string, input any, mode Mode, expectErrors bool) {
    	t.Helper()
    	src, err := readSource(filename, input)
    	if err != nil {
    		t.Error(err)
    		return
    	}
    
    	fset := token.NewFileSet()
    	_, err = ParseFile(fset, filename, src, mode)
    	found, ok := err.(scanner.ErrorList)
    	if err != nil && !ok {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 27 19:47:49 UTC 2022
    - 5.9K bytes
    - Viewed (0)
  10. pkg/config/analysis/analyzers/analyzers_test.go

    		}
    	}
    
    	// Gather test files
    	var files []local.ReaderSource
    	for _, f := range tc.inputFiles {
    		of, err := os.Open(f)
    		if err != nil {
    			return nil, fmt.Errorf("error opening test file: %q", f)
    		}
    		files = append(files, local.ReaderSource{Name: f, Reader: of})
    	}
    
    	// Include resources from test files
    	err := sa.AddTestReaderKubeSource(files)
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri Jun 14 07:22:31 UTC 2024
    - 42.6K bytes
    - Viewed (0)
Back to top