_id
stringlengths
2
7
title
stringclasses
1 value
partition
stringclasses
3 values
text
stringlengths
6
2.61k
language
stringclasses
1 value
meta_information
dict
c31500
train
// HomeDir returns the path to the user's home directory. // It returns the empty string if the value isn't known.
{ "resource": "" }
c31501
train
// NewJSONConfigParser returns a jsonconfig.ConfigParser with its IncludeDirs // set with PerkeepConfigDir and the contents of CAMLI_INCLUDE_PATH.
{ "resource": "" }
c31502
train
// NewMemoryKeyValue returns a KeyValue implementation that's backed only // by memory. It's mostly useful for tests and development.
{ "resource": "" }
c31503
train
// blobsFromDir returns the list of file blobs in directory dirBlob. // It only traverses permanode directories.
{ "resource": "" }
c31504
train
// renameDuplicates goes through bf to check for duplicate filepaths. // It renames duplicate filepaths and returns a new slice, sorted by // file path.
{ "resource": "" }
c31505
train
// ServeHTTP streams a zip archive of all the files "under" // zh.root. That is, all the files pointed by file permanodes, // which are directly members of zh.root or recursively down // directory permanodes and permanodes members. // To build the fullpath of a file in a collection, it uses // the collection title if p...
{ "resource": "" }
c31506
train
// Props is an auto-generated proxy to the current props of ShareItemsBtn
{ "resource": "" }
c31507
train
// appConfig keeps on trying to fetch the extra config from the app handler. If // it doesn't succed after an hour has passed, the program exits.
{ "resource": "" }
c31508
train
// setMasterQuery registers with the app handler a master query that includes // topNode and all its descendants as the search response.
{ "resource": "" }
c31509
train
// Given a blobref and a few hex characters of the digest of the next hop, return the complete // blobref of the prefix, if that's a valid next hop.
{ "resource": "" }
c31510
train
// serveSubjectTemplate creates the funcs to generate the PageHeader, PageFile, // and pageMembers that can be used by the subject template, and serves the template.
{ "resource": "" }
c31511
train
// subjectHeader returns the PageHeader corresponding to the described subject.
{ "resource": "" }
c31512
train
// subjectFile returns the relevant PageFile if the described subject is a file permanode.
{ "resource": "" }
c31513
train
// subjectMembers returns the relevant PageMembers if the described subject is a permanode with members.
{ "resource": "" }
c31514
train
// serveZip streams a zip archive of all the files "under" // pr.subject. That is, all the files pointed by file permanodes, // which are directly members of pr.subject or recursively down // directory permanodes and permanodes members.
{ "resource": "" }
c31515
train
// SubFetch returns part of a blob. // The caller must close the returned io.ReadCloser. // The Reader may return fewer than 'length' bytes. Callers should // check. The returned error should be os.ErrNotExist if the blob // doesn't exist.
{ "resource": "" }
c31516
train
// NewDeployHandlerFromConfig initializes a DeployHandler from cfg. // Host and prefix have the same meaning as for NewDeployHandler. cfg should not be nil.
{ "resource": "" }
c31517
train
// if there's project as a query parameter, it means we've just created a // project for them and we're redirecting them to the form, but with the projectID // field pre-filled for them this time.
{ "resource": "" }
c31518
train
// serveOldInstance looks on GCE for an instance such as defined in depl.Conf, and if // found, serves the appropriate page depending on whether the instance is usable. It does // not serve anything if the instance is not found.
{ "resource": "" }
c31519
train
// serveInstanceState serves the state of the requested Google Cloud Engine VM creation // process. If the operation was successful, it serves a success page. If it failed, it // serves an error page. If it isn't finished yet, it replies with "running".
{ "resource": "" }
c31520
train
// serveProgress serves a page with some javascript code that regularly queries // the server about the progress of the requested Google Cloud Engine VM creation. // The server replies through serveInstanceState.
{ "resource": "" }
c31521
train
// randomZone picks one of the zone suffixes for region and returns it // appended to region, as a fully-qualified zone name. // If the given region is invalid, the default Zone is returned instead.
{ "resource": "" }
c31522
train
// fromState parses the oauth state parameter from r to extract the blobRef of the // instance configuration and the xsrftoken that were stored during serveSetup.
{ "resource": "" }
c31523
train
// dataStores returns the blobserver that stores the instances configurations, and the kv // store for the instances states.
{ "resource": "" }
c31524
train
// handleMasterQuery allows an app to register the master query that defines the // domain limiting all subsequent search queries.
{ "resource": "" }
c31525
train
// handleSearch runs the requested search query against the search handler, and // if the results are within the domain allowed by the master query, forwards them // back to the client.
{ "resource": "" }
c31526
train
// allowProxySearchResponse checks whether the blobs in sr are within the domain // defined by the masterQuery, and hence if the client is allowed to get that // response.
{ "resource": "" }
c31527
train
// randListenFn only exists to allow testing of randListen, by letting the caller // replace randPort with a func that actually has a predictable result.
{ "resource": "" }
c31528
train
// baseURL returns the concatenation of the scheme and host parts of // serverBaseURL with the port of listenAddr.
{ "resource": "" }
c31529
train
// FromJSONConfig creates an HandlerConfig from the contents of config. // prefix and serverBaseURL are used if not found in config.
{ "resource": "" }
c31530
train
// InitHandler sets the app handler's search handler, if the app handler was configured // to have one with HasSearch.
{ "resource": "" }
c31531
train
// Quit sends the app's process a SIGINT, and waits up to 5 seconds for it // to exit, returning an error if it doesn't.
{ "resource": "" }
c31532
train
// NewCachingFetcher returns a CachingFetcher that fetches from // fetcher and writes to and serves from cache.
{ "resource": "" }
c31533
train
// SetCacheHitHook sets a function that will modify the return values from Fetch // in the case of a cache hit. // Its purpose is to add potential side-effects from calling the Fetcher that would // have happened if we had had a cache miss. It is the responsibility of fn to // return a ReadCloser equivalent to the stat...
{ "resource": "" }
c31534
train
// maybeAddChild adds a child directory to this mutable directory // unless it already has one with this name and permanode.
{ "resource": "" }
c31535
train
// Release is called when a file handle is no longer needed. This is // called asynchronously after the last handle to a file is closed.
{ "resource": "" }
c31536
train
// Hand crafted this parser since it's a really common path.
{ "resource": "" }
c31537
train
// NewMemoryIndex returns an Index backed only by memory, for use in tests.
{ "resource": "" }
c31538
train
// pageCountPoppler calls the tool pdfinfo from the Poppler project for // filename and parses the output for the page count which is then returned. If // any error occurs or the pages count information is not found, an error is // returned.
{ "resource": "" }
c31539
train
// pageCountNative uses a native Go library to extract and return the number of // pages in the PDF document. It returns an error if the filename is not of a // PDF file, or if it failed to decode the PDF.
{ "resource": "" }
c31540
train
// pageCount returns the number of pages in the given PDF file, or an error if // it could not be determined. The function may trigger calls to external tools // to achieve a valid count after native counting has been tried without // success.
{ "resource": "" }
c31541
train
// SearchHelp returns JSON of an array of predicate names and descriptions.
{ "resource": "" }
c31542
train
// ReceiveString uploads the blob given by the string s to dst // and returns its blobref and size.
{ "resource": "" }
c31543
train
// Receive wraps calling a BlobReceiver's ReceiveBlob method, // additionally providing verification of the src digest, and also // notifying the blob hub on success. // The error will be ErrCorruptBlob if the blobref didn't match.
{ "resource": "" }
c31544
train
// Register registers a site-specific importer. It should only be called from init, // and not from concurrent goroutines.
{ "resource": "" }
c31545
train
// Context returns the run's context. It is always non-nil.
{ "resource": "" }
c31546
train
// CreateAccount creates a new importer account for the Host h, and the importer // implementation named impl. It returns a RunContext setup with that account.
{ "resource": "" }
c31547
train
// AccountsStatus returns the currently configured accounts and their status for // inclusion in the status.json document, as rendered by the web UI.
{ "resource": "" }
c31548
train
// RunImporterAccount runs the importerType importer on the account described in // accountNode.
{ "resource": "" }
c31549
train
// HTTPClient returns the HTTP client to use.
{ "resource": "" }
c31550
train
// HTTPTransport returns the HTTP transport to use.
{ "resource": "" }
c31551
train
// NewObject creates a new permanode and returns its Object wrapper.
{ "resource": "" }
c31552
train
// Attr returns the object's attribute value for the provided attr, // or the empty string if unset. To distinguish between unset, // an empty string, or multiple attribute values, use Attrs.
{ "resource": "" }
c31553
train
// Attrs returns the attribute values for the provided attr.
{ "resource": "" }
c31554
train
// ForeachAttr runs fn for each of the object's attributes & values. // There might be multiple values for the same attribute. // The internal lock is held while running, so no mutations should be // made or it will deadlock.
{ "resource": "" }
c31555
train
// DelAttr removes value from the values set for the attribute attr of // permaNode. If value is empty then all the values for attribute are cleared.
{ "resource": "" }
c31556
train
// SetAttr sets the attribute key to value.
{ "resource": "" }
c31557
train
// SetAttrValues sets multi-valued attribute.
{ "resource": "" }
c31558
train
// ObjectFromRef returns the object given by the named permanode
{ "resource": "" }
c31559
train
// NewCache returns a cache that won't store more than size bytes. // Blobs are evicted in LRU order.
{ "resource": "" }
c31560
train
// NumBlobs returns the number of blobs stored in s.
{ "resource": "" }
c31561
train
// SumBlobSize returns the total size in bytes of all the blobs in s.
{ "resource": "" }
c31562
train
// BlobrefStrings returns the sorted stringified blobrefs stored in s.
{ "resource": "" }
c31563
train
// Stats returns the number of blobs and number of bytes that were fetched from s.
{ "resource": "" }
c31564
train
// ConnUserid returns the uid that owns the given localhost connection. // The returned error is ErrNotFound if the connection wasn't found.
{ "resource": "" }
c31565
train
// Write an AST node to w.
{ "resource": "" }
c31566
train
// getQuery returns the query corresponding to the current search in the web UI.
{ "resource": "" }
c31567
train
// findAll returns all the permanodes matching the current web UI search // session. The javascript UI code uses a javascript object with blobRefs as // properties to represent a user's selection of permanodes. Since gopherjs // converts a Go map to a javascript object, findAll returns such a map so it // matches direc...
{ "resource": "" }
c31568
train
// Client returns a Perkeep client as defined by environment variables // automatically supplied by the Perkeep server host.
{ "resource": "" }
c31569
train
// which is one of "src", "dest", or "thirdleg"
{ "resource": "" }
c31570
train
// RemoveBlobs removes the list of blobs. An error is returned if the // server failed to remove a blob. Removing a non-existent blob isn't // an error.
{ "resource": "" }
c31571
train
// RemoveBlob removes the provided blob. An error is returned if the server failed to remove // the blob. Removing a non-existent blob isn't an error.
{ "resource": "" }
c31572
train
// setClient configures a client for c, for the describe requests.
{ "resource": "" }
c31573
train
// NewRegexpFakeTransport takes a slice of Matchers and returns an // http.RoundTripper that will apply the function associated with the // first UrlRegex that matches.
{ "resource": "" }
c31574
train
// FileResponder returns an HTTP response generator that returns the // contents of the named file.
{ "resource": "" }
c31575
train
// StaticResponder returns an HTTP response generator that parses res // for an entire HTTP response, including headers and body.
{ "resource": "" }
c31576
train
// Command implements the Command method for the Thumbnailer interface.
{ "resource": "" }
c31577
train
// NewKeyValue returns a KeyValue as defined by cfg. // It returns an error of type NeedWipeError when the returned KeyValue should // be fixed with Wipe.
{ "resource": "" }
c31578
train
// NewKeyValueMaybeWipe calls NewKeyValue and wipes the KeyValue if, and only // if, NewKeyValue has returned a NeedWipeError.
{ "resource": "" }
c31579
train
// CheckSizes returns ErrKeyTooLarge if key does not respect KeyMaxSize or // ErrValueTooLarge if value does not respect ValueMaxSize
{ "resource": "" }
c31580
train
// addContinueConstraint conditionally modifies q.Constraint to scroll // past the results as indicated by q.Continue.
{ "resource": "" }
c31581
train
// matchesPermanodeTypes returns a set of valid permanode types that a matching // permanode must have as its "camliNodeType" attribute. // It returns a zero-length slice if this constraint might include things other // things.
{ "resource": "" }
c31582
train
// matchesAtMostOneBlob reports whether this constraint matches at most a single blob. // If so, it returns that blob. Otherwise it returns a zero, invalid blob.Ref.
{ "resource": "" }
c31583
train
// setResultContinue sets res.Continue if q is suitable for having a continue token. // The corpus is locked for reads.
{ "resource": "" }
c31584
train
// hasValueConstraint returns true if one or more constraints that check an attribute's value are set.
{ "resource": "" }
c31585
train
// permanodeMatchesAttrVals checks that the values in vals - all of them, if c.ValueAll is set - // match the values for c.Attr. // vals are the current permanode values of c.Attr.
{ "resource": "" }
c31586
train
// hasMatchingParent checks all parents against c and returns true as soon as one of // them matches, or returns false if none of them is a match.
{ "resource": "" }
c31587
train
// hasMatchingChild runs matcher against each child and returns true as soon as // there is a match, of false if none of them is a match.
{ "resource": "" }
c31588
train
// StorageGeneration returns the generation's initialization time, // and the random string.
{ "resource": "" }
c31589
train
// LogWriter returns an environment-specific io.WriteCloser suitable for passing // to log.SetOutput. It will also include writing to os.Stderr as well. // Since it might be writing to a Google Cloud Logger, it is the responsibility // of the caller to Close it when needed, to flush the last log entries.
{ "resource": "" }
c31590
train
// resetInstance reboots the GCE VM that this process is running in.
{ "resource": "" }
c31591
train
// On success, handleShareSelection calls d.showSharedURL with the URL that can // be used to share the item. If the item is a file, the URL can be used directly // to fetch the file. If the item is a directory, the URL should be used with // pk-get -shared.
{ "resource": "" }
c31592
train
// mkdir creates a new directory blob, with children composing its static-set, // and uploads it. It returns the blobRef of the new directory.
{ "resource": "" }
c31593
train
// shareFile returns the URL that can be used to share the target item. If the // item is a file, the URL can be used directly to fetch the file. If the item is a // directory, the URL should be used with pk-get -shared.
{ "resource": "" }
c31594
train
// newShareClaim creates, signs, and uploads a transitive haveref share claim // for sharing the target item. It returns the ref of the claim.
{ "resource": "" }
c31595
train
// fileAsPhoto returns a photo populated with the information found about f, // or nil if f is not actually a photo from Google Photos. // // The returned photo contains only the metadata; // the content of the photo can be downloaded with dl.openPhoto.
{ "resource": "" }
c31596
train
// rateLimit calls f obeying the global Rate limit. // On "Rate Limit Exceeded" error, it sleeps and tries later.
{ "resource": "" }
c31597
train
// MIMEType returns the MIME type from the data in the provided header // of the data. // It returns the empty string if the MIME type can't be determined.
{ "resource": "" }
c31598
train
// MIMETypeFromReaderAt takes a ReaderAt, sniffs the beginning of it, // and returns the MIME type if sniffed, else the empty string.
{ "resource": "" }
c31599
train
// HasExtension returns whether the file extension of filename is among // extensions. It is a case-insensitive lookup, optimized for the ASCII case.
{ "resource": "" }