text:
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package openEHR_GUI;

import Utils.Log;
import java.awt.Component;
import javax.swing.BoxLayout;

/**
 *
 * @author vinicius
 */
public class MainFrame extends javax.swing.JFrame {

    TeleconsultationElements te;

    public MainFrame() {

        Log lg = new Log();
        te = new TeleconsultationElements();
        initComponents();

        setLayout(new BoxLayout(this.getContentPane(), BoxLayout.PAGE_AXIS));
        getContentPane().add(te);

        pack();
        /*
         * getContentPane().add(new ArchetypePane(new
         * File("/Users/vinicius/Dropbox/Importantes/OpenEHR - Archetype+RM
         * Splicer and
         * Editor/Repository/openehr/ehr/entry/observation/openEHR-EHR-OBSERVATION.anaesthetic.v1draft.xml")));
         * pack();
         */
        /*
         * JPanel jp = new ArchetypePane(new
         * File("/Users/vinicius/Dropbox/Importantes/OpenEHR - Archetype+RM
         * Splicer and
         * Editor/Repository/openehr/ehr/entry/observation/openEHR-EHR-OBSERVATION.anaesthetic.v1draft.xml"));
         * setLayout(new BorderLayout()); getContentPane().add(jp);
         */

    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jButton1 = new javax.swing.JButton();

        jButton1.setText("jButton1");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setResizable(false);

        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(0, 414, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(0, 300, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed

            System.out.println(this.getContentPane().getComponents()[0].getName());
        for (Component Components : this.getContentPane().getComponents()) {
            if (Components instanceof ArchetypeTypeTab) {
            }
        }
    }//GEN-LAST:event_jButton1ActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /*
         * Set the Nimbus look and feel
         */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /*
         * If Nimbus (introduced in Java SE 6) is not available, stay with the
         * default look and feel. For details see
         * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(MainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /*
         * Create and display the form
         */
        java.awt.EventQueue.invokeLater(new Runnable() {
            @Override
            public void run() {
                new MainFrame().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton1;
    // End of variables declaration//GEN-END:variables
}


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.analytics.synapse.artifacts.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;

/** Json write settings. */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type")
@JsonTypeName("JsonWriteSettings")
@Fluent
public final class JsonWriteSettings extends FormatWriteSettings {
    /*
     * File pattern of JSON. This setting controls the way a collection of JSON objects will be treated. The default
     * value is 'setOfObjects'. It is case-sensitive.
     */
    @JsonProperty(value = "filePattern")
    private Object filePattern;

    /**
     * Get the filePattern property: File pattern of JSON. This setting controls the way a collection of JSON objects
     * will be treated. The default value is 'setOfObjects'. It is case-sensitive.
     *
     * @return the filePattern value.
     */
    public Object getFilePattern() {
        return this.filePattern;
    }

    /**
     * Set the filePattern property: File pattern of JSON. This setting controls the way a collection of JSON objects
     * will be treated. The default value is 'setOfObjects'. It is case-sensitive.
     *
     * @param filePattern the filePattern value to set.
     * @return the JsonWriteSettings object itself.
     */
    public JsonWriteSettings setFilePattern(Object filePattern) {
        this.filePattern = filePattern;
        return this;
    }
}

redpajama_set_name: RedPajamaGithub


text:
module RecordCache
  module Strategy
    module Util
      CLASS_KEY = :c
      ATTRIBUTES_KEY = :a

      class << self

        # serialize one record before adding it to the cache
        # creates a shallow clone with a version and without associations
        def serialize(record)
          {CLASS_KEY => record.class.name,
           ATTRIBUTES_KEY => record.instance_variable_get(:@attributes).dup}
        end

        # deserialize a cached record
        def deserialize(serialized)
          record = serialized[CLASS_KEY].constantize.allocate
          attributes = serialized[ATTRIBUTES_KEY].clone
          record.class.serialized_attributes.keys.each do |attribute|
            if attributes[attribute].respond_to?(:unserialize)
              if attributes[attribute].method(:unserialize).arity > 0
                attributes[attribute] = attributes[attribute].unserialize(attributes[attribute].value)
              else
                attributes[attribute] = attributes[attribute].unserialize
              end
            end
          end
          record.init_with('attributes' => attributes)
          record
        end

        # Filter the cached records in memory
        # only simple x = y or x IN (a,b,c) can be handled
        # string comparison is case insensitive
        # Example:
        #  RecordCache::Strategy::Util.filter!(Apple.all, :price => [0.49, 0.59, 0.69], :name => "Green Apple")
        def filter!(records, wheres)
          wheres.each_pair do |attr, value|
            attr = attr.to_sym
            if value.is_a?(Array)
              where_values = Set.new(value.first.respond_to?(:downcase) ? value.map(&:downcase) : value)
              records.to_a.select! do |record|
                attribute_value = record.send(attr)
                attribute_value = attribute_value.downcase if attribute_value.respond_to?(:downcase)
                where_values.include?(attribute_value)
              end
            else
              where_value = value.respond_to?(:downcase) ? value.downcase : value
              records.to_a.select! do |record|
                attribute_value = record.send(attr)
                attribute_value = attribute_value.downcase if attribute_value.respond_to?(:downcase)
                attribute_value == where_value
              end
            end
          end
        end

        # Sort the cached records in memory, similar to MySql sorting rules including collatiom
        # Simply provide the Symbols of the attributes to sort in Ascending order, or use
        # [<attribute>, false] for Descending order.
        # Example:
        #  RecordCache::Strategy::Util.sort!(Apple.all, :name)
        #  RecordCache::Strategy::Util.sort!(Apple.all, [:name, false])
        #  RecordCache::Strategy::Util.sort!(Apple.all, [:price, false], :name)
        #  RecordCache::Strategy::Util.sort!(Apple.all, [:price, false], [:name, true])
        #  RecordCache::Strategy::Util.sort!(Apple.all, [[:price, false], [:name, true]])
        def sort!(records, *sort_orders)
          return records if records.empty? || sort_orders.empty?
          if sort_orders.first.is_a?(Array) && sort_orders.first.first.is_a?(Array)
            sort_orders = sort_orders.first
          else
            sort_orders = sort_orders.map{ |order| order.is_a?(Array) ? order : [order, true] } unless sort_orders.all?{ |order| order.is_a?(Array) }
          end
          records.sort!(&sort_proc(records.first.class, sort_orders))
          Collator.clear
          records
        end

        private

        # Retrieve the Proc based on the order by attributes
        # Note: Case insensitive sorting with collation is used for Strings
        def sort_proc(base, sort_orders)
          # [['(COLLATER.collate(x.name) || NIL_COMES_FIRST)', 'COLLATER.collate(y.name)'], ['(y.updated_at || NIL_COMES_FIRST)', 'x.updated_at']]
          sort = sort_orders.map do |attr, asc|
            attr = attr.to_s
            lr = ["x.", "y."]
            lr.reverse! unless asc
            lr.each{ |s| s << attr }
            lr.each{ |s| s.replace("Collator.collate(#{s})") } if base.columns_hash[attr].type == :string
            lr[0].replace("(#{lr[0]} || NIL_COMES_FIRST)")
            lr
          end
          # ['[(COLLATER.collate(x.name) || NIL_COMES_FIRST), (y.updated_at || NIL_COMES_FIRST)]', '[COLLATER.collate(y.name), x.updated_at]']
          sort = sort.transpose.map{|s| s.size == 1 ? s.first : "[#{s.join(',')}]"}
          # Proc.new{ |x,y| { ([(COLLATER.collate(x.name) || NIL_COMES_FIRST), (y.updated_at || NIL_COMES_FIRST)] <=> [COLLATER.collate(y.name), x.updated_at]) || 1 }
          eval("Proc.new{ |x,y| (#{sort[0]} <=> #{sort[1]}) || 1 }")
        end

        # If +x.nil?+ this class will return -1 for +x <=> y+
        NIL_COMES_FIRST = ((class NilComesFirst; def <=>(y); -1; end; end); NilComesFirst.new)

        # StringCollator uses the Rails transliterate method for collation
        module Collator
          @collated = []

          def self.clear
            @collated.each { |string| string.send(:remove_instance_variable, :@rc_collated) }
            @collated.clear
          end

          def self.collate(string)
            collated = string.instance_variable_get(:@rc_collated)
            return collated if collated
            normalized = ActiveSupport::Multibyte::Unicode.normalize(ActiveSupport::Multibyte::Unicode.tidy_bytes(string || ''), :c).mb_chars
            collated = I18n.transliterate(normalized).downcase.mb_chars
            # transliterate will replace ignored/unknown chars with ? the following line replaces ? with the original character
            collated.chars.each_with_index{ |c, i| collated[i] = normalized[i] if c == '?' } if collated.index('?')
            # puts "collation: #{string} => #{collated.to_s}"
            string.instance_variable_set(:@rc_collated, collated)
            @collated << string
            collated
          end
        end
      end

    end
  end
end


text:
<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Slider extends Model
{
    protected $fillable = ['picture', 'layer1', 'layer2'];

    public function sliders()
    {
        return $this->hasMany(Slider::class);
    }
}


text:
import connexion
import six

from tapi_server.models.inline_object19 import InlineObject19  # noqa: E501
from tapi_server.models.inline_object2 import InlineObject2  # noqa: E501
from tapi_server.models.inline_object20 import InlineObject20  # noqa: E501
from tapi_server.models.inline_object28 import InlineObject28  # noqa: E501
from tapi_server.models.inline_object7 import InlineObject7  # noqa: E501
from tapi_server.models.tapi_common_name_and_value import TapiCommonNameAndValue  # noqa: E501
from tapi_server.models.tapi_notification_alarm_info import TapiNotificationAlarmInfo  # noqa: E501
from tapi_server.models.tapi_notification_create_notification_subscription_service import TapiNotificationCreateNotificationSubscriptionService  # noqa: E501
from tapi_server.models.tapi_notification_delete_notification_subscription_service import TapiNotificationDeleteNotificationSubscriptionService  # noqa: E501
from tapi_server.models.tapi_notification_get_notification_list import TapiNotificationGetNotificationList  # noqa: E501
from tapi_server.models.tapi_notification_get_notification_subscription_service_details import TapiNotificationGetNotificationSubscriptionServiceDetails  # noqa: E501
from tapi_server.models.tapi_notification_get_notification_subscription_service_list import TapiNotificationGetNotificationSubscriptionServiceList  # noqa: E501
from tapi_server.models.tapi_notification_get_supported_notification_types import TapiNotificationGetSupportedNotificationTypes  # noqa: E501
from tapi_server.models.tapi_notification_name_and_value_change import TapiNotificationNameAndValueChange  # noqa: E501
from tapi_server.models.tapi_notification_notification import TapiNotificationNotification  # noqa: E501
from tapi_server.models.tapi_notification_notification_channel import TapiNotificationNotificationChannel  # noqa: E501
from tapi_server.models.tapi_notification_notification_context import TapiNotificationNotificationContext  # noqa: E501
from tapi_server.models.tapi_notification_notification_subscription_service import TapiNotificationNotificationSubscriptionService  # noqa: E501
from tapi_server.models.tapi_notification_subscription_filter import TapiNotificationSubscriptionFilter  # noqa: E501
from tapi_server.models.tapi_notification_tca_info import TapiNotificationTcaInfo  # noqa: E501
from tapi_server.models.tapi_notification_update_notification_subscription_service import TapiNotificationUpdateNotificationSubscriptionService  # noqa: E501
from tapi_server import util

def data_context_notification_context_delete():  # noqa: E501
    """data_context_notification_context_delete

    removes tapi.notification.NotificationContext # noqa: E501

    :rtype: None
    """
    return 'do some magic!'

def data_context_notification_context_get():  # noqa: E501
    """data_context_notification_context_get

    returns tapi.notification.NotificationContext # noqa: E501

    :rtype: TapiNotificationNotificationContext
    """
    return 'do some magic!'

def data_context_notification_context_notif_subscription_post(tapi_notification_notification_subscription_service=None):  # noqa: E501
    """data_context_notification_context_notif_subscription_post

    creates tapi.notification.NotificationSubscriptionService # noqa: E501

    :param tapi_notification_notification_subscription_service: tapi.notification.NotificationSubscriptionService to be added to list
    :type tapi_notification_notification_subscription_service: dict | bytes

    :rtype: None
    """
    if connexion.request.is_json:
        tapi_notification_notification_subscription_service = TapiNotificationNotificationSubscriptionService.from_dict(connexion.request.get_json())  # noqa: E501
    return 'do some magic!'

def data_context_notification_context_notif_subscriptionuuid_delete(uuid):  # noqa: E501
    """data_context_notification_context_notif_subscriptionuuid_delete

    removes tapi.notification.NotificationSubscriptionService # noqa: E501

    :param uuid: Id of notif-subscription
    :type uuid: str

    :rtype: None
    """
    return 'do some magic!'

def data_context_notification_context_notif_subscriptionuuid_get(uuid):  # noqa: E501
    """data_context_notification_context_notif_subscriptionuuid_get

    returns tapi.notification.NotificationSubscriptionService # noqa: E501

    :param uuid: Id of notif-subscription
    :type uuid: str

    :rtype: TapiNotificationNotificationSubscriptionService
    """
    return 'do some magic!'

def data_context_notification_context_notif_subscriptionuuid_name_post(uuid, tapi_common_name_and_value=None):  # noqa: E501
    """data_context_notification_context_notif_subscriptionuuid_name_post

    creates tapi.common.NameAndValue # noqa: E501

    :param uuid: Id of notif-subscription
    :type uuid: str
    :param tapi_common_name_and_value: tapi.common.NameAndValue to be added to list
    :type tapi_common_name_and_value: dict | bytes

    :rtype: None
    """
    if connexion.request.is_json:
        tapi_common_name_and_value = TapiCommonNameAndValue.from_dict(connexion.request.get_json())  # noqa: E501
    return 'do some magic!'

def data_context_notification_context_notif_subscriptionuuid_namevalue_name_delete(uuid, value_name):  # noqa: E501
    """data_context_notification_context_notif_subscriptionuuid_namevalue_name_delete

    removes tapi.common.NameAndValue # noqa: E501

    :param uuid: Id of notif-subscription
    :type uuid: str
    :param value_name: Id of name
    :type value_name: str

    :rtype: None
    """
    return 'do some magic!'

def data_context_notification_context_notif_subscriptionuuid_namevalue_name_get(uuid, value_name):  # noqa: E501
    """data_context_notification_context_notif_subscriptionuuid_namevalue_name_get

    returns tapi.common.NameAndValue # noqa: E501

    :param uuid: Id of notif-subscription
    :type uuid: str
    :param value_name: Id of name
    :type value_name: str

    :rtype: TapiCommonNameAndValue
    """
    return 'do some magic!'

def data_context_notification_context_notif_subscriptionuuid_namevalue_name_post(uuid, value_name, tapi_common_name_and_value=None):  # noqa: E501
    """data_context_notification_context_notif_subscriptionuuid_namevalue_name_post

    creates tapi.common.NameAndValue # noqa: E501

    :param uuid: Id of notif-subscription
    :type uuid: str
    :param value_name: Id of name
    :type value_name: str
    :param tapi_common_name_and_value: tapi.common.NameAndValue to be added to list
    :type tapi_common_name_and_value: dict | bytes

    :rtype: None
    """
    if connexion.request.is_json:
        tapi_common_name_and_value = TapiCommonNameAndValue.from_dict(connexion.request.get_json())  # noqa: E501
    return 'do some magic!'

def data_context_notification_context_notif_subscriptionuuid_namevalue_name_put(uuid, value_name, tapi_common_name_and_value=None):  # noqa: E501
    """data_context_notification_context_notif_subscriptionuuid_namevalue_name_put

    creates or updates tapi.common.NameAndValue # noqa: E501

    :param uuid: Id of notif-subscription
    :type uuid: str
    :param value_name: Id of name
    :type value_name: str
    :param tapi_common_name_and_value: tapi.common.NameAndValue to be added or updated
    :type tapi_common_name_and_value: dict | bytes

    :rtype: None
    """
    if connexion.request.is_json:
        tapi_common_name_and_value = TapiCommonNameAndValue.from_dict(connexion.request.get_json())  # noqa: E501
    return 'do some magic!'

def data_context_notification_context_notif_subscriptionuuid_notification_channel_delete(uuid):  # noqa: E501
    """data_context_notification_context_notif_subscriptionuuid_notification_channel_delete

    removes tapi.notification.NotificationChannel # noqa: E501

    :param uuid: Id of notif-subscription
    :type uuid: str

    :rtype: None
    """
    return 'do some magic!'

def data_context_notification_context_notif_subscriptionuuid_notification_channel_get(uuid):  # noqa: E501
    """data_context_notification_context_notif_subscriptionuuid_notification_channel_get

    returns tapi.notification.NotificationChannel # noqa: E501

    :param uuid: Id of notif-subscription
    :type uuid: str

    :rtype: TapiNotificationNotificationChannel
    """
    return 'do some magic!'

def data_context_notification_context_notif_subscriptionuuid_notification_channel_name_post(uuid, tapi_common_name_and_value=None):  # noqa: E501
    """data_context_notification_context_notif_subscriptionuuid_notification_channel_name_post

    creates tapi.common.NameAndValue # noqa: E501

    :param uuid: Id of notif-subscription
    :type uuid: str
    :param tapi_common_name_and_value: tapi.common.NameAndValue to be added to list
    :type tapi_common_name_and_value: dict | bytes

    :rtype: None
    """
    if connexion.request.is_json:
        tapi_common_name_and_value = TapiCommonNameAndValue.from_dict(connexion.request.get_json())  # noqa: E501
    return 'do some magic!'

def data_context_notification_context_notif_subscriptionuuid_notification_channel_namevalue_name_delete(uuid, value_name):  # noqa: E501
    """data_context_notification_context_notif_subscriptionuuid_notification_channel_namevalue_name_delete

    removes tapi.common.NameAndValue # noqa: E501

    :param uuid: Id of notif-subscription
    :type uuid: str
    :param value_name: Id of name
    :type value_name: str

    :rtype: None
    """
    return 'do some magic!'

def data_context_notification_context_notif_subscriptionuuid_notification_channel_namevalue_name_get(uuid, value_name):  # noqa: E501
    """data_context_notification_context_notif_subscriptionuuid_notification_channel_namevalue_name_get

    returns tapi.common.NameAndValue # noqa: E501

    :param uuid: Id of notif-subscription
    :type uuid: str
    :param value_name: Id of name
    :type value_name: str

    :rtype: TapiCommonNameAndValue
    """
    return 'do some magic!'

def data_context_notification_context_notif_subscriptionuuid_notification_channel_namevalue_name_post(uuid, value_name, tapi_common_name_and_value=None):  # noqa: E501
    """data_context_notification_context_notif_subscriptionuuid_notification_channel_namevalue_name_post

    creates tapi.common.NameAndValue # noqa: E501

    :param uuid: Id of notif-subscription
    :type uuid: str
    :param value_name: Id of name
    :type value_name: str
    :param tapi_common_name_and_value: tapi.common.NameAndValue to be added to list
    :type tapi_common_name_and_value: dict | bytes

    :rtype: None
    """
    if connexion.request.is_json:
        tapi_common_name_and_value = TapiCommonNameAndValue.from_dict(connexion.request.get_json())  # noqa: E501
    return 'do some magic!'

def data_context_notification_context_notif_subscriptionuuid_notification_channel_namevalue_name_put(uuid, value_name, tapi_common_name_and_value=None):  # noqa: E501
    """data_context_notification_context_notif_subscriptionuuid_notification_channel_namevalue_name_put

    creates or updates tapi.common.NameAndValue # noqa: E501

    :param uuid: Id of notif-subscription
    :type uuid: str
    :param value_name: Id of name
    :type value_name: str
    :param tapi_common_name_and_value: tapi.common.NameAndValue to be added or updated
    :type tapi_common_name_and_value: dict | bytes

    :rtype: None
    """
    if connexion.request.is_json:
        tapi_common_name_and_value = TapiCommonNameAndValue.from_dict(connexion.request.get_json())  # noqa: E501
    return 'do some magic!'

def data_context_notification_context_notif_subscriptionuuid_notification_channel_post(uuid, tapi_notification_notification_channel=None):  # noqa: E501
    """data_context_notification_context_notif_subscriptionuuid_notification_channel_post

    creates tapi.notification.NotificationChannel # noqa: E501

    :param uuid: Id of notif-subscription
    :type uuid: str
    :param tapi_notification_notification_channel: tapi.notification.NotificationChannel to be added to list
    :type tapi_notification_notification_channel: dict | bytes

    :rtype: None
    """
    if connexion.request.is_json:
        tapi_notification_notification_channel = TapiNotificationNotificationChannel.from_dict(connexion.request.get_json())  # noqa: E501
    return 'do some magic!'

def data_context_notification_context_notif_subscriptionuuid_notification_channel_put(uuid, tapi_notification_notification_channel=None):  # noqa: E501
    """data_context_notification_context_notif_subscriptionuuid_notification_channel_put

    creates or updates tapi.notification.NotificationChannel # noqa: E501

    :param uuid: Id of notif-subscription
    :type uuid: str
    :param tapi_notification_notification_channel: tapi.notification.NotificationChannel to be added or updated
    :type tapi_notification_notification_channel: dict | bytes

    :rtype: None
    """
    if connexion.request.is_json:
        tapi_notification_notification_channel = TapiNotificationNotificationChannel.from_dict(connexion.request.get_json())  # noqa: E501
    return 'do some magic!'

def data_context_notification_context_notif_subscriptionuuid_notificationnotification_uuid_additional_infovalue_name_get(uuid, notification_uuid, value_name):  # noqa: E501
    """data_context_notification_context_notif_subscriptionuuid_notificationnotification_uuid_additional_infovalue_name_get

    returns tapi.common.NameAndValue # noqa: E501

    :param uuid: Id of notif-subscription
    :type uuid: str
    :param notification_uuid: Id of notification
    :type notification_uuid: str
    :param value_name: Id of additional-info
    :type value_name: str

    :rtype: TapiCommonNameAndValue
    """
    return 'do some magic!'

def data_context_notification_context_notif_subscriptionuuid_notificationnotification_uuid_alarm_info_get(uuid, notification_uuid):  # noqa: E501
    """data_context_notification_context_notif_subscriptionuuid_notificationnotification_uuid_alarm_info_get

    returns tapi.notification.AlarmInfo # noqa: E501

    :param uuid: Id of notif-subscription
    :type uuid: str
    :param notification_uuid: Id of notification
    :type notification_uuid: str

    :rtype: TapiNotificationAlarmInfo
    """
    return 'do some magic!'

def data_context_notification_context_notif_subscriptionuuid_notificationnotification_uuid_changed_attributesvalue_name_get(uuid, notification_uuid, value_name):  # noqa: E501
    """data_context_notification_context_notif_subscriptionuuid_notificationnotification_uuid_changed_attributesvalue_name_get

    returns tapi.notification.NameAndValueChange # noqa: E501

    :param uuid: Id of notif-subscription
    :type uuid: str
    :param notification_uuid: Id of notification
    :type notification_uuid: str
    :param value_name: Id of changed-attributes
    :type value_name: str

    :rtype: TapiNotificationNameAndValueChange
    """
    return 'do some magic!'

def data_context_notification_context_notif_subscriptionuuid_notificationnotification_uuid_get(uuid, notification_uuid):  # noqa: E501
    """data_context_notification_context_notif_subscriptionuuid_notificationnotification_uuid_get

    returns tapi.notification.Notification # noqa: E501

    :param uuid: Id of notif-subscription
    :type uuid: str
    :param notification_uuid: Id of notification
    :type notification_uuid: str

    :rtype: TapiNotificationNotification
    """
    return 'do some magic!'

def data_context_notification_context_notif_subscriptionuuid_notificationnotification_uuid_namevalue_name_get(uuid, notification_uuid, value_name):  # noqa: E501
    """data_context_notification_context_notif_subscriptionuuid_notificationnotification_uuid_namevalue_name_get

    returns tapi.common.NameAndValue # noqa: E501

    :param uuid: Id of notif-subscription
    :type uuid: str
    :param notification_uuid: Id of notification
    :type notification_uuid: str
    :param value_name: Id of name
    :type value_name: str

    :rtype: TapiCommonNameAndValue
    """
    return 'do some magic!'

def data_context_notification_context_notif_subscriptionuuid_notificationnotification_uuid_target_object_namevalue_name_get(uuid, notification_uuid, value_name):  # noqa: E501
    """data_context_notification_context_notif_subscriptionuuid_notificationnotification_uuid_target_object_namevalue_name_get

    returns tapi.common.NameAndValue # noqa: E501

    :param uuid: Id of notif-subscription
    :type uuid: str
    :param notification_uuid: Id of notification
    :type notification_uuid: str
    :param value_name: Id of target-object-name
    :type value_name: str

    :rtype: TapiCommonNameAndValue
    """
    return 'do some magic!'

def data_context_notification_context_notif_subscriptionuuid_notificationnotification_uuid_tca_info_get(uuid, notification_uuid):  # noqa: E501
    """data_context_notification_context_notif_subscriptionuuid_notificationnotification_uuid_tca_info_get

    returns tapi.notification.TcaInfo # noqa: E501

    :param uuid: Id of notif-subscription
    :type uuid: str
    :param notification_uuid: Id of notification
    :type notification_uuid: str

    :rtype: TapiNotificationTcaInfo
    """
    return 'do some magic!'

def data_context_notification_context_notif_subscriptionuuid_post(uuid, tapi_notification_notification_subscription_service=None):  # noqa: E501
    """data_context_notification_context_notif_subscriptionuuid_post

    creates tapi.notification.NotificationSubscriptionService # noqa: E501

    :param uuid: Id of notif-subscription
    :type uuid: str
    :param tapi_notification_notification_subscription_service: tapi.notification.NotificationSubscriptionService to be added to list
    :type tapi_notification_notification_subscription_service: dict | bytes

    :rtype: None
    """
    if connexion.request.is_json:
        tapi_notification_notification_subscription_service = TapiNotificationNotificationSubscriptionService.from_dict(connexion.request.get_json())  # noqa: E501
    return 'do some magic!'

def data_context_notification_context_notif_subscriptionuuid_put(uuid, tapi_notification_notification_subscription_service=None):  # noqa: E501
    """data_context_notification_context_notif_subscriptionuuid_put

    creates or updates tapi.notification.NotificationSubscriptionService # noqa: E501

    :param uuid: Id of notif-subscription
    :type uuid: str
    :param tapi_notification_notification_subscription_service: tapi.notification.NotificationSubscriptionService to be added or updated
    :type tapi_notification_notification_subscription_service: dict | bytes

    :rtype: None
    """
    if connexion.request.is_json:
        tapi_notification_notification_subscription_service = TapiNotificationNotificationSubscriptionService.from_dict(connexion.request.get_json())  # noqa: E501
    return 'do some magic!'

def data_context_notification_context_notif_subscriptionuuid_subscription_filter_delete(uuid):  # noqa: E501
    """data_context_notification_context_notif_subscriptionuuid_subscription_filter_delete

    removes tapi.notification.SubscriptionFilter # noqa: E501

    :param uuid: Id of notif-subscription
    :type uuid: str

    :rtype: None
    """
    return 'do some magic!'

def data_context_notification_context_notif_subscriptionuuid_subscription_filter_get(uuid):  # noqa: E501
    """data_context_notification_context_notif_subscriptionuuid_subscription_filter_get

    returns tapi.notification.SubscriptionFilter # noqa: E501

    :param uuid: Id of notif-subscription
    :type uuid: str

    :rtype: TapiNotificationSubscriptionFilter
    """
    return 'do some magic!'

def data_context_notification_context_notif_subscriptionuuid_subscription_filter_name_post(uuid, tapi_common_name_and_value=None):  # noqa: E501
    """data_context_notification_context_notif_subscriptionuuid_subscription_filter_name_post

    creates tapi.common.NameAndValue # noqa: E501

    :param uuid: Id of notif-subscription
    :type uuid: str
    :param tapi_common_name_and_value: tapi.common.NameAndValue to be added to list
    :type tapi_common_name_and_value: dict | bytes

    :rtype: None
    """
    if connexion.request.is_json:
        tapi_common_name_and_value = TapiCommonNameAndValue.from_dict(connexion.request.get_json())  # noqa: E501
    return 'do some magic!'

def data_context_notification_context_notif_subscriptionuuid_subscription_filter_namevalue_name_delete(uuid, value_name):  # noqa: E501
    """data_context_notification_context_notif_subscriptionuuid_subscription_filter_namevalue_name_delete

    removes tapi.common.NameAndValue # noqa: E501

    :param uuid: Id of notif-subscription
    :type uuid: str
    :param value_name: Id of name
    :type value_name: str

    :rtype: None
    """
    return 'do some magic!'

def data_context_notification_context_notif_subscriptionuuid_subscription_filter_namevalue_name_get(uuid, value_name):  # noqa: E501
    """data_context_notification_context_notif_subscriptionuuid_subscription_filter_namevalue_name_get

    returns tapi.common.NameAndValue # noqa: E501

    :param uuid: Id of notif-subscription
    :type uuid: str
    :param value_name: Id of name
    :type value_name: str

    :rtype: TapiCommonNameAndValue
    """
    return 'do some magic!'

def data_context_notification_context_notif_subscriptionuuid_subscription_filter_namevalue_name_post(uuid, value_name, tapi_common_name_and_value=None):  # noqa: E501
    """data_context_notification_context_notif_subscriptionuuid_subscription_filter_namevalue_name_post

    creates tapi.common.NameAndValue # noqa: E501

    :param uuid: Id of notif-subscription
    :type uuid: str
    :param value_name: Id of name
    :type value_name: str
    :param tapi_common_name_and_value: tapi.common.NameAndValue to be added to list
    :type tapi_common_name_and_value: dict | bytes

    :rtype: None
    """
    if connexion.request.is_json:
        tapi_common_name_and_value = TapiCommonNameAndValue.from_dict(connexion.request.get_json())  # noqa: E501
    return 'do some magic!'

def data_context_notification_context_notif_subscriptionuuid_subscription_filter_namevalue_name_put(uuid, value_name, tapi_common_name_and_value=None):  # noqa: E501
    """data_context_notification_context_notif_subscriptionuuid_subscription_filter_namevalue_name_put

    creates or updates tapi.common.NameAndValue # noqa: E501

    :param uuid: Id of notif-subscription
    :type uuid: str
    :param value_name: Id of name
    :type value_name: str
    :param tapi_common_name_and_value: tapi.common.NameAndValue to be added or updated
    :type tapi_common_name_and_value: dict | bytes

    :rtype: None
    """
    if connexion.request.is_json:
        tapi_common_name_and_value = TapiCommonNameAndValue.from_dict(connexion.request.get_json())  # noqa: E501
    return 'do some magic!'

def data_context_notification_context_notif_subscriptionuuid_subscription_filter_post(uuid, tapi_notification_subscription_filter=None):  # noqa: E501
    """data_context_notification_context_notif_subscriptionuuid_subscription_filter_post

    creates tapi.notification.SubscriptionFilter # noqa: E501

    :param uuid: Id of notif-subscription
    :type uuid: str
    :param tapi_notification_subscription_filter: tapi.notification.SubscriptionFilter to be added to list
    :type tapi_notification_subscription_filter: dict | bytes

    :rtype: None
    """
    if connexion.request.is_json:
        tapi_notification_subscription_filter = TapiNotificationSubscriptionFilter.from_dict(connexion.request.get_json())  # noqa: E501
    return 'do some magic!'

def data_context_notification_context_notif_subscriptionuuid_subscription_filter_put(uuid, tapi_notification_subscription_filter=None):  # noqa: E501
    """data_context_notification_context_notif_subscriptionuuid_subscription_filter_put

    creates or updates tapi.notification.SubscriptionFilter # noqa: E501

    :param uuid: Id of notif-subscription
    :type uuid: str
    :param tapi_notification_subscription_filter: tapi.notification.SubscriptionFilter to be added or updated
    :type tapi_notification_subscription_filter: dict | bytes

    :rtype: None
    """
    if connexion.request.is_json:
        tapi_notification_subscription_filter = TapiNotificationSubscriptionFilter.from_dict(connexion.request.get_json())  # noqa: E501
    return 'do some magic!'

def data_context_notification_context_notificationuuid_additional_infovalue_name_get(uuid, value_name):  # noqa: E501
    """data_context_notification_context_notificationuuid_additional_infovalue_name_get

    returns tapi.common.NameAndValue # noqa: E501

    :param uuid: Id of notification
    :type uuid: str
    :param value_name: Id of additional-info
    :type value_name: str

    :rtype: TapiCommonNameAndValue
    """
    return 'do some magic!'

def data_context_notification_context_notificationuuid_alarm_info_get(uuid):  # noqa: E501
    """data_context_notification_context_notificationuuid_alarm_info_get

    returns tapi.notification.AlarmInfo # noqa: E501

    :param uuid: Id of notification
    :type uuid: str

    :rtype: TapiNotificationAlarmInfo
    """
    return 'do some magic!'

def data_context_notification_context_notificationuuid_changed_attributesvalue_name_get(uuid, value_name):  # noqa: E501
    """data_context_notification_context_notificationuuid_changed_attributesvalue_name_get

    returns tapi.notification.NameAndValueChange # noqa: E501

    :param uuid: Id of notification
    :type uuid: str
    :param value_name: Id of changed-attributes
    :type value_name: str

    :rtype: TapiNotificationNameAndValueChange
    """
    return 'do some magic!'

def data_context_notification_context_notificationuuid_get(uuid):  # noqa: E501
    """data_context_notification_context_notificationuuid_get

    returns tapi.notification.Notification # noqa: E501

    :param uuid: Id of notification
    :type uuid: str

    :rtype: TapiNotificationNotification
    """
    return 'do some magic!'

def data_context_notification_context_notificationuuid_namevalue_name_get(uuid, value_name):  # noqa: E501
    """data_context_notification_context_notificationuuid_namevalue_name_get

    returns tapi.common.NameAndValue # noqa: E501

    :param uuid: Id of notification
    :type uuid: str
    :param value_name: Id of name
    :type value_name: str

    :rtype: TapiCommonNameAndValue
    """
    return 'do some magic!'

def data_context_notification_context_notificationuuid_target_object_namevalue_name_get(uuid, value_name):  # noqa: E501
    """data_context_notification_context_notificationuuid_target_object_namevalue_name_get

    returns tapi.common.NameAndValue # noqa: E501

    :param uuid: Id of notification
    :type uuid: str
    :param value_name: Id of target-object-name
    :type value_name: str

    :rtype: TapiCommonNameAndValue
    """
    return 'do some magic!'

def data_context_notification_context_notificationuuid_tca_info_get(uuid):  # noqa: E501
    """data_context_notification_context_notificationuuid_tca_info_get

    returns tapi.notification.TcaInfo # noqa: E501

    :param uuid: Id of notification
    :type uuid: str

    :rtype: TapiNotificationTcaInfo
    """
    return 'do some magic!'

def data_context_notification_context_post(tapi_notification_notification_context=None):  # noqa: E501
    """data_context_notification_context_post

    creates tapi.notification.NotificationContext # noqa: E501

    :param tapi_notification_notification_context: tapi.notification.NotificationContext to be added to list
    :type tapi_notification_notification_context: dict | bytes

    :rtype: None
    """
    if connexion.request.is_json:
        tapi_notification_notification_context = TapiNotificationNotificationContext.from_dict(connexion.request.get_json())  # noqa: E501
    return 'do some magic!'

def data_context_notification_context_put(tapi_notification_notification_context=None):  # noqa: E501
    """data_context_notification_context_put

    creates or updates tapi.notification.NotificationContext # noqa: E501

    :param tapi_notification_notification_context: tapi.notification.NotificationContext to be added or updated
    :type tapi_notification_notification_context: dict | bytes

    :rtype: None
    """
    if connexion.request.is_json:
        tapi_notification_notification_context = TapiNotificationNotificationContext.from_dict(connexion.request.get_json())  # noqa: E501
    return 'do some magic!'

def operations_create_notification_subscription_service_post(inline_object2=None):  # noqa: E501
    """operations_create_notification_subscription_service_post

     # noqa: E501

    :param inline_object2:
    :type inline_object2: dict | bytes

    :rtype: TapiNotificationCreateNotificationSubscriptionService
    """
    if connexion.request.is_json:
        inline_object2 = InlineObject2.from_dict(connexion.request.get_json())  # noqa: E501
    return 'do some magic!'

def operations_delete_notification_subscription_service_post(inline_object7=None):  # noqa: E501
    """operations_delete_notification_subscription_service_post

     # noqa: E501

    :param inline_object7:
    :type inline_object7: dict | bytes

    :rtype: TapiNotificationDeleteNotificationSubscriptionService
    """
    if connexion.request.is_json:
        inline_object7 = InlineObject7.from_dict(connexion.request.get_json())  # noqa: E501
    return 'do some magic!'

def operations_get_notification_list_post(inline_object19=None):  # noqa: E501
    """operations_get_notification_list_post

     # noqa: E501

    :param inline_object19:
    :type inline_object19: dict | bytes

    :rtype: TapiNotificationGetNotificationList
    """
    if connexion.request.is_json:
        inline_object19 = InlineObject19.from_dict(connexion.request.get_json())  # noqa: E501
    return 'do some magic!'

def operations_get_notification_subscription_service_details_post(inline_object20=None):  # noqa: E501
    """operations_get_notification_subscription_service_details_post

     # noqa: E501

    :param inline_object20:
    :type inline_object20: dict | bytes

    :rtype: TapiNotificationGetNotificationSubscriptionServiceDetails
    """
    if connexion.request.is_json:
        inline_object20 = InlineObject20.from_dict(connexion.request.get_json())  # noqa: E501
    return 'do some magic!'

def operations_get_notification_subscription_service_list_post():  # noqa: E501
    """operations_get_notification_subscription_service_list_post

     # noqa: E501

    :rtype: TapiNotificationGetNotificationSubscriptionServiceList
    """
    return 'do some magic!'

def operations_get_supported_notification_types_post():  # noqa: E501
    """operations_get_supported_notification_types_post

     # noqa: E501

    :rtype: TapiNotificationGetSupportedNotificationTypes
    """
    return 'do some magic!'

def operations_update_notification_subscription_service_post(inline_object28=None):  # noqa: E501
    """operations_update_notification_subscription_service_post

     # noqa: E501

    :param inline_object28:
    :type inline_object28: dict | bytes

    :rtype: TapiNotificationUpdateNotificationSubscriptionService
    """
    if connexion.request.is_json:
        inline_object28 = InlineObject28.from_dict(connexion.request.get_json())  # noqa: E501
    return 'do some magic!'


text:
"""ARMA process and estimation with scipy.signal.lfilter

Notes
-----
* written without textbook, works but not sure about everything
  briefly checked and it looks to be standard least squares, see below

* theoretical autocorrelation function of general ARMA
  Done, relatively easy to guess solution, time consuming to get
  theoretical test cases, example file contains explicit formulas for
  acovf of MA(1), MA(2) and ARMA(1,1)

Properties:
Judge, ... (1985): The Theory and Practise of Econometrics

Author: josefpktd
License: BSD
"""
from statsmodels.compat.python import range

import numpy as np
from scipy import signal, optimize, linalg

__all__ = ['arma_acf', 'arma_acovf', 'arma_generate_sample',
           'arma_impulse_response', 'arma2ar', 'arma2ma', 'deconvolve',
           'lpol2index', 'index2lpol']

def arma_generate_sample(ar, ma, nsample, sigma=1, distrvs=np.random.randn,
                         burnin=0):
    """
    Generate a random sample of an ARMA process

    Parameters
    ----------
    ar : array_like, 1d
        coefficient for autoregressive lag polynomial, including zero lag
    ma : array_like, 1d
        coefficient for moving-average lag polynomial, including zero lag
    nsample : int
        length of simulated time series
    sigma : float
        standard deviation of noise
    distrvs : function, random number generator
        function that generates the random numbers, and takes sample size
        as argument
        default: np.random.randn
        TODO: change to size argument
    burnin : integer
        Burn in observations at the generated and dropped from the beginning of
        the sample

    Returns
    -------
    sample : array
        sample of ARMA process given by ar, ma of length nsample

    Notes
    -----
    As mentioned above, both the AR and MA components should include the
    coefficient on the zero-lag. This is typically 1. Further, due to the
    conventions used in signal processing used in signal.lfilter vs.
    conventions in statistics for ARMA processes, the AR parameters should
    have the opposite sign of what you might expect. See the examples below.

    Examples
    --------
    >>> import numpy as np
    >>> np.random.seed(12345)
    >>> arparams = np.array([.75, -.25])
    >>> maparams = np.array([.65, .35])
    >>> ar = np.r_[1, -arparams] # add zero-lag and negate
    >>> ma = np.r_[1, maparams] # add zero-lag
    >>> y = sm.tsa.arma_generate_sample(ar, ma, 250)
    >>> model = sm.tsa.ARMA(y, (2, 2)).fit(trend='nc', disp=0)
    >>> model.params
    array([ 0.79044189, -0.23140636,  0.70072904,  0.40608028])
    """
    # TODO: unify with ArmaProcess method
    eta = sigma * distrvs(nsample + burnin)
    return signal.lfilter(ma, ar, eta)[burnin:]

def arma_acovf(ar, ma, nobs=10, sigma2=1, dtype=None):
    """
    Theoretical autocovariance function of ARMA process

    Parameters
    ----------
    ar : array_like, 1d
        coefficient for autoregressive lag polynomial, including zero lag
    ma : array_like, 1d
        coefficient for moving-average lag polynomial, including zero lag
    nobs : int
        number of terms (lags plus zero lag) to include in returned acovf
    sigma2 : float
        Variance of the innovation term.

    Returns
    -------
    acovf : array
        autocovariance of ARMA process given by ar, ma

    See Also
    --------
    arma_acf
    acovf

    References
    ----------
    Brockwell, Peter J., and Richard A. Davis. 2009.
    Time Series: Theory and Methods. 2nd ed. 1991.
    New York, NY: Springer.

    """
    if dtype is None:
        dtype = np.common_type(np.array(ar), np.array(ma), np.array(sigma2))

    p = len(ar) - 1
    q = len(ma) - 1
    m = max(p, q) + 1

    if sigma2.real < 0:
        raise ValueError('Must have positive innovation variance.')

    # Short-circuit for trivial corner-case
    if p == q == 0:
        out = np.zeros(nobs, dtype=dtype)
        out[0] = sigma2
        return out

    # Get the moving average representation coefficients that we need
    ma_coeffs = arma2ma(ar, ma, lags=m)

    # Solve for the first m autocovariances via the linear system
    # described by (BD, eq. 3.3.8)
    A = np.zeros((m, m), dtype=dtype)
    b = np.zeros((m, 1), dtype=dtype)
    # We need a zero-right-padded version of ar params
    tmp_ar = np.zeros(m, dtype=dtype)
    tmp_ar[:p + 1] = ar
    for k in range(m):
        A[k, :(k + 1)] = tmp_ar[:(k + 1)][::-1]
        A[k, 1:m - k] += tmp_ar[(k + 1):m]
        b[k] = sigma2 * np.dot(ma[k:q + 1], ma_coeffs[:max((q + 1 - k), 0)])
    acovf = np.zeros(max(nobs, m), dtype=dtype)
    acovf[:m] = np.linalg.solve(A, b)[:, 0]

    # Iteratively apply (BD, eq. 3.3.9) to solve for remaining autocovariances
    if nobs > m:
        zi = signal.lfiltic([1], ar, acovf[:m:][::-1])
        acovf[m:] = signal.lfilter([1], ar, np.zeros(nobs - m, dtype=dtype),
                                   zi=zi)[0]

    return acovf[:nobs]

def arma_acf(ar, ma, lags=10, **kwargs):
    """
    Theoretical autocorrelation function of an ARMA process

    Parameters
    ----------
    ar : array_like, 1d
        coefficient for autoregressive lag polynomial, including zero lag
    ma : array_like, 1d
        coefficient for moving-average lag polynomial, including zero lag
    lags : int
        number of terms (lags plus zero lag) to include in returned acf

    Returns
    -------
    acf : array
        autocorrelation of ARMA process given by ar, ma

    See Also
    --------
    arma_acovf
    acf
    acovf
    """
    if 'nobs' in kwargs:
        lags = kwargs['nobs']
        import warnings
        warnings.warn('nobs is deprecated in favor of lags',
                      DeprecationWarning)

    acovf = arma_acovf(ar, ma, lags)
    return acovf / acovf[0]

def arma_pacf(ar, ma, lags=10, **kwargs):
    """
    Partial autocorrelation function of an ARMA process

    Parameters
    ----------
    ar : array_like, 1d
        coefficient for autoregressive lag polynomial, including zero lag
    ma : array_like, 1d
        coefficient for moving-average lag polynomial, including zero lag
    lags : int
        number of terms (lags plus zero lag) to include in returned pacf

    Returns
    -------
    pacf : array
        partial autocorrelation of ARMA process given by ar, ma

    Notes
    -----
    solves yule-walker equation for each lag order up to nobs lags

    not tested/checked yet
    """
    if 'nobs' in kwargs:
        lags = kwargs['nobs']
        import warnings
        warnings.warn('nobs is deprecated in favor of lags',
                      DeprecationWarning)
    # TODO: Should use rank 1 inverse update
    apacf = np.zeros(lags)
    acov = arma_acf(ar, ma, lags=lags + 1)

    apacf[0] = 1.
    for k in range(2, lags + 1):
        r = acov[:k]
        apacf[k - 1] = linalg.solve(linalg.toeplitz(r[:-1]), r[1:])[-1]
    return apacf

def arma_periodogram(ar, ma, worN=None, whole=0):
    """
    Periodogram for ARMA process given by lag-polynomials ar and ma

    Parameters
    ----------
    ar : array_like
        autoregressive lag-polynomial with leading 1 and lhs sign
    ma : array_like
        moving average lag-polynomial with leading 1
    worN : {None, int}, optional
        option for scipy.signal.freqz (read "w or N")
        If None, then compute at 512 frequencies around the unit circle.
        If a single integer, the compute at that many frequencies.
        Otherwise, compute the response at frequencies given in worN
    whole : {0,1}, optional
        options for scipy.signal.freqz
        Normally, frequencies are computed from 0 to pi (upper-half of
        unit-circle.  If whole is non-zero compute frequencies from 0 to 2*pi.

    Returns
    -------
    w : array
        frequencies
    sd : array
        periodogram, spectral density

    Notes
    -----
    Normalization ?

    This uses signal.freqz, which does not use fft. There is a fft version
    somewhere.
    """
    w, h = signal.freqz(ma, ar, worN=worN, whole=whole)
    sd = np.abs(h) ** 2 / np.sqrt(2 * np.pi)
    if np.any(np.isnan(h)):
        # this happens with unit root or seasonal unit root'
        import warnings
        warnings.warn('Warning: nan in frequency response h, maybe a unit '
                      'root', RuntimeWarning)
    return w, sd

def arma_impulse_response(ar, ma, leads=100, **kwargs):
    """
    Get the impulse response function (MA representation) for ARMA process

    Parameters
    ----------
    ma : array_like, 1d
        moving average lag polynomial
    ar : array_like, 1d
        auto regressive lag polynomial
    leads : int
        number of observations to calculate

    Returns
    -------
    ir : array, 1d
        impulse response function with nobs elements

    Notes
    -----
    This is the same as finding the MA representation of an ARMA(p,q).
    By reversing the role of ar and ma in the function arguments, the
    returned result is the AR representation of an ARMA(p,q), i.e

    ma_representation = arma_impulse_response(ar, ma, leads=100)
    ar_representation = arma_impulse_response(ma, ar, leads=100)

    Fully tested against matlab

    Examples
    --------
    AR(1)

    >>> arma_impulse_response([1.0, -0.8], [1.], leads=10)
    array([ 1.        ,  0.8       ,  0.64      ,  0.512     ,  0.4096    ,
            0.32768   ,  0.262144  ,  0.2097152 ,  0.16777216,  0.13421773])

    this is the same as

    >>> 0.8**np.arange(10)
    array([ 1.        ,  0.8       ,  0.64      ,  0.512     ,  0.4096    ,
            0.32768   ,  0.262144  ,  0.2097152 ,  0.16777216,  0.13421773])

    MA(2)

    >>> arma_impulse_response([1.0], [1., 0.5, 0.2], leads=10)
    array([ 1. ,  0.5,  0.2,  0. ,  0. ,  0. ,  0. ,  0. ,  0. ,  0. ])

    ARMA(1,2)

    >>> arma_impulse_response([1.0, -0.8], [1., 0.5, 0.2], leads=10)
    array([ 1.        ,  1.3       ,  1.24      ,  0.992     ,  0.7936    ,
            0.63488   ,  0.507904  ,  0.4063232 ,  0.32505856,  0.26004685])
    """
    if 'nobs' in kwargs:
        leads = kwargs['nobs']
        import warnings
        warnings.warn('nobs is deprecated in favor of leads',
                      DeprecationWarning)
    impulse = np.zeros(leads)
    impulse[0] = 1.
    return signal.lfilter(ma, ar, impulse)

def arma2ma(ar, ma, lags=100, **kwargs):
    """
    Get the MA representation of an ARMA process

    Parameters
    ----------
    ar : array_like, 1d
        auto regressive lag polynomial
    ma : array_like, 1d
        moving average lag polynomial
    lags : int
        number of coefficients to calculate

    Returns
    -------
    ar : array, 1d
        coefficients of AR lag polynomial with nobs elements

    Notes
    -----
    Equivalent to ``arma_impulse_response(ma, ar, leads=100)``

    Examples
    --------
    """
    if 'nobs' in kwargs:
        lags = kwargs['nobs']
        import warnings
        warnings.warn('nobs is deprecated in favor of lags',
                      DeprecationWarning)

    return arma_impulse_response(ar, ma, leads=lags)

def arma2ar(ar, ma, lags=100, **kwargs):
    """
    Get the AR representation of an ARMA process

    Parameters
    ----------
    ar : array_like, 1d
        auto regressive lag polynomial
    ma : array_like, 1d
        moving average lag polynomial
    lags : int
        number of coefficients to calculate

    Returns
    -------
    ar : array, 1d
        coefficients of AR lag polynomial with nobs elements

    Notes
    -----
    Equivalent to ``arma_impulse_response(ma, ar, leads=100)``

    Examples
    --------
    """
    if 'nobs' in kwargs:
        lags = kwargs['nobs']
        import warnings
        warnings.warn('nobs is deprecated in favor of lags',
                      DeprecationWarning)
    return arma_impulse_response(ma, ar, leads=lags)

# moved from sandbox.tsa.try_fi
def ar2arma(ar_des, p, q, n=20, mse='ar', start=None):
    """
    Find arma approximation to ar process

    This finds the ARMA(p,q) coefficients that minimize the integrated
    squared difference between the impulse_response functions (MA
    representation) of the AR and the ARMA process. This does not  check
    whether the MA lag polynomial of the ARMA process is invertible, neither
    does it check the roots of the AR lag polynomial.

    Parameters
    ----------
    ar_des : array_like
        coefficients of original AR lag polynomial, including lag zero
    p : int
        length of desired AR lag polynomials
    q : int
        length of desired MA lag polynomials
    n : int
        number of terms of the impulse_response function to include in the
        objective function for the approximation
    mse : string, 'ar'
        not used yet,

    Returns
    -------
    ar_app, ma_app : arrays
        coefficients of the AR and MA lag polynomials of the approximation
    res : tuple
        result of optimize.leastsq

    Notes
    -----
    Extension is possible if we want to match autocovariance instead
    of impulse response function.
    """

    # TODO: convert MA lag polynomial, ma_app, to be invertible, by mirroring
    # TODO: roots outside the unit interval to ones that are inside. How to do
    # TODO: this?

    # p,q = pq
    def msear_err(arma, ar_des):
        ar, ma = np.r_[1, arma[:p - 1]], np.r_[1, arma[p - 1:]]
        ar_approx = arma_impulse_response(ma, ar, n)
        return (ar_des - ar_approx)  # ((ar - ar_approx)**2).sum()

    if start is None:
        arma0 = np.r_[-0.9 * np.ones(p - 1), np.zeros(q - 1)]
    else:
        arma0 = start
    res = optimize.leastsq(msear_err, arma0, ar_des, maxfev=5000)
    arma_app = np.atleast_1d(res[0])
    ar_app = np.r_[1, arma_app[:p - 1]],
    ma_app = np.r_[1, arma_app[p - 1:]]
    return ar_app, ma_app, res

def lpol2index(ar):
    """
    Remove zeros from lag polynomial

    Parameters
    ----------
    ar : array_like
        coefficients of lag polynomial

    Returns
    -------
    coeffs : array
        non-zero coefficients of lag polynomial
    index : array
        index (lags) of lag polynomial with non-zero elements
    """
    ar = np.asarray(ar)
    index = np.nonzero(ar)[0]
    coeffs = ar[index]
    return coeffs, index

def index2lpol(coeffs, index):
    """
    Expand coefficients to lag poly

    Parameters
    ----------
    coeffs : array
        non-zero coefficients of lag polynomial
    index : array
        index (lags) of lag polynomial with non-zero elements

    Returns
    -------
    ar : array_like
        coefficients of lag polynomial
    """
    n = max(index)
    ar = np.zeros(n + 1)
    ar[index] = coeffs
    return ar

def lpol_fima(d, n=20):
    """MA representation of fractional integration

    .. math:: (1-L)^{-d} for |d|<0.5  or |d|<1 (?)

    Parameters
    ----------
    d : float
        fractional power
    n : int
        number of terms to calculate, including lag zero

    Returns
    -------
    ma : array
        coefficients of lag polynomial

    """
    # hide import inside function until we use this heavily
    from scipy.special import gammaln
    j = np.arange(n)
    return np.exp(gammaln(d + j) - gammaln(j + 1) - gammaln(d))

# moved from sandbox.tsa.try_fi
def lpol_fiar(d, n=20):
    """AR representation of fractional integration

    .. math:: (1-L)^{d} for |d|<0.5  or |d|<1 (?)

    Parameters
    ----------
    d : float
        fractional power
    n : int
        number of terms to calculate, including lag zero

    Returns
    -------
    ar : array
        coefficients of lag polynomial

    Notes:
    first coefficient is 1, negative signs except for first term,
    ar(L)*x_t
    """
    # hide import inside function until we use this heavily
    from scipy.special import gammaln
    j = np.arange(n)
    ar = - np.exp(gammaln(-d + j) - gammaln(j + 1) - gammaln(-d))
    ar[0] = 1
    return ar

# moved from sandbox.tsa.try_fi
def lpol_sdiff(s):
    """return coefficients for seasonal difference (1-L^s)

    just a trivial convenience function

    Parameters
    ----------
    s : int
        number of periods in season

    Returns
    -------
    sdiff : list, length s+1

    """
    return [1] + [0] * (s - 1) + [-1]

def deconvolve(num, den, n=None):
    """Deconvolves divisor out of signal, division of polynomials for n terms

    calculates den^{-1} * num

    Parameters
    ----------
    num : array_like
        signal or lag polynomial
    denom : array_like
        coefficients of lag polynomial (linear filter)
    n : None or int
        number of terms of quotient

    Returns
    -------
    quot : array
        quotient or filtered series
    rem : array
        remainder

    Notes
    -----
    If num is a time series, then this applies the linear filter den^{-1}.
    If both num and den are both lag polynomials, then this calculates the
    quotient polynomial for n terms and also returns the remainder.

    This is copied from scipy.signal.signaltools and added n as optional
    parameter.

    """
    num = np.atleast_1d(num)
    den = np.atleast_1d(den)
    N = len(num)
    D = len(den)
    if D > N and n is None:
        quot = []
        rem = num
    else:
        if n is None:
            n = N - D + 1
        input = np.zeros(n, float)
        input[0] = 1
        quot = signal.lfilter(num, den, input)
        num_approx = signal.convolve(den, quot, mode='full')
        if len(num) < len(num_approx):  # 1d only ?
            num = np.concatenate((num, np.zeros(len(num_approx) - len(num))))
        rem = num - num_approx
    return quot, rem

class ArmaProcess(object):
    r"""
    Theoretical properties of an ARMA process for specified lag-polynomials

    Parameters
    ----------
    ar : array_like, 1d, optional
        Coefficient for autoregressive lag polynomial, including zero lag.
        See the notes for some information about the sign.
    ma : array_like, 1d, optional
        Coefficient for moving-average lag polynomial, including zero lag
    nobs : int, optional
        Length of simulated time series. Used, for example, if a sample is
        generated. See example.

    Notes
    -----
    Both the AR and MA components must include the coefficient on the
    zero-lag. In almost all cases these values should be 1. Further, due to
    using the lag-polynomial representation, the AR parameters should
    have the opposite sign of what one would write in the ARMA representation.
    See the examples below.

    The ARMA(p,q) process is described by

    .. math::

        y_{t}=\phi_{1}y_{t-1}+\ldots+\phi_{p}y_{t-p}+\theta_{1}\epsilon_{t-1}
               +\ldots+\theta_{q}\epsilon_{t-q}+\epsilon_{t}

    and the parameterization used in this function uses the lag-polynomial
    representation,

    .. math::

        \left(1-\phi_{1}L-\ldots-\phi_{p}L^{p}\right)y_{t} =
            \left(1-\theta_{1}L-\ldots-\theta_{q}L^{q}\right)

    Examples
    --------
    >>> import numpy as np
    >>> np.random.seed(12345)
    >>> arparams = np.array([.75, -.25])
    >>> maparams = np.array([.65, .35])
    >>> ar = np.r_[1, -arparams] # add zero-lag and negate
    >>> ma = np.r_[1, maparams] # add zero-lag
    >>> arma_process = sm.tsa.ArmaProcess(ar, ma)
    >>> arma_process.isstationary
    True
    >>> arma_process.isinvertible
    True
    >>> y = arma_process.generate_sample(250)
    >>> model = sm.tsa.ARMA(y, (2, 2)).fit(trend='nc', disp=0)
    >>> model.params
    array([ 0.79044189, -0.23140636,  0.70072904,  0.40608028])
    """

    # TODO: Check unit root behavior
    def __init__(self, ar=None, ma=None, nobs=100):
        if ar is None:
            ar = np.array([1.])
        if ma is None:
            ma = np.array([1.])
        self.ar = np.asarray(ar)
        self.ma = np.asarray(ma)
        self.arcoefs = -self.ar[1:]
        self.macoefs = self.ma[1:]
        self.arpoly = np.polynomial.Polynomial(self.ar)
        self.mapoly = np.polynomial.Polynomial(self.ma)
        self.nobs = nobs

    @classmethod
    def from_coeffs(cls, arcoefs=None, macoefs=None, nobs=100):
        """
        Convenience function to create ArmaProcess from ARMA representation

        Parameters
        ----------
        arcoefs : array-like, optional
            Coefficient for autoregressive lag polynomial, not including zero
            lag. The sign is inverted to conform to the usual time series
            representation of an ARMA process in statistics. See the class
            docstring for more information.
        macoefs : array-like, optional
            Coefficient for moving-average lag polynomial, excluding zero lag
        nobs : int, optional
            Length of simulated time series. Used, for example, if a sample
            is generated.

        Examples
        --------
        >>> arparams = [.75, -.25]
        >>> maparams = [.65, .35]
        >>> arma_process = sm.tsa.ArmaProcess.from_coeffs(ar, ma)
        >>> arma_process.isstationary
        True
        >>> arma_process.isinvertible
        True
        """
        arcoefs = [] if arcoefs is None else arcoefs
        macoefs = [] if macoefs is None else macoefs
        return cls(np.r_[1, -np.asarray(arcoefs)],
                   np.r_[1, np.asarray(macoefs)],
                   nobs=nobs)

    @classmethod
    def from_estimation(cls, model_results, nobs=None):
        """
        Convenience function to create an ArmaProcess from the results
        of an ARMA estimation

        Parameters
        ----------
        model_results : ARMAResults instance
            A fitted model
        nobs : int, optional
            If None, nobs is taken from the results
        """
        arcoefs = model_results.arparams
        macoefs = model_results.maparams
        nobs = nobs or model_results.nobs
        return cls(np.r_[1, -arcoefs], np.r_[1, macoefs], nobs=nobs)

    def __mul__(self, oth):
        if isinstance(oth, self.__class__):
            ar = (self.arpoly * oth.arpoly).coef
            ma = (self.mapoly * oth.mapoly).coef
        else:
            try:
                aroth, maoth = oth
                arpolyoth = np.polynomial.Polynomial(aroth)
                mapolyoth = np.polynomial.Polynomial(maoth)
                ar = (self.arpoly * arpolyoth).coef
                ma = (self.mapoly * mapolyoth).coef
            except:
                raise TypeError('Other type is not a valid type')
        return self.__class__(ar, ma, nobs=self.nobs)

    def __repr__(self):
        msg = 'ArmaProcess({0}, {1}, nobs={2}) at {3}'
        return msg.format(self.ar.tolist(), self.ma.tolist(),
                          self.nobs, hex(id(self)))

    def __str__(self):
        return 'ArmaProcess\nAR: {0}\nMA: {1}'.format(self.ar.tolist(),
                                                      self.ma.tolist())

    def acovf(self, nobs=None):
        nobs = nobs or self.nobs
        return arma_acovf(self.ar, self.ma, nobs=nobs)

    acovf.__doc__ = arma_acovf.__doc__

    def acf(self, lags=None):
        lags = lags or self.nobs
        return arma_acf(self.ar, self.ma, lags=lags)

    acf.__doc__ = arma_acf.__doc__

    def pacf(self, lags=None):
        lags = lags or self.nobs
        return arma_pacf(self.ar, self.ma, lags=lags)

    pacf.__doc__ = arma_pacf.__doc__

    def periodogram(self, nobs=None):
        nobs = nobs or self.nobs
        return arma_periodogram(self.ar, self.ma, worN=nobs)

    periodogram.__doc__ = arma_periodogram.__doc__

    def impulse_response(self, leads=None):
        leads = leads or self.nobs
        return arma_impulse_response(self.ar, self.ma, leads=leads)

    impulse_response.__doc__ = arma_impulse_response.__doc__

    def arma2ma(self, lags=None):
        lags = lags or self.lags
        return arma2ma(self.ar, self.ma, lags=lags)

    arma2ma.__doc__ = arma2ma.__doc__

    def arma2ar(self, lags=None):
        lags = lags or self.lags
        return arma2ar(self.ar, self.ma, lags=lags)

    arma2ar.__doc__ = arma2ar.__doc__

    @property
    def arroots(self):
        """Roots of autoregressive lag-polynomial"""
        return self.arpoly.roots()

    @property
    def maroots(self):
        """Roots of moving average lag-polynomial"""
        return self.mapoly.roots()

    @property
    def isstationary(self):
        """
        Arma process is stationary if AR roots are outside unit circle

        Returns
        -------
        isstationary : boolean
             True if autoregressive roots are outside unit circle
        """
        if np.all(np.abs(self.arroots) > 1.0):
            return True
        else:
            return False

    @property
    def isinvertible(self):
        """
        Arma process is invertible if MA roots are outside unit circle

        Returns
        -------
        isinvertible : boolean
             True if moving average roots are outside unit circle
        """
        if np.all(np.abs(self.maroots) > 1):
            return True
        else:
            return False

    def invertroots(self, retnew=False):
        """
        Make MA polynomial invertible by inverting roots inside unit circle

        Parameters
        ----------
        retnew : boolean
            If False (default), then return the lag-polynomial as array.
            If True, then return a new instance with invertible MA-polynomial

        Returns
        -------
        manew : array
           new invertible MA lag-polynomial, returned if retnew is false.
        wasinvertible : boolean
           True if the MA lag-polynomial was already invertible, returned if
           retnew is false.
        armaprocess : new instance of class
           If retnew is true, then return a new instance with invertible
           MA-polynomial
        """
        # TODO: variable returns like this?
        pr = self.maroots
        mainv = self.ma
        invertible = self.isinvertible
        if not invertible:
            pr[np.abs(pr) < 1] = 1. / pr[np.abs(pr) < 1]
            pnew = np.polynomial.Polynomial.fromroots(pr)
            mainv = pnew.coef / pnew.coef[0]

        if retnew:
            return self.__class__(self.ar, mainv, nobs=self.nobs)
        else:
            return mainv, invertible

    def generate_sample(self, nsample=100, scale=1., distrvs=None, axis=0,
                        burnin=0):
        """
        Simulate an ARMA

        Parameters
        ----------
        nsample : int or tuple of ints
            If nsample is an integer, then this creates a 1d timeseries of
            length size. If nsample is a tuple, creates a len(nsample)
            dimensional time series where time is indexed along the input
            variable ``axis``. All series are unless ``distrvs`` generates
            dependent data.
        scale : float
            standard deviation of noise
        distrvs : function, random number generator
            function that generates the random numbers, and takes sample size
            as argument
            default: np.random.randn
            TODO: change to size argument
        burnin : integer (default: 0)
            to reduce the effect of initial conditions, burnin observations
            at the beginning of the sample are dropped
        axis : int
            See nsample.

        Returns
        -------
        rvs : ndarray
            random sample(s) of arma process

        Notes
        -----
        Should work for n-dimensional with time series along axis, but not
        tested yet. Processes are sampled independently.
        """
        if distrvs is None:
            distrvs = np.random.normal
        if np.ndim(nsample) == 0:
            nsample = [nsample]
        if burnin:
            # handle burin time for nd arrays
            # maybe there is a better trick in scipy.fft code
            newsize = list(nsample)
            newsize[axis] += burnin
            newsize = tuple(newsize)
            fslice = [slice(None)] * len(newsize)
            fslice[axis] = slice(burnin, None, None)
            fslice = tuple(fslice)
        else:
            newsize = tuple(nsample)
            fslice = tuple([slice(None)] * np.ndim(newsize))
        eta = scale * distrvs(size=newsize)
        return signal.lfilter(self.ma, self.ar, eta, axis=axis)[fslice]


text:
var app_root_url_1 = require('angular2/src/core/compiler/app_root_url');
exports.AppRootUrl = app_root_url_1.AppRootUrl;
var url_resolver_1 = require('angular2/src/core/compiler/url_resolver');
exports.UrlResolver = url_resolver_1.UrlResolver;
var title_1 = require('angular2/src/core/services/title');
exports.Title = title_1.Title;
//# sourceMappingURL=services.js.map


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

public class MouseClickBomb : MonoBehaviour
{
	public const string k_Key = "exploded";

	public TileBase m_Border;
	public TileBase m_ExplodedFloor;
	public GameObject m_Explosion;

	private Grid m_Grid;
	private Tilemap m_Foreground;
	private Tilemap m_BackGround;
	private GridInformation m_Info;

	// Use this for initialization
	void Start ()
	{
		m_Grid = GetComponent<Grid>();
		m_Info = GetComponent<GridInformation>();
		m_Foreground = GameObject.Find("Foreground").GetComponent<Tilemap>();
		m_BackGround = GameObject.Find("Background").GetComponent<Tilemap>();
	}

	// Update is called once per frame
	void Update ()
	{
		if (m_Grid && Input.GetMouseButtonDown(0))
		{
			Vector3 world = Camera.main.ScreenToWorldPoint(Input.mousePosition);
			Vector3Int gridPos = m_Grid.WorldToCell(world);

			ExplodeCell(gridPos);
			ExplodeCell(gridPos + new Vector3Int(-1, 0, 0));
			ExplodeCell(gridPos + new Vector3Int(-2, 0, 0));
			ExplodeCell(gridPos + new Vector3Int(1, 0, 0));
			ExplodeCell(gridPos + new Vector3Int(2, 0, 0));
			ExplodeCell(gridPos + new Vector3Int(0, -1, 0));
			ExplodeCell(gridPos + new Vector3Int(0, -2, 0));
			ExplodeCell(gridPos + new Vector3Int(0, 1, 0));
			ExplodeCell(gridPos + new Vector3Int(0, 2, 0));
		}
	}

	private void ExplodeCell(Vector3Int position)
	{
		if (m_Foreground.GetTile(position) == m_Border)
			return;

		m_Info.ErasePositionProperty(position, k_Key);
		m_Info.SetPositionProperty(position, k_Key, 1);
		foreach (var pos in new BoundsInt(position.x - 1, position.y - 1, position.z, 3, 3, 1).allPositionsWithin)
		{
			if (m_Foreground.GetTile(pos) != null)
			{
				m_BackGround.SetTile(pos, m_ExplodedFloor);
			}
		}
		m_Foreground.SetTile(position, null);

		GameObject.Instantiate(m_Explosion, m_Grid.CellToLocalInterpolated(position + new Vector3(0.5f, 0.5f)), Quaternion.identity);
	}
}


text:
namespace pe {

// The interface that guides image and basic-block transform decisions for COFF
// files.
class CoffTransformPolicy : public block_graph::TransformPolicyInterface {
 public:
  CoffTransformPolicy() { }
  virtual ~CoffTransformPolicy() { }

  // @name TransformPolicyInterface implementation
  // @{
  virtual bool BlockIsSafeToBasicBlockDecompose(
      const BlockGraph::Block* block) const OVERRIDE;
  virtual bool ReferenceIsSafeToRedirect(
      const BlockGraph::Block* referrer,
      const BlockGraph::Reference& reference) const OVERRIDE;
  // @}

 private:
  // TODO(chrisha): For now we are only a thin wrapper around a PE transform
  //     policy. When the rest of the COFF machinery lands reimplement this to
  //     respect the differences between COFF and PE code blocks.
  PETransformPolicy pe_policy_;

  DISALLOW_COPY_AND_ASSIGN(CoffTransformPolicy);
};

}  // namespace pe

#endif  // SYZYGY_PE_COFF_TRANSFORM_POLICY_H_


text:
package org.jetbrains.plugins.scala
package lang
package psi
package stubs
package index

import com.intellij.openapi.project.Project
import com.intellij.psi.search.GlobalSearchScope
import com.intellij.psi.stubs.{StringStubIndexExtension, StubIndexKey}
import org.jetbrains.plugins.scala.finder.ScalaSourceFilterScope
import org.jetbrains.plugins.scala.lang.psi.api.statements.ScValue
import org.jetbrains.plugins.scala.lang.psi.api.statements.params.ScClassParameter

/**
 * User: Alexander Podkhalyuzin
 * Date: 17.10.2008
 */

class ScValueNameIndex extends StringStubIndexExtension[ScValue] {
  override def get(key: String, project: Project, scope: GlobalSearchScope): java.util.Collection[ScValue] =
    super.get(key, project, new ScalaSourceFilterScope(scope, project))

  def getKey: StubIndexKey[String, ScValue] = ScValueNameIndex.KEY
}

object ScValueNameIndex {
  val KEY = ScalaIndexKeys.VALUE_NAME_KEY
}

class ScClassParameterNameIndex extends StringStubIndexExtension[ScClassParameter] {
  override def get(key: String, project: Project, scope: GlobalSearchScope): java.util.Collection[ScClassParameter] =
    super.get(key, project, new ScalaSourceFilterScope(scope, project))

  def getKey: StubIndexKey[String, ScClassParameter] = ScClassParameterNameIndex.KEY
}

object ScClassParameterNameIndex {
  val KEY = ScalaIndexKeys.CLASS_PARAMETER_NAME_KEY
}


text:
title: Contact
permalink: "contact/index.html"
layout: default
---

Questions?

Contact Paul Pillitteri for additional information on the project, to discuss booking the installation, press or new work.

Paul @ MediaInMotion.com


text: <?import namespace="foo" implementation="#bar">


text:
var express = require('express');
var app = express();
var bodyParser = require("body-parser");
var multipart = require('connect-multiparty');
var multipartMiddleware = multipart();
var path = require('path');
var auth = require('./routes/auth');
var beers = require('./routes/beers');
var users = require('./routes/users');
var db = require('./mongoose');

app.use('/css', express.static(__dirname + '/node_modules/acsset/css'));
app.use(express.static(__dirname + "/public"));

app.use(bodyParser.urlencoded({
	extended: true
}));
app.use(bodyParser.json());

// Auth
app.post('/api/authenticate', auth.authenticate);
app.post('/api/isAuthenticated', auth.isAuthenticated);

// User
app.get('/api/users', auth.isAuthenticated, users.findAll);
app.get('/api/users/:id', auth.isAuthenticated, users.findById);
app.post('/api/users', users.addUser);
app.put('/api/users/:id', auth.isAuthenticated, users.updateUser);
app.delete('/api/users/:id', auth.isAuthenticated, users.deleteUser);

// Beer
app.get('/api/beers', beers.findAll);
app.get('/api/beers/:year', beers.findYear);
app.get('/api/beers/view/:id', beers.findById);
app.post('/api/beers', auth.isAuthenticated, beers.addBeer);
app.post('/api/beers/upload', auth.isAuthenticated, multipartMiddleware, beers.upload);
app.put('/api/beers/:id', auth.isAuthenticated, beers.updateBeer);
app.delete('/api/beers/:id', auth.isAuthenticated, beers.deleteBeer);

app.use('*', function(req, res, next) {
	var indexFile = path.resolve(__dirname + '/public/index.html');
	res.sendFile(indexFile);
});

app.listen(process.env.PORT || 8080, function() {
	console.log('App listening on port 8080!');
});