text:
"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = generateMissingPluginMessage;
const pluginNameMap = {
  classProperties: {
    syntax: {
      name: "@babel/plugin-syntax-class-properties",
      url: "https://git.io/vb4yQ"
    },
    transform: {
      name: "@babel/plugin-proposal-class-properties",
      url: "https://git.io/vb4SL"
    }
  },
  decorators: {
    syntax: {
      name: "@babel/plugin-syntax-decorators",
      url: "https://git.io/vb4y9"
    },
    transform: {
      name: "@babel/plugin-proposal-decorators",
      url: "https://git.io/vb4ST"
    }
  },
  doExpressions: {
    syntax: {
      name: "@babel/plugin-syntax-do-expressions",
      url: "https://git.io/vb4yh"
    },
    transform: {
      name: "@babel/plugin-proposal-do-expressions",
      url: "https://git.io/vb4S3"
    }
  },
  dynamicImport: {
    syntax: {
      name: "@babel/plugin-syntax-dynamic-import",
      url: "https://git.io/vb4Sv"
    }
  },
  exportDefaultFrom: {
    syntax: {
      name: "@babel/plugin-syntax-export-default-from",
      url: "https://git.io/vb4SO"
    },
    transform: {
      name: "@babel/plugin-proposal-export-default-from",
      url: "https://git.io/vb4yH"
    }
  },
  exportNamespaceFrom: {
    syntax: {
      name: "@babel/plugin-syntax-export-namespace-from",
      url: "https://git.io/vb4Sf"
    },
    transform: {
      name: "@babel/plugin-proposal-export-namespace-from",
      url: "https://git.io/vb4SG"
    }
  },
  flow: {
    syntax: {
      name: "@babel/plugin-syntax-flow",
      url: "https://git.io/vb4yb"
    },
    transform: {
      name: "@babel/plugin-transform-flow-strip-types",
      url: "https://git.io/vb49g"
    }
  },
  functionBind: {
    syntax: {
      name: "@babel/plugin-syntax-function-bind",
      url: "https://git.io/vb4y7"
    },
    transform: {
      name: "@babel/plugin-proposal-function-bind",
      url: "https://git.io/vb4St"
    }
  },
  functionSent: {
    syntax: {
      name: "@babel/plugin-syntax-function-sent",
      url: "https://git.io/vb4yN"
    },
    transform: {
      name: "@babel/plugin-proposal-function-sent",
      url: "https://git.io/vb4SZ"
    }
  },
  importMeta: {
    syntax: {
      name: "@babel/plugin-syntax-import-meta",
      url: "https://git.io/vbKK6"
    }
  },
  jsx: {
    syntax: {
      name: "@babel/plugin-syntax-jsx",
      url: "https://git.io/vb4yA"
    },
    transform: {
      name: "@babel/plugin-transform-react-jsx",
      url: "https://git.io/vb4yd"
    }
  },
  logicalAssignment: {
    syntax: {
      name: "@babel/plugin-syntax-logical-assignment-operators",
      url: "https://git.io/vAlBp"
    },
    transform: {
      name: "@babel/plugin-proposal-logical-assignment-operators",
      url: "https://git.io/vAlRe"
    }
  },
  nullishCoalescingOperator: {
    syntax: {
      name: "@babel/plugin-syntax-nullish-coalescing-operator",
      url: "https://git.io/vb4yx"
    },
    transform: {
      name: "@babel/plugin-proposal-nullish-coalescing-operator",
      url: "https://git.io/vb4Se"
    }
  },
  numericSeparator: {
    syntax: {
      name: "@babel/plugin-syntax-numeric-separator",
      url: "https://git.io/vb4Sq"
    },
    transform: {
      name: "@babel/plugin-proposal-numeric-separator",
      url: "https://git.io/vb4yS"
    }
  },
  optionalChaining: {
    syntax: {
      name: "@babel/plugin-syntax-optional-chaining",
      url: "https://git.io/vb4Sc"
    },
    transform: {
      name: "@babel/plugin-proposal-optional-chaining",
      url: "https://git.io/vb4Sk"
    }
  },
  pipelineOperator: {
    syntax: {
      name: "@babel/plugin-syntax-pipeline-operator",
      url: "https://git.io/vb4yj"
    },
    transform: {
      name: "@babel/plugin-proposal-pipeline-operator",
      url: "https://git.io/vb4SU"
    }
  },
  throwExpressions: {
    syntax: {
      name: "@babel/plugin-syntax-throw-expressions",
      url: "https://git.io/vb4SJ"
    },
    transform: {
      name: "@babel/plugin-proposal-throw-expressions",
      url: "https://git.io/vb4yF"
    }
  },
  typescript: {
    syntax: {
      name: "@babel/plugin-syntax-typescript",
      url: "https://git.io/vb4SC"
    },
    transform: {
      name: "@babel/plugin-transform-typescript",
      url: "https://git.io/vb4Sm"
    }
  },
  asyncGenerators: {
    syntax: {
      name: "@babel/plugin-syntax-async-generators",
      url: "https://git.io/vb4SY"
    },
    transform: {
      name: "@babel/plugin-proposal-async-generator-functions",
      url: "https://git.io/vb4yp"
    }
  },
  objectRestSpread: {
    syntax: {
      name: "@babel/plugin-syntax-object-rest-spread",
      url: "https://git.io/vb4y5"
    },
    transform: {
      name: "@babel/plugin-proposal-object-rest-spread",
      url: "https://git.io/vb4Ss"
    }
  },
  optionalCatchBinding: {
    syntax: {
      name: "@babel/plugin-syntax-optional-catch-binding",
      url: "https://git.io/vb4Sn"
    },
    transform: {
      name: "@babel/plugin-proposal-optional-catch-binding",
      url: "https://git.io/vb4SI"
    }
  }
};

const getNameURLCombination = ({
  name,
  url
}) => `${name} (${url})`;

function generateMissingPluginMessage(missingPluginName, loc, codeFrame) {
  let helpMessage = `Support for the experimental syntax '${missingPluginName}' isn't currently enabled ` + `(${loc.line}:${loc.column + 1}):\n\n` + codeFrame;
  const pluginInfo = pluginNameMap[missingPluginName];

  if (pluginInfo) {
    const {
      syntax: syntaxPlugin,
      transform: transformPlugin
    } = pluginInfo;

    if (syntaxPlugin) {
      if (transformPlugin) {
        const transformPluginInfo = getNameURLCombination(transformPlugin);
        helpMessage += `\n\nAdd ${transformPluginInfo} to the 'plugins' section of your Babel config ` + `to enable transformation.`;
      } else {
        const syntaxPluginInfo = getNameURLCombination(syntaxPlugin);
        helpMessage += `\n\nAdd ${syntaxPluginInfo} to the 'plugins' section of your Babel config ` + `to enable parsing.`;
      }
    }
  }

  return helpMessage;
}


text:
package org.apache.tez.common.security;

import org.apache.hadoop.classification.InterfaceAudience.Private;

/**
 * ACL Types
 */
@Private
public enum ACLType {
  /** YARN admin (view/modify) permissions on the Application Master */
  YARN_ADMIN_ACL,
  /** View permissions on the Application Master */
  AM_VIEW_ACL,
  /** Modify permissions on the Application Master */
  AM_MODIFY_ACL,
  /** View permissions on the DAG */
  DAG_VIEW_ACL,
  /** Modify permissions on the DAG */
  DAG_MODIFY_ACL
}

redpajama_set_name: RedPajamaGithub


text:
Tutorial
--------

HTML5 includes the `<video>` tag. It is used for displaying videos.

    <video width="400" height="400" controls>
        <source src="video.mp4" type="video/mp4">
    </video>

### Code explained

`<video>` is the main tag that is used for displaying videos.
`controls` adds buttons for controlling the video.
`<source>` adds a file.
`src` specifies the file location on the server.
`type` specifies the file type (In this case MP4)

Exercise
--------

Add `myvideo.mp4` to this website with height 600 and width 649.

Tutorial Code
-------------

    <!DOCTYPE html>
    <html>
        <head>
        </head>
        <body>

        </body>
    </html>

Expected Output
---------------

    <!DOCTYPE html>
    <html>
        <head>
        </head>
        <body>
            <video height="600" width="649" controls>
                <source src="myvideo.mp4" type="video/mp4>
            </video>
        </body>
    </html>

Solution
--------

    <!DOCTYPE html>
    <html>
        <head>
        </head>
        <body>
            <video height="600" width="649" controls>
                <source src="myvideo.mp4" type="video/mp4>
            </video>
        </body>
    </html>


text:
package tsdb // import "github.com/influxdata/influxdb/tsdb"

import (
	"errors"
	"fmt"
	"io"
	"io/ioutil"
	"log"
	"os"
	"path/filepath"
	"sort"
	"strconv"
	"strings"
	"sync"
	"time"

	"github.com/influxdata/influxdb/influxql"
	"github.com/influxdata/influxdb/models"
)

