text:
// The MIT License (MIT)
//
// Copyright (c) Microsoft Corporation
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

using System;
using System.IO;

namespace Microsoft.Tools.WindowsInstaller
{
    /// <summary>
    /// Represents a view on the registry as imposed by the registry redirector.
    /// </summary>
    /// <remarks>
    /// This is a static respresentation based on the information at:
    /// http://msdn.microsoft.com/en-us/library/windows/desktop/aa384253(v=vs.85).aspx.
    /// </remarks>
    internal sealed class RegistryView
    {
        // Singleton fields.
        private static volatile object syncRoot = new object();
        private static RegistryView instance = null;

        // Improve performance by loading fields instead of allocating new strings each time.
        private static readonly string SOFTWARE = @"\SOFTWARE";
        private static readonly string WOW64 = @"\Wow6432Node";

        private static readonly string SOFTWARE_WOW64 = SOFTWARE + WOW64;

        private static readonly string HKCR = "HKEY_CLASSES_ROOT";
        private static readonly string HKCR_WOW64 = @"HKEY_CLASSES_ROOT" + WOW64;
        private static readonly string HKCU = "HKEY_CURRENT_USER";
        private static readonly string HKCU_WOW64 = @"HKEY_CURRENT_USER" + SOFTWARE_WOW64;
        private static readonly string HKLM = "HKEY_LOCAL_MACHINE";
        private static readonly string HKLM_WOW64 = @"HKEY_LOCAL_MACHINE" + SOFTWARE_WOW64;
        private static readonly string HKU = "HKEY_USERS";

        private static readonly Tree<bool> tree;

        static RegistryView()
        {
            // The value is false if Shared or true if Redirected.
            tree = new Tree<bool>();

            // HKEY_CLASSES_ROOT
            tree.Add(@"00:\CLSID", true);
            tree.Add(@"00:\DirectShow", true);
            tree.Add(@"00:\Interface", true);
            tree.Add(@"00:\Media Type", true);
            tree.Add(@"00:\MediaFoundation", true);

            // HKEY_CURRENT_USER
            tree.Add(@"01:\SOFTWARE\Classes\CLSID", true);
            tree.Add(@"01:\SOFTWARE\Classes\DirectShow", true);
            tree.Add(@"01:\SOFTWARE\Classes\Interface", true);
            tree.Add(@"01:\SOFTWARE\Classes\Media Type", true);
            tree.Add(@"01:\SOFTWARE\Classes\MediaFoundation", true);

            // HKEY_LOCAL_MACHINE
            tree.Add(@"02:\SOFTWARE", true);
            tree.Add(@"02:\SOFTWARE\Classes", false);
            tree.Add(@"02:\SOFTWARE\Classes\CLSID", true);
            tree.Add(@"02:\SOFTWARE\Classes\DirectShow", true);
            tree.Add(@"02:\SOFTWARE\Classes\Interface", true);
            tree.Add(@"02:\SOFTWARE\Classes\Media Type", true);
            tree.Add(@"02:\SOFTWARE\Classes\MediaFoundation", true);
            tree.Add(@"02:\SOFTWARE\Clients", false);
            tree.Add(@"02:\SOFTWARE\Microsoft\COM3", false);
            tree.Add(@"02:\SOFTWARE\Microsoft\Cryptography\Calais\Current", false);
            tree.Add(@"02:\SOFTWARE\Microsoft\Cryptography\Calais\Readers", false);
            tree.Add(@"02:\SOFTWARE\Microsoft\Cryptography\Services", false);
            tree.Add(@"02:\SOFTWARE\Microsoft\CTF\SystemShared", false);
            tree.Add(@"02:\SOFTWARE\Microsoft\CTF\TIP", false);
            tree.Add(@"02:\SOFTWARE\Microsoft\DFS", false);
            tree.Add(@"02:\SOFTWARE\Microsoft\Driver Signing", false);
            tree.Add(@"02:\SOFTWARE\Microsoft\EnterpriseCertificates", false);
            tree.Add(@"02:\SOFTWARE\Microsoft\EventSystem", false);
            tree.Add(@"02:\SOFTWARE\Microsoft\MSMQ", false);
            tree.Add(@"02:\SOFTWARE\Microsoft\Non-Driver Signing", false);
            tree.Add(@"02:\SOFTWARE\Microsoft\Notepad\DefaultFonts", false);
            tree.Add(@"02:\SOFTWARE\Microsoft\OLE", false);
            tree.Add(@"02:\SOFTWARE\Microsoft\RAS", false);
            tree.Add(@"02:\SOFTWARE\Microsoft\RPC", false);
            tree.Add(@"02:\SOFTWARE\Microsoft\SOFTWARE\Microsoft\Shared Tools\MSInfo", false);
            tree.Add(@"02:\SOFTWARE\Microsoft\SystemCertificates", false);
            tree.Add(@"02:\SOFTWARE\Microsoft\TermServLicensing", false);
            tree.Add(@"02:\SOFTWARE\Microsoft\TransactionServer", false);
            tree.Add(@"02:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths", false);
            tree.Add(@"02:\SOFTWARE\Microsoft\Windows\CurrentVersion\Control Panel\Cursors\Schemes", false);
            tree.Add(@"02:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers", false);
            tree.Add(@"02:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\DriveIcons", false);
            tree.Add(@"02:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\KindMap", false);
            tree.Add(@"02:\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy", false);
            tree.Add(@"02:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies", false);
            tree.Add(@"02:\SOFTWARE\Microsoft\Windows\CurrentVersion\PreviewHandlers", false);
            tree.Add(@"02:\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup", false);
            tree.Add(@"02:\SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Locations", false);
            tree.Add(@"02:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Console", false);
            tree.Add(@"02:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontDpi", false);
            tree.Add(@"02:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontLink", false);
            tree.Add(@"02:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontMapper", false);
            tree.Add(@"02:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts", false);
            tree.Add(@"02:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontSubstitutes", false);
            tree.Add(@"02:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Gre_Initialize", false);
            tree.Add(@"02:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options", false);
            tree.Add(@"02:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Language Pack", false);
            tree.Add(@"02:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkCards", false);
            tree.Add(@"02:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Perflib", false);
            tree.Add(@"02:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Ports", false);
            tree.Add(@"02:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print", false);
            tree.Add(@"02:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList", false);
            tree.Add(@"02:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones", false);
            tree.Add(@"02:\SOFTWARE\Policies", false);
            tree.Add(@"02:\SOFTWARE\RegisteredApplications", false);

            // HKEY_USERS
            tree.Add(@"03:\*\SOFTWARE\Classes\CLSID", true);
            tree.Add(@"03:\*\SOFTWARE\Classes\DirectShow", true);
            tree.Add(@"03:\*\SOFTWARE\Classes\Interface", true);
            tree.Add(@"03:\*\SOFTWARE\Classes\Media Type", true);
            tree.Add(@"03:\*\SOFTWARE\Classes\MediaFoundation", true);
        }

        /// <summary>
        /// Gets the single instance for the current process bitness.
        /// </summary>
        /// <returns></returns>
        internal static RegistryView GetInstance()
        {
            if (null == instance)
            {
                lock (syncRoot)
                {
                    if (null == instance)
                    {
                        instance = new RegistryView(8 == IntPtr.Size);
                    }
                }
            }

            return instance;
        }

        /// <summary>
        /// Creates a new instance of the <see cref="RegistryView"/> class for the given bitness.
        /// </summary>
        /// <param name="is64Bit">True if running under a 64-bit process; otherwise, false for a 32-bit process.</param>
        internal RegistryView(bool is64Bit)
        {
            this.Is64Bit = is64Bit;
        }

        /// <summary>
        /// Gets whether the code is executing in a 64-bit process.
        /// </summary>
        internal bool Is64Bit { get; private set; }

        /// <summary>
        /// Maps the Windows Installer key path to an appropriate registry path given the current process's bitness.
        /// </summary>
        /// <param name="keyPath">The Windows Installer key path to map.</param>
        /// <returns>The registry path that is mapped to the key path, or null if the key path is a 64-bit key path and the current process is 32-bit.</returns>
        internal string MapKeyPath(string keyPath)
        {
            // Callers should not have to handle exceptions for control flow.
            if (string.IsNullOrEmpty(keyPath) || 4 > keyPath.Length)
            {
                return null;
            }

            var root = keyPath.Substring(0, 2);
            var path = keyPath.Substring(3);
            var is64Bit = '2' == root[0];
            var hive = root[1];

            if (!this.Is64Bit)
            {
                // Simply return 32-bit paths as-is and null for 64-bit paths.
                if (!is64Bit)
                {
                    root = this.MapRoot(path, false, hive);
                    if (null != root)
                    {
                        return root + path;
                    }
                }
            }
            else
            {
                // Return 64-bit paths as-is but map 32-bit paths to WOW64 node only if redirected.
                if (is64Bit || !tree.Under(keyPath))
                {
                    root = this.MapRoot(path, true, hive);
                }
                else
                {
                    root = this.MapRoot(path, false, hive);

                    if ('3' == hive)
                    {
                        // Strip user SID from registry key.
                        var i = path.IndexOf(Path.DirectorySeparatorChar, 1);
                        path = path.Substring(i);
                    }

                    // The redirected root will be replaced.
                    if (0 == path.IndexOf(SOFTWARE, StringComparison.OrdinalIgnoreCase))
                    {
                        path = path.Substring(SOFTWARE.Length);
                    }

                    // Make sure the path doesn't reference the WOW64 node twice.
                    // Windows Installer seems to handle this correctly during installation.
                    if (0 == path.IndexOf(WOW64, StringComparison.OrdinalIgnoreCase))
                    {
                        path = path.Substring(WOW64.Length);
                    }
                }

                if (null != root)
                {
                    return root + path;
                }
            }

            return null;
        }

        private string MapRoot(string path, bool is64bit, char hive)
        {
            // Check for impossible mapping.
            if (!this.Is64Bit && is64bit)
            {
                return null;
            }

            // HKEY_CLASSES_ROOT
            if ('0' == hive)
            {
                return this.Is64Bit == is64bit ? HKCR : HKCR_WOW64;
            }

            // HKEY_CURRENT_USER
            if ('1' == hive)
            {
                return this.Is64Bit == is64bit ? HKCU : HKCU_WOW64;
            }

            // HKEY_LOCAL_MACHINE
            if ('2' == hive)
            {
                return this.Is64Bit == is64bit ? HKLM : HKLM_WOW64;
            }

            // HKEY_USERS
            if ('3' == hive && !string.IsNullOrEmpty(path))
            {
                if (this.Is64Bit == is64bit)
                {
                    return HKU;
                }
                else
                {
                    // Extract the user SID with leading backslash.
                    var userSid = path.Substring(0, path.IndexOf(Path.DirectorySeparatorChar, 1));
                    return HKU + userSid + SOFTWARE_WOW64;
                }
            }

            return null;
        }
    }
}


text:
(async function(testRunner) {
  const {page, session, dp} = await testRunner.startBlank(
      'Tests that virtual time fence does not block interrupting protocol' +
      ' commands.');

  await dp.Emulation.setVirtualTimePolicy({policy: 'pause'});
  await dp.Performance.enable();
  await dp.Page.navigate({url: testRunner.url('/resources/blank.html')});
  dp.Emulation.setVirtualTimePolicy({
    policy: 'pauseIfNetworkFetchesPending',
    budget: 1000});

  await dp.Emulation.onceVirtualTimeBudgetExpired();
  await dp.Performance.getMetrics();
  // Should pass.
  testRunner.log('Returned from the Performance.getMetrics call.');
  testRunner.completeTest();
})

redpajama_set_name: RedPajamaGithub


text:
import {Context} from 'dubbo2.js';

export type TPredictFunction = (ctx: Context) => boolean;

export interface IDubboInvokeParam {
  group?: string;
  version?: string;
  timeout?: number;
}

export interface IRule {
  condition: string | RegExp | TPredictFunction;
  invokeParam: IDubboInvokeParam;
}


text:
namespace blink {

// The ResourceInterceptPolicy enum controls whether a resource request is
// allowed to be handled by plugin (intercept as a stream) or to turn into a
// download (intercept as a download).
//
// Note: For a restriction that only intends to prevent download, if it's also
// guaranteed that the resource won't be handled by plugin (e.g. in sandboxed
// iframe), then it's safe and also recommended to choose the more restricted
// policy |kAllowNone|.
enum class ResourceInterceptPolicy {
  // Allow all type of interceptions.
  kAllowAll = 0,

  // Disallow any type of interceptions.
  //
  // TODO(crbug/930951): the current implementation doesn't completely honor
  // this description. When the resource type is |ResourceType::kObject|, mime
  // sniffing would still check the existence of plugins and may intercept it as
  // a stream.
  kAllowNone = 1,

  // Only allow intercepting as stream.
  kAllowPluginOnly = 2,
};

}  // namespace blink

#endif  // THIRD_PARTY_BLINK_PUBLIC_COMMON_NAVIGATION_RESOURCE_INTERCEPT_POLICY_H_


text:
package org.apache.camel.itest.osgi.blueprint;

import org.apache.camel.CamelContext;
import org.apache.camel.ProducerTemplate;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.processor.interceptor.DefaultTraceEventMessage;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Configuration;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.PaxExam;
import org.ops4j.pax.tinybundles.core.TinyBundles;
import org.osgi.framework.Constants;

import static org.ops4j.pax.exam.OptionUtils.combine;

@RunWith(PaxExam.class)
public class BlueprintTracerRefTest extends BlueprintTracerTest {

    // implicitly inherit the test method from super

    @Configuration
    public static Option[] configure() throws Exception {

        Option[] options = combine(
                getDefaultCamelKarafOptions(),

                bundle(TinyBundles.bundle()
                        .add("OSGI-INF/blueprint/test.xml", BlueprintTracerRefTest.class.getResource("blueprint-30.xml"))
                        .set(Constants.BUNDLE_SYMBOLICNAME, BlueprintTracerRefTest.class.getName())
                        .set(Constants.BUNDLE_VERSION, "1.0.0")
                        .set(Constants.DYNAMICIMPORT_PACKAGE, "*")
                        .build()).noStart(),

                // do eagerly register the Camel context so that OsgiCamelContextPublisher can publish it early enough as an OSGi service
                org.ops4j.pax.exam.CoreOptions.systemProperty("registerBlueprintCamelContextEager").value("true"),

                // using the features to install the camel components
                loadCamelFeatures("camel-blueprint"));

        return options;
    }

}


text:
class FileHandler: public Poco::Net::HTTPRequestHandler
{
	public:
		FileHandler();
		virtual ~FileHandler();

		void handleRequest(
				Poco::Net::HTTPServerRequest& request,
				Poco::Net::HTTPServerResponse& response);

	protected:

	private:
};


text:
using ServerKinect.Shape;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ServerKinect.HandTracking
{
    public class Palm
    {
        private Point location;
        private double distanceToContour;

        public Palm(Point location, double distanceToContour)
        {
            this.location = location;
            this.distanceToContour = distanceToContour;
        }

        public Point Location
        {
            get { return this.location; }
        }

        public double DistanceToContour
        {
            get { return this.distanceToContour; }
        }
    }
}


text:
typedef struct {
    int size;
    int len;
    char **names;
    char **vols;
    long long *vers;
    TBuf **vals;
} Vars;

extern Vars *vars_new(int len);
extern Vars *vars_read(IO *io);
extern int vars_write(Vars *v, IO *io);
extern int vars_scan(Vars *v, const char *var, long long ver);
extern void vars_add(Vars *v, const char *var, long long ver, TBuf *val);
extern void vars_free(Vars *v);
extern void vars_cpy(Vars *dest, Vars *src);


text:
package com.google.javascript.jscomp.gwt.client;

import static com.google.common.base.Strings.isNullOrEmpty;
import static com.google.common.base.Strings.nullToEmpty;

import com.google.common.collect.ImmutableMap;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.JavaScriptObject;
import com.google.javascript.jscomp.BasicErrorManager;
import com.google.javascript.jscomp.CheckLevel;
import com.google.javascript.jscomp.CompilationLevel;
import com.google.javascript.jscomp.Compiler;
import com.google.javascript.jscomp.CompilerOptions;
import com.google.javascript.jscomp.CompilerOptions.LanguageMode;
import com.google.javascript.jscomp.DefaultExterns;
import com.google.javascript.jscomp.DiagnosticType;
import com.google.javascript.jscomp.JSError;
import com.google.javascript.jscomp.ResourceLoader;
import com.google.javascript.jscomp.SourceFile;
import com.google.javascript.jscomp.SourceMapInput;
import com.google.javascript.jscomp.WarningLevel;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import jsinterop.annotations.JsPackage;
import jsinterop.annotations.JsProperty;
import jsinterop.annotations.JsType;

/**
 * Runner for the GWT-compiled JSCompiler as a single exported method.
 */
public final class GwtRunner implements EntryPoint {
  private static final CompilationLevel DEFAULT_COMPILATION_LEVEL =
      CompilationLevel.SIMPLE_OPTIMIZATIONS;

  private static final String EXTERNS_PREFIX = "externs/";

  private GwtRunner() {}

  @JsType(namespace = JsPackage.GLOBAL, name = "Object", isNative = true)
  private static class Flags {
    boolean angularPass;
    boolean assumeFunctionWrapper;
    String compilationLevel;
    boolean dartPass;
    String env;
    boolean exportLocalPropertyDefinitions;
    boolean generateExports;
    String languageIn;
    String languageOut;
    boolean checksOnly;
    boolean newTypeInf;
    boolean polymerPass;
    boolean preserveTypeAnnotations;
    boolean processCommonJsModules;
    public String renamePrefixNamespace;
    boolean rewritePolyfills;
    String warningLevel;
    boolean useTypesForOptimization;

    // These flags do not match the Java compiler JAR.
    File[] jsCode;
    File[] externs;
    boolean createSourceMap;
  }

  /**
   * defaultFlags must have a value set for each field. Otherwise, GWT has no way to create the
   * fields inside Flags (as it's native). If Flags is not-native, GWT eats its field names
   * anyway.
   */
  private static final Flags defaultFlags = new Flags();
  static {
    defaultFlags.angularPass = false;
    defaultFlags.assumeFunctionWrapper = false;
    defaultFlags.compilationLevel = "SIMPLE";
    defaultFlags.dartPass = false;
    defaultFlags.env = "BROWSER";
    defaultFlags.exportLocalPropertyDefinitions = false;
    defaultFlags.generateExports = false;
    defaultFlags.languageIn = "ECMASCRIPT6";
    defaultFlags.languageOut = "ECMASCRIPT5";
    defaultFlags.checksOnly = false;
    defaultFlags.newTypeInf = false;
    defaultFlags.polymerPass = false;
    defaultFlags.preserveTypeAnnotations = false;
    defaultFlags.processCommonJsModules = false;
    defaultFlags.renamePrefixNamespace = null;
    defaultFlags.rewritePolyfills = true;
    defaultFlags.warningLevel = "DEFAULT";
    defaultFlags.useTypesForOptimization = true;
    defaultFlags.jsCode = null;
    defaultFlags.externs = null;
    defaultFlags.createSourceMap = false;
  }

  @JsType(namespace = JsPackage.GLOBAL, name = "Object", isNative = true)
  private static class File {
    @JsProperty String path;
    @JsProperty String src;
    @JsProperty String sourceMap;
  }

  @JsType(namespace = JsPackage.GLOBAL, name = "Object", isNative = true)
  private static class ModuleOutput {
    @JsProperty String compiledCode;
    @JsProperty String sourceMap;
    @JsProperty JavaScriptObject[] errors;
    @JsProperty JavaScriptObject[] warnings;
  }

  private static native JavaScriptObject createError(String file, String description, String type,
        int lineNo, int charNo) /*-{
    return {file: file, description: description, type: type, lineNo: lineNo, charNo: charNo};
  }-*/;

  /**
   * Convert a list of {@link JSError} instances to a JS array containing plain objects.
   */
  private static JavaScriptObject[] toNativeErrorArray(List<JSError> errors) {
    JavaScriptObject out[] = new JavaScriptObject[errors.size()];
    for (int i = 0; i < errors.size(); ++i) {
      JSError error = errors.get(i);
      DiagnosticType type = error.getType();
      out[i] = createError(error.sourceName, error.description, type != null ? type.key : null,
          error.lineNumber, error.getCharno());
    }
    return out;
  }

  private static List<SourceFile> createExterns(CompilerOptions.Environment environment) {
    String[] resources = ResourceLoader.resourceList(GwtRunner.class);
    Map<String, SourceFile> all = new HashMap<>();
    for (String res : resources) {
      if (res.startsWith(EXTERNS_PREFIX)) {
        String filename = res.substring(EXTERNS_PREFIX.length());
        all.put(filename, SourceFile.fromCode("externs.zip//" + res,
              ResourceLoader.loadTextResource(GwtRunner.class, res)));
      }
    }
    return DefaultExterns.prepareExterns(environment, all);
  }

  private static void applyDefaultOptions(CompilerOptions options) {
    CompilationLevel.SIMPLE_OPTIMIZATIONS.setOptionsForCompilationLevel(options);
    WarningLevel.DEFAULT.setOptionsForWarningLevel(options);
    options.setLanguageIn(LanguageMode.ECMASCRIPT6);
    options.setLanguageOut(LanguageMode.ECMASCRIPT5);
  }

  private static void applyOptionsFromFlags(CompilerOptions options, Flags flags) {
    CompilationLevel level = DEFAULT_COMPILATION_LEVEL;
    if (flags.compilationLevel != null) {
      level = CompilationLevel.fromString(flags.compilationLevel.toUpperCase());
      if (level == null) {
        throw new RuntimeException(
            "Bad value for compilationLevel: " + flags.compilationLevel);
      }
    }
    level.setOptionsForCompilationLevel(options);
    if (flags.assumeFunctionWrapper) {
      level.setWrappedOutputOptimizations(options);
    }
    if (flags.useTypesForOptimization) {
      level.setTypeBasedOptimizationOptions(options);
    }

    WarningLevel warningLevel = WarningLevel.DEFAULT;
    if (flags.warningLevel != null) {
      warningLevel = WarningLevel.valueOf(flags.warningLevel);
    }
    warningLevel.setOptionsForWarningLevel(options);

    CompilerOptions.Environment environment = CompilerOptions.Environment.BROWSER;
    if (flags.env != null) {
      environment = CompilerOptions.Environment.valueOf(flags.env.toUpperCase());
    }
    options.setEnvironment(environment);

    LanguageMode languageIn = LanguageMode.fromString(flags.languageIn);
    if (languageIn != null) {
      options.setLanguageIn(languageIn);
    }
    LanguageMode languageOut = LanguageMode.fromString(flags.languageOut);
    if (languageOut != null) {
      options.setLanguageOut(languageOut);
    }

    if (flags.createSourceMap) {
      options.setSourceMapOutputPath("%output%");
    }

    options.setAngularPass(flags.angularPass);
    options.setChecksOnly(flags.checksOnly);
    options.setDartPass(flags.dartPass);
    options.setExportLocalPropertyDefinitions(flags.exportLocalPropertyDefinitions);
    options.setGenerateExports(flags.generateExports);
    options.setNewTypeInference(flags.newTypeInf);
    options.setPolymerPass(flags.polymerPass);
    options.setPreserveTypeAnnotations(flags.preserveTypeAnnotations);
    options.setProcessCommonJSModules(flags.processCommonJsModules);
    options.setRenamePrefixNamespace(flags.renamePrefixNamespace);
    options.setRewritePolyfills(flags.rewritePolyfills);
  }

  private static void disableUnsupportedOptions(CompilerOptions options) {
    options.getDependencyOptions().setDependencySorting(false);
  }

  private static List<SourceFile> fromFileArray(File[] src, String unknownPrefix) {
    List<SourceFile> out = new ArrayList<>();
    if (src != null) {
      for (int i = 0; i < src.length; ++i) {
        File file = src[i];
        String path = file.path;
        if (path == null) {
          path = unknownPrefix + i;
        }
        out.add(SourceFile.fromCode(path, nullToEmpty(file.src)));
      }
    }
    return out;
  }

  private static ImmutableMap<String, SourceMapInput> buildSourceMaps(
      File[] src, String unknownPrefix) {
    ImmutableMap.Builder<String, SourceMapInput> inputSourceMaps = new ImmutableMap.Builder<>();
    if (src != null) {
      for (int i = 0; i < src.length; ++i) {
        File file = src[i];
        if (isNullOrEmpty(file.sourceMap)) {
          continue;
        }
        String path = file.path;
        if (path == null) {
          path = unknownPrefix + i;
        }
        path += ".map";
        SourceFile sf = SourceFile.fromCode(path, file.sourceMap);
        inputSourceMaps.put(path, new SourceMapInput(sf));
      }
    }
    return inputSourceMaps.build();
  }

  /**
   * Updates the destination flags (user input) with source flags (the defaults). Returns a list
   * of flags that are on the destination, but not on the source.
   */
  private static native String[] updateFlags(Flags dst, Flags src) /*-{
    for (var k in src) {
      if (!(k in dst)) {
        dst[k] = src[k];
      }
    }
    var unhandled = [];
    for (var k in dst) {
      if (!(k in src)) {
        unhandled.push(k);
      }
    }
    return unhandled;
  }-*/;

  /**
   * Public compiler call. Exposed in {@link #exportCompile}.
   */
  public static ModuleOutput compile(Flags flags) {
    String[] unhandled = updateFlags(flags, defaultFlags);
    if (unhandled.length > 0) {
      throw new RuntimeException("Unhandled flag: " + unhandled[0]);
    }

    List<SourceFile> jsCode = fromFileArray(flags.jsCode, "Input_");
    ImmutableMap<String, SourceMapInput> sourceMaps = buildSourceMaps(flags.jsCode, "Input_");

    CompilerOptions options = new CompilerOptions();
    applyDefaultOptions(options);
    applyOptionsFromFlags(options, flags);
    options.setInputSourceMaps(sourceMaps);
    disableUnsupportedOptions(options);

    List<SourceFile> externs = fromFileArray(flags.externs, "Extern_");
    externs.addAll(createExterns(options.getEnvironment()));

    NodeErrorManager errorManager = new NodeErrorManager();
    Compiler compiler = new Compiler(new NodePrintStream());
    compiler.setErrorManager(errorManager);
    compiler.compile(externs, jsCode, options);

    ModuleOutput output = new ModuleOutput();
    output.compiledCode = compiler.toSource();
    output.errors = toNativeErrorArray(errorManager.errors);
    output.warnings = toNativeErrorArray(errorManager.warnings);

    if (flags.createSourceMap) {
      StringBuilder b = new StringBuilder();
      try {
        compiler.getSourceMap().appendTo(b, "IGNORED");
      } catch (IOException e) {
        // ignore
      }
      output.sourceMap = b.toString();
    }

    return output;
  }

  /**
   * Exports the {@link #compile} method via JSNI.
   *
   * This will be placed on {@code module.exports}, {@code self.compile} or {@code window.compile}.
   */
  public native void exportCompile() /*-{
    var fn = $entry(@com.google.javascript.jscomp.gwt.client.GwtRunner::compile(*));
    if (typeof module !== 'undefined' && module.exports) {
      module.exports = fn;
    } else if (typeof self === 'object') {
      self.compile = fn;
    } else {
      window.compile = fn;
    }
  }-*/;

  @Override
  public void onModuleLoad() {
    exportCompile();
  }

  /**
   * Custom {@link BasicErrorManager} to record {@link JSError} instances.
   */
  private static class NodeErrorManager extends BasicErrorManager {
    final List<JSError> errors = new ArrayList<>();
    final List<JSError> warnings = new ArrayList<>();

    @Override
    public void println(CheckLevel level, JSError error) {
      if (level == CheckLevel.ERROR) {
        errors.add(error);
      } else if (level == CheckLevel.WARNING) {
        warnings.add(error);
      }
    }

    @Override
    public void printSummary() {}
  }

  // TODO(johnlenz): remove this once GWT has a proper PrintStream implementation
  private static class NodePrintStream extends PrintStream {
    private String line = "";

    NodePrintStream() {
      super((OutputStream) null);
    }

    @Override
    public void println(String s) {
      print(s + "\n");
    }

    @Override
    public void print(String s) {
      if (useStdErr()) {
        writeToStdErr(s);
      } else {
        writeFinishedLinesToConsole(s);
      }
    }

    private void writeFinishedLinesToConsole(String s) {
      line = line + s;
      int start = 0;
      int end = 0;
      while ((end = line.indexOf('\n', start)) != -1) {
        writeToConsole(line.substring(start, end));
        start = end + 1;
      }
      line = line.substring(start);
    }

    private static native boolean useStdErr() /*-{
      return !!(typeof process != "undefined" && process.stderr);
    }-*/;

    private native boolean writeToStdErr(String s) /*-{
      process.stderr.write(s);
    }-*/;

    // NOTE: console methods always add a newline following the text.
    private native void writeToConsole(String s) /*-{
       console.log(s);
    }-*/;

    @Override
    public void close() {
    }

    @Override
    public void flush() {
    }

    @Override
    public void write(byte[] buffer, int offset, int length) {
    }

    @Override
    public void write(int oneByte) {
    }
  }
}


text:
// Generated by xsd compiler for android/java
// DO NOT CHANGE!
package ebay.apis.eblbasecomponents;

import java.io.Serializable;
import com.leansoft.nano.annotation.*;

/**
 *
 * Indicates which address option the category supports for
 * Classified Ad format listings.
 * Added for EbayMotors Pro users
 *
 */
public class EBayMotorsProStreetCountDefinitionType implements Serializable {

    private static final long serialVersionUID = -1L;

}


text:
from __future__ import print_function
import os

def debug_print(*args):
    if 'ASP_DEBUG' in os.environ:
        for arg in args:
            print(arg, end='')
        print()


text:
<?php

declare(strict_types=1);

namespace App\Service;

use App\Entity;
use App\Exception\RateLimitExceededException;
use App\LockFactory;
use App\Version;
use GuzzleHttp\Client;
use GuzzleHttp\RequestOptions;
use InvalidArgumentException;
use RuntimeException;
use Symfony\Component\Lock\Exception\LockConflictedException;

class LastFm
{
    public const API_BASE_URL = 'https://ws.audioscrobbler.com/2.0/';

    protected ?string $apiKey = null;

    public function __construct(
        protected Client $httpClient,
        protected LockFactory $lockFactory,
        Entity\Repository\SettingsRepository $settingsRepo
    ) {
        $this->apiKey = $settingsRepo->readSettings()->getLastFmApiKey();
    }

    public function hasApiKey(): bool
    {
        return !empty($this->apiKey);
    }

    /**
     * @param string $apiMethod API method to call.
     * @param mixed[] $query Query string parameters to supplement defaults.
     *
     * @return mixed[] The decoded JSON response.
     */
    public function makeRequest(
        string $apiMethod,
        array $query = []
    ): array {
        $apiKey = $this->apiKey;
        if (empty($apiKey)) {
            throw new InvalidArgumentException('No last.fm API key provided.');
        }

        $rateLimitLock = $this->lockFactory->createLock(
            'api_lastfm',
            1,
            false
        );

        try {
            $rateLimitLock->acquire(true);
        } catch (LockConflictedException) {
            throw new RateLimitExceededException('Could not acquire rate limiting lock.');
        }

        $query = array_merge(
            $query,
            [
                'method' => $apiMethod,
                'api_key' => $apiKey,
                'format' => 'json',
            ]
        );

        $response = $this->httpClient->request(
            'GET',
            self::API_BASE_URL,
            [
                RequestOptions::HTTP_ERRORS => true,
                RequestOptions::HEADERS => [
                    'User-Agent' => 'AzuraCast ' . Version::FALLBACK_VERSION,
                    'Accept' => 'application/json',
                ],
                RequestOptions::QUERY => $query,
            ]
        );

        $responseBody = (string)$response->getBody();
        $responseJson = json_decode($responseBody, true, 512, JSON_THROW_ON_ERROR);

        if (!empty($responseJson['error'])) {
            if (!empty($responseJson['message'])) {
                throw new RuntimeException(
                    'last.fm API error: ' . $responseJson['message'],
                    (int)$responseJson['error']
                );
            }

            throw $this->createExceptionFromErrorCode((int)$responseJson['error']);
        }

        return $responseJson;
    }

    protected function createExceptionFromErrorCode(int $errorCode): RuntimeException
    {
        $errorDescriptions = [
            2 => 'Invalid service - This service does not exist',
            3 => 'Invalid Method - No method with that name in this package',
            4 => 'Authentication Failed - You do not have permissions to access the service',
            5 => 'Invalid format - This service doesn\'t exist in that format',
            6 => 'Invalid parameters - Your request is missing a required parameter',
            7 => 'Invalid resource specified',
            8 => 'Operation failed - Something else went wrong',
            9 => 'Invalid session key - Please re-authenticate',
            10 => 'Invalid API key - You must be granted a valid key by last.fm',
            11 => 'Service Offline - This service is temporarily offline. try again later.',
            13 => 'Invalid method signature supplied',
            16 => 'There was a temporary error processing your request. Please try again',
            26 => 'Suspended API key - Access for your account has been suspended, please contact Last.fm',
            29 => 'Rate limit exceeded - Your IP has made too many requests in a short period',
        ];

        return new RuntimeException(
            'last.fm API error: ' . ($errorDescriptions[$errorCode] ?? 'Unknown Error'),
            $errorCode
        );
    }
}


text:
package org.datanucleus.tests.types;

import javax.persistence.EntityManager;
import javax.persistence.EntityTransaction;

import org.datanucleus.samples.annotations.array.ArrayHolder;
import org.datanucleus.samples.annotations.array.Permission;
import org.datanucleus.tests.JPAPersistenceTestCase;

/**
 * Tests for array field persistence.
 */
public class ArrayTest extends JPAPersistenceTestCase
{
    public ArrayTest(String name)
    {
        super(name);
    }

    public void testArrayOfIntViaLob()
    {
        try
        {
            EntityManager em = emf.createEntityManager();
            EntityTransaction tx = em.getTransaction();
            try
            {
                tx.begin();

                ArrayHolder h1 = new ArrayHolder(1);
                int[] ints = new int[] {123, 6789, 25000};
                h1.setIntArray(ints);
                em.persist(h1);

                tx.commit();
            }
            finally
            {
                if (tx.isActive())
                {
                    tx.rollback();
                }
                em.close();
            }
            emf.getCache().evictAll();

            em = emf.createEntityManager();
            tx = em.getTransaction();
            try
            {
                tx.begin();

                ArrayHolder h1 = em.find(ArrayHolder.class, 1);
                assertNotNull(h1);
                int[] ints = h1.getIntArray();
                assertNotNull(ints);
                assertEquals(3, ints.length);
                assertEquals(123, ints[0]);
                assertEquals(6789, ints[1]);
                assertEquals(25000, ints[2]);

                tx.commit();
            }
            finally
            {
                if (tx.isActive())
                {
                    tx.rollback();
                }
                em.close();
            }
        }
        finally
        {
            clean(ArrayHolder.class);
        }
    }

    public void testArrayOfLongViaJoin()
    {
        try
        {
            EntityManager em = emf.createEntityManager();
            EntityTransaction tx = em.getTransaction();
            try
            {
                tx.begin();

                ArrayHolder h1 = new ArrayHolder(1);
                long[] longs = new long[] {123, 6789, 25000};
                h1.setLongArray(longs);
                em.persist(h1);

                tx.commit();
            }
            finally
            {
                if (tx.isActive())
                {
                    tx.rollback();
                }
                em.close();
            }
            emf.getCache().evictAll();

            em = emf.createEntityManager();
            tx = em.getTransaction();
            try
            {
                tx.begin();

                ArrayHolder h1 = em.find(ArrayHolder.class, 1);
                assertNotNull(h1);
                long[] longs = h1.getLongArray();
                assertNotNull(longs);
                assertEquals(3, longs.length);
                assertEquals(123, longs[0]);
                assertEquals(6789, longs[1]);
                assertEquals(25000, longs[2]);

                tx.commit();
            }
            finally
            {
                if (tx.isActive())
                {
                    tx.rollback();
                }
                em.close();
            }
        }
        finally
        {
            clean(ArrayHolder.class);
        }
    }

    public void testArrayOfPersistablesViaJoin()
    {
        try
        {
            EntityManager em = emf.createEntityManager();
            EntityTransaction tx = em.getTransaction();
            try
            {
                tx.begin();

                ArrayHolder h1 = new ArrayHolder(1);
                Permission p1 = new Permission(101, "Admin");
                Permission p2 = new Permission(102, "Developer");
                Permission[] perms = new Permission[] {p1, p2};
                h1.setPermissions(perms);
                em.persist(h1);
                em.persist(p1);
                em.persist(p2);

                tx.commit();
            }
            finally
            {
                if (tx.isActive())
                {
                    tx.rollback();
                }
                em.close();
            }
            emf.getCache().evictAll();

            em = emf.createEntityManager();
            tx = em.getTransaction();
            try
            {
                tx.begin();

                ArrayHolder h1 = em.find(ArrayHolder.class, 1);
                assertNotNull(h1);
                Permission[] perms = h1.getPermissions();
                assertNotNull(perms);
                assertEquals(2, perms.length);
                assertEquals(101, perms[0].getId());
                assertEquals(102, perms[1].getId());

                tx.commit();
            }
            finally
            {
                if (tx.isActive())
                {
                    tx.rollback();
                }
                em.close();
            }
        }
        finally
        {
            clean(ArrayHolder.class);
            clean(Permission.class);
        }
    }
}


text:
$:.unshift(File.dirname(__FILE__))
require 'spec_helper'

%w[pstore tokyo_cabinet kyoto_cabinet sqlite3 mongodb redis].each { |file| require "medusa/storage/#{file}.rb" }

module Medusa
  describe Storage do

    describe ".Hash" do
      it "returns a Hash adapter" do
        Medusa::Storage.Hash.should be_an_instance_of(Hash)
      end
    end

    describe ".PStore" do
      it "returns a PStore adapter" do
        test_file = 'test.pstore'
        Medusa::Storage.PStore(test_file).should be_an_instance_of(Medusa::Storage::PStore)
      end
    end

    describe ".TokyoCabinet" do
      it "returns a TokyoCabinet adapter" do
        test_file = 'test.tch'
        store = Medusa::Storage.TokyoCabinet(test_file)
        store.should be_an_instance_of(Medusa::Storage::TokyoCabinet)
        store.close
      end
    end

    describe ".KyotoCabinet" do
      context "when the file is specified" do
        it "returns a KyotoCabinet adapter using that file" do
          test_file = 'test.kch'
          store = Medusa::Storage.KyotoCabinet(test_file)
          store.should be_an_instance_of(Medusa::Storage::KyotoCabinet)
          store.close
        end
      end

      context "when no file is specified" do
        it "returns a KyotoCabinet adapter using the default filename" do
          store = Medusa::Storage.KyotoCabinet
          store.should be_an_instance_of(Medusa::Storage::KyotoCabinet)
          store.close
        end
      end
    end

    describe ".SQLite3" do
      it "returns a SQLite3 adapter" do
        test_file = 'test.db'
        store = Medusa::Storage.SQLite3(test_file)
        store.should be_an_instance_of(Medusa::Storage::SQLite3)
        store.close
      end
    end

    describe ".MongoDB" do
      it "returns a MongoDB adapter" do
        store = Medusa::Storage.MongoDB
        store.should be_an_instance_of(Medusa::Storage::MongoDB)
        store.close
      end
    end

    describe ".Redis" do
      it "returns a Redis adapter" do
        store = Medusa::Storage.Redis
        store.should be_an_instance_of(Medusa::Storage::Redis)
        store.close
      end
    end

    module Storage
      shared_examples_for "storage engine" do

        before(:each) do
          @url = SPEC_DOMAIN
          @page = Page.new(URI(@url))
        end

        it "should implement [] and []=" do
          @store.should respond_to(:[])
          @store.should respond_to(:[]=)

          @store[@url] = @page
          @store[@url].url.should == URI(@url)
        end

        it "should implement has_key?" do
          @store.should respond_to(:has_key?)

          @store[@url] = @page
          @store.has_key?(@url).should == true

          @store.has_key?('missing').should == false
        end

        it "should implement delete" do
          @store.should respond_to(:delete)

          @store[@url] = @page
          @store.delete(@url).url.should == @page.url
          @store.has_key?(@url).should  == false
        end

        it "should implement keys" do
          @store.should respond_to(:keys)

          urls = [SPEC_DOMAIN, SPEC_DOMAIN + 'test', SPEC_DOMAIN + 'another']
          pages = urls.map { |url| Page.new(URI(url)) }
          urls.zip(pages).each { |arr| @store[arr[0]] = arr[1] }

          (@store.keys - urls).should == []
        end

        it "should implement each" do
          @store.should respond_to(:each)

          urls = [SPEC_DOMAIN, SPEC_DOMAIN + 'test', SPEC_DOMAIN + 'another']
          pages = urls.map { |url| Page.new(URI(url)) }
          urls.zip(pages).each { |arr| @store[arr[0]] = arr[1] }

          result = {}
          @store.each { |k, v| result[k] = v }
          (result.keys - urls).should == []
          (result.values.map { |page| page.url.to_s } - urls).should == []
        end

        it "should implement merge!, and return self" do
          @store.should respond_to(:merge!)

          hash = {SPEC_DOMAIN => Page.new(URI(SPEC_DOMAIN)),
                  SPEC_DOMAIN + 'test' => Page.new(URI(SPEC_DOMAIN + 'test'))}
          merged = @store.merge! hash
          hash.each { |key, value| @store[key].url.to_s.should == key }

          merged.should === @store
        end

        it "should correctly deserialize nil redirect_to when loading" do
          @page.redirect_to.should be_nil
          @store[@url] = @page
          @store[@url].redirect_to.should be_nil
        end
      end

      describe PStore do
        it_should_behave_like "storage engine"

        before(:each) do
          @test_file = 'test.pstore'
          File.delete @test_file rescue nil
          @store =  Medusa::Storage.PStore(@test_file)
        end

        after(:all) do
          File.delete @test_file rescue nil
        end
      end

      describe TokyoCabinet do
        it_should_behave_like "storage engine"

        before(:each) do
          @test_file = 'test.tch'
          File.delete @test_file rescue nil
          @store =  Medusa::Storage.TokyoCabinet(@test_file)
        end

        after(:each) do
          @store.close
        end

        after(:all) do
          File.delete @test_file rescue nil
        end

        it "should raise an error if supplied with a file extension other than .tch" do
          lambda { Medusa::Storage.TokyoCabinet('test.tmp') }.should raise_error(RuntimeError)
        end
      end

      describe KyotoCabinet do
        it_should_behave_like "storage engine"

        before(:each) do
          @test_file = 'test.kch'
          File.delete @test_file rescue nil
          @store =  Medusa::Storage.KyotoCabinet(@test_file)
        end

        after(:each) do
          @store.close
        end

        after(:all) do
          File.delete @test_file rescue nil
        end

        it "should raise an error if supplied with a file extension other than .kch" do
          lambda { Medusa::Storage.KyotoCabinet('test.tmp') }.should raise_error(RuntimeError)
        end
      end

      describe SQLite3 do
        it_should_behave_like "storage engine"

        before(:each) do
          @test_file = 'test.db'
          File.delete @test_file rescue nil
          @store =  Medusa::Storage.SQLite3(@test_file)
        end

        after(:each) do
          @store.close
        end

        after(:all) do
          File.delete @test_file rescue nil
        end

      end

      describe Storage::MongoDB do
        it_should_behave_like "storage engine"

        before(:each) do
          @store = Storage.MongoDB
        end

        after(:each) do
          @store.close
        end
      end

      describe Storage::Redis do
        it_should_behave_like "storage engine"

        before(:each) do
          @store = Storage.Redis
        end

        after(:each) do
          @store.close
        end
      end

    end
  end
end


text:
package br.puc_rio.ele.lvc.interimage.core.datamanager;

/**
 * A class that defines a splittable resource.
 * @author Rodrigo Ferreira
 */
public class SplittableResource implements Resource {

	public static final short IMAGE = 1;
	public static final short SHAPE = 2;

	private Object _object;
	private short _type;

	public SplittableResource(Object obj, short type) {
		_object = obj;
		_type = type;
	}

	public short getType() {
		return _type;
	}

	public Object getObject() {
		return _object;
	}

}


text:
package com.zsygfddsd.spacestation.base.adapter.multirecycler;

import android.util.SparseArray;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by mac on 16/6/24.
 */
public class ItemEntityList {

    private List<Object> mItems = new ArrayList<>();

    private List<Integer> mItemLayoutIds = new ArrayList<>();

    private SparseArray<OnBind> mOnBinds = new SparseArray<>(10);

    public ItemEntityList() {
    }

    public ItemEntityList addItem(int itemLayoutId, Object itemData) {
        mItemLayoutIds.add(itemLayoutId);
        mItems.add(itemData);
        return this;
    }

    public ItemEntityList addItem(int position, int itemLayoutId, Object itemData) {
        mItemLayoutIds.add(position, itemLayoutId);
        mItems.add(position, itemData);
        return this;
    }

    public ItemEntityList addItems(int position, int itemLayoutId, List<?> itemDatas) {

        List<Integer> mlayoutIds = new ArrayList<>();
        for (int i = 0; i < itemDatas.size(); i++) {
            mlayoutIds.add(itemLayoutId);
        }
        mItemLayoutIds.addAll(position, mlayoutIds);
        mItems.addAll(position, itemDatas);
        return this;
    }

    public ItemEntityList addItems(int itemLayoutId, List<?> itemDatas) {
        for (int i = 0; i < itemDatas.size(); i++) {
            mItemLayoutIds.add(itemLayoutId);
        }
        mItems.addAll(itemDatas);
        return this;
    }

    public ItemEntityList addOnBind(int itemLayoutId, OnBind onBind) {
        mOnBinds.put(itemLayoutId, onBind);
        return this;
    }

    public void clear() {
        clearItemDatas();
        clearOnBinds();
    }

    public void clearItemDatas() {
        mItems.clear();
        mItemLayoutIds.clear();
    }

    public void clearOnBinds() {
        mOnBinds.clear();
    }

    public void replace(int position, int itemLayoutId, Object itemData) {
        remove(position);
        addItem(position, itemLayoutId, itemData);
    }

    public void remove(int position) {
        mItems.remove(position);
        mItemLayoutIds.remove(position);
    }

    public List<Object> getItemDatasForViewType(int itemLayoutId) {

        List<Object> items = new ArrayList<>();

        for (int i = 0; i < mItemLayoutIds.size(); i++) {
            if (itemLayoutId == mItemLayoutIds.get(i)) {
                items.add(mItems.get(i));
            }
        }
        return items;
    }

    public List<Integer> getPositionsForViewType(int itemLayoutId) {

        List<Integer> positions = new ArrayList<>();

        for (int i = 0; i < mItemLayoutIds.size(); i++) {
            if (itemLayoutId == mItemLayoutIds.get(i)) {
                positions.add(i);
            }
        }
        return positions;
    }

    public int getItemCount() {
        return mItems.size();
    }

    public int getItemLayoutId(int position) {
        return mItemLayoutIds.get(position);
    }

    public Object getItemData(int position) {
        return mItems.get(position);
    }

    public OnBind getOnBind(int position) {

        return mOnBinds.get(getItemLayoutId(position), null);
    }

    private OnBind getOnBindByLayoutId(int itemLayoutId) {
        return mOnBinds.get(itemLayoutId, null);
    }

}


text:
struct TextureResource {
	std::string name;
	ID3D11ShaderResourceView* srv;
};

struct MaterialResource {
	std::string name;
	Material* material;
};

struct FontResource {
	std::string name;
	SpriteFont* font;
};

class Resources
{

public:
	//Model file formats
	static const char FILE_FORMAT_OBJ[];
	//Image file formats
	static const char FILE_FORMAT_TGA[];
	static const char FILE_FORMAT_DDS[];
	static const char FILE_FORMAT_PNG[];
	static const char FILE_FORMAT_JPG[];
	//Text file formats
	static const char FILE_FORMAT_SPRITE_FONT[];

	const static unsigned int MAX_NUM_MESHES = 50;//Max number of meshes we can load
	const static unsigned int MAX_NUM_TEXTURES = 200;//Max number of textures we can load
	const static unsigned int MAX_NUM_MATERIALS = 100;//Max number of materials we can hold
	const static unsigned int MAX_NUM_FONTS = 50;//Max number of fonts we can hold

	Resources(ID3D11Device* newDevice, ID3D11DeviceContext* newDeviceContext);
	~Resources();

	//Mesh Stuff
	//TODO: refactor
	Mesh* GetMeshIfLoaded(const char* meshName);//Returns the mesh only if it is loaded
	Mesh* GetMeshAndLoadIfNotFound(const char* meshName);
	bool IsMeshLoaded(const char* meshName);
	void LoadMesh(std::string meshName);//Load a mesh for latter
	Mesh* AddMesh(std::string meshName, Vertex* vertices, int numVerts, UINT* indices, int newNumIndices);
	int GetNextMeshIndex();
	int FindMesh(std::string meshName);

	//Texture Stuff
	ID3D11ShaderResourceView* GetTextureIfLoaded(const char* textureName);
	bool IsTextureLoaded(const char* textureName);
	ID3D11ShaderResourceView* LoadTexture(std::string textureName, std::string format);
	ID3D11ShaderResourceView* LoadTextureFindFormat(std::string textureName);
	int FindTextureIndex(std::string textureName);

	//Material Stuff
	//Creates a material with the sampler state, shaders, loads the texture, and possibly the normal to. The shader resource name is equal to the texture name in this case
	Material* CreateMaterial(SimpleVertexShader* vert, SimplePixelShader* pixel, ID3D11SamplerState* sampler, std::string textrureName);
	Material* CreateMaterial(SimpleVertexShader* vert, SimplePixelShader* pixel, ID3D11SamplerState* sampler, std::string textrure1Name, std::string textrure2Name);
	Material* CreateMaterial(SimpleVertexShader* vert, SimplePixelShader* pixel, ID3D11SamplerState* sampler, std::string textrure1Name, std::string textrure2Name, std::string textrure3Name);
	Material* GetMaterial(std::string materialName);
	int GetMaterialIndex(std::string materialName);

	//Font stuff
	SpriteFont* LoadSpriteFont(std::string fileName);
	SpriteFont* GetSpriteFont(std::string fileName);
private:
	ID3D11Device* device;
	ID3D11DeviceContext* deviceContext;

	//TODO: move some of this info to a mesh resource instead of this
	std::string defaultModelPath;
	Mesh* meshes[MAX_NUM_MESHES];
	std::string* meshNameToIndex;
	unsigned int numberOfMeshes;

	std::string defaultTexturePath;
	TextureResource* textures;
	unsigned int numberOfTextures;

	MaterialResource* materials;
	unsigned int numberOfMaterials;

	std::string defaultSpriteFontPath;
	FontResource* fonts;
	unsigned int numberOfFonts;
};


text:
.class final synthetic Lcom/samsung/android/server/virtualspace/-$Lambda$wYXLyHX4JNQqB1O6YCPeZbQDJx0$6;
.super Ljava/lang/Object;

# interfaces
.implements Ljava/lang/Runnable;

# instance fields
.field private final synthetic -$f0:I

.field private final synthetic -$f1:I

.field private final synthetic -$f2:Ljava/lang/Object;

# direct methods
.method private final synthetic $m$0()V
    .locals 3

    iget-object v0, p0, Lcom/samsung/android/server/virtualspace/-$Lambda$wYXLyHX4JNQqB1O6YCPeZbQDJx0$6;->-$f2:Ljava/lang/Object;

    check-cast v0, Lcom/samsung/android/server/virtualspace/VSSession;

    iget v1, p0, Lcom/samsung/android/server/virtualspace/-$Lambda$wYXLyHX4JNQqB1O6YCPeZbQDJx0$6;->-$f0:I

    iget v2, p0, Lcom/samsung/android/server/virtualspace/-$Lambda$wYXLyHX4JNQqB1O6YCPeZbQDJx0$6;->-$f1:I

    invoke-virtual {v0, v1, v2}, Lcom/samsung/android/server/virtualspace/VSSession;->lambda$-com_samsung_android_server_virtualspace_VSSession_14157(II)V

    return-void
.end method

.method public synthetic constructor <init>(IILjava/lang/Object;)V
    .locals 0

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

    iput p1, p0, Lcom/samsung/android/server/virtualspace/-$Lambda$wYXLyHX4JNQqB1O6YCPeZbQDJx0$6;->-$f0:I

    iput p2, p0, Lcom/samsung/android/server/virtualspace/-$Lambda$wYXLyHX4JNQqB1O6YCPeZbQDJx0$6;->-$f1:I

    iput-object p3, p0, Lcom/samsung/android/server/virtualspace/-$Lambda$wYXLyHX4JNQqB1O6YCPeZbQDJx0$6;->-$f2:Ljava/lang/Object;

    return-void
.end method

# virtual methods
.method public final run()V
    .locals 0

    invoke-direct {p0}, Lcom/samsung/android/server/virtualspace/-$Lambda$wYXLyHX4JNQqB1O6YCPeZbQDJx0$6;->$m$0()V

    return-void
.end method


text:
<?php

class updateCampaignResponse
{

    /**
     * @var Campaign $return
     * @access public
     */
    public $return = null;
}


text:
cd %~dp0
py -2 "%LOCALAPPDATA%/Google/Cloud SDK/google-cloud-sdk/bin/dev_appserver.py" app.yaml


text:
import greenfoot.*;
import javax.swing.JOptionPane;
/**
 * Write a description of class GreaterThanButton here.
 *
 * @author (your name)
 * @version (a version number or a date)
 */
public class GreaterThanButton extends Actor
{
    // instance variables - replace the example below with your own
    private int x;
    private OperatorStrategy os;

    /**
     * Constructor for objects of class GreaterThanButton
     */
    public GreaterThanButton()
    {
        GreenfootImage image = new GreenfootImage("Greater.png");
        setImage(image);
    }

    /**
     * An example of a method - replace this comment with your own
     *
     * @param  y   a sample parameter for a method
     * @return     the sum of x and y
     */
    public void act()
    {
      MouseInfo mouseInfo = Greenfoot.getMouseInfo();
      if(Greenfoot.mouseClicked(this)){
          Greenfoot.playSound("button_click.mp3");
          getWorldOfType(GamePlayWorld.class).operator= os.getOperationMode();
          LabelBox box = getWorldOfType(GamePlayWorld.class).getObjects(LabelBox.class).get(0);
          box.updateImage("Greater Than");
        }

    }

    public void addStrategy(OperatorStrategy os){
        this.os = os;
    }
}


text:
package workbench.gui.editor;

import java.util.ArrayList;

import javax.swing.text.Segment;

/**
 * A token marker that splits lines of text into tokens. Each token carries
 * a length field and an indentification tag that can be mapped to a color
 * for painting that token.

 *
 * For performance reasons, the linked list of tokens is reused after each
 * line is tokenized. Therefore, the return value of markTokens
 * should only be used for immediate painting. Notably, it cannot be
 * cached.
 *
 * @author Slava Pestov, Thomas Kellerer
 * @see Token
 */
public abstract class TokenMarker
{
	/**
	 * Stores the first {@link Token} for each line that
	 * has been tokenized
	 */
	protected ArrayList<Token> lineStartTokens = new ArrayList<>(250);

	/**
	 * The number of lines in the model being tokenized. This can be
	 * less than the length of the lineInfo array.
	 */
	protected int length;

	/**
	 * Creates a new TokenMarker. This DOES NOT create
	 * a lineInfo array; an initial call to insertLines()
	 * does that.
	 */
	protected TokenMarker()
	{
	}

	public Token getLastTokenInLine(int lineIndex)
	{
		Token start = getFirstTokenInLine(lineIndex);

		if (start == null) return null;

		while (start != null)
		{
			if (start.next == null)
			{
				return start;
			}
			start = start.next;
		}
		return null;
	}

	private Token findTokenForPosition(int line, int positionInLine)
	{
		Token tok = getFirstTokenInLine(line);
		if (tok == null) return null;
		int pos = 0;
		while (tok != null)
		{
			if (pos <= positionInLine && positionInLine <= pos + tok.length) return tok;
			pos += tok.length;
			tok = tok.next;
			if (pos > positionInLine) return null;
		}
		return null;
	}

	public boolean isStringLiteralAt(int line, int positionInLine)
	{
		Token tok = findTokenForPosition(line, positionInLine);
		if (tok == null) return false;
		if (tok.isLiteral())
		{
			char pending = getPendingLiteralChar();
			return pending == 0;
		}
		return false;
	}

	public Token getFirstTokenInLine(int lineIndex)
	{
		if (lineIndex < 0 || lineIndex >= length)
		{
			return null;
		}
		return lineStartTokens.get(lineIndex);
	}

	public Token getToken(Segment line, int lineIndex)
	{
		Token token = getFirstTokenInLine(lineIndex);
		if (token == null)
		{
			token = markTokens(line, lineIndex);
		}
		return token;
	}

	protected Token getPreviousLineToken(int lineIndex)
	{
		Token token = null;
		while (lineIndex > 0)
		{
			lineIndex--;
			token = getLastTokenInLine(lineIndex);
			if (token != null)
			{
				break;
			}
		}
		return token;
	}

	/**
	 * Clears the tokens for the specified line.
	 * This is to try to give the GC a hint to quickly free up
	 * the memory allocated by the Tokens.  When loading large
	 * files, the Token instances are consuming the most memory
	 */
	protected synchronized void clearLine(int lineIndex)
	{
		Token first = getFirstTokenInLine(lineIndex);
		if (first == null) return;

		while (first.next != null)
		{
			first = first.next;
			first.next = null;
		}
		lineStartTokens.set(lineIndex, null);
	}

	/**
	 * A wrapper for the lower-level markTokensImpl method
	 * that is called to split a line up into tokens.
	 * @param line The line
	 * @param lineIndex The line number
	 */
	public synchronized Token markTokens(Segment line, int lineIndex)
	{
		if (lineIndex >= length) return null;

		Token prev = getPreviousLineToken(lineIndex);

		lineStartTokens.set(lineIndex, null);

		markTokensImpl(prev, line, lineIndex);

		// tell the last token if it has a pending literal character (" or ')
		Token t = getLastTokenInLine(lineIndex);
		if (t != null) t.setPendingLiteralChar(getPendingLiteralChar());

		return lineStartTokens.get(lineIndex);
	}

	/**
	 * An abstract method that splits a line up into tokens. It
	 * should parse the line, and call addToken() to
	 * add syntax tokens to the token list. Then, it should return
	 * the initial token type for the next line.

	 *
	 * For example if the current line contains the start of a
	 * multiline comment that doesn't end on that line, this method
	 * should return the comment token type so that it continues on
	 * the next line.
	 *
	 * @param lastToken The initial token type for this line
	 * @param line The line to be tokenized
	 * @param lineIndex The index of the line in the document, starting at 0
	 */
	protected abstract void markTokensImpl(Token lastToken, Segment line, int lineIndex);

	public abstract char getPendingLiteralChar();

	public void reset()
	{
		for (int i=0; i < lineStartTokens.size(); i++)
		{
			clearLine(i);
		}
		lineStartTokens = new ArrayList<>(250);
		length = 0;
	}

	/**
	 * Informs the token marker that lines have been inserted into
	 * the document.
	 * @param index The first line number
	 * @param lines The number of lines
	 */
	public void insertLines(int index, int lines)
	{
		if (lines <= 0)	return;
		length += lines;

		// Expand the array, so that the subsequent for-next loop
		// does not re-allocated the internal array each time
		lineStartTokens.ensureCapacity(length);

		// now make sure that every index is valid
		int len = index + lines;
		for (int i = index; i < len; i++)
		{
			lineStartTokens.add(index, null);
		}
	}

	/**
	 * Informs the token marker that line have been deleted from
	 * the document. This removes the lines in question from the
	 * lineInfo array.
	 * @param index The first line number
	 * @param lines The number of lines
	 */
	public void deleteLines(int index, int lines)
	{
		if (lines <= 0)	return;
		int end = index + lines;
		length -= lines;
		for (int i=index; i < end; i++)
		{
			clearLine(index);
			lineStartTokens.remove(index);
		}
	}

	/**
	 * Returns the number of lines in this token marker.
	 */
	public int getLineCount()
	{
		return length;
	}

	/**
	 * Adds a token to the token list.
	 *
	 * @param length The length of the token
	 * @param id The id of the token
	 */
	protected synchronized Token addToken(int lineIndex, int length, byte id)
	{
		if (id >= Token.INTERNAL_FIRST && id <= Token.INTERNAL_LAST)
		{
			throw new InternalError("Invalid id: " + id);
		}

		if (length == 0) return null;

		Token newToken = new Token(length, id);
		Token firstToken = lineStartTokens.get(lineIndex);
		if (firstToken == null)
		{
			lineStartTokens.set(lineIndex, newToken);
		}
		else
		{
			while (firstToken.next != null)
			{
				firstToken = firstToken.next;
			}
			firstToken.next = newToken;
		}
		return newToken;
	}

}


text:
namespace ash::cfm {

void ServiceAdaptor::Delegate::OnAdaptorConnect(bool success) {}

void ServiceAdaptor::Delegate::OnAdaptorDisconnect() {}

ServiceAdaptor::ServiceAdaptor(std::string interface_name, Delegate* delegate)
    : interface_name_(std::move(interface_name)), delegate_(delegate) {
  DCHECK(delegate_);
}

ServiceAdaptor::~ServiceAdaptor() = default;

chromeos::cfm::mojom::CfmServiceContext* ServiceAdaptor::GetContext() {
  if (!context_.is_bound()) {
    ServiceConnection::GetInstance()->BindServiceContext(
        context_.BindNewPipeAndPassReceiver());
    context_.reset_on_disconnect();
  }

  return context_.get();
}

void ServiceAdaptor::GetService(std::string interface_name,
                                mojo::ScopedMessagePipeHandle receiver_pipe,
                                GetServiceCallback callback) {
  GetContext()->RequestBindService(
      std::move(interface_name), std::move(receiver_pipe), std::move(callback));
}

void ServiceAdaptor::BindServiceAdaptor() {
  if (adaptor_.is_bound()) {
    return;
  }

  GetContext()->ProvideAdaptor(interface_name_,
                               adaptor_.BindNewPipeAndPassRemote(),
                               base::BindOnce(&ServiceAdaptor::OnAdaptorConnect,
                                              weak_ptr_factory_.GetWeakPtr()));

  adaptor_.set_disconnect_handler(base::BindOnce(
      &ServiceAdaptor::OnAdaptorDisconnect, base::Unretained(this)));
}

void ServiceAdaptor::OnBindService(
    mojo::ScopedMessagePipeHandle receiver_pipe) {
  delegate_->OnBindService(std::move(receiver_pipe));
}

void ServiceAdaptor::OnAdaptorConnect(bool success) {
  DLOG_IF(WARNING, !success) << "Failed Registration for " << interface_name_;
  if (!success) {
    // If the connection to |CfmServiceContext| is unsuccessful reset the
    // adaptor to allow for future attempts.
    adaptor_.reset();
  }

  delegate_->OnAdaptorConnect(success);
}

void ServiceAdaptor::OnAdaptorDisconnect() {
  adaptor_.reset();

  delegate_->OnAdaptorDisconnect();
}

}  // namespace ash::cfm


text:
<?php

require_once("../etc/config.php");

echo "This is the configuration setup for the application........
";
echo "
";
echo "Installation base for apache package                      :  ".$olioconfig['apacheinstallBase']."
";
echo "Installation base for php				   :  ".$olioconfig['phpinstallBase']."
";
echo "Installation base for mysql                               :  ".$olioconfig['mysqlinstallBase']."
";
echo "Installation base for memcached                           :  ".$olioconfig['memcachedinstallBase']."
";
echo "Installation base for mogilefs                            :  ".$olioconfig['mogilefsinstallBase']."
";
echo "The directory that directly corresponds to urlBase        :  ".$olioconfig['siteBase']."
";
echo "Base url for the site                                     :  ".$olioconfig['urlBase']."
";
echo "Expiry time for memcache on set function in seconds       :  ".$olioconfig['cacheExpire']."
";
echo "Mogilefs host ip & port number                            :  ".$olioconfig['mogilefsHost']."
";
echo "Memcached host ip                                         :  ".$olioconfig['memcachedHost']."
";
echo "Gecoder Emulator host ip				   :  ".$olioconfig['geocoderHost']."
";
echo "Flag set for 'onuseradd' tag                              :  ".$olioconfig['onuseradd']."
";
echo "Flag set for 'personrequested' tag                        :  ".$olioconfig['personrequested']."
";
echo "Flag set for 'top10events' tag                            :  ".$olioconfig['top10events']."
";
echo "Flag set for 'tagcloud' tag                               :  ".$olioconfig['tagcloud']."
";
?>


text:
import os
import warnings
from typing import List
from typing import Optional
from typing import Tuple

import pytest
from _pytest.fixtures import FixtureRequest
from _pytest.pytester import Pytester

WARNINGS_SUMMARY_HEADER = "warnings summary"

@pytest.fixture
def pyfile_with_warnings(pytester: Pytester, request: FixtureRequest) -> str:
    """Create a test file which calls a function in a module which generates warnings."""
    pytester.syspathinsert()
    test_name = request.function.__name__
    module_name = test_name.lstrip("test_") + "_module"
    test_file = pytester.makepyfile(
        """
        import {module_name}
        def test_func():
            assert {module_name}.foo() == 1
        """.format(
            module_name=module_name
        ),
        **{
            module_name: """
            import warnings
            def foo():
                warnings.warn(UserWarning("user warning"))
                warnings.warn(RuntimeWarning("runtime warning"))
                return 1
            """,
        },
    )
    return str(test_file)

@pytest.mark.filterwarnings("default")
def test_normal_flow(pytester: Pytester, pyfile_with_warnings) -> None:
    """Check that the warnings section is displayed."""
    result = pytester.runpytest(pyfile_with_warnings)
    result.stdout.fnmatch_lines(
        [
            "*== %s ==*" % WARNINGS_SUMMARY_HEADER,
            "test_normal_flow.py::test_func",
            "*normal_flow_module.py:3: UserWarning: user warning",
            '*  warnings.warn(UserWarning("user warning"))',
            "*normal_flow_module.py:4: RuntimeWarning: runtime warning",
            '*  warnings.warn(RuntimeWarning("runtime warning"))',
            "* 1 passed, 2 warnings*",
        ]
    )

@pytest.mark.filterwarnings("always")
def test_setup_teardown_warnings(pytester: Pytester) -> None:
    pytester.makepyfile(
        """
        import warnings
        import pytest

        @pytest.fixture
        def fix():
            warnings.warn(UserWarning("warning during setup"))
            yield
            warnings.warn(UserWarning("warning during teardown"))

        def test_func(fix):
            pass
    """
    )
    result = pytester.runpytest()
    result.stdout.fnmatch_lines(
        [
            "*== %s ==*" % WARNINGS_SUMMARY_HEADER,
            "*test_setup_teardown_warnings.py:6: UserWarning: warning during setup",
            '*warnings.warn(UserWarning("warning during setup"))',
            "*test_setup_teardown_warnings.py:8: UserWarning: warning during teardown",
            '*warnings.warn(UserWarning("warning during teardown"))',
            "* 1 passed, 2 warnings*",
        ]
    )

@pytest.mark.parametrize("method", ["cmdline", "ini"])
def test_as_errors(pytester: Pytester, pyfile_with_warnings, method) -> None:
    args = ("-W", "error") if method == "cmdline" else ()
    if method == "ini":
        pytester.makeini(
            """
            [pytest]
            filterwarnings=error
            """
        )
    # Use a subprocess, since changing logging level affects other threads
    # (xdist).
    result = pytester.runpytest_subprocess(*args, pyfile_with_warnings)
    result.stdout.fnmatch_lines(
        [
            "E       UserWarning: user warning",
            "as_errors_module.py:3: UserWarning",
            "* 1 failed in *",
        ]
    )

@pytest.mark.parametrize("method", ["cmdline", "ini"])
def test_ignore(pytester: Pytester, pyfile_with_warnings, method) -> None:
    args = ("-W", "ignore") if method == "cmdline" else ()
    if method == "ini":
        pytester.makeini(
            """
        [pytest]
        filterwarnings= ignore
        """
        )

    result = pytester.runpytest(*args, pyfile_with_warnings)
    result.stdout.fnmatch_lines(["* 1 passed in *"])
    assert WARNINGS_SUMMARY_HEADER not in result.stdout.str()

@pytest.mark.filterwarnings("always")
def test_unicode(pytester: Pytester) -> None:
    pytester.makepyfile(
        """
        import warnings
        import pytest

        @pytest.fixture
        def fix():
            warnings.warn("测试")
            yield

        def test_func(fix):
            pass
        """
    )
    result = pytester.runpytest()
    result.stdout.fnmatch_lines(
        [
            "*== %s ==*" % WARNINGS_SUMMARY_HEADER,
            "*test_unicode.py:7: UserWarning: \u6d4b\u8bd5*",
            "* 1 passed, 1 warning*",
        ]
    )

def test_works_with_filterwarnings(pytester: Pytester) -> None:
    """Ensure our warnings capture does not mess with pre-installed filters (#2430)."""
    pytester.makepyfile(
        """
        import warnings

        class MyWarning(Warning):
            pass

        warnings.filterwarnings("error", category=MyWarning)

        class TestWarnings(object):
            def test_my_warning(self):
                try:
                    warnings.warn(MyWarning("warn!"))
                    assert False
                except MyWarning:
                    assert True
    """
    )
    result = pytester.runpytest()
    result.stdout.fnmatch_lines(["*== 1 passed in *"])

@pytest.mark.parametrize("default_config", ["ini", "cmdline"])
def test_filterwarnings_mark(pytester: Pytester, default_config) -> None:
    """Test ``filterwarnings`` mark works and takes precedence over command
    line and ini options."""
    if default_config == "ini":
        pytester.makeini(
            """
            [pytest]
            filterwarnings = always
        """
        )
    pytester.makepyfile(
        """
        import warnings
        import pytest

        @pytest.mark.filterwarnings('ignore::RuntimeWarning')
        def test_ignore_runtime_warning():
            warnings.warn(RuntimeWarning())

        @pytest.mark.filterwarnings('error')
        def test_warning_error():
            warnings.warn(RuntimeWarning())

        def test_show_warning():
            warnings.warn(RuntimeWarning())
    """
    )
    result = pytester.runpytest("-W always" if default_config == "cmdline" else "")
    result.stdout.fnmatch_lines(["*= 1 failed, 2 passed, 1 warning in *"])

def test_non_string_warning_argument(pytester: Pytester) -> None:
    """Non-str argument passed to warning breaks pytest (#2956)"""
    pytester.makepyfile(
        """\
        import warnings
        import pytest

        def test():
            warnings.warn(UserWarning(1, 'foo'))
        """
    )
    result = pytester.runpytest("-W", "always")
    result.stdout.fnmatch_lines(["*= 1 passed, 1 warning in *"])

def test_filterwarnings_mark_registration(pytester: Pytester) -> None:
    """Ensure filterwarnings mark is registered"""
    pytester.makepyfile(
        """
        import pytest

        @pytest.mark.filterwarnings('error')
        def test_func():
            pass
    """
    )
    result = pytester.runpytest("--strict-markers")
    assert result.ret == 0

@pytest.mark.filterwarnings("always")
def test_warning_captured_hook(pytester: Pytester) -> None:
    pytester.makeconftest(
        """
        def pytest_configure(config):
            config.issue_config_time_warning(UserWarning("config warning"), stacklevel=2)
    """
    )
    pytester.makepyfile(
        """
        import pytest, warnings

        warnings.warn(UserWarning("collect warning"))

        @pytest.fixture
        def fix():
            warnings.warn(UserWarning("setup warning"))
            yield 1
            warnings.warn(UserWarning("teardown warning"))

        def test_func(fix):
            warnings.warn(UserWarning("call warning"))
            assert fix == 1
        """
    )

    collected = []

    class WarningCollector:
        def pytest_warning_recorded(self, warning_message, when, nodeid, location):
            collected.append((str(warning_message.message), when, nodeid, location))

    result = pytester.runpytest(plugins=[WarningCollector()])
    result.stdout.fnmatch_lines(["*1 passed*"])

    expected = [
        ("config warning", "config", ""),
        ("collect warning", "collect", ""),
        ("setup warning", "runtest", "test_warning_captured_hook.py::test_func"),
        ("call warning", "runtest", "test_warning_captured_hook.py::test_func"),
        ("teardown warning", "runtest", "test_warning_captured_hook.py::test_func"),
    ]
    for index in range(len(expected)):
        collected_result = collected[index]
        expected_result = expected[index]

        assert collected_result[0] == expected_result[0], str(collected)
        assert collected_result[1] == expected_result[1], str(collected)
        assert collected_result[2] == expected_result[2], str(collected)

        # NOTE: collected_result[3] is location, which differs based on the platform you are on
        #       thus, the best we can do here is assert the types of the paremeters match what we expect
        #       and not try and preload it in the expected array
        if collected_result[3] is not None:
            assert type(collected_result[3][0]) is str, str(collected)
            assert type(collected_result[3][1]) is int, str(collected)
            assert type(collected_result[3][2]) is str, str(collected)
        else:
            assert collected_result[3] is None, str(collected)

@pytest.mark.filterwarnings("always")
def test_collection_warnings(pytester: Pytester) -> None:
    """Check that we also capture warnings issued during test collection (#3251)."""
    pytester.makepyfile(
        """
        import warnings

        warnings.warn(UserWarning("collection warning"))

        def test_foo():
            pass
    """
    )
    result = pytester.runpytest()
    result.stdout.fnmatch_lines(
        [
            "*== %s ==*" % WARNINGS_SUMMARY_HEADER,
            "  *collection_warnings.py:3: UserWarning: collection warning",
            '    warnings.warn(UserWarning("collection warning"))',
            "* 1 passed, 1 warning*",
        ]
    )

@pytest.mark.filterwarnings("always")
def test_mark_regex_escape(pytester: Pytester) -> None:
    """@pytest.mark.filterwarnings should not try to escape regex characters (#3936)"""
    pytester.makepyfile(
        r"""
        import pytest, warnings

        @pytest.mark.filterwarnings(r"ignore:some \(warning\)")
        def test_foo():
            warnings.warn(UserWarning("some (warning)"))
    """
    )
    result = pytester.runpytest()
    assert WARNINGS_SUMMARY_HEADER not in result.stdout.str()

@pytest.mark.filterwarnings("default")
@pytest.mark.parametrize("ignore_pytest_warnings", ["no", "ini", "cmdline"])
def test_hide_pytest_internal_warnings(
    pytester: Pytester, ignore_pytest_warnings
) -> None:
    """Make sure we can ignore internal pytest warnings using a warnings filter."""
    pytester.makepyfile(
        """
        import pytest
        import warnings

        warnings.warn(pytest.PytestWarning("some internal warning"))

        def test_bar():
            pass
    """
    )
    if ignore_pytest_warnings == "ini":
        pytester.makeini(
            """
            [pytest]
            filterwarnings = ignore::pytest.PytestWarning
        """
        )
    args = (
        ["-W", "ignore::pytest.PytestWarning"]
        if ignore_pytest_warnings == "cmdline"
        else []
    )
    result = pytester.runpytest(*args)
    if ignore_pytest_warnings != "no":
        assert WARNINGS_SUMMARY_HEADER not in result.stdout.str()
    else:
        result.stdout.fnmatch_lines(
            [
                "*== %s ==*" % WARNINGS_SUMMARY_HEADER,
                "*test_hide_pytest_internal_warnings.py:4: PytestWarning: some internal warning",
                "* 1 passed, 1 warning *",
            ]
        )

@pytest.mark.parametrize("ignore_on_cmdline", [True, False])
def test_option_precedence_cmdline_over_ini(
    pytester: Pytester, ignore_on_cmdline
) -> None:
    """Filters defined in the command-line should take precedence over filters in ini files (#3946)."""
    pytester.makeini(
        """
        [pytest]
        filterwarnings = error
    """
    )
    pytester.makepyfile(
        """
        import warnings
        def test():
            warnings.warn(UserWarning('hello'))
    """
    )
    args = ["-W", "ignore"] if ignore_on_cmdline else []
    result = pytester.runpytest(*args)
    if ignore_on_cmdline:
        result.stdout.fnmatch_lines(["* 1 passed in*"])
    else:
        result.stdout.fnmatch_lines(["* 1 failed in*"])

def test_option_precedence_mark(pytester: Pytester) -> None:
    """Filters defined by marks should always take precedence (#3946)."""
    pytester.makeini(
        """
        [pytest]
        filterwarnings = ignore
    """
    )
    pytester.makepyfile(
        """
        import pytest, warnings
        @pytest.mark.filterwarnings('error')
        def test():
            warnings.warn(UserWarning('hello'))
    """
    )
    result = pytester.runpytest("-W", "ignore")
    result.stdout.fnmatch_lines(["* 1 failed in*"])

class TestDeprecationWarningsByDefault:
    """
    Note: all pytest runs are executed in a subprocess so we don't inherit warning filters
    from pytest's own test suite
    """

    def create_file(self, pytester: Pytester, mark="") -> None:
        pytester.makepyfile(
            """
            import pytest, warnings

            warnings.warn(DeprecationWarning("collection"))

            {mark}
            def test_foo():
                warnings.warn(PendingDeprecationWarning("test run"))
        """.format(
                mark=mark
            )
        )

    @pytest.mark.parametrize("customize_filters", [True, False])
    def test_shown_by_default(self, pytester: Pytester, customize_filters) -> None:
        """Show deprecation warnings by default, even if user has customized the warnings filters (#4013)."""
        self.create_file(pytester)
        if customize_filters:
            pytester.makeini(
                """
                [pytest]
                filterwarnings =
                    once::UserWarning
            """
            )
        result = pytester.runpytest_subprocess()
        result.stdout.fnmatch_lines(
            [
                "*== %s ==*" % WARNINGS_SUMMARY_HEADER,
                "*test_shown_by_default.py:3: DeprecationWarning: collection",
                "*test_shown_by_default.py:7: PendingDeprecationWarning: test run",
                "* 1 passed, 2 warnings*",
            ]
        )

    def test_hidden_by_ini(self, pytester: Pytester) -> None:
        self.create_file(pytester)
        pytester.makeini(
            """
            [pytest]
            filterwarnings =
                ignore::DeprecationWarning
                ignore::PendingDeprecationWarning
        """
        )
        result = pytester.runpytest_subprocess()
        assert WARNINGS_SUMMARY_HEADER not in result.stdout.str()

    def test_hidden_by_mark(self, pytester: Pytester) -> None:
        """Should hide the deprecation warning from the function, but the warning during collection should
        be displayed normally.
        """
        self.create_file(
            pytester,
            mark='@pytest.mark.filterwarnings("ignore::PendingDeprecationWarning")',
        )
        result = pytester.runpytest_subprocess()
        result.stdout.fnmatch_lines(
            [
                "*== %s ==*" % WARNINGS_SUMMARY_HEADER,
                "*test_hidden_by_mark.py:3: DeprecationWarning: collection",
                "* 1 passed, 1 warning*",
            ]
        )

    def test_hidden_by_cmdline(self, pytester: Pytester) -> None:
        self.create_file(pytester)
        result = pytester.runpytest_subprocess(
            "-W",
            "ignore::DeprecationWarning",
            "-W",
            "ignore::PendingDeprecationWarning",
        )
        assert WARNINGS_SUMMARY_HEADER not in result.stdout.str()

    def test_hidden_by_system(self, pytester: Pytester, monkeypatch) -> None:
        self.create_file(pytester)
        monkeypatch.setenv("PYTHONWARNINGS", "once::UserWarning")
        result = pytester.runpytest_subprocess()
        assert WARNINGS_SUMMARY_HEADER not in result.stdout.str()

@pytest.mark.parametrize("change_default", [None, "ini", "cmdline"])
@pytest.mark.skip(
    reason="This test should be enabled again before pytest 7.0 is released"
)
def test_deprecation_warning_as_error(pytester: Pytester, change_default) -> None:
    """This ensures that PytestDeprecationWarnings raised by pytest are turned into errors.

    This test should be enabled as part of each major release, and skipped again afterwards
    to ensure our deprecations are turning into warnings as expected.
    """
    pytester.makepyfile(
        """
        import warnings, pytest
        def test():
            warnings.warn(pytest.PytestDeprecationWarning("some warning"))
    """
    )
    if change_default == "ini":
        pytester.makeini(
            """
            [pytest]
            filterwarnings =
                ignore::pytest.PytestDeprecationWarning
        """
        )

    args = (
        ("-Wignore::pytest.PytestDeprecationWarning",)
        if change_default == "cmdline"
        else ()
    )
    result = pytester.runpytest(*args)
    if change_default is None:
        result.stdout.fnmatch_lines(["* 1 failed in *"])
    else:
        assert change_default in ("ini", "cmdline")
        result.stdout.fnmatch_lines(["* 1 passed in *"])

class TestAssertionWarnings:
    @staticmethod
    def assert_result_warns(result, msg) -> None:
        result.stdout.fnmatch_lines(["*PytestAssertRewriteWarning: %s*" % msg])

    def test_tuple_warning(self, pytester: Pytester) -> None:
        pytester.makepyfile(
            """\
            def test_foo():
                assert (1,2)
            """
        )
        result = pytester.runpytest()
        self.assert_result_warns(
            result, "assertion is always true, perhaps remove parentheses?"
        )

def test_warnings_checker_twice() -> None:
    """Issue #4617"""
    expectation = pytest.warns(UserWarning)
    with expectation:
        warnings.warn("Message A", UserWarning)
    with expectation:
        warnings.warn("Message B", UserWarning)

@pytest.mark.filterwarnings("ignore::pytest.PytestExperimentalApiWarning")
@pytest.mark.filterwarnings("always")
def test_group_warnings_by_message(pytester: Pytester) -> None:
    pytester.copy_example("warnings/test_group_warnings_by_message.py")
    result = pytester.runpytest()
    result.stdout.fnmatch_lines(
        [
            "*== %s ==*" % WARNINGS_SUMMARY_HEADER,
            "test_group_warnings_by_message.py::test_foo[[]0[]]",
            "test_group_warnings_by_message.py::test_foo[[]1[]]",
            "test_group_warnings_by_message.py::test_foo[[]2[]]",
            "test_group_warnings_by_message.py::test_foo[[]3[]]",
            "test_group_warnings_by_message.py::test_foo[[]4[]]",
            "test_group_warnings_by_message.py::test_foo_1",
            "  */test_group_warnings_by_message.py:*: UserWarning: foo",
            "    warnings.warn(UserWarning(msg))",
            "",
            "test_group_warnings_by_message.py::test_bar[[]0[]]",
            "test_group_warnings_by_message.py::test_bar[[]1[]]",
            "test_group_warnings_by_message.py::test_bar[[]2[]]",
            "test_group_warnings_by_message.py::test_bar[[]3[]]",
            "test_group_warnings_by_message.py::test_bar[[]4[]]",
            "  */test_group_warnings_by_message.py:*: UserWarning: bar",
            "    warnings.warn(UserWarning(msg))",
            "",
            "-- Docs: *",
            "*= 11 passed, 11 warnings *",
        ],
        consecutive=True,
    )

@pytest.mark.filterwarnings("ignore::pytest.PytestExperimentalApiWarning")
@pytest.mark.filterwarnings("always")
def test_group_warnings_by_message_summary(pytester: Pytester) -> None:
    pytester.copy_example("warnings/test_group_warnings_by_message_summary")
    pytester.syspathinsert()
    result = pytester.runpytest()
    result.stdout.fnmatch_lines(
        [
            "*== %s ==*" % WARNINGS_SUMMARY_HEADER,
            "test_1.py: 21 warnings",
            "test_2.py: 1 warning",
            "  */test_1.py:7: UserWarning: foo",
            "    warnings.warn(UserWarning(msg))",
            "",
            "test_1.py: 20 warnings",
            "  */test_1.py:7: UserWarning: bar",
            "    warnings.warn(UserWarning(msg))",
            "",
            "-- Docs: *",
            "*= 42 passed, 42 warnings *",
        ],
        consecutive=True,
    )

def test_pytest_configure_warning(pytester: Pytester, recwarn) -> None:
    """Issue 5115."""
    pytester.makeconftest(
        """
        def pytest_configure():
            import warnings

            warnings.warn("from pytest_configure")
        """
    )

    result = pytester.runpytest()
    assert result.ret == 5
    assert "INTERNALERROR" not in result.stderr.str()
    warning = recwarn.pop()
    assert str(warning.message) == "from pytest_configure"

class TestStackLevel:
    @pytest.fixture
    def capwarn(self, pytester: Pytester):
        class CapturedWarnings:
            captured: List[
                Tuple[warnings.WarningMessage, Optional[Tuple[str, int, str]]]
            ] = []

            @classmethod
            def pytest_warning_recorded(cls, warning_message, when, nodeid, location):
                cls.captured.append((warning_message, location))

        pytester.plugins = [CapturedWarnings()]

        return CapturedWarnings

    def test_issue4445_rewrite(self, pytester: Pytester, capwarn) -> None:
        """#4445: Make sure the warning points to a reasonable location
        See origin of _issue_warning_captured at: _pytest.assertion.rewrite.py:241
        """
        pytester.makepyfile(some_mod="")
        conftest = pytester.makeconftest(
            """
                import some_mod
                import pytest

                pytest.register_assert_rewrite("some_mod")
            """
        )
        pytester.parseconfig()

        # with stacklevel=5 the warning originates from register_assert_rewrite
        # function in the created conftest.py
        assert len(capwarn.captured) == 1
        warning, location = capwarn.captured.pop()
        file, lineno, func = location

        assert "Module already imported" in str(warning.message)
        assert file == str(conftest)
        assert func == "<module>"  # the above conftest.py
        assert lineno == 4

    def test_issue4445_preparse(self, pytester: Pytester, capwarn) -> None:
        """#4445: Make sure the warning points to a reasonable location
        See origin of _issue_warning_captured at: _pytest.config.__init__.py:910
        """
        pytester.makeconftest(
            """
            import nothing
            """
        )
        pytester.parseconfig("--help")

        # with stacklevel=2 the warning should originate from config._preparse and is
        # thrown by an errorneous conftest.py
        assert len(capwarn.captured) == 1
        warning, location = capwarn.captured.pop()
        file, _, func = location

        assert "could not load initial conftests" in str(warning.message)
        assert f"config{os.sep}__init__.py" in file
        assert func == "_preparse"

    @pytest.mark.filterwarnings("default")
    def test_conftest_warning_captured(self, pytester: Pytester) -> None:
        """Warnings raised during importing of conftest.py files is captured (#2891)."""
        pytester.makeconftest(
            """
            import warnings
            warnings.warn(UserWarning("my custom warning"))
            """
        )
        result = pytester.runpytest()
        result.stdout.fnmatch_lines(
            ["conftest.py:2", "*UserWarning: my custom warning*"]
        )

    def test_issue4445_import_plugin(self, pytester: Pytester, capwarn) -> None:
        """#4445: Make sure the warning points to a reasonable location"""
        pytester.makepyfile(
            some_plugin="""
            import pytest
            pytest.skip("thing", allow_module_level=True)
            """
        )
        pytester.syspathinsert()
        pytester.parseconfig("-p", "some_plugin")

        # with stacklevel=2 the warning should originate from
        # config.PytestPluginManager.import_plugin is thrown by a skipped plugin

        assert len(capwarn.captured) == 1
        warning, location = capwarn.captured.pop()
        file, _, func = location

        assert "skipped plugin 'some_plugin': thing" in str(warning.message)
        assert f"config{os.sep}__init__.py" in file
        assert func == "_warn_about_skipped_plugins"

    def test_issue4445_issue5928_mark_generator(self, pytester: Pytester) -> None:
        """#4445 and #5928: Make sure the warning from an unknown mark points to
        the test file where this mark is used.
        """
        testfile = pytester.makepyfile(
            """
            import pytest

            @pytest.mark.unknown
            def test_it():
                pass
            """
        )
        result = pytester.runpytest_subprocess()
        # with stacklevel=2 the warning should originate from the above created test file
        result.stdout.fnmatch_lines_random(
            [
                "*{testfile}:3*".format(testfile=str(testfile)),
                "*Unknown pytest.mark.unknown*",
            ]
        )


text:
#ifndef AMGCL_UTIL_HPP
#define AMGCL_UTIL_HPP

/**
 * \file   amgcl/util.hpp
 * \author Denis Demidov <dennis.demidov@gmail.com>
 * \brief  Various utilities.
 */

#include <iostream>
#include <set>
#include <limits>
#include <stdexcept>
#include <boost/io/ios_state.hpp>
#include <boost/property_tree/ptree.hpp>
#include <boost/preprocessor/stringize.hpp>
#include <boost/preprocessor/facilities/empty.hpp>
#include <boost/preprocessor/seq/for_each.hpp>

/* Performance measurement macros
 *
 * If AMGCL_PROFILING macro is defined at compilation, then TIC(name) and
 * TOC(name) macros correspond to prof.tic(name) and prof.toc(name).
 * amgcl::prof should be an instance of amgcl::profiler<> defined in a user
 * code similar to:
 * \code
 * namespace amgcl { profiler<> prof; }
 * \endcode
 * If AMGCL_PROFILING is undefined, then TIC and TOC are noop macros.
 */
#ifdef AMGCL_PROFILING
#  include <amgcl/profiler.hpp>
#  define TIC(name) amgcl::prof.tic(name);
#  define TOC(name) amgcl::prof.toc(name);
namespace amgcl { extern profiler<> prof; }
#else
#  define TIC(name)
#  define TOC(name)
#endif

#define AMGCL_DEBUG_SHOW(x)                                                    \
    std::cout << std::setw(20) << #x << ": "                                   \
              << std::setw(15) << std::setprecision(8) << std::scientific      \
              << (x) << std::endl

namespace amgcl {

/// Throws \p message if \p condition is not true.
template <class Condition, class Message>
void precondition(const Condition &condition, const Message &message) {
    if ( !static_cast<bool>(condition) )
        throw std::runtime_error(message);
}

#define AMGCL_PARAMS_IMPORT_VALUE(p, name)                                     \
    name( p.get(#name, params().name) )

#define AMGCL_PARAMS_IMPORT_CHILD(p, name)                                     \
    name( p.get_child(#name, amgcl::detail::empty_ptree()) )

#define AMGCL_PARAMS_EXPORT_VALUE(p, path, name)                               \
    p.put(std::string(path) + #name, name)

#define AMGCL_PARAMS_EXPORT_CHILD(p, path, name)                               \
    name.get(p, std::string(path) + #name + ".")

// Missing parameter action
#ifndef AMGCL_PARAM_MISSING
#  define AMGCL_PARAM_MISSING(name) (void)0
#endif

// Unknown parameter action
#ifndef AMGCL_PARAM_UNKNOWN
#  define AMGCL_PARAM_UNKNOWN(name)                                            \
      std::cerr << "AMGCL WARNING: unknown parameter " << name << std::endl
#endif

# define AMGCL_PARAMS_CHECK_LOOP(z, p, name)                                   \
    defprm.insert(BOOST_PP_STRINGIZE(name));                                   \
    if (!p.count(BOOST_PP_STRINGIZE(name))) {                                  \
        AMGCL_PARAM_MISSING(BOOST_PP_STRINGIZE(name));                         \
    }

# define AMGCL_PARAMS_CHECK(p, names)                                          \
    std::set<std::string> defprm;                                              \
    BOOST_PP_SEQ_FOR_EACH(AMGCL_PARAMS_CHECK_LOOP, p, names)                   \
    for(boost::property_tree::ptree::const_iterator v = p.begin(), e = p.end(); v != e; ++v) \
        if (!defprm.count(v->first)) {                                         \
            AMGCL_PARAM_UNKNOWN(v->first);                                     \
        }

namespace detail {

inline const boost::property_tree::ptree& empty_ptree() {
    static const boost::property_tree::ptree p;
    return p;
}

struct empty_params {
    empty_params() {}
    empty_params(const boost::property_tree::ptree &p) {
        AMGCL_PARAMS_CHECK(p, BOOST_PP_EMPTY());
    }
    void get(boost::property_tree::ptree&, const std::string&) const {}
};

template <class T>
T eps(size_t n) {
    return 2 * std::numeric_limits<T>::epsilon() * n;
}

} // namespace detail

} // namespace amgcl

namespace std {

// Read pointers from input streams.
// This allows to exchange pointers through boost::property_tree::ptree.
template <class T>
inline istream& operator>>(istream &is, T* &ptr) {
    boost::io::ios_all_saver stream_state(is);

    size_t val;
    is >> std::hex >> val;

    ptr = reinterpret_cast<T*>(val);

    return is;
}

} // namespace std

#endif


text:
package main

import (
		"fmt"
		"net/http"
		"os"
)
func handler(w http.ResponseWriter, r *http.Request){
		h, _ := os.Hostname()
		fmt.Fprintf(w, "Hi there, I'm served from %s!", h)
}
func main(){
		http.HandleFunc("/", handler)
		http.ListenAndServe(":8484", nil)
}