text:
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package org.chromium.net.impl;

import androidx.annotation.IntDef;

import org.chromium.net.UploadDataProvider;
import org.chromium.net.UploadDataSink;

import java.io.IOException;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.nio.ByteBuffer;
import java.util.Locale;
import java.util.concurrent.Executor;
import java.util.concurrent.RejectedExecutionException;
import java.util.concurrent.atomic.AtomicReference;
/**
 * Base class for Java UrlRequest implementations of UploadDataSink. Handles asynchronicity and
 * manages the executors for this upload.
 */
public abstract class JavaUploadDataSinkBase extends UploadDataSink {
    @IntDef({SinkState.AWAITING_READ_RESULT, SinkState.AWAITING_REWIND_RESULT, SinkState.UPLOADING,
            SinkState.NOT_STARTED})
    @Retention(RetentionPolicy.SOURCE)
    @interface SinkState {
        int AWAITING_READ_RESULT = 0;
        int AWAITING_REWIND_RESULT = 1;
        int UPLOADING = 2;
        int NOT_STARTED = 3;
    }

    public static final int DEFAULT_UPLOAD_BUFFER_SIZE = 8192;

    private final AtomicReference<Integer /*SinkState*/> mSinkState =
            new AtomicReference<>(SinkState.NOT_STARTED);
    private final Executor mUserUploadExecutor;
    private final Executor mExecutor;
    private final UploadDataProvider mUploadProvider;
    private ByteBuffer mBuffer;
    /** This holds the total bytes to send (the content-length). -1 if unknown. */
    private long mTotalBytes;
    /** This holds the bytes written so far */
    private long mWrittenBytes;

    public JavaUploadDataSinkBase(
            final Executor userExecutor, Executor executor, UploadDataProvider provider) {
        mUserUploadExecutor = new Executor() {
            @Override
            public void execute(Runnable runnable) {
                try {
                    userExecutor.execute(runnable);
                } catch (RejectedExecutionException e) {
                    processUploadError(e);
                }
            }
        };
        mExecutor = executor;
        mUploadProvider = provider;
    }

    @Override
    public void onReadSucceeded(final boolean finalChunk) {
        if (!mSinkState.compareAndSet(/* expected= */ SinkState.AWAITING_READ_RESULT,
                    /* updated= */ SinkState.UPLOADING)) {
            throw new IllegalStateException(
                    "onReadSucceeded() called when not awaiting a read result; in state: "
                    + mSinkState.get());
        }
        mExecutor.execute(getErrorSettingRunnable(new JavaUrlRequestUtils.CheckedRunnable() {
            @Override
            public void run() throws Exception {
                mBuffer.flip();
                if (mTotalBytes != -1 && mTotalBytes - mWrittenBytes < mBuffer.remaining()) {
                    processUploadError(
                            new IllegalArgumentException(String.format(Locale.getDefault(),
                                    "Read upload data length %d exceeds expected length %d",
                                    mWrittenBytes + mBuffer.remaining(), mTotalBytes)));
                    return;
                }

                mWrittenBytes += processSuccessfulRead(mBuffer);

                if (mWrittenBytes < mTotalBytes || (mTotalBytes == -1 && !finalChunk)) {
                    mBuffer.clear();
                    mSinkState.set(SinkState.AWAITING_READ_RESULT);
                    executeOnUploadExecutor(new JavaUrlRequestUtils.CheckedRunnable() {
                        @Override
                        public void run() throws Exception {
                            mUploadProvider.read(JavaUploadDataSinkBase.this, mBuffer);
                        }
                    });
                } else if (mTotalBytes == -1) {
                    finish();
                } else if (mTotalBytes == mWrittenBytes) {
                    finish();
                } else {
                    processUploadError(
                            new IllegalArgumentException(String.format(Locale.getDefault(),
                                    "Read upload data length %d exceeds expected length %d",
                                    mWrittenBytes, mTotalBytes)));
                }
            }
        }));
    }

    @Override
    public void onRewindSucceeded() {
        if (!mSinkState.compareAndSet(/* expected= */ SinkState.AWAITING_REWIND_RESULT,
                    /* updated= */ SinkState.UPLOADING)) {
            throw new IllegalStateException(
                    "onRewindSucceeded() called when not awaiting a rewind; in state: "
                    + mSinkState.get());
        }
        startRead();
    }

    @Override
    public void onReadError(Exception exception) {
        processUploadError(exception);
    }

    @Override
    public void onRewindError(Exception exception) {
        processUploadError(exception);
    }

    private void startRead() {
        mExecutor.execute(getErrorSettingRunnable(new JavaUrlRequestUtils.CheckedRunnable() {
            @Override
            public void run() throws Exception {
                initializeRead();
                mSinkState.set(SinkState.AWAITING_READ_RESULT);
                executeOnUploadExecutor(new JavaUrlRequestUtils.CheckedRunnable() {
                    @Override
                    public void run() throws Exception {
                        mUploadProvider.read(JavaUploadDataSinkBase.this, mBuffer);
                    }
                });
            }
        }));
    }

    /**
     * Helper method to execute a checked runnable on the upload executor and process any errors
     * that occur as upload errors.
     *
     * @param runnable the runnable to attempt to run and check for errors
     */
    private void executeOnUploadExecutor(JavaUrlRequestUtils.CheckedRunnable runnable) {
        try {
            mUserUploadExecutor.execute(getUploadErrorSettingRunnable(runnable));
        } catch (RejectedExecutionException e) {
            processUploadError(e);
        }
    }

    /**
     * Starts the upload. This method can be called multiple times. If it is not the first time it
     * is called the {@link UploadDataProvider} must rewind.
     *
     * @param firstTime true if this is the first time this {@link UploadDataSink} has started an
     *                  upload
     */
    public void start(final boolean firstTime) {
        executeOnUploadExecutor(new JavaUrlRequestUtils.CheckedRunnable() {
            @Override
            public void run() throws Exception {
                mTotalBytes = mUploadProvider.getLength();
                if (mTotalBytes == 0) {
                    finish();
                } else {
                    // If we know how much data we have to upload, and it's small, we can save
                    // memory by allocating a reasonably sized buffer to read into.
                    if (mTotalBytes > 0 && mTotalBytes < DEFAULT_UPLOAD_BUFFER_SIZE) {
                        // Allocate one byte more than necessary, to detect callers uploading
                        // more bytes than they specified in length.
                        mBuffer = ByteBuffer.allocateDirect((int) mTotalBytes + 1);
                    } else {
                        mBuffer = ByteBuffer.allocateDirect(DEFAULT_UPLOAD_BUFFER_SIZE);
                    }

                    initializeStart(mTotalBytes);

                    if (firstTime) {
                        startRead();
                    } else {
                        mSinkState.set(SinkState.AWAITING_REWIND_RESULT);
                        mUploadProvider.rewind(JavaUploadDataSinkBase.this);
                    }
                }
            }
        });
    }

    /**
     * Gets a runnable that checks for errors and processes them by setting an error state when
     * executing a {@link CheckedRunnable}.
     *
     * @param runnable The runnable to run.
     * @return a runnable that checks for errors
     */
    protected abstract Runnable getErrorSettingRunnable(
            JavaUrlRequestUtils.CheckedRunnable runnable);

    /**
     * Gets a runnable that checks for errors and processes them by setting an upload error state
     * when executing a {@link CheckedRunnable}.
     *
     * @param runnable The runnable to run.
     * @return a runnable that checks for errors
     */
    protected abstract Runnable getUploadErrorSettingRunnable(
            JavaUrlRequestUtils.CheckedRunnable runnable);

    /**
     * Processes an error encountered while uploading data.
     *
     * @param error the {@link Throwable} to process
     */
    protected abstract void processUploadError(final Throwable error);

    /**
     * Called when a successful read has occurred and there is new data in the {@code mBuffer} to
     * process.
     *
     * @return the number of bytes processed in this read
     * @throws IOException
     */
    protected abstract int processSuccessfulRead(ByteBuffer buffer) throws IOException;

    /**
     * Finishes this upload. Called when the upload is complete.
     *
     * @throws IOException
     */
    protected abstract void finish() throws IOException;

    /**
     * Initializes the {@link UploadDataSink} before each call to {@code read} in the
     * {@link UploadDataProvider}.
     *
     * @throws IOException
     */
    protected abstract void initializeRead() throws IOException;

    /**
     * Initializes the {@link UploadDataSink} at the start of the upload.
     *
     * @param totalBytes the total number of bytes to be retrieved in this upload
     */
    protected abstract void initializeStart(long totalBytes);
}


text:
1. `Connection Method: Standard TCP/IP over SSH`.
2. `SSH Hostname: 192.168.11.22:22`. This is an example. The real value should match what you have in your Vagrantfile.
3. `SSH Username: vagrant`.
4. `SSH Password: vagrant`.
5. `SSH Key File: ` should be empty.
6. `MySQL Hostname: 127.0.0.1`.
7. `MySQL Server Port: 3306`.
8. `Username: root`.
9. `Password: password`. This is an example. The real value should match what you used as the root user password from the `mysql.root_password` ansible variable.

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="UTF-8"?>
<sem:triples uri="http://www.lds.org/vrl/specific-people/pioneers/hunter-edward-1821-1892" xmlns:sem="http://marklogic.com/semantics">
  <sem:triple>
    <sem:subject>http://www.lds.org/vrl/specific-people/pioneers/hunter-edward-1821-1892</sem:subject>
    <sem:predicate>http://www.w3.org/2004/02/skos/core#prefLabel</sem:predicate>
    <sem:object datatype="xsd:string" xml:lang="eng">Hunter, Edward 1821-1892</sem:object>
  </sem:triple>
  <sem:triple>
    <sem:subject>http://www.lds.org/vrl/specific-people/pioneers/hunter-edward-1821-1892</sem:subject>
    <sem:predicate>http://www.w3.org/2004/02/skos/core#inScheme</sem:predicate>
    <sem:object datatype="sem:iri">http://www.lds.org/concept-scheme/vrl</sem:object>
  </sem:triple>
  <sem:triple>
    <sem:subject>http://www.lds.org/vrl/specific-people/pioneers/hunter-edward-1821-1892</sem:subject>
    <sem:predicate>http://www.lds.org/core#entityType</sem:predicate>
    <sem:object datatype="sem:iri">http://www.schema.org/Place</sem:object>
  </sem:triple>
</sem:triples>


text:
namespace Fuszenecker.GraphEngine.Graph.Interfaces
{
    public interface ITransaction : ITransactionOperations, IOperations
    {
    }
}


text:
import logging
import typing
import unittest
from typing import Callable
from typing import Union

from parameterized import parameterized

import apache_beam as beam
from apache_beam import coders
from apache_beam.io.jdbc import ReadFromJdbc
from apache_beam.io.jdbc import WriteToJdbc
from apache_beam.options.pipeline_options import StandardOptions
from apache_beam.testing.test_pipeline import TestPipeline
from apache_beam.testing.util import assert_that
from apache_beam.testing.util import equal_to

# pylint: disable=wrong-import-order, wrong-import-position, ungrouped-imports
try:
  import sqlalchemy
except ImportError:
  sqlalchemy = None
# pylint: enable=wrong-import-order, wrong-import-position, ungrouped-imports

# pylint: disable=wrong-import-order, wrong-import-position, ungrouped-imports
try:
  from testcontainers.postgres import PostgresContainer
  from testcontainers.mysql import MySqlContainer
except ImportError:
  PostgresContainer = None
# pylint: enable=wrong-import-order, wrong-import-position, ungrouped-imports

ROW_COUNT = 10

JdbcReadTestRow = typing.NamedTuple(
    "JdbcReadTestRow",
    [
        ("f_int", int),
    ],
)
coders.registry.register_coder(JdbcReadTestRow, coders.RowCoder)

JdbcWriteTestRow = typing.NamedTuple(
    "JdbcWriteTestRow",
    [
        ("f_id", int),
        ("f_real", float),
        ("f_string", str),
    ],
)
coders.registry.register_coder(JdbcWriteTestRow, coders.RowCoder)