var (
	// ErrShardNotFound gets returned when trying to get a non existing shard.
	ErrShardNotFound = fmt.Errorf("shard not found")
	// ErrStoreClosed gets returned when trying to use a closed Store.
	ErrStoreClosed = fmt.Errorf("store is closed")
)

const (
	maintenanceCheckInterval = time.Minute
)

// Store manages shards and indexes for databases.
type Store struct {
	mu   sync.RWMutex
	path string

	databaseIndexes map[string]*DatabaseIndex

	// shards is a map of shard IDs to the associated Shard.
	shards map[uint64]*Shard

	EngineOptions EngineOptions
	Logger        *log.Logger

	// logOutput is where output from the underlying databases will go.
	logOutput io.Writer

	closing chan struct{}
	wg      sync.WaitGroup
	opened  bool
}

// NewStore returns a new store with the given path and a default configuration.
// The returned store must be initialized by calling Open before using it.
func NewStore(path string) *Store {
	opts := NewEngineOptions()
	opts.Config = NewConfig()

	return &Store{
		path:          path,
		EngineOptions: opts,
		Logger:        log.New(os.Stderr, "[store] ", log.LstdFlags),
		logOutput:     os.Stderr,
	}
}

// SetLogOutput sets the writer to which all logs are written. It must not be
// called after Open is called.
func (s *Store) SetLogOutput(w io.Writer) {
	s.Logger = log.New(w, "[store] ", log.LstdFlags)
	s.logOutput = w
	for _, s := range s.shards {
		s.SetLogOutput(w)
	}
}

// Path returns the store's root path.
func (s *Store) Path() string { return s.path }

// Open initializes the store, creating all necessary directories, loading all
// shards and indexes and initializing periodic maintenance of all shards.
func (s *Store) Open() error {
	s.mu.Lock()
	defer s.mu.Unlock()

	s.closing = make(chan struct{})

	s.shards = map[uint64]*Shard{}
	s.databaseIndexes = map[string]*DatabaseIndex{}

	s.Logger.Printf("Using data dir: %v", s.Path())

	// Create directory.
	if err := os.MkdirAll(s.path, 0777); err != nil {
		return err
	}

	// TODO: Start AE for Node
	if err := s.loadIndexes(); err != nil {
		return err
	}

	if err := s.loadShards(); err != nil {
		return err
	}

	s.opened = true

	return nil
}

func (s *Store) loadIndexes() error {
	dbs, err := ioutil.ReadDir(s.path)
	if err != nil {
		return err
	}
	for _, db := range dbs {
		if !db.IsDir() {
			s.Logger.Printf("Skipping database dir: %s. Not a directory", db.Name())
			continue
		}
		s.databaseIndexes[db.Name()] = NewDatabaseIndex(db.Name())
	}
	return nil
}

func (s *Store) loadShards() error {
	// struct to hold the result of opening each reader in a goroutine
	type res struct {
		s   *Shard
		err error
	}

	throttle := newthrottle(4)

	resC := make(chan *res)
	var n int

	// loop through the current database indexes
	for db := range s.databaseIndexes {
		rps, err := ioutil.ReadDir(filepath.Join(s.path, db))
		if err != nil {
			return err
		}

		for _, rp := range rps {
			// retention policies should be directories.  Skip anything that is not a dir.
			if !rp.IsDir() {
				s.Logger.Printf("Skipping retention policy dir: %s. Not a directory", rp.Name())
				continue
			}

			shards, err := ioutil.ReadDir(filepath.Join(s.path, db, rp.Name()))
			if err != nil {
				return err
			}
			for _, sh := range shards {
				n++
				go func(index *DatabaseIndex, db, rp, sh string) {
					throttle.take()
					defer throttle.release()

					start := time.Now()
					path := filepath.Join(s.path, db, rp, sh)
					walPath := filepath.Join(s.EngineOptions.Config.WALDir, db, rp, sh)

					// Shard file names are numeric shardIDs
					shardID, err := strconv.ParseUint(sh, 10, 64)
					if err != nil {
						resC <- &res{err: fmt.Errorf("%s is not a valid ID. Skipping shard.", sh)}
						return
					}

					shard := NewShard(shardID, s.databaseIndexes[db], path, walPath, s.EngineOptions)
					shard.SetLogOutput(s.logOutput)

					err = shard.Open()
					if err != nil {
						resC <- &res{err: fmt.Errorf("Failed to open shard: %d: %s", shardID, err)}
						return
					}

					resC <- &res{s: shard}
					s.Logger.Printf("%s opened in %s", path, time.Now().Sub(start))
				}(s.databaseIndexes[db], db, rp.Name(), sh.Name())
			}
		}
	}

	for i := 0; i < n; i++ {
		res := <-resC
		if res.err != nil {
			s.Logger.Println(res.err)
			continue
		}
		s.shards[res.s.id] = res.s
	}
	close(resC)
	return nil
}

// Close closes the store and all associated shards. After calling Close accessing
// shards through the Store will result in ErrStoreClosed being returned.
func (s *Store) Close() error {
	s.mu.Lock()
	defer s.mu.Unlock()

	if s.opened {
		close(s.closing)
	}
	s.wg.Wait()

	for _, sh := range s.shards {
		if err := sh.Close(); err != nil {
			return err
		}
	}
	s.opened = false
	s.shards = nil
	s.databaseIndexes = nil

	return nil
}

// DatabaseIndexN returns the number of databases indicies in the store.
func (s *Store) DatabaseIndexN() int {
	s.mu.RLock()
	defer s.mu.RUnlock()
	return len(s.databaseIndexes)
}

// Shard returns a shard by id.
func (s *Store) Shard(id uint64) *Shard {
	s.mu.RLock()
	defer s.mu.RUnlock()
	sh, ok := s.shards[id]
	if !ok {
		return nil
	}
	return sh
}

// Shards returns a list of shards by id.
func (s *Store) Shards(ids []uint64) []*Shard {
	s.mu.RLock()
	defer s.mu.RUnlock()
	a := make([]*Shard, 0, len(ids))
	for _, id := range ids {
		sh, ok := s.shards[id]
		if !ok {
			continue
		}
		a = append(a, sh)
	}
	return a
}

// ShardN returns the number of shards in the store.
func (s *Store) ShardN() int {
	s.mu.RLock()
	defer s.mu.RUnlock()
	return len(s.shards)
}

// CreateShard creates a shard with the given id and retention policy on a database.
func (s *Store) CreateShard(database, retentionPolicy string, shardID uint64) error {
	s.mu.Lock()
	defer s.mu.Unlock()

	select {
	case <-s.closing:
		return ErrStoreClosed
	default:
	}

	// shard already exists
	if _, ok := s.shards[shardID]; ok {
		return nil
	}

	// created the db and retention policy dirs if they don't exist
	if err := os.MkdirAll(filepath.Join(s.path, database, retentionPolicy), 0700); err != nil {
		return err
	}

	// create the WAL directory
	walPath := filepath.Join(s.EngineOptions.Config.WALDir, database, retentionPolicy, fmt.Sprintf("%d", shardID))
	if err := os.MkdirAll(walPath, 0700); err != nil {
		return err
	}

	// create the database index if it does not exist
	db, ok := s.databaseIndexes[database]
	if !ok {
		db = NewDatabaseIndex(database)
		s.databaseIndexes[database] = db
	}

	path := filepath.Join(s.path, database, retentionPolicy, strconv.FormatUint(shardID, 10))
	shard := NewShard(shardID, db, path, walPath, s.EngineOptions)
	shard.SetLogOutput(s.logOutput)
	if err := shard.Open(); err != nil {
		return err
	}

	s.shards[shardID] = shard

	return nil
}

// DeleteShard removes a shard from disk.
func (s *Store) DeleteShard(shardID uint64) error {
	s.mu.Lock()
	defer s.mu.Unlock()
	return s.deleteShard(shardID)
}

// deleteShard removes a shard from disk. Callers of deleteShard need
// to handle locks appropriately.
func (s *Store) deleteShard(shardID uint64) error {
	// ensure shard exists
	sh, ok := s.shards[shardID]
	if !ok {
		return nil
	}

	if err := sh.Close(); err != nil {
		return err
	}

	if err := os.RemoveAll(sh.path); err != nil {
		return err
	}

	if err := os.RemoveAll(sh.walPath); err != nil {
		return err
	}

	delete(s.shards, shardID)
	return nil
}

// ShardIteratorCreator returns an iterator creator for a shard.
func (s *Store) ShardIteratorCreator(id uint64) influxql.IteratorCreator {
	sh := s.Shard(id)
	if sh == nil {
		return nil
	}
	return &shardIteratorCreator{sh: sh}
}

// DeleteDatabase will close all shards associated with a database and remove the directory and files from disk.
func (s *Store) DeleteDatabase(name string) error {
	s.mu.Lock()
	defer s.mu.Unlock()

	// Close and delete all shards on the database.
	for shardID, sh := range s.shards {
		if sh.database == name {
			// Delete the shard from disk.
			if err := s.deleteShard(shardID); err != nil {
				return err
			}
		}
	}

	if err := os.RemoveAll(filepath.Join(s.path, name)); err != nil {
		return err
	}
	if err := os.RemoveAll(filepath.Join(s.EngineOptions.Config.WALDir, name)); err != nil {
		return err
	}

	delete(s.databaseIndexes, name)
	return nil
}

// DeleteRetentionPolicy will close all shards associated with the
// provided retention policy, remove the retention policy directories on
// both the DB and WAL, and remove all shard files from disk.
func (s *Store) DeleteRetentionPolicy(database, name string) error {
	s.mu.Lock()
	defer s.mu.Unlock()

	// Close and delete all shards under the retention policy on the
	// database.
	for shardID, sh := range s.shards {
		if sh.database == database && sh.retentionPolicy == name {
			// Delete the shard from disk.
			if err := s.deleteShard(shardID); err != nil {
				return err
			}
		}
	}

	// Remove the rentention policy folder.
	if err := os.RemoveAll(filepath.Join(s.path, database, name)); err != nil {
		return err
	}

	// Remove the retention policy folder from the the WAL.
	return os.RemoveAll(filepath.Join(s.EngineOptions.Config.WALDir, database, name))
}

// DeleteMeasurement removes a measurement and all associated series from a database.
func (s *Store) DeleteMeasurement(database, name string) error {
	s.mu.Lock()
	defer s.mu.Unlock()

	// Find the database.
	db := s.databaseIndexes[database]
	if db == nil {
		return nil
	}

	// Find the measurement.
	m := db.Measurement(name)
	if m == nil {
		return influxql.ErrMeasurementNotFound(name)
	}

	// Remove measurement from index.
	db.DropMeasurement(m.Name)

	// Remove underlying data.
	for _, sh := range s.shards {
		if sh.database != database {
			continue
		}

		if err := sh.DeleteMeasurement(m.Name, m.SeriesKeys()); err != nil {
			return err
		}
	}

	return nil
}

// ShardIDs returns a slice of all ShardIDs under management.
func (s *Store) ShardIDs() []uint64 {
	s.mu.RLock()
	defer s.mu.RUnlock()
	return s.shardIDs()
}

func (s *Store) shardIDs() []uint64 {
	a := make([]uint64, 0, len(s.shards))
	for shardID := range s.shards {
		a = append(a, shardID)
	}
	return a
}

// shardsSlice returns an ordered list of shards.
func (s *Store) shardsSlice() []*Shard {
	a := make([]*Shard, 0, len(s.shards))
	for _, sh := range s.shards {
		a = append(a, sh)
	}
	sort.Sort(Shards(a))
	return a
}

// DatabaseIndex returns the index for a database by its name.
func (s *Store) DatabaseIndex(name string) *DatabaseIndex {
	s.mu.RLock()
	defer s.mu.RUnlock()
	return s.databaseIndexes[name]
}

// Databases returns all the databases in the indexes
func (s *Store) Databases() []string {
	s.mu.RLock()
	defer s.mu.RUnlock()
	databases := make([]string, 0, len(s.databaseIndexes))
	for db := range s.databaseIndexes {
		databases = append(databases, db)
	}
	return databases
}

// Measurement returns a measurement by name from the given database.
func (s *Store) Measurement(database, name string) *Measurement {
	s.mu.RLock()
	db := s.databaseIndexes[database]
	s.mu.RUnlock()
	if db == nil {
		return nil
	}
	return db.Measurement(name)
}

// DiskSize returns the size of all the shard files in bytes.  This size does not include the WAL size.
func (s *Store) DiskSize() (int64, error) {
	s.mu.RLock()
	defer s.mu.RUnlock()
	var size int64
	for _, shardID := range s.ShardIDs() {
		shard := s.Shard(shardID)
		sz, err := shard.DiskSize()
		if err != nil {
			return 0, err
		}
		size += sz
	}
	return size, nil
}

// BackupShard will get the shard and have the engine backup since the passed in time to the writer
func (s *Store) BackupShard(id uint64, since time.Time, w io.Writer) error {
	shard := s.Shard(id)
	if shard == nil {
		return fmt.Errorf("shard %d doesn't exist on this server", id)
	}

	path, err := relativePath(s.path, shard.path)
	if err != nil {
		return err
	}

	return shard.engine.Backup(w, path, since)
}

// ShardRelativePath will return the relative path to the shard. i.e. <database>/<retention>/<id>
func (s *Store) ShardRelativePath(id uint64) (string, error) {
	shard := s.Shard(id)
	if shard == nil {
		return "", fmt.Errorf("shard %d doesn't exist on this server", id)
	}
	return relativePath(s.path, shard.path)
}

// DeleteSeries loops through the local shards and deletes the series data and metadata for the passed in series keys
func (s *Store) DeleteSeries(database string, sources []influxql.Source, condition influxql.Expr) error {
	// Expand regex expressions in the FROM clause.
	a, err := s.ExpandSources(sources)
	if err != nil {
		return err
	} else if sources != nil && len(sources) != 0 && len(a) == 0 {
		return nil
	}
	sources = a

	// Determine deletion time range.
	min, max, err := influxql.TimeRangeAsEpochNano(condition)
	if err != nil {
		return err
	}

	s.mu.RLock()
	defer s.mu.RUnlock()

	// Find the database.
	db := s.DatabaseIndex(database)
	if db == nil {
		return nil
	}

	measurements, err := measurementsFromSourcesOrDB(db, sources...)
	if err != nil {
		return err
	}

	var seriesKeys []string
	for _, m := range measurements {
		var ids SeriesIDs
		var filters FilterExprs
		if condition != nil {
			// Get series IDs that match the WHERE clause.
			ids, filters, err = m.walkWhereForSeriesIds(condition)
			if err != nil {
				return err
			}

			// Delete boolean literal true filter expressions.
			// These are returned for `WHERE tagKey = 'tagVal'` type expressions and are okay.
			filters.DeleteBoolLiteralTrues()

			// Check for unsupported field filters.
			// Any remaining filters means there were fields (e.g., `WHERE value = 1.2`).
			if filters.Len() > 0 {
				return errors.New("fields not supported in WHERE clause during deletion")
			}
		} else {
			// No WHERE clause so get all series IDs for this measurement.
			ids = m.seriesIDs
		}

		for _, id := range ids {
			seriesKeys = append(seriesKeys, m.seriesByID[id].Key)
		}
	}

	// delete the raw series data
	if err := s.deleteSeries(database, seriesKeys, min, max); err != nil {
		return err
	}

	return nil
}

func (s *Store) deleteSeries(database string, seriesKeys []string, min, max int64) error {
	db := s.databaseIndexes[database]
	if db == nil {
		return influxql.ErrDatabaseNotFound(database)
	}

	for _, sh := range s.shards {
		if sh.database != database {
			continue
		}
		if err := sh.DeleteSeriesRange(seriesKeys, min, max); err != nil {
			return err
		}

		// The keys we passed in may be fully deleted from the shard, if so,
		// we need to remove the shard from all the meta data indexes
		existing, err := sh.ContainsSeries(seriesKeys)
		if err != nil {
			return err
		}

		for k, exists := range existing {
			if !exists {
				db.UnassignShard(k, sh.id)
			}
		}
	}

	return nil
}

// ExpandSources expands sources against all local shards.
func (s *Store) ExpandSources(sources influxql.Sources) (influxql.Sources, error) {
	return s.IteratorCreators().ExpandSources(sources)
}

// IteratorCreators returns a set of all local shards as iterator creators.
func (s *Store) IteratorCreators() influxql.IteratorCreators {
	s.mu.Lock()
	defer s.mu.Unlock()

	a := make(influxql.IteratorCreators, 0, len(s.shards))
	for _, sh := range s.shards {
		a = append(a, sh)
	}
	return a
}

func (s *Store) IteratorCreator(shards []uint64) (influxql.IteratorCreator, error) {
	// Generate iterators for each node.
	ics := make([]influxql.IteratorCreator, 0)
	if err := func() error {
		for _, id := range shards {
			ic := s.ShardIteratorCreator(id)
			if ic == nil {
				continue
			}
			ics = append(ics, ic)
		}

		return nil
	}(); err != nil {
		influxql.IteratorCreators(ics).Close()
		return nil, err
	}

	return influxql.IteratorCreators(ics), nil
}

// WriteToShard writes a list of points to a shard identified by its ID.
func (s *Store) WriteToShard(shardID uint64, points []models.Point) error {
	s.mu.RLock()

	select {
	case <-s.closing:
		s.mu.RUnlock()
		return ErrStoreClosed
	default:
	}

	sh, ok := s.shards[shardID]
	if !ok {
		s.mu.RUnlock()
		return ErrShardNotFound
	}
	s.mu.RUnlock()

	return sh.WritePoints(points)
}

// filterShowSeriesResult will limit the number of series returned based on the limit and the offset.
// Unlike limit and offset on SELECT statements, the limit and offset don't apply to the number of Rows, but
// to the number of total Values returned, since each Value represents a unique series.
func (e *Store) filterShowSeriesResult(limit, offset int, rows models.Rows) models.Rows {
	var filteredSeries models.Rows
	seriesCount := 0
	for _, r := range rows {
		var currentSeries [][]interface{}

		// filter the values
		for _, v := range r.Values {
			if seriesCount >= offset && seriesCount-offset < limit {
				currentSeries = append(currentSeries, v)
			}
			seriesCount++
		}

		// only add the row back in if there are some values in it
		if len(currentSeries) > 0 {
			r.Values = currentSeries
			filteredSeries = append(filteredSeries, r)
			if seriesCount > limit+offset {
				return filteredSeries
			}
		}
	}
	return filteredSeries
}

// IsRetryable returns true if this error is temporary and could be retried
func IsRetryable(err error) bool {
	if err == nil {
		return true
	}

	if strings.Contains(err.Error(), "field type conflict") {
		return false
	}
	return true
}

// DecodeStorePath extracts the database and retention policy names
// from a given shard or WAL path.
func DecodeStorePath(shardOrWALPath string) (database, retentionPolicy string) {
	// shardOrWALPath format: /maybe/absolute/base/then/:database/:retentionPolicy/:nameOfShardOrWAL

	// Discard the last part of the path (the shard name or the wal name).
	path, _ := filepath.Split(filepath.Clean(shardOrWALPath))

	// Extract the database and retention policy.
	path, rp := filepath.Split(filepath.Clean(path))
	_, db := filepath.Split(filepath.Clean(path))
	return db, rp
}

// relativePath will expand out the full paths passed in and return
// the relative shard path from the store
func relativePath(storePath, shardPath string) (string, error) {
	path, err := filepath.Abs(storePath)
	if err != nil {
		return "", fmt.Errorf("store abs path: %s", err)
	}

	fp, err := filepath.Abs(shardPath)
	if err != nil {
		return "", fmt.Errorf("file abs path: %s", err)
	}

	name, err := filepath.Rel(path, fp)
	if err != nil {
		return "", fmt.Errorf("file rel path: %s", err)
	}

	return name, nil
}

// measurementsFromSourcesOrDB returns a list of measurements from the
// sources passed in or, if sources is empty, a list of all
// measurement names from the database passed in.
func measurementsFromSourcesOrDB(db *DatabaseIndex, sources ...influxql.Source) (Measurements, error) {
	var measurements Measurements
	if len(sources) > 0 {
		for _, source := range sources {
			if m, ok := source.(*influxql.Measurement); ok {
				measurement := db.measurements[m.Name]
				if measurement == nil {
					continue
				}

				measurements = append(measurements, measurement)
			} else {
				return nil, errors.New("identifiers in FROM clause must be measurement names")
			}
		}
	} else {
		// No measurements specified in FROM clause so get all measurements that have series.
		for _, m := range db.Measurements() {
			if m.HasSeries() {
				measurements = append(measurements, m)
			}
		}
	}
	sort.Sort(measurements)

	return measurements, nil
}

// throttle is a simple channel based concurrency limiter.  It uses a fixed
// size channel to limit callers from proceeding until there is a value avalable
// in the channel.  If all are in-use, the caller blocks until one is freed.
type throttle struct {
	c chan struct{}
}

func newthrottle(limit int) *throttle {
	t := &throttle{
		c: make(chan struct{}, limit),
	}
	for i := 0; i < limit; i++ {
		t.c <- struct{}{}
	}
	return t
}

func (t *throttle) take() {
	<-t.c
}

func (t *throttle) release() {
	t.c <- struct{}{}
}


text: ./node_modules/.bin/mocha --timeout 3000


text:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>Filibuster</title> <link rel="stylesheet" href="styles.css">
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro" rel="stylesheet">

Results for "legal_contract_thing"

Index

Definitions __legal_contract_legalese__

Disclaimer of Warranty __legal_contract_legalese__

Equipment __legal_contract_legalese__

General __legal_contract_legalese__

Legal Notice __legal_contract_legalese__

Monitoring __legal_contract_legalese__

Legal Notice __legal_contract_legalese__

General __legal_contract_legalese__

Trademarks __legal_contract_legalese__

Changed Terms __legal_contract_legalese__

Termination __legal_contract_legalese__

Third Party Content __legal_contract_legalese__

Disclaimer of Warranty __legal_contract_legalese__

General __legal_contract_legalese__

General __legal_contract_legalese__

Legal Notice __legal_contract_legalese__

Monitoring __legal_contract_legalese__

Limitation of Liability __legal_contract_legalese__

Termination __legal_contract_legalese__

Disclaimer of Warranty __legal_contract_legalese__


text:
import expect from 'expect'
import React from 'react'
import {render, unmountComponentAtNode} from 'react-dom'

import Zeitline from 'src/'

describe('Zeitline', () => {
  let node

  beforeEach(() => {
    node = document.createElement('div')
  })

  afterEach(() => {
    unmountComponentAtNode(node)
  })

  it('have a svg node', () => {
    render(<Zeitline/>, node, () => {
      expect(node.innerHTML).toContain('svg')
    })
  })

  it('have two events', () => {
    render(<Zeitline data={[
      {date: new Date('30 Jun 2017'), label: 'first'},
      {date: new Date('10 Jul 2017'), label: 'second'},
    ]}/>, node, () => {
      expect(node.querySelectorAll('.event-group').length).toEqual(2)
    })
  })

  it('have no more svg node', () => {
    render(<Zeitline/>, node, () => {
      unmountComponentAtNode(node);
      expect(node.innerHTML).toEqual('')
    })
  })
})


text:
#include "S_OptionsAudio.h"
#include "j1Window.h"

S_OptionsAudio::S_OptionsAudio()
{
	scene_str = "OptionsAudio";
}

S_OptionsAudio::~S_OptionsAudio()
{
}

bool S_OptionsAudio::Awake(pugi::xml_node& conf)
{
	AudioLabel = App->gui->CreateButton(iPoint(40, 40), &std::string(conf.child("AudioLabel").attribute("value").as_string("Audio menu")), ButtonType::idle_only, &label_title_rec, false);
	AudioLabel->SetFont(App->font->Triforce48);
	((Gui*)AudioLabel)->SetListener(this);
	AudioLabel->SetVisible(false);
	int X_pos = App->win->GetWindowWHalf() - (int)(idle_button_rect.w * 0.5f);
	MasterVolume = App->gui->CreateButton(iPoint(X_pos, 200), &std::string(conf.child("MasterVolume").attribute("value").as_string("Master Volume")), ButtonType::idle_hover_pressed, &idle_button_rect, &hover_button_rect, &pressed_button_rect, false);
	MasterVolume->SetFont(App->font->Sherwood20);
	((Gui*)MasterVolume)->SetListener(this);
	MasterVolume->SetVisible(false);
	MasterVolume->Focusable(true);
	/*
	MusicVolume = App->gui->CreateButton(iPoint(X_pos, 310), &std::string(conf.child("MusicVolume").attribute("value").as_string("Music Volume")), ButtonType::idle_hover_pressed, &idle_button_rect, &hover_button_rect, &pressed_button_rect, false);
	MusicVolume->SetFont(App->font->Sherwood20);
	((Gui*)MusicVolume)->SetListener(this);
	MusicVolume->SetVisible(false);
	MusicVolume->Focusable(true);
	SFXVolume = App->gui->CreateButton(iPoint(X_pos, 420), &std::string(conf.child("SFXVolume").attribute("value").as_string("SFX Volume")), ButtonType::idle_hover_pressed, &idle_button_rect, &hover_button_rect, &pressed_button_rect, false);
	SFXVolume->SetFont(App->font->Sherwood20);
	((Gui*)SFXVolume)->SetListener(this);
	SFXVolume->SetVisible(false);
	SFXVolume->Focusable(true);
	*/
	back = App->gui->CreateButton(iPoint(920, 600), &std::string(conf.child("back").attribute("value").as_string("Back")), ButtonType::idle_hover_pressed, &idle_button_rect, &hover_button_rect, &pressed_button_rect, false);
	back->SetFont(App->font->Sherwood20);
	((Gui*)back)->SetListener(this);
	back->SetVisible(false);
	back->Focusable(true);

	buttons.push_back(MasterVolume);
	//buttons.push_back(MusicVolume);
	//buttons.push_back(SFXVolume);
	buttons.push_back(back);

	return true;
};

bool S_OptionsAudio::Start()
{
	AudioLabel->SetVisible(true);
	MasterVolume->SetVisible(true);
	//MusicVolume->SetVisible(true);
	//SFXVolume->SetVisible(true);
	back->SetVisible(true);

	App->gui->SetFocus(buttons.front());

	return true;
}

bool S_OptionsAudio::Update()
{
	MenuInput(&buttons);
	return true;
}

bool S_OptionsAudio::Clean()
{
	AudioLabel->SetVisible(false);
	MasterVolume->SetVisible(false);
	//MusicVolume->SetVisible(false);
	//SFXVolume->SetVisible(false);
	back->SetVisible(false);
	return true;
}

void S_OptionsAudio::OnGui(Gui* ui, GuiEvent event)
{
	if ((ui == (Gui*)back) && (event == GuiEvent::mouse_lclk_down))
	{
		App->scene->Show(Scene_ID::options);
	}
}

bool S_OptionsAudio::Save(pugi::xml_node& node) const
{
	return true;
}

bool S_OptionsAudio::Load(pugi::xml_node& node)
{
	return true;
}


text:
echo "Building..."
npm run build

echo "Initializing..."
node index.js --port=8080


text:
/**
 * WordPress dependencies
 */
import { sprintf, __, _x } from '@wordpress/i18n';
import { createInterpolateElement } from '@wordpress/element';

/**
 * Internal dependencies
 */
import Data from 'googlesitekit-data';
import { MODULES_PAGESPEED_INSIGHTS } from '../../datastore/constants';
import { CORE_SITE } from '../../../../googlesitekit/datastore/site/constants';
import Link from '../../../../components/Link';
const { useSelect } = Data;

export default function ReportDetailsLink() {
	const referenceURL = useSelect( ( select ) =>
		select( CORE_SITE ).getCurrentReferenceURL()
	);
	const pagespeedInsightsURL = useSelect( ( select ) =>
		select( MODULES_PAGESPEED_INSIGHTS ).getServiceURL( {
			path: 'report',
			query: { url: referenceURL },
		} )
	);

	return (

			{ createInterpolateElement(
				sprintf(
					/* translators: %s: link with translated service name */
					__( 'View details at %s', 'google-site-kit' ),
					`${ _x(
						'PageSpeed Insights',
						'Service name',
						'google-site-kit'
					) }`
				),
				{
					a: <Link href={ pagespeedInsightsURL } external />,
				}
			) }

	);
}


text:
package com.ansorgit.plugins.bash.lang.parser.builtin;

import java.util.List;

import org.junit.Test;
import com.ansorgit.plugins.bash.lang.LanguageBuiltins;
import com.ansorgit.plugins.bash.lang.parser.BashElementTypes;
import com.ansorgit.plugins.bash.lang.parser.BashPsiBuilder;
import com.ansorgit.plugins.bash.lang.parser.MockPsiBuilder;
import com.ansorgit.plugins.bash.lang.parser.MockPsiTest;
import com.google.common.collect.Lists;
import com.intellij.openapi.util.Pair;
import com.intellij.psi.tree.IElementType;

/**
 * Date: 01.05.2009
 * Time: 21:16:12
 *
 * @author Joachim Ansorg
 */
public abstract class ExportCommandTest extends MockPsiTest {
    MockFunction parserFunction = new MockFunction() {
        @Override
        public boolean apply(BashPsiBuilder psi) {
            return new ExportCommand().parse(psi);
        }
    };

    MockFunction parserFunctionWithMarker = new MockFunction() {
        @Override
        public boolean apply(BashPsiBuilder psi) {
            return new ExportCommand().parse(psi);
        }

        @Override
        public boolean postCheck(MockPsiBuilder mockBuilder) {
            List<Pair<MockPsiBuilder.MockMarker, IElementType>> markers = mockBuilder.getDoneMarkers();
            if (markers.size() == 0) {
                return false;
            }

            //has to contain at least one variable def element marker
            for (Pair<MockPsiBuilder.MockMarker, IElementType> marker : markers) {
                if (marker.getSecond() == BashElementTypes.VAR_DEF_ELEMENT) {
                    return true;
                }
            }

            return false;
        }
    };

    @Test
    public void testBuiltin() {
        LanguageBuiltins.varDefCommands.contains("export");
    }

    @Test
    public void testParse() {
        //export a=1
        mockTest(parserFunctionWithMarker, Lists.newArrayList("export"), WORD, ASSIGNMENT_WORD, EQ, WORD);
        //export a
        mockTest(parserFunctionWithMarker, Lists.newArrayList("export"), WORD, WORD);
        //export a=1 b=2
        mockTest(parserFunctionWithMarker, Lists.newArrayList("export"),
                WORD, ASSIGNMENT_WORD, EQ, WORD, WHITESPACE, ASSIGNMENT_WORD, EQ, WORD);
    }

    @Test
    public void testComplicated() {
        //>out a=1 export a=1
        mockTest(parserFunction, Lists.newArrayList(">", "out", " ", "a", "=", "1", " ", "export"),
                GREATER_THAN, WORD, WHITESPACE, ASSIGNMENT_WORD, EQ, NUMBER, WHITESPACE, WORD,
                WHITESPACE, ASSIGNMENT_WORD, EQ, NUMBER);
    }

    @Test
    public void testArrayAssignment() throws Exception {
        //export a=(1 2 3)
        mockTest(parserFunction, Lists.newArrayList("export"), WORD, WORD, EQ, LEFT_PAREN, WORD, WHITESPACE, WORD, WHITESPACE, WORD, RIGHT_PAREN);

        //export a=(1 [10]=2 3)
        mockTest(parserFunction, Lists.newArrayList("export"), WORD, WORD, EQ, LEFT_PAREN, WORD, WHITESPACE, LEFT_SQUARE, NUMBER, RIGHT_SQUARE, EQ, WORD, WHITESPACE, WORD, RIGHT_PAREN);
    }
}


text:
![WMI metric][1]

## Overview

Get metrics from your Windows applications and servers with Windows Management Instrumentation (WMI) in real time to

- Visualize their performance.
- Correlate their activity with the rest of your applications.

**Note:** It is recommended that the [Windows performance counters check][2] be used instead in all cases due to its significantly lower overhead and thus better scalability.

## Setup

### Installation

If you are only collecting standard metrics from Microsoft Windows and other packaged applications, there are no installation steps. If you need to define new metrics to collect from your application, then you have a few options:

1. Submit performance counters using System.Diagnostics in .NET, then access them with WMI.
2. Implement a COM-based WMI provider for your application. You would typically only do this if you are using a non-.NET language.

To learn more about using System.Diagnostics, see the [PerformanceCounter Class][3]). After adding your metric you should be able to find it in WMI. To browse the WMI namespaces, you may find [WMI Explorer][4] useful. You can find the same information with Powershell using [Get-WmiObject][5]. Also, review the information in [Retrieving WMI metrics][6].

If you assign the new metric a category of My_New_Metric, the WMI path is
`\\<ComputerName>\ROOT\CIMV2:Win32_PerfFormattedData_My_New_Metric`

If the metric isn't showing up in WMI, try running `winmgmt /resyncperf` to force the computer to reregister the performance libraries with WMI.

### Configuration

1. Click the **Install Integration** button on the WMI Integration Tile.
2. Open the Datadog Agent Manager on the Windows server.
3. Edit the `Wmi Check` configuration.

```yaml
init_config:
instances:
  - class: Win32_OperatingSystem
    metrics:
      - [NumberOfProcesses, system.proc.count, gauge]
      - [NumberOfUsers, system.users.count, gauge]
  - class: Win32_PerfFormattedData_PerfProc_Process
    metrics:
      - [ThreadCount, proc.threads.count, gauge]
      - [VirtualBytes, proc.mem.virtual, gauge]
      - [PercentProcessorTime, proc.cpu_pct, gauge]
    tag_by: Name
  - class: Win32_PerfFormattedData_PerfProc_Process
    metrics:
      - [IOReadBytesPerSec, proc.io.bytes_read, gauge]
    tag_by: Name
    tag_queries:
      - [IDProcess, Win32_Process, Handle, CommandLine]
```

<div class="alert alert-info">
The default configuration uses the filter clause to limit the metrics pulled. Either set the filters to valid values or remove them as shown above to collect the metrics.
</div>

The metrics definitions include three components:

- Class property in WMI.
- Metric name as it appears in Datadog.
- The metric type.

The following sample configuration populates many more metrics on a Windows 2012 server.
```yaml
init_config:

instances:
  # Fetch the number of processes and users.
  - class: Win32_OperatingSystem
    metrics:
      - [NumberOfProcesses, system.proc.count, gauge]
      - [NumberOfUsers, system.users.count, gauge]

# Paging info
  - class: Win32_PerfFormattedData_PerfOS_Memory
    metrics:
      - [PageFaultsPersec, system.mem.page.faults, gauge]
      - [PageReadsPersec, system.mem.page.reads, gauge]
      - [PagesInputPersec, system.mem.page.input, gauge]
      - [AvailableMBytes, system.mem.avail, gauge]
      - [CommitLimit, system.mem.limit, gauge]
      # Cache bytes metric for disk info
      - [CacheBytes, system.mem.fs_cache, gauge]

# Paging file
  - class: Win32_PerfFormattedData_PerfOS_PagingFile
    metrics:
      - [PercentUsage, system.mem.page.pct, gauge]
    tag_by: Name
  # Fetch the number of processes
  - class: Win32_PerfFormattedData_PerfOS_System
    metrics:
      - [ProcessorQueueLength, system.proc.queue, gauge]

  - class: Win32_PerfFormattedData_PerfOS_Processor
    metrics:
      - [PercentProcessorTime, system.cpu.pct, gauge]
      - [PercentPrivilegedTime, system.cpu.priv.pct, gauge]
      - [PercentDPCTime, system.cpu.dpc.pct, gauge]
      - [PercentInterruptTime, system.cpu.interrupt.pct, gauge]
      - [DPCsQueuedPersec, system.cpu.dpc.queue, gauge]
    tag_by: Name

# Context switches
  - class: Win32_PerfFormattedData_PerfProc_Thread
    metrics:
      - [ContextSwitchesPersec, system.proc.context_switches, gauge]
    filters:
      - Name: _total/_total

# Disk info
  - class: Win32_PerfFormattedData_PerfDisk_LogicalDisk
    metrics:
      - [PercentFreeSpace, system.disk.free.pct, gauge]
      - [PercentIdleTime, system.disk.idle, gauge]
      - [AvgDisksecPerRead, system.disk.read_sec, gauge]
      - [AvgDisksecPerWrite, system.disk.write_sec, gauge]
      - [DiskWritesPersec, system.disk.writes, gauge]
      - [DiskReadsPersec, system.disk.reads, gauge]
      - [AvgDiskQueueLength, system.disk.queue, gauge]
    tag_by: Name

  - class: Win32_PerfFormattedData_Tcpip_TCPv4
    metrics:
      - [SegmentsRetransmittedPersec, system.net.tcp.retrans_seg, gauge]
    tag_by: Name
```
#### Configuration options

_This feature is available starting with version 5.3 of the agent_

Each WMI query has 2 required options, `class` and `metrics` and six optional options, `host`, `namespace`, `filters`, `provider`, `tag_by`, `constant_tags` and `tag_queries`.

- `class` is the name of the WMI class, for example `Win32_OperatingSystem` or `Win32_PerfFormattedData_PerfProc_Process`. You can find many of the standard class names on the [MSDN docs][7]. The `Win32_FormattedData_*` classes provide many useful performance counters by default.

- `metrics` is a list of metrics you want to capture, with each item in the
  list being a set of `[<WMI_PROPERTY_NAME>, <METRIC_NAME>, <METRIC_TYPE>]`:

  - `<WMI_PROPERTY_NAME>` is something like `NumberOfUsers` or `ThreadCount`. The standard properties are also available on the MSDN docs for each class.
  - `<METRIC_NAME>` is the name you want to show up in Datadog.
  - `<METRIC_TYPE>` is from the standard choices for all agent checks, such as gauge, rate, histogram or counter.

- `host` is the optional target of the WMI query, `localhost` is assumed by default. If you set this option, make sure that Remote Management is enabled on the target host. See [Configure Remote Management in Server Manager][8] for more information.

- `namespace` is the optional WMI namespace to connect to (default to `cimv2`).

- `filters` is a list of filters on the WMI query you may want. For example, for a process-based WMI class you may want metrics for only certain processes running on your machine, so you could add a filter for each process name. You can also use the '%' character as a wildcard.

- `provider` is the optional WMI provider (default to `32` on Datadog Agent 32-bit or `64`). It is used to request WMI data from the non-default provider. Available options are: `32` or `64`.
  See [MSDN][9] for more information.

- `tag_by` optionally lets you tag each metric with a property from the WMI class you're using. This is only useful when you have multiple values for your WMI query.

- `tags` optionally lets you tag each metric with a set of fixed values.

- `tag_queries` optionally lets you specify a list of queries, to tag metrics with a target class property. Each item in the list is a set of `[<LINK_SOURCE_PROPERTY>, <TARGET_CLASS>, <LINK_TARGET_CLASS_PROPERTY>, <TARGET_PROPERTY>]` where:

  - `<LINK_SOURCE_PROPERTY>` contains the link value
  - `<TARGET_CLASS>` is the class to link to
  - `<LINK_TARGET_CLASS_PROPERTY>` is the target class property to link to
  - `<TARGET_PROPERTY>` contains the value to tag with

  It translates to a WMI query:
  `SELECT '<TARGET_PROPERTY>' FROM '<TARGET_CLASS>' WHERE '<LINK_TARGET_CLASS_PROPERTY>' = '<LINK_SOURCE_PROPERTY>'`

##### Example

The setting `[IDProcess, Win32_Process, Handle, CommandLine]` tags each process with its command line. Any instance number is removed from tag_by values, for example: `name:process#1` => `name:process. NB`. The Agent must be running under an **Administrator** account for this to work as the `CommandLine` property is not accessible to non-admins.

### Validation

Run the [Agent's status subcommand][10] and look for `wmi_check` under the Checks section.

## Data Collected

### Metrics

All metrics collected by the WMI check are forwarded to Datadog as [custom metrics][11], which may impact your [billing][12].

### Events

The WMI check does not include any events.

### Service Checks

The WMI check does not include any service checks.

## Troubleshooting

Need help? Contact [Datadog support][13].

[1]: https://raw.githubusercontent.com/DataDog/integrations-core/master/wmi_check/images/wmimetric.png
[2]: https://docs.datadoghq.com/integrations/windows_performance_counters/
[3]: https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.performancecounter
[4]: https://github.com/vinaypamnani/wmie2/releases
[5]: https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/get-wmiobject
[6]: https://docs.datadoghq.com/integrations/guide/retrieving-wmi-metrics/
[7]: https://msdn.microsoft.com/en-us/library/windows/desktop/aa394084.aspx
[8]: https://technet.microsoft.com/en-us/library/Hh921475.aspx
[9]: https://msdn.microsoft.com/en-us/library/aa393067.aspx
[10]: https://docs.datadoghq.com/agent/guide/agent-commands/#agent-status-and-information
[11]: https://docs.datadoghq.com/developers/metrics/custom_metrics/
[12]: https://docs.datadoghq.com/account_management/billing/custom_metrics/
[13]: https://docs.datadoghq.com/help/


text:
import os
import pynja
import repo

# This is a pseudo-projects that makes linking against Qt easier.
# There is no output here, just linkLibraries and runtimeDeps variables being set.

@pynja.project
class qt_xml(repo.CppProject):
    def emit(self):
        if self.variant.linkage == "sta":
            raise Exception("Qt static libs not supported.")
        self.qt_add_lib_dependency("Qt5Xml")
        self.add_cpplib_dependency("qt_core")
        self.propagate_lib_dependencies()


text:
<?php

/**
 * Generated 2019-11-16T20:28:28+00:00 16.0.19506.12022
 */
namespace Office365\SharePoint\WebParts;

use Office365\SharePoint\BaseEntity;

/**
 * Represents
 * a Web Part on a Web Part
 * Page.
 */
class WebPart extends BaseEntity
{
    /**
     * Gets or
     * sets the export mode of a Web Part.
     * @return integer
     */
    public function getExportMode()
    {
        if (!$this->isPropertyAvailable("ExportMode")) {
            return null;
        }
        return $this->getProperty("ExportMode");
    }
    /**
     * Gets or
     * sets the export mode of a Web Part.
     * @var integer
     */
    public function setExportMode($value)
    {
        $this->setProperty("ExportMode", $value, true);
    }
    /**
     * Specifies
     * whether a Web Part is
     * displayed on a Web Part Page.If
     * "true", the Web Part MUST be hidden. Web Parts that are hidden MUST
     * NOT be displayed on the page to the end user, but SHOULD still participate
     * normally in the rendering of the page. The default value is "false".
     * @return bool
     */
    public function getHidden()
    {
        if (!$this->isPropertyAvailable("Hidden")) {
            return null;
        }
        return $this->getProperty("Hidden");
    }
    /**
     * Specifies
     * whether a Web Part is
     * displayed on a Web Part Page.If
     * "true", the Web Part MUST be hidden. Web Parts that are hidden MUST
     * NOT be displayed on the page to the end user, but SHOULD still participate
     * normally in the rendering of the page. The default value is "false".
     * @var bool
     */
    public function setHidden($value)
    {
        $this->setProperty("Hidden", $value, true);
    }
    /**
     * Specifies
     * whether a Web Part is
     * currently closed on a Web Part Page.If
     * "true", the Web Part is closed. Web Parts that are closed MUST NOT be
     * displayed on the page, and MUST NOT participate normally in the rendering of
     * the page. The default value is "false".To open or close a Web Part, see WebPartDefinition.OpenWebPart,
     * as specified in section 3.2.5.149.2.1.4,
     * and WebPartDefinition.CloseWebPart, as specified in section 3.2.5.149.2.1.1.
     * @return bool
     */
    public function getIsClosed()
    {
        if (!$this->isPropertyAvailable("IsClosed")) {
            return null;
        }
        return $this->getProperty("IsClosed");
    }
    /**
     * Specifies
     * whether a Web Part is
     * currently closed on a Web Part Page.If
     * "true", the Web Part is closed. Web Parts that are closed MUST NOT be
     * displayed on the page, and MUST NOT participate normally in the rendering of
     * the page. The default value is "false".To open or close a Web Part, see WebPartDefinition.OpenWebPart,
     * as specified in section 3.2.5.149.2.1.4,
     * and WebPartDefinition.CloseWebPart, as specified in section 3.2.5.149.2.1.1.
     * @var bool
     */
    public function setIsClosed($value)
    {
        $this->setProperty("IsClosed", $value, true);
    }
    /**
     * Specifies
     * a string that is concatenated with the Title property value to form a
     * complete title for a Web Part. The
     * default value is an empty string ("").
     * @return string
     */
    public function getSubtitle()
    {
        if (!$this->isPropertyAvailable("Subtitle")) {
            return null;
        }
        return $this->getProperty("Subtitle");
    }
    /**
     * Specifies
     * a string that is concatenated with the Title property value to form a
     * complete title for a Web Part. The
     * default value is an empty string ("").
     * @var string
     */
    public function setSubtitle($value)
    {
        $this->setProperty("Subtitle", $value, true);
    }
    /**
     * Specifies
     * the title of a Web Part.If this
     * property is set to NULL, the title of the Web Part MUST instead be reset to its
     * default value if one is specified in the Web Part's definition.
     * @return string
     */
    public function getTitle()
    {
        if (!$this->isPropertyAvailable("Title")) {
            return null;
        }
        return $this->getProperty("Title");
    }
    /**
     * Specifies
     * the title of a Web Part.If this
     * property is set to NULL, the title of the Web Part MUST instead be reset to its
     * default value if one is specified in the Web Part's definition.
     * @var string
     */
    public function setTitle($value)
    {
        $this->setProperty("Title", $value, true);
    }
    /**
     * Specifies
     * a URL
     * to the supplemental information about a Web Part.If this
     * property is set to NULL, the title URL of the Web Part MUST instead be reset to
     * its default value if one is specified in the Web Part's definition.The value of this property SHOULD be a valid URL, but the
     * protocol server MAY accept other strings without validating them.
     * @return string
     */
    public function getTitleUrl()
    {
        if (!$this->isPropertyAvailable("TitleUrl")) {
            return null;
        }
        return $this->getProperty("TitleUrl");
    }
    /**
     * Specifies
     * a URL
     * to the supplemental information about a Web Part.If this
     * property is set to NULL, the title URL of the Web Part MUST instead be reset to
     * its default value if one is specified in the Web Part's definition.The value of this property SHOULD be a valid URL, but the
     * protocol server MAY accept other strings without validating them.
     * @var string
     */
    public function setTitleUrl($value)
    {
        $this->setProperty("TitleUrl", $value, true);
    }
    /**
     * Specifies
     * the index position of a Web Part within the Web Part
     * zone.The value
     * is the numerical order of a Web Part within the Web Part zone. The first Web
     * Part in a Web Part zone MUST have an index value of zero.
     * @return integer
     */
    public function getZoneIndex()
    {
        if (!$this->isPropertyAvailable("ZoneIndex")) {
            return null;
        }
        return $this->getProperty("ZoneIndex");
    }
    /**
     * Specifies
     * the index position of a Web Part within the Web Part
     * zone.The value
     * is the numerical order of a Web Part within the Web Part zone. The first Web
     * Part in a Web Part zone MUST have an index value of zero.
     * @var integer
     */
    public function setZoneIndex($value)
    {
        $this->setProperty("ZoneIndex", $value, true);
    }
}


text:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MatchPos : MonoBehaviour {
	public Transform thingToMatch;
	public bool matchPos;
	public Vector3 posOffset;
	public bool matchRotX = true;
	public bool matchRotY = true;
	public bool matchRotZ = true;

	// Use this for initialization
	void Start () {

	}

	// Update is called once per frame
	void Update () {
		if (matchPos) {
			transform.position = thingToMatch.position;
			transform.position += posOffset;
		}

		Vector3 eulerangles = thingToMatch.rotation.eulerAngles;
		Vector3 myangles = transform.rotation.eulerAngles;
		transform.rotation = Quaternion.Euler (matchRotX ? eulerangles.x : myangles.x, matchRotY ? eulerangles.y : myangles.y, matchRotZ ? eulerangles.z : myangles.z);
	}
}


text:
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
import matplotlib.animation as animation
import matplotlib.cm as cm
import numpy as np
from fredpy import series,window_equalize
import subprocess

# Convert the mp4 video to ogg format
# makeOgg = 'ffmpeg -i US_Inflation_Unemployment_Monthly_BP_Filtered.mp4 -acodec libvorbis -ac 2 -ab 128k -ar 44100 -b:v 1800k  US_Inflation_Unemployment_Monthly_BP_Filtered.ogv'
# makeOgg = 'ffmpeg -i US_Inflation_Unemployment_Monthly_BP_Filtered.mp4 -acodec libtheora -ac 2 -ab 128k -ar 44100 -b:v 1800k  US_Inflation_Unemployment_Monthly_BP_Filtered.ogv'
# subprocess.call(makeOgg,shell=True)

# makeWebm = 'ffmpeg -i US_Inflation_Unemployment_Monthly_BP_Filtered.mp4 -c:v libvpx -crf 10 -b:v 1M -c:a libvorbis US_Inflation_Unemployment_Monthly_BP_Filtered.webm'
makeWebm = 'ffmpeg -i US_Inflation_Unemployment_Monthly_BP_Filtered.mp4 -acodec libvorbis -vcodec libtheora -ac 2 -ab 96k -ar 44100 -b:v 819200 US_Inflation_Unemployment_Monthly_BP_Filtered.ogv'
subprocess.call(makeWebm,shell=True)

# -s 1280×720


text:
package org.apache.mxnet.init

import org.apache.mxnet.init.Base._

import scala.collection.mutable.ListBuffer

class LibInfo {
  /**
    * Get the list of the symbol ids
    * @param symbolList Pass in an empty ListBuffer and obtain a list of operator IDs
    * @return Callback result
    */
  @native def mxSymbolListAtomicSymbolCreators(symbolList: ListBuffer[SymbolHandle]): Int

  /**
    * Get the detailed information of an operator
    * @param handle The ID of the operator
    * @param name Name of the operator
    * @param desc Description of the operator
    * @param numArgs Number of arguments
    * @param argNames Argument names
    * @param argTypes Argument types
    * @param argDescs Argument descriptions
    * @param keyVarNumArgs Kwargs number
    * @return Callback result
    */
  @native def mxSymbolGetAtomicSymbolInfo(handle: SymbolHandle,
                                          name: RefString,
                                          desc: RefString,
                                          numArgs: RefInt,
                                          argNames: ListBuffer[String],
                                          argTypes: ListBuffer[String],
                                          argDescs: ListBuffer[String],
                                          keyVarNumArgs: RefString): Int
  /**
    * Get the name list of all operators
    * @param names Names of all operator
    * @return Callback result
    */
  @native def mxListAllOpNames(names: ListBuffer[String]): Int

  /**
    * Get operator ID from its name
    * @param opName Operator name
    * @param opHandle Operator ID
    * @return Callback result
    */
  @native def nnGetOpHandle(opName: String, opHandle: RefLong): Int
}


text:
project_path: /web/tools/_project.yaml
book_path: /web/tools/_book.yaml
description: Use dispositivos virtuais no Device Mode do Chrome para criar sites que priorizam os dispositivos móveis.

{# wf_updated_on: 2016-03-07 #}
{# wf_published_on: 2015-04-13 #}

# Simular dispositivos móveis com Device Mode {: .page-title }

{% include "web/_shared/contributors/pbakaus.html" %}

Use o Device Mode do Chrome DevTools para criar sites totalmente responsivos e que priorizam dispositivos móveis. Saiba como usá-lo para simular diversos dispositivos diferentes e seus recursos.

Aviso: O Device Mode oferece uma boa aproximação de como seu site
ficará em um dispositivo móvel, mas, para ter uma perspectiva completa, teste
seu site em dispositivos reais. O DevTools não pode emular as características
de desempenho de dispositivos móveis, por exemplo.

## Resumo

* Emule seu site em [diferentes tamanhos e resoluções de tela](/web/tools/chrome-devtools/device-mode/emulate-mobile-viewports), incluindo telas Retina.
* Projete com responsividade visualizando e [inspecionando consultas de mídia CSS](/web/tools/chrome-devtools/iterate/device-mode/media-queries).
* Avalie o desempenho do seu site usando o [emulador de rede](/web/tools/chrome-devtools/network-performance/network-conditions), sem afetar o tráfego de outras abas.
* [Simule entradas de dispositivo](/web/tools/chrome-devtools/device-mode/device-input-and-sensors) com precisão para eventos de toque, geolocalização e orientação do dispositivo

## Alternar Device Mode {: #toggle }

Use o botão **Device Mode** para ativar ou desativar o Device Mode.

![Início do Device Mode](imgs/device-mode-initial-view.png)

Quando o Device Mode está ativado, o ícone é azul
(![Device Mode ativado](imgs/device-mode-on.png)).

Quando ele está desativado, o ícone é cinza
(![Device Mode desativado](imgs/device-mode-off.png)).

O Device Mode é ativado por padrão.

Você também pode alternar o Device Mode pressionando
Command+Shift+M (Mac) ou
Ctrl+Shift+M (Windows, Linux).
Para usar esse atalho, o mouse deve estar focado na janela do DevTools.
Se ele estiver focado na janela de visualização, você acionará o [atalho de alternar usuário
do Chrome](https://support.google.com/chrome/answer/157179).

{# wf_devsite_translation #}


text:
export interface IAngularSearchWebPartProps {
  description: string;
  contentTypes: string;
}


text:
define(
	 ({
		viewer: {
			common: {
				close: "Cerrar"
			},
			loading: {
				step1: "Cargando aplicación",
				step2: "Cargando datos",
				step3: "Inicializando",
				loadBuilder: "Cambiando a Builder",
				long: "Map Journal se está inicializando",
				long2: "Gracias por esperar",
				failButton: "Volver a cargar la aplicación"
			},
			signin: {
				title: "Se requiere autenticación",
				explainViewer: "Inicia sesión con una cuenta en %PORTAL_LINK% para acceder a la aplicación.",
				explainBuilder: "Inicia sesión con una cuenta en %PORTAL_LINK% para configurar la aplicación."
			},
			errors: {
				boxTitle: "Se ha producido un error",
				invalidConfig: "Configuración no válida",
				invalidConfigNoApp: "No se ha especificado el identificador de la aplicación en index.html.",
				unspecifiedConfigOwner: "El propietario autorizado no se ha configurado.",
				invalidConfigOwner: "El propietario de la aplicación no está autorizado.",
				createMap: "No se puede crear el mapa",
				invalidApp: "No se puede acceder a %TPL_NAME% o no existe.",
				appLoadingFail: "Se ha producido un error, %TPL_NAME% no se cargó correctamente.",
				notConfiguredDesktop: "La aplicación no se ha configurado todavía.",
				notConfiguredMobile: "El builder de %TPL_NAME% no es compatible con esta resolución de pantalla.",
				notAuthorized: "No tienes autorización para acceder a esta aplicación",
				noBuilderIE: "El builder no es compatible con versiones de Internet Explorer anteriores a la %VERSION%. %UPGRADE%",
				noViewerIE: "Esta aplicación no es compatible con versiones de Internet Explorer anteriores a la %VERSION%. %UPGRADE%",
				upgradeBrowser: "Actualiza tu navegador.",
				mapLoadingFail: "Se ha producido un error, el mapa no se cargó correctamente.",
				signOut: "Cerrar sesión"
			},
			mobileView: {
				tapForDetails: "Tocar para ver detalles",
				clickForDetails: "Más información",
				swipeToExplore: "Barrer para explorar",
				tapForMap: "Tocar para volver al mapa",
				clickForMap: "VOLVER AL MAPA"
			},
			floatLayout: {
				scroll: "Desplazar"
			},
			sideLayout: {
				scroll: "Desplázate hacia abajo para obtener más información"
			},
			mainStage: {
				back: "Atrás"
			},
			headerFromCommon: {
				storymapsText: "Un mapa de historias",
				builderButton: "Editar",
				bitlyTooltip: "Consigue un enlace corto a la aplicación",
				templateTitle: "Establecer título de plantilla",
				templateSubtitle: "Establecer subtítulo de plantilla",
				share: "Compartir"
			},
			overviewFromCommon: {
				title: "Mapa de vista general"
			},
			legendFromCommon: {
				title: "Leyenda"
			},
			shareFromCommon: {
				copy: "Copiar",
				copied: "Copiado",
				open: "Abrir",
				embed: "Integrar en página web",
				embedExplain: "Usa el siguiente código HTML para integrar el diario en una página web.",
				size: "Tamaño (ancho/alto):"
			}
        }
    })
);


text:
package ru.lotnyk.http.model;

import java.sql.Timestamp;

/**
 * Class User.
 * @author Roman Lotnyk(romanlotnik@yandex.ru)
 * @version 1
 * @since 20.07.2017
 */
public class User {
    /**
     * name.
     */
    private String name;
    /**
     * login.
     */
    private String login;
    /**
     * email.
     */
    private String email;
    /**
     * date.
     */
    private Timestamp date;

    /**
     * Constructor.
     * @param name name.
     * @param login login.
     * @param email email.
     * @param date date.
     */
    public User(String name, String login, String email, Timestamp date) {
        this.name = name;
        this.login = login;
        this.email = email;
        this.date = date;
    }

    /**
     * getter.
     * @return return
     */
    public String getName() {
        return this.name;
    }
    /**
     * getter.
     * @return return
     */
    public String getLogin() {
        return this.login;
    }
    /**
     * getter.
     * @return return
     */
    public String getEmail() {
        return this.email;
    }
    /**
     * getter.
     * @return return
     */
    public Timestamp getDate() {
        return this.date;
    }

    /**
     * toString.
     * @return return
     */
    @Override
    public String toString() {
        return String.format("Name: %s, Login: %s, Email: %s, Date: %s", this.name,
                this.login, this.email, this.date);
    }
}


text:
namespace Appleseed.Framework.Settings
{
    using System;
    using System.Data.SqlClient;
    using System.Web;

    using Appleseed.Framework.Data;
    using Appleseed.Framework.Exceptions;

    /// <summary>
    /// The Database
    /// </summary>
    public class Database
    {
        #region Properties

        /// <summary>
        ///   Gets the database version.
        /// </summary>
        /// <value>The database version.</value>
        public static int DatabaseVersion
        {
            // by Manu 16/10/2003
            // Added 2 mods:
            // 1) Rb version is created if it is missed.
            // This is especially good for empty databases.
            // Be aware that this can break compatibility with 1613 version
            // 2) Connection problems are thrown immediately as errors.
            get
            {
                return GetDatabaseVersion();
            }
        }

        private static int GetDatabaseVersion()
        {
            if (HttpContext.Current.Application[dbKey] == null)
            {
                try
                {
                    // Create rb version if it is missing
                    const string CreateRbVersions =
                        "IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N\'[rb_Versions]\') AND OBJECTPROPERTY(id, N\'IsUserTable\') = 1) " +
                        "CREATE TABLE [rb_Versions] ([Release] [int] NOT NULL , [Version] [nvarchar] (50) NULL , [ReleaseDate] [datetime] NULL ) ON [PRIMARY]";
                    DBHelper.ExeSQL(CreateRbVersions);
                }
                catch (SqlException ex)
                {
                    throw new DatabaseUnreachableException(
                        "Failed to get Database Version - most likely cannot connect to db or no permission.", ex);

                    // Jes1111
                    // Appleseed.Framework.Configuration.ErrorHandler.HandleException("If this fails most likely cannot connect to db or no permission", ex);
                    // If this fails most likely cannot connect to db or no permission
                    // throw;
                }

                var version =
                    DBHelper.ExecuteSqlScalar<int?>("SELECT TOP 1 Release FROM rb_Versions ORDER BY Release DESC");

                // Caches db version
                var curVersion = version != null ? Int32.Parse(version.ToString()) : 1110;
                HttpContext.Current.Application.Lock();
                HttpContext.Current.Application[dbKey] = curVersion;
                HttpContext.Current.Application.UnLock();
            }

            return (int)HttpContext.Current.Application[dbKey];
        }

        /// <summary>
        ///   Gets the db key.
        /// </summary>
        /// <value>The db key.</value>
        public static string dbKey
        {
            get
            {
                var currentdatabase = "CurrentDatabase";
                if (Config.EnableMultiDbSupport)
                {
                    currentdatabase = string.Format(
                        "DatabaseVersion_{0}_{1}",
                        Config.SqlConnectionString.DataSource,
                        Config.SqlConnectionString.Database); // For multi-db support
                }

                return currentdatabase;
            }
        }

        #endregion
    }
}


text:
from __future__ import print_function
import os, sys, re

def getTerminalSize():
  """
  returns (lines:int, cols:int)
  """
  import os, struct
  def ioctl_GWINSZ(fd):
      import fcntl, termios
      return struct.unpack("hh", fcntl.ioctl(fd, termios.TIOCGWINSZ, "1234"))
  # try stdin, stdout, stderr
  if (not sys.stdout.isatty()):
    return (25, 80)

  fd = 1
  try:
    return ioctl_GWINSZ(fd)
  except:
    pass
  # try os.ctermid()
  try:
    fd = os.open(os.ctermid(), os.O_RDONLY)
    try:
      return ioctl_GWINSZ(fd)
    finally:
      os.close(fd)
  except:
    pass
  # try `stty size`
  try:
    return tuple(int(x) for x in os.popen("stty size", "r").read().split())
  except:
    pass
  # try environment variables
  try:
    return tuple(int(os.getenv(var)) for var in ("LINES", "COLUMNS"))
  except:
    pass
  # i give up. return default.
  return (25, 80)

def main():
  rows, columns = getTerminalSize()

  s = "rows: "+str(rows)+" columns: "+str(columns)+"\n"

  sys.stderr.write(s)

if ( __name__ == '__main__'): main()