text:
title: "Xdebug"
aliases:
  - /en/master/tools/xdebug/
---

Xdebug can be used to debug both web requests and cli scripts (e.g., Drush commands).

## Stack Setup {#setup}

Xdebug integration is disabled by default as it causes a major performance hit. To enable it:

```bash
fin config set --env=local XDEBUG_ENABLED=1
fin project start
```

To verify that Xdebug was enabled:

```bash
$ fin exec php -v | grep -i xdebug
    with Xdebug v3.0.4, Copyright (c) 2002-2021, by Derick Rethans
```

Next, follow the IDE specific setup steps:

- [PHPStorm](#phpstorm)
- [Visual Studio Code](#vscode)
- [NetBeans](#netbeans)
- [Atom](#atom)

## Debugging with PHPStorm {#phpstorm}

First, follow the [setup instructions](#setup) to enable the Xdebug integration.

### Automatic Setup {#phpstorm-automatic}

PHPStorm makes debugging setup very easy using the [Incoming Connection Dialog](https://www.jetbrains.com/help/idea/incoming-connection-dialog.html).

1. Open a project in PHPStorm and set a breakpoint wherever you like
2. Click on the **Start Listening for PHP Debug Connections** button in PHPStorm

    ![PHPStorm Xdebug Listener](/images/xdebug-phpstorm-listener.png)

3. Open the project in a browser

    A debugging session will start and Xdebug will initialize a connection to PHPStorm.

4. Click on **Accept** in the **Incoming Connection From Xdebug** dialogue in PHPStorm

    ![PHPStorm Xdebug Mappings](/images/xdebug-phpstorm-automatic.png)

    PHPStorm automatically configures a server and directory mappings between the host and the server.

Directory mappings are very important, as that's how PHPStorm knows how to map sources on the server to those on
the host. By default, you will not be able to debug anything above the project's `docroot` folder.

If you don't get the **Incoming Connection From Xdebug** dialogue or you need to debug scripts above the `docroot`
directory, see the [manual setup steps](#phpstorm-manual).

### Manual Setup {#phpstorm-manual}

1. Under **Preferences > Languages & Frameworks > PHP > Servers** add a new server
2. Set **Name** and **Hostname** to project's virtual host (e.g., `myproject.docksal`)
3. Configure host to server directory mappings

    Map the project directory on the host to `/var/www/` on the server:

    ![PHPStorm Xdebug Manual](/images/xdebug-phpstorm-manual.png)

With this manual setup you will be able to debug scripts within your project's root (`/var/www/` on the server).

### CLI Scripts {#phpstorm-cli}

First, follow [automatic](#phpstorm-automatic) or [manual](#phpstorm-manual) instructions to configure server and path
mapping settings in PHPStorm.

To debug PHP CLI scripts, we have to tell PHPStorm which **existing** server configuration to use via the
`PHP_IDE_CONFIG` variable. This can be done using the following commands:

```bash
fin config set --env=local 'PHP_IDE_CONFIG=serverName=${VIRTUAL_HOST}'
fin project start
```

{{% notice warning %}}
The script you are trying to debug must reside within the project root directory (`/var/www/`on the server) or
PHPStorm won't be able to access the script's source code and debug it.
{{% /notice %}}

### CLI Scripts: Drush {#phpstorm-drush}

To debug custom Drush commands, make the following additional adjustments in PHPStorm settings:

1. Go to **Preferences > Languages & Frameworks > PHP > Debug**
2. Uncheck **Force break at the first line when no path mapping specified**
3. Uncheck **Force break at the first line when a script is outside the project**

    ![PHPStorm Xdebug Drush](/images/xdebug-phpstorm-drush.png)

You can run your scripts in console and debug them in the same way as browser requests. For example, you can run
`fin drush fl` and debug this Drush command from the Features module.

## Debugging with Visual Studio Code {#vscode}

1. Follow the [setup instructions](#setup) to enable the Xdebug integration
2. Install [PHP_Debug](https://marketplace.visualstudio.com/items?itemName=felixfbecker.php-debug) plugin by Felix Becker
3. Configure PHP Debug Settings

    - Click Debug Icon in left sidebar
    - Click Configuration Gear in top bar, select `PHP` from the dropdown list
    - Configure `pathMappings`

    ![Visual Studio Xdebug Settings](/images/xdebug-vscode.jpg)

    Here is an an example of what `launch.json` should look like:

    ```json
    {
      "version": "0.2.0",
      "configurations": [
        {
          "name": "Listen for XDebug",
          "type": "php",
          "request": "launch",
          "port": 9000,
          "pathMappings": {
            "/var/www/": "${workspaceFolder}"
          }
        },
        {
          "name": "Launch currently open script",
          "type": "php",
          "request": "launch",
          "program": "${file}",
          "cwd": "${fileDirname}",
          "port": 9000,
          "pathMappings": {
            "/var/www/": "${workspaceFolder}"
          }
        }
      ]
    }
    ```

4. Set a breakpoint
5. Select the **Listen for XDebug** configuration from the dropdown and click **Start Debugging**

You can debug both web requests and cli scripts using this configuration.

{{% notice info %}}
VS Code fans, try the built-in [Visual Studio Code IDE in Docksal](/tools/ide/) with Xdebug configured out of the box.
{{% /notice %}}

### CLI Scripts: Drush {#vscode-drush}

To debug Drush commands using Xdebug and VSCode, add the following to your path mappings under the configuration that begins with `"name": "Listen for XDebug",`

**Drush 8.x**

- Add `"/usr/local/bin/drush": "${workspaceFolder}/bin/drush"` to `pathMappings` in your `launch.json` file.

**Drush 9.x**

- Add `"/usr/local/bin/drush": "${workspaceFolder}/vendor/bin/drush"` to `pathMappings` in your `launch.json` file.

## Debugging with NetBeans {#netbeans}

1. Follow the [setup instructions](#setup) to enable the Xdebug integration
2. Open NetBeans Debugging configuration ("Tools> Options > PHP > Debugging") and set "DebuggerPort" to 9000
3. Open your project in NetBeans
4. Configure project properties:

    - Right mouse click on project name, then "Properties" from the dropdown menu
    - Under "Sources", set correct Web Root folder by clicking "Browse" button (usually it's `docroot`)
    - Under "Run Configuration", use project's virtual host (e.g., `myproject.docksal`) to set the Project URL
    - Click "OK" to save project properties

5. Set a breakpoint wherever you like
6. In NetBeans, with the whole project selected or one of the project files opened and active, press `<CTRL> + <F5>` on your keyboard to start the debugger

## Debugging with Atom {#atom}

1. Follow the [setup instructions](#setup) to enable the Xdebug integration
2. Install [PHP-Debug Plugin](https://atom.io/packages/php-debug)
3. Configure PHP Debug Settings (Preferences > Packages)

    - Search for "php-debug"
    - Click "Settings" button below plugin
    - "Server" can be set to `*`
    - "Server Listen Port" should be set to 9000
    - Make sure "Continue to listen for debug sessions even if the debugger windows are all closed" is checked. This will make the debugger window open automatically.

## XDebug v2 vs v3 Considerations

To avoid introducing breaking changes within the CLI service and with IDEs, Docksal does the following:

- overrides `xdebug.client_port` with `9000` for XDebug v3 (which switched to port `9003` by default)
- sets `XDEBUG_CONFIG=client_host=${DOCKSAL_HOST_IP} remote_host=${DOCKSAL_HOST_IP}` to support both
v3 (`xdebug.client_host`) and v2 (`xdebug.remote_host`) configuration variables at the same time


text:
class Pypy3 < Formula
  desc "Implementation of Python 3 in Python"
  homepage "https://pypy.org/"
  url "https://downloads.python.org/pypy/pypy3.7-v7.3.5-src.tar.bz2"
  sha256 "d920fe409a9ecad9d074aa8568ca5f3ed3581be66f66e5d8988b7ec66e6d99a2"
  license "MIT"
  revision 1
  head "https://foss.heptapod.net/pypy/pypy", using: :hg, branch: "py3.7"

  livecheck do
    url "https://downloads.python.org/pypy/"
    regex(/href=.*?pypy3(?:\.\d+)*[._-]v?(\d+(?:\.\d+)+)-src\.t/i)
  end

  bottle do
    sha256 cellar: :any,                 big_sur:      "3d8907b569ced4b4a0893bb52c2624f9fdc37f095836bae48b1fff7685a47f1f"
    sha256 cellar: :any,                 catalina:     "7fe0a93d651ded514ad89691a4f5b94485c875e010ede43ff8d8a570dac28c8b"
    sha256 cellar: :any,                 mojave:       "bcdd791348b1d5132ec3bbcdc9d592623b04d02e0b22f5afd5b34d3bc5826b70"
    sha256 cellar: :any_skip_relocation, x86_64_linux: "993244a124f5643d23a81a95b0b23a842f098188c37cb3dc94e4852d2565e326"
  end

  depends_on "pkg-config" => :build
  depends_on "pypy" => :build
  depends_on arch: :x86_64
  depends_on "gdbm"
  depends_on "openssl@1.1"
  depends_on "sqlite"
  depends_on "tcl-tk"
  depends_on "xz"

  uses_from_macos "bzip2"
  uses_from_macos "expat"
  uses_from_macos "libffi"
  uses_from_macos "ncurses"
  uses_from_macos "unzip"
  uses_from_macos "zlib"

  resource "setuptools" do
    url "https://files.pythonhosted.org/packages/cf/79/1a19c2f792da00cbead7b6caa176afdddf517522cb9163ce39576025b050/setuptools-57.1.0.tar.gz"
    sha256 "cfca9c97e7eebbc8abe18d5e5e962a08dcad55bb63afddd82d681de4d22a597b"
  end

  resource "pip" do
    url "https://files.pythonhosted.org/packages/4d/0c/3b63fe024414a8a48661cf04f0993d4b2b8ef92daed45636474c018cd5b7/pip-21.1.3.tar.gz"
    sha256 "b5b1eb91b36894bd01b8e5a56a422c2f3838573da0b0a1c63a096bb454e3b23f"
  end

  # Build fixes:
  # - Disable Linux tcl-tk detection since the build script only searches system paths.
  #   When tcl-tk is not found, it uses unversioned `-ltcl -ltk`, which breaks build.
  # - Disable building cffi imports with `--embed-dependencies`, which compiles and
  #   statically links a specific OpenSSL version.
  # - Add flag `--no-make-portable` to package.py so that we can disable portable build.
  #   Portable build is default on macOS and copies tcl-tk/sqlite dylibs into bottle.
  # Upstream issue ref: https://foss.heptapod.net/pypy/pypy/-/issues/3538
  patch :DATA

  def install
    # The `tcl-tk` library paths are hardcoded and need to be modified for non-/usr/local prefix
    inreplace "lib_pypy/_tkinter/tklib_build.py", "/usr/local/opt/tcl-tk/", Formula["tcl-tk"].opt_prefix/""

    # Having PYTHONPATH set can cause the build to fail if another
    # Python is present, e.g. a Homebrew-provided Python 2.x
    # See https://github.com/Homebrew/homebrew/issues/24364
    ENV["PYTHONPATH"] = ""
    ENV["PYPY_USESSION_DIR"] = buildpath

    python = Formula["pypy"].opt_bin/"pypy"
    cd "pypy/goal" do
      system python, buildpath/"rpython/bin/rpython",
             "-Ojit", "--shared", "--cc", ENV.cc, "--verbose",
             "--make-jobs", ENV.make_jobs, "targetpypystandalone.py"

      with_env(PYTHONPATH: buildpath) do
        system "./pypy3-c", buildpath/"lib_pypy/pypy_tools/build_cffi_imports.py"
      end
    end

    libexec.mkpath
    cd "pypy/tool/release" do
      package_args = %w[--archive-name pypy3 --targetdir . --no-make-portable --no-embedded-dependencies]
      system python, "package.py", *package_args
      system "tar", "-C", libexec.to_s, "--strip-components", "1", "-xf", "pypy3.tar.bz2"
    end

    (libexec/"lib").install libexec/"bin/#{shared_library("libpypy3-c")}" => shared_library("libpypy3-c")

    if OS.mac?
      MachO::Tools.change_install_name("#{libexec}/bin/pypy3",
                                       "@rpath/libpypy3-c.dylib",
                                       "#{libexec}/lib/libpypy3-c.dylib")
      MachO::Tools.change_dylib_id("#{libexec}/lib/libpypy3-c.dylib",
                                   "#{opt_libexec}/lib/libpypy3-c.dylib")
    end

    (libexec/"lib-python").install "lib-python/3"
    libexec.install %w[include lib_pypy]

    # The PyPy binary install instructions suggest installing somewhere
    # (like /opt) and symlinking in binaries as needed. Specifically,
    # we want to avoid putting PyPy's Python.h somewhere that configure
    # scripts will find it.
    bin.install_symlink libexec/"bin/pypy3"
    bin.install_symlink libexec/"bin/pypy" => "pypy3.7"
    lib.install_symlink libexec/"lib/#{shared_library("libpypy3-c")}"

    # Delete two files shipped which we do not want to deliver
    # These files make patchelf fail
    if OS.linux?
      rm_f libexec/"bin/libpypy3-c.so.debug"
      rm_f libexec/"bin/pypy3.debug"
    end
  end

  def post_install
    # Precompile cffi extensions in lib_pypy
    # list from create_cffi_import_libraries in pypy/tool/release/package.py
    %w[_sqlite3 _curses syslog gdbm _tkinter].each do |module_name|
      quiet_system bin/"pypy3", "-c", "import #{module_name}"
    end

    # Post-install, fix up the site-packages and install-scripts folders
    # so that user-installed Python software survives minor updates, such
    # as going from 1.7.0 to 1.7.1.

    # Create a site-packages in the prefix.
    prefix_site_packages.mkpath

    # Symlink the prefix site-packages into the cellar.
    libexec.install_symlink prefix_site_packages

    # Tell distutils-based installers where to put scripts
    scripts_folder.mkpath
    (distutils/"distutils.cfg").atomic_write <<~EOS
      [install]
      install-scripts=#{scripts_folder}
    EOS

    %w[setuptools pip].each do |pkg|
      resource(pkg).stage do
        system bin/"pypy3", "-s", "setup.py", "--no-user-cfg", "install", "--force", "--verbose"
      end
    end

    # Symlinks to easy_install_pypy3 and pip_pypy3
    bin.install_symlink scripts_folder/"easy_install" => "easy_install_pypy3"
    bin.install_symlink scripts_folder/"pip" => "pip_pypy3"

    # post_install happens after linking
    %w[easy_install_pypy3 pip_pypy3].each { |e| (HOMEBREW_PREFIX/"bin").install_symlink bin/e }
  end

  def caveats
    <<~EOS
      A "distutils.cfg" has been written to:
        #{distutils}
      specifying the install-scripts folder as:
        #{scripts_folder}

      If you install Python packages via "pypy3 setup.py install", easy_install_pypy3,
      or pip_pypy3, any provided scripts will go into the install-scripts folder
      above, so you may want to add it to your PATH *after* #{HOMEBREW_PREFIX}/bin
      so you don't overwrite tools from CPython.

      Setuptools and pip have been installed, so you can use easy_install_pypy3 and
      pip_pypy3.
      To update pip and setuptools between pypy3 releases, run:
          pip_pypy3 install --upgrade pip setuptools

      See: https://docs.brew.sh/Homebrew-and-Python
    EOS
  end

  # The HOMEBREW_PREFIX location of site-packages
  def prefix_site_packages
    HOMEBREW_PREFIX/"lib/pypy3/site-packages"
  end

  # Where setuptools will install executable scripts
  def scripts_folder
    HOMEBREW_PREFIX/"share/pypy3"
  end

  # The Cellar location of distutils
  def distutils
    libexec/"lib-python/3/distutils"
  end

  test do
    system bin/"pypy3", "-c", "print('Hello, world!')"
    system bin/"pypy3", "-c", "import time; time.clock()"
    system scripts_folder/"pip", "list"
  end
end

__END__
--- a/lib_pypy/_tkinter/tklib_build.py
+++ b/lib_pypy/_tkinter/tklib_build.py
@@ -17,12 +17,12 @@ elif sys.platform == 'win32':
     incdirs = []
     linklibs = ['tcl86t', 'tk86t']
     libdirs = []
-elif sys.platform == 'darwin':
+else:
     # homebrew
     incdirs = ['/usr/local/opt/tcl-tk/include']
     linklibs = ['tcl8.6', 'tk8.6']
     libdirs = ['/usr/local/opt/tcl-tk/lib']
-else:
+if False: # disable Linux system tcl-tk detection
     # On some Linux distributions, the tcl and tk libraries are
     # stored in /usr/include, so we must check this case also
     libdirs = []
--- a/pypy/goal/targetpypystandalone.py
+++ b/pypy/goal/targetpypystandalone.py
@@ -382,7 +382,7 @@ class PyPyTarget(object):
             ''' Use cffi to compile cffi interfaces to modules'''
             filename = join(pypydir, '..', 'lib_pypy', 'pypy_tools',
                                    'build_cffi_imports.py')
-            if sys.platform in ('darwin', 'linux', 'linux2'):
+            if False: # disable building static openssl
                 argv = [filename, '--embed-dependencies']
             else:
                 argv = [filename,]
--- a/pypy/tool/release/package.py
+++ b/pypy/tool/release/package.py
@@ -358,7 +358,7 @@ def package(*args, **kwds):
                         default=(ARCH in ('darwin', 'aarch64', 'x86_64')),
                         help='whether to embed dependencies in CFFI modules '
                         '(default on OS X)')
-    parser.add_argument('--make-portable',
+    parser.add_argument('--make-portable', '--no-make-portable',
                         dest='make_portable',
                         action=NegateAction,
                         default=(ARCH in ('darwin',)),

redpajama_set_name: RedPajamaGithub


text:
package org.jetbrains.plugins.scala
package lang
package psi
package impl
package expr

import com.intellij.lang.ASTNode
import org.jetbrains.plugins.scala.lang.psi.api.expr._

/**
* @author Alexander Podkhalyuzin
* Date: 06.03.2008
*/

class ScErrorStatImpl(node: ASTNode) extends ScalaPsiElementImpl(node) with ScErrorStat {
  override def toString: String = "ErrorStatement"
}


text:
using System;
using System.Xml.Serialization;

namespace HoloXPLOR.Data.DataForge
{
    [XmlRoot(ElementName = "UIGraph_SimpleComponent")]
    public partial class UIGraph_SimpleComponent : CtxGraph_Component
    {
        [XmlAttribute(AttributeName = "type")]
        public UIGraph_SimpleComponentType Type { get; set; }

    }
}


text:
import _extends from "@babel/runtime/helpers/extends";
import React from 'react';
import PropTypes from 'prop-types';
import { ArrowIcon } from '../../graphics/icons/arrow-icon';
import { CheckedIcon } from '../../graphics/icons/checked-icon';
import { IconBadge } from '../../information/icon-badge';
export const StepperIconDefault = props => /*#__PURE__*/React.createElement(StepperIcon, _extends({}, props, {
  state: "default"
}));
export const StepperIconInProgress = props => /*#__PURE__*/React.createElement(StepperIcon, _extends({}, props, {
  state: "inProgress"
}));
export const StepperIconValidated = props => /*#__PURE__*/React.createElement(StepperIcon, _extends({}, props, {
  state: "validated"
}));
export const StepperIcon = _ref => {
  let {
    state,
    ...props
  } = _ref;

  if (state === 'inProgress' || state === 'progress') {
    return /*#__PURE__*/React.createElement(IconBadge, _extends({
      size: "small",
      status: "info"
    }, props), /*#__PURE__*/React.createElement(ArrowIcon, null));
  }

  if (state === 'validated' || state === 'valid') {
    return /*#__PURE__*/React.createElement(IconBadge, _extends({
      size: "small",
      status: "success"
    }, props), /*#__PURE__*/React.createElement(CheckedIcon, null));
  }

  return /*#__PURE__*/React.createElement(IconBadge, _extends({
    size: "small",
    empty: true
  }, props));
};
StepperIcon.defaultProps = {
  state: 'default'
};
StepperIcon.propTypes = {
  state: PropTypes.oneOf(['default', 'progress', 'inProgress', 'validated', 'valid'])
};


text:
package com.sibvisions.vertx.handler;

import io.vertx.core.Handler;

/**
 * The ExceptionHandler is a {@link Handler} that delegates a
 * handler-exception to {@link AbstractDataHandler}.
 *
 * @author René Jahn
 */
public class ExceptionHandler implements Handler<Throwable>
{
    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    // Class members
    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    /** the data handler. */
    private AbstractDataHandler dataHandler;

    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    // Initialization
    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    /**
     * Creates a new instance of ExceptionHandler.
     *
     * @param pHandler the data handler
     */
    public ExceptionHandler(AbstractDataHandler pHandler)
    {
        dataHandler = pHandler;
    }

    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    // Interface implementation
    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    /**
     * {@inheritDoc}
     */
    public void handle(Throwable pThrowable)
    {
        dataHandler.close();
    }

}   // ExceptionHandler


text:
package net.daw.proyectodaw.service.implementation;

import com.google.gson.Gson;
import java.sql.Connection;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import net.daw.proyectodaw.bean.implementation.OfertaBean;
import net.daw.proyectodaw.bean.implementation.UsuarioBean;
import net.daw.proyectodaw.bean.implementation.ReplyBean;
import net.daw.proyectodaw.connection.publicinterface.ConnectionInterface;
import net.daw.proyectodaw.dao.implementation.OfertaDao;
import net.daw.proyectodaw.helper.statics.AppConfigurationHelper;
import static net.daw.proyectodaw.helper.statics.AppConfigurationHelper.getSourceConnection;
import net.daw.proyectodaw.helper.statics.FilterBeanHelper;
import net.daw.proyectodaw.helper.statics.JsonMessage;
import net.daw.proyectodaw.helper.statics.Log4j;
import net.daw.proyectodaw.helper.statics.ParameterCook;
import net.daw.proyectodaw.service.publicinterface.TableServiceInterface;
import net.daw.proyectodaw.service.publicinterface.ViewServiceInterface;

/**
 *
 * @author a044888329b
 */
public class OfertaService implements TableServiceInterface, ViewServiceInterface{

    protected HttpServletRequest oRequest = null;

    public OfertaService(HttpServletRequest request) {
        oRequest = request;
    }

    private Boolean checkpermission(String strMethodName) throws Exception {
        UsuarioBean oPuserBean = (UsuarioBean) oRequest.getSession().getAttribute("userBean");
        if (oPuserBean != null) {
            return true;
        } else {
            return false;
        }
    }

    @Override
    public ReplyBean getcount() throws Exception {
        if (this.checkpermission("getcount")) {
            String data = null;
            ArrayList<FilterBeanHelper> alFilter = ParameterCook.getFilterParams(ParameterCook.prepareFilter(oRequest));
            Connection oConnection = null;
            ConnectionInterface oDataConnectionSource = null;
            try {

                oDataConnectionSource = getSourceConnection();
                oConnection = oDataConnectionSource.newConnection();
                OfertaDao oOfertaDao = new OfertaDao(oConnection, (UsuarioBean) oRequest.getSession().getAttribute("userBean"), null);
                data = JsonMessage.getJsonExpression(200, Long.toString(oOfertaDao.getCount(alFilter)));
            } catch (Exception ex) {
                Log4j.errorLog(this.getClass().getName() + ":" + (ex.getStackTrace()[0]).getMethodName(), ex);
                throw new Exception();
            } finally {
                if (oConnection != null) {
                    oConnection.close();
                }
                if (oDataConnectionSource != null) {
                    oDataConnectionSource.disposeConnection();
                }
            }
            return new ReplyBean(200, data);
        } else {
            return new ReplyBean(401, JsonMessage.getJsonMsg(401, "Unauthorized"));
        }
    }

    @Override
    public ReplyBean get() throws Exception {
        if (this.checkpermission("get")) {
            int id = ParameterCook.prepareId(oRequest);
            String data = null;
            Connection oConnection = null;
            ConnectionInterface oDataConnectionSource = null;
            try {
                oDataConnectionSource = getSourceConnection();
                oConnection = oDataConnectionSource.newConnection();
                OfertaDao oOfertaDao = new OfertaDao(oConnection, (UsuarioBean) oRequest.getSession().getAttribute("userBean"), null);
                OfertaBean oOfertaBean = new OfertaBean(id);
                oOfertaBean = oOfertaDao.get(oOfertaBean, AppConfigurationHelper.getJsonMsgDepth());
                Gson gson = AppConfigurationHelper.getGson();
                data = JsonMessage.getJsonExpression(200, AppConfigurationHelper.getGson().toJson(oOfertaBean));
            } catch (Exception ex) {
                Log4j.errorLog(this.getClass().getName() + ":" + (ex.getStackTrace()[0]).getMethodName(), ex);
                throw new Exception();
            } finally {
                if (oConnection != null) {
                    oConnection.close();
                }
                if (oDataConnectionSource != null) {
                    oDataConnectionSource.disposeConnection();
                }
            }
            return new ReplyBean(200, data);
        } else {
            return new ReplyBean(401, JsonMessage.getJsonMsg(401, "Unauthorized"));
        }
    }

    @Override
    public ReplyBean getall() throws Exception {
        if (this.checkpermission("getall")) {
            HashMap<String, String> hmOrder = ParameterCook.getOrderParams(ParameterCook.prepareOrder(oRequest));
            ArrayList<FilterBeanHelper> alFilter = ParameterCook.getFilterParams(ParameterCook.prepareFilter(oRequest));
            String data = null;
            Connection oConnection = null;
            ConnectionInterface oDataConnectionSource = null;
            try {
                oDataConnectionSource = getSourceConnection();
                oConnection = oDataConnectionSource.newConnection();
                OfertaDao oOfertaDao = new OfertaDao(oConnection, (UsuarioBean) oRequest.getSession().getAttribute("userBean"), null);
                ArrayList<OfertaBean> arrBeans = oOfertaDao.getAll(alFilter, hmOrder, AppConfigurationHelper.getJsonMsgDepth());
                data = JsonMessage.getJsonExpression(200, AppConfigurationHelper.getGson().toJson(arrBeans));
            } catch (Exception ex) {
                Log4j.errorLog(this.getClass().getName() + ":" + (ex.getStackTrace()[0]).getMethodName(), ex);
                throw new Exception();
            } finally {
                if (oConnection != null) {
                    oConnection.close();
                }
                if (oDataConnectionSource != null) {
                    oDataConnectionSource.disposeConnection();
                }
            }
            return new ReplyBean(200, data);
        } else {
            return new ReplyBean(401, JsonMessage.getJsonMsg(401, "Unauthorized"));
        }
    }

    @Override
    public ReplyBean getpage() throws Exception {
        if (this.checkpermission("getpage")) {
            int intRegsPerPag = ParameterCook.prepareRpp(oRequest);
            int intPage = ParameterCook.preparePage(oRequest);
            HashMap<String, String> hmOrder = ParameterCook.getOrderParams(ParameterCook.prepareOrder(oRequest));
            ArrayList<FilterBeanHelper> alFilter = ParameterCook.getFilterParams(ParameterCook.prepareFilter(oRequest));
            String data = null;
            Connection oConnection = null;
            ConnectionInterface oDataConnectionSource = null;
            try {
                oDataConnectionSource = getSourceConnection();
                oConnection = oDataConnectionSource.newConnection();
                OfertaDao oOfertaDao = new OfertaDao(oConnection, (UsuarioBean) oRequest.getSession().getAttribute("userBean"), null);
                List<OfertaBean> arrBeans = oOfertaDao.getPage(intRegsPerPag, intPage, alFilter, hmOrder, AppConfigurationHelper.getJsonMsgDepth());
                data = JsonMessage.getJsonExpression(200, AppConfigurationHelper.getGson().toJson(arrBeans));
            } catch (Exception ex) {
                Log4j.errorLog(this.getClass().getName() + ":" + (ex.getStackTrace()[0]).getMethodName(), ex);
                throw new Exception();
            } finally {
                if (oConnection != null) {
                    oConnection.close();
                }
                if (oDataConnectionSource != null) {
                    oDataConnectionSource.disposeConnection();
                }
            }
            return new ReplyBean(200, data);
        } else {
            return new ReplyBean(401, JsonMessage.getJsonMsg(401, "Unauthorized"));
        }
    }

    @Override
    public ReplyBean remove() throws Exception {
        if (this.checkpermission("remove")) {
            Integer id = ParameterCook.prepareId(oRequest);
            String data = null;
            Connection oConnection = null;
            ConnectionInterface oDataConnectionSource = null;
            try {
                oDataConnectionSource = getSourceConnection();
                oConnection = oDataConnectionSource.newConnection();
                oConnection.setAutoCommit(false);
                OfertaDao oOfertaDao = new OfertaDao(oConnection, (UsuarioBean) oRequest.getSession().getAttribute("userBean"), null);
                data = JsonMessage.getJsonExpression(200, (String) oOfertaDao.remove(id).toString());
                oConnection.commit();
            } catch (Exception ex) {
                if (oConnection != null) {
                    oConnection.rollback();
                }
                Log4j.errorLog(this.getClass().getName() + ":" + (ex.getStackTrace()[0]).getMethodName(), ex);
                throw new Exception();
            } finally {
                if (oConnection != null) {
                    oConnection.close();
                }
                if (oDataConnectionSource != null) {
                    oDataConnectionSource.disposeConnection();
                }
            }
            return new ReplyBean(200, data);
        } else {
            return new ReplyBean(401, JsonMessage.getJsonMsg(401, "Unauthorized"));
        }
    }

    @Override
    public ReplyBean set() throws Exception {
        if (this.checkpermission("set")) {
            String jason = ParameterCook.prepareJson(oRequest);
            ReplyBean oReplyBean = new ReplyBean();
            Connection oConnection = null;
            ConnectionInterface oDataConnectionSource = null;
            try {
                oDataConnectionSource = getSourceConnection();
                oConnection = oDataConnectionSource.newConnection();
                oConnection.setAutoCommit(false);
                OfertaDao oOfertaDao = new OfertaDao(oConnection, (UsuarioBean) oRequest.getSession().getAttribute("userBean"), null);
                OfertaBean oOfertaBean = new OfertaBean();
                oOfertaBean = AppConfigurationHelper.getGson().fromJson(jason, oOfertaBean.getClass());
                if (oOfertaBean != null) {
                    Integer iResult = oOfertaDao.set(oOfertaBean);
                    if (iResult >= 1) {
                        oReplyBean.setCode(200);
                        oReplyBean.setJson(JsonMessage.getJsonExpression(200, iResult.toString()));
                    } else {
                        oReplyBean.setCode(500);
                        oReplyBean.setJson(JsonMessage.getJsonMsg(500, "Error during registry set"));
                    }
                } else {
                    oReplyBean.setCode(500);
                    oReplyBean.setJson(JsonMessage.getJsonMsg(500, "Error during registry set"));
                }
                oConnection.commit();
            } catch (Exception ex) {
                if (oConnection != null) {
                    oConnection.rollback();
                }
                Log4j.errorLog(this.getClass().getName() + ":" + (ex.getStackTrace()[0]).getMethodName(), ex);
                throw new Exception();
            } finally {
                if (oConnection != null) {
                    oConnection.close();
                }
                if (oDataConnectionSource != null) {
                    oDataConnectionSource.disposeConnection();
                }
            }
            return oReplyBean;
        } else {
            return new ReplyBean(401, JsonMessage.getJsonMsg(401, "Unauthorized"));
        }
    }

}


text:
'''
@author: Joseph
@email:liseor@gmail.com
Created on 2012-7-19
'''
import tornado.web
from view.frontend import BaseHandler
import simplejson as json
from config.settings import globalSetting

from models.user import User
from models.board import Board
from models.category import Category
from models.pin import Pin
from common.function import urldecode
from models.boardFollow import BoardFollow
import time

class FollowingHandler(BaseHandler):
    @tornado.web.authenticated
    def get(self):
        uri = self.request.uri
        request = {}
        board = BoardFollow()

        #in_keys = board.allKey()
        user_key = self.get_secure_cookie("user_key")
        query = {}
        query['q']         = "user:%s" % user_key

        query['start']  = "0"
        query['rows']   = globalSetting['max_index_board_rows']
        query['sort']   = "follow"

        if "page" in uri:
            request = urldecode(uri)
            page = int(request['page'])
            query['start']  = query['rows']*page
            #if pin_count < query['rows']*page:
            #    return ''

        board_data = board.solr(query)
        #print len(board_data)

        boards_dict = board.formatBoards(board_data)

        if request:
            #print request
            callback_result = {
                            'filter':'board:index',
                            'boards':boards_dict
                            }

            callback_response = "%s(%s)" % (request['callback'],json.dumps(callback_result))
            self.set_header("Content-Type", "text/html; charset=utf-8")
            return self.write(callback_response)
        else:
            boards = ''
            for _board_t in boards_dict:
                boards = self.render_string('board_unit.html',board=_board_t) + boards

            user_key = self.get_secure_cookie("user_key")
            user = User()
            userInfo = user.getDetail(user_key)
            from models.userFollow import UserFollow
            userFollow = UserFollow()
            counts = {}
            pinM = Pin()
            boardM = Board()
            counts['fans'] = len(userFollow.getByKeyValues("follow", user_key))
            counts['pins'] = len(pinM.getByKeyValues("user", user_key))
            counts['boards'] = len(boardM.getByKeyValues("user", user_key))

            self.render('board_follow.html',counts=counts,userInfo = userInfo,user=self.currentUserInfo(),boards=boards)

class FolllowHandler(BaseHandler):
    @tornado.web.authenticated
    def get(self,key):
        res = {}
        user_key = self.get_secure_cookie("user_key")
        b_key = "%s%s" % (user_key,key)

        boardFollow = BoardFollow()

        if boardFollow.get(b_key):
            res['code'] = 1
            res['msg'] = "您已关注过了"
        else:
            board = Board()
            board.key = key
            board.data =  board.get(key)
            board.data['follow'] = int(board.data['follow']) + 1
            board.put()
            boardFollow.key = b_key

            boardFollow.data['user'] = user_key
            boardFollow.data['board'] = key
            boardFollow.data['createTime'] = int(time.time())
            boardFollow.post()
            res['code'] = 0
            res['msg'] = "成功"
            print res
        res_str = json.dumps(res)
        self.write(res_str)

class RemoveFolllowHandler(BaseHandler):
    @tornado.web.authenticated
    def get(self,key):
        res = {}
        res['code'] = 0
        res['msg'] = "成功"
        boardFollow = BoardFollow()
        user_key = self.get_secure_cookie("user_key")
        b_key = "%s%s" % (user_key,key)
        boardFollow.delete(b_key)
        res_str = json.dumps(res)
        self.write(res_str)

class BoardPinHandler(BaseHandler):
    def get(self,key):
        uri = self.request.uri
        request = {}
        pin = Pin()

        pin_keys = pin.getByKeyValues("board",key)
        pin_count = len(pin_keys)

        query = {}
        query['q']         = "board:%s" % key

        query['start']  = "0"
        query['rows']   = globalSetting['max_index_pin_rows']
        query['sort']   = "createTime"

        if "page" in uri:
            request = urldecode(uri)
            page = int(request['page'])
            query['start']  = query['rows']*page
            if pin_count < query['rows']*page:
                return ''

        pin_data = pin.solr(query)
        print len(pin_data)

        marks_dict = pin.formatPins(pin_data)

        if request:
            #print request['callback']
            #print request['page']
            callback_result = {
                            'filter':'pin:index',
                            'pins':marks_dict
                            }

            callback_response = "%s(%s)" % (request['callback'],json.dumps(callback_result))
            self.set_header("Content-Type", "text/html; charset=utf-8")
            return self.write(callback_response)
        else:
            marks = ''
            for _mark_t in marks_dict:
                marks = self.render_string('mark.html',mark=_mark_t)+marks
            board = Board()
            user = User()
            category = Category()

            board_data = board.get(key)

            b_user = user.getDetail(board_data['user'])
            b_category = category.get(board_data['category'])
            b_keys = board.getByKeyValues("user", board_data['user'])

            if key in b_keys:
                b_keys.remove(key)

            b_boards = board.all(b_keys)

            self.render('board_pins_list.html',f_board = self.formatFollowBoardData(key), b_boards= b_boards,b_category = b_category,b_user=b_user,user=self.currentUserInfo(),board = board.get(key),marks=marks)
    def formatFollowBoardData(self,key):
        user_key = self.get_secure_cookie("user_key")
        f_board = {}
        if user_key:
            f_key = "%s%s" % (user_key,key)
            boardFollow = BoardFollow()
            if boardFollow.get(f_key):
                f_board['rel'] = 1
                f_board['str'] = "取消关注"
            else:
                f_board['rel'] = 0
                f_board['str'] = "关注"

        else:
            f_board['rel'] = 0
            f_board['str'] = "关注"

        return f_board

class PopularHandler(BaseHandler):
    def get(self):
        uri = self.request.uri
        request = {}
        board = Board()

        pin_keys = board.allKey()

        query = {}
        query['q']         = "public:1"

        query['start']  = "0"
        query['rows']   = globalSetting['max_index_board_rows']
        query['sort']   = "follow"

        if "page" in uri:
            request = urldecode(uri)
            page = int(request['page'])
            query['start']  = query['rows']*page
            #if pin_count < query['rows']*page:
            #    return ''

        board_data = board.solr(query)
        print len(board_data)

        boards_dict = board.formatBoards(board_data)

        if request:
            #print request
            callback_result = {
                            'filter':'board:index',
                            'boards':boards_dict
                            }

            callback_response = "%s(%s)" % (request['callback'],json.dumps(callback_result))
            self.set_header("Content-Type", "text/html; charset=utf-8")
            return self.write(callback_response)
        else:
            boards = ''
            for _board_t in boards_dict:
                boards = self.render_string('board_unit.html',board=_board_t) + boards

            self.render('board_pop.html',user=self.currentUserInfo(),boards=boards)

class AjaxBoardHandler(BaseHandler):
    @tornado.web.authenticated
    def get(self):
        category = Category()
        keys = category.allKey()
        _data =  category.all(keys)
        #print _data
        self.render('ajax/board.html',cats = _data)

class AjaxAddboardHandler(BaseHandler):
    @tornado.web.authenticated
    def post(self):
        import hashlib

        title = self.get_argument("title",None)
        category_key = self.get_argument("category", None)
        user_key = self.get_secure_cookie("user_key")

        board          = Board()

        res = {}
        try:
            import time
            _tmp = "%s%s" % (user_key,title)
            key = board.genKey(_tmp)
            board.key = key
            board.data['title'] = title
            board.data['user'] = user_key
            board.data['category'] = category_key
            board.data['createTime'] = time.time()
            board.data['pins']    = []

            board.post()
        except Exception as what:
            print what
            res['code'] = 1
            res['data'] = what
        else:
            res['code'] = 0
            res['data'] = "sucess"
            obj  = {}
            obj['key'] = board.key
            res['obj'] = obj

        body = json.dumps(res)
        print body
        self.set_header("Content-Type", "text/json; charset=UTF-8")
        self.write(body)

class AdminBoardHandler(BaseHandler):
    def get(self):
        board = Board()
        keys = board.allKey()
        _data = board.all(keys)
        print _data
        #self.dumpJson(keys)
        self.render('manager/board.html',data=_data)

class AdminBoardNewHandler(BaseHandler):
    def get(self,key):
        user = User()

        categroy = Category()
        user_keys = user.allKey()
        category_keys = categroy.allKey()

        _data_user =  user.all(user_keys)
        _data_category = categroy.all(category_keys)
        data = {}
        if key:
            board = Board()
            board.data = board.get(key)
            data['title']       = board.data['title']
            data['key']         = board.data['key']
            data['user']        = board.data['user']
            data['category']    = board.data['category']
            data['createTime']    = board.data['createTime']
            data['follow']    = board.data['follow']
        else:
            data['title']       = ''
            data['key']         = ''
            data['user']        = ''
            data['category']    = ''

        self.render('manager/board_new.html',data = data,data_user = _data_user,data_category = _data_category)

    def post(self,id):
        import hashlib
        key          = self.get_argument("key",None)
        title        = self.get_argument("title",None)

        user_key     = self.get_argument("user",None)
        category_key = self.get_argument("category",None)

        _tmp = "%s%s" % (user_key,title)

        board                  = Board()
        user                  = User()
        user_data = user.get(user_key)
        nickname  = user_data['nickname']
        import time
        if key:
            board.key              = key
            board.data             = board.get(key)
            board.data['user']     = user_key
            board.data['category'] = category_key
            board.data['title']    = title
            board.data['createTime']    = time.time()
            board.data['key']      = key
            print board.data
            board.put()
        else:
            data = board.get(board.key)
            if data:
                print "exist"
            else:
                board.key              = board.genKey(_tmp)
                board.data['user']     = user_key
                board.data['category'] = category_key
                board.data['title']    = title
                board.data['createTime']    = time.time()
                board.data['key']      = board.key
                board.data['pins']    = []
                board.post()

        self.redirect('/manager/board/')

class AdminDeleteBoardHandler(BaseHandler):
    def get(self,key):
        board = Board()
        board.delete(key)


text:
namespace Microsoft.Azure.Management.Media.Models
{
    using Newtonsoft.Json;
    using System.Collections;
    using System.Collections.Generic;
    using System.Linq;

    /// <summary>
    /// Describes all the properties for encoding a video with the H.264 codec.
    /// </summary>
    [Newtonsoft.Json.JsonObject("#Microsoft.Media.H264Video")]
    public partial class H264Video : Video
    {
        /// <summary>
        /// Initializes a new instance of the H264Video class.
        /// </summary>
        public H264Video()
        {
            CustomInit();
        }

        /// <summary>
        /// Initializes a new instance of the H264Video class.
        /// </summary>
        /// <param name="label">An optional label for the codec. The label can
        /// be used to control muxing behavior.</param>
        /// <param name="keyFrameInterval">The distance between two key frames,
        /// thereby defining a group of pictures (GOP). The value should be a
        /// non-zero integer in the range [1, 30] seconds, specified in ISO
        /// 8601 format. The default is 2 seconds (PT2S).</param>
        /// <param name="stretchMode">The resizing mode - how the input video
        /// will be resized to fit the desired output resolution(s). Default is
        /// AutoSize. Possible values include: 'None', 'AutoSize',
        /// 'AutoFit'</param>
        /// <param name="sceneChangeDetection">Whether or not the encoder
        /// should insert key frames at scene changes. If not specified, the
        /// default is false. This flag should be set to true only when the
        /// encoder is being configured to produce a single output
        /// video.</param>
        /// <param name="complexity">Tells the encoder how to choose its
        /// encoding settings. The default value is Balanced. Possible values
        /// include: 'Speed', 'Balanced', 'Quality'</param>
        /// <param name="layers">The collection of output H.264 layers to be
        /// produced by the encoder.</param>
        public H264Video(string label = default(string), System.TimeSpan? keyFrameInterval = default(System.TimeSpan?), StretchMode? stretchMode = default(StretchMode?), bool? sceneChangeDetection = default(bool?), H264Complexity? complexity = default(H264Complexity?), IList<H264Layer> layers = default(IList<H264Layer>))
            : base(label, keyFrameInterval, stretchMode)
        {
            SceneChangeDetection = sceneChangeDetection;
            Complexity = complexity;
            Layers = layers;
            CustomInit();
        }

        /// <summary>
        /// An initialization method that performs custom operations like setting defaults
        /// </summary>
        partial void CustomInit();

        /// <summary>
        /// Gets or sets whether or not the encoder should insert key frames at
        /// scene changes. If not specified, the default is false. This flag
        /// should be set to true only when the encoder is being configured to
        /// produce a single output video.
        /// </summary>
        [JsonProperty(PropertyName = "sceneChangeDetection")]
        public bool? SceneChangeDetection { get; set; }

        /// <summary>
        /// Gets or sets tells the encoder how to choose its encoding settings.
        /// The default value is Balanced. Possible values include: 'Speed',
        /// 'Balanced', 'Quality'
        /// </summary>
        [JsonProperty(PropertyName = "complexity")]
        public H264Complexity? Complexity { get; set; }

        /// <summary>
        /// Gets or sets the collection of output H.264 layers to be produced
        /// by the encoder.
        /// </summary>
        [JsonProperty(PropertyName = "layers")]
        public IList<H264Layer> Layers { get; set; }

    }
}


text:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Demo4_ISP
{
    public partial class frmCars : Form
    {
        public frmCars()
        {
            InitializeComponent();
        }
        ISportCar theCar;
        private void cboPickUpCar_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (cboPickUpCar.Text == "Mercedes")
            {
                theCar = new SportsCarWithN("Mercedes");
             // subscription to SpeedLimit depends on type
               ((SportsCarWithN)theCar).SpeedLimit += TheCar_SpeedLimit;
            }
            else
            {
                theCar = new SportsCar(cboPickUpCar.Text);
            }
            theCar.LegalLimitCondition += TheCar_LegalLimitCondition;
            // refresh car's properties
            txtMaxSpeed.Text = theCar.MaxSpeed.ToString();
            pbPhoto.Image = theCar.Photo;
            updateUI();
        }

        private void TheCar_LegalLimitCondition(object sender, int e)
        {
            updateUI(e);
        }

        private void TheCar_SpeedLimit(object sender, EventArgs e)
        {
            var eventData = e as SpeedLimitData;
            MessageBox.Show("Attempt to obtain " + eventData.resultingSpeed +
                " Miles//hr at: " + eventData.moment.ToLongTimeString(), "Warning",
                MessageBoxButtons.OK, MessageBoxIcon.Warning);
        }

        private void btnAccelerate_Click(object sender, EventArgs e)
        {
            theCar.Accelerate();
            updateUI();
        }
        private void updateUI(int speedExcess = 0)
        {
            txtSpeed.Text = theCar.Speed.ToString();
            if (speedExcess > 0)
            {
                MessageBox.Show("Legal limit exceeded by " + speedExcess + " mi/h");
            }
        }
        private void btnExit_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void frmCars_FormClosing(object sender, FormClosingEventArgs e)
        {
            //e holds info about the reason for closing and a cancel property.
        }
    }
}


text:
import sys
from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload

from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import (
    ClientAuthenticationError,
    HttpResponseError,
    ResourceExistsError,
    ResourceNotFoundError,
    ResourceNotModifiedError,
    map_error,
)
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import AsyncHttpResponse
from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod
from azure.core.rest import HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling

from ... import models as _models
from ..._vendor import _convert_request
from ...operations._outputs_operations import (
    build_create_or_replace_request,
    build_delete_request,
    build_get_request,
    build_list_by_streaming_job_request,
    build_test_request,
    build_update_request,
)

if sys.version_info >= (3, 8):
    from typing import Literal  # pylint: disable=no-name-in-module, ungrouped-imports
else:
    from typing_extensions import Literal  # type: ignore  # pylint: disable=ungrouped-imports
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]

class OutputsOperations:
    """
    .. warning::
        **DO NOT** instantiate this class directly.

        Instead, you should access the following operations through
        :class:`~azure.mgmt.streamanalytics.aio.StreamAnalyticsManagementClient`'s
        :attr:`outputs` attribute.
    """

    models = _models

    def __init__(self, *args, **kwargs) -> None:
        input_args = list(args)
        self._client = input_args.pop(0) if input_args else kwargs.pop("client")
        self._config = input_args.pop(0) if input_args else kwargs.pop("config")
        self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
        self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")

    @overload
    async def create_or_replace(
        self,
        resource_group_name: str,
        job_name: str,
        output_name: str,
        output: _models.Output,
        if_match: Optional[str] = None,
        if_none_match: Optional[str] = None,
        *,
        content_type: str = "application/json",
        **kwargs: Any
    ) -> _models.Output:
        """Creates an output or replaces an already existing output under an existing streaming job.

        :param resource_group_name: The name of the resource group. The name is case insensitive.
         Required.
        :type resource_group_name: str
        :param job_name: The name of the streaming job. Required.
        :type job_name: str
        :param output_name: The name of the output. Required.
        :type output_name: str
        :param output: The definition of the output that will be used to create a new output or replace
         the existing one under the streaming job. Required.
        :type output: ~azure.mgmt.streamanalytics.models.Output
        :param if_match: The ETag of the output. Omit this value to always overwrite the current
         output. Specify the last-seen ETag value to prevent accidentally overwriting concurrent
         changes. Default value is None.
        :type if_match: str
        :param if_none_match: Set to '*' to allow a new output to be created, but to prevent updating
         an existing output. Other values will result in a 412 Pre-condition Failed response. Default
         value is None.
        :type if_none_match: str
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: Output or the result of cls(response)
        :rtype: ~azure.mgmt.streamanalytics.models.Output
        :raises ~azure.core.exceptions.HttpResponseError:
        """

    @overload
    async def create_or_replace(
        self,
        resource_group_name: str,
        job_name: str,
        output_name: str,
        output: IO,
        if_match: Optional[str] = None,
        if_none_match: Optional[str] = None,
        *,
        content_type: str = "application/json",
        **kwargs: Any
    ) -> _models.Output:
        """Creates an output or replaces an already existing output under an existing streaming job.

        :param resource_group_name: The name of the resource group. The name is case insensitive.
         Required.
        :type resource_group_name: str
        :param job_name: The name of the streaming job. Required.
        :type job_name: str
        :param output_name: The name of the output. Required.
        :type output_name: str
        :param output: The definition of the output that will be used to create a new output or replace
         the existing one under the streaming job. Required.
        :type output: IO
        :param if_match: The ETag of the output. Omit this value to always overwrite the current
         output. Specify the last-seen ETag value to prevent accidentally overwriting concurrent
         changes. Default value is None.
        :type if_match: str
        :param if_none_match: Set to '*' to allow a new output to be created, but to prevent updating
         an existing output. Other values will result in a 412 Pre-condition Failed response. Default
         value is None.
        :type if_none_match: str
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Default value is "application/json".
        :paramtype content_type: str
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: Output or the result of cls(response)
        :rtype: ~azure.mgmt.streamanalytics.models.Output
        :raises ~azure.core.exceptions.HttpResponseError:
        """

    @distributed_trace_async
    async def create_or_replace(
        self,
        resource_group_name: str,
        job_name: str,
        output_name: str,
        output: Union[_models.Output, IO],
        if_match: Optional[str] = None,
        if_none_match: Optional[str] = None,
        **kwargs: Any
    ) -> _models.Output:
        """Creates an output or replaces an already existing output under an existing streaming job.

        :param resource_group_name: The name of the resource group. The name is case insensitive.
         Required.
        :type resource_group_name: str
        :param job_name: The name of the streaming job. Required.
        :type job_name: str
        :param output_name: The name of the output. Required.
        :type output_name: str
        :param output: The definition of the output that will be used to create a new output or replace
         the existing one under the streaming job. Is either a model type or a IO type. Required.
        :type output: ~azure.mgmt.streamanalytics.models.Output or IO
        :param if_match: The ETag of the output. Omit this value to always overwrite the current
         output. Specify the last-seen ETag value to prevent accidentally overwriting concurrent
         changes. Default value is None.
        :type if_match: str
        :param if_none_match: Set to '*' to allow a new output to be created, but to prevent updating
         an existing output. Other values will result in a 412 Pre-condition Failed response. Default
         value is None.
        :type if_none_match: str
        :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
         Default value is None.
        :paramtype content_type: str
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: Output or the result of cls(response)
        :rtype: ~azure.mgmt.streamanalytics.models.Output
        :raises ~azure.core.exceptions.HttpResponseError:
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
        _params = case_insensitive_dict(kwargs.pop("params", {}) or {})

        api_version = kwargs.pop(
            "api_version", _params.pop("api-version", "2021-10-01-preview")
        )  # type: Literal["2021-10-01-preview"]
        content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None))  # type: Optional[str]
        cls = kwargs.pop("cls", None)  # type: ClsType[_models.Output]

        content_type = content_type or "application/json"
        _json = None
        _content = None
        if isinstance(output, (IO, bytes)):
            _content = output
        else:
            _json = self._serialize.body(output, "Output")

        request = build_create_or_replace_request(
            resource_group_name=resource_group_name,
            job_name=job_name,
            output_name=output_name,
            subscription_id=self._config.subscription_id,
            if_match=if_match,
            if_none_match=if_none_match,
            api_version=api_version,
            content_type=content_type,
            json=_json,
            content=_content,
            template_url=self.create_or_replace.metadata["url"],
            headers=_headers,
            params=_params,
        )
        request = _convert_request(request)
        request.url = self._client.format_url(request.url)  # type: ignore

        pipeline_response = await self._client._pipeline.run(  # type: ignore # pylint: disable=protected-access
            request, stream=False, **kwargs
        )

        response = pipeline_response.http_response

        if response.status_code not in [200, 201]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response)
            raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

        response_headers = {}
        if response.status_code == 200:
            response_headers["ETag"] = self._deserialize("str", response.headers.get("ETag"))

            deserialized = self._deserialize("Output", pipeline_response)

        if response.status_code == 201:
            response_headers["ETag"] = self._deserialize("str", response.headers.get("ETag"))

            deserialized = self._deserialize("Output", pipeline_response)

        if cls:
            return cls(pipeline_response, deserialized, response_headers)

        return deserialized

    create_or_replace.metadata = {"url": "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StreamAnalytics/streamingjobs/{jobName}/outputs/{outputName}"}  # type: ignore

    @overload
    async def update(
        self,
        resource_group_name: str,
        job_name: str,
        output_name: str,
        output: _models.Output,
        if_match: Optional[str] = None,
        *,
        content_type: str = "application/json",
        **kwargs: Any
    ) -> _models.Output:
        """Updates an existing output under an existing streaming job. This can be used to partially
        update (ie. update one or two properties) an output without affecting the rest the job or
        output definition.

        :param resource_group_name: The name of the resource group. The name is case insensitive.
         Required.
        :type resource_group_name: str
        :param job_name: The name of the streaming job. Required.
        :type job_name: str
        :param output_name: The name of the output. Required.
        :type output_name: str
        :param output: An Output object. The properties specified here will overwrite the corresponding
         properties in the existing output (ie. Those properties will be updated). Any properties that
         are set to null here will mean that the corresponding property in the existing output will
         remain the same and not change as a result of this PATCH operation. Required.
        :type output: ~azure.mgmt.streamanalytics.models.Output
        :param if_match: The ETag of the output. Omit this value to always overwrite the current
         output. Specify the last-seen ETag value to prevent accidentally overwriting concurrent
         changes. Default value is None.
        :type if_match: str
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: Output or the result of cls(response)
        :rtype: ~azure.mgmt.streamanalytics.models.Output
        :raises ~azure.core.exceptions.HttpResponseError:
        """

    @overload
    async def update(
        self,
        resource_group_name: str,
        job_name: str,
        output_name: str,
        output: IO,
        if_match: Optional[str] = None,
        *,
        content_type: str = "application/json",
        **kwargs: Any
    ) -> _models.Output:
        """Updates an existing output under an existing streaming job. This can be used to partially
        update (ie. update one or two properties) an output without affecting the rest the job or
        output definition.

        :param resource_group_name: The name of the resource group. The name is case insensitive.
         Required.
        :type resource_group_name: str
        :param job_name: The name of the streaming job. Required.
        :type job_name: str
        :param output_name: The name of the output. Required.
        :type output_name: str
        :param output: An Output object. The properties specified here will overwrite the corresponding
         properties in the existing output (ie. Those properties will be updated). Any properties that
         are set to null here will mean that the corresponding property in the existing output will
         remain the same and not change as a result of this PATCH operation. Required.
        :type output: IO
        :param if_match: The ETag of the output. Omit this value to always overwrite the current
         output. Specify the last-seen ETag value to prevent accidentally overwriting concurrent
         changes. Default value is None.
        :type if_match: str
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Default value is "application/json".
        :paramtype content_type: str
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: Output or the result of cls(response)
        :rtype: ~azure.mgmt.streamanalytics.models.Output
        :raises ~azure.core.exceptions.HttpResponseError:
        """

    @distributed_trace_async
    async def update(
        self,
        resource_group_name: str,
        job_name: str,
        output_name: str,
        output: Union[_models.Output, IO],
        if_match: Optional[str] = None,
        **kwargs: Any
    ) -> _models.Output:
        """Updates an existing output under an existing streaming job. This can be used to partially
        update (ie. update one or two properties) an output without affecting the rest the job or
        output definition.

        :param resource_group_name: The name of the resource group. The name is case insensitive.
         Required.
        :type resource_group_name: str
        :param job_name: The name of the streaming job. Required.
        :type job_name: str
        :param output_name: The name of the output. Required.
        :type output_name: str
        :param output: An Output object. The properties specified here will overwrite the corresponding
         properties in the existing output (ie. Those properties will be updated). Any properties that
         are set to null here will mean that the corresponding property in the existing output will
         remain the same and not change as a result of this PATCH operation. Is either a model type or a
         IO type. Required.
        :type output: ~azure.mgmt.streamanalytics.models.Output or IO
        :param if_match: The ETag of the output. Omit this value to always overwrite the current
         output. Specify the last-seen ETag value to prevent accidentally overwriting concurrent
         changes. Default value is None.
        :type if_match: str
        :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
         Default value is None.
        :paramtype content_type: str
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: Output or the result of cls(response)
        :rtype: ~azure.mgmt.streamanalytics.models.Output
        :raises ~azure.core.exceptions.HttpResponseError:
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
        _params = case_insensitive_dict(kwargs.pop("params", {}) or {})

        api_version = kwargs.pop(
            "api_version", _params.pop("api-version", "2021-10-01-preview")
        )  # type: Literal["2021-10-01-preview"]
        content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None))  # type: Optional[str]
        cls = kwargs.pop("cls", None)  # type: ClsType[_models.Output]

        content_type = content_type or "application/json"
        _json = None
        _content = None
        if isinstance(output, (IO, bytes)):
            _content = output
        else:
            _json = self._serialize.body(output, "Output")

        request = build_update_request(
            resource_group_name=resource_group_name,
            job_name=job_name,
            output_name=output_name,
            subscription_id=self._config.subscription_id,
            if_match=if_match,
            api_version=api_version,
            content_type=content_type,
            json=_json,
            content=_content,
            template_url=self.update.metadata["url"],
            headers=_headers,
            params=_params,
        )
        request = _convert_request(request)
        request.url = self._client.format_url(request.url)  # type: ignore

        pipeline_response = await self._client._pipeline.run(  # type: ignore # pylint: disable=protected-access
            request, stream=False, **kwargs
        )

        response = pipeline_response.http_response

        if response.status_code not in [200]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response)
            raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

        response_headers = {}
        response_headers["ETag"] = self._deserialize("str", response.headers.get("ETag"))

        deserialized = self._deserialize("Output", pipeline_response)

        if cls:
            return cls(pipeline_response, deserialized, response_headers)

        return deserialized

    update.metadata = {"url": "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StreamAnalytics/streamingjobs/{jobName}/outputs/{outputName}"}  # type: ignore

    @distributed_trace_async
    async def delete(  # pylint: disable=inconsistent-return-statements
        self, resource_group_name: str, job_name: str, output_name: str, **kwargs: Any
    ) -> None:
        """Deletes an output from the streaming job.

        :param resource_group_name: The name of the resource group. The name is case insensitive.
         Required.
        :type resource_group_name: str
        :param job_name: The name of the streaming job. Required.
        :type job_name: str
        :param output_name: The name of the output. Required.
        :type output_name: str
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: None or the result of cls(response)
        :rtype: None
        :raises ~azure.core.exceptions.HttpResponseError:
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = kwargs.pop("headers", {}) or {}
        _params = case_insensitive_dict(kwargs.pop("params", {}) or {})

        api_version = kwargs.pop(
            "api_version", _params.pop("api-version", "2021-10-01-preview")
        )  # type: Literal["2021-10-01-preview"]
        cls = kwargs.pop("cls", None)  # type: ClsType[None]

        request = build_delete_request(
            resource_group_name=resource_group_name,
            job_name=job_name,
            output_name=output_name,
            subscription_id=self._config.subscription_id,
            api_version=api_version,
            template_url=self.delete.metadata["url"],
            headers=_headers,
            params=_params,
        )
        request = _convert_request(request)
        request.url = self._client.format_url(request.url)  # type: ignore

        pipeline_response = await self._client._pipeline.run(  # type: ignore # pylint: disable=protected-access
            request, stream=False, **kwargs
        )

        response = pipeline_response.http_response

        if response.status_code not in [200, 204]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response)
            raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

        if cls:
            return cls(pipeline_response, None, {})

    delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StreamAnalytics/streamingjobs/{jobName}/outputs/{outputName}"}  # type: ignore

    @distributed_trace_async
    async def get(self, resource_group_name: str, job_name: str, output_name: str, **kwargs: Any) -> _models.Output:
        """Gets details about the specified output.

        :param resource_group_name: The name of the resource group. The name is case insensitive.
         Required.
        :type resource_group_name: str
        :param job_name: The name of the streaming job. Required.
        :type job_name: str
        :param output_name: The name of the output. Required.
        :type output_name: str
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: Output or the result of cls(response)
        :rtype: ~azure.mgmt.streamanalytics.models.Output
        :raises ~azure.core.exceptions.HttpResponseError:
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = kwargs.pop("headers", {}) or {}
        _params = case_insensitive_dict(kwargs.pop("params", {}) or {})

        api_version = kwargs.pop(
            "api_version", _params.pop("api-version", "2021-10-01-preview")
        )  # type: Literal["2021-10-01-preview"]
        cls = kwargs.pop("cls", None)  # type: ClsType[_models.Output]

        request = build_get_request(
            resource_group_name=resource_group_name,
            job_name=job_name,
            output_name=output_name,
            subscription_id=self._config.subscription_id,
            api_version=api_version,
            template_url=self.get.metadata["url"],
            headers=_headers,
            params=_params,
        )
        request = _convert_request(request)
        request.url = self._client.format_url(request.url)  # type: ignore

        pipeline_response = await self._client._pipeline.run(  # type: ignore # pylint: disable=protected-access
            request, stream=False, **kwargs
        )

        response = pipeline_response.http_response

        if response.status_code not in [200]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response)
            raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

        response_headers = {}
        response_headers["ETag"] = self._deserialize("str", response.headers.get("ETag"))

        deserialized = self._deserialize("Output", pipeline_response)

        if cls:
            return cls(pipeline_response, deserialized, response_headers)

        return deserialized

    get.metadata = {"url": "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StreamAnalytics/streamingjobs/{jobName}/outputs/{outputName}"}  # type: ignore

    @distributed_trace
    def list_by_streaming_job(
        self, resource_group_name: str, job_name: str, select: Optional[str] = None, **kwargs: Any
    ) -> AsyncIterable["_models.Output"]:
        """Lists all of the outputs under the specified streaming job.

        :param resource_group_name: The name of the resource group. The name is case insensitive.
         Required.
        :type resource_group_name: str
        :param job_name: The name of the streaming job. Required.
        :type job_name: str
        :param select: The $select OData query parameter. This is a comma-separated list of structural
         properties to include in the response, or "\ *" to include all properties. By default, all
         properties are returned except diagnostics. Currently only accepts '*\ ' as a valid value.
         Default value is None.
        :type select: str
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: An iterator like instance of either Output or the result of cls(response)
        :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.streamanalytics.models.Output]
        :raises ~azure.core.exceptions.HttpResponseError:
        """
        _headers = kwargs.pop("headers", {}) or {}
        _params = case_insensitive_dict(kwargs.pop("params", {}) or {})

        api_version = kwargs.pop(
            "api_version", _params.pop("api-version", "2021-10-01-preview")
        )  # type: Literal["2021-10-01-preview"]
        cls = kwargs.pop("cls", None)  # type: ClsType[_models.OutputListResult]

        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        def prepare_request(next_link=None):
            if not next_link:

                request = build_list_by_streaming_job_request(
                    resource_group_name=resource_group_name,
                    job_name=job_name,
                    subscription_id=self._config.subscription_id,
                    select=select,
                    api_version=api_version,
                    template_url=self.list_by_streaming_job.metadata["url"],
                    headers=_headers,
                    params=_params,
                )
                request = _convert_request(request)
                request.url = self._client.format_url(request.url)  # type: ignore

            else:
                request = HttpRequest("GET", next_link)
                request = _convert_request(request)
                request.url = self._client.format_url(request.url)  # type: ignore
                request.method = "GET"
            return request

        async def extract_data(pipeline_response):
            deserialized = self._deserialize("OutputListResult", pipeline_response)
            list_of_elem = deserialized.value
            if cls:
                list_of_elem = cls(list_of_elem)
            return deserialized.next_link or None, AsyncList(list_of_elem)

        async def get_next(next_link=None):
            request = prepare_request(next_link)

            pipeline_response = await self._client._pipeline.run(  # type: ignore # pylint: disable=protected-access
                request, stream=False, **kwargs
            )
            response = pipeline_response.http_response

            if response.status_code not in [200]:
                map_error(status_code=response.status_code, response=response, error_map=error_map)
                error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response)
                raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

            return pipeline_response

        return AsyncItemPaged(get_next, extract_data)

    list_by_streaming_job.metadata = {"url": "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StreamAnalytics/streamingjobs/{jobName}/outputs"}  # type: ignore

    async def _test_initial(
        self,
        resource_group_name: str,
        job_name: str,
        output_name: str,
        output: Optional[Union[_models.Output, IO]] = None,
        **kwargs: Any
    ) -> Optional[_models.ResourceTestStatus]:
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
        _params = case_insensitive_dict(kwargs.pop("params", {}) or {})

        api_version = kwargs.pop(
            "api_version", _params.pop("api-version", "2021-10-01-preview")
        )  # type: Literal["2021-10-01-preview"]
        content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None))  # type: Optional[str]
        cls = kwargs.pop("cls", None)  # type: ClsType[Optional[_models.ResourceTestStatus]]

        content_type = content_type or "application/json"
        _json = None
        _content = None
        if isinstance(output, (IO, bytes)):
            _content = output
        else:
            if output is not None:
                _json = self._serialize.body(output, "Output")
            else:
                _json = None

        request = build_test_request(
            resource_group_name=resource_group_name,
            job_name=job_name,
            output_name=output_name,
            subscription_id=self._config.subscription_id,
            api_version=api_version,
            content_type=content_type,
            json=_json,
            content=_content,
            template_url=self._test_initial.metadata["url"],
            headers=_headers,
            params=_params,
        )
        request = _convert_request(request)
        request.url = self._client.format_url(request.url)  # type: ignore

        pipeline_response = await self._client._pipeline.run(  # type: ignore # pylint: disable=protected-access
            request, stream=False, **kwargs
        )

        response = pipeline_response.http_response

        if response.status_code not in [200, 202]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response)
            raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

        deserialized = None
        if response.status_code == 200:
            deserialized = self._deserialize("ResourceTestStatus", pipeline_response)

        if cls:
            return cls(pipeline_response, deserialized, {})

        return deserialized

    _test_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StreamAnalytics/streamingjobs/{jobName}/outputs/{outputName}/test"}  # type: ignore

    @overload
    async def begin_test(
        self,
        resource_group_name: str,
        job_name: str,
        output_name: str,
        output: Optional[_models.Output] = None,
        *,
        content_type: str = "application/json",
        **kwargs: Any
    ) -> AsyncLROPoller[_models.ResourceTestStatus]:
        """Tests whether an output's datasource is reachable and usable by the Azure Stream Analytics
        service.

        :param resource_group_name: The name of the resource group. The name is case insensitive.
         Required.
        :type resource_group_name: str
        :param job_name: The name of the streaming job. Required.
        :type job_name: str
        :param output_name: The name of the output. Required.
        :type output_name: str
        :param output: If the output specified does not already exist, this parameter must contain the
         full output definition intended to be tested. If the output specified already exists, this
         parameter can be left null to test the existing output as is or if specified, the properties
         specified will overwrite the corresponding properties in the existing output (exactly like a
         PATCH operation) and the resulting output will be tested. Default value is None.
        :type output: ~azure.mgmt.streamanalytics.models.Output
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :keyword callable cls: A custom type or function that will be passed the direct response
        :keyword str continuation_token: A continuation token to restart a poller from a saved state.
        :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
         this operation to not poll, or pass in your own initialized polling object for a personal
         polling strategy.
        :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
        :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
         Retry-After header is present.
        :return: An instance of AsyncLROPoller that returns either ResourceTestStatus or the result of
         cls(response)
        :rtype:
         ~azure.core.polling.AsyncLROPoller[~azure.mgmt.streamanalytics.models.ResourceTestStatus]
        :raises ~azure.core.exceptions.HttpResponseError:
        """

    @overload
    async def begin_test(
        self,
        resource_group_name: str,
        job_name: str,
        output_name: str,
        output: Optional[IO] = None,
        *,
        content_type: str = "application/json",
        **kwargs: Any
    ) -> AsyncLROPoller[_models.ResourceTestStatus]:
        """Tests whether an output's datasource is reachable and usable by the Azure Stream Analytics
        service.

        :param resource_group_name: The name of the resource group. The name is case insensitive.
         Required.
        :type resource_group_name: str
        :param job_name: The name of the streaming job. Required.
        :type job_name: str
        :param output_name: The name of the output. Required.
        :type output_name: str
        :param output: If the output specified does not already exist, this parameter must contain the
         full output definition intended to be tested. If the output specified already exists, this
         parameter can be left null to test the existing output as is or if specified, the properties
         specified will overwrite the corresponding properties in the existing output (exactly like a
         PATCH operation) and the resulting output will be tested. Default value is None.
        :type output: IO
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Default value is "application/json".
        :paramtype content_type: str
        :keyword callable cls: A custom type or function that will be passed the direct response
        :keyword str continuation_token: A continuation token to restart a poller from a saved state.
        :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
         this operation to not poll, or pass in your own initialized polling object for a personal
         polling strategy.
        :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
        :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
         Retry-After header is present.
        :return: An instance of AsyncLROPoller that returns either ResourceTestStatus or the result of
         cls(response)
        :rtype:
         ~azure.core.polling.AsyncLROPoller[~azure.mgmt.streamanalytics.models.ResourceTestStatus]
        :raises ~azure.core.exceptions.HttpResponseError:
        """

    @distributed_trace_async
    async def begin_test(
        self,
        resource_group_name: str,
        job_name: str,
        output_name: str,
        output: Optional[Union[_models.Output, IO]] = None,
        **kwargs: Any
    ) -> AsyncLROPoller[_models.ResourceTestStatus]:
        """Tests whether an output's datasource is reachable and usable by the Azure Stream Analytics
        service.

        :param resource_group_name: The name of the resource group. The name is case insensitive.
         Required.
        :type resource_group_name: str
        :param job_name: The name of the streaming job. Required.
        :type job_name: str
        :param output_name: The name of the output. Required.
        :type output_name: str
        :param output: If the output specified does not already exist, this parameter must contain the
         full output definition intended to be tested. If the output specified already exists, this
         parameter can be left null to test the existing output as is or if specified, the properties
         specified will overwrite the corresponding properties in the existing output (exactly like a
         PATCH operation) and the resulting output will be tested. Is either a model type or a IO type.
         Default value is None.
        :type output: ~azure.mgmt.streamanalytics.models.Output or IO
        :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
         Default value is None.
        :paramtype content_type: str
        :keyword callable cls: A custom type or function that will be passed the direct response
        :keyword str continuation_token: A continuation token to restart a poller from a saved state.
        :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
         this operation to not poll, or pass in your own initialized polling object for a personal
         polling strategy.
        :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
        :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
         Retry-After header is present.
        :return: An instance of AsyncLROPoller that returns either ResourceTestStatus or the result of
         cls(response)
        :rtype:
         ~azure.core.polling.AsyncLROPoller[~azure.mgmt.streamanalytics.models.ResourceTestStatus]
        :raises ~azure.core.exceptions.HttpResponseError:
        """
        _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
        _params = case_insensitive_dict(kwargs.pop("params", {}) or {})

        api_version = kwargs.pop(
            "api_version", _params.pop("api-version", "2021-10-01-preview")
        )  # type: Literal["2021-10-01-preview"]
        content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None))  # type: Optional[str]
        cls = kwargs.pop("cls", None)  # type: ClsType[_models.ResourceTestStatus]
        polling = kwargs.pop("polling", True)  # type: Union[bool, AsyncPollingMethod]
        lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
        cont_token = kwargs.pop("continuation_token", None)  # type: Optional[str]
        if cont_token is None:
            raw_result = await self._test_initial(  # type: ignore
                resource_group_name=resource_group_name,
                job_name=job_name,
                output_name=output_name,
                output=output,
                api_version=api_version,
                content_type=content_type,
                cls=lambda x, y, z: x,
                headers=_headers,
                params=_params,
                **kwargs
            )
        kwargs.pop("error_map", None)

        def get_long_running_output(pipeline_response):
            deserialized = self._deserialize("ResourceTestStatus", pipeline_response)
            if cls:
                return cls(pipeline_response, deserialized, {})
            return deserialized

        if polling is True:
            polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))  # type: AsyncPollingMethod
        elif polling is False:
            polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
        else:
            polling_method = polling
        if cont_token:
            return AsyncLROPoller.from_continuation_token(
                polling_method=polling_method,
                continuation_token=cont_token,
                client=self._client,
                deserialization_callback=get_long_running_output,
            )
        return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method)

    begin_test.metadata = {"url": "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StreamAnalytics/streamingjobs/{jobName}/outputs/{outputName}/test"}  # type: ignore


text:
use strict;
use warnings;
use Bio::KBase::workspace::ScriptHelpers qw(printObjectInfo get_ws_client workspace workspaceURL parseObjectMeta parseWorkspaceMeta printObjectMeta);
use Bio::KBase::fbaModelServices::ScriptHelpers qw(parse_input_table fbaws get_fba_client runFBACommand universalFBAScriptCode );

my $manpage =
"
NAME
      ga-add-feature - add feature to genome

DESCRIPTION

EXAMPLES

SEE ALSO

AUTHORS
      Christopher Henry
";

#Defining globals describing behavior
my $primaryArgs = ["Genome","Feature ID or Filename"];
my $servercommand = "add_features";
my $script = "ga-add-feature";
my $translation = {
	Genome => "genome",
	genomews => "genome_workspace",
	outputid => "output_id",
	workspace => "workspace",
};
#Defining usage and options
my $specs = [
    [ 'genomews=s', 'Workspace where genome is located' ],
	[ 'list|l', 'List features available for deletion' ],
    [ 'outputid=s', 'ID to which genome should be saved'],
    [ 'function=s', 'Function of the gene'],
    [ 'type=s', 'Type of the gene'],
    [ 'proteinseq=s', 'Type of the gene'],
    [ 'dnaseq=s', 'Type of the gene'],
    [ 'locations=s', 'List of locations for gene on contigs (contig/start/stop/direction)'],
    [ 'aliases=s', 'List of aliases for gene (; delimited)'],
    [ 'publications=s', 'List of publications for gene (; delimited)'],
    [ 'annotations=s', 'List of notes for gene (; delimited)'],
    [ 'workspace|w=s', 'Reference default workspace', { "default" => fbaws() } ]
];
my ($opt,$params) = universalFBAScriptCode($specs,$script,$primaryArgs,$translation,$manpage,undef,["list"]);
if (defined($opt->{list})) {
	my $ws = fbaws();
	if (defined($opt->{genomews})) {
		$ws = $opt->{genomews};
	}
	(my $data,my $prov) = get_workspace_object($ws."/".$ARGV[0]);
	print "Listing genes for deletion:\n";
	for (my $i=0; $i < @{$data->{features}}; $i++) {
		print $data->{features}->[$i]->{id}."\t".$data->{features}->[$i]->{function}."\n";
	}
}
if (-e $opt->{"Feature ID or Filename"}) {
	$params->{features} = parse_input_table($opt->{"Feature ID or Filename"},[
		["id",1,undef,undef],
		["function",0,undef,undef],
		["type",0,undef,undef],
		["aliases",0,undef,";"],
		["publications",0,undef,";"],
		["annotations",0,undef,";"],
		["proteinseq",0,undef,undef],
		["dnaseq",0,undef,undef],
		["locations",0,undef,undef]
	]);
	for (my $j=0; $j < @{$params->{features}}; $j++) {
		if (defined($params->{features}->[$j]->[8])) {
			my $array = [split(/;/,$params->{features}->[$j]->[8])];
			for (my $i=0; $i < @{$array}; $i++) {
				my $subarray = [split(/\//,$array->[$i])];
				push(@{$params->{features}->[$j]->[8]},[$subarray->[0],$subarray->[1],$subarray->[3],$subarray->[2]]);
			}
		}
	}
} else {
	$params->{features} = [[
		$opt->{"Feature ID or Filename"},
		undef,
		undef,
		undef,
		undef,
		undef,
		undef,
		undef,
		undef
	]];
	if (defined($opt->{function})) {
		$params->{features}->[0]->[1] = $opt->{function};
	}
	if (defined($opt->{type})) {
		$params->{features}->[0]->[2] = $opt->{type};
	}
	if (defined($opt->{proteinseq})) {
		$params->{features}->[0]->[6] = $opt->{proteinseq};
	}
	if (defined($opt->{dnaseq})) {
		$params->{features}->[0]->[7] = $opt->{dnaseq};
	}
	if (defined($opt->{locations})) {
		my $array = [split(/;/,$opt->{locations})];
		for (my $i=0; $i < @{$array}; $i++) {
			my $subarray = [split(/\//,$array->[$i])];
			push(@{$params->{features}->[0]->[8]},[$subarray->[0],$subarray->[1],$subarray->[3],$subarray->[2]]);
		}
	}
	if (defined($opt->{aliases})) {
		$params->{features}->[0]->[3] = [split(/;/,$opt->{aliases})];
	}
	if (defined($opt->{function})) {
		$params->{features}->[0]->[4] = [split(/;/,$opt->{publications})];
	}
	if (defined($opt->{function})) {
		$params->{features}->[0]->[5] = [split(/;/,$opt->{annotations})];
	}
}
#Calling the server
my $output = runFBACommand($params,$servercommand,$opt);
#Checking output and report results
if (!defined($output)) {
	print "Feature addition failed!\n";
} else {
	print "Feature successfully added:\n";
	printObjectInfo($output);
}


text:
angular.module('starter.controllers', [])

.controller('AppCtrl', function($scope, $rootScope, $ionicPush, $ionicUser) {
  $rootScope.$on('$cordovaPush:tokenReceived', function(event, data) {
    console.log('Got token', data.token, data.platform);
  });
  //Basic registration
  $scope.pushRegister = function() {
    alert('Registering...');

    $ionicPush.register({
      canShowAlert: false,
      onNotification: function(notification) {
        // Called for each notification for custom handling
        $scope.lastNotification = JSON.stringify(notification);
      }
    }).then(function(deviceToken) {
      $scope.token = deviceToken;
    });
  }
  $scope.identifyUser = function() {
    alert('Identifying');
    console.log('Identifying user');

    var user = $ionicUser.get();
    if(!user.user_id) {
      // Set your user_id here, or generate a random one
      user.user_id = $ionicUser.generateGUID()
    };

    angular.extend(user, {
      name: 'Test User',
      message: 'I come from planet Ion'
    });

    $ionicUser.identify(user);

  }
})