@unittest.skipIf(sqlalchemy is None, 'sql alchemy package is not installed.')
@unittest.skipIf(
    PostgresContainer is None, 'testcontainers package is not installed')
@unittest.skipIf(
    TestPipeline().get_pipeline_options().view_as(StandardOptions).runner is
    None,
    'Do not run this test on precommit suites.')
class CrossLanguageJdbcIOTest(unittest.TestCase):
  DbData = typing.NamedTuple(
      'DbData',
      [('container_fn', typing.Any), ('classpath', typing.List[str]),
       ('db_string', str), ('connector', str)])
  DB_CONTAINER_CLASSPATH_STRING = {
      'postgres': DbData(
          lambda: PostgresContainer('postgres:12.3'),
          None,
          'postgresql',
          'org.postgresql.Driver'),
      'mysql': DbData(
          lambda: MySqlContainer(), ['mysql:mysql-connector-java:8.0.28'],
          'mysql',
          'com.mysql.cj.jdbc.Driver')
  }

  def _setUpTestCase(
      self,
      container_init: Callable[[], Union[PostgresContainer, MySqlContainer]],
      db_string: str,
      driver: str):
    # This method is not the normal setUp from unittest, because the test has
    # beem parameterized. The setup then needs extra parameters to initialize.
    self.start_db_container(retries=3, container_init=container_init)
    self.engine = sqlalchemy.create_engine(self.db.get_connection_url())
    self.username = 'test'
    self.password = 'test'
    self.host = self.db.get_container_host_ip()
    self.port = self.db.get_exposed_port(self.db.port_to_expose)
    self.database_name = 'test'
    self.driver_class_name = driver
    self.jdbc_url = 'jdbc:{}://{}:{}/{}'.format(
        db_string, self.host, self.port, self.database_name)

  def tearDown(self):
    # Sometimes stopping the container raises ReadTimeout. We can ignore it
    # here to avoid the test failure.
    try:
      self.db.stop()
    except:  # pylint: disable=bare-except
      logging.error('Could not stop the postgreSQL container.')

  @parameterized.expand(['postgres', 'mysql'])
  def test_xlang_jdbc_write(self, database):
    container_init, classpath, db_string, driver = (
        CrossLanguageJdbcIOTest.DB_CONTAINER_CLASSPATH_STRING[database])
    self._setUpTestCase(container_init, db_string, driver)
    table_name = 'jdbc_external_test_write'
    self.engine.execute(
        "CREATE TABLE {}(f_id INTEGER, f_real FLOAT, f_string VARCHAR(100))".
        format(table_name))
    inserted_rows = [
        JdbcWriteTestRow(i, i + 0.1, 'Test{}'.format(i))
        for i in range(ROW_COUNT)
    ]

    with TestPipeline() as p:
      p.not_use_test_runner_api = True
      _ = (
          p
          | beam.Create(inserted_rows).with_output_types(JdbcWriteTestRow)
          # TODO(BEAM-10750) Add test with overridden write_statement
          | 'Write to jdbc' >> WriteToJdbc(
              table_name=table_name,
              driver_class_name=self.driver_class_name,
              jdbc_url=self.jdbc_url,
              username=self.username,
              password=self.password,
              classpath=classpath,
          ))

    fetched_data = self.engine.execute("SELECT * FROM {}".format(table_name))
    fetched_rows = [
        JdbcWriteTestRow(int(row[0]), float(row[1]), str(row[2]))
        for row in fetched_data
    ]

    self.assertEqual(
        set(fetched_rows),
        set(inserted_rows),
        'Inserted data does not fit data fetched from table',
    )

  @parameterized.expand(['postgres', 'mysql'])
  def test_xlang_jdbc_read(self, database):
    container_init, classpath, db_string, driver = (
        CrossLanguageJdbcIOTest.DB_CONTAINER_CLASSPATH_STRING[database])
    self._setUpTestCase(container_init, db_string, driver)
    table_name = 'jdbc_external_test_read'
    self.engine.execute("CREATE TABLE {}(f_int INTEGER)".format(table_name))

    for i in range(ROW_COUNT):
      self.engine.execute("INSERT INTO {} VALUES({})".format(table_name, i))

    with TestPipeline() as p:
      p.not_use_test_runner_api = True
      result = (
          p
          # TODO(BEAM-10750) Add test with overridden read_query
          | 'Read from jdbc' >> ReadFromJdbc(
              table_name=table_name,
              driver_class_name=self.driver_class_name,
              jdbc_url=self.jdbc_url,
              username=self.username,
              password=self.password,
              classpath=classpath))

      assert_that(
          result, equal_to([JdbcReadTestRow(i) for i in range(ROW_COUNT)]))

  # Creating a container with testcontainers sometimes raises ReadTimeout
  # error. In java there are 2 retries set by default.
  def start_db_container(self, retries, container_init):
    for i in range(retries):
      try:
        self.db = container_init()
        self.db.start()
        break
      except Exception as e:  # pylint: disable=bare-except
        if i == retries - 1:
          logging.error('Unable to initialize database container.')
          raise e

if __name__ == '__main__':
  logging.getLogger().setLevel(logging.INFO)
  unittest.main()


text:
import uri from 'vs/base/common/uri';
import {TPromise} from 'vs/base/common/winjs.base';
import Event from 'vs/base/common/event';
import severity from 'vs/base/common/severity';
import {createDecorator} from 'vs/platform/instantiation/common/instantiation';
import editor = require('vs/editor/common/editorCommon');
import {Position} from 'vs/editor/common/core/position';
import {ISuggestion} from 'vs/editor/common/modes';
import {Source} from 'vs/workbench/parts/debug/common/debugSource';
import {Range} from 'vs/editor/common/core/range';
import {RawContextKey, ContextKeyExpr} from 'vs/platform/contextkey/common/contextkey';

export const VIEWLET_ID = 'workbench.view.debug';
export const REPL_ID = 'workbench.panel.repl';
export const DEBUG_SERVICE_ID = 'debugService';
export const CONTEXT_IN_DEBUG_MODE = new RawContextKey<boolean>('inDebugMode', false);
export const CONTEXT_NOT_IN_DEBUG_MODE: ContextKeyExpr = CONTEXT_IN_DEBUG_MODE.toNegated();
export const CONTEXT_IN_DEBUG_REPL = new RawContextKey<boolean>('inDebugRepl', false);
export const CONTEXT_NOT_IN_DEBUG_REPL: ContextKeyExpr = CONTEXT_IN_DEBUG_REPL.toNegated();
export const EDITOR_CONTRIBUTION_ID = 'editor.contrib.debug';
export const DEBUG_SCHEME = 'debug';

// raw

export interface IRawModelUpdate {
	threadId: number;
	thread?: DebugProtocol.Thread;
	callStack?: DebugProtocol.StackFrame[];
	stoppedDetails?: IRawStoppedDetails;
	allThreadsStopped?: boolean;
}

export interface IRawStoppedDetails {
	reason: string;
	threadId?: number;
	text?: string;
	totalFrames?: number;
	framesErrorMessage?: string;
}

// model

export interface ITreeElement {
	getId(): string;
}

export interface IExpressionContainer extends ITreeElement {
	reference: number;
	getChildren(debugService: IDebugService): TPromise<IExpression[]>;
}

export interface IExpression extends ITreeElement, IExpressionContainer {
	name: string;
	value: string;
	valueChanged: boolean;
	type?: string;
}

export interface IThread extends ITreeElement {
	/**
	 * Id of the thread generated by the debug adapter backend.
	 */
	threadId: number;

	/**
	 * Name of the thread.
	 */
	name: string;

	/**
	 * Information about the current thread stop event. Null if thread is not stopped.
	 */
	stoppedDetails: IRawStoppedDetails;

	/**
	 * Queries the debug adapter for the callstack and returns a promise with
	 * the stack frames of the callstack.
	 * If the thread is not stopped, it returns a promise to an empty array.
	 * Only gets the first 20 stack frames. Calling this method consecutive times
	 * with getAdditionalStackFrames = true gets the remainder of the call stack.
	 */
	getCallStack(debugService: IDebugService, getAdditionalStackFrames?: boolean): TPromise<IStackFrame[]>;

	/**
	 * Gets the callstack if it has already been received from the debug
	 * adapter, otherwise it returns undefined.
	 */
	getCachedCallStack(): IStackFrame[];

	/**
	 * Invalidates the callstack cache
	 */
	clearCallStack(): void;

	/**
	 * Indicates whether this thread is stopped. The callstack for stopped
	 * threads can be retrieved from the debug adapter.
	 */
	stopped: boolean;
}

export interface IScope extends IExpressionContainer {
	name: string;
	expensive: boolean;
}

export interface IStackFrame extends ITreeElement {
	threadId: number;
	name: string;
	lineNumber: number;
	column: number;
	frameId: number;
	source: Source;
	getScopes(debugService: IDebugService): TPromise<IScope[]>;
}

export interface IEnablement extends ITreeElement {
	enabled: boolean;
}

export interface IRawBreakpoint {
	uri: uri;
	lineNumber: number;
	enabled?: boolean;
	condition?: string;
}

export interface IBreakpoint extends IEnablement {
	source: Source;
	lineNumber: number;
	desiredLineNumber: number;
	condition: string;
	verified: boolean;
	idFromAdapter: number;
	message: string;
}

export interface IFunctionBreakpoint extends IEnablement {
	name: string;
	verified: boolean;
	idFromAdapter: number;
}

export interface IExceptionBreakpoint extends IEnablement {
	filter: string;
	label: string;
}

// model interfaces

export interface IViewModel extends ITreeElement {
	getFocusedStackFrame(): IStackFrame;
	getSelectedExpression(): IExpression;
	getFocusedThreadId(): number;
	setSelectedExpression(expression: IExpression);
	getSelectedFunctionBreakpoint(): IFunctionBreakpoint;
	setSelectedFunctionBreakpoint(functionBreakpoint: IFunctionBreakpoint): void;

	onDidFocusStackFrame: Event<IStackFrame>;
	onDidSelectExpression: Event<IExpression>;
	onDidSelectFunctionBreakpoint: Event<IFunctionBreakpoint>;
}

export interface IModel extends ITreeElement {
	getThreads(): { [threadId: number]: IThread; };
	getBreakpoints(): IBreakpoint[];
	areBreakpointsActivated(): boolean;
	getFunctionBreakpoints(): IFunctionBreakpoint[];
	getExceptionBreakpoints(): IExceptionBreakpoint[];
	getWatchExpressions(): IExpression[];
	getReplElements(): ITreeElement[];

	onDidChangeBreakpoints: Event<void>;
	onDidChangeCallStack: Event<void>;
	onDidChangeWatchExpressions: Event<IExpression>;
	onDidChangeReplElements: Event<void>;
};

// service enums

export enum State {
	Disabled,
	Inactive,
	Initializing,
	Stopped,
	Running,
	RunningNoDebug
}

// service interfaces

export interface IGlobalConfig {
	version: string;
	debugServer?: number;
	configurations: IConfig[];
}

export interface IEnvConfig {
	name?: string;
	type: string;
	request: string;
	internalConsoleOptions?: string;
	preLaunchTask?: string;
	debugServer?: number;
	noDebug?: boolean;
	silentlyAbort?: boolean;
}

export interface IExtHostConfig extends IEnvConfig {
	port?: number;
	sourceMaps?: boolean;
	outDir?: string;
}

export interface IConfig extends IEnvConfig {
	windows?: IEnvConfig;
	osx?: IEnvConfig;
	linux?: IEnvConfig;
}

export interface IRawEnvAdapter {
	type?: string;
	label?: string;
	program?: string;
	args?: string[];
	runtime?: string;
	runtimeArgs?: string[];
}

export interface IRawAdapter extends IRawEnvAdapter {
	enableBreakpointsFor?: { languageIds: string[] };
	configurationAttributes?: any;
	initialConfigurations?: any[];
	variables: { [key: string]: string };
	aiKey?: string;
	win?: IRawEnvAdapter;
	winx86?: IRawEnvAdapter;
	windows?: IRawEnvAdapter;
	osx?: IRawEnvAdapter;
	linux?: IRawEnvAdapter;
}

export interface IRawBreakpointContribution {
	language: string;
}

export interface IRawDebugSession {
	configuration: { type: string, isAttach: boolean, capabilities: DebugProtocol.Capabilites };

	disconnect(restart?: boolean, force?: boolean): TPromise<DebugProtocol.DisconnectResponse>;

	stackTrace(args: DebugProtocol.StackTraceArguments): TPromise<DebugProtocol.StackTraceResponse>;
	scopes(args: DebugProtocol.ScopesArguments): TPromise<DebugProtocol.ScopesResponse>;
	variables(args: DebugProtocol.VariablesArguments): TPromise<DebugProtocol.VariablesResponse>;
	evaluate(args: DebugProtocol.EvaluateArguments): TPromise<DebugProtocol.EvaluateResponse>;

	custom(request: string, args: any): TPromise<DebugProtocol.Response>;

	onDidEvent: Event<DebugProtocol.Event>;
}

export interface IConfigurationManager {
	configurationName: string;
	setConfiguration(name: string): TPromise<void>;
	openConfigFile(sideBySide: boolean): TPromise<boolean>;
	loadLaunchConfig(): TPromise<IGlobalConfig>;
	canSetBreakpointsIn(model: editor.IModel): boolean;

	/**
	 * Allows to register on change of debug configuration.
	 */
	onDidConfigurationChange: Event<string>;
}

export const IDebugService = createDecorator<IDebugService>(DEBUG_SERVICE_ID);

export interface IDebugService {
	_serviceBrand: any;

	/**
	 * Gets the current debug state.
	 */
	state: State;

	/**
	 * Allows to register on debug state changes.
	 */
	onDidChangeState: Event<State>;

	/**
	 * Gets the current configuration manager.
	 */
	getConfigurationManager(): IConfigurationManager;

	/**
	 * Sets the focused stack frame and evaluates all expresions against the newly focused stack frame,
	 */
	setFocusedStackFrameAndEvaluate(focusedStackFrame: IStackFrame): TPromise<void>;

	/**
	 * Adds new breakpoints to the model. Notifies debug adapter of breakpoint changes.
	 */
	addBreakpoints(rawBreakpoints: IRawBreakpoint[]): TPromise<void[]>;

	/**
	 * Enables or disables all breakpoints. If breakpoint is passed only enables or disables the passed breakpoint.
	 * Notifies debug adapter of breakpoint changes.
	 */
	enableOrDisableBreakpoints(enable: boolean, breakpoint?: IEnablement): TPromise<void>;

	/**
	 * Sets the global activated property for all breakpoints.
	 * Notifies debug adapter of breakpoint changes.
	 */
	setBreakpointsActivated(activated: boolean): TPromise<void>;

	/**
	 * Removes all breakpoints. If id is passed only removes the breakpoint associated with that id.
	 * Notifies debug adapter of breakpoint changes.
	 */
	removeBreakpoints(id?: string): TPromise<any>;

	/**
	 * Adds a new no name function breakpoint. The function breakpoint should be renamed once user enters the name.
	 */
	addFunctionBreakpoint(): void;

	/**
	 * Renames an already existing function breakpoint.
	 * Notifies debug adapter of breakpoint changes.
	 */
	renameFunctionBreakpoint(id: string, newFunctionName: string): TPromise<void>;

	/**
	 * Removes all function breakpoints. If id is passed only removes the function breakpoint with the passed id.
	 * Notifies debug adapter of breakpoint changes.
	 */
	removeFunctionBreakpoints(id?: string): TPromise<void>;

	/**
	 * Adds a new expression to the repl.
	 */
	addReplExpression(name: string): TPromise<void>;

	/**
	 * Removes all repl expressions.
	 */
	removeReplExpressions(): void;

	/**
	 * Adds a new log to the repl. Either a string value or a dictionary (used to inspect complex objects printed to the repl).
	 */
	logToRepl(value: string | { [key: string]: any }, severity?: severity): void;

	/**
	 * Appends new output to the repl.
	 */
	appendReplOutput(value: string, severity?: severity): void;

	/**
	 * Sets the value for the variable against the debug adapter.
	 */
	setVariable(variable: IExpression, value: string): TPromise<void>;

	/**
	 * Adds a new watch expression and evaluates it against the debug adapter.
	 */
	addWatchExpression(name?: string): TPromise<void>;

	/**
	 * Renames a watch expression and evaluates it against the debug adapter.
	 */
	renameWatchExpression(id: string, newName: string): TPromise<void>;

	/**
	 * Removes all watch expressions. If id is passed only removes the watch expression with the passed id.
	 */
	removeWatchExpressions(id?: string): void;

	/**
	 * Creates a new debug session. Depending on the configuration will either 'launch' or 'attach'.
	 */
	createSession(noDebug: boolean, configuration?: IConfig): TPromise<any>;

	/**
	 * Restarts an active debug session or creates a new one if there is no active session.
	 */
	restartSession(): TPromise<any>;

	/**
	 * Returns the active debug session or null if debug is inactive.
	 */
	getActiveSession(): IRawDebugSession;

	/**
	 * Gets the current debug model.
	 */
	getModel(): IModel;

	/**
	 * Gets the current view model.
	 */
	getViewModel(): IViewModel;

	/**
	 * Opens a new or reveals an already visible editor showing the source.
	 */
	openOrRevealSource(source: Source, lineNumber: number, preserveFocus: boolean, sideBySide: boolean): TPromise<any>;

	next(threadId: number): TPromise<void>;
	stepIn(threadId: number): TPromise<void>;
	stepOut(threadId: number): TPromise<void>;
	stepBack(threadId: number): TPromise<void>;
	continue(threadId: number): TPromise<void>;
	pause(threadId: number): TPromise<any>;
	restartFrame(frameId: number): TPromise<any>;
	completions(text: string, position: Position): TPromise<ISuggestion[]>;
}

// Editor interfaces
export interface IDebugEditorContribution extends editor.IEditorContribution {
	showHover(range: Range, hoveringOver: string, focus: boolean): TPromise<void>;
}

// utils

const _formatPIIRegexp = /{([^}]+)}/g;

export function formatPII(value: string, excludePII: boolean, args: { [key: string]: string }): string {
	return value.replace(_formatPIIRegexp, function (match, group) {
		if (excludePII && group.length > 0 && group[0] !== '_') {
			return match;
		}

		return args && args.hasOwnProperty(group) ?
			args[group] :
			match;
	});
}


text:
<?php
declare(strict_types=1);

namespace Go\ParserReflection\Locator;

use PHPUnit\Framework\TestCase;
use Go\ParserReflection\ReflectionClass;

class ComposerLocatorTest extends TestCase
{
    public function testLocateClass()
    {
        $locator         = new ComposerLocator();
        $reflectionClass = new \ReflectionClass(ReflectionClass::class);
        $this->assertSame(
            $reflectionClass->getFileName(),
            $locator->locateClass(ReflectionClass::class)
        );
        $this->assertSame(
            $reflectionClass->getFileName(),
            $locator->locateClass('\\' . ReflectionClass::class)
        );
    }
}


text:
% get latency until relevant AOI fixated
%
% Syntax: latency =calcLatencyRelAOIFix( eyePos, aoiCenter, maxDist, AOIsOfInterest )
%
% Inputs:
%  eyePos: vector  of complex (x+i*y) coordinates.  -1-i1  to identify
%         missing data.  They are in range [ 0 ,1 ]
%  aoiCenter: coordinates of AOI in image scale, returned by 'returnAOICenters.m'
%  maxDist: returned by  'returnAOICenters.m'
%  AOIsOfInterest: index of AOIs which we are interested in
%
% Outputs:
%  latency: value between 0 and length of eye track,
%

function latency =calcLatencyRelAOIFixDist( fixStruct, aoiCenter, maxDist, AOIsOfInterest )

fixPosVector = fixStruct.fixPosVector;
fixationVector = fixStruct.fixationVector;

numFixation = size(fixPosVector,2);
numSamples = length( fixationVector );
latency = numSamples;

for i1 = 1:numFixation
    dist = calc2Dist( fixPosVector(:,i1), aoiCenter); % 2-norm
    [minDist minIdx] = min( dist);
    if minDist < maxDist && sum(minIdx == AOIsOfInterest)
         latency = find(  fixationVector == i1 );
         latency = latency(1); %/numSamples; % look at beginning of fixation
         break;
    end

end


text:
class EvidencePropertyTypeRel < Sequel::Model(DB[:EvidencePropertyTypeRel])

  ### SEQUEL

  many_to_one :Evidence
  many_to_one :Type

end


text:
(function() {
  var request;

  module.exports = request = function(options, i, callback) {};

}).call(this);


text:
from django.apps import AppConfig

class GestionaleConfig(AppConfig):
    name = 'gestionale_'
    verbose_name = 'Gestionale'


text:
import java.lang.*;
import java.util.*;
import java.io.*;

class SuperSum{

  public static <T> void p(T arr)
  {
    System.out.print(arr);
  }

  public static void main(String[] args) throws FileNotFoundException{
    Scanner scan = new Scanner(new File("supersum.dat"));
    int sets = scan.nextInt();

    for (int i = 0; i < sets; i++)
    {
      int num = Integer.toString(scan.nextLine());
      String n = Integer.toString(num);

      while(n.length() > 1)
      {
        int sum = 0;
        for (int j = 0; j < n.length(); j++)
        {
          sum+=Integer.parseInt(Character.toString(n.charAt(j)));
        }
        n = Integer.toString(sum);
      }
      p(n+"\n");
    }
  }
}


text:
.class public Landroid/graphics/pdf/PdfDocument;
.super Ljava/lang/Object;
.source "PdfDocument.java"

# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Landroid/graphics/pdf/PdfDocument$PdfCanvas;,
        Landroid/graphics/pdf/PdfDocument$PageInfo;,
        Landroid/graphics/pdf/PdfDocument$Page;
    }
.end annotation

# instance fields
.field private final mChunk:[B

.field private final mCloseGuard:Ldalvik/system/CloseGuard;

.field private mCurrentPage:Landroid/graphics/pdf/PdfDocument$Page;

.field private mNativeDocument:J

.field private final mPages:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List",
            "<",
            "Landroid/graphics/pdf/PdfDocument$PageInfo;",
            ">;"
        }
    .end annotation
.end field

# direct methods
.method public constructor <init>()V
    .registers 3

    .prologue
    .line 92
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 79
    const/16 v0, 0x1000

    new-array v0, v0, [B

    iput-object v0, p0, Landroid/graphics/pdf/PdfDocument;->mChunk:[B

    .line 81
    invoke-static {}, Ldalvik/system/CloseGuard;->get()Ldalvik/system/CloseGuard;

    move-result-object v0

    iput-object v0, p0, Landroid/graphics/pdf/PdfDocument;->mCloseGuard:Ldalvik/system/CloseGuard;

    .line 83
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Landroid/graphics/pdf/PdfDocument;->mPages:Ljava/util/List;

    .line 93
    invoke-direct {p0}, Landroid/graphics/pdf/PdfDocument;->nativeCreateDocument()J

    move-result-wide v0

    iput-wide v0, p0, Landroid/graphics/pdf/PdfDocument;->mNativeDocument:J

    .line 94
    iget-object v0, p0, Landroid/graphics/pdf/PdfDocument;->mCloseGuard:Ldalvik/system/CloseGuard;

    const-string/jumbo v1, "close"

    invoke-virtual {v0, v1}, Ldalvik/system/CloseGuard;->open(Ljava/lang/String;)V

    .line 92
    return-void
.end method

.method private dispose()V
    .registers 5

    .prologue
    const-wide/16 v2, 0x0

    .line 213
    iget-wide v0, p0, Landroid/graphics/pdf/PdfDocument;->mNativeDocument:J

    cmp-long v0, v0, v2

    if-eqz v0, :cond_14

    .line 214
    iget-wide v0, p0, Landroid/graphics/pdf/PdfDocument;->mNativeDocument:J

    invoke-direct {p0, v0, v1}, Landroid/graphics/pdf/PdfDocument;->nativeClose(J)V

    .line 215
    iget-object v0, p0, Landroid/graphics/pdf/PdfDocument;->mCloseGuard:Ldalvik/system/CloseGuard;

    invoke-virtual {v0}, Ldalvik/system/CloseGuard;->close()V

    .line 216
    iput-wide v2, p0, Landroid/graphics/pdf/PdfDocument;->mNativeDocument:J

    .line 212
    :cond_14
    return-void
.end method

.method private native nativeClose(J)V
.end method

.method private native nativeCreateDocument()J
.end method

.method private native nativeFinishPage(J)V
.end method

.method private static native nativeStartPage(JIIIIII)J
.end method

.method private native nativeWriteTo(JLjava/io/OutputStream;[B)V
.end method

.method private throwIfClosed()V
    .registers 5

    .prologue
    .line 224
    iget-wide v0, p0, Landroid/graphics/pdf/PdfDocument;->mNativeDocument:J

    const-wide/16 v2, 0x0

    cmp-long v0, v0, v2

    if-nez v0, :cond_11

    .line 225
    new-instance v0, Ljava/lang/IllegalStateException;

    const-string/jumbo v1, "document is closed!"

    invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V

    throw v0

    .line 223
    :cond_11
    return-void
.end method

.method private throwIfCurrentPageNotFinished()V
    .registers 3

    .prologue
    .line 233
    iget-object v0, p0, Landroid/graphics/pdf/PdfDocument;->mCurrentPage:Landroid/graphics/pdf/PdfDocument$Page;

    if-eqz v0, :cond_d

    .line 234
    new-instance v0, Ljava/lang/IllegalStateException;

    const-string/jumbo v1, "Current page not finished!"

    invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V

    throw v0

    .line 232
    :cond_d
    return-void
.end method

# virtual methods
.method public close()V
    .registers 1

    .prologue
    .line 198
    invoke-direct {p0}, Landroid/graphics/pdf/PdfDocument;->throwIfCurrentPageNotFinished()V

    .line 199
    invoke-direct {p0}, Landroid/graphics/pdf/PdfDocument;->dispose()V

    .line 197
    return-void
.end method

.method protected finalize()V
    .registers 2
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/lang/Throwable;
        }
    .end annotation

    .prologue
    .line 205
    :try_start_0
    iget-object v0, p0, Landroid/graphics/pdf/PdfDocument;->mCloseGuard:Ldalvik/system/CloseGuard;

    invoke-virtual {v0}, Ldalvik/system/CloseGuard;->warnIfOpen()V

    .line 206
    invoke-direct {p0}, Landroid/graphics/pdf/PdfDocument;->dispose()V
    :try_end_8
    .catchall {:try_start_0 .. :try_end_8} :catchall_c

    .line 208
    invoke-super {p0}, Ljava/lang/Object;->finalize()V

    .line 203
    return-void

    .line 207
    :catchall_c
    move-exception v0

    .line 208
    invoke-super {p0}, Ljava/lang/Object;->finalize()V

    .line 207
    throw v0
.end method

.method public finishPage(Landroid/graphics/pdf/PdfDocument$Page;)V
    .registers 5
    .param p1, "page"    # Landroid/graphics/pdf/PdfDocument$Page;

    .prologue
    const/4 v2, 0x0

    .line 140
    invoke-direct {p0}, Landroid/graphics/pdf/PdfDocument;->throwIfClosed()V

    .line 141
    if-nez p1, :cond_f

    .line 142
    new-instance v0, Ljava/lang/IllegalArgumentException;

    const-string/jumbo v1, "page cannot be null"

    invoke-direct {v0, v1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v0

    .line 144
    :cond_f
    iget-object v0, p0, Landroid/graphics/pdf/PdfDocument;->mCurrentPage:Landroid/graphics/pdf/PdfDocument$Page;

    if-eq p1, v0, :cond_1c

    .line 145
    new-instance v0, Ljava/lang/IllegalStateException;

    const-string/jumbo v1, "invalid page"

    invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V

    throw v0

    .line 147
    :cond_1c
    invoke-virtual {p1}, Landroid/graphics/pdf/PdfDocument$Page;->isFinished()Z

    move-result v0

    if-eqz v0, :cond_2b

    .line 148
    new-instance v0, Ljava/lang/IllegalStateException;

    const-string/jumbo v1, "page already finished"

    invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V

    throw v0

    .line 150
    :cond_2b
    iget-object v0, p0, Landroid/graphics/pdf/PdfDocument;->mPages:Ljava/util/List;

    invoke-virtual {p1}, Landroid/graphics/pdf/PdfDocument$Page;->getInfo()Landroid/graphics/pdf/PdfDocument$PageInfo;

    move-result-object v1

    invoke-interface {v0, v1}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 151
    iput-object v2, p0, Landroid/graphics/pdf/PdfDocument;->mCurrentPage:Landroid/graphics/pdf/PdfDocument$Page;

    .line 152
    iget-wide v0, p0, Landroid/graphics/pdf/PdfDocument;->mNativeDocument:J

    invoke-direct {p0, v0, v1}, Landroid/graphics/pdf/PdfDocument;->nativeFinishPage(J)V

    .line 153
    invoke-static {p1}, Landroid/graphics/pdf/PdfDocument$Page;->-wrap0(Landroid/graphics/pdf/PdfDocument$Page;)V

    .line 139
    return-void
.end method

.method public getPages()Ljava/util/List;
    .registers 2
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Ljava/util/List",
            "<",
            "Landroid/graphics/pdf/PdfDocument$PageInfo;",
            ">;"
        }
    .end annotation

    .prologue
    .line 184
    iget-object v0, p0, Landroid/graphics/pdf/PdfDocument;->mPages:Ljava/util/List;

    invoke-static {v0}, Ljava/util/Collections;->unmodifiableList(Ljava/util/List;)Ljava/util/List;

    move-result-object v0

    return-object v0
.end method

.method public startPage(Landroid/graphics/pdf/PdfDocument$PageInfo;)Landroid/graphics/pdf/PdfDocument$Page;
    .registers 12
    .param p1, "pageInfo"    # Landroid/graphics/pdf/PdfDocument$PageInfo;

    .prologue
    const/4 v9, 0x0

    .line 116
    invoke-direct {p0}, Landroid/graphics/pdf/PdfDocument;->throwIfClosed()V

    .line 117
    invoke-direct {p0}, Landroid/graphics/pdf/PdfDocument;->throwIfCurrentPageNotFinished()V

    .line 118
    if-nez p1, :cond_12

    .line 119
    new-instance v0, Ljava/lang/IllegalArgumentException;

    const-string/jumbo v1, "page cannot be null"

    invoke-direct {v0, v1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v0

    .line 121
    :cond_12
    new-instance v8, Landroid/graphics/pdf/PdfDocument$PdfCanvas;

    iget-wide v0, p0, Landroid/graphics/pdf/PdfDocument;->mNativeDocument:J

    invoke-static {p1}, Landroid/graphics/pdf/PdfDocument$PageInfo;->-get2(Landroid/graphics/pdf/PdfDocument$PageInfo;)I

    move-result v2

    .line 122
    invoke-static {p1}, Landroid/graphics/pdf/PdfDocument$PageInfo;->-get1(Landroid/graphics/pdf/PdfDocument$PageInfo;)I

    move-result v3

    invoke-static {p1}, Landroid/graphics/pdf/PdfDocument$PageInfo;->-get0(Landroid/graphics/pdf/PdfDocument$PageInfo;)Landroid/graphics/Rect;

    move-result-object v4

    iget v4, v4, Landroid/graphics/Rect;->left:I

    invoke-static {p1}, Landroid/graphics/pdf/PdfDocument$PageInfo;->-get0(Landroid/graphics/pdf/PdfDocument$PageInfo;)Landroid/graphics/Rect;

    move-result-object v5

    iget v5, v5, Landroid/graphics/Rect;->top:I

    .line 123
    invoke-static {p1}, Landroid/graphics/pdf/PdfDocument$PageInfo;->-get0(Landroid/graphics/pdf/PdfDocument$PageInfo;)Landroid/graphics/Rect;

    move-result-object v6

    iget v6, v6, Landroid/graphics/Rect;->right:I

    invoke-static {p1}, Landroid/graphics/pdf/PdfDocument$PageInfo;->-get0(Landroid/graphics/pdf/PdfDocument$PageInfo;)Landroid/graphics/Rect;

    move-result-object v7

    iget v7, v7, Landroid/graphics/Rect;->bottom:I

    .line 121
    invoke-static/range {v0 .. v7}, Landroid/graphics/pdf/PdfDocument;->nativeStartPage(JIIIIII)J

    move-result-wide v0

    invoke-direct {v8, p0, v0, v1}, Landroid/graphics/pdf/PdfDocument$PdfCanvas;-><init>(Landroid/graphics/pdf/PdfDocument;J)V

    .line 124
    .local v8, "canvas":Landroid/graphics/Canvas;
    new-instance v0, Landroid/graphics/pdf/PdfDocument$Page;

    invoke-direct {v0, v8, p1, v9}, Landroid/graphics/pdf/PdfDocument$Page;-><init>(Landroid/graphics/Canvas;Landroid/graphics/pdf/PdfDocument$PageInfo;Landroid/graphics/pdf/PdfDocument$Page;)V

    iput-object v0, p0, Landroid/graphics/pdf/PdfDocument;->mCurrentPage:Landroid/graphics/pdf/PdfDocument$Page;

    .line 125
    iget-object v0, p0, Landroid/graphics/pdf/PdfDocument;->mCurrentPage:Landroid/graphics/pdf/PdfDocument$Page;

    return-object v0
.end method

.method public writeTo(Ljava/io/OutputStream;)V
    .registers 5
    .param p1, "out"    # Ljava/io/OutputStream;
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .prologue
    .line 170
    invoke-direct {p0}, Landroid/graphics/pdf/PdfDocument;->throwIfClosed()V

    .line 171
    invoke-direct {p0}, Landroid/graphics/pdf/PdfDocument;->throwIfCurrentPageNotFinished()V

    .line 172
    if-nez p1, :cond_11

    .line 173
    new-instance v0, Ljava/lang/IllegalArgumentException;

    const-string/jumbo v1, "out cannot be null!"

    invoke-direct {v0, v1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v0

    .line 175
    :cond_11
    iget-wide v0, p0, Landroid/graphics/pdf/PdfDocument;->mNativeDocument:J

    iget-object v2, p0, Landroid/graphics/pdf/PdfDocument;->mChunk:[B

    invoke-direct {p0, v0, v1, p1, v2}, Landroid/graphics/pdf/PdfDocument;->nativeWriteTo(JLjava/io/OutputStream;[B)V

    .line 169
    return-void
.end method


text:
namespace apl
{

CriticalSection::CriticalSection(ILockBase* apLock) : mIsLocked(true), mpLock(apLock)
{
	mpLock->Lock();
}

CriticalSection::~CriticalSection()
{
	if(mIsLocked) mpLock->Unlock();
}

}


text:
package com.osawaseigo.netty.promises;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import io.netty.util.concurrent.Future;

public class App
{

	public static void main( String[] args ) throws Exception
    {
        System.out.println( "\n\n\tExample of promises in Netty!" );
        System.out.println( "tUsage demo in the integration tests." );
     }
}


text:
/* $Id: math.h 2264 2011-12-25 01:16:55Z dmix $ */

/*
   math.h - mathematical functions

   Author : Michael Stumpf
            Michael.Stumpf@t-online.de

   __ATTR_CONST__ added by marekm@linux.org.pl for functions
   that "do not examine any values except their arguments, and have
   no effects except the return value", for better optimization by gcc.
 */

#ifndef __MATH_H
#define __MATH_H

/** \file */
/** \defgroup avr_math <math.h>: Mathematics
    \code #include <math.h> \endcode

    This header file declares basic mathematics constants and
    functions.

    \par Notes:
    - In order to access the functions declared herein, it is usually
      also required to additionally link against the library \c libm.a.
      See also the related \ref faq_libm "FAQ entry".
    - Math functions do not raise exceptions and do not change the
      \c errno variable. Therefore the majority of them are declared
      with const attribute, for better optimization by GCC.	*/

/** \ingroup avr_math	*/
/*@{*/

/** The constant \a e.	*/
#define M_E		2.7182818284590452354

/** The logarithm of the \a e to base 2. */
#define M_LOG2E		1.4426950408889634074	/* log_2 e */

/** The logarithm of the \a e to base 10. */
#define M_LOG10E	0.43429448190325182765	/* log_10 e */

/** The natural logarithm of the 2.	*/
#define M_LN2		0.69314718055994530942	/* log_e 2 */

/** The natural logarithm of the 10.	*/
#define M_LN10		2.30258509299404568402	/* log_e 10 */

/** The constant \a pi.	*/
#define M_PI		3.14159265358979323846	/* pi */

/** The constant \a pi/2.	*/
#define M_PI_2		1.57079632679489661923	/* pi/2 */

/** The constant \a pi/4.	*/
#define M_PI_4		0.78539816339744830962	/* pi/4 */

/** The constant \a 1/pi.	*/
#define M_1_PI		0.31830988618379067154	/* 1/pi */

/** The constant \a 2/pi.	*/
#define M_2_PI		0.63661977236758134308	/* 2/pi */

/** The constant \a 2/sqrt(pi).	*/
#define M_2_SQRTPI	1.12837916709551257390	/* 2/sqrt(pi) */

/** The square root of 2.	*/
#define M_SQRT2		1.41421356237309504880	/* sqrt(2) */

/** The constant \a 1/sqrt(2).	*/
#define M_SQRT1_2	0.70710678118654752440	/* 1/sqrt(2) */

/** NAN constant.	*/
#define NAN	__builtin_nan("")

/** INFINITY constant.	*/
#define INFINITY	__builtin_inf()

#ifndef __ATTR_CONST__
# define __ATTR_CONST__ __attribute__((__const__))
#endif

#ifdef __cplusplus
extern "C" {
#endif

/**
    The cos() function returns the cosine of \a __x, measured in radians.
 */
extern double cos(double __x) __ATTR_CONST__;
#define cosf	cos		/**< The alias for cos().	*/

/**
    The sin() function returns the sine of \a __x, measured in radians.
 */
extern double sin(double __x) __ATTR_CONST__;
#define sinf	sin		/**< The alias for sin().	*/

/**
    The tan() function returns the tangent of \a __x, measured in radians.
 */
extern double tan(double __x) __ATTR_CONST__;
#define tanf	tan		/**< The alias for tan().	*/

/**
    The fabs() function computes the absolute value of a floating-point
    number \a __x.
 */
extern double fabs(double __x) __ATTR_CONST__;
#define fabsf	fabs		/**< The alias for fabs().	*/

/**
    The function fmod() returns the floating-point remainder of __x /
    __y.
 */
extern double fmod(double __x, double __y) __ATTR_CONST__;
#define fmodf	fmod		/**< The alias for fmod().	*/

/**
    The modf() function breaks the argument \a __x into integral and
    fractional parts, each of which has the same sign as the argument.
    It stores the integral part as a double in the object pointed to by
    \a __iptr.

    The modf() function returns the signed fractional part of \a __x.

    \note This implementation skips writing by zero pointer.  However,
    the GCC 4.3 can replace this function with inline code that does not
    permit to use NULL address for the avoiding of storing.
 */
extern double modf(double __x, double *__iptr);

/** The alias for modf().
 */
extern float modff (float __x, float *__iptr);

/**
    The sqrt() function returns the non-negative square root of \a __x.
 */
extern double sqrt(double __x) __ATTR_CONST__;
#define sqrtf	sqrt		/**< The alias for sqrt().	*/

/**
    The cbrt() function returns the cube root of \a __x.
 */
extern double cbrt(double __x) __ATTR_CONST__;
#define cbrtf	cbrt		/**< The alias for cbrt().	*/

/**
    The hypot() function returns sqrt(__x*__x + __y*__y). This
    is the length of the hypotenuse of a right triangle with sides of
    length \a __x and \a __y, or the  distance of the point (\a __x, \a
    __y) from the origin. Using this function  instead of the direct
    formula is wise, since the error is much smaller. No underflow with
    small \a __x and \a __y. No overflow if result is in range.
 */
extern double hypot (double __x, double __y) __ATTR_CONST__;
#define hypotf	hypot		/**< The alias for hypot().	*/

/**
    The function square() returns __x * __x.

    \note This function does not belong to the C standard definition.
 */
extern double square(double __x) __ATTR_CONST__;
#define squaref	square		/**< The alias for square().	*/

/**
    The floor() function returns the largest integral value less than or
    equal to \a __x, expressed as a floating-point number.
 */
extern double floor(double __x) __ATTR_CONST__;
#define floorf	floor		/**< The alias for floor().	*/

/**
    The ceil() function returns the smallest integral value greater than
    or equal to \a __x, expressed as a floating-point number.
 */
extern double ceil(double __x) __ATTR_CONST__;
#define ceilf	ceil		/**< The alias for ceil().	*/

/**
    The frexp() function breaks a floating-point number into a normalized
    fraction and an integral power of 2.  It stores the integer in the \c
    int object pointed to by \a __pexp.

    If \a __x is a normal float point number, the frexp() function
    returns the value \c v, such that \c v has a magnitude in the
    interval [1/2, 1) or zero, and \a __x equals \c v times 2 raised to
    the power \a __pexp. If \a __x is zero, both parts of the result are
    zero. If \a __x is not a finite number, the frexp() returns \a __x as
    is and stores 0 by \a __pexp.

    \note  This implementation permits a zero pointer as a directive to
    skip a storing the exponent.
 */
extern double frexp(double __x, int *__pexp);
#define frexpf	frexp		/**< The alias for frexp().	*/

/**
    The ldexp() function multiplies a floating-point number by an integral
    power of 2. It returns the value of \a __x times 2 raised to the power
    \a __exp.
 */
extern double ldexp(double __x, int __exp) __ATTR_CONST__;
#define ldexpf	ldexp		/**< The alias for ldexp().	*/

/**
    The exp() function returns the exponential value of \a __x.
 */
extern double exp(double __x) __ATTR_CONST__;
#define expf	exp		/**< The alias for exp().	*/

/**
    The cosh() function returns the hyperbolic cosine of \a __x.
 */
extern double cosh(double __x) __ATTR_CONST__;
#define coshf	cosh		/**< The alias for cosh().	*/

/**
    The sinh() function returns the hyperbolic sine of \a __x.
 */
extern double sinh(double __x) __ATTR_CONST__;
#define sinhf	sinh		/**< The alias for sinh().	*/

/**
    The tanh() function returns the hyperbolic tangent of \a __x.
 */
extern double tanh(double __x) __ATTR_CONST__;
#define tanhf	tanh		/**< The alias for tanh().	*/

/**
    The acos() function computes the principal value of the arc cosine of
    \a __x.  The returned value is in the range [0, pi] radians. A domain
    error occurs for arguments not in the range [-1, +1].
 */
extern double acos(double __x) __ATTR_CONST__;
#define acosf	acos		/**< The alias for acos().	*/

/**
    The asin() function computes the principal value of the arc sine of
    \a __x.  The returned value is in the range [-pi/2, pi/2] radians. A
    domain error occurs for arguments not in the range [-1, +1].
 */
extern double asin(double __x) __ATTR_CONST__;
#define asinf	asin		/**< The alias for asin().	*/

/**
    The atan() function computes the principal value of the arc tangent
    of \a __x.  The returned value is in the range [-pi/2, pi/2] radians.
 */
extern double atan(double __x) __ATTR_CONST__;
#define atanf	atan		/**< The alias for atan().	*/

/**
    The atan2() function computes the principal value of the arc tangent
    of __y / __x, using the signs of both arguments to determine
    the quadrant of the return value.  The returned value is in the range
    [-pi, +pi] radians.
 */
extern double atan2(double __y, double __x) __ATTR_CONST__;
#define atan2f	atan2		/**< The alias for atan2().	*/

/**
    The log() function returns the natural logarithm of argument \a __x.
 */
extern double log(double __x) __ATTR_CONST__;
#define logf	log		/**< The alias for log().	*/

/**
    The log10() function returns the logarithm of argument \a __x to base 10.
 */
extern double log10(double __x) __ATTR_CONST__;
#define log10f	log10		/**< The alias for log10().	*/

/**
    The function pow() returns the value of \a __x to the exponent \a __y.
 */
extern double pow(double __x, double __y) __ATTR_CONST__;
#define powf	pow		/**< The alias for pow().	*/

/**
    The function isnan() returns 1 if the argument \a __x represents a
    "not-a-number" (NaN) object, otherwise 0.
 */
extern int isnan(double __x) __ATTR_CONST__;
#define	isnanf	isnan		/**< The alias for isnan().	*/

/**
    The function isinf() returns 1 if the argument \a __x is positive
    infinity, -1 if \a __x is negative infinity, and 0 otherwise.

    \note The GCC 4.3 can replace this function with inline code that
    returns the 1 value for both infinities (gcc bug #35509).
 */
extern int isinf(double __x) __ATTR_CONST__;
#define isinff	isinf		/**< The alias for isinf().	*/

/**
    The isfinite() function returns a nonzero value if \a __x is finite:
    not plus or minus infinity, and not NaN.
 */
__ATTR_CONST__ static inline int isfinite (double __x)
{
    unsigned char __exp;
    __asm__ (
	"mov	%0, %C1		\n\t"
	"lsl	%0		\n\t"
	"mov	%0, %D1		\n\t"
	"rol	%0		"
	: "=r" (__exp)
	: "r" (__x)	);
    return __exp != 0xff;
}
#define isfinitef isfinite	/**< The alias for isfinite().	*/

/**
    The copysign() function returns \a __x but with the sign of \a __y.
    They work even if \a __x or \a __y are NaN or zero.
*/
__ATTR_CONST__ static inline double copysign (double __x, double __y)
{
    __asm__ (
	"bst	%D2, 7	\n\t"
	"bld	%D0, 7	"
	: "=r" (__x)
	: "0" (__x), "r" (__y) );
    return __x;
}
#define copysignf copysign	/**< The alias for copysign().	*/

/**
    The signbit() function returns a nonzero value if the value of \a __x
    has its sign bit set.  This is not the same as `\a __x < 0.0',
    because IEEE 754 floating point allows zero to be signed. The
    comparison `-0.0 < 0.0' is false, but `signbit (-0.0)' will return a
    nonzero value.
 */
extern int signbit (double __x) __ATTR_CONST__;
#define signbitf signbit	/**< The alias for signbit().	*/

/**
    The fdim() function returns max(__x - __y, 0). If \a __x or
    \a __y or both are NaN, NaN is returned.
 */
extern double fdim (double __x, double __y) __ATTR_CONST__;
#define fdimf	fdim		/**< The alias for fdim().	*/

/**
    The fma() function performs floating-point multiply-add. This is the
    operation (__x * __y) + __z, but the intermediate result is
    not rounded to the destination type.  This can sometimes improve the
    precision of a calculation.
 */
extern double fma (double __x, double __y, double __z) __ATTR_CONST__;
#define fmaf	fma		/**< The alias for fma().	*/

/**
    The fmax() function returns the greater of the two values \a __x and
    \a __y. If an argument is NaN, the other argument is returned. If
    both arguments are NaN, NaN is returned.
 */
extern double fmax (double __x, double __y) __ATTR_CONST__;
#define fmaxf	fmax		/**< The alias for fmax().	*/

/**
    The fmin() function returns the lesser of the two values \a __x and
    \a __y. If an argument is NaN, the other argument is returned. If
    both arguments are NaN, NaN is returned.
 */
extern double fmin (double __x, double __y) __ATTR_CONST__;
#define fminf	fmin		/**< The alias for fmin().	*/

/**
    The trunc() function rounds \a __x to the nearest integer not larger
    in absolute value.
 */
extern double trunc (double __x) __ATTR_CONST__;
#define truncf	trunc		/**< The alias for trunc().	*/

/**
    The round() function rounds \a __x to the nearest integer, but rounds
    halfway cases away from zero (instead of to the nearest even integer).
    Overflow is impossible.

    \return The rounded value. If \a __x is an integral or infinite, \a
    __x itself is returned. If \a __x is \c NaN, then \c NaN is returned.
 */
extern double round (double __x) __ATTR_CONST__;
#define roundf	round		/**< The alias for round().	*/

/**
    The lround() function rounds \a __x to the nearest integer, but rounds
    halfway cases away from zero (instead of to the nearest even integer).
    This function is similar to round() function, but it differs in type of
    return value and in that an overflow is possible.

    \return The rounded long integer value. If \a __x is not a finite number
    or an overflow was, this realization returns the \c LONG_MIN value
    (0x80000000).
 */
extern long lround (double __x) __ATTR_CONST__;
#define lroundf	lround		/**< The alias for lround().	*/

/**
    The lrint() function rounds \a __x to the nearest integer, rounding the
    halfway cases to the even integer direction. (That is both 1.5 and 2.5
    values are rounded to 2). This function is similar to rint() function,
    but it differs in type of return value and in that an overflow is
    possible.

    \return The rounded long integer value. If \a __x is not a finite
    number or an overflow was, this realization returns the \c LONG_MIN
    value (0x80000000).
 */
extern long lrint (double __x) __ATTR_CONST__;
#define lrintf	lrint		/**< The alias for lrint().	*/

#ifdef __cplusplus
}
#endif

/*@}*/
#endif /* !__MATH_H */


text:
'use strict';

/* global workerPouch */

describe('test.supported-browser.js', function () {

  it('should support the current browser', function () {
    return workerPouch.isSupportedBrowser().then(function (supported) {
      if (supported !== true) {
        throw new Error('this browser is not supported');
      }
    });
  });
});


text: export { VstsClient, VstsConfiguration } from "./vstsClient";


text:
package service

import (
	"time"

	"github.com/jcmturner/gokrb5/v8/credentials"
	"github.com/jcmturner/gokrb5/v8/iana/errorcode"
	"github.com/jcmturner/gokrb5/v8/messages"
)

// VerifyAPREQ verifies an AP_REQ sent to the service. Returns a boolean for if the AP_REQ is valid and the client's principal name and realm.
func VerifyAPREQ(APReq *messages.APReq, s *Settings) (bool, *credentials.Credentials, error) {
	var creds *credentials.Credentials
	ok, err := APReq.Verify(s.Keytab, s.MaxClockSkew(), s.ClientAddress(), s.KeytabPrincipal())
	if err != nil || !ok {
		return false, creds, err
	}

	if s.RequireHostAddr() && len(APReq.Ticket.DecryptedEncPart.CAddr) < 1 {
		return false, creds,
			messages.NewKRBError(APReq.Ticket.SName, APReq.Ticket.Realm, errorcode.KRB_AP_ERR_BADADDR, "ticket does not contain HostAddress values required")
	}

	// Check for replay
	rc := GetReplayCache(s.MaxClockSkew())
	if rc.IsReplay(APReq.Ticket.SName, APReq.Authenticator) {
		return false, creds,
			messages.NewKRBError(APReq.Ticket.SName, APReq.Ticket.Realm, errorcode.KRB_AP_ERR_REPEAT, "replay detected")
	}

	c := credentials.NewFromPrincipalName(APReq.Authenticator.CName, APReq.Authenticator.CRealm)
	creds = c
	creds.SetAuthTime(time.Now().UTC())
	creds.SetAuthenticated(true)
	creds.SetValidUntil(APReq.Ticket.DecryptedEncPart.EndTime)

	//PAC decoding
	if !s.disablePACDecoding {
		isPAC, pac, err := APReq.Ticket.GetPACType(s.Keytab, s.KeytabPrincipal(), s.Logger())
		if isPAC && err != nil {
			return false, creds, err
		}
		if isPAC {
			// There is a valid PAC. Adding attributes to creds
			creds.SetADCredentials(credentials.ADCredentials{
				GroupMembershipSIDs: pac.KerbValidationInfo.GetGroupMembershipSIDs(),
				LogOnTime:           pac.KerbValidationInfo.LogOnTime.Time(),
				LogOffTime:          pac.KerbValidationInfo.LogOffTime.Time(),
				PasswordLastSet:     pac.KerbValidationInfo.PasswordLastSet.Time(),
				EffectiveName:       pac.KerbValidationInfo.EffectiveName.Value,
				FullName:            pac.KerbValidationInfo.FullName.Value,
				UserID:              int(pac.KerbValidationInfo.UserID),
				PrimaryGroupID:      int(pac.KerbValidationInfo.PrimaryGroupID),
				LogonServer:         pac.KerbValidationInfo.LogonServer.Value,
				LogonDomainName:     pac.KerbValidationInfo.LogonDomainName.Value,
				LogonDomainID:       pac.KerbValidationInfo.LogonDomainID.String(),
			})
		}
	}
	return true, creds, nil
}


text:
package net.serenitybdd.screenplay.jenkins;

import net.serenitybdd.screenplay.Actor;
import net.serenitybdd.screenplay.Task;
import net.serenitybdd.screenplay.actions.Click;
import net.serenitybdd.screenplay.jenkins.tasks.CreateAFreestyleProject;
import net.serenitybdd.screenplay.jenkins.tasks.configuration.TodoList;
import net.serenitybdd.screenplay.jenkins.user_interface.navigation.SidePanel;
import net.thucydides.core.annotations.Step;

import static net.serenitybdd.screenplay.Tasks.instrumented;

public class HaveAProjectCreated implements Task {

    public static HaveAProjectCreated called(String name) {
        return instrumented(HaveAProjectCreated.class, name);
    }

    public Task andConfiguredTo(Task... configurationTasks) {
        this.requiredConfiguration.addAll(configurationTasks);

        return this;
    }

    @Step("{0} creates the '#projectName' project")
    @Override
    public <T extends Actor> void performAs(T actor) {
        actor.attemptsTo(
                CreateAFreestyleProject.called(projectName).andConfigureItTo(requiredConfiguration),
                Click.on(SidePanel.Back_to_Dashboard)
        );
    }

    public HaveAProjectCreated(String projectName) {
        this.projectName = projectName;
    }

    private final String projectName;
    private final TodoList requiredConfiguration = TodoList.empty();
}


text:
namespace render {
}


text:
<!-- This is the Header Layout -->

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    style="@style/card"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <!-- This is the base Inner View inside a CardHeader.
         You can customize it with your layout xml file and your CardHeader.
         You can popolate your element with CardHeader#setupInnerViewElements() method -->
    <TextView
        android:layout_width="match_parent"
        android:layout_height="48dp"
        android:id="@+id/text_exmple_card1"

        android:textSize="20sp"
        android:layout_marginLeft="0dp"
        android:layout_marginStart="0dp"
        android:background="#53A93F"
        android:paddingLeft="10dp"
        android:paddingRight="10dp"
        android:gravity="center_vertical"
        android:textColor="#FFF"
        />

    </LinearLayout>


text:
This tutorial shows you how to get started developing for Alexa Skills Kit using a Nodejs Lambda.

## Prerequisites

* bespoken tools (bst)
    * `$ npm install bespoken-tools -g`
    * [Installation Instructions](/getting_started/)
* Amazon Developer Account
    * [Amazon Developer](https://developer.amazon.com/alexa)

## Getting Started

Clone the Amazon Alexa Skills Kit for JavaScript repo:

```bash
$ git clone https://github.com/amzn/alexa-skills-kit-js
```

Go to the root level of the sample:
```bash
$ cd alexa-skills-kit-js/
```

## Start bst proxy

For Nodejs Lambdas, bst proxy command, in addition to setting up the proxy, will run your lambda for you and even reload it on changes.

This will start the helloWorld lambda:

```
$ bst proxy lambda samples/helloWorld/src/index.js
```

## Configure your Skill

From the [Alexa Skills Kit list](https://developer.amazon.com/edw/home.html#/skills/list) within the Amazon Developer's Console:

__Choose "Add a New Skill"__

__Fill out the Information tab__

* Give your skill a name and invocation phrase, 'bst nodejs sample' and 'greeter' for example

__Fill out the Interaction Model__

* Copy and paste the Intent Schema from [here](https://raw.githubusercontent.com/amzn/alexa-skills-kit-js/master/samples/helloWorld/speechAssets/IntentSchema.json)
* Copy and paste the Sample Utterances from [here](https://raw.githubusercontent.com/amzn/alexa-skills-kit-js/master/samples/helloWorld/speechAssets/SampleUtterances.txt)

__Configure the Endpoint__

When you started the proxy, bst printed out a URL that you need to configure your skill:

```bash
$ bst proxy lambda samples/helloWorld/src/index.js
BST: v0.6.5  Node: v4.3.2

Your URL for Alexa Skill configuration:
https://proxy.bespoken.tools?node-id=0c6a4f17-c86f-4024-ba26-a351ac319431
```
Alternatively, you can create this URL via the `proxy urlgen` command.

Copy and paste this URL as your endpoint:

![Alexa Skill Configuration](/assets/images/bst-nodejs-lambda-configuration.png "Alexa Skill Configuration")

Also make sure you select "HTTPS" and account linking to "NO".

__Configure SSL__

On the SSL Certificate page, select the middle radio button "My development endpoint is a subdomain of a domain that has a wildcard certificate from a certificate authority"

## Test
Go to the service simulator, and type: "hello" and hit "Ask \<Your Skill Name>".

You should get a valid JSON in reply:

![Test your Skill](/assets/images/bst-nodejs-lambda-test.png "Test your Skill")

## Next Steps
You can now start adding functionality to your skill. To learn more about coding Alexa Skills, see the official [documentation](https://github.com/amzn/alexa-skills-kit-js)

You can also try it out on an Alexa device like an Echo, as long as it is registered with your account.
Just say "Open \<Your Invocation Name>" to use it.


text:
"""Support for mounting images with qemu-nbd"""

import os
import time

from nova.openstack.common import cfg
from nova.openstack.common import log as logging
from nova import utils
from nova.virt.disk.mount import api

LOG = logging.getLogger(__name__)

nbd_opts = [
    cfg.IntOpt('timeout_nbd',
               default=10,
               help='time to wait for a NBD device coming up'),
    cfg.IntOpt('max_nbd_devices',
               default=16,
               help='maximum number of possible nbd devices'),
    ]

CONF = cfg.CONF
CONF.register_opts(nbd_opts)

class NbdMount(api.Mount):
    """qemu-nbd support disk images."""
    mode = 'nbd'

    # NOTE(padraig): There are three issues with this nbd device handling
    #  1. max_nbd_devices should be inferred (#861504)
    #  2. We assume nothing else on the system uses nbd devices
    #  3. Multiple workers on a system can race against each other
    # A patch has been proposed in Nov 2011, to add add a -f option to
    # qemu-nbd, akin to losetup -f. One could test for this by running qemu-nbd
    # with just the -f option, where it will fail if not supported, or if there
    # are no free devices. Note that patch currently hardcodes 16 devices.
    # We might be able to alleviate problem 2. by scanning /proc/partitions
    # like the aformentioned patch does.

    _DEVICES_INITIALIZED = False
    _DEVICES = None

    def __init__(self, image, mount_dir, partition=None, device=None):
        super(NbdMount, self).__init__(image, mount_dir, partition=partition,
                                       device=device)

        # NOTE(mikal): this must be done here, because we need configuration
        # to have been parsed before we initialize. Note the scoping to ensure
        # we're updating the class scoped variables.
        if not self._DEVICES_INITIALIZED:
            NbdMount._DEVICES = ['/dev/nbd%s' % i for
                                 i in range(CONF.max_nbd_devices)]
            NbdMount._DEVICES_INITIALIZED = True

    def _allocate_nbd(self):
        if not os.path.exists("/sys/block/nbd0"):
            self.error = _('nbd unavailable: module not loaded')
            return None

        while True:
            if not self._DEVICES:
                # really want to log this info, not raise
                self.error = _('No free nbd devices')
                return None

            device = self._DEVICES.pop()
            if not os.path.exists("/sys/block/%s/pid" %
                                  os.path.basename(device)):
                break
        return device

    def _free_nbd(self, device):
        # The device could already be present if unget_dev
        # is called right after a nova restart
        # (when destroying an LXC container for example).
        if not device in self._DEVICES:
            self._DEVICES.append(device)

    def get_dev(self):
        device = self._allocate_nbd()
        if not device:
            return False

        LOG.debug(_("Get nbd device %(dev)s for %(imgfile)s") %
                  {'dev': device, 'imgfile': self.image})
        _out, err = utils.trycmd('qemu-nbd', '-c', device, self.image,
                                 run_as_root=True)
        if err:
            self.error = _('qemu-nbd error: %s') % err
            self._free_nbd(device)
            return False

        # NOTE(vish): this forks into another process, so give it a chance
        #             to set up before continuing
        for _i in range(CONF.timeout_nbd):
            if os.path.exists("/sys/block/%s/pid" % os.path.basename(device)):
                self.device = device
                break
            time.sleep(1)
        else:
            self.error = _('nbd device %s did not show up') % device
            self._free_nbd(device)
            return False

        self.linked = True
        return True

    def unget_dev(self):
        if not self.linked:
            return
        LOG.debug(_("Release nbd device %s"), self.device)
        utils.execute('qemu-nbd', '-d', self.device, run_as_root=True)
        self._free_nbd(self.device)
        self.linked = False
        self.device = None


text:
"""Copyright 2016 The OpenConfig Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

setup_tools file definition for oc-pyang.
"""

import os
from setuptools import find_packages
from setuptools import setup
from codecs import open

# support both older pip (<=9.0.3), and modern >=10
try:
    from pip._internal.req import parse_requirements
except ImportError:
    from pip.req import parse_requirements

import openconfig_pyang

# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))

with open("requirements.txt", "r") as fp:
    reqs = [r for r in fp.read().splitlines() if (len(r) > 0 and not r.startswith("#"))]

setup(
    name="openconfig_pyang",
    version=openconfig_pyang.__version__,
    description=("OpenConfig Pyang provides plugins for the Pyang validator "
                 "that provide functionality which relates to OpenConfig "
                 " data models. Particularly, it provides a linter, path "
                 " extractor, and documentation generator."),

    url="https://github.com/openconfig/oc-pyang",

    author="The OpenConfig Authors",
    author_email="netopenconfig@googlegroups.com",

    license="Apache",
    classifiers=[
        "Development Status :: 4 - Beta",
        "Intended Audience :: Telecommunications Industry",
        "Intended Audience :: Developers",
        "Topic :: Software Development :: Code Generators",
        "License :: OSI Approved :: Apache Software License",
        "Programming Language :: Python :: 2.7",
        "Programming Language :: Python :: 3.5"
        "Programming Language :: Python :: 3.6"
        "Programming Language :: Python :: 3.7"
    ],
    include_package_data=True,
    keywords="yang pyang openconfig",
    packages=find_packages(),
    scripts=['bin/oclint'],
    install_requires=reqs,
    zip_safe=False,
)


text:
"use strict";
const ramda = require('ramda');
const fs = require('fs');
const path = require('path');
const node_1 = require('../node');
const scope = require('../scope');
const identifier_1 = require('../identifier');
const property = require('../property');
const types_1 = require('../../types');
function isDeclaration(identifier) {
    return node_1.parent(identifier)
        .map(parent => parent.type === 'VariableDeclarator' && parent.id === identifier)
        .or_else(false);
}
exports.isDeclaration = isDeclaration;
function moduleExport(ast) {
    let modules = scope.identifiers(ast)
        .filter(m => m.name === 'module')
        .filter(m => !property.isa(m))
        .filter(m => node_1.parent(m).map(n => n.type === 'MemberExpression' &&
        ((n.property.type === 'Identifier' && n.property.name === 'exports') ||
            (n.property.type === 'Literal' && n.property.value === 'exports'))));
    let values = types_1.Optional.cat(modules
        .filter(m => node_1.parent(m).chain(node_1.parent).map(i => i.type === 'AssignmentExpression'))
        .map(m => node_1.parent(m).chain(node_1.parent).map(i => i.right))
        .map(v => v.chain(v => v.type === 'Identifier' ? identifier_1.findDefinition(v) : types_1.Optional.of(v))));
    return types_1.Optional.of(ramda.head(values));
}
function resolve(expression) {
    if (expression.type === 'CallExpression') {
        if (expression.callee.type === 'Identifier' && expression.callee.name === 'require' && expression.arguments.length > 0) {
            let fpath = expression.arguments[0];
            if (fpath.type === 'Literal' && typeof (fpath.type) === 'string') {
                // todo: refine _path, .js
                let curDir = path.dirname(ramda.last(node_1.ancestors(expression))['_path']);
                let srcPath = path.join(curDir, fpath.value) + '.js';
                let src = fs.readFileSync(srcPath, 'utf-8');
                return node_1.parse(src, types_1.Optional.of(srcPath), {})
                    .map(ast => moduleExport(ast).or_else(ast))
                    .either(e => types_1.Optional.empty(), m => types_1.Optional.of(m));
            }
            else {
                return types_1.Optional.empty();
            }
        }
        else {
            return types_1.Optional.empty();
        }
    }
    else if (expression.type === 'MemberExpression') {
        if (expression.property.type === 'Identifier') {
            return resolve(expression.object)
                .chain(host => property.value(expression.property.name, host));
        }
        else {
            return types_1.Optional.empty();
        }
    }
    else {
        return types_1.Optional.empty();
    }
}
function definition(declaration) {
    try {
        return node_1.parent(declaration)
            .chain(p => resolve(p.init));
    }
    catch (e) {
        return types_1.Optional.empty();
    }
}
exports.definition = definition;
function propertyValueGetter(propertyName, host) {
    let values = scope.identifiers(host)
        .filter(i => i.name === 'exports' && !property.isa(i))
        .filter(i => node_1.parent(i).map(p => p.type === 'MemberExpression' &&
        p.object === i &&
        ((p.property.type === 'Identifier' && p.property.name === propertyName) ||
            (p.property.type === 'Literal' && p.property.value === propertyName)))
        .or_else(false))
        .filter(i => node_1.parent(i).chain(node_1.parent).map(i => i.type === 'AssignmentExpression' && i.left === node_1.parent(i).or_else(null)))
        .map(i => node_1.parent(i)
        .chain(node_1.parent)
        .map(i => i.right)
        .chain(v => v.type === 'Identifier' ? identifier_1.findDefinition(v) : types_1.Optional.of(v)));
    return types_1.Optional.of(ramda.head(types_1.Optional.cat(values)));
}
exports.propertyValueGetter = propertyValueGetter;


text:
package net.catchme.packet;

import java.net.DatagramPacket;

public abstract class Packet {

	abstract public void process(String data, DatagramPacket dp);

	abstract public String getData();
}


text:
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.

// This page is called via AJAX to repopulte the TOC when LMSFinish() is called.

require_once('../../config.php');
require_once($CFG->dirroot.'/mod/scorm/locallib.php');

$id = optional_param('id', '', PARAM_INT);                  // Course Module ID, or
$a = optional_param('a', '', PARAM_INT);                    // scorm ID
$scoid = required_param('scoid', PARAM_INT);                // sco ID
$attempt = required_param('attempt', PARAM_INT);            // attempt number
$mode = optional_param('mode', 'normal', PARAM_ALPHA);      // navigation mode
$currentorg = optional_param('currentorg', '', PARAM_RAW);  // selected organization.

if (!empty($id)) {
    if (! $cm = get_coursemodule_from_id('scorm', $id)) {
        print_error('invalidcoursemodule');
    }
    if (! $course = $DB->get_record("course", array("id" => $cm->course))) {
        print_error('coursemisconf');
    }
    if (! $scorm = $DB->get_record("scorm", array("id" => $cm->instance))) {
        print_error('invalidcoursemodule');
    }
} else if (!empty($a)) {
    if (! $scorm = $DB->get_record("scorm", array("id" => $a))) {
        print_error('invalidcoursemodule');
    }
    if (! $course = $DB->get_record("course", array("id" => $scorm->course))) {
        print_error('coursemisconf');
    }
    if (! $cm = get_coursemodule_from_instance("scorm", $scorm->id, $course->id)) {
        print_error('invalidcoursemodule');
    }
} else {
    print_error('missingparameter');
}

// PARAM_RAW is used for $currentorg, validate it against records stored in the table.
if (!empty($currentorg)) {
    if (!$DB->record_exists('scorm_scoes', array('scorm' => $scorm->id, 'identifier' => $currentorg))) {
        $currentorg = '';
    }
}

$PAGE->set_url('/mod/scorm/prereqs.php', array('scoid' => $scoid, 'attempt' => $attempt, 'id' => $cm->id));

require_login($course, false, $cm);

$scorm->version = strtolower(clean_param($scorm->version, PARAM_SAFEDIR));   // Just to be safe.
if (!file_exists($CFG->dirroot.'/mod/scorm/datamodels/'.$scorm->version.'lib.php')) {
    $scorm->version = 'scorm_12';
}
require_once($CFG->dirroot.'/mod/scorm/datamodels/'.$scorm->version.'lib.php');

if (confirm_sesskey() && (!empty($scoid))) {
    $result = true;
    $request = null;
    if (has_capability('mod/scorm:savetrack', context_module::instance($cm->id))) {
        $result = scorm_get_toc($USER, $scorm, $cm->id, TOCJSLINK, $currentorg, $scoid, $mode, $attempt, true, false);
        echo $result->toc;
    }
}


text:
package com.ibm.icu.dev.test.localespi;

import com.ibm.icu.dev.test.TestFmwk.TestGroup;

public class TestAll extends TestGroup {

    public static void main(String[] args) {
        new TestAll().run(args);
    }

    public TestAll() {
        super(new String[] {
            "BreakIteratorTest",
            "CollatorTest",
            "DateFormatSymbolsTest",
            "DateFormatTest",
            "DecimalFormatSymbolsTest",
            "NumberFormatTest",
            "CurrencyNameTest",
            "LocaleNameTest",
            "TimeZoneNameTest",
        });
    }
}


text:
package br.com.mnix.mazinrpcaiser.server.service;

/**
 * Created by mnix05 on 11/6/14.
 *
 * @author mnix05
 */
public class RequestHasNoServiceException extends Exception {
	private static final long serialVersionUID = -112128908156740124L;

	public RequestHasNoServiceException(String message) {
		super(message);
	}

}


text:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">

    <!-- Selector style for listrow -->
    <item android:drawable="@drawable/gradient_bg" android:state_pressed="false" android:state_selected="false"/>
    <item android:drawable="@drawable/gradient_bg_hover" android:state_pressed="true"/>
    <item android:drawable="@drawable/gradient_bg_hover" android:state_pressed="false" android:state_selected="true"/>

</selector>


text:
using Google.Maps.Examples.Shared;
using Google.Maps.Feature.Style;
using UnityEngine;

namespace Google.Maps.Examples {
  /// <summary>
  /// Example demonstrating how to add borders around the base of buildings.
  /// </summary>
  /// <remarks>
  /// This example is almost identical to the Nine Slicing example. The only difference is the use
  /// of the <see cref="Extruder"/> class to add modelled borders to the bases of buildings. <para>
  /// Uses <see cref="DynamicMapsService"/> component to allow navigation around the world, with the
  /// <see cref="MapsService"/> component keeping only the viewed part of the world loaded at all
  /// times.
  /// </para><para>
  /// Also uses <see cref="BuildingTexturer"/> component to apply Nine-Sliced <see
  /// cref="Material"/>s.
  /// </para>
  /// Uses <see cref="ErrorHandling"/> component to display any errors encountered by the
  /// <see cref="MapsService"/> component when loading geometry.
  /// </remarks>
  [RequireComponent(typeof(DynamicMapsService), typeof(BuildingTexturer), typeof(ErrorHandling))]
  public sealed class BuildingBorders : MonoBehaviour {
    [Tooltip("Material to apply around bases of buildings and around roads.")]
    public Material BuildingAndRoadBorder;

    [Tooltip("Material to use for roads.")]
    public Material Roads;

    /// <summary>
    /// Create a <see cref="MapsService"/> to load buildings, then add borders around their bases
    /// and around the edges of roads.
    /// </summary>
    private void Start() {
      // Verify a Building Base Material has been given.
      if (BuildingAndRoadBorder == null) {
        Debug.LogError(ExampleErrors.MissingParameter(
            this,
            BuildingAndRoadBorder,
            "Building And Road Border",
            "to apply around the bases of buildings"));

        return;
      }

      // Verify a Roads Material has been given.
      if (Roads == null) {
        Debug.LogError(ExampleErrors.MissingParameter(this, Roads, "Roads", "to apply to roads"));

        return;
      }

      // Get the required Dynamic Maps Service on this GameObject.
      DynamicMapsService dynamicMapsService = GetComponent<DynamicMapsService>();

      // Create a roads style that defines a material for roads and for borders of roads. The
      // specific border material used is chosen to look just a little darker than the material of
      // the ground plane (helping the roads to visually blend into the surrounding ground).
      SegmentStyle roadsStyle =
          new SegmentStyle
              .Builder {
                Material = Roads,
                BorderMaterial = BuildingAndRoadBorder,
                Width = 7.0f,
                BorderWidth = 1.0f
              }
              .Build();

      // Get default style options.
      GameObjectOptions renderingStyles = ExampleDefaults.DefaultGameObjectOptions;

      // Replace default roads style with new, just created roads style.
      renderingStyles.SegmentStyle = roadsStyle;

      // Get required BuildingTexturer component on this GameObject.
      BuildingTexturer buildingTexturer = GetComponent<BuildingTexturer>();

      // Sign up to event called after each new building is loaded, so can assign Materials to this
      // new building, and add an extruded base around the building to fake an Ambient Occlusion
      // contact shadow. Note that:
      // - DynamicMapsService.MapsService is auto-found on first access (so will not be null).
      // - This event must be set now during Awake, so that when Dynamic Maps Service starts loading
      //   the map during Start, this event will be triggered for all Extruded Structures.
      dynamicMapsService.MapsService.Events.ExtrudedStructureEvents.DidCreate.AddListener(args => {
        // Apply nine sliced wall and roof materials to this building.
        buildingTexturer.AssignNineSlicedMaterials(args.GameObject);

        // Add a border around base to building using Building Border Builder class, coloring it
        // using the given border Material.
        Extruder.AddBuildingBorder(args.GameObject, args.MapFeature.Shape, BuildingAndRoadBorder);
      });
    }
  }
}


text:
<component name="libraryTable">
  <library name="Maven: org.jboss.spec.javax.annotation:jboss-annotations-api_1.1_spec:1.0.1.Final">
    <CLASSES>
      <root url="jar://$MAVEN_REPOSITORY$/org/jboss/spec/javax/annotation/jboss-annotations-api_1.1_spec/1.0.1.Final/jboss-annotations-api_1.1_spec-1.0.1.Final.jar!/" />
    </CLASSES>
    <JAVADOC>
      <root url="jar://$MAVEN_REPOSITORY$/org/jboss/spec/javax/annotation/jboss-annotations-api_1.1_spec/1.0.1.Final/jboss-annotations-api_1.1_spec-1.0.1.Final-javadoc.jar!/" />
    </JAVADOC>
    <SOURCES>
      <root url="jar://$MAVEN_REPOSITORY$/org/jboss/spec/javax/annotation/jboss-annotations-api_1.1_spec/1.0.1.Final/jboss-annotations-api_1.1_spec-1.0.1.Final-sources.jar!/" />
    </SOURCES>
  </library>
</component>


text:
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text.Json.Serialization;

namespace Refit
{
    /// <summary>
    /// Transforms a form source from a .NET representation to the appropriate HTTP form encoded representation.
    /// </summary>
    /// <remarks>Performs field renaming and value formatting as specified in <see cref="QueryAttribute"/>s and
    /// <see cref="RefitSettings.FormUrlEncodedParameterFormatter"/>. A given key may appear multiple times with the
    /// same or different values.</remarks>
    class FormValueMultimap : IEnumerable<KeyValuePair<string?, string?>>
    {
        static readonly Dictionary<Type, PropertyInfo[]> PropertyCache = new();

        readonly IList<KeyValuePair<string?, string?>> formEntries = new List<KeyValuePair<string?, string?>>();

        readonly IHttpContentSerializer contentSerializer;

        public FormValueMultimap(object source, RefitSettings settings)
        {
            if (settings is null)
                throw new ArgumentNullException(nameof(settings));
            contentSerializer = settings.ContentSerializer;

            if (source == null) return;

            if (source is IDictionary dictionary)
            {
                foreach (var key in dictionary.Keys)
                {
                    var value = dictionary[key];
                    if (value != null)
                    {
                        Add(key.ToString(), settings.FormUrlEncodedParameterFormatter.Format(value, null));
                    }
                }

                return;
            }

            var type = source.GetType();

            lock (PropertyCache)
            {
                if (!PropertyCache.ContainsKey(type))
                {
                    PropertyCache[type] = GetProperties(type);
                }

                foreach (var property in PropertyCache[type])
                {
                    var value = property.GetValue(source, null);
                    if (value != null)
                    {
                        var fieldName = GetFieldNameForProperty(property);

                        // see if there's a query attribute
                        var attrib = property.GetCustomAttribute<QueryAttribute>(true);

                        if (value is IEnumerable enumerable)
                        {
                            var collectionFormat = attrib != null && attrib.IsCollectionFormatSpecified
                                ? attrib.CollectionFormat
                                : settings.CollectionFormat;

                            switch (collectionFormat)
                            {
                                case CollectionFormat.Multi:
                                    foreach (var item in enumerable)
                                    {
                                        Add(fieldName, settings.FormUrlEncodedParameterFormatter.Format(item, attrib?.Format));
                                    }
                                    break;
                                case CollectionFormat.Csv:
                                case CollectionFormat.Ssv:
                                case CollectionFormat.Tsv:
                                case CollectionFormat.Pipes:
                                    var delimiter = collectionFormat switch
                                    {
                                        CollectionFormat.Csv => ",",
                                        CollectionFormat.Ssv => " ",
                                        CollectionFormat.Tsv => "\t",
                                        _ => "|"
                                    };

                                    var formattedValues = enumerable
                                        .Cast<object>()
                                        .Select(v => settings.FormUrlEncodedParameterFormatter.Format(v, attrib?.Format));
                                    Add(fieldName, string.Join(delimiter, formattedValues));
                                    break;
                                default:
                                    Add(fieldName, settings.FormUrlEncodedParameterFormatter.Format(value, attrib?.Format));
                                    break;
                            }
                        }
                        else
                        {
                            Add(fieldName, settings.FormUrlEncodedParameterFormatter.Format(value, attrib?.Format));
                        }

                    }
                }
            }
        }

        /// <summary>
        /// Returns a key for each entry. If multiple entries share the same key, the key is returned multiple times.
        /// </summary>
        public IEnumerable<string?> Keys => this.Select(it => it.Key);

        void Add(string? key, string? value)
        {
            formEntries.Add(new KeyValuePair<string?, string?>(key, value));
        }

        string GetFieldNameForProperty(PropertyInfo propertyInfo)
        {
            var name = propertyInfo.GetCustomAttributes<AliasAsAttribute>(true)
                               .Select(a => a.Name)
                               .FirstOrDefault()
                   ?? contentSerializer.GetFieldNameForProperty(propertyInfo)
                   ?? propertyInfo.Name;

            var qattrib = propertyInfo.GetCustomAttributes<QueryAttribute>(true)
                           .Select(attr => !string.IsNullOrWhiteSpace(attr.Prefix) ? $"{attr.Prefix}{attr.Delimiter}{name}" : name)
                           .FirstOrDefault();

            return qattrib ?? name;
        }

        static PropertyInfo[] GetProperties(Type type)
        {
            return type.GetProperties(BindingFlags.Instance | BindingFlags.Public)
                       .Where(p => p.CanRead && p.GetMethod?.IsPublic == true)
                       .ToArray();
        }

        public IEnumerator<KeyValuePair<string?, string?>> GetEnumerator()
        {
            return formEntries.GetEnumerator();
        }

        IEnumerator IEnumerable.GetEnumerator()
        {
            return GetEnumerator();
        }
    }
}


text:
package bndtools.model.repo;

public class LoadingContentElement {

	public static final String MSG = "Loading content...";

	@Override
	public String toString() {
		return MSG;
	}

}


text:
#include <thread>
#include <vector>
#include <string>
#include <mutex>
#include <queue>
#include <condition_variable>

#include <async.h>

namespace async {

struct queue::impl {
	std::mutex mutex;
	std::condition_variable event;
	std::condition_variable ready;
	std::thread worker;
	std::queue<std::function<void(void)>> jobs;
	bool killed;

	impl();
	void worker_thread(void);
};

queue::impl::impl() {
	killed = false;
	worker = std::thread(&impl::worker_thread, this);
}

void queue::impl::worker_thread(void) {
	std::unique_lock<std::mutex> lock(mutex);

	while (!killed) {
		std::function<void(void)> job = nullptr;

		while (!killed && jobs.empty()) {
			ready.notify_all();
			event.wait(lock);
		}

		if (!jobs.empty()) {
			job = jobs.front();
			jobs.pop();

			lock.unlock();
			job();
			lock.lock();
		}
	}
}

queue::queue() : pimpl(new impl) {
}

queue::~queue() {
	wait();

	pimpl->killed = true;
	pimpl->event.notify_all();
	pimpl->worker.join();
}

queue& queue::async(const std::function<void(void)>& job) throw(error) {
	if (!job) {
		throw error("Bad job.");
	}

	std::lock_guard<std::mutex> lock(pimpl->mutex);
	pimpl->jobs.push(job);

	pimpl->event.notify_one();

	return *this;
}

queue& queue::async(group &group, const std::function<void(void)>& job) throw(error) {
	if (!job) {
		throw error("Bad job.");
	}

	group.enter();

	async([&] {
		job();
		group.leave();
	});

	return *this;
}

queue& queue::sync(const std::function<void(void)>& job) throw(error) {
	bool done = false;
	std::mutex sync_mutex;
	std::condition_variable sync_event;

	if (!job) {
		throw error("Bad job.");
	}

	async([&]{
		job();

		std::lock_guard<std::mutex> sync_lock(sync_mutex);
		done = true;
		sync_event.notify_all();
	});

	std::unique_lock<std::mutex> sync_lock(sync_mutex);
	while (!done) {
		sync_event.wait(sync_lock);
	}

	return *this;
}

queue& queue::sync(group &group, const std::function<void(void)>& job) throw(error) {
	if (!job) {
		throw error("Bad job.");
	}

	group.enter();

	sync([&] {
		job();
		group.leave();
	});

	return *this;
}

queue& queue::wait() {
	std::unique_lock<std::mutex> lock(pimpl->mutex);

	while (!pimpl->jobs.empty()) {
		pimpl->ready.wait(lock);
	}

	return *this;
}

}


text:
// Copyright 2017 The Kubernetes Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/**
 * Represents label object used in deploy form view.
 * @final
 */
export default class DeployLabel {
  /**
   * @param {string} key
   * @param {string} value
   * @param {boolean} editable
   * @param {function(string): string|undefined} derivedValueGetterFn
   */
  constructor(key = '', value = '', editable = true, derivedValueGetterFn = undefined) {
    /** @export {boolean} */
    this.editable = editable;

    /** @export {string} */
    this.key = key;

    /** @private {string} */
    this.value_ = value;

    /** @private {function(string): string|undefined} */
    this.derivedValueGetter_ = derivedValueGetterFn;
  }

  /**
   * @param {string=} [newValue]
   * @return {string}
   * @export
   */
  value(newValue) {
    if (this.derivedValueGetter_ !== undefined) {
      if (newValue !== undefined) {
        throw Error('Can not set value of derived label.');
      }
      return this.derivedValueGetter_(this.key);
    }
    return newValue !== undefined ? (this.value_ = newValue) : this.value_;
  }

  /**
   * Converts 'this' object to backendApi.Label object.
   * @return {!backendApi.Label}
   * @export
   */
  toBackendApi() {
    return {
      key: this.key,
      value: this.value(),
    };
  }
}