text:
Appendix: API documentation
#############################################

This page contains automatically generated documentation from the Enrich2 codebase. It is intended for developers and advanced users.

:py:mod:`~enrich2.storemanager` --- Abstract class for Enrich2 data
===================================================================

.. py:module:: storemanager
	:synopsis: Abstract class for Enrich2 data.

This module contains the class definition for the :py:class:`~enrich2.storemanager.storemanager.StoreManager` abstract class, the shared base class for most classes in the `Enrich2 <index.html>`_ project. This class provides general behavior for the GUI and for handling HDF5 data files.

:py:class:`~enrich2.storemanager.StoreManager` class
-----------------------------------------------------------------
.. autoclass:: enrich2.storemanager.StoreManager
	:members:

:py:mod:`~enrich2.seqlib` --- Sequencing library file handling and element counting
===================================================================================

.. py:module:: seqlib
	:synopsis: Sequencing library file handling and element counting.

This module provides class definitions for the various types of sequencing library designs usable by `Enrich2 <index.html>`_. Data for each FASTQ_ file (or pair of overlapping FASTQ_ files for overlapping paired-end data) is read into its own :py:class:`~enrich2.seqlib.SeqLib` object. If necessary, FASTQ_ files should be split by index read before being read by a :py:class:`~enrich2.seqlib.SeqLib` object. :py:class:`~enrich2.seqlib.SeqLib` objects are coordinated by :py:mod:`~enrich2.selection.Selection` objects.

:py:class:`~enrich2.seqlib.SeqLib` and :py:class:`~enrich2.variant.VariantSeqLib` are abstract classes.

:py:class:`~enrich2.seqlib.SeqLib` class
-------------------------------------------------------
.. autoclass:: enrich2.seqlib.SeqLib
	:members:

:py:class:`~enrich2.variant.VariantSeqLib` class
-------------------------------------------------------
.. autoclass:: enrich2.variant.VariantSeqLib
	:members:

:py:class:`~enrich2.barcode.BarcodeSeqLib` class
-------------------------------------------------------
.. autoclass:: enrich2.barcode.BarcodeSeqLib
	:members:

:py:class:`~enrich2.barcodevariant.BcvSeqLib` class
-------------------------------------------------------------
.. autoclass:: enrich2.barcodevariant.BcvSeqLib
	:members:

:py:class:`~enrich2.barcodeid.BcidSeqLib` class
-------------------------------------------------------------
.. autoclass:: enrich2.barcodeid.BcidSeqLib
	:members:

:py:class:`~enrich2.basic.BasicSeqLib` class
-----------------------------------------------------
.. autoclass:: enrich2.basic.BasicSeqLib
	:members:

:py:class:`~enrich2.overlap.OverlapSeqLib` class
--------------------------------------------------------
.. autoclass:: enrich2.overlap.OverlapSeqLib
	:members:

:py:class:`~enrich2.idonly.IdOnlySeqLib` class
-------------------------------------------------------------
.. autoclass:: enrich2.idonly.IdOnlySeqLib
	:members:

:py:class:`~enrich2.seqlib.SeqLib` helper classes
-------------------------------------------------------

:py:class:`~enrich2.aligner.Aligner` class
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
.. autoclass:: enrich2.aligner.Aligner
	:members:

:py:class:`~enrich2.wildtype.WildTypeSequence` class
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
.. autoclass:: enrich2.wildtype.WildTypeSequence
	:members:

:py:class:`~enrich2.barcodemap.BarcodeMap` class
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
.. autoclass:: enrich2.barcodemap.BarcodeMap
	:members:

:py:mod:`~enrich2.selection` --- Functional score calculation using SeqLib count data
=====================================================================================

.. py:module:: selection
	:synopsis: Functional score calculation using :py:class:`~enrich2.seqlib.SeqLib` count data.

This module provides class definitions for the :py:class:`~enrich2.selection.Selection` class. This is where functional scores are calculated from the :py:class:`~enrich2.seqlib.SeqLib` count data. For time series data, each time point in the selection can have multiple :py:class:`~enrich2.seqlib.SeqLib` assigned to it, in which case the counts for each element will be added together. Each time series selection must have a time point 0 (the "input library").

:py:class:`~enrich2.selection.Selection` class
----------------------------------------------------------
.. autoclass:: enrich2.selection.Selection
	:members:

:py:class:`~enrich2.selection.Selection` helpers
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
.. autofunction:: enrich2.selection.regression_apply

:py:mod:`~enrich2.condition` --- Dummy class for GUI
=======================================================================

.. py:module:: condition
	:synopsis: Dummy class for GUI.

This module provides class definitions for the :py:class:`~enrich2.experiment.condition.Condition` classes. This class is required for proper GUI operation. All condition-related behaviors are in the :py:class:`~enrich2.experiment.Experiment` class.

:py:class:`~enrich2.condition.Condition` class
-----------------------------------------------------------
.. autoclass:: enrich2.condition.Condition
	:members:

:py:mod:`~enrich2.experiment` --- Aggregation of replicate selections
=======================================================================

.. py:module:: experiment
	:synopsis: Aggregation of replicate selections.

This module provides class definitions for the :py:class:`~enrich2.experiment.Experiment`. Functional scores for selections within the same condition are combined to generate a single functional score (and associated error) for each element in each experimental condition.

:py:class:`~enrich2.experiment.Experiment` class
--------------------------------------------------------------
.. autoclass:: enrich2.experiment.Experiment
	:members:

Enrich2 plotting
===================================================================

.. py:module:: plots
	:synopsis: Library for general Enrich2 plotting.

Text goes here.

.. automodule:: enrich2.plots
	:members:

Sequence-function map plotting
--------------------------------------------------------------------

.. py:module:: sfmap
	:synopsis: Library for sequence-function map plotting.

Text goes here.

.. automodule:: enrich2.sfmap
	:members:

Utility functions
====================================================================

Configuration object type detection
---------------------------------------------------------------------------

.. automodule:: enrich2.config_check
	:members:

Dataframe and index helper functions
----------------------------------------------------------------------------

.. automodule:: enrich2.dataframe
	:members:

.. _api-variant-helper:

Variant helper functions
----------------------------------------------------------------------------

.. automodule:: enrich2.variant
	:members: mutation_count, has_indel, has_unresolvable, protein_variant

HGVS_ variant regular expressions
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

.. autodata:: enrich2.variant.re_protein

.. autodata:: enrich2.variant.re_coding

.. autodata:: enrich2.variant.re_noncoding

Enrich2 entry points
====================================================================

.. automodule:: enrich2.main
	:members:


text:
//*******************************
//EVENT CALLBACKS
//*******************************

//rotate Function
function doRotate(rx,ry){//dom - no reference to current camera position in this function! i think this is part of the problem. function relies on mouse position being right?

	theta = - ( ( rx - onMouseDownPosition.x ) * 0.5 ) + onMouseDownTheta;
	theta = Math.min( 120, Math.max( -120, theta ) );
	phi = ( ( ry - onMouseDownPosition.y ) * 0.5 ) + onMouseDownPhi;
	phi = Math.min( 90, Math.max( -90, phi ) );

	cameraPosition(theta,phi,radius);
}

function onDocumentMouseMove(event) {
    //mouseX = ( event.clientX - windowHalfX );
    //mouseY = ( event.clientY - windowHalfY );

    mouseX = ( event.clientX - windowHalfX );
	mouseY = ( event.clientY - windowHalfY );

}

function onDocumentTouchStart( event ) {

	if ( event.touches.length === 1 ) {

		event.preventDefault();

		mouseXOnMouseDown = event.touches[ 0 ].pageX - windowHalfX;
		targetRotationOnMouseDown = targetRotation;

	}

}

function onDocumentTouchMove( event ) {

	if ( event.touches.length === 1 ) {

		event.preventDefault();

		mouseX = event.touches[ 0 ].pageX - windowHalfX;
		targetRotation = targetRotationOnMouseDown + ( mouseX - mouseXOnMouseDown ) * 0.05;

	}

}

function onDocumentMouseScroll(event) {
    var delta = 0;
        if (!event) /* For IE. */
                event = window.event;
        if (event.wheelDelta) { /* IE/Opera. */
                delta = event.wheelDelta/120;
        } else if (event.detail) { /** Mozilla case. */
                /** In Mozilla, sign of delta is different than in IE.
                 * Also, delta is multiple of 3.
                 */
                delta = -event.detail/3;
        }
        if (delta)
                handle(delta);
        if (event.preventDefault)
                event.preventDefault();
	event.returnValue = false;
}

function handle(delta) {
        if (delta < 0){
            //out
            if(radius < bbox*20){
                radius += bbox/2;
                cameraPosition(theta,phi,radius);
            }
        }
        else{
            //in
            if(radius > bbox*2){
                radius -= bbox/2;
                cameraPosition(theta,phi,radius);
            }
        }
}

/*

//mouseMove Callback
function onDocumentMouseMove(event) {

	//Handle Left Mouse as Rotate
	if (isMouseDown == true && mouseType== "left" ){

		lastFrameX = currentX;
		lastFrameY = currentY;
		currentX = event.clientX;
		currentY = event.clientY;

		doRotate(currentX,currentY);
	}

	//Handle Right Mouse as Zoom
	if(isMouseDown == true && mouseType== "right" ){
		currentX = event.clientX;
		currentY = event.clientY;

		radius =  ( ( event.clientY - onMouseDownPosition.y ) * (bbox/442) ) + onMouseDownRadius;
		radius = Math.min( (bbox*5), Math.max( (bbox/2), radius ) );
		cameraPosition(theta,phi,radius);
	}

	//Handle Middle Mouse as Pan
	if(isMouseDown == true && mouseType== "middle" ){
		currentX = event.clientX;
		currentY = event.clientY;

		dX = ((event.clientX - lastFrameX)*(bbox/600));
		dY = ((event.clientY - lastFrameY)*(bbox/600));
		dY = -dY;

		camXDelta = camXVector.clone()
		camXDelta.multiplyScalar(dX)

		camYDelta = camYVector.clone()
		camYDelta.multiplyScalar(dY)

		vectorTemp.add(camXDelta , camYDelta);

		camera.target.position.x -= vectorTemp.x;
		camera.target.position.y -= vectorTemp.y;
		camera.target.position.z -= vectorTemp.z;

		camera.position.x -= vectorTemp.x;
		camera.position.y -= vectorTemp.y;
		camera.position.z -= vectorTemp.z;

		//log("cam"+camera.position.toString() + "    target" + camera.target.position.toString());

		camera.updateMatrix();

		lastFrameX = currentX;
		lastFrameY = currentY;
	}

}

//mouseDown Callback
function onDocumentMouseDown(event) {

	isMouseDown = true;
	onMouseDownTheta = theta;
	onMouseDownPhi = phi;
	onMouseDownRadius = radius;

	onMouseDownPosition.x = event.clientX;
	onMouseDownPosition.y = event.clientY;

	doDecay=false;
	lastFrameX = currentX;//these 2 lines needed to be here! on click down, reset your mouse position, not just when dragging!
	lastFrameY = currentY;

	camNormalVector = camera.position.clone();
	camNormalVector = camNormalVector.normalize()

	camXVector.x = Math.cos( theta * Math.PI / 180);
	camXVector.y = 0;
	camXVector.z = Math.sin( theta * Math.PI / 180  + Math.PI);

	camYVector.cross(camNormalVector,camXVector);

	//Left - make sure there is nothing else pressed
	if (event.button == 0){
		mouseType = "left";
	}
	//Middle
	if (event.button == 1){
		mouseType = "middle";
	}
	//Right
	if (event.button == 2){
		mouseType = "right";
	}
}

//mouseUp Callback
function onDocumentMouseUp(event) {
	//letting go of any mouse lets go of all
	isMouseDown = false;

	doDecay=true;

	escapeVelocity.x = mouseVelocityX;
	escapeVelocity.y = mouseVelocityY;

	if( escapeVelocity.x == 0 && escapeVelocity.y == 0){//this if statement too, it keeps decay from ever happening if mouse hasnt moved, and resets last frame coords.
		doDecay = false;
		lastFrameX = currentX;
		lastFrameY = currentY;
	}

	tempX = currentX;
	tempY = currentY;

	decayVelocity = escapeVelocity.clone();
	decayTime = 0;

}

*/

//Reset Click Handling
function toggleReset() {
	//log("ResetView");
	radius = bbox * 2;

	a = (- (onMouseDownTheta *-2 )+ onMouseDownPosition.x);
	b = - (onMouseDownPhi *2 )+ onMouseDownPosition.y;

	doRotate(a,b);

	//dom and greg suck at math and logixxx too
	//theta = - ( ( rx - onMouseDownPosition.x ) * 0.5 ) + onMouseDownTheta;
	//phi = ( ( ry - onMouseDownPosition.y ) * 0.5 ) + onMouseDownPhi;
	//cameraPosition (0,0,radius)
}

//click Shader Handling
function toggleChangeShader() {

	shaderNum = shaderNum +1;
	if (shaderNum == 3){
		shaderNum = 0;
	}

	if (shaderNum == 0){
		//log("Shader 0: Texture Only  Default");
		scene.removeLight( directionalLightLeft );
		scene.removeLight( directionalLightRight );
		mesh.materials[0] = myMaterials[0].material;
	}

	if (shaderNum == 8){
		//log("Shader 1: Texture plus 3d Lights");
		mesh.materials[0] = myMaterials[0].material;
		scene.addLight( directionalLightLeft );
		scene.addLight( directionalLightRight );

	}

	if (shaderNum == 1){
		//log("Shader 2: Wire");
		scene.addLight( directionalLightLeft );
		scene.addLight( directionalLightRight );
		mesh.materials[0] = myMaterials[1].material;
	}

	if (shaderNum == 2){
		//log("Shader 3: Smooth");
		mesh.materials[0] = myMaterials[2].material;
	}
}

//click enable AutoZoom algorithm
function toggleAutoZoom() {
	//log("AutoZoom");
}

//click moveScale
function toggleMoveScale() {
	//log("MoveScale");
}

//click Toggle AutoRotate
function toggleAutoRotate() {
	//log("AutoRotate");
	if (autoRotateEnabled == true){
		autoRotateEnabled = false;
		mesh.rotation.y = 0;
		doDecay=false;
	}
	else{
		autoRotateEnabled = true;
	}
}

//click moveScale
function toggleTextureViewer() {
	//log("Texture Viewer");
}

//click moveScale
function toggleScreenshot() {
	//log("Screenshot");
}

redpajama_set_name: RedPajamaGithub


text:
namespace app { namespace Uno { struct Float2; } }
namespace app { namespace Uno { struct Float3; } }
namespace app { namespace Uno { struct Float4x4; } }

namespace app {
namespace Fuse {

::uInterfaceType* IFrustum__typeof();

struct IFrustum
{
    ::app::Uno::Float2(*__fp_GetDepthRange)(void*, ::uObject*);
    ::app::Uno::Float4x4(*__fp_GetProjectionTransform)(void*, ::uObject*);
    ::app::Uno::Float4x4(*__fp_GetProjectionTransformInverse)(void*, ::uObject*);
    ::app::Uno::Float4x4(*__fp_GetViewTransform)(void*, ::uObject*);
    ::app::Uno::Float4x4(*__fp_GetViewTransformInverse)(void*, ::uObject*);
    ::app::Uno::Float3(*__fp_GetWorldPosition)(void*, ::uObject*);

    static ::app::Uno::Float2 GetDepthRange(::uObject* __this, ::uObject* viewport);
    static ::app::Uno::Float4x4 GetProjectionTransform(::uObject* __this, ::uObject* viewport);
    static ::app::Uno::Float4x4 GetProjectionTransformInverse(::uObject* __this, ::uObject* viewport);
    static ::app::Uno::Float4x4 GetViewTransform(::uObject* __this, ::uObject* viewport);
    static ::app::Uno::Float4x4 GetViewTransformInverse(::uObject* __this, ::uObject* viewport);
    static ::app::Uno::Float3 GetWorldPosition(::uObject* __this, ::uObject* viewport);
};

}}

#include <app/Uno.Float2.h>
#include <app/Uno.Float3.h>
#include <app/Uno.Float4x4.h>

namespace app {
namespace Fuse {

inline ::app::Uno::Float2 IFrustum::GetDepthRange(::uObject* __this, ::uObject* viewport) { return ((IFrustum*)uGetInterfacePtr(__this, IFrustum__typeof()))->__fp_GetDepthRange((::uByte*)__this + (__this->__obj_type->TypeType == uTypeTypeStruct ? sizeof(::uObject) : 0), viewport); }
inline ::app::Uno::Float4x4 IFrustum::GetProjectionTransform(::uObject* __this, ::uObject* viewport) { return ((IFrustum*)uGetInterfacePtr(__this, IFrustum__typeof()))->__fp_GetProjectionTransform((::uByte*)__this + (__this->__obj_type->TypeType == uTypeTypeStruct ? sizeof(::uObject) : 0), viewport); }
inline ::app::Uno::Float4x4 IFrustum::GetProjectionTransformInverse(::uObject* __this, ::uObject* viewport) { return ((IFrustum*)uGetInterfacePtr(__this, IFrustum__typeof()))->__fp_GetProjectionTransformInverse((::uByte*)__this + (__this->__obj_type->TypeType == uTypeTypeStruct ? sizeof(::uObject) : 0), viewport); }
inline ::app::Uno::Float4x4 IFrustum::GetViewTransform(::uObject* __this, ::uObject* viewport) { return ((IFrustum*)uGetInterfacePtr(__this, IFrustum__typeof()))->__fp_GetViewTransform((::uByte*)__this + (__this->__obj_type->TypeType == uTypeTypeStruct ? sizeof(::uObject) : 0), viewport); }
inline ::app::Uno::Float4x4 IFrustum::GetViewTransformInverse(::uObject* __this, ::uObject* viewport) { return ((IFrustum*)uGetInterfacePtr(__this, IFrustum__typeof()))->__fp_GetViewTransformInverse((::uByte*)__this + (__this->__obj_type->TypeType == uTypeTypeStruct ? sizeof(::uObject) : 0), viewport); }
inline ::app::Uno::Float3 IFrustum::GetWorldPosition(::uObject* __this, ::uObject* viewport) { return ((IFrustum*)uGetInterfacePtr(__this, IFrustum__typeof()))->__fp_GetWorldPosition((::uByte*)__this + (__this->__obj_type->TypeType == uTypeTypeStruct ? sizeof(::uObject) : 0), viewport); }

}}

#endif


text:
package com.intellij.history.core;

import com.intellij.util.io.PagePool;
import com.intellij.util.io.storage.AbstractRecordsTable;
import org.jetbrains.annotations.NotNull;

import java.io.IOException;
import java.nio.file.Path;

public final class LocalHistoryRecordsTable extends AbstractRecordsTable {
  private static final int VERSION = 4;

  private static final int LAST_ID_OFFSET = DEFAULT_HEADER_SIZE;
  private static final int FIRST_RECORD_OFFSET = LAST_ID_OFFSET + 8;
  private static final int LAST_RECORD_OFFSET = FIRST_RECORD_OFFSET + 4;
  private static final int FS_TIMESTAMP_OFFSET = LAST_RECORD_OFFSET + 4;
  private static final int HEADER_SIZE = FS_TIMESTAMP_OFFSET + 8;

  private static final int PREV_RECORD_OFFSET = DEFAULT_RECORD_SIZE;
  private static final int NEXT_RECORD_OFFSET = PREV_RECORD_OFFSET + 4;
  private static final int TIMESTAMP_OFFSET = NEXT_RECORD_OFFSET + 4;
  private static final int RECORD_SIZE = TIMESTAMP_OFFSET + 8;

  private static final byte[] ZEROS = new byte[RECORD_SIZE];

  public LocalHistoryRecordsTable(@NotNull Path storageFilePath, @NotNull PagePool pool) throws IOException {
    super(storageFilePath, pool);
  }

  @Override
  protected int getHeaderSize() {
    return HEADER_SIZE;
  }

  @Override
  protected int getRecordSize() {
    return RECORD_SIZE;
  }

  @Override
  protected int getImplVersion() {
    return VERSION;
  }

  @Override
  protected byte[] getZeros() {
    return ZEROS;
  }

  public long getLastId() {
    return myStorage.getLong(LAST_ID_OFFSET);
  }

  public void setLastId(long lastId) {
    markDirty();
    myStorage.putLong(LAST_ID_OFFSET, lastId);
  }

  public void setFirstRecord(int record) {
    markDirty();
    myStorage.putInt(FIRST_RECORD_OFFSET, record);
  }

  public int getFirstRecord() {
    return myStorage.getInt(FIRST_RECORD_OFFSET);
  }

  public void setLastRecord(int record) {
    markDirty();
    myStorage.putInt(LAST_RECORD_OFFSET, record);
  }

  public int getLastRecord() {
    return myStorage.getInt(LAST_RECORD_OFFSET);
  }

  public void setFSTimestamp(long timestamp) {
    markDirty();
    myStorage.putLong(FS_TIMESTAMP_OFFSET, timestamp);
  }

  public long getFSTimestamp() {
    return myStorage.getLong(FS_TIMESTAMP_OFFSET);
  }

  public void setPrevRecord(int record, int prevRecord) {
    markDirty();
    myStorage.putInt(getOffset(record, PREV_RECORD_OFFSET), prevRecord);
  }

  public int getPrevRecord(int record) {
    return myStorage.getInt(getOffset(record, PREV_RECORD_OFFSET));
  }

  public void setNextRecord(int record, int nextRecord) {
    markDirty();
    myStorage.putInt(getOffset(record, NEXT_RECORD_OFFSET), nextRecord);
  }

  public int getNextRecord(int record) {
    return myStorage.getInt(getOffset(record, NEXT_RECORD_OFFSET));
  }

  public void setTimestamp(int record, long timestamp) {
    markDirty();
    myStorage.putLong(getOffset(record, TIMESTAMP_OFFSET), timestamp);
  }

  public long getTimestamp(int record) {
    return myStorage.getLong(getOffset(record, TIMESTAMP_OFFSET));
  }
}


text:
#import <OCExpectations/NSObject+OCExpectations.h>
#import <OCExpectations/NSObject+OCSpecMatchers.h>
#import <OCExpectations/OCSpecMatcher.h>
#import <OCExpectations/OCSpecBaseMatcher.h>
#import <OCExpectations/OCSpecTrueMatcher.h>
#import <OCExpectations/OCSpecFalseMatcher.h>
#import <OCExpectations/OCSpecNullMatcher.h>
#import <OCExpectations/OCSpecBeAnInstanceOfMatcher.h>
#import <OCExpectations/OCSpecBeAKindOfMatcher.h>
#import <OCExpectations/OCSpecBeWithinMatcher.h>
#import <OCExpectations/OCSpecEqualMatcher.h>
#import <OCExpectations/OCSpecEqlMatcher.h>
#import <OCExpectations/OCSpecIncludeMatcher.h>
#import <OCExpectations/OCSpecCompareSameMatcher.h>
#import <OCExpectations/OCSpecCompareAscendingMatcher.h>
#import <OCExpectations/OCSpecCompareDescendingMatcher.h>
#import <OCExpectations/OCPositiveExpectationHandler.h>
#import <OCExpectations/OCNegativeExpectationHandler.h>
#import <OCExpectations/OCSpecHelpers.h>
#import <OCExpectations/OCExceptions.h>
#import <OCExpectations/NSArray+OCIndexedSubscript.h>
#import <OCExpectations/OCRecursiveEnumeration.h>
#import <OCExpectations/Versioning.h>


text:
/* You can write here you own css styles. */
/* They will be used prior to all other styles */

.your_example_style{
    color:orangered;
    font-size:12px;
}


text:
'''
'''
from __future__ import absolute_import
from __future__ import with_statement
import logging
import threading
from . import os_helper
if os_helper.isJython():
    from com.ziclix.python.sql import zxJDBC
else:
    from ..site_packages import pypyodbc
from . import conf

# connection=None  # use global connection object to keep connection
threadVar = threading.local()  # thread local variable to keep connection

def closeConnection_jdbc():
    logger = logging.getLogger(__name__)
    #global connection
    try:
        _ = threadVar.connection
    except:
        threadVar.connection = None

    if (threadVar.connection is not None) and (threadVar.connection.closed == False):
        threadVar.connection.close()
        logger.info("Disconnect tera database.")
        threadVar.connection = None

def closeConnection_odbc():
    logger = logging.getLogger(__name__)
    #global connection
    try:
        _ = threadVar.connection
    except:
        threadVar.connection = None

    if (threadVar.connection is not None) and (threadVar.connection.connected):
        threadVar.connection.close()
        logger.info("Disconnect Teradata database.")
        threadVar.connection = None

def openConnection_jdbc():
    logger = logging.getLogger(__name__)
    #global connection
    try:
        _ = threadVar.connection
    except:
        threadVar.connection = None

    if threadVar.connection is None:
        logger.info('To get database Teradata connection')
        threadVar.connection = zxJDBC.connect(conf.tera_url_jdbc, conf.tera_uid_jdbc, conf.tera_pwd_jdbc, conf.tera_driver_jdbc)
        logger.info('Teradata connection: %s', (threadVar.connection,))
    return threadVar.connection

def openConnection_odbc():
    logger = logging.getLogger(__name__)
    #global connection
    try:
        _ = threadVar.connection
    except:
        threadVar.connection = None

    if threadVar.connection is None:
        logger.info('To get database Teradata connection')
        threadVar.connection = pypyodbc.connect(conf.tera_url_odbc)
        logger.info('Teradata connection: %s', (threadVar.connection,))
    return threadVar.connection

if os_helper.isJython():
    openConnection = openConnection_jdbc
    closeConnection = closeConnection_jdbc
else:
    openConnection = openConnection_odbc
    closeConnection = closeConnection_odbc


text:
// Load modules

var Fs = require('fs');
var Path = require('path');
var Boom = require('boom');
var Hoek = require('hoek');
var Items = require('items');
var Joi = require('joi');
var File = require('./file');

// Declare internals

var internals = {};

internals.schema = Joi.object({
    path: Joi.alternatives(Joi.array().items(Joi.string()).single(), Joi.func()).required(),
    index: Joi.alternatives(Joi.boolean(), Joi.array().items(Joi.string()).single()).default(true),
    listing: Joi.boolean(),
    showHidden: Joi.boolean(),
    redirectToSlash: Joi.boolean(),
    lookupCompressed: Joi.boolean(),
    defaultExtension: Joi.string().alphanum()
});

exports.handler = function (route, options) {

    Joi.assert(options, internals.schema, 'Invalid directory handler options (' + route.path + ')');
    Hoek.assert(route.path[route.path.length - 1] === '}', 'The route path must end with a parameter:', route.path);

    var settings = Joi.validate(options, internals.schema).value;

    var normalize = function (paths) {

        var normalized = [];
        for (var i = 0, il = paths.length; i < il; ++i) {
            var path = paths[i];

            if (!Hoek.isAbsolutePath(path)) {
                path = Path.join(route.settings.files.relativeTo, path);
            }

            normalized.push(path);
        }

        return normalized;
    };

    var normalized = (Array.isArray(settings.path) ? normalize(settings.path) : []);            // Array or function

    var indexNames = (settings.index === true) ? ['index.html'] : (settings.index || []);

    // Declare handler

    var handler = function (request, reply) {

        var paths = normalized;
        if (typeof settings.path === 'function') {
            var result = settings.path.call(null, request);
            if (result instanceof Error) {
                return reply(result);
            }

            if (Array.isArray(result)) {
                paths = normalize(result);
            }
            else if (typeof result === 'string') {
                paths = normalize([result]);
            }
            else {
                return reply(Boom.badImplementation('Invalid path function'));
            }
        }

        // Append parameter

        var selection = null;
        var lastParam = request.paramsArray[request.paramsArray.length - 1];
        if (lastParam) {
            if (lastParam.indexOf('..') !== -1) {
                return reply(Boom.forbidden());
            }

            selection = lastParam;
        }

        if (selection &&
            !settings.showHidden &&
            internals.isFileHidden(selection)) {

            return reply(Boom.notFound());
        }

        // Generate response

        var resource = request.path;
        var hasTrailingSlash = (resource[resource.length - 1] === '/');

        Items.serial(paths, function (path, nextPath) {

            path = Path.join(path, selection || '');

            File.load(path, request, { lookupCompressed: settings.lookupCompressed }, function (response) {

                // File loaded successfully

                if (!response.isBoom) {
                    return reply(response);
                }

                // Not found

                var err = response;
                if (err.output.statusCode === 404) {
                    if (!settings.defaultExtension) {
                        return nextPath();
                    }

                    if (hasTrailingSlash) {
                        path = path.slice(0, -1);
                    }

                    return File.load(path + '.' + settings.defaultExtension, request, { lookupCompressed: settings.lookupCompressed }, function (extResponse) {

                        if (!extResponse.isBoom) {
                            return reply(extResponse);
                        }

                        return nextPath();
                    });
                }

                // Propagate non-directory errors

                if (err.output.statusCode !== 403 || err.data !== 'EISDIR') {
                    return reply(err);
                }

                // Directory

                if (indexNames.length === 0 &&
                    !settings.listing) {

                    return reply(Boom.forbidden());
                }

                if (settings.redirectToSlash !== false &&                       // Defaults to true
                    !request.connection.settings.router.stripTrailingSlash &&
                    !hasTrailingSlash) {

                    return reply.redirect(resource + '/');
                }

                Items.serial(indexNames, function (indexName, nextIndex) {

                    var indexFile = Path.join(path, indexName);
                    File.load(indexFile, request, { lookupCompressed: settings.lookupCompressed }, function (indexResponse) {

                        // File loaded successfully

                        if (!indexResponse.isBoom) {
                            return reply(indexResponse);
                        }

                        // Directory

                        var err = indexResponse;
                        if (err.output.statusCode !== 404) {
                            return reply(Boom.badImplementation(indexName + ' is a directory'));
                        }

                        // Not found, try the next one

                        return nextIndex();
                    });
                },
                function (/* err */) {

                    // None of the index files were found

                    if (!settings.listing) {
                        return reply(Boom.forbidden());
                    }

                    return internals.generateListing(path, resource, selection, hasTrailingSlash, settings, request, reply);
                });
            });
        },
        function (/* err */) {

            return reply(Boom.notFound());
        });
    };

    return handler;
};

internals.generateListing = function (path, resource, selection, hasTrailingSlash, settings, request, reply) {

    Fs.readdir(path, function (err, files) {

        if (err) {
            return reply(Boom.internal('Error accessing directory', err));
        }

        resource = decodeURIComponent(resource);
        var display = Hoek.escapeHtml(resource);
        var html = '<title>' + display + '</title>
Directory: ' + display + '

';

        if (selection) {
            var parent = resource.substring(0, resource.lastIndexOf('/', resource.length - (hasTrailingSlash ? 2 : 1))) + '/';
            html += '
Parent Directory
';
        }

        for (var i = 0, il = files.length; i < il; ++i) {
            if (settings.showHidden ||
                !internals.isFileHidden(files[i])) {

                html += '
' + Hoek.escapeHtml(files[i]) + '
';
            }
        }

        html += '
';

        return reply(request.generateResponse(html));
    });
};

internals.isFileHidden = function (path) {

    return /(^|[\\\/])\.([^\\\/]|[\\\/]?$)/.test(path);           // Starts with a '.' or contains '/.' or '\.', and not followed by a '/' or '\' or end
};

internals.pathEncode = function (path) {

    return encodeURIComponent(path).replace(/%2F/g, '/').replace(/%5C/g, '\\');
};


text:
import { expect } from '@playwright/test';
import { JupyterLabPage, test } from '@jupyterlab/galata';

test.describe('page', () => {
  test('should return a JupyterLabPage', ({ page }) => {
    expect(page).toBeInstanceOf(JupyterLabPage);
  });

  test('should go to default JupyterLab URL', async ({ baseURL, page }) => {
    const baseJLabUrl = await page.getBaseUrl();

    expect(page.url().startsWith(`${baseURL}${baseJLabUrl}lab`)).toEqual(true);
  });

  test('should have playwright Page interface', async ({ page }) => {
    expect(page.waitForSelector).toBe(
      ((page as any) as JupyterLabPage).page.waitForSelector
    );
  });
});

test.describe('mockSettings', () => {
  test.use({
    mockSettings: {
      '@jupyterlab/apputils-extension:themes': {
        theme: 'JupyterLab Dark'
      }
    }
  });

  test('should return mocked settings', async ({ page }) => {
    expect(await page.theme.getTheme()).toEqual('JupyterLab Dark');
  });

  test('should not return mocked settings after save', async ({ page }) => {
    await page.click('text=Settings');
    await page.click('ul[role="menu"] >> text=Theme');
    const [response] = await Promise.all([
      page.waitForResponse(
        response =>
          /.*api\/settings\/@jupyterlab\/apputils-extension:themes/.test(
            response.url()
          ) && response.request().method() === 'GET'
      ),
      page.click('ul[role="menu"] >> text=JupyterLab Light')
    ]);

    await page.waitForSelector('#jupyterlab-splash', { state: 'detached' });
    await page.waitForSelector('div[role="main"] >> text=Launcher');

    expect(((await response.json()) as any).raw).toMatch(/JupyterLab Light/);

    expect(await page.theme.getTheme()).toEqual('JupyterLab Light');
  });
});

test.describe('mockState', () => {
  // Use non-default state to have the running session panel displayed
  test.use({
    mockState: {
      'layout-restorer:data': {
        main: {
          dock: {
            type: 'tab-area',
            currentIndex: 0,
            widgets: []
          }
        },
        down: {
          size: 0,
          widgets: []
        },
        left: {
          collapsed: false,
          visible: true,
          current: 'running-sessions',
          widgets: [
            'filebrowser',
            'jp-property-inspector',
            'running-sessions',
            '@jupyterlab/toc:plugin',
            'debugger-sidebar',
            'extensionmanager.main-view'
          ]
        },
        right: {
          collapsed: true,
          visible: true,
          widgets: []
        },
        relativeSizes: [0.4, 0.6, 0]
      }
    } as any
  });

  test('should return the mocked state', async ({ page }) => {
    expect(
      await page.waitForSelector(
        '[aria-label="Running Sessions section"] >> text=Open Tabs'
      )
    ).toBeTruthy();
  });
});

test.describe('sessions', () => {
  test('should return the active sessions', async ({ page, sessions }) => {
    await page.notebook.createNew();

    // Wait for the poll to tick
    await page.waitForResponse(
      async response =>
        response.url().includes('api/sessions') &&
        response.request().method() === 'GET' &&
        ((await response.json()) as any[]).length === 1
    );

    expect(sessions.size).toEqual(1);

    await page.menu.clickMenuItem('File>New>Console');
    await page.waitForSelector('.jp-Dialog');
    await page.click('.jp-Dialog .jp-mod-accept');
    await page.waitForSelector('text= | Idle');

    expect(sessions.size).toEqual(2);
  });

  test('should have no sessions at first', ({ sessions }) => {
    expect(sessions.size).toEqual(0);
  });
});

test.describe('terminals', () => {
  test('should return the active terminals', async ({ page, terminals }) => {
    await Promise.all([
      page.waitForResponse(
        response =>
          response.request().method() === 'POST' &&
          response.url().includes('api/terminals')
      ),
      page.menu.clickMenuItem('File>New>Terminal')
    ]);

    // Wait for the poll to tick
    await page.waitForResponse(
      async response =>
        response.url().includes('api/terminals') &&
        response.request().method() === 'GET' &&
        ((await response.json()) as any[]).length === 1
    );

    expect(terminals.size).toEqual(1);
  });

  test('should have no terminals at first', ({ terminals }) => {
    expect(terminals.size).toEqual(0);
  });
});

test.describe('tmpPath', () => {
  test('should return an unique test folder', ({ tmpPath }) => {
    expect(tmpPath).toEqual(
      'test-galata-fixture-tmpPath-should-return-an-unique-test-folder-galata'
    );
  });
});


text:
package s99.p07

import org.scalatest.FunSuite
import org.scalatest.junit.JUnitRunner
import org.junit.runner.RunWith
import P07._

@RunWith(classOf[JUnitRunner])
class P07Suite extends FunSuite {

  test("flatten on empty list returns empty list") {
    val input = List()
    val answer = input
    assert(answer === flatten(input))
  }

  test("flatten on non-list single element list returns itself") {
    val input = List(1)
    val answer = input
    assert(answer === flatten(input))
  }

  test("flatten on non-list multiple element list returns itself") {
    val input = List(1, 2, 3, 4, 5)
    val answer = input
    assert(answer === flatten(input))
  }

  test("flatten on nested list") {
    val answer = List(1, 1)
    val input = List(List(1, 1))
    assert(answer === flatten(input))
  }

  test("flatten with all kinds of list elements") {
    val answer = List(1, 1, 2, 3, 5, 8)
    val input = List(List(1, 1), 2, List(3, List(5, 8)))
    assert(answer === flatten(input))
  }

  test("flatten with strings does not flatten strings") {
    val answer = List("one", "two", "three", "four", "five")
    val input = List(List(List("one", "two"), "three"), List("four"), "five")
    assert(answer === flatten(input))
  }

  /* This test fails. See P07 for explanation.
  test("palindrome poly check of empty list is always successful") {
    val answer = List(1, 1, 2, 3, 5, 8)
    val input = List(List(1, 1), 2, List(3, List(5, 8)))
    assert(answer === flattenPolymorphic(input))
  }
  */
}


text:
Tab Writer

                     <button ng-click="writeTab($parent.$index, $index)" class = "fret" ng-repeat="x in getNumber(18) track by $index" style="background-image: url(static/img/fret.png)"></button>

                     <button class="btn btn-primary" ng-click="wait()" id="add" >Wait</button>
                     <button class="btn btn-primary" ng-click="clear()" id="add" >Clear</button>

               <textarea readonly wrap = "off" id = "tabBody"  rows = "6"  cols="21" >E |{{tab.E}}
A |{{tab.A}}
D |{{tab.D}}
G |{{tab.G}}
B |{{tab.B}}
e |{{tab.e}}</textarea>

               <button type="submit" class="btn btn-success btn-lg" data-toggle="modal" data-target="#saveModal">Save</button>
               <button type="submit" class="btn btn-modal btn-lg" data-toggle="modal" ng-click = "viewTabs()"data-target="#listModal">View Tabs</button>

                                 <button type="button" class="close" data-dismiss="modal">×</button>

Enter Tab Name

                                       Tab Name
                                       <input type="text" class="form-control" placeholder="Tab Name" id="name">

                                       <button type="submit" id = "savetab" class="btn btn-modal btn-lg" data-toggle="modal" data-dismiss="modal">Save</button>

                                 <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>

                                 <button type="button" class="close" data-dismiss="modal">×</button>

Tabs

 {{ t.name }}  <button ng-click = "openTab(t)" data-dismiss="modal" class="btn btn-view btn-lg">View</button>  <button ng-click = "deleteTab(t._id)" class="btn btn-delete btn-lg">Delete</button>

                                 <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>

About

Guitab Writer is a Graphical User Interface Tab Writer that allows users to view a virtual Fretboard, allowing
                     them to click on frets and strings so that they can build their tab for songs.

Guitab Writer was made for my Third Year Project for the Module Professional IT Skills. I used a template from a Bootstrap template.

                   Download Theme


text:
<?php
/*
Plugin Name: Datapress
Plugin URI: http://projects.csail.mit.edu/datapress
Description: Show maps, timelines, and rich data visualizations in your blog!
Version: 1.5
Author: The Haystack Group @ MIT
Author URI: http://haystack.csail.mit.edu/
*/

include_once('wp-exhibit-config.php');
include_once('wp-exhibit-admin-options.php');
include_once('wp-exhibit-activation-tools.php');
include_once('wp-exhibit-insert-exhibit.php');
include_once('wp-exhibit-save-post.php');
include_once('save-exhibit.php');
include_once('model/wp-exhibit-model.php');
include_once('proxy/insert-parrotable-url.php');
include_once('proxy/import-datafiles.php');
include_once('configurator/exhibit-configurator.php');
include_once('data-editor/template-browser.php');
include_once('data-editor/template-editor.php');
include_once('wp-exhibit-geocoder.php');
include_once('data-editor/save.php');

class WpExhibit {
 	var $wp_version;
	var $exhibit_from_admin_page;

	function WpExhibit() {
		global $wp_version;
		$this->wp_version = $wp_version;
	}

	function exhibit_admin_include() {
		include('exhibit_admin_include.php');
	}

	/*
	 * Only include if the number of posts == 1 and it has an exhibit
	 * on the page. Else just include the other stuff
	 */
	function exhibit_include() {
        include('head.php');
	}

	function get_current_exhibit_from_admin_page() {
		// Returned cached version of the exhibit, or cached NULL:
		// NULL -> we have yet to check for exhibit
		// 0    -> we checked for exhibit, it wasn't there (this is a cached NULL)
		// else -> we found the exhibit

		if (isset($this->exhibit_from_admin_page) && ($this->exhibit_from_admin_page != null) && (! is_int($this->exhibit_from_admin_page)) ) {
			return $this->exhibit_from_admin_page;
		}
		else if (isset($this->exhibit_from_admin_page) && (is_int($this->exhibit_from_admin_page)) ) {
			return NULL; // cached null
		}

		$postID = $_GET['post'];
		if ($postID != NULL) {
			// See if we know about any data sources associated with this item.
		    $ex_exhibit = WpPostExhibit::getForPost($postID);
            if ($ex_exhibit != NULL) {
				$this->exhibit_from_admin_page = $ex_exhibit;
				return $ex_exhibit;
            }
		}
		$this->exhibit_from_admin_page = 0;
		return NULL;
	}

	function add_options_page() {
		add_options_page('Datapress', 'Datapress', 8, 'datapressoptions', 'exhibit_options_page');
	}

	function edit_page_inclusions() {
		$ex = $this->get_current_exhibit_from_admin_page();
/*		if ($ex == NULL) {
			echo "<input type='hidden' id='exhibitid' name='exhibitid' value='' />";
		}
		else {
			$ex_id = $ex->get('id');
			echo "<input type='hidden' id='exhibitid' name='exhibitid' value='$ex_id' />";
		}*/
	}

	function save_post($post_id, $post) {
		SaveExhibitPost::save($post_id);
	}

	function privacy_notice() {
		if (! get_option('datapress_privacy_notice_shown')) {
 			echo "

Thank you for installing DataPress!

DataPress collects some basic statistics about its use to aid in a research project analyzing data publishing on the web. To turn off this data collection, simply visit the DataPress Settings Page.

";
			add_option('datapress_privacy_notice_shown', '1');
		}
	}

	function activate_plugin() {
        WpExhibitActivationTools::activate_plugin();
	}

	function migrate_plugin() {
        WpExhibitActivationTools::migrate();
	}

	function deactivate_plugin() {
		delete_option('datapress_privacy_notice_shown');
        WpExhibitActivationTools::deactivate_plugin();
	}

	function load_exhibit() {
		global $wp_query;
		foreach ($wp_query->posts as $apost) {
			$apost->datapress_exhibit = WpPostExhibit::getForPost($apost->ID);
		}
	}

	function insert_parrotable_url() {
        InsertParrotableUrl::insert_url();
	    die;
	}

	function save_exhibit_configuration() {
        SaveExhibitConfiguration::save();
	    die;
	}

  function make_exhibit_button() {
	$ex = $this->get_current_exhibit_from_admin_page();
	if ($ex == NULL) {
		echo "Visualization     <input type='hidden' id='exhibitid' name='exhibitid' value='' />";
	}
	else {
		$ex_id = $ex->get('id');
		echo "Visualization     <input type='hidden' id='exhibitid' name='exhibitid' value='$ex_id' />";
	}

	// Show show the type adder
    // echo "Data Item     ";
    //
    // echo "Data Set     ";

        // Context menu for data editor, and location for changing url that is to
        // be clicked if someone wants to edit data.
        echo '

Edit Data

Delete

';
    }

	function insert_exhibit($content) {
		global $wp_query;
		if ($wp_query->post->datapress_exhibit != NULL) {
		    return WpExhibitHtmlBuilder::insert_exhibit($wp_query->post->datapress_exhibit, $content);
		}
		else {
			return $content;
		}
	}

    // Add tinymce plugin for editing data
    function tinymce_editdata_plugin($plugin_array) {
        $plugin_array['dpeditdata'] = wp_guess_url() . "/wp-content/plugins/datapress/js/tinymce_editdata_plugin.js";
         return $plugin_array;
    }
    function tinymce_plugin_css($css) {
        return $css . "," . wp_guess_url() . "/wp-content/plugins/datapress/css/tinymce_editdata_plugin.css";
    }
}

$exhibit = new WpExhibit();
$exhibit->migrate_plugin();

add_action('wp_head', array($exhibit, 'exhibit_include'));
add_action('admin_head', array($exhibit, 'exhibit_admin_include'));
add_action('admin_menu', array($exhibit, 'add_options_page'));

#
# Old lozenge interface.
# add_action('edit_page_form', array($exhibit, 'edit_page_inclusions'));
# add_action('edit_form_advanced', array($exhibit, 'edit_page_inclusions'));
#

add_action('wp', array($exhibit, 'load_exhibit'));
add_action('wp_ajax_insert_parrotable_url', array($exhibit, 'insert_parrotable_url') );
add_action('wp_ajax_save_exhibit_configuration', array($exhibit, 'save_exhibit_configuration') );
add_action('wp_ajax_save_data_template', 'save_data_template' );
add_action('wp_ajax_datapress_configurator', 'show_datapress_configurator' );
add_action('wp_ajax_template_picker', 'show_datapress_template_browser' );
add_action('wp_ajax_template_editor', 'show_datapress_template_editor' );
add_action('wp_ajax_import_datafiles', 'import_data_files' );
add_action('media_buttons', array($exhibit, 'make_exhibit_button'));
add_filter('the_content', array($exhibit, 'insert_exhibit'));
add_action('edit_page_form', array($exhibit, 'edit_page_inclusions'));
add_action('edit_form_advanced', array($exhibit, 'edit_page_inclusions'));
add_action('admin_notices', array($exhibit, 'privacy_notice'));
add_filter('save_post', array($exhibit, 'save_post'), 10, 2);
add_filter("mce_external_plugins", array($exhibit, 'tinymce_editdata_plugin'));
add_filter("mce_css", array($exhibit, "tinymce_plugin_css"));

register_activation_hook(__FILE__, array($exhibit, 'activate_plugin'));
register_deactivation_hook(__FILE__, array($exhibit, 'deactivate_plugin'));

/* ---------------------------------------------------------------------------
 * JavaScript Registration
 * --------------------------------------------------------------------------- */

if (!$guessurl = site_url())
	$guessurl = wp_guess_url();
$baseuri = $guessurl;
$wp_datapress_plugin_url = trailingslashit( get_bloginfo('wpurl') ).PLUGINDIR.'/datapress';

wp_register_script( 'exhibit-api', 'http://projects.csail.mit.edu/datapress/exhibit-files/exhibit-api/exhibit-api.js', array(  ) );
wp_register_script( 'exhibit-chart', 'http://projects.csail.mit.edu/datapress/exhibit-files/exhibit-api/extensions/chart/chart-extension.js', array( 'exhibit-api' ) );
wp_register_script( 'exhibit-time', 'http://projects.csail.mit.edu/datapress/exhibit-files/exhibit-api/extensions/time/time-extension.js', array( 'exhibit-api' ) );

wp_register_script( 'dp-jquery', "$wp_datapress_plugin_url/js/jquery-1.3.2.min.js", array() );
wp_register_script( 'dp-jquery-ui', "$wp_datapress_plugin_url/js/jquery-ui-1.7.3.custom.min.js", array('dp-jquery') );
wp_register_script( 'dp-mce', "$wp_datapress_plugin_url/tinymce/jquery.tinymce.js", array('dp-jquery') );

wp_register_script( 'base64', "$wp_datapress_plugin_url/js/jquery.base64.js", array() );
wp_register_script( 'configurator', "$wp_datapress_plugin_url/configurator/configurator.js.php");

function datapress_ScriptsAction() {
    if (is_admin()) {
        wp_enqueue_script('jquery');
        wp_enqueue_script('wp_datapress_test_script', $wp_datapress_plugin_url.'/TEST.js', array('jquery'));
    }
}

/* ---------------------------------------------------------------------------
 * Stylesheet Registration
 * --------------------------------------------------------------------------- */

wp_register_style( 'dp-configurator', "$wp_datapress_plugin_url/css/wpexhibit.css");
wp_register_style( 'dp-jquery', "$wp_datapress_plugin_url/js/jQueryUI1.7.3/smoothness/jquery-ui-1.7.3.custom.css");
wp_register_style( 'dp-template', "$wp_datapress_plugin_url/css/template.css");

include_once('facet_widget.php');
?>


text:
"""This module contains the general information for CommVMedia ManagedObject."""

from ...imcmo import ManagedObject
from ...imccoremeta import MoPropertyMeta, MoMeta
from ...imcmeta import VersionMeta

class CommVMediaConsts:
    ADMIN_ACTION_DELETE_ALL_SAVED_MAPPINGS = "delete-all-saved-mappings"

class CommVMedia(ManagedObject):
    """This is CommVMedia class."""

    consts = CommVMediaConsts()
    naming_props = set([])

    mo_meta = {
        "classic": MoMeta("CommVMedia", "commVMedia", "vmedia-svc", VersionMeta.Version151f, "InputOutput", 0xff, [], ["admin", "read-only", "user"], [u'commSvcEp'], [u'commSavedVMediaMap', u'commVMediaMap'], ["Get", "Set"]),
        "modular": MoMeta("CommVMedia", "commVMedia", "vmedia-svc", VersionMeta.Version2013e, "InputOutput", 0x1ff, [], ["admin", "read-only", "user"], [u'commSvcRack'], [u'commSavedVMediaMap', u'commVMediaMap'], ["Get", "Set"])
    }

    prop_meta = {

        "classic": {
            "admin_action": MoPropertyMeta("admin_action", "adminAction", "string", VersionMeta.Version301c, MoPropertyMeta.READ_WRITE, 0x2, 0, 510, None, ["delete-all-saved-mappings"], []),
            "admin_state": MoPropertyMeta("admin_state", "adminState", "string", VersionMeta.Version151f, MoPropertyMeta.READ_WRITE, 0x4, None, None, None, ["Disabled", "Enabled", "disabled", "enabled"], []),
            "dn": MoPropertyMeta("dn", "dn", "string", VersionMeta.Version151f, MoPropertyMeta.READ_WRITE, 0x8, 0, 255, None, [], []),
            "encryption_state": MoPropertyMeta("encryption_state", "encryptionState", "string", VersionMeta.Version151f, MoPropertyMeta.READ_WRITE, 0x10, None, None, None, ["Disabled", "Enabled", "disabled", "enabled"], []),
            "rn": MoPropertyMeta("rn", "rn", "string", VersionMeta.Version151f, MoPropertyMeta.READ_WRITE, 0x20, 0, 255, None, [], []),
            "status": MoPropertyMeta("status", "status", "string", VersionMeta.Version151f, MoPropertyMeta.READ_WRITE, 0x40, None, None, None, ["", "created", "deleted", "modified", "removed"], []),
            "active_sessions": MoPropertyMeta("active_sessions", "activeSessions", "string", VersionMeta.Version151f, MoPropertyMeta.READ_ONLY, None, None, None, None, [], []),
            "child_action": MoPropertyMeta("child_action", "childAction", "string", VersionMeta.Version151f, MoPropertyMeta.INTERNAL, None, None, None, None, [], []),
            "low_power_usb_state": MoPropertyMeta("low_power_usb_state", "lowPowerUsbState", "string", VersionMeta.Version208d, MoPropertyMeta.READ_WRITE, 0x80, None, None, None, ["Disabled", "Enabled", "disabled", "enabled"], []),
        },

        "modular": {
            "admin_action": MoPropertyMeta("admin_action", "adminAction", "string", VersionMeta.Version301c, MoPropertyMeta.READ_WRITE, 0x2, 0, 510, None, ["delete-all-saved-mappings"], []),
            "admin_state": MoPropertyMeta("admin_state", "adminState", "string", VersionMeta.Version2013e, MoPropertyMeta.READ_WRITE, 0x4, None, None, None, ["Disabled", "Enabled", "disabled", "enabled"], []),
            "dn": MoPropertyMeta("dn", "dn", "string", VersionMeta.Version2013e, MoPropertyMeta.READ_WRITE, 0x8, 0, 255, None, [], []),
            "encryption_state": MoPropertyMeta("encryption_state", "encryptionState", "string", VersionMeta.Version2013e, MoPropertyMeta.READ_WRITE, 0x10, None, None, None, ["Disabled", "Enabled", "disabled", "enabled"], []),
            "rn": MoPropertyMeta("rn", "rn", "string", VersionMeta.Version2013e, MoPropertyMeta.READ_WRITE, 0x20, 0, 255, None, [], []),
            "status": MoPropertyMeta("status", "status", "string", VersionMeta.Version2013e, MoPropertyMeta.READ_WRITE, 0x40, None, None, None, ["", "created", "deleted", "modified", "removed"], []),
            "active_sessions": MoPropertyMeta("active_sessions", "activeSessions", "string", VersionMeta.Version2013e, MoPropertyMeta.READ_ONLY, None, None, None, None, [], []),
            "child_action": MoPropertyMeta("child_action", "childAction", "string", VersionMeta.Version2013e, MoPropertyMeta.INTERNAL, None, None, None, None, [], []),
            "low_power_usb": MoPropertyMeta("low_power_usb", "lowPowerUsb", "string", VersionMeta.Version2013e, MoPropertyMeta.READ_WRITE, 0x80, None, None, None, ["Disabled", "Enabled", "disabled", "enabled"], []),
            "max_sessions": MoPropertyMeta("max_sessions", "maxSessions", "uint", VersionMeta.Version2013e, MoPropertyMeta.READ_WRITE, 0x100, None, None, None, [], ["1-4"]),
        },

    }

    prop_map = {

        "classic": {
            "adminAction": "admin_action",
            "adminState": "admin_state",
            "dn": "dn",
            "encryptionState": "encryption_state",
            "rn": "rn",
            "status": "status",
            "activeSessions": "active_sessions",
            "childAction": "child_action",
            "lowPowerUsbState": "low_power_usb_state",
        },

        "modular": {
            "adminAction": "admin_action",
            "adminState": "admin_state",
            "dn": "dn",
            "encryptionState": "encryption_state",
            "rn": "rn",
            "status": "status",
            "activeSessions": "active_sessions",
            "childAction": "child_action",
            "lowPowerUsb": "low_power_usb",
            "maxSessions": "max_sessions",
        },

    }

    def __init__(self, parent_mo_or_dn, **kwargs):
        self._dirty_mask = 0
        self.admin_action = None
        self.admin_state = None
        self.encryption_state = None
        self.status = None
        self.active_sessions = None
        self.child_action = None
        self.low_power_usb_state = None
        self.low_power_usb = None
        self.max_sessions = None

        ManagedObject.__init__(self, "CommVMedia", parent_mo_or_dn, **kwargs)


text:
package kieker.common.record.flow;

/**
 * @author Jan Waller
 *
 * @since 1.6
 */
public interface ICallRecord extends IOperationRecord {
	public String getCallerOperationSignature() ;

	public String getCallerClassSignature() ;

	public String getCalleeOperationSignature() ;

	public String getCalleeClassSignature() ;

}


text:
""" Cisco_IOS_XR_tty_vty_cfg

This module contains a collection of YANG definitions
for Cisco IOS\-XR tty\-vty package configuration.

This module contains definitions
for the following management objects\:
  vty\: VTY Pools configuration

Copyright (c) 2013\-2016 by Cisco Systems, Inc.
All rights reserved.

"""

import re
import collections

from enum import Enum

from ydk.types import Empty, YList, YLeafList, DELETE, Decimal64, FixedBitsDict

from ydk.errors import YPYError, YPYModelError

class Vty(object):
    """
    VTY Pools configuration

    .. attribute:: vty_pools

    	List of VTY Pools
    	**type**\:   :py:class:`VtyPools <ydk.models.cisco_ios_xr.Cisco_IOS_XR_tty_vty_cfg.Vty.VtyPools>`

    """

    _prefix = 'tty-vty-cfg'
    _revision = '2015-09-16'

    def __init__(self):
        self.vty_pools = Vty.VtyPools()
        self.vty_pools.parent = self

    class VtyPools(object):
        """
        List of VTY Pools

        .. attribute:: vty_pool

        	VTY Pool
        	**type**\: list of    :py:class:`VtyPool <ydk.models.cisco_ios_xr.Cisco_IOS_XR_tty_vty_cfg.Vty.VtyPools.VtyPool>`

        """

        _prefix = 'tty-vty-cfg'
        _revision = '2015-09-16'

        def __init__(self):
            self.parent = None
            self.vty_pool = YList()
            self.vty_pool.parent = self
            self.vty_pool.name = 'vty_pool'

        class VtyPool(object):
            """
            VTY Pool

            .. attribute:: pool_name  <key>

            	For configuring range for default pool use 'default',For configuring range for fault\-manager pool use 'fm',For configuring range for any user defined pool use any other string
            	**type**\:  str

            	**pattern:** [\\w\\\-\\.\:,\_@#%$\\+=\\\|;]+

            .. attribute:: first_vty

            	First VTY number,For default VTY use 0,For user\-defined use 5,For fault\-manager use 100
            	**type**\:  int

            	**range:** \-2147483648..2147483647

            	**mandatory**\: True

            .. attribute:: last_vty

            	Last VTY number,For default configure between 0\-99,For user\-defined configure between 5\-99 ,For fault\-manager configure between 100\-199
            	**type**\:  int

            	**range:** \-2147483648..2147483647

            	**mandatory**\: True

            .. attribute:: line_template

            	Name of line template
            	**type**\:  str

            .. attribute:: none

            	Empty Option
            	**type**\:  str

            """

            _prefix = 'tty-vty-cfg'
            _revision = '2015-09-16'

            def __init__(self):
                self.parent = None
                self.pool_name = None
                self.first_vty = None
                self.last_vty = None
                self.line_template = None
                self.none = None

            @property
            def _common_path(self):
                if self.pool_name is None:
                    raise YPYModelError('Key property pool_name is None')

                return '/Cisco-IOS-XR-tty-vty-cfg:vty/Cisco-IOS-XR-tty-vty-cfg:vty-pools/Cisco-IOS-XR-tty-vty-cfg:vty-pool[Cisco-IOS-XR-tty-vty-cfg:pool-name = ' + str(self.pool_name) + ']'

            def is_config(self):
                ''' Returns True if this instance represents config data else returns False '''
                return True

            def _has_data(self):
                if self.pool_name is not None:
                    return True

                if self.first_vty is not None:
                    return True

                if self.last_vty is not None:
                    return True

                if self.line_template is not None:
                    return True

                if self.none is not None:
                    return True

                return False

            @staticmethod
            def _meta_info():
                from ydk.models.cisco_ios_xr._meta import _Cisco_IOS_XR_tty_vty_cfg as meta
                return meta._meta_table['Vty.VtyPools.VtyPool']['meta_info']

        @property
        def _common_path(self):

            return '/Cisco-IOS-XR-tty-vty-cfg:vty/Cisco-IOS-XR-tty-vty-cfg:vty-pools'

        def is_config(self):
            ''' Returns True if this instance represents config data else returns False '''
            return True

        def _has_data(self):
            if self.vty_pool is not None:
                for child_ref in self.vty_pool:
                    if child_ref._has_data():
                        return True

            return False

        @staticmethod
        def _meta_info():
            from ydk.models.cisco_ios_xr._meta import _Cisco_IOS_XR_tty_vty_cfg as meta
            return meta._meta_table['Vty.VtyPools']['meta_info']

    @property
    def _common_path(self):

        return '/Cisco-IOS-XR-tty-vty-cfg:vty'

    def is_config(self):
        ''' Returns True if this instance represents config data else returns False '''
        return True

    def _has_data(self):
        if self.vty_pools is not None and self.vty_pools._has_data():
            return True

        return False

    @staticmethod
    def _meta_info():
        from ydk.models.cisco_ios_xr._meta import _Cisco_IOS_XR_tty_vty_cfg as meta
        return meta._meta_table['Vty']['meta_info']


text:
package cmd

import (
	"fmt"
	"strings"

	"github.com/jgsqware/clairctl/clair"
	"github.com/jgsqware/clairctl/config"
	"github.com/jgsqware/clairctl/docker"
	"github.com/jgsqware/clairctl/xstrings"
	"github.com/spf13/cobra"
	"github.com/spf13/viper"
)

var clusterReportCmd = &cobra.Command{
	Use:   "report",
	Short: "Generate Docker Images vulnerabilities report",
	Long:  `Generate Docker Images vulnerabilities report as HTML or JSON`,
	Run: func(cmd *cobra.Command, args []string) {
		images := config.ClusterImages
		for imageName := range images {
			config.ImageName = imageName
			image, manifest, err := docker.RetrieveManifest(config.ImageName, true)

			if err != nil {
				fmt.Println(errInternalError)
				log.Fatalf("retrieving manifest for %q: %v", config.ImageName, err)
			}

			analyzes := clair.Analyze(image, manifest)
			imageName := strings.Replace(analyzes.ImageName, "/", "-", -1)
			if analyzes.Tag != "" {
				imageName += "-" + analyzes.Tag
			}

			switch clair.Report.Format {
			case "html":
				html, err := clair.ReportAsHTML(analyzes)
				if err != nil {
					fmt.Println(errInternalError)
					log.Fatalf("generating HTML report: %v", err)
				}
				err = clair.SaveReport(imageName, string(html))
				if err != nil {
					fmt.Println(errInternalError)
					log.Fatalf("saving HTML report: %v", err)
				}

			case "json":
				json, err := xstrings.ToIndentJSON(analyzes)

				if err != nil {
					fmt.Println(errInternalError)
					log.Fatalf("indenting JSON: %v", err)
				}
				err = clair.SaveReport(imageName, string(json))
				if err != nil {
					fmt.Println(errInternalError)
					log.Fatalf("saving JSON report: %v", err)
				}

			default:
				fmt.Printf("Unsupported Report format: %v", clair.Report.Format)
				log.Fatalf("Unsupported Report format: %v", clair.Report.Format)
			}
			if viper.GetString("notifier.endpoint") != "" {
				clair.Notify(analyzes)
			}
		}
	},
}

func init() {
	clusterCmd.AddCommand(clusterReportCmd)
	viper.BindPFlag("clair.report.format", clusterReportCmd.Flags().Lookup("format"))
}


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Arbeiten Naturf. Vereins Riga 1:252. 1847

#### Original name
null

### Remarks
null


text:
r"""
This code was generated by
\ / _    _  _|   _  _
 | (_)\/(_)(_|\/| |(/_  v1.0.0
      /       /
"""

from twilio.base import deserialize
from twilio.base import values
from twilio.base.instance_context import InstanceContext
from twilio.base.instance_resource import InstanceResource
from twilio.base.list_resource import ListResource
from twilio.base.page import Page

class FactorList(ListResource):

    def __init__(self, version, service_sid, identity):
        """
        Initialize the FactorList

        :param Version version: Version that contains the resource
        :param service_sid: Service Sid.
        :param identity: Unique external identifier of the Entity

        :returns: twilio.rest.verify.v2.service.entity.factor.FactorList
        :rtype: twilio.rest.verify.v2.service.entity.factor.FactorList
        """
        super(FactorList, self).__init__(version)

        # Path Solution
        self._solution = {'service_sid': service_sid, 'identity': identity, }
        self._uri = '/Services/{service_sid}/Entities/{identity}/Factors'.format(**self._solution)

    def stream(self, limit=None, page_size=None):
        """
        Streams FactorInstance records from the API as a generator stream.
        This operation lazily loads records as efficiently as possible until the limit
        is reached.
        The results are returned as a generator, so this operation is memory efficient.

        :param int limit: Upper limit for the number of records to return. stream()
                          guarantees to never return more than limit.  Default is no limit
        :param int page_size: Number of records to fetch per request, when not set will use
                              the default value of 50 records.  If no page_size is defined
                              but a limit is defined, stream() will attempt to read the
                              limit with the most efficient page size, i.e. min(limit, 1000)

        :returns: Generator that will yield up to limit results
        :rtype: list[twilio.rest.verify.v2.service.entity.factor.FactorInstance]
        """
        limits = self._version.read_limits(limit, page_size)

        page = self.page(page_size=limits['page_size'], )

        return self._version.stream(page, limits['limit'])

    def list(self, limit=None, page_size=None):
        """
        Lists FactorInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param int limit: Upper limit for the number of records to return. list() guarantees
                          never to return more than limit.  Default is no limit
        :param int page_size: Number of records to fetch per request, when not set will use
                              the default value of 50 records.  If no page_size is defined
                              but a limit is defined, list() will attempt to read the limit
                              with the most efficient page size, i.e. min(limit, 1000)

        :returns: Generator that will yield up to limit results
        :rtype: list[twilio.rest.verify.v2.service.entity.factor.FactorInstance]
        """
        return list(self.stream(limit=limit, page_size=page_size, ))

    def page(self, page_token=values.unset, page_number=values.unset,
             page_size=values.unset):
        """
        Retrieve a single page of FactorInstance records from the API.
        Request is executed immediately

        :param str page_token: PageToken provided by the API
        :param int page_number: Page Number, this value is simply for client state
        :param int page_size: Number of records to return, defaults to 50

        :returns: Page of FactorInstance
        :rtype: twilio.rest.verify.v2.service.entity.factor.FactorPage
        """
        data = values.of({'PageToken': page_token, 'Page': page_number, 'PageSize': page_size, })

        response = self._version.page(method='GET', uri=self._uri, params=data, )

        return FactorPage(self._version, response, self._solution)

    def get_page(self, target_url):
        """
        Retrieve a specific page of FactorInstance records from the API.
        Request is executed immediately

        :param str target_url: API-generated URL for the requested results page

        :returns: Page of FactorInstance
        :rtype: twilio.rest.verify.v2.service.entity.factor.FactorPage
        """
        response = self._version.domain.twilio.request(
            'GET',
            target_url,
        )

        return FactorPage(self._version, response, self._solution)

    def get(self, sid):
        """
        Constructs a FactorContext

        :param sid: A string that uniquely identifies this Factor.

        :returns: twilio.rest.verify.v2.service.entity.factor.FactorContext
        :rtype: twilio.rest.verify.v2.service.entity.factor.FactorContext
        """
        return FactorContext(
            self._version,
            service_sid=self._solution['service_sid'],
            identity=self._solution['identity'],
            sid=sid,
        )

    def __call__(self, sid):
        """
        Constructs a FactorContext

        :param sid: A string that uniquely identifies this Factor.

        :returns: twilio.rest.verify.v2.service.entity.factor.FactorContext
        :rtype: twilio.rest.verify.v2.service.entity.factor.FactorContext
        """
        return FactorContext(
            self._version,
            service_sid=self._solution['service_sid'],
            identity=self._solution['identity'],
            sid=sid,
        )

    def __repr__(self):
        """
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        """
        return '<Twilio.Verify.V2.FactorList>'

class FactorPage(Page):

    def __init__(self, version, response, solution):
        """
        Initialize the FactorPage

        :param Version version: Version that contains the resource
        :param Response response: Response from the API
        :param service_sid: Service Sid.
        :param identity: Unique external identifier of the Entity

        :returns: twilio.rest.verify.v2.service.entity.factor.FactorPage
        :rtype: twilio.rest.verify.v2.service.entity.factor.FactorPage
        """
        super(FactorPage, self).__init__(version, response)

        # Path Solution
        self._solution = solution

    def get_instance(self, payload):
        """
        Build an instance of FactorInstance

        :param dict payload: Payload response from the API

        :returns: twilio.rest.verify.v2.service.entity.factor.FactorInstance
        :rtype: twilio.rest.verify.v2.service.entity.factor.FactorInstance
        """
        return FactorInstance(
            self._version,
            payload,
            service_sid=self._solution['service_sid'],
            identity=self._solution['identity'],
        )

    def __repr__(self):
        """
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        """
        return '<Twilio.Verify.V2.FactorPage>'

class FactorContext(InstanceContext):

    def __init__(self, version, service_sid, identity, sid):
        """
        Initialize the FactorContext

        :param Version version: Version that contains the resource
        :param service_sid: Service Sid.
        :param identity: Unique external identifier of the Entity
        :param sid: A string that uniquely identifies this Factor.

        :returns: twilio.rest.verify.v2.service.entity.factor.FactorContext
        :rtype: twilio.rest.verify.v2.service.entity.factor.FactorContext
        """
        super(FactorContext, self).__init__(version)

        # Path Solution
        self._solution = {'service_sid': service_sid, 'identity': identity, 'sid': sid, }
        self._uri = '/Services/{service_sid}/Entities/{identity}/Factors/{sid}'.format(**self._solution)

    def delete(self):
        """
        Deletes the FactorInstance

        :returns: True if delete succeeds, False otherwise
        :rtype: bool
        """
        return self._version.delete(method='DELETE', uri=self._uri, )

    def fetch(self):
        """
        Fetch the FactorInstance

        :returns: The fetched FactorInstance
        :rtype: twilio.rest.verify.v2.service.entity.factor.FactorInstance
        """
        payload = self._version.fetch(method='GET', uri=self._uri, )

        return FactorInstance(
            self._version,
            payload,
            service_sid=self._solution['service_sid'],
            identity=self._solution['identity'],
            sid=self._solution['sid'],
        )

    def update(self, auth_payload=values.unset, friendly_name=values.unset,
               config_notification_token=values.unset,
               config_sdk_version=values.unset, config_time_step=values.unset,
               config_skew=values.unset, config_code_length=values.unset,
               config_alg=values.unset, config_notification_platform=values.unset):
        """
        Update the FactorInstance

        :param unicode auth_payload: Optional payload to verify the Factor for the first time
        :param unicode friendly_name: The friendly name of this Factor
        :param unicode config_notification_token: For APN, the device token. For FCM, the registration token
        :param unicode config_sdk_version: The Verify Push SDK version used to configure the factor
        :param unicode config_time_step: How often, in seconds, are TOTP codes generated
        :param unicode config_skew: The number of past and future time-steps valid at a given time
        :param unicode config_code_length: Number of digits for generated TOTP codes
        :param FactorInstance.TotpAlgorithms config_alg: The algorithm used to derive the TOTP codes
        :param unicode config_notification_platform: The transport technology used to generate the Notification Token

        :returns: The updated FactorInstance
        :rtype: twilio.rest.verify.v2.service.entity.factor.FactorInstance
        """
        data = values.of({
            'AuthPayload': auth_payload,
            'FriendlyName': friendly_name,
            'Config.NotificationToken': config_notification_token,
            'Config.SdkVersion': config_sdk_version,
            'Config.TimeStep': config_time_step,
            'Config.Skew': config_skew,
            'Config.CodeLength': config_code_length,
            'Config.Alg': config_alg,
            'Config.NotificationPlatform': config_notification_platform,
        })

        payload = self._version.update(method='POST', uri=self._uri, data=data, )

        return FactorInstance(
            self._version,
            payload,
            service_sid=self._solution['service_sid'],
            identity=self._solution['identity'],
            sid=self._solution['sid'],
        )

    def __repr__(self):
        """
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        """
        context = ' '.join('{}={}'.format(k, v) for k, v in self._solution.items())
        return '<Twilio.Verify.V2.FactorContext {}>'.format(context)

class FactorInstance(InstanceResource):

    class FactorStatuses(object):
        UNVERIFIED = "unverified"
        VERIFIED = "verified"

    class FactorTypes(object):
        PUSH = "push"
        TOTP = "totp"

    class NotificationPlatforms(object):
        APN = "apn"
        FCM = "fcm"
        NONE = "none"

    class TotpAlgorithms(object):
        SHA1 = "sha1"
        SHA256 = "sha256"
        SHA512 = "sha512"

    def __init__(self, version, payload, service_sid, identity, sid=None):
        """
        Initialize the FactorInstance

        :returns: twilio.rest.verify.v2.service.entity.factor.FactorInstance
        :rtype: twilio.rest.verify.v2.service.entity.factor.FactorInstance
        """
        super(FactorInstance, self).__init__(version)

        # Marshaled Properties
        self._properties = {
            'sid': payload.get('sid'),
            'account_sid': payload.get('account_sid'),
            'service_sid': payload.get('service_sid'),
            'entity_sid': payload.get('entity_sid'),
            'identity': payload.get('identity'),
            'date_created': deserialize.iso8601_datetime(payload.get('date_created')),
            'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')),
            'friendly_name': payload.get('friendly_name'),
            'status': payload.get('status'),
            'factor_type': payload.get('factor_type'),
            'config': payload.get('config'),
            'metadata': payload.get('metadata'),
            'url': payload.get('url'),
        }

        # Context
        self._context = None
        self._solution = {
            'service_sid': service_sid,
            'identity': identity,
            'sid': sid or self._properties['sid'],
        }

    @property
    def _proxy(self):
        """
        Generate an instance context for the instance, the context is capable of
        performing various actions.  All instance actions are proxied to the context

        :returns: FactorContext for this FactorInstance
        :rtype: twilio.rest.verify.v2.service.entity.factor.FactorContext
        """
        if self._context is None:
            self._context = FactorContext(
                self._version,
                service_sid=self._solution['service_sid'],
                identity=self._solution['identity'],
                sid=self._solution['sid'],
            )
        return self._context

    @property
    def sid(self):
        """
        :returns: A string that uniquely identifies this Factor.
        :rtype: unicode
        """
        return self._properties['sid']

    @property
    def account_sid(self):
        """
        :returns: Account Sid.
        :rtype: unicode
        """
        return self._properties['account_sid']

    @property
    def service_sid(self):
        """
        :returns: Service Sid.
        :rtype: unicode
        """
        return self._properties['service_sid']

    @property
    def entity_sid(self):
        """
        :returns: Entity Sid.
        :rtype: unicode
        """
        return self._properties['entity_sid']

    @property
    def identity(self):
        """
        :returns: Unique external identifier of the Entity
        :rtype: unicode
        """
        return self._properties['identity']

    @property
    def date_created(self):
        """
        :returns: The date this Factor was created
        :rtype: datetime
        """
        return self._properties['date_created']

    @property
    def date_updated(self):
        """
        :returns: The date this Factor was updated
        :rtype: datetime
        """
        return self._properties['date_updated']

    @property
    def friendly_name(self):
        """
        :returns: A human readable description of this resource.
        :rtype: unicode
        """
        return self._properties['friendly_name']

    @property
    def status(self):
        """
        :returns: The Status of this Factor
        :rtype: FactorInstance.FactorStatuses
        """
        return self._properties['status']

    @property
    def factor_type(self):
        """
        :returns: The Type of this Factor
        :rtype: FactorInstance.FactorTypes
        """
        return self._properties['factor_type']

    @property
    def config(self):
        """
        :returns: Configurations for a `factor_type`.
        :rtype: dict
        """
        return self._properties['config']

    @property
    def metadata(self):
        """
        :returns: Metadata of the factor.
        :rtype: dict
        """
        return self._properties['metadata']

    @property
    def url(self):
        """
        :returns: The URL of this resource.
        :rtype: unicode
        """
        return self._properties['url']

    def delete(self):
        """
        Deletes the FactorInstance

        :returns: True if delete succeeds, False otherwise
        :rtype: bool
        """
        return self._proxy.delete()

    def fetch(self):
        """
        Fetch the FactorInstance

        :returns: The fetched FactorInstance
        :rtype: twilio.rest.verify.v2.service.entity.factor.FactorInstance
        """
        return self._proxy.fetch()

    def update(self, auth_payload=values.unset, friendly_name=values.unset,
               config_notification_token=values.unset,
               config_sdk_version=values.unset, config_time_step=values.unset,
               config_skew=values.unset, config_code_length=values.unset,
               config_alg=values.unset, config_notification_platform=values.unset):
        """
        Update the FactorInstance

        :param unicode auth_payload: Optional payload to verify the Factor for the first time
        :param unicode friendly_name: The friendly name of this Factor
        :param unicode config_notification_token: For APN, the device token. For FCM, the registration token
        :param unicode config_sdk_version: The Verify Push SDK version used to configure the factor
        :param unicode config_time_step: How often, in seconds, are TOTP codes generated
        :param unicode config_skew: The number of past and future time-steps valid at a given time
        :param unicode config_code_length: Number of digits for generated TOTP codes
        :param FactorInstance.TotpAlgorithms config_alg: The algorithm used to derive the TOTP codes
        :param unicode config_notification_platform: The transport technology used to generate the Notification Token

        :returns: The updated FactorInstance
        :rtype: twilio.rest.verify.v2.service.entity.factor.FactorInstance
        """
        return self._proxy.update(
            auth_payload=auth_payload,
            friendly_name=friendly_name,
            config_notification_token=config_notification_token,
            config_sdk_version=config_sdk_version,
            config_time_step=config_time_step,
            config_skew=config_skew,
            config_code_length=config_code_length,
            config_alg=config_alg,
            config_notification_platform=config_notification_platform,
        )

    def __repr__(self):
        """
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        """
        context = ' '.join('{}={}'.format(k, v) for k, v in self._solution.items())
        return '<Twilio.Verify.V2.FactorInstance {}>'.format(context)


text:
currentclamps Package
=====================

:mod:`currentclamps` Package
----------------------------

.. automodule:: morphforgecontrib.simulation.stimulation.currentclamps
    :members:
    :undoc-members:
    :show-inheritance:

Subpackages
-----------

.. toctree::

    morphforgecontrib.simulation.stimulation.currentclamps.sinwave


text:
require('dotenv').config()
const path = require('path')
const webpack = require('webpack')

const { VueLoaderPlugin } = require('vue-loader')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const FriendlyErrorsWebpackPlugin = require('friendly-errors-webpack-plugin')
const WebpackNotifierPlugin = require('webpack-notifier')
const ManifestPlugin = require('webpack-manifest-plugin')
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer')
  .BundleAnalyzerPlugin

const hmr = process.argv.includes('--hot')
const production = process.env.NODE_ENV === 'production'
const devServerPort = parseInt(process.env.DEV_SERVER_PORT || '8080', 10)
const devServerUrl = process.env.DEV_SERVER_URL || 'http://localhost:8080'

const publicPathFolder = production ? '/dist/' : '/build/'
const publicPath = hmr ? `${devServerUrl}${publicPathFolder}` : publicPathFolder

function getEntryConfig(name, analyzerPort, alias = {}) {
  let plugins = [
    new VueLoaderPlugin(),
    new webpack.IgnorePlugin(/jsdom$/),
    new FriendlyErrorsWebpackPlugin(),
    new WebpackNotifierPlugin(),
    new MiniCssExtractPlugin({
      filename: production ? 'css/[name].[chunkhash].css' : 'css/[name].css'
    }),
    new ManifestPlugin({
      fileName: `manifest-${name}.json`,
      publicPath,
      writeToFileEmit: true
    })
  ]

  if (production) {
    plugins.push(
      ...[
        new BundleAnalyzerPlugin({
          analyzerPort
        })
      ]
    )
  }

  let postcssPlugins = [require('autoprefixer')()]

  if (production) {
    postcssPlugins.push(require('cssnano')())
  }

  let cssLoaders = [
    hmr ? 'vue-style-loader' : MiniCssExtractPlugin.loader,
    {
      loader: 'css-loader',
      options: {
        sourceMap: true
      }
    },
    {
      loader: 'postcss-loader',
      options: {
        ident: 'postcss',
        sourceMap: true,
        plugins: postcssPlugins
      }
    }
  ]

  return {
    entry: {
      [name]: [
        `./resources/js/${name}/app.js`,
        `./resources/sass/${name}/app.scss`
      ]
    },
    output: {
      path: path.resolve(__dirname, 'public' + publicPathFolder),
      filename: production ? 'js/[name].[chunkhash].js' : 'js/[name].js',
      publicPath
    },
    module: {
      rules: [
        {
          test: /\.css$/,
          use: cssLoaders
        },
        {
          test: /\.scss$/,
          use: cssLoaders.concat([
            {
              loader: 'resolve-url-loader'
            },
            {
              loader: 'sass-loader',
              options: {
                outputStyle: 'expanded',
                sourceMap: true
              }
            }
          ])
        },
        {
          test: /\.(js|vue)$/,
          loader: 'eslint-loader',
          enforce: 'pre'
        },
        {
          test: /\.vue$/,
          loader: 'vue-loader'
        },
        {
          test: /\.js$/,
          exclude: /node_modules/,
          loader: 'babel-loader',
          options: {
            presets: ['@babel/preset-env']
          }
        },
        {
          test: /\.(png|jpe?g|gif)$/,
          use: [
            {
              loader: 'url-loader',
              options: {
                name: path => {
                  if (!/node_modules/.test(path)) {
                    return 'images/[name].[ext]?[hash]'
                  }

                  return (
                    `images/vendor-${name}/` +
                    path
                      .replace(/\\/g, '/')
                      .replace(
                        /((.*(node_modules))|images|image|img|assets)\//g,
                        ''
                      ) +
                    '?[hash]'
                  )
                },
                limit: 4096
              }
            }
          ]
        },
        {
          test: /\.(woff2?|ttf|eot|svg|otf)$/,
          loader: 'url-loader',
          options: {
            name: path => {
              if (!/node_modules/.test(path)) {
                return 'fonts/[name].[ext]?[hash]'
              }

              return `fonts/vendor-${name}/[name].[ext]?[hash]`
            },
            limit: 4096
          }
        }
      ]
    },
    optimization: {
      splitChunks: {
        cacheGroups: {
          vendor: {
            test: /node_modules.*\.js$/,
            name: `vendor-${name}`,
            chunks: 'all'
          }
        }
      }
    },
    plugins,
    resolve: {
      extensions: ['.js', '.vue', '.json'],
      alias: Object.assign(
        {
          sweetalert2$: 'sweetalert2/dist/sweetalert2.js'
        },
        alias
      )
    },
    externals: {
      jquery: 'jQuery',
      'popper.js': 'Popper'
    },
    devtool: production ? 'source-map' : 'cheap-module-eval-source-map',
    devServer: {
      contentBase: path.resolve(__dirname, 'public'),
      headers: {
        'Access-Control-Allow-Origin': '*'
      },
      watchOptions: {
        aggregateTimeout: 300,
        poll: 1000,
        ignored: /node_modules/
      },
      historyApiFallback: true,
      compress: true,
      noInfo: true,
      quiet: true,
      port: devServerPort
    }
  }
}

module.exports = [
  getEntryConfig('frontend', 8888, {
    vue$: 'vue/dist/vue.esm.js'
  }),
  getEntryConfig('backend', 8889)
]


text:
<menu xmlns:tools="http://schemas.android.com/tools"
    tools:context="me.lianzhao.myapplication.SlicesActivity">

</menu>


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

import './note-import-dialog.css'

angular.module('zeppelinWebApp').controller('NoteImportCtrl', NoteImportCtrl)

function NoteImportCtrl ($scope, $timeout, websocketMsgSrv) {
  'ngInject'

  let vm = this
  $scope.note = {}
  $scope.note.step1 = true
  $scope.note.step2 = false
  $scope.maxLimit = ''
  let limit = 0

  websocketMsgSrv.listConfigurations()
  $scope.$on('configurationsInfo', function (scope, event) {
    limit = event.configurations['zeppelin.websocket.max.text.message.size']
    $scope.maxLimit = Math.round(limit / 1048576)
  })

  vm.resetFlags = function () {
    $scope.note = {}
    $scope.note.step1 = true
    $scope.note.step2 = false
    angular.element('#noteImportFile').val('')
  }

  $scope.uploadFile = function () {
    angular.element('#noteImportFile').click()
  }

  $scope.importFile = function (element) {
    $scope.note.errorText = ''
    $scope.note.importFile = element.files[0]
    let file = $scope.note.importFile
    let reader = new FileReader()

    if (file.size > limit) {
      $scope.note.errorText = 'File size limit Exceeded!'
      $scope.$apply()
      return
    }

    reader.onloadend = function () {
      vm.processImportJson(reader.result)
    }

    if (file) {
      reader.readAsText(file)
    }
  }

  $scope.uploadURL = function () {
    $scope.note.errorText = ''
    $scope.note.step1 = false
    $timeout(function () {
      $scope.note.step2 = true
    }, 400)
  }

  vm.importBack = function () {
    $scope.note.errorText = ''
    $timeout(function () {
      $scope.note.step1 = true
    }, 400)
    $scope.note.step2 = false
  }

  vm.importNote = function () {
    $scope.note.errorText = ''
    if ($scope.note.importUrl) {
      jQuery.ajax({
        url: $scope.note.importUrl,
        type: 'GET',
        dataType: 'json',
        jsonp: false,
        xhrFields: {
          withCredentials: false
        },
        error: function (xhr, ajaxOptions, thrownError) {
          $scope.note.errorText = 'Unable to Fetch URL'
          $scope.$apply()
        }}).done(function (data) {
          vm.processImportJson(data)
        })
    } else {
      $scope.note.errorText = 'Enter URL'
      $scope.$apply()
    }
  }

  vm.processImportJson = function (result) {
    if (typeof result !== 'object') {
      try {
        result = JSON.parse(result)
      } catch (e) {
        $scope.note.errorText = 'JSON parse exception'
        $scope.$apply()
        return
      }
    }
    if (result.paragraphs && result.paragraphs.length > 0) {
      if (!$scope.note.noteImportName) {
        $scope.note.noteImportName = result.name
      } else {
        result.name = $scope.note.noteImportName
      }
      websocketMsgSrv.importNote(result)
      // angular.element('#noteImportModal').modal('hide');
    } else {
      $scope.note.errorText = 'Invalid JSON'
    }
    $scope.$apply()
  }

  /*
   ** $scope.$on functions below
   */

  $scope.$on('setNoteMenu', function (event, notes) {
    vm.resetFlags()
    angular.element('#noteImportModal').modal('hide')
  })
}


text:
require_relative '../../app/models/chorus_config'

Chorus::Application.configure do
  # Settings specified here will take precedence over those in config/application.rb

  # Code is not reloaded between requests
  config.cache_classes = true

  # Full error reports are disabled and caching is turned on
  config.consider_all_requests_local       = false
  config.action_controller.perform_caching = true

  # Disable Rails's static asset server (Apache or nginx will already do this)
  config.serve_static_assets = false

  # Compress JavaScripts and CSS
  config.assets.compress = true
  config.assets.js_compressor = :uglifier
  config.assets.css_compressor = :yui

  # Don't fallback to assets pipeline if a precompiled asset is missed
  config.assets.compile = false

  # Generate digests for assets URLs
  config.assets.digest = true

  # Defaults to Rails.root.join("public/assets")
  # config.assets.manifest = YOUR_PATH

  # Prepend all log lines with the following tags
  # config.log_tags = [ :subdomain, :uuid ]

  # Use a different logger for distributed setups
  # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
  local_chorus_config = ChorusConfig.instance

  # See everything in the log (default is :info)
  config.log_level = local_chorus_config.log_level

  if local_chorus_config.syslog_configured?
    config.logger = ActiveSupport::TaggedLogging.new(Logger::Syslog.new('Chorus'))
  end

  # Use a different cache store in production
  # config.cache_store = :mem_cache_store

  # Enable serving of images, stylesheets, and JavaScripts from an asset server
  # config.action_controller.asset_host = "http://assets.example.com"

  # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
  # config.assets.precompile += %w( search.js )

  # Enable threaded mode
  if !(defined?($rails_rake_task) && $rails_rake_task)
    config.threadsafe!
  end
  config.eager_load_paths += config.autoload_paths

  # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
  # the I18n.default_locale when a translation can not be found)
  config.i18n.fallbacks = true

  # Send deprecation notices to registered listeners
  config.active_support.deprecation = :notify

  # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
  config.force_ssl = ChorusConfig.instance["ssl.enabled"]

  if ChorusConfig.instance["mail.enabled"]
    config.action_mailer.delivery_method = :smtp
    config.action_mailer.smtp_settings = ChorusConfig.instance.smtp_configuration
    ActionMailer::Base.default ChorusConfig.instance.mail_configuration
  else
    config.action_mailer.perform_deliveries = false
  end

  # Log the query plan for queries taking more than this (works
  # with SQLite, MySQL, and PostgreSQL)
  # config.active_record.auto_explain_threshold_in_seconds = 0.5
end