code
stringlengths
9
256k
<s> def messages ( request ) : <EOL> """<STR_LIT>""" <EOL> if hasattr ( request , '<STR_LIT>' ) and request . facebook . uid is not None : <EOL> from models import Message <EOL> messages = Message . objects . get_and_delete_all ( uid = request . facebook . uid ) <EOL> return { '<STR_LIT>' : messages } </s>
<s> """<STR_LIT>""" </s>
<s> import unittest <EOL> from openid import message <EOL> from openid . test . support import OpenIDTestMixin <EOL> from openid . consumer import consumer <EOL> from openid . test . test_consumer import TestIdRes <EOL> from openid . consumer import discover <EOL> def const ( result ) : <EOL> """<STR_LIT>""" <EOL> def constResult ( * args , ** kwargs ) : <EOL> return result <EOL> return constResult <EOL> class DiscoveryVerificationTest ( OpenIDTestMixin , TestIdRes ) : <EOL> def failUnlessProtocolError ( self , prefix , callable , * args , ** kwargs ) : <EOL> try : <EOL> result = callable ( * args , ** kwargs ) <EOL> except consumer . ProtocolError , e : <EOL> self . failUnless ( <EOL> e [ <NUM_LIT:0> ] . startswith ( prefix ) , <EOL> '<STR_LIT>' % ( prefix , e [ <NUM_LIT:0> ] ) ) <EOL> else : <EOL> self . fail ( '<STR_LIT>' <EOL> '<STR_LIT>' % ( prefix , result ) ) <EOL> def test_openID1NoLocalID ( self ) : <EOL> endpoint = discover . OpenIDServiceEndpoint ( ) <EOL> endpoint . claimed_id = '<STR_LIT>' <EOL> msg = message . Message . fromOpenIDArgs ( { } ) <EOL> self . failUnlessProtocolError ( <EOL> '<STR_LIT>' , <EOL> self . consumer . _verifyDiscoveryResults , msg , endpoint ) <EOL> self . failUnlessLogEmpty ( ) <EOL> def test_openID1NoEndpoint ( self ) : <EOL> msg = message . Message . fromOpenIDArgs ( { '<STR_LIT>' : '<STR_LIT>' } ) <EOL> self . failUnlessRaises ( RuntimeError , <EOL> self . consumer . _verifyDiscoveryResults , msg ) <EOL> self . failUnlessLogEmpty ( ) <EOL> def test_openID2NoOPEndpointArg ( self ) : <EOL> msg = message . Message . fromOpenIDArgs ( { '<STR_LIT>' : message . OPENID2_NS } ) <EOL> self . failUnlessRaises ( KeyError , <EOL> self . consumer . _verifyDiscoveryResults , msg ) <EOL> self . failUnlessLogEmpty ( ) <EOL> def test_openID2LocalIDNoClaimed ( self ) : <EOL> msg = message . Message . fromOpenIDArgs ( { '<STR_LIT>' : message . OPENID2_NS , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' } ) <EOL> self . failUnlessProtocolError ( <EOL> '<STR_LIT>' , <EOL> self . consumer . _verifyDiscoveryResults , msg ) <EOL> self . failUnlessLogEmpty ( ) <EOL> def test_openID2NoLocalIDClaimed ( self ) : <EOL> msg = message . Message . fromOpenIDArgs ( { '<STR_LIT>' : message . OPENID2_NS , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' } ) <EOL> self . failUnlessProtocolError ( <EOL> '<STR_LIT>' , <EOL> self . consumer . _verifyDiscoveryResults , msg ) <EOL> self . failUnlessLogEmpty ( ) <EOL> def test_openID2NoIdentifiers ( self ) : <EOL> op_endpoint = '<STR_LIT>' <EOL> msg = message . Message . fromOpenIDArgs ( { '<STR_LIT>' : message . OPENID2_NS , <EOL> '<STR_LIT>' : op_endpoint } ) <EOL> result_endpoint = self . consumer . _verifyDiscoveryResults ( msg ) <EOL> self . failUnless ( result_endpoint . isOPIdentifier ( ) ) <EOL> self . failUnlessEqual ( op_endpoint , result_endpoint . server_url ) <EOL> self . failUnlessEqual ( None , result_endpoint . claimed_id ) <EOL> self . failUnlessLogEmpty ( ) <EOL> def test_openID2NoEndpointDoesDisco ( self ) : <EOL> op_endpoint = '<STR_LIT>' <EOL> sentinel = discover . OpenIDServiceEndpoint ( ) <EOL> sentinel . claimed_id = '<STR_LIT>' <EOL> self . consumer . _discoverAndVerify = const ( sentinel ) <EOL> msg = message . Message . fromOpenIDArgs ( <EOL> { '<STR_LIT>' : message . OPENID2_NS , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : op_endpoint } ) <EOL> result = self . consumer . _verifyDiscoveryResults ( msg ) <EOL> self . failUnlessEqual ( sentinel , result ) <EOL> self . failUnlessLogMatches ( '<STR_LIT>' ) <EOL> def test_openID2MismatchedDoesDisco ( self ) : <EOL> mismatched = discover . OpenIDServiceEndpoint ( ) <EOL> mismatched . identity = '<STR_LIT>' <EOL> mismatched . local_id = '<STR_LIT>' <EOL> op_endpoint = '<STR_LIT>' <EOL> sentinel = discover . OpenIDServiceEndpoint ( ) <EOL> sentinel . claimed_id = '<STR_LIT>' <EOL> self . consumer . _discoverAndVerify = const ( sentinel ) <EOL> msg = message . Message . fromOpenIDArgs ( <EOL> { '<STR_LIT>' : message . OPENID2_NS , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : op_endpoint } ) <EOL> result = self . consumer . _verifyDiscoveryResults ( msg , mismatched ) <EOL> self . failUnlessEqual ( sentinel , result ) <EOL> self . failUnlessLogMatches ( '<STR_LIT>' , <EOL> '<STR_LIT>' ) <EOL> def test_openid2UsePreDiscovered ( self ) : <EOL> endpoint = discover . OpenIDServiceEndpoint ( ) <EOL> endpoint . local_id = '<STR_LIT>' <EOL> endpoint . claimed_id = '<STR_LIT>' <EOL> endpoint . server_url = '<STR_LIT>' <EOL> endpoint . type_uris = [ discover . OPENID_2_0_TYPE ] <EOL> msg = message . Message . fromOpenIDArgs ( <EOL> { '<STR_LIT>' : message . OPENID2_NS , <EOL> '<STR_LIT>' : endpoint . local_id , <EOL> '<STR_LIT>' : endpoint . claimed_id , <EOL> '<STR_LIT>' : endpoint . server_url } ) <EOL> result = self . consumer . _verifyDiscoveryResults ( msg , endpoint ) <EOL> self . failUnless ( result is endpoint ) <EOL> self . failUnlessLogEmpty ( ) <EOL> def test_openid2UsePreDiscoveredWrongType ( self ) : <EOL> text = "<STR_LIT>" <EOL> endpoint = discover . OpenIDServiceEndpoint ( ) <EOL> endpoint . local_id = '<STR_LIT>' <EOL> endpoint . claimed_id = '<STR_LIT>' <EOL> endpoint . server_url = '<STR_LIT>' <EOL> endpoint . type_uris = [ discover . OPENID_1_1_TYPE ] <EOL> def discoverAndVerify ( to_match ) : <EOL> self . failUnlessEqual ( endpoint . claimed_id , to_match . claimed_id ) <EOL> raise consumer . ProtocolError ( text ) <EOL> self . consumer . _discoverAndVerify = discoverAndVerify <EOL> msg = message . Message . fromOpenIDArgs ( <EOL> { '<STR_LIT>' : message . OPENID2_NS , <EOL> '<STR_LIT>' : endpoint . local_id , <EOL> '<STR_LIT>' : endpoint . claimed_id , <EOL> '<STR_LIT>' : endpoint . server_url } ) <EOL> try : <EOL> r = self . consumer . _verifyDiscoveryResults ( msg , endpoint ) <EOL> except consumer . ProtocolError , e : <EOL> self . failUnless ( str ( e ) , text ) <EOL> else : <EOL> self . fail ( "<STR_LIT>" % ( r , ) ) <EOL> self . failUnlessLogMatches ( '<STR_LIT>' , <EOL> '<STR_LIT>' ) <EOL> def test_openid1UsePreDiscovered ( self ) : <EOL> endpoint = discover . OpenIDServiceEndpoint ( ) <EOL> endpoint . local_id = '<STR_LIT>' <EOL> endpoint . claimed_id = '<STR_LIT>' <EOL> endpoint . server_url = '<STR_LIT>' <EOL> endpoint . type_uris = [ discover . OPENID_1_1_TYPE ] <EOL> msg = message . Message . fromOpenIDArgs ( <EOL> { '<STR_LIT>' : message . OPENID1_NS , <EOL> '<STR_LIT>' : endpoint . local_id } ) <EOL> result = self . consumer . _verifyDiscoveryResults ( msg , endpoint ) <EOL> self . failUnless ( result is endpoint ) <EOL> self . failUnlessLogEmpty ( ) <EOL> def test_openid1UsePreDiscoveredWrongType ( self ) : <EOL> class VerifiedError ( Exception ) : pass <EOL> def discoverAndVerify ( _to_match ) : <EOL> raise VerifiedError <EOL> self . consumer . _discoverAndVerify = discoverAndVerify <EOL> endpoint = discover . OpenIDServiceEndpoint ( ) <EOL> endpoint . local_id = '<STR_LIT>' <EOL> endpoint . claimed_id = '<STR_LIT>' <EOL> endpoint . server_url = '<STR_LIT>' <EOL> endpoint . type_uris = [ discover . OPENID_2_0_TYPE ] <EOL> msg = message . Message . fromOpenIDArgs ( <EOL> { '<STR_LIT>' : message . OPENID1_NS , <EOL> '<STR_LIT>' : endpoint . local_id } ) <EOL> self . failUnlessRaises ( <EOL> VerifiedError , <EOL> self . consumer . _verifyDiscoveryResults , msg , endpoint ) <EOL> self . failUnlessLogMatches ( '<STR_LIT>' , <EOL> '<STR_LIT>' ) <EOL> def test_openid2Fragment ( self ) : <EOL> claimed_id = "<STR_LIT>" <EOL> claimed_id_frag = claimed_id + "<STR_LIT>" <EOL> endpoint = discover . OpenIDServiceEndpoint ( ) <EOL> endpoint . local_id = '<STR_LIT>' <EOL> endpoint . claimed_id = claimed_id <EOL> endpoint . server_url = '<STR_LIT>' <EOL> endpoint . type_uris = [ discover . OPENID_2_0_TYPE ] <EOL> msg = message . Message . fromOpenIDArgs ( <EOL> { '<STR_LIT>' : message . OPENID2_NS , <EOL> '<STR_LIT>' : endpoint . local_id , <EOL> '<STR_LIT>' : claimed_id_frag , <EOL> '<STR_LIT>' : endpoint . server_url } ) <EOL> result = self . consumer . _verifyDiscoveryResults ( msg , endpoint ) <EOL> self . failUnlessEqual ( result . local_id , endpoint . local_id ) <EOL> self . failUnlessEqual ( result . server_url , endpoint . server_url ) <EOL> self . failUnlessEqual ( result . type_uris , endpoint . type_uris ) <EOL> self . failUnlessEqual ( result . claimed_id , claimed_id_frag ) <EOL> self . failUnlessLogEmpty ( ) <EOL> class TestVerifyDiscoverySingle ( TestIdRes ) : <EOL> def test_endpointWithoutLocalID ( self ) : <EOL> endpoint = discover . OpenIDServiceEndpoint ( ) <EOL> endpoint . server_url = "<STR_LIT>" <EOL> endpoint . claimed_id = "<STR_LIT>" <EOL> to_match = discover . OpenIDServiceEndpoint ( ) <EOL> to_match . server_url = "<STR_LIT>" <EOL> to_match . claimed_id = "<STR_LIT>" <EOL> to_match . local_id = "<STR_LIT>" <EOL> result = self . consumer . _verifyDiscoverySingle ( endpoint , to_match ) <EOL> self . failUnlessEqual ( result , None ) <EOL> self . failUnlessLogEmpty ( ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( ) </s>
<s> from django . db import models <EOL> from facebook . djangofb import get_facebook_client <EOL> class UserManager ( models . Manager ) : <EOL> """<STR_LIT>""" <EOL> def get_current ( self ) : <EOL> """<STR_LIT>""" <EOL> facebook = get_facebook_client ( ) <EOL> user , created = self . get_or_create ( id = int ( facebook . uid ) ) <EOL> if created : <EOL> pass <EOL> return user <EOL> class User ( models . Model ) : <EOL> """<STR_LIT>""" <EOL> id = models . IntegerField ( primary_key = True ) <EOL> language = models . CharField ( maxlength = <NUM_LIT:64> , default = '<STR_LIT>' ) <EOL> objects = UserManager ( ) </s>
<s> """<STR_LIT>""" <EOL> import os <EOL> import re <EOL> import time <EOL> from django . conf import global_settings <EOL> from django . utils . functional import LazyObject <EOL> from django . utils import importlib <EOL> ENVIRONMENT_VARIABLE = "<STR_LIT>" <EOL> class LazySettings ( LazyObject ) : <EOL> """<STR_LIT>""" <EOL> def _setup ( self ) : <EOL> """<STR_LIT>""" <EOL> try : <EOL> settings_module = os . environ [ ENVIRONMENT_VARIABLE ] <EOL> if not settings_module : <EOL> raise KeyError <EOL> except KeyError : <EOL> raise ImportError ( "<STR_LIT>" % ENVIRONMENT_VARIABLE ) <EOL> self . _wrapped = Settings ( settings_module ) <EOL> def configure ( self , default_settings = global_settings , ** options ) : <EOL> """<STR_LIT>""" <EOL> if self . _wrapped != None : <EOL> raise RuntimeError , '<STR_LIT>' <EOL> holder = UserSettingsHolder ( default_settings ) <EOL> for name , value in options . items ( ) : <EOL> setattr ( holder , name , value ) <EOL> self . _wrapped = holder <EOL> def configured ( self ) : <EOL> """<STR_LIT>""" <EOL> return bool ( self . _wrapped ) <EOL> configured = property ( configured ) <EOL> class Settings ( object ) : <EOL> def __init__ ( self , settings_module ) : <EOL> for setting in dir ( global_settings ) : <EOL> if setting == setting . upper ( ) : <EOL> setattr ( self , setting , getattr ( global_settings , setting ) ) <EOL> self . SETTINGS_MODULE = settings_module <EOL> try : <EOL> mod = importlib . import_module ( self . SETTINGS_MODULE ) <EOL> except ImportError , e : <EOL> raise ImportError , "<STR_LIT>" % ( self . SETTINGS_MODULE , e ) <EOL> tuple_settings = ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> for setting in dir ( mod ) : <EOL> if setting == setting . upper ( ) : <EOL> setting_value = getattr ( mod , setting ) <EOL> if setting in tuple_settings and type ( setting_value ) == str : <EOL> setting_value = ( setting_value , ) <EOL> setattr ( self , setting , setting_value ) <EOL> new_installed_apps = [ ] <EOL> for app in self . INSTALLED_APPS : <EOL> if app . endswith ( '<STR_LIT>' ) : <EOL> app_mod = importlib . import_module ( app [ : - <NUM_LIT:2> ] ) <EOL> appdir = os . path . dirname ( app_mod . __file__ ) <EOL> app_subdirs = os . listdir ( appdir ) <EOL> app_subdirs . sort ( ) <EOL> name_pattern = re . compile ( r'<STR_LIT>' ) <EOL> for d in app_subdirs : <EOL> if name_pattern . match ( d ) and os . path . isdir ( os . path . join ( appdir , d ) ) : <EOL> new_installed_apps . append ( '<STR_LIT>' % ( app [ : - <NUM_LIT:2> ] , d ) ) <EOL> else : <EOL> new_installed_apps . append ( app ) <EOL> self . INSTALLED_APPS = new_installed_apps <EOL> if hasattr ( time , '<STR_LIT>' ) : <EOL> os . environ [ '<STR_LIT>' ] = self . TIME_ZONE <EOL> time . tzset ( ) <EOL> def get_all_members ( self ) : <EOL> return dir ( self ) <EOL> class UserSettingsHolder ( object ) : <EOL> """<STR_LIT>""" <EOL> SETTINGS_MODULE = None <EOL> def __init__ ( self , default_settings ) : <EOL> """<STR_LIT>""" <EOL> self . default_settings = default_settings <EOL> def __getattr__ ( self , name ) : <EOL> return getattr ( self . default_settings , name ) <EOL> def get_all_members ( self ) : <EOL> return dir ( self ) + dir ( self . default_settings ) <EOL> settings = LazySettings ( ) </s>
<s> from django . contrib . auth . tests . basic import BASIC_TESTS <EOL> from django . contrib . auth . tests . views import PasswordResetTest , ChangePasswordTest , LoginTest , LogoutTest <EOL> from django . contrib . auth . tests . forms import FORM_TESTS <EOL> from django . contrib . auth . tests . remote_user import RemoteUserTest , RemoteUserNoCreateTest , RemoteUserCustomTest <EOL> from django . contrib . auth . tests . tokens import TOKEN_GENERATOR_TESTS <EOL> __test__ = { <EOL> '<STR_LIT>' : BASIC_TESTS , <EOL> '<STR_LIT>' : PasswordResetTest , <EOL> '<STR_LIT>' : FORM_TESTS , <EOL> '<STR_LIT>' : TOKEN_GENERATOR_TESTS , <EOL> '<STR_LIT>' : ChangePasswordTest , <EOL> '<STR_LIT>' : LoginTest , <EOL> '<STR_LIT>' : LogoutTest , <EOL> } </s>
<s> from django . contrib . flatpages . models import FlatPage <EOL> from django . template import loader , RequestContext <EOL> from django . shortcuts import get_object_or_404 <EOL> from django . http import HttpResponse , HttpResponseRedirect <EOL> from django . conf import settings <EOL> from django . core . xheaders import populate_xheaders <EOL> from django . utils . safestring import mark_safe <EOL> DEFAULT_TEMPLATE = '<STR_LIT>' <EOL> def flatpage ( request , url ) : <EOL> """<STR_LIT>""" <EOL> if not url . endswith ( '<STR_LIT:/>' ) and settings . APPEND_SLASH : <EOL> return HttpResponseRedirect ( "<STR_LIT>" % request . path ) <EOL> if not url . startswith ( '<STR_LIT:/>' ) : <EOL> url = "<STR_LIT:/>" + url <EOL> f = get_object_or_404 ( FlatPage , url__exact = url , sites__id__exact = settings . SITE_ID ) <EOL> if f . registration_required and not request . user . is_authenticated ( ) : <EOL> from django . contrib . auth . views import redirect_to_login <EOL> return redirect_to_login ( request . path ) <EOL> if f . template_name : <EOL> t = loader . select_template ( ( f . template_name , DEFAULT_TEMPLATE ) ) <EOL> else : <EOL> t = loader . get_template ( DEFAULT_TEMPLATE ) <EOL> f . title = mark_safe ( f . title ) <EOL> f . content = mark_safe ( f . content ) <EOL> c = RequestContext ( request , { <EOL> '<STR_LIT>' : f , <EOL> } ) <EOL> response = HttpResponse ( t . render ( c ) ) <EOL> populate_xheaders ( request , response , FlatPage , f . id ) <EOL> return response </s>
<s> import os <EOL> from django . conf import settings <EOL> from django . core . management import call_command <EOL> from django . db import connection <EOL> def spatialite_init_file ( ) : <EOL> return getattr ( settings , '<STR_LIT>' , '<STR_LIT>' ) <EOL> def create_test_spatial_db ( verbosity = <NUM_LIT:1> , autoclobber = False , interactive = False ) : <EOL> "<STR_LIT>" <EOL> if settings . DATABASE_ENGINE != '<STR_LIT>' : <EOL> raise Exception ( '<STR_LIT>' ) <EOL> db_name = connection . creation . _create_test_db ( verbosity , autoclobber ) <EOL> connection . close ( ) <EOL> settings . DATABASE_NAME = db_name <EOL> connection . settings_dict [ "<STR_LIT>" ] = db_name <EOL> can_rollback = connection . creation . _rollback_works ( ) <EOL> settings . DATABASE_SUPPORTS_TRANSACTIONS = can_rollback <EOL> connection . settings_dict [ "<STR_LIT>" ] = can_rollback <EOL> load_spatialite_sql ( db_name , verbosity = verbosity ) <EOL> if verbosity >= <NUM_LIT:1> : <EOL> print '<STR_LIT>' % db_name <EOL> call_command ( '<STR_LIT>' , verbosity = verbosity , interactive = interactive ) <EOL> def load_spatialite_sql ( db_name , verbosity = <NUM_LIT:1> ) : <EOL> """<STR_LIT>""" <EOL> spatialite_sql = spatialite_init_file ( ) <EOL> if not os . path . isfile ( spatialite_sql ) : <EOL> raise Exception ( '<STR_LIT>' % spatialite_sql ) <EOL> sql_fh = open ( spatialite_sql , '<STR_LIT:r>' ) <EOL> try : <EOL> cur = connection . cursor ( ) <EOL> cur . executescript ( sql_fh . read ( ) ) <EOL> finally : <EOL> sql_fh . close ( ) </s>
<s> import unittest <EOL> from django . contrib . gis . gdal import OGRGeometry , OGRGeomType , OGRException , OGRIndexError , SpatialReference , CoordTransform , gdal_version <EOL> from django . contrib . gis . tests . geometries import * <EOL> class OGRGeomTest ( unittest . TestCase ) : <EOL> "<STR_LIT>" <EOL> def test00a_geomtype ( self ) : <EOL> "<STR_LIT>" <EOL> try : <EOL> g = OGRGeomType ( <NUM_LIT:1> ) <EOL> g = OGRGeomType ( <NUM_LIT:7> ) <EOL> g = OGRGeomType ( '<STR_LIT>' ) <EOL> g = OGRGeomType ( '<STR_LIT>' ) <EOL> g = OGRGeomType ( '<STR_LIT>' ) <EOL> g = OGRGeomType ( '<STR_LIT>' ) <EOL> except : <EOL> self . fail ( '<STR_LIT>' ) <EOL> self . assertRaises ( OGRException , OGRGeomType , <NUM_LIT> ) <EOL> self . assertRaises ( OGRException , OGRGeomType , '<STR_LIT>' ) <EOL> self . assertRaises ( OGRException , OGRGeomType , <NUM_LIT:9> ) <EOL> self . assertEqual ( True , OGRGeomType ( <NUM_LIT:1> ) == OGRGeomType ( <NUM_LIT:1> ) ) <EOL> self . assertEqual ( True , OGRGeomType ( <NUM_LIT:7> ) == '<STR_LIT>' ) <EOL> self . assertEqual ( True , OGRGeomType ( '<STR_LIT>' ) == '<STR_LIT>' ) <EOL> self . assertEqual ( False , OGRGeomType ( '<STR_LIT>' ) == <NUM_LIT:2> ) <EOL> self . assertEqual ( True , OGRGeomType ( '<STR_LIT>' ) == <NUM_LIT:0> ) <EOL> self . assertEqual ( True , OGRGeomType ( <NUM_LIT:6> ) == '<STR_LIT>' ) <EOL> self . assertEqual ( False , OGRGeomType ( <NUM_LIT:1> ) != OGRGeomType ( '<STR_LIT>' ) ) <EOL> self . assertEqual ( True , OGRGeomType ( '<STR_LIT>' ) != OGRGeomType ( <NUM_LIT:6> ) ) <EOL> self . assertEqual ( '<STR_LIT>' , OGRGeomType ( '<STR_LIT>' ) . django ) <EOL> self . assertEqual ( '<STR_LIT>' , OGRGeomType ( '<STR_LIT>' ) . django ) <EOL> self . assertEqual ( None , OGRGeomType ( '<STR_LIT:none>' ) . django ) <EOL> gt = OGRGeomType ( '<STR_LIT>' ) <EOL> self . assertEqual ( <NUM_LIT:0> , gt . num ) <EOL> self . assertEqual ( '<STR_LIT>' , gt . name ) <EOL> def test01a_wkt ( self ) : <EOL> "<STR_LIT>" <EOL> for g in wkt_out : <EOL> geom = OGRGeometry ( g . wkt ) <EOL> self . assertEqual ( g . wkt , geom . wkt ) <EOL> def test01b_gml ( self ) : <EOL> "<STR_LIT>" <EOL> for g in wkt_out : <EOL> geom = OGRGeometry ( g . wkt ) <EOL> self . assertEqual ( g . gml , geom . gml ) <EOL> def test01c_hex ( self ) : <EOL> "<STR_LIT>" <EOL> for g in hex_wkt : <EOL> geom1 = OGRGeometry ( g . wkt ) <EOL> self . assertEqual ( g . hex , geom1 . hex ) <EOL> geom2 = OGRGeometry ( g . hex ) <EOL> self . assertEqual ( geom1 , geom2 ) <EOL> def test01d_wkb ( self ) : <EOL> "<STR_LIT>" <EOL> from binascii import b2a_hex <EOL> for g in hex_wkt : <EOL> geom1 = OGRGeometry ( g . wkt ) <EOL> wkb = geom1 . wkb <EOL> self . assertEqual ( b2a_hex ( wkb ) . upper ( ) , g . hex ) <EOL> geom2 = OGRGeometry ( wkb ) <EOL> self . assertEqual ( geom1 , geom2 ) <EOL> def test01e_json ( self ) : <EOL> "<STR_LIT>" <EOL> from django . contrib . gis . gdal . prototypes . geom import GEOJSON <EOL> if not GEOJSON : return <EOL> for g in json_geoms : <EOL> geom = OGRGeometry ( g . wkt ) <EOL> if not hasattr ( g , '<STR_LIT>' ) : <EOL> self . assertEqual ( g . json , geom . json ) <EOL> self . assertEqual ( g . json , geom . geojson ) <EOL> self . assertEqual ( OGRGeometry ( g . wkt ) , OGRGeometry ( geom . json ) ) <EOL> def test02_points ( self ) : <EOL> "<STR_LIT>" <EOL> prev = OGRGeometry ( '<STR_LIT>' ) <EOL> for p in points : <EOL> if not hasattr ( p , '<STR_LIT:z>' ) : <EOL> pnt = OGRGeometry ( p . wkt ) <EOL> self . assertEqual ( <NUM_LIT:1> , pnt . geom_type ) <EOL> self . assertEqual ( '<STR_LIT>' , pnt . geom_name ) <EOL> self . assertEqual ( p . x , pnt . x ) <EOL> self . assertEqual ( p . y , pnt . y ) <EOL> self . assertEqual ( ( p . x , p . y ) , pnt . tuple ) <EOL> def test03_multipoints ( self ) : <EOL> "<STR_LIT>" <EOL> for mp in multipoints : <EOL> mgeom1 = OGRGeometry ( mp . wkt ) <EOL> self . assertEqual ( <NUM_LIT:4> , mgeom1 . geom_type ) <EOL> self . assertEqual ( '<STR_LIT>' , mgeom1 . geom_name ) <EOL> mgeom2 = OGRGeometry ( '<STR_LIT>' ) <EOL> mgeom3 = OGRGeometry ( '<STR_LIT>' ) <EOL> for g in mgeom1 : <EOL> mgeom2 . add ( g ) <EOL> mgeom3 . add ( g . wkt ) <EOL> self . assertEqual ( mgeom1 , mgeom2 ) <EOL> self . assertEqual ( mgeom1 , mgeom3 ) <EOL> self . assertEqual ( mp . points , mgeom2 . tuple ) <EOL> self . assertEqual ( mp . n_p , mgeom2 . point_count ) <EOL> def test04_linestring ( self ) : <EOL> "<STR_LIT>" <EOL> prev = OGRGeometry ( '<STR_LIT>' ) <EOL> for ls in linestrings : <EOL> linestr = OGRGeometry ( ls . wkt ) <EOL> self . assertEqual ( <NUM_LIT:2> , linestr . geom_type ) <EOL> self . assertEqual ( '<STR_LIT>' , linestr . geom_name ) <EOL> self . assertEqual ( ls . n_p , linestr . point_count ) <EOL> self . assertEqual ( ls . tup , linestr . tuple ) <EOL> self . assertEqual ( True , linestr == OGRGeometry ( ls . wkt ) ) <EOL> self . assertEqual ( True , linestr != prev ) <EOL> self . assertRaises ( OGRIndexError , linestr . __getitem__ , len ( linestr ) ) <EOL> prev = linestr <EOL> x = [ tmpx for tmpx , tmpy in ls . tup ] <EOL> y = [ tmpy for tmpx , tmpy in ls . tup ] <EOL> self . assertEqual ( x , linestr . x ) <EOL> self . assertEqual ( y , linestr . y ) <EOL> def test05_multilinestring ( self ) : <EOL> "<STR_LIT>" <EOL> prev = OGRGeometry ( '<STR_LIT>' ) <EOL> for mls in multilinestrings : <EOL> mlinestr = OGRGeometry ( mls . wkt ) <EOL> self . assertEqual ( <NUM_LIT:5> , mlinestr . geom_type ) <EOL> self . assertEqual ( '<STR_LIT>' , mlinestr . geom_name ) <EOL> self . assertEqual ( mls . n_p , mlinestr . point_count ) <EOL> self . assertEqual ( mls . tup , mlinestr . tuple ) <EOL> self . assertEqual ( True , mlinestr == OGRGeometry ( mls . wkt ) ) <EOL> self . assertEqual ( True , mlinestr != prev ) <EOL> prev = mlinestr <EOL> for ls in mlinestr : <EOL> self . assertEqual ( <NUM_LIT:2> , ls . geom_type ) <EOL> self . assertEqual ( '<STR_LIT>' , ls . geom_name ) <EOL> self . assertRaises ( OGRIndexError , mlinestr . __getitem__ , len ( mlinestr ) ) <EOL> def test06_linearring ( self ) : <EOL> "<STR_LIT>" <EOL> prev = OGRGeometry ( '<STR_LIT>' ) <EOL> for rr in linearrings : <EOL> lr = OGRGeometry ( rr . wkt ) <EOL> self . assertEqual ( '<STR_LIT>' , lr . geom_name ) <EOL> self . assertEqual ( rr . n_p , len ( lr ) ) <EOL> self . assertEqual ( True , lr == OGRGeometry ( rr . wkt ) ) <EOL> self . assertEqual ( True , lr != prev ) <EOL> prev = lr <EOL> def test07a_polygons ( self ) : <EOL> "<STR_LIT>" <EOL> bbox = ( - <NUM_LIT> , - <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) <EOL> p = OGRGeometry . from_bbox ( bbox ) <EOL> self . assertEqual ( bbox , p . extent ) <EOL> prev = OGRGeometry ( '<STR_LIT>' ) <EOL> for p in polygons : <EOL> poly = OGRGeometry ( p . wkt ) <EOL> self . assertEqual ( <NUM_LIT:3> , poly . geom_type ) <EOL> self . assertEqual ( '<STR_LIT>' , poly . geom_name ) <EOL> self . assertEqual ( p . n_p , poly . point_count ) <EOL> self . assertEqual ( p . n_i + <NUM_LIT:1> , len ( poly ) ) <EOL> self . assertAlmostEqual ( p . area , poly . area , <NUM_LIT:9> ) <EOL> x , y = poly . centroid . tuple <EOL> self . assertAlmostEqual ( p . centroid [ <NUM_LIT:0> ] , x , <NUM_LIT:9> ) <EOL> self . assertAlmostEqual ( p . centroid [ <NUM_LIT:1> ] , y , <NUM_LIT:9> ) <EOL> self . assertEqual ( True , poly == OGRGeometry ( p . wkt ) ) <EOL> self . assertEqual ( True , poly != prev ) <EOL> if p . ext_ring_cs : <EOL> ring = poly [ <NUM_LIT:0> ] <EOL> self . assertEqual ( p . ext_ring_cs , ring . tuple ) <EOL> self . assertEqual ( p . ext_ring_cs , poly [ <NUM_LIT:0> ] . tuple ) <EOL> self . assertEqual ( len ( p . ext_ring_cs ) , ring . point_count ) <EOL> for r in poly : <EOL> self . assertEqual ( '<STR_LIT>' , r . geom_name ) <EOL> def test07b_closepolygons ( self ) : <EOL> "<STR_LIT>" <EOL> poly = OGRGeometry ( '<STR_LIT>' ) <EOL> self . assertEqual ( <NUM_LIT:8> , poly . point_count ) <EOL> print "<STR_LIT>" <EOL> try : <EOL> c = poly . centroid <EOL> except OGRException : <EOL> pass <EOL> else : <EOL> self . fail ( '<STR_LIT>' ) <EOL> print "<STR_LIT>" <EOL> major , minor1 , minor2 = gdal_version ( ) . split ( '<STR_LIT:.>' ) <EOL> if major == '<STR_LIT:1>' : <EOL> iminor1 = int ( minor1 ) <EOL> if iminor1 < <NUM_LIT:4> or ( iminor1 == <NUM_LIT:4> and minor2 . startswith ( '<STR_LIT:1>' ) ) : return <EOL> poly . close_rings ( ) <EOL> self . assertEqual ( <NUM_LIT:10> , poly . point_count ) <EOL> self . assertEqual ( OGRGeometry ( '<STR_LIT>' ) , poly . centroid ) <EOL> def test08_multipolygons ( self ) : <EOL> "<STR_LIT>" <EOL> prev = OGRGeometry ( '<STR_LIT>' ) <EOL> for mp in multipolygons : <EOL> mpoly = OGRGeometry ( mp . wkt ) <EOL> self . assertEqual ( <NUM_LIT:6> , mpoly . geom_type ) <EOL> self . assertEqual ( '<STR_LIT>' , mpoly . geom_name ) <EOL> if mp . valid : <EOL> self . assertEqual ( mp . n_p , mpoly . point_count ) <EOL> self . assertEqual ( mp . num_geom , len ( mpoly ) ) <EOL> self . assertRaises ( OGRIndexError , mpoly . __getitem__ , len ( mpoly ) ) <EOL> for p in mpoly : <EOL> self . assertEqual ( '<STR_LIT>' , p . geom_name ) <EOL> self . assertEqual ( <NUM_LIT:3> , p . geom_type ) <EOL> self . assertEqual ( mpoly . wkt , OGRGeometry ( mp . wkt ) . wkt ) <EOL> def test09a_srs ( self ) : <EOL> "<STR_LIT>" <EOL> for mp in multipolygons : <EOL> sr = SpatialReference ( '<STR_LIT>' ) <EOL> mpoly = OGRGeometry ( mp . wkt , sr ) <EOL> self . assertEqual ( sr . wkt , mpoly . srs . wkt ) <EOL> klone = mpoly . clone ( ) <EOL> self . assertEqual ( sr . wkt , klone . srs . wkt ) <EOL> for poly in mpoly : <EOL> self . assertEqual ( sr . wkt , poly . srs . wkt ) <EOL> for ring in poly : <EOL> self . assertEqual ( sr . wkt , ring . srs . wkt ) <EOL> a , b = topology_geoms [ <NUM_LIT:0> ] <EOL> a , b = OGRGeometry ( a . wkt , sr ) , OGRGeometry ( b . wkt , sr ) <EOL> diff = a . difference ( b ) <EOL> union = a . union ( b ) <EOL> self . assertEqual ( sr . wkt , diff . srs . wkt ) <EOL> self . assertEqual ( sr . srid , union . srs . srid ) <EOL> mpoly = OGRGeometry ( mp . wkt , <NUM_LIT> ) <EOL> self . assertEqual ( <NUM_LIT> , mpoly . srid ) <EOL> mpoly . srs = SpatialReference ( <NUM_LIT> ) <EOL> self . assertEqual ( <NUM_LIT> , mpoly . srid ) <EOL> self . assertEqual ( '<STR_LIT>' , mpoly . srs . name ) <EOL> for poly in mpoly : <EOL> self . assertEqual ( mpoly . srs . wkt , poly . srs . wkt ) <EOL> poly . srs = <NUM_LIT> <EOL> for ring in poly : <EOL> self . assertEqual ( <NUM_LIT> , ring . srs . srid ) <EOL> self . assertEqual ( '<STR_LIT>' , ring . srs . name ) <EOL> ring . srs = str ( SpatialReference ( <NUM_LIT> ) ) <EOL> self . assertEqual ( <NUM_LIT> , ring . srs . srid ) <EOL> ring . srid = <NUM_LIT> <EOL> self . assertEqual ( '<STR_LIT>' , ring . srs . name ) <EOL> self . assertEqual ( <NUM_LIT> , ring . srid ) <EOL> def test09b_srs_transform ( self ) : <EOL> "<STR_LIT>" <EOL> orig = OGRGeometry ( '<STR_LIT>' , <NUM_LIT> ) <EOL> trans = OGRGeometry ( '<STR_LIT>' , <NUM_LIT> ) <EOL> t1 , t2 , t3 = orig . clone ( ) , orig . clone ( ) , orig . clone ( ) <EOL> t1 . transform ( trans . srid ) <EOL> t2 . transform ( SpatialReference ( '<STR_LIT>' ) ) <EOL> ct = CoordTransform ( SpatialReference ( '<STR_LIT>' ) , SpatialReference ( <NUM_LIT> ) ) <EOL> t3 . transform ( ct ) <EOL> k1 = orig . clone ( ) <EOL> k2 = k1 . transform ( trans . srid , clone = True ) <EOL> self . assertEqual ( k1 , orig ) <EOL> self . assertNotEqual ( k1 , k2 ) <EOL> prec = <NUM_LIT:3> <EOL> for p in ( t1 , t2 , t3 , k2 ) : <EOL> self . assertAlmostEqual ( trans . x , p . x , prec ) <EOL> self . assertAlmostEqual ( trans . y , p . y , prec ) <EOL> def test10_difference ( self ) : <EOL> "<STR_LIT>" <EOL> for i in xrange ( len ( topology_geoms ) ) : <EOL> g_tup = topology_geoms [ i ] <EOL> a = OGRGeometry ( g_tup [ <NUM_LIT:0> ] . wkt ) <EOL> b = OGRGeometry ( g_tup [ <NUM_LIT:1> ] . wkt ) <EOL> d1 = OGRGeometry ( diff_geoms [ i ] . wkt ) <EOL> d2 = a . difference ( b ) <EOL> self . assertEqual ( d1 , d2 ) <EOL> self . assertEqual ( d1 , a - b ) <EOL> a -= b <EOL> self . assertEqual ( d1 , a ) <EOL> def test11_intersection ( self ) : <EOL> "<STR_LIT>" <EOL> for i in xrange ( len ( topology_geoms ) ) : <EOL> g_tup = topology_geoms [ i ] <EOL> a = OGRGeometry ( g_tup [ <NUM_LIT:0> ] . wkt ) <EOL> b = OGRGeometry ( g_tup [ <NUM_LIT:1> ] . wkt ) <EOL> i1 = OGRGeometry ( intersect_geoms [ i ] . wkt ) <EOL> self . assertEqual ( True , a . intersects ( b ) ) <EOL> i2 = a . intersection ( b ) <EOL> self . assertEqual ( i1 , i2 ) <EOL> self . assertEqual ( i1 , a & b ) <EOL> a &= b <EOL> self . assertEqual ( i1 , a ) <EOL> def test12_symdifference ( self ) : <EOL> "<STR_LIT>" <EOL> for i in xrange ( len ( topology_geoms ) ) : <EOL> g_tup = topology_geoms [ i ] <EOL> a = OGRGeometry ( g_tup [ <NUM_LIT:0> ] . wkt ) <EOL> b = OGRGeometry ( g_tup [ <NUM_LIT:1> ] . wkt ) <EOL> d1 = OGRGeometry ( sdiff_geoms [ i ] . wkt ) <EOL> d2 = a . sym_difference ( b ) <EOL> self . assertEqual ( d1 , d2 ) <EOL> self . assertEqual ( d1 , a ^ b ) <EOL> a ^= b <EOL> self . assertEqual ( d1 , a ) <EOL> def test13_union ( self ) : <EOL> "<STR_LIT>" <EOL> for i in xrange ( len ( topology_geoms ) ) : <EOL> g_tup = topology_geoms [ i ] <EOL> a = OGRGeometry ( g_tup [ <NUM_LIT:0> ] . wkt ) <EOL> b = OGRGeometry ( g_tup [ <NUM_LIT:1> ] . wkt ) <EOL> u1 = OGRGeometry ( union_geoms [ i ] . wkt ) <EOL> u2 = a . union ( b ) <EOL> self . assertEqual ( u1 , u2 ) <EOL> self . assertEqual ( u1 , a | b ) <EOL> a |= b <EOL> self . assertEqual ( u1 , a ) <EOL> def test14_add ( self ) : <EOL> "<STR_LIT>" <EOL> mp = OGRGeometry ( '<STR_LIT>' ) <EOL> pnt = OGRGeometry ( '<STR_LIT>' ) <EOL> self . assertRaises ( OGRException , mp . add , pnt ) <EOL> for mp in multipolygons : <EOL> mpoly = OGRGeometry ( mp . wkt ) <EOL> mp1 = OGRGeometry ( '<STR_LIT>' ) <EOL> mp2 = OGRGeometry ( '<STR_LIT>' ) <EOL> mp3 = OGRGeometry ( '<STR_LIT>' ) <EOL> for poly in mpoly : <EOL> mp1 . add ( poly ) <EOL> mp2 . add ( poly . wkt ) <EOL> mp3 . add ( mpoly ) <EOL> for tmp in ( mp1 , mp2 , mp3 ) : self . assertEqual ( mpoly , tmp ) <EOL> def test15_extent ( self ) : <EOL> "<STR_LIT>" <EOL> mp = OGRGeometry ( '<STR_LIT>' ) <EOL> self . assertEqual ( ( <NUM_LIT:0.0> , <NUM_LIT:0.0> , <NUM_LIT> , <NUM_LIT> ) , mp . extent ) <EOL> poly = OGRGeometry ( polygons [ <NUM_LIT:3> ] . wkt ) <EOL> ring = poly . shell <EOL> x , y = ring . x , ring . y <EOL> xmin , ymin = min ( x ) , min ( y ) <EOL> xmax , ymax = max ( x ) , max ( y ) <EOL> self . assertEqual ( ( xmin , ymin , xmax , ymax ) , poly . extent ) <EOL> def suite ( ) : <EOL> s = unittest . TestSuite ( ) <EOL> s . addTest ( unittest . makeSuite ( OGRGeomTest ) ) <EOL> return s <EOL> def run ( verbosity = <NUM_LIT:2> ) : <EOL> unittest . TextTestRunner ( verbosity = verbosity ) . run ( suite ( ) ) </s>
<s> from django . contrib . gis . db import models <EOL> from django . contrib . gis . tests . utils import mysql , spatialite <EOL> null_flag = not mysql <EOL> class Country ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT:30> ) <EOL> mpoly = models . MultiPolygonField ( ) <EOL> objects = models . GeoManager ( ) <EOL> def __unicode__ ( self ) : return self . name <EOL> class City ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT:30> ) <EOL> point = models . PointField ( ) <EOL> objects = models . GeoManager ( ) <EOL> def __unicode__ ( self ) : return self . name <EOL> class PennsylvaniaCity ( City ) : <EOL> county = models . CharField ( max_length = <NUM_LIT:30> ) <EOL> objects = models . GeoManager ( ) <EOL> class State ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT:30> ) <EOL> poly = models . PolygonField ( null = null_flag ) <EOL> objects = models . GeoManager ( ) <EOL> def __unicode__ ( self ) : return self . name <EOL> if not spatialite : <EOL> class Feature ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT:20> ) <EOL> geom = models . GeometryField ( ) <EOL> objects = models . GeoManager ( ) <EOL> def __unicode__ ( self ) : return self . name <EOL> class MinusOneSRID ( models . Model ) : <EOL> geom = models . PointField ( srid = - <NUM_LIT:1> ) <EOL> objects = models . GeoManager ( ) </s>
<s> """<STR_LIT>""" <EOL> import re <EOL> from django . utils . translation import ugettext_lazy as _ <EOL> from django . forms . fields import Field , RegexField , Select <EOL> from django . forms import ValidationError <EOL> re_ssn = re . compile ( r'<STR_LIT>' ) <EOL> class ATZipCodeField ( RegexField ) : <EOL> """<STR_LIT>""" <EOL> default_error_messages = { <EOL> '<STR_LIT>' : _ ( '<STR_LIT>' ) , <EOL> } <EOL> def __init__ ( self , * args , ** kwargs ) : <EOL> super ( ATZipCodeField , self ) . __init__ ( r'<STR_LIT>' , <EOL> max_length = None , min_length = None , * args , ** kwargs ) <EOL> class ATStateSelect ( Select ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , attrs = None ) : <EOL> from django . contrib . localflavor . at . at_states import STATE_CHOICES <EOL> super ( ATStateSelect , self ) . __init__ ( attrs , choices = STATE_CHOICES ) <EOL> class ATSocialSecurityNumberField ( Field ) : <EOL> """<STR_LIT>""" <EOL> default_error_messages = { <EOL> '<STR_LIT>' : _ ( u'<STR_LIT>' ) , <EOL> } <EOL> def clean ( self , value ) : <EOL> if not re_ssn . search ( value ) : <EOL> raise ValidationError ( self . error_messages [ '<STR_LIT>' ] ) <EOL> sqnr , date = value . split ( "<STR_LIT:U+0020>" ) <EOL> sqnr , check = ( sqnr [ : <NUM_LIT:3> ] , ( sqnr [ <NUM_LIT:3> ] ) ) <EOL> if int ( sqnr ) < <NUM_LIT:100> : <EOL> raise ValidationError ( self . error_messages [ '<STR_LIT>' ] ) <EOL> res = int ( sqnr [ <NUM_LIT:0> ] ) * <NUM_LIT:3> + int ( sqnr [ <NUM_LIT:1> ] ) * <NUM_LIT:7> + int ( sqnr [ <NUM_LIT:2> ] ) * <NUM_LIT:9> + int ( date [ <NUM_LIT:0> ] ) * <NUM_LIT:5> + int ( date [ <NUM_LIT:1> ] ) * <NUM_LIT:8> + int ( date [ <NUM_LIT:2> ] ) * <NUM_LIT:4> + int ( date [ <NUM_LIT:3> ] ) * <NUM_LIT:2> + int ( date [ <NUM_LIT:4> ] ) * <NUM_LIT:1> + int ( date [ <NUM_LIT:5> ] ) * <NUM_LIT:6> <EOL> res = res % <NUM_LIT:11> <EOL> if res != int ( check ) : <EOL> raise ValidationError ( self . error_messages [ '<STR_LIT>' ] ) <EOL> return u'<STR_LIT>' % ( sqnr , check , date , ) </s>
<s> import datetime <EOL> from django . contrib . sessions . models import Session <EOL> from django . contrib . sessions . backends . base import SessionBase , CreateError <EOL> from django . core . exceptions import SuspiciousOperation <EOL> from django . db import IntegrityError , transaction <EOL> from django . utils . encoding import force_unicode <EOL> class SessionStore ( SessionBase ) : <EOL> """<STR_LIT>""" <EOL> def load ( self ) : <EOL> try : <EOL> s = Session . objects . get ( <EOL> session_key = self . session_key , <EOL> expire_date__gt = datetime . datetime . now ( ) <EOL> ) <EOL> return self . decode ( force_unicode ( s . session_data ) ) <EOL> except ( Session . DoesNotExist , SuspiciousOperation ) : <EOL> self . create ( ) <EOL> return { } <EOL> def exists ( self , session_key ) : <EOL> try : <EOL> Session . objects . get ( session_key = session_key ) <EOL> except Session . DoesNotExist : <EOL> return False <EOL> return True <EOL> def create ( self ) : <EOL> while True : <EOL> self . session_key = self . _get_new_session_key ( ) <EOL> try : <EOL> self . save ( must_create = True ) <EOL> except CreateError : <EOL> continue <EOL> self . modified = True <EOL> self . _session_cache = { } <EOL> return <EOL> def save ( self , must_create = False ) : <EOL> """<STR_LIT>""" <EOL> obj = Session ( <EOL> session_key = self . session_key , <EOL> session_data = self . encode ( self . _get_session ( no_load = must_create ) ) , <EOL> expire_date = self . get_expiry_date ( ) <EOL> ) <EOL> sid = transaction . savepoint ( ) <EOL> try : <EOL> obj . save ( force_insert = must_create ) <EOL> except IntegrityError : <EOL> if must_create : <EOL> transaction . savepoint_rollback ( sid ) <EOL> raise CreateError <EOL> raise <EOL> def delete ( self , session_key = None ) : <EOL> if session_key is None : <EOL> if self . _session_key is None : <EOL> return <EOL> session_key = self . _session_key <EOL> try : <EOL> Session . objects . get ( session_key = session_key ) . delete ( ) <EOL> except Session . DoesNotExist : <EOL> pass </s>
<s> """<STR_LIT>""" <EOL> import sys <EOL> from django . utils import termcolors <EOL> def supports_color ( ) : <EOL> """<STR_LIT>""" <EOL> unsupported_platform = ( sys . platform in ( '<STR_LIT:win32>' , '<STR_LIT>' ) ) <EOL> is_a_tty = hasattr ( sys . stdout , '<STR_LIT>' ) and sys . stdout . isatty ( ) <EOL> if unsupported_platform or not is_a_tty : <EOL> return False <EOL> return True <EOL> def color_style ( ) : <EOL> """<STR_LIT>""" <EOL> if not supports_color ( ) : <EOL> return no_style ( ) <EOL> class dummy : pass <EOL> style = dummy ( ) <EOL> style . ERROR = termcolors . make_style ( fg = '<STR_LIT>' , opts = ( '<STR_LIT>' , ) ) <EOL> style . ERROR_OUTPUT = termcolors . make_style ( fg = '<STR_LIT>' , opts = ( '<STR_LIT>' , ) ) <EOL> style . NOTICE = termcolors . make_style ( fg = '<STR_LIT>' ) <EOL> style . SQL_FIELD = termcolors . make_style ( fg = '<STR_LIT>' , opts = ( '<STR_LIT>' , ) ) <EOL> style . SQL_COLTYPE = termcolors . make_style ( fg = '<STR_LIT>' ) <EOL> style . SQL_KEYWORD = termcolors . make_style ( fg = '<STR_LIT>' ) <EOL> style . SQL_TABLE = termcolors . make_style ( opts = ( '<STR_LIT>' , ) ) <EOL> return style <EOL> def no_style ( ) : <EOL> """<STR_LIT>""" <EOL> class dummy : <EOL> def __getattr__ ( self , attr ) : <EOL> return lambda x : x <EOL> return dummy ( ) </s>
<s> """<STR_LIT>""" <EOL> from StringIO import StringIO <EOL> import yaml <EOL> try : <EOL> import decimal <EOL> except ImportError : <EOL> from django . utils import _decimal as decimal <EOL> from django . db import models <EOL> from django . core . serializers . python import Serializer as PythonSerializer <EOL> from django . core . serializers . python import Deserializer as PythonDeserializer <EOL> class DjangoSafeDumper ( yaml . SafeDumper ) : <EOL> def represent_decimal ( self , data ) : <EOL> return self . represent_scalar ( '<STR_LIT>' , str ( data ) ) <EOL> DjangoSafeDumper . add_representer ( decimal . Decimal , DjangoSafeDumper . represent_decimal ) <EOL> class Serializer ( PythonSerializer ) : <EOL> """<STR_LIT>""" <EOL> internal_use_only = False <EOL> def handle_field ( self , obj , field ) : <EOL> if isinstance ( field , models . TimeField ) and getattr ( obj , field . name ) is not None : <EOL> self . _current [ field . name ] = str ( getattr ( obj , field . name ) ) <EOL> else : <EOL> super ( Serializer , self ) . handle_field ( obj , field ) <EOL> def end_serialization ( self ) : <EOL> self . options . pop ( '<STR_LIT>' , None ) <EOL> self . options . pop ( '<STR_LIT>' , None ) <EOL> yaml . dump ( self . objects , self . stream , Dumper = DjangoSafeDumper , ** self . options ) <EOL> def getvalue ( self ) : <EOL> return self . stream . getvalue ( ) <EOL> def Deserializer ( stream_or_string , ** options ) : <EOL> """<STR_LIT>""" <EOL> if isinstance ( stream_or_string , basestring ) : <EOL> stream = StringIO ( stream_or_string ) <EOL> else : <EOL> stream = stream_or_string <EOL> for obj in PythonDeserializer ( yaml . load ( stream ) ) : <EOL> yield obj </s>
<s> import os <EOL> import sys <EOL> from django . conf import settings <EOL> from django . db . backends . creation import BaseDatabaseCreation <EOL> class DatabaseCreation ( BaseDatabaseCreation ) : <EOL> data_types = { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:bool>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:date>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:bool>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:text>' , <EOL> '<STR_LIT>' : '<STR_LIT:time>' , <EOL> } <EOL> def sql_for_pending_references ( self , model , style , pending_references ) : <EOL> "<STR_LIT>" <EOL> return [ ] <EOL> def sql_remove_table_constraints ( self , model , references_to_delete , style ) : <EOL> "<STR_LIT>" <EOL> return [ ] <EOL> def _create_test_db ( self , verbosity , autoclobber ) : <EOL> if settings . TEST_DATABASE_NAME and settings . TEST_DATABASE_NAME != "<STR_LIT>" : <EOL> test_database_name = settings . TEST_DATABASE_NAME <EOL> if verbosity >= <NUM_LIT:1> : <EOL> print "<STR_LIT>" <EOL> if os . access ( test_database_name , os . F_OK ) : <EOL> if not autoclobber : <EOL> confirm = raw_input ( "<STR_LIT>" % test_database_name ) <EOL> if autoclobber or confirm == '<STR_LIT:yes>' : <EOL> try : <EOL> if verbosity >= <NUM_LIT:1> : <EOL> print "<STR_LIT>" <EOL> os . remove ( test_database_name ) <EOL> except Exception , e : <EOL> sys . stderr . write ( "<STR_LIT>" % e ) <EOL> sys . exit ( <NUM_LIT:2> ) <EOL> else : <EOL> print "<STR_LIT>" <EOL> sys . exit ( <NUM_LIT:1> ) <EOL> if verbosity >= <NUM_LIT:1> : <EOL> print "<STR_LIT>" <EOL> else : <EOL> test_database_name = "<STR_LIT>" <EOL> return test_database_name <EOL> def _destroy_test_db ( self , test_database_name , verbosity ) : <EOL> if test_database_name and test_database_name != "<STR_LIT>" : <EOL> os . remove ( test_database_name ) </s>
<s> """<STR_LIT>""" <EOL> from copy import deepcopy <EOL> from django . utils . datastructures import SortedDict <EOL> from django . utils . html import conditional_escape <EOL> from django . utils . encoding import StrAndUnicode , smart_unicode , force_unicode <EOL> from django . utils . safestring import mark_safe <EOL> from fields import Field , FileField <EOL> from widgets import Media , media_property , TextInput , Textarea <EOL> from util import flatatt , ErrorDict , ErrorList , ValidationError <EOL> __all__ = ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> NON_FIELD_ERRORS = '<STR_LIT>' <EOL> def pretty_name ( name ) : <EOL> "<STR_LIT>" <EOL> name = name [ <NUM_LIT:0> ] . upper ( ) + name [ <NUM_LIT:1> : ] <EOL> return name . replace ( '<STR_LIT:_>' , '<STR_LIT:U+0020>' ) <EOL> def get_declared_fields ( bases , attrs , with_base_fields = True ) : <EOL> """<STR_LIT>""" <EOL> fields = [ ( field_name , attrs . pop ( field_name ) ) for field_name , obj in attrs . items ( ) if isinstance ( obj , Field ) ] <EOL> fields . sort ( lambda x , y : cmp ( x [ <NUM_LIT:1> ] . creation_counter , y [ <NUM_LIT:1> ] . creation_counter ) ) <EOL> if with_base_fields : <EOL> for base in bases [ : : - <NUM_LIT:1> ] : <EOL> if hasattr ( base , '<STR_LIT>' ) : <EOL> fields = base . base_fields . items ( ) + fields <EOL> else : <EOL> for base in bases [ : : - <NUM_LIT:1> ] : <EOL> if hasattr ( base , '<STR_LIT>' ) : <EOL> fields = base . declared_fields . items ( ) + fields <EOL> return SortedDict ( fields ) <EOL> class DeclarativeFieldsMetaclass ( type ) : <EOL> """<STR_LIT>""" <EOL> def __new__ ( cls , name , bases , attrs ) : <EOL> attrs [ '<STR_LIT>' ] = get_declared_fields ( bases , attrs ) <EOL> new_class = super ( DeclarativeFieldsMetaclass , <EOL> cls ) . __new__ ( cls , name , bases , attrs ) <EOL> if '<STR_LIT>' not in attrs : <EOL> new_class . media = media_property ( new_class ) <EOL> return new_class <EOL> class BaseForm ( StrAndUnicode ) : <EOL> def __init__ ( self , data = None , files = None , auto_id = '<STR_LIT>' , prefix = None , <EOL> initial = None , error_class = ErrorList , label_suffix = '<STR_LIT::>' , <EOL> empty_permitted = False ) : <EOL> self . is_bound = data is not None or files is not None <EOL> self . data = data or { } <EOL> self . files = files or { } <EOL> self . auto_id = auto_id <EOL> self . prefix = prefix <EOL> self . initial = initial or { } <EOL> self . error_class = error_class <EOL> self . label_suffix = label_suffix <EOL> self . empty_permitted = empty_permitted <EOL> self . _errors = None <EOL> self . _changed_data = None <EOL> self . fields = deepcopy ( self . base_fields ) <EOL> def __unicode__ ( self ) : <EOL> return self . as_table ( ) <EOL> def __iter__ ( self ) : <EOL> for name , field in self . fields . items ( ) : <EOL> yield BoundField ( self , field , name ) <EOL> def __getitem__ ( self , name ) : <EOL> "<STR_LIT>" <EOL> try : <EOL> field = self . fields [ name ] <EOL> except KeyError : <EOL> raise KeyError ( '<STR_LIT>' % name ) <EOL> return BoundField ( self , field , name ) <EOL> def _get_errors ( self ) : <EOL> "<STR_LIT>" <EOL> if self . _errors is None : <EOL> self . full_clean ( ) <EOL> return self . _errors <EOL> errors = property ( _get_errors ) <EOL> def is_valid ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . is_bound and not bool ( self . errors ) <EOL> def add_prefix ( self , field_name ) : <EOL> """<STR_LIT>""" <EOL> return self . prefix and ( '<STR_LIT>' % ( self . prefix , field_name ) ) or field_name <EOL> def add_initial_prefix ( self , field_name ) : <EOL> """<STR_LIT>""" <EOL> return u'<STR_LIT>' % self . add_prefix ( field_name ) <EOL> def _html_output ( self , normal_row , error_row , row_ender , help_text_html , errors_on_separate_row ) : <EOL> "<STR_LIT>" <EOL> top_errors = self . non_field_errors ( ) <EOL> output , hidden_fields = [ ] , [ ] <EOL> for name , field in self . fields . items ( ) : <EOL> bf = BoundField ( self , field , name ) <EOL> bf_errors = self . error_class ( [ conditional_escape ( error ) for error in bf . errors ] ) <EOL> if bf . is_hidden : <EOL> if bf_errors : <EOL> top_errors . extend ( [ u'<STR_LIT>' % ( name , force_unicode ( e ) ) for e in bf_errors ] ) <EOL> hidden_fields . append ( unicode ( bf ) ) <EOL> else : <EOL> if errors_on_separate_row and bf_errors : <EOL> output . append ( error_row % force_unicode ( bf_errors ) ) <EOL> if bf . label : <EOL> label = conditional_escape ( force_unicode ( bf . label ) ) <EOL> if self . label_suffix : <EOL> if label [ - <NUM_LIT:1> ] not in '<STR_LIT>' : <EOL> label += self . label_suffix <EOL> label = bf . label_tag ( label ) or '<STR_LIT>' <EOL> else : <EOL> label = '<STR_LIT>' <EOL> if field . help_text : <EOL> help_text = help_text_html % force_unicode ( field . help_text ) <EOL> else : <EOL> help_text = u'<STR_LIT>' <EOL> output . append ( normal_row % { '<STR_LIT>' : force_unicode ( bf_errors ) , '<STR_LIT:label>' : force_unicode ( label ) , '<STR_LIT>' : unicode ( bf ) , '<STR_LIT>' : help_text } ) <EOL> if top_errors : <EOL> output . insert ( <NUM_LIT:0> , error_row % force_unicode ( top_errors ) ) <EOL> if hidden_fields : <EOL> str_hidden = u'<STR_LIT>' . join ( hidden_fields ) <EOL> if output : <EOL> last_row = output [ - <NUM_LIT:1> ] <EOL> if not last_row . endswith ( row_ender ) : <EOL> last_row = normal_row % { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT:label>' : '<STR_LIT>' , '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : '<STR_LIT>' } <EOL> output . append ( last_row ) <EOL> output [ - <NUM_LIT:1> ] = last_row [ : - len ( row_ender ) ] + str_hidden + row_ender <EOL> else : <EOL> output . append ( str_hidden ) <EOL> return mark_safe ( u'<STR_LIT:\n>' . join ( output ) ) <EOL> def as_table ( self ) : <EOL> "<STR_LIT>" <EOL> return self . _html_output ( u'<STR_LIT>' , u'<STR_LIT>' , '<STR_LIT>' , u'<STR_LIT>' , False ) <EOL> def as_ul ( self ) : <EOL> "<STR_LIT>" <EOL> return self . _html_output ( u'<STR_LIT>' , u'<STR_LIT>' , '<STR_LIT>' , u'<STR_LIT>' , False ) <EOL> def as_p ( self ) : <EOL> "<STR_LIT>" <EOL> return self . _html_output ( u'<STR_LIT>' , u'<STR_LIT:%s>' , '<STR_LIT>' , u'<STR_LIT>' , True ) <EOL> def non_field_errors ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . errors . get ( NON_FIELD_ERRORS , self . error_class ( ) ) <EOL> def _raw_value ( self , fieldname ) : <EOL> """<STR_LIT>""" <EOL> field = self . fields [ fieldname ] <EOL> prefix = self . add_prefix ( fieldname ) <EOL> return field . widget . value_from_datadict ( self . data , self . files , prefix ) <EOL> def full_clean ( self ) : <EOL> """<STR_LIT>""" <EOL> self . _errors = ErrorDict ( ) <EOL> if not self . is_bound : <EOL> return <EOL> self . cleaned_data = { } <EOL> if self . empty_permitted and not self . has_changed ( ) : <EOL> return <EOL> for name , field in self . fields . items ( ) : <EOL> value = field . widget . value_from_datadict ( self . data , self . files , self . add_prefix ( name ) ) <EOL> try : <EOL> if isinstance ( field , FileField ) : <EOL> initial = self . initial . get ( name , field . initial ) <EOL> value = field . clean ( value , initial ) <EOL> else : <EOL> value = field . clean ( value ) <EOL> self . cleaned_data [ name ] = value <EOL> if hasattr ( self , '<STR_LIT>' % name ) : <EOL> value = getattr ( self , '<STR_LIT>' % name ) ( ) <EOL> self . cleaned_data [ name ] = value <EOL> except ValidationError , e : <EOL> self . _errors [ name ] = e . messages <EOL> if name in self . cleaned_data : <EOL> del self . cleaned_data [ name ] <EOL> try : <EOL> self . cleaned_data = self . clean ( ) <EOL> except ValidationError , e : <EOL> self . _errors [ NON_FIELD_ERRORS ] = e . messages <EOL> if self . _errors : <EOL> delattr ( self , '<STR_LIT>' ) <EOL> def clean ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . cleaned_data <EOL> def has_changed ( self ) : <EOL> """<STR_LIT>""" <EOL> return bool ( self . changed_data ) <EOL> def _get_changed_data ( self ) : <EOL> if self . _changed_data is None : <EOL> self . _changed_data = [ ] <EOL> for name , field in self . fields . items ( ) : <EOL> prefixed_name = self . add_prefix ( name ) <EOL> data_value = field . widget . value_from_datadict ( self . data , self . files , prefixed_name ) <EOL> if not field . show_hidden_initial : <EOL> initial_value = self . initial . get ( name , field . initial ) <EOL> else : <EOL> initial_prefixed_name = self . add_initial_prefix ( name ) <EOL> hidden_widget = field . hidden_widget ( ) <EOL> initial_value = hidden_widget . value_from_datadict ( <EOL> self . data , self . files , initial_prefixed_name ) <EOL> if field . widget . _has_changed ( initial_value , data_value ) : <EOL> self . _changed_data . append ( name ) <EOL> return self . _changed_data <EOL> changed_data = property ( _get_changed_data ) <EOL> def _get_media ( self ) : <EOL> """<STR_LIT>""" <EOL> media = Media ( ) <EOL> for field in self . fields . values ( ) : <EOL> media = media + field . widget . media <EOL> return media <EOL> media = property ( _get_media ) <EOL> def is_multipart ( self ) : <EOL> """<STR_LIT>""" <EOL> for field in self . fields . values ( ) : <EOL> if field . widget . needs_multipart_form : <EOL> return True <EOL> return False <EOL> def hidden_fields ( self ) : <EOL> """<STR_LIT>""" <EOL> return [ field for field in self if field . is_hidden ] <EOL> def visible_fields ( self ) : <EOL> """<STR_LIT>""" <EOL> return [ field for field in self if not field . is_hidden ] <EOL> class Form ( BaseForm ) : <EOL> "<STR_LIT>" <EOL> __metaclass__ = DeclarativeFieldsMetaclass <EOL> class BoundField ( StrAndUnicode ) : <EOL> "<STR_LIT>" <EOL> def __init__ ( self , form , field , name ) : <EOL> self . form = form <EOL> self . field = field <EOL> self . name = name <EOL> self . html_name = form . add_prefix ( name ) <EOL> self . html_initial_name = form . add_initial_prefix ( name ) <EOL> if self . field . label is None : <EOL> self . label = pretty_name ( name ) <EOL> else : <EOL> self . label = self . field . label <EOL> self . help_text = field . help_text or '<STR_LIT>' <EOL> def __unicode__ ( self ) : <EOL> """<STR_LIT>""" <EOL> if self . field . show_hidden_initial : <EOL> return self . as_widget ( ) + self . as_hidden ( only_initial = True ) <EOL> return self . as_widget ( ) <EOL> def _errors ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . form . errors . get ( self . name , self . form . error_class ( ) ) <EOL> errors = property ( _errors ) <EOL> def as_widget ( self , widget = None , attrs = None , only_initial = False ) : <EOL> """<STR_LIT>""" <EOL> if not widget : <EOL> widget = self . field . widget <EOL> attrs = attrs or { } <EOL> auto_id = self . auto_id <EOL> if auto_id and '<STR_LIT:id>' not in attrs and '<STR_LIT:id>' not in widget . attrs : <EOL> attrs [ '<STR_LIT:id>' ] = auto_id <EOL> if not self . form . is_bound : <EOL> data = self . form . initial . get ( self . name , self . field . initial ) <EOL> if callable ( data ) : <EOL> data = data ( ) <EOL> else : <EOL> if isinstance ( self . field , FileField ) and self . data is None : <EOL> data = self . form . initial . get ( self . name , self . field . initial ) <EOL> else : <EOL> data = self . data <EOL> if not only_initial : <EOL> name = self . html_name <EOL> else : <EOL> name = self . html_initial_name <EOL> return widget . render ( name , data , attrs = attrs ) <EOL> def as_text ( self , attrs = None , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> return self . as_widget ( TextInput ( ) , attrs , ** kwargs ) <EOL> def as_textarea ( self , attrs = None , ** kwargs ) : <EOL> "<STR_LIT>" <EOL> return self . as_widget ( Textarea ( ) , attrs , ** kwargs ) <EOL> def as_hidden ( self , attrs = None , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> return self . as_widget ( self . field . hidden_widget ( ) , attrs , ** kwargs ) <EOL> def _data ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . field . widget . value_from_datadict ( self . form . data , self . form . files , self . html_name ) <EOL> data = property ( _data ) <EOL> def label_tag ( self , contents = None , attrs = None ) : <EOL> """<STR_LIT>""" <EOL> contents = contents or conditional_escape ( self . label ) <EOL> widget = self . field . widget <EOL> id_ = widget . attrs . get ( '<STR_LIT:id>' ) or self . auto_id <EOL> if id_ : <EOL> attrs = attrs and flatatt ( attrs ) or '<STR_LIT>' <EOL> contents = u'<STR_LIT>' % ( widget . id_for_label ( id_ ) , attrs , unicode ( contents ) ) <EOL> return mark_safe ( contents ) <EOL> def _is_hidden ( self ) : <EOL> "<STR_LIT>" <EOL> return self . field . widget . is_hidden <EOL> is_hidden = property ( _is_hidden ) <EOL> def _auto_id ( self ) : <EOL> """<STR_LIT>""" <EOL> auto_id = self . form . auto_id <EOL> if auto_id and '<STR_LIT:%s>' in smart_unicode ( auto_id ) : <EOL> return smart_unicode ( auto_id ) % self . html_name <EOL> elif auto_id : <EOL> return self . html_name <EOL> return '<STR_LIT>' <EOL> auto_id = property ( _auto_id ) </s>
<s> import sys , time , os <EOL> from django . conf import settings <EOL> from django . db import connection <EOL> from django . core import mail <EOL> from django . test import signals <EOL> from django . template import Template <EOL> from django . utils . translation import deactivate <EOL> class ContextList ( list ) : <EOL> """<STR_LIT>""" <EOL> def __getitem__ ( self , key ) : <EOL> if isinstance ( key , basestring ) : <EOL> for subcontext in self : <EOL> if key in subcontext : <EOL> return subcontext [ key ] <EOL> raise KeyError <EOL> else : <EOL> return super ( ContextList , self ) . __getitem__ ( key ) <EOL> def instrumented_test_render ( self , context ) : <EOL> """<STR_LIT>""" <EOL> signals . template_rendered . send ( sender = self , template = self , context = context ) <EOL> return self . nodelist . render ( context ) <EOL> class TestSMTPConnection ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( * args , ** kwargs ) : <EOL> pass <EOL> def open ( self ) : <EOL> "<STR_LIT>" <EOL> pass <EOL> def close ( self ) : <EOL> "<STR_LIT>" <EOL> pass <EOL> def send_messages ( self , messages ) : <EOL> "<STR_LIT>" <EOL> mail . outbox . extend ( messages ) <EOL> return len ( messages ) <EOL> def setup_test_environment ( ) : <EOL> """<STR_LIT>""" <EOL> Template . original_render = Template . render <EOL> Template . render = instrumented_test_render <EOL> mail . original_SMTPConnection = mail . SMTPConnection <EOL> mail . SMTPConnection = TestSMTPConnection <EOL> mail . outbox = [ ] <EOL> deactivate ( ) <EOL> def teardown_test_environment ( ) : <EOL> """<STR_LIT>""" <EOL> Template . render = Template . original_render <EOL> del Template . original_render <EOL> mail . SMTPConnection = mail . original_SMTPConnection <EOL> del mail . original_SMTPConnection <EOL> del mail . outbox <EOL> def get_runner ( settings ) : <EOL> test_path = settings . TEST_RUNNER . split ( '<STR_LIT:.>' ) <EOL> if len ( test_path ) > <NUM_LIT:1> : <EOL> test_module_name = '<STR_LIT:.>' . join ( test_path [ : - <NUM_LIT:1> ] ) <EOL> else : <EOL> test_module_name = '<STR_LIT:.>' <EOL> test_module = __import__ ( test_module_name , { } , { } , test_path [ - <NUM_LIT:1> ] ) <EOL> test_runner = getattr ( test_module , test_path [ - <NUM_LIT:1> ] ) <EOL> return test_runner </s>
<s> from django import http <EOL> from django . conf import settings <EOL> from django . utils import importlib <EOL> from django . utils . translation import check_for_language , activate , to_locale , get_language <EOL> from django . utils . text import javascript_quote <EOL> import os <EOL> import gettext as gettext_module <EOL> def set_language ( request ) : <EOL> """<STR_LIT>""" <EOL> next = request . REQUEST . get ( '<STR_LIT>' , None ) <EOL> if not next : <EOL> next = request . META . get ( '<STR_LIT>' , None ) <EOL> if not next : <EOL> next = '<STR_LIT:/>' <EOL> response = http . HttpResponseRedirect ( next ) <EOL> if request . method == '<STR_LIT:POST>' : <EOL> lang_code = request . POST . get ( '<STR_LIT>' , None ) <EOL> if lang_code and check_for_language ( lang_code ) : <EOL> if hasattr ( request , '<STR_LIT>' ) : <EOL> request . session [ '<STR_LIT>' ] = lang_code <EOL> else : <EOL> response . set_cookie ( settings . LANGUAGE_COOKIE_NAME , lang_code ) <EOL> return response <EOL> NullSource = """<STR_LIT>""" <EOL> LibHead = """<STR_LIT>""" <EOL> LibFoot = """<STR_LIT>""" <EOL> SimplePlural = """<STR_LIT>""" <EOL> InterPolate = r"""<STR_LIT>""" <EOL> PluralIdx = r"""<STR_LIT>""" <EOL> def null_javascript_catalog ( request , domain = None , packages = None ) : <EOL> """<STR_LIT>""" <EOL> return http . HttpResponse ( NullSource + InterPolate , '<STR_LIT>' ) <EOL> def javascript_catalog ( request , domain = '<STR_LIT>' , packages = None ) : <EOL> """<STR_LIT>""" <EOL> if request . GET : <EOL> if '<STR_LIT>' in request . GET : <EOL> if check_for_language ( request . GET [ '<STR_LIT>' ] ) : <EOL> activate ( request . GET [ '<STR_LIT>' ] ) <EOL> if packages is None : <EOL> packages = [ '<STR_LIT>' ] <EOL> if type ( packages ) in ( str , unicode ) : <EOL> packages = packages . split ( '<STR_LIT:+>' ) <EOL> packages = [ p for p in packages if p == '<STR_LIT>' or p in settings . INSTALLED_APPS ] <EOL> default_locale = to_locale ( settings . LANGUAGE_CODE ) <EOL> locale = to_locale ( get_language ( ) ) <EOL> t = { } <EOL> paths = [ ] <EOL> for package in packages : <EOL> p = importlib . import_module ( package ) <EOL> path = os . path . join ( os . path . dirname ( p . __file__ ) , '<STR_LIT>' ) <EOL> paths . append ( path ) <EOL> try : <EOL> catalog = gettext_module . translation ( domain , path , [ '<STR_LIT>' ] ) <EOL> t . update ( catalog . _catalog ) <EOL> except IOError : <EOL> pass <EOL> if default_locale != '<STR_LIT>' : <EOL> for path in paths : <EOL> try : <EOL> catalog = gettext_module . translation ( domain , path , [ default_locale ] ) <EOL> except IOError : <EOL> catalog = None <EOL> if catalog is not None : <EOL> t . update ( catalog . _catalog ) <EOL> if locale != default_locale : <EOL> for path in paths : <EOL> try : <EOL> catalog = gettext_module . translation ( domain , path , [ locale ] ) <EOL> except IOError : <EOL> catalog = None <EOL> if catalog is not None : <EOL> t . update ( catalog . _catalog ) <EOL> src = [ LibHead ] <EOL> plural = None <EOL> if '<STR_LIT>' in t : <EOL> for l in t [ '<STR_LIT>' ] . split ( '<STR_LIT:\n>' ) : <EOL> if l . startswith ( '<STR_LIT>' ) : <EOL> plural = l . split ( '<STR_LIT::>' , <NUM_LIT:1> ) [ <NUM_LIT:1> ] . strip ( ) <EOL> if plural is not None : <EOL> plural = [ el . strip ( ) for el in plural . split ( '<STR_LIT:;>' ) if el . strip ( ) . startswith ( '<STR_LIT>' ) ] [ <NUM_LIT:0> ] . split ( '<STR_LIT:=>' , <NUM_LIT:1> ) [ <NUM_LIT:1> ] <EOL> src . append ( PluralIdx % plural ) <EOL> else : <EOL> src . append ( SimplePlural ) <EOL> csrc = [ ] <EOL> pdict = { } <EOL> for k , v in t . items ( ) : <EOL> if k == '<STR_LIT>' : <EOL> continue <EOL> if type ( k ) in ( str , unicode ) : <EOL> csrc . append ( "<STR_LIT>" % ( javascript_quote ( k ) , javascript_quote ( v ) ) ) <EOL> elif type ( k ) == tuple : <EOL> if k [ <NUM_LIT:0> ] not in pdict : <EOL> pdict [ k [ <NUM_LIT:0> ] ] = k [ <NUM_LIT:1> ] <EOL> else : <EOL> pdict [ k [ <NUM_LIT:0> ] ] = max ( k [ <NUM_LIT:1> ] , pdict [ k [ <NUM_LIT:0> ] ] ) <EOL> csrc . append ( "<STR_LIT>" % ( javascript_quote ( k [ <NUM_LIT:0> ] ) , k [ <NUM_LIT:1> ] , javascript_quote ( v ) ) ) <EOL> else : <EOL> raise TypeError , k <EOL> csrc . sort ( ) <EOL> for k , v in pdict . items ( ) : <EOL> src . append ( "<STR_LIT>" % ( javascript_quote ( k ) , '<STR_LIT:U+002C>' . join ( [ "<STR_LIT>" ] * ( v + <NUM_LIT:1> ) ) ) ) <EOL> src . extend ( csrc ) <EOL> src . append ( LibFoot ) <EOL> src . append ( InterPolate ) <EOL> src = '<STR_LIT>' . join ( src ) <EOL> return http . HttpResponse ( src , '<STR_LIT>' ) </s>
<s> """<STR_LIT>""" <EOL> __version__ = "<STR_LIT>" [ <NUM_LIT:11> : - <NUM_LIT:2> ] <EOL> __author__ = "<STR_LIT>" <EOL> __copyright__ = "<STR_LIT>" <EOL> __docformat__ = '<STR_LIT>' <EOL> import re <EOL> import sys <EOL> from optparse import OptionValueError <EOL> from epydoc import log <EOL> class UrlGenerator : <EOL> """<STR_LIT>""" <EOL> class IndexAmbiguous ( IndexError ) : <EOL> """<STR_LIT>""" <EOL> def get_url ( self , name ) : <EOL> """<STR_LIT>""" <EOL> raise NotImplementedError <EOL> def get_canonical_name ( self , name ) : <EOL> """<STR_LIT>""" <EOL> rv = [ ] <EOL> for m in self . _SEP_RE . finditer ( name ) : <EOL> groups = m . groups ( ) <EOL> if groups [ <NUM_LIT:0> ] is not None : <EOL> rv . append ( groups [ <NUM_LIT:0> ] ) <EOL> elif groups [ <NUM_LIT:2> ] is not None : <EOL> break <EOL> return tuple ( rv ) <EOL> _SEP_RE = re . compile ( r"""<STR_LIT>""" ) <EOL> class VoidUrlGenerator ( UrlGenerator ) : <EOL> """<STR_LIT>""" <EOL> def get_url ( self , name ) : <EOL> return None <EOL> class DocUrlGenerator ( UrlGenerator ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self ) : <EOL> self . _exact_matches = { } <EOL> """<STR_LIT>""" <EOL> self . _partial_names = { } <EOL> """<STR_LIT>""" <EOL> self . prefix = '<STR_LIT>' <EOL> """<STR_LIT>""" <EOL> self . _filename = None <EOL> """<STR_LIT>""" <EOL> def get_url ( self , name ) : <EOL> cname = self . get_canonical_name ( name ) <EOL> url = self . _exact_matches . get ( cname , None ) <EOL> if url is None : <EOL> vals = self . _partial_names . get ( cname ) <EOL> if vals is None : <EOL> raise IndexError ( <EOL> "<STR_LIT>" % ( name ) ) <EOL> elif len ( vals ) == <NUM_LIT:1> : <EOL> url = self . _exact_matches [ vals [ <NUM_LIT:0> ] ] <EOL> else : <EOL> raise self . IndexAmbiguous ( <EOL> "<STR_LIT>" <EOL> % ( len ( vals ) , name , "<STR_LIT:U+002CU+0020>" . join ( [ "<STR_LIT>" % n for n in vals ] ) ) ) <EOL> return self . prefix + url <EOL> def clear ( self ) : <EOL> """<STR_LIT>""" <EOL> self . _exact_matches . clear ( ) <EOL> self . _partial_names . clear ( ) <EOL> def load_index ( self , f ) : <EOL> """<STR_LIT>""" <EOL> self . _filename = str ( f ) <EOL> if isinstance ( f , basestring ) : <EOL> f = open ( f ) <EOL> self . load_records ( self . _iter_tuples ( f ) ) <EOL> def _iter_tuples ( self , f ) : <EOL> """<STR_LIT>""" <EOL> for nrow , row in enumerate ( f ) : <EOL> row = row . rstrip ( ) <EOL> if not row : continue <EOL> rec = row . split ( '<STR_LIT:\t>' , <NUM_LIT:2> ) <EOL> if len ( rec ) == <NUM_LIT:2> : <EOL> yield rec <EOL> else : <EOL> log . warning ( "<STR_LIT>" <EOL> % ( self . _filename , nrow + <NUM_LIT:1> , row ) ) <EOL> def load_records ( self , records ) : <EOL> """<STR_LIT>""" <EOL> for name , url in records : <EOL> cname = self . get_canonical_name ( name ) <EOL> if not cname : <EOL> log . warning ( "<STR_LIT>" <EOL> % ( self . _filename , name ) ) <EOL> continue <EOL> if name in self . _exact_matches : <EOL> continue <EOL> self . _exact_matches [ name ] = url <EOL> self . _exact_matches [ cname ] = url <EOL> for i in range ( <NUM_LIT:1> , len ( cname ) ) : <EOL> self . _partial_names . setdefault ( cname [ i : ] , [ ] ) . append ( name ) <EOL> api_register = { } <EOL> """<STR_LIT>""" <EOL> def register_api ( name , generator = None ) : <EOL> """<STR_LIT>""" <EOL> if generator is None : <EOL> generator = VoidUrlGenerator ( ) <EOL> api_register [ name ] = generator <EOL> def set_api_file ( name , file ) : <EOL> """<STR_LIT>""" <EOL> generator = DocUrlGenerator ( ) <EOL> generator . load_index ( file ) <EOL> register_api ( name , generator ) <EOL> def set_api_root ( name , prefix ) : <EOL> """<STR_LIT>""" <EOL> api_register [ name ] . prefix = prefix <EOL> try : <EOL> import docutils <EOL> from docutils . parsers . rst import roles <EOL> from docutils import nodes , utils <EOL> from docutils . readers . standalone import Reader <EOL> except ImportError : <EOL> docutils = roles = nodes = utils = None <EOL> class Reader : settings_spec = ( ) <EOL> _TARGET_RE = re . compile ( r'<STR_LIT>' ) <EOL> def create_api_role ( name , problematic ) : <EOL> """<STR_LIT>""" <EOL> def resolve_api_name ( n , rawtext , text , lineno , inliner , <EOL> options = { } , content = [ ] ) : <EOL> if docutils is None : <EOL> raise AssertionError ( '<STR_LIT>' ) <EOL> m = _TARGET_RE . match ( text ) <EOL> if m : text , target = m . groups ( ) <EOL> else : target = text <EOL> text = utils . unescape ( text ) <EOL> node = nodes . literal ( rawtext , text , ** options ) <EOL> try : <EOL> url = api_register [ name ] . get_url ( target ) <EOL> except IndexError , exc : <EOL> msg = inliner . reporter . warning ( str ( exc ) , line = lineno ) <EOL> if problematic : <EOL> prb = inliner . problematic ( rawtext , text , msg ) <EOL> return [ prb ] , [ msg ] <EOL> else : <EOL> return [ node ] , [ ] <EOL> if url is not None : <EOL> node = nodes . reference ( rawtext , '<STR_LIT>' , node , refuri = url , ** options ) <EOL> return [ node ] , [ ] <EOL> roles . register_local_role ( name , resolve_api_name ) <EOL> def split_name ( value ) : <EOL> """<STR_LIT>""" <EOL> parts = value . split ( '<STR_LIT::>' , <NUM_LIT:1> ) <EOL> if len ( parts ) != <NUM_LIT:2> : <EOL> raise OptionValueError ( <EOL> "<STR_LIT>" <EOL> % value ) <EOL> name , val = parts <EOL> if name not in api_register : <EOL> raise OptionValueError ( <EOL> "<STR_LIT>" <EOL> % name ) <EOL> return ( name , val ) <EOL> class ApiLinkReader ( Reader ) : <EOL> """<STR_LIT>""" <EOL> settings_spec = ( <EOL> '<STR_LIT>' , <EOL> None , <EOL> ( ( <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' , <EOL> [ '<STR_LIT>' ] , <EOL> { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT:action>' : '<STR_LIT>' } <EOL> ) , ( <EOL> '<STR_LIT>' , <EOL> [ '<STR_LIT>' ] , <EOL> { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT:action>' : '<STR_LIT>' } <EOL> ) , ( <EOL> '<STR_LIT>' , <EOL> [ '<STR_LIT>' ] , <EOL> { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT:action>' : '<STR_LIT>' } <EOL> ) , ) ) + Reader . settings_spec <EOL> def __init__ ( self , * args , ** kwargs ) : <EOL> if docutils is None : <EOL> raise AssertionError ( '<STR_LIT>' ) <EOL> Reader . __init__ ( self , * args , ** kwargs ) <EOL> def read ( self , source , parser , settings ) : <EOL> self . read_configuration ( settings , problematic = True ) <EOL> return Reader . read ( self , source , parser , settings ) <EOL> def read_configuration ( self , settings , problematic = True ) : <EOL> """<STR_LIT>""" <EOL> if hasattr ( self , '<STR_LIT>' ) : <EOL> return <EOL> ApiLinkReader . _conf = True <EOL> try : <EOL> if settings . external_api is not None : <EOL> for name in settings . external_api : <EOL> register_api ( name ) <EOL> create_api_role ( name , problematic = problematic ) <EOL> if settings . external_api_file is not None : <EOL> for name , file in map ( split_name , settings . external_api_file ) : <EOL> set_api_file ( name , file ) <EOL> if settings . external_api_root is not None : <EOL> for name , root in map ( split_name , settings . external_api_root ) : <EOL> set_api_root ( name , root ) <EOL> except OptionValueError , exc : <EOL> print >> sys . stderr , "<STR_LIT>" % ( exc . __class__ . __name__ , exc ) <EOL> sys . exit ( <NUM_LIT:2> ) <EOL> read_configuration = classmethod ( read_configuration ) </s>
<s> """<STR_LIT>""" <EOL> __all__ = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> __revision__ = "<STR_LIT>" </s>
<s> """<STR_LIT>""" <EOL> __author__ = '<STR_LIT>' <EOL> import gdata . client <EOL> import gdata . blogger . data <EOL> import atom . data <EOL> import atom . http_core <EOL> BLOGS_URL = '<STR_LIT>' <EOL> BLOG_POST_URL = '<STR_LIT>' <EOL> BLOG_POST_COMMENTS_URL = '<STR_LIT>' <EOL> BLOG_COMMENTS_URL = '<STR_LIT>' <EOL> BLOG_ARCHIVE_URL = '<STR_LIT>' <EOL> class BloggerClient ( gdata . client . GDClient ) : <EOL> api_version = '<STR_LIT:2>' <EOL> auth_serice = '<STR_LIT>' <EOL> auth_scopes = [ '<STR_LIT>' ] <EOL> def get_blogs ( self , user_id = '<STR_LIT:default>' , auth_token = None , <EOL> desired_class = gdata . blogger . data . BlogFeed , ** kwargs ) : <EOL> return self . get_feed ( BLOGS_URL % user_id , auth_token = auth_token , <EOL> desired_class = desired_class , ** kwargs ) <EOL> GetBlogs = get_blogs <EOL> def get_posts ( self , blog_id , auth_token = None , <EOL> desired_class = gdata . blogger . data . BlogPostFeed , query = None , <EOL> ** kwargs ) : <EOL> return self . get_feed ( BLOG_POST_URL % blog_id , auth_token = auth_token , <EOL> desired_class = desired_class , query = query , ** kwargs ) <EOL> GetPosts = get_posts <EOL> def get_post_comments ( self , blog_id , post_id , auth_token = None , <EOL> desired_class = gdata . blogger . data . CommentFeed , <EOL> query = None , ** kwargs ) : <EOL> return self . get_feed ( BLOG_POST_COMMENTS_URL % ( blog_id , post_id ) , <EOL> auth_token = auth_token , desired_class = desired_class , <EOL> query = query , ** kwargs ) <EOL> GetPostComments = get_post_comments <EOL> def get_blog_comments ( self , blog_id , auth_token = None , <EOL> desired_class = gdata . blogger . data . CommentFeed , <EOL> query = None , ** kwargs ) : <EOL> return self . get_feed ( BLOG_COMMENTS_URL % blog_id , auth_token = auth_token , <EOL> desired_class = desired_class , query = query , ** kwargs ) <EOL> GetBlogComments = get_blog_comments <EOL> def get_blog_archive ( self , blog_id , auth_token = None , ** kwargs ) : <EOL> return self . get_feed ( BLOG_ARCHIVE_URL % blog_id , auth_token = auth_token , <EOL> ** kwargs ) <EOL> GetBlogArchive = get_blog_archive <EOL> def add_post ( self , blog_id , title , body , labels = None , draft = False , <EOL> auth_token = None , title_type = '<STR_LIT:text>' , body_type = '<STR_LIT:html>' , ** kwargs ) : <EOL> new_entry = gdata . blogger . data . BlogPost ( <EOL> title = atom . data . Title ( text = title , type = title_type ) , <EOL> content = atom . data . Content ( text = body , type = body_type ) ) <EOL> if labels : <EOL> for label in labels : <EOL> new_entry . add_label ( label ) <EOL> if draft : <EOL> new_entry . control = atom . data . Control ( draft = atom . data . Draft ( text = '<STR_LIT:yes>' ) ) <EOL> return self . post ( new_entry , BLOG_POST_URL % blog_id , auth_token = auth_token , ** kwargs ) <EOL> AddPost = add_post <EOL> def add_comment ( self , blog_id , post_id , body , auth_token = None , <EOL> title_type = '<STR_LIT:text>' , body_type = '<STR_LIT:html>' , ** kwargs ) : <EOL> new_entry = gdata . blogger . data . Comment ( <EOL> content = atom . data . Content ( text = body , type = body_type ) ) <EOL> return self . post ( new_entry , BLOG_POST_COMMENTS_URL % ( blog_id , post_id ) , <EOL> auth_token = auth_token , ** kwargs ) <EOL> AddComment = add_comment <EOL> def update ( self , entry , auth_token = None , ** kwargs ) : <EOL> old_etag = entry . etag <EOL> entry . etag = None <EOL> response = gdata . client . GDClient . update ( self , entry , <EOL> auth_token = auth_token , ** kwargs ) <EOL> entry . etag = old_etag <EOL> return response <EOL> Update = update <EOL> def delete ( self , entry_or_uri , auth_token = None , ** kwargs ) : <EOL> if isinstance ( entry_or_uri , ( str , unicode , atom . http_core . Uri ) ) : <EOL> return gdata . client . GDClient . delete ( self , entry_or_uri , <EOL> auth_token = auth_token , ** kwargs ) <EOL> old_etag = entry_or_uri . etag <EOL> entry_or_uri . etag = None <EOL> response = gdata . client . GDClient . delete ( self , entry_or_uri , <EOL> auth_token = auth_token , ** kwargs ) <EOL> entry_or_uri . etag = old_etag <EOL> return response <EOL> Delete = delete <EOL> class Query ( gdata . client . Query ) : <EOL> def __init__ ( self , order_by = None , ** kwargs ) : <EOL> gdata . client . Query . __init__ ( self , ** kwargs ) <EOL> self . order_by = order_by <EOL> def modify_request ( self , http_request ) : <EOL> gdata . client . _add_query_param ( '<STR_LIT>' , self . order_by , http_request ) <EOL> gdata . client . Query . modify_request ( self , http_request ) <EOL> ModifyRequest = modify_request </s>
<s> """<STR_LIT>""" <EOL> __author__ = u'<STR_LIT>' <EOL> __license__ = '<STR_LIT>' <EOL> __version__ = '<STR_LIT>' [ <NUM_LIT:11> : - <NUM_LIT:2> ] <EOL> import sys , os . path , StringIO <EOL> import time <EOL> import gdata . service <EOL> import gdata <EOL> import atom . service <EOL> import atom <EOL> import gdata . photos <EOL> SUPPORTED_UPLOAD_TYPES = ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> UNKOWN_ERROR = <NUM_LIT:1000> <EOL> GPHOTOS_BAD_REQUEST = <NUM_LIT> <EOL> GPHOTOS_CONFLICT = <NUM_LIT> <EOL> GPHOTOS_INTERNAL_SERVER_ERROR = <NUM_LIT> <EOL> GPHOTOS_INVALID_ARGUMENT = <NUM_LIT> <EOL> GPHOTOS_INVALID_CONTENT_TYPE = <NUM_LIT> <EOL> GPHOTOS_NOT_AN_IMAGE = <NUM_LIT> <EOL> GPHOTOS_INVALID_KIND = <NUM_LIT> <EOL> class GooglePhotosException ( Exception ) : <EOL> def __init__ ( self , response ) : <EOL> self . error_code = response [ '<STR_LIT:status>' ] <EOL> self . reason = response [ '<STR_LIT>' ] . strip ( ) <EOL> if '<STR_LIT>' in str ( response [ '<STR_LIT:body>' ] ) : <EOL> response [ '<STR_LIT:body>' ] = "<STR_LIT>" <EOL> self . body = response [ '<STR_LIT:body>' ] . strip ( ) <EOL> self . message = "<STR_LIT>" % response <EOL> error_map = { '<STR_LIT>' : GPHOTOS_NOT_AN_IMAGE , <EOL> '<STR_LIT>' : <EOL> GPHOTOS_INVALID_KIND , <EOL> } <EOL> for msg , code in error_map . iteritems ( ) : <EOL> if self . body == msg : <EOL> self . error_code = code <EOL> break <EOL> self . args = [ self . error_code , self . reason , self . body ] <EOL> class PhotosService ( gdata . service . GDataService ) : <EOL> userUri = '<STR_LIT>' <EOL> def __init__ ( self , email = None , password = None , source = None , <EOL> server = '<STR_LIT>' , additional_headers = None , <EOL> ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> self . email = email <EOL> self . client = source <EOL> gdata . service . GDataService . __init__ ( <EOL> self , email = email , password = password , service = '<STR_LIT>' , source = source , <EOL> server = server , additional_headers = additional_headers , ** kwargs ) <EOL> def GetFeed ( self , uri , limit = None , start_index = None ) : <EOL> """<STR_LIT>""" <EOL> if limit is not None : <EOL> uri += '<STR_LIT>' % limit <EOL> if start_index is not None : <EOL> uri += '<STR_LIT>' % start_index <EOL> try : <EOL> return self . Get ( uri , converter = gdata . photos . AnyFeedFromString ) <EOL> except gdata . service . RequestError , e : <EOL> raise GooglePhotosException ( e . args [ <NUM_LIT:0> ] ) <EOL> def GetEntry ( self , uri , limit = None , start_index = None ) : <EOL> """<STR_LIT>""" <EOL> if limit is not None : <EOL> uri += '<STR_LIT>' % limit <EOL> if start_index is not None : <EOL> uri += '<STR_LIT>' % start_index <EOL> try : <EOL> return self . Get ( uri , converter = gdata . photos . AnyEntryFromString ) <EOL> except gdata . service . RequestError , e : <EOL> raise GooglePhotosException ( e . args [ <NUM_LIT:0> ] ) <EOL> def GetUserFeed ( self , kind = '<STR_LIT>' , user = '<STR_LIT:default>' , limit = None ) : <EOL> """<STR_LIT>""" <EOL> if isinstance ( kind , ( list , tuple ) ) : <EOL> kind = "<STR_LIT:U+002C>" . join ( kind ) <EOL> uri = '<STR_LIT>' % ( user , kind ) <EOL> return self . GetFeed ( uri , limit = limit ) <EOL> def GetTaggedPhotos ( self , tag , user = '<STR_LIT:default>' , limit = None ) : <EOL> """<STR_LIT>""" <EOL> uri = '<STR_LIT>' % ( user , tag . lower ( ) ) <EOL> return self . GetFeed ( uri , limit ) <EOL> def SearchUserPhotos ( self , query , user = '<STR_LIT:default>' , limit = <NUM_LIT:100> ) : <EOL> """<STR_LIT>""" <EOL> uri = '<STR_LIT>' % ( user , query ) <EOL> return self . GetFeed ( uri , limit = limit ) <EOL> def SearchCommunityPhotos ( self , query , limit = <NUM_LIT:100> ) : <EOL> """<STR_LIT>""" <EOL> uri = '<STR_LIT>' % query <EOL> return self . GetFeed ( uri , limit = limit ) <EOL> def GetContacts ( self , user = '<STR_LIT:default>' , limit = None ) : <EOL> """<STR_LIT>""" <EOL> uri = '<STR_LIT>' % user <EOL> return self . GetFeed ( uri , limit = limit ) <EOL> def SearchContactsPhotos ( self , user = '<STR_LIT:default>' , search = None , limit = None ) : <EOL> """<STR_LIT>""" <EOL> uri = '<STR_LIT>' % ( user , search ) <EOL> return self . GetFeed ( uri , limit = limit ) <EOL> def InsertAlbum ( self , title , summary , location = None , access = '<STR_LIT>' , <EOL> commenting_enabled = '<STR_LIT:true>' , timestamp = None ) : <EOL> """<STR_LIT>""" <EOL> album = gdata . photos . AlbumEntry ( ) <EOL> album . title = atom . Title ( text = title , title_type = '<STR_LIT:text>' ) <EOL> album . summary = atom . Summary ( text = summary , summary_type = '<STR_LIT:text>' ) <EOL> if location is not None : <EOL> album . location = gdata . photos . Location ( text = location ) <EOL> album . access = gdata . photos . Access ( text = access ) <EOL> if commenting_enabled in ( '<STR_LIT:true>' , '<STR_LIT:false>' ) : <EOL> album . commentingEnabled = gdata . photos . CommentingEnabled ( text = commenting_enabled ) <EOL> if timestamp is None : <EOL> timestamp = '<STR_LIT>' % int ( time . time ( ) * <NUM_LIT:1000> ) <EOL> album . timestamp = gdata . photos . Timestamp ( text = timestamp ) <EOL> try : <EOL> return self . Post ( album , uri = self . userUri % self . email , <EOL> converter = gdata . photos . AlbumEntryFromString ) <EOL> except gdata . service . RequestError , e : <EOL> raise GooglePhotosException ( e . args [ <NUM_LIT:0> ] ) <EOL> def InsertPhoto ( self , album_or_uri , photo , filename_or_handle , <EOL> content_type = '<STR_LIT>' ) : <EOL> """<STR_LIT>""" <EOL> try : <EOL> assert ( isinstance ( photo , gdata . photos . PhotoEntry ) ) <EOL> except AssertionError : <EOL> raise GooglePhotosException ( { '<STR_LIT:status>' : GPHOTOS_INVALID_ARGUMENT , <EOL> '<STR_LIT:body>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' % type ( photo ) <EOL> } ) <EOL> try : <EOL> majtype , mintype = content_type . split ( '<STR_LIT:/>' ) <EOL> assert ( mintype in SUPPORTED_UPLOAD_TYPES ) <EOL> except ( ValueError , AssertionError ) : <EOL> raise GooglePhotosException ( { '<STR_LIT:status>' : GPHOTOS_INVALID_CONTENT_TYPE , <EOL> '<STR_LIT:body>' : '<STR_LIT>' % content_type , <EOL> '<STR_LIT>' : '<STR_LIT>' % [ '<STR_LIT>' + t for t in SUPPORTED_UPLOAD_TYPES ] <EOL> } ) <EOL> if isinstance ( filename_or_handle , ( str , unicode ) ) and os . path . exists ( filename_or_handle ) : <EOL> mediasource = gdata . MediaSource ( ) <EOL> mediasource . setFile ( filename_or_handle , content_type ) <EOL> elif hasattr ( filename_or_handle , '<STR_LIT>' ) : <EOL> if hasattr ( filename_or_handle , '<STR_LIT>' ) : <EOL> filename_or_handle . seek ( <NUM_LIT:0> ) <EOL> file_handle = StringIO . StringIO ( filename_or_handle . read ( ) ) <EOL> name = '<STR_LIT:image>' <EOL> if hasattr ( filename_or_handle , '<STR_LIT:name>' ) : <EOL> name = filename_or_handle . name <EOL> mediasource = gdata . MediaSource ( file_handle , content_type , <EOL> content_length = file_handle . len , file_name = name ) <EOL> else : <EOL> raise GooglePhotosException ( { '<STR_LIT:status>' : GPHOTOS_INVALID_ARGUMENT , <EOL> '<STR_LIT:body>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' % type ( filename_or_handle ) <EOL> } ) <EOL> if isinstance ( album_or_uri , ( str , unicode ) ) : <EOL> feed_uri = album_or_uri <EOL> elif hasattr ( album_or_uri , '<STR_LIT>' ) : <EOL> feed_uri = album_or_uri . GetFeedLink ( ) . href <EOL> try : <EOL> return self . Post ( photo , uri = feed_uri , media_source = mediasource , <EOL> converter = gdata . photos . PhotoEntryFromString ) <EOL> except gdata . service . RequestError , e : <EOL> raise GooglePhotosException ( e . args [ <NUM_LIT:0> ] ) <EOL> def InsertPhotoSimple ( self , album_or_uri , title , summary , filename_or_handle , <EOL> content_type = '<STR_LIT>' , keywords = None ) : <EOL> """<STR_LIT>""" <EOL> metadata = gdata . photos . PhotoEntry ( ) <EOL> metadata . title = atom . Title ( text = title ) <EOL> metadata . summary = atom . Summary ( text = summary , summary_type = '<STR_LIT:text>' ) <EOL> if keywords is not None : <EOL> if isinstance ( keywords , list ) : <EOL> keywords = '<STR_LIT:U+002C>' . join ( keywords ) <EOL> metadata . media . keywords = gdata . media . Keywords ( text = keywords ) <EOL> return self . InsertPhoto ( album_or_uri , metadata , filename_or_handle , <EOL> content_type ) <EOL> def UpdatePhotoMetadata ( self , photo ) : <EOL> """<STR_LIT>""" <EOL> try : <EOL> return self . Put ( data = photo , uri = photo . GetEditLink ( ) . href , <EOL> converter = gdata . photos . PhotoEntryFromString ) <EOL> except gdata . service . RequestError , e : <EOL> raise GooglePhotosException ( e . args [ <NUM_LIT:0> ] ) <EOL> def UpdatePhotoBlob ( self , photo_or_uri , filename_or_handle , <EOL> content_type = '<STR_LIT>' ) : <EOL> """<STR_LIT>""" <EOL> try : <EOL> majtype , mintype = content_type . split ( '<STR_LIT:/>' ) <EOL> assert ( mintype in SUPPORTED_UPLOAD_TYPES ) <EOL> except ( ValueError , AssertionError ) : <EOL> raise GooglePhotosException ( { '<STR_LIT:status>' : GPHOTOS_INVALID_CONTENT_TYPE , <EOL> '<STR_LIT:body>' : '<STR_LIT>' % content_type , <EOL> '<STR_LIT>' : '<STR_LIT>' % [ '<STR_LIT>' + t for t in SUPPORTED_UPLOAD_TYPES ] <EOL> } ) <EOL> if isinstance ( filename_or_handle , ( str , unicode ) ) and os . path . exists ( filename_or_handle ) : <EOL> photoblob = gdata . MediaSource ( ) <EOL> photoblob . setFile ( filename_or_handle , content_type ) <EOL> elif hasattr ( filename_or_handle , '<STR_LIT>' ) : <EOL> if hasattr ( filename_or_handle , '<STR_LIT>' ) : <EOL> filename_or_handle . seek ( <NUM_LIT:0> ) <EOL> file_handle = StringIO . StringIO ( filename_or_handle . read ( ) ) <EOL> name = '<STR_LIT:image>' <EOL> if hasattr ( filename_or_handle , '<STR_LIT:name>' ) : <EOL> name = filename_or_handle . name <EOL> mediasource = gdata . MediaSource ( file_handle , content_type , <EOL> content_length = file_handle . len , file_name = name ) <EOL> else : <EOL> raise GooglePhotosException ( { '<STR_LIT:status>' : GPHOTOS_INVALID_ARGUMENT , <EOL> '<STR_LIT:body>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' % type ( filename_or_handle ) <EOL> } ) <EOL> if isinstance ( photo_or_uri , ( str , unicode ) ) : <EOL> entry_uri = photo_or_uri <EOL> elif hasattr ( photo_or_uri , '<STR_LIT>' ) : <EOL> entry_uri = photo_or_uri . GetEditMediaLink ( ) . href <EOL> try : <EOL> return self . Put ( photoblob , entry_uri , <EOL> converter = gdata . photos . PhotoEntryFromString ) <EOL> except gdata . service . RequestError , e : <EOL> raise GooglePhotosException ( e . args [ <NUM_LIT:0> ] ) <EOL> def InsertTag ( self , photo_or_uri , tag ) : <EOL> """<STR_LIT>""" <EOL> tag = gdata . photos . TagEntry ( title = atom . Title ( text = tag ) ) <EOL> if isinstance ( photo_or_uri , ( str , unicode ) ) : <EOL> post_uri = photo_or_uri <EOL> elif hasattr ( photo_or_uri , '<STR_LIT>' ) : <EOL> post_uri = photo_or_uri . GetPostLink ( ) . href <EOL> try : <EOL> return self . Post ( data = tag , uri = post_uri , <EOL> converter = gdata . photos . TagEntryFromString ) <EOL> except gdata . service . RequestError , e : <EOL> raise GooglePhotosException ( e . args [ <NUM_LIT:0> ] ) <EOL> def InsertComment ( self , photo_or_uri , comment ) : <EOL> """<STR_LIT>""" <EOL> comment = gdata . photos . CommentEntry ( content = atom . Content ( text = comment ) ) <EOL> if isinstance ( photo_or_uri , ( str , unicode ) ) : <EOL> post_uri = photo_or_uri <EOL> elif hasattr ( photo_or_uri , '<STR_LIT>' ) : <EOL> post_uri = photo_or_uri . GetPostLink ( ) . href <EOL> try : <EOL> return self . Post ( data = comment , uri = post_uri , <EOL> converter = gdata . photos . CommentEntryFromString ) <EOL> except gdata . service . RequestError , e : <EOL> raise GooglePhotosException ( e . args [ <NUM_LIT:0> ] ) <EOL> def Delete ( self , object_or_uri , * args , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> try : <EOL> uri = object_or_uri . GetEditLink ( ) . href <EOL> except AttributeError : <EOL> uri = object_or_uri <EOL> try : <EOL> return gdata . service . GDataService . Delete ( self , uri , * args , ** kwargs ) <EOL> except gdata . service . RequestError , e : <EOL> raise GooglePhotosException ( e . args [ <NUM_LIT:0> ] ) <EOL> def GetSmallestThumbnail ( media_thumbnail_list ) : <EOL> """<STR_LIT>""" <EOL> r = { } <EOL> for thumb in media_thumbnail_list : <EOL> r [ int ( thumb . width ) * int ( thumb . height ) ] = thumb <EOL> keys = r . keys ( ) <EOL> keys . sort ( ) <EOL> return r [ keys [ <NUM_LIT:0> ] ] <EOL> def ConvertAtomTimestampToEpoch ( timestamp ) : <EOL> """<STR_LIT>""" <EOL> return time . mktime ( time . strptime ( timestamp , '<STR_LIT>' ) ) </s>
<s> """<STR_LIT>""" <EOL> import socket <EOL> import httplib <EOL> from gdata . tlslite . TLSConnection import TLSConnection <EOL> from gdata . tlslite . integration . ClientHelper import ClientHelper <EOL> class HTTPBaseTLSConnection ( httplib . HTTPConnection ) : <EOL> """<STR_LIT>""" <EOL> default_port = <NUM_LIT> <EOL> def __init__ ( self , host , port = None , strict = None ) : <EOL> if strict == None : <EOL> httplib . HTTPConnection . __init__ ( self , host , port ) <EOL> else : <EOL> httplib . HTTPConnection . __init__ ( self , host , port , strict ) <EOL> def connect ( self ) : <EOL> sock = socket . socket ( socket . AF_INET , socket . SOCK_STREAM ) <EOL> if hasattr ( sock , '<STR_LIT>' ) : <EOL> sock . settimeout ( <NUM_LIT:10> ) <EOL> sock . connect ( ( self . host , self . port ) ) <EOL> self . sock = TLSConnection ( sock ) <EOL> self . sock . closeSocket = True <EOL> self . _handshake ( self . sock ) <EOL> def _handshake ( self , tlsConnection ) : <EOL> """<STR_LIT>""" <EOL> raise NotImplementedError ( ) <EOL> class HTTPTLSConnection ( HTTPBaseTLSConnection , ClientHelper ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , host , port = None , <EOL> username = None , password = None , sharedKey = None , <EOL> certChain = None , privateKey = None , <EOL> cryptoID = None , protocol = None , <EOL> x509Fingerprint = None , <EOL> x509TrustList = None , x509CommonName = None , <EOL> settings = None ) : <EOL> """<STR_LIT>""" <EOL> HTTPBaseTLSConnection . __init__ ( self , host , port ) <EOL> ClientHelper . __init__ ( self , <EOL> username , password , sharedKey , <EOL> certChain , privateKey , <EOL> cryptoID , protocol , <EOL> x509Fingerprint , <EOL> x509TrustList , x509CommonName , <EOL> settings ) <EOL> def _handshake ( self , tlsConnection ) : <EOL> ClientHelper . _handshake ( self , tlsConnection ) </s>
<s> """<STR_LIT>""" <EOL> from compat import * <EOL> class RC4 : <EOL> def __init__ ( self , keyBytes , implementation ) : <EOL> if len ( keyBytes ) < <NUM_LIT:16> or len ( keyBytes ) > <NUM_LIT> : <EOL> raise ValueError ( ) <EOL> self . isBlockCipher = False <EOL> self . name = "<STR_LIT>" <EOL> self . implementation = implementation <EOL> def encrypt ( self , plaintext ) : <EOL> raise NotImplementedError ( ) <EOL> def decrypt ( self , ciphertext ) : <EOL> raise NotImplementedError ( ) </s>
<s> __author__ = '<STR_LIT>' <EOL> import httplib <EOL> import logging <EOL> import sys <EOL> import urllib2 <EOL> import hashlib <EOL> from base64 import b64encode <EOL> from oauth import oauth <EOL> import simplejson <EOL> try : <EOL> from google . appengine . api import urlfetch <EOL> except : <EOL> pass <EOL> logging . basicConfig ( level = logging . DEBUG ) <EOL> VERBOSE = <NUM_LIT:0> <EOL> def get_default_urlfetch ( ) : <EOL> """<STR_LIT>""" <EOL> if sys . modules . has_key ( '<STR_LIT>' ) : <EOL> return AppEngineUrlFetch ( ) <EOL> return UrlFetch ( ) <EOL> def log_request ( request ) : <EOL> logging . debug ( '<STR_LIT>' % <EOL> ( request . get_method ( ) , <EOL> request . get_url ( ) , <EOL> str ( request . get_headers ( ) ) , <EOL> request . get_post_body ( ) ) ) <EOL> def log_response ( response ) : <EOL> logging . debug ( '<STR_LIT>' % ( response . status , <EOL> response . content . decode ( '<STR_LIT:utf-8>' ) ) ) <EOL> class UrlFetch ( object ) : <EOL> """<STR_LIT>""" <EOL> def fetch ( self , request ) : <EOL> """<STR_LIT>""" <EOL> log_request ( request ) <EOL> method = request . get_method ( ) <EOL> headers = request . get_headers ( ) <EOL> if VERBOSE > <NUM_LIT:0> : <EOL> logging . info ( "<STR_LIT>" , request . get_url ( ) ) <EOL> req = urllib2 . Request ( request . get_url ( ) , <EOL> data = request . get_post_body ( ) , <EOL> headers = headers ) <EOL> try : <EOL> f = urllib2 . urlopen ( req ) <EOL> result = f . read ( ) <EOL> response = Response ( httplib . OK , result ) <EOL> except urllib2 . URLError , e : <EOL> response = Response ( e . code , e . read ( ) ) <EOL> log_response ( response ) <EOL> return response <EOL> class AppEngineUrlFetch ( UrlFetch ) : <EOL> """<STR_LIT>""" <EOL> def fetch ( self , request ) : <EOL> """<STR_LIT>""" <EOL> log_request ( request ) <EOL> method = request . get_method ( ) <EOL> url = request . get_url ( ) <EOL> body = request . get_post_body ( ) <EOL> headers = request . get_headers ( ) <EOL> result = urlfetch . fetch ( <EOL> method = method , <EOL> url = url , <EOL> payload = body , <EOL> headers = headers ) <EOL> response = Response ( result . status_code , result . content ) <EOL> log_response ( response ) <EOL> return response <EOL> class Request ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , url , method = '<STR_LIT:GET>' , signed_params = None , post_body = None ) : <EOL> self . post_body = post_body or None <EOL> """<STR_LIT>""" <EOL> self . use_body_as_signing_parameter = False <EOL> params = signed_params or { } <EOL> params [ '<STR_LIT>' ] = method <EOL> self . oauth_request = oauth . OAuthRequest . from_request ( method , url , <EOL> parameters = params ) <EOL> assert self . oauth_request <EOL> def add_security_token ( self , security_token , parameter_name = "<STR_LIT>" ) : <EOL> self . oauth_request . set_parameter ( parameter_name , security_token ) <EOL> self . security_token_parameter = parameter_name <EOL> def get_security_token ( self ) : <EOL> if hasattr ( self , "<STR_LIT>" ) : <EOL> return self . oauth_request . get_parameter ( self . security_token_parameter ) <EOL> def set_body_as_signing_parameter ( self , use_body ) : <EOL> self . use_body_as_signing_parameter = use_body <EOL> def sign_request ( self , consumer , signature_method ) : <EOL> """<STR_LIT>""" <EOL> params = { <EOL> '<STR_LIT>' : consumer . key , <EOL> '<STR_LIT>' : oauth . generate_timestamp ( ) , <EOL> '<STR_LIT>' : oauth . generate_nonce ( ) , <EOL> '<STR_LIT>' : oauth . OAuthRequest . version , <EOL> } <EOL> if self . use_body_as_signing_parameter : <EOL> params [ self . get_post_body ( ) ] = "<STR_LIT>" <EOL> else : <EOL> if self . post_body : <EOL> if VERBOSE > <NUM_LIT:0> : <EOL> logging . info ( "<STR_LIT>" % str ( self . post_body ) ) <EOL> body_hash = b64encode ( hashlib . sha1 ( self . get_post_body ( ) ) . digest ( ) ) <EOL> params [ '<STR_LIT>' ] = body_hash <EOL> if self . get_security_token ( ) : <EOL> self . set_parameter ( "<STR_LIT>" , None ) <EOL> self . set_parameters ( params ) <EOL> if VERBOSE > <NUM_LIT:0> : <EOL> key , raw = signature_method . build_signature_base_string ( <EOL> self . oauth_request , consumer , None ) <EOL> logging . info ( "<STR_LIT>" % key ) <EOL> logging . info ( "<STR_LIT>" % raw ) <EOL> self . oauth_request . sign_request ( signature_method , consumer , None ) <EOL> def set_parameter ( self , name , value ) : <EOL> """<STR_LIT>""" <EOL> self . oauth_request . set_parameter ( name , value ) <EOL> def set_parameters ( self , params ) : <EOL> """<STR_LIT>""" <EOL> for name , value in params . iteritems ( ) : <EOL> self . set_parameter ( name , value ) <EOL> def get_parameter ( self , key ) : <EOL> """<STR_LIT>""" <EOL> return self . oauth_request . get_parameter ( key ) <EOL> def get_method ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . oauth_request . get_normalized_http_method ( ) <EOL> def get_url ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . oauth_request . to_url ( ) <EOL> def get_normalized_url ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . oauth_request . get_normalized_http_url ( ) <EOL> def get_headers ( self ) : <EOL> headers = { } <EOL> if self . post_body : <EOL> headers [ '<STR_LIT:Content-Type>' ] = '<STR_LIT:application/json>' <EOL> return headers <EOL> def get_post_body ( self ) : <EOL> """<STR_LIT>""" <EOL> if self . post_body : <EOL> return simplejson . dumps ( self . post_body ) <EOL> return None <EOL> class Response ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , status , content ) : <EOL> self . status = status <EOL> self . content = content </s>
<s> """<STR_LIT>""" </s>
<s> import urllib <EOL> import urllib2 <EOL> import urlparse <EOL> from lxml import etree <EOL> def _normalize_whitespace ( s ) : <EOL> return '<STR_LIT:U+0020>' . join ( s . split ( ) ) <EOL> def _extract_text_help ( root , acc ) : <EOL> if root . text is not None and root . text . strip ( ) : <EOL> acc . append ( _normalize_whitespace ( root . text . strip ( ) ) ) <EOL> for child in root . getchildren ( ) : <EOL> acc = _extract_text_help ( child , acc ) <EOL> if child . tail is not None and child . tail . strip ( ) : <EOL> acc . append ( _normalize_whitespace ( child . tail . strip ( ) ) ) <EOL> return acc <EOL> def _extract_text ( root ) : <EOL> return '<STR_LIT:U+0020>' . join ( _extract_text_help ( root , [ ] ) ) <EOL> def _extract ( elt , doc ) : <EOL> """<STR_LIT>""" <EOL> if '<STR_LIT>' in elt . attrib or '<STR_LIT>' in elt . attrib : <EOL> return MicrodataObject ( elt , doc ) <EOL> tag = elt . tag <EOL> if tag == '<STR_LIT:a>' and '<STR_LIT>' in elt . attrib : <EOL> href = elt . attrib [ '<STR_LIT>' ] <EOL> if href . startswith ( '<STR_LIT:#>' ) : <EOL> target = doc . _doc . getroot ( ) . find ( "<STR_LIT>" % href [ <NUM_LIT:1> : ] ) <EOL> if target is not None : return _extract ( target , doc ) <EOL> else : <EOL> up = urlparse . urlparse ( href ) <EOL> remote_doc = enter ( urlparse . urlunparse ( ( up . scheme , up . netloc , up . path , up . params , up . query , '<STR_LIT>' ) ) ) <EOL> if up . fragment : <EOL> target = remote_doc . _doc . getroot ( ) . find ( "<STR_LIT>" % up . fragment ) <EOL> if target is not None : return _extract ( target , remote_doc ) <EOL> if len ( remote_doc . objects ) == <NUM_LIT:1> : return remote_doc . objects [ <NUM_LIT:0> ] <EOL> return _extract ( remote_doc . _doc . getroot ( ) , remote_doc ) <EOL> if tag == '<STR_LIT>' : return elt . attrib [ '<STR_LIT:src>' ] <EOL> return _extract_text ( elt ) <EOL> def _value_of ( doc , fragment = '<STR_LIT>' ) : <EOL> if fragment : <EOL> target = doc . _doc . getroot ( ) . find ( "<STR_LIT>" % fragment ) <EOL> if target is not None : return _extract ( target , doc ) <EOL> if len ( doc . objects ) == <NUM_LIT:1> : return doc . objects [ <NUM_LIT:0> ] <EOL> if len ( doc . objects ) > <NUM_LIT:0> : return doc . objects <EOL> return _extract ( doc . _doc . getroot ( ) , doc ) <EOL> class Link ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , elt , doc ) : <EOL> self . _elt = elt <EOL> self . _doc = doc <EOL> def __repr__ ( self ) : <EOL> return "<STR_LIT>" % ( self . _elt . attrib [ '<STR_LIT>' ] , id ( self ) ) <EOL> def follow ( self ) : <EOL> href = self . _elt . attrib [ '<STR_LIT>' ] <EOL> resolved = urlparse . urljoin ( self . _doc . _url , href ) <EOL> up = urlparse . urlparse ( resolved ) <EOL> resolved_base = urlparse . urlunparse ( ( up . scheme , up . netloc , up . path , <EOL> up . params , up . query , '<STR_LIT>' ) ) <EOL> if resolved_base == self . _doc . _url : <EOL> return _value_of ( self . _doc , up . fragment ) <EOL> else : <EOL> remote_doc = enter ( resolved_base ) <EOL> return _value_of ( remote_doc , up . fragment ) <EOL> class Form ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , elt , doc ) : <EOL> self . _elt = elt <EOL> self . _doc = doc <EOL> def __repr__ ( self ) : <EOL> if '<STR_LIT>' not in self . _elt . attrib : <EOL> return "<STR_LIT>" % id ( self ) <EOL> return "<STR_LIT>" % ( self . _elt . attrib [ '<STR_LIT>' ] , id ( self ) ) <EOL> def _set_value_for ( self , elt , args , params ) : <EOL> if '<STR_LIT:name>' not in elt . attrib : return <EOL> name = elt . attrib [ '<STR_LIT:name>' ] <EOL> if name in args : <EOL> params [ name ] = args [ name ] <EOL> else : <EOL> if '<STR_LIT:value>' in elt . attrib : <EOL> params [ name ] = elt . attrib [ '<STR_LIT:value>' ] <EOL> else : <EOL> params [ name ] = "<STR_LIT>" <EOL> def _get_params ( self ) : <EOL> out = [ ] <EOL> for elt in self . _elt . findall ( "<STR_LIT>" ) : <EOL> if '<STR_LIT:type>' in elt . attrib and elt . attrib [ '<STR_LIT:type>' ] == '<STR_LIT>' : <EOL> continue <EOL> if '<STR_LIT:name>' in elt . attrib : out . append ( elt . attrib [ '<STR_LIT:name>' ] ) <EOL> return out <EOL> params = property ( _get_params ) <EOL> def _build_params ( self , args ) : <EOL> params = { } <EOL> for elt in self . _elt . findall ( "<STR_LIT>" ) : <EOL> self . _set_value_for ( elt , args , params ) <EOL> for elt in self . _elt . findall ( "<STR_LIT>" ) : <EOL> self . _set_value_for ( elt , args , params ) <EOL> return urllib . urlencode ( params ) <EOL> def submit ( self , args = { } ) : <EOL> action = urlparse . urljoin ( self . _doc . _url , self . _elt . attrib [ '<STR_LIT:action>' ] ) <EOL> params = self . _build_params ( args ) <EOL> if '<STR_LIT>' not in self . _elt . attrib or self . _elt . attrib [ '<STR_LIT>' ] == '<STR_LIT:GET>' : <EOL> up = urlparse . urlparse ( action ) <EOL> if up . params : allparams = "<STR_LIT>" % ( up . params , params ) <EOL> else : allparams = params <EOL> where = urlparse . urlunparse ( ( up . scheme , up . netloc , up . path , <EOL> up . params , allparams , '<STR_LIT>' ) ) <EOL> return enter ( where ) <EOL> else : <EOL> print "<STR_LIT:POST>" , action , "<STR_LIT>" , <EOL> f = urllib2 . urlopen ( action , params ) <EOL> print "<STR_LIT:OK>" <EOL> return MicrodataDocument ( f , action ) <EOL> class MicrodataObject ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , root , doc ) : <EOL> self . _root = root <EOL> self . _doc = doc <EOL> self . _propmap = None <EOL> self . _linkmap = None <EOL> self . _formmap = None <EOL> self . _orphan_forms = None <EOL> def __repr__ ( self ) : <EOL> t = self . itemtype <EOL> if t is None : return "<STR_LIT>" % id ( self ) <EOL> return "<STR_LIT>" % ( self . itemtype , id ( self ) ) <EOL> def _dfs_build_help ( self , elt ) : <EOL> if '<STR_LIT>' in elt . attrib : <EOL> prop = elt . attrib [ '<STR_LIT>' ] <EOL> if prop not in self . _propmap : self . _propmap [ prop ] = [ ] <EOL> self . _propmap [ prop ] . append ( elt ) <EOL> if '<STR_LIT>' in elt . attrib : return <EOL> for child in elt . getchildren ( ) : <EOL> self . _dfs_build_help ( child ) <EOL> def _dfs_form_help ( self , elt ) : <EOL> if elt . tag == '<STR_LIT>' : <EOL> if '<STR_LIT>' in elt . attrib : <EOL> rel = elt . attrib [ '<STR_LIT>' ] <EOL> if rel not in self . _formmap : self . _formmap [ rel ] = [ ] <EOL> self . _formmap [ rel ] . append ( Form ( elt , self . _doc ) ) <EOL> else : <EOL> self . _orphan_forms . append ( Form ( elt , self . _doc ) ) <EOL> if '<STR_LIT>' in elt . attrib : return <EOL> for child in elt . getchildren ( ) : <EOL> self . _dfs_form_help ( child ) <EOL> def _build_formmap ( self ) : <EOL> self . _formmap = { } <EOL> self . _orphan_forms = [ ] <EOL> for child in self . _root . getchildren ( ) : <EOL> self . _dfs_form_help ( child ) <EOL> def _dfs_link_help ( self , elt ) : <EOL> if elt . tag == '<STR_LIT:a>' and '<STR_LIT>' in elt . attrib : <EOL> rel = elt . attrib [ '<STR_LIT>' ] <EOL> if rel not in self . _linkmap : self . _linkmap [ rel ] = [ ] <EOL> self . _linkmap [ rel ] . append ( Link ( elt , self . _doc ) ) <EOL> if '<STR_LIT>' in elt . attrib : return <EOL> for child in elt . getchildren ( ) : <EOL> self . _dfs_link_help ( child ) <EOL> def _build_linkmap ( self ) : <EOL> self . _linkmap = { } <EOL> for child in self . _root . getchildren ( ) : <EOL> self . _dfs_link_help ( child ) <EOL> def _build_propmap ( self ) : <EOL> self . _propmap = { } <EOL> for child in self . _root . getchildren ( ) : <EOL> self . _dfs_build_help ( child ) <EOL> def _get_propmap ( self ) : <EOL> if self . _propmap is None : self . _build_propmap ( ) <EOL> return self . _propmap <EOL> def __len__ ( self ) : return self . _get_propmap ( ) . __len__ ( ) <EOL> def __contains__ ( self , x ) : return self . _get_propmap ( ) . __contains__ ( x ) <EOL> def __iter__ ( self ) : return self . _get_propmap ( ) . __iter__ ( ) <EOL> def get_property ( self , prop , raw = False , allow_multi = True ) : <EOL> propmap = self . _get_propmap ( ) <EOL> if prop not in propmap : <EOL> self_link = self . get_links ( "<STR_LIT>" , raw = False , allow_multi = False ) <EOL> if self_link is not None : <EOL> alt = self_link . follow ( ) <EOL> if alt is not None and type ( alt ) == MicrodataObject : <EOL> return alt . get_property ( prop , raw , allow_multi ) <EOL> return None <EOL> vals = propmap [ prop ] <EOL> if not raw : <EOL> vals = map ( lambda v : _extract ( v , self . _doc ) , vals ) <EOL> if len ( vals ) == <NUM_LIT:0> : return None <EOL> if len ( vals ) == <NUM_LIT:1> or not allow_multi : return vals [ <NUM_LIT:0> ] <EOL> return vals <EOL> def get_props ( self ) : <EOL> return self . _get_propmap ( ) . keys ( ) <EOL> props = property ( get_props ) <EOL> def get_itemtype ( self ) : <EOL> if '<STR_LIT>' not in self . _root . attrib : return None <EOL> return self . _root . attrib [ '<STR_LIT>' ] <EOL> itemtype = property ( get_itemtype ) <EOL> def _get_linkmap ( self ) : <EOL> if self . _linkmap is None : self . _build_linkmap ( ) <EOL> return self . _linkmap <EOL> links = property ( _get_linkmap ) <EOL> def _get_formmap ( self ) : <EOL> if self . _formmap is None : self . _build_formmap ( ) <EOL> return self . _formmap <EOL> forms = property ( _get_formmap ) <EOL> def submit ( self , rel , args ) : <EOL> return self . forms [ rel ] [ <NUM_LIT:0> ] . submit ( args ) <EOL> def get_links ( self , rel , raw = False , allow_multi = True ) : <EOL> linkmap = self . _get_linkmap ( ) <EOL> if rel not in linkmap : return None <EOL> links = linkmap [ rel ] <EOL> if raw : <EOL> return map ( lambda l : l . _elt , links ) <EOL> if len ( links ) == <NUM_LIT:0> : return None <EOL> if len ( links ) == <NUM_LIT:1> or not allow_multi : return links [ <NUM_LIT:0> ] <EOL> return out <EOL> def __getitem__ ( self , name ) : <EOL> return self . get_property ( name , raw = False , allow_multi = False ) <EOL> def __getattr__ ( self , name ) : <EOL> return self . get_property ( name , raw = False , allow_multi = False ) <EOL> class MicrodataDocument : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , f , url ) : <EOL> parser = etree . HTMLParser ( ) <EOL> self . _doc = etree . parse ( f , parser ) <EOL> self . _url = url <EOL> def _dfs_help ( self , root , acc ) : <EOL> if '<STR_LIT>' in root . attrib and '<STR_LIT>' not in root . attrib : <EOL> acc . append ( MicrodataObject ( root , self ) ) <EOL> return acc <EOL> for child in root . getchildren ( ) : <EOL> acc = self . _dfs_help ( child , acc ) <EOL> return acc <EOL> def _get_forms ( self ) : <EOL> fake_obj = MicrodataObject ( self . _doc . getroot ( ) , self ) <EOL> return fake_obj . forms <EOL> forms = property ( _get_forms ) <EOL> def _get_links ( self ) : <EOL> fake_obj = MicrodataObject ( self . _doc . getroot ( ) , self ) <EOL> return fake_obj . links <EOL> links = property ( _get_links ) <EOL> def _get_orphan_forms ( self ) : <EOL> fake_obj = MicrodataObject ( self . _doc . getroot ( ) , self ) <EOL> return fake_obj . _orphan_forms <EOL> orphan_forms = property ( _get_orphan_forms ) <EOL> def _get_all_forms ( self ) : <EOL> return map ( lambda elt : Form ( elt , self ) , <EOL> self . _doc . getroot ( ) . findall ( "<STR_LIT>" ) ) <EOL> allforms = property ( _get_all_forms ) <EOL> def follow ( self , rel ) : <EOL> return self . links [ rel ] [ <NUM_LIT:0> ] . follow ( ) <EOL> def submit ( self , rel , args ) : <EOL> return self . forms [ rel ] [ <NUM_LIT:0> ] . submit ( args ) <EOL> def get_toplevel_objects ( self ) : <EOL> return self . _dfs_help ( self . _doc . getroot ( ) , [ ] ) <EOL> objects = property ( get_toplevel_objects ) <EOL> def enter ( url ) : <EOL> print "<STR_LIT:GET>" , url , "<STR_LIT>" , <EOL> f = urllib2 . urlopen ( url ) <EOL> print "<STR_LIT:OK>" <EOL> return MicrodataDocument ( f , url ) </s>
<s> from . construct_nodes import EnamlDefConstruct <EOL> from . exceptions import DeclarativeException <EOL> from . resolver import Resolver <EOL> def __make_enamldef_helper ( dct , f_globals ) : <EOL> """<STR_LIT>""" <EOL> node = EnamlDefConstruct . from_dict ( dct ) <EOL> try : <EOL> Resolver . resolve ( node , f_globals ) <EOL> except DeclarativeException as e : <EOL> raise e <EOL> cls = node . typeclass <EOL> cls . __constructs__ += ( node , ) <EOL> return cls </s>
<s> from collections import deque <EOL> import sys <EOL> import warnings <EOL> from atom . api import Atom , Int , Bool , Coerced , Enum , List , Unicode <EOL> from enaml . nodevisitor import NodeVisitor <EOL> from . geometry import Rect <EOL> def _coerce_rect ( value ) : <EOL> """<STR_LIT>""" <EOL> if isinstance ( value , ( list , tuple ) ) : <EOL> return Rect ( * value ) <EOL> msg = "<STR_LIT>" <EOL> raise TypeError ( msg % type ( value ) . __name__ ) <EOL> class LayoutNode ( Atom ) : <EOL> """<STR_LIT>""" <EOL> def children ( self ) : <EOL> """<STR_LIT>""" <EOL> return [ ] <EOL> def traverse ( self , depth_first = False ) : <EOL> """<STR_LIT>""" <EOL> if depth_first : <EOL> stack = [ ( None , self ) ] <EOL> stack_pop = stack . pop <EOL> stack_extend = stack . extend <EOL> else : <EOL> stack = deque ( [ ( None , self ) ] ) <EOL> stack_pop = stack . popleft <EOL> stack_extend = stack . extend <EOL> while stack : <EOL> parent , node = stack_pop ( ) <EOL> yield parent , node <EOL> stack_extend ( ( node , child ) for child in node . children ( ) ) <EOL> def find ( self , kind ) : <EOL> """<STR_LIT>""" <EOL> for parent , node in self . traverse ( ) : <EOL> if isinstance ( node , kind ) : <EOL> return node <EOL> def find_all ( self , kind ) : <EOL> """<STR_LIT>""" <EOL> res = [ ] <EOL> for parent , node in self . traverse ( ) : <EOL> if isinstance ( node , kind ) : <EOL> res . append ( node ) <EOL> return res <EOL> class ItemLayout ( LayoutNode ) : <EOL> """<STR_LIT>""" <EOL> name = Unicode ( ) <EOL> floating = Bool ( False ) <EOL> geometry = Coerced ( Rect , ( - <NUM_LIT:1> , - <NUM_LIT:1> , - <NUM_LIT:1> , - <NUM_LIT:1> ) , coercer = _coerce_rect ) <EOL> linked = Bool ( False ) <EOL> maximized = Bool ( False ) <EOL> def __init__ ( self , name , ** kwargs ) : <EOL> super ( ItemLayout , self ) . __init__ ( name = name , ** kwargs ) <EOL> class TabLayout ( LayoutNode ) : <EOL> """<STR_LIT>""" <EOL> tab_position = Enum ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT:left>' , '<STR_LIT:right>' ) <EOL> index = Int ( <NUM_LIT:0> ) <EOL> items = List ( Coerced ( ItemLayout ) ) <EOL> def __init__ ( self , * items , ** kwargs ) : <EOL> super ( TabLayout , self ) . __init__ ( items = list ( items ) , ** kwargs ) <EOL> def children ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . items [ : ] <EOL> class _SplitLayoutItem ( object ) : <EOL> """<STR_LIT>""" <EOL> class __metaclass__ ( type ) : <EOL> def __instancecheck__ ( cls , instance ) : <EOL> return isinstance ( instance , ( ItemLayout , TabLayout , SplitLayout ) ) <EOL> def __call__ ( cls , item ) : <EOL> if isinstance ( item , basestring ) : <EOL> return ItemLayout ( item ) <EOL> msg = "<STR_LIT>" <EOL> raise TypeError ( msg % type ( item ) . __name__ ) <EOL> class SplitLayout ( LayoutNode ) : <EOL> """<STR_LIT>""" <EOL> orientation = Enum ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> sizes = List ( Int ( ) ) <EOL> items = List ( Coerced ( _SplitLayoutItem ) ) <EOL> def __init__ ( self , * items , ** kwargs ) : <EOL> super ( SplitLayout , self ) . __init__ ( items = list ( items ) , ** kwargs ) <EOL> def children ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . items [ : ] <EOL> class HSplitLayout ( SplitLayout ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , * items , ** kwargs ) : <EOL> kwargs [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> super ( HSplitLayout , self ) . __init__ ( * items , ** kwargs ) <EOL> class VSplitLayout ( SplitLayout ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , * items , ** kwargs ) : <EOL> kwargs [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> super ( VSplitLayout , self ) . __init__ ( * items , ** kwargs ) <EOL> class DockBarLayout ( LayoutNode ) : <EOL> """<STR_LIT>""" <EOL> position = Enum ( '<STR_LIT>' , '<STR_LIT:right>' , '<STR_LIT>' , '<STR_LIT:left>' ) <EOL> items = List ( Coerced ( ItemLayout ) ) <EOL> def __init__ ( self , * items , ** kwargs ) : <EOL> super ( DockBarLayout , self ) . __init__ ( items = list ( items ) , ** kwargs ) <EOL> def children ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . items [ : ] <EOL> class _AreaLayoutItem ( object ) : <EOL> """<STR_LIT>""" <EOL> class __metaclass__ ( type ) : <EOL> def __instancecheck__ ( cls , instance ) : <EOL> allowed = ( type ( None ) , ItemLayout , TabLayout , SplitLayout ) <EOL> return isinstance ( instance , allowed ) <EOL> def __call__ ( cls , item ) : <EOL> if isinstance ( item , basestring ) : <EOL> return ItemLayout ( item ) <EOL> msg = "<STR_LIT>" <EOL> raise TypeError ( msg % type ( item ) . __name__ ) <EOL> class AreaLayout ( LayoutNode ) : <EOL> """<STR_LIT>""" <EOL> item = Coerced ( _AreaLayoutItem ) <EOL> dock_bars = List ( DockBarLayout ) <EOL> floating = Bool ( False ) <EOL> geometry = Coerced ( Rect , ( - <NUM_LIT:1> , - <NUM_LIT:1> , - <NUM_LIT:1> , - <NUM_LIT:1> ) , coercer = _coerce_rect ) <EOL> linked = Bool ( False ) <EOL> maximized = Bool ( False ) <EOL> def __init__ ( self , item = None , ** kwargs ) : <EOL> super ( AreaLayout , self ) . __init__ ( item = item , ** kwargs ) <EOL> def children ( self ) : <EOL> """<STR_LIT>""" <EOL> item = self . item <EOL> base = [ item ] if item is not None else [ ] <EOL> return base + self . dock_bars <EOL> class _DockLayoutItem ( object ) : <EOL> """<STR_LIT>""" <EOL> class __metaclass__ ( type ) : <EOL> def __instancecheck__ ( cls , instance ) : <EOL> return isinstance ( instance , ( ItemLayout , AreaLayout ) ) <EOL> def __call__ ( cls , item ) : <EOL> if isinstance ( item , basestring ) : <EOL> return ItemLayout ( item ) <EOL> if isinstance ( item , ( SplitLayout , TabLayout ) ) : <EOL> return AreaLayout ( item ) <EOL> msg = "<STR_LIT>" <EOL> raise TypeError ( msg % type ( item ) . __name__ ) <EOL> class DockLayout ( LayoutNode ) : <EOL> """<STR_LIT>""" <EOL> items = List ( Coerced ( _DockLayoutItem ) ) <EOL> def __init__ ( self , * items , ** kwargs ) : <EOL> super ( DockLayout , self ) . __init__ ( items = list ( items ) , ** kwargs ) <EOL> def children ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . items [ : ] <EOL> class DockLayoutWarning ( UserWarning ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> class DockLayoutValidator ( NodeVisitor ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , available ) : <EOL> """<STR_LIT>""" <EOL> self . _available = set ( available ) <EOL> def warn ( self , message ) : <EOL> """<STR_LIT>""" <EOL> f_globals = self . _caller . f_globals <EOL> f_lineno = self . _caller . f_lineno <EOL> f_mod = f_globals . get ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> f_name = f_globals . get ( '<STR_LIT>' ) <EOL> if f_name : <EOL> if f_name . lower ( ) . endswith ( ( "<STR_LIT>" , "<STR_LIT>" ) ) : <EOL> f_name = f_name [ : - <NUM_LIT:1> ] <EOL> else : <EOL> if f_mod == "<STR_LIT:__main__>" : <EOL> f_name = sys . argv [ <NUM_LIT:0> ] <EOL> if not f_name : <EOL> f_name = f_mod <EOL> warnings . warn_explicit ( <EOL> message , DockLayoutWarning , f_name , f_lineno , f_mod , f_globals <EOL> ) <EOL> def setup ( self , node ) : <EOL> """<STR_LIT>""" <EOL> self . _caller = sys . _getframe ( <NUM_LIT:2> ) <EOL> self . _seen_items = set ( ) <EOL> self . _cant_maximize = { } <EOL> def teardown ( self , node ) : <EOL> """<STR_LIT>""" <EOL> for name in self . _available - self . _seen_items : <EOL> msg = "<STR_LIT>" <EOL> self . warn ( msg % name ) <EOL> for name in self . _seen_items - self . _available : <EOL> msg = "<STR_LIT>" <EOL> self . warn ( msg % name ) <EOL> del self . _caller <EOL> del self . _seen_items <EOL> del self . _cant_maximize <EOL> def visit_ItemLayout ( self , node ) : <EOL> """<STR_LIT>""" <EOL> if node . name in self . _seen_items : <EOL> self . warn ( "<STR_LIT>" % node . name ) <EOL> self . _seen_items . add ( node . name ) <EOL> if not node . floating : <EOL> if - <NUM_LIT:1> not in node . geometry : <EOL> self . warn ( "<STR_LIT>" ) <EOL> if node . linked : <EOL> self . warn ( "<STR_LIT>" ) <EOL> if node . maximized and node in self . _cant_maximize : <EOL> msg = "<STR_LIT>" <EOL> self . warn ( msg % self . _cant_maximize [ node ] ) <EOL> def visit_TabLayout ( self , node ) : <EOL> """<STR_LIT>""" <EOL> for item in node . items : <EOL> self . _cant_maximize [ item ] = '<STR_LIT>' <EOL> self . visit ( item ) <EOL> def visit_SplitLayout ( self , node ) : <EOL> """<STR_LIT>""" <EOL> if len ( node . sizes ) > <NUM_LIT:0> : <EOL> if len ( node . sizes ) != len ( node . items ) : <EOL> self . warn ( "<STR_LIT>" ) <EOL> for item in node . items : <EOL> if isinstance ( item , SplitLayout ) : <EOL> if item . orientation == node . orientation : <EOL> msg = "<STR_LIT>" <EOL> self . warn ( msg ) <EOL> self . visit ( item ) <EOL> def visit_DockBarLayout ( self , node ) : <EOL> """<STR_LIT>""" <EOL> for item in node . items : <EOL> self . _cant_maximize [ item ] = '<STR_LIT>' <EOL> self . visit ( item ) <EOL> def visit_AreaLayout ( self , node ) : <EOL> """<STR_LIT>""" <EOL> if not node . floating : <EOL> if - <NUM_LIT:1> not in node . geometry : <EOL> self . warn ( "<STR_LIT>" ) <EOL> if node . linked : <EOL> self . warn ( "<STR_LIT>" ) <EOL> if node . maximized : <EOL> self . warn ( "<STR_LIT>" ) <EOL> if node . item is not None : <EOL> self . visit ( node . item ) <EOL> seen_positions = set ( ) <EOL> for bar in node . dock_bars : <EOL> if bar . position in seen_positions : <EOL> msg = "<STR_LIT>" <EOL> self . warn ( msg % bar . position ) <EOL> seen_positions . add ( bar . position ) <EOL> self . visit ( bar ) <EOL> def visit_DockLayout ( self , node ) : <EOL> """<STR_LIT>""" <EOL> has_non_floating_area = False <EOL> for item in node . items : <EOL> if isinstance ( item , ItemLayout ) : <EOL> if not item . floating : <EOL> self . warn ( "<STR_LIT>" ) <EOL> else : <EOL> if not item . floating : <EOL> if has_non_floating_area : <EOL> self . warn ( "<STR_LIT>" ) <EOL> has_non_floating_area = True <EOL> self . visit ( item ) <EOL> class DockLayoutOp ( Atom ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> class InsertItem ( DockLayoutOp ) : <EOL> """<STR_LIT>""" <EOL> item = Unicode ( ) <EOL> target = Unicode ( ) <EOL> position = Enum ( '<STR_LIT:left>' , '<STR_LIT>' , '<STR_LIT:right>' , '<STR_LIT>' ) <EOL> class InsertBorderItem ( DockLayoutOp ) : <EOL> """<STR_LIT>""" <EOL> item = Unicode ( ) <EOL> target = Unicode ( ) <EOL> position = Enum ( '<STR_LIT:left>' , '<STR_LIT>' , '<STR_LIT:right>' , '<STR_LIT>' ) <EOL> class InsertDockBarItem ( DockLayoutOp ) : <EOL> """<STR_LIT>""" <EOL> item = Unicode ( ) <EOL> target = Unicode ( ) <EOL> position = Enum ( '<STR_LIT:right>' , '<STR_LIT:left>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> index = Int ( - <NUM_LIT:1> ) <EOL> class InsertTab ( DockLayoutOp ) : <EOL> """<STR_LIT>""" <EOL> item = Unicode ( ) <EOL> target = Unicode ( ) <EOL> index = Int ( - <NUM_LIT:1> ) <EOL> tab_position = Enum ( '<STR_LIT:default>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT:left>' , '<STR_LIT:right>' ) <EOL> class FloatItem ( DockLayoutOp ) : <EOL> """<STR_LIT>""" <EOL> item = Coerced ( ItemLayout ) <EOL> class FloatArea ( DockLayoutOp ) : <EOL> """<STR_LIT>""" <EOL> area = Coerced ( AreaLayout ) <EOL> class RemoveItem ( DockLayoutOp ) : <EOL> """<STR_LIT>""" <EOL> item = Unicode ( ) <EOL> class ExtendItem ( DockLayoutOp ) : <EOL> """<STR_LIT>""" <EOL> item = Unicode ( ) <EOL> class RetractItem ( DockLayoutOp ) : <EOL> """<STR_LIT>""" <EOL> item = Unicode ( ) <EOL> import os <EOL> if os . environ . get ( '<STR_LIT>' ) : <EOL> class dockitem ( Atom ) : <EOL> """<STR_LIT>""" <EOL> name = Unicode ( ) <EOL> geometry = Coerced ( Rect , ( - <NUM_LIT:1> , - <NUM_LIT:1> , - <NUM_LIT:1> , - <NUM_LIT:1> ) , coercer = _coerce_rect ) <EOL> maximized = Bool ( False ) <EOL> linked = Bool ( False ) <EOL> def __init__ ( self , name , ** kwargs ) : <EOL> super ( dockitem , self ) . __init__ ( name = name , ** kwargs ) <EOL> def traverse ( self ) : <EOL> yield self <EOL> def _coerce_item ( thing ) : <EOL> """<STR_LIT>""" <EOL> if isinstance ( thing , basestring ) : <EOL> return dockitem ( thing ) <EOL> msg = "<STR_LIT>" <EOL> raise TypeError ( msg % type ( thing ) . __name__ ) <EOL> class docktabs ( Atom ) : <EOL> """<STR_LIT>""" <EOL> tab_position = Enum ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT:left>' , '<STR_LIT:right>' ) <EOL> index = Int ( <NUM_LIT:0> ) <EOL> children = List ( Coerced ( dockitem , coercer = _coerce_item ) ) <EOL> def __init__ ( self , * children , ** kwargs ) : <EOL> super ( docktabs , self ) . __init__ ( children = list ( children ) , ** kwargs ) <EOL> def traverse ( self ) : <EOL> yield self <EOL> for child in self . children : <EOL> for item in child . traverse ( ) : <EOL> yield item <EOL> class _splitnode ( object ) : <EOL> """<STR_LIT>""" <EOL> class __metaclass__ ( type ) : <EOL> def __instancecheck__ ( cls , instance ) : <EOL> return isinstance ( instance , ( dockitem , docktabs , docksplit ) ) <EOL> def __call__ ( cls , item ) : <EOL> if isinstance ( item , basestring ) : <EOL> return dockitem ( item ) <EOL> msg = "<STR_LIT>" <EOL> raise TypeError ( msg % type ( item ) . __name__ ) <EOL> class docksplit ( Atom ) : <EOL> """<STR_LIT>""" <EOL> orientation = Enum ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> sizes = List ( int ) <EOL> children = List ( Coerced ( _splitnode ) ) <EOL> def __init__ ( self , * children , ** kwargs ) : <EOL> super ( docksplit , self ) . __init__ ( children = list ( children ) , ** kwargs ) <EOL> def traverse ( self ) : <EOL> yield self <EOL> for child in self . children : <EOL> for item in child . traverse ( ) : <EOL> yield item <EOL> def hdocksplit ( * args , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> kwargs . setdefault ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> return docksplit ( * args , ** kwargs ) <EOL> def vdocksplit ( * args , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> kwargs . setdefault ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> return docksplit ( * args , ** kwargs ) <EOL> class _areanode ( object ) : <EOL> """<STR_LIT>""" <EOL> class __metaclass__ ( type ) : <EOL> def __instancecheck__ ( cls , instance ) : <EOL> return isinstance ( instance , ( dockitem , docktabs , docksplit ) ) <EOL> def __call__ ( cls , item ) : <EOL> if isinstance ( item , basestring ) : <EOL> return dockitem ( item ) <EOL> msg = "<STR_LIT>" <EOL> raise TypeError ( msg % type ( item ) . __name__ ) <EOL> class dockarea ( Atom ) : <EOL> """<STR_LIT>""" <EOL> geometry = Coerced ( Rect , ( - <NUM_LIT:1> , - <NUM_LIT:1> , - <NUM_LIT:1> , - <NUM_LIT:1> ) , coercer = _coerce_rect ) <EOL> maximized = Bool ( False ) <EOL> maximized_item = Unicode ( ) <EOL> linked = Bool ( False ) <EOL> child = Coerced ( _areanode ) <EOL> def __init__ ( self , child , ** kwargs ) : <EOL> super ( dockarea , self ) . __init__ ( child = child , ** kwargs ) <EOL> def traverse ( self ) : <EOL> yield self <EOL> for item in self . child . traverse ( ) : <EOL> yield item <EOL> class _primarynode ( object ) : <EOL> """<STR_LIT>""" <EOL> class __metaclass__ ( type ) : <EOL> def __instancecheck__ ( cls , instance ) : <EOL> return isinstance ( instance , ( type ( None ) , dockarea , dockitem ) ) <EOL> def __call__ ( cls , item ) : <EOL> if isinstance ( item , basestring ) : <EOL> return dockitem ( item ) <EOL> if isinstance ( item , ( docksplit , docktabs ) ) : <EOL> return dockarea ( item ) <EOL> msg = "<STR_LIT>" <EOL> raise TypeError ( msg % type ( item ) . __name__ ) <EOL> class _secondarynode ( object ) : <EOL> """<STR_LIT>""" <EOL> class __metaclass__ ( type ) : <EOL> def __instancecheck__ ( cls , instance ) : <EOL> return isinstance ( instance , ( dockarea , dockitem ) ) <EOL> def __call__ ( cls , item ) : <EOL> if isinstance ( item , basestring ) : <EOL> return dockitem ( item ) <EOL> if isinstance ( item , ( docksplit , docktabs ) ) : <EOL> return dockarea ( item ) <EOL> msg = "<STR_LIT>" <EOL> raise TypeError ( msg % type ( item ) . __name__ ) <EOL> class docklayout ( Atom ) : <EOL> """<STR_LIT>""" <EOL> primary = Coerced ( _primarynode ) <EOL> secondary = List ( Coerced ( _secondarynode ) ) <EOL> def __init__ ( self , primary , * secondary , ** kwargs ) : <EOL> sup = super ( docklayout , self ) <EOL> sup . __init__ ( primary = primary , secondary = list ( secondary ) , ** kwargs ) <EOL> def traverse ( self ) : <EOL> yield self <EOL> if self . primary is not None : <EOL> for item in self . primary . traverse ( ) : <EOL> yield item <EOL> for secondary in self . secondary : <EOL> for item in secondary . traverse ( ) : <EOL> yield item <EOL> def convert_to_new_docklayout ( layout ) : <EOL> """<STR_LIT>""" <EOL> assert isinstance ( layout , docklayout ) <EOL> def h_generic ( item ) : <EOL> if isinstance ( item , dockitem ) : <EOL> return h_dockitem ( item ) <EOL> if isinstance ( item , docktabs ) : <EOL> return h_docktabs ( item ) <EOL> if isinstance ( item , docksplit ) : <EOL> return h_docksplit ( item ) <EOL> if isinstance ( item , dockarea ) : <EOL> return h_dockarea ( item ) <EOL> return h_docklayout ( item ) <EOL> def h_dockitem ( item ) : <EOL> n_item = ItemLayout ( item . name ) <EOL> n_item . geometry = item . geometry <EOL> n_item . maximized = item . maximized <EOL> n_item . linked = item . linked <EOL> return n_item <EOL> def h_docktabs ( tabs ) : <EOL> n_tabs = TabLayout ( ) <EOL> n_tabs . items = [ h_dockitem ( i ) for i in tabs . children ] <EOL> n_tabs . tab_position = tabs . tab_position <EOL> n_tabs . index = tabs . index <EOL> return n_tabs <EOL> def h_docksplit ( split ) : <EOL> n_split = SplitLayout ( ) <EOL> n_split . items = [ h_generic ( i ) for i in split . children ] <EOL> n_split . orientation = split . orientation <EOL> n_split . sizes = split . sizes <EOL> return n_split <EOL> def h_dockarea ( area ) : <EOL> h_area = AreaLayout ( ) <EOL> h_area . item = h_generic ( area . child ) <EOL> h_area . geometry = area . geometry <EOL> h_area . linked = area . linked <EOL> h_area . maximized = area . maximized <EOL> if area . maximized_item : <EOL> for item in h_area . find_all ( ItemLayout ) : <EOL> if item . name == area . maximized_item : <EOL> item . maximized = True <EOL> break <EOL> return h_area <EOL> def h_docklayout ( layout ) : <EOL> h_layout = DockLayout ( ) <EOL> if layout . primary is not None : <EOL> h_layout . items . append ( h_generic ( layout . primary ) ) <EOL> for other in layout . secondary : <EOL> h_item = h_generic ( other ) <EOL> h_item . floating = True <EOL> h_layout . items . append ( h_item ) <EOL> return h_layout <EOL> return h_generic ( layout ) <EOL> def convert_to_old_docklayout ( layout ) : <EOL> """<STR_LIT>""" <EOL> assert isinstance ( layout , DockLayout ) <EOL> def h_generic ( item ) : <EOL> if isinstance ( item , ItemLayout ) : <EOL> return h_ItemLayout ( item ) <EOL> if isinstance ( item , TabLayout ) : <EOL> return h_TabLayout ( item ) <EOL> if isinstance ( item , SplitLayout ) : <EOL> return h_SplitLayout ( item ) <EOL> if isinstance ( item , AreaLayout ) : <EOL> return h_AreaLayout ( item ) <EOL> return h_DockLayout ( item ) <EOL> def h_ItemLayout ( item ) : <EOL> n_item = dockitem ( item . name ) <EOL> n_item . geometry = item . geometry <EOL> n_item . maximized = item . maximized <EOL> n_item . linked = item . linked <EOL> return n_item <EOL> def h_TabLayout ( tabs ) : <EOL> n_tabs = docktabs ( ) <EOL> n_tabs . children = [ h_ItemLayout ( i ) for i in tabs . items ] <EOL> n_tabs . tab_position = tabs . tab_position <EOL> n_tabs . index = tabs . index <EOL> return n_tabs <EOL> def h_SplitLayout ( split ) : <EOL> n_split = docksplit ( ) <EOL> n_split . children = [ h_generic ( i ) for i in split . items ] <EOL> n_split . orientation = split . orientation <EOL> n_split . sizes = split . sizes <EOL> return n_split <EOL> def h_AreaLayout ( area ) : <EOL> if area . item is None : <EOL> n_area = dockarea ( None ) <EOL> else : <EOL> n_area = dockarea ( h_generic ( area . item ) ) <EOL> n_area . geometry = area . geometry <EOL> n_area . linked = area . linked <EOL> n_area . maximized = area . maximized <EOL> for item in area . find_all ( ItemLayout ) : <EOL> if item . maximized : <EOL> n_area . maximized_item = item . name <EOL> break <EOL> return n_area <EOL> def h_DockLayout ( layout ) : <EOL> primary = None <EOL> secondary = [ ] <EOL> for item in layout . items : <EOL> n_item = h_generic ( item ) <EOL> if item . floating or primary is not None : <EOL> secondary . append ( n_item ) <EOL> else : <EOL> primary = n_item <EOL> return docklayout ( primary , * secondary ) <EOL> return h_generic ( layout ) </s>
<s> from atom . api import Atom , Bool , Int , Typed <EOL> from enaml . qt . QtCore import Qt , QEvent , QRect , QSize , QPoint , QMargins , Signal <EOL> from enaml . qt . QtGui import QApplication , QFrame <EOL> class QDockFrame ( QFrame ) : <EOL> """<STR_LIT>""" <EOL> NoBorder = <NUM_LIT:0> <EOL> NorthBorder = <NUM_LIT:1> <EOL> EastBorder = <NUM_LIT:2> <EOL> SouthBorder = <NUM_LIT:3> <EOL> WestBorder = <NUM_LIT:4> <EOL> NorthEastBorder = <NUM_LIT:5> <EOL> NorthWestBorder = <NUM_LIT:6> <EOL> SouthEastBorder = <NUM_LIT:7> <EOL> SouthWestBorder = <NUM_LIT:8> <EOL> ResizeCursors = { <EOL> NorthBorder : Qt . SizeVerCursor , <EOL> SouthBorder : Qt . SizeVerCursor , <EOL> EastBorder : Qt . SizeHorCursor , <EOL> WestBorder : Qt . SizeHorCursor , <EOL> NorthEastBorder : Qt . SizeBDiagCursor , <EOL> SouthWestBorder : Qt . SizeBDiagCursor , <EOL> NorthWestBorder : Qt . SizeFDiagCursor , <EOL> SouthEastBorder : Qt . SizeFDiagCursor , <EOL> } <EOL> ResizeHandlers = { <EOL> NorthBorder : '<STR_LIT>' , <EOL> SouthBorder : '<STR_LIT>' , <EOL> EastBorder : '<STR_LIT>' , <EOL> WestBorder : '<STR_LIT>' , <EOL> NorthEastBorder : '<STR_LIT>' , <EOL> SouthWestBorder : '<STR_LIT>' , <EOL> NorthWestBorder : '<STR_LIT>' , <EOL> SouthEastBorder : '<STR_LIT>' , <EOL> } <EOL> ResizeCornerExtra = <NUM_LIT:8> <EOL> linkButtonToggled = Signal ( bool ) <EOL> class FrameState ( Atom ) : <EOL> """<STR_LIT>""" <EOL> mouse_title = Bool ( False ) <EOL> resize_border = Int ( <NUM_LIT:0> ) <EOL> last_size = Typed ( QSize ) <EOL> resize_offset = Typed ( QPoint ) <EOL> def __init__ ( self , manager , parent = None ) : <EOL> """<STR_LIT>""" <EOL> super ( QDockFrame , self ) . __init__ ( parent ) <EOL> self . frame_state = self . FrameState ( ) <EOL> self . _manager = manager <EOL> def manager ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . _manager <EOL> def raiseFrame ( self ) : <EOL> """<STR_LIT>""" <EOL> manager = self . _manager <EOL> if manager is not None : <EOL> manager . raise_frame ( self ) <EOL> def titleBarGeometry ( self ) : <EOL> """<STR_LIT>""" <EOL> return QRect ( ) <EOL> def resizeMargins ( self ) : <EOL> """<STR_LIT>""" <EOL> return QMargins ( ) <EOL> def isLinked ( self ) : <EOL> """<STR_LIT>""" <EOL> return False <EOL> def setLinked ( self , linked ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def event ( self , event ) : <EOL> """<STR_LIT>""" <EOL> if event . type ( ) == QEvent . HoverMove : <EOL> self . hoverMoveEvent ( event ) <EOL> return event . isAccepted ( ) <EOL> if event . type ( ) == QEvent . WindowActivate and self . isWindow ( ) : <EOL> self . raiseFrame ( ) <EOL> return super ( QDockFrame , self ) . event ( event ) <EOL> def mousePressEvent ( self , event ) : <EOL> """<STR_LIT>""" <EOL> event . ignore ( ) <EOL> state = self . frame_state <EOL> geo = self . titleBarGeometry ( ) <EOL> if geo . isValid ( ) and geo . contains ( event . pos ( ) ) : <EOL> if self . titleBarMousePressEvent ( event ) : <EOL> if self . isWindow ( ) : <EOL> self . activateWindow ( ) <EOL> self . raise_ ( ) <EOL> event . accept ( ) <EOL> state . mouse_title = True <EOL> return <EOL> if self . isWindow ( ) and event . button ( ) == Qt . LeftButton : <EOL> border , offset = self . _resizeBorderTest ( event . pos ( ) ) <EOL> if border != self . NoBorder : <EOL> state . resize_border = border <EOL> state . resize_offset = offset <EOL> state . last_size = self . size ( ) <EOL> event . accept ( ) <EOL> def mouseMoveEvent ( self , event ) : <EOL> """<STR_LIT>""" <EOL> event . ignore ( ) <EOL> state = self . frame_state <EOL> if state . mouse_title : <EOL> if self . titleBarMouseMoveEvent ( event ) : <EOL> event . accept ( ) <EOL> return <EOL> if self . isWindow ( ) and state . resize_border != self . NoBorder : <EOL> border = state . resize_border <EOL> handler = getattr ( self , self . ResizeHandlers [ border ] ) <EOL> handler ( event . pos ( ) , state . resize_offset ) <EOL> event . accept ( ) <EOL> def mouseReleaseEvent ( self , event ) : <EOL> """<STR_LIT>""" <EOL> event . ignore ( ) <EOL> state = self . frame_state <EOL> self . _refreshCursor ( event . pos ( ) ) <EOL> if state . mouse_title : <EOL> if self . titleBarMouseReleaseEvent ( event ) : <EOL> event . accept ( ) <EOL> state . mouse_title = False <EOL> return <EOL> if self . isWindow ( ) and event . button ( ) == Qt . LeftButton : <EOL> state . resize_border = self . NoBorder <EOL> state . resize_offset = None <EOL> if state . last_size is not None : <EOL> if state . last_size != self . size ( ) : <EOL> self . manager ( ) . frame_resized ( self ) <EOL> del state . last_size <EOL> event . accept ( ) <EOL> def hoverMoveEvent ( self , event ) : <EOL> """<STR_LIT>""" <EOL> event . ignore ( ) <EOL> if not self . isWindow ( ) or self . isMaximized ( ) : <EOL> return <EOL> if QApplication . mouseButtons ( ) != Qt . NoButton : <EOL> return <EOL> state = self . frame_state <EOL> if state . mouse_title : <EOL> return <EOL> if state . resize_border != self . NoBorder : <EOL> return <EOL> self . _refreshCursor ( event . pos ( ) ) <EOL> event . accept ( ) <EOL> def titleBarMousePressEvent ( self , event ) : <EOL> """<STR_LIT>""" <EOL> return False <EOL> def titleBarMouseMoveEvent ( self , event ) : <EOL> """<STR_LIT>""" <EOL> return False <EOL> def titleBarMouseReleaseEvent ( self , event ) : <EOL> """<STR_LIT>""" <EOL> return False <EOL> def _refreshCursor ( self , pos ) : <EOL> """<STR_LIT>""" <EOL> border , ignored = self . _resizeBorderTest ( pos ) <EOL> cursor = self . ResizeCursors . get ( border ) <EOL> if cursor is None : <EOL> self . unsetCursor ( ) <EOL> else : <EOL> self . setCursor ( cursor ) <EOL> def _resizeBorderTest ( self , pos ) : <EOL> """<STR_LIT>""" <EOL> rect = self . rect ( ) <EOL> if not rect . contains ( pos ) : <EOL> return ( self . NoBorder , QPoint ( ) ) <EOL> x = pos . x ( ) <EOL> y = pos . y ( ) <EOL> width = rect . width ( ) <EOL> height = rect . height ( ) <EOL> margins = self . resizeMargins ( ) <EOL> extra = self . ResizeCornerExtra <EOL> if x < margins . left ( ) : <EOL> if y < margins . top ( ) + extra : <EOL> mode = self . NorthWestBorder <EOL> offset = QPoint ( x , y ) <EOL> elif y > height - ( margins . bottom ( ) + extra ) : <EOL> mode = self . SouthWestBorder <EOL> offset = QPoint ( x , height - y ) <EOL> else : <EOL> mode = self . WestBorder <EOL> offset = QPoint ( x , <NUM_LIT:0> ) <EOL> elif y < margins . top ( ) : <EOL> if x < margins . left ( ) + extra : <EOL> mode = self . NorthWestBorder <EOL> offset = QPoint ( x , y ) <EOL> elif x > width - ( margins . right ( ) + extra ) : <EOL> mode = self . NorthEastBorder <EOL> offset = QPoint ( width - x , y ) <EOL> else : <EOL> mode = self . NorthBorder <EOL> offset = QPoint ( <NUM_LIT:0> , y ) <EOL> elif x > width - margins . right ( ) : <EOL> if y < margins . top ( ) + extra : <EOL> mode = self . NorthEastBorder <EOL> offset = QPoint ( width - x , y ) <EOL> elif y > height - ( margins . bottom ( ) + extra ) : <EOL> mode = self . SouthEastBorder <EOL> offset = QPoint ( width - x , height - y ) <EOL> else : <EOL> mode = self . EastBorder <EOL> offset = QPoint ( width - x , <NUM_LIT:0> ) <EOL> elif y > height - margins . bottom ( ) : <EOL> if x < margins . left ( ) + extra : <EOL> mode = self . SouthWestBorder <EOL> offset = QPoint ( x , height - y ) <EOL> elif x > width - ( margins . right ( ) + extra ) : <EOL> mode = self . SouthEastBorder <EOL> offset = QPoint ( width - x , height - y ) <EOL> else : <EOL> mode = self . SouthBorder <EOL> offset = QPoint ( <NUM_LIT:0> , height - y ) <EOL> else : <EOL> mode = self . NoBorder <EOL> offset = QPoint ( ) <EOL> return mode , offset <EOL> def _resizeNorth ( self , pos , offset ) : <EOL> """<STR_LIT>""" <EOL> dh = pos . y ( ) - offset . y ( ) <EOL> height = self . height ( ) <EOL> min_height = self . minimumSizeHint ( ) . height ( ) <EOL> if height - dh < min_height : <EOL> dh = height - min_height <EOL> rect = self . geometry ( ) <EOL> rect . setY ( rect . y ( ) + dh ) <EOL> self . setGeometry ( rect ) <EOL> def _resizeSouth ( self , pos , offset ) : <EOL> """<STR_LIT>""" <EOL> dh = pos . y ( ) - self . height ( ) + offset . y ( ) <EOL> size = self . size ( ) <EOL> size . setHeight ( size . height ( ) + dh ) <EOL> self . resize ( size ) <EOL> def _resizeEast ( self , pos , offset ) : <EOL> """<STR_LIT>""" <EOL> dw = pos . x ( ) - self . width ( ) + offset . x ( ) <EOL> size = self . size ( ) <EOL> size . setWidth ( size . width ( ) + dw ) <EOL> self . resize ( size ) <EOL> def _resizeWest ( self , pos , offset ) : <EOL> """<STR_LIT>""" <EOL> dw = pos . x ( ) - offset . x ( ) <EOL> width = self . width ( ) <EOL> min_width = self . minimumSizeHint ( ) . width ( ) <EOL> if width - dw < min_width : <EOL> dw = width - min_width <EOL> rect = self . geometry ( ) <EOL> rect . setX ( rect . x ( ) + dw ) <EOL> self . setGeometry ( rect ) <EOL> def _resizeNortheast ( self , pos , offset ) : <EOL> """<STR_LIT>""" <EOL> dw = pos . x ( ) - self . width ( ) + offset . x ( ) <EOL> dh = pos . y ( ) - offset . y ( ) <EOL> size = self . size ( ) <EOL> min_size = self . minimumSizeHint ( ) <EOL> if size . height ( ) - dh < min_size . height ( ) : <EOL> dh = size . height ( ) - min_size . height ( ) <EOL> rect = self . geometry ( ) <EOL> rect . setWidth ( rect . width ( ) + dw ) <EOL> rect . setY ( rect . y ( ) + dh ) <EOL> self . setGeometry ( rect ) <EOL> def _resizeNorthwest ( self , pos , offset ) : <EOL> """<STR_LIT>""" <EOL> dw = pos . x ( ) - offset . x ( ) <EOL> dh = pos . y ( ) - offset . y ( ) <EOL> size = self . size ( ) <EOL> min_size = self . minimumSizeHint ( ) <EOL> if size . width ( ) - dw < min_size . width ( ) : <EOL> dw = size . width ( ) - min_size . width ( ) <EOL> if size . height ( ) - dh < min_size . height ( ) : <EOL> dh = size . height ( ) - min_size . height ( ) <EOL> rect = self . geometry ( ) <EOL> rect . setX ( rect . x ( ) + dw ) <EOL> rect . setY ( rect . y ( ) + dh ) <EOL> self . setGeometry ( rect ) <EOL> def _resizeSouthwest ( self , pos , offset ) : <EOL> """<STR_LIT>""" <EOL> dw = pos . x ( ) - offset . x ( ) <EOL> dh = pos . y ( ) - self . height ( ) + offset . y ( ) <EOL> size = self . size ( ) <EOL> min_size = self . minimumSizeHint ( ) <EOL> if size . width ( ) - dw < min_size . width ( ) : <EOL> dw = size . width ( ) - min_size . width ( ) <EOL> rect = self . geometry ( ) <EOL> rect . setX ( rect . x ( ) + dw ) <EOL> rect . setHeight ( rect . height ( ) + dh ) <EOL> self . setGeometry ( rect ) <EOL> def _resizeSoutheast ( self , pos , offset ) : <EOL> """<STR_LIT>""" <EOL> dw = pos . x ( ) - self . width ( ) + offset . x ( ) <EOL> dh = pos . y ( ) - self . height ( ) + offset . y ( ) <EOL> size = self . size ( ) <EOL> size . setWidth ( size . width ( ) + dw ) <EOL> size . setHeight ( size . height ( ) + dh ) <EOL> self . resize ( size ) </s>
<s> from atom . api import Int , Typed <EOL> from enaml . widgets . combo_box import ProxyComboBox <EOL> from . QtGui import QComboBox <EOL> from . qt_control import QtControl <EOL> INDEX_GUARD = <NUM_LIT> <EOL> class QtComboBox ( QtControl , ProxyComboBox ) : <EOL> """<STR_LIT>""" <EOL> widget = Typed ( QComboBox ) <EOL> _guard = Int ( <NUM_LIT:0> ) <EOL> def create_widget ( self ) : <EOL> """<STR_LIT>""" <EOL> box = QComboBox ( self . parent_widget ( ) ) <EOL> box . setInsertPolicy ( QComboBox . NoInsert ) <EOL> self . widget = box <EOL> def init_widget ( self ) : <EOL> """<STR_LIT>""" <EOL> super ( QtComboBox , self ) . init_widget ( ) <EOL> d = self . declaration <EOL> self . set_items ( d . items ) <EOL> self . set_index ( d . index ) <EOL> self . set_editable ( d . editable ) <EOL> self . widget . currentIndexChanged . connect ( self . on_index_changed ) <EOL> def on_index_changed ( self ) : <EOL> """<STR_LIT>""" <EOL> if not self . _guard & INDEX_GUARD : <EOL> self . declaration . index = self . widget . currentIndex ( ) <EOL> def set_items ( self , items ) : <EOL> """<STR_LIT>""" <EOL> widget = self . widget <EOL> count = widget . count ( ) <EOL> nitems = len ( items ) <EOL> for idx , item in enumerate ( items [ : count ] ) : <EOL> widget . setItemText ( idx , item ) <EOL> if nitems > count : <EOL> for item in items [ count : ] : <EOL> widget . addItem ( item ) <EOL> elif nitems < count : <EOL> for idx in reversed ( xrange ( nitems , count ) ) : <EOL> widget . removeItem ( idx ) <EOL> def set_index ( self , index ) : <EOL> """<STR_LIT>""" <EOL> self . _guard |= INDEX_GUARD <EOL> try : <EOL> self . widget . setCurrentIndex ( index ) <EOL> finally : <EOL> self . _guard &= ~ INDEX_GUARD <EOL> def set_editable ( self , editable ) : <EOL> """<STR_LIT>""" <EOL> widget = self . widget <EOL> widget . setEditable ( editable ) <EOL> widget . update ( ) </s>
<s> import sys <EOL> from weakref import WeakKeyDictionary <EOL> from atom . api import Typed <EOL> from enaml . widgets . notebook import ProxyNotebook <EOL> from . QtCore import Qt , QEvent , Signal <EOL> from . QtGui import QTabWidget , QTabBar , QResizeEvent , QApplication <EOL> from . qt_constraints_widget import QtConstraintsWidget <EOL> from . qt_page import QtPage <EOL> TAB_POSITIONS = { <EOL> '<STR_LIT>' : QTabWidget . North , <EOL> '<STR_LIT>' : QTabWidget . South , <EOL> '<STR_LIT:left>' : QTabWidget . West , <EOL> '<STR_LIT:right>' : QTabWidget . East , <EOL> } <EOL> DOCUMENT_MODES = { <EOL> '<STR_LIT>' : True , <EOL> '<STR_LIT>' : False , <EOL> } <EOL> class QNotebook ( QTabWidget ) : <EOL> """<STR_LIT>""" <EOL> layoutRequested = Signal ( ) <EOL> def __init__ ( self , * args , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> super ( QNotebook , self ) . __init__ ( * args , ** kwargs ) <EOL> self . tabCloseRequested . connect ( self . onTabCloseRequested ) <EOL> self . _hidden_pages = WeakKeyDictionary ( ) <EOL> def _refreshTabBar ( self ) : <EOL> """<STR_LIT>""" <EOL> app = QApplication . instance ( ) <EOL> if app is not None : <EOL> bar = self . tabBar ( ) <EOL> size = bar . size ( ) <EOL> event = QResizeEvent ( size , size ) <EOL> app . sendEvent ( bar , event ) <EOL> size = self . size ( ) <EOL> event = QResizeEvent ( size , size ) <EOL> app . sendEvent ( self , event ) <EOL> def onTabCloseRequested ( self , index ) : <EOL> """<STR_LIT>""" <EOL> self . widget ( index ) . requestClose ( ) <EOL> def event ( self , event ) : <EOL> """<STR_LIT>""" <EOL> res = super ( QNotebook , self ) . event ( event ) <EOL> if event . type ( ) == QEvent . LayoutRequest : <EOL> self . layoutRequested . emit ( ) <EOL> return res <EOL> def showPage ( self , page ) : <EOL> """<STR_LIT>""" <EOL> index = self . indexOf ( page ) <EOL> if index == - <NUM_LIT:1> : <EOL> index = self . _hidden_pages . pop ( page , - <NUM_LIT:1> ) <EOL> if index != - <NUM_LIT:1> : <EOL> self . insertPage ( index , page ) <EOL> def hidePage ( self , page ) : <EOL> """<STR_LIT>""" <EOL> index = self . indexOf ( page ) <EOL> if index != - <NUM_LIT:1> : <EOL> self . removeTab ( index ) <EOL> page . hide ( ) <EOL> self . _hidden_pages [ page ] = index <EOL> def addPage ( self , page ) : <EOL> """<STR_LIT>""" <EOL> self . insertPage ( self . count ( ) , page ) <EOL> def insertPage ( self , index , page ) : <EOL> """<STR_LIT>""" <EOL> if page . isOpen ( ) : <EOL> index = min ( index , self . count ( ) ) <EOL> self . insertTab ( index , page , page . title ( ) ) <EOL> self . setTabIcon ( index , page . icon ( ) ) <EOL> self . setTabToolTip ( index , page . toolTip ( ) ) <EOL> self . setTabEnabled ( index , page . isTabEnabled ( ) ) <EOL> self . setTabCloseButtonVisible ( index , page . isClosable ( ) ) <EOL> else : <EOL> page . hide ( ) <EOL> self . _hidden_pages [ page ] = index <EOL> def removePage ( self , page ) : <EOL> """<STR_LIT>""" <EOL> index = self . indexOf ( page ) <EOL> if index != - <NUM_LIT:1> : <EOL> self . removeTab ( index ) <EOL> page . hide ( ) <EOL> def setTabCloseButtonVisible ( self , index , visible , refresh = True ) : <EOL> """<STR_LIT>""" <EOL> if index >= <NUM_LIT:0> and index < self . count ( ) : <EOL> tabBar = self . tabBar ( ) <EOL> btn1 = tabBar . tabButton ( index , QTabBar . LeftSide ) <EOL> btn2 = tabBar . tabButton ( index , QTabBar . RightSide ) <EOL> if btn1 is not None : <EOL> btn1 . setVisible ( visible ) <EOL> if not visible : <EOL> btn1 . resize ( <NUM_LIT:0> , <NUM_LIT:0> ) <EOL> else : <EOL> btn1 . resize ( btn1 . sizeHint ( ) ) <EOL> if btn2 is not None : <EOL> btn2 . setVisible ( visible ) <EOL> if not visible : <EOL> btn2 . resize ( <NUM_LIT:0> , <NUM_LIT:0> ) <EOL> else : <EOL> btn2 . resize ( btn2 . sizeHint ( ) ) <EOL> if refresh : <EOL> self . _refreshTabBar ( ) <EOL> def setTabsClosable ( self , closable ) : <EOL> """<STR_LIT>""" <EOL> super ( QNotebook , self ) . setTabsClosable ( closable ) <EOL> if closable : <EOL> setVisible = self . setTabCloseButtonVisible <EOL> for index in xrange ( self . count ( ) ) : <EOL> page = self . widget ( index ) <EOL> setVisible ( index , page . isClosable ( ) , refresh = False ) <EOL> self . _refreshTabBar ( ) <EOL> class QtNotebook ( QtConstraintsWidget , ProxyNotebook ) : <EOL> """<STR_LIT>""" <EOL> widget = Typed ( QNotebook ) <EOL> def create_widget ( self ) : <EOL> """<STR_LIT>""" <EOL> widget = QNotebook ( self . parent_widget ( ) ) <EOL> if sys . platform == '<STR_LIT>' : <EOL> widget . setAttribute ( Qt . WA_LayoutUsesWidgetRect , True ) <EOL> self . widget = widget <EOL> def init_widget ( self ) : <EOL> """<STR_LIT>""" <EOL> super ( QtNotebook , self ) . init_widget ( ) <EOL> d = self . declaration <EOL> self . set_tab_style ( d . tab_style ) <EOL> self . set_tab_position ( d . tab_position ) <EOL> self . set_tabs_closable ( d . tabs_closable ) <EOL> self . set_tabs_movable ( d . tabs_movable ) <EOL> def init_layout ( self ) : <EOL> """<STR_LIT>""" <EOL> super ( QtNotebook , self ) . init_layout ( ) <EOL> widget = self . widget <EOL> for page in self . pages ( ) : <EOL> widget . addPage ( page ) <EOL> widget . layoutRequested . connect ( self . on_layout_requested ) <EOL> def pages ( self ) : <EOL> """<STR_LIT>""" <EOL> for p in self . declaration . pages ( ) : <EOL> w = p . proxy . widget <EOL> if w is not None : <EOL> yield w <EOL> def child_added ( self , child ) : <EOL> """<STR_LIT>""" <EOL> super ( QtNotebook , self ) . child_added ( child ) <EOL> if isinstance ( child , QtPage ) : <EOL> for index , dchild in enumerate ( self . children ( ) ) : <EOL> if child is dchild : <EOL> self . widget . insertPage ( index , child . widget ) <EOL> def child_removed ( self , child ) : <EOL> """<STR_LIT>""" <EOL> super ( QtNotebook , self ) . child_removed ( child ) <EOL> if isinstance ( child , QtPage ) : <EOL> self . widget . removePage ( child . widget ) <EOL> def on_layout_requested ( self ) : <EOL> """<STR_LIT>""" <EOL> self . size_hint_updated ( ) <EOL> def set_tab_style ( self , style ) : <EOL> """<STR_LIT>""" <EOL> self . widget . setDocumentMode ( DOCUMENT_MODES [ style ] ) <EOL> def set_tab_position ( self , position ) : <EOL> """<STR_LIT>""" <EOL> self . widget . setTabPosition ( TAB_POSITIONS [ position ] ) <EOL> def set_tabs_closable ( self , closable ) : <EOL> """<STR_LIT>""" <EOL> self . widget . setTabsClosable ( closable ) <EOL> def set_tabs_movable ( self , movable ) : <EOL> """<STR_LIT>""" <EOL> self . widget . setMovable ( movable ) </s>
<s> TOKENS = { <EOL> "<STR_LIT>" : { <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT:default>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT:error>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" <EOL> } , <EOL> "<STR_LIT>" : { <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT:default>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT:label>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" <EOL> } , <EOL> "<STR_LIT>" : { <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT:default>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT:label>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT:string>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" <EOL> } , <EOL> "<STR_LIT>" : { <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT:default>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" <EOL> } , <EOL> "<STR_LIT>" : { <EOL> } , <EOL> "<STR_LIT>" : { <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT:default>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT:value>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" <EOL> } , <EOL> "<STR_LIT:d>" : { <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT:default>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT:string>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" <EOL> } , <EOL> "<STR_LIT>" : { <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT:default>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" <EOL> } , <EOL> "<STR_LIT>" : { <EOL> } , <EOL> "<STR_LIT>" : { <EOL> } , <EOL> "<STR_LIT>" : { <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT:default>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT:label>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" <EOL> } , <EOL> "<STR_LIT:html>" : { <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT:default>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" <EOL> } , <EOL> "<STR_LIT>" : { <EOL> } , <EOL> "<STR_LIT>" : { <EOL> } , <EOL> "<STR_LIT>" : { <EOL> } , <EOL> "<STR_LIT>" : { <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT:default>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT:label>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT:string>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" <EOL> } , <EOL> "<STR_LIT>" : { <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT:default>" : "<STR_LIT>" , <EOL> "<STR_LIT:error>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT:target>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" <EOL> } , <EOL> "<STR_LIT>" : { <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT:default>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" <EOL> } , <EOL> "<STR_LIT>" : { <EOL> } , <EOL> "<STR_LIT>" : { <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT:default>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" <EOL> } , <EOL> "<STR_LIT>" : { <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT:default>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT:error>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" <EOL> } , <EOL> "<STR_LIT>" : { <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT:default>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT:name>" : "<STR_LIT:Name>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT:text>" : "<STR_LIT>" <EOL> } , <EOL> "<STR_LIT>" : { <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT:default>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT:string>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" <EOL> } , <EOL> "<STR_LIT>" : { <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT:default>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT:key>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" <EOL> } , <EOL> "<STR_LIT>" : { <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT:default>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" <EOL> } , <EOL> "<STR_LIT>" : { <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT:default>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT:error>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" <EOL> } , <EOL> "<STR_LIT>" : { <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT:default>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT:value>" : "<STR_LIT>" <EOL> } , <EOL> "<STR_LIT>" : { <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT:default>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" <EOL> } , <EOL> "<STR_LIT>" : { <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT:default>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" <EOL> } , <EOL> "<STR_LIT>" : { <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT:default>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT:text>" : "<STR_LIT>" <EOL> } , <EOL> "<STR_LIT>" : { <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT:default>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT:string>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" <EOL> } , <EOL> "<STR_LIT>" : { <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT:default>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT:string>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" <EOL> } , <EOL> "<STR_LIT>" : { <EOL> } , <EOL> "<STR_LIT>" : { <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT:default>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" <EOL> } <EOL> } <EOL> TOKENS [ "<STR_LIT>" ] = TOKENS [ "<STR_LIT>" ] <EOL> TOKENS [ "<STR_LIT>" ] = TOKENS [ "<STR_LIT>" ] <EOL> TOKENS [ "<STR_LIT>" ] = TOKENS [ "<STR_LIT>" ] <EOL> TOKENS [ "<STR_LIT>" ] = TOKENS [ "<STR_LIT>" ] <EOL> TOKENS [ "<STR_LIT>" ] = TOKENS [ "<STR_LIT>" ] <EOL> TOKENS [ "<STR_LIT>" ] = TOKENS [ "<STR_LIT>" ] <EOL> TOKENS [ "<STR_LIT>" ] = TOKENS [ "<STR_LIT>" ] <EOL> TOKENS [ "<STR_LIT>" ] = TOKENS [ "<STR_LIT:html>" ] </s>
<s> import json <EOL> from html_object import HTMLObject <EOL> class WebCom : <EOL> ws = None <EOL> def __init__ ( self ) : <EOL> pass <EOL> @ classmethod <EOL> def enamltoWeb ( cls , change ) : <EOL> jsonDict = dict ( ) <EOL> jsonDict [ '<STR_LIT:id>' ] = change [ '<STR_LIT:object>' ] . id <EOL> jsonDict [ '<STR_LIT:data>' ] = { "<STR_LIT:value>" : change [ '<STR_LIT:value>' ] } <EOL> print "<STR_LIT>" , [ jsonDict ] <EOL> cls . ws . send ( json . dumps ( { "<STR_LIT>" : [ jsonDict ] } ) ) <EOL> @ classmethod <EOL> def webtoEnaml ( cls , in_message , ws ) : <EOL> cls . ws = ws <EOL> print in_message <EOL> HTMLObject . updateObject ( in_message [ '<STR_LIT:id>' ] , in_message [ '<STR_LIT:data>' ] [ '<STR_LIT:value>' ] ) </s>
<s> from atom . api import set_default <EOL> from enaml . layout . layout_helpers import align , vertical , horizontal , spacer <EOL> from . constraints_widget import ConstraintMember <EOL> from . container import Container <EOL> class Form ( Container ) : <EOL> """<STR_LIT>""" <EOL> midline = ConstraintMember ( ) <EOL> hug_height = set_default ( '<STR_LIT>' ) <EOL> def layout_constraints ( self ) : <EOL> """<STR_LIT>""" <EOL> children = self . widgets ( ) <EOL> labels = children [ : : <NUM_LIT:2> ] <EOL> widgets = children [ <NUM_LIT:1> : : <NUM_LIT:2> ] <EOL> n_labels = len ( labels ) <EOL> n_widgets = len ( widgets ) <EOL> if n_labels != n_widgets : <EOL> if n_labels > n_widgets : <EOL> odd_child = labels . pop ( ) <EOL> else : <EOL> odd_child = widgets . pop ( ) <EOL> else : <EOL> odd_child = None <EOL> b_flx = spacer ( <NUM_LIT:0> ) . flex ( ) <EOL> w_flx = spacer ( <NUM_LIT:10> ) . flex ( ) <EOL> midline = self . midline <EOL> top = self . contents_top <EOL> left = self . contents_left <EOL> right = self . contents_right <EOL> constraints = self . constraints [ : ] <EOL> column1 = [ top , b_flx ] <EOL> column2 = [ top , b_flx ] <EOL> push = constraints . append <EOL> push_col1 = column1 . append <EOL> push_col2 = column2 . append <EOL> for label , widget in zip ( labels , widgets ) : <EOL> push ( ( widget . left == midline ) | '<STR_LIT>' ) <EOL> push ( align ( '<STR_LIT>' , label , widget ) | '<STR_LIT>' ) <EOL> push ( horizontal ( left , b_flx , label , w_flx , widget , b_flx , right ) ) <EOL> push_col1 ( label ) <EOL> push_col1 ( w_flx ) <EOL> push_col2 ( widget ) <EOL> push_col2 ( w_flx ) <EOL> if odd_child is not None : <EOL> push_col1 ( odd_child ) <EOL> push_col2 ( odd_child ) <EOL> push ( horizontal ( left , b_flx , odd_child , b_flx , right ) ) <EOL> else : <EOL> column1 . pop ( ) <EOL> column2 . pop ( ) <EOL> bottom = self . contents_bottom <EOL> push_col1 ( b_flx ) <EOL> push_col1 ( bottom ) <EOL> push_col2 ( b_flx ) <EOL> push_col2 ( bottom ) <EOL> push ( vertical ( * column1 ) ) <EOL> push ( vertical ( * column2 ) ) <EOL> return constraints </s>
<s> from atom . api import ( <EOL> Atom , Enum , Int , Range , Typed , ForwardTyped , observe , set_default <EOL> ) <EOL> from enaml . core . declarative import d_ <EOL> from . constraints_widget import ConstraintsWidget , ProxyConstraintsWidget <EOL> from . stack_item import StackItem <EOL> class Transition ( Atom ) : <EOL> """<STR_LIT>""" <EOL> type = Enum ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> direction = Enum ( <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' <EOL> ) <EOL> duration = Range ( low = <NUM_LIT:0> , value = <NUM_LIT> ) <EOL> class ProxyStack ( ProxyConstraintsWidget ) : <EOL> """<STR_LIT>""" <EOL> declaration = ForwardTyped ( lambda : Stack ) <EOL> def set_index ( self , index ) : <EOL> raise NotImplementedError <EOL> def set_transition ( self , transition ) : <EOL> raise NotImplementedError <EOL> class Stack ( ConstraintsWidget ) : <EOL> """<STR_LIT>""" <EOL> index = d_ ( Int ( <NUM_LIT:0> ) ) <EOL> transition = d_ ( Typed ( Transition ) ) <EOL> hug_width = set_default ( '<STR_LIT:ignore>' ) <EOL> hug_height = set_default ( '<STR_LIT:ignore>' ) <EOL> proxy = Typed ( ProxyStack ) <EOL> def stack_items ( self ) : <EOL> """<STR_LIT>""" <EOL> return [ c for c in self . children if isinstance ( c , StackItem ) ] <EOL> @ observe ( ( '<STR_LIT:index>' , '<STR_LIT>' ) ) <EOL> def _update_proxy ( self , change ) : <EOL> """<STR_LIT>""" <EOL> super ( Stack , self ) . _update_proxy ( change ) </s>
<s> import wx <EOL> from atom . api import Typed <EOL> from enaml . widgets . group_box import ProxyGroupBox <EOL> from . wx_container import WxContainer , wxContainer <EOL> WX_ALIGNMENTS = { <EOL> '<STR_LIT:left>' : wx . ALIGN_LEFT , <EOL> '<STR_LIT>' : wx . ALIGN_CENTER , <EOL> '<STR_LIT:right>' : wx . ALIGN_RIGHT , <EOL> } <EOL> class wxGroupBox ( wxContainer ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , * args , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> super ( wxGroupBox , self ) . __init__ ( * args , ** kwargs ) <EOL> self . _title = '<STR_LIT>' <EOL> self . _border = wx . StaticBox ( self ) <EOL> self . _line = wx . StaticLine ( self ) <EOL> self . _label = wx . StaticText ( self ) <EOL> self . _label . Raise ( ) <EOL> self . _label_size = self . _label . GetBestSize ( ) <EOL> self . _title_alignment = wx . ALIGN_LEFT <EOL> self . _flat = False <EOL> self . SetDoubleBuffered ( True ) <EOL> def GetAlignment ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . _title_alignment <EOL> def SetAlignment ( self , alignment ) : <EOL> """<STR_LIT>""" <EOL> self . _title_alignment = alignment <EOL> self . _update_layout ( ) <EOL> def GetFlat ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . _flat <EOL> def SetFlat ( self , flat ) : <EOL> """<STR_LIT>""" <EOL> self . _flat = flat <EOL> if flat : <EOL> self . _border . Show ( False ) <EOL> self . _line . Show ( True ) <EOL> else : <EOL> self . _border . Show ( True ) <EOL> self . _line . Show ( False ) <EOL> self . _update_layout ( ) <EOL> def GetTitle ( self ) : <EOL> """<STR_LIT>""" <EOL> title = self . _title <EOL> if title : <EOL> title = title [ <NUM_LIT:1> : - <NUM_LIT:1> ] <EOL> return title <EOL> def SetTitle ( self , title ) : <EOL> """<STR_LIT>""" <EOL> if title : <EOL> title = '<STR_LIT>' % title <EOL> self . _title = title <EOL> self . _label . SetLabel ( title ) <EOL> self . _label_size = self . _label . GetBestSize ( ) <EOL> if not title : <EOL> self . _label . Show ( False ) <EOL> else : <EOL> self . _label . Show ( True ) <EOL> self . _update_layout ( ) <EOL> def SetDimensions ( self , x , y , width , height ) : <EOL> """<STR_LIT>""" <EOL> super ( wxGroupBox , self ) . SetDimensions ( x , y , width , height ) <EOL> self . _update_layout ( ) <EOL> def SetSize ( self , size ) : <EOL> """<STR_LIT>""" <EOL> super ( wxGroupBox , self ) . SetSize ( size ) <EOL> self . _update_layout ( ) <EOL> def GetContentsMargins ( self ) : <EOL> """<STR_LIT>""" <EOL> label = self . _label <EOL> height = label . GetCharHeight ( ) <EOL> if not label . IsShown ( ) : <EOL> height /= <NUM_LIT:2> <EOL> return ( height , <NUM_LIT:1> , <NUM_LIT:1> , <NUM_LIT:1> ) <EOL> def _update_layout ( self ) : <EOL> """<STR_LIT>""" <EOL> if self . _flat : <EOL> self . _update_line_geometry ( ) <EOL> else : <EOL> self . _update_border_geometry ( ) <EOL> self . _update_title_geometry ( ) <EOL> self . Refresh ( ) <EOL> def _update_border_geometry ( self ) : <EOL> """<STR_LIT>""" <EOL> width , height = self . GetSizeTuple ( ) <EOL> self . _border . SetSizeWH ( width , height ) <EOL> def _update_line_geometry ( self ) : <EOL> """<STR_LIT>""" <EOL> y = self . _label_size . GetHeight ( ) / <NUM_LIT:2> <EOL> width , _ = self . GetSizeTuple ( ) <EOL> self . _line . SetDimensions ( <NUM_LIT:0> , y , width , <NUM_LIT:2> ) <EOL> def _update_title_geometry ( self ) : <EOL> """<STR_LIT>""" <EOL> label = self . _label <EOL> flat = self . _flat <EOL> align = self . _title_alignment <EOL> text_width , _ = self . _label_size <EOL> width , _ = self . GetSizeTuple ( ) <EOL> if align == wx . ALIGN_LEFT : <EOL> x = <NUM_LIT:0> if flat else <NUM_LIT:8> <EOL> label . Move ( ( x , <NUM_LIT:0> ) ) <EOL> elif align == wx . ALIGN_RIGHT : <EOL> right = width <EOL> right -= <NUM_LIT:0> if flat else <NUM_LIT:8> <EOL> x = right - text_width <EOL> label . Move ( ( x , <NUM_LIT:0> ) ) <EOL> elif align == wx . ALIGN_CENTER : <EOL> label . CenterOnParent ( dir = wx . HORIZONTAL ) <EOL> else : <EOL> raise ValueError ( '<STR_LIT>' % align ) <EOL> class WxGroupBox ( WxContainer , ProxyGroupBox ) : <EOL> """<STR_LIT>""" <EOL> widget = Typed ( wxGroupBox ) <EOL> def create_widget ( self ) : <EOL> """<STR_LIT>""" <EOL> self . widget = wxGroupBox ( self . parent_widget ( ) ) <EOL> def init_widget ( self ) : <EOL> """<STR_LIT>""" <EOL> super ( WxGroupBox , self ) . init_widget ( ) <EOL> d = self . declaration <EOL> self . set_title ( d . title , cm_update = False ) <EOL> self . set_flat ( d . flat ) <EOL> self . set_title_align ( d . title_align ) <EOL> def contents_margins ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . widget . GetContentsMargins ( ) <EOL> def set_title ( self , title , cm_update = True ) : <EOL> """<STR_LIT>""" <EOL> if not cm_update : <EOL> self . widget . SetTitle ( title ) <EOL> return <EOL> widget = self . widget <EOL> old_margins = widget . GetContentsMargins ( ) <EOL> widget . SetTitle ( title ) <EOL> new_margins = widget . GetContentsMargins ( ) <EOL> if old_margins != new_margins : <EOL> self . contents_margins_updated ( ) <EOL> def set_flat ( self , flat ) : <EOL> """<STR_LIT>""" <EOL> self . widget . SetFlat ( flat ) <EOL> def set_title_align ( self , align ) : <EOL> """<STR_LIT>""" <EOL> wx_align = WX_ALIGNMENTS [ align ] <EOL> self . widget . SetAlignment ( wx_align ) </s>
<s> """<STR_LIT>""" <EOL> __author__ = "<STR_LIT>" <EOL> __date__ = "<STR_LIT>" <EOL> import wx <EOL> import types <EOL> from aui_utilities import BitmapFromBits , StepColour , ChopText , GetBaseColour <EOL> from aui_utilities import DrawGradientRectangle , DrawMACCloseButton <EOL> from aui_utilities import DarkenBitmap , LightContrastColour <EOL> from aui_constants import * <EOL> optionActive = <NUM_LIT:2> ** <NUM_LIT> <EOL> """<STR_LIT>""" <EOL> _ctypes = False <EOL> if wx . Platform == "<STR_LIT>" : <EOL> try : <EOL> import ctypes <EOL> import winxptheme <EOL> _ctypes = True <EOL> except ImportError : <EOL> pass <EOL> class AuiDefaultDockArt ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self ) : <EOL> """<STR_LIT>""" <EOL> self . Init ( ) <EOL> isMac = wx . Platform == "<STR_LIT>" <EOL> if isMac : <EOL> self . _caption_font = wx . SMALL_FONT <EOL> else : <EOL> self . _caption_font = wx . Font ( <NUM_LIT:8> , wx . DEFAULT , wx . NORMAL , wx . NORMAL , False ) <EOL> self . SetDefaultPaneBitmaps ( isMac ) <EOL> self . _restore_bitmap = wx . BitmapFromXPMData ( restore_xpm ) <EOL> self . _sash_size = <NUM_LIT:4> <EOL> if isMac : <EOL> self . _sash_size = <NUM_LIT:8> <EOL> elif wx . Platform == "<STR_LIT>" : <EOL> self . _sash_size = wx . RendererNative . Get ( ) . GetSplitterParams ( wx . GetTopLevelWindows ( ) [ <NUM_LIT:0> ] ) . widthSash <EOL> else : <EOL> self . _sash_size = <NUM_LIT:4> <EOL> self . _caption_size = <NUM_LIT> <EOL> self . _border_size = <NUM_LIT:1> <EOL> self . _button_size = <NUM_LIT> <EOL> self . _gripper_size = <NUM_LIT:9> <EOL> self . _gradient_type = AUI_GRADIENT_VERTICAL <EOL> self . _draw_sash = False <EOL> def Init ( self ) : <EOL> """<STR_LIT>""" <EOL> self . SetDefaultColours ( ) <EOL> isMac = wx . Platform == "<STR_LIT>" <EOL> if isMac : <EOL> self . _active_caption_colour = wx . SystemSettings . GetColour ( wx . SYS_COLOUR_HIGHLIGHT ) <EOL> else : <EOL> self . _active_caption_colour = wx . SystemSettings . GetColour ( wx . SYS_COLOUR_ACTIVECAPTION ) <EOL> self . _active_caption_gradient_colour = LightContrastColour ( wx . SystemSettings . GetColour ( wx . SYS_COLOUR_HIGHLIGHT ) ) <EOL> self . _active_caption_text_colour = wx . SystemSettings . GetColour ( wx . SYS_COLOUR_HIGHLIGHTTEXT ) <EOL> self . _inactive_caption_text_colour = wx . BLACK <EOL> def SetDefaultColours ( self , base_colour = None ) : <EOL> """<STR_LIT>""" <EOL> if base_colour is None : <EOL> base_colour = GetBaseColour ( ) <EOL> darker1_colour = StepColour ( base_colour , <NUM_LIT> ) <EOL> darker2_colour = StepColour ( base_colour , <NUM_LIT> ) <EOL> darker3_colour = StepColour ( base_colour , <NUM_LIT> ) <EOL> darker4_colour = StepColour ( base_colour , <NUM_LIT> ) <EOL> self . _background_colour = base_colour <EOL> self . _background_gradient_colour = StepColour ( base_colour , <NUM_LIT> ) <EOL> self . _inactive_caption_colour = darker1_colour <EOL> self . _inactive_caption_gradient_colour = StepColour ( base_colour , <NUM_LIT> ) <EOL> self . _sash_brush = wx . Brush ( base_colour ) <EOL> self . _background_brush = wx . Brush ( base_colour ) <EOL> self . _border_pen = wx . Pen ( darker2_colour ) <EOL> self . _gripper_brush = wx . Brush ( base_colour ) <EOL> self . _gripper_pen1 = wx . Pen ( darker4_colour ) <EOL> self . _gripper_pen2 = wx . Pen ( darker3_colour ) <EOL> self . _gripper_pen3 = wx . WHITE_PEN <EOL> self . _hint_background_colour = colourHintBackground <EOL> def GetMetric ( self , id ) : <EOL> """<STR_LIT>""" <EOL> if id == AUI_DOCKART_SASH_SIZE : <EOL> return self . _sash_size <EOL> elif id == AUI_DOCKART_CAPTION_SIZE : <EOL> return self . _caption_size <EOL> elif id == AUI_DOCKART_GRIPPER_SIZE : <EOL> return self . _gripper_size <EOL> elif id == AUI_DOCKART_PANE_BORDER_SIZE : <EOL> return self . _border_size <EOL> elif id == AUI_DOCKART_PANE_BUTTON_SIZE : <EOL> return self . _button_size <EOL> elif id == AUI_DOCKART_GRADIENT_TYPE : <EOL> return self . _gradient_type <EOL> elif id == AUI_DOCKART_DRAW_SASH_GRIP : <EOL> return self . _draw_sash <EOL> else : <EOL> raise Exception ( "<STR_LIT>" ) <EOL> def SetMetric ( self , id , new_val ) : <EOL> """<STR_LIT>""" <EOL> if id == AUI_DOCKART_SASH_SIZE : <EOL> self . _sash_size = new_val <EOL> elif id == AUI_DOCKART_CAPTION_SIZE : <EOL> self . _caption_size = new_val <EOL> elif id == AUI_DOCKART_GRIPPER_SIZE : <EOL> self . _gripper_size = new_val <EOL> elif id == AUI_DOCKART_PANE_BORDER_SIZE : <EOL> self . _border_size = new_val <EOL> elif id == AUI_DOCKART_PANE_BUTTON_SIZE : <EOL> self . _button_size = new_val <EOL> elif id == AUI_DOCKART_GRADIENT_TYPE : <EOL> self . _gradient_type = new_val <EOL> elif id == AUI_DOCKART_DRAW_SASH_GRIP : <EOL> self . _draw_sash = new_val <EOL> else : <EOL> raise Exception ( "<STR_LIT>" ) <EOL> def GetColor ( self , id ) : <EOL> """<STR_LIT>""" <EOL> if id == AUI_DOCKART_BACKGROUND_COLOUR : <EOL> return self . _background_brush . GetColour ( ) <EOL> elif id == AUI_DOCKART_BACKGROUND_GRADIENT_COLOUR : <EOL> return self . _background_gradient_colour <EOL> elif id == AUI_DOCKART_SASH_COLOUR : <EOL> return self . _sash_brush . GetColour ( ) <EOL> elif id == AUI_DOCKART_INACTIVE_CAPTION_COLOUR : <EOL> return self . _inactive_caption_colour <EOL> elif id == AUI_DOCKART_INACTIVE_CAPTION_GRADIENT_COLOUR : <EOL> return self . _inactive_caption_gradient_colour <EOL> elif id == AUI_DOCKART_INACTIVE_CAPTION_TEXT_COLOUR : <EOL> return self . _inactive_caption_text_colour <EOL> elif id == AUI_DOCKART_ACTIVE_CAPTION_COLOUR : <EOL> return self . _active_caption_colour <EOL> elif id == AUI_DOCKART_ACTIVE_CAPTION_GRADIENT_COLOUR : <EOL> return self . _active_caption_gradient_colour <EOL> elif id == AUI_DOCKART_ACTIVE_CAPTION_TEXT_COLOUR : <EOL> return self . _active_caption_text_colour <EOL> elif id == AUI_DOCKART_BORDER_COLOUR : <EOL> return self . _border_pen . GetColour ( ) <EOL> elif id == AUI_DOCKART_GRIPPER_COLOUR : <EOL> return self . _gripper_brush . GetColour ( ) <EOL> elif id == AUI_DOCKART_HINT_WINDOW_COLOUR : <EOL> return self . _hint_background_colour <EOL> else : <EOL> raise Exception ( "<STR_LIT>" ) <EOL> def SetColor ( self , id , colour ) : <EOL> """<STR_LIT>""" <EOL> if isinstance ( colour , basestring ) : <EOL> colour = wx . NamedColour ( colour ) <EOL> elif isinstance ( colour , types . TupleType ) : <EOL> colour = wx . Colour ( * colour ) <EOL> elif isinstance ( colour , types . IntType ) : <EOL> colour = wx . ColourRGB ( colour ) <EOL> if id == AUI_DOCKART_BACKGROUND_COLOUR : <EOL> self . _background_brush . SetColour ( colour ) <EOL> elif id == AUI_DOCKART_BACKGROUND_GRADIENT_COLOUR : <EOL> self . _background_gradient_colour = colour <EOL> elif id == AUI_DOCKART_SASH_COLOUR : <EOL> self . _sash_brush . SetColour ( colour ) <EOL> elif id == AUI_DOCKART_INACTIVE_CAPTION_COLOUR : <EOL> self . _inactive_caption_colour = colour <EOL> if not self . _custom_pane_bitmaps and wx . Platform == "<STR_LIT>" : <EOL> self . _inactive_close_bitmap = DrawMACCloseButton ( wx . WHITE , colour ) <EOL> elif id == AUI_DOCKART_INACTIVE_CAPTION_GRADIENT_COLOUR : <EOL> self . _inactive_caption_gradient_colour = colour <EOL> elif id == AUI_DOCKART_INACTIVE_CAPTION_TEXT_COLOUR : <EOL> self . _inactive_caption_text_colour = colour <EOL> elif id == AUI_DOCKART_ACTIVE_CAPTION_COLOUR : <EOL> self . _active_caption_colour = colour <EOL> if not self . _custom_pane_bitmaps and wx . Platform == "<STR_LIT>" : <EOL> self . _active_close_bitmap = DrawMACCloseButton ( wx . WHITE , colour ) <EOL> elif id == AUI_DOCKART_ACTIVE_CAPTION_GRADIENT_COLOUR : <EOL> self . _active_caption_gradient_colour = colour <EOL> elif id == AUI_DOCKART_ACTIVE_CAPTION_TEXT_COLOUR : <EOL> self . _active_caption_text_colour = colour <EOL> elif id == AUI_DOCKART_BORDER_COLOUR : <EOL> self . _border_pen . SetColour ( colour ) <EOL> elif id == AUI_DOCKART_GRIPPER_COLOUR : <EOL> self . _gripper_brush . SetColour ( colour ) <EOL> self . _gripper_pen1 . SetColour ( StepColour ( colour , <NUM_LIT> ) ) <EOL> self . _gripper_pen2 . SetColour ( StepColour ( colour , <NUM_LIT> ) ) <EOL> elif id == AUI_DOCKART_HINT_WINDOW_COLOUR : <EOL> self . _hint_background_colour = colour <EOL> else : <EOL> raise Exception ( "<STR_LIT>" ) <EOL> GetColour = GetColor <EOL> SetColour = SetColor <EOL> def SetFont ( self , id , font ) : <EOL> """<STR_LIT>""" <EOL> if id == AUI_DOCKART_CAPTION_FONT : <EOL> self . _caption_font = font <EOL> def GetFont ( self , id ) : <EOL> """<STR_LIT>""" <EOL> if id == AUI_DOCKART_CAPTION_FONT : <EOL> return self . _caption_font <EOL> return wx . NullFont <EOL> def DrawSash ( self , dc , window , orient , rect ) : <EOL> """<STR_LIT>""" <EOL> dc . SetPen ( wx . TRANSPARENT_PEN ) <EOL> dc . SetBrush ( self . _sash_brush ) <EOL> dc . DrawRectangle ( rect . x , rect . y , rect . width , rect . height ) <EOL> draw_sash = self . GetMetric ( AUI_DOCKART_DRAW_SASH_GRIP ) <EOL> if draw_sash : <EOL> self . DrawSashGripper ( dc , orient , rect ) <EOL> def DrawBackground ( self , dc , window , orient , rect ) : <EOL> """<STR_LIT>""" <EOL> dc . SetPen ( wx . TRANSPARENT_PEN ) <EOL> if wx . Platform == "<STR_LIT>" : <EOL> dc . SetBrush ( wx . WHITE_BRUSH ) <EOL> dc . DrawRectangle ( rect . x , rect . y , rect . width , rect . height ) <EOL> DrawGradientRectangle ( dc , rect , self . _background_brush . GetColour ( ) , <EOL> self . _background_gradient_colour , <EOL> AUI_GRADIENT_HORIZONTAL , rect . x , <NUM_LIT> ) <EOL> def DrawBorder ( self , dc , window , rect , pane ) : <EOL> """<STR_LIT>""" <EOL> drect = wx . Rect ( * rect ) <EOL> dc . SetPen ( self . _border_pen ) <EOL> dc . SetBrush ( wx . TRANSPARENT_BRUSH ) <EOL> border_width = self . GetMetric ( AUI_DOCKART_PANE_BORDER_SIZE ) <EOL> if pane . IsToolbar ( ) : <EOL> for ii in xrange ( <NUM_LIT:0> , border_width ) : <EOL> dc . SetPen ( wx . WHITE_PEN ) <EOL> dc . DrawLine ( drect . x , drect . y , drect . x + drect . width , drect . y ) <EOL> dc . DrawLine ( drect . x , drect . y , drect . x , drect . y + drect . height ) <EOL> dc . SetPen ( self . _border_pen ) <EOL> dc . DrawLine ( drect . x , drect . y + drect . height - <NUM_LIT:1> , <EOL> drect . x + drect . width , drect . y + drect . height - <NUM_LIT:1> ) <EOL> dc . DrawLine ( drect . x + drect . width - <NUM_LIT:1> , drect . y , <EOL> drect . x + drect . width - <NUM_LIT:1> , drect . y + drect . height ) <EOL> drect . Deflate ( <NUM_LIT:1> , <NUM_LIT:1> ) <EOL> else : <EOL> for ii in xrange ( <NUM_LIT:0> , border_width ) : <EOL> dc . DrawRectangle ( drect . x , drect . y , drect . width , drect . height ) <EOL> drect . Deflate ( <NUM_LIT:1> , <NUM_LIT:1> ) <EOL> def DrawCaptionBackground ( self , dc , rect , pane ) : <EOL> """<STR_LIT>""" <EOL> active = pane . state & optionActive <EOL> if self . _gradient_type == AUI_GRADIENT_NONE : <EOL> if active : <EOL> dc . SetBrush ( wx . Brush ( self . _active_caption_colour ) ) <EOL> else : <EOL> dc . SetBrush ( wx . Brush ( self . _inactive_caption_colour ) ) <EOL> dc . DrawRectangle ( rect . x , rect . y , rect . width , rect . height ) <EOL> else : <EOL> switch_gradient = pane . HasCaptionLeft ( ) <EOL> gradient_type = self . _gradient_type <EOL> if switch_gradient : <EOL> gradient_type = ( self . _gradient_type == AUI_GRADIENT_HORIZONTAL and [ AUI_GRADIENT_VERTICAL ] or [ AUI_GRADIENT_HORIZONTAL ] ) [ <NUM_LIT:0> ] <EOL> if active : <EOL> if wx . Platform == "<STR_LIT>" : <EOL> DrawGradientRectangle ( dc , rect , self . _active_caption_colour , <EOL> self . _active_caption_gradient_colour , <EOL> gradient_type ) <EOL> else : <EOL> DrawGradientRectangle ( dc , rect , self . _active_caption_gradient_colour , <EOL> self . _active_caption_colour , <EOL> gradient_type ) <EOL> else : <EOL> if wx . Platform == "<STR_LIT>" : <EOL> DrawGradientRectangle ( dc , rect , self . _inactive_caption_gradient_colour , <EOL> self . _inactive_caption_colour , <EOL> gradient_type ) <EOL> else : <EOL> DrawGradientRectangle ( dc , rect , self . _inactive_caption_colour , <EOL> self . _inactive_caption_gradient_colour , <EOL> gradient_type ) <EOL> def DrawIcon ( self , dc , rect , pane ) : <EOL> """<STR_LIT>""" <EOL> if pane . icon . Ok ( ) : <EOL> if pane . HasCaptionLeft ( ) : <EOL> bmp = wx . ImageFromBitmap ( pane . icon ) . Rotate90 ( clockwise = False ) <EOL> dc . DrawBitmap ( bmp . ConvertToBitmap ( ) , rect . x + ( rect . width - pane . icon . GetWidth ( ) ) / <NUM_LIT:2> , rect . y + rect . height - <NUM_LIT:2> - pane . icon . GetHeight ( ) , True ) <EOL> else : <EOL> dc . DrawBitmap ( pane . icon , rect . x + <NUM_LIT:2> , rect . y + ( rect . height - pane . icon . GetHeight ( ) ) / <NUM_LIT:2> , True ) <EOL> def DrawCaption ( self , dc , window , text , rect , pane ) : <EOL> """<STR_LIT>""" <EOL> dc . SetPen ( wx . TRANSPARENT_PEN ) <EOL> dc . SetFont ( self . _caption_font ) <EOL> self . DrawCaptionBackground ( dc , rect , pane ) <EOL> if pane . state & optionActive : <EOL> dc . SetTextForeground ( self . _active_caption_text_colour ) <EOL> else : <EOL> dc . SetTextForeground ( self . _inactive_caption_text_colour ) <EOL> w , h = dc . GetTextExtent ( "<STR_LIT>" ) <EOL> clip_rect = wx . Rect ( * rect ) <EOL> btns = pane . CountButtons ( ) <EOL> captionLeft = pane . HasCaptionLeft ( ) <EOL> variable = ( captionLeft and [ rect . height ] or [ rect . width ] ) [ <NUM_LIT:0> ] <EOL> variable -= <NUM_LIT:3> <EOL> variable -= <NUM_LIT:2> <EOL> caption_offset = <NUM_LIT:0> <EOL> if pane . icon : <EOL> if captionLeft : <EOL> caption_offset += pane . icon . GetHeight ( ) + <NUM_LIT:3> <EOL> else : <EOL> caption_offset += pane . icon . GetWidth ( ) + <NUM_LIT:3> <EOL> self . DrawIcon ( dc , rect , pane ) <EOL> variable -= caption_offset <EOL> variable -= btns * ( self . _button_size + self . _border_size ) <EOL> draw_text = ChopText ( dc , text , variable ) <EOL> if captionLeft : <EOL> dc . DrawRotatedText ( draw_text , rect . x + ( rect . width / <NUM_LIT:2> ) - ( h / <NUM_LIT:2> ) - <NUM_LIT:1> , rect . y + rect . height - <NUM_LIT:3> - caption_offset , <NUM_LIT> ) <EOL> else : <EOL> dc . DrawText ( draw_text , rect . x + <NUM_LIT:3> + caption_offset , rect . y + ( rect . height / <NUM_LIT:2> ) - ( h / <NUM_LIT:2> ) - <NUM_LIT:1> ) <EOL> def RequestUserAttention ( self , dc , window , text , rect , pane ) : <EOL> """<STR_LIT>""" <EOL> state = pane . state <EOL> pane . state &= ~ optionActive <EOL> for indx in xrange ( <NUM_LIT:6> ) : <EOL> active = ( indx % <NUM_LIT:2> == <NUM_LIT:0> and [ True ] or [ False ] ) [ <NUM_LIT:0> ] <EOL> if active : <EOL> pane . state |= optionActive <EOL> else : <EOL> pane . state &= ~ optionActive <EOL> self . DrawCaptionBackground ( dc , rect , pane ) <EOL> self . DrawCaption ( dc , window , text , rect , pane ) <EOL> wx . SafeYield ( ) <EOL> wx . MilliSleep ( <NUM_LIT> ) <EOL> pane . state = state <EOL> def DrawGripper ( self , dc , window , rect , pane ) : <EOL> """<STR_LIT>""" <EOL> dc . SetPen ( wx . TRANSPARENT_PEN ) <EOL> dc . SetBrush ( self . _gripper_brush ) <EOL> dc . DrawRectangle ( rect . x , rect . y , rect . width , rect . height ) <EOL> if not pane . HasGripperTop ( ) : <EOL> y = <NUM_LIT:4> <EOL> while <NUM_LIT:1> : <EOL> dc . SetPen ( self . _gripper_pen1 ) <EOL> dc . DrawPoint ( rect . x + <NUM_LIT:3> , rect . y + y ) <EOL> dc . SetPen ( self . _gripper_pen2 ) <EOL> dc . DrawPoint ( rect . x + <NUM_LIT:3> , rect . y + y + <NUM_LIT:1> ) <EOL> dc . DrawPoint ( rect . x + <NUM_LIT:4> , rect . y + y ) <EOL> dc . SetPen ( self . _gripper_pen3 ) <EOL> dc . DrawPoint ( rect . x + <NUM_LIT:5> , rect . y + y + <NUM_LIT:1> ) <EOL> dc . DrawPoint ( rect . x + <NUM_LIT:5> , rect . y + y + <NUM_LIT:2> ) <EOL> dc . DrawPoint ( rect . x + <NUM_LIT:4> , rect . y + y + <NUM_LIT:2> ) <EOL> y = y + <NUM_LIT:4> <EOL> if y > rect . GetHeight ( ) - <NUM_LIT:4> : <EOL> break <EOL> else : <EOL> x = <NUM_LIT:4> <EOL> while <NUM_LIT:1> : <EOL> dc . SetPen ( self . _gripper_pen1 ) <EOL> dc . DrawPoint ( rect . x + x , rect . y + <NUM_LIT:3> ) <EOL> dc . SetPen ( self . _gripper_pen2 ) <EOL> dc . DrawPoint ( rect . x + x + <NUM_LIT:1> , rect . y + <NUM_LIT:3> ) <EOL> dc . DrawPoint ( rect . x + x , rect . y + <NUM_LIT:4> ) <EOL> dc . SetPen ( self . _gripper_pen3 ) <EOL> dc . DrawPoint ( rect . x + x + <NUM_LIT:1> , rect . y + <NUM_LIT:5> ) <EOL> dc . DrawPoint ( rect . x + x + <NUM_LIT:2> , rect . y + <NUM_LIT:5> ) <EOL> dc . DrawPoint ( rect . x + x + <NUM_LIT:2> , rect . y + <NUM_LIT:4> ) <EOL> x = x + <NUM_LIT:4> <EOL> if x > rect . GetWidth ( ) - <NUM_LIT:4> : <EOL> break <EOL> def DrawPaneButton ( self , dc , window , button , button_state , _rect , pane ) : <EOL> """<STR_LIT>""" <EOL> if not pane : <EOL> return <EOL> if button == AUI_BUTTON_CLOSE : <EOL> if pane . state & optionActive : <EOL> bmp = self . _active_close_bitmap <EOL> else : <EOL> bmp = self . _inactive_close_bitmap <EOL> elif button == AUI_BUTTON_PIN : <EOL> if pane . state & optionActive : <EOL> bmp = self . _active_pin_bitmap <EOL> else : <EOL> bmp = self . _inactive_pin_bitmap <EOL> elif button == AUI_BUTTON_MAXIMIZE_RESTORE : <EOL> if pane . IsMaximized ( ) : <EOL> if pane . state & optionActive : <EOL> bmp = self . _active_restore_bitmap <EOL> else : <EOL> bmp = self . _inactive_restore_bitmap <EOL> else : <EOL> if pane . state & optionActive : <EOL> bmp = self . _active_maximize_bitmap <EOL> else : <EOL> bmp = self . _inactive_maximize_bitmap <EOL> elif button == AUI_BUTTON_MINIMIZE : <EOL> if pane . state & optionActive : <EOL> bmp = self . _active_minimize_bitmap <EOL> else : <EOL> bmp = self . _inactive_minimize_bitmap <EOL> isVertical = pane . HasCaptionLeft ( ) <EOL> rect = wx . Rect ( * _rect ) <EOL> if isVertical : <EOL> old_x = rect . x <EOL> rect . x = rect . x + ( rect . width / <NUM_LIT:2> ) - ( bmp . GetWidth ( ) / <NUM_LIT:2> ) <EOL> rect . width = old_x + rect . width - rect . x - <NUM_LIT:1> <EOL> else : <EOL> old_y = rect . y <EOL> rect . y = rect . y + ( rect . height / <NUM_LIT:2> ) - ( bmp . GetHeight ( ) / <NUM_LIT:2> ) <EOL> rect . height = old_y + rect . height - rect . y - <NUM_LIT:1> <EOL> if button_state == AUI_BUTTON_STATE_PRESSED : <EOL> rect . x += <NUM_LIT:1> <EOL> rect . y += <NUM_LIT:1> <EOL> if button_state in [ AUI_BUTTON_STATE_HOVER , AUI_BUTTON_STATE_PRESSED ] : <EOL> if pane . state & optionActive : <EOL> dc . SetBrush ( wx . Brush ( StepColour ( self . _active_caption_colour , <NUM_LIT> ) ) ) <EOL> dc . SetPen ( wx . Pen ( StepColour ( self . _active_caption_colour , <NUM_LIT> ) ) ) <EOL> else : <EOL> dc . SetBrush ( wx . Brush ( StepColour ( self . _inactive_caption_colour , <NUM_LIT> ) ) ) <EOL> dc . SetPen ( wx . Pen ( StepColour ( self . _inactive_caption_colour , <NUM_LIT> ) ) ) <EOL> if wx . Platform != "<STR_LIT>" : <EOL> dc . DrawRectangle ( rect . x , rect . y , <NUM_LIT:15> , <NUM_LIT:15> ) <EOL> else : <EOL> bmp = DarkenBitmap ( bmp , self . _active_caption_colour , StepColour ( self . _active_caption_colour , <NUM_LIT> ) ) <EOL> if isVertical : <EOL> bmp = wx . ImageFromBitmap ( bmp ) . Rotate90 ( clockwise = False ) . ConvertToBitmap ( ) <EOL> dc . DrawBitmap ( bmp , rect . x , rect . y , True ) <EOL> def DrawSashGripper ( self , dc , orient , rect ) : <EOL> """<STR_LIT>""" <EOL> dc . SetBrush ( self . _gripper_brush ) <EOL> if orient == wx . HORIZONTAL : <EOL> x = rect . x + int ( ( <NUM_LIT:1.0> / <NUM_LIT> ) * rect . width ) <EOL> xend = rect . x + int ( ( <NUM_LIT> / <NUM_LIT> ) * rect . width ) <EOL> y = rect . y + ( rect . height / <NUM_LIT:2> ) - <NUM_LIT:1> <EOL> while <NUM_LIT:1> : <EOL> dc . SetPen ( self . _gripper_pen3 ) <EOL> dc . DrawRectangle ( x , y , <NUM_LIT:2> , <NUM_LIT:2> ) <EOL> dc . SetPen ( self . _gripper_pen2 ) <EOL> dc . DrawPoint ( x + <NUM_LIT:1> , y + <NUM_LIT:1> ) <EOL> x = x + <NUM_LIT:5> <EOL> if x >= xend : <EOL> break <EOL> else : <EOL> y = rect . y + int ( ( <NUM_LIT:1.0> / <NUM_LIT> ) * rect . height ) <EOL> yend = rect . y + int ( ( <NUM_LIT> / <NUM_LIT> ) * rect . height ) <EOL> x = rect . x + ( rect . width / <NUM_LIT:2> ) - <NUM_LIT:1> <EOL> while <NUM_LIT:1> : <EOL> dc . SetPen ( self . _gripper_pen3 ) <EOL> dc . DrawRectangle ( x , y , <NUM_LIT:2> , <NUM_LIT:2> ) <EOL> dc . SetPen ( self . _gripper_pen2 ) <EOL> dc . DrawPoint ( x + <NUM_LIT:1> , y + <NUM_LIT:1> ) <EOL> y = y + <NUM_LIT:5> <EOL> if y >= yend : <EOL> break <EOL> def SetDefaultPaneBitmaps ( self , isMac ) : <EOL> """<STR_LIT>""" <EOL> if isMac : <EOL> self . _inactive_close_bitmap = DrawMACCloseButton ( wx . WHITE , self . _inactive_caption_colour ) <EOL> self . _active_close_bitmap = DrawMACCloseButton ( wx . WHITE , self . _active_caption_colour ) <EOL> else : <EOL> self . _inactive_close_bitmap = BitmapFromBits ( close_bits , <NUM_LIT:16> , <NUM_LIT:16> , self . _inactive_caption_text_colour ) <EOL> self . _active_close_bitmap = BitmapFromBits ( close_bits , <NUM_LIT:16> , <NUM_LIT:16> , self . _active_caption_text_colour ) <EOL> if isMac : <EOL> self . _inactive_maximize_bitmap = BitmapFromBits ( max_bits , <NUM_LIT:16> , <NUM_LIT:16> , wx . WHITE ) <EOL> self . _active_maximize_bitmap = BitmapFromBits ( max_bits , <NUM_LIT:16> , <NUM_LIT:16> , wx . WHITE ) <EOL> else : <EOL> self . _inactive_maximize_bitmap = BitmapFromBits ( max_bits , <NUM_LIT:16> , <NUM_LIT:16> , self . _inactive_caption_text_colour ) <EOL> self . _active_maximize_bitmap = BitmapFromBits ( max_bits , <NUM_LIT:16> , <NUM_LIT:16> , self . _active_caption_text_colour ) <EOL> if isMac : <EOL> self . _inactive_restore_bitmap = BitmapFromBits ( restore_bits , <NUM_LIT:16> , <NUM_LIT:16> , wx . WHITE ) <EOL> self . _active_restore_bitmap = BitmapFromBits ( restore_bits , <NUM_LIT:16> , <NUM_LIT:16> , wx . WHITE ) <EOL> else : <EOL> self . _inactive_restore_bitmap = BitmapFromBits ( restore_bits , <NUM_LIT:16> , <NUM_LIT:16> , self . _inactive_caption_text_colour ) <EOL> self . _active_restore_bitmap = BitmapFromBits ( restore_bits , <NUM_LIT:16> , <NUM_LIT:16> , self . _active_caption_text_colour ) <EOL> if isMac : <EOL> self . _inactive_minimize_bitmap = BitmapFromBits ( minimize_bits , <NUM_LIT:16> , <NUM_LIT:16> , wx . WHITE ) <EOL> self . _active_minimize_bitmap = BitmapFromBits ( minimize_bits , <NUM_LIT:16> , <NUM_LIT:16> , wx . WHITE ) <EOL> else : <EOL> self . _inactive_minimize_bitmap = BitmapFromBits ( minimize_bits , <NUM_LIT:16> , <NUM_LIT:16> , self . _inactive_caption_text_colour ) <EOL> self . _active_minimize_bitmap = BitmapFromBits ( minimize_bits , <NUM_LIT:16> , <NUM_LIT:16> , self . _active_caption_text_colour ) <EOL> self . _inactive_pin_bitmap = BitmapFromBits ( pin_bits , <NUM_LIT:16> , <NUM_LIT:16> , self . _inactive_caption_text_colour ) <EOL> self . _active_pin_bitmap = BitmapFromBits ( pin_bits , <NUM_LIT:16> , <NUM_LIT:16> , self . _active_caption_text_colour ) <EOL> self . _custom_pane_bitmaps = False <EOL> def SetCustomPaneBitmap ( self , bmp , button , active , maximize = False ) : <EOL> """<STR_LIT>""" <EOL> if bmp . GetWidth ( ) > <NUM_LIT:16> or bmp . GetHeight ( ) > <NUM_LIT:16> : <EOL> raise Exception ( "<STR_LIT>" ) <EOL> if button == AUI_BUTTON_CLOSE : <EOL> if active : <EOL> self . _active_close_bitmap = bmp <EOL> else : <EOL> self . _inactive_close_bitmap = bmp <EOL> if wx . Platform == "<STR_LIT>" : <EOL> self . _custom_pane_bitmaps = True <EOL> elif button == AUI_BUTTON_PIN : <EOL> if active : <EOL> self . _active_pin_bitmap = bmp <EOL> else : <EOL> self . _inactive_pin_bitmap = bmp <EOL> elif button == AUI_BUTTON_MAXIMIZE_RESTORE : <EOL> if maximize : <EOL> if active : <EOL> self . _active_maximize_bitmap = bmp <EOL> else : <EOL> self . _inactive_maximize_bitmap = bmp <EOL> else : <EOL> if active : <EOL> self . _active_restore_bitmap = bmp <EOL> else : <EOL> self . _inactive_restore_bitmap = bmp <EOL> elif button == AUI_BUTTON_MINIMIZE : <EOL> if active : <EOL> self . _active_minimize_bitmap = bmp <EOL> else : <EOL> self . _inactive_minimize_bitmap = bmp <EOL> if _ctypes : <EOL> class RECT ( ctypes . Structure ) : <EOL> """<STR_LIT>""" <EOL> _fields_ = [ ( '<STR_LIT:left>' , ctypes . c_ulong ) , ( '<STR_LIT>' , ctypes . c_ulong ) , ( '<STR_LIT:right>' , ctypes . c_ulong ) , ( '<STR_LIT>' , ctypes . c_ulong ) ] <EOL> def dump ( self ) : <EOL> """<STR_LIT>""" <EOL> return map ( int , ( self . left , self . top , self . right , self . bottom ) ) <EOL> class SIZE ( ctypes . Structure ) : <EOL> """<STR_LIT>""" <EOL> _fields_ = [ ( '<STR_LIT:x>' , ctypes . c_long ) , ( '<STR_LIT:y>' , ctypes . c_long ) ] <EOL> class ModernDockArt ( AuiDefaultDockArt ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , win ) : <EOL> """<STR_LIT>""" <EOL> AuiDefaultDockArt . __init__ ( self ) <EOL> self . win = win <EOL> hwnd = self . win . GetHandle ( ) <EOL> self . usingTheme = False <EOL> if _ctypes : <EOL> self . hTheme1 = winxptheme . OpenThemeData ( hwnd , "<STR_LIT>" ) <EOL> self . usingTheme = True <EOL> if not self . hTheme1 : <EOL> self . usingTheme = False <EOL> self . _button_size = <NUM_LIT> <EOL> self . _button_border_size = <NUM_LIT:3> <EOL> self . _caption_text_indent = <NUM_LIT:6> <EOL> self . _caption_size = <NUM_LIT> <EOL> self . _active_close_bitmap = self . _inactive_close_bitmap <EOL> self . Init ( ) <EOL> def Init ( self ) : <EOL> """<STR_LIT>""" <EOL> AuiDefaultDockArt . Init ( self ) <EOL> self . _active_caption_colour = self . _inactive_caption_colour <EOL> self . _active_caption_text_colour = wx . SystemSettings . GetColour ( wx . SYS_COLOUR_CAPTIONTEXT ) <EOL> self . _inactive_caption_text_colour = self . _active_caption_text_colour <EOL> def DrawCaption ( self , dc , window , text , rect , pane ) : <EOL> """<STR_LIT>""" <EOL> dc . SetPen ( wx . TRANSPARENT_PEN ) <EOL> self . DrawCaptionBackground ( dc , rect , pane ) <EOL> active = ( ( pane . state & optionActive ) and [ True ] or [ False ] ) [ <NUM_LIT:0> ] <EOL> self . _caption_font . SetWeight ( wx . FONTWEIGHT_BOLD ) <EOL> dc . SetFont ( self . _caption_font ) <EOL> if active : <EOL> dc . SetTextForeground ( self . _active_caption_text_colour ) <EOL> else : <EOL> dc . SetTextForeground ( self . _inactive_caption_text_colour ) <EOL> w , h = dc . GetTextExtent ( "<STR_LIT>" ) <EOL> clip_rect = wx . Rect ( * rect ) <EOL> btns = pane . CountButtons ( ) <EOL> captionLeft = pane . HasCaptionLeft ( ) <EOL> variable = ( captionLeft and [ rect . height ] or [ rect . width ] ) [ <NUM_LIT:0> ] <EOL> variable -= <NUM_LIT:3> <EOL> variable -= <NUM_LIT:2> <EOL> caption_offset = <NUM_LIT:0> <EOL> if pane . icon : <EOL> if captionLeft : <EOL> caption_offset += pane . icon . GetHeight ( ) + <NUM_LIT:3> <EOL> else : <EOL> caption_offset += pane . icon . GetWidth ( ) + <NUM_LIT:3> <EOL> self . DrawIcon ( dc , rect , pane ) <EOL> diff = - <NUM_LIT:2> <EOL> if self . usingTheme : <EOL> diff = - <NUM_LIT:1> <EOL> variable -= caption_offset <EOL> variable -= btns * ( self . _button_size + self . _button_border_size ) <EOL> draw_text = ChopText ( dc , text , variable ) <EOL> if captionLeft : <EOL> dc . DrawRotatedText ( draw_text , rect . x + ( rect . width / <NUM_LIT:2> ) - ( h / <NUM_LIT:2> ) - diff , rect . y + rect . height - <NUM_LIT:3> - caption_offset , <NUM_LIT> ) <EOL> else : <EOL> dc . DrawText ( draw_text , rect . x + <NUM_LIT:3> + caption_offset , rect . y + ( rect . height / <NUM_LIT:2> ) - ( h / <NUM_LIT:2> ) - diff ) <EOL> def DrawCaptionBackground ( self , dc , rect , pane ) : <EOL> """<STR_LIT>""" <EOL> dc . SetBrush ( self . _background_brush ) <EOL> dc . DrawRectangle ( rect . x , rect . y , rect . width , rect . height ) <EOL> active = ( ( pane . state & optionActive ) and [ True ] or [ False ] ) [ <NUM_LIT:0> ] <EOL> if self . usingTheme : <EOL> rectangle = wx . Rect ( ) <EOL> rc = RECT ( rectangle . x , rectangle . y , rectangle . width , rectangle . height ) <EOL> rect . x = max ( <NUM_LIT:0> , rect . x ) <EOL> rect . y = max ( <NUM_LIT:0> , rect . y ) <EOL> rc . top = rect . x <EOL> rc . left = rect . y <EOL> rc . right = rect . x + rect . width <EOL> rc . bottom = rect . y + rect . height <EOL> if active : <EOL> winxptheme . DrawThemeBackground ( self . hTheme1 , dc . GetHDC ( ) , <NUM_LIT:5> , <NUM_LIT:1> , ( rc . top , rc . left , rc . right , rc . bottom ) , None ) <EOL> else : <EOL> winxptheme . DrawThemeBackground ( self . hTheme1 , dc . GetHDC ( ) , <NUM_LIT:5> , <NUM_LIT:2> , ( rc . top , rc . left , rc . right , rc . bottom ) , None ) <EOL> else : <EOL> AuiDefaultDockArt . DrawCaptionBackground ( self , dc , rect , pane ) <EOL> def RequestUserAttention ( self , dc , window , text , rect , pane ) : <EOL> """<STR_LIT>""" <EOL> state = pane . state <EOL> pane . state &= ~ optionActive <EOL> for indx in xrange ( <NUM_LIT:6> ) : <EOL> active = ( indx % <NUM_LIT:2> == <NUM_LIT:0> and [ True ] or [ False ] ) [ <NUM_LIT:0> ] <EOL> if active : <EOL> pane . state |= optionActive <EOL> else : <EOL> pane . state &= ~ optionActive <EOL> self . DrawCaptionBackground ( dc , rect , pane ) <EOL> self . DrawCaption ( dc , window , text , rect , pane ) <EOL> wx . SafeYield ( ) <EOL> wx . MilliSleep ( <NUM_LIT> ) <EOL> pane . state = state <EOL> def DrawPaneButton ( self , dc , window , button , button_state , rect , pane ) : <EOL> """<STR_LIT>""" <EOL> if self . usingTheme : <EOL> hTheme = self . hTheme1 <EOL> drect = wx . Rect ( rect . x , rect . y , self . _button_size , self . _button_size ) <EOL> rc = RECT ( <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> ) <EOL> if pane . HasCaptionLeft ( ) : <EOL> rc . top = rect . x + self . _button_border_size <EOL> rc . left = int ( rect . y + <NUM_LIT> * self . _button_border_size ) <EOL> rc . right = rect . x + self . _button_size + self . _button_border_size <EOL> rc . bottom = int ( rect . y + self . _button_size + <NUM_LIT> * self . _button_border_size ) <EOL> else : <EOL> rc . top = rect . x - self . _button_border_size <EOL> rc . left = int ( rect . y + <NUM_LIT> * self . _button_border_size ) <EOL> rc . right = rect . x + self . _button_size - self . _button_border_size <EOL> rc . bottom = int ( rect . y + self . _button_size + <NUM_LIT> * self . _button_border_size ) <EOL> if button == AUI_BUTTON_CLOSE : <EOL> btntype = <NUM_LIT> <EOL> elif button == AUI_BUTTON_PIN : <EOL> btntype = <NUM_LIT> <EOL> elif button == AUI_BUTTON_MAXIMIZE_RESTORE : <EOL> if not pane . IsMaximized ( ) : <EOL> btntype = <NUM_LIT> <EOL> else : <EOL> btntype = <NUM_LIT> <EOL> else : <EOL> btntype = <NUM_LIT:15> <EOL> state = <NUM_LIT:4> <EOL> if pane . state & optionActive : <EOL> if button_state == AUI_BUTTON_STATE_NORMAL : <EOL> state = <NUM_LIT:1> <EOL> elif button_state == AUI_BUTTON_STATE_HOVER : <EOL> state = <NUM_LIT:2> <EOL> elif button_state == AUI_BUTTON_STATE_PRESSED : <EOL> state = <NUM_LIT:3> <EOL> else : <EOL> raise Exception ( "<STR_LIT>" ) <EOL> else : <EOL> if button_state == AUI_BUTTON_STATE_NORMAL : <EOL> state = <NUM_LIT:5> <EOL> elif button_state == AUI_BUTTON_STATE_HOVER : <EOL> state = <NUM_LIT:6> <EOL> elif button_state == AUI_BUTTON_STATE_PRESSED : <EOL> state = <NUM_LIT:7> <EOL> else : <EOL> raise Exception ( "<STR_LIT>" ) <EOL> try : <EOL> winxptheme . DrawThemeBackground ( hTheme , dc . GetHDC ( ) , btntype , state , ( rc . top , rc . left , rc . right , rc . bottom ) , None ) <EOL> except TypeError : <EOL> return <EOL> else : <EOL> rect2 = wx . Rect ( rect . x - <NUM_LIT:4> , rect . y + <NUM_LIT:2> , rect . width , rect . height ) <EOL> AuiDefaultDockArt . DrawPaneButton ( self , dc , window , button , button_state , rect2 , pane ) </s>
<s> APP_NAME = "<STR_LIT>" <EOL> APP_ICON = "<STR_LIT>" <EOL> APP_THEME = "<STR_LIT>" </s>
<s> from __future__ import absolute_import , unicode_literals <EOL> import logging <EOL> import os <EOL> import sys <EOL> from os . path import expanduser , isdir , join , exists <EOL> from . utils import rm_empty_dir , rm_rf <EOL> import platform <EOL> if platform . release ( ) == "<STR_LIT>" : <EOL> from . csidl import get_folder_path <EOL> quicklaunch_dirs = [ "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ] <EOL> else : <EOL> from . knownpaths import get_folder_path <EOL> quicklaunch_dirs = [ ] <EOL> from . winshortcut import create_shortcut <EOL> quicklaunch_dir = join ( get_folder_path ( '<STR_LIT>' ) , * quicklaunch_dirs ) <EOL> dirs = { "<STR_LIT>" : { "<STR_LIT>" : get_folder_path ( '<STR_LIT>' ) , <EOL> "<STR_LIT:start>" : get_folder_path ( '<STR_LIT>' ) } , <EOL> "<STR_LIT:user>" : { "<STR_LIT>" : get_folder_path ( '<STR_LIT>' ) , <EOL> "<STR_LIT:start>" : get_folder_path ( '<STR_LIT>' ) } } <EOL> def quoted ( s ) : <EOL> """<STR_LIT>""" <EOL> s = s . strip ( u'<STR_LIT:">' ) <EOL> if u'<STR_LIT:U+0020>' in s or u'<STR_LIT:/>' in s : <EOL> return u'<STR_LIT>' % s <EOL> else : <EOL> return s <EOL> def to_unicode ( var , codec = sys . getdefaultencoding ( ) ) : <EOL> if not codec : <EOL> codec = "<STR_LIT:utf-8>" <EOL> if hasattr ( var , "<STR_LIT>" ) : <EOL> var = var . decode ( codec ) <EOL> return var <EOL> def to_bytes ( var , codec = sys . getdefaultencoding ( ) ) : <EOL> if not codec : <EOL> codec = "<STR_LIT:utf-8>" <EOL> if hasattr ( var , "<STR_LIT>" ) : <EOL> var = var . encode ( codec ) <EOL> return var <EOL> unicode_prefix = to_unicode ( sys . prefix ) <EOL> def substitute_env_variables ( text , env_prefix = unicode_prefix , env_name = None ) : <EOL> py_major_ver = sys . version_info [ <NUM_LIT:0> ] <EOL> py_bitness = <NUM_LIT:8> * tuple . __itemsize__ <EOL> env_prefix = to_unicode ( env_prefix ) <EOL> text = to_unicode ( text ) <EOL> env_name = to_unicode ( env_name ) <EOL> for a , b in [ <EOL> ( u'<STR_LIT>' , env_prefix ) , <EOL> ( u'<STR_LIT>' , unicode_prefix ) , <EOL> ( u'<STR_LIT>' , <EOL> os . path . normpath ( join ( env_prefix , u'<STR_LIT>' ) ) . replace ( u"<STR_LIT:\\>" , u"<STR_LIT:/>" ) ) , <EOL> ( u'<STR_LIT>' , join ( env_prefix , u'<STR_LIT>' ) ) , <EOL> ( u'<STR_LIT>' , get_folder_path ( '<STR_LIT>' ) ) , <EOL> ( u'<STR_LIT>' , get_folder_path ( '<STR_LIT>' ) ) , <EOL> ( u'<STR_LIT>' , env_name if env_name else u"<STR_LIT>" ) , <EOL> ( u'<STR_LIT>' , u'<STR_LIT>' % ( py_major_ver ) ) , <EOL> ( u'<STR_LIT>' , u"<STR_LIT>" % py_bitness ) , <EOL> ] : <EOL> text = text . replace ( a , b ) <EOL> return text <EOL> class Menu ( object ) : <EOL> def __init__ ( self , name , prefix = unicode_prefix , mode = None ) : <EOL> prefix = to_unicode ( prefix ) <EOL> self . mode = mode if mode else ( '<STR_LIT:user>' if exists ( join ( prefix , u'<STR_LIT>' ) ) else '<STR_LIT>' ) <EOL> folder_name = substitute_env_variables ( name ) <EOL> self . path = join ( dirs [ self . mode ] [ "<STR_LIT:start>" ] , folder_name ) <EOL> try : <EOL> self . create ( ) <EOL> except WindowsError : <EOL> logging . warn ( "<STR_LIT>" <EOL> "<STR_LIT>" ) <EOL> self . path = join ( dirs [ "<STR_LIT:user>" ] [ "<STR_LIT:start>" ] , folder_name ) <EOL> self . mode = "<STR_LIT:user>" <EOL> def create ( self ) : <EOL> if not isdir ( self . path ) : <EOL> os . mkdir ( self . path ) <EOL> def remove ( self ) : <EOL> rm_empty_dir ( self . path ) <EOL> def get_python_args_for_subprocess ( prefix , args , cmd ) : <EOL> return [ quoted ( join ( unicode_prefix , u'<STR_LIT>' ) ) , quoted ( prefix ) , <EOL> quoted ( cmd ) ] + args <EOL> def extend_script_args ( args , shortcut ) : <EOL> try : <EOL> args . append ( shortcut [ '<STR_LIT>' ] ) <EOL> except KeyError : <EOL> pass <EOL> try : <EOL> args . extend ( shortcut [ '<STR_LIT>' ] ) <EOL> except KeyError : <EOL> pass <EOL> class ShortCut ( object ) : <EOL> def __init__ ( self , menu , shortcut , target_prefix , env_name ) : <EOL> """<STR_LIT>""" <EOL> self . menu = menu <EOL> self . shortcut = shortcut <EOL> self . prefix = to_unicode ( target_prefix ) <EOL> self . env_name = env_name <EOL> def remove ( self ) : <EOL> self . create ( remove = True ) <EOL> def create ( self , remove = False ) : <EOL> args = [ ] <EOL> if "<STR_LIT>" in self . shortcut : <EOL> cmd = join ( self . prefix , u"<STR_LIT>" ) . replace ( "<STR_LIT:\\>" , "<STR_LIT:/>" ) <EOL> args = self . shortcut [ "<STR_LIT>" ] . split ( ) <EOL> args = get_python_args_for_subprocess ( self . prefix , args , cmd ) <EOL> elif "<STR_LIT>" in self . shortcut : <EOL> cmd = join ( self . prefix , u"<STR_LIT>" ) . replace ( "<STR_LIT:\\>" , "<STR_LIT:/>" ) <EOL> args = self . shortcut [ "<STR_LIT>" ] . split ( ) <EOL> args = get_python_args_for_subprocess ( self . prefix , args , cmd ) <EOL> elif "<STR_LIT>" in self . shortcut : <EOL> cmd = join ( unicode_prefix , u'<STR_LIT>' ) <EOL> args = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , self . shortcut [ '<STR_LIT>' ] ] <EOL> elif "<STR_LIT>" in self . shortcut : <EOL> cmd = self . shortcut [ "<STR_LIT>" ] . replace ( '<STR_LIT:/>' , '<STR_LIT:\\>' ) <EOL> extend_script_args ( args , self . shortcut ) <EOL> args = get_python_args_for_subprocess ( self . prefix , args , cmd ) <EOL> cmd = join ( unicode_prefix , u"<STR_LIT>" ) . replace ( "<STR_LIT:\\>" , "<STR_LIT:/>" ) <EOL> elif "<STR_LIT>" in self . shortcut : <EOL> cmd = substitute_env_variables ( <EOL> self . shortcut [ "<STR_LIT>" ] , <EOL> env_prefix = self . prefix , <EOL> env_name = self . env_name ) . replace ( '<STR_LIT:/>' , '<STR_LIT:\\>' ) <EOL> extend_script_args ( args , self . shortcut ) <EOL> else : <EOL> raise Exception ( "<STR_LIT>" % self . shortcut ) <EOL> workdir = self . shortcut . get ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> icon = self . shortcut . get ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> args = [ substitute_env_variables ( s , env_prefix = self . prefix , <EOL> env_name = self . env_name ) for s in args ] <EOL> workdir = substitute_env_variables ( workdir , <EOL> env_prefix = self . prefix , <EOL> env_name = self . env_name ) <EOL> icon = substitute_env_variables ( icon , env_prefix = self . prefix , <EOL> env_name = self . env_name ) <EOL> workdir = workdir . replace ( '<STR_LIT:/>' , '<STR_LIT:\\>' ) <EOL> icon = icon . replace ( '<STR_LIT:/>' , '<STR_LIT:\\>' ) <EOL> if workdir : <EOL> if not isdir ( workdir ) : <EOL> os . makedirs ( workdir ) <EOL> else : <EOL> workdir = expanduser ( '<STR_LIT>' ) <EOL> dst_dirs = [ self . menu . path ] <EOL> if self . shortcut . get ( '<STR_LIT>' ) : <EOL> dst_dirs . append ( dirs [ self . menu . mode ] [ '<STR_LIT>' ] ) <EOL> if self . shortcut . get ( '<STR_LIT>' ) : <EOL> dst_dirs . append ( dirs [ self . menu . mode ] [ '<STR_LIT>' ] ) <EOL> name_suffix = "<STR_LIT>" . format ( self . env_name ) if self . env_name else "<STR_LIT>" <EOL> for dst_dir in dst_dirs : <EOL> dst = join ( dst_dir , self . shortcut [ '<STR_LIT:name>' ] + name_suffix + '<STR_LIT>' ) <EOL> if remove : <EOL> rm_rf ( dst ) <EOL> else : <EOL> create_shortcut ( <EOL> u'<STR_LIT>' + quoted ( cmd ) , <EOL> u'<STR_LIT>' + self . shortcut [ '<STR_LIT:name>' ] + name_suffix , <EOL> u'<STR_LIT>' + dst , <EOL> u'<STR_LIT:U+0020>' . join ( quoted ( arg ) for arg in args ) , <EOL> u'<STR_LIT>' + workdir , <EOL> u'<STR_LIT>' + icon , <EOL> ) </s>
<s> import argparse <EOL> import sys <EOL> import os <EOL> from django . template import Template , Context <EOL> from django . conf import settings as django_settings <EOL> import django <EOL> __author__ = '<STR_LIT>' <EOL> def _create_file_from_template ( template_file_name , destination_file_name , topology_name ) : <EOL> with open ( template_file_name , '<STR_LIT:r>' ) as template_file : <EOL> template_str = template_file . read ( ) <EOL> template = Template ( template_str ) <EOL> context = Context ( { '<STR_LIT>' : topology_name } ) <EOL> file_contents = template . render ( context ) <EOL> with open ( destination_file_name , '<STR_LIT:w>' ) as destination_file : <EOL> destination_file . write ( file_contents ) <EOL> def scaffold ( args ) : <EOL> dir_name = args . dir_name <EOL> topology_name = args . topology_name <EOL> if '<STR_LIT>' not in os . environ : <EOL> if not django_settings . configured : <EOL> django_settings . configure ( ) <EOL> django . setup ( ) <EOL> if os . path . exists ( dir_name ) : <EOL> print '<STR_LIT>' <EOL> sys . exit ( <NUM_LIT:1> ) <EOL> os . makedirs ( dir_name ) <EOL> open ( '<STR_LIT>' % dir_name , '<STR_LIT:w>' ) . close ( ) <EOL> template_dir = '<STR_LIT>' % os . path . dirname ( os . path . realpath ( __file__ ) ) <EOL> _create_file_from_template ( '<STR_LIT>' % template_dir , '<STR_LIT>' % dir_name , topology_name ) <EOL> _create_file_from_template ( '<STR_LIT>' % template_dir , '<STR_LIT>' % dir_name , topology_name ) <EOL> _create_file_from_template ( '<STR_LIT>' % template_dir , '<STR_LIT>' % dir_name , topology_name ) <EOL> _create_file_from_template ( '<STR_LIT>' % template_dir , '<STR_LIT>' % dir_name , topology_name ) <EOL> usage = """<STR_LIT>""" <EOL> print usage . format ( dir_name = dir_name , topology_name = topology_name ) <EOL> def listen ( args ) : <EOL> raise BaseException ( "<STR_LIT>" ) <EOL> def submit ( args ) : <EOL> raise BaseException ( "<STR_LIT>" ) <EOL> def main ( ) : <EOL> parser = argparse . ArgumentParser ( description = '<STR_LIT>' ) <EOL> subparsers = parser . add_subparsers ( ) <EOL> scaffold_parser = subparsers . add_parser ( '<STR_LIT>' , help = '<STR_LIT>' ) <EOL> scaffold_parser . add_argument ( '<STR_LIT>' , help = '<STR_LIT>' ) <EOL> scaffold_parser . add_argument ( '<STR_LIT>' , help = '<STR_LIT>' ) <EOL> scaffold_parser . set_defaults ( func = scaffold ) <EOL> listen_parser = subparsers . add_parser ( '<STR_LIT>' , help = '<STR_LIT>' ) <EOL> listen_parser . set_defaults ( func = listen ) <EOL> submit_parser = subparsers . add_parser ( '<STR_LIT>' , help = '<STR_LIT>' ) <EOL> submit_parser . add_argument ( '<STR_LIT>' ) <EOL> submit_parser . set_defaults ( func = submit ) <EOL> if len ( sys . argv ) < <NUM_LIT:2> : <EOL> parser . print_help ( ) <EOL> sys . exit ( <NUM_LIT:0> ) <EOL> args = parser . parse_args ( ) <EOL> args . func ( args ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> main ( ) </s>
<s> import unittest <EOL> from hydro . transformers import Transformers <EOL> from pandas import DataFrame <EOL> from pandas . util . testing import assert_frame_equal <EOL> from numpy import nan <EOL> __author__ = '<STR_LIT>' <EOL> class TransformersTest ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . test_df_1 = DataFrame ( { '<STR_LIT:id>' : [ '<STR_LIT:1>' , '<STR_LIT:2>' ] , '<STR_LIT:name>' : [ '<STR_LIT>' , '<STR_LIT>' ] } ) <EOL> self . test_df_2 = DataFrame ( { '<STR_LIT:id>' : [ '<STR_LIT:1>' , '<STR_LIT:3>' ] , '<STR_LIT>' : [ '<STR_LIT>' , '<STR_LIT>' ] } ) <EOL> self . test_df_3 = DataFrame ( { '<STR_LIT:id>' : [ '<STR_LIT:1>' , '<STR_LIT:2>' ] , '<STR_LIT>' : [ '<STR_LIT>' , '<STR_LIT>' ] } ) <EOL> self . test_result_1 = DataFrame ( { '<STR_LIT:id>' : [ '<STR_LIT:1>' ] , '<STR_LIT:name>' : [ '<STR_LIT>' ] , '<STR_LIT>' : [ '<STR_LIT>' ] } ) [ [ "<STR_LIT:id>" , "<STR_LIT:name>" , "<STR_LIT>" ] ] <EOL> self . test_result_2 = DataFrame ( { '<STR_LIT:id>' : [ '<STR_LIT:1>' , '<STR_LIT:2>' ] , '<STR_LIT:name>' : [ '<STR_LIT>' , '<STR_LIT>' ] , <EOL> '<STR_LIT>' : [ '<STR_LIT>' , nan ] } ) [ [ "<STR_LIT:id>" , "<STR_LIT:name>" , "<STR_LIT>" ] ] <EOL> self . test_result_3 = DataFrame ( { '<STR_LIT:id>' : [ '<STR_LIT:1>' , '<STR_LIT:3>' ] , '<STR_LIT:name>' : [ '<STR_LIT>' , nan ] , <EOL> '<STR_LIT>' : [ '<STR_LIT>' , '<STR_LIT>' ] } ) [ [ "<STR_LIT:id>" , "<STR_LIT:name>" , "<STR_LIT>" ] ] <EOL> self . test_result_4 = DataFrame ( { '<STR_LIT:id>' : [ '<STR_LIT:1>' ] , '<STR_LIT>' : [ '<STR_LIT>' ] , <EOL> '<STR_LIT>' : [ '<STR_LIT>' ] } ) [ [ "<STR_LIT>" , "<STR_LIT:id>" , <EOL> "<STR_LIT>" ] ] <EOL> self . transformer = Transformers ( ) <EOL> def test_combine ( self ) : <EOL> comb_res1 = self . transformer . combine ( self . test_df_1 , self . test_df_2 , "<STR_LIT:id>" , "<STR_LIT:id>" ) [ [ "<STR_LIT:id>" , "<STR_LIT:name>" , "<STR_LIT>" ] ] <EOL> assert_frame_equal ( comb_res1 , self . test_result_1 ) <EOL> comb_res2 = self . transformer . combine ( self . test_df_1 , self . test_df_2 , "<STR_LIT:id>" , "<STR_LIT:id>" , "<STR_LIT:left>" ) [ [ "<STR_LIT:id>" , "<STR_LIT:name>" , <EOL> "<STR_LIT>" ] ] <EOL> assert_frame_equal ( comb_res2 , self . test_result_2 ) <EOL> comb_res3 = self . transformer . combine ( self . test_df_1 , self . test_df_2 , "<STR_LIT:id>" , "<STR_LIT:id>" , "<STR_LIT:right>" ) [ [ "<STR_LIT:id>" , "<STR_LIT:name>" , <EOL> "<STR_LIT>" ] ] <EOL> assert_frame_equal ( comb_res3 , self . test_result_3 ) <EOL> comb_res4 = self . transformer . combine ( self . test_df_3 , self . test_df_2 , "<STR_LIT:id>" , "<STR_LIT:id>" , <EOL> suffixes = ( '<STR_LIT>' , '<STR_LIT>' ) ) <EOL> assert_frame_equal ( comb_res4 , self . test_result_4 ) <EOL> def test_concat ( self ) : <EOL> concat_res1 = self . transformer . concat ( [ self . test_df_2 , self . test_df_3 ] ) <EOL> self . assertEquals ( <NUM_LIT:4> , len ( concat_res1 ) ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( ) </s>
<s> import sys <EOL> import argparse <EOL> import logging <EOL> import codecs <EOL> from impacket . examples import logger <EOL> from impacket import version <EOL> from impacket . dcerpc . v5 import transport , scmr <EOL> from impacket . dcerpc . v5 . ndr import NULL <EOL> from impacket . crypto import * <EOL> class SVCCTL : <EOL> KNOWN_PROTOCOLS = { <EOL> '<STR_LIT>' : ( r'<STR_LIT>' , <NUM_LIT> ) , <EOL> '<STR_LIT>' : ( r'<STR_LIT>' , <NUM_LIT> ) , <EOL> } <EOL> def __init__ ( self , username , password , domain , options ) : <EOL> self . __username = username <EOL> self . __password = password <EOL> self . __protocol = SVCCTL . KNOWN_PROTOCOLS . keys ( ) <EOL> self . __options = options <EOL> self . __action = options . action . upper ( ) <EOL> self . __domain = domain <EOL> self . __lmhash = '<STR_LIT>' <EOL> self . __nthash = '<STR_LIT>' <EOL> self . __aesKey = options . aesKey <EOL> self . __doKerberos = options . k <EOL> if options . hashes is not None : <EOL> self . __lmhash , self . __nthash = options . hashes . split ( '<STR_LIT::>' ) <EOL> def run ( self , addr ) : <EOL> for protocol in self . __protocol : <EOL> protodef = SVCCTL . KNOWN_PROTOCOLS [ protocol ] <EOL> port = protodef [ <NUM_LIT:1> ] <EOL> logging . info ( "<STR_LIT>" % protocol ) <EOL> stringbinding = protodef [ <NUM_LIT:0> ] % addr <EOL> rpctransport = transport . DCERPCTransportFactory ( stringbinding ) <EOL> rpctransport . set_dport ( port ) <EOL> rpctransport . set_kerberos ( self . __doKerberos ) <EOL> if hasattr ( rpctransport , '<STR_LIT>' ) : <EOL> rpctransport . set_credentials ( self . __username , self . __password , self . __domain , self . __lmhash , self . __nthash , self . __aesKey ) <EOL> try : <EOL> self . doStuff ( rpctransport ) <EOL> except Exception , e : <EOL> logging . critical ( str ( e ) ) <EOL> break <EOL> else : <EOL> break <EOL> def doStuff ( self , rpctransport ) : <EOL> dce = rpctransport . get_dce_rpc ( ) <EOL> dce . connect ( ) <EOL> dce . bind ( scmr . MSRPC_UUID_SCMR ) <EOL> rpc = dce <EOL> ans = scmr . hROpenSCManagerW ( rpc ) <EOL> scManagerHandle = ans [ '<STR_LIT>' ] <EOL> if self . __action != '<STR_LIT>' and self . __action != '<STR_LIT>' : <EOL> ans = scmr . hROpenServiceW ( rpc , scManagerHandle , self . __options . name + '<STR_LIT:\x00>' ) <EOL> serviceHandle = ans [ '<STR_LIT>' ] <EOL> if self . __action == '<STR_LIT>' : <EOL> logging . info ( "<STR_LIT>" % self . __options . name ) <EOL> scmr . hRStartServiceW ( rpc , serviceHandle ) <EOL> scmr . hRCloseServiceHandle ( rpc , serviceHandle ) <EOL> elif self . __action == '<STR_LIT>' : <EOL> logging . info ( "<STR_LIT>" % self . __options . name ) <EOL> scmr . hRControlService ( rpc , serviceHandle , scmr . SERVICE_CONTROL_STOP ) <EOL> scmr . hRCloseServiceHandle ( rpc , serviceHandle ) <EOL> elif self . __action == '<STR_LIT>' : <EOL> logging . info ( "<STR_LIT>" % self . __options . name ) <EOL> scmr . hRDeleteService ( rpc , serviceHandle ) <EOL> scmr . hRCloseServiceHandle ( rpc , serviceHandle ) <EOL> elif self . __action == '<STR_LIT>' : <EOL> logging . info ( "<STR_LIT>" % self . __options . name ) <EOL> resp = scmr . hRQueryServiceConfigW ( rpc , serviceHandle ) <EOL> print "<STR_LIT>" % resp [ '<STR_LIT>' ] [ '<STR_LIT>' ] , <EOL> if resp [ '<STR_LIT>' ] [ '<STR_LIT>' ] & <NUM_LIT> : <EOL> print "<STR_LIT>" , <EOL> if resp [ '<STR_LIT>' ] [ '<STR_LIT>' ] & <NUM_LIT> : <EOL> print "<STR_LIT>" , <EOL> if resp [ '<STR_LIT>' ] [ '<STR_LIT>' ] & <NUM_LIT> : <EOL> print "<STR_LIT>" , <EOL> if resp [ '<STR_LIT>' ] [ '<STR_LIT>' ] & <NUM_LIT> : <EOL> print "<STR_LIT>" , <EOL> if resp [ '<STR_LIT>' ] [ '<STR_LIT>' ] & <NUM_LIT> : <EOL> print "<STR_LIT>" , <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" % resp [ '<STR_LIT>' ] [ '<STR_LIT>' ] , <EOL> if resp [ '<STR_LIT>' ] [ '<STR_LIT>' ] == <NUM_LIT> : <EOL> print "<STR_LIT>" <EOL> elif resp [ '<STR_LIT>' ] [ '<STR_LIT>' ] == <NUM_LIT> : <EOL> print "<STR_LIT>" <EOL> elif resp [ '<STR_LIT>' ] [ '<STR_LIT>' ] == <NUM_LIT> : <EOL> print "<STR_LIT>" <EOL> elif resp [ '<STR_LIT>' ] [ '<STR_LIT>' ] == <NUM_LIT> : <EOL> print "<STR_LIT>" <EOL> elif resp [ '<STR_LIT>' ] [ '<STR_LIT>' ] == <NUM_LIT> : <EOL> print "<STR_LIT>" <EOL> else : <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" % resp [ '<STR_LIT>' ] [ '<STR_LIT>' ] , <EOL> if resp [ '<STR_LIT>' ] [ '<STR_LIT>' ] == <NUM_LIT> : <EOL> print "<STR_LIT>" <EOL> elif resp [ '<STR_LIT>' ] [ '<STR_LIT>' ] == <NUM_LIT> : <EOL> print "<STR_LIT>" <EOL> elif resp [ '<STR_LIT>' ] [ '<STR_LIT>' ] == <NUM_LIT> : <EOL> print "<STR_LIT>" <EOL> elif resp [ '<STR_LIT>' ] [ '<STR_LIT>' ] == <NUM_LIT> : <EOL> print "<STR_LIT>" <EOL> else : <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" % resp [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ : - <NUM_LIT:1> ] <EOL> print "<STR_LIT>" % resp [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ : - <NUM_LIT:1> ] <EOL> print "<STR_LIT>" % resp [ '<STR_LIT>' ] [ '<STR_LIT>' ] <EOL> print "<STR_LIT>" % resp [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ : - <NUM_LIT:1> ] <EOL> print "<STR_LIT>" % resp [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ : - <NUM_LIT:1> ] <EOL> print "<STR_LIT>" % resp [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ : - <NUM_LIT:1> ] <EOL> elif self . __action == '<STR_LIT>' : <EOL> print "<STR_LIT>" % self . __options . name <EOL> resp = scmr . hRQueryServiceStatus ( rpc , serviceHandle ) <EOL> print "<STR_LIT>" % self . __options . name , <EOL> state = resp [ '<STR_LIT>' ] [ '<STR_LIT>' ] <EOL> if state == scmr . SERVICE_CONTINUE_PENDING : <EOL> print "<STR_LIT>" <EOL> elif state == scmr . SERVICE_PAUSE_PENDING : <EOL> print "<STR_LIT>" <EOL> elif state == scmr . SERVICE_PAUSED : <EOL> print "<STR_LIT>" <EOL> elif state == scmr . SERVICE_RUNNING : <EOL> print "<STR_LIT>" <EOL> elif state == scmr . SERVICE_START_PENDING : <EOL> print "<STR_LIT>" <EOL> elif state == scmr . SERVICE_STOP_PENDING : <EOL> print "<STR_LIT>" <EOL> elif state == scmr . SERVICE_STOPPED : <EOL> print "<STR_LIT>" <EOL> else : <EOL> print "<STR_LIT>" <EOL> elif self . __action == '<STR_LIT>' : <EOL> logging . info ( "<STR_LIT>" ) <EOL> resp = scmr . hREnumServicesStatusW ( rpc , scManagerHandle ) <EOL> for i in range ( len ( resp ) ) : <EOL> print "<STR_LIT>" % ( resp [ i ] [ '<STR_LIT>' ] [ : - <NUM_LIT:1> ] , resp [ i ] [ '<STR_LIT>' ] [ : - <NUM_LIT:1> ] ) , <EOL> state = resp [ i ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] <EOL> if state == scmr . SERVICE_CONTINUE_PENDING : <EOL> print "<STR_LIT>" <EOL> elif state == scmr . SERVICE_PAUSE_PENDING : <EOL> print "<STR_LIT>" <EOL> elif state == scmr . SERVICE_PAUSED : <EOL> print "<STR_LIT>" <EOL> elif state == scmr . SERVICE_RUNNING : <EOL> print "<STR_LIT>" <EOL> elif state == scmr . SERVICE_START_PENDING : <EOL> print "<STR_LIT>" <EOL> elif state == scmr . SERVICE_STOP_PENDING : <EOL> print "<STR_LIT>" <EOL> elif state == scmr . SERVICE_STOPPED : <EOL> print "<STR_LIT>" <EOL> else : <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" % len ( resp ) <EOL> elif self . __action == '<STR_LIT>' : <EOL> logging . info ( "<STR_LIT>" % self . __options . name ) <EOL> scmr . hRCreateServiceW ( rpc , scManagerHandle , self . __options . name + '<STR_LIT:\x00>' , self . __options . display + '<STR_LIT:\x00>' , lpBinaryPathName = self . __options . path + '<STR_LIT:\x00>' ) <EOL> elif self . __action == '<STR_LIT>' : <EOL> logging . info ( "<STR_LIT>" % self . __options . name ) <EOL> if self . __options . start_type is not None : <EOL> start_type = int ( self . __options . start_type ) <EOL> else : <EOL> start_type = scmr . SERVICE_NO_CHANGE <EOL> if self . __options . service_type is not None : <EOL> service_type = int ( self . __options . service_type ) <EOL> else : <EOL> service_type = scmr . SERVICE_NO_CHANGE <EOL> if self . __options . display is not None : <EOL> display = self . __options . display + '<STR_LIT:\x00>' <EOL> else : <EOL> display = NULL <EOL> if self . __options . path is not None : <EOL> path = self . __options . path + '<STR_LIT:\x00>' <EOL> else : <EOL> path = NULL <EOL> if self . __options . start_name is not None : <EOL> start_name = self . __options . start_name + '<STR_LIT:\x00>' <EOL> else : <EOL> start_name = NULL <EOL> if self . __options . password is not None : <EOL> s = rpctransport . get_smb_connection ( ) <EOL> key = s . getSessionKey ( ) <EOL> try : <EOL> password = ( self . __options . password + '<STR_LIT:\x00>' ) . encode ( '<STR_LIT>' ) <EOL> except UnicodeDecodeError : <EOL> import sys <EOL> password = ( self . __options . password + '<STR_LIT:\x00>' ) . decode ( sys . getfilesystemencoding ( ) ) . encode ( '<STR_LIT>' ) <EOL> password = encryptSecret ( key , password ) <EOL> else : <EOL> password = NULL <EOL> scmr . hRChangeServiceConfigW ( rpc , serviceHandle , service_type , start_type , scmr . SERVICE_ERROR_IGNORE , path , NULL , NULL , NULL , <NUM_LIT:0> , start_name , password , <NUM_LIT:0> , display ) <EOL> scmr . hRCloseServiceHandle ( rpc , serviceHandle ) <EOL> else : <EOL> logging . error ( "<STR_LIT>" % self . __action ) <EOL> scmr . hRCloseServiceHandle ( rpc , scManagerHandle ) <EOL> dce . disconnect ( ) <EOL> return <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> logger . init ( ) <EOL> if sys . stdout . encoding is None : <EOL> sys . stdout = codecs . getwriter ( '<STR_LIT:utf8>' ) ( sys . stdout ) <EOL> print version . BANNER <EOL> parser = argparse . ArgumentParser ( add_help = True , description = "<STR_LIT>" ) <EOL> parser . add_argument ( '<STR_LIT:target>' , action = '<STR_LIT:store>' , help = '<STR_LIT>' ) <EOL> parser . add_argument ( '<STR_LIT>' , action = '<STR_LIT:store_true>' , help = '<STR_LIT>' ) <EOL> subparsers = parser . add_subparsers ( help = '<STR_LIT>' , dest = '<STR_LIT:action>' ) <EOL> start_parser = subparsers . add_parser ( '<STR_LIT:start>' , help = '<STR_LIT>' ) <EOL> start_parser . add_argument ( '<STR_LIT>' , action = '<STR_LIT:store>' , required = True , help = '<STR_LIT>' ) <EOL> stop_parser = subparsers . add_parser ( '<STR_LIT>' , help = '<STR_LIT>' ) <EOL> stop_parser . add_argument ( '<STR_LIT>' , action = '<STR_LIT:store>' , required = True , help = '<STR_LIT>' ) <EOL> delete_parser = subparsers . add_parser ( '<STR_LIT>' , help = '<STR_LIT>' ) <EOL> delete_parser . add_argument ( '<STR_LIT>' , action = '<STR_LIT:store>' , required = True , help = '<STR_LIT>' ) <EOL> status_parser = subparsers . add_parser ( '<STR_LIT:status>' , help = '<STR_LIT>' ) <EOL> status_parser . add_argument ( '<STR_LIT>' , action = '<STR_LIT:store>' , required = True , help = '<STR_LIT>' ) <EOL> config_parser = subparsers . add_parser ( '<STR_LIT>' , help = '<STR_LIT>' ) <EOL> config_parser . add_argument ( '<STR_LIT>' , action = '<STR_LIT:store>' , required = True , help = '<STR_LIT>' ) <EOL> list_parser = subparsers . add_parser ( '<STR_LIT:list>' , help = '<STR_LIT>' ) <EOL> create_parser = subparsers . add_parser ( '<STR_LIT>' , help = '<STR_LIT>' ) <EOL> create_parser . add_argument ( '<STR_LIT>' , action = '<STR_LIT:store>' , required = True , help = '<STR_LIT>' ) <EOL> create_parser . add_argument ( '<STR_LIT>' , action = '<STR_LIT:store>' , required = True , help = '<STR_LIT>' ) <EOL> create_parser . add_argument ( '<STR_LIT>' , action = '<STR_LIT:store>' , required = True , help = '<STR_LIT>' ) <EOL> create_parser = subparsers . add_parser ( '<STR_LIT>' , help = '<STR_LIT>' ) <EOL> create_parser . add_argument ( '<STR_LIT>' , action = '<STR_LIT:store>' , required = True , help = '<STR_LIT>' ) <EOL> create_parser . add_argument ( '<STR_LIT>' , action = '<STR_LIT:store>' , required = False , help = '<STR_LIT>' ) <EOL> create_parser . add_argument ( '<STR_LIT>' , action = '<STR_LIT:store>' , required = False , help = '<STR_LIT>' ) <EOL> create_parser . add_argument ( '<STR_LIT>' , action = '<STR_LIT:store>' , required = False , help = '<STR_LIT>' ) <EOL> create_parser . add_argument ( '<STR_LIT>' , action = '<STR_LIT:store>' , required = False , help = '<STR_LIT>' ) <EOL> create_parser . add_argument ( '<STR_LIT>' , action = '<STR_LIT:store>' , required = False , help = '<STR_LIT>' ) <EOL> create_parser . add_argument ( '<STR_LIT>' , action = '<STR_LIT:store>' , required = False , help = '<STR_LIT>' ) <EOL> group = parser . add_argument_group ( '<STR_LIT>' ) <EOL> group . add_argument ( '<STR_LIT>' , action = "<STR_LIT:store>" , metavar = "<STR_LIT>" , help = '<STR_LIT>' ) <EOL> group . add_argument ( '<STR_LIT>' , action = "<STR_LIT:store_true>" , help = '<STR_LIT>' ) <EOL> group . add_argument ( '<STR_LIT>' , action = "<STR_LIT:store_true>" , help = '<STR_LIT>' ) <EOL> group . add_argument ( '<STR_LIT>' , action = "<STR_LIT:store>" , metavar = "<STR_LIT>" , help = '<STR_LIT>' ) <EOL> if len ( sys . argv ) == <NUM_LIT:1> : <EOL> parser . print_help ( ) <EOL> sys . exit ( <NUM_LIT:1> ) <EOL> options = parser . parse_args ( ) <EOL> if options . debug is True : <EOL> logging . getLogger ( ) . setLevel ( logging . DEBUG ) <EOL> else : <EOL> logging . getLogger ( ) . setLevel ( logging . INFO ) <EOL> import re <EOL> domain , username , password , address = re . compile ( '<STR_LIT>' ) . match ( options . target ) . groups ( '<STR_LIT>' ) <EOL> if '<STR_LIT:@>' in address : <EOL> password = password + '<STR_LIT:@>' + address . rpartition ( '<STR_LIT:@>' ) [ <NUM_LIT:0> ] <EOL> address = address . rpartition ( '<STR_LIT:@>' ) [ <NUM_LIT:2> ] <EOL> if domain is None : <EOL> domain = '<STR_LIT>' <EOL> if options . aesKey is not None : <EOL> options . k = True <EOL> if password == '<STR_LIT>' and username != '<STR_LIT>' and options . hashes is None and options . no_pass is False and options . aesKey is None : <EOL> from getpass import getpass <EOL> password = getpass ( "<STR_LIT>" ) <EOL> services = SVCCTL ( username , password , domain , options ) <EOL> try : <EOL> services . run ( address ) <EOL> except Exception , e : <EOL> logging . error ( str ( e ) ) </s>
<s> import unittest <EOL> import ConfigParser <EOL> import string <EOL> import random <EOL> from impacket . dcerpc . v5 import transport <EOL> from impacket . dcerpc . v5 import samr , epm <EOL> from impacket . dcerpc . v5 import dtypes <EOL> from impacket import nt_errors , ntlm <EOL> from impacket . dcerpc . v5 . ndr import NULL <EOL> class SAMRTests ( unittest . TestCase ) : <EOL> def connect ( self ) : <EOL> rpctransport = transport . DCERPCTransportFactory ( self . stringBinding ) <EOL> if len ( self . hashes ) > <NUM_LIT:0> : <EOL> lmhash , nthash = self . hashes . split ( '<STR_LIT::>' ) <EOL> else : <EOL> lmhash = '<STR_LIT>' <EOL> nthash = '<STR_LIT>' <EOL> if hasattr ( rpctransport , '<STR_LIT>' ) : <EOL> rpctransport . set_credentials ( self . username , self . password , self . domain , lmhash , nthash ) <EOL> dce = rpctransport . get_dce_rpc ( ) <EOL> dce . connect ( ) <EOL> dce . set_auth_level ( ntlm . NTLM_AUTH_PKT_INTEGRITY ) <EOL> dce . bind ( samr . MSRPC_UUID_SAMR , transfer_syntax = self . ts ) <EOL> request = samr . SamrConnect ( ) <EOL> request [ '<STR_LIT>' ] = u'<STR_LIT>' <EOL> request [ '<STR_LIT>' ] = samr . DELETE | samr . READ_CONTROL | samr . WRITE_DAC | samr . WRITE_OWNER | samr . ACCESS_SYSTEM_SECURITY | samr . GENERIC_READ | samr . GENERIC_WRITE | samr . GENERIC_EXECUTE | samr . SAM_SERVER_CONNECT | samr . SAM_SERVER_SHUTDOWN | samr . SAM_SERVER_INITIALIZE | samr . SAM_SERVER_CREATE_DOMAIN | samr . SAM_SERVER_ENUMERATE_DOMAINS | samr . SAM_SERVER_LOOKUP_DOMAIN | samr . SAM_SERVER_READ | samr . SAM_SERVER_WRITE | samr . SAM_SERVER_EXECUTE <EOL> resp = dce . request ( request ) <EOL> request = samr . SamrEnumerateDomainsInSamServer ( ) <EOL> request [ '<STR_LIT>' ] = resp [ '<STR_LIT>' ] <EOL> request [ '<STR_LIT>' ] = <NUM_LIT:0> <EOL> request [ '<STR_LIT>' ] = <NUM_LIT> <EOL> resp2 = dce . request ( request ) <EOL> request = samr . SamrLookupDomainInSamServer ( ) <EOL> request [ '<STR_LIT>' ] = resp [ '<STR_LIT>' ] <EOL> request [ '<STR_LIT:Name>' ] = resp2 [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ <NUM_LIT:0> ] [ '<STR_LIT:Name>' ] <EOL> resp3 = dce . request ( request ) <EOL> request = samr . SamrOpenDomain ( ) <EOL> request [ '<STR_LIT>' ] = resp [ '<STR_LIT>' ] <EOL> request [ '<STR_LIT>' ] = samr . DOMAIN_READ_PASSWORD_PARAMETERS | samr . DOMAIN_READ_OTHER_PARAMETERS | samr . DOMAIN_CREATE_USER | samr . DOMAIN_CREATE_ALIAS | samr . DOMAIN_LOOKUP | samr . DOMAIN_LIST_ACCOUNTS | samr . DOMAIN_ADMINISTER_SERVER | samr . DELETE | samr . READ_CONTROL | samr . ACCESS_SYSTEM_SECURITY | samr . DOMAIN_WRITE_OTHER_PARAMETERS | samr . DOMAIN_WRITE_PASSWORD_PARAMS <EOL> request [ '<STR_LIT>' ] = resp3 [ '<STR_LIT>' ] <EOL> resp4 = dce . request ( request ) <EOL> return dce , rpctransport , resp4 [ '<STR_LIT>' ] <EOL> def test_SamrCloseHandle ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> request = samr . SamrCloseHandle ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> def test_hSamrCloseHandle ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> resp = samr . hSamrCloseHandle ( dce , domainHandle ) <EOL> resp . dump ( ) <EOL> def test_SamrConnect5 ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> request = samr . SamrConnect5 ( ) <EOL> request [ '<STR_LIT>' ] = u'<STR_LIT>' <EOL> request [ '<STR_LIT>' ] = dtypes . MAXIMUM_ALLOWED <EOL> request [ '<STR_LIT>' ] = <NUM_LIT:1> <EOL> request [ '<STR_LIT>' ] [ '<STR_LIT>' ] = <NUM_LIT:1> <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> def test_hSamrConnect5 ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> resp = samr . hSamrConnect5 ( dce ) <EOL> resp . dump ( ) <EOL> def test_SamrConnect4 ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> request = samr . SamrConnect4 ( ) <EOL> request [ '<STR_LIT>' ] = dtypes . MAXIMUM_ALLOWED <EOL> request [ '<STR_LIT>' ] = u'<STR_LIT>' <EOL> request [ '<STR_LIT>' ] = <NUM_LIT:2> <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> def test_hSamrConnect4 ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> resp = samr . hSamrConnect4 ( dce ) <EOL> resp . dump ( ) <EOL> def test_SamrConnect2 ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> request = samr . SamrConnect2 ( ) <EOL> request [ '<STR_LIT>' ] = dtypes . MAXIMUM_ALLOWED <EOL> request [ '<STR_LIT>' ] = u'<STR_LIT>' <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> def test_hSamrConnect2 ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> resp = samr . hSamrConnect2 ( dce ) <EOL> resp . dump ( ) <EOL> def test_SamrConnect ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> request = samr . SamrConnect ( ) <EOL> request [ '<STR_LIT>' ] = dtypes . MAXIMUM_ALLOWED <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> def test_hSamrConnect ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> resp = samr . hSamrConnect ( dce ) <EOL> resp . dump ( ) <EOL> def test_SamrOpenDomain ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> request = samr . SamrConnect ( ) <EOL> request [ '<STR_LIT>' ] = dtypes . MAXIMUM_ALLOWED <EOL> request [ '<STR_LIT>' ] = u'<STR_LIT>' <EOL> resp = dce . request ( request ) <EOL> request = samr . SamrOpenDomain ( ) <EOL> SID = '<STR_LIT>' <EOL> request [ '<STR_LIT>' ] = resp [ '<STR_LIT>' ] <EOL> request [ '<STR_LIT>' ] = dtypes . MAXIMUM_ALLOWED <EOL> request [ '<STR_LIT>' ] . fromCanonical ( SID ) <EOL> try : <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> except Exception , e : <EOL> if str ( e ) . find ( '<STR_LIT>' ) < <NUM_LIT:0> : <EOL> raise <EOL> def test_hSamrOpenDomain ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> resp = samr . hSamrConnect ( dce ) <EOL> SID = '<STR_LIT>' <EOL> sid = dtypes . RPC_SID ( ) <EOL> sid . fromCanonical ( SID ) <EOL> try : <EOL> resp = samr . hSamrOpenDomain ( dce , serverHandle = resp [ '<STR_LIT>' ] , domainId = sid ) <EOL> resp . dump ( ) <EOL> except Exception , e : <EOL> if str ( e ) . find ( '<STR_LIT>' ) < <NUM_LIT:0> : <EOL> raise <EOL> def test_SamrOpenGroup ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> request = samr . SamrConnect ( ) <EOL> request [ '<STR_LIT>' ] = dtypes . MAXIMUM_ALLOWED <EOL> request [ '<STR_LIT>' ] = u'<STR_LIT>' <EOL> resp = dce . request ( request ) <EOL> request = samr . SamrOpenGroup ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = dtypes . MAXIMUM_ALLOWED <EOL> request [ '<STR_LIT>' ] = samr . DOMAIN_GROUP_RID_USERS <EOL> try : <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> except Exception , e : <EOL> if str ( e ) . find ( '<STR_LIT>' ) < <NUM_LIT:0> : <EOL> raise <EOL> def test_hSamrOpenGroup ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> try : <EOL> resp = samr . hSamrOpenGroup ( dce , domainHandle , groupId = samr . DOMAIN_GROUP_RID_USERS ) <EOL> resp . dump ( ) <EOL> except Exception , e : <EOL> if str ( e ) . find ( '<STR_LIT>' ) < <NUM_LIT:0> : <EOL> raise <EOL> def test_SamrOpenAlias ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> request = samr . SamrOpenAlias ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = dtypes . MAXIMUM_ALLOWED <EOL> request [ '<STR_LIT>' ] = <NUM_LIT> <EOL> try : <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> except Exception , e : <EOL> if str ( e ) . find ( '<STR_LIT>' ) < <NUM_LIT:0> : <EOL> raise <EOL> def test_hSamrOpenAlias ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> try : <EOL> resp = samr . hSamrOpenAlias ( dce , domainHandle , aliasId = <NUM_LIT> ) <EOL> resp . dump ( ) <EOL> except Exception , e : <EOL> if str ( e ) . find ( '<STR_LIT>' ) < <NUM_LIT:0> : <EOL> raise <EOL> def test_SamrOpenUser ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> request = samr . SamrOpenUser ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = samr . USER_READ_GENERAL | samr . USER_READ_PREFERENCES | samr . USER_READ_ACCOUNT <EOL> request [ '<STR_LIT>' ] = samr . DOMAIN_USER_RID_ADMIN <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> def test_hSamrOpenUser ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> resp = samr . hSamrOpenUser ( dce , domainHandle , samr . USER_READ_GENERAL | samr . USER_READ_PREFERENCES | samr . USER_READ_ACCOUNT , samr . DOMAIN_USER_RID_ADMIN ) <EOL> resp . dump ( ) <EOL> def test_SamrEnumerateDomainsInSamServer ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> request = samr . SamrConnect ( ) <EOL> request [ '<STR_LIT>' ] = u'<STR_LIT>' <EOL> request [ '<STR_LIT>' ] = samr . SAM_SERVER_ENUMERATE_DOMAINS | samr . SAM_SERVER_LOOKUP_DOMAIN <EOL> resp = dce . request ( request ) <EOL> request = samr . SamrEnumerateDomainsInSamServer ( ) <EOL> request [ '<STR_LIT>' ] = resp [ '<STR_LIT>' ] <EOL> request [ '<STR_LIT>' ] = <NUM_LIT:0> <EOL> request [ '<STR_LIT>' ] = <NUM_LIT> <EOL> resp2 = dce . request ( request ) <EOL> resp2 . dump ( ) <EOL> request = samr . SamrLookupDomainInSamServer ( ) <EOL> request [ '<STR_LIT>' ] = resp [ '<STR_LIT>' ] <EOL> request [ '<STR_LIT:Name>' ] = resp2 [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ <NUM_LIT:0> ] [ '<STR_LIT:Name>' ] <EOL> resp3 = dce . request ( request ) <EOL> resp3 . dump ( ) <EOL> request = samr . SamrOpenDomain ( ) <EOL> request [ '<STR_LIT>' ] = resp [ '<STR_LIT>' ] <EOL> request [ '<STR_LIT>' ] = dtypes . MAXIMUM_ALLOWED <EOL> request [ '<STR_LIT>' ] = resp3 [ '<STR_LIT>' ] <EOL> resp4 = dce . request ( request ) <EOL> resp4 . dump ( ) <EOL> def test_hSamrEnumerateDomainsInSamServer ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> resp = samr . hSamrConnect ( dce , desiredAccess = samr . SAM_SERVER_ENUMERATE_DOMAINS | samr . SAM_SERVER_LOOKUP_DOMAIN ) <EOL> resp2 = samr . hSamrEnumerateDomainsInSamServer ( dce , resp [ '<STR_LIT>' ] ) <EOL> resp2 . dump ( ) <EOL> resp3 = samr . hSamrLookupDomainInSamServer ( dce , resp [ '<STR_LIT>' ] , resp2 [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ <NUM_LIT:0> ] [ '<STR_LIT:Name>' ] ) <EOL> resp3 . dump ( ) <EOL> request = samr . SamrOpenDomain ( ) <EOL> request [ '<STR_LIT>' ] = resp [ '<STR_LIT>' ] <EOL> request [ '<STR_LIT>' ] = dtypes . MAXIMUM_ALLOWED <EOL> request [ '<STR_LIT>' ] = resp3 [ '<STR_LIT>' ] <EOL> resp4 = dce . request ( request ) <EOL> resp4 . dump ( ) <EOL> def test_SamrLookupNamesInDomain ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> request = samr . SamrLookupNamesInDomain ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = <NUM_LIT:1> <EOL> entry = dtypes . RPC_UNICODE_STRING ( ) <EOL> entry [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> request [ '<STR_LIT>' ] . append ( entry ) <EOL> request . fields [ '<STR_LIT>' ] . fields [ '<STR_LIT>' ] = <NUM_LIT:1000> <EOL> resp5 = dce . request ( request ) <EOL> resp5 . dump ( ) <EOL> def test_hSamrLookupNamesInDomain ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> resp = samr . hSamrLookupNamesInDomain ( dce , domainHandle , ( '<STR_LIT>' , '<STR_LIT>' ) ) <EOL> resp . dump ( ) <EOL> def test_SamrLookupIdsInDomain ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> request = samr . SamrLookupIdsInDomain ( ) <EOL> request . dump ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = <NUM_LIT:2> <EOL> entry = dtypes . ULONG ( ) <EOL> entry [ '<STR_LIT>' ] = <NUM_LIT> <EOL> request [ '<STR_LIT>' ] . append ( entry ) <EOL> entry = dtypes . ULONG ( ) <EOL> entry [ '<STR_LIT>' ] = <NUM_LIT> <EOL> request [ '<STR_LIT>' ] . append ( entry ) <EOL> request . fields [ '<STR_LIT>' ] . fields [ '<STR_LIT>' ] = <NUM_LIT:1000> <EOL> resp5 = dce . request ( request ) <EOL> resp5 . dump ( ) <EOL> def test_hSamrLookupIdsInDomain ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> resp = samr . hSamrLookupIdsInDomain ( dce , domainHandle , ( <NUM_LIT> , <NUM_LIT> ) ) <EOL> resp . dump ( ) <EOL> def test_SamrEnumerateGroupsInDomain ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> request = samr . SamrEnumerateGroupsInDomain ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = <NUM_LIT:0> <EOL> request [ '<STR_LIT>' ] = <NUM_LIT> <EOL> status = nt_errors . STATUS_MORE_ENTRIES <EOL> while status == nt_errors . STATUS_MORE_ENTRIES : <EOL> try : <EOL> resp4 = dce . request ( request ) <EOL> except Exception , e : <EOL> if str ( e ) . find ( '<STR_LIT>' ) < <NUM_LIT:0> : <EOL> raise <EOL> resp4 = e . get_packet ( ) <EOL> resp4 [ '<STR_LIT>' ] . dump ( ) <EOL> request [ '<STR_LIT>' ] = resp4 [ '<STR_LIT>' ] <EOL> status = resp4 [ '<STR_LIT>' ] <EOL> def test_hSamrEnumerateGroupsInDomain ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> resp = samr . hSamrEnumerateGroupsInDomain ( dce , domainHandle ) <EOL> resp . dump ( ) <EOL> def test_SamrEnumerateAliasesInDomain ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> request = samr . SamrEnumerateAliasesInDomain ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = <NUM_LIT:0> <EOL> request [ '<STR_LIT>' ] = <NUM_LIT> <EOL> status = nt_errors . STATUS_MORE_ENTRIES <EOL> while status == nt_errors . STATUS_MORE_ENTRIES : <EOL> try : <EOL> resp4 = dce . request ( request ) <EOL> except Exception , e : <EOL> if str ( e ) . find ( '<STR_LIT>' ) < <NUM_LIT:0> : <EOL> raise <EOL> resp4 = e . get_packet ( ) <EOL> resp4 [ '<STR_LIT>' ] . dump ( ) <EOL> request [ '<STR_LIT>' ] = resp4 [ '<STR_LIT>' ] <EOL> status = resp4 [ '<STR_LIT>' ] <EOL> def test_hSamrEnumerateAliasesInDomain ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> resp = samr . hSamrEnumerateAliasesInDomain ( dce , domainHandle ) <EOL> resp . dump ( ) <EOL> def test_SamrEnumerateUsersInDomain ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> request = samr . SamrEnumerateUsersInDomain ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = samr . USER_NORMAL_ACCOUNT <EOL> request [ '<STR_LIT>' ] = <NUM_LIT:0> <EOL> request [ '<STR_LIT>' ] = <NUM_LIT> <EOL> status = nt_errors . STATUS_MORE_ENTRIES <EOL> while status == nt_errors . STATUS_MORE_ENTRIES : <EOL> try : <EOL> resp4 = dce . request ( request ) <EOL> except Exception , e : <EOL> if str ( e ) . find ( '<STR_LIT>' ) < <NUM_LIT:0> : <EOL> raise <EOL> resp4 = e . get_packet ( ) <EOL> resp4 [ '<STR_LIT>' ] . dump ( ) <EOL> request [ '<STR_LIT>' ] = resp4 [ '<STR_LIT>' ] <EOL> status = resp4 [ '<STR_LIT>' ] <EOL> def test_hSamrEnumerateUsersInDomain ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> resp = samr . hSamrEnumerateUsersInDomain ( dce , domainHandle ) <EOL> resp . dump ( ) <EOL> def test_SamrGetGroupsForUser ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> request = samr . SamrOpenUser ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = samr . USER_READ_GENERAL | samr . USER_READ_PREFERENCES | samr . USER_READ_ACCOUNT | samr . USER_LIST_GROUPS <EOL> request [ '<STR_LIT>' ] = samr . DOMAIN_USER_RID_ADMIN <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> request = samr . SamrGetGroupsForUser ( ) <EOL> request [ '<STR_LIT>' ] = resp [ '<STR_LIT>' ] <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> def test_hSamrGetGroupsForUser ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> request = samr . SamrOpenUser ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = samr . USER_READ_GENERAL | samr . USER_READ_PREFERENCES | samr . USER_READ_ACCOUNT | samr . USER_LIST_GROUPS <EOL> request [ '<STR_LIT>' ] = samr . DOMAIN_USER_RID_ADMIN <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> resp = samr . hSamrGetGroupsForUser ( dce , resp [ '<STR_LIT>' ] ) <EOL> resp . dump ( ) <EOL> def test_SamrQueryDisplayInformation3 ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> request = samr . SamrQueryDisplayInformation3 ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = samr . DOMAIN_DISPLAY_INFORMATION . DomainDisplayUser <EOL> request [ '<STR_LIT>' ] = <NUM_LIT:0> <EOL> request [ '<STR_LIT>' ] = <NUM_LIT:100> <EOL> request [ '<STR_LIT>' ] = <NUM_LIT> <EOL> try : <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> except Exception , e : <EOL> if str ( e ) . find ( '<STR_LIT>' ) >= <NUM_LIT:0> : <EOL> e . get_packet ( ) . dump ( ) <EOL> else : <EOL> raise <EOL> request = samr . SamrQueryDisplayInformation3 ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = samr . DOMAIN_DISPLAY_INFORMATION . DomainDisplayMachine <EOL> request [ '<STR_LIT>' ] = <NUM_LIT:0> <EOL> request [ '<STR_LIT>' ] = <NUM_LIT:100> <EOL> request [ '<STR_LIT>' ] = <NUM_LIT> <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> request = samr . SamrQueryDisplayInformation3 ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = samr . DOMAIN_DISPLAY_INFORMATION . DomainDisplayGroup <EOL> request [ '<STR_LIT>' ] = <NUM_LIT:0> <EOL> request [ '<STR_LIT>' ] = <NUM_LIT:100> <EOL> request [ '<STR_LIT>' ] = <NUM_LIT> <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> request = samr . SamrQueryDisplayInformation3 ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = samr . DOMAIN_DISPLAY_INFORMATION . DomainDisplayOemGroup <EOL> request [ '<STR_LIT>' ] = <NUM_LIT:0> <EOL> request [ '<STR_LIT>' ] = <NUM_LIT:100> <EOL> request [ '<STR_LIT>' ] = <NUM_LIT> <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> def test_hSamrQueryDisplayInformation3 ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> try : <EOL> resp = samr . hSamrQueryDisplayInformation3 ( dce , domainHandle , samr . DOMAIN_DISPLAY_INFORMATION . DomainDisplayUser ) <EOL> resp . dump ( ) <EOL> except Exception , e : <EOL> if str ( e ) . find ( '<STR_LIT>' ) >= <NUM_LIT:0> : <EOL> e . get_packet ( ) . dump ( ) <EOL> else : <EOL> raise <EOL> resp = samr . hSamrQueryDisplayInformation3 ( dce , domainHandle , samr . DOMAIN_DISPLAY_INFORMATION . DomainDisplayMachine ) <EOL> resp . dump ( ) <EOL> resp = samr . hSamrQueryDisplayInformation3 ( dce , domainHandle , samr . DOMAIN_DISPLAY_INFORMATION . DomainDisplayGroup ) <EOL> resp . dump ( ) <EOL> resp = samr . hSamrQueryDisplayInformation3 ( dce , domainHandle , samr . DOMAIN_DISPLAY_INFORMATION . DomainDisplayOemGroup ) <EOL> resp . dump ( ) <EOL> def test_SamrQueryDisplayInformation2 ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> try : <EOL> resp = samr . hSamrQueryDisplayInformation2 ( dce , domainHandle , samr . DOMAIN_DISPLAY_INFORMATION . DomainDisplayUser ) <EOL> resp . dump ( ) <EOL> except Exception , e : <EOL> if str ( e ) . find ( '<STR_LIT>' ) >= <NUM_LIT:0> : <EOL> e . get_packet ( ) . dump ( ) <EOL> else : <EOL> raise <EOL> resp = samr . hSamrQueryDisplayInformation2 ( dce , domainHandle , samr . DOMAIN_DISPLAY_INFORMATION . DomainDisplayMachine ) <EOL> resp . dump ( ) <EOL> resp = samr . hSamrQueryDisplayInformation2 ( dce , domainHandle , samr . DOMAIN_DISPLAY_INFORMATION . DomainDisplayGroup ) <EOL> resp . dump ( ) <EOL> resp = samr . hSamrQueryDisplayInformation2 ( dce , domainHandle , samr . DOMAIN_DISPLAY_INFORMATION . DomainDisplayOemGroup ) <EOL> resp . dump ( ) <EOL> def test_SamrQueryDisplayInformation ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> request = samr . SamrQueryDisplayInformation ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = samr . DOMAIN_DISPLAY_INFORMATION . DomainDisplayUser <EOL> request [ '<STR_LIT>' ] = <NUM_LIT:0> <EOL> request [ '<STR_LIT>' ] = <NUM_LIT:100> <EOL> request [ '<STR_LIT>' ] = <NUM_LIT> <EOL> try : <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> except Exception , e : <EOL> if str ( e ) . find ( '<STR_LIT>' ) >= <NUM_LIT:0> : <EOL> e . get_packet ( ) . dump ( ) <EOL> else : <EOL> raise <EOL> request = samr . SamrQueryDisplayInformation ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = samr . DOMAIN_DISPLAY_INFORMATION . DomainDisplayMachine <EOL> request [ '<STR_LIT>' ] = <NUM_LIT:0> <EOL> request [ '<STR_LIT>' ] = <NUM_LIT:100> <EOL> request [ '<STR_LIT>' ] = <NUM_LIT> <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> request = samr . SamrQueryDisplayInformation ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = samr . DOMAIN_DISPLAY_INFORMATION . DomainDisplayGroup <EOL> request [ '<STR_LIT>' ] = <NUM_LIT:0> <EOL> request [ '<STR_LIT>' ] = <NUM_LIT:100> <EOL> request [ '<STR_LIT>' ] = <NUM_LIT> <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> request = samr . SamrQueryDisplayInformation ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = samr . DOMAIN_DISPLAY_INFORMATION . DomainDisplayOemGroup <EOL> request [ '<STR_LIT>' ] = <NUM_LIT:0> <EOL> request [ '<STR_LIT>' ] = <NUM_LIT:100> <EOL> request [ '<STR_LIT>' ] = <NUM_LIT> <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> def test_hSamrQueryDisplayInformation ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> try : <EOL> resp = samr . hSamrQueryDisplayInformation ( dce , domainHandle , samr . DOMAIN_DISPLAY_INFORMATION . DomainDisplayUser ) <EOL> resp . dump ( ) <EOL> except Exception , e : <EOL> if str ( e ) . find ( '<STR_LIT>' ) >= <NUM_LIT:0> : <EOL> e . get_packet ( ) . dump ( ) <EOL> else : <EOL> raise <EOL> resp = samr . hSamrQueryDisplayInformation ( dce , domainHandle , samr . DOMAIN_DISPLAY_INFORMATION . DomainDisplayMachine ) <EOL> resp . dump ( ) <EOL> resp = samr . hSamrQueryDisplayInformation ( dce , domainHandle , samr . DOMAIN_DISPLAY_INFORMATION . DomainDisplayGroup ) <EOL> resp . dump ( ) <EOL> resp = samr . hSamrQueryDisplayInformation ( dce , domainHandle , samr . DOMAIN_DISPLAY_INFORMATION . DomainDisplayOemGroup ) <EOL> resp . dump ( ) <EOL> def test_SamrGetDisplayEnumerationIndex2 ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> request = samr . SamrGetDisplayEnumerationIndex2 ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = samr . DOMAIN_DISPLAY_INFORMATION . DomainDisplayUser <EOL> request [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> request = samr . SamrGetDisplayEnumerationIndex2 ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = samr . DOMAIN_DISPLAY_INFORMATION . DomainDisplayGroup <EOL> request [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> def test_hSamrGetDisplayEnumerationIndex2 ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> resp = samr . hSamrGetDisplayEnumerationIndex2 ( dce , domainHandle , samr . DOMAIN_DISPLAY_INFORMATION . DomainDisplayUser , '<STR_LIT>' ) <EOL> resp . dump ( ) <EOL> resp = samr . hSamrGetDisplayEnumerationIndex2 ( dce , domainHandle , samr . DOMAIN_DISPLAY_INFORMATION . DomainDisplayGroup , '<STR_LIT>' ) <EOL> resp . dump ( ) <EOL> def test_SamrGetDisplayEnumerationIndex ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> resp = samr . hSamrGetDisplayEnumerationIndex ( dce , domainHandle , samr . DOMAIN_DISPLAY_INFORMATION . DomainDisplayUser , '<STR_LIT>' ) <EOL> resp . dump ( ) <EOL> def test_hSamrGetDisplayEnumerationIndex ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> request = samr . SamrGetDisplayEnumerationIndex ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = samr . DOMAIN_DISPLAY_INFORMATION . DomainDisplayUser <EOL> request [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> def test_SamrCreateGroupInDomain_SamrDeleteGroup ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> request = samr . SamrCreateGroupInDomain ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT:Name>' ] = '<STR_LIT>' <EOL> request [ '<STR_LIT>' ] = samr . GROUP_ALL_ACCESS | samr . DELETE <EOL> try : <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> except Exception , e : <EOL> if str ( e ) . find ( "<STR_LIT>" ) < <NUM_LIT:0> : <EOL> raise <EOL> request = samr . SamrDeleteGroup ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> try : <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> except Exception , e : <EOL> if str ( e ) . find ( "<STR_LIT>" ) < <NUM_LIT:0> : <EOL> raise <EOL> def test_hSamrCreateGroupInDomain_hSamrDeleteGroup ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> try : <EOL> resp = samr . hSamrCreateGroupInDomain ( dce , domainHandle , '<STR_LIT>' , samr . GROUP_ALL_ACCESS | samr . DELETE ) <EOL> resp . dump ( ) <EOL> except Exception , e : <EOL> if str ( e ) . find ( "<STR_LIT>" ) < <NUM_LIT:0> : <EOL> raise <EOL> try : <EOL> resp = samr . hSamrDeleteGroup ( dce , domainHandle ) <EOL> resp . dump ( ) <EOL> except Exception , e : <EOL> if str ( e ) . find ( "<STR_LIT>" ) < <NUM_LIT:0> : <EOL> raise <EOL> def test_SamrCreateAliasInDomain_SamrDeleteAlias ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> request = samr . SamrCreateAliasInDomain ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> request [ '<STR_LIT>' ] = samr . GROUP_ALL_ACCESS | samr . DELETE <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> request = samr . SamrDeleteAlias ( ) <EOL> request [ '<STR_LIT>' ] = resp [ '<STR_LIT>' ] <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> def test_hSamrCreateAliasInDomain_hSamrDeleteAlias ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> resp = samr . hSamrCreateAliasInDomain ( dce , domainHandle , '<STR_LIT>' , samr . GROUP_ALL_ACCESS | samr . DELETE ) <EOL> resp . dump ( ) <EOL> resp = samr . hSamrDeleteAlias ( dce , resp [ '<STR_LIT>' ] ) <EOL> resp . dump ( ) <EOL> def test_SamrCreateUser2InDomain_SamrDeleteUser ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> request = samr . SamrCreateUser2InDomain ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT:Name>' ] = '<STR_LIT>' <EOL> request [ '<STR_LIT>' ] = samr . USER_NORMAL_ACCOUNT <EOL> request [ '<STR_LIT>' ] = samr . USER_READ_GENERAL | samr . DELETE <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> request = samr . SamrDeleteUser ( ) <EOL> request [ '<STR_LIT>' ] = resp [ '<STR_LIT>' ] <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> def test_hSamrCreateUser2InDomain_hSamrDeleteUser ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> resp = samr . hSamrCreateUser2InDomain ( dce , domainHandle , '<STR_LIT>' , samr . USER_NORMAL_ACCOUNT , samr . USER_READ_GENERAL | samr . DELETE ) <EOL> resp . dump ( ) <EOL> resp = samr . hSamrDeleteUser ( dce , resp [ '<STR_LIT>' ] ) <EOL> resp . dump ( ) <EOL> def test_SamrQueryInformationDomain2 ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> request = samr . SamrQueryInformationDomain2 ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = samr . DOMAIN_INFORMATION_CLASS . DomainPasswordInformation <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> request = samr . SamrQueryInformationDomain2 ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = samr . DOMAIN_INFORMATION_CLASS . DomainGeneralInformation <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> request = samr . SamrQueryInformationDomain2 ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = samr . DOMAIN_INFORMATION_CLASS . DomainLogoffInformation <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> request = samr . SamrQueryInformationDomain2 ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = samr . DOMAIN_INFORMATION_CLASS . DomainOemInformation <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> request = samr . SamrQueryInformationDomain2 ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = samr . DOMAIN_INFORMATION_CLASS . DomainNameInformation <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> request = samr . SamrQueryInformationDomain2 ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = samr . DOMAIN_INFORMATION_CLASS . DomainServerRoleInformation <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> request = samr . SamrQueryInformationDomain2 ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = samr . DOMAIN_INFORMATION_CLASS . DomainReplicationInformation <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> request = samr . SamrQueryInformationDomain2 ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = samr . DOMAIN_INFORMATION_CLASS . DomainModifiedInformation <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> request = samr . SamrQueryInformationDomain2 ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = samr . DOMAIN_INFORMATION_CLASS . DomainStateInformation <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> request = samr . SamrQueryInformationDomain2 ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = samr . DOMAIN_INFORMATION_CLASS . DomainGeneralInformation2 <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> request = samr . SamrQueryInformationDomain2 ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = samr . DOMAIN_INFORMATION_CLASS . DomainLockoutInformation <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> request = samr . SamrQueryInformationDomain2 ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = samr . DOMAIN_INFORMATION_CLASS . DomainModifiedInformation2 <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> def test_SamrQueryInformationDomain2 ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> request = samr . SamrQueryInformationDomain2 ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = samr . DOMAIN_INFORMATION_CLASS . DomainPasswordInformation <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> request = samr . SamrQueryInformationDomain2 ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = samr . DOMAIN_INFORMATION_CLASS . DomainGeneralInformation <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> request = samr . SamrQueryInformationDomain2 ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = samr . DOMAIN_INFORMATION_CLASS . DomainLogoffInformation <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> request = samr . SamrQueryInformationDomain2 ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = samr . DOMAIN_INFORMATION_CLASS . DomainOemInformation <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> request = samr . SamrQueryInformationDomain2 ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = samr . DOMAIN_INFORMATION_CLASS . DomainNameInformation <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> request = samr . SamrQueryInformationDomain2 ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = samr . DOMAIN_INFORMATION_CLASS . DomainServerRoleInformation <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> request = samr . SamrQueryInformationDomain2 ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = samr . DOMAIN_INFORMATION_CLASS . DomainReplicationInformation <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> request = samr . SamrQueryInformationDomain2 ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = samr . DOMAIN_INFORMATION_CLASS . DomainModifiedInformation <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> request = samr . SamrQueryInformationDomain2 ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = samr . DOMAIN_INFORMATION_CLASS . DomainStateInformation <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> request = samr . SamrQueryInformationDomain2 ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = samr . DOMAIN_INFORMATION_CLASS . DomainGeneralInformation2 <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> request = samr . SamrQueryInformationDomain2 ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = samr . DOMAIN_INFORMATION_CLASS . DomainLockoutInformation <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> request = samr . SamrQueryInformationDomain2 ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = samr . DOMAIN_INFORMATION_CLASS . DomainModifiedInformation2 <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> def test_hSamrQueryInformationDomain2 ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> resp = samr . hSamrQueryInformationDomain2 ( dce , domainHandle , samr . DOMAIN_INFORMATION_CLASS . DomainPasswordInformation ) <EOL> resp . dump ( ) <EOL> resp = samr . hSamrQueryInformationDomain2 ( dce , domainHandle , samr . DOMAIN_INFORMATION_CLASS . DomainGeneralInformation ) <EOL> resp . dump ( ) <EOL> resp = samr . hSamrQueryInformationDomain2 ( dce , domainHandle , samr . DOMAIN_INFORMATION_CLASS . DomainLogoffInformation ) <EOL> resp . dump ( ) <EOL> resp = samr . hSamrQueryInformationDomain2 ( dce , domainHandle , samr . DOMAIN_INFORMATION_CLASS . DomainOemInformation ) <EOL> resp . dump ( ) <EOL> resp = samr . hSamrQueryInformationDomain2 ( dce , domainHandle , samr . DOMAIN_INFORMATION_CLASS . DomainNameInformation ) <EOL> resp . dump ( ) <EOL> resp = samr . hSamrQueryInformationDomain2 ( dce , domainHandle , samr . DOMAIN_INFORMATION_CLASS . DomainServerRoleInformation ) <EOL> resp . dump ( ) <EOL> resp = samr . hSamrQueryInformationDomain2 ( dce , domainHandle , samr . DOMAIN_INFORMATION_CLASS . DomainReplicationInformation ) <EOL> resp . dump ( ) <EOL> resp = samr . hSamrQueryInformationDomain2 ( dce , domainHandle , samr . DOMAIN_INFORMATION_CLASS . DomainModifiedInformation ) <EOL> resp . dump ( ) <EOL> resp = samr . hSamrQueryInformationDomain2 ( dce , domainHandle , samr . DOMAIN_INFORMATION_CLASS . DomainStateInformation ) <EOL> resp . dump ( ) <EOL> resp = samr . hSamrQueryInformationDomain2 ( dce , domainHandle , samr . DOMAIN_INFORMATION_CLASS . DomainGeneralInformation2 ) <EOL> resp . dump ( ) <EOL> resp = samr . hSamrQueryInformationDomain2 ( dce , domainHandle , samr . DOMAIN_INFORMATION_CLASS . DomainLockoutInformation ) <EOL> resp . dump ( ) <EOL> resp = samr . hSamrQueryInformationDomain2 ( dce , domainHandle , samr . DOMAIN_INFORMATION_CLASS . DomainModifiedInformation2 ) <EOL> resp . dump ( ) <EOL> def test_hSamrQueryInformationDomain_hSamrSetInformationDomain ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> resp = samr . hSamrQueryInformationDomain ( dce , domainHandle , samr . DOMAIN_INFORMATION_CLASS . DomainPasswordInformation ) <EOL> resp . dump ( ) <EOL> resp [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] = <NUM_LIT:11> <EOL> resp = samr . hSamrSetInformationDomain ( dce , domainHandle , resp [ '<STR_LIT>' ] ) <EOL> resp . dump ( ) <EOL> resp2 = samr . hSamrQueryInformationDomain ( dce , domainHandle , samr . DOMAIN_INFORMATION_CLASS . DomainPasswordInformation ) <EOL> resp2 . dump ( ) <EOL> self . assertTrue ( <NUM_LIT:11> == resp2 [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] ) <EOL> resp2 [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] = <NUM_LIT:0> <EOL> resp = samr . hSamrSetInformationDomain ( dce , domainHandle , resp2 [ '<STR_LIT>' ] ) <EOL> resp . dump ( ) <EOL> resp = samr . hSamrQueryInformationDomain ( dce , domainHandle , samr . DOMAIN_INFORMATION_CLASS . DomainGeneralInformation ) <EOL> resp . dump ( ) <EOL> resp [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> try : <EOL> resp = samr . hSamrSetInformationDomain ( dce , domainHandle , resp [ '<STR_LIT>' ] ) <EOL> except Exception , e : <EOL> if str ( e ) . find ( '<STR_LIT>' ) < <NUM_LIT:0> : <EOL> raise <EOL> resp = samr . hSamrQueryInformationDomain ( dce , domainHandle , samr . DOMAIN_INFORMATION_CLASS . DomainLogoffInformation ) <EOL> resp . dump ( ) <EOL> oldData = resp [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] <EOL> resp [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] = <NUM_LIT:11> <EOL> resp = samr . hSamrSetInformationDomain ( dce , domainHandle , resp [ '<STR_LIT>' ] ) <EOL> resp . dump ( ) <EOL> resp2 = samr . hSamrQueryInformationDomain ( dce , domainHandle , samr . DOMAIN_INFORMATION_CLASS . DomainLogoffInformation ) <EOL> resp2 . dump ( ) <EOL> self . assertTrue ( <NUM_LIT:11> == resp2 [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] ) <EOL> resp2 [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] = oldData <EOL> resp = samr . hSamrSetInformationDomain ( dce , domainHandle , resp2 [ '<STR_LIT>' ] ) <EOL> resp . dump ( ) <EOL> resp = samr . hSamrQueryInformationDomain ( dce , domainHandle , samr . DOMAIN_INFORMATION_CLASS . DomainOemInformation ) <EOL> resp . dump ( ) <EOL> oldData = resp [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] <EOL> resp [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> resp = samr . hSamrSetInformationDomain ( dce , domainHandle , resp [ '<STR_LIT>' ] ) <EOL> resp . dump ( ) <EOL> resp2 = samr . hSamrQueryInformationDomain ( dce , domainHandle , samr . DOMAIN_INFORMATION_CLASS . DomainOemInformation ) <EOL> resp2 . dump ( ) <EOL> self . assertTrue ( '<STR_LIT>' == resp2 [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] ) <EOL> resp2 [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] = oldData <EOL> resp = samr . hSamrSetInformationDomain ( dce , domainHandle , resp2 [ '<STR_LIT>' ] ) <EOL> resp . dump ( ) <EOL> resp = samr . hSamrQueryInformationDomain ( dce , domainHandle , samr . DOMAIN_INFORMATION_CLASS . DomainNameInformation ) <EOL> resp . dump ( ) <EOL> resp = samr . hSamrQueryInformationDomain ( dce , domainHandle , samr . DOMAIN_INFORMATION_CLASS . DomainServerRoleInformation ) <EOL> resp . dump ( ) <EOL> resp = samr . hSamrQueryInformationDomain ( dce , domainHandle , samr . DOMAIN_INFORMATION_CLASS . DomainReplicationInformation ) <EOL> resp . dump ( ) <EOL> oldData = resp [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] <EOL> resp [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> resp = samr . hSamrSetInformationDomain ( dce , domainHandle , resp [ '<STR_LIT>' ] ) <EOL> resp . dump ( ) <EOL> resp2 = samr . hSamrQueryInformationDomain ( dce , domainHandle , samr . DOMAIN_INFORMATION_CLASS . DomainReplicationInformation ) <EOL> resp2 . dump ( ) <EOL> self . assertTrue ( '<STR_LIT>' == resp2 [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] ) <EOL> resp2 [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] = oldData <EOL> resp = samr . hSamrSetInformationDomain ( dce , domainHandle , resp2 [ '<STR_LIT>' ] ) <EOL> resp . dump ( ) <EOL> resp = samr . hSamrQueryInformationDomain ( dce , domainHandle , samr . DOMAIN_INFORMATION_CLASS . DomainModifiedInformation ) <EOL> resp . dump ( ) <EOL> resp = samr . hSamrQueryInformationDomain ( dce , domainHandle , samr . DOMAIN_INFORMATION_CLASS . DomainStateInformation ) <EOL> resp . dump ( ) <EOL> resp = samr . hSamrQueryInformationDomain ( dce , domainHandle , samr . DOMAIN_INFORMATION_CLASS . DomainGeneralInformation2 ) <EOL> resp . dump ( ) <EOL> resp = samr . hSamrQueryInformationDomain ( dce , domainHandle , samr . DOMAIN_INFORMATION_CLASS . DomainLockoutInformation ) <EOL> resp . dump ( ) <EOL> resp = samr . hSamrQueryInformationDomain ( dce , domainHandle , samr . DOMAIN_INFORMATION_CLASS . DomainModifiedInformation2 ) <EOL> resp . dump ( ) <EOL> def test_SamrQueryInformationGroup_SamrSetInformationGroup ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> request = samr . SamrOpenGroup ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = samr . GROUP_ALL_ACCESS <EOL> request [ '<STR_LIT>' ] = samr . DOMAIN_GROUP_RID_USERS <EOL> try : <EOL> resp0 = dce . request ( request ) <EOL> resp0 . dump ( ) <EOL> except Exception , e : <EOL> if str ( e ) . find ( '<STR_LIT>' ) < <NUM_LIT:0> : <EOL> raise <EOL> request = samr . SamrQueryInformationGroup ( ) <EOL> request [ '<STR_LIT>' ] = resp0 [ '<STR_LIT>' ] <EOL> request [ '<STR_LIT>' ] = samr . GROUP_INFORMATION_CLASS . GroupGeneralInformation <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> request [ '<STR_LIT>' ] = samr . GROUP_INFORMATION_CLASS . GroupNameInformation <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> oldData = resp [ '<STR_LIT>' ] [ '<STR_LIT:Name>' ] [ '<STR_LIT:Name>' ] <EOL> req = samr . SamrSetInformationGroup ( ) <EOL> req [ '<STR_LIT>' ] = resp0 [ '<STR_LIT>' ] <EOL> req [ '<STR_LIT>' ] = samr . GROUP_INFORMATION_CLASS . GroupNameInformation <EOL> req [ '<STR_LIT>' ] [ '<STR_LIT>' ] = samr . GROUP_INFORMATION_CLASS . GroupNameInformation <EOL> req [ '<STR_LIT>' ] [ '<STR_LIT:Name>' ] [ '<STR_LIT:Name>' ] = '<STR_LIT>' <EOL> resp = dce . request ( req ) <EOL> resp . dump ( ) <EOL> request [ '<STR_LIT>' ] = samr . GROUP_INFORMATION_CLASS . GroupNameInformation <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> self . assertTrue ( '<STR_LIT>' == resp [ '<STR_LIT>' ] [ '<STR_LIT:Name>' ] [ '<STR_LIT:Name>' ] ) <EOL> req [ '<STR_LIT>' ] [ '<STR_LIT:Name>' ] [ '<STR_LIT:Name>' ] = oldData <EOL> resp = dce . request ( req ) <EOL> resp . dump ( ) <EOL> request [ '<STR_LIT>' ] = samr . GROUP_INFORMATION_CLASS . GroupAttributeInformation <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> oldData = resp [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] <EOL> req = samr . SamrSetInformationGroup ( ) <EOL> req [ '<STR_LIT>' ] = resp0 [ '<STR_LIT>' ] <EOL> req [ '<STR_LIT>' ] = samr . GROUP_INFORMATION_CLASS . GroupAttributeInformation <EOL> req [ '<STR_LIT>' ] [ '<STR_LIT>' ] = samr . GROUP_INFORMATION_CLASS . GroupAttributeInformation <EOL> req [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] = <NUM_LIT:2> <EOL> resp = dce . request ( req ) <EOL> resp . dump ( ) <EOL> request [ '<STR_LIT>' ] = samr . GROUP_INFORMATION_CLASS . GroupAttributeInformation <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> req [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] = oldData <EOL> resp = dce . request ( req ) <EOL> resp . dump ( ) <EOL> request [ '<STR_LIT>' ] = samr . GROUP_INFORMATION_CLASS . GroupAdminCommentInformation <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> oldData = resp [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] <EOL> req = samr . SamrSetInformationGroup ( ) <EOL> req [ '<STR_LIT>' ] = resp0 [ '<STR_LIT>' ] <EOL> req [ '<STR_LIT>' ] = samr . GROUP_INFORMATION_CLASS . GroupAdminCommentInformation <EOL> req [ '<STR_LIT>' ] [ '<STR_LIT>' ] = samr . GROUP_INFORMATION_CLASS . GroupAdminCommentInformation <EOL> req [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> resp = dce . request ( req ) <EOL> resp . dump ( ) <EOL> request [ '<STR_LIT>' ] = samr . GROUP_INFORMATION_CLASS . GroupAdminCommentInformation <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> self . assertTrue ( '<STR_LIT>' == resp [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] ) <EOL> req [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] = oldData <EOL> resp = dce . request ( req ) <EOL> resp . dump ( ) <EOL> request [ '<STR_LIT>' ] = samr . GROUP_INFORMATION_CLASS . GroupReplicationInformation <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> def test_hSamrQueryInformationGroup_hSamrSetInformationGroup ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> try : <EOL> resp0 = samr . hSamrOpenGroup ( dce , domainHandle , samr . GROUP_ALL_ACCESS , samr . DOMAIN_GROUP_RID_USERS ) <EOL> resp0 . dump ( ) <EOL> except Exception , e : <EOL> if str ( e ) . find ( '<STR_LIT>' ) < <NUM_LIT:0> : <EOL> raise <EOL> resp = samr . hSamrQueryInformationGroup ( dce , resp0 [ '<STR_LIT>' ] , samr . GROUP_INFORMATION_CLASS . GroupGeneralInformation ) <EOL> resp . dump ( ) <EOL> resp = samr . hSamrQueryInformationGroup ( dce , resp0 [ '<STR_LIT>' ] , samr . GROUP_INFORMATION_CLASS . GroupNameInformation ) <EOL> resp . dump ( ) <EOL> oldData = resp [ '<STR_LIT>' ] [ '<STR_LIT:Name>' ] [ '<STR_LIT:Name>' ] <EOL> req = samr . SAMPR_GROUP_INFO_BUFFER ( ) <EOL> req [ '<STR_LIT>' ] = samr . GROUP_INFORMATION_CLASS . GroupNameInformation <EOL> req [ '<STR_LIT:Name>' ] [ '<STR_LIT:Name>' ] = '<STR_LIT>' <EOL> resp = samr . hSamrSetInformationGroup ( dce , resp0 [ '<STR_LIT>' ] , req ) <EOL> resp . dump ( ) <EOL> resp = samr . hSamrQueryInformationGroup ( dce , resp0 [ '<STR_LIT>' ] , samr . GROUP_INFORMATION_CLASS . GroupNameInformation ) <EOL> resp . dump ( ) <EOL> self . assertTrue ( '<STR_LIT>' == resp [ '<STR_LIT>' ] [ '<STR_LIT:Name>' ] [ '<STR_LIT:Name>' ] ) <EOL> req [ '<STR_LIT:Name>' ] [ '<STR_LIT:Name>' ] = oldData <EOL> resp = samr . hSamrSetInformationGroup ( dce , resp0 [ '<STR_LIT>' ] , req ) <EOL> resp . dump ( ) <EOL> def test_hSamrQueryInformationAlias_hSamrSetInformationAlias ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> resp4 = samr . hSamrEnumerateAliasesInDomain ( dce , domainHandle ) <EOL> resp4 . dump ( ) <EOL> resp0 = samr . hSamrOpenAlias ( dce , domainHandle , aliasId = resp4 [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ <NUM_LIT:0> ] [ '<STR_LIT>' ] ) <EOL> resp0 . dump ( ) <EOL> resp = samr . hSamrQueryInformationAlias ( dce , resp0 [ '<STR_LIT>' ] , samr . ALIAS_INFORMATION_CLASS . AliasGeneralInformation ) <EOL> resp . dump ( ) <EOL> resp = samr . hSamrQueryInformationAlias ( dce , resp0 [ '<STR_LIT>' ] , samr . ALIAS_INFORMATION_CLASS . AliasNameInformation ) <EOL> resp . dump ( ) <EOL> oldData = resp [ '<STR_LIT>' ] [ '<STR_LIT:Name>' ] [ '<STR_LIT:Name>' ] <EOL> req = samr . SAMPR_ALIAS_INFO_BUFFER ( ) <EOL> req [ '<STR_LIT>' ] = samr . ALIAS_INFORMATION_CLASS . AliasNameInformation <EOL> req [ '<STR_LIT:Name>' ] [ '<STR_LIT:Name>' ] = '<STR_LIT>' <EOL> resp = samr . hSamrSetInformationAlias ( dce , resp0 [ '<STR_LIT>' ] , req ) <EOL> resp . dump ( ) <EOL> resp = samr . hSamrQueryInformationAlias ( dce , resp0 [ '<STR_LIT>' ] , samr . ALIAS_INFORMATION_CLASS . AliasNameInformation ) <EOL> resp . dump ( ) <EOL> self . assertTrue ( '<STR_LIT>' == resp [ '<STR_LIT>' ] [ '<STR_LIT:Name>' ] [ '<STR_LIT:Name>' ] ) <EOL> req [ '<STR_LIT:Name>' ] [ '<STR_LIT:Name>' ] = oldData <EOL> resp = samr . hSamrSetInformationAlias ( dce , resp0 [ '<STR_LIT>' ] , req ) <EOL> resp . dump ( ) <EOL> def test_SamrQueryInformationAlias_SamrSetInformationAlias ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> request = samr . SamrEnumerateAliasesInDomain ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = <NUM_LIT:0> <EOL> request [ '<STR_LIT>' ] = <NUM_LIT> <EOL> status = nt_errors . STATUS_MORE_ENTRIES <EOL> while status == nt_errors . STATUS_MORE_ENTRIES : <EOL> try : <EOL> resp4 = dce . request ( request ) <EOL> except Exception , e : <EOL> if str ( e ) . find ( '<STR_LIT>' ) < <NUM_LIT:0> : <EOL> raise <EOL> resp4 = e . get_packet ( ) <EOL> resp4 [ '<STR_LIT>' ] . dump ( ) <EOL> request [ '<STR_LIT>' ] = resp4 [ '<STR_LIT>' ] <EOL> status = resp4 [ '<STR_LIT>' ] <EOL> resp4 . dump ( ) <EOL> request = samr . SamrOpenAlias ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = dtypes . MAXIMUM_ALLOWED <EOL> request [ '<STR_LIT>' ] = resp4 [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ <NUM_LIT:0> ] [ '<STR_LIT>' ] <EOL> resp0 = dce . request ( request ) <EOL> resp0 . dump ( ) <EOL> request = samr . SamrQueryInformationAlias ( ) <EOL> request [ '<STR_LIT>' ] = resp0 [ '<STR_LIT>' ] <EOL> request [ '<STR_LIT>' ] = samr . ALIAS_INFORMATION_CLASS . AliasGeneralInformation <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> request [ '<STR_LIT>' ] = samr . ALIAS_INFORMATION_CLASS . AliasNameInformation <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> oldData = resp [ '<STR_LIT>' ] [ '<STR_LIT:Name>' ] [ '<STR_LIT:Name>' ] <EOL> req = samr . SamrSetInformationAlias ( ) <EOL> req [ '<STR_LIT>' ] = resp0 [ '<STR_LIT>' ] <EOL> req [ '<STR_LIT>' ] = samr . ALIAS_INFORMATION_CLASS . AliasNameInformation <EOL> req [ '<STR_LIT>' ] [ '<STR_LIT>' ] = samr . ALIAS_INFORMATION_CLASS . AliasNameInformation <EOL> req [ '<STR_LIT>' ] [ '<STR_LIT:Name>' ] [ '<STR_LIT:Name>' ] = '<STR_LIT>' <EOL> resp = dce . request ( req ) <EOL> resp . dump ( ) <EOL> request [ '<STR_LIT>' ] = samr . ALIAS_INFORMATION_CLASS . AliasNameInformation <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> self . assertTrue ( '<STR_LIT>' == resp [ '<STR_LIT>' ] [ '<STR_LIT:Name>' ] [ '<STR_LIT:Name>' ] ) <EOL> req [ '<STR_LIT>' ] [ '<STR_LIT:Name>' ] [ '<STR_LIT:Name>' ] = oldData <EOL> resp = dce . request ( req ) <EOL> resp . dump ( ) <EOL> request [ '<STR_LIT>' ] = samr . ALIAS_INFORMATION_CLASS . AliasAdminCommentInformation <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> oldData = resp [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] <EOL> req = samr . SamrSetInformationAlias ( ) <EOL> req [ '<STR_LIT>' ] = resp0 [ '<STR_LIT>' ] <EOL> req [ '<STR_LIT>' ] = samr . ALIAS_INFORMATION_CLASS . AliasAdminCommentInformation <EOL> req [ '<STR_LIT>' ] [ '<STR_LIT>' ] = samr . ALIAS_INFORMATION_CLASS . AliasAdminCommentInformation <EOL> req [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> resp = dce . request ( req ) <EOL> resp . dump ( ) <EOL> request [ '<STR_LIT>' ] = samr . ALIAS_INFORMATION_CLASS . AliasAdminCommentInformation <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> self . assertTrue ( '<STR_LIT>' == resp [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] ) <EOL> req [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] = oldData <EOL> resp = dce . request ( req ) <EOL> resp . dump ( ) <EOL> def test_SamrQueryInformationUser2_SamrSetInformationUser2 ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> request = samr . SamrOpenUser ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = samr . USER_READ_GENERAL | samr . USER_READ_PREFERENCES | samr . USER_WRITE_PREFERENCES | samr . USER_READ_LOGON | samr . USER_READ_ACCOUNT | samr . USER_WRITE_ACCOUNT | samr . USER_CHANGE_PASSWORD | samr . USER_FORCE_PASSWORD_CHANGE | samr . USER_LIST_GROUPS | samr . USER_READ_GROUP_INFORMATION | samr . USER_WRITE_GROUP_INFORMATION | samr . USER_ALL_ACCESS | samr . USER_READ | samr . USER_WRITE | samr . USER_EXECUTE <EOL> request [ '<STR_LIT>' ] = samr . DOMAIN_USER_RID_ADMIN <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> request = samr . SamrQueryInformationUser2 ( ) <EOL> request [ '<STR_LIT>' ] = resp [ '<STR_LIT>' ] <EOL> userHandle = resp [ '<STR_LIT>' ] <EOL> request [ '<STR_LIT>' ] = samr . USER_INFORMATION_CLASS . UserGeneralInformation <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> request [ '<STR_LIT>' ] = samr . USER_INFORMATION_CLASS . UserPreferencesInformation <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> oldData = resp [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] <EOL> req = samr . SamrSetInformationUser2 ( ) <EOL> req [ '<STR_LIT>' ] = userHandle <EOL> req [ '<STR_LIT>' ] = samr . USER_INFORMATION_CLASS . UserPreferencesInformation <EOL> req [ '<STR_LIT>' ] = resp [ '<STR_LIT>' ] <EOL> req [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> resp = dce . request ( req ) <EOL> resp . dump ( ) <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> self . assertTrue ( '<STR_LIT>' == resp [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] ) <EOL> req [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] = oldData <EOL> resp = dce . request ( req ) <EOL> resp . dump ( ) <EOL> request [ '<STR_LIT>' ] = samr . USER_INFORMATION_CLASS . UserLogonInformation <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> request [ '<STR_LIT>' ] = samr . USER_INFORMATION_CLASS . UserLogonHoursInformation <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> request [ '<STR_LIT>' ] = samr . USER_INFORMATION_CLASS . UserAccountInformation <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> request [ '<STR_LIT>' ] = samr . USER_INFORMATION_CLASS . UserNameInformation <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> oldData = resp [ '<STR_LIT>' ] [ '<STR_LIT:Name>' ] [ '<STR_LIT>' ] <EOL> req = samr . SamrSetInformationUser2 ( ) <EOL> req [ '<STR_LIT>' ] = userHandle <EOL> req [ '<STR_LIT>' ] = samr . USER_INFORMATION_CLASS . UserNameInformation <EOL> req [ '<STR_LIT>' ] = resp [ '<STR_LIT>' ] <EOL> req [ '<STR_LIT>' ] [ '<STR_LIT:Name>' ] [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> resp = dce . request ( req ) <EOL> resp . dump ( ) <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> self . assertTrue ( '<STR_LIT>' == resp [ '<STR_LIT>' ] [ '<STR_LIT:Name>' ] [ '<STR_LIT>' ] ) <EOL> req [ '<STR_LIT>' ] [ '<STR_LIT:Name>' ] [ '<STR_LIT>' ] = oldData <EOL> resp = dce . request ( req ) <EOL> resp . dump ( ) <EOL> request [ '<STR_LIT>' ] = samr . USER_INFORMATION_CLASS . UserAccountNameInformation <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> oldData = resp [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] <EOL> req = samr . SamrSetInformationUser2 ( ) <EOL> req [ '<STR_LIT>' ] = userHandle <EOL> req [ '<STR_LIT>' ] = samr . USER_INFORMATION_CLASS . UserAccountNameInformation <EOL> req [ '<STR_LIT>' ] = resp [ '<STR_LIT>' ] <EOL> req [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> resp = dce . request ( req ) <EOL> resp . dump ( ) <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> self . assertTrue ( '<STR_LIT>' == resp [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] ) <EOL> req [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] = oldData <EOL> resp = dce . request ( req ) <EOL> resp . dump ( ) <EOL> request [ '<STR_LIT>' ] = samr . USER_INFORMATION_CLASS . UserFullNameInformation <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> request [ '<STR_LIT>' ] = samr . USER_INFORMATION_CLASS . UserPrimaryGroupInformation <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> request [ '<STR_LIT>' ] = samr . USER_INFORMATION_CLASS . UserHomeInformation <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> request [ '<STR_LIT>' ] = samr . USER_INFORMATION_CLASS . UserScriptInformation <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> request [ '<STR_LIT>' ] = samr . USER_INFORMATION_CLASS . UserProfileInformation <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> request [ '<STR_LIT>' ] = samr . USER_INFORMATION_CLASS . UserAdminCommentInformation <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> request [ '<STR_LIT>' ] = samr . USER_INFORMATION_CLASS . UserWorkStationsInformation <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> request [ '<STR_LIT>' ] = samr . USER_INFORMATION_CLASS . UserControlInformation <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> request [ '<STR_LIT>' ] = samr . USER_INFORMATION_CLASS . UserExpiresInformation <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> request [ '<STR_LIT>' ] = samr . USER_INFORMATION_CLASS . UserInternal1Information <EOL> try : <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> except Exception , e : <EOL> if str ( e ) . find ( '<STR_LIT>' ) < <NUM_LIT:0> : <EOL> raise <EOL> pass <EOL> request [ '<STR_LIT>' ] = samr . USER_INFORMATION_CLASS . UserParametersInformation <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> request [ '<STR_LIT>' ] = samr . USER_INFORMATION_CLASS . UserAllInformation <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> request [ '<STR_LIT>' ] = samr . USER_INFORMATION_CLASS . UserInternal4Information <EOL> try : <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> except Exception , e : <EOL> if str ( e ) . find ( '<STR_LIT>' ) < <NUM_LIT:0> : <EOL> raise <EOL> pass <EOL> request [ '<STR_LIT>' ] = samr . USER_INFORMATION_CLASS . UserInternal5Information <EOL> try : <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> except Exception , e : <EOL> if str ( e ) . find ( '<STR_LIT>' ) < <NUM_LIT:0> : <EOL> raise <EOL> pass <EOL> request [ '<STR_LIT>' ] = samr . USER_INFORMATION_CLASS . UserInternal4InformationNew <EOL> try : <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> except Exception , e : <EOL> if str ( e ) . find ( '<STR_LIT>' ) < <NUM_LIT:0> : <EOL> raise <EOL> pass <EOL> request [ '<STR_LIT>' ] = samr . USER_INFORMATION_CLASS . UserInternal5InformationNew <EOL> try : <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> except Exception , e : <EOL> if str ( e ) . find ( '<STR_LIT>' ) < <NUM_LIT:0> : <EOL> raise <EOL> pass <EOL> def test_hSamrQueryInformationUser2_hSamrSetInformationUser2 ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> desiredAccess = samr . USER_READ_GENERAL | samr . USER_READ_PREFERENCES | samr . USER_WRITE_PREFERENCES | samr . USER_READ_LOGON | samr . USER_READ_ACCOUNT | samr . USER_WRITE_ACCOUNT | samr . USER_CHANGE_PASSWORD | samr . USER_FORCE_PASSWORD_CHANGE | samr . USER_LIST_GROUPS | samr . USER_READ_GROUP_INFORMATION | samr . USER_WRITE_GROUP_INFORMATION | samr . USER_ALL_ACCESS | samr . USER_READ | samr . USER_WRITE | samr . USER_EXECUTE <EOL> resp = samr . hSamrOpenUser ( dce , domainHandle , desiredAccess , samr . DOMAIN_USER_RID_ADMIN ) <EOL> resp . dump ( ) <EOL> userHandle = resp [ '<STR_LIT>' ] <EOL> resp = samr . hSamrQueryInformationUser2 ( dce , userHandle , samr . USER_INFORMATION_CLASS . UserGeneralInformation ) <EOL> resp . dump ( ) <EOL> resp = samr . hSamrQueryInformationUser2 ( dce , userHandle , samr . USER_INFORMATION_CLASS . UserPreferencesInformation ) <EOL> resp . dump ( ) <EOL> oldData = resp [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] <EOL> resp [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> resp = samr . hSamrSetInformationUser2 ( dce , userHandle , resp [ '<STR_LIT>' ] ) <EOL> resp . dump ( ) <EOL> resp = samr . hSamrQueryInformationUser2 ( dce , userHandle , samr . USER_INFORMATION_CLASS . UserPreferencesInformation ) <EOL> resp . dump ( ) <EOL> self . assertTrue ( '<STR_LIT>' == resp [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] ) <EOL> resp [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] = oldData <EOL> resp = samr . hSamrSetInformationUser2 ( dce , userHandle , resp [ '<STR_LIT>' ] ) <EOL> resp . dump ( ) <EOL> resp = samr . hSamrQueryInformationUser2 ( dce , userHandle , samr . USER_INFORMATION_CLASS . UserLogonInformation ) <EOL> resp . dump ( ) <EOL> resp = samr . hSamrQueryInformationUser2 ( dce , userHandle , samr . USER_INFORMATION_CLASS . UserLogonHoursInformation ) <EOL> resp . dump ( ) <EOL> resp = samr . hSamrQueryInformationUser2 ( dce , userHandle , samr . USER_INFORMATION_CLASS . UserAccountInformation ) <EOL> resp . dump ( ) <EOL> resp = samr . hSamrQueryInformationUser2 ( dce , userHandle , samr . USER_INFORMATION_CLASS . UserNameInformation ) <EOL> resp . dump ( ) <EOL> oldData = resp [ '<STR_LIT>' ] [ '<STR_LIT:Name>' ] [ '<STR_LIT>' ] <EOL> resp [ '<STR_LIT>' ] [ '<STR_LIT:Name>' ] [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> resp = samr . hSamrSetInformationUser2 ( dce , userHandle , resp [ '<STR_LIT>' ] ) <EOL> resp . dump ( ) <EOL> resp = samr . hSamrQueryInformationUser2 ( dce , userHandle , samr . USER_INFORMATION_CLASS . UserNameInformation ) <EOL> resp . dump ( ) <EOL> self . assertTrue ( '<STR_LIT>' == resp [ '<STR_LIT>' ] [ '<STR_LIT:Name>' ] [ '<STR_LIT>' ] ) <EOL> resp [ '<STR_LIT>' ] [ '<STR_LIT:Name>' ] [ '<STR_LIT>' ] = oldData <EOL> resp = samr . hSamrSetInformationUser2 ( dce , userHandle , resp [ '<STR_LIT>' ] ) <EOL> resp . dump ( ) <EOL> resp = samr . hSamrQueryInformationUser2 ( dce , userHandle , samr . USER_INFORMATION_CLASS . UserAccountNameInformation ) <EOL> resp . dump ( ) <EOL> oldData = resp [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] <EOL> resp [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> resp = samr . hSamrSetInformationUser2 ( dce , userHandle , resp [ '<STR_LIT>' ] ) <EOL> resp . dump ( ) <EOL> resp = samr . hSamrQueryInformationUser2 ( dce , userHandle , samr . USER_INFORMATION_CLASS . UserAccountNameInformation ) <EOL> resp . dump ( ) <EOL> self . assertTrue ( '<STR_LIT>' == resp [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] ) <EOL> resp [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] = oldData <EOL> resp = samr . hSamrSetInformationUser2 ( dce , userHandle , resp [ '<STR_LIT>' ] ) <EOL> resp . dump ( ) <EOL> resp = samr . hSamrQueryInformationUser2 ( dce , userHandle , samr . USER_INFORMATION_CLASS . UserFullNameInformation ) <EOL> resp . dump ( ) <EOL> resp = samr . hSamrQueryInformationUser2 ( dce , userHandle , samr . USER_INFORMATION_CLASS . UserPrimaryGroupInformation ) <EOL> resp . dump ( ) <EOL> resp = samr . hSamrQueryInformationUser2 ( dce , userHandle , samr . USER_INFORMATION_CLASS . UserHomeInformation ) <EOL> resp . dump ( ) <EOL> resp = samr . hSamrQueryInformationUser2 ( dce , userHandle , samr . USER_INFORMATION_CLASS . UserScriptInformation ) <EOL> resp . dump ( ) <EOL> resp = samr . hSamrQueryInformationUser2 ( dce , userHandle , samr . USER_INFORMATION_CLASS . UserProfileInformation ) <EOL> resp . dump ( ) <EOL> resp = samr . hSamrQueryInformationUser2 ( dce , userHandle , samr . USER_INFORMATION_CLASS . UserAdminCommentInformation ) <EOL> resp . dump ( ) <EOL> resp = samr . hSamrQueryInformationUser2 ( dce , userHandle , samr . USER_INFORMATION_CLASS . UserWorkStationsInformation ) <EOL> resp . dump ( ) <EOL> resp = samr . hSamrQueryInformationUser2 ( dce , userHandle , samr . USER_INFORMATION_CLASS . UserControlInformation ) <EOL> resp . dump ( ) <EOL> resp = samr . hSamrQueryInformationUser2 ( dce , userHandle , samr . USER_INFORMATION_CLASS . UserExpiresInformation ) <EOL> resp . dump ( ) <EOL> resp = samr . hSamrQueryInformationUser2 ( dce , userHandle , samr . USER_INFORMATION_CLASS . UserParametersInformation ) <EOL> resp . dump ( ) <EOL> resp = samr . hSamrQueryInformationUser2 ( dce , userHandle , samr . USER_INFORMATION_CLASS . UserAllInformation ) <EOL> resp . dump ( ) <EOL> def test_SamrQueryInformationUser_SamrSetInformationUser ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> request = samr . SamrOpenUser ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = samr . USER_READ_GENERAL | samr . USER_READ_PREFERENCES | samr . USER_READ_ACCOUNT | samr . USER_ALL_ACCESS | samr . USER_READ <EOL> request [ '<STR_LIT>' ] = samr . DOMAIN_USER_RID_ADMIN <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> request = samr . SamrQueryInformationUser ( ) <EOL> request [ '<STR_LIT>' ] = resp [ '<STR_LIT>' ] <EOL> userHandle = resp [ '<STR_LIT>' ] <EOL> request [ '<STR_LIT>' ] = samr . USER_INFORMATION_CLASS . UserGeneralInformation <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> request [ '<STR_LIT>' ] = samr . USER_INFORMATION_CLASS . UserPreferencesInformation <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> oldData = resp [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] <EOL> req = samr . SamrSetInformationUser ( ) <EOL> req [ '<STR_LIT>' ] = userHandle <EOL> req [ '<STR_LIT>' ] = samr . USER_INFORMATION_CLASS . UserPreferencesInformation <EOL> req [ '<STR_LIT>' ] = resp [ '<STR_LIT>' ] <EOL> req [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> resp = dce . request ( req ) <EOL> resp . dump ( ) <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> self . assertTrue ( '<STR_LIT>' == resp [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] ) <EOL> req [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] = oldData <EOL> resp = dce . request ( req ) <EOL> resp . dump ( ) <EOL> request [ '<STR_LIT>' ] = samr . USER_INFORMATION_CLASS . UserLogonInformation <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> request [ '<STR_LIT>' ] = samr . USER_INFORMATION_CLASS . UserLogonHoursInformation <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> request [ '<STR_LIT>' ] = samr . USER_INFORMATION_CLASS . UserAccountInformation <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> request [ '<STR_LIT>' ] = samr . USER_INFORMATION_CLASS . UserNameInformation <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> request [ '<STR_LIT>' ] = samr . USER_INFORMATION_CLASS . UserAccountNameInformation <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> request [ '<STR_LIT>' ] = samr . USER_INFORMATION_CLASS . UserFullNameInformation <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> request [ '<STR_LIT>' ] = samr . USER_INFORMATION_CLASS . UserPrimaryGroupInformation <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> request [ '<STR_LIT>' ] = samr . USER_INFORMATION_CLASS . UserHomeInformation <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> request [ '<STR_LIT>' ] = samr . USER_INFORMATION_CLASS . UserScriptInformation <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> request [ '<STR_LIT>' ] = samr . USER_INFORMATION_CLASS . UserProfileInformation <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> request [ '<STR_LIT>' ] = samr . USER_INFORMATION_CLASS . UserAdminCommentInformation <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> request [ '<STR_LIT>' ] = samr . USER_INFORMATION_CLASS . UserWorkStationsInformation <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> request [ '<STR_LIT>' ] = samr . USER_INFORMATION_CLASS . UserControlInformation <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> request [ '<STR_LIT>' ] = samr . USER_INFORMATION_CLASS . UserExpiresInformation <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> request [ '<STR_LIT>' ] = samr . USER_INFORMATION_CLASS . UserInternal1Information <EOL> try : <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> except Exception , e : <EOL> if str ( e ) . find ( '<STR_LIT>' ) < <NUM_LIT:0> : <EOL> raise <EOL> pass <EOL> request [ '<STR_LIT>' ] = samr . USER_INFORMATION_CLASS . UserParametersInformation <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> request [ '<STR_LIT>' ] = samr . USER_INFORMATION_CLASS . UserAllInformation <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> request [ '<STR_LIT>' ] = samr . USER_INFORMATION_CLASS . UserInternal4Information <EOL> try : <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> except Exception , e : <EOL> if str ( e ) . find ( '<STR_LIT>' ) < <NUM_LIT:0> : <EOL> raise <EOL> pass <EOL> request [ '<STR_LIT>' ] = samr . USER_INFORMATION_CLASS . UserInternal5Information <EOL> try : <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> except Exception , e : <EOL> if str ( e ) . find ( '<STR_LIT>' ) < <NUM_LIT:0> : <EOL> raise <EOL> pass <EOL> request [ '<STR_LIT>' ] = samr . USER_INFORMATION_CLASS . UserInternal4InformationNew <EOL> try : <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> except Exception , e : <EOL> if str ( e ) . find ( '<STR_LIT>' ) < <NUM_LIT:0> : <EOL> raise <EOL> pass <EOL> request [ '<STR_LIT>' ] = samr . USER_INFORMATION_CLASS . UserInternal5InformationNew <EOL> try : <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> except Exception , e : <EOL> if str ( e ) . find ( '<STR_LIT>' ) < <NUM_LIT:0> : <EOL> raise <EOL> pass <EOL> def test_SamrAddMemberToGroup_SamrRemoveMemberFromGroup ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> request = samr . SamrConnect ( ) <EOL> request [ '<STR_LIT>' ] = dtypes . MAXIMUM_ALLOWED <EOL> request [ '<STR_LIT>' ] = u'<STR_LIT>' <EOL> resp = dce . request ( request ) <EOL> request = samr . SamrOpenGroup ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = dtypes . MAXIMUM_ALLOWED <EOL> request [ '<STR_LIT>' ] = samr . DOMAIN_GROUP_RID_USERS <EOL> try : <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> except Exception , e : <EOL> if str ( e ) . find ( '<STR_LIT>' ) < <NUM_LIT:0> : <EOL> raise <EOL> request = samr . SamrRemoveMemberFromGroup ( ) <EOL> request [ '<STR_LIT>' ] = resp [ '<STR_LIT>' ] <EOL> request [ '<STR_LIT>' ] = samr . DOMAIN_USER_RID_ADMIN <EOL> try : <EOL> resp2 = dce . request ( request ) <EOL> resp2 . dump ( ) <EOL> except Exception , e : <EOL> if str ( e ) . find ( '<STR_LIT>' ) < <NUM_LIT:0> : <EOL> raise <EOL> request = samr . SamrAddMemberToGroup ( ) <EOL> request [ '<STR_LIT>' ] = resp [ '<STR_LIT>' ] <EOL> request [ '<STR_LIT>' ] = samr . DOMAIN_USER_RID_ADMIN <EOL> request [ '<STR_LIT>' ] = samr . SE_GROUP_ENABLED_BY_DEFAULT <EOL> try : <EOL> resp2 = dce . request ( request ) <EOL> resp2 . dump ( ) <EOL> except Exception , e : <EOL> if str ( e ) . find ( '<STR_LIT>' ) < <NUM_LIT:0> : <EOL> raise <EOL> def test_hSamrAddMemberToGroup_hSamrRemoveMemberFromGroup ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> request = samr . SamrConnect ( ) <EOL> request [ '<STR_LIT>' ] = dtypes . MAXIMUM_ALLOWED <EOL> request [ '<STR_LIT>' ] = u'<STR_LIT>' <EOL> resp = dce . request ( request ) <EOL> request = samr . SamrOpenGroup ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = dtypes . MAXIMUM_ALLOWED <EOL> request [ '<STR_LIT>' ] = samr . DOMAIN_GROUP_RID_USERS <EOL> try : <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> except Exception , e : <EOL> if str ( e ) . find ( '<STR_LIT>' ) < <NUM_LIT:0> : <EOL> raise <EOL> try : <EOL> resp2 = samr . hSamrRemoveMemberFromGroup ( dce , resp [ '<STR_LIT>' ] , samr . DOMAIN_USER_RID_ADMIN ) <EOL> resp2 . dump ( ) <EOL> except Exception , e : <EOL> if str ( e ) . find ( '<STR_LIT>' ) < <NUM_LIT:0> : <EOL> raise <EOL> try : <EOL> resp2 = samr . hSamrAddMemberToGroup ( dce , resp [ '<STR_LIT>' ] , samr . DOMAIN_USER_RID_ADMIN , samr . SE_GROUP_ENABLED_BY_DEFAULT ) <EOL> resp2 . dump ( ) <EOL> except Exception , e : <EOL> if str ( e ) . find ( '<STR_LIT>' ) < <NUM_LIT:0> : <EOL> raise <EOL> def test_SamrGetMembersInGroup ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> request = samr . SamrOpenGroup ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = dtypes . MAXIMUM_ALLOWED <EOL> request [ '<STR_LIT>' ] = samr . DOMAIN_GROUP_RID_USERS <EOL> try : <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> except Exception , e : <EOL> if str ( e ) . find ( '<STR_LIT>' ) < <NUM_LIT:0> : <EOL> raise <EOL> request = samr . SamrGetMembersInGroup ( ) <EOL> request [ '<STR_LIT>' ] = resp [ '<STR_LIT>' ] <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> def test_hSamrGetMembersInGroup ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> request = samr . SamrOpenGroup ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = dtypes . MAXIMUM_ALLOWED <EOL> request [ '<STR_LIT>' ] = samr . DOMAIN_GROUP_RID_USERS <EOL> try : <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> except Exception , e : <EOL> if str ( e ) . find ( '<STR_LIT>' ) < <NUM_LIT:0> : <EOL> raise <EOL> resp = samr . hSamrGetMembersInGroup ( dce , resp [ '<STR_LIT>' ] ) <EOL> resp . dump ( ) <EOL> def test_SamrGetMembersInAlias ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> request = samr . SamrEnumerateAliasesInDomain ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = <NUM_LIT:0> <EOL> request [ '<STR_LIT>' ] = <NUM_LIT> <EOL> status = nt_errors . STATUS_MORE_ENTRIES <EOL> while status == nt_errors . STATUS_MORE_ENTRIES : <EOL> try : <EOL> resp4 = dce . request ( request ) <EOL> except Exception , e : <EOL> if str ( e ) . find ( '<STR_LIT>' ) < <NUM_LIT:0> : <EOL> raise <EOL> resp4 = e . get_packet ( ) <EOL> resp4 [ '<STR_LIT>' ] . dump ( ) <EOL> request [ '<STR_LIT>' ] = resp4 [ '<STR_LIT>' ] <EOL> status = resp4 [ '<STR_LIT>' ] <EOL> request = samr . SamrOpenAlias ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = dtypes . MAXIMUM_ALLOWED <EOL> request [ '<STR_LIT>' ] = resp4 [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ <NUM_LIT:0> ] [ '<STR_LIT>' ] <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> request = samr . SamrGetMembersInAlias ( ) <EOL> request [ '<STR_LIT>' ] = resp [ '<STR_LIT>' ] <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> def test_hSamrGetMembersInAlias ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> request = samr . SamrEnumerateAliasesInDomain ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = <NUM_LIT:0> <EOL> request [ '<STR_LIT>' ] = <NUM_LIT> <EOL> status = nt_errors . STATUS_MORE_ENTRIES <EOL> while status == nt_errors . STATUS_MORE_ENTRIES : <EOL> try : <EOL> resp4 = dce . request ( request ) <EOL> except Exception , e : <EOL> if str ( e ) . find ( '<STR_LIT>' ) < <NUM_LIT:0> : <EOL> raise <EOL> resp4 = e . get_packet ( ) <EOL> resp4 [ '<STR_LIT>' ] . dump ( ) <EOL> request [ '<STR_LIT>' ] = resp4 [ '<STR_LIT>' ] <EOL> status = resp4 [ '<STR_LIT>' ] <EOL> request = samr . SamrOpenAlias ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = dtypes . MAXIMUM_ALLOWED <EOL> request [ '<STR_LIT>' ] = resp4 [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ <NUM_LIT:0> ] [ '<STR_LIT>' ] <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> resp = samr . hSamrGetMembersInAlias ( dce , resp [ '<STR_LIT>' ] ) <EOL> resp . dump ( ) <EOL> def test_SamrAddMemberToAlias_SamrRemoveMemberFromAlias ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> request = samr . SamrCreateAliasInDomain ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> request [ '<STR_LIT>' ] = samr . GROUP_ALL_ACCESS | samr . DELETE <EOL> resp = dce . request ( request ) <EOL> aliasHandle = resp [ '<STR_LIT>' ] <EOL> relativeId = resp [ '<STR_LIT>' ] <EOL> resp . dump ( ) <EOL> request = samr . SamrRidToSid ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = relativeId <EOL> resp3 = dce . request ( request ) <EOL> resp3 . dump ( ) <EOL> sp = resp3 [ '<STR_LIT>' ] . formatCanonical ( ) <EOL> domainID = '<STR_LIT:->' . join ( sp . split ( '<STR_LIT:->' ) [ : - <NUM_LIT:1> ] ) <EOL> adminSID = domainID + '<STR_LIT>' % samr . DOMAIN_USER_RID_ADMIN <EOL> sid = samr . RPC_SID ( ) <EOL> sid . fromCanonical ( adminSID ) <EOL> request = samr . SamrAddMemberToAlias ( ) <EOL> request [ '<STR_LIT>' ] = aliasHandle <EOL> request [ '<STR_LIT>' ] = sid <EOL> resp2 = dce . request ( request ) <EOL> resp2 . dump ( ) <EOL> request = samr . SamrRemoveMemberFromAlias ( ) <EOL> request [ '<STR_LIT>' ] = aliasHandle <EOL> request [ '<STR_LIT>' ] = sid <EOL> resp2 = dce . request ( request ) <EOL> resp2 . dump ( ) <EOL> request = samr . SamrDeleteAlias ( ) <EOL> request [ '<STR_LIT>' ] = aliasHandle <EOL> resp = dce . request ( request ) <EOL> def test_hSamrAddMemberToAlias_hSamrRemoveMemberFromAlias ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> resp = samr . hSamrCreateAliasInDomain ( dce , domainHandle , '<STR_LIT>' , samr . GROUP_ALL_ACCESS | samr . DELETE ) <EOL> resp . dump ( ) <EOL> aliasHandle = resp [ '<STR_LIT>' ] <EOL> relativeId = resp [ '<STR_LIT>' ] <EOL> resp . dump ( ) <EOL> request = samr . SamrRidToSid ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = relativeId <EOL> resp3 = dce . request ( request ) <EOL> resp3 . dump ( ) <EOL> sp = resp3 [ '<STR_LIT>' ] . formatCanonical ( ) <EOL> domainID = '<STR_LIT:->' . join ( sp . split ( '<STR_LIT:->' ) [ : - <NUM_LIT:1> ] ) <EOL> adminSID = domainID + '<STR_LIT>' % samr . DOMAIN_USER_RID_ADMIN <EOL> sid = samr . RPC_SID ( ) <EOL> sid . fromCanonical ( adminSID ) <EOL> resp2 = samr . hSamrAddMemberToAlias ( dce , aliasHandle , sid ) <EOL> resp2 . dump ( ) <EOL> resp2 = samr . hSamrRemoveMemberFromAlias ( dce , aliasHandle , sid ) <EOL> resp2 . dump ( ) <EOL> resp = samr . hSamrDeleteAlias ( dce , aliasHandle ) <EOL> resp . dump ( ) <EOL> def test_SamrAddMultipleMembersToAlias_SamrRemoveMultipleMembersFromAliass ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> request = samr . SamrCreateAliasInDomain ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> request [ '<STR_LIT>' ] = samr . GROUP_ALL_ACCESS | samr . DELETE <EOL> resp = dce . request ( request ) <EOL> aliasHandle = resp [ '<STR_LIT>' ] <EOL> relativeId = resp [ '<STR_LIT>' ] <EOL> resp . dump ( ) <EOL> request = samr . SamrRidToSid ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = relativeId <EOL> resp3 = dce . request ( request ) <EOL> resp3 . dump ( ) <EOL> sp = resp3 [ '<STR_LIT>' ] . formatCanonical ( ) <EOL> domainID = '<STR_LIT:->' . join ( sp . split ( '<STR_LIT:->' ) [ : - <NUM_LIT:1> ] ) <EOL> adminSID = domainID + '<STR_LIT>' % samr . DOMAIN_USER_RID_ADMIN <EOL> sid = samr . RPC_SID ( ) <EOL> sid . fromCanonical ( adminSID ) <EOL> sid = samr . RPC_SID ( ) <EOL> sid . fromCanonical ( adminSID ) <EOL> guestSID = domainID + '<STR_LIT>' % samr . DOMAIN_USER_RID_GUEST <EOL> sid1 = samr . RPC_SID ( ) <EOL> sid1 . fromCanonical ( adminSID ) <EOL> sid2 = samr . RPC_SID ( ) <EOL> sid2 . fromCanonical ( guestSID ) <EOL> si = samr . PSAMPR_SID_INFORMATION ( ) <EOL> si [ '<STR_LIT>' ] = sid1 <EOL> si2 = samr . PSAMPR_SID_INFORMATION ( ) <EOL> si2 [ '<STR_LIT>' ] = sid2 <EOL> request = samr . SamrAddMultipleMembersToAlias ( ) <EOL> request [ '<STR_LIT>' ] = aliasHandle <EOL> request [ '<STR_LIT>' ] [ '<STR_LIT>' ] = <NUM_LIT:2> <EOL> request [ '<STR_LIT>' ] [ '<STR_LIT>' ] . append ( si ) <EOL> request [ '<STR_LIT>' ] [ '<STR_LIT>' ] . append ( si2 ) <EOL> resp2 = dce . request ( request ) <EOL> resp2 . dump ( ) <EOL> request = samr . SamrRemoveMultipleMembersFromAlias ( ) <EOL> request [ '<STR_LIT>' ] = resp [ '<STR_LIT>' ] <EOL> request [ '<STR_LIT>' ] [ '<STR_LIT>' ] = <NUM_LIT:2> <EOL> request [ '<STR_LIT>' ] [ '<STR_LIT>' ] . append ( si ) <EOL> request [ '<STR_LIT>' ] [ '<STR_LIT>' ] . append ( si2 ) <EOL> resp2 = dce . request ( request ) <EOL> resp2 . dump ( ) <EOL> request = samr . SamrDeleteAlias ( ) <EOL> request [ '<STR_LIT>' ] = aliasHandle <EOL> resp = dce . request ( request ) <EOL> def test_hSamrAddMultipleMembersToAlias_hSamrRemoveMultipleMembersFromAliass ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> resp = samr . hSamrCreateAliasInDomain ( dce , domainHandle , '<STR_LIT>' , samr . GROUP_ALL_ACCESS | samr . DELETE ) <EOL> aliasHandle = resp [ '<STR_LIT>' ] <EOL> relativeId = resp [ '<STR_LIT>' ] <EOL> resp . dump ( ) <EOL> request = samr . SamrRidToSid ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = relativeId <EOL> resp3 = dce . request ( request ) <EOL> resp3 . dump ( ) <EOL> sp = resp3 [ '<STR_LIT>' ] . formatCanonical ( ) <EOL> domainID = '<STR_LIT:->' . join ( sp . split ( '<STR_LIT:->' ) [ : - <NUM_LIT:1> ] ) <EOL> adminSID = domainID + '<STR_LIT>' % samr . DOMAIN_USER_RID_ADMIN <EOL> sid = samr . RPC_SID ( ) <EOL> sid . fromCanonical ( adminSID ) <EOL> sid = samr . RPC_SID ( ) <EOL> sid . fromCanonical ( adminSID ) <EOL> guestSID = domainID + '<STR_LIT>' % samr . DOMAIN_USER_RID_GUEST <EOL> sid1 = samr . RPC_SID ( ) <EOL> sid1 . fromCanonical ( adminSID ) <EOL> sid2 = samr . RPC_SID ( ) <EOL> sid2 . fromCanonical ( guestSID ) <EOL> si = samr . PSAMPR_SID_INFORMATION ( ) <EOL> si [ '<STR_LIT>' ] = sid1 <EOL> si2 = samr . PSAMPR_SID_INFORMATION ( ) <EOL> si2 [ '<STR_LIT>' ] = sid2 <EOL> sidArray = samr . SAMPR_PSID_ARRAY ( ) <EOL> sidArray [ '<STR_LIT>' ] . append ( si ) <EOL> sidArray [ '<STR_LIT>' ] . append ( si2 ) <EOL> resp = samr . hSamrAddMultipleMembersToAlias ( dce , aliasHandle , sidArray ) <EOL> resp . dump ( ) <EOL> resp = samr . hSamrRemoveMultipleMembersFromAlias ( dce , aliasHandle , sidArray ) <EOL> resp . dump ( ) <EOL> request = samr . SamrDeleteAlias ( ) <EOL> request [ '<STR_LIT>' ] = aliasHandle <EOL> resp = dce . request ( request ) <EOL> def test_SamrRemoveMemberFromForeignDomain ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> request = samr . SamrCreateAliasInDomain ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> request [ '<STR_LIT>' ] = samr . GROUP_ALL_ACCESS | samr . DELETE <EOL> resp = dce . request ( request ) <EOL> aliasHandle = resp [ '<STR_LIT>' ] <EOL> relativeId = resp [ '<STR_LIT>' ] <EOL> resp . dump ( ) <EOL> request = samr . SamrRidToSid ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = relativeId <EOL> resp3 = dce . request ( request ) <EOL> resp3 . dump ( ) <EOL> sp = resp3 [ '<STR_LIT>' ] . formatCanonical ( ) <EOL> domainID = '<STR_LIT:->' . join ( sp . split ( '<STR_LIT:->' ) [ : - <NUM_LIT:1> ] ) <EOL> adminSID = domainID + '<STR_LIT>' % samr . DOMAIN_USER_RID_ADMIN <EOL> request = samr . SamrRemoveMemberFromForeignDomain ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] . fromCanonical ( adminSID ) <EOL> try : <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> except Exception , e : <EOL> if str ( e ) . find ( '<STR_LIT>' ) < <NUM_LIT:0> : <EOL> raise <EOL> request = samr . SamrDeleteAlias ( ) <EOL> request [ '<STR_LIT>' ] = aliasHandle <EOL> resp = dce . request ( request ) <EOL> def test_hSamrRemoveMemberFromForeignDomain ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> request = samr . SamrCreateAliasInDomain ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> request [ '<STR_LIT>' ] = samr . GROUP_ALL_ACCESS | samr . DELETE <EOL> resp = dce . request ( request ) <EOL> aliasHandle = resp [ '<STR_LIT>' ] <EOL> relativeId = resp [ '<STR_LIT>' ] <EOL> resp . dump ( ) <EOL> request = samr . SamrRidToSid ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = relativeId <EOL> resp3 = dce . request ( request ) <EOL> resp3 . dump ( ) <EOL> sp = resp3 [ '<STR_LIT>' ] . formatCanonical ( ) <EOL> domainID = '<STR_LIT:->' . join ( sp . split ( '<STR_LIT:->' ) [ : - <NUM_LIT:1> ] ) <EOL> adminSID = domainID + '<STR_LIT>' % samr . DOMAIN_USER_RID_ADMIN <EOL> sid = samr . RPC_SID ( ) <EOL> sid . fromCanonical ( adminSID ) <EOL> try : <EOL> resp = samr . hSamrRemoveMemberFromForeignDomain ( dce , domainHandle , sid ) <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> except Exception , e : <EOL> if str ( e ) . find ( '<STR_LIT>' ) < <NUM_LIT:0> : <EOL> raise <EOL> request = samr . SamrDeleteAlias ( ) <EOL> request [ '<STR_LIT>' ] = aliasHandle <EOL> resp = dce . request ( request ) <EOL> def test_SamrGetAliasMembership ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> request = samr . SamrCreateAliasInDomain ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> request [ '<STR_LIT>' ] = samr . GROUP_ALL_ACCESS | samr . DELETE <EOL> resp = dce . request ( request ) <EOL> aliasHandle = resp [ '<STR_LIT>' ] <EOL> relativeId = resp [ '<STR_LIT>' ] <EOL> resp . dump ( ) <EOL> request = samr . SamrRidToSid ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = relativeId <EOL> resp3 = dce . request ( request ) <EOL> resp3 . dump ( ) <EOL> sp = resp3 [ '<STR_LIT>' ] . formatCanonical ( ) <EOL> domainID = '<STR_LIT:->' . join ( sp . split ( '<STR_LIT:->' ) [ : - <NUM_LIT:1> ] ) <EOL> adminSID = domainID + '<STR_LIT>' % samr . DOMAIN_USER_RID_ADMIN <EOL> sid = samr . RPC_SID ( ) <EOL> sid . fromCanonical ( adminSID ) <EOL> guestSID = domainID + '<STR_LIT>' % samr . DOMAIN_USER_RID_GUEST <EOL> sid1 = samr . RPC_SID ( ) <EOL> sid1 . fromCanonical ( adminSID ) <EOL> sid2 = samr . RPC_SID ( ) <EOL> sid2 . fromCanonical ( guestSID ) <EOL> si = samr . PSAMPR_SID_INFORMATION ( ) <EOL> si [ '<STR_LIT>' ] = sid1 <EOL> si2 = samr . PSAMPR_SID_INFORMATION ( ) <EOL> si2 [ '<STR_LIT>' ] = sid2 <EOL> request = samr . SamrGetAliasMembership ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] [ '<STR_LIT>' ] = <NUM_LIT:2> <EOL> request [ '<STR_LIT>' ] [ '<STR_LIT>' ] . append ( si ) <EOL> request [ '<STR_LIT>' ] [ '<STR_LIT>' ] . append ( si2 ) <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> request = samr . SamrDeleteAlias ( ) <EOL> request [ '<STR_LIT>' ] = aliasHandle <EOL> resp = dce . request ( request ) <EOL> def test_hSamrGetAliasMembership ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> request = samr . SamrCreateAliasInDomain ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> request [ '<STR_LIT>' ] = samr . GROUP_ALL_ACCESS | samr . DELETE <EOL> resp = dce . request ( request ) <EOL> aliasHandle = resp [ '<STR_LIT>' ] <EOL> relativeId = resp [ '<STR_LIT>' ] <EOL> resp . dump ( ) <EOL> request = samr . SamrRidToSid ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = relativeId <EOL> resp3 = dce . request ( request ) <EOL> resp3 . dump ( ) <EOL> sp = resp3 [ '<STR_LIT>' ] . formatCanonical ( ) <EOL> domainID = '<STR_LIT:->' . join ( sp . split ( '<STR_LIT:->' ) [ : - <NUM_LIT:1> ] ) <EOL> adminSID = domainID + '<STR_LIT>' % samr . DOMAIN_USER_RID_ADMIN <EOL> sid = samr . RPC_SID ( ) <EOL> sid . fromCanonical ( adminSID ) <EOL> guestSID = domainID + '<STR_LIT>' % samr . DOMAIN_USER_RID_GUEST <EOL> sid1 = samr . RPC_SID ( ) <EOL> sid1 . fromCanonical ( adminSID ) <EOL> sid2 = samr . RPC_SID ( ) <EOL> sid2 . fromCanonical ( guestSID ) <EOL> si = samr . PSAMPR_SID_INFORMATION ( ) <EOL> si [ '<STR_LIT>' ] = sid1 <EOL> si2 = samr . PSAMPR_SID_INFORMATION ( ) <EOL> si2 [ '<STR_LIT>' ] = sid2 <EOL> sidsArray = samr . SAMPR_PSID_ARRAY ( ) <EOL> sidsArray [ '<STR_LIT>' ] . append ( si ) <EOL> sidsArray [ '<STR_LIT>' ] . append ( si2 ) <EOL> try : <EOL> resp = samr . hSamrGetAliasMembership ( dce , domainHandle , sidsArray ) <EOL> resp . dump ( ) <EOL> except Exception , e : <EOL> request = samr . SamrDeleteAlias ( ) <EOL> request [ '<STR_LIT>' ] = aliasHandle <EOL> resp = dce . request ( request ) <EOL> raise <EOL> request = samr . SamrDeleteAlias ( ) <EOL> request [ '<STR_LIT>' ] = aliasHandle <EOL> resp = dce . request ( request ) <EOL> def test_SamrSetMemberAttributesOfGroup ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> request = samr . SamrConnect ( ) <EOL> request [ '<STR_LIT>' ] = dtypes . MAXIMUM_ALLOWED <EOL> request [ '<STR_LIT>' ] = u'<STR_LIT>' <EOL> resp = dce . request ( request ) <EOL> request = samr . SamrOpenGroup ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = dtypes . MAXIMUM_ALLOWED <EOL> request [ '<STR_LIT>' ] = samr . DOMAIN_GROUP_RID_USERS <EOL> resp = dce . request ( request ) <EOL> request = samr . SamrSetMemberAttributesOfGroup ( ) <EOL> request [ '<STR_LIT>' ] = resp [ '<STR_LIT>' ] <EOL> request [ '<STR_LIT>' ] = samr . DOMAIN_USER_RID_ADMIN <EOL> request [ '<STR_LIT>' ] = samr . SE_GROUP_ENABLED_BY_DEFAULT <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> def test_hSamrSetMemberAttributesOfGroup ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> request = samr . SamrConnect ( ) <EOL> request [ '<STR_LIT>' ] = dtypes . MAXIMUM_ALLOWED <EOL> request [ '<STR_LIT>' ] = u'<STR_LIT>' <EOL> resp = dce . request ( request ) <EOL> request = samr . SamrOpenGroup ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = dtypes . MAXIMUM_ALLOWED <EOL> request [ '<STR_LIT>' ] = samr . DOMAIN_GROUP_RID_USERS <EOL> resp = dce . request ( request ) <EOL> resp = samr . hSamrSetMemberAttributesOfGroup ( dce , resp [ '<STR_LIT>' ] , samr . DOMAIN_USER_RID_ADMIN , samr . SE_GROUP_ENABLED_BY_DEFAULT ) <EOL> resp . dump ( ) <EOL> def test_SamrGetUserDomainPasswordInformation ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> request = samr . SamrOpenUser ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = samr . USER_READ_GENERAL | samr . USER_READ_PREFERENCES | samr . USER_READ_ACCOUNT <EOL> request [ '<STR_LIT>' ] = samr . DOMAIN_USER_RID_ADMIN <EOL> resp = dce . request ( request ) <EOL> request = samr . SamrGetUserDomainPasswordInformation ( ) <EOL> request [ '<STR_LIT>' ] = resp [ '<STR_LIT>' ] <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> def test_hSamrGetUserDomainPasswordInformation ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> request = samr . SamrOpenUser ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = samr . USER_READ_GENERAL | samr . USER_READ_PREFERENCES | samr . USER_READ_ACCOUNT <EOL> request [ '<STR_LIT>' ] = samr . DOMAIN_USER_RID_ADMIN <EOL> resp = dce . request ( request ) <EOL> resp = samr . hSamrGetUserDomainPasswordInformation ( dce , resp [ '<STR_LIT>' ] ) <EOL> resp . dump ( ) <EOL> def test_SamrGetDomainPasswordInformation ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> request = samr . SamrGetDomainPasswordInformation ( ) <EOL> request [ '<STR_LIT>' ] = NULL <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> def test_hSamrGetDomainPasswordInformation ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> resp = samr . hSamrGetDomainPasswordInformation ( dce ) <EOL> resp . dump ( ) <EOL> def test_SamrRidToSid ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> request = samr . SamrRidToSid ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = samr . DOMAIN_USER_RID_ADMIN <EOL> resp = dce . request ( request ) <EOL> def test_hSamrRidToSid ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> resp = samr . hSamrRidToSid ( dce , domainHandle , samr . DOMAIN_USER_RID_ADMIN ) <EOL> resp . dump ( ) <EOL> def test_SamrSetDSRMPassword ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> request = samr . SamrSetDSRMPassword ( ) <EOL> request [ '<STR_LIT>' ] = NULL <EOL> request [ '<STR_LIT>' ] = samr . DOMAIN_USER_RID_ADMIN <EOL> request [ '<STR_LIT>' ] = '<STR_LIT:\x00>' * <NUM_LIT:16> <EOL> try : <EOL> resp = dce . request ( request ) <EOL> except Exception , e : <EOL> if self . stringBinding . find ( '<STR_LIT>' ) >= <NUM_LIT:0> : <EOL> if str ( e ) . find ( '<STR_LIT>' ) < <NUM_LIT:0> : <EOL> raise <EOL> elif str ( e ) . find ( '<STR_LIT>' ) < <NUM_LIT:0> : <EOL> raise <EOL> def test_SamrValidatePassword ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> request = samr . SamrValidatePassword ( ) <EOL> request [ '<STR_LIT>' ] = samr . PASSWORD_POLICY_VALIDATION_TYPE . SamValidatePasswordReset <EOL> request [ '<STR_LIT>' ] [ '<STR_LIT>' ] = samr . PASSWORD_POLICY_VALIDATION_TYPE . SamValidatePasswordReset <EOL> request [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] = samr . SAM_VALIDATE_PASSWORD_HISTORY <EOL> request [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] = NULL <EOL> request [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> request [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> kk = samr . SamrValidatePassword ( ) <EOL> kk . fromString ( str ( request ) ) <EOL> try : <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> except Exception , e : <EOL> if str ( e ) . find ( '<STR_LIT>' ) < <NUM_LIT:0> : <EOL> raise <EOL> def test_hSamrValidatePassword ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> inputArg = samr . SAM_VALIDATE_INPUT_ARG ( ) <EOL> inputArg [ '<STR_LIT>' ] = samr . PASSWORD_POLICY_VALIDATION_TYPE . SamValidatePasswordReset <EOL> inputArg [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] = samr . SAM_VALIDATE_PASSWORD_HISTORY <EOL> inputArg [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] = NULL <EOL> inputArg [ '<STR_LIT>' ] [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> inputArg [ '<STR_LIT>' ] [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> try : <EOL> resp = samr . hSamrValidatePassword ( dce , inputArg ) <EOL> resp . dump ( ) <EOL> except Exception , e : <EOL> if str ( e ) . find ( '<STR_LIT>' ) < <NUM_LIT:0> : <EOL> raise <EOL> def test_SamrQuerySecurityObject ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> request = samr . SamrQuerySecurityObject ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT>' ] = dtypes . OWNER_SECURITY_INFORMATION | dtypes . GROUP_SECURITY_INFORMATION | dtypes . SACL_SECURITY_INFORMATION | dtypes . DACL_SECURITY_INFORMATION <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> def test_hSamrQuerySecurityObject ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> resp = samr . hSamrQuerySecurityObject ( dce , domainHandle , dtypes . OWNER_SECURITY_INFORMATION | dtypes . GROUP_SECURITY_INFORMATION | dtypes . SACL_SECURITY_INFORMATION | dtypes . DACL_SECURITY_INFORMATION ) <EOL> resp . dump ( ) <EOL> def test_SamrSetSecurityObject ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> resp = samr . hSamrLookupNamesInDomain ( dce , domainHandle , ( self . username , ) ) <EOL> resp . dump ( ) <EOL> resp = samr . hSamrOpenUser ( dce , domainHandle , samr . USER_ALL_ACCESS | samr . USER_READ_GROUP_INFORMATION | samr . USER_WRITE_GROUP_INFORMATION , resp [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ <NUM_LIT:0> ] [ '<STR_LIT>' ] ) <EOL> resp . dump ( ) <EOL> userHandle = resp [ '<STR_LIT>' ] <EOL> request = samr . SamrQuerySecurityObject ( ) <EOL> request [ '<STR_LIT>' ] = userHandle <EOL> request [ '<STR_LIT>' ] = dtypes . GROUP_SECURITY_INFORMATION <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> request = samr . SamrSetSecurityObject ( ) <EOL> request [ '<STR_LIT>' ] = userHandle <EOL> request [ '<STR_LIT>' ] = dtypes . GROUP_SECURITY_INFORMATION <EOL> request [ '<STR_LIT>' ] = resp [ '<STR_LIT>' ] <EOL> try : <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> except Exception , e : <EOL> if str ( e ) . find ( '<STR_LIT>' ) <= <NUM_LIT:0> : <EOL> raise <EOL> resp = samr . hSamrCloseHandle ( dce , userHandle ) <EOL> resp . dump ( ) <EOL> def test_hSamrSetSecurityObject ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> resp = samr . hSamrLookupNamesInDomain ( dce , domainHandle , ( self . username , ) ) <EOL> resp . dump ( ) <EOL> resp = samr . hSamrOpenUser ( dce , domainHandle , samr . USER_ALL_ACCESS | samr . USER_READ_GROUP_INFORMATION | samr . USER_WRITE_GROUP_INFORMATION , resp [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ <NUM_LIT:0> ] [ '<STR_LIT>' ] ) <EOL> resp . dump ( ) <EOL> userHandle = resp [ '<STR_LIT>' ] <EOL> resp = samr . hSamrQuerySecurityObject ( dce , userHandle , dtypes . GROUP_SECURITY_INFORMATION ) <EOL> resp . dump ( ) <EOL> try : <EOL> resp = samr . hSamrSetSecurityObject ( dce , userHandle , dtypes . GROUP_SECURITY_INFORMATION , resp [ '<STR_LIT>' ] ) <EOL> resp . dump ( ) <EOL> except Exception , e : <EOL> if str ( e ) . find ( '<STR_LIT>' ) <= <NUM_LIT:0> : <EOL> raise <EOL> resp = samr . hSamrCloseHandle ( dce , userHandle ) <EOL> resp . dump ( ) <EOL> def test_SamrChangePasswordUser ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> request = samr . SamrCreateUser2InDomain ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT:Name>' ] = '<STR_LIT>' <EOL> request [ '<STR_LIT>' ] = samr . USER_NORMAL_ACCOUNT <EOL> request [ '<STR_LIT>' ] = dtypes . MAXIMUM_ALLOWED | samr . USER_READ_GENERAL | samr . DELETE <EOL> resp0 = dce . request ( request ) <EOL> resp0 . dump ( ) <EOL> oldPwd = '<STR_LIT>' <EOL> oldPwdHashNT = ntlm . NTOWFv1 ( oldPwd ) <EOL> newPwd = '<STR_LIT>' <EOL> newPwdHashNT = ntlm . NTOWFv1 ( newPwd ) <EOL> newPwdHashLM = ntlm . LMOWFv1 ( newPwd ) <EOL> from impacket import crypto <EOL> request = samr . SamrChangePasswordUser ( ) <EOL> request [ '<STR_LIT>' ] = resp0 [ '<STR_LIT>' ] <EOL> request [ '<STR_LIT>' ] = <NUM_LIT:0> <EOL> request [ '<STR_LIT>' ] = NULL <EOL> request [ '<STR_LIT>' ] = NULL <EOL> request [ '<STR_LIT>' ] = <NUM_LIT:1> <EOL> request [ '<STR_LIT>' ] = crypto . SamEncryptNTLMHash ( oldPwdHashNT , newPwdHashNT ) <EOL> request [ '<STR_LIT>' ] = crypto . SamEncryptNTLMHash ( newPwdHashNT , oldPwdHashNT ) <EOL> request [ '<STR_LIT>' ] = <NUM_LIT:0> <EOL> request [ '<STR_LIT>' ] = NULL <EOL> request [ '<STR_LIT>' ] = <NUM_LIT:1> <EOL> request [ '<STR_LIT>' ] = crypto . SamEncryptNTLMHash ( newPwdHashLM , newPwdHashNT ) <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> request = samr . SamrDeleteUser ( ) <EOL> request [ '<STR_LIT>' ] = resp0 [ '<STR_LIT>' ] <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> def test_hSamrChangePasswordUser ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> request = samr . SamrCreateUser2InDomain ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT:Name>' ] = '<STR_LIT>' <EOL> request [ '<STR_LIT>' ] = samr . USER_NORMAL_ACCOUNT <EOL> request [ '<STR_LIT>' ] = dtypes . MAXIMUM_ALLOWED | samr . USER_READ_GENERAL | samr . DELETE <EOL> resp0 = dce . request ( request ) <EOL> resp0 . dump ( ) <EOL> resp = samr . hSamrChangePasswordUser ( dce , resp0 [ '<STR_LIT>' ] , '<STR_LIT>' , '<STR_LIT>' ) <EOL> resp . dump ( ) <EOL> request = samr . SamrDeleteUser ( ) <EOL> request [ '<STR_LIT>' ] = resp0 [ '<STR_LIT>' ] <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> def test_SamrOemChangePasswordUser2 ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> oldPwd = '<STR_LIT>' <EOL> oldPwdHashLM = ntlm . LMOWFv1 ( oldPwd ) <EOL> newPwd = '<STR_LIT>' <EOL> newPwdHashNT = ntlm . NTOWFv1 ( newPwd ) <EOL> newPwdHashLM = ntlm . LMOWFv1 ( newPwd ) <EOL> try : <EOL> from Crypto . Cipher import ARC4 <EOL> except Exception : <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> from impacket import crypto <EOL> request = samr . SamrOemChangePasswordUser2 ( ) <EOL> request [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> request [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> samUser = samr . SAMPR_USER_PASSWORD ( ) <EOL> samUser [ '<STR_LIT>' ] = '<STR_LIT:A>' * ( <NUM_LIT> - len ( newPwd ) ) + newPwd <EOL> samUser [ '<STR_LIT>' ] = len ( newPwd ) <EOL> pwdBuff = str ( samUser ) <EOL> rc4 = ARC4 . new ( oldPwdHashLM ) <EOL> encBuf = rc4 . encrypt ( pwdBuff ) <EOL> request [ '<STR_LIT>' ] [ '<STR_LIT>' ] = encBuf <EOL> request [ '<STR_LIT>' ] = crypto . SamEncryptNTLMHash ( oldPwdHashLM , newPwdHashLM ) <EOL> try : <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> except Exception , e : <EOL> if str ( e ) . find ( '<STR_LIT>' ) < <NUM_LIT:0> : <EOL> raise <EOL> def test_SamrUnicodeChangePasswordUser2 ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> request = samr . SamrCreateUser2InDomain ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT:Name>' ] = '<STR_LIT>' <EOL> request [ '<STR_LIT>' ] = samr . USER_NORMAL_ACCOUNT <EOL> request [ '<STR_LIT>' ] = dtypes . MAXIMUM_ALLOWED | samr . USER_READ_GENERAL | samr . DELETE <EOL> resp0 = dce . request ( request ) <EOL> resp0 . dump ( ) <EOL> oldPwd = '<STR_LIT>' <EOL> oldPwdHashNT = ntlm . NTOWFv1 ( oldPwd ) <EOL> newPwd = '<STR_LIT>' <EOL> newPwdHashNT = ntlm . NTOWFv1 ( newPwd ) <EOL> newPwdHashLM = ntlm . LMOWFv1 ( newPwd ) <EOL> from impacket import crypto <EOL> request = samr . SamrChangePasswordUser ( ) <EOL> request [ '<STR_LIT>' ] = resp0 [ '<STR_LIT>' ] <EOL> request [ '<STR_LIT>' ] = <NUM_LIT:0> <EOL> request [ '<STR_LIT>' ] = NULL <EOL> request [ '<STR_LIT>' ] = NULL <EOL> request [ '<STR_LIT>' ] = <NUM_LIT:1> <EOL> request [ '<STR_LIT>' ] = crypto . SamEncryptNTLMHash ( oldPwdHashNT , newPwdHashNT ) <EOL> request [ '<STR_LIT>' ] = crypto . SamEncryptNTLMHash ( newPwdHashNT , oldPwdHashNT ) <EOL> request [ '<STR_LIT>' ] = <NUM_LIT:0> <EOL> request [ '<STR_LIT>' ] = NULL <EOL> request [ '<STR_LIT>' ] = <NUM_LIT:1> <EOL> request [ '<STR_LIT>' ] = crypto . SamEncryptNTLMHash ( newPwdHashLM , newPwdHashNT ) <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> oldPwd = '<STR_LIT>' <EOL> oldPwdHashLM = ntlm . LMOWFv1 ( oldPwd ) <EOL> oldPwdHashNT = ntlm . NTOWFv1 ( oldPwd ) <EOL> newPwd = chars = "<STR_LIT>" . join ( [ random . choice ( string . letters ) for i in xrange ( <NUM_LIT:15> ) ] ) <EOL> newPwdHashNT = ntlm . NTOWFv1 ( newPwd ) <EOL> newPwdHashLM = ntlm . LMOWFv1 ( newPwd ) <EOL> try : <EOL> from Crypto . Cipher import ARC4 <EOL> except Exception : <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> from impacket import crypto <EOL> request = samr . SamrUnicodeChangePasswordUser2 ( ) <EOL> request [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> request [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> samUser = samr . SAMPR_USER_PASSWORD ( ) <EOL> samUser [ '<STR_LIT>' ] = '<STR_LIT:A>' * ( <NUM_LIT> - len ( newPwd ) * <NUM_LIT:2> ) + newPwd . encode ( '<STR_LIT>' ) <EOL> samUser [ '<STR_LIT>' ] = len ( newPwd ) * <NUM_LIT:2> <EOL> pwdBuff = str ( samUser ) <EOL> rc4 = ARC4 . new ( oldPwdHashNT ) <EOL> encBuf = rc4 . encrypt ( pwdBuff ) <EOL> request [ '<STR_LIT>' ] [ '<STR_LIT>' ] = encBuf <EOL> request [ '<STR_LIT>' ] = crypto . SamEncryptNTLMHash ( oldPwdHashNT , newPwdHashNT ) <EOL> request [ '<STR_LIT>' ] = <NUM_LIT:0> <EOL> request [ '<STR_LIT>' ] = NULL <EOL> request [ '<STR_LIT>' ] = NULL <EOL> try : <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> except Exception , e : <EOL> if str ( e ) . find ( '<STR_LIT>' ) < <NUM_LIT:0> : <EOL> raise <EOL> request = samr . SamrDeleteUser ( ) <EOL> request [ '<STR_LIT>' ] = resp0 [ '<STR_LIT>' ] <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> def test_hSamrUnicodeChangePasswordUser2 ( self ) : <EOL> dce , rpctransport , domainHandle = self . connect ( ) <EOL> request = samr . SamrCreateUser2InDomain ( ) <EOL> request [ '<STR_LIT>' ] = domainHandle <EOL> request [ '<STR_LIT:Name>' ] = '<STR_LIT>' <EOL> request [ '<STR_LIT>' ] = samr . USER_NORMAL_ACCOUNT <EOL> request [ '<STR_LIT>' ] = dtypes . MAXIMUM_ALLOWED | samr . USER_READ_GENERAL | samr . DELETE <EOL> resp0 = dce . request ( request ) <EOL> resp0 . dump ( ) <EOL> oldPwd = '<STR_LIT>' <EOL> oldPwdHashNT = ntlm . NTOWFv1 ( oldPwd ) <EOL> newPwd = '<STR_LIT>' <EOL> newPwdHashNT = ntlm . NTOWFv1 ( newPwd ) <EOL> newPwdHashLM = ntlm . LMOWFv1 ( newPwd ) <EOL> from impacket import crypto <EOL> request = samr . SamrChangePasswordUser ( ) <EOL> request [ '<STR_LIT>' ] = resp0 [ '<STR_LIT>' ] <EOL> request [ '<STR_LIT>' ] = <NUM_LIT:0> <EOL> request [ '<STR_LIT>' ] = NULL <EOL> request [ '<STR_LIT>' ] = NULL <EOL> request [ '<STR_LIT>' ] = <NUM_LIT:1> <EOL> request [ '<STR_LIT>' ] = crypto . SamEncryptNTLMHash ( oldPwdHashNT , newPwdHashNT ) <EOL> request [ '<STR_LIT>' ] = crypto . SamEncryptNTLMHash ( newPwdHashNT , oldPwdHashNT ) <EOL> request [ '<STR_LIT>' ] = <NUM_LIT:0> <EOL> request [ '<STR_LIT>' ] = NULL <EOL> request [ '<STR_LIT>' ] = <NUM_LIT:1> <EOL> request [ '<STR_LIT>' ] = crypto . SamEncryptNTLMHash ( newPwdHashLM , newPwdHashNT ) <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> try : <EOL> resp = samr . hSamrUnicodeChangePasswordUser2 ( dce , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> resp . dump ( ) <EOL> except Exception , e : <EOL> if str ( e ) . find ( '<STR_LIT>' ) < <NUM_LIT:0> : <EOL> raise <EOL> request = samr . SamrDeleteUser ( ) <EOL> request [ '<STR_LIT>' ] = resp0 [ '<STR_LIT>' ] <EOL> resp = dce . request ( request ) <EOL> resp . dump ( ) <EOL> class SMBTransport ( SAMRTests ) : <EOL> def setUp ( self ) : <EOL> SAMRTests . setUp ( self ) <EOL> configFile = ConfigParser . ConfigParser ( ) <EOL> configFile . read ( '<STR_LIT>' ) <EOL> self . username = configFile . get ( '<STR_LIT>' , '<STR_LIT:username>' ) <EOL> self . domain = configFile . get ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . serverName = configFile . get ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . password = configFile . get ( '<STR_LIT>' , '<STR_LIT:password>' ) <EOL> self . machine = configFile . get ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . hashes = configFile . get ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . stringBinding = epm . hept_map ( self . machine , samr . MSRPC_UUID_SAMR , protocol = '<STR_LIT>' ) <EOL> self . ts = ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> class TCPTransport ( SAMRTests ) : <EOL> def setUp ( self ) : <EOL> SAMRTests . setUp ( self ) <EOL> configFile = ConfigParser . ConfigParser ( ) <EOL> configFile . read ( '<STR_LIT>' ) <EOL> self . username = configFile . get ( '<STR_LIT>' , '<STR_LIT:username>' ) <EOL> self . domain = configFile . get ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . serverName = configFile . get ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . password = configFile . get ( '<STR_LIT>' , '<STR_LIT:password>' ) <EOL> self . machine = configFile . get ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . hashes = configFile . get ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . stringBinding = epm . hept_map ( self . machine , samr . MSRPC_UUID_SAMR , protocol = '<STR_LIT>' ) <EOL> self . ts = ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> class SMBTransport64 ( SAMRTests ) : <EOL> def setUp ( self ) : <EOL> SAMRTests . setUp ( self ) <EOL> configFile = ConfigParser . ConfigParser ( ) <EOL> configFile . read ( '<STR_LIT>' ) <EOL> self . username = configFile . get ( '<STR_LIT>' , '<STR_LIT:username>' ) <EOL> self . domain = configFile . get ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . serverName = configFile . get ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . password = configFile . get ( '<STR_LIT>' , '<STR_LIT:password>' ) <EOL> self . machine = configFile . get ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . hashes = configFile . get ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . stringBinding = epm . hept_map ( self . machine , samr . MSRPC_UUID_SAMR , protocol = '<STR_LIT>' ) <EOL> self . ts = ( '<STR_LIT>' , '<STR_LIT:1.0>' ) <EOL> class TCPTransport64 ( SAMRTests ) : <EOL> def setUp ( self ) : <EOL> SAMRTests . setUp ( self ) <EOL> configFile = ConfigParser . ConfigParser ( ) <EOL> configFile . read ( '<STR_LIT>' ) <EOL> self . username = configFile . get ( '<STR_LIT>' , '<STR_LIT:username>' ) <EOL> self . domain = configFile . get ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . serverName = configFile . get ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . password = configFile . get ( '<STR_LIT>' , '<STR_LIT:password>' ) <EOL> self . machine = configFile . get ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . hashes = configFile . get ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . stringBinding = epm . hept_map ( self . machine , samr . MSRPC_UUID_SAMR , protocol = '<STR_LIT>' ) <EOL> self . ts = ( '<STR_LIT>' , '<STR_LIT:1.0>' ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> import sys <EOL> if len ( sys . argv ) > <NUM_LIT:1> : <EOL> testcase = sys . argv [ <NUM_LIT:1> ] <EOL> suite = unittest . TestLoader ( ) . loadTestsFromTestCase ( globals ( ) [ testcase ] ) <EOL> else : <EOL> suite = unittest . TestLoader ( ) . loadTestsFromTestCase ( SMBTransport ) <EOL> suite . addTests ( unittest . TestLoader ( ) . loadTestsFromTestCase ( TCPTransport ) ) <EOL> suite . addTests ( unittest . TestLoader ( ) . loadTestsFromTestCase ( SMBTransport64 ) ) <EOL> suite . addTests ( unittest . TestLoader ( ) . loadTestsFromTestCase ( TCPTransport64 ) ) <EOL> unittest . TextTestRunner ( verbosity = <NUM_LIT:1> ) . run ( suite ) </s>
<s> """<STR_LIT>""" <EOL> from pydevd_constants import * <EOL> from types import * <EOL> try : <EOL> from StringIO import StringIO <EOL> except ImportError : <EOL> from io import StringIO <EOL> import sys <EOL> try : <EOL> from urllib import quote <EOL> except : <EOL> from urllib . parse import quote <EOL> import threading <EOL> import pydevd_resolver <EOL> import traceback <EOL> try : <EOL> __setFalse = False <EOL> except : <EOL> import __builtin__ <EOL> setattr ( __builtin__ , '<STR_LIT:True>' , <NUM_LIT:1> ) <EOL> setattr ( __builtin__ , '<STR_LIT:False>' , <NUM_LIT:0> ) <EOL> class VariableError ( RuntimeError ) : pass <EOL> class FrameNotFoundError ( RuntimeError ) : pass <EOL> if not sys . platform . startswith ( "<STR_LIT>" ) : <EOL> typeMap = [ <EOL> ( type ( None ) , None , ) , <EOL> ( int , None ) , <EOL> ( float , None ) , <EOL> ( complex , None ) , <EOL> ( str , None ) , <EOL> ( tuple , pydevd_resolver . tupleResolver ) , <EOL> ( list , pydevd_resolver . tupleResolver ) , <EOL> ( dict , pydevd_resolver . dictResolver ) , <EOL> ] <EOL> try : <EOL> typeMap . append ( ( long , None ) ) <EOL> except : <EOL> pass <EOL> try : <EOL> typeMap . append ( ( unicode , None ) ) <EOL> except : <EOL> pass <EOL> try : <EOL> typeMap . append ( ( set , pydevd_resolver . setResolver ) ) <EOL> except : <EOL> pass <EOL> try : <EOL> typeMap . append ( ( frozenset , pydevd_resolver . setResolver ) ) <EOL> except : <EOL> pass <EOL> else : <EOL> from org . python import core <EOL> typeMap = [ <EOL> ( core . PyNone , None ) , <EOL> ( core . PyInteger , None ) , <EOL> ( core . PyLong , None ) , <EOL> ( core . PyFloat , None ) , <EOL> ( core . PyComplex , None ) , <EOL> ( core . PyString , None ) , <EOL> ( core . PyTuple , pydevd_resolver . tupleResolver ) , <EOL> ( core . PyList , pydevd_resolver . tupleResolver ) , <EOL> ( core . PyDictionary , pydevd_resolver . dictResolver ) , <EOL> ( core . PyStringMap , pydevd_resolver . dictResolver ) , <EOL> ] <EOL> if hasattr ( core , '<STR_LIT>' ) : <EOL> typeMap . append ( ( core . PyJavaInstance , pydevd_resolver . instanceResolver ) ) <EOL> def getType ( o ) : <EOL> """<STR_LIT>""" <EOL> try : <EOL> type_object = type ( o ) <EOL> type_name = type_object . __name__ <EOL> except : <EOL> return '<STR_LIT>' , '<STR_LIT>' , None <EOL> try : <EOL> if type_name == '<STR_LIT>' : <EOL> return ( type_object , type_name , pydevd_resolver . instanceResolver ) <EOL> if type_name == '<STR_LIT>' : <EOL> return ( type_object , type_name , pydevd_resolver . jyArrayResolver ) <EOL> for t in typeMap : <EOL> if isinstance ( o , t [ <NUM_LIT:0> ] ) : <EOL> return ( type_object , type_name , t [ <NUM_LIT:1> ] ) <EOL> except : <EOL> traceback . print_exc ( ) <EOL> return ( type_object , type_name , pydevd_resolver . defaultResolver ) <EOL> try : <EOL> from xml . sax . saxutils import escape <EOL> def makeValidXmlValue ( s ) : <EOL> return escape ( s , { '<STR_LIT:">' : '<STR_LIT>' } ) <EOL> except : <EOL> def makeValidXmlValue ( s ) : <EOL> return s . replace ( '<STR_LIT:<>' , '<STR_LIT>' ) . replace ( '<STR_LIT:>>' , '<STR_LIT>' ) . replace ( '<STR_LIT:">' , '<STR_LIT>' ) <EOL> def varToXML ( v , name ) : <EOL> """<STR_LIT>""" <EOL> type , typeName , resolver = getType ( v ) <EOL> try : <EOL> if hasattr ( v , '<STR_LIT>' ) : <EOL> try : <EOL> cName = str ( v . __class__ ) <EOL> if cName . find ( '<STR_LIT:.>' ) != - <NUM_LIT:1> : <EOL> cName = cName . split ( '<STR_LIT:.>' ) [ - <NUM_LIT:1> ] <EOL> elif cName . find ( "<STR_LIT:'>" ) != - <NUM_LIT:1> : <EOL> cName = cName [ cName . index ( "<STR_LIT:'>" ) + <NUM_LIT:1> : ] <EOL> if cName . endswith ( "<STR_LIT>" ) : <EOL> cName = cName [ : - <NUM_LIT:2> ] <EOL> except : <EOL> cName = str ( v . __class__ ) <EOL> value = '<STR_LIT>' % ( cName , v ) <EOL> else : <EOL> value = str ( v ) <EOL> except : <EOL> try : <EOL> value = repr ( v ) <EOL> except : <EOL> value = '<STR_LIT>' % v . __class__ <EOL> xml = '<STR_LIT>' % ( makeValidXmlValue ( name ) , makeValidXmlValue ( typeName ) ) <EOL> if value : <EOL> if len ( value ) > MAXIMUM_VARIABLE_REPRESENTATION_SIZE : <EOL> value = value [ <NUM_LIT:0> : MAXIMUM_VARIABLE_REPRESENTATION_SIZE ] <EOL> value += '<STR_LIT>' <EOL> try : <EOL> if not IS_PY3K : <EOL> if isinstance ( value , unicode ) : <EOL> value = value . encode ( '<STR_LIT:utf-8>' ) <EOL> else : <EOL> if isinstance ( value , bytes ) : <EOL> value = value . encode ( '<STR_LIT:utf-8>' ) <EOL> except TypeError : <EOL> pass <EOL> xmlValue = '<STR_LIT>' % ( makeValidXmlValue ( quote ( value , '<STR_LIT>' ) ) ) <EOL> else : <EOL> xmlValue = '<STR_LIT>' <EOL> if resolver is not None : <EOL> xmlCont = '<STR_LIT>' <EOL> else : <EOL> xmlCont = '<STR_LIT>' <EOL> return '<STR_LIT>' . join ( ( xml , xmlValue , xmlCont , '<STR_LIT>' ) ) <EOL> if USE_PSYCO_OPTIMIZATION : <EOL> try : <EOL> import psyco <EOL> varToXML = psyco . proxy ( varToXML ) <EOL> except ImportError : <EOL> if hasattr ( sys , '<STR_LIT>' ) : <EOL> sys . exc_clear ( ) <EOL> def frameVarsToXML ( frame ) : <EOL> """<STR_LIT>""" <EOL> xml = "<STR_LIT>" <EOL> keys = frame . f_locals . keys ( ) <EOL> if hasattr ( keys , '<STR_LIT>' ) : <EOL> keys . sort ( ) <EOL> else : <EOL> keys = sorted ( keys ) <EOL> for k in keys : <EOL> try : <EOL> v = frame . f_locals [ k ] <EOL> xml += varToXML ( v , str ( k ) ) <EOL> except Exception : <EOL> traceback . print_exc ( ) <EOL> sys . stderr . write ( "<STR_LIT>" ) <EOL> return xml <EOL> def iterFrames ( initialFrame ) : <EOL> '''<STR_LIT>''' <EOL> frames = [ ] <EOL> while initialFrame is not None : <EOL> frames . append ( initialFrame ) <EOL> initialFrame = initialFrame . f_back <EOL> return frames <EOL> def dumpFrames ( thread_id ) : <EOL> sys . stdout . write ( '<STR_LIT>' ) <EOL> if thread_id != GetThreadId ( threading . currentThread ( ) ) : <EOL> raise VariableError ( "<STR_LIT>" ) <EOL> curFrame = GetFrame ( ) <EOL> for frame in iterFrames ( curFrame ) : <EOL> sys . stdout . write ( '<STR_LIT>' % id ( frame ) ) <EOL> class AdditionalFramesContainer : <EOL> lock = threading . Lock ( ) <EOL> additional_frames = { } <EOL> def addAdditionalFrameById ( thread_id , frames_by_id ) : <EOL> AdditionalFramesContainer . additional_frames [ thread_id ] = frames_by_id <EOL> def removeAdditionalFrameById ( thread_id ) : <EOL> del AdditionalFramesContainer . additional_frames [ thread_id ] <EOL> def findFrame ( thread_id , frame_id ) : <EOL> """<STR_LIT>""" <EOL> if thread_id != GetThreadId ( threading . currentThread ( ) ) : <EOL> raise VariableError ( "<STR_LIT>" ) <EOL> lookingFor = int ( frame_id ) <EOL> if AdditionalFramesContainer . additional_frames : <EOL> if DictContains ( AdditionalFramesContainer . additional_frames , thread_id ) : <EOL> frame = AdditionalFramesContainer . additional_frames [ thread_id ] . get ( lookingFor ) <EOL> if frame is not None : <EOL> return frame <EOL> curFrame = GetFrame ( ) <EOL> if frame_id == "<STR_LIT:*>" : <EOL> return curFrame <EOL> frameFound = None <EOL> for frame in iterFrames ( curFrame ) : <EOL> if lookingFor == id ( frame ) : <EOL> frameFound = frame <EOL> del frame <EOL> break <EOL> del frame <EOL> del curFrame <EOL> if frameFound is None : <EOL> msgFrames = '<STR_LIT>' <EOL> i = <NUM_LIT:0> <EOL> for frame in iterFrames ( GetFrame ( ) ) : <EOL> i += <NUM_LIT:1> <EOL> msgFrames += str ( id ( frame ) ) <EOL> if i % <NUM_LIT:5> == <NUM_LIT:0> : <EOL> msgFrames += '<STR_LIT:\n>' <EOL> else : <EOL> msgFrames += '<STR_LIT>' <EOL> errMsg = '''<STR_LIT>''' % ( thread_id , lookingFor , GetThreadId ( threading . currentThread ( ) ) , msgFrames ) <EOL> raise FrameNotFoundError ( errMsg ) <EOL> return frameFound <EOL> def resolveCompoundVariable ( thread_id , frame_id , scope , attrs ) : <EOL> """<STR_LIT>""" <EOL> frame = findFrame ( thread_id , frame_id ) <EOL> attrList = attrs . split ( '<STR_LIT:\t>' ) <EOL> if scope == "<STR_LIT>" : <EOL> var = frame . f_globals <EOL> del attrList [ <NUM_LIT:0> ] <EOL> else : <EOL> var = frame . f_locals <EOL> for k in attrList : <EOL> type , _typeName , resolver = getType ( var ) <EOL> var = resolver . resolve ( var , k ) <EOL> try : <EOL> type , _typeName , resolver = getType ( var ) <EOL> return resolver . getDictionary ( var ) <EOL> except : <EOL> traceback . print_exc ( ) <EOL> def evaluateExpression ( thread_id , frame_id , expression , doExec ) : <EOL> '''<STR_LIT>''' <EOL> frame = findFrame ( thread_id , frame_id ) <EOL> expression = expression . replace ( '<STR_LIT>' , '<STR_LIT:\n>' ) <EOL> updated_globals = dict ( ) <EOL> updated_globals . update ( frame . f_globals ) <EOL> updated_globals . update ( frame . f_locals ) <EOL> try : <EOL> if doExec : <EOL> try : <EOL> compiled = compile ( expression , '<STR_LIT>' , '<STR_LIT>' ) <EOL> except : <EOL> exec ( expression , updated_globals , frame . f_locals ) <EOL> else : <EOL> result = eval ( compiled , updated_globals , frame . f_locals ) <EOL> if result is not None : <EOL> sys . stdout . write ( '<STR_LIT>' % ( result , ) ) <EOL> return <EOL> else : <EOL> result = None <EOL> try : <EOL> result = eval ( expression , updated_globals , frame . f_locals ) <EOL> except Exception : <EOL> s = StringIO ( ) <EOL> traceback . print_exc ( file = s ) <EOL> result = s . getvalue ( ) <EOL> try : <EOL> try : <EOL> etype , value , tb = sys . exc_info ( ) <EOL> result = value <EOL> finally : <EOL> etype = value = tb = None <EOL> except : <EOL> pass <EOL> return result <EOL> finally : <EOL> del updated_globals <EOL> del frame <EOL> def changeAttrExpression ( thread_id , frame_id , attr , expression ) : <EOL> '''<STR_LIT>''' <EOL> frame = findFrame ( thread_id , frame_id ) <EOL> try : <EOL> expression = expression . replace ( '<STR_LIT>' , '<STR_LIT:\n>' ) <EOL> if attr [ : <NUM_LIT:7> ] == "<STR_LIT>" : <EOL> attr = attr [ <NUM_LIT:8> : ] <EOL> if attr in frame . f_globals : <EOL> frame . f_globals [ attr ] = eval ( expression , frame . f_globals , frame . f_locals ) <EOL> else : <EOL> exec ( '<STR_LIT>' % ( attr , expression ) , frame . f_globals , frame . f_locals ) <EOL> except Exception : <EOL> traceback . print_exc ( ) </s>
<s> """<STR_LIT>""" <EOL> import sys <EOL> import maya . cmds as cmds <EOL> import amTools . utilities as utils <EOL> import amTools . utilities . ui as amui <EOL> utils . plugins . verifyPlugin ( '<STR_LIT>' , __file__ ) <EOL> kSetupOptionsWindow = '<STR_LIT>' <EOL> kToolName = '<STR_LIT>' <EOL> kVersionNumber = '<STR_LIT>' <EOL> kVersionDate = '<STR_LIT>' <EOL> def menuItem ( * args ) : <EOL> """<STR_LIT>""" <EOL> optionsWindow ( ) <EOL> def optionsWindow ( ) : <EOL> """<STR_LIT>""" <EOL> if cmds . window ( kSetupOptionsWindow , q = True , ex = True ) : <EOL> cmds . deleteUI ( kSetupOptionsWindow ) <EOL> mainWindow = cmds . window ( kSetupOptionsWindow , title = '<STR_LIT>' % kToolName , menuBar = True , wh = ( <NUM_LIT> , <NUM_LIT> ) ) <EOL> cmds . menu ( label = '<STR_LIT>' ) <EOL> amui . helpMenuItem ( kToolName , __file__ ) <EOL> amui . aboutMenuItem ( kToolName , kVersionNumber , kVersionDate ) <EOL> mainForm = cmds . formLayout ( nd = <NUM_LIT:100> ) <EOL> if_suffixName = cmds . textFieldGrp ( text = '<STR_LIT>' , label = '<STR_LIT>' ) <EOL> if_numberTwistJoints = cmds . intSliderGrp ( v = <NUM_LIT:3> , min = <NUM_LIT:1> , max = <NUM_LIT:10> , fmn = <NUM_LIT:1> , fmx = <NUM_LIT:100> , label = '<STR_LIT>' , field = True ) <EOL> cmds . formLayout ( mainForm , edit = True , attachForm = [ ( if_suffixName , '<STR_LIT:left>' , <NUM_LIT:30> ) , ( if_suffixName , '<STR_LIT>' , <NUM_LIT:5> ) ] , attachNone = [ ( if_suffixName , '<STR_LIT:right>' ) , ( if_suffixName , '<STR_LIT>' ) ] ) <EOL> cmds . formLayout ( mainForm , edit = True , attachForm = [ ( if_numberTwistJoints , '<STR_LIT:left>' , <NUM_LIT:30> ) ] , attachNone = [ ( if_numberTwistJoints , '<STR_LIT:right>' ) , ( if_numberTwistJoints , '<STR_LIT>' ) ] , attachControl = [ ( if_numberTwistJoints , '<STR_LIT>' , <NUM_LIT:5> , if_suffixName ) ] ) <EOL> constraintFrame = eval ( '<STR_LIT>' % amui . __frameAlignCenter__ ) <EOL> constraintForm = cmds . formLayout ( nd = <NUM_LIT:100> ) <EOL> pelvisText = '<STR_LIT>' <EOL> sel = cmds . ls ( sl = True , l = True , type = '<STR_LIT>' ) <EOL> if sel and len ( sel ) > <NUM_LIT:0> : <EOL> try : <EOL> hip = cmds . listRelatives ( sel [ <NUM_LIT:0> ] , p = True , f = True ) <EOL> pelvis = cmds . listRelatives ( hip [ <NUM_LIT:0> ] , p = True , f = True ) <EOL> pelvisText = pelvis [ <NUM_LIT:0> ] <EOL> except : pass <EOL> if_pelvis = cmds . textFieldGrp ( label = '<STR_LIT>' , tx = pelvisText ) <EOL> if_hipAimAxis = cmds . floatFieldGrp ( v1 = <NUM_LIT:1> , v2 = <NUM_LIT:0> , v3 = <NUM_LIT:0> , nf = <NUM_LIT:3> , pre = <NUM_LIT:4> , label = '<STR_LIT>' ) <EOL> if_hipFrontAxis = cmds . floatFieldGrp ( v1 = <NUM_LIT:0> , v2 = <NUM_LIT:0> , v3 = <NUM_LIT:1> , nf = <NUM_LIT:3> , pre = <NUM_LIT:4> , label = '<STR_LIT>' ) <EOL> if_pelvisAimAxis = cmds . floatFieldGrp ( v1 = <NUM_LIT:0> , v2 = <NUM_LIT:1> , v3 = <NUM_LIT:0> , nf = <NUM_LIT:3> , pre = <NUM_LIT:4> , label = '<STR_LIT>' ) <EOL> if_pelvisFrontAxis = cmds . floatFieldGrp ( v1 = <NUM_LIT:0> , v2 = <NUM_LIT:0> , v3 = <NUM_LIT:1> , nf = <NUM_LIT:3> , pre = <NUM_LIT:4> , label = '<STR_LIT>' ) <EOL> cmds . formLayout ( constraintForm , edit = True , attachForm = [ ( if_pelvis , '<STR_LIT:left>' , <NUM_LIT:30> ) , ( if_pelvis , '<STR_LIT>' , <NUM_LIT:5> ) ] , attachNone = [ ( if_pelvis , '<STR_LIT:right>' ) , ( if_pelvis , '<STR_LIT>' ) ] ) <EOL> cmds . formLayout ( constraintForm , edit = True , attachForm = [ ( if_hipAimAxis , '<STR_LIT:left>' , <NUM_LIT:30> ) ] , attachNone = [ ( if_hipAimAxis , '<STR_LIT:right>' ) , ( if_hipAimAxis , '<STR_LIT>' ) ] , attachControl = [ ( if_hipAimAxis , '<STR_LIT>' , <NUM_LIT:5> , if_pelvis ) ] ) <EOL> cmds . formLayout ( constraintForm , edit = True , attachForm = [ ( if_hipFrontAxis , '<STR_LIT:left>' , <NUM_LIT:30> ) ] , attachNone = [ ( if_hipFrontAxis , '<STR_LIT:right>' ) , ( if_hipFrontAxis , '<STR_LIT>' ) ] , attachControl = [ ( if_hipFrontAxis , '<STR_LIT>' , <NUM_LIT:5> , if_hipAimAxis ) ] ) <EOL> cmds . formLayout ( constraintForm , edit = True , attachForm = [ ( if_pelvisAimAxis , '<STR_LIT:left>' , <NUM_LIT:30> ) ] , attachNone = [ ( if_pelvisAimAxis , '<STR_LIT:right>' ) , ( if_pelvisAimAxis , '<STR_LIT>' ) ] , attachControl = [ ( if_pelvisAimAxis , '<STR_LIT>' , <NUM_LIT:5> , if_hipFrontAxis ) ] ) <EOL> cmds . formLayout ( constraintForm , edit = True , attachForm = [ ( if_pelvisFrontAxis , '<STR_LIT:left>' , <NUM_LIT:30> ) ] , attachNone = [ ( if_pelvisFrontAxis , '<STR_LIT:right>' ) , ( if_pelvisFrontAxis , '<STR_LIT>' ) ] , attachControl = [ ( if_pelvisFrontAxis , '<STR_LIT>' , <NUM_LIT:5> , if_pelvisAimAxis ) ] ) <EOL> cmds . setParent ( '<STR_LIT:..>' ) <EOL> cmds . setParent ( '<STR_LIT:..>' ) <EOL> cmds . formLayout ( mainForm , edit = True , attachPosition = [ ( constraintFrame , '<STR_LIT:left>' , - <NUM_LIT:1> , <NUM_LIT:0> ) , ( constraintFrame , '<STR_LIT:right>' , - <NUM_LIT:1> , <NUM_LIT:100> ) ] , attachControl = [ ( constraintFrame , '<STR_LIT>' , <NUM_LIT:5> , if_numberTwistJoints ) ] , attachNone = [ ( constraintFrame , '<STR_LIT>' ) ] ) <EOL> cmd_create = '<STR_LIT>' % ( <EOL> if_suffixName , <EOL> if_numberTwistJoints , <EOL> if_pelvis , <EOL> if_hipAimAxis , <EOL> if_hipFrontAxis , <EOL> if_pelvisAimAxis , <EOL> if_pelvisFrontAxis ) <EOL> utils . ui . threeButtonLayout ( mainForm , mainWindow , cmd_create ) <EOL> cmds . showWindow ( mainWindow ) <EOL> def doOptions ( input_suffix , input_numberTwistJoints , input_pelvis , input_hipAimAxis , input_hipFrontAxis , input_pelvisAimAxis , input_pelvisFrontAxis ) : <EOL> """<STR_LIT>""" <EOL> try : <EOL> selection = utils . dg . validateSelection ( type = '<STR_LIT>' , name = '<STR_LIT>' , min = <NUM_LIT:1> ) <EOL> suffix = cmds . textFieldGrp ( input_suffix , q = True , tx = True ) <EOL> utils . dg . validateAffix ( suffix ) <EOL> pelvis = cmds . textFieldGrp ( input_pelvis , q = True , tx = True ) <EOL> utils . dg . verifyNode ( pelvis ) <EOL> numberTwistJoints = cmds . intSliderGrp ( input_numberTwistJoints , q = True , v = True ) <EOL> newSelection = [ ] <EOL> for knee in selection : <EOL> hip = cmds . listRelatives ( knee , p = True , f = True ) <EOL> hipShort = cmds . listRelatives ( knee , p = True ) <EOL> newJoints = doSetup ( <EOL> hipShort [ <NUM_LIT:0> ] + suffix , <EOL> numberTwistJoints , <EOL> knee , <EOL> hip [ <NUM_LIT:0> ] , <EOL> pelvis , <EOL> cmds . floatFieldGrp ( input_hipAimAxis , q = True , v = True ) , <EOL> cmds . floatFieldGrp ( input_hipFrontAxis , q = True , v = True ) , <EOL> cmds . floatFieldGrp ( input_pelvisAimAxis , q = True , v = True ) , <EOL> cmds . floatFieldGrp ( input_pelvisFrontAxis , q = True , v = True ) ) <EOL> newSelection += newJoints <EOL> cmds . select ( newSelection ) <EOL> except : raise <EOL> def doSetup ( baseName , numberTwistJoints , knee , hip , pelvis , hipAimAxis , hipFrontAxis , pelvisAimAxis , pelvisFrontAxis ) : <EOL> """<STR_LIT>""" <EOL> try : <EOL> utils . dg . validateNodeName ( baseName ) <EOL> utils . dg . verifyNode ( knee ) <EOL> utils . dg . verifyNode ( hip ) <EOL> utils . dg . verifyNode ( pelvis ) <EOL> kneeTranslate = cmds . getAttr ( '<STR_LIT>' % knee ) [ <NUM_LIT:0> ] <EOL> bodySide = cmds . getAttr ( '<STR_LIT>' % hip ) <EOL> rotateOrder = cmds . getAttr ( '<STR_LIT>' % hip ) <EOL> twistJoints = [ ] <EOL> for i in range ( numberTwistJoints ) : <EOL> cmds . select ( cl = True ) <EOL> newJoint = cmds . joint ( name = '<STR_LIT>' % ( baseName , i + <NUM_LIT:1> ) ) <EOL> if i == <NUM_LIT:0> : <EOL> newJoint = cmds . parent ( newJoint , hip ) [ <NUM_LIT:0> ] <EOL> jointRadius = <NUM_LIT:1.0> <EOL> jointOrient = [ ] <EOL> if cmds . objectType ( hip , isType = '<STR_LIT>' ) : <EOL> jointRadius = cmds . getAttr ( '<STR_LIT>' % hip ) * <NUM_LIT:0.5> <EOL> cmds . setAttr ( '<STR_LIT>' % newJoint , jointRadius ) <EOL> cmds . setAttr ( '<STR_LIT>' % newJoint , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> ) <EOL> cmds . setAttr ( '<STR_LIT>' % newJoint , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> ) <EOL> cmds . am_hipConstraint ( <EOL> newJoint , <EOL> pelvisObject = pelvis , <EOL> hipObject = hip , <EOL> ha = hipAimAxis , <EOL> hf = hipFrontAxis , <EOL> pa = pelvisAimAxis , <EOL> pf = pelvisFrontAxis ) <EOL> else : <EOL> newJoint = cmds . parent ( newJoint , hip ) [ <NUM_LIT:0> ] <EOL> cmds . setAttr ( '<STR_LIT>' % newJoint , jointRadius ) <EOL> cmds . setAttr ( '<STR_LIT>' % newJoint , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> ) <EOL> pct = float ( i ) / float ( numberTwistJoints ) <EOL> cmds . setAttr ( '<STR_LIT>' % newJoint , kneeTranslate [ <NUM_LIT:0> ] * pct , kneeTranslate [ <NUM_LIT:1> ] * pct , kneeTranslate [ <NUM_LIT:2> ] * pct ) <EOL> orientConstraint = cmds . orientConstraint ( [ twistJoints [ <NUM_LIT:0> ] , hip , newJoint ] ) <EOL> targetWeights = cmds . orientConstraint ( q = True , weightAliasList = True ) <EOL> cmds . setAttr ( '<STR_LIT>' % ( orientConstraint [ <NUM_LIT:0> ] , targetWeights [ <NUM_LIT:0> ] ) , numberTwistJoints - i ) <EOL> cmds . setAttr ( '<STR_LIT>' % ( orientConstraint [ <NUM_LIT:0> ] , targetWeights [ <NUM_LIT:1> ] ) , i ) <EOL> cmds . setAttr ( '<STR_LIT>' % orientConstraint [ <NUM_LIT:0> ] , <NUM_LIT:1> ) <EOL> cmds . setAttr ( '<STR_LIT>' % newJoint , bodySide ) <EOL> cmds . setAttr ( '<STR_LIT>' % newJoint , <NUM_LIT> ) <EOL> cmds . setAttr ( '<STR_LIT>' % newJoint , '<STR_LIT>' % ( i + <NUM_LIT:1> ) , type = '<STR_LIT:string>' ) <EOL> cmds . setAttr ( '<STR_LIT>' % newJoint , rotateOrder ) <EOL> twistJoints . append ( newJoint ) <EOL> return twistJoints <EOL> except : raise </s>
<s> import sys <EOL> import os , glob , shutil <EOL> assert '<STR_LIT>' not in sys . modules or '<STR_LIT>' in os . environ , "<STR_LIT>" <EOL> os . environ [ '<STR_LIT>' ] = '<STR_LIT:True>' <EOL> pymel_root = os . path . dirname ( os . path . dirname ( sys . modules [ __name__ ] . __file__ ) ) <EOL> docsdir = os . path . join ( pymel_root , '<STR_LIT>' ) <EOL> stubdir = os . path . join ( pymel_root , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> useStubs = False <EOL> if useStubs : <EOL> sys . path . insert ( <NUM_LIT:0> , stubdir ) <EOL> import pymel <EOL> print pymel . __file__ <EOL> else : <EOL> import pymel <EOL> from pymel . core . uitypes import * <EOL> from pymel . core . nodetypes import * <EOL> version = pymel . __version__ . rsplit ( '<STR_LIT:.>' , <NUM_LIT:1> ) [ <NUM_LIT:0> ] <EOL> SOURCE = '<STR_LIT:source>' <EOL> BUILD = os . path . join ( '<STR_LIT>' , version ) <EOL> from pymel . internal . cmdcache import fixCodeExamples <EOL> def generate ( ) : <EOL> from sphinx . ext . autosummary . generate import main <EOL> os . chdir ( os . path . join ( docsdir ) ) <EOL> if os . path . exists ( BUILD ) : <EOL> print "<STR_LIT>" , os . path . join ( docsdir , BUILD ) <EOL> shutil . rmtree ( BUILD ) <EOL> os . chdir ( os . path . join ( docsdir , SOURCE ) ) <EOL> if os . path . exists ( '<STR_LIT>' ) : <EOL> print "<STR_LIT>" , os . path . join ( docsdir , SOURCE , '<STR_LIT>' ) <EOL> shutil . rmtree ( '<STR_LIT>' ) <EOL> main ( [ '<STR_LIT>' ] + '<STR_LIT>' . split ( ) ) <EOL> main ( [ '<STR_LIT>' ] + '<STR_LIT>' . split ( ) + glob . glob ( '<STR_LIT>' ) ) <EOL> def clean_build ( ) : <EOL> builddir = os . path . join ( docsdir , BUILD ) <EOL> if os . path . exists ( builddir ) : <EOL> print "<STR_LIT>" , builddir <EOL> shutil . rmtree ( builddir ) <EOL> def clean_generated ( ) : <EOL> gendir = os . path . join ( docsdir , SOURCE , '<STR_LIT>' ) <EOL> if os . path . exists ( gendir ) : <EOL> print "<STR_LIT>" , gendir <EOL> shutil . rmtree ( gendir ) <EOL> def build ( clean = True , ** kwargs ) : <EOL> from sphinx import main <EOL> os . chdir ( docsdir ) <EOL> if clean : <EOL> clean_generated ( ) <EOL> clean_build ( ) <EOL> opts = [ '<STR_LIT>' ] <EOL> opts += '<STR_LIT>' . split ( ) <EOL> if '<STR_LIT>' not in kwargs : <EOL> if os . name == '<STR_LIT>' : <EOL> dots = [ '<STR_LIT>' , '<STR_LIT>' ] <EOL> else : <EOL> dots = [ '<STR_LIT>' ] <EOL> dot = None <EOL> for d in dots : <EOL> if os . path . exists ( d ) : <EOL> dot = d <EOL> break <EOL> if not dot : <EOL> raise TypeError ( '<STR_LIT>' % '<STR_LIT:U+002CU+0020>' . join ( dots ) ) <EOL> kwargs [ '<STR_LIT>' ] = dot <EOL> for key , value in kwargs . iteritems ( ) : <EOL> opts . append ( '<STR_LIT>' ) <EOL> opts . append ( key . strip ( ) + '<STR_LIT:=>' + value . strip ( ) ) <EOL> opts . append ( SOURCE ) <EOL> opts . append ( BUILD ) <EOL> main ( opts ) </s>
<s> """<STR_LIT>""" <EOL> import re <EOL> import inspect <EOL> import pymel . internal . pmcmds as cmds <EOL> import pymel . internal . factories as _factories <EOL> _factories . createFunctions ( __name__ ) <EOL> class NameParser ( unicode ) : <EOL> PARENT_SEP = '<STR_LIT:|>' <EOL> def __new__ ( cls , strObj ) : <EOL> """<STR_LIT>""" <EOL> if cls is not NameParser : <EOL> newcls = cls <EOL> else : <EOL> newcls = _getParserClass ( strObj ) <EOL> self = super ( NameParser , cls ) . __new__ ( newcls , strObj ) <EOL> return self <EOL> def __repr__ ( self ) : <EOL> return u"<STR_LIT>" % ( self . __class__ . __name__ , super ( NameParser , self ) . __repr__ ( ) ) <EOL> def __getattr__ ( self , attr ) : <EOL> """<STR_LIT>""" <EOL> if attr . startswith ( '<STR_LIT>' ) and attr . endswith ( '<STR_LIT>' ) : <EOL> return super ( NameParser , self ) . __getattr__ ( attr ) <EOL> return AttributeName ( '<STR_LIT>' % ( self , attr ) ) <EOL> def stripNamespace ( self , levels = <NUM_LIT:0> ) : <EOL> """<STR_LIT>""" <EOL> nodes = [ ] <EOL> for dagElem in self . split ( '<STR_LIT:|>' ) : <EOL> attrSplit = dagElem . split ( '<STR_LIT:.>' ) <EOL> spaceSplit = attrSplit [ <NUM_LIT:0> ] . split ( '<STR_LIT::>' ) <EOL> if levels : <EOL> attrSplit [ <NUM_LIT:0> ] = '<STR_LIT::>' . join ( spaceSplit [ min ( len ( spaceSplit ) - <NUM_LIT:1> , levels ) : ] ) <EOL> else : <EOL> attrSplit [ <NUM_LIT:0> ] = spaceSplit [ - <NUM_LIT:1> ] <EOL> nodes . append ( '<STR_LIT:.>' . join ( attrSplit ) ) <EOL> return self . __class__ ( '<STR_LIT:|>' . join ( nodes ) ) <EOL> def stripGivenNamespace ( self , namespace , partial = True ) : <EOL> """<STR_LIT>""" <EOL> prefixSplit = namespace . rstrip ( '<STR_LIT::>' ) . split ( '<STR_LIT::>' ) <EOL> nodes = [ ] <EOL> for dagElem in self . split ( '<STR_LIT:|>' ) : <EOL> attrSplit = dagElem . split ( '<STR_LIT:.>' ) <EOL> spaceSplit = attrSplit [ <NUM_LIT:0> ] . split ( '<STR_LIT::>' ) <EOL> if partial : <EOL> for toStrip in prefixSplit : <EOL> if spaceSplit [ <NUM_LIT:0> ] == toStrip : <EOL> spaceSplit . pop ( <NUM_LIT:0> ) <EOL> else : <EOL> break <EOL> else : <EOL> if spaceSplit [ : len ( prefixSplit ) ] == prefixSplit : <EOL> spaceSplit = spaceSplit [ len ( prefixSplit ) : ] <EOL> attrSplit [ <NUM_LIT:0> ] = spaceSplit [ - <NUM_LIT:1> ] <EOL> attrSplit [ <NUM_LIT:0> ] = '<STR_LIT::>' . join ( spaceSplit ) <EOL> nodes . append ( '<STR_LIT:.>' . join ( attrSplit ) ) <EOL> return self . __class__ ( '<STR_LIT:|>' . join ( nodes ) ) <EOL> def swapNamespace ( self , prefix ) : <EOL> """<STR_LIT>""" <EOL> if not prefix . endswith ( '<STR_LIT::>' ) : <EOL> prefix += '<STR_LIT::>' <EOL> return self . __class__ . addPrefix ( self . stripNamespace ( ) , prefix ) <EOL> def namespaceList ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . lstrip ( '<STR_LIT:|>' ) . rstrip ( '<STR_LIT:|>' ) . split ( '<STR_LIT:|>' ) [ - <NUM_LIT:1> ] . split ( '<STR_LIT::>' ) [ : - <NUM_LIT:1> ] <EOL> def namespace ( self ) : <EOL> """<STR_LIT>""" <EOL> nsList = self . namespaceList ( ) <EOL> if nsList : <EOL> return '<STR_LIT::>' . join ( nsList ) + '<STR_LIT::>' <EOL> return '<STR_LIT>' <EOL> def addPrefix ( self , prefix ) : <EOL> '<STR_LIT>' <EOL> name = self <EOL> leadingSlash = False <EOL> if name . startswith ( '<STR_LIT:|>' ) : <EOL> name = name [ <NUM_LIT:1> : ] <EOL> leadingSlash = True <EOL> name = self . __class__ ( '<STR_LIT:|>' . join ( map ( lambda x : prefix + x , name . split ( '<STR_LIT:|>' ) ) ) ) <EOL> if leadingSlash : <EOL> name = '<STR_LIT:|>' + name <EOL> return self . __class__ ( name ) <EOL> def attr ( self , attr ) : <EOL> """<STR_LIT>""" <EOL> return AttributeName ( '<STR_LIT>' % ( self , attr ) ) <EOL> class AttributeName ( NameParser ) : <EOL> """<STR_LIT:U+0020>""" <EOL> attrItemReg = re . compile ( '<STR_LIT>' ) <EOL> def __init__ ( self , attrName ) : <EOL> if '<STR_LIT:.>' not in attrName : <EOL> raise TypeError , "<STR_LIT>" % self <EOL> self . __dict__ [ '<STR_LIT>' ] = <NUM_LIT:0> <EOL> def __getitem__ ( self , item ) : <EOL> return AttributeName ( '<STR_LIT>' % ( self , item ) ) <EOL> def __call__ ( self , * args , ** kwargs ) : <EOL> raise TypeError ( "<STR_LIT>" % ( repr ( self . node ( ) ) , self . plugAttr ( ) ) ) <EOL> def array ( self ) : <EOL> """<STR_LIT>""" <EOL> try : <EOL> return AttributeName ( AttributeName . attrItemReg . split ( self ) [ <NUM_LIT:0> ] ) <EOL> except : <EOL> raise TypeError , "<STR_LIT>" % self <EOL> def plugNode ( self ) : <EOL> """<STR_LIT>""" <EOL> return NameParser ( unicode ( self ) . split ( '<STR_LIT:.>' ) [ <NUM_LIT:0> ] ) <EOL> node = plugNode <EOL> def plugAttr ( self ) : <EOL> """<STR_LIT>""" <EOL> return '<STR_LIT:.>' . join ( unicode ( self ) . split ( '<STR_LIT:.>' ) [ <NUM_LIT:1> : ] ) <EOL> def lastPlugAttr ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . split ( '<STR_LIT:.>' ) [ - <NUM_LIT:1> ] <EOL> def nodeName ( self ) : <EOL> '<STR_LIT>' <EOL> return self . split ( '<STR_LIT:|>' ) [ - <NUM_LIT:1> ] <EOL> def item ( self , asSlice = False , asString = False ) : <EOL> try : <EOL> item = AttributeName . attrItemReg . search ( self ) . group ( <NUM_LIT:1> ) <EOL> if asString : <EOL> return "<STR_LIT>" % unicode ( item ) <EOL> val = item . split ( "<STR_LIT::>" ) <EOL> val = map ( int , val ) <EOL> if len ( val ) > <NUM_LIT:1> : <EOL> return asSlice and slice ( * val ) or val <EOL> return val [ <NUM_LIT:0> ] <EOL> except : return None <EOL> def getParent ( self , generations = <NUM_LIT:1> ) : <EOL> """<STR_LIT>""" <EOL> if generations == <NUM_LIT:0> : <EOL> return self <EOL> split = self . split ( '<STR_LIT:.>' ) <EOL> if - len ( split ) < generations < len ( split ) - <NUM_LIT:1> : <EOL> if generations < <NUM_LIT:0> : <EOL> splitIndex = <NUM_LIT:1> - generations <EOL> else : <EOL> splitIndex = - generations <EOL> try : <EOL> return AttributeName ( '<STR_LIT:.>' . join ( split [ : splitIndex ] ) ) <EOL> except : <EOL> pass <EOL> def addAttr ( self , ** kwargs ) : <EOL> kwargs [ '<STR_LIT>' ] = self . plugAttr ( ) <EOL> kwargs . pop ( '<STR_LIT>' , None ) <EOL> from pymel . core . general import addAttr <EOL> return addAttr ( self . node ( ) , ** kwargs ) <EOL> def setAttr ( self , * args , ** kwargs ) : <EOL> from pymel . core . general import setAttr <EOL> return setAttr ( self , * args , ** kwargs ) <EOL> set = setAttr <EOL> add = addAttr <EOL> def exists ( self ) : <EOL> node = self . plugNode ( ) <EOL> attr = self . plugAttr ( ) <EOL> if not node or not attr : <EOL> return False <EOL> if not cmds . objExists ( node ) : <EOL> return False <EOL> if attr in cmds . listAttr ( node , shortNames = <NUM_LIT:1> ) + cmds . listAttr ( node ) : <EOL> return True <EOL> return False <EOL> class DependNodeName ( NameParser ) : <EOL> def node ( self ) : <EOL> """<STR_LIT>""" <EOL> return self <EOL> def exists ( self , ** kwargs ) : <EOL> "<STR_LIT>" <EOL> return bool ( cmds . objExists ( self , ** kwargs ) ) <EOL> _numPartReg = re . compile ( '<STR_LIT>' ) <EOL> def stripNum ( self ) : <EOL> """<STR_LIT>""" <EOL> try : <EOL> return DependNodeName . _numPartReg . split ( self ) [ <NUM_LIT:0> ] <EOL> except IndexError : <EOL> return unicode ( self ) <EOL> def extractNum ( self ) : <EOL> """<STR_LIT>""" <EOL> try : <EOL> return DependNodeName . _numPartReg . split ( self ) [ <NUM_LIT:1> ] <EOL> except IndexError : <EOL> raise ValueError , "<STR_LIT>" % self <EOL> def nextUniqueName ( self ) : <EOL> """<STR_LIT>""" <EOL> try : <EOL> name = self . nextName ( ) <EOL> except ValueError : <EOL> name = self . __class__ ( self + '<STR_LIT:1>' ) <EOL> while name . exists ( ) : <EOL> name = name . nextName ( ) <EOL> return name <EOL> def nextName ( self ) : <EOL> """<STR_LIT>""" <EOL> groups = DependNodeName . _numPartReg . split ( self ) <EOL> if len ( groups ) > <NUM_LIT:1> : <EOL> num = groups [ <NUM_LIT:1> ] <EOL> formatStr = '<STR_LIT>' + unicode ( len ( num ) ) + '<STR_LIT:d>' <EOL> return self . __class__ ( formatStr % ( groups [ <NUM_LIT:0> ] , ( int ( num ) + <NUM_LIT:1> ) ) ) <EOL> else : <EOL> raise ValueError , "<STR_LIT>" % self <EOL> def prevName ( self ) : <EOL> """<STR_LIT>""" <EOL> groups = DependNodeName . _numPartReg . split ( self ) <EOL> if len ( groups ) > <NUM_LIT:1> : <EOL> num = groups [ <NUM_LIT:1> ] <EOL> formatStr = '<STR_LIT>' + unicode ( len ( num ) ) + '<STR_LIT:d>' <EOL> return self . __class__ ( formatStr % ( groups [ <NUM_LIT:0> ] , ( int ( num ) - <NUM_LIT:1> ) ) ) <EOL> else : <EOL> raise ValueError , "<STR_LIT>" % self <EOL> class DagNodeName ( DependNodeName ) : <EOL> def root ( self ) : <EOL> '<STR_LIT>' <EOL> return DagNodeName ( '<STR_LIT:|>' + self . longName ( ) [ <NUM_LIT:1> : ] . split ( '<STR_LIT:|>' ) [ <NUM_LIT:0> ] ) <EOL> def getRoot ( self ) : <EOL> """<STR_LIT>""" <EOL> par = None <EOL> cur = self <EOL> while <NUM_LIT:1> : <EOL> par = cur . getParent ( ) <EOL> if not par : <EOL> break <EOL> cur = par <EOL> return cur <EOL> def firstParent ( self ) : <EOL> '<STR_LIT>' <EOL> return DagNodeName ( '<STR_LIT:|>' . join ( self . split ( '<STR_LIT:|>' ) [ : - <NUM_LIT:1> ] ) ) <EOL> def getParent ( self , generations = <NUM_LIT:1> ) : <EOL> """<STR_LIT>""" <EOL> if generations == <NUM_LIT:0> : <EOL> return self <EOL> split = self . split ( '<STR_LIT:|>' ) <EOL> if - len ( split ) <= generations < len ( split ) : <EOL> try : <EOL> return DagNodeName ( '<STR_LIT:|>' . join ( split [ : - generations ] ) ) <EOL> except : <EOL> pass <EOL> def nodeName ( self ) : <EOL> '<STR_LIT>' <EOL> return self . split ( '<STR_LIT:|>' ) [ - <NUM_LIT:1> ] <EOL> def _getParserClass ( strObj ) : <EOL> mro = set ( [ cls . __name__ for cls in inspect . getmro ( type ( strObj ) ) ] ) <EOL> if '<STR_LIT>' in mro : <EOL> if '<STR_LIT>' in mro : <EOL> newcls = DagNodeName <EOL> elif '<STR_LIT>' in mro : <EOL> newcls = AttributeName <EOL> else : <EOL> newcls = DependNodeName <EOL> else : <EOL> strObj = unicode ( strObj ) <EOL> if '<STR_LIT:.>' in strObj : <EOL> newcls = AttributeName <EOL> elif '<STR_LIT:|>' in strObj : <EOL> newcls = DagNodeName <EOL> else : <EOL> newcls = DependNodeName <EOL> return newcls </s>
<s> """<STR_LIT>""" <EOL> class Options ( dict ) : <EOL> """<STR_LIT>""" <EOL> def __setattr__ ( self , name , value ) : <EOL> if hasattr ( self , name ) : <EOL> super ( self , Options ) . __setattr__ ( name , value ) <EOL> else : <EOL> self [ name ] = value <EOL> def main ( ) : <EOL> from optparse import OptionParser <EOL> import sys <EOL> usage = """<STR_LIT>""" <EOL> parser = OptionParser ( usage = usage ) <EOL> opts = Options ( ) <EOL> parser . add_option ( "<STR_LIT>" , "<STR_LIT>" , <EOL> help = """<STR_LIT>""" ) <EOL> parser . add_option ( "<STR_LIT>" , "<STR_LIT>" , <EOL> help = "<STR_LIT>" ) <EOL> parser . add_option ( "<STR_LIT:-c>" , "<STR_LIT>" , action = "<STR_LIT:store_true>" , <EOL> help = """<STR_LIT>""" ) <EOL> parser . add_option ( "<STR_LIT>" , "<STR_LIT>" , type = "<STR_LIT:int>" , <EOL> help = """<STR_LIT>""" ) <EOL> parser . add_option ( "<STR_LIT>" , "<STR_LIT>" , action = "<STR_LIT:store_true>" , <EOL> help = """<STR_LIT>""" ) <EOL> parser . add_option ( "<STR_LIT>" , "<STR_LIT>" , action = "<STR_LIT:store_true>" , <EOL> help = """<STR_LIT>""" ) <EOL> parser . add_option ( "<STR_LIT>" , "<STR_LIT>" , <EOL> help = """<STR_LIT>""" ) <EOL> parser . add_option ( "<STR_LIT>" , "<STR_LIT>" , action = "<STR_LIT:store_true>" , <EOL> help = """<STR_LIT>""" ) <EOL> parser . add_option ( "<STR_LIT>" , "<STR_LIT>" , <EOL> help = """<STR_LIT>""" ) <EOL> parser . set_defaults ( outputDir = None , <EOL> pymelNamespace = '<STR_LIT>' , forceCompatibility = False , <EOL> verbosity = <NUM_LIT:0> , test = False , <EOL> recurse = False , exclude = ( ) , melPathOnly = False ) <EOL> options , args = parser . parse_args ( values = opts ) <EOL> if len ( args ) < <NUM_LIT:1> : <EOL> print "<STR_LIT>" <EOL> parser . print_help ( ) <EOL> return <EOL> elif len ( args ) > <NUM_LIT:2> : <EOL> print "<STR_LIT>" <EOL> parser . print_help ( ) <EOL> return <EOL> exclude = options . get ( '<STR_LIT>' , False ) <EOL> if exclude : <EOL> options [ '<STR_LIT>' ] = exclude . split ( '<STR_LIT:U+002C>' ) <EOL> from pymel . tools . mel2py import mel2py <EOL> if args and '<STR_LIT:U+002C>' in args [ <NUM_LIT:0> ] : <EOL> args [ <NUM_LIT:0> ] = args [ <NUM_LIT:0> ] . split ( '<STR_LIT:U+002C>' ) <EOL> mel2py ( * args , ** options ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> main ( ) </s>
<s> import sys <EOL> import os <EOL> import types <EOL> import doctest <EOL> import modulefinder <EOL> import traceback <EOL> import inspect <EOL> from StringIO import StringIO <EOL> from unittest import * <EOL> import pymel . util <EOL> from warnings import warn <EOL> TEST_MAIN_FUNC_NAME = "<STR_LIT>" <EOL> SUITE_FUNC_NAME = "<STR_LIT>" <EOL> def doctestFriendly ( func ) : <EOL> """<STR_LIT>""" <EOL> def prepForDoctest ( * args , ** kwargs ) : <EOL> result = None <EOL> if ( sys . displayhook != sys . __displayhook__ <EOL> or sys . stdout != sys . __stdout__ ) : <EOL> save_displayhook = sys . displayhook <EOL> try : <EOL> savedMaster = doctest . master <EOL> except AttributeError : <EOL> savedMaster = None <EOL> try : <EOL> sys . displayhook = sys . __displayhook__ <EOL> doctest . master = None <EOL> try : <EOL> result = func ( * args , ** kwargs ) <EOL> except : <EOL> raise <EOL> finally : <EOL> sys . displayhook = save_displayhook <EOL> doctest . master = savedMaster <EOL> else : <EOL> result = func ( * args , ** kwargs ) <EOL> return result <EOL> return prepForDoctest <EOL> @ doctestFriendly <EOL> def doctestobj ( * args , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> return doctest . run_docstring_examples ( * args , ** kwargs ) <EOL> @ doctestFriendly <EOL> def doctestmod ( * args , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> return doctest . testmod ( * args , ** kwargs ) <EOL> class MayaTestRunner ( TextTestRunner ) : <EOL> def __init__ ( self , stream = sys . stdout , descriptions = True , verbosity = <NUM_LIT:2> ) : <EOL> super ( MayaTestRunner , self ) . __init__ ( stream = stream , <EOL> descriptions = descriptions , <EOL> verbosity = verbosity ) <EOL> @ doctestFriendly <EOL> def run ( self , * args , ** kwargs ) : <EOL> super ( MayaTestRunner , self ) . run ( * args , ** kwargs ) <EOL> def addFuncToModule ( func , module ) : <EOL> if not hasattr ( module , func . __name__ ) : <EOL> setattr ( module , func . __name__ , func ) <EOL> def startsWithDoubleUnderscore ( testcase ) : <EOL> return testcase . __name__ . startswith ( "<STR_LIT>" ) <EOL> def setupUnittestModule ( moduleName , suiteFuncName = SUITE_FUNC_NAME , testMainName = TEST_MAIN_FUNC_NAME , <EOL> filterTestCases = startsWithDoubleUnderscore ) : <EOL> """<STR_LIT>""" <EOL> module = sys . modules [ moduleName ] <EOL> def theSuite ( ) : <EOL> return findTestCases ( module ) <EOL> theSuite . __name__ = suiteFuncName <EOL> def test_main ( ) : <EOL> return MayaTestRunner ( ) . run ( theSuite ( ) ) <EOL> test_main . __name__ = testMainName <EOL> addFuncToModule ( theSuite , module ) <EOL> addFuncToModule ( test_main , module ) <EOL> for name in dir ( module ) : <EOL> obj = getattr ( module , name ) <EOL> if ( isinstance ( obj , ( type , types . ClassType ) ) and <EOL> issubclass ( obj , TestCase ) and <EOL> filterTestCases and <EOL> filterTestCases ( obj ) ) : <EOL> delattr ( module , name ) <EOL> if moduleName == '<STR_LIT:__main__>' : <EOL> test_main ( ) <EOL> class TestCaseExtended ( TestCase ) : <EOL> DO_NOT_LOAD = False <EOL> def assertNoError ( self , function , * args , ** kwargs ) : <EOL> try : <EOL> function ( * args , ** kwargs ) <EOL> except : <EOL> self . fail ( "<STR_LIT>" % traceback . format_exc ( ) ) <EOL> def assertIteration ( self , iterable , expectedResults , <EOL> orderMatters = True , <EOL> onlyMembershipMatters = False ) : <EOL> """<STR_LIT>""" <EOL> expectedResults = list ( expectedResults ) <EOL> if onlyMembershipMatters : <EOL> unmatchedResults = set ( expectedResults ) <EOL> else : <EOL> unmatchedResults = list ( expectedResults ) <EOL> for item in iterable : <EOL> notInExpectedResultsFormat = "<STR_LIT>" <EOL> if onlyMembershipMatters : <EOL> self . assertTrue ( item in expectedResults , <EOL> notInExpectedResultsFormat % ( iterable , item , "<STR_LIT>" , expectedResults ) ) <EOL> else : <EOL> self . assertTrue ( item in unmatchedResults , <EOL> notInExpectedResultsFormat % ( iterable , item , "<STR_LIT>" , unmatchedResults ) ) <EOL> if orderMatters : <EOL> self . assertEqual ( item , unmatchedResults [ <NUM_LIT:0> ] , "<STR_LIT>" % ( item , unmatchedResults [ <NUM_LIT:0> ] ) ) <EOL> if item in unmatchedResults : <EOL> unmatchedResults . remove ( item ) <EOL> message = "<STR_LIT>" % ( iterable , [ str ( x ) for x in unmatchedResults ] ) <EOL> self . assertEqual ( len ( unmatchedResults ) , <NUM_LIT:0> , message ) <EOL> def assertVectorsEqual ( self , v1 , v2 , places = <NUM_LIT:5> ) : <EOL> for p1 , p2 in zip ( v1 , v2 ) : <EOL> try : <EOL> self . assertAlmostEqual ( p1 , p2 , places = places ) <EOL> except AssertionError : <EOL> self . fail ( '<STR_LIT>' % ( v1 , v2 , places ) ) <EOL> def permutations ( sequence , length = None ) : <EOL> """<STR_LIT>""" <EOL> if length is None : <EOL> length = len ( sequence ) <EOL> elif length < <NUM_LIT:0> or length > len ( sequence ) : <EOL> raise ValueError ( "<STR_LIT>" % ( length , sequence ) ) <EOL> if length == <NUM_LIT:0> : yield [ ] <EOL> else : <EOL> for i in xrange ( len ( sequence ) ) : <EOL> for subpermutation in permutations ( sequence [ : i ] + sequence [ i + <NUM_LIT:1> : ] , length - <NUM_LIT:1> ) : <EOL> yield [ sequence [ i ] ] + subpermutation <EOL> def isOneToOne ( dict ) : <EOL> """<STR_LIT>""" <EOL> return len ( set ( dict . itervalues ( ) ) ) == len ( dict ) <EOL> def isEquivalenceRelation ( inputs , outputs , dict ) : <EOL> """<STR_LIT>""" <EOL> inputs = set ( inputs ) <EOL> output = set ( outputs ) <EOL> if len ( inputs ) == len ( outputs ) and set ( dict . iterkeys ( ) ) == inputs and set ( dict . itervalues ( ) ) == outputs : <EOL> return True <EOL> else : <EOL> return False <EOL> class SuiteFromModule ( TestSuite ) : <EOL> def __init__ ( self , module , testImport = True ) : <EOL> """<STR_LIT>""" <EOL> super ( SuiteFromModule , self ) . __init__ ( ) <EOL> self . _importError = None <EOL> if isinstance ( module , basestring ) : <EOL> self . moduleName = module <EOL> self . module = self . _importTestModule ( ) <EOL> elif isinstance ( module , types . ModuleType ) : <EOL> self . moduleName = module . __name__ <EOL> self . module = module <EOL> if self . _importError is None and self . module : <EOL> try : <EOL> importedSuite = self . _importSuite ( ) <EOL> if not importedSuite . countTestCases ( ) : <EOL> self . _importError = "<STR_LIT>" % ( self . module . __name__ , self . suiteFuncName ) <EOL> except : <EOL> self . _importError = traceback . format_exc ( ) <EOL> if not self . _importError : <EOL> self . addTest ( importedSuite ) <EOL> if testImport : <EOL> self . addTest ( self . _makeImportTestCase ( ) ) <EOL> def _importTestModule ( self ) : <EOL> module = None <EOL> try : <EOL> module = __import__ ( self . moduleName ) <EOL> packagePath = self . moduleName . split ( '<STR_LIT:.>' ) <EOL> for subModule in packagePath [ <NUM_LIT:1> : ] : <EOL> module = getattr ( module , subModule ) <EOL> except : <EOL> self . _importError = traceback . format_exc ( ) <EOL> module = None <EOL> return module <EOL> def _importSuite ( self ) : <EOL> return TestSuite ( ) <EOL> def _makeImportTestCase ( suite_self ) : <EOL> class TestSuiteImport ( TestCaseExtended ) : <EOL> def runTest ( testCase_self ) : <EOL> testCase_self . assertTrue ( suite_self . _importError is None , "<STR_LIT>" % ( suite_self . moduleName , suite_self . _importError ) ) <EOL> runTest . __doc__ = """<STR_LIT>""" % ( suite_self . __class__ . __name__ , suite_self . moduleName ) <EOL> return TestSuiteImport ( ) <EOL> class UnittestSuiteFromModule ( SuiteFromModule ) : <EOL> def __init__ ( self , moduleName , suiteFuncName = SUITE_FUNC_NAME , ** kwargs ) : <EOL> self . suiteFuncName = suiteFuncName <EOL> super ( UnittestSuiteFromModule , self ) . __init__ ( moduleName , ** kwargs ) <EOL> def _importSuite ( self ) : <EOL> theSuite = None <EOL> suiteFunc = getattr ( self . module , self . suiteFuncName , None ) <EOL> if isinstance ( suiteFunc , TestSuite ) : <EOL> theSuite = suiteFunc <EOL> elif callable ( suiteFunc ) : <EOL> theSuite = suiteFunc ( ) <EOL> if not theSuite : <EOL> theSuite = findTestCases ( self . module ) <EOL> if not theSuite : <EOL> theSuite = TestSuite ( ) <EOL> return theSuite <EOL> class DoctestSuiteFromModule ( SuiteFromModule ) : <EOL> def __init__ ( self , moduleName , packageRecurse = False , alreadyRecursed = None , ** kwargs ) : <EOL> if alreadyRecursed is None : <EOL> alreadyRecursed = [ ] <EOL> self . alreadyRecursed = alreadyRecursed <EOL> self . packageRecurse = packageRecurse <EOL> super ( DoctestSuiteFromModule , self ) . __init__ ( moduleName , ** kwargs ) <EOL> def _importSuite ( self ) : <EOL> theSuite = None <EOL> if self . module not in self . alreadyRecursed : <EOL> self . alreadyRecursed . append ( self . module ) <EOL> try : <EOL> theSuite = doctest . DocTestSuite ( self . module ) <EOL> except ValueError : <EOL> theSuite = None <EOL> if self . packageRecurse : <EOL> for path in getattr ( self . module , '<STR_LIT>' , [ ] ) : <EOL> for name in os . listdir ( path ) : <EOL> newPath = os . path . join ( path , name ) <EOL> basename , ext = os . path . splitext ( name ) <EOL> if ( ( os . path . isfile ( newPath ) and ext in ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) and basename != '<STR_LIT>' ) <EOL> or ( os . path . isdir ( newPath ) and os . path . isfile ( os . path . join ( newPath , '<STR_LIT>' ) ) ) ) : <EOL> newModuleName = self . moduleName + "<STR_LIT:.>" + basename <EOL> newSuite = DoctestSuiteFromModule ( newModuleName , testImport = False , packageRecurse = True , alreadyRecursed = self . alreadyRecursed ) <EOL> if newSuite . countTestCases ( ) : <EOL> theSuite . addTest ( newSuite ) <EOL> if not theSuite : <EOL> theSuite = TestSuite ( ) <EOL> return theSuite <EOL> def setCompare ( iter1 , iter2 ) : <EOL> """<STR_LIT>""" <EOL> s1 = set ( iter1 ) <EOL> s2 = set ( iter2 ) <EOL> intersect = s1 & s2 <EOL> return s1 - intersect , intersect , s2 - intersect <EOL> def suite ( ) : <EOL> theSuite = TestSuite ( ) <EOL> unittestMods = findUnittestModules ( ) <EOL> for testMod in unittestMods : <EOL> theSuite . addTest ( UnittestSuiteFromModule ( testMod ) ) <EOL> doctests = DoctestSuiteFromModule ( '<STR_LIT>' , packageRecurse = True ) <EOL> if doctests . countTestCases ( ) : <EOL> theSuite . addTest ( doctests ) <EOL> return theSuite </s>
<s> import sys <EOL> import unittest <EOL> import maya . cmds as cmds <EOL> import pymel . core as pm <EOL> import pymel . core . uitypes as ui <EOL> import pymel . core . windows as windows <EOL> class TestMenu ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> cmds . setParent ( None , menu = <NUM_LIT:1> ) <EOL> self . win = cmds . window ( ) <EOL> def tearDown ( self ) : <EOL> cmds . deleteUI ( self . win , window = True ) <EOL> def testOptionMenuAsMenu ( self ) : <EOL> cmds . formLayout ( ) <EOL> om = ui . OptionMenu ( '<STR_LIT>' , create = True ) <EOL> cmds . menuItem ( label = '<STR_LIT>' ) <EOL> self . assertEqual ( windows . menu ( om , q = <NUM_LIT:1> , numberOfItems = <NUM_LIT:1> ) , <NUM_LIT:1> ) <EOL> self . assertEqual ( windows . menu ( om . name ( ) , q = <NUM_LIT:1> , numberOfItems = <NUM_LIT:1> ) , <NUM_LIT:1> ) <EOL> self . assertEqual ( windows . menu ( om . shortName ( ) , q = <NUM_LIT:1> , numberOfItems = <NUM_LIT:1> ) , <NUM_LIT:1> ) <EOL> ui . Menu ( om ) <EOL> ui . Menu ( om . name ( ) ) <EOL> ui . Menu ( om . shortName ( ) ) <EOL> if not pm . about ( batch = <NUM_LIT:1> ) : <EOL> for key , obj in globals ( ) . items ( ) : <EOL> if isinstance ( obj , unittest . TestCase ) : <EOL> del globals ( ) [ key ] <EOL> obj . __name__ = '<STR_LIT>' + obj . __name__ </s>
<s> import xml . sax . handler <EOL> import tempfile <EOL> import getopt <EOL> import os <EOL> import urllib2 <EOL> import xml . etree . ElementTree as ElementTree <EOL> import sys <EOL> import webbrowser <EOL> import xml <EOL> import maya <EOL> class Request : <EOL> def __init__ ( self ) : <EOL> pass <EOL> def setPreview ( self , preview ) : <EOL> pass <EOL> def setToNativeVersion ( self ) : <EOL> pass <EOL> def setVersion ( self , line , release , master , build ) : <EOL> pass <EOL> def url ( self ) : <EOL> pass <EOL> class ParsingErrorHandler ( xml . sax . handler . ErrorHandler ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , url ) : <EOL> pass <EOL> def error ( self , exception ) : <EOL> pass <EOL> def fatalError ( self , exception ) : <EOL> pass <EOL> def format ( self , exception ) : <EOL> pass <EOL> class HtmlUpdate : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , title , response ) : <EOL> pass <EOL> def process ( self , html ) : <EOL> pass <EOL> class HtmlTemplateUpdate : <EOL> def __init__ ( self ) : <EOL> pass <EOL> def process ( self , html ) : <EOL> pass <EOL> def processSingle ( self , html ) : <EOL> pass <EOL> def processSingleNone ( self , html ) : <EOL> pass <EOL> def processSingleSome ( self , html ) : <EOL> pass <EOL> class Response : <EOL> def __init__ ( self , request , doRefresh = True ) : <EOL> pass <EOL> def numberOfUpdates ( self , forceRefresh = False ) : <EOL> pass <EOL> def refresh ( self , setTimeout = None ) : <EOL> pass <EOL> def resetRequest ( self , request ) : <EOL> pass <EOL> def result ( self , forceRefresh = False ) : <EOL> pass <EOL> def Update ( response , output ) : <EOL> pass <EOL> def downloadURL ( url ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def Download ( response , output ) : <EOL> pass <EOL> def usage ( ) : <EOL> pass </s>
<s> import maya . OpenMaya as OpenMaya <EOL> import math <EOL> import os <EOL> import maya . cmds as cmds <EOL> import xml . etree . ElementTree as ET <EOL> import sys <EOL> import xml <EOL> import string <EOL> import maya <EOL> class HIKRetargeter : <EOL> """<STR_LIT>""" <EOL> def __del__ ( self ) : <EOL> pass <EOL> def __init__ ( self , HIKDestination = None ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def connect ( self ) : <EOL> pass <EOL> def destinationAttrs ( self ) : <EOL> pass <EOL> def disconnect ( self ) : <EOL> pass <EOL> def fromGraph ( self , node ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def fromXML ( self , root , dest , file = None ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def fromstring ( self , text , dest = None ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def getDestination ( self ) : <EOL> pass <EOL> def getMapping ( self , bodyPart , type , linkNum = <NUM_LIT:0> ) : <EOL> pass <EOL> def getMappingIds ( self ) : <EOL> pass <EOL> def getMappingKey ( self , bodyPart , type , linkNum = <NUM_LIT:0> ) : <EOL> pass <EOL> def getSource ( self ) : <EOL> pass <EOL> def isConnected ( self ) : <EOL> pass <EOL> def read ( self , file , dest ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def removeMapping ( self , bodyPart , type , linkNum = <NUM_LIT:0> ) : <EOL> pass <EOL> def setDestination ( self , destination ) : <EOL> pass <EOL> def setMapping ( self , bodyPart , destRig , type , retargeter , id , linkNum = <NUM_LIT:0> ) : <EOL> pass <EOL> def toGraph ( self ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def toXML ( self ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def tostring ( self , indent = False ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def write ( self , file ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def createDefaultMapping ( source , dest , bodyPart , destRig , type , id , linkNum = <NUM_LIT:0> ) : <EOL> pass <EOL> class DefaultRetargeter : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , matSource = None , destRig = None , destSkel = None , type = None , id = - <NUM_LIT:1> , body = None ) : <EOL> pass <EOL> def calculateOffsets ( self , destination , destinationSkel , type ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def delRetargeter ( self , src ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def destinationAttrs ( self ) : <EOL> pass <EOL> def doRetarget ( self , src ) : <EOL> pass <EOL> def fromDictionary ( self , vals ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def fromGraph ( self , node ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def getDestinationRig ( self ) : <EOL> pass <EOL> def getId ( self ) : <EOL> pass <EOL> def getOffset ( self ) : <EOL> pass <EOL> def getType ( self ) : <EOL> pass <EOL> def setOffset ( self , x , y , z ) : <EOL> pass <EOL> def setUpRot ( self , matrixSource , destination , destinationSkel = None , offset = None , destinationSkelParent = None ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def setUpTrans ( self , matrixSource , destination , destSkel = None , offset = None , sourceRoot = None , destRoot = None ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def toDictionary ( self ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def toGraph ( self , src ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> class RetargUtils : <EOL> def addAttrConnection ( attr1 , attr2 ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def addAttrFunc ( attr1 , val ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def addVecConnection ( attr1 , attr2 ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def addVecFunc ( attr1 , val ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def addVecFuncGetNode ( attr1 , val ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def connectPairBlendCompound ( src , dest , attr ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def convertRad2Deg ( rot ) : <EOL> pass <EOL> def decomposeRelative ( sourceMat , sourceRootMat , newRootMat ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def disconnectIfConnected ( src , dest ) : <EOL> pass <EOL> def disconnectPairBlendCompound ( src , dest , attr ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def eulerToQuat ( euler , rotateOrder = None ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def eulerValToComposeMat ( euler , rotateOrder ) : <EOL> pass <EOL> def getAttr ( plug ) : <EOL> pass <EOL> def getJointOrient ( nodeName ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def getMatrix ( node , matrixString ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def getWorldPositionUsingRP ( nodeName ) : <EOL> pass <EOL> def hasAnimCurves ( node ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def hasPairBlend ( node ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def hookUpDecomposeToMatrix ( matrixSource ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def inverseQuat ( quat ) : <EOL> pass <EOL> def isAnimCurve ( object ) : <EOL> pass <EOL> def isLocked ( node , attr ) : <EOL> pass <EOL> def listAnimCurves ( node , attrs ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def loadPlugin ( name ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def matrixToList ( matrixVal ) : <EOL> pass <EOL> def matrixToQuat ( matrixAttr ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def multConstMat ( mVal , mVal2 ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def multMatrix ( matrixAttr , matrixAttr1 ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def multMatrixByConstMat ( matrixVal , pre , matrixAttr ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def multMatrixByConstMatNode ( matrixVal , pre , matrixAttr ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def multPointByMatrix ( matrixAttr , pointAttr ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def multQuatConnection ( quat1 , quat2 ) : <EOL> pass <EOL> def nameToNode ( name ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def parkAnimCurves ( node ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def quatToEuler ( quat , rotateOrder ) : <EOL> pass <EOL> def quatToMatrix ( quatAttr ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def removeAllConnections ( nodes ) : <EOL> pass <EOL> def setAttr ( plug , val ) : <EOL> pass <EOL> def setAttrIfNotNone ( attr , val ) : <EOL> pass <EOL> def subVecConnection ( attr1 , attr2 ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def subVecFunc ( attr1 , val ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def unparkAnimCurves ( node ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def walkGraph ( startAttr , endAttr ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> class MappedRetargeter : <EOL> def __init__ ( self ) : <EOL> pass <EOL> def fromDictionary ( self , vals ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def getRetargeter ( self ) : <EOL> pass <EOL> def setRetargeter ( self , retargeter ) : <EOL> pass <EOL> def toDictionary ( self ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> class PivotRetargeter ( DefaultRetargeter ) : <EOL> pass </s>
<s> """<STR_LIT>""" <EOL> from maya . mel . melutils import * <EOL> def eval ( * args , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> pass </s>
<s> import pymel . internal . factories as _factories <EOL> def ShowTexturePlacements ( * args , ** kwargs ) : <EOL> pass <EOL> def HideDeformingGeometry ( * args , ** kwargs ) : <EOL> pass <EOL> def ShareOneBrush ( * args , ** kwargs ) : <EOL> pass <EOL> def FreezeTransformations ( * args , ** kwargs ) : <EOL> pass <EOL> def MoveSewUVs ( * args , ** kwargs ) : <EOL> pass <EOL> def ShowStrokeControlCurves ( * args , ** kwargs ) : <EOL> pass <EOL> def RepeatLastActionAtMousePosition ( * args , ** kwargs ) : <EOL> pass <EOL> def PolySpinEdgeForward ( * args , ** kwargs ) : <EOL> pass <EOL> def AddInfluence ( * args , ** kwargs ) : <EOL> pass <EOL> def PolyRemoveAllCrease ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateAmbientLight ( * args , ** kwargs ) : <EOL> pass <EOL> def HyperGraphPanelUndoViewChange ( * args , ** kwargs ) : <EOL> pass <EOL> def PaintFluidsTool ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectLightsShadowingObject ( * args , ** kwargs ) : <EOL> pass <EOL> def OutTangentAuto ( * args , ** kwargs ) : <EOL> pass <EOL> def CutUVs ( * args , ** kwargs ) : <EOL> pass <EOL> def NodeEditorWindow ( * args , ** kwargs ) : <EOL> pass <EOL> def RenameAttribute ( * args , ** kwargs ) : <EOL> pass <EOL> def ShowManipulatorTool ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateEmitterOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ReducePolygon ( * args , ** kwargs ) : <EOL> pass <EOL> def ShowNURBSCurves ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateCharacter ( * args , ** kwargs ) : <EOL> pass <EOL> def EditOversamplingForCacheSettings ( * args , ** kwargs ) : <EOL> pass <EOL> def geometryMergeCacheOpt ( * args , ** kwargs ) : <EOL> pass <EOL> def SetVertexNormalOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectContiguousEdges ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleHikDetails ( * args , ** kwargs ) : <EOL> pass <EOL> def Newton ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectAllJoints ( * args , ** kwargs ) : <EOL> pass <EOL> def AddDivisions ( * args , ** kwargs ) : <EOL> pass <EOL> def UpdateCurrentScene3dsMax ( * args , ** kwargs ) : <EOL> pass <EOL> def WireToolOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateSubdivSurface ( * args , ** kwargs ) : <EOL> pass <EOL> def SmoothProxyOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def NEmitFromObjectOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def RadialOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def AssignTemplateOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def WhatsNewStartupDialogOff ( * args , ** kwargs ) : <EOL> pass <EOL> def MakeCollideOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleOriginAxis ( * args , ** kwargs ) : <EOL> pass <EOL> def InitialFluidStatesOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def NodeEditorGraphClearGraph ( * args , ** kwargs ) : <EOL> pass <EOL> def DisableMemoryCaching ( * args , ** kwargs ) : <EOL> pass <EOL> def HIKSetFullBodyKey ( * args , ** kwargs ) : <EOL> pass <EOL> def NURBSSmoothnessFine ( * args , ** kwargs ) : <EOL> pass <EOL> def AssetEditor ( * args , ** kwargs ) : <EOL> pass <EOL> def PaintGrid ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleModelingToolkit ( * args , ** kwargs ) : <EOL> pass <EOL> def PaintOperationMarkingMenuPress ( * args , ** kwargs ) : <EOL> pass <EOL> def SculptSubdivsToolOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def NURBSSmoothnessMediumOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def NodeEditorHideAttributes ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateSculptDeformerOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ArtPaintBlendShapeWeightsToolOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def SubdivProxy ( * args , ** kwargs ) : <EOL> pass <EOL> def PublishAttributes ( * args , ** kwargs ) : <EOL> pass <EOL> def UniversalManipOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def Art3dPaintTool ( * args , ** kwargs ) : <EOL> pass <EOL> def PrelightPolygon ( * args , ** kwargs ) : <EOL> pass <EOL> def ExportOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ThreePointArcToolOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def IntersectCurve ( * args , ** kwargs ) : <EOL> pass <EOL> def ConnectComponentsOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def TextureCentricUVLinkingEditor ( * args , ** kwargs ) : <EOL> pass <EOL> def DeleteCurrentUVSet ( * args , ** kwargs ) : <EOL> pass <EOL> def AnimationTurntableOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def RotateToolMarkingMenu ( * args , ** kwargs ) : <EOL> pass <EOL> def FitBSplineOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def TemplateObject ( * args , ** kwargs ) : <EOL> pass <EOL> def SetPassiveKey ( * args , ** kwargs ) : <EOL> pass <EOL> def AimConstraintOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateParticleDiskCacheOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ShowGeometry ( * args , ** kwargs ) : <EOL> pass <EOL> def InTangentLinear ( * args , ** kwargs ) : <EOL> pass <EOL> def MergeEdgeToolOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def TangentsStepped ( * args , ** kwargs ) : <EOL> pass <EOL> def ExtractFaceOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def TransformNoSelectOffTool ( * args , ** kwargs ) : <EOL> pass <EOL> def ClosestPointOn ( * args , ** kwargs ) : <EOL> pass <EOL> def SmoothTangent ( * args , ** kwargs ) : <EOL> pass <EOL> def PublishChildAnchorOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def SendAsNewScene3dsMax ( * args , ** kwargs ) : <EOL> pass <EOL> def HideMarkers ( * args , ** kwargs ) : <EOL> pass <EOL> def CVCurveToolOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def DeleteAllNRigids ( * args , ** kwargs ) : <EOL> pass <EOL> def OffsetEdgeLoopToolOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ResolveInterpenetration ( * args , ** kwargs ) : <EOL> pass <EOL> def FourViewArrangement ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateNURBSCubeOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def RenderLayerRelationshipEditor ( * args , ** kwargs ) : <EOL> pass <EOL> def SetKeyVertexColor ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateFlexorWindow ( * args , ** kwargs ) : <EOL> pass <EOL> def SlideEdgeToolOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ConvertSelectionToVertices ( * args , ** kwargs ) : <EOL> pass <EOL> def PoleVectorConstraint ( * args , ** kwargs ) : <EOL> pass <EOL> def Sine ( * args , ** kwargs ) : <EOL> pass <EOL> def HideTexturePlacements ( * args , ** kwargs ) : <EOL> pass <EOL> def BreakShadowLinks ( * args , ** kwargs ) : <EOL> pass <EOL> def ConvertSelectionToUVBorder ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectEdgeMask ( * args , ** kwargs ) : <EOL> pass <EOL> def UnlockCurveLength ( * args , ** kwargs ) : <EOL> pass <EOL> def NodeEditorToggleZoomOut ( * args , ** kwargs ) : <EOL> pass <EOL> def CustomPolygonDisplay ( * args , ** kwargs ) : <EOL> pass <EOL> def UnlockContainer ( * args , ** kwargs ) : <EOL> pass <EOL> def RemoveInbetween ( * args , ** kwargs ) : <EOL> pass <EOL> def ShowSubdivSurfaces ( * args , ** kwargs ) : <EOL> pass <EOL> def Wave ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateCurveFromPoly ( * args , ** kwargs ) : <EOL> pass <EOL> def ConnectNodeToIKFK ( * args , ** kwargs ) : <EOL> pass <EOL> def NodeEditorSetTraversalDepthZero ( * args , ** kwargs ) : <EOL> pass <EOL> def ShowLightManipulators ( * args , ** kwargs ) : <EOL> pass <EOL> def RenderTextureRange ( * args , ** kwargs ) : <EOL> pass <EOL> def fluidReplaceFramesOpt ( * args , ** kwargs ) : <EOL> pass <EOL> def VolumeAxisOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def DuplicateSpecialOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleMeshUVBorders ( * args , ** kwargs ) : <EOL> pass <EOL> def NodeEditorPinSelected ( * args , ** kwargs ) : <EOL> pass <EOL> def GraphEditor ( * args , ** kwargs ) : <EOL> pass <EOL> def CombinePolygonsOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectAllHairSystem ( * args , ** kwargs ) : <EOL> pass <EOL> def VertexNormalEditTool ( * args , ** kwargs ) : <EOL> pass <EOL> def SetKeyOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def AveragePolygonNormals ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateWrapOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def AddAnimationOffset ( * args , ** kwargs ) : <EOL> pass <EOL> def RedoViewChange ( * args , ** kwargs ) : <EOL> pass <EOL> def CreatePolygonPipe ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateSpotLightOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def SmoothBindSkin ( * args , ** kwargs ) : <EOL> pass <EOL> def MakePondMotorBoatsOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ExportOfflineFileFromRefEdOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def PublishParentAnchorOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def UntrimSurfacesOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def fluidReplaceCache ( * args , ** kwargs ) : <EOL> pass <EOL> def SetInitialState ( * args , ** kwargs ) : <EOL> pass <EOL> def LoopBrushAnimation ( * args , ** kwargs ) : <EOL> pass <EOL> def DistanceTool ( * args , ** kwargs ) : <EOL> pass <EOL> def UnpublishNode ( * args , ** kwargs ) : <EOL> pass <EOL> def InTangentFixed ( * args , ** kwargs ) : <EOL> pass <EOL> def ParentBaseWireOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def UnifyTangents ( * args , ** kwargs ) : <EOL> pass <EOL> def DetachSurfaces ( * args , ** kwargs ) : <EOL> pass <EOL> def NodeEditorToggleSyncedSelection ( * args , ** kwargs ) : <EOL> pass <EOL> def UniformOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ScriptPaintTool ( * args , ** kwargs ) : <EOL> pass <EOL> def SubdividePolygon ( * args , ** kwargs ) : <EOL> pass <EOL> def SetIKFKKeyframe ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleFBIKEffectorsRotatePinState ( * args , ** kwargs ) : <EOL> pass <EOL> def ArchiveScene ( * args , ** kwargs ) : <EOL> pass <EOL> def CreatePond ( * args , ** kwargs ) : <EOL> pass <EOL> def ProjectTangentOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def PublishConnectionsOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleDisplayGradient ( * args , ** kwargs ) : <EOL> pass <EOL> def LayoutUVRectangle ( * args , ** kwargs ) : <EOL> pass <EOL> def ConvertSelectionToUVs ( * args , ** kwargs ) : <EOL> pass <EOL> def ExpandSelectedComponents ( * args , ** kwargs ) : <EOL> pass <EOL> def fluidDeleteCacheFramesOpt ( * args , ** kwargs ) : <EOL> pass <EOL> def ColorPreferencesWindow ( * args , ** kwargs ) : <EOL> pass <EOL> def DeleteRigidBodies ( * args , ** kwargs ) : <EOL> pass <EOL> def Ungroup ( * args , ** kwargs ) : <EOL> pass <EOL> def SaveScene ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleColorFeedback ( * args , ** kwargs ) : <EOL> pass <EOL> def AlignSurfacesOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def CreatePolygonHelixOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleBorderEdges ( * args , ** kwargs ) : <EOL> pass <EOL> def ReversePolygonNormalsOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def FillHole ( * args , ** kwargs ) : <EOL> pass <EOL> def MirrorPolygonGeometry ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateNURBSSquareOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ShowClusters ( * args , ** kwargs ) : <EOL> pass <EOL> def SubdivSurfacePolygonProxyMode ( * args , ** kwargs ) : <EOL> pass <EOL> def PlaybackBackward ( * args , ** kwargs ) : <EOL> pass <EOL> def SetFocusToCommandLine ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleVertices ( * args , ** kwargs ) : <EOL> pass <EOL> def CircularFillet ( * args , ** kwargs ) : <EOL> pass <EOL> def PlaceFullBodyPivot ( * args , ** kwargs ) : <EOL> pass <EOL> def HideHairSystems ( * args , ** kwargs ) : <EOL> pass <EOL> def DeleteAllRigidConstraints ( * args , ** kwargs ) : <EOL> pass <EOL> def DeleteAllHistory ( * args , ** kwargs ) : <EOL> pass <EOL> def GeometryToBoundingBoxOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def PickWalkUp ( * args , ** kwargs ) : <EOL> pass <EOL> def NormalConstraint ( * args , ** kwargs ) : <EOL> pass <EOL> def buildCacheManager ( * args , ** kwargs ) : <EOL> pass <EOL> def PluginManager ( * args , ** kwargs ) : <EOL> pass <EOL> def ModifyPaintValueRelease ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateBindingSet ( * args , ** kwargs ) : <EOL> pass <EOL> def PerspOutlinerLayout ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleSoftEdges ( * args , ** kwargs ) : <EOL> pass <EOL> def nucleusDisplayOtherNodes ( * args , ** kwargs ) : <EOL> pass <EOL> def SewUVs ( * args , ** kwargs ) : <EOL> pass <EOL> def CopyMeshAttributes ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectPolygonSelectionBoundary ( * args , ** kwargs ) : <EOL> pass <EOL> def geometryDeleteCacheFrames ( * args , ** kwargs ) : <EOL> pass <EOL> def Birail3 ( * args , ** kwargs ) : <EOL> pass <EOL> def DeactivateGlobalScreenSlider ( * args , ** kwargs ) : <EOL> pass <EOL> def SetToFaceNormals ( * args , ** kwargs ) : <EOL> pass <EOL> def RenderLayerEditorWindow ( * args , ** kwargs ) : <EOL> pass <EOL> def FilletBlendToolOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def geometryAppendCache ( * args , ** kwargs ) : <EOL> pass <EOL> def CurveSmoothnessCoarse ( * args , ** kwargs ) : <EOL> pass <EOL> def SetProject ( * args , ** kwargs ) : <EOL> pass <EOL> def RelaxUVShell ( * args , ** kwargs ) : <EOL> pass <EOL> def ShowRenderingUI ( * args , ** kwargs ) : <EOL> pass <EOL> def WhatsNewHighlightingOn ( * args , ** kwargs ) : <EOL> pass <EOL> def EnableAll ( * args , ** kwargs ) : <EOL> pass <EOL> def UIModeMarkingMenu ( * args , ** kwargs ) : <EOL> pass <EOL> def SetNClothStartFromMesh ( * args , ** kwargs ) : <EOL> pass <EOL> def UnlockNormals ( * args , ** kwargs ) : <EOL> pass <EOL> def DuplicateCurve ( * args , ** kwargs ) : <EOL> pass <EOL> def BatchRender ( * args , ** kwargs ) : <EOL> pass <EOL> def fluidReplaceCacheOpt ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectAllNRigids ( * args , ** kwargs ) : <EOL> pass <EOL> def TestTextureOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def PublishParentAnchor ( * args , ** kwargs ) : <EOL> pass <EOL> def AttachToPath ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateUVsBasedOnCameraOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def SmoothingLevelIncrease ( * args , ** kwargs ) : <EOL> pass <EOL> def UngroupOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def fluidDeleteCacheOpt ( * args , ** kwargs ) : <EOL> pass <EOL> def ReattachSkeletonJoints ( * args , ** kwargs ) : <EOL> pass <EOL> def nucleusGetnParticleExample ( * args , ** kwargs ) : <EOL> pass <EOL> def SimplifyStrokePathCurves ( * args , ** kwargs ) : <EOL> pass <EOL> def MakeLightLinks ( * args , ** kwargs ) : <EOL> pass <EOL> def TwoPointArcToolOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def fluidAppendOpt ( * args , ** kwargs ) : <EOL> pass <EOL> def UndoViewChange ( * args , ** kwargs ) : <EOL> pass <EOL> def InsertKeyToolDeactivate ( * args , ** kwargs ) : <EOL> pass <EOL> def TwoPointArcTool ( * args , ** kwargs ) : <EOL> pass <EOL> def DisplayIntermediateObjects ( * args , ** kwargs ) : <EOL> pass <EOL> def UVCentricUVLinkingEditor ( * args , ** kwargs ) : <EOL> pass <EOL> def PaintSetMembershipToolOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectAllClusters ( * args , ** kwargs ) : <EOL> pass <EOL> def AssignNewMaterial ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateSpotLight ( * args , ** kwargs ) : <EOL> pass <EOL> def STRSTweakModeOff ( * args , ** kwargs ) : <EOL> pass <EOL> def ScaleKeys ( * args , ** kwargs ) : <EOL> pass <EOL> def SubdivSmoothnessMediumOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def CreatePolygonPyramidOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ExpressionEditor ( * args , ** kwargs ) : <EOL> pass <EOL> def TurbulenceOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def KeyBlendShapeTargetsWeight ( * args , ** kwargs ) : <EOL> pass <EOL> def ConvertSelectionToContainedEdges ( * args , ** kwargs ) : <EOL> pass <EOL> def EnableNCloths ( * args , ** kwargs ) : <EOL> pass <EOL> def NURBSSmoothnessFineOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def DeleteFBIKSelectedKeys ( * args , ** kwargs ) : <EOL> pass <EOL> def nClothMakeCollideOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ArtPaintSelectToolOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def RoundToolOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def FloatSelectedObjectsOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def CreatePointLightOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def DeleteAllExpressions ( * args , ** kwargs ) : <EOL> pass <EOL> def StitchEdgesTool ( * args , ** kwargs ) : <EOL> pass <EOL> def AddInbetween ( * args , ** kwargs ) : <EOL> pass <EOL> def SnapPointToPointOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def MergeVertexToolOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ExtrudeFaceOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def SpreadSheetEditor ( * args , ** kwargs ) : <EOL> pass <EOL> def HideObjectGeometry ( * args , ** kwargs ) : <EOL> pass <EOL> def AddPointsTool ( * args , ** kwargs ) : <EOL> pass <EOL> def SplitMeshWithProjectedCurveOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ChamferVertexOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def DeleteAllShadingGroupsAndMaterials ( * args , ** kwargs ) : <EOL> pass <EOL> def HideClusters ( * args , ** kwargs ) : <EOL> pass <EOL> def ReversePolygonNormals ( * args , ** kwargs ) : <EOL> pass <EOL> def SphericalProjectionOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def DeleteAllChannels ( * args , ** kwargs ) : <EOL> pass <EOL> def FreeformFillet ( * args , ** kwargs ) : <EOL> pass <EOL> def AddToContainerOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ShowFollicles ( * args , ** kwargs ) : <EOL> pass <EOL> def RenderViewWindow ( * args , ** kwargs ) : <EOL> pass <EOL> def AddHolderOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateHairCacheOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateHairOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def HideCloth ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateActiveRigidBody ( * args , ** kwargs ) : <EOL> pass <EOL> def RigidBindSkinOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def FreeformFilletOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def EnableSelectedIKHandles ( * args , ** kwargs ) : <EOL> pass <EOL> def PaintEffectsToolOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateGhost ( * args , ** kwargs ) : <EOL> pass <EOL> def ShowClothPanelCurves ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectIsolate ( * args , ** kwargs ) : <EOL> pass <EOL> def BevelOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def CutPolygonOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ShowBatchRender ( * args , ** kwargs ) : <EOL> pass <EOL> def RemoveWireOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ShowAllEditedComponents ( * args , ** kwargs ) : <EOL> pass <EOL> def PostInfinityCycleOffset ( * args , ** kwargs ) : <EOL> pass <EOL> def ShowNParticles ( * args , ** kwargs ) : <EOL> pass <EOL> def CreaseProxyEdgeToolOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def MoveToolOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateCameraOnly ( * args , ** kwargs ) : <EOL> pass <EOL> def EditFluidResolutionOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ShelfPreferencesWindow ( * args , ** kwargs ) : <EOL> pass <EOL> def BridgeEdge ( * args , ** kwargs ) : <EOL> pass <EOL> def CopySkinWeights ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectComponentToolMarkingMenuPopDown ( * args , ** kwargs ) : <EOL> pass <EOL> def MoveRotateScaleToolToggleSnapRelativeMode ( * args , ** kwargs ) : <EOL> pass <EOL> def SendAsNewSceneSoftimage ( * args , ** kwargs ) : <EOL> pass <EOL> def BakeNonDefHistoryOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def OffsetCurveOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def BreakLightLinks ( * args , ** kwargs ) : <EOL> pass <EOL> def TruncateHairCache ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectAllImagePlanes ( * args , ** kwargs ) : <EOL> pass <EOL> def GoToMinFrame ( * args , ** kwargs ) : <EOL> pass <EOL> def NextManipulatorHandle ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateSubdivRegion ( * args , ** kwargs ) : <EOL> pass <EOL> def SmoothPolygonOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def BlendShapeEditor ( * args , ** kwargs ) : <EOL> pass <EOL> def NCreateEmitterOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def MoveIKtoFK ( * args , ** kwargs ) : <EOL> pass <EOL> def MakeCollide ( * args , ** kwargs ) : <EOL> pass <EOL> def InTangentFlat ( * args , ** kwargs ) : <EOL> pass <EOL> def nClothMergeCache ( * args , ** kwargs ) : <EOL> pass <EOL> def ModifyStampDepthRelease ( * args , ** kwargs ) : <EOL> pass <EOL> def IncrementFluidCenter ( * args , ** kwargs ) : <EOL> pass <EOL> def ParticleFillOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def TransferAttributeValuesOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def DisableGlobalStitch ( * args , ** kwargs ) : <EOL> pass <EOL> def HIKSelectedMode ( * args , ** kwargs ) : <EOL> pass <EOL> def PaintOnPaintableObjects ( * args , ** kwargs ) : <EOL> pass <EOL> def SculptReferenceVectorMarkingMenuRelease ( * args , ** kwargs ) : <EOL> pass <EOL> def SurfaceBooleanSubtractToolOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def StitchEdgesToolOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleViewCube ( * args , ** kwargs ) : <EOL> pass <EOL> def NodeEditorGridToggleSnap ( * args , ** kwargs ) : <EOL> pass <EOL> def NonSacredTool ( * args , ** kwargs ) : <EOL> pass <EOL> def StraightenUVBorderOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def PruneSmallWeightsOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def DecreaseManipulatorSize ( * args , ** kwargs ) : <EOL> pass <EOL> def UnitizeUVsOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def PreferencesWindow ( * args , ** kwargs ) : <EOL> pass <EOL> def AddFloorContactPlane ( * args , ** kwargs ) : <EOL> pass <EOL> def ConformPolygonNormals ( * args , ** kwargs ) : <EOL> pass <EOL> def DeleteTimeWarp ( * args , ** kwargs ) : <EOL> pass <EOL> def ScaleCurvatureOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def Squash ( * args , ** kwargs ) : <EOL> pass <EOL> def DeleteConstraints ( * args , ** kwargs ) : <EOL> pass <EOL> def nClothCacheOpt ( * args , ** kwargs ) : <EOL> pass <EOL> def AnimationSweepOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def RigidBodySolver ( * args , ** kwargs ) : <EOL> pass <EOL> def FireworksOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def AffectSelectedObject ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateOceanWakeOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def PresetBlendingWindow ( * args , ** kwargs ) : <EOL> pass <EOL> def ExtendSurfacesOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ClearPaintEffectsView ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectVertexMask ( * args , ** kwargs ) : <EOL> pass <EOL> def HideLightManipulators ( * args , ** kwargs ) : <EOL> pass <EOL> def PolyConvertToRingAndCollapse ( * args , ** kwargs ) : <EOL> pass <EOL> def BufferCurveSnapshot ( * args , ** kwargs ) : <EOL> pass <EOL> def DeleteAllNCloths ( * args , ** kwargs ) : <EOL> pass <EOL> def ResetWire ( * args , ** kwargs ) : <EOL> pass <EOL> def FluidGradients ( * args , ** kwargs ) : <EOL> pass <EOL> def AddPondBoatLocator ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateNURBSConeOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def PaintEffectsWindow ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateFBIK ( * args , ** kwargs ) : <EOL> pass <EOL> def IPROptions ( * args , ** kwargs ) : <EOL> pass <EOL> def PokePolygon ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectSharedColorInstances ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateConstraintOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def HideStrokes ( * args , ** kwargs ) : <EOL> pass <EOL> def DeleteAllCameras ( * args , ** kwargs ) : <EOL> pass <EOL> def DisplayShadingMarkingMenuPopDown ( * args , ** kwargs ) : <EOL> pass <EOL> def PaintEffectsMeshQuality ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectEdgeLoopSp ( * args , ** kwargs ) : <EOL> pass <EOL> def PlaybackToggle ( * args , ** kwargs ) : <EOL> pass <EOL> def CustomNURBSSmoothness ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateNURBSCircle ( * args , ** kwargs ) : <EOL> pass <EOL> def GoToDefaultView ( * args , ** kwargs ) : <EOL> pass <EOL> def RemoveFromContainer ( * args , ** kwargs ) : <EOL> pass <EOL> def WrinkleTool ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateCreaseSet ( * args , ** kwargs ) : <EOL> pass <EOL> def OutTangentLinear ( * args , ** kwargs ) : <EOL> pass <EOL> def ShowLastHidden ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateCameraAimOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def OrientJointOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleMeshMaps ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectAllRigidConstraints ( * args , ** kwargs ) : <EOL> pass <EOL> def GraphDelete ( * args , ** kwargs ) : <EOL> pass <EOL> def AutobindContainer ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectNextIntermediatObject ( * args , ** kwargs ) : <EOL> pass <EOL> def GetSettingsFromSelectedStroke ( * args , ** kwargs ) : <EOL> pass <EOL> def ActivateGlobalScreenSliderModeMarkingMenu ( * args , ** kwargs ) : <EOL> pass <EOL> def RedoPreviousIPRRender ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleTimeSlider ( * args , ** kwargs ) : <EOL> pass <EOL> def Smoke ( * args , ** kwargs ) : <EOL> pass <EOL> def MakePondBoatsOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ShowHotbox ( * args , ** kwargs ) : <EOL> pass <EOL> def EditMembershipTool ( * args , ** kwargs ) : <EOL> pass <EOL> def PublishNode ( * args , ** kwargs ) : <EOL> pass <EOL> def InteractivePlayback ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleSubdDetails ( * args , ** kwargs ) : <EOL> pass <EOL> def DisplaySmoothShaded ( * args , ** kwargs ) : <EOL> pass <EOL> def InTangentAuto ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectAllIKHandles ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleShelf ( * args , ** kwargs ) : <EOL> pass <EOL> def DetachSkin ( * args , ** kwargs ) : <EOL> pass <EOL> def HIKCharacterControlsTool ( * args , ** kwargs ) : <EOL> pass <EOL> def NodeEditorToggleLockUnlock ( * args , ** kwargs ) : <EOL> pass <EOL> def Export ( * args , ** kwargs ) : <EOL> pass <EOL> def ScaleToolWithSnapMarkingMenuPopDown ( * args , ** kwargs ) : <EOL> pass <EOL> def SubdivToNURBS ( * args , ** kwargs ) : <EOL> pass <EOL> def NodeEditorGraphAllShapes ( * args , ** kwargs ) : <EOL> pass <EOL> def CreatePolygonTorus ( * args , ** kwargs ) : <EOL> pass <EOL> def TogglePolygonFaceCenters ( * args , ** kwargs ) : <EOL> pass <EOL> def ProjectCurveOnSurfaceOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def UnfoldUV ( * args , ** kwargs ) : <EOL> pass <EOL> def ConvertSelectionToUVEdgeLoop ( * args , ** kwargs ) : <EOL> pass <EOL> def TogglePolyDisplayEdges ( * args , ** kwargs ) : <EOL> pass <EOL> def EnableSnapshots ( * args , ** kwargs ) : <EOL> pass <EOL> def CurveEditTool ( * args , ** kwargs ) : <EOL> pass <EOL> def PasteSelected ( * args , ** kwargs ) : <EOL> pass <EOL> def nClothReplaceFramesOpt ( * args , ** kwargs ) : <EOL> pass <EOL> def TogglePanZoomPress ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateWakeOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def AlignCurveOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def CreatePolygonCylinderOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def PolygonSoftenHardenOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def SoftModDeformerOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def MirrorJoint ( * args , ** kwargs ) : <EOL> pass <EOL> def PolygonPaste ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateNURBSSphereOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ShowClothPanels ( * args , ** kwargs ) : <EOL> pass <EOL> def SetFluidAttrFromCurve ( * args , ** kwargs ) : <EOL> pass <EOL> def CharacterAnimationEditor ( * args , ** kwargs ) : <EOL> pass <EOL> def ShowUIElements ( * args , ** kwargs ) : <EOL> pass <EOL> def IncreaseManipulatorSize ( * args , ** kwargs ) : <EOL> pass <EOL> def HideFur ( * args , ** kwargs ) : <EOL> pass <EOL> def OpenCloseCurve ( * args , ** kwargs ) : <EOL> pass <EOL> def PolygonBooleanIntersectionOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def MakeFluidCollide ( * args , ** kwargs ) : <EOL> pass <EOL> def DeleteAllFluids ( * args , ** kwargs ) : <EOL> pass <EOL> def GeometryConstraintOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ShowStrokePathCurves ( * args , ** kwargs ) : <EOL> pass <EOL> def ResampleCurveOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ModifyOpacityRelease ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateJiggleOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateBezierCurveTool ( * args , ** kwargs ) : <EOL> pass <EOL> def GoToNextDrivenKey ( * args , ** kwargs ) : <EOL> pass <EOL> def HypergraphWindow ( * args , ** kwargs ) : <EOL> pass <EOL> def PlayblastOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectObjectsIlluminatedByLight ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleEdgeMetadata ( * args , ** kwargs ) : <EOL> pass <EOL> def ShowNRigids ( * args , ** kwargs ) : <EOL> pass <EOL> def CylindricalProjection ( * args , ** kwargs ) : <EOL> pass <EOL> def RenderGlobalsWindow ( * args , ** kwargs ) : <EOL> pass <EOL> def RelaxInitialState ( * args , ** kwargs ) : <EOL> pass <EOL> def ShowPolygonSurfaces ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateClusterOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def EmitFromObjectOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def geometryReplaceCache ( * args , ** kwargs ) : <EOL> pass <EOL> def NextSkinPaintMode ( * args , ** kwargs ) : <EOL> pass <EOL> def Quit ( * args , ** kwargs ) : <EOL> pass <EOL> def DragOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def OpenCloseSurfaces ( * args , ** kwargs ) : <EOL> pass <EOL> def BatchBake ( * args , ** kwargs ) : <EOL> pass <EOL> def NewtonOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def TesselateSubdivSurfaceOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def AttachSelectedAsSourceField ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateTextureReferenceObject ( * args , ** kwargs ) : <EOL> pass <EOL> def NURBSToPolygonsOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def NURBSSmoothnessHull ( * args , ** kwargs ) : <EOL> pass <EOL> def ReassignBoneLatticeJoint ( * args , ** kwargs ) : <EOL> pass <EOL> def AssumePreferredAngle ( * args , ** kwargs ) : <EOL> pass <EOL> def MakeHoleTool ( * args , ** kwargs ) : <EOL> pass <EOL> def TogglePaintAtDepth ( * args , ** kwargs ) : <EOL> pass <EOL> def AssignOfflineFileFromRefEd ( * args , ** kwargs ) : <EOL> pass <EOL> def InsertJointTool ( * args , ** kwargs ) : <EOL> pass <EOL> def DisconnectJoint ( * args , ** kwargs ) : <EOL> pass <EOL> def HardwareRenderBuffer ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleMultiColorFeedback ( * args , ** kwargs ) : <EOL> pass <EOL> def PaintReduceWeightsToolOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def GravityOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def NodeEditorRenderSwatches ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateSoftBody ( * args , ** kwargs ) : <EOL> pass <EOL> def ArtPaintSelectTool ( * args , ** kwargs ) : <EOL> pass <EOL> def SubdivSmoothnessHullOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def CreatePolygonPrismOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def Loft ( * args , ** kwargs ) : <EOL> pass <EOL> def Art3dPaintToolOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def PreviousFrame ( * args , ** kwargs ) : <EOL> pass <EOL> def ExportSkinWeightMaps ( * args , ** kwargs ) : <EOL> pass <EOL> def MergeUVOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ThreeRightSplitViewArrangement ( * args , ** kwargs ) : <EOL> pass <EOL> def JointTool ( * args , ** kwargs ) : <EOL> pass <EOL> def DetachSkeletonJoints ( * args , ** kwargs ) : <EOL> pass <EOL> def ApplySettingsToSelectedStroke ( * args , ** kwargs ) : <EOL> pass <EOL> def EnableIKSolvers ( * args , ** kwargs ) : <EOL> pass <EOL> def DeleteFBIKAllKeys ( * args , ** kwargs ) : <EOL> pass <EOL> def nClothDeleteHistoryOpt ( * args , ** kwargs ) : <EOL> pass <EOL> def FlipUVs ( * args , ** kwargs ) : <EOL> pass <EOL> def TesselateSubdivSurface ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateSpringOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def Radial ( * args , ** kwargs ) : <EOL> pass <EOL> def HairUVSetLinkingEditor ( * args , ** kwargs ) : <EOL> pass <EOL> def CreatePlatonicSolidOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def Snap2PointsTo2PointsOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def SnapKeysOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def TangetConstraint ( * args , ** kwargs ) : <EOL> pass <EOL> def HIKSetBodyPartKey ( * args , ** kwargs ) : <EOL> pass <EOL> def ExtrudeEdgeOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def TranslateToolMarkingMenuPopDown ( * args , ** kwargs ) : <EOL> pass <EOL> def SequenceEditor ( * args , ** kwargs ) : <EOL> pass <EOL> def ShotPlaylistEditor ( * args , ** kwargs ) : <EOL> pass <EOL> def CenterPivot ( * args , ** kwargs ) : <EOL> pass <EOL> def SwapBlendShapeOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def HideClothPanels ( * args , ** kwargs ) : <EOL> pass <EOL> def ReverseCurve ( * args , ** kwargs ) : <EOL> pass <EOL> def FrameSelectedInAllViews ( * args , ** kwargs ) : <EOL> pass <EOL> def MovePolygonComponentOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def RenderViewNextImage ( * args , ** kwargs ) : <EOL> pass <EOL> def ExportOfflineFile ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateHair ( * args , ** kwargs ) : <EOL> pass <EOL> def PolyBrushMarkingMenuPopDown ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectToggleMode ( * args , ** kwargs ) : <EOL> pass <EOL> def ShatterOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def Parent ( * args , ** kwargs ) : <EOL> pass <EOL> def SineOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def HighQualityDisplay ( * args , ** kwargs ) : <EOL> pass <EOL> def PaintEffectsToPolyOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectFacetMask ( * args , ** kwargs ) : <EOL> pass <EOL> def OrientConstraint ( * args , ** kwargs ) : <EOL> pass <EOL> def CutKeysOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def PostInfinityConstant ( * args , ** kwargs ) : <EOL> pass <EOL> def ShowModelingUI ( * args , ** kwargs ) : <EOL> pass <EOL> def Vortex ( * args , ** kwargs ) : <EOL> pass <EOL> def PolySelectToolOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def EditCharacterAttributes ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleObjectDetails ( * args , ** kwargs ) : <EOL> pass <EOL> def NodeEditorReduceTraversalDepth ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectBrushNames ( * args , ** kwargs ) : <EOL> pass <EOL> def PolyCreaseToolOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ViewImage ( * args , ** kwargs ) : <EOL> pass <EOL> def CommandShell ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleFocalLength ( * args , ** kwargs ) : <EOL> pass <EOL> def BakeChannelOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def NodeEditorGridToggleVisibility ( * args , ** kwargs ) : <EOL> pass <EOL> def TangentsPlateau ( * args , ** kwargs ) : <EOL> pass <EOL> def AddBlendShapeOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def CollapseSubdivSurfaceHierarchy ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectAllFluids ( * args , ** kwargs ) : <EOL> pass <EOL> def UpdateCurrentSceneSoftimage ( * args , ** kwargs ) : <EOL> pass <EOL> def Create3DContainer ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateSubdivCylinder ( * args , ** kwargs ) : <EOL> pass <EOL> def MapUVBorder ( * args , ** kwargs ) : <EOL> pass <EOL> def ExportOfflineFileOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def QualityDisplayMarkingMenu ( * args , ** kwargs ) : <EOL> pass <EOL> def UpdateBindingSet ( * args , ** kwargs ) : <EOL> pass <EOL> def MakeBrushSpring ( * args , ** kwargs ) : <EOL> pass <EOL> def Drag ( * args , ** kwargs ) : <EOL> pass <EOL> def UnpublishParentAnchor ( * args , ** kwargs ) : <EOL> pass <EOL> def DisableExpressions ( * args , ** kwargs ) : <EOL> pass <EOL> def HIKPinRotate ( * args , ** kwargs ) : <EOL> pass <EOL> def Triangulate ( * args , ** kwargs ) : <EOL> pass <EOL> def SculptPolygonsToolOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleFBIKEffectorsTranslatePinState ( * args , ** kwargs ) : <EOL> pass <EOL> def ArtPaintAttrToolOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateReference ( * args , ** kwargs ) : <EOL> pass <EOL> def StraightenCurvesOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def PruneSculpt ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleEdgeIDs ( * args , ** kwargs ) : <EOL> pass <EOL> def LightningOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def MoveNearestPickedKeyToolActivate ( * args , ** kwargs ) : <EOL> pass <EOL> def PreInfinityLinear ( * args , ** kwargs ) : <EOL> pass <EOL> def SetPreferredAngle ( * args , ** kwargs ) : <EOL> pass <EOL> def deleteHistoryAheadOfGeomCache ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleCullingVertices ( * args , ** kwargs ) : <EOL> pass <EOL> def CompleteCurrentTool ( * args , ** kwargs ) : <EOL> pass <EOL> def TranslateToolWithSnapMarkingMenuPopDown ( * args , ** kwargs ) : <EOL> pass <EOL> def ScaleConstraintOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleCommandLine ( * args , ** kwargs ) : <EOL> pass <EOL> def GoalOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def nClothAppendOpt ( * args , ** kwargs ) : <EOL> pass <EOL> def AnimationSnapshotOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def RigidBindSkin ( * args , ** kwargs ) : <EOL> pass <EOL> def MirrorSubdivSurfaceOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateOceanOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ShowFkSkeleton ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleAutoFrame ( * args , ** kwargs ) : <EOL> pass <EOL> def nClothReplaceCacheOpt ( * args , ** kwargs ) : <EOL> pass <EOL> def SetFullBodyIKKeysKeyToPin ( * args , ** kwargs ) : <EOL> pass <EOL> def ExtendFluidOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def TrackTool ( * args , ** kwargs ) : <EOL> pass <EOL> def ClearCurrentContainer ( * args , ** kwargs ) : <EOL> pass <EOL> def Planar ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectUVShell ( * args , ** kwargs ) : <EOL> pass <EOL> def HideKinematics ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectToolMarkingMenuPopDown ( * args , ** kwargs ) : <EOL> pass <EOL> def BrushPresetReplaceShading ( * args , ** kwargs ) : <EOL> pass <EOL> def DeleteAllLights ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateParticleDiskCache ( * args , ** kwargs ) : <EOL> pass <EOL> def ResetTransformationsOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def FluidEmitter ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateNURBSCircleOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def PickWalkIn ( * args , ** kwargs ) : <EOL> pass <EOL> def PreInfinityCycle ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateExpressionClip ( * args , ** kwargs ) : <EOL> pass <EOL> def IKSplineHandleTool ( * args , ** kwargs ) : <EOL> pass <EOL> def ShadingGroupAttributeEditor ( * args , ** kwargs ) : <EOL> pass <EOL> def PointOnPolyConstraint ( * args , ** kwargs ) : <EOL> pass <EOL> def geometryDeleteCacheFramesOpt ( * args , ** kwargs ) : <EOL> pass <EOL> def HideStrokeControlCurves ( * args , ** kwargs ) : <EOL> pass <EOL> def RemoveLatticeTweaks ( * args , ** kwargs ) : <EOL> pass <EOL> def DeformerSetEditor ( * args , ** kwargs ) : <EOL> pass <EOL> def SetToFaceNormalsOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def AddOceanSurfaceLocator ( * args , ** kwargs ) : <EOL> pass <EOL> def geometryAppendCacheOpt ( * args , ** kwargs ) : <EOL> pass <EOL> def SetRigidBodyCollision ( * args , ** kwargs ) : <EOL> pass <EOL> def RemoveConstraintTarget ( * args , ** kwargs ) : <EOL> pass <EOL> def ShowSmoothSkinInfluences ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateContainer ( * args , ** kwargs ) : <EOL> pass <EOL> def EnableGlobalStitch ( * args , ** kwargs ) : <EOL> pass <EOL> def SetNormalAngle ( * args , ** kwargs ) : <EOL> pass <EOL> def ShowJoints ( * args , ** kwargs ) : <EOL> pass <EOL> def UnmirrorSmoothProxy ( * args , ** kwargs ) : <EOL> pass <EOL> def DuplicateFaceOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleMeshEdges ( * args , ** kwargs ) : <EOL> pass <EOL> def SetKeyScale ( * args , ** kwargs ) : <EOL> pass <EOL> def Bevel ( * args , ** kwargs ) : <EOL> pass <EOL> def fluidReplaceFrames ( * args , ** kwargs ) : <EOL> pass <EOL> def GraphCut ( * args , ** kwargs ) : <EOL> pass <EOL> def SetInitialStateOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def AutoProjection ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateVolumeSphere ( * args , ** kwargs ) : <EOL> pass <EOL> def ThreeTopSplitViewArrangement ( * args , ** kwargs ) : <EOL> pass <EOL> def Uniform ( * args , ** kwargs ) : <EOL> pass <EOL> def ActivateFullBodyPivot ( * args , ** kwargs ) : <EOL> pass <EOL> def RecentCommandsWindow ( * args , ** kwargs ) : <EOL> pass <EOL> def SlideEdgeTool ( * args , ** kwargs ) : <EOL> pass <EOL> def MakePaintable ( * args , ** kwargs ) : <EOL> pass <EOL> def PublishConnections ( * args , ** kwargs ) : <EOL> pass <EOL> def InteractiveBindSkin ( * args , ** kwargs ) : <EOL> pass <EOL> def nucleusDisplayTextureNodes ( * args , ** kwargs ) : <EOL> pass <EOL> def DisplayShadingMarkingMenu ( * args , ** kwargs ) : <EOL> pass <EOL> def NewSceneOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def UVSetEditor ( * args , ** kwargs ) : <EOL> pass <EOL> def ImportOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def PanelPreferencesWindow ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectAllGeometry ( * args , ** kwargs ) : <EOL> pass <EOL> def GrowPolygonSelectionRegion ( * args , ** kwargs ) : <EOL> pass <EOL> def AssignTemplate ( * args , ** kwargs ) : <EOL> pass <EOL> def TwoSideBySideViewArrangement ( * args , ** kwargs ) : <EOL> pass <EOL> def STRSTweakModeOn ( * args , ** kwargs ) : <EOL> pass <EOL> def DeleteAllStaticChannels ( * args , ** kwargs ) : <EOL> pass <EOL> def Delete ( * args , ** kwargs ) : <EOL> pass <EOL> def SubdivSurfaceMatchTopology ( * args , ** kwargs ) : <EOL> pass <EOL> def CreatePolygonTool ( * args , ** kwargs ) : <EOL> pass <EOL> def ProjectCurveOnMeshOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ExtendFluid ( * args , ** kwargs ) : <EOL> pass <EOL> def LatticeDeformKeysTool ( * args , ** kwargs ) : <EOL> pass <EOL> def ConvertSelectionToShellBorder ( * args , ** kwargs ) : <EOL> pass <EOL> def EnableRigidBodies ( * args , ** kwargs ) : <EOL> pass <EOL> def AddOceanPreviewPlane ( * args , ** kwargs ) : <EOL> pass <EOL> def PasteKeys ( * args , ** kwargs ) : <EOL> pass <EOL> def DeleteKeysOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def SaveCurrentLayout ( * args , ** kwargs ) : <EOL> pass <EOL> def AlignCameraToPolygon ( * args , ** kwargs ) : <EOL> pass <EOL> def CreatePolygonCubeOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def SnapToPoint ( * args , ** kwargs ) : <EOL> pass <EOL> def MirrorDeformerWeights ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateNURBSPlaneOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def FBIKReachKeyingOptionIK ( * args , ** kwargs ) : <EOL> pass <EOL> def DeleteAllClusters ( * args , ** kwargs ) : <EOL> pass <EOL> def SquareSurface ( * args , ** kwargs ) : <EOL> pass <EOL> def RemoveSubdivProxyMirrorOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateNURBSCube ( * args , ** kwargs ) : <EOL> pass <EOL> def SetDrivenKeyOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def SplitPolygonTool ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleUnsharedUVs ( * args , ** kwargs ) : <EOL> pass <EOL> def ChangeVertexSize ( * args , ** kwargs ) : <EOL> pass <EOL> def DeleteAttribute ( * args , ** kwargs ) : <EOL> pass <EOL> def HideFluids ( * args , ** kwargs ) : <EOL> pass <EOL> def SplitEdge ( * args , ** kwargs ) : <EOL> pass <EOL> def DeleteAllDynamicConstraints ( * args , ** kwargs ) : <EOL> pass <EOL> def AddWire ( * args , ** kwargs ) : <EOL> pass <EOL> def DeleteAllConstraints ( * args , ** kwargs ) : <EOL> pass <EOL> def RerootSkeleton ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateImagePlaneOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ShowDynamicConstraints ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateAreaLight ( * args , ** kwargs ) : <EOL> pass <EOL> def SnapToGrid ( * args , ** kwargs ) : <EOL> pass <EOL> def HypergraphHierarchyWindow ( * args , ** kwargs ) : <EOL> pass <EOL> def OpenSceneOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ConvertToKey ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectMultiComponentMask ( * args , ** kwargs ) : <EOL> pass <EOL> def FrameSelected ( * args , ** kwargs ) : <EOL> pass <EOL> def Birail1 ( * args , ** kwargs ) : <EOL> pass <EOL> def CycleIKHandleStickyState ( * args , ** kwargs ) : <EOL> pass <EOL> def ShowBoundingBox ( * args , ** kwargs ) : <EOL> pass <EOL> def ShowAllUI ( * args , ** kwargs ) : <EOL> pass <EOL> def ParentConstraint ( * args , ** kwargs ) : <EOL> pass <EOL> def RefineSelectedComponents ( * args , ** kwargs ) : <EOL> pass <EOL> def ShowObjectGeometry ( * args , ** kwargs ) : <EOL> pass <EOL> def BrushPresetBlendShading ( * args , ** kwargs ) : <EOL> pass <EOL> def Create2DContainer ( * args , ** kwargs ) : <EOL> pass <EOL> def ShortPolygonNormals ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateClipOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def CopySkinWeightsOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectCurveCVsFirst ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleIKAllowRotation ( * args , ** kwargs ) : <EOL> pass <EOL> def BakeTopologyToTargets ( * args , ** kwargs ) : <EOL> pass <EOL> def TumbleTool ( * args , ** kwargs ) : <EOL> pass <EOL> def CopyKeys ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectAllMarkingMenu ( * args , ** kwargs ) : <EOL> pass <EOL> def AddDynamicBuoyOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def MovePolygonComponent ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateText ( * args , ** kwargs ) : <EOL> pass <EOL> def BlindDataEditor ( * args , ** kwargs ) : <EOL> pass <EOL> def RandomizeFollicles ( * args , ** kwargs ) : <EOL> pass <EOL> def MoveInfluence ( * args , ** kwargs ) : <EOL> pass <EOL> def ShowWrapInfluences ( * args , ** kwargs ) : <EOL> pass <EOL> def UpdateCurrentSceneMudbox ( * args , ** kwargs ) : <EOL> pass <EOL> def Birail2 ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectTool ( * args , ** kwargs ) : <EOL> pass <EOL> def InsertIsoparms ( * args , ** kwargs ) : <EOL> pass <EOL> def DisableSelectedIKHandles ( * args , ** kwargs ) : <EOL> pass <EOL> def PixelMoveUp ( * args , ** kwargs ) : <EOL> pass <EOL> def nClothDeleteHistory ( * args , ** kwargs ) : <EOL> pass <EOL> def PaintRandomOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectAll ( * args , ** kwargs ) : <EOL> pass <EOL> def GraphSnapOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateShot ( * args , ** kwargs ) : <EOL> pass <EOL> def ModifyDisplacementPress ( * args , ** kwargs ) : <EOL> pass <EOL> def nClothCreate ( * args , ** kwargs ) : <EOL> pass <EOL> def MirrorDeformerWeightsOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def SubdivSmoothnessFineOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ResetTemplateBrush ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleVertMetadata ( * args , ** kwargs ) : <EOL> pass <EOL> def CreatePolygonPlaneOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def LockNormals ( * args , ** kwargs ) : <EOL> pass <EOL> def ExportSelection ( * args , ** kwargs ) : <EOL> pass <EOL> def IntersectSurfacesOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def PickWalkDown ( * args , ** kwargs ) : <EOL> pass <EOL> def DetachCurveOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def DeleteExpressions ( * args , ** kwargs ) : <EOL> pass <EOL> def AppendToPolygonTool ( * args , ** kwargs ) : <EOL> pass <EOL> def RotateToolWithSnapMarkingMenu ( * args , ** kwargs ) : <EOL> pass <EOL> def FlipTriangleEdge ( * args , ** kwargs ) : <EOL> pass <EOL> def CreatePassiveRigidBody ( * args , ** kwargs ) : <EOL> pass <EOL> def ShowIKHandles ( * args , ** kwargs ) : <EOL> pass <EOL> def Snap3PointsTo3PointsOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def MergeToCenter ( * args , ** kwargs ) : <EOL> pass <EOL> def PolyEditEdgeFlowOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def Extrude ( * args , ** kwargs ) : <EOL> pass <EOL> def TransformPolygonComponentOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def HideNRigids ( * args , ** kwargs ) : <EOL> pass <EOL> def PolyExtrude ( * args , ** kwargs ) : <EOL> pass <EOL> def PolyConvertToRingAndSplit ( * args , ** kwargs ) : <EOL> pass <EOL> def CameraSetEditor ( * args , ** kwargs ) : <EOL> pass <EOL> def DeleteAllPoses ( * args , ** kwargs ) : <EOL> pass <EOL> def ResetWireOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def RetimeKeysTool ( * args , ** kwargs ) : <EOL> pass <EOL> def PolyBrushMarkingMenu ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateDirectionalLight ( * args , ** kwargs ) : <EOL> pass <EOL> def FrameAllInAllViews ( * args , ** kwargs ) : <EOL> pass <EOL> def AddPondDynamicLocatorOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateCreaseSetOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def PaintEffectsToPoly ( * args , ** kwargs ) : <EOL> pass <EOL> def PolyAssignSubdivHoleOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectTextureReferenceObject ( * args , ** kwargs ) : <EOL> pass <EOL> def PolyDisplayReset ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateConstructionPlane ( * args , ** kwargs ) : <EOL> pass <EOL> def HideUnselectedObjects ( * args , ** kwargs ) : <EOL> pass <EOL> def PaintEffectsToNurbsOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def PaintEffectsPanel ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectEdgeRingTool ( * args , ** kwargs ) : <EOL> pass <EOL> def mayaPreviewRenderIntoNewWindow ( * args , ** kwargs ) : <EOL> pass <EOL> def CutCurveOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def PaintCacheToolOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectTimeWarp ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateDagContainerOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def OutTangentPlateau ( * args , ** kwargs ) : <EOL> pass <EOL> def ShowManipulators ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateCameraAimUp ( * args , ** kwargs ) : <EOL> pass <EOL> def PolyRemoveCrease ( * args , ** kwargs ) : <EOL> pass <EOL> def EPCurveTool ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateEmitter ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectAllWires ( * args , ** kwargs ) : <EOL> pass <EOL> def MirrorJointOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def OptimizeSceneOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def BakeAllNonDefHistory ( * args , ** kwargs ) : <EOL> pass <EOL> def GoToPreviousDrivenKey ( * args , ** kwargs ) : <EOL> pass <EOL> def GlobalStitchOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def AddAuxEffector ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleToolMessage ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateSubdivCone ( * args , ** kwargs ) : <EOL> pass <EOL> def SmoothCurveOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def MakeShadowLinks ( * args , ** kwargs ) : <EOL> pass <EOL> def Quadrangulate ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleSurfaceFaceCenters ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateDiskCache ( * args , ** kwargs ) : <EOL> pass <EOL> def MakeBoats ( * args , ** kwargs ) : <EOL> pass <EOL> def DollyTool ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateDirectionalLightOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def InTangentPlateau ( * args , ** kwargs ) : <EOL> pass <EOL> def ParentOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleShowBufferCurves ( * args , ** kwargs ) : <EOL> pass <EOL> def DisableAll ( * args , ** kwargs ) : <EOL> pass <EOL> def NodeEditorTransforms ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectEdgeLoopTool ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleFkIk ( * args , ** kwargs ) : <EOL> pass <EOL> def SculptGeometryToolOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def SubstituteGeometryOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleScalePivots ( * args , ** kwargs ) : <EOL> pass <EOL> def NodeEditorGraphRearrange ( * args , ** kwargs ) : <EOL> pass <EOL> def TogglePolygonFaceTriangles ( * args , ** kwargs ) : <EOL> pass <EOL> def StitchSurfacePointsOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def PruneCluster ( * args , ** kwargs ) : <EOL> pass <EOL> def LightCentricLightLinkingEditor ( * args , ** kwargs ) : <EOL> pass <EOL> def TogglePolyDisplayHardEdges ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateDagContainer ( * args , ** kwargs ) : <EOL> pass <EOL> def ExportDeformerWeights ( * args , ** kwargs ) : <EOL> pass <EOL> def ParticleCollisionEvents ( * args , ** kwargs ) : <EOL> pass <EOL> def PerformanceSettingsWindow ( * args , ** kwargs ) : <EOL> pass <EOL> def PostInfinityOscillate ( * args , ** kwargs ) : <EOL> pass <EOL> def TogglePanZoomRelease ( * args , ** kwargs ) : <EOL> pass <EOL> def SaveSceneOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def AnimLayerRelationshipEditor ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateVolumeLight ( * args , ** kwargs ) : <EOL> pass <EOL> def Revolve ( * args , ** kwargs ) : <EOL> pass <EOL> def FineLevelComponentDisplay ( * args , ** kwargs ) : <EOL> pass <EOL> def MirrorSkinWeightsOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateNodeWindow ( * args , ** kwargs ) : <EOL> pass <EOL> def MediumQualityDisplay ( * args , ** kwargs ) : <EOL> pass <EOL> def SetFullBodyIKKeysAll ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleWireframeInArtisan ( * args , ** kwargs ) : <EOL> pass <EOL> def CleanupPolygonOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectUVBorder ( * args , ** kwargs ) : <EOL> pass <EOL> def HideIntermediateObjects ( * args , ** kwargs ) : <EOL> pass <EOL> def DeleteAllJoints ( * args , ** kwargs ) : <EOL> pass <EOL> def GetFluidExample ( * args , ** kwargs ) : <EOL> pass <EOL> def ObjectCentricLightLinkingEditor ( * args , ** kwargs ) : <EOL> pass <EOL> def FlowPathObject ( * args , ** kwargs ) : <EOL> pass <EOL> def ModifyUVVectorPress ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateMotionTrailOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def PolySelectTool ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateAreaLightOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateEmptyUVSet ( * args , ** kwargs ) : <EOL> pass <EOL> def IKHandleTool ( * args , ** kwargs ) : <EOL> pass <EOL> def PointOnCurve ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectPreviousObjects3dsMax ( * args , ** kwargs ) : <EOL> pass <EOL> def GoToBindPose ( * args , ** kwargs ) : <EOL> pass <EOL> def HideSelectedObjects ( * args , ** kwargs ) : <EOL> pass <EOL> def DecrementFluidCenter ( * args , ** kwargs ) : <EOL> pass <EOL> def NodeEditorGraphDownstream ( * args , ** kwargs ) : <EOL> pass <EOL> def CurveSmoothnessRough ( * args , ** kwargs ) : <EOL> pass <EOL> def RemoveBlendShapeOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def WireDropoffLocator ( * args , ** kwargs ) : <EOL> pass <EOL> def PolygonCopy ( * args , ** kwargs ) : <EOL> pass <EOL> def EnableExpressions ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectEdgeLoop ( * args , ** kwargs ) : <EOL> pass <EOL> def NextViewArrangement ( * args , ** kwargs ) : <EOL> pass <EOL> def DuplicateEdgesOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def BendCurves ( * args , ** kwargs ) : <EOL> pass <EOL> def geometryExportCache ( * args , ** kwargs ) : <EOL> pass <EOL> def NextFrame ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectAllOutput ( * args , ** kwargs ) : <EOL> pass <EOL> def GraphCopy ( * args , ** kwargs ) : <EOL> pass <EOL> def AttachSubdivSurface ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleBackfaceCulling ( * args , ** kwargs ) : <EOL> pass <EOL> def AutoPaintMarkingMenu ( * args , ** kwargs ) : <EOL> pass <EOL> def Snap3PointsTo3Points ( * args , ** kwargs ) : <EOL> pass <EOL> def NamespaceEditor ( * args , ** kwargs ) : <EOL> pass <EOL> def SurfaceEditingToolOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def AssumePreferredAngleOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def RebuildSurfaces ( * args , ** kwargs ) : <EOL> pass <EOL> def RenderDiagnostics ( * args , ** kwargs ) : <EOL> pass <EOL> def SinglePerspectiveViewLayout ( * args , ** kwargs ) : <EOL> pass <EOL> def MakeMotorBoats ( * args , ** kwargs ) : <EOL> pass <EOL> def NURBSSmoothnessRoughOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def PublishChildAnchor ( * args , ** kwargs ) : <EOL> pass <EOL> def InsertKnot ( * args , ** kwargs ) : <EOL> pass <EOL> def AssignOfflineFileFromRefEdOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def DisplayShaded ( * args , ** kwargs ) : <EOL> pass <EOL> def AssignHairConstraint ( * args , ** kwargs ) : <EOL> pass <EOL> def ImportDeformerWeights ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectAllFollicles ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectAllNCloths ( * args , ** kwargs ) : <EOL> pass <EOL> def Group ( * args , ** kwargs ) : <EOL> pass <EOL> def NodeEditorShapeMenuStateAllExceptShadingGroupMembers ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleMeshPoints ( * args , ** kwargs ) : <EOL> pass <EOL> def ScaleToolMarkingMenu ( * args , ** kwargs ) : <EOL> pass <EOL> def SubdivSurfaceCleanTopology ( * args , ** kwargs ) : <EOL> pass <EOL> def CreatePolygonSphere ( * args , ** kwargs ) : <EOL> pass <EOL> def RedoPreviousRender ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleLayerBar ( * args , ** kwargs ) : <EOL> pass <EOL> def ProductInformation ( * args , ** kwargs ) : <EOL> pass <EOL> def ExtendCurveOnSurfaceOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def LassoTool ( * args , ** kwargs ) : <EOL> pass <EOL> def ConvertSelectionToFaces ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleIKSolvers ( * args , ** kwargs ) : <EOL> pass <EOL> def ArcLengthTool ( * args , ** kwargs ) : <EOL> pass <EOL> def EnableNucleuses ( * args , ** kwargs ) : <EOL> pass <EOL> def ClearInitialState ( * args , ** kwargs ) : <EOL> pass <EOL> def ThreeBottomSplitViewArrangement ( * args , ** kwargs ) : <EOL> pass <EOL> def DeleteHistory ( * args , ** kwargs ) : <EOL> pass <EOL> def nClothRemove ( * args , ** kwargs ) : <EOL> pass <EOL> def STRSTweakModeToggle ( * args , ** kwargs ) : <EOL> pass <EOL> def FloodSurfaces ( * args , ** kwargs ) : <EOL> pass <EOL> def HideNURBSSurfaces ( * args , ** kwargs ) : <EOL> pass <EOL> def CreatePolygonConeOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def SnapToMeshCenter ( * args , ** kwargs ) : <EOL> pass <EOL> def MirrorCutPolygonGeometry ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateNURBSCylinderOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ExtrudeVertexOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def SmoothingDisplayToggle ( * args , ** kwargs ) : <EOL> pass <EOL> def SetCurrentUVSet ( * args , ** kwargs ) : <EOL> pass <EOL> def TangentsLinear ( * args , ** kwargs ) : <EOL> pass <EOL> def OutTangentFlat ( * args , ** kwargs ) : <EOL> pass <EOL> def CreatePolygonTorusOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ChangeNormalSize ( * args , ** kwargs ) : <EOL> pass <EOL> def SwapBufferCurve ( * args , ** kwargs ) : <EOL> pass <EOL> def HideDynamicConstraints ( * args , ** kwargs ) : <EOL> pass <EOL> def FreezeTransformationsOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def MoveSkinJointsTool ( * args , ** kwargs ) : <EOL> pass <EOL> def ReplaceObjects ( * args , ** kwargs ) : <EOL> pass <EOL> def ModifyDisplacementRelease ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateIllustratorCurvesOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def PolyCreaseTool ( * args , ** kwargs ) : <EOL> pass <EOL> def BrushPresetBlendShadingOff ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectMaskToolMarkingMenu ( * args , ** kwargs ) : <EOL> pass <EOL> def PanZoomTool ( * args , ** kwargs ) : <EOL> pass <EOL> def SimplifyCurve ( * args , ** kwargs ) : <EOL> pass <EOL> def CycleBackgroundColor ( * args , ** kwargs ) : <EOL> pass <EOL> def NodeEditorAdditiveGraphingMode ( * args , ** kwargs ) : <EOL> pass <EOL> def RenameCurrentColorSet ( * args , ** kwargs ) : <EOL> pass <EOL> def ConnectionEditor ( * args , ** kwargs ) : <EOL> pass <EOL> def WedgePolygon ( * args , ** kwargs ) : <EOL> pass <EOL> def ReducePolygonOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ShowNURBSSurfaces ( * args , ** kwargs ) : <EOL> pass <EOL> def PolygonBooleanDifference ( * args , ** kwargs ) : <EOL> pass <EOL> def EditTexture ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleAutoActivateBodyPart ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectContiguousEdgesOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ViewSequence ( * args , ** kwargs ) : <EOL> pass <EOL> def CommandWindow ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleHoleFaces ( * args , ** kwargs ) : <EOL> pass <EOL> def BakeSpringAnimation ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectAllLattices ( * args , ** kwargs ) : <EOL> pass <EOL> def GoToWorkingFrame ( * args , ** kwargs ) : <EOL> pass <EOL> def NodeEditorAddOnNodeCreate ( * args , ** kwargs ) : <EOL> pass <EOL> def UpdateEraseSurface ( * args , ** kwargs ) : <EOL> pass <EOL> def CollapseSubdivSurfaceHierarchyOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateSubdivSurfaceOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def NodeEditorGraphRemoveSelected ( * args , ** kwargs ) : <EOL> pass <EOL> def NParticleTool ( * args , ** kwargs ) : <EOL> pass <EOL> def RaiseApplicationWindows ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectAllBrushes ( * args , ** kwargs ) : <EOL> pass <EOL> def UpdateBindingSetOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def MakeCurvesDynamic ( * args , ** kwargs ) : <EOL> pass <EOL> def NodeEditorGraphAllShapesExceptShading ( * args , ** kwargs ) : <EOL> pass <EOL> def ParticleTool ( * args , ** kwargs ) : <EOL> pass <EOL> def DeleteVertex ( * args , ** kwargs ) : <EOL> pass <EOL> def DisableParticles ( * args , ** kwargs ) : <EOL> pass <EOL> def HIKSetSelectionKey ( * args , ** kwargs ) : <EOL> pass <EOL> def NodeEditorAutoSizeNodes ( * args , ** kwargs ) : <EOL> pass <EOL> def UnparentOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def PaintOperationMarkingMenuRelease ( * args , ** kwargs ) : <EOL> pass <EOL> def SurfaceEditingTool ( * args , ** kwargs ) : <EOL> pass <EOL> def DeleteMotionPaths ( * args , ** kwargs ) : <EOL> pass <EOL> def GraphPasteOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def NodeEditorIncreaseTraversalDepth ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateSet ( * args , ** kwargs ) : <EOL> pass <EOL> def SubdivProxyOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def EmitFluidFromObjectOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def CreatePolygonPipeOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def LockContainer ( * args , ** kwargs ) : <EOL> pass <EOL> def PrelightPolygonOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ExportProxyContainer ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleCurrentContainerHud ( * args , ** kwargs ) : <EOL> pass <EOL> def ConnectJoint ( * args , ** kwargs ) : <EOL> pass <EOL> def DetachComponent ( * args , ** kwargs ) : <EOL> pass <EOL> def SurfaceBooleanUnionToolOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleCompIDs ( * args , ** kwargs ) : <EOL> pass <EOL> def DeleteEdge ( * args , ** kwargs ) : <EOL> pass <EOL> def nClothDeleteCacheFrames ( * args , ** kwargs ) : <EOL> pass <EOL> def AppendToHairCache ( * args , ** kwargs ) : <EOL> pass <EOL> def Flare ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleCameraNames ( * args , ** kwargs ) : <EOL> pass <EOL> def CreatePolygonHelix ( * args , ** kwargs ) : <EOL> pass <EOL> def Air ( * args , ** kwargs ) : <EOL> pass <EOL> def CreatePartition ( * args , ** kwargs ) : <EOL> pass <EOL> def ShowHairSystems ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleAutoSmooth ( * args , ** kwargs ) : <EOL> pass <EOL> def MergeMultipleEdges ( * args , ** kwargs ) : <EOL> pass <EOL> def ExtractSubdivSurfaceVertices ( * args , ** kwargs ) : <EOL> pass <EOL> def ClosestPointOnOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def PolyMergeOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def PlanarOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def SendAsNewSceneMotionBuilder ( * args , ** kwargs ) : <EOL> pass <EOL> def HideNCloths ( * args , ** kwargs ) : <EOL> pass <EOL> def CVHardness ( * args , ** kwargs ) : <EOL> pass <EOL> def PixelMoveLeft ( * args , ** kwargs ) : <EOL> pass <EOL> def HideCameraManipulators ( * args , ** kwargs ) : <EOL> pass <EOL> def OffsetSurfaces ( * args , ** kwargs ) : <EOL> pass <EOL> def ResolveInterpenetrationOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def FourViewLayout ( * args , ** kwargs ) : <EOL> pass <EOL> def AddPondDynamicBuoyOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def PreInfinityCycleOffset ( * args , ** kwargs ) : <EOL> pass <EOL> def RenderOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateFluidCache ( * args , ** kwargs ) : <EOL> pass <EOL> def PerspTextureLayout ( * args , ** kwargs ) : <EOL> pass <EOL> def PoleVectorConstraintOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectSimilar ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleShowResults ( * args , ** kwargs ) : <EOL> pass <EOL> def TangentsFixed ( * args , ** kwargs ) : <EOL> pass <EOL> def TogglePolyDisplaySoftEdges ( * args , ** kwargs ) : <EOL> pass <EOL> def PaintEffectsToCurveOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def SetVertexNormal ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectEdgeRing ( * args , ** kwargs ) : <EOL> pass <EOL> def dynamicConstraintRemove ( * args , ** kwargs ) : <EOL> pass <EOL> def geometryCache ( * args , ** kwargs ) : <EOL> pass <EOL> def SetRigidBodyInterpenetration ( * args , ** kwargs ) : <EOL> pass <EOL> def RemoveInfluence ( * args , ** kwargs ) : <EOL> pass <EOL> def ShowSurfaceCVs ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateCurveFromPolyOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ShowLights ( * args , ** kwargs ) : <EOL> pass <EOL> def UnmirrorSmoothProxyOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def DuplicateWithTransform ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleModelEditorBars ( * args , ** kwargs ) : <EOL> pass <EOL> def SetKeyTranslate ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectAllSubdivGeometry ( * args , ** kwargs ) : <EOL> pass <EOL> def GraphPaste ( * args , ** kwargs ) : <EOL> pass <EOL> def SetKey ( * args , ** kwargs ) : <EOL> pass <EOL> def AveragePolygonNormalsOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def CurlCurves ( * args , ** kwargs ) : <EOL> pass <EOL> def fluidMergeCache ( * args , ** kwargs ) : <EOL> pass <EOL> def BevelPlusOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def GlobalDiskCacheControl ( * args , ** kwargs ) : <EOL> pass <EOL> def AddAnimationOffsetOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def SetFullBodyIKKeysOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateSpring ( * args , ** kwargs ) : <EOL> pass <EOL> def MakePressureCurve ( * args , ** kwargs ) : <EOL> pass <EOL> def fluidDeleteCache ( * args , ** kwargs ) : <EOL> pass <EOL> def UnfoldUVOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def PublishRootTransform ( * args , ** kwargs ) : <EOL> pass <EOL> def nucleusDisplayTransformNodes ( * args , ** kwargs ) : <EOL> pass <EOL> def LoopBrushAnimationOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def DoUnghost ( * args , ** kwargs ) : <EOL> pass <EOL> def UncreaseSubdivSurface ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleRotationPivots ( * args , ** kwargs ) : <EOL> pass <EOL> def nucleusDisplayDynamicConstraintNodes ( * args , ** kwargs ) : <EOL> pass <EOL> def DetachSurfacesOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def HIKFullBodyMode ( * args , ** kwargs ) : <EOL> pass <EOL> def NodeEditorToggleZoomIn ( * args , ** kwargs ) : <EOL> pass <EOL> def TwoStackedViewArrangement ( * args , ** kwargs ) : <EOL> pass <EOL> def ScriptPaintToolOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def AddTimeWarp ( * args , ** kwargs ) : <EOL> pass <EOL> def ArchiveSceneOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def Twist ( * args , ** kwargs ) : <EOL> pass <EOL> def RotateUVs ( * args , ** kwargs ) : <EOL> pass <EOL> def ProjectWindow ( * args , ** kwargs ) : <EOL> pass <EOL> def LevelOfDetailGroup ( * args , ** kwargs ) : <EOL> pass <EOL> def AttachSubdivSurfaceOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleProxyDisplay ( * args , ** kwargs ) : <EOL> pass <EOL> def SetMaxInfluences ( * args , ** kwargs ) : <EOL> pass <EOL> def CombinePolygons ( * args , ** kwargs ) : <EOL> pass <EOL> def AddMissingFBIKEffectors ( * args , ** kwargs ) : <EOL> pass <EOL> def SaveSceneAs ( * args , ** kwargs ) : <EOL> pass <EOL> def AlignUV ( * args , ** kwargs ) : <EOL> pass <EOL> def StitchSurfacePoints ( * args , ** kwargs ) : <EOL> pass <EOL> def AddInfluenceOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ReverseSurfaceDirection ( * args , ** kwargs ) : <EOL> pass <EOL> def FilletBlendTool ( * args , ** kwargs ) : <EOL> pass <EOL> def SquareSurfaceOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateNURBSTorus ( * args , ** kwargs ) : <EOL> pass <EOL> def ShowDeformers ( * args , ** kwargs ) : <EOL> pass <EOL> def TogglePolyNonPlanarFaceDisplay ( * args , ** kwargs ) : <EOL> pass <EOL> def SetFocusToNumericInputLine ( * args , ** kwargs ) : <EOL> pass <EOL> def SplitPolygonToolOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def DeleteAllStrokes ( * args , ** kwargs ) : <EOL> pass <EOL> def HideGeometry ( * args , ** kwargs ) : <EOL> pass <EOL> def HideHotbox ( * args , ** kwargs ) : <EOL> pass <EOL> def OpenCloseSurfacesOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def SplitEdgeRingTool ( * args , ** kwargs ) : <EOL> pass <EOL> def DeleteAllIKHandles ( * args , ** kwargs ) : <EOL> pass <EOL> def NormalConstraintOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ResetReflectionOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def SoftModTool ( * args , ** kwargs ) : <EOL> pass <EOL> def ModifyStampDepthPress ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateLocator ( * args , ** kwargs ) : <EOL> pass <EOL> def SplitEdgeRingToolOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def AttachSurfaces ( * args , ** kwargs ) : <EOL> pass <EOL> def PolyMerge ( * args , ** kwargs ) : <EOL> pass <EOL> def HypershadeRenderPerspLayout ( * args , ** kwargs ) : <EOL> pass <EOL> def ShowClothSeams ( * args , ** kwargs ) : <EOL> pass <EOL> def CopySelected ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateAmbientLightOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def HidePolygonSurfaces ( * args , ** kwargs ) : <EOL> pass <EOL> def Birail3Options ( * args , ** kwargs ) : <EOL> pass <EOL> def DeactivateGlobalScreenSliderModeMarkingMenu ( * args , ** kwargs ) : <EOL> pass <EOL> def ShowCameraManipulators ( * args , ** kwargs ) : <EOL> pass <EOL> def Create3DContainerEmitterOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def CurveSmoothnessFine ( * args , ** kwargs ) : <EOL> pass <EOL> def ShowAnimationUI ( * args , ** kwargs ) : <EOL> pass <EOL> def RemoveBindingSet ( * args , ** kwargs ) : <EOL> pass <EOL> def ShowResultsOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def Create2DContainerEmitter ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateConstraintClipOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def EnableConstraints ( * args , ** kwargs ) : <EOL> pass <EOL> def BrushAnimationMarkingMenu ( * args , ** kwargs ) : <EOL> pass <EOL> def CopyUVsToUVSet ( * args , ** kwargs ) : <EOL> pass <EOL> def DuplicateCurveOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleLatticePoints ( * args , ** kwargs ) : <EOL> pass <EOL> def BatchRenderOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def CopyKeysOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectAllNURBSCurves ( * args , ** kwargs ) : <EOL> pass <EOL> def AttachToPathOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateVolumeCone ( * args , ** kwargs ) : <EOL> pass <EOL> def Snap2PointsTo2Points ( * args , ** kwargs ) : <EOL> pass <EOL> def CoarserSubdivLevel ( * args , ** kwargs ) : <EOL> pass <EOL> def ATOMTemplateOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def RebuildCurve ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectUVMask ( * args , ** kwargs ) : <EOL> pass <EOL> def Birail2Options ( * args , ** kwargs ) : <EOL> pass <EOL> def MakeLive ( * args , ** kwargs ) : <EOL> pass <EOL> def InsertKeysTool ( * args , ** kwargs ) : <EOL> pass <EOL> def DisplayLayerEditorWindow ( * args , ** kwargs ) : <EOL> pass <EOL> def BevelPolygon ( * args , ** kwargs ) : <EOL> pass <EOL> def Import ( * args , ** kwargs ) : <EOL> pass <EOL> def PaintVertexColorTool ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectAllDynamicConstraints ( * args , ** kwargs ) : <EOL> pass <EOL> def BestPlaneTexturingTool ( * args , ** kwargs ) : <EOL> pass <EOL> def GridUV ( * args , ** kwargs ) : <EOL> pass <EOL> def AssignOfflineFile ( * args , ** kwargs ) : <EOL> pass <EOL> def nClothCreateOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ScaleKeysOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def SubdivSmoothnessRough ( * args , ** kwargs ) : <EOL> pass <EOL> def nClothDeleteCacheOpt ( * args , ** kwargs ) : <EOL> pass <EOL> def CreatePolygonSoccerBall ( * args , ** kwargs ) : <EOL> pass <EOL> def nClothAppend ( * args , ** kwargs ) : <EOL> pass <EOL> def PreviousManipulatorHandle ( * args , ** kwargs ) : <EOL> pass <EOL> def ExtendCurve ( * args , ** kwargs ) : <EOL> pass <EOL> def ResetLattice ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleUIElements ( * args , ** kwargs ) : <EOL> pass <EOL> def KeyframeTangentMarkingMenu ( * args , ** kwargs ) : <EOL> pass <EOL> def ConvertSelectionToContainedFaces ( * args , ** kwargs ) : <EOL> pass <EOL> def EnableNParticles ( * args , ** kwargs ) : <EOL> pass <EOL> def AddDivisionsOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def DeleteHair ( * args , ** kwargs ) : <EOL> pass <EOL> def PaintEffectPanelDeactivate ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateCameraAimUpOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def FloatSelectedPondObjects ( * args , ** kwargs ) : <EOL> pass <EOL> def HypergraphDGWindow ( * args , ** kwargs ) : <EOL> pass <EOL> def attachNclothCache ( * args , ** kwargs ) : <EOL> pass <EOL> def CreatePolyFromPreview ( * args , ** kwargs ) : <EOL> pass <EOL> def SnapToCurve ( * args , ** kwargs ) : <EOL> pass <EOL> def MergeVertices ( * args , ** kwargs ) : <EOL> pass <EOL> def ExtrudeOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def TransplantHair ( * args , ** kwargs ) : <EOL> pass <EOL> def SetBreakdownKeyOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def HidePlanes ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleToolSettings ( * args , ** kwargs ) : <EOL> pass <EOL> def ChangeEdgeWidth ( * args , ** kwargs ) : <EOL> pass <EOL> def DeleteAllSounds ( * args , ** kwargs ) : <EOL> pass <EOL> def HideDeformers ( * args , ** kwargs ) : <EOL> pass <EOL> def DeleteAllClips ( * args , ** kwargs ) : <EOL> pass <EOL> def AddToCurrentScene3dsMax ( * args , ** kwargs ) : <EOL> pass <EOL> def PaintFluidsToolOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def RepeatLast ( * args , ** kwargs ) : <EOL> pass <EOL> def ModifyConstraintAxisOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateActiveRigidBodyOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateConstructionPlaneOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def HyperGraphPanelRedoViewChange ( * args , ** kwargs ) : <EOL> pass <EOL> def BrushPresetBlendOff ( * args , ** kwargs ) : <EOL> pass <EOL> def PaintEffectsToCurve ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectLightsIlluminatingObject ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateNURBSSphere ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateConstraint ( * args , ** kwargs ) : <EOL> pass <EOL> def BevelPlus ( * args , ** kwargs ) : <EOL> pass <EOL> def CutSelected ( * args , ** kwargs ) : <EOL> pass <EOL> def PaintEffectPanelActivate ( * args , ** kwargs ) : <EOL> pass <EOL> def RemoveWrapInfluence ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateCharacterOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def PostInfinityLinear ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectShortestEdgePathTool ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateCameraOnlyOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def OutTangentClamped ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectContainerContents ( * args , ** kwargs ) : <EOL> pass <EOL> def EnableFluids ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleHelpLine ( * args , ** kwargs ) : <EOL> pass <EOL> def BakeSimulation ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectAllInput ( * args , ** kwargs ) : <EOL> pass <EOL> def AddCurvesToHairSystem ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateSubdivSphere ( * args , ** kwargs ) : <EOL> pass <EOL> def SmoothProxy ( * args , ** kwargs ) : <EOL> pass <EOL> def NEmitFromObject ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleSurfaceOrigin ( * args , ** kwargs ) : <EOL> pass <EOL> def MakeCollideHair ( * args , ** kwargs ) : <EOL> pass <EOL> def InitialFluidStates ( * args , ** kwargs ) : <EOL> pass <EOL> def ParticleInstancer ( * args , ** kwargs ) : <EOL> pass <EOL> def CurveUtilitiesMarkingMenuPopDown ( * args , ** kwargs ) : <EOL> pass <EOL> def DisableIKSolvers ( * args , ** kwargs ) : <EOL> pass <EOL> def PolygonApplyColorOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def PaintOnViewPlane ( * args , ** kwargs ) : <EOL> pass <EOL> def SculptSubdivsTool ( * args , ** kwargs ) : <EOL> pass <EOL> def SurfaceBooleanUnionTool ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleSceneTimecode ( * args , ** kwargs ) : <EOL> pass <EOL> def PolygonApplyColor ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateSculptDeformer ( * args , ** kwargs ) : <EOL> pass <EOL> def SubdCutUVs ( * args , ** kwargs ) : <EOL> pass <EOL> def PruneWire ( * args , ** kwargs ) : <EOL> pass <EOL> def AttachSurfacesOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def UniversalManip ( * args , ** kwargs ) : <EOL> pass <EOL> def TogglePolyDisplayLimitToSelected ( * args , ** kwargs ) : <EOL> pass <EOL> def PrefixHierarchyNames ( * args , ** kwargs ) : <EOL> pass <EOL> def ShowSelectedObjects ( * args , ** kwargs ) : <EOL> pass <EOL> def InteractiveSplitToolOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ConnectComponents ( * args , ** kwargs ) : <EOL> pass <EOL> def DeleteUVs ( * args , ** kwargs ) : <EOL> pass <EOL> def TogglePanelMenubar ( * args , ** kwargs ) : <EOL> pass <EOL> def DeleteCurrentColorSet ( * args , ** kwargs ) : <EOL> pass <EOL> def AnimationTurntable ( * args , ** kwargs ) : <EOL> pass <EOL> def RotateTool ( * args , ** kwargs ) : <EOL> pass <EOL> def FitBSpline ( * args , ** kwargs ) : <EOL> pass <EOL> def PolygonSelectionConstraints ( * args , ** kwargs ) : <EOL> pass <EOL> def AimConstraint ( * args , ** kwargs ) : <EOL> pass <EOL> def ShowFur ( * args , ** kwargs ) : <EOL> pass <EOL> def MergeEdgeTool ( * args , ** kwargs ) : <EOL> pass <EOL> def setNClothStartState ( * args , ** kwargs ) : <EOL> pass <EOL> def DisableConstraints ( * args , ** kwargs ) : <EOL> pass <EOL> def ExtractFace ( * args , ** kwargs ) : <EOL> pass <EOL> def TransferAttributes ( * args , ** kwargs ) : <EOL> pass <EOL> def CloseFrontWindow ( * args , ** kwargs ) : <EOL> pass <EOL> def HideLights ( * args , ** kwargs ) : <EOL> pass <EOL> def CVCurveTool ( * args , ** kwargs ) : <EOL> pass <EOL> def DeleteAllNParticles ( * args , ** kwargs ) : <EOL> pass <EOL> def OffsetEdgeLoopTool ( * args , ** kwargs ) : <EOL> pass <EOL> def FluidGradientsOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def AddPondBoatLocatorOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ShowPolygonsUI ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateFBIKOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ShowPlanes ( * args , ** kwargs ) : <EOL> pass <EOL> def PokePolygonOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectSharedUVInstances ( * args , ** kwargs ) : <EOL> pass <EOL> def CreatePolygonCylinder ( * args , ** kwargs ) : <EOL> pass <EOL> def HideSubdivSurfaces ( * args , ** kwargs ) : <EOL> pass <EOL> def BreakRigidBodyConnection ( * args , ** kwargs ) : <EOL> pass <EOL> def GhostObject ( * args , ** kwargs ) : <EOL> pass <EOL> def CustomNURBSSmoothnessOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def RemoveFromContainerOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ShowStrokes ( * args , ** kwargs ) : <EOL> pass <EOL> def AddKeysTool ( * args , ** kwargs ) : <EOL> pass <EOL> def WrinkleToolOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def PolygonPasteOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ShowLattices ( * args , ** kwargs ) : <EOL> pass <EOL> def DuplicateSpecial ( * args , ** kwargs ) : <EOL> pass <EOL> def geometryExportCacheOpt ( * args , ** kwargs ) : <EOL> pass <EOL> def NextGreasePencilFrame ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectAllSculptObjects ( * args , ** kwargs ) : <EOL> pass <EOL> def GraphDeleteOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def AutobindContainerOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateWrap ( * args , ** kwargs ) : <EOL> pass <EOL> def ZoomTool ( * args , ** kwargs ) : <EOL> pass <EOL> def NewScene ( * args , ** kwargs ) : <EOL> pass <EOL> def GetToonExample ( * args , ** kwargs ) : <EOL> pass <EOL> def ActivateViewport20 ( * args , ** kwargs ) : <EOL> pass <EOL> def AttachBrushToCurves ( * args , ** kwargs ) : <EOL> pass <EOL> def SmokeOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def MakePondMotorBoats ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectAllStrokes ( * args , ** kwargs ) : <EOL> pass <EOL> def NURBSTexturePlacementTool ( * args , ** kwargs ) : <EOL> pass <EOL> def AssignOfflineFileOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def deleteNclothCache ( * args , ** kwargs ) : <EOL> pass <EOL> def InteractiveSplitTool ( * args , ** kwargs ) : <EOL> pass <EOL> def LongPolygonNormals ( * args , ** kwargs ) : <EOL> pass <EOL> def DisplayWireframe ( * args , ** kwargs ) : <EOL> pass <EOL> def InTangentClamped ( * args , ** kwargs ) : <EOL> pass <EOL> def ParentBaseWire ( * args , ** kwargs ) : <EOL> pass <EOL> def DetachSkinOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def NodeEditorToggleShowNamespace ( * args , ** kwargs ) : <EOL> pass <EOL> def ArtPaintSkinWeightsTool ( * args , ** kwargs ) : <EOL> pass <EOL> def ScriptEditor ( * args , ** kwargs ) : <EOL> pass <EOL> def SubdivToNURBSOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def NodeEditorGraphUpDownstream ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleLocalRotationAxes ( * args , ** kwargs ) : <EOL> pass <EOL> def ProjectTangent ( * args , ** kwargs ) : <EOL> pass <EOL> def TimeDraggerToolActivate ( * args , ** kwargs ) : <EOL> pass <EOL> def LayoutUV ( * args , ** kwargs ) : <EOL> pass <EOL> def ConvertSelectionToUVShell ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleKeepHardEdgeCulling ( * args , ** kwargs ) : <EOL> pass <EOL> def EnterEditMode ( * args , ** kwargs ) : <EOL> pass <EOL> def ThreeLeftSplitViewArrangement ( * args , ** kwargs ) : <EOL> pass <EOL> def PasteVertexSkinWeights ( * args , ** kwargs ) : <EOL> pass <EOL> def DeletePolyElements ( * args , ** kwargs ) : <EOL> pass <EOL> def InsertEdgeLoopTool ( * args , ** kwargs ) : <EOL> pass <EOL> def SavePreferences ( * args , ** kwargs ) : <EOL> pass <EOL> def mrShaderManager ( * args , ** kwargs ) : <EOL> pass <EOL> def AlignSurfaces ( * args , ** kwargs ) : <EOL> pass <EOL> def FilePathEditor ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateNURBSSquare ( * args , ** kwargs ) : <EOL> pass <EOL> def Turbulence ( * args , ** kwargs ) : <EOL> pass <EOL> def geometryReplaceCacheFramesOpt ( * args , ** kwargs ) : <EOL> pass <EOL> def MarkingMenuPreferencesWindow ( * args , ** kwargs ) : <EOL> pass <EOL> def SetFluidAttrFromCurveOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleVertexNormalDisplay ( * args , ** kwargs ) : <EOL> pass <EOL> def CharacterSetEditor ( * args , ** kwargs ) : <EOL> pass <EOL> def SmoothSkinWeights ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectToolMarkingMenu ( * args , ** kwargs ) : <EOL> pass <EOL> def OpenCloseCurveOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def HIKCycleMode ( * args , ** kwargs ) : <EOL> pass <EOL> def ResetSoftSelectOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def DeleteAllFurs ( * args , ** kwargs ) : <EOL> pass <EOL> def GeometryToBoundingBox ( * args , ** kwargs ) : <EOL> pass <EOL> def DuplicateNURBSPatchesOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def SmoothHairCurvesOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def geometryReplaceCacheFrames ( * args , ** kwargs ) : <EOL> pass <EOL> def SurfaceFlow ( * args , ** kwargs ) : <EOL> pass <EOL> def NonWeightedTangents ( * args , ** kwargs ) : <EOL> pass <EOL> def ModifyPaintValuePress ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateLattice ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateBezierCurveToolOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def HypershadeOutlinerPerspLayout ( * args , ** kwargs ) : <EOL> pass <EOL> def geometryMergeCache ( * args , ** kwargs ) : <EOL> pass <EOL> def PlayblastWindow ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectObjectsShadowedByLight ( * args , ** kwargs ) : <EOL> pass <EOL> def OutTangentSpline ( * args , ** kwargs ) : <EOL> pass <EOL> def CylindricalProjectionOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def RenderIntoNewWindow ( * args , ** kwargs ) : <EOL> pass <EOL> def WedgePolygonOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ConvertInstanceToObject ( * args , ** kwargs ) : <EOL> pass <EOL> def NodeEditorShapeMenuStateNoShapes ( * args , ** kwargs ) : <EOL> pass <EOL> def RelaxInitialStateOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def WhatsNewHighlightingOff ( * args , ** kwargs ) : <EOL> pass <EOL> def PolygonBooleanUnionOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def WarpImage ( * args , ** kwargs ) : <EOL> pass <EOL> def geometryDeleteCacheOpt ( * args , ** kwargs ) : <EOL> pass <EOL> def NodeEditorRestorePreviousGraph ( * args , ** kwargs ) : <EOL> pass <EOL> def VisorWindow ( * args , ** kwargs ) : <EOL> pass <EOL> def Duplicate ( * args , ** kwargs ) : <EOL> pass <EOL> def BatchBakeOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def PolygonBooleanIntersection ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectAllNParticles ( * args , ** kwargs ) : <EOL> pass <EOL> def TestTexture ( * args , ** kwargs ) : <EOL> pass <EOL> def UpdateReferenceSurface ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateUVsBasedOnCamera ( * args , ** kwargs ) : <EOL> pass <EOL> def SmoothingLevelDecrease ( * args , ** kwargs ) : <EOL> pass <EOL> def NURBSSmoothnessHullOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ReattachSkeleton ( * args , ** kwargs ) : <EOL> pass <EOL> def SimplifyCurveOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def MakeHoleToolOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def InsertKeyToolActivate ( * args , ** kwargs ) : <EOL> pass <EOL> def UntemplateObject ( * args , ** kwargs ) : <EOL> pass <EOL> def DisplacementToPolygon ( * args , ** kwargs ) : <EOL> pass <EOL> def Help ( * args , ** kwargs ) : <EOL> pass <EOL> def PaintSetMembershipTool ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectAllCameras ( * args , ** kwargs ) : <EOL> pass <EOL> def DeleteSurfaceFlowOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def GreasePencilTool ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateSoftBodyOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleFaceMetadata ( * args , ** kwargs ) : <EOL> pass <EOL> def SubdivSmoothnessMedium ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleEditPoints ( * args , ** kwargs ) : <EOL> pass <EOL> def CreatePolygonPyramid ( * args , ** kwargs ) : <EOL> pass <EOL> def LoftOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def PreviousGreasePencilFrame ( * args , ** kwargs ) : <EOL> pass <EOL> def ExportSkinWeightMapsOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleCurrentFrame ( * args , ** kwargs ) : <EOL> pass <EOL> def JointToolOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def PickWalkOut ( * args , ** kwargs ) : <EOL> pass <EOL> def ShareColorInstances ( * args , ** kwargs ) : <EOL> pass <EOL> def DeleteHairCache ( * args , ** kwargs ) : <EOL> pass <EOL> def EnableMemoryCaching ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleContainerCentric ( * args , ** kwargs ) : <EOL> pass <EOL> def DeleteFBIKBodyPartKeys ( * args , ** kwargs ) : <EOL> pass <EOL> def nClothMakeCollide ( * args , ** kwargs ) : <EOL> pass <EOL> def SurfaceBooleanIntersectToolOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def RoundTool ( * args , ** kwargs ) : <EOL> pass <EOL> def OutTangentFixed ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleChannelBox ( * args , ** kwargs ) : <EOL> pass <EOL> def attachFluidCache ( * args , ** kwargs ) : <EOL> pass <EOL> def CreatePointLight ( * args , ** kwargs ) : <EOL> pass <EOL> def IntersectCurveOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def SnapPointToPoint ( * args , ** kwargs ) : <EOL> pass <EOL> def MergeVertexTool ( * args , ** kwargs ) : <EOL> pass <EOL> def ProjectCurveOnMesh ( * args , ** kwargs ) : <EOL> pass <EOL> def ExtrudeFace ( * args , ** kwargs ) : <EOL> pass <EOL> def PlanarProjection ( * args , ** kwargs ) : <EOL> pass <EOL> def SetActiveKey ( * args , ** kwargs ) : <EOL> pass <EOL> def HideNonlinears ( * args , ** kwargs ) : <EOL> pass <EOL> def ChamferVertex ( * args , ** kwargs ) : <EOL> pass <EOL> def DeleteAllSculptObjects ( * args , ** kwargs ) : <EOL> pass <EOL> def HideClothSeams ( * args , ** kwargs ) : <EOL> pass <EOL> def ReverseCurveOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectAllPolygonGeometry ( * args , ** kwargs ) : <EOL> pass <EOL> def FreeTangentWeight ( * args , ** kwargs ) : <EOL> pass <EOL> def AddToContainer ( * args , ** kwargs ) : <EOL> pass <EOL> def RenderViewPrevImage ( * args , ** kwargs ) : <EOL> pass <EOL> def PickColorActivate ( * args , ** kwargs ) : <EOL> pass <EOL> def ModelingPanelUndoViewChange ( * args , ** kwargs ) : <EOL> pass <EOL> def FloatSelectedObjects ( * args , ** kwargs ) : <EOL> pass <EOL> def PolygonBooleanUnion ( * args , ** kwargs ) : <EOL> pass <EOL> def Create3DContainerOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def PerspGraphLayout ( * args , ** kwargs ) : <EOL> pass <EOL> def BrushAnimationMarkingMenuPopDown ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectHierarchy ( * args , ** kwargs ) : <EOL> pass <EOL> def AssignHairConstraintOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def PencilCurveTool ( * args , ** kwargs ) : <EOL> pass <EOL> def geometryCacheOpt ( * args , ** kwargs ) : <EOL> pass <EOL> def FireOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def CutPolygon ( * args , ** kwargs ) : <EOL> pass <EOL> def SetStrokeControlCurves ( * args , ** kwargs ) : <EOL> pass <EOL> def RemoveWire ( * args , ** kwargs ) : <EOL> pass <EOL> def PartitionEditor ( * args , ** kwargs ) : <EOL> pass <EOL> def PostInfinityCycle ( * args , ** kwargs ) : <EOL> pass <EOL> def ShowNCloths ( * args , ** kwargs ) : <EOL> pass <EOL> def Unparent ( * args , ** kwargs ) : <EOL> pass <EOL> def PolySpinEdgeBackward ( * args , ** kwargs ) : <EOL> pass <EOL> def EditFluidResolution ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleOppositeFlagOfSelectedShapes ( * args , ** kwargs ) : <EOL> pass <EOL> def ParticleInstancerOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectComponentToolMarkingMenu ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleFrameRate ( * args , ** kwargs ) : <EOL> pass <EOL> def CurveFlow ( * args , ** kwargs ) : <EOL> pass <EOL> def FBIKReachKeyingOptionFK ( * args , ** kwargs ) : <EOL> pass <EOL> def fluidMergeCacheOpt ( * args , ** kwargs ) : <EOL> pass <EOL> def GoToFBIKStancePose ( * args , ** kwargs ) : <EOL> pass <EOL> def AddBoatLocator ( * args , ** kwargs ) : <EOL> pass <EOL> def SetFullBodyIKKeysSelected ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateSubdivPlane ( * args , ** kwargs ) : <EOL> pass <EOL> def MarkingMenuPopDown ( * args , ** kwargs ) : <EOL> pass <EOL> def fluidDeleteCacheFrames ( * args , ** kwargs ) : <EOL> pass <EOL> def UnghostObject ( * args , ** kwargs ) : <EOL> pass <EOL> def PerspRelationshipEditorLayout ( * args , ** kwargs ) : <EOL> pass <EOL> def QualityDisplayMarkingMenuPopDown ( * args , ** kwargs ) : <EOL> pass <EOL> def nucleusGetEffectsAsset ( * args , ** kwargs ) : <EOL> pass <EOL> def MakeBrushSpringOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def Undo ( * args , ** kwargs ) : <EOL> pass <EOL> def ParticleFill ( * args , ** kwargs ) : <EOL> pass <EOL> def nucleusDisplayMaterialNodes ( * args , ** kwargs ) : <EOL> pass <EOL> def AddToCurrentSceneSoftimage ( * args , ** kwargs ) : <EOL> pass <EOL> def DisableFluids ( * args , ** kwargs ) : <EOL> pass <EOL> def HIKPinTranslate ( * args , ** kwargs ) : <EOL> pass <EOL> def PaintGridOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def SurfaceBooleanSubtractTool ( * args , ** kwargs ) : <EOL> pass <EOL> def NodeEditorGraphUpstream ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateReferenceOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def TwistOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def StraightenUVBorder ( * args , ** kwargs ) : <EOL> pass <EOL> def PruneSmallWeights ( * args , ** kwargs ) : <EOL> pass <EOL> def UnitizeUVs ( * args , ** kwargs ) : <EOL> pass <EOL> def RotateToolMarkingMenuPopDown ( * args , ** kwargs ) : <EOL> pass <EOL> def DeleteAllNonLinearDeformers ( * args , ** kwargs ) : <EOL> pass <EOL> def AddPfxToHairSystem ( * args , ** kwargs ) : <EOL> pass <EOL> def PreInfinityOscillate ( * args , ** kwargs ) : <EOL> pass <EOL> def ExportOfflineFileFromRefEd ( * args , ** kwargs ) : <EOL> pass <EOL> def PerspGraphOutlinerLayout ( * args , ** kwargs ) : <EOL> pass <EOL> def DeleteTextureReferenceObject ( * args , ** kwargs ) : <EOL> pass <EOL> def AddMissingFBIKEffectorsOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def nClothCache ( * args , ** kwargs ) : <EOL> pass <EOL> def AnimationSweep ( * args , ** kwargs ) : <EOL> pass <EOL> def AddKeyToolActivate ( * args , ** kwargs ) : <EOL> pass <EOL> def Fireworks ( * args , ** kwargs ) : <EOL> pass <EOL> def HoldCurrentKeys ( * args , ** kwargs ) : <EOL> pass <EOL> def AddWrapInfluence ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateOceanWake ( * args , ** kwargs ) : <EOL> pass <EOL> def ShowFluids ( * args , ** kwargs ) : <EOL> pass <EOL> def AddHolder ( * args , ** kwargs ) : <EOL> pass <EOL> def SplitUV ( * args , ** kwargs ) : <EOL> pass <EOL> def ExtendSurfaces ( * args , ** kwargs ) : <EOL> pass <EOL> def TransferAttributeValues ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectVertexFaceMask ( * args , ** kwargs ) : <EOL> pass <EOL> def HideLattices ( * args , ** kwargs ) : <EOL> pass <EOL> def RebuildSurfacesOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def DeleteAllMotionPaths ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateLatticeOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def OffsetCurveOnSurfaceOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ResetWeightsToDefault ( * args , ** kwargs ) : <EOL> pass <EOL> def SoftModToolOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def FluidEmitterOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ModifyUpperRadiusRelease ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateNURBSCone ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleIKHandleSnap ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateExpressionClipOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def IKSplineHandleToolOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateHairCache ( * args , ** kwargs ) : <EOL> pass <EOL> def ApplySettingsToLastStroke ( * args , ** kwargs ) : <EOL> pass <EOL> def PointOnPolyConstraintOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectPreviousObjectsSoftimage ( * args , ** kwargs ) : <EOL> pass <EOL> def HideStrokePathCurves ( * args , ** kwargs ) : <EOL> pass <EOL> def BoundaryOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ShowCameras ( * args , ** kwargs ) : <EOL> pass <EOL> def AddPondDynamicBuoy ( * args , ** kwargs ) : <EOL> pass <EOL> def LayerRelationshipEditor ( * args , ** kwargs ) : <EOL> pass <EOL> def CustomNURBSComponentsOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ShowAttributeEditorOrChannelBox ( * args , ** kwargs ) : <EOL> pass <EOL> def BrushPresetBlendShape ( * args , ** kwargs ) : <EOL> pass <EOL> def RemoveConstraintTargetOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def Create2DContainerEmitterOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def SetDrivenKey ( * args , ** kwargs ) : <EOL> pass <EOL> def PolygonNormalEditTool ( * args , ** kwargs ) : <EOL> pass <EOL> def ShowAll ( * args , ** kwargs ) : <EOL> pass <EOL> def ShowKinematics ( * args , ** kwargs ) : <EOL> pass <EOL> def CopyVertexSkinWeights ( * args , ** kwargs ) : <EOL> pass <EOL> def Shatter ( * args , ** kwargs ) : <EOL> pass <EOL> def DuplicateNURBSPatches ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleMeshFaces ( * args , ** kwargs ) : <EOL> pass <EOL> def BreakTangent ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectAllRigidBodies ( * args , ** kwargs ) : <EOL> pass <EOL> def GraphCutOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def MoveRotateScaleTool ( * args , ** kwargs ) : <EOL> pass <EOL> def OffsetCurveOnSurface ( * args , ** kwargs ) : <EOL> pass <EOL> def AutoProjectionOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateWake ( * args , ** kwargs ) : <EOL> pass <EOL> def Boundary ( * args , ** kwargs ) : <EOL> pass <EOL> def HideBoundingBox ( * args , ** kwargs ) : <EOL> pass <EOL> def SwapBlendShape ( * args , ** kwargs ) : <EOL> pass <EOL> def NURBSToPolygons ( * args , ** kwargs ) : <EOL> pass <EOL> def Redo ( * args , ** kwargs ) : <EOL> pass <EOL> def MoveNearestPickedKeyToolDeactivate ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleGrid ( * args , ** kwargs ) : <EOL> pass <EOL> def TranslateToolWithSnapMarkingMenu ( * args , ** kwargs ) : <EOL> pass <EOL> def MakePondBoats ( * args , ** kwargs ) : <EOL> pass <EOL> def ModifyUpperRadiusPress ( * args , ** kwargs ) : <EOL> pass <EOL> def deleteGeometryCache ( * args , ** kwargs ) : <EOL> pass <EOL> def InteractiveBindSkinOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def TransformNoSelectOnTool ( * args , ** kwargs ) : <EOL> pass <EOL> def ImportSkinWeightMaps ( * args , ** kwargs ) : <EOL> pass <EOL> def ParameterTool ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateIllustratorCurves ( * args , ** kwargs ) : <EOL> pass <EOL> def HIKBodyPartMode ( * args , ** kwargs ) : <EOL> pass <EOL> def NodeEditorShowConnectedAttrs ( * args , ** kwargs ) : <EOL> pass <EOL> def ScaleToolWithSnapMarkingMenu ( * args , ** kwargs ) : <EOL> pass <EOL> def NodeEditorGraphAddSelected ( * args , ** kwargs ) : <EOL> pass <EOL> def CreatePolygonToolOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ProjectCurveOnSurface ( * args , ** kwargs ) : <EOL> pass <EOL> def LatticeDeformKeysToolOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def SetKeyRotate ( * args , ** kwargs ) : <EOL> pass <EOL> def PasteKeysOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def nClothReplaceFrames ( * args , ** kwargs ) : <EOL> pass <EOL> def TangetConstraintOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def SaveFluidStateAs ( * args , ** kwargs ) : <EOL> pass <EOL> def mrMapVisualizer ( * args , ** kwargs ) : <EOL> pass <EOL> def AlignCurve ( * args , ** kwargs ) : <EOL> pass <EOL> def SoftModDeformer ( * args , ** kwargs ) : <EOL> pass <EOL> def FBIKReachKeyingOptionSimple ( * args , ** kwargs ) : <EOL> pass <EOL> def PolyExtrudeOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def SetEditor ( * args , ** kwargs ) : <EOL> pass <EOL> def CreatePondOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleVertIDs ( * args , ** kwargs ) : <EOL> pass <EOL> def DeleteChannels ( * args , ** kwargs ) : <EOL> pass <EOL> def CreatePoseOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def HideFollicles ( * args , ** kwargs ) : <EOL> pass <EOL> def GeometryConstraint ( * args , ** kwargs ) : <EOL> pass <EOL> def AddWireOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def AddKeysToolOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ResampleCurve ( * args , ** kwargs ) : <EOL> pass <EOL> def ModifyOpacityPress ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateJiggleDeformer ( * args , ** kwargs ) : <EOL> pass <EOL> def PolyEditEdgeFlow ( * args , ** kwargs ) : <EOL> pass <EOL> def HypergraphIncreaseDepth ( * args , ** kwargs ) : <EOL> pass <EOL> def TangentsFlat ( * args , ** kwargs ) : <EOL> pass <EOL> def CopyFlexor ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateConstraintClip ( * args , ** kwargs ) : <EOL> pass <EOL> def Birail1Options ( * args , ** kwargs ) : <EOL> pass <EOL> def CycleThroughCameras ( * args , ** kwargs ) : <EOL> pass <EOL> def PlaybackForward ( * args , ** kwargs ) : <EOL> pass <EOL> def RenderFlagsWindow ( * args , ** kwargs ) : <EOL> pass <EOL> def OutlinerWindow ( * args , ** kwargs ) : <EOL> pass <EOL> def RegionKeysTool ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateCameraFromView ( * args , ** kwargs ) : <EOL> pass <EOL> def ChannelControlEditor ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateCluster ( * args , ** kwargs ) : <EOL> pass <EOL> def EmitFromObject ( * args , ** kwargs ) : <EOL> pass <EOL> def TangentsAuto ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectPreviousObjectsMudbox ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectCurveCVsLast ( * args , ** kwargs ) : <EOL> pass <EOL> def OrientConstraintOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def BaseLevelComponentDisplay ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectAllMarkingMenuPopDown ( * args , ** kwargs ) : <EOL> pass <EOL> def NodeEditorExtendToShapes ( * args , ** kwargs ) : <EOL> pass <EOL> def TrimToolOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateTextOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def SmoothingDisplayShowBoth ( * args , ** kwargs ) : <EOL> pass <EOL> def RandomizeFolliclesOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleTangentDisplay ( * args , ** kwargs ) : <EOL> pass <EOL> def BakeNonDefHistory ( * args , ** kwargs ) : <EOL> pass <EOL> def ShrinkPolygonSelectionRegion ( * args , ** kwargs ) : <EOL> pass <EOL> def MakeFluidCollideOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def InsertIsoparmsOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def DisableSnapshots ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateBlendShape ( * args , ** kwargs ) : <EOL> pass <EOL> def PaintReduceWeightsTool ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectAllAssets ( * args , ** kwargs ) : <EOL> pass <EOL> def Gravity ( * args , ** kwargs ) : <EOL> pass <EOL> def AssignBrushToHairSystem ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateShotOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def SubdivSmoothnessHull ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleRangeSlider ( * args , ** kwargs ) : <EOL> pass <EOL> def CreatePolygonPrism ( * args , ** kwargs ) : <EOL> pass <EOL> def HypergraphDecreaseDepth ( * args , ** kwargs ) : <EOL> pass <EOL> def LockTangentWeight ( * args , ** kwargs ) : <EOL> pass <EOL> def PrevSkinPaintMode ( * args , ** kwargs ) : <EOL> pass <EOL> def ExportSelectionOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def InvertSelection ( * args , ** kwargs ) : <EOL> pass <EOL> def ConnectToTime ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleParticleCount ( * args , ** kwargs ) : <EOL> pass <EOL> def DeleteExpressionsOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def AppendToPolygonToolOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def RotateToolWithSnapMarkingMenuPopDown ( * args , ** kwargs ) : <EOL> pass <EOL> def FlipTubeDirection ( * args , ** kwargs ) : <EOL> pass <EOL> def PolygonSoftenEdge ( * args , ** kwargs ) : <EOL> pass <EOL> def CreatePassiveRigidBodyOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def SnapKeys ( * args , ** kwargs ) : <EOL> pass <EOL> def MergeUV ( * args , ** kwargs ) : <EOL> pass <EOL> def PolygonHardenEdge ( * args , ** kwargs ) : <EOL> pass <EOL> def ExtrudeEdge ( * args , ** kwargs ) : <EOL> pass <EOL> def TranslateToolMarkingMenu ( * args , ** kwargs ) : <EOL> pass <EOL> def SeparatePolygon ( * args , ** kwargs ) : <EOL> pass <EOL> def HideNURBSCurves ( * args , ** kwargs ) : <EOL> pass <EOL> def PolygonClearClipboard ( * args , ** kwargs ) : <EOL> pass <EOL> def CancelBatchRender ( * args , ** kwargs ) : <EOL> pass <EOL> def DeleteAllRigidBodies ( * args , ** kwargs ) : <EOL> pass <EOL> def HideClothPanelCurves ( * args , ** kwargs ) : <EOL> pass <EOL> def RetimeKeysToolOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def PolygonBooleanDifferenceOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def AddPondSurfaceLocator ( * args , ** kwargs ) : <EOL> pass <EOL> def CycleFBIKReachKeyingOption ( * args , ** kwargs ) : <EOL> pass <EOL> def RenderTextureRangeOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateGhostOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def Create3DContainerEmitter ( * args , ** kwargs ) : <EOL> pass <EOL> def ShowNonlinears ( * args , ** kwargs ) : <EOL> pass <EOL> def HideWrapInfluences ( * args , ** kwargs ) : <EOL> pass <EOL> def BridgeEdgeOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectFacePath ( * args , ** kwargs ) : <EOL> pass <EOL> def BendOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def CutKeys ( * args , ** kwargs ) : <EOL> pass <EOL> def GetOceanPondExample ( * args , ** kwargs ) : <EOL> pass <EOL> def RemoveSubdivProxyMirror ( * args , ** kwargs ) : <EOL> pass <EOL> def PositionAlongCurve ( * args , ** kwargs ) : <EOL> pass <EOL> def geometryReplaceCacheOpt ( * args , ** kwargs ) : <EOL> pass <EOL> def ShowMarkers ( * args , ** kwargs ) : <EOL> pass <EOL> def EPCurveToolOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleNormals ( * args , ** kwargs ) : <EOL> pass <EOL> def NextKey ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectBorderEdgeTool ( * args , ** kwargs ) : <EOL> pass <EOL> def PolyConvertToLoopAndDelete ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleFkSkeletonVisibility ( * args , ** kwargs ) : <EOL> pass <EOL> def BakeChannel ( * args , ** kwargs ) : <EOL> pass <EOL> def CurveFillet ( * args , ** kwargs ) : <EOL> pass <EOL> def DeleteStaticChannelsOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def AddBlendShape ( * args , ** kwargs ) : <EOL> pass <EOL> def AttachCurve ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateSubdivCube ( * args , ** kwargs ) : <EOL> pass <EOL> def SmoothHairCurves ( * args , ** kwargs ) : <EOL> pass <EOL> def MakeUVInstanceCurrent ( * args , ** kwargs ) : <EOL> pass <EOL> def NURBSTexturePlacementToolOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ConvertSelectionToEdges ( * args , ** kwargs ) : <EOL> pass <EOL> def QuadrangulateOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def MakeBoatsOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def DopeSheetEditor ( * args , ** kwargs ) : <EOL> pass <EOL> def NURBSSmoothnessMedium ( * args , ** kwargs ) : <EOL> pass <EOL> def InTangentSpline ( * args , ** kwargs ) : <EOL> pass <EOL> def PartialCreaseSubdivSurface ( * args , ** kwargs ) : <EOL> pass <EOL> def HIKLiveConnectionTool ( * args , ** kwargs ) : <EOL> pass <EOL> def NodeEditorUnpinSelected ( * args , ** kwargs ) : <EOL> pass <EOL> def PaintGeomCacheToolOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def SculptPolygonsTool ( * args , ** kwargs ) : <EOL> pass <EOL> def SurfaceBooleanIntersectTool ( * args , ** kwargs ) : <EOL> pass <EOL> def NCreateEmitter ( * args , ** kwargs ) : <EOL> pass <EOL> def ArtPaintAttrTool ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateQuickSelectSet ( * args , ** kwargs ) : <EOL> pass <EOL> def ArtPaintBlendShapeWeightsTool ( * args , ** kwargs ) : <EOL> pass <EOL> def StraightenCurves ( * args , ** kwargs ) : <EOL> pass <EOL> def PruneLattice ( * args , ** kwargs ) : <EOL> pass <EOL> def TimeDraggerToolDeactivate ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleKeepWireCulling ( * args , ** kwargs ) : <EOL> pass <EOL> def Lightning ( * args , ** kwargs ) : <EOL> pass <EOL> def ExportDeformerWeightsOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ThreePointArcTool ( * args , ** kwargs ) : <EOL> pass <EOL> def NodeEditorShowAllAttrs ( * args , ** kwargs ) : <EOL> pass <EOL> def PerspGraphHypergraphLayout ( * args , ** kwargs ) : <EOL> pass <EOL> def DeleteSurfaceFlow ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleHulls ( * args , ** kwargs ) : <EOL> pass <EOL> def MoveNormalToolOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ScaleConstraint ( * args , ** kwargs ) : <EOL> pass <EOL> def HideAll ( * args , ** kwargs ) : <EOL> pass <EOL> def AnimationSnapshot ( * args , ** kwargs ) : <EOL> pass <EOL> def WaveOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateSetOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def IncrementAndSave ( * args , ** kwargs ) : <EOL> pass <EOL> def RevolveOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def Fire ( * args , ** kwargs ) : <EOL> pass <EOL> def MirrorSubdivSurface ( * args , ** kwargs ) : <EOL> pass <EOL> def TemplateBrushSettings ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleFastInteraction ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateOcean ( * args , ** kwargs ) : <EOL> pass <EOL> def ShowDynamicsUI ( * args , ** kwargs ) : <EOL> pass <EOL> def TangentsSpline ( * args , ** kwargs ) : <EOL> pass <EOL> def SetFullBodyIKKeysBodyPart ( * args , ** kwargs ) : <EOL> pass <EOL> def ToolSettingsWindow ( * args , ** kwargs ) : <EOL> pass <EOL> def ClearCurrentCharacterList ( * args , ** kwargs ) : <EOL> pass <EOL> def TangentsClamped ( * args , ** kwargs ) : <EOL> pass <EOL> def HideJoints ( * args , ** kwargs ) : <EOL> pass <EOL> def OptimizeScene ( * args , ** kwargs ) : <EOL> pass <EOL> def BrushPresetBlendShapeOff ( * args , ** kwargs ) : <EOL> pass <EOL> def DeleteAllLattices ( * args , ** kwargs ) : <EOL> pass <EOL> def SmoothPolygon ( * args , ** kwargs ) : <EOL> pass <EOL> def SurfaceFlowOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def OffsetCurve ( * args , ** kwargs ) : <EOL> pass <EOL> def ResetTransformations ( * args , ** kwargs ) : <EOL> pass <EOL> def VortexOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def FlowPathObjectOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ModifyUVVectorRelease ( * args , ** kwargs ) : <EOL> pass <EOL> def SmoothBindSkinOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def GridOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateEmptyUVSetOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def IKHandleToolOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ConvertSelectionToVertexFaces ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateRigidBodySolver ( * args , ** kwargs ) : <EOL> pass <EOL> def PointOnCurveOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectPreviousObjectsMotionBuilder ( * args , ** kwargs ) : <EOL> pass <EOL> def HideSmoothSkinInfluences ( * args , ** kwargs ) : <EOL> pass <EOL> def BothProxySubdivDisplay ( * args , ** kwargs ) : <EOL> pass <EOL> def DefaultQualityDisplay ( * args , ** kwargs ) : <EOL> pass <EOL> def HideUIElements ( * args , ** kwargs ) : <EOL> pass <EOL> def CurveUtilitiesMarkingMenu ( * args , ** kwargs ) : <EOL> pass <EOL> def WeightedTangents ( * args , ** kwargs ) : <EOL> pass <EOL> def RemoveBrushSharing ( * args , ** kwargs ) : <EOL> pass <EOL> def ShowShadingGroupAttributeEditor ( * args , ** kwargs ) : <EOL> pass <EOL> def WarpImageOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ConnectJointOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def WireDropoffLocatorOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def PolygonCopyOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def NodeEditorSetTraversalDepthUnlim ( * args , ** kwargs ) : <EOL> pass <EOL> def ComponentEditor ( * args , ** kwargs ) : <EOL> pass <EOL> def VolumeAxis ( * args , ** kwargs ) : <EOL> pass <EOL> def DuplicateFace ( * args , ** kwargs ) : <EOL> pass <EOL> def BendCurvesOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def NodeEditorPinByDefault ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectAllParticles ( * args , ** kwargs ) : <EOL> pass <EOL> def GraphCopyOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def UseSelectedEmitter ( * args , ** kwargs ) : <EOL> pass <EOL> def AutoPaintMarkingMenuPopDown ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateVolumeLightOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def GetHairExample ( * args , ** kwargs ) : <EOL> pass <EOL> def AbortCurrentTool ( * args , ** kwargs ) : <EOL> pass <EOL> def UpdateCurrentSceneMotionBuilder ( * args , ** kwargs ) : <EOL> pass <EOL> def CoarsenSelectedComponents ( * args , ** kwargs ) : <EOL> pass <EOL> def SingleViewArrangement ( * args , ** kwargs ) : <EOL> pass <EOL> def MakeMotorBoatsOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def UntrimSurfaces ( * args , ** kwargs ) : <EOL> pass <EOL> def HypershadePerspLayout ( * args , ** kwargs ) : <EOL> pass <EOL> def InsertKnotOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def DisplayShadedAndTextured ( * args , ** kwargs ) : <EOL> pass <EOL> def SculptReferenceVectorMarkingMenuPress ( * args , ** kwargs ) : <EOL> pass <EOL> def ImportDeformerWeightsOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def PanePop ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectAllFurs ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleFaceNormalDisplay ( * args , ** kwargs ) : <EOL> pass <EOL> def GroupOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ScaleToolMarkingMenuPopDown ( * args , ** kwargs ) : <EOL> pass <EOL> def SubdivSurfaceHierarchyMode ( * args , ** kwargs ) : <EOL> pass <EOL> def DeleteSelectedContainers ( * args , ** kwargs ) : <EOL> pass <EOL> def CreatePolygonSphereOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ScaleToolOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ExtendCurveOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleCustomNURBSComponents ( * args , ** kwargs ) : <EOL> pass <EOL> def LastActionTool ( * args , ** kwargs ) : <EOL> pass <EOL> def PixelMoveRight ( * args , ** kwargs ) : <EOL> pass <EOL> def EnableParticles ( * args , ** kwargs ) : <EOL> pass <EOL> def IPRRenderIntoNewWindow ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleCreaseEdges ( * args , ** kwargs ) : <EOL> pass <EOL> def CoarseLevelComponentDisplay ( * args , ** kwargs ) : <EOL> pass <EOL> def DeleteKeys ( * args , ** kwargs ) : <EOL> pass <EOL> def nClothReplaceCache ( * args , ** kwargs ) : <EOL> pass <EOL> def SaveBrushPreset ( * args , ** kwargs ) : <EOL> pass <EOL> def CreatePolygonCube ( * args , ** kwargs ) : <EOL> pass <EOL> def SubdividePolygonOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def SnapToPixel ( * args , ** kwargs ) : <EOL> pass <EOL> def MirrorCutPolygonGeometryOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ConvertSelectionToShell ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateNURBSPlane ( * args , ** kwargs ) : <EOL> pass <EOL> def TrimTool ( * args , ** kwargs ) : <EOL> pass <EOL> def PlanarProjectionOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleAttributeEditor ( * args , ** kwargs ) : <EOL> pass <EOL> def PreviousKey ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleUVs ( * args , ** kwargs ) : <EOL> pass <EOL> def ChangeUVSize ( * args , ** kwargs ) : <EOL> pass <EOL> def DeleteAllWires ( * args , ** kwargs ) : <EOL> pass <EOL> def HideFkSkeleton ( * args , ** kwargs ) : <EOL> pass <EOL> def DeleteAllContainers ( * args , ** kwargs ) : <EOL> pass <EOL> def FullCreaseSubdivSurface ( * args , ** kwargs ) : <EOL> pass <EOL> def MoveSkinJointsToolOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def PickWalkRight ( * args , ** kwargs ) : <EOL> pass <EOL> def SculptSurfacesTool ( * args , ** kwargs ) : <EOL> pass <EOL> def ReplaceObjectsOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ModifyLowerRadiusPress ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateImagePlane ( * args , ** kwargs ) : <EOL> pass <EOL> def ShareUVInstances ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateAnnotateNode ( * args , ** kwargs ) : <EOL> pass <EOL> def UnpublishRootTransform ( * args , ** kwargs ) : <EOL> pass <EOL> def clearNClothStartState ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleSelectDetails ( * args , ** kwargs ) : <EOL> pass <EOL> def PaintGeomCacheTool ( * args , ** kwargs ) : <EOL> pass <EOL> def SetWorkingFrame ( * args , ** kwargs ) : <EOL> pass <EOL> def ConvertToBreakdown ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectMaskToolMarkingMenuPopDown ( * args , ** kwargs ) : <EOL> pass <EOL> def PencilCurveToolOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def BevelPolygonOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def SetTimecode ( * args , ** kwargs ) : <EOL> pass <EOL> def RenameCurrentUVSet ( * args , ** kwargs ) : <EOL> pass <EOL> def HIKToggleReleasePinning ( * args , ** kwargs ) : <EOL> pass <EOL> def SetPreferredAngleOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ReferenceEditor ( * args , ** kwargs ) : <EOL> pass <EOL> def UnpublishChildAnchor ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateClip ( * args , ** kwargs ) : <EOL> pass <EOL> def EmitFluidFromObject ( * args , ** kwargs ) : <EOL> pass <EOL> def UnpublishAttributes ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectCurveCVsAll ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleFaceNormals ( * args , ** kwargs ) : <EOL> pass <EOL> def SetKeyPath ( * args , ** kwargs ) : <EOL> pass <EOL> def BakeSpringAnimationOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectAllLights ( * args , ** kwargs ) : <EOL> pass <EOL> def Goal ( * args , ** kwargs ) : <EOL> pass <EOL> def AddDynamicBuoy ( * args , ** kwargs ) : <EOL> pass <EOL> def ModelingPanelRedoViewChange ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateSubdivTorus ( * args , ** kwargs ) : <EOL> pass <EOL> def SmoothSkinWeightsOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ScaleCurvature ( * args , ** kwargs ) : <EOL> pass <EOL> def NParticleToolOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def RaiseMainWindow ( * args , ** kwargs ) : <EOL> pass <EOL> def MirrorPolygonGeometryOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def nucleusGetnClothExample ( * args , ** kwargs ) : <EOL> pass <EOL> def MakeCurvesDynamicOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def fluidAppend ( * args , ** kwargs ) : <EOL> pass <EOL> def UndoCanvas ( * args , ** kwargs ) : <EOL> pass <EOL> def BrushPresetReplaceShadingOff ( * args , ** kwargs ) : <EOL> pass <EOL> def InsertEdgeLoopToolOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ParticleToolOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def nucleusDisplayNComponentNodes ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleFaceIDs ( * args , ** kwargs ) : <EOL> pass <EOL> def DisableRigidBodies ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleFBIKEffectorsPinState ( * args , ** kwargs ) : <EOL> pass <EOL> def UIModeMarkingMenuPopDown ( * args , ** kwargs ) : <EOL> pass <EOL> def BakeSimulationOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def PaintRandom ( * args , ** kwargs ) : <EOL> pass <EOL> def SculptSurfacesToolOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def PaintEffectsTool ( * args , ** kwargs ) : <EOL> pass <EOL> def GraphSnap ( * args , ** kwargs ) : <EOL> pass <EOL> def ArtPaintSkinWeightsToolOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def SubdivSmoothnessFine ( * args , ** kwargs ) : <EOL> pass <EOL> def CreatePolygonPlane ( * args , ** kwargs ) : <EOL> pass <EOL> def LockCurveLength ( * args , ** kwargs ) : <EOL> pass <EOL> def PreloadReferenceEditor ( * args , ** kwargs ) : <EOL> pass <EOL> def ExportProxyContainerOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def IntersectSurfaces ( * args , ** kwargs ) : <EOL> pass <EOL> def PickColorDeactivate ( * args , ** kwargs ) : <EOL> pass <EOL> def DetachCurve ( * args , ** kwargs ) : <EOL> pass <EOL> def AddOceanDynamicLocator ( * args , ** kwargs ) : <EOL> pass <EOL> def DeleteMemoryCaching ( * args , ** kwargs ) : <EOL> pass <EOL> def DeleteEntireHairSystem ( * args , ** kwargs ) : <EOL> pass <EOL> def nClothDeleteCacheFramesOpt ( * args , ** kwargs ) : <EOL> pass <EOL> def AppendToHairCacheOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def AddKeyToolDeactivate ( * args , ** kwargs ) : <EOL> pass <EOL> def RotateToolOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def FlareOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def AirOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def CreatePartitionOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def SquashOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def MergeMultipleEdgesOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def SplitVertex ( * args , ** kwargs ) : <EOL> pass <EOL> def ExtractSubdivSurfaceVerticesOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ClusterCurve ( * args , ** kwargs ) : <EOL> pass <EOL> def SendAsNewSceneMudbox ( * args , ** kwargs ) : <EOL> pass <EOL> def HideNParticles ( * args , ** kwargs ) : <EOL> pass <EOL> def SplitMeshWithProjectedCurve ( * args , ** kwargs ) : <EOL> pass <EOL> def AddToCurrentSceneMotionBuilder ( * args , ** kwargs ) : <EOL> pass <EOL> def CVHardnessOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def DeleteAllParticles ( * args , ** kwargs ) : <EOL> pass <EOL> def HideCameras ( * args , ** kwargs ) : <EOL> pass <EOL> def RestoreUIElements ( * args , ** kwargs ) : <EOL> pass <EOL> def SphericalProjection ( * args , ** kwargs ) : <EOL> pass <EOL> def GetFBIKExample ( * args , ** kwargs ) : <EOL> pass <EOL> def FrameAll ( * args , ** kwargs ) : <EOL> pass <EOL> def AddPondDynamicLocator ( * args , ** kwargs ) : <EOL> pass <EOL> def RenderPassSetEditor ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateFluidCacheOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def FullHotboxDisplay ( * args , ** kwargs ) : <EOL> pass <EOL> def Create2DContainerOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectSimilarOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def PaintEffectsToNurbs ( * args , ** kwargs ) : <EOL> pass <EOL> def ShowCloth ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectEdgeRingSp ( * args , ** kwargs ) : <EOL> pass <EOL> def CutCurve ( * args , ** kwargs ) : <EOL> pass <EOL> def ShowBaseWire ( * args , ** kwargs ) : <EOL> pass <EOL> def RemoveJoint ( * args , ** kwargs ) : <EOL> pass <EOL> def attachGeometryCache ( * args , ** kwargs ) : <EOL> pass <EOL> def PolygonSoftenHarden ( * args , ** kwargs ) : <EOL> pass <EOL> def ShowAllComponents ( * args , ** kwargs ) : <EOL> pass <EOL> def BrushPresetBlend ( * args , ** kwargs ) : <EOL> pass <EOL> def CreaseProxyEdgeTool ( * args , ** kwargs ) : <EOL> pass <EOL> def MoveTool ( * args , ** kwargs ) : <EOL> pass <EOL> def SetBreakdownKey ( * args , ** kwargs ) : <EOL> pass <EOL> def AddToCurrentSceneMudbox ( * args , ** kwargs ) : <EOL> pass <EOL> def DynamicRelationshipEditor ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleCVs ( * args , ** kwargs ) : <EOL> pass <EOL> def OffsetSurfacesOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def BreakTangents ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectAllTransforms ( * args , ** kwargs ) : <EOL> pass <EOL> def MoveRotateScaleToolToggleSnapMode ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleFbikDetails ( * args , ** kwargs ) : <EOL> pass <EOL> def AverageVertex ( * args , ** kwargs ) : <EOL> pass <EOL> def CustomPolygonDisplayOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def GlobalStitch ( * args , ** kwargs ) : <EOL> pass <EOL> def AddAttribute ( * args , ** kwargs ) : <EOL> pass <EOL> def MoveNormalTool ( * args , ** kwargs ) : <EOL> pass <EOL> def SmoothCurve ( * args , ** kwargs ) : <EOL> pass <EOL> def MakePressureCurveOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectToolOptionsMarkingMenu ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleChannelsLayers ( * args , ** kwargs ) : <EOL> pass <EOL> def PublishRootTransformOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def TransformPolygonComponent ( * args , ** kwargs ) : <EOL> pass <EOL> def LowQualityDisplay ( * args , ** kwargs ) : <EOL> pass <EOL> def DoUnghostOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ParentConstraintOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def DeviceEditor ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleCreaseVertices ( * args , ** kwargs ) : <EOL> pass <EOL> def AttachCurveOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ModifyLowerRadiusRelease ( * args , ** kwargs ) : <EOL> pass <EOL> def SculptGeometryTool ( * args , ** kwargs ) : <EOL> pass <EOL> def SubstituteGeometry ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleViewAxis ( * args , ** kwargs ) : <EOL> pass <EOL> def NodeEditorGraphNoShapes ( * args , ** kwargs ) : <EOL> pass <EOL> def CreatePose ( * args , ** kwargs ) : <EOL> pass <EOL> def ModifyConstraintAxis ( * args , ** kwargs ) : <EOL> pass <EOL> def ProportionalModificationTool ( * args , ** kwargs ) : <EOL> pass <EOL> def LevelOfDetailUngroup ( * args , ** kwargs ) : <EOL> pass <EOL> def CurveFilletOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def PreInfinityConstant ( * args , ** kwargs ) : <EOL> pass <EOL> def ExportAnimOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def PerPointEmissionRates ( * args , ** kwargs ) : <EOL> pass <EOL> def DeleteStaticChannels ( * args , ** kwargs ) : <EOL> pass <EOL> def SaveSceneAsOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def AddBoatLocatorOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleBackfaceGeometry ( * args , ** kwargs ) : <EOL> pass <EOL> def AlignUVOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def HotkeyPreferencesWindow ( * args , ** kwargs ) : <EOL> pass <EOL> def ReverseSurfaceDirectionOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def MirrorSkinWeights ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateNURBSTorusOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ShowDeformingGeometry ( * args , ** kwargs ) : <EOL> pass <EOL> def ActivateGlobalScreenSlider ( * args , ** kwargs ) : <EOL> pass <EOL> def MediumPolygonNormals ( * args , ** kwargs ) : <EOL> pass <EOL> def HideUnselectedCVs ( * args , ** kwargs ) : <EOL> pass <EOL> def SetFullBodyIKKeys ( * args , ** kwargs ) : <EOL> pass <EOL> def CleanupPolygon ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectToolOptionsMarkingMenuPopDown ( * args , ** kwargs ) : <EOL> pass <EOL> def HideIKHandles ( * args , ** kwargs ) : <EOL> pass <EOL> def OpenScene ( * args , ** kwargs ) : <EOL> pass <EOL> def PolyConvertToLoopAndDuplicate ( * args , ** kwargs ) : <EOL> pass <EOL> def DeleteAllImagePlanes ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateDiskCacheOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def NormalizeUVs ( * args , ** kwargs ) : <EOL> pass <EOL> def PolyAssignSubdivHole ( * args , ** kwargs ) : <EOL> pass <EOL> def AddOceanDynamicLocatorOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateMotionTrail ( * args , ** kwargs ) : <EOL> pass <EOL> def DetachSkeleton ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateBlendShapeOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleAnimationDetails ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateContainerOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateEmptyGroup ( * args , ** kwargs ) : <EOL> pass <EOL> def HypershadeWindow ( * args , ** kwargs ) : <EOL> pass <EOL> def SubdivSmoothnessRoughOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def PointConstraintOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectPolygonToolMarkingMenuPopDown ( * args , ** kwargs ) : <EOL> pass <EOL> def PointConstraint ( * args , ** kwargs ) : <EOL> pass <EOL> def HideSculptObjects ( * args , ** kwargs ) : <EOL> pass <EOL> def PaintCacheTool ( * args , ** kwargs ) : <EOL> pass <EOL> def PaintEffectsGlobalSettings ( * args , ** kwargs ) : <EOL> pass <EOL> def PlaybackStop ( * args , ** kwargs ) : <EOL> pass <EOL> def CurveSmoothnessMedium ( * args , ** kwargs ) : <EOL> pass <EOL> def PFXUVSetLinkingEditor ( * args , ** kwargs ) : <EOL> pass <EOL> def RemoveBlendShape ( * args , ** kwargs ) : <EOL> pass <EOL> def ShowSculptObjects ( * args , ** kwargs ) : <EOL> pass <EOL> def WhatsNewStartupDialogOn ( * args , ** kwargs ) : <EOL> pass <EOL> def PolygonCollapse ( * args , ** kwargs ) : <EOL> pass <EOL> def EnableDynamicConstraints ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateCameraAim ( * args , ** kwargs ) : <EOL> pass <EOL> def OrientJoint ( * args , ** kwargs ) : <EOL> pass <EOL> def DuplicateEdges ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleLatticeShape ( * args , ** kwargs ) : <EOL> pass <EOL> def Bend ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectPolygonToolMarkingMenu ( * args , ** kwargs ) : <EOL> pass <EOL> def SelectAllNURBSSurfaces ( * args , ** kwargs ) : <EOL> pass <EOL> def TextureViewWindow ( * args , ** kwargs ) : <EOL> pass <EOL> def PixelMoveDown ( * args , ** kwargs ) : <EOL> pass <EOL> def AttributeEditor ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateVolumeCube ( * args , ** kwargs ) : <EOL> pass <EOL> def DeleteChannelsOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def NURBSSmoothnessRough ( * args , ** kwargs ) : <EOL> pass <EOL> def RebuildCurveOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleTextureBorderEdges ( * args , ** kwargs ) : <EOL> pass <EOL> def MakeMotionField ( * args , ** kwargs ) : <EOL> pass <EOL> def PublishAttributesOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def buildSendToBackburnerDialog ( * args , ** kwargs ) : <EOL> pass <EOL> def InsertKeysToolOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleStatusLine ( * args , ** kwargs ) : <EOL> pass <EOL> def DisplayLight ( * args , ** kwargs ) : <EOL> pass <EOL> def ImportAnimOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def PaintVertexColorToolOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleSelectionHandles ( * args , ** kwargs ) : <EOL> pass <EOL> def GridUVOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def NodeEditorShapeMenuStateAll ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleReflection ( * args , ** kwargs ) : <EOL> pass <EOL> def PickWalkLeft ( * args , ** kwargs ) : <EOL> pass <EOL> def ScaleTool ( * args , ** kwargs ) : <EOL> pass <EOL> def CreatePolygonSoccerBallOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def PreviousViewArrangement ( * args , ** kwargs ) : <EOL> pass <EOL> def ExtendCurveOnSurface ( * args , ** kwargs ) : <EOL> pass <EOL> def CurveFlowOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def KeyframeTangentMarkingMenuPopDown ( * args , ** kwargs ) : <EOL> pass <EOL> def TogglePolyCount ( * args , ** kwargs ) : <EOL> pass <EOL> def EnableNRigids ( * args , ** kwargs ) : <EOL> pass <EOL> def CurlCurvesOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def CircularFilletOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def nClothMergeCacheOpt ( * args , ** kwargs ) : <EOL> pass <EOL> def TogglePaintOnPaintableObjects ( * args , ** kwargs ) : <EOL> pass <EOL> def FloatSelectedPondObjectsOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def WireTool ( * args , ** kwargs ) : <EOL> pass <EOL> def CreatePolygonCone ( * args , ** kwargs ) : <EOL> pass <EOL> def MergeVerticesOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def CreateNURBSCylinder ( * args , ** kwargs ) : <EOL> pass <EOL> def ExtrudeVertex ( * args , ** kwargs ) : <EOL> pass <EOL> def TransplantHairOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def SetCurrentColorSet ( * args , ** kwargs ) : <EOL> pass <EOL> def PolygonClearClipboardOptions ( * args , ** kwargs ) : <EOL> pass <EOL> def ToggleToolbox ( * args , ** kwargs ) : <EOL> pass <EOL> def ChangeFullBodyPivotPlacement ( * args , ** kwargs ) : <EOL> pass </s>
<s> """<STR_LIT>""" <EOL> import sys <EOL> import os <EOL> import inspect <EOL> from collections import defaultdict <EOL> import maya . OpenMaya as om <EOL> import maya . OpenMayaMPx as mpx <EOL> import maya . cmds <EOL> class PluginError ( Exception ) : pass <EOL> class PluginRegistryError ( PluginError ) : pass <EOL> class AlreadyRegisteredError ( PluginRegistryError ) : pass <EOL> class NotRegisteredError ( PluginRegistryError ) : pass <EOL> mpxNamesToEnumNames = { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> } <EOL> mpxNamesToApiEnumNames = { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> } <EOL> mpxNamesToMayaNodes = { <EOL> '<STR_LIT>' : u'<STR_LIT>' , <EOL> '<STR_LIT>' : u'<STR_LIT>' , <EOL> '<STR_LIT>' : u'<STR_LIT>' , <EOL> '<STR_LIT>' : u'<STR_LIT>' , <EOL> '<STR_LIT>' : u'<STR_LIT>' , <EOL> '<STR_LIT>' : u'<STR_LIT>' , <EOL> '<STR_LIT>' : u'<STR_LIT>' , <EOL> '<STR_LIT>' : u'<STR_LIT>' , <EOL> '<STR_LIT>' : u'<STR_LIT>' , <EOL> '<STR_LIT>' : u'<STR_LIT>' , <EOL> '<STR_LIT>' : u'<STR_LIT>' , <EOL> '<STR_LIT>' : u'<STR_LIT>' , <EOL> '<STR_LIT>' : u'<STR_LIT>' , <EOL> '<STR_LIT>' : u'<STR_LIT>' , <EOL> '<STR_LIT>' : u'<STR_LIT>' , <EOL> '<STR_LIT>' : u'<STR_LIT>' , <EOL> '<STR_LIT>' : u'<STR_LIT>' , <EOL> '<STR_LIT>' : u'<STR_LIT>' , <EOL> '<STR_LIT>' : u'<STR_LIT>' , <EOL> '<STR_LIT>' : u'<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> } <EOL> mpxClassesToMpxEnums = { } <EOL> for _mpxName , _enumName in mpxNamesToEnumNames . iteritems ( ) : <EOL> _mpxCls = getattr ( mpx , _mpxName , None ) <EOL> if _mpxCls : <EOL> _enum = getattr ( mpx . MPxNode , _enumName , None ) <EOL> if _enum is not None : <EOL> mpxClassesToMpxEnums [ _mpxCls ] = _enum <EOL> else : <EOL> print "<STR_LIT>" % ( _enumName , _mpxName ) <EOL> del _mpxName , _enumName , _enum <EOL> pluginMayaTypes = set ( mpxNamesToMayaNodes . itervalues ( ) ) <EOL> NON_CREATABLE = set ( [ '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> ] ) <EOL> _enumToStr = None <EOL> def enumToStr ( ) : <EOL> '''<STR_LIT>''' <EOL> global _enumToStr <EOL> if _enumToStr is None : <EOL> _enumToStr = { } <EOL> for name , val in inspect . getmembers ( mpx . MPxNode , lambda x : isinstance ( x , int ) ) : <EOL> if name . startswith ( '<STR_LIT:k>' ) : <EOL> _enumToStr [ val ] = name <EOL> return _enumToStr <EOL> _allMPx = None <EOL> def allMPx ( ) : <EOL> '''<STR_LIT>''' <EOL> global _allMPx <EOL> if _allMPx is None : <EOL> _allMPx = [ ] <EOL> for _ , cls in inspect . getmembers ( mpx , lambda x : inspect . isclass ( x ) and issubclass ( x , mpx . MPxNode ) ) : <EOL> _allMPx . append ( cls ) <EOL> return _allMPx <EOL> for _mpx in allMPx ( ) : <EOL> assert _mpx in mpxClassesToMpxEnums , '<STR_LIT>' % _mpx . __name__ <EOL> registered = set ( ) <EOL> pyNodeMethods = { } <EOL> def _pluginModule ( ) : <EOL> return inspect . getmodule ( lambda : None ) <EOL> def _pluginName ( ) : <EOL> return _pluginModule ( ) . __name__ . split ( '<STR_LIT:.>' ) [ - <NUM_LIT:1> ] <EOL> def _pluginFile ( ) : <EOL> return inspect . getsourcefile ( lambda : None ) <EOL> def _loadPlugin ( ) : <EOL> thisFile = _pluginFile ( ) <EOL> if not maya . cmds . pluginInfo ( thisFile , query = <NUM_LIT:1> , loaded = <NUM_LIT:1> ) : <EOL> maya . cmds . loadPlugin ( thisFile ) <EOL> def _unloadPlugin ( ) : <EOL> thisFile = _pluginFile ( ) <EOL> if maya . cmds . pluginInfo ( thisFile , query = <NUM_LIT:1> , loaded = <NUM_LIT:1> ) : <EOL> maya . cmds . unloadPlugin ( thisFile ) <EOL> def _getPlugin ( object = None ) : <EOL> if object is None : <EOL> _loadPlugin ( ) <EOL> mobject = mpx . MFnPlugin . findPlugin ( _pluginName ( ) ) <EOL> plugin = mpx . MFnPlugin ( mobject ) <EOL> elif isinstance ( object , om . MObject ) : <EOL> plugin = mpx . MFnPlugin ( object ) <EOL> elif isinstance ( object , mpx . MFnPlugin ) : <EOL> plugin = object <EOL> else : <EOL> raise TypeError ( '<STR_LIT>' ) <EOL> return plugin <EOL> def initializePlugin ( mobject ) : <EOL> "<STR_LIT>" <EOL> pass <EOL> def uninitializePlugin ( mobject ) : <EOL> "<STR_LIT>" <EOL> global registered <EOL> mod = sys . modules [ '<STR_LIT>' ] <EOL> plugin = mpx . MFnPlugin ( mobject ) <EOL> for obj in registered : <EOL> print "<STR_LIT>" , obj . name ( ) <EOL> obj . deregisterCommand ( plugin ) <EOL> registered = set ( ) <EOL> class BasePluginMixin ( object ) : <EOL> _name = None <EOL> _mpxType = None <EOL> @ classmethod <EOL> def getMpxType ( cls ) : <EOL> if cls . _mpxType is None : <EOL> for pClass in inspect . getmro ( cls ) : <EOL> if pClass in mpxClassesToMpxEnums : <EOL> cls . _mpxType = pClass <EOL> break <EOL> return cls . _mpxType <EOL> @ classmethod <EOL> def mayaName ( cls ) : <EOL> if cls . _name is None : <EOL> cls . _name = cls . __name__ <EOL> return cls . _name <EOL> _typeId = None <EOL> @ classmethod <EOL> def getTypeId ( cls , nodeName = None ) : <EOL> if cls . _typeId is None : <EOL> if nodeName is None : <EOL> nodeName = cls . mayaName ( ) <EOL> cls . _typeId = cls . _devTypeIdHash ( nodeName ) <EOL> return cls . _typeId <EOL> @ classmethod <EOL> def _devTypeIdHash ( cls , name ) : <EOL> '''<STR_LIT>''' <EOL> import hashlib <EOL> start = <NUM_LIT> <EOL> end = <NUM_LIT> <EOL> size = ( end - start ) + <NUM_LIT:1> <EOL> md5 = hashlib . md5 ( ) <EOL> md5 . update ( name ) <EOL> id = start + long ( md5 . hexdigest ( ) , <NUM_LIT:16> ) % size <EOL> return om . MTypeId ( id ) <EOL> @ classmethod <EOL> def create ( cls ) : <EOL> inst = cls ( ) <EOL> return mpx . asMPxPtr ( inst ) <EOL> @ classmethod <EOL> def _getRegisteredPluginObj ( cls ) : <EOL> if '<STR_LIT>' not in cls . __dict__ : <EOL> cls . _registeredPlugin_data = None <EOL> return cls . _registeredPlugin_data <EOL> @ classmethod <EOL> def _setRegisteredPluginObj ( cls , val ) : <EOL> if val and cls . isRegistered ( ) : <EOL> raise AlreadyRegisteredError ( "<STR_LIT>" % cls . __name__ ) <EOL> cls . _registeredPlugin_data = val <EOL> @ classmethod <EOL> def register ( cls , plugin = None ) : <EOL> """<STR_LIT>""" <EOL> global registered <EOL> useThisPlugin = ( plugin is None ) <EOL> mplugin = _getPlugin ( plugin ) <EOL> cls . _setRegisteredPluginObj ( mplugin . object ( ) ) <EOL> cls . _registerOverride ( mplugin , useThisPlugin ) <EOL> if useThisPlugin : <EOL> registered . add ( cls ) <EOL> @ classmethod <EOL> def _registerOverride ( cls , mplugin , useThisPlugin ) : <EOL> '''<STR_LIT>''' <EOL> return <EOL> @ classmethod <EOL> def deregister ( cls , plugin = None ) : <EOL> """<STR_LIT>""" <EOL> global registered <EOL> if not cls . isRegistered ( ) : <EOL> raise NotRegisteredError ( "<STR_LIT>" % cls . __name__ ) <EOL> useThisPlugin = ( plugin is None ) <EOL> mplugin = _getPlugin ( plugin ) <EOL> cls . _deregisterOverride ( mplugin , useThisPlugin ) <EOL> if plugin is None : <EOL> registered . remove ( cls ) <EOL> cls . _setRegisteredPluginObj ( None ) <EOL> @ classmethod <EOL> def _deregisterOverride ( cls , mplugin , useThisPlugin ) : <EOL> '''<STR_LIT>''' <EOL> return <EOL> @ classmethod <EOL> def isRegistered ( cls ) : <EOL> return bool ( cls . _getRegisteredPluginObj ( ) ) <EOL> class Command ( BasePluginMixin , mpx . MPxCommand ) : <EOL> """<STR_LIT>""" <EOL> @ classmethod <EOL> def createSyntax ( cls ) : <EOL> return om . MSyntax ( ) <EOL> @ classmethod <EOL> def _registerOverride ( cls , mplugin , useThisPlugin ) : <EOL> name = cls . mayaName ( ) <EOL> mplugin . registerCommand ( name , cls . create , cls . createSyntax ) <EOL> if useThisPlugin : <EOL> import pymel . core <EOL> pymel . core . _addPluginCommand ( mplugin . name ( ) , name ) <EOL> @ classmethod <EOL> def _deregisterOverride ( cls , mplugin , useThisPlugin ) : <EOL> '''<STR_LIT>''' <EOL> name = cls . mayaName ( ) <EOL> mplugin . deregisterCommand ( name ) <EOL> if useThisPlugin : <EOL> import pymel . core <EOL> pymel . core . _removePluginCommand ( mplugin . name ( ) , name ) <EOL> class TransformationMatrix ( BasePluginMixin , mpx . MPxTransformationMatrix ) : <EOL> _typeId = None <EOL> @ classmethod <EOL> def register ( cls , plugin = None ) : pass <EOL> @ classmethod <EOL> def deregister ( cls , plugin = None ) : pass <EOL> class DependNode ( BasePluginMixin , mpx . MPxNode ) : <EOL> _typeEnum = None <EOL> _typeId = None <EOL> @ classmethod <EOL> def getTypeEnum ( cls ) : <EOL> if cls . _typeEnum is None : <EOL> cls . _typeEnum = mpxClassesToMpxEnums [ cls . getMpxType ( ) ] <EOL> return cls . _typeEnum <EOL> _classification = None <EOL> _callbacks = defaultdict ( list ) <EOL> @ classmethod <EOL> def initialize ( cls ) : <EOL> return <EOL> @ classmethod <EOL> def _registerOverride ( cls , mplugin , useThisPlugin ) : <EOL> nodeName = cls . mayaName ( ) <EOL> global pyNodeMethods <EOL> pluginPynodeMethods = pyNodeMethods . setdefault ( mplugin . name ( ) , { } ) <EOL> pluginPynodeMethods [ nodeName ] = { } <EOL> for _ , clsObj in inspect . getmembers ( cls ) : <EOL> if isinstance ( clsObj , PyNodeMethod ) : <EOL> pluginPynodeMethods [ nodeName ] [ clsObj . name ] = clsObj . func <EOL> cls . _nodeRegisterOverride ( nodeName , mplugin ) <EOL> if useThisPlugin : <EOL> import pymel . core <EOL> pymel . core . _addPluginNode ( mplugin . name ( ) , nodeName ) <EOL> for cbname , reg in [ <EOL> ( '<STR_LIT>' , om . MDGMessage . addTimeChangeCallback ) , <EOL> ( '<STR_LIT>' , om . MDGMessage . addForceUpdateCallback ) , <EOL> ( '<STR_LIT>' , om . MDGMessage . addNodeAddedCallback ) , <EOL> ( '<STR_LIT>' , om . MDGMessage . addNodeRemovedCallback ) , <EOL> ( '<STR_LIT>' , om . MDGMessage . addPreConnectionCallback ) ] : <EOL> if hasattr ( cls , cbname ) : <EOL> cb = getattr ( cls , cbname ) <EOL> cls . _callbacks [ nodeName ] . append ( reg ( cb , nodeName ) ) <EOL> @ classmethod <EOL> def _nodeRegisterOverride ( cls , nodeName , mplugin ) : <EOL> registerArgs = [ nodeName , cls . getTypeId ( ) , cls . create , cls . initialize , <EOL> cls . getTypeEnum ( ) ] <EOL> if cls . _classification : <EOL> registerArgs . append ( cls . _classification ) <EOL> mplugin . registerNode ( * registerArgs ) <EOL> @ classmethod <EOL> def _deregisterOverride ( cls , mplugin , useThisPlugin ) : <EOL> '''<STR_LIT>''' <EOL> nodeName = cls . mayaName ( ) <EOL> global pyNodeMethods <EOL> pyNodeMethods . get ( mplugin . name ( ) , { } ) . pop ( nodeName , None ) <EOL> mplugin . deregisterNode ( cls . getTypeId ( ) ) <EOL> if useThisPlugin : <EOL> import pymel . core <EOL> pymel . core . _removePluginNode ( mplugin . name ( ) , nodeName ) <EOL> for id in cls . _callbacks . pop ( nodeName , [ ] ) : <EOL> om . MMessage . removeCallback ( id ) <EOL> @ classmethod <EOL> def isAbstractClass ( cls ) : <EOL> return False <EOL> if hasattr ( mpx , '<STR_LIT>' ) : <EOL> class Assembly ( DependNode , mpx . MPxAssembly ) : pass <EOL> class CameraSet ( DependNode , mpx . MPxCameraSet ) : pass <EOL> class Constraint ( DependNode , mpx . MPxConstraint ) : pass <EOL> class DeformerNode ( DependNode , mpx . MPxDeformerNode ) : pass <EOL> class EmitterNode ( DependNode , mpx . MPxEmitterNode ) : pass <EOL> class FluidEmitterNode ( EmitterNode , mpx . MPxFluidEmitterNode ) : pass <EOL> class FieldNode ( DependNode , mpx . MPxFieldNode ) : pass <EOL> class HardwareShader ( DependNode , mpx . MPxHardwareShader ) : pass <EOL> class HwShaderNode ( DependNode , mpx . MPxHwShaderNode ) : pass <EOL> class IkSolverNode ( DependNode , mpx . MPxIkSolverNode ) : pass <EOL> class ImagePlane ( DependNode , mpx . MPxImagePlane ) : pass <EOL> class LocatorNode ( DependNode , mpx . MPxLocatorNode ) : pass <EOL> class ManipContainer ( DependNode , mpx . MPxManipContainer ) : pass <EOL> class ManipulatorNode ( DependNode , mpx . MPxManipulatorNode ) : pass <EOL> class ObjectSet ( DependNode , mpx . MPxObjectSet ) : pass <EOL> class ParticleAttributeMapperNode ( DependNode , mpx . MPxParticleAttributeMapperNode ) : pass <EOL> class PolyTrg ( DependNode , mpx . MPxPolyTrg ) : pass <EOL> class SpringNode ( DependNode , mpx . MPxSpringNode ) : pass <EOL> class SurfaceShape ( DependNode , mpx . MPxSurfaceShape ) : pass <EOL> class ComponentShape ( SurfaceShape , mpx . MPxComponentShape ) : pass <EOL> class Transform ( DependNode , mpx . MPxTransform ) : <EOL> _transformMatrix = TransformationMatrix <EOL> @ classmethod <EOL> def _nodeRegisterOverride ( cls , nodeName , mplugin ) : <EOL> registerArgs = [ nodeName , cls . getTypeId ( ) , cls . create , cls . initialize , <EOL> cls . _transformMatrix . create , <EOL> cls . _transformMatrix . getTypeId ( ) ] <EOL> if cls . _classification : <EOL> registerArgs . append ( cls . _classification ) <EOL> mplugin . registerTransform ( * registerArgs ) <EOL> class PyNodeMethod ( object ) : <EOL> '''<STR_LIT>''' <EOL> def __init__ ( self , func , name = None ) : <EOL> if name is None : <EOL> name = func . __name__ <EOL> self . func = func <EOL> self . name = name <EOL> def _buildPluginHierarchy ( dummyClasses = None ) : <EOL> '''<STR_LIT>''' <EOL> import pymel . internal . apicache as apicache <EOL> if dummyClasses is None : <EOL> dummyClasses = _createDummyPluginNodeClasses ( ) <EOL> inheritances = { } <EOL> for pluginType , dummyClass in dummyClasses . iteritems ( ) : <EOL> nodeType = dummyClass . mayaName ( ) <EOL> wasRegistered = dummyClass . isRegistered ( ) <EOL> if not wasRegistered : <EOL> dummyClass . register ( ) <EOL> try : <EOL> try : <EOL> inheritance = apicache . getInheritance ( nodeType ) <EOL> except apicache . ManipNodeTypeError : <EOL> continue <EOL> finally : <EOL> if not wasRegistered : <EOL> dummyClass . deregister ( ) <EOL> if not inheritance : <EOL> continue <EOL> assert inheritance [ - <NUM_LIT:1> ] == nodeType <EOL> inheritances [ pluginType ] = inheritance [ : - <NUM_LIT:1> ] <EOL> return inheritances <EOL> def _buildMpxNamesToApiEnumNames ( dummyClasses = None , dummyNodes = None ) : <EOL> import pymel . api as api <EOL> mpxNamesToEnumNames = { } <EOL> with _DummyPluginNodesMaker ( dummyClasses = dummyClasses , <EOL> alreadyCreated = dummyNodes ) as nodeMaker : <EOL> for mpxCls , mayaNode in nodeMaker . nodes . iteritems ( ) : <EOL> mobj = api . toMObject ( mayaNode ) <EOL> mpxNamesToEnumNames [ mpxCls . __name__ ] = mobj . apiTypeStr ( ) <EOL> return mpxNamesToEnumNames <EOL> def _buildAll ( ) : <EOL> with _DummyPluginNodesMaker ( ) as nodeMaker : <EOL> hierarchy = _buildPluginHierarchy ( dummyClasses = nodeMaker . dummyClasses ) <EOL> mpxClassesToMpxEnums = _buildMpxNamesToApiEnumNames ( dummyClasses = nodeMaker . dummyClasses , <EOL> dummyNodes = nodeMaker . nodes ) <EOL> mpxToMaya = _buildMpxNamesToMayaNodes ( hierarchy = hierarchy ) <EOL> return hierarchy , mpxToMaya , mpxClassesToMpxEnums <EOL> def _buildMpxNamesToMayaNodes ( hierarchy = None ) : <EOL> if hierarchy is None : <EOL> hierarchy = _buildPluginHierarchy ( ) <EOL> mpxNamesToMayaNodes = { } <EOL> for mpxCls , parents in hierarchy . iteritems ( ) : <EOL> if not parents : <EOL> mayaType = hierarchy [ mpx . MPxNode ] [ - <NUM_LIT:1> ] <EOL> else : <EOL> mayaType = parents [ - <NUM_LIT:1> ] <EOL> mpxNamesToMayaNodes [ mpxCls . __name__ ] = mayaType <EOL> return mpxNamesToMayaNodes <EOL> def _createDummyPluginNodeClasses ( ) : <EOL> '''<STR_LIT>''' <EOL> pymelPlugClasses = [ ] <EOL> for obj in globals ( ) . itervalues ( ) : <EOL> if inspect . isclass ( obj ) and issubclass ( obj , DependNode ) : <EOL> pymelPlugClasses . append ( obj ) <EOL> dummyClasses = { } <EOL> for cls in pymelPlugClasses : <EOL> class DummyClass ( cls ) : <EOL> _name = '<STR_LIT>' + cls . __name__ <EOL> DummyClass . __name__ = '<STR_LIT>' + cls . __name__ <EOL> dummyClasses [ DummyClass . getMpxType ( ) ] = DummyClass <EOL> return dummyClasses <EOL> class _DummyPluginNodesMaker ( object ) : <EOL> def __init__ ( self , dummyClasses = None , alreadyCreated = None ) : <EOL> if dummyClasses is None : <EOL> dummyClasses = _createDummyPluginNodeClasses ( ) <EOL> self . dummyClasses = dummyClasses <EOL> self . toUnregister = [ ] <EOL> self . nodes = { } <EOL> if alreadyCreated is None : <EOL> alreadyCreated = { } <EOL> self . alreadyCreated = alreadyCreated <EOL> if self . alreadyCreated : <EOL> self . nodes . update ( self . alreadyCreated ) <EOL> self . toDelete = [ ] <EOL> def __enter__ ( self ) : <EOL> for mpxCls , pyCls in self . dummyClasses . iteritems ( ) : <EOL> if not pyCls . isRegistered ( ) : <EOL> self . toUnregister . append ( pyCls ) <EOL> pyCls . register ( ) <EOL> if mpxCls not in self . alreadyCreated : <EOL> if mpxCls . __name__ in NON_CREATABLE : <EOL> continue <EOL> newNode = maya . cmds . createNode ( pyCls . mayaName ( ) ) <EOL> parent = maya . cmds . listRelatives ( newNode , parent = <NUM_LIT:1> ) <EOL> self . nodes [ mpxCls ] = newNode <EOL> if parent : <EOL> self . toDelete . append ( parent ) <EOL> else : <EOL> self . toDelete . append ( newNode ) <EOL> return self <EOL> def __exit__ ( self , type , value , traceback ) : <EOL> if self . toDelete : <EOL> maya . cmds . delete ( * self . toDelete ) <EOL> for pyCls in self . toUnregister : <EOL> pyCls . deregister ( ) <EOL> def mayaPlugins ( ) : <EOL> '''<STR_LIT>''' <EOL> import pymel . mayautils <EOL> mayaLoc = pymel . mayautils . getMayaLocation ( ) <EOL> plugins = [ ] <EOL> pluginPaths = [ os . path . realpath ( x ) for x in os . environ [ '<STR_LIT>' ] . split ( os . path . pathsep ) ] <EOL> for pluginPath in [ x for x in pluginPaths if x . startswith ( mayaLoc ) and os . path . isdir ( x ) ] : <EOL> for x in os . listdir ( pluginPath ) : <EOL> if os . path . isfile ( os . path . join ( pluginPath , x ) ) : <EOL> if not maya . cmds . pluginInfo ( x , q = <NUM_LIT:1> , loaded = <NUM_LIT:1> ) : <EOL> plugins . append ( x ) <EOL> return plugins <EOL> def loadAllMayaPlugins ( ) : <EOL> '''<STR_LIT>''' <EOL> import logging <EOL> logger = logging . getLogger ( '<STR_LIT>' ) <EOL> logger . debug ( "<STR_LIT>" ) <EOL> for plugin in mayaPlugins ( ) : <EOL> try : <EOL> maya . cmds . loadPlugin ( plugin , quiet = <NUM_LIT:1> ) <EOL> except RuntimeError : pass <EOL> logger . debug ( "<STR_LIT>" ) <EOL> def unloadAllPlugins ( skipErrors = False , exclude = ( '<STR_LIT>' , ) ) : <EOL> import logging <EOL> logger = logging . getLogger ( '<STR_LIT>' ) <EOL> logger . debug ( "<STR_LIT>" ) <EOL> loadedPlugins = maya . cmds . pluginInfo ( q = True , listPlugins = True ) <EOL> if loadedPlugins : <EOL> for plug in loadedPlugins : <EOL> if plug in exclude : <EOL> continue <EOL> logger . debug ( "<STR_LIT>" % plug ) <EOL> try : <EOL> maya . cmds . unloadPlugin ( plug , force = True ) <EOL> except Exception : <EOL> if skipErrors : <EOL> import traceback <EOL> logger . warning ( "<STR_LIT>" % plug ) <EOL> logger . warning ( traceback . format_exc ( ) ) <EOL> else : <EOL> raise <EOL> logger . debug ( "<STR_LIT>" ) <EOL> UNREPORTED_COMMANDS = { <EOL> '<STR_LIT>' : { } , <EOL> '<STR_LIT>' : { '<STR_LIT>' : [ '<STR_LIT>' ] } , <EOL> '<STR_LIT>' : { } , <EOL> '<STR_LIT>' : { } , <EOL> '<STR_LIT>' : { } , <EOL> } <EOL> def pluginCommands ( pluginName , reportedOnly = False ) : <EOL> '''<STR_LIT>''' <EOL> import logging <EOL> logger = logging . getLogger ( '<STR_LIT>' ) <EOL> commands = [ ] <EOL> for cmdType , pluginToCmds in UNREPORTED_COMMANDS . iteritems ( ) : <EOL> try : <EOL> moreCmds = maya . cmds . pluginInfo ( pluginName , query = <NUM_LIT:1> , ** { cmdType : <NUM_LIT:1> } ) <EOL> except TypeError : <EOL> if reportedOnly : <EOL> moreCmds = [ ] <EOL> else : <EOL> moreCmds = pluginToCmds . get ( pluginName , [ ] ) <EOL> except Exception : <EOL> logger . error ( "<STR_LIT>" % ( cmdType , pluginName ) ) <EOL> moreCmds = [ ] <EOL> if moreCmds : <EOL> commands . extend ( moreCmds ) <EOL> return commands </s>
<s> import sys <EOL> import os <EOL> import types <EOL> import doctest <EOL> import modulefinder <EOL> import traceback <EOL> import inspect <EOL> from StringIO import StringIO <EOL> from unittest import * <EOL> import pymel . util <EOL> from warnings import warn <EOL> TEST_MAIN_FUNC_NAME = "<STR_LIT>" <EOL> SUITE_FUNC_NAME = "<STR_LIT>" <EOL> def doctestFriendly ( func ) : <EOL> """<STR_LIT>""" <EOL> def prepForDoctest ( * args , ** kwargs ) : <EOL> result = None <EOL> if ( sys . displayhook != sys . __displayhook__ <EOL> or sys . stdout != sys . __stdout__ ) : <EOL> save_displayhook = sys . displayhook <EOL> try : <EOL> savedMaster = doctest . master <EOL> except AttributeError : <EOL> savedMaster = None <EOL> try : <EOL> sys . displayhook = sys . __displayhook__ <EOL> doctest . master = None <EOL> try : <EOL> result = func ( * args , ** kwargs ) <EOL> except : <EOL> raise <EOL> finally : <EOL> sys . displayhook = save_displayhook <EOL> doctest . master = savedMaster <EOL> else : <EOL> result = func ( * args , ** kwargs ) <EOL> return result <EOL> return prepForDoctest <EOL> @ doctestFriendly <EOL> def doctestobj ( * args , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> return doctest . run_docstring_examples ( * args , ** kwargs ) <EOL> @ doctestFriendly <EOL> def doctestmod ( * args , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> return doctest . testmod ( * args , ** kwargs ) <EOL> class MayaTestRunner ( TextTestRunner ) : <EOL> def __init__ ( self , stream = sys . stdout , descriptions = True , verbosity = <NUM_LIT:2> ) : <EOL> super ( MayaTestRunner , self ) . __init__ ( stream = stream , <EOL> descriptions = descriptions , <EOL> verbosity = verbosity ) <EOL> @ doctestFriendly <EOL> def run ( self , * args , ** kwargs ) : <EOL> super ( MayaTestRunner , self ) . run ( * args , ** kwargs ) <EOL> def addFuncToModule ( func , module ) : <EOL> if not hasattr ( module , func . __name__ ) : <EOL> setattr ( module , func . __name__ , func ) <EOL> def startsWithDoubleUnderscore ( testcase ) : <EOL> return testcase . __name__ . startswith ( "<STR_LIT>" ) <EOL> def setupUnittestModule ( moduleName , suiteFuncName = SUITE_FUNC_NAME , testMainName = TEST_MAIN_FUNC_NAME , <EOL> filterTestCases = startsWithDoubleUnderscore ) : <EOL> """<STR_LIT>""" <EOL> module = sys . modules [ moduleName ] <EOL> def theSuite ( ) : <EOL> return findTestCases ( module ) <EOL> theSuite . __name__ = suiteFuncName <EOL> def test_main ( ) : <EOL> return MayaTestRunner ( ) . run ( theSuite ( ) ) <EOL> test_main . __name__ = testMainName <EOL> addFuncToModule ( theSuite , module ) <EOL> addFuncToModule ( test_main , module ) <EOL> for name in dir ( module ) : <EOL> obj = getattr ( module , name ) <EOL> if ( isinstance ( obj , ( type , types . ClassType ) ) and <EOL> issubclass ( obj , TestCase ) and <EOL> filterTestCases and <EOL> filterTestCases ( obj ) ) : <EOL> delattr ( module , name ) <EOL> if moduleName == '<STR_LIT:__main__>' : <EOL> test_main ( ) <EOL> class TestCaseExtended ( TestCase ) : <EOL> DO_NOT_LOAD = False <EOL> def assertNoError ( self , function , * args , ** kwargs ) : <EOL> try : <EOL> function ( * args , ** kwargs ) <EOL> except : <EOL> self . fail ( "<STR_LIT>" % traceback . format_exc ( ) ) <EOL> def assertIteration ( self , iterable , expectedResults , <EOL> orderMatters = True , <EOL> onlyMembershipMatters = False ) : <EOL> """<STR_LIT>""" <EOL> expectedResults = list ( expectedResults ) <EOL> if onlyMembershipMatters : <EOL> unmatchedResults = set ( expectedResults ) <EOL> else : <EOL> unmatchedResults = list ( expectedResults ) <EOL> for item in iterable : <EOL> notInExpectedResultsFormat = "<STR_LIT>" <EOL> if onlyMembershipMatters : <EOL> self . assertTrue ( item in expectedResults , <EOL> notInExpectedResultsFormat % ( iterable , item , "<STR_LIT>" , expectedResults ) ) <EOL> else : <EOL> self . assertTrue ( item in unmatchedResults , <EOL> notInExpectedResultsFormat % ( iterable , item , "<STR_LIT>" , unmatchedResults ) ) <EOL> if orderMatters : <EOL> self . assertEqual ( item , unmatchedResults [ <NUM_LIT:0> ] , "<STR_LIT>" % ( item , unmatchedResults [ <NUM_LIT:0> ] ) ) <EOL> if item in unmatchedResults : <EOL> unmatchedResults . remove ( item ) <EOL> message = "<STR_LIT>" % ( iterable , [ str ( x ) for x in unmatchedResults ] ) <EOL> self . assertEqual ( len ( unmatchedResults ) , <NUM_LIT:0> , message ) <EOL> def assertVectorsEqual ( self , v1 , v2 , places = <NUM_LIT:5> ) : <EOL> for p1 , p2 in zip ( v1 , v2 ) : <EOL> try : <EOL> self . assertAlmostEqual ( p1 , p2 , places = places ) <EOL> except AssertionError : <EOL> self . fail ( '<STR_LIT>' % ( v1 , v2 , places ) ) <EOL> def permutations ( sequence , length = None ) : <EOL> """<STR_LIT>""" <EOL> if length is None : <EOL> length = len ( sequence ) <EOL> elif length < <NUM_LIT:0> or length > len ( sequence ) : <EOL> raise ValueError ( "<STR_LIT>" % ( length , sequence ) ) <EOL> if length == <NUM_LIT:0> : yield [ ] <EOL> else : <EOL> for i in xrange ( len ( sequence ) ) : <EOL> for subpermutation in permutations ( sequence [ : i ] + sequence [ i + <NUM_LIT:1> : ] , length - <NUM_LIT:1> ) : <EOL> yield [ sequence [ i ] ] + subpermutation <EOL> def isOneToOne ( dict ) : <EOL> """<STR_LIT>""" <EOL> return len ( set ( dict . itervalues ( ) ) ) == len ( dict ) <EOL> def isEquivalenceRelation ( inputs , outputs , dict ) : <EOL> """<STR_LIT>""" <EOL> inputs = set ( inputs ) <EOL> output = set ( outputs ) <EOL> if len ( inputs ) == len ( outputs ) and set ( dict . iterkeys ( ) ) == inputs and set ( dict . itervalues ( ) ) == outputs : <EOL> return True <EOL> else : <EOL> return False <EOL> class SuiteFromModule ( TestSuite ) : <EOL> def __init__ ( self , module , testImport = True ) : <EOL> """<STR_LIT>""" <EOL> super ( SuiteFromModule , self ) . __init__ ( ) <EOL> self . _importError = None <EOL> if isinstance ( module , basestring ) : <EOL> self . moduleName = module <EOL> self . module = self . _importTestModule ( ) <EOL> elif isinstance ( module , types . ModuleType ) : <EOL> self . moduleName = module . __name__ <EOL> self . module = module <EOL> if self . _importError is None and self . module : <EOL> try : <EOL> importedSuite = self . _importSuite ( ) <EOL> if not importedSuite . countTestCases ( ) : <EOL> self . _importError = "<STR_LIT>" % ( self . module . __name__ , self . suiteFuncName ) <EOL> except : <EOL> self . _importError = traceback . format_exc ( ) <EOL> if not self . _importError : <EOL> self . addTest ( importedSuite ) <EOL> if testImport : <EOL> self . addTest ( self . _makeImportTestCase ( ) ) <EOL> def _importTestModule ( self ) : <EOL> module = None <EOL> try : <EOL> module = __import__ ( self . moduleName ) <EOL> packagePath = self . moduleName . split ( '<STR_LIT:.>' ) <EOL> for subModule in packagePath [ <NUM_LIT:1> : ] : <EOL> module = getattr ( module , subModule ) <EOL> except : <EOL> self . _importError = traceback . format_exc ( ) <EOL> module = None <EOL> return module <EOL> def _importSuite ( self ) : <EOL> return TestSuite ( ) <EOL> def _makeImportTestCase ( suite_self ) : <EOL> class TestSuiteImport ( TestCaseExtended ) : <EOL> def runTest ( testCase_self ) : <EOL> testCase_self . assertTrue ( suite_self . _importError is None , "<STR_LIT>" % ( suite_self . moduleName , suite_self . _importError ) ) <EOL> runTest . __doc__ = """<STR_LIT>""" % ( suite_self . __class__ . __name__ , suite_self . moduleName ) <EOL> return TestSuiteImport ( ) <EOL> class UnittestSuiteFromModule ( SuiteFromModule ) : <EOL> def __init__ ( self , moduleName , suiteFuncName = SUITE_FUNC_NAME , ** kwargs ) : <EOL> self . suiteFuncName = suiteFuncName <EOL> super ( UnittestSuiteFromModule , self ) . __init__ ( moduleName , ** kwargs ) <EOL> def _importSuite ( self ) : <EOL> theSuite = None <EOL> suiteFunc = getattr ( self . module , self . suiteFuncName , None ) <EOL> if isinstance ( suiteFunc , TestSuite ) : <EOL> theSuite = suiteFunc <EOL> elif callable ( suiteFunc ) : <EOL> theSuite = suiteFunc ( ) <EOL> if not theSuite : <EOL> theSuite = findTestCases ( self . module ) <EOL> if not theSuite : <EOL> theSuite = TestSuite ( ) <EOL> return theSuite <EOL> class DoctestSuiteFromModule ( SuiteFromModule ) : <EOL> def __init__ ( self , moduleName , packageRecurse = False , alreadyRecursed = None , ** kwargs ) : <EOL> if alreadyRecursed is None : <EOL> alreadyRecursed = [ ] <EOL> self . alreadyRecursed = alreadyRecursed <EOL> self . packageRecurse = packageRecurse <EOL> super ( DoctestSuiteFromModule , self ) . __init__ ( moduleName , ** kwargs ) <EOL> def _importSuite ( self ) : <EOL> theSuite = None <EOL> if self . module not in self . alreadyRecursed : <EOL> self . alreadyRecursed . append ( self . module ) <EOL> try : <EOL> theSuite = doctest . DocTestSuite ( self . module ) <EOL> except ValueError : <EOL> theSuite = None <EOL> if self . packageRecurse : <EOL> for path in getattr ( self . module , '<STR_LIT>' , [ ] ) : <EOL> for name in os . listdir ( path ) : <EOL> newPath = os . path . join ( path , name ) <EOL> basename , ext = os . path . splitext ( name ) <EOL> if ( ( os . path . isfile ( newPath ) and ext in ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) and basename != '<STR_LIT>' ) <EOL> or ( os . path . isdir ( newPath ) and os . path . isfile ( os . path . join ( newPath , '<STR_LIT>' ) ) ) ) : <EOL> newModuleName = self . moduleName + "<STR_LIT:.>" + basename <EOL> newSuite = DoctestSuiteFromModule ( newModuleName , testImport = False , packageRecurse = True , alreadyRecursed = self . alreadyRecursed ) <EOL> if newSuite . countTestCases ( ) : <EOL> theSuite . addTest ( newSuite ) <EOL> if not theSuite : <EOL> theSuite = TestSuite ( ) <EOL> return theSuite <EOL> def setCompare ( iter1 , iter2 ) : <EOL> """<STR_LIT>""" <EOL> s1 = set ( iter1 ) <EOL> s2 = set ( iter2 ) <EOL> intersect = s1 & s2 <EOL> return s1 - intersect , intersect , s2 - intersect <EOL> def suite ( ) : <EOL> theSuite = TestSuite ( ) <EOL> unittestMods = findUnittestModules ( ) <EOL> for testMod in unittestMods : <EOL> theSuite . addTest ( UnittestSuiteFromModule ( testMod ) ) <EOL> doctests = DoctestSuiteFromModule ( '<STR_LIT>' , packageRecurse = True ) <EOL> if doctests . countTestCases ( ) : <EOL> theSuite . addTest ( doctests ) <EOL> return theSuite </s>
<s> '''<STR_LIT>''' <EOL> if not __name__ == '<STR_LIT:__main__>' : <EOL> print "<STR_LIT>" </s>
<s> import os , sys <EOL> import shutil <EOL> import ctypes . util <EOL> import configparser , platform <EOL> import urllib . request <EOL> import tarfile , zipfile <EOL> import appdirs <EOL> import hashlib <EOL> from decimal import Decimal as D <EOL> def generate_config_file ( filename , config_args , known_config = { } , overwrite = False ) : <EOL> if not overwrite and os . path . exists ( filename ) : <EOL> return <EOL> config_dir = os . path . dirname ( os . path . abspath ( filename ) ) <EOL> if not os . path . exists ( config_dir ) : <EOL> os . makedirs ( config_dir , mode = <NUM_LIT> ) <EOL> config_lines = [ ] <EOL> config_lines . append ( '<STR_LIT>' ) <EOL> config_lines . append ( '<STR_LIT>' ) <EOL> for arg in config_args : <EOL> key = arg [ <NUM_LIT:0> ] [ - <NUM_LIT:1> ] . replace ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> value = None <EOL> if key in known_config : <EOL> value = known_config [ key ] <EOL> elif '<STR_LIT:default>' in arg [ <NUM_LIT:1> ] : <EOL> value = arg [ <NUM_LIT:1> ] [ '<STR_LIT:default>' ] <EOL> if value is None : <EOL> value = '<STR_LIT>' <EOL> elif isinstance ( value , bool ) : <EOL> value = '<STR_LIT:1>' if value else '<STR_LIT:0>' <EOL> elif isinstance ( value , ( float , D ) ) : <EOL> value = format ( value , '<STR_LIT>' ) <EOL> if '<STR_LIT:default>' in arg [ <NUM_LIT:1> ] or value == '<STR_LIT>' : <EOL> key = '<STR_LIT>' . format ( key ) <EOL> config_lines . append ( '<STR_LIT>' . format ( key , value , arg [ <NUM_LIT:1> ] [ '<STR_LIT>' ] ) ) <EOL> with open ( filename , '<STR_LIT:w>' , encoding = '<STR_LIT:utf8>' ) as config_file : <EOL> config_file . writelines ( "<STR_LIT:\n>" . join ( config_lines ) ) <EOL> os . chmod ( filename , <NUM_LIT> ) <EOL> def extract_old_config ( ) : <EOL> old_config = { } <EOL> old_appdir = appdirs . user_config_dir ( appauthor = '<STR_LIT>' , appname = '<STR_LIT>' , roaming = True ) <EOL> old_configfile = os . path . join ( old_appdir , '<STR_LIT>' ) <EOL> if os . path . exists ( old_configfile ) : <EOL> configfile = configparser . ConfigParser ( ) <EOL> configfile . read ( old_configfile ) <EOL> if '<STR_LIT>' in configfile : <EOL> for key in configfile [ '<STR_LIT>' ] : <EOL> new_key = key . replace ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> new_key = new_key . replace ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> new_value = configfile [ '<STR_LIT>' ] [ key ] . replace ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> old_config [ new_key ] = new_value <EOL> return old_config <EOL> def extract_bitcoincore_config ( ) : <EOL> bitcoincore_config = { } <EOL> if platform . system ( ) == '<STR_LIT>' : <EOL> btc_conf_file = os . path . expanduser ( '<STR_LIT>' ) <EOL> elif platform . system ( ) == '<STR_LIT>' : <EOL> btc_conf_file = os . path . join ( os . environ [ '<STR_LIT>' ] , '<STR_LIT>' ) <EOL> else : <EOL> btc_conf_file = os . path . expanduser ( '<STR_LIT>' ) <EOL> btc_conf_file = os . path . join ( btc_conf_file , '<STR_LIT>' ) <EOL> if os . path . exists ( btc_conf_file ) : <EOL> conf = { } <EOL> with open ( btc_conf_file , '<STR_LIT:r>' ) as fd : <EOL> for line in fd . readlines ( ) : <EOL> if '<STR_LIT:#>' in line or '<STR_LIT:=>' not in line : <EOL> continue <EOL> k , v = line . split ( '<STR_LIT:=>' , <NUM_LIT:1> ) <EOL> conf [ k . strip ( ) ] = v . strip ( ) <EOL> config_keys = { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' <EOL> } <EOL> for bitcoind_key in config_keys : <EOL> if bitcoind_key in conf : <EOL> counterparty_key = config_keys [ bitcoind_key ] <EOL> bitcoincore_config [ counterparty_key ] = conf [ bitcoind_key ] <EOL> return bitcoincore_config <EOL> def get_server_known_config ( ) : <EOL> server_known_config = { } <EOL> bitcoincore_config = extract_bitcoincore_config ( ) <EOL> server_known_config . update ( bitcoincore_config ) <EOL> old_config = extract_old_config ( ) <EOL> server_known_config . update ( old_config ) <EOL> return server_known_config <EOL> def server_to_client_config ( server_config ) : <EOL> client_config = { } <EOL> config_keys = { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' <EOL> } <EOL> for server_key in config_keys : <EOL> if server_key in server_config : <EOL> client_key = config_keys [ server_key ] <EOL> client_config [ client_key ] = server_config [ server_key ] <EOL> return client_config <EOL> def generate_config_files ( ) : <EOL> from counterpartycli . server import CONFIG_ARGS as SERVER_CONFIG_ARGS <EOL> from counterpartycli . client import CONFIG_ARGS as CLIENT_CONFIG_ARGS <EOL> from counterpartylib . lib import config , util <EOL> configdir = appdirs . user_config_dir ( appauthor = config . XCP_NAME , appname = config . APP_NAME , roaming = True ) <EOL> server_configfile = os . path . join ( configdir , '<STR_LIT>' ) <EOL> if not os . path . exists ( server_configfile ) : <EOL> server_known_config = get_server_known_config ( ) <EOL> generate_config_file ( server_configfile , SERVER_CONFIG_ARGS , server_known_config ) <EOL> client_configfile = os . path . join ( configdir , '<STR_LIT>' ) <EOL> if not os . path . exists ( client_configfile ) : <EOL> client_known_config = server_to_client_config ( server_known_config ) <EOL> generate_config_file ( client_configfile , CLIENT_CONFIG_ARGS , client_known_config ) <EOL> def zip_folder ( folder_path , zip_path ) : <EOL> zip_file = zipfile . ZipFile ( zip_path , '<STR_LIT:w>' , zipfile . ZIP_DEFLATED ) <EOL> for root , dirs , files in os . walk ( folder_path ) : <EOL> for a_file in files : <EOL> zip_file . write ( os . path . join ( root , a_file ) ) <EOL> zip_file . close ( ) <EOL> def before_py2exe_build ( win_dist_dir ) : <EOL> if os . path . exists ( win_dist_dir ) : <EOL> shutil . rmtree ( win_dist_dir ) <EOL> for exe_name in [ '<STR_LIT>' , '<STR_LIT>' ] : <EOL> shutil . copy ( '<STR_LIT>' , '<STR_LIT>' . format ( exe_name ) ) <EOL> with open ( '<STR_LIT>' . format ( exe_name ) , '<STR_LIT:a>' ) as fp : <EOL> fp . write ( '<STR_LIT>' . format ( exe_name ) ) <EOL> src = '<STR_LIT>' <EOL> dst = '<STR_LIT>' <EOL> shutil . copy ( src , dst ) <EOL> def after_py2exe_build ( win_dist_dir ) : <EOL> for exe_name in [ '<STR_LIT>' , '<STR_LIT>' ] : <EOL> os . remove ( '<STR_LIT>' . format ( exe_name ) ) <EOL> import counterpartylib , certifi <EOL> additionals_modules = [ counterpartylib , certifi ] <EOL> for module in additionals_modules : <EOL> moudle_file = os . path . dirname ( module . __file__ ) <EOL> dest_file = os . path . join ( win_dist_dir , '<STR_LIT>' , module . __name__ ) <EOL> shutil . copytree ( moudle_file , dest_file ) <EOL> dlls = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> dlls . append ( ctypes . util . find_msvcrt ( ) ) <EOL> dlls_path = dlls <EOL> for dll in dlls : <EOL> dll_path = ctypes . util . find_library ( dll ) <EOL> shutil . copy ( dll_path , win_dist_dir ) <EOL> zip_path = '<STR_LIT>' . format ( win_dist_dir ) <EOL> zip_folder ( win_dist_dir , zip_path ) <EOL> with open ( zip_path , '<STR_LIT:rb>' ) as zip_file : <EOL> data = zip_file . read ( ) <EOL> md5 = hashlib . md5 ( data ) . hexdigest ( ) <EOL> new_zip_path = '<STR_LIT>' . format ( win_dist_dir , md5 ) <EOL> os . rename ( zip_path , new_zip_path ) <EOL> shutil . rmtree ( win_dist_dir ) <EOL> os . remove ( '<STR_LIT>' ) <EOL> def bootstrap ( overwrite = True , ask_confirmation = False ) : <EOL> if ask_confirmation : <EOL> question = '<STR_LIT>' <EOL> if input ( question ) . lower ( ) != '<STR_LIT:y>' : <EOL> return <EOL> util . bootstrap ( testnet = False ) <EOL> util . bootstrap ( testnet = True ) </s>
<s> import math <EOL> def ifloor ( x ) : return int ( math . floor ( x ) ) <EOL> class BakeryManager ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , bakery , tileSize , minRenderSize , maxRenderSize , maxPreGenSize , startX , startY ) : <EOL> """<STR_LIT>""" <EOL> assert minRenderSize <= maxRenderSize <= maxPreGenSize <EOL> self . tileSize = tileSize <EOL> self . bakery = bakery <EOL> self . asyncBaking = False <EOL> tileX = startX / tileSize <EOL> tileY = startY / tileSize <EOL> def replaceTileCacheEntry ( x , y , old ) : <EOL> if old : <EOL> self . destroy ( old ) <EOL> return None <EOL> self . tileCache = ToroidalCache ( maxPreGenSize , replaceTileCacheEntry , tileX , tileY ) <EOL> def replaceMidCacheEntry ( x , y , old ) : <EOL> if old : <EOL> self . unrender ( old ) <EOL> new = self . tileCache . get ( x , y ) <EOL> if new : <EOL> self . render ( new ) <EOL> return new <EOL> self . midCache = ToroidalCache ( maxRenderSize , replaceMidCacheEntry , tileX , tileY ) <EOL> def replaceRenderTile ( x , y , old ) : <EOL> new = self . tileCache . get ( x , y ) <EOL> if not new : <EOL> new = self . _makeTile ( x , y ) <EOL> self . midCache . store ( x , y , new ) <EOL> self . tileCache . store ( x , y , new ) <EOL> self . render ( new ) <EOL> return new <EOL> self . renderCache = ToroidalCache ( minRenderSize , replaceRenderTile , tileX , tileY ) <EOL> def _storeTile ( self , x , y , tile ) : <EOL> if not self . tileCache . inbounds ( x , y ) : <EOL> print "<STR_LIT>" , x , y <EOL> return <EOL> t = self . tileCache . get ( x , y ) <EOL> if t is not None : <EOL> print "<STR_LIT>" , x , y <EOL> return <EOL> self . tileCache . store ( x , y , tile ) <EOL> if self . midCache . inbounds ( x , y ) : <EOL> t = self . midCache . get ( x , y ) <EOL> if t is not None : <EOL> print "<STR_LIT>" , x , y <EOL> return <EOL> self . midCache . store ( x , y , tile ) <EOL> self . render ( tile ) <EOL> if self . renderCache . inbounds ( x , y ) : <EOL> t = self . renderCache . get ( x , y ) <EOL> if t is not None : <EOL> print "<STR_LIT>" , x , y <EOL> return <EOL> self . renderCache . store ( x , y , tile ) <EOL> def getTile ( self , wx , wy ) : <EOL> x = ifloor ( wx / self . tileSize ) <EOL> y = ifloor ( wy / self . tileSize ) <EOL> if self . tileCache . inbounds ( x , y ) : <EOL> return self . tileCache . get ( x , y ) <EOL> return None <EOL> def _makeTile ( self , x , y , async = False ) : <EOL> if async : <EOL> self . asyncBaking = True <EOL> self . bakery . asyncGetTile ( x , y , self . _asyncTileDone , ( x , y ) ) <EOL> else : <EOL> self . asyncBaking = False <EOL> return self . bakery . getTile ( x , y ) <EOL> def updateCenter ( self , worldX , worldY ) : <EOL> """<STR_LIT>""" <EOL> x = worldX / self . tileSize <EOL> y = worldY / self . tileSize <EOL> self . tileCache . updateCenter ( x , y ) <EOL> self . midCache . updateCenter ( x , y ) <EOL> self . renderCache . updateCenter ( x , y ) <EOL> if not self . asyncBaking : <EOL> minDistSquared = <NUM_LIT> <EOL> minX = minY = None <EOL> for iy in xrange ( self . tileCache . size ) : <EOL> ty = iy + self . tileCache . originY <EOL> for ix in xrange ( self . tileCache . size ) : <EOL> tx = ix + self . tileCache . originX <EOL> if self . tileCache . get ( tx , ty ) is None : <EOL> distSquared = ( tx - x ) ** <NUM_LIT:2> + ( ty - y ) ** <NUM_LIT:2> <EOL> if distSquared < minDistSquared : <EOL> minX = tx <EOL> minY = ty <EOL> minDistSquared = distSquared <EOL> if minX != None : <EOL> self . _makeTile ( ifloor ( minX ) , ifloor ( minY ) , True ) <EOL> def _asyncTileDone ( self , tile , x , y ) : <EOL> if not self . asyncBaking : <EOL> print "<STR_LIT>" <EOL> return <EOL> self . asyncBaking = False <EOL> if self . tileCache . inbounds ( x , y ) : <EOL> t = self . tileCache . get ( x , y ) <EOL> if t is None : <EOL> self . _storeTile ( x , y , tile ) <EOL> def render ( self , tile ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def unrender ( self , tile ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def destroy ( self , tile ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> class NodePathBakeryManager ( BakeryManager ) : <EOL> def __init__ ( self , parentNodePath , * args , ** kargs ) : <EOL> self . parentNodePath = parentNodePath <EOL> BakeryManager . __init__ ( self , * args , ** kargs ) <EOL> def render ( self , tile ) : <EOL> """<STR_LIT>""" <EOL> tile . reparentTo ( self . parentNodePath ) <EOL> def unrender ( self , tile ) : <EOL> """<STR_LIT>""" <EOL> tile . detachNode ( ) <EOL> def destroy ( self , tile ) : <EOL> """<STR_LIT>""" <EOL> tile . removeNode ( ) <EOL> class ToroidalCache ( object ) : <EOL> def __init__ ( self , size , replaceValue , startX = <NUM_LIT:0> , startY = <NUM_LIT:0> , hysteresis = <NUM_LIT:0.1> ) : <EOL> """<STR_LIT>""" <EOL> self . size = size <EOL> self . originX = ifloor ( startX + <NUM_LIT> - size / <NUM_LIT> ) <EOL> self . originY = ifloor ( startY + <NUM_LIT> - size / <NUM_LIT> ) <EOL> self . hysteresis = hysteresis <EOL> self . replaceValue = replaceValue <EOL> self . data = [ None ] * ( size ** <NUM_LIT:2> ) <EOL> for x in xrange ( size ) : <EOL> for y in xrange ( size ) : <EOL> tx = x + self . originX <EOL> ty = y + self . originY <EOL> self . store ( tx , ty , self . replaceValue ( tx , ty , None ) ) <EOL> def updateCenter ( self , x , y ) : <EOL> """<STR_LIT>""" <EOL> offset = self . size / <NUM_LIT> <EOL> tolarance = self . hysteresis + <NUM_LIT:0.5> <EOL> xError = x - ( offset + self . originX ) <EOL> yError = y - ( offset + self . originY ) <EOL> xChange = int ( round ( xError ) ) if abs ( xError ) > tolarance else <NUM_LIT:0> <EOL> yChange = int ( round ( yError ) ) if abs ( yError ) > tolarance else <NUM_LIT:0> <EOL> if xChange or yChange : <EOL> originX = self . originX + xChange <EOL> originY = self . originY + yChange <EOL> for yindex in xrange ( originY , originY + self . size ) : <EOL> for xindex in xrange ( originX , originX + self . size ) : <EOL> if not self . inbounds ( xindex , yindex ) : <EOL> old = self . get ( xindex , yindex ) <EOL> new = self . replaceValue ( xindex , yindex , old ) <EOL> self . store ( xindex , yindex , new ) <EOL> self . originX = originX <EOL> self . originY = originY <EOL> def inbounds ( self , x , y ) : <EOL> """<STR_LIT>""" <EOL> return ( <NUM_LIT:0> <= ( x - self . originX ) < self . size ) and ( <NUM_LIT:0> <= ( y - self . originY ) < self . size ) <EOL> def get ( self , x , y ) : <EOL> """<STR_LIT>""" <EOL> return self . data [ self . _cellIndex ( x , y ) ] <EOL> def _cellIndex ( self , x , y ) : <EOL> col = x % self . size <EOL> row = y % self . size <EOL> return col + row * self . size <EOL> def store ( self , x , y , data ) : <EOL> """<STR_LIT>""" <EOL> self . data [ self . _cellIndex ( x , y ) ] = data </s>
<s> import sys <EOL> from lib . db import * <EOL> class sample ( object ) : <EOL> def __init__ ( self ) : <EOL> pass <EOL> def define_sample ( self , md5 , sha1 , sha256 , ruleset_name , rule_name , notificaiton_date , first_seen , detection_ratio , size ) : <EOL> self . md5 = md5 <EOL> self . sha1 = sha1 <EOL> self . sha256 = sha256 <EOL> self . ruleset_name = ruleset_name <EOL> self . rule_name = rule_name <EOL> self . notificaiton_date = notificaiton_date <EOL> self . first_seen = first_seen <EOL> self . detection_ratio = detection_ratio <EOL> self . size = size <EOL> def define_by_hash ( self , usr_hash ) : <EOL> db_cursor = db_notif . cursor ( ) <EOL> if ( usr_hash . isalnum ( ) == False ) : <EOL> sys . exit ( "<STR_LIT>" ) <EOL> elif ( len ( usr_hash ) == <NUM_LIT:32> ) : <EOL> sql_select_details = "<STR_LIT>" <EOL> elif ( len ( usr_hash ) == <NUM_LIT> ) : <EOL> sql_select_details = "<STR_LIT>" <EOL> elif ( len ( usr_hash ) == <NUM_LIT:64> ) : <EOL> sql_select_details = "<STR_LIT>" <EOL> else : <EOL> sys . exit ( "<STR_LIT>" ) <EOL> db_cursor . execute ( sql_select_details , ( [ usr_hash ] ) ) <EOL> db_result = db_cursor . fetchone ( ) <EOL> if db_result is None : <EOL> sys . exit ( "<STR_LIT>" ) <EOL> else : <EOL> try : <EOL> self . define_sample ( <EOL> db_result [ <NUM_LIT:0> ] , <EOL> db_result [ <NUM_LIT:1> ] , <EOL> db_result [ <NUM_LIT:2> ] , <EOL> db_result [ <NUM_LIT:3> ] , <EOL> db_result [ <NUM_LIT:4> ] , <EOL> db_result [ <NUM_LIT:5> ] , <EOL> db_result [ <NUM_LIT:6> ] , <EOL> db_result [ <NUM_LIT:7> ] , <EOL> db_result [ <NUM_LIT:8> ] <EOL> ) <EOL> self . set_path ( db_result [ <NUM_LIT:9> ] ) <EOL> except : <EOL> sys . exit ( "<STR_LIT>" ) <EOL> '''<STR_LIT>''' <EOL> def print_self ( self ) : <EOL> print "<STR_LIT>" % self . md5 <EOL> print "<STR_LIT>" % self . sha1 <EOL> print "<STR_LIT>" % self . sha256 <EOL> print "<STR_LIT>" % self . ruleset_name <EOL> print "<STR_LIT>" % self . rule_name <EOL> print "<STR_LIT>" % self . notificaiton_date <EOL> print "<STR_LIT>" % self . first_seen <EOL> print "<STR_LIT>" % self . detection_ratio <EOL> print "<STR_LIT>" % self . size <EOL> '''<STR_LIT>''' <EOL> def print_short ( self ) : <EOL> print "<STR_LIT>" % ( self . md5 , self . rule_name ) <EOL> def set_path ( self , path ) : <EOL> self . path = path <EOL> def insert_db ( self ) : <EOL> values = [ <EOL> self . md5 , <EOL> self . sha1 , <EOL> self . sha256 , <EOL> self . ruleset_name , <EOL> self . rule_name , <EOL> self . notificaiton_date , <EOL> self . first_seen , <EOL> self . detection_ratio , <EOL> self . size , <EOL> self . path <EOL> ] <EOL> sql_insert = "<STR_LIT>" <EOL> try : <EOL> db_notif . execute ( sql_insert , ( values ) ) <EOL> db_notif . commit ( ) <EOL> return True <EOL> except : <EOL> return False <EOL> def check_new ( self ) : <EOL> db_cursor = db_notif . cursor ( ) <EOL> sql_check_new = "<STR_LIT>" <EOL> db_cursor . execute ( sql_check_new , ( self . md5 , self . rule_name ) ) <EOL> if db_cursor . fetchone ( ) is None : <EOL> return True <EOL> else : <EOL> return False </s>
<s> from __future__ import unicode_literals <EOL> from django . db import models , migrations <EOL> class Migration ( migrations . Migration ) : <EOL> dependencies = [ <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ] <EOL> operations = [ <EOL> migrations . AlterModelOptions ( <EOL> name = '<STR_LIT>' , <EOL> options = { '<STR_LIT>' : '<STR_LIT>' } , <EOL> ) , <EOL> migrations . AlterModelOptions ( <EOL> name = '<STR_LIT>' , <EOL> options = { } , <EOL> ) , <EOL> migrations . AlterModelOptions ( <EOL> name = '<STR_LIT>' , <EOL> options = { '<STR_LIT>' : '<STR_LIT>' } , <EOL> ) , <EOL> ] </s>
<s> """<STR_LIT>""" <EOL> from collections import defaultdict <EOL> from django . conf import settings <EOL> from rest_framework import viewsets <EOL> from rest_framework import mixins <EOL> from rest_framework import pagination <EOL> from rest_framework . views import APIView <EOL> from rest_framework . response import Response <EOL> from omaha . api import BaseView <EOL> from omaha . models import Version <EOL> from sparkle . serializers import SparkleVersionSerializer <EOL> from sparkle . models import SparkleVersion <EOL> class LatestVersionView ( APIView ) : <EOL> """<STR_LIT>""" <EOL> permission_classes = [ ] <EOL> def get ( self , request , format = None ) : <EOL> win_versions = Version . objects . filter_by_enabled ( ) . select_related ( '<STR_LIT>' , '<STR_LIT>' ) . order_by ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) . distinct ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> mac_versions = SparkleVersion . objects . filter_by_enabled ( ) . select_related ( '<STR_LIT>' , '<STR_LIT>' ) . order_by ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) . distinct ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> recursive_dd = lambda : defaultdict ( recursive_dd ) <EOL> data = recursive_dd ( ) <EOL> for v in win_versions : <EOL> data [ v . app . name ] [ '<STR_LIT>' ] [ v . channel . name ] = dict ( version = str ( v . version ) , url = v . file_absolute_url ) <EOL> for v in mac_versions : <EOL> data [ v . app . name ] [ '<STR_LIT>' ] [ v . channel . name ] = dict ( version = str ( v . short_version ) , url = v . file_absolute_url ) <EOL> return Response ( data ) </s>
<s> """<STR_LIT>""" <EOL> from django . test import TestCase <EOL> from feedback . models import Feedback <EOL> from feedback . factories import FeedbackFactory <EOL> class FeedbackManagerTest ( TestCase ) : <EOL> def test_get_size ( self ) : <EOL> screenshot_size = <NUM_LIT:10> <EOL> blackbox_size = <NUM_LIT:20> <EOL> attached_file_size = <NUM_LIT:30> <EOL> system_logs_size = <NUM_LIT> <EOL> FeedbackFactory . create_batch ( <NUM_LIT:10> , screenshot_size = screenshot_size , <EOL> blackbox_size = blackbox_size , <EOL> attached_file_size = attached_file_size , <EOL> system_logs_size = system_logs_size ) <EOL> size = Feedback . objects . get_size ( ) <EOL> self . assertEqual ( size , ( screenshot_size + blackbox_size + attached_file_size + system_logs_size ) * <NUM_LIT:10> ) </s>
<s> from __future__ import unicode_literals <EOL> from django . db import models , migrations <EOL> import omaha . fields <EOL> class Migration ( migrations . Migration ) : <EOL> dependencies = [ <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ] <EOL> operations = [ <EOL> migrations . CreateModel ( <EOL> name = '<STR_LIT>' , <EOL> fields = [ <EOL> ( '<STR_LIT:id>' , models . AutoField ( verbose_name = '<STR_LIT>' , serialize = False , auto_created = True , primary_key = True ) ) , <EOL> ( '<STR_LIT>' , models . BooleanField ( default = True ) ) , <EOL> ( '<STR_LIT>' , omaha . fields . PercentField ( ) ) , <EOL> ( '<STR_LIT>' , models . DateField ( ) ) , <EOL> ( '<STR_LIT>' , models . DateField ( ) ) , <EOL> ( '<STR_LIT:version>' , models . OneToOneField ( to = '<STR_LIT>' ) ) , <EOL> ] , <EOL> options = { <EOL> } , <EOL> bases = ( models . Model , ) , <EOL> ) , <EOL> ] </s>
<s> """<STR_LIT>""" <EOL> from builtins import range <EOL> from functools import partial <EOL> from datetime import datetime , timedelta <EOL> from django . conf import settings <EOL> from django . db import transaction <EOL> from django . utils import timezone <EOL> from bitmapist import setup_redis , mark_event , unmark_event , WeekEvents , MonthEvents , DayEvents , HourEvents <EOL> import pytz <EOL> from omaha . utils import get_id , is_new_install , valuedispatch , redis <EOL> from omaha . settings import DEFAULT_CHANNEL <EOL> from omaha . models import ACTIVE_USERS_DICT_CHOICES , Request , AppRequest , Os , Hw , Event , Version , Channel <EOL> from sparkle . models import SparkleVersion <EOL> __all__ = [ '<STR_LIT>' , '<STR_LIT>' ] <EOL> host , port , db = settings . CACHES [ '<STR_LIT>' ] [ '<STR_LIT>' ] . split ( '<STR_LIT::>' ) <EOL> setup_redis ( '<STR_LIT:default>' , host , port , db = db ) <EOL> def userid_counting ( userid , apps_list , platform , now = None ) : <EOL> id = get_id ( userid ) <EOL> mark_event ( '<STR_LIT>' , id , now = now ) <EOL> list ( map ( partial ( add_app_statistics , id , platform , now = now ) , apps_list or [ ] ) ) <EOL> def add_app_statistics ( userid , platform , app , now = None ) : <EOL> mark = partial ( mark_event , now = now ) <EOL> if not now : <EOL> now = timezone . now ( ) <EOL> appid = app . get ( '<STR_LIT>' ) <EOL> version = app . get ( '<STR_LIT:version>' ) <EOL> channel = app . get ( '<STR_LIT>' ) or DEFAULT_CHANNEL <EOL> if is_new_install ( appid , userid ) : <EOL> mark ( '<STR_LIT>' % appid , userid ) <EOL> mark ( '<STR_LIT>' . format ( appid , platform ) , userid ) <EOL> redis . setbit ( "<STR_LIT>" % appid , userid , <NUM_LIT:1> ) <EOL> elif userid not in MonthEvents ( '<STR_LIT>' . format ( appid , platform ) , year = now . year , month = now . month ) : <EOL> mark ( '<STR_LIT>' % appid , userid ) <EOL> mark ( '<STR_LIT>' . format ( appid , platform ) , userid ) <EOL> mark ( '<STR_LIT>' . format ( appid , version ) , userid ) <EOL> mark ( '<STR_LIT>' . format ( appid , channel ) , userid ) <EOL> mark ( '<STR_LIT>' . format ( appid , platform , version ) , userid ) <EOL> def update_live_statistics ( userid , apps_list , platform , now = None ) : <EOL> id = get_id ( userid ) <EOL> list ( map ( partial ( add_app_live_statistics , id , platform , now = now ) , apps_list or [ ] ) ) <EOL> def add_app_live_statistics ( userid , platform , app , now = None ) : <EOL> mark = partial ( mark_event , now = now , track_hourly = True ) <EOL> unmark = partial ( unmark_event , track_hourly = True ) <EOL> appid = app . get ( '<STR_LIT>' ) <EOL> version = app . get ( '<STR_LIT:version>' ) <EOL> events = app . findall ( '<STR_LIT>' ) <EOL> nextversion = app . get ( '<STR_LIT>' ) <EOL> install_event = filter ( lambda x : x . get ( '<STR_LIT>' ) == '<STR_LIT:2>' , events ) <EOL> if install_event and install_event [ <NUM_LIT:0> ] . get ( '<STR_LIT>' ) == '<STR_LIT:1>' : <EOL> mark ( '<STR_LIT>' . format ( appid , nextversion ) , userid ) <EOL> mark ( '<STR_LIT>' . format ( appid , platform , nextversion ) , userid ) <EOL> return <EOL> update_event = filter ( lambda x : x . get ( '<STR_LIT>' ) == '<STR_LIT:3>' , events ) <EOL> if update_event and update_event [ <NUM_LIT:0> ] . get ( '<STR_LIT>' ) == '<STR_LIT:1>' : <EOL> unmark ( '<STR_LIT>' . format ( appid , version ) , userid ) <EOL> unmark ( '<STR_LIT>' . format ( appid , platform , version ) , userid ) <EOL> mark ( '<STR_LIT>' . format ( appid , nextversion ) , userid ) <EOL> mark ( '<STR_LIT>' . format ( appid , platform , nextversion ) , userid ) <EOL> return <EOL> uninstall_event = filter ( lambda x : x . get ( '<STR_LIT>' ) == '<STR_LIT:4>' , events ) <EOL> if uninstall_event and uninstall_event [ <NUM_LIT:0> ] . get ( '<STR_LIT>' ) == '<STR_LIT:1>' : <EOL> unmark ( '<STR_LIT>' . format ( appid , version ) , userid ) <EOL> unmark ( '<STR_LIT>' . format ( appid , platform , version ) , userid ) <EOL> return <EOL> if version : <EOL> mark ( '<STR_LIT>' . format ( appid , version ) , userid ) <EOL> mark ( '<STR_LIT>' . format ( appid , platform , version ) , userid ) <EOL> def get_users_statistics_months ( app_id , platform = None , year = None , start = <NUM_LIT:1> , end = <NUM_LIT:12> ) : <EOL> now = timezone . now ( ) <EOL> if not year : <EOL> year = now . year <EOL> if platform : <EOL> install_event_name = '<STR_LIT>' . format ( app_id , platform ) <EOL> update_event_name = '<STR_LIT>' . format ( app_id , platform ) <EOL> else : <EOL> install_event_name = '<STR_LIT>' % app_id <EOL> update_event_name = '<STR_LIT>' % app_id <EOL> installs_by_month = [ ] <EOL> updates_by_month = [ ] <EOL> for m in range ( start , end + <NUM_LIT:1> ) : <EOL> installs_by_month . append ( MonthEvents ( install_event_name , year , m ) ) <EOL> updates_by_month . append ( MonthEvents ( update_event_name , year , m ) ) <EOL> installs_data = [ ( datetime ( year , start + i , <NUM_LIT:1> ) . strftime ( "<STR_LIT>" ) , len ( e ) ) for i , e in enumerate ( installs_by_month ) ] <EOL> updates_data = [ ( datetime ( year , start + i , <NUM_LIT:1> ) . strftime ( "<STR_LIT>" ) , len ( e ) ) for i , e in enumerate ( updates_by_month ) ] <EOL> return dict ( new = installs_data , updates = updates_data ) <EOL> def get_users_statistics_weeks ( app_id = None ) : <EOL> now = timezone . now ( ) <EOL> event_name = '<STR_LIT>' % app_id if app_id else '<STR_LIT>' <EOL> year = now . year <EOL> current_week = now . isocalendar ( ) [ <NUM_LIT:1> ] <EOL> previous_week = ( now - timedelta ( weeks = <NUM_LIT:1> ) ) . isocalendar ( ) [ <NUM_LIT:1> ] <EOL> yesterday = now - timedelta ( days = <NUM_LIT:1> ) <EOL> data = [ <EOL> ( '<STR_LIT>' , len ( WeekEvents ( event_name , year , previous_week ) ) ) , <EOL> ( '<STR_LIT>' , len ( WeekEvents ( event_name , year , current_week ) ) ) , <EOL> ( '<STR_LIT>' , len ( DayEvents ( event_name , year , yesterday . month , yesterday . day ) ) ) , <EOL> ( '<STR_LIT>' , len ( DayEvents ( event_name , year , now . month , now . day ) ) ) , <EOL> ] <EOL> return data <EOL> def get_channel_statistics ( app_id , date = None ) : <EOL> if not date : <EOL> date = timezone . now ( ) <EOL> event_name = '<STR_LIT>' <EOL> channels = [ c . name for c in Channel . objects . all ( ) ] <EOL> data = [ ( channel , len ( MonthEvents ( event_name . format ( app_id , channel ) , date . year , date . month ) ) ) for channel in channels ] <EOL> data = filter ( lambda x : x [ <NUM_LIT:1> ] , data ) <EOL> return data <EOL> def get_users_versions_by_platform ( app_id , platform , date ) : <EOL> if platform == '<STR_LIT>' : <EOL> versions = [ str ( v . version ) for v in Version . objects . filter_by_enabled ( app__id = app_id ) ] <EOL> else : <EOL> versions = [ str ( v . short_version ) for v in SparkleVersion . objects . filter_by_enabled ( app__id = app_id ) ] <EOL> event_name = '<STR_LIT>' <EOL> data = [ ( v , len ( MonthEvents ( event_name . format ( app_id , platform , v ) , date . year , date . month ) ) ) for v in versions ] <EOL> return data <EOL> def get_users_versions ( app_id , date = None ) : <EOL> if not date : <EOL> date = timezone . now ( ) <EOL> win_data = get_users_versions_by_platform ( app_id , '<STR_LIT>' , date ) <EOL> win_data = filter ( lambda x : x [ <NUM_LIT:1> ] , win_data ) <EOL> mac_data = get_users_versions_by_platform ( app_id , '<STR_LIT>' , date ) <EOL> mac_data = filter ( lambda x : x [ <NUM_LIT:1> ] , mac_data ) <EOL> data = dict ( win = dict ( win_data ) , mac = dict ( mac_data ) ) <EOL> return data <EOL> def get_versions_data_by_platform ( app_id , end , n_hours , versions , platform , tz = '<STR_LIT>' ) : <EOL> tzinfo = pytz . timezone ( tz ) <EOL> start = end - timezone . timedelta ( hours = n_hours ) <EOL> event_name = "<STR_LIT>" <EOL> hours = [ datetime ( start . year , start . month , start . day , start . hour , tzinfo = pytz . UTC ) <EOL> + timezone . timedelta ( hours = x ) for x in range ( <NUM_LIT:1> , n_hours + <NUM_LIT:1> ) ] <EOL> data = [ ( v , [ [ hour . astimezone ( tzinfo ) . strftime ( "<STR_LIT>" ) , <EOL> len ( HourEvents . from_date ( event_name . format ( app_id , platform , v ) , hour ) ) ] <EOL> for hour in hours ] ) <EOL> for v in versions ] <EOL> data = filter ( lambda version_data : sum ( [ data [ <NUM_LIT:1> ] for data in version_data [ <NUM_LIT:1> ] ] ) , data ) <EOL> return dict ( data ) <EOL> def get_users_live_versions ( app_id , start , end , tz = '<STR_LIT>' ) : <EOL> win_versions = [ str ( v . version ) for v in Version . objects . filter_by_enabled ( app__id = app_id ) ] <EOL> mac_versions = [ str ( v . short_version ) for v in SparkleVersion . objects . filter_by_enabled ( app__id = app_id ) ] <EOL> tmp_hours = divmod ( ( end - start ) . total_seconds ( ) , <NUM_LIT> * <NUM_LIT> ) <EOL> n_hours = tmp_hours [ <NUM_LIT:0> ] + <NUM_LIT:1> <EOL> n_hours = int ( n_hours ) <EOL> win_data = get_versions_data_by_platform ( app_id , end , n_hours , win_versions , '<STR_LIT>' , tz = tz ) <EOL> mac_data = get_versions_data_by_platform ( app_id , end , n_hours , mac_versions , '<STR_LIT>' , tz = tz ) <EOL> data = dict ( win = win_data , mac = mac_data ) <EOL> return data <EOL> @ valuedispatch <EOL> def is_user_active ( period , userid ) : <EOL> return False <EOL> @ is_user_active . register ( ACTIVE_USERS_DICT_CHOICES [ '<STR_LIT:all>' ] ) <EOL> def _ ( period , userid ) : <EOL> return True <EOL> @ is_user_active . register ( ACTIVE_USERS_DICT_CHOICES [ '<STR_LIT>' ] ) <EOL> def _ ( period , userid ) : <EOL> return get_id ( userid ) in WeekEvents . from_date ( '<STR_LIT>' , timezone . now ( ) ) <EOL> @ is_user_active . register ( ACTIVE_USERS_DICT_CHOICES [ '<STR_LIT>' ] ) <EOL> def _ ( period , userid ) : <EOL> return get_id ( userid ) in MonthEvents . from_date ( '<STR_LIT>' , timezone . now ( ) ) <EOL> def get_kwargs_for_model ( cls , obj , exclude = None ) : <EOL> exclude = exclude or [ ] <EOL> fields = [ ( field . name , field . to_python ) for field in cls . _meta . fields if field . name not in exclude ] <EOL> kwargs = dict ( [ ( i , convert ( obj . get ( i ) ) ) for ( i , convert ) in fields ] ) <EOL> return kwargs <EOL> def parse_os ( os ) : <EOL> kwargs = get_kwargs_for_model ( Os , os , exclude = [ '<STR_LIT:id>' ] ) <EOL> obj , flag = Os . objects . get_or_create ( ** kwargs ) <EOL> return obj <EOL> def parse_hw ( hw ) : <EOL> kwargs = get_kwargs_for_model ( Hw , hw , exclude = [ '<STR_LIT:id>' ] ) <EOL> obj , flag = Hw . objects . get_or_create ( ** kwargs ) <EOL> return obj <EOL> def parse_req ( request , ip = None ) : <EOL> kwargs = get_kwargs_for_model ( Request , request , exclude = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT:id>' ] ) <EOL> kwargs [ '<STR_LIT>' ] = ip <EOL> return Request ( ** kwargs ) <EOL> def parse_apps ( apps , request ) : <EOL> app_list = [ ] <EOL> for app in apps : <EOL> events = app . findall ( '<STR_LIT>' ) <EOL> if not events : <EOL> continue <EOL> kwargs = get_kwargs_for_model ( AppRequest , app , exclude = [ '<STR_LIT>' , '<STR_LIT:version>' , '<STR_LIT>' , '<STR_LIT:id>' ] ) <EOL> kwargs [ '<STR_LIT:version>' ] = app . get ( '<STR_LIT:version>' ) or None <EOL> kwargs [ '<STR_LIT>' ] = app . get ( '<STR_LIT>' ) or None <EOL> app_req = AppRequest . objects . create ( request = request , ** kwargs ) <EOL> event_list = parse_events ( events ) <EOL> app_req . events . add ( * event_list ) <EOL> app_list . append ( app_req ) <EOL> return app_list <EOL> def parse_events ( events ) : <EOL> res = [ ] <EOL> for event in events : <EOL> kwargs = get_kwargs_for_model ( Event , event ) <EOL> res . append ( Event . objects . create ( ** kwargs ) ) <EOL> return res <EOL> @ transaction . atomic <EOL> def collect_statistics ( request , ip = None ) : <EOL> userid = request . get ( '<STR_LIT>' ) <EOL> apps = request . findall ( '<STR_LIT>' ) <EOL> if userid : <EOL> userid_counting ( userid , apps , request . os . get ( '<STR_LIT>' ) ) <EOL> update_live_statistics ( userid , apps , request . os . get ( '<STR_LIT>' ) ) <EOL> if not filter ( lambda app : bool ( app . findall ( '<STR_LIT>' ) ) , apps ) : <EOL> return <EOL> req = parse_req ( request , ip ) <EOL> req . os = parse_os ( request . os ) <EOL> req . hw = parse_hw ( request . hw ) if request . get ( '<STR_LIT>' ) else None <EOL> req . save ( ) <EOL> parse_apps ( apps , req ) </s>
<s> """<STR_LIT>""" <EOL> from django . conf import settings <EOL> from django . conf . urls import url <EOL> from omaha . views import UpdateView <EOL> from omaha . views_admin import ( <EOL> StatisticsView , <EOL> StatisticsDetailView , <EOL> LiveStatisticsView , <EOL> VersionsUsageView , <EOL> RequestListView , <EOL> AppRequestDetailView , <EOL> PreferenceFormView , <EOL> MonitoringFormView , <EOL> ManualCleanupFormView , <EOL> ) <EOL> urlpatterns = [ <EOL> url ( r'<STR_LIT>' , UpdateView . as_view ( ) , name = '<STR_LIT>' ) , <EOL> ] <EOL> if settings . IS_PRIVATE : <EOL> urlpatterns += [ <EOL> url ( r'<STR_LIT>' , StatisticsView . as_view ( ) , name = '<STR_LIT>' ) , <EOL> url ( r'<STR_LIT>' , StatisticsDetailView . as_view ( ) , <EOL> name = '<STR_LIT>' ) , <EOL> url ( r'<STR_LIT>' , LiveStatisticsView . as_view ( ) , <EOL> name = '<STR_LIT>' ) , <EOL> url ( r'<STR_LIT>' , RequestListView . as_view ( ) , name = '<STR_LIT>' ) , <EOL> url ( r'<STR_LIT>' , VersionsUsageView . as_view ( ) , name = '<STR_LIT>' ) , <EOL> url ( r'<STR_LIT>' , AppRequestDetailView . as_view ( ) , name = '<STR_LIT>' ) , <EOL> url ( r'<STR_LIT>' , PreferenceFormView . as_view ( ) , name = '<STR_LIT>' ) , <EOL> url ( r'<STR_LIT>' , MonitoringFormView . as_view ( ) , name = '<STR_LIT>' ) , <EOL> url ( r'<STR_LIT>' , ManualCleanupFormView . as_view ( ) , name = '<STR_LIT>' ) , <EOL> ] </s>
<s> from __future__ import unicode_literals <EOL> from django . db import models , migrations <EOL> class Migration ( migrations . Migration ) : <EOL> dependencies = [ <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ] <EOL> operations = [ <EOL> migrations . AddField ( <EOL> model_name = '<STR_LIT>' , <EOL> name = '<STR_LIT>' , <EOL> field = models . BooleanField ( default = True ) , <EOL> preserve_default = True , <EOL> ) , <EOL> ] </s>
<s> """<STR_LIT>""" <EOL> import sys <EOL> PY2 = sys . version_info [ <NUM_LIT:0> ] == <NUM_LIT:2> <EOL> PY3 = sys . version_info [ <NUM_LIT:0> ] == <NUM_LIT:3> <EOL> if PY2 : <EOL> p_input = raw_input <EOL> p_map = map <EOL> def to_bytes ( s ) : <EOL> if isinstance ( s , str ) : <EOL> return s <EOL> if isinstance ( s , unicode ) : <EOL> return s . encode ( '<STR_LIT:utf-8>' ) <EOL> to_str = to_bytes <EOL> def bchr ( s ) : <EOL> return chr ( s ) <EOL> def bord ( s ) : <EOL> return ord ( s ) <EOL> elif PY3 : <EOL> p_input = input <EOL> p_map = lambda f , it : list ( map ( f , it ) ) <EOL> def to_bytes ( s ) : <EOL> if isinstance ( s , bytes ) : <EOL> return s <EOL> if isinstance ( s , str ) : <EOL> return s . encode ( '<STR_LIT:utf-8>' ) <EOL> def to_str ( s ) : <EOL> if isinstance ( s , bytes ) : <EOL> return s . decode ( '<STR_LIT:utf-8>' ) <EOL> if isinstance ( s , str ) : <EOL> return s <EOL> def bchr ( s ) : <EOL> return bytes ( [ s ] ) <EOL> def bord ( s ) : <EOL> return s </s>
<s> """<STR_LIT>""" <EOL> try : <EOL> from setuptools import setup <EOL> except ImportError : <EOL> from distutils . core import setup <EOL> setup ( name = '<STR_LIT>' , <EOL> version = '<STR_LIT>' , <EOL> description = '<STR_LIT>' , <EOL> license = '<STR_LIT>' , <EOL> author = '<STR_LIT>' , <EOL> author_email = '<STR_LIT>' , <EOL> url = '<STR_LIT>' , <EOL> package_dir = { '<STR_LIT>' : '<STR_LIT:src>' } , <EOL> packages = [ <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' <EOL> ] , <EOL> namespace_packages = [ <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' <EOL> ] , <EOL> zip_safe = True <EOL> ) </s>
<s> import os <EOL> import logging <EOL> import numpy as np <EOL> import theano <EOL> from pandas import DataFrame , read_hdf <EOL> from blocks . extensions import Printing , SimpleExtension <EOL> from blocks . main_loop import MainLoop <EOL> from blocks . roles import add_role <EOL> logger = logging . getLogger ( '<STR_LIT>' ) <EOL> def shared_param ( init , name , cast_float32 , role , ** kwargs ) : <EOL> if cast_float32 : <EOL> v = np . float32 ( init ) <EOL> p = theano . shared ( v , name = name , ** kwargs ) <EOL> add_role ( p , role ) <EOL> return p <EOL> class AttributeDict ( dict ) : <EOL> __getattr__ = dict . __getitem__ <EOL> def __setattr__ ( self , a , b ) : <EOL> self . __setitem__ ( a , b ) <EOL> class DummyLoop ( MainLoop ) : <EOL> def __init__ ( self , extensions ) : <EOL> return super ( DummyLoop , self ) . __init__ ( algorithm = None , <EOL> data_stream = None , <EOL> extensions = extensions ) <EOL> def run ( self ) : <EOL> for extension in self . extensions : <EOL> extension . main_loop = self <EOL> self . _run_extensions ( '<STR_LIT>' ) <EOL> self . _run_extensions ( '<STR_LIT>' ) <EOL> class ShortPrinting ( Printing ) : <EOL> def __init__ ( self , to_print , use_log = True , ** kwargs ) : <EOL> self . to_print = to_print <EOL> self . use_log = use_log <EOL> super ( ShortPrinting , self ) . __init__ ( ** kwargs ) <EOL> def do ( self , which_callback , * args ) : <EOL> log = self . main_loop . log <EOL> msg = "<STR_LIT>" . format ( <EOL> log . status [ '<STR_LIT>' ] , <EOL> log . status [ '<STR_LIT>' ] ) <EOL> items = [ ] <EOL> for k , vars in self . to_print . iteritems ( ) : <EOL> for shortname , vars in vars . iteritems ( ) : <EOL> if vars is None : <EOL> continue <EOL> if type ( vars ) is not list : <EOL> vars = [ vars ] <EOL> s = "<STR_LIT>" <EOL> for var in vars : <EOL> try : <EOL> name = k + '<STR_LIT:_>' + var . name <EOL> val = log . current_row [ name ] <EOL> except : <EOL> continue <EOL> try : <EOL> s += '<STR_LIT:U+0020>' + '<STR_LIT:U+0020>' . join ( [ "<STR_LIT>" % v for v in val ] ) <EOL> except : <EOL> s += "<STR_LIT>" % val <EOL> if s != "<STR_LIT>" : <EOL> items += [ shortname + s ] <EOL> msg = msg + "<STR_LIT:U+002CU+0020>" . join ( items ) <EOL> if self . use_log : <EOL> logger . info ( msg ) <EOL> else : <EOL> print msg <EOL> class SaveParams ( SimpleExtension ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , trigger_var , params , save_path , ** kwargs ) : <EOL> super ( SaveParams , self ) . __init__ ( ** kwargs ) <EOL> if trigger_var is None : <EOL> self . var_name = None <EOL> else : <EOL> self . var_name = trigger_var [ <NUM_LIT:0> ] + '<STR_LIT:_>' + trigger_var [ <NUM_LIT:1> ] . name <EOL> self . save_path = save_path <EOL> self . params = params <EOL> self . to_save = { } <EOL> self . best_value = None <EOL> self . add_condition ( '<STR_LIT>' , self . save ) <EOL> self . add_condition ( '<STR_LIT>' , self . save ) <EOL> def save ( self , which_callback , * args ) : <EOL> if self . var_name is None : <EOL> self . to_save = { v . name : v . get_value ( ) for v in self . params } <EOL> path = self . save_path + '<STR_LIT>' <EOL> logger . info ( '<STR_LIT>' % path ) <EOL> np . savez_compressed ( path , ** self . to_save ) <EOL> def do ( self , which_callback , * args ) : <EOL> if self . var_name is None : <EOL> return <EOL> val = self . main_loop . log . current_row [ self . var_name ] <EOL> if self . best_value is None or val < self . best_value : <EOL> self . best_value = val <EOL> self . to_save = { v . name : v . get_value ( ) for v in self . params } <EOL> class SaveExpParams ( SimpleExtension ) : <EOL> def __init__ ( self , experiment_params , dir , ** kwargs ) : <EOL> super ( SaveExpParams , self ) . __init__ ( ** kwargs ) <EOL> self . dir = dir <EOL> self . experiment_params = experiment_params <EOL> def do ( self , which_callback , * args ) : <EOL> df = DataFrame . from_dict ( self . experiment_params , orient = '<STR_LIT:index>' ) <EOL> df . to_hdf ( os . path . join ( self . dir , '<STR_LIT>' ) , '<STR_LIT>' , mode = '<STR_LIT:w>' , <EOL> complevel = <NUM_LIT:5> , complib = '<STR_LIT>' ) <EOL> class SaveLog ( SimpleExtension ) : <EOL> def __init__ ( self , dir , show = None , ** kwargs ) : <EOL> super ( SaveLog , self ) . __init__ ( ** kwargs ) <EOL> self . dir = dir <EOL> self . show = show if show is not None else [ ] <EOL> def do ( self , which_callback , * args ) : <EOL> df = self . main_loop . log . to_dataframe ( ) <EOL> df . to_hdf ( os . path . join ( self . dir , '<STR_LIT>' ) , '<STR_LIT>' , mode = '<STR_LIT:w>' , <EOL> complevel = <NUM_LIT:5> , complib = '<STR_LIT>' ) <EOL> def prepare_dir ( save_to , results_dir = '<STR_LIT>' ) : <EOL> base = os . path . join ( results_dir , save_to ) <EOL> i = <NUM_LIT:0> <EOL> while True : <EOL> name = base + str ( i ) <EOL> try : <EOL> os . makedirs ( name ) <EOL> break <EOL> except : <EOL> i += <NUM_LIT:1> <EOL> return name <EOL> def load_df ( dirpath , filename , varname = None ) : <EOL> varname = filename if varname is None else varname <EOL> fn = os . path . join ( dirpath , filename ) <EOL> return read_hdf ( fn , varname ) <EOL> def filter_funcs_prefix ( d , pfx ) : <EOL> pfx = '<STR_LIT>' <EOL> fp = lambda x : x . find ( pfx ) <EOL> return { n [ fp ( n ) + len ( pfx ) : ] : v for n , v in d . iteritems ( ) if fp ( n ) >= <NUM_LIT:0> } </s>
<s> import sys <EOL> from mixbox . binding_utils import * <EOL> from . import cybox_common <EOL> from . import address_object <EOL> from . import port_object <EOL> from . import uri_object <EOL> class HTTPRequestResponseType ( GeneratedsSuper ) : <EOL> """<STR_LIT>""" <EOL> subclass = None <EOL> superclass = None <EOL> def __init__ ( self , ordinal_position = None , HTTP_Client_Request = None , HTTP_Provisional_Server_Response = None , HTTP_Server_Response = None ) : <EOL> self . ordinal_position = _cast ( int , ordinal_position ) <EOL> self . HTTP_Client_Request = HTTP_Client_Request <EOL> self . HTTP_Provisional_Server_Response = HTTP_Provisional_Server_Response <EOL> self . HTTP_Server_Response = HTTP_Server_Response <EOL> def factory ( * args_ , ** kwargs_ ) : <EOL> if HTTPRequestResponseType . subclass : <EOL> return HTTPRequestResponseType . subclass ( * args_ , ** kwargs_ ) <EOL> else : <EOL> return HTTPRequestResponseType ( * args_ , ** kwargs_ ) <EOL> factory = staticmethod ( factory ) <EOL> def get_HTTP_Client_Request ( self ) : return self . HTTP_Client_Request <EOL> def set_HTTP_Client_Request ( self , HTTP_Client_Request ) : self . HTTP_Client_Request = HTTP_Client_Request <EOL> def get_HTTP_Provisional_Server_Response ( self ) : return self . HTTP_Provisional_Server_Response <EOL> def set_HTTP_Provisional_Server_Response ( self , HTTP_Provisional_Server_Response ) : self . HTTP_Provisional_Server_Response = HTTP_Provisional_Server_Response <EOL> def get_HTTP_Server_Response ( self ) : return self . HTTP_Server_Response <EOL> def set_HTTP_Server_Response ( self , HTTP_Server_Response ) : self . HTTP_Server_Response = HTTP_Server_Response <EOL> def get_ordinal_position ( self ) : return self . ordinal_position <EOL> def set_ordinal_position ( self , ordinal_position ) : self . ordinal_position = ordinal_position <EOL> def hasContent_ ( self ) : <EOL> if ( <EOL> self . HTTP_Client_Request is not None or <EOL> self . HTTP_Provisional_Server_Response is not None or <EOL> self . HTTP_Server_Response is not None <EOL> ) : <EOL> return True <EOL> else : <EOL> return False <EOL> def export ( self , lwrite , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , namespacedef_ = '<STR_LIT>' , pretty_print = True ) : <EOL> if pretty_print : <EOL> eol_ = '<STR_LIT:\n>' <EOL> else : <EOL> eol_ = '<STR_LIT>' <EOL> showIndent ( lwrite , level , pretty_print ) <EOL> lwrite ( '<STR_LIT>' % ( namespace_ , name_ , namespacedef_ and '<STR_LIT:U+0020>' + namespacedef_ or '<STR_LIT>' , ) ) <EOL> already_processed = set ( ) <EOL> self . exportAttributes ( lwrite , level , already_processed , namespace_ , name_ = '<STR_LIT>' ) <EOL> if self . hasContent_ ( ) : <EOL> lwrite ( '<STR_LIT>' % ( eol_ , ) ) <EOL> self . exportChildren ( lwrite , level + <NUM_LIT:1> , namespace_ , name_ , pretty_print = pretty_print ) <EOL> showIndent ( lwrite , level , pretty_print ) <EOL> lwrite ( '<STR_LIT>' % ( namespace_ , name_ , eol_ ) ) <EOL> else : <EOL> lwrite ( '<STR_LIT>' % ( eol_ , ) ) <EOL> def exportAttributes ( self , lwrite , level , already_processed , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' ) : <EOL> if self . ordinal_position is not None : <EOL> lwrite ( '<STR_LIT>' % self . gds_format_integer ( self . ordinal_position , input_name = '<STR_LIT>' ) ) <EOL> def exportChildren ( self , lwrite , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , fromsubclass_ = False , pretty_print = True ) : <EOL> if pretty_print : <EOL> eol_ = '<STR_LIT:\n>' <EOL> else : <EOL> eol_ = '<STR_LIT>' <EOL> if self . HTTP_Client_Request is not None : <EOL> self . HTTP_Client_Request . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . HTTP_Provisional_Server_Response is not None : <EOL> self . HTTP_Provisional_Server_Response . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . HTTP_Server_Response is not None : <EOL> self . HTTP_Server_Response . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> def build ( self , node ) : <EOL> already_processed = set ( ) <EOL> self . buildAttributes ( node , node . attrib , already_processed ) <EOL> for child in node : <EOL> nodeName_ = Tag_pattern_ . match ( child . tag ) . groups ( ) [ - <NUM_LIT:1> ] <EOL> self . buildChildren ( child , node , nodeName_ ) <EOL> def buildAttributes ( self , node , attrs , already_processed ) : <EOL> value = find_attr_value_ ( '<STR_LIT>' , node ) <EOL> if value is not None : <EOL> try : <EOL> self . ordinal_position = int ( value ) <EOL> except ValueError as exp : <EOL> raise_parse_error ( node , '<STR_LIT>' % exp ) <EOL> if self . ordinal_position < <NUM_LIT:0> : <EOL> raise_parse_error ( node , '<STR_LIT>' ) <EOL> def buildChildren ( self , child_ , node , nodeName_ , fromsubclass_ = False ) : <EOL> if nodeName_ == '<STR_LIT>' : <EOL> obj_ = HTTPClientRequestType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_HTTP_Client_Request ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = HTTPServerResponseType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_HTTP_Provisional_Server_Response ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = HTTPServerResponseType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_HTTP_Server_Response ( obj_ ) <EOL> class HTTPClientRequestType ( GeneratedsSuper ) : <EOL> """<STR_LIT>""" <EOL> subclass = None <EOL> superclass = None <EOL> def __init__ ( self , HTTP_Request_Line = None , HTTP_Request_Header = None , HTTP_Message_Body = None ) : <EOL> self . HTTP_Request_Line = HTTP_Request_Line <EOL> self . HTTP_Request_Header = HTTP_Request_Header <EOL> self . HTTP_Message_Body = HTTP_Message_Body <EOL> def factory ( * args_ , ** kwargs_ ) : <EOL> if HTTPClientRequestType . subclass : <EOL> return HTTPClientRequestType . subclass ( * args_ , ** kwargs_ ) <EOL> else : <EOL> return HTTPClientRequestType ( * args_ , ** kwargs_ ) <EOL> factory = staticmethod ( factory ) <EOL> def get_HTTP_Request_Line ( self ) : return self . HTTP_Request_Line <EOL> def set_HTTP_Request_Line ( self , HTTP_Request_Line ) : self . HTTP_Request_Line = HTTP_Request_Line <EOL> def get_HTTP_Request_Header ( self ) : return self . HTTP_Request_Header <EOL> def set_HTTP_Request_Header ( self , HTTP_Request_Header ) : self . HTTP_Request_Header = HTTP_Request_Header <EOL> def get_HTTP_Message_Body ( self ) : return self . HTTP_Message_Body <EOL> def set_HTTP_Message_Body ( self , HTTP_Message_Body ) : self . HTTP_Message_Body = HTTP_Message_Body <EOL> def hasContent_ ( self ) : <EOL> if ( <EOL> self . HTTP_Request_Line is not None or <EOL> self . HTTP_Request_Header is not None or <EOL> self . HTTP_Message_Body is not None <EOL> ) : <EOL> return True <EOL> else : <EOL> return False <EOL> def export ( self , lwrite , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , namespacedef_ = '<STR_LIT>' , pretty_print = True ) : <EOL> if pretty_print : <EOL> eol_ = '<STR_LIT:\n>' <EOL> else : <EOL> eol_ = '<STR_LIT>' <EOL> showIndent ( lwrite , level , pretty_print ) <EOL> lwrite ( '<STR_LIT>' % ( namespace_ , name_ , namespacedef_ and '<STR_LIT:U+0020>' + namespacedef_ or '<STR_LIT>' , ) ) <EOL> already_processed = set ( ) <EOL> self . exportAttributes ( lwrite , level , already_processed , namespace_ , name_ = '<STR_LIT>' ) <EOL> if self . hasContent_ ( ) : <EOL> lwrite ( '<STR_LIT>' % ( eol_ , ) ) <EOL> self . exportChildren ( lwrite , level + <NUM_LIT:1> , namespace_ , name_ , pretty_print = pretty_print ) <EOL> showIndent ( lwrite , level , pretty_print ) <EOL> lwrite ( '<STR_LIT>' % ( namespace_ , name_ , eol_ ) ) <EOL> else : <EOL> lwrite ( '<STR_LIT>' % ( eol_ , ) ) <EOL> def exportAttributes ( self , lwrite , level , already_processed , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' ) : <EOL> pass <EOL> def exportChildren ( self , lwrite , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , fromsubclass_ = False , pretty_print = True ) : <EOL> if pretty_print : <EOL> eol_ = '<STR_LIT:\n>' <EOL> else : <EOL> eol_ = '<STR_LIT>' <EOL> if self . HTTP_Request_Line is not None : <EOL> self . HTTP_Request_Line . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . HTTP_Request_Header is not None : <EOL> self . HTTP_Request_Header . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . HTTP_Message_Body is not None : <EOL> self . HTTP_Message_Body . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> def build ( self , node ) : <EOL> already_processed = set ( ) <EOL> self . buildAttributes ( node , node . attrib , already_processed ) <EOL> for child in node : <EOL> nodeName_ = Tag_pattern_ . match ( child . tag ) . groups ( ) [ - <NUM_LIT:1> ] <EOL> self . buildChildren ( child , node , nodeName_ ) <EOL> def buildAttributes ( self , node , attrs , already_processed ) : <EOL> pass <EOL> def buildChildren ( self , child_ , node , nodeName_ , fromsubclass_ = False ) : <EOL> if nodeName_ == '<STR_LIT>' : <EOL> obj_ = HTTPRequestLineType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_HTTP_Request_Line ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = HTTPRequestHeaderType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_HTTP_Request_Header ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = HTTPMessageType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_HTTP_Message_Body ( obj_ ) <EOL> class HTTPServerResponseType ( GeneratedsSuper ) : <EOL> """<STR_LIT>""" <EOL> subclass = None <EOL> superclass = None <EOL> def __init__ ( self , HTTP_Status_Line = None , HTTP_Response_Header = None , HTTP_Message_Body = None ) : <EOL> self . HTTP_Status_Line = HTTP_Status_Line <EOL> self . HTTP_Response_Header = HTTP_Response_Header <EOL> self . HTTP_Message_Body = HTTP_Message_Body <EOL> def factory ( * args_ , ** kwargs_ ) : <EOL> if HTTPServerResponseType . subclass : <EOL> return HTTPServerResponseType . subclass ( * args_ , ** kwargs_ ) <EOL> else : <EOL> return HTTPServerResponseType ( * args_ , ** kwargs_ ) <EOL> factory = staticmethod ( factory ) <EOL> def get_HTTP_Status_Line ( self ) : return self . HTTP_Status_Line <EOL> def set_HTTP_Status_Line ( self , HTTP_Status_Line ) : self . HTTP_Status_Line = HTTP_Status_Line <EOL> def get_HTTP_Response_Header ( self ) : return self . HTTP_Response_Header <EOL> def set_HTTP_Response_Header ( self , HTTP_Response_Header ) : self . HTTP_Response_Header = HTTP_Response_Header <EOL> def get_HTTP_Message_Body ( self ) : return self . HTTP_Message_Body <EOL> def set_HTTP_Message_Body ( self , HTTP_Message_Body ) : self . HTTP_Message_Body = HTTP_Message_Body <EOL> def hasContent_ ( self ) : <EOL> if ( <EOL> self . HTTP_Status_Line is not None or <EOL> self . HTTP_Response_Header is not None or <EOL> self . HTTP_Message_Body is not None <EOL> ) : <EOL> return True <EOL> else : <EOL> return False <EOL> def export ( self , lwrite , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , namespacedef_ = '<STR_LIT>' , pretty_print = True ) : <EOL> if pretty_print : <EOL> eol_ = '<STR_LIT:\n>' <EOL> else : <EOL> eol_ = '<STR_LIT>' <EOL> showIndent ( lwrite , level , pretty_print ) <EOL> lwrite ( '<STR_LIT>' % ( namespace_ , name_ , namespacedef_ and '<STR_LIT:U+0020>' + namespacedef_ or '<STR_LIT>' , ) ) <EOL> already_processed = set ( ) <EOL> self . exportAttributes ( lwrite , level , already_processed , namespace_ , name_ = '<STR_LIT>' ) <EOL> if self . hasContent_ ( ) : <EOL> lwrite ( '<STR_LIT>' % ( eol_ , ) ) <EOL> self . exportChildren ( lwrite , level + <NUM_LIT:1> , namespace_ , name_ , pretty_print = pretty_print ) <EOL> showIndent ( lwrite , level , pretty_print ) <EOL> lwrite ( '<STR_LIT>' % ( namespace_ , name_ , eol_ ) ) <EOL> else : <EOL> lwrite ( '<STR_LIT>' % ( eol_ , ) ) <EOL> def exportAttributes ( self , lwrite , level , already_processed , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' ) : <EOL> pass <EOL> def exportChildren ( self , lwrite , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , fromsubclass_ = False , pretty_print = True ) : <EOL> if pretty_print : <EOL> eol_ = '<STR_LIT:\n>' <EOL> else : <EOL> eol_ = '<STR_LIT>' <EOL> if self . HTTP_Status_Line is not None : <EOL> self . HTTP_Status_Line . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . HTTP_Response_Header is not None : <EOL> self . HTTP_Response_Header . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . HTTP_Message_Body is not None : <EOL> self . HTTP_Message_Body . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> def build ( self , node ) : <EOL> already_processed = set ( ) <EOL> self . buildAttributes ( node , node . attrib , already_processed ) <EOL> for child in node : <EOL> nodeName_ = Tag_pattern_ . match ( child . tag ) . groups ( ) [ - <NUM_LIT:1> ] <EOL> self . buildChildren ( child , node , nodeName_ ) <EOL> def buildAttributes ( self , node , attrs , already_processed ) : <EOL> pass <EOL> def buildChildren ( self , child_ , node , nodeName_ , fromsubclass_ = False ) : <EOL> if nodeName_ == '<STR_LIT>' : <EOL> obj_ = HTTPStatusLineType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_HTTP_Status_Line ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = HTTPResponseHeaderType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_HTTP_Response_Header ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = HTTPMessageType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_HTTP_Message_Body ( obj_ ) <EOL> class HTTPRequestLineType ( GeneratedsSuper ) : <EOL> """<STR_LIT>""" <EOL> subclass = None <EOL> superclass = None <EOL> def __init__ ( self , HTTP_Method = None , Value = None , Version = None ) : <EOL> self . HTTP_Method = HTTP_Method <EOL> self . Value = Value <EOL> self . Version = Version <EOL> def factory ( * args_ , ** kwargs_ ) : <EOL> if HTTPRequestLineType . subclass : <EOL> return HTTPRequestLineType . subclass ( * args_ , ** kwargs_ ) <EOL> else : <EOL> return HTTPRequestLineType ( * args_ , ** kwargs_ ) <EOL> factory = staticmethod ( factory ) <EOL> def get_HTTP_Method ( self ) : return self . HTTP_Method <EOL> def set_HTTP_Method ( self , HTTP_Method ) : self . HTTP_Method = HTTP_Method <EOL> def validate_HTTPMethodType ( self , value ) : <EOL> pass <EOL> def get_Value ( self ) : return self . Value <EOL> def set_Value ( self , Value ) : self . Value = Value <EOL> def validate_StringObjectPropertyType ( self , value ) : <EOL> pass <EOL> def get_Version ( self ) : return self . Version <EOL> def set_Version ( self , Version ) : self . Version = Version <EOL> def hasContent_ ( self ) : <EOL> if ( <EOL> self . HTTP_Method is not None or <EOL> self . Value is not None or <EOL> self . Version is not None <EOL> ) : <EOL> return True <EOL> else : <EOL> return False <EOL> def export ( self , lwrite , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , namespacedef_ = '<STR_LIT>' , pretty_print = True ) : <EOL> if pretty_print : <EOL> eol_ = '<STR_LIT:\n>' <EOL> else : <EOL> eol_ = '<STR_LIT>' <EOL> showIndent ( lwrite , level , pretty_print ) <EOL> lwrite ( '<STR_LIT>' % ( namespace_ , name_ , namespacedef_ and '<STR_LIT:U+0020>' + namespacedef_ or '<STR_LIT>' , ) ) <EOL> already_processed = set ( ) <EOL> self . exportAttributes ( lwrite , level , already_processed , namespace_ , name_ = '<STR_LIT>' ) <EOL> if self . hasContent_ ( ) : <EOL> lwrite ( '<STR_LIT>' % ( eol_ , ) ) <EOL> self . exportChildren ( lwrite , level + <NUM_LIT:1> , namespace_ , name_ , pretty_print = pretty_print ) <EOL> showIndent ( lwrite , level , pretty_print ) <EOL> lwrite ( '<STR_LIT>' % ( namespace_ , name_ , eol_ ) ) <EOL> else : <EOL> lwrite ( '<STR_LIT>' % ( eol_ , ) ) <EOL> def exportAttributes ( self , lwrite , level , already_processed , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' ) : <EOL> pass <EOL> def exportChildren ( self , lwrite , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , fromsubclass_ = False , pretty_print = True ) : <EOL> if pretty_print : <EOL> eol_ = '<STR_LIT:\n>' <EOL> else : <EOL> eol_ = '<STR_LIT>' <EOL> if self . HTTP_Method is not None : <EOL> self . HTTP_Method . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Value is not None : <EOL> self . Value . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Version is not None : <EOL> self . Version . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> def build ( self , node ) : <EOL> already_processed = set ( ) <EOL> self . buildAttributes ( node , node . attrib , already_processed ) <EOL> for child in node : <EOL> nodeName_ = Tag_pattern_ . match ( child . tag ) . groups ( ) [ - <NUM_LIT:1> ] <EOL> self . buildChildren ( child , node , nodeName_ ) <EOL> def buildAttributes ( self , node , attrs , already_processed ) : <EOL> pass <EOL> def buildChildren ( self , child_ , node , nodeName_ , fromsubclass_ = False ) : <EOL> if nodeName_ == '<STR_LIT>' : <EOL> obj_ = HTTPMethodType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_HTTP_Method ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Value ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Version ( obj_ ) <EOL> class HTTPRequestHeaderType ( GeneratedsSuper ) : <EOL> """<STR_LIT>""" <EOL> subclass = None <EOL> superclass = None <EOL> def __init__ ( self , Raw_Header = None , Parsed_Header = None ) : <EOL> self . Raw_Header = Raw_Header <EOL> self . Parsed_Header = Parsed_Header <EOL> def factory ( * args_ , ** kwargs_ ) : <EOL> if HTTPRequestHeaderType . subclass : <EOL> return HTTPRequestHeaderType . subclass ( * args_ , ** kwargs_ ) <EOL> else : <EOL> return HTTPRequestHeaderType ( * args_ , ** kwargs_ ) <EOL> factory = staticmethod ( factory ) <EOL> def get_Raw_Header ( self ) : return self . Raw_Header <EOL> def set_Raw_Header ( self , Raw_Header ) : self . Raw_Header = Raw_Header <EOL> def validate_StringObjectPropertyType ( self , value ) : <EOL> pass <EOL> def get_Parsed_Header ( self ) : return self . Parsed_Header <EOL> def set_Parsed_Header ( self , Parsed_Header ) : self . Parsed_Header = Parsed_Header <EOL> def hasContent_ ( self ) : <EOL> if ( <EOL> self . Raw_Header is not None or <EOL> self . Parsed_Header is not None <EOL> ) : <EOL> return True <EOL> else : <EOL> return False <EOL> def export ( self , lwrite , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , namespacedef_ = '<STR_LIT>' , pretty_print = True ) : <EOL> if pretty_print : <EOL> eol_ = '<STR_LIT:\n>' <EOL> else : <EOL> eol_ = '<STR_LIT>' <EOL> showIndent ( lwrite , level , pretty_print ) <EOL> lwrite ( '<STR_LIT>' % ( namespace_ , name_ , namespacedef_ and '<STR_LIT:U+0020>' + namespacedef_ or '<STR_LIT>' , ) ) <EOL> already_processed = set ( ) <EOL> self . exportAttributes ( lwrite , level , already_processed , namespace_ , name_ = '<STR_LIT>' ) <EOL> if self . hasContent_ ( ) : <EOL> lwrite ( '<STR_LIT>' % ( eol_ , ) ) <EOL> self . exportChildren ( lwrite , level + <NUM_LIT:1> , namespace_ , name_ , pretty_print = pretty_print ) <EOL> showIndent ( lwrite , level , pretty_print ) <EOL> lwrite ( '<STR_LIT>' % ( namespace_ , name_ , eol_ ) ) <EOL> else : <EOL> lwrite ( '<STR_LIT>' % ( eol_ , ) ) <EOL> def exportAttributes ( self , lwrite , level , already_processed , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' ) : <EOL> pass <EOL> def exportChildren ( self , lwrite , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , fromsubclass_ = False , pretty_print = True ) : <EOL> if pretty_print : <EOL> eol_ = '<STR_LIT:\n>' <EOL> else : <EOL> eol_ = '<STR_LIT>' <EOL> if self . Raw_Header is not None : <EOL> if self . Raw_Header . get_valueOf_ ( ) is not None : <EOL> value = self . Raw_Header . get_valueOf_ ( ) <EOL> if not value . startswith ( '<STR_LIT>' ) : <EOL> value = '<STR_LIT>' + value + '<STR_LIT>' <EOL> self . Raw_Header . set_valueOf_ ( value ) <EOL> self . Raw_Header . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Parsed_Header is not None : <EOL> self . Parsed_Header . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> def build ( self , node ) : <EOL> already_processed = set ( ) <EOL> self . buildAttributes ( node , node . attrib , already_processed ) <EOL> for child in node : <EOL> nodeName_ = Tag_pattern_ . match ( child . tag ) . groups ( ) [ - <NUM_LIT:1> ] <EOL> self . buildChildren ( child , node , nodeName_ ) <EOL> def buildAttributes ( self , node , attrs , already_processed ) : <EOL> pass <EOL> def buildChildren ( self , child_ , node , nodeName_ , fromsubclass_ = False ) : <EOL> if nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Raw_Header ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = HTTPRequestHeaderFieldsType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Parsed_Header ( obj_ ) <EOL> class HTTPRequestHeaderFieldsType ( GeneratedsSuper ) : <EOL> """<STR_LIT>""" <EOL> subclass = None <EOL> superclass = None <EOL> def __init__ ( self , Accept = None , Accept_Charset = None , Accept_Language = None , Accept_Datetime = None , Accept_Encoding = None , Authorization = None , Cache_Control = None , Connection = None , Cookie = None , Content_Length = None , Content_MD5 = None , Content_Type = None , Date = None , Expect = None , From = None , Host = None , If_Match = None , If_Modified_Since = None , If_None_Match = None , If_Range = None , If_Unmodified_Since = None , Max_Forwards = None , Pragma = None , Proxy_Authorization = None , Range = None , Referer = None , TE = None , User_Agent = None , Via = None , Warning = None , DNT = None , X_Requested_With = None , X_Forwarded_For = None , X_Forwarded_Proto = None , X_ATT_DeviceId = None , X_Wap_Profile = None ) : <EOL> self . Accept = Accept <EOL> self . Accept_Charset = Accept_Charset <EOL> self . Accept_Language = Accept_Language <EOL> self . Accept_Datetime = Accept_Datetime <EOL> self . Accept_Encoding = Accept_Encoding <EOL> self . Authorization = Authorization <EOL> self . Cache_Control = Cache_Control <EOL> self . Connection = Connection <EOL> self . Cookie = Cookie <EOL> self . Content_Length = Content_Length <EOL> self . Content_MD5 = Content_MD5 <EOL> self . Content_Type = Content_Type <EOL> self . Date = Date <EOL> self . Expect = Expect <EOL> self . From = From <EOL> self . Host = Host <EOL> self . If_Match = If_Match <EOL> self . If_Modified_Since = If_Modified_Since <EOL> self . If_None_Match = If_None_Match <EOL> self . If_Range = If_Range <EOL> self . If_Unmodified_Since = If_Unmodified_Since <EOL> self . Max_Forwards = Max_Forwards <EOL> self . Pragma = Pragma <EOL> self . Proxy_Authorization = Proxy_Authorization <EOL> self . Range = Range <EOL> self . Referer = Referer <EOL> self . TE = TE <EOL> self . User_Agent = User_Agent <EOL> self . Via = Via <EOL> self . Warning = Warning <EOL> self . DNT = DNT <EOL> self . X_Requested_With = X_Requested_With <EOL> self . X_Forwarded_For = X_Forwarded_For <EOL> self . X_Forwarded_Proto = X_Forwarded_Proto <EOL> self . X_ATT_DeviceId = X_ATT_DeviceId <EOL> self . X_Wap_Profile = X_Wap_Profile <EOL> def factory ( * args_ , ** kwargs_ ) : <EOL> if HTTPRequestHeaderFieldsType . subclass : <EOL> return HTTPRequestHeaderFieldsType . subclass ( * args_ , ** kwargs_ ) <EOL> else : <EOL> return HTTPRequestHeaderFieldsType ( * args_ , ** kwargs_ ) <EOL> factory = staticmethod ( factory ) <EOL> def get_Accept ( self ) : return self . Accept <EOL> def set_Accept ( self , Accept ) : self . Accept = Accept <EOL> def validate_StringObjectPropertyType ( self , value ) : <EOL> pass <EOL> def get_Accept_Charset ( self ) : return self . Accept_Charset <EOL> def set_Accept_Charset ( self , Accept_Charset ) : self . Accept_Charset = Accept_Charset <EOL> def get_Accept_Language ( self ) : return self . Accept_Language <EOL> def set_Accept_Language ( self , Accept_Language ) : self . Accept_Language = Accept_Language <EOL> def get_Accept_Datetime ( self ) : return self . Accept_Datetime <EOL> def set_Accept_Datetime ( self , Accept_Datetime ) : self . Accept_Datetime = Accept_Datetime <EOL> def get_Accept_Encoding ( self ) : return self . Accept_Encoding <EOL> def set_Accept_Encoding ( self , Accept_Encoding ) : self . Accept_Encoding = Accept_Encoding <EOL> def get_Authorization ( self ) : return self . Authorization <EOL> def set_Authorization ( self , Authorization ) : self . Authorization = Authorization <EOL> def get_Cache_Control ( self ) : return self . Cache_Control <EOL> def set_Cache_Control ( self , Cache_Control ) : self . Cache_Control = Cache_Control <EOL> def get_Connection ( self ) : return self . Connection <EOL> def set_Connection ( self , Connection ) : self . Connection = Connection <EOL> def get_Cookie ( self ) : return self . Cookie <EOL> def set_Cookie ( self , Cookie ) : self . Cookie = Cookie <EOL> def get_Content_Length ( self ) : return self . Content_Length <EOL> def set_Content_Length ( self , Content_Length ) : self . Content_Length = Content_Length <EOL> def validate_IntegerObjectPropertyType ( self , value ) : <EOL> pass <EOL> def get_Content_MD5 ( self ) : return self . Content_MD5 <EOL> def set_Content_MD5 ( self , Content_MD5 ) : self . Content_MD5 = Content_MD5 <EOL> def get_Content_Type ( self ) : return self . Content_Type <EOL> def set_Content_Type ( self , Content_Type ) : self . Content_Type = Content_Type <EOL> def get_Date ( self ) : return self . Date <EOL> def set_Date ( self , Date ) : self . Date = Date <EOL> def validate_DateTimeObjectPropertyType ( self , value ) : <EOL> pass <EOL> def get_Expect ( self ) : return self . Expect <EOL> def set_Expect ( self , Expect ) : self . Expect = Expect <EOL> def get_From ( self ) : return self . From <EOL> def set_From ( self , From ) : self . From = From <EOL> def get_Host ( self ) : return self . Host <EOL> def set_Host ( self , Host ) : self . Host = Host <EOL> def get_If_Match ( self ) : return self . If_Match <EOL> def set_If_Match ( self , If_Match ) : self . If_Match = If_Match <EOL> def get_If_Modified_Since ( self ) : return self . If_Modified_Since <EOL> def set_If_Modified_Since ( self , If_Modified_Since ) : self . If_Modified_Since = If_Modified_Since <EOL> def get_If_None_Match ( self ) : return self . If_None_Match <EOL> def set_If_None_Match ( self , If_None_Match ) : self . If_None_Match = If_None_Match <EOL> def get_If_Range ( self ) : return self . If_Range <EOL> def set_If_Range ( self , If_Range ) : self . If_Range = If_Range <EOL> def get_If_Unmodified_Since ( self ) : return self . If_Unmodified_Since <EOL> def set_If_Unmodified_Since ( self , If_Unmodified_Since ) : self . If_Unmodified_Since = If_Unmodified_Since <EOL> def get_Max_Forwards ( self ) : return self . Max_Forwards <EOL> def set_Max_Forwards ( self , Max_Forwards ) : self . Max_Forwards = Max_Forwards <EOL> def get_Pragma ( self ) : return self . Pragma <EOL> def set_Pragma ( self , Pragma ) : self . Pragma = Pragma <EOL> def get_Proxy_Authorization ( self ) : return self . Proxy_Authorization <EOL> def set_Proxy_Authorization ( self , Proxy_Authorization ) : self . Proxy_Authorization = Proxy_Authorization <EOL> def get_Range ( self ) : return self . Range <EOL> def set_Range ( self , Range ) : self . Range = Range <EOL> def get_Referer ( self ) : return self . Referer <EOL> def set_Referer ( self , Referer ) : self . Referer = Referer <EOL> def get_TE ( self ) : return self . TE <EOL> def set_TE ( self , TE ) : self . TE = TE <EOL> def get_User_Agent ( self ) : return self . User_Agent <EOL> def set_User_Agent ( self , User_Agent ) : self . User_Agent = User_Agent <EOL> def get_Via ( self ) : return self . Via <EOL> def set_Via ( self , Via ) : self . Via = Via <EOL> def get_Warning ( self ) : return self . Warning <EOL> def set_Warning ( self , Warning ) : self . Warning = Warning <EOL> def get_DNT ( self ) : return self . DNT <EOL> def set_DNT ( self , DNT ) : self . DNT = DNT <EOL> def get_X_Requested_With ( self ) : return self . X_Requested_With <EOL> def set_X_Requested_With ( self , X_Requested_With ) : self . X_Requested_With = X_Requested_With <EOL> def get_X_Forwarded_For ( self ) : return self . X_Forwarded_For <EOL> def set_X_Forwarded_For ( self , X_Forwarded_For ) : self . X_Forwarded_For = X_Forwarded_For <EOL> def get_X_Forwarded_Proto ( self ) : return self . X_Forwarded_Proto <EOL> def set_X_Forwarded_Proto ( self , X_Forwarded_Proto ) : self . X_Forwarded_Proto = X_Forwarded_Proto <EOL> def get_X_ATT_DeviceId ( self ) : return self . X_ATT_DeviceId <EOL> def set_X_ATT_DeviceId ( self , X_ATT_DeviceId ) : self . X_ATT_DeviceId = X_ATT_DeviceId <EOL> def get_X_Wap_Profile ( self ) : return self . X_Wap_Profile <EOL> def set_X_Wap_Profile ( self , X_Wap_Profile ) : self . X_Wap_Profile = X_Wap_Profile <EOL> def hasContent_ ( self ) : <EOL> if ( <EOL> self . Accept is not None or <EOL> self . Accept_Charset is not None or <EOL> self . Accept_Language is not None or <EOL> self . Accept_Datetime is not None or <EOL> self . Accept_Encoding is not None or <EOL> self . Authorization is not None or <EOL> self . Cache_Control is not None or <EOL> self . Connection is not None or <EOL> self . Cookie is not None or <EOL> self . Content_Length is not None or <EOL> self . Content_MD5 is not None or <EOL> self . Content_Type is not None or <EOL> self . Date is not None or <EOL> self . Expect is not None or <EOL> self . From is not None or <EOL> self . Host is not None or <EOL> self . If_Match is not None or <EOL> self . If_Modified_Since is not None or <EOL> self . If_None_Match is not None or <EOL> self . If_Range is not None or <EOL> self . If_Unmodified_Since is not None or <EOL> self . Max_Forwards is not None or <EOL> self . Pragma is not None or <EOL> self . Proxy_Authorization is not None or <EOL> self . Range is not None or <EOL> self . Referer is not None or <EOL> self . TE is not None or <EOL> self . User_Agent is not None or <EOL> self . Via is not None or <EOL> self . Warning is not None or <EOL> self . DNT is not None or <EOL> self . X_Requested_With is not None or <EOL> self . X_Forwarded_For is not None or <EOL> self . X_Forwarded_Proto is not None or <EOL> self . X_ATT_DeviceId is not None or <EOL> self . X_Wap_Profile is not None <EOL> ) : <EOL> return True <EOL> else : <EOL> return False <EOL> def export ( self , lwrite , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , namespacedef_ = '<STR_LIT>' , pretty_print = True ) : <EOL> if pretty_print : <EOL> eol_ = '<STR_LIT:\n>' <EOL> else : <EOL> eol_ = '<STR_LIT>' <EOL> showIndent ( lwrite , level , pretty_print ) <EOL> lwrite ( '<STR_LIT>' % ( namespace_ , name_ , namespacedef_ and '<STR_LIT:U+0020>' + namespacedef_ or '<STR_LIT>' , ) ) <EOL> already_processed = set ( ) <EOL> self . exportAttributes ( lwrite , level , already_processed , namespace_ , name_ = '<STR_LIT>' ) <EOL> if self . hasContent_ ( ) : <EOL> lwrite ( '<STR_LIT>' % ( eol_ , ) ) <EOL> self . exportChildren ( lwrite , level + <NUM_LIT:1> , namespace_ , name_ , pretty_print = pretty_print ) <EOL> showIndent ( lwrite , level , pretty_print ) <EOL> lwrite ( '<STR_LIT>' % ( namespace_ , name_ , eol_ ) ) <EOL> else : <EOL> lwrite ( '<STR_LIT>' % ( eol_ , ) ) <EOL> def exportAttributes ( self , lwrite , level , already_processed , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' ) : <EOL> pass <EOL> def exportChildren ( self , lwrite , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , fromsubclass_ = False , pretty_print = True ) : <EOL> if pretty_print : <EOL> eol_ = '<STR_LIT:\n>' <EOL> else : <EOL> eol_ = '<STR_LIT>' <EOL> if self . Accept is not None : <EOL> self . Accept . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Accept_Charset is not None : <EOL> self . Accept_Charset . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Accept_Language is not None : <EOL> self . Accept_Language . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Accept_Datetime is not None : <EOL> self . Accept_Datetime . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Accept_Encoding is not None : <EOL> self . Accept_Encoding . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Authorization is not None : <EOL> self . Authorization . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Cache_Control is not None : <EOL> self . Cache_Control . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Connection is not None : <EOL> self . Connection . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Cookie is not None : <EOL> self . Cookie . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Content_Length is not None : <EOL> self . Content_Length . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Content_MD5 is not None : <EOL> self . Content_MD5 . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Content_Type is not None : <EOL> self . Content_Type . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Date is not None : <EOL> self . Date . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Expect is not None : <EOL> self . Expect . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . From is not None : <EOL> self . From . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Host is not None : <EOL> self . Host . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . If_Match is not None : <EOL> self . If_Match . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . If_Modified_Since is not None : <EOL> self . If_Modified_Since . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . If_None_Match is not None : <EOL> self . If_None_Match . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . If_Range is not None : <EOL> self . If_Range . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . If_Unmodified_Since is not None : <EOL> self . If_Unmodified_Since . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Max_Forwards is not None : <EOL> self . Max_Forwards . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Pragma is not None : <EOL> self . Pragma . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Proxy_Authorization is not None : <EOL> self . Proxy_Authorization . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Range is not None : <EOL> self . Range . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Referer is not None : <EOL> self . Referer . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . TE is not None : <EOL> self . TE . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . User_Agent is not None : <EOL> self . User_Agent . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Via is not None : <EOL> self . Via . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Warning is not None : <EOL> self . Warning . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . DNT is not None : <EOL> self . DNT . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . X_Requested_With is not None : <EOL> self . X_Requested_With . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . X_Forwarded_For is not None : <EOL> self . X_Forwarded_For . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . X_Forwarded_Proto is not None : <EOL> self . X_Forwarded_Proto . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . X_ATT_DeviceId is not None : <EOL> self . X_ATT_DeviceId . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . X_Wap_Profile is not None : <EOL> self . X_Wap_Profile . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> def build ( self , node ) : <EOL> already_processed = set ( ) <EOL> self . buildAttributes ( node , node . attrib , already_processed ) <EOL> for child in node : <EOL> nodeName_ = Tag_pattern_ . match ( child . tag ) . groups ( ) [ - <NUM_LIT:1> ] <EOL> self . buildChildren ( child , node , nodeName_ ) <EOL> def buildAttributes ( self , node , attrs , already_processed ) : <EOL> pass <EOL> def buildChildren ( self , child_ , node , nodeName_ , fromsubclass_ = False ) : <EOL> if nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Accept ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Accept_Charset ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Accept_Language ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Accept_Datetime ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Accept_Encoding ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Authorization ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Cache_Control ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Connection ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Cookie ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . IntegerObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Content_Length ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Content_MD5 ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Content_Type ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . DateTimeObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Date ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Expect ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = address_object . AddressObjectType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_From ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = HostFieldType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Host ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_If_Match ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . DateTimeObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_If_Modified_Since ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_If_None_Match ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_If_Range ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . DateTimeObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_If_Unmodified_Since ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . IntegerObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Max_Forwards ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Pragma ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Proxy_Authorization ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Range ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = uri_object . URIObjectType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Referer ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_TE ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_User_Agent ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Via ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Warning ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_DNT ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_X_Requested_With ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_X_Forwarded_For ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_X_Forwarded_Proto ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_X_ATT_DeviceId ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = uri_object . URIObjectType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_X_Wap_Profile ( obj_ ) <EOL> class HTTPResponseHeaderType ( GeneratedsSuper ) : <EOL> """<STR_LIT>""" <EOL> subclass = None <EOL> superclass = None <EOL> def __init__ ( self , Raw_Header = None , Parsed_Header = None ) : <EOL> self . Raw_Header = Raw_Header <EOL> self . Parsed_Header = Parsed_Header <EOL> def factory ( * args_ , ** kwargs_ ) : <EOL> if HTTPResponseHeaderType . subclass : <EOL> return HTTPResponseHeaderType . subclass ( * args_ , ** kwargs_ ) <EOL> else : <EOL> return HTTPResponseHeaderType ( * args_ , ** kwargs_ ) <EOL> factory = staticmethod ( factory ) <EOL> def get_Raw_Header ( self ) : return self . Raw_Header <EOL> def set_Raw_Header ( self , Raw_Header ) : self . Raw_Header = Raw_Header <EOL> def validate_StringObjectPropertyType ( self , value ) : <EOL> pass <EOL> def get_Parsed_Header ( self ) : return self . Parsed_Header <EOL> def set_Parsed_Header ( self , Parsed_Header ) : self . Parsed_Header = Parsed_Header <EOL> def hasContent_ ( self ) : <EOL> if ( <EOL> self . Raw_Header is not None or <EOL> self . Parsed_Header is not None <EOL> ) : <EOL> return True <EOL> else : <EOL> return False <EOL> def export ( self , lwrite , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , namespacedef_ = '<STR_LIT>' , pretty_print = True ) : <EOL> if pretty_print : <EOL> eol_ = '<STR_LIT:\n>' <EOL> else : <EOL> eol_ = '<STR_LIT>' <EOL> showIndent ( lwrite , level , pretty_print ) <EOL> lwrite ( '<STR_LIT>' % ( namespace_ , name_ , namespacedef_ and '<STR_LIT:U+0020>' + namespacedef_ or '<STR_LIT>' , ) ) <EOL> already_processed = set ( ) <EOL> self . exportAttributes ( lwrite , level , already_processed , namespace_ , name_ = '<STR_LIT>' ) <EOL> if self . hasContent_ ( ) : <EOL> lwrite ( '<STR_LIT>' % ( eol_ , ) ) <EOL> self . exportChildren ( lwrite , level + <NUM_LIT:1> , namespace_ , name_ , pretty_print = pretty_print ) <EOL> showIndent ( lwrite , level , pretty_print ) <EOL> lwrite ( '<STR_LIT>' % ( namespace_ , name_ , eol_ ) ) <EOL> else : <EOL> lwrite ( '<STR_LIT>' % ( eol_ , ) ) <EOL> def exportAttributes ( self , lwrite , level , already_processed , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' ) : <EOL> pass <EOL> def exportChildren ( self , lwrite , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , fromsubclass_ = False , pretty_print = True ) : <EOL> if pretty_print : <EOL> eol_ = '<STR_LIT:\n>' <EOL> else : <EOL> eol_ = '<STR_LIT>' <EOL> if self . Raw_Header is not None : <EOL> if self . Raw_Header . get_valueOf_ ( ) is not None : <EOL> value = self . Raw_Header . get_valueOf_ ( ) <EOL> if not value . startswith ( '<STR_LIT>' ) : <EOL> value = '<STR_LIT>' + value + '<STR_LIT>' <EOL> self . Raw_Header . set_valueOf_ ( value ) <EOL> self . Raw_Header . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Parsed_Header is not None : <EOL> self . Parsed_Header . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> def build ( self , node ) : <EOL> already_processed = set ( ) <EOL> self . buildAttributes ( node , node . attrib , already_processed ) <EOL> for child in node : <EOL> nodeName_ = Tag_pattern_ . match ( child . tag ) . groups ( ) [ - <NUM_LIT:1> ] <EOL> self . buildChildren ( child , node , nodeName_ ) <EOL> def buildAttributes ( self , node , attrs , already_processed ) : <EOL> pass <EOL> def buildChildren ( self , child_ , node , nodeName_ , fromsubclass_ = False ) : <EOL> if nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Raw_Header ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = HTTPResponseHeaderFieldsType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Parsed_Header ( obj_ ) <EOL> class HTTPResponseHeaderFieldsType ( GeneratedsSuper ) : <EOL> """<STR_LIT>""" <EOL> subclass = None <EOL> superclass = None <EOL> def __init__ ( self , Access_Control_Allow_Origin = None , Accept_Ranges = None , Age = None , Cache_Control = None , Connection = None , Content_Encoding = None , Content_Language = None , Content_Length = None , Content_Location = None , Content_MD5 = None , Content_Disposition = None , Content_Range = None , Content_Type = None , Date = None , ETag = None , Expires = None , Last_Modified = None , Link = None , Location = None , P3P = None , Pragma = None , Proxy_Authenticate = None , Refresh = None , Retry_After = None , Server = None , Set_Cookie = None , Strict_Transport_Security = None , Trailer = None , Transfer_Encoding = None , Vary = None , Via = None , Warning = None , WWW_Authenticate = None , X_Frame_Options = None , X_XSS_Protection = None , X_Content_Type_Options = None , X_Powered_By = None , X_UA_Compatible = None ) : <EOL> self . Access_Control_Allow_Origin = Access_Control_Allow_Origin <EOL> self . Accept_Ranges = Accept_Ranges <EOL> self . Age = Age <EOL> self . Cache_Control = Cache_Control <EOL> self . Connection = Connection <EOL> self . Content_Encoding = Content_Encoding <EOL> self . Content_Language = Content_Language <EOL> self . Content_Length = Content_Length <EOL> self . Content_Location = Content_Location <EOL> self . Content_MD5 = Content_MD5 <EOL> self . Content_Disposition = Content_Disposition <EOL> self . Content_Range = Content_Range <EOL> self . Content_Type = Content_Type <EOL> self . Date = Date <EOL> self . ETag = ETag <EOL> self . Expires = Expires <EOL> self . Last_Modified = Last_Modified <EOL> self . Link = Link <EOL> self . Location = Location <EOL> self . P3P = P3P <EOL> self . Pragma = Pragma <EOL> self . Proxy_Authenticate = Proxy_Authenticate <EOL> self . Refresh = Refresh <EOL> self . Retry_After = Retry_After <EOL> self . Server = Server <EOL> self . Set_Cookie = Set_Cookie <EOL> self . Strict_Transport_Security = Strict_Transport_Security <EOL> self . Trailer = Trailer <EOL> self . Transfer_Encoding = Transfer_Encoding <EOL> self . Vary = Vary <EOL> self . Via = Via <EOL> self . Warning = Warning <EOL> self . WWW_Authenticate = WWW_Authenticate <EOL> self . X_Frame_Options = X_Frame_Options <EOL> self . X_XSS_Protection = X_XSS_Protection <EOL> self . X_Content_Type_Options = X_Content_Type_Options <EOL> self . X_Powered_By = X_Powered_By <EOL> self . X_UA_Compatible = X_UA_Compatible <EOL> def factory ( * args_ , ** kwargs_ ) : <EOL> if HTTPResponseHeaderFieldsType . subclass : <EOL> return HTTPResponseHeaderFieldsType . subclass ( * args_ , ** kwargs_ ) <EOL> else : <EOL> return HTTPResponseHeaderFieldsType ( * args_ , ** kwargs_ ) <EOL> factory = staticmethod ( factory ) <EOL> def get_Access_Control_Allow_Origin ( self ) : return self . Access_Control_Allow_Origin <EOL> def set_Access_Control_Allow_Origin ( self , Access_Control_Allow_Origin ) : self . Access_Control_Allow_Origin = Access_Control_Allow_Origin <EOL> def validate_StringObjectPropertyType ( self , value ) : <EOL> pass <EOL> def get_Accept_Ranges ( self ) : return self . Accept_Ranges <EOL> def set_Accept_Ranges ( self , Accept_Ranges ) : self . Accept_Ranges = Accept_Ranges <EOL> def get_Age ( self ) : return self . Age <EOL> def set_Age ( self , Age ) : self . Age = Age <EOL> def validate_IntegerObjectPropertyType ( self , value ) : <EOL> pass <EOL> def get_Cache_Control ( self ) : return self . Cache_Control <EOL> def set_Cache_Control ( self , Cache_Control ) : self . Cache_Control = Cache_Control <EOL> def get_Connection ( self ) : return self . Connection <EOL> def set_Connection ( self , Connection ) : self . Connection = Connection <EOL> def get_Content_Encoding ( self ) : return self . Content_Encoding <EOL> def set_Content_Encoding ( self , Content_Encoding ) : self . Content_Encoding = Content_Encoding <EOL> def get_Content_Language ( self ) : return self . Content_Language <EOL> def set_Content_Language ( self , Content_Language ) : self . Content_Language = Content_Language <EOL> def get_Content_Length ( self ) : return self . Content_Length <EOL> def set_Content_Length ( self , Content_Length ) : self . Content_Length = Content_Length <EOL> def get_Content_Location ( self ) : return self . Content_Location <EOL> def set_Content_Location ( self , Content_Location ) : self . Content_Location = Content_Location <EOL> def get_Content_MD5 ( self ) : return self . Content_MD5 <EOL> def set_Content_MD5 ( self , Content_MD5 ) : self . Content_MD5 = Content_MD5 <EOL> def get_Content_Disposition ( self ) : return self . Content_Disposition <EOL> def set_Content_Disposition ( self , Content_Disposition ) : self . Content_Disposition = Content_Disposition <EOL> def get_Content_Range ( self ) : return self . Content_Range <EOL> def set_Content_Range ( self , Content_Range ) : self . Content_Range = Content_Range <EOL> def get_Content_Type ( self ) : return self . Content_Type <EOL> def set_Content_Type ( self , Content_Type ) : self . Content_Type = Content_Type <EOL> def get_Date ( self ) : return self . Date <EOL> def set_Date ( self , Date ) : self . Date = Date <EOL> def validate_DateTimeObjectPropertyType ( self , value ) : <EOL> pass <EOL> def get_ETag ( self ) : return self . ETag <EOL> def set_ETag ( self , ETag ) : self . ETag = ETag <EOL> def get_Expires ( self ) : return self . Expires <EOL> def set_Expires ( self , Expires ) : self . Expires = Expires <EOL> def get_Last_Modified ( self ) : return self . Last_Modified <EOL> def set_Last_Modified ( self , Last_Modified ) : self . Last_Modified = Last_Modified <EOL> def get_Link ( self ) : return self . Link <EOL> def set_Link ( self , Link ) : self . Link = Link <EOL> def get_Location ( self ) : return self . Location <EOL> def set_Location ( self , Location ) : self . Location = Location <EOL> def get_P3P ( self ) : return self . P3P <EOL> def set_P3P ( self , P3P ) : self . P3P = P3P <EOL> def get_Pragma ( self ) : return self . Pragma <EOL> def set_Pragma ( self , Pragma ) : self . Pragma = Pragma <EOL> def get_Proxy_Authenticate ( self ) : return self . Proxy_Authenticate <EOL> def set_Proxy_Authenticate ( self , Proxy_Authenticate ) : self . Proxy_Authenticate = Proxy_Authenticate <EOL> def get_Refresh ( self ) : return self . Refresh <EOL> def set_Refresh ( self , Refresh ) : self . Refresh = Refresh <EOL> def get_Retry_After ( self ) : return self . Retry_After <EOL> def set_Retry_After ( self , Retry_After ) : self . Retry_After = Retry_After <EOL> def get_Server ( self ) : return self . Server <EOL> def set_Server ( self , Server ) : self . Server = Server <EOL> def get_Set_Cookie ( self ) : return self . Set_Cookie <EOL> def set_Set_Cookie ( self , Set_Cookie ) : self . Set_Cookie = Set_Cookie <EOL> def get_Strict_Transport_Security ( self ) : return self . Strict_Transport_Security <EOL> def set_Strict_Transport_Security ( self , Strict_Transport_Security ) : self . Strict_Transport_Security = Strict_Transport_Security <EOL> def get_Trailer ( self ) : return self . Trailer <EOL> def set_Trailer ( self , Trailer ) : self . Trailer = Trailer <EOL> def get_Transfer_Encoding ( self ) : return self . Transfer_Encoding <EOL> def set_Transfer_Encoding ( self , Transfer_Encoding ) : self . Transfer_Encoding = Transfer_Encoding <EOL> def get_Vary ( self ) : return self . Vary <EOL> def set_Vary ( self , Vary ) : self . Vary = Vary <EOL> def get_Via ( self ) : return self . Via <EOL> def set_Via ( self , Via ) : self . Via = Via <EOL> def get_Warning ( self ) : return self . Warning <EOL> def set_Warning ( self , Warning ) : self . Warning = Warning <EOL> def get_WWW_Authenticate ( self ) : return self . WWW_Authenticate <EOL> def set_WWW_Authenticate ( self , WWW_Authenticate ) : self . WWW_Authenticate = WWW_Authenticate <EOL> def get_X_Frame_Options ( self ) : return self . X_Frame_Options <EOL> def set_X_Frame_Options ( self , X_Frame_Options ) : self . X_Frame_Options = X_Frame_Options <EOL> def get_X_XSS_Protection ( self ) : return self . X_XSS_Protection <EOL> def set_X_XSS_Protection ( self , X_XSS_Protection ) : self . X_XSS_Protection = X_XSS_Protection <EOL> def get_X_Content_Type_Options ( self ) : return self . X_Content_Type_Options <EOL> def set_X_Content_Type_Options ( self , X_Content_Type_Options ) : self . X_Content_Type_Options = X_Content_Type_Options <EOL> def get_X_Powered_By ( self ) : return self . X_Powered_By <EOL> def set_X_Powered_By ( self , X_Powered_By ) : self . X_Powered_By = X_Powered_By <EOL> def get_X_UA_Compatible ( self ) : return self . X_UA_Compatible <EOL> def set_X_UA_Compatible ( self , X_UA_Compatible ) : self . X_UA_Compatible = X_UA_Compatible <EOL> def hasContent_ ( self ) : <EOL> if ( <EOL> self . Access_Control_Allow_Origin is not None or <EOL> self . Accept_Ranges is not None or <EOL> self . Age is not None or <EOL> self . Cache_Control is not None or <EOL> self . Connection is not None or <EOL> self . Content_Encoding is not None or <EOL> self . Content_Language is not None or <EOL> self . Content_Length is not None or <EOL> self . Content_Location is not None or <EOL> self . Content_MD5 is not None or <EOL> self . Content_Disposition is not None or <EOL> self . Content_Range is not None or <EOL> self . Content_Type is not None or <EOL> self . Date is not None or <EOL> self . ETag is not None or <EOL> self . Expires is not None or <EOL> self . Last_Modified is not None or <EOL> self . Link is not None or <EOL> self . Location is not None or <EOL> self . P3P is not None or <EOL> self . Pragma is not None or <EOL> self . Proxy_Authenticate is not None or <EOL> self . Refresh is not None or <EOL> self . Retry_After is not None or <EOL> self . Server is not None or <EOL> self . Set_Cookie is not None or <EOL> self . Strict_Transport_Security is not None or <EOL> self . Trailer is not None or <EOL> self . Transfer_Encoding is not None or <EOL> self . Vary is not None or <EOL> self . Via is not None or <EOL> self . Warning is not None or <EOL> self . WWW_Authenticate is not None or <EOL> self . X_Frame_Options is not None or <EOL> self . X_XSS_Protection is not None or <EOL> self . X_Content_Type_Options is not None or <EOL> self . X_Powered_By is not None or <EOL> self . X_UA_Compatible is not None <EOL> ) : <EOL> return True <EOL> else : <EOL> return False <EOL> def export ( self , lwrite , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , namespacedef_ = '<STR_LIT>' , pretty_print = True ) : <EOL> if pretty_print : <EOL> eol_ = '<STR_LIT:\n>' <EOL> else : <EOL> eol_ = '<STR_LIT>' <EOL> showIndent ( lwrite , level , pretty_print ) <EOL> lwrite ( '<STR_LIT>' % ( namespace_ , name_ , namespacedef_ and '<STR_LIT:U+0020>' + namespacedef_ or '<STR_LIT>' , ) ) <EOL> already_processed = set ( ) <EOL> self . exportAttributes ( lwrite , level , already_processed , namespace_ , name_ = '<STR_LIT>' ) <EOL> if self . hasContent_ ( ) : <EOL> lwrite ( '<STR_LIT>' % ( eol_ , ) ) <EOL> self . exportChildren ( lwrite , level + <NUM_LIT:1> , namespace_ , name_ , pretty_print = pretty_print ) <EOL> showIndent ( lwrite , level , pretty_print ) <EOL> lwrite ( '<STR_LIT>' % ( namespace_ , name_ , eol_ ) ) <EOL> else : <EOL> lwrite ( '<STR_LIT>' % ( eol_ , ) ) <EOL> def exportAttributes ( self , lwrite , level , already_processed , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' ) : <EOL> pass <EOL> def exportChildren ( self , lwrite , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , fromsubclass_ = False , pretty_print = True ) : <EOL> if pretty_print : <EOL> eol_ = '<STR_LIT:\n>' <EOL> else : <EOL> eol_ = '<STR_LIT>' <EOL> if self . Access_Control_Allow_Origin is not None : <EOL> self . Access_Control_Allow_Origin . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Accept_Ranges is not None : <EOL> self . Accept_Ranges . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Age is not None : <EOL> self . Age . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Cache_Control is not None : <EOL> self . Cache_Control . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Connection is not None : <EOL> self . Connection . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Content_Encoding is not None : <EOL> self . Content_Encoding . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Content_Language is not None : <EOL> self . Content_Language . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Content_Length is not None : <EOL> self . Content_Length . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Content_Location is not None : <EOL> self . Content_Location . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Content_MD5 is not None : <EOL> self . Content_MD5 . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Content_Disposition is not None : <EOL> self . Content_Disposition . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Content_Range is not None : <EOL> self . Content_Range . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Content_Type is not None : <EOL> self . Content_Type . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Date is not None : <EOL> self . Date . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . ETag is not None : <EOL> self . ETag . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Expires is not None : <EOL> self . Expires . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Last_Modified is not None : <EOL> self . Last_Modified . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Link is not None : <EOL> self . Link . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Location is not None : <EOL> self . Location . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . P3P is not None : <EOL> self . P3P . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Pragma is not None : <EOL> self . Pragma . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Proxy_Authenticate is not None : <EOL> self . Proxy_Authenticate . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Refresh is not None : <EOL> self . Refresh . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Retry_After is not None : <EOL> self . Retry_After . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Server is not None : <EOL> self . Server . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Set_Cookie is not None : <EOL> self . Set_Cookie . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Strict_Transport_Security is not None : <EOL> self . Strict_Transport_Security . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Trailer is not None : <EOL> self . Trailer . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Transfer_Encoding is not None : <EOL> self . Transfer_Encoding . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Vary is not None : <EOL> self . Vary . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Via is not None : <EOL> self . Via . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Warning is not None : <EOL> self . Warning . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . WWW_Authenticate is not None : <EOL> self . WWW_Authenticate . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . X_Frame_Options is not None : <EOL> self . X_Frame_Options . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . X_XSS_Protection is not None : <EOL> self . X_XSS_Protection . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . X_Content_Type_Options is not None : <EOL> self . X_Content_Type_Options . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . X_Powered_By is not None : <EOL> self . X_Powered_By . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . X_UA_Compatible is not None : <EOL> self . X_UA_Compatible . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> def build ( self , node ) : <EOL> already_processed = set ( ) <EOL> self . buildAttributes ( node , node . attrib , already_processed ) <EOL> for child in node : <EOL> nodeName_ = Tag_pattern_ . match ( child . tag ) . groups ( ) [ - <NUM_LIT:1> ] <EOL> self . buildChildren ( child , node , nodeName_ ) <EOL> def buildAttributes ( self , node , attrs , already_processed ) : <EOL> pass <EOL> def buildChildren ( self , child_ , node , nodeName_ , fromsubclass_ = False ) : <EOL> if nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Access_Control_Allow_Origin ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Accept_Ranges ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . IntegerObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Age ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Cache_Control ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Connection ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Content_Encoding ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Content_Language ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . IntegerObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Content_Length ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Content_Location ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Content_MD5 ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Content_Disposition ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Content_Range ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Content_Type ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . DateTimeObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Date ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_ETag ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . DateTimeObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Expires ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . DateTimeObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Last_Modified ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Link ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = uri_object . URIObjectType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Location ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_P3P ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Pragma ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Proxy_Authenticate ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Refresh ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . IntegerObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Retry_After ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Server ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Set_Cookie ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Strict_Transport_Security ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Trailer ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Transfer_Encoding ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Vary ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Via ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Warning ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_WWW_Authenticate ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_X_Frame_Options ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_X_XSS_Protection ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_X_Content_Type_Options ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_X_Powered_By ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_X_UA_Compatible ( obj_ ) <EOL> class HTTPMessageType ( GeneratedsSuper ) : <EOL> """<STR_LIT>""" <EOL> subclass = None <EOL> superclass = None <EOL> def __init__ ( self , Length = None , Message_Body = None ) : <EOL> self . Length = Length <EOL> self . Message_Body = Message_Body <EOL> def factory ( * args_ , ** kwargs_ ) : <EOL> if HTTPMessageType . subclass : <EOL> return HTTPMessageType . subclass ( * args_ , ** kwargs_ ) <EOL> else : <EOL> return HTTPMessageType ( * args_ , ** kwargs_ ) <EOL> factory = staticmethod ( factory ) <EOL> def get_Length ( self ) : return self . Length <EOL> def set_Length ( self , Length ) : self . Length = Length <EOL> def validate_PositiveIntegerObjectPropertyType ( self , value ) : <EOL> pass <EOL> def get_Message_Body ( self ) : return self . Message_Body <EOL> def set_Message_Body ( self , Message_Body ) : self . Message_Body = Message_Body <EOL> def validate_StringObjectPropertyType ( self , value ) : <EOL> pass <EOL> def hasContent_ ( self ) : <EOL> if ( <EOL> self . Length is not None or <EOL> self . Message_Body is not None <EOL> ) : <EOL> return True <EOL> else : <EOL> return False <EOL> def export ( self , lwrite , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , namespacedef_ = '<STR_LIT>' , pretty_print = True ) : <EOL> if pretty_print : <EOL> eol_ = '<STR_LIT:\n>' <EOL> else : <EOL> eol_ = '<STR_LIT>' <EOL> showIndent ( lwrite , level , pretty_print ) <EOL> lwrite ( '<STR_LIT>' % ( namespace_ , name_ , namespacedef_ and '<STR_LIT:U+0020>' + namespacedef_ or '<STR_LIT>' , ) ) <EOL> already_processed = set ( ) <EOL> self . exportAttributes ( lwrite , level , already_processed , namespace_ , name_ = '<STR_LIT>' ) <EOL> if self . hasContent_ ( ) : <EOL> lwrite ( '<STR_LIT>' % ( eol_ , ) ) <EOL> self . exportChildren ( lwrite , level + <NUM_LIT:1> , namespace_ , name_ , pretty_print = pretty_print ) <EOL> showIndent ( lwrite , level , pretty_print ) <EOL> lwrite ( '<STR_LIT>' % ( namespace_ , name_ , eol_ ) ) <EOL> else : <EOL> lwrite ( '<STR_LIT>' % ( eol_ , ) ) <EOL> def exportAttributes ( self , lwrite , level , already_processed , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' ) : <EOL> pass <EOL> def exportChildren ( self , lwrite , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , fromsubclass_ = False , pretty_print = True ) : <EOL> if pretty_print : <EOL> eol_ = '<STR_LIT:\n>' <EOL> else : <EOL> eol_ = '<STR_LIT>' <EOL> if self . Length is not None : <EOL> self . Length . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Message_Body is not None : <EOL> self . Message_Body . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> def build ( self , node ) : <EOL> already_processed = set ( ) <EOL> self . buildAttributes ( node , node . attrib , already_processed ) <EOL> for child in node : <EOL> nodeName_ = Tag_pattern_ . match ( child . tag ) . groups ( ) [ - <NUM_LIT:1> ] <EOL> self . buildChildren ( child , node , nodeName_ ) <EOL> def buildAttributes ( self , node , attrs , already_processed ) : <EOL> pass <EOL> def buildChildren ( self , child_ , node , nodeName_ , fromsubclass_ = False ) : <EOL> if nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . PositiveIntegerObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Length ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Message_Body ( obj_ ) <EOL> class HTTPStatusLineType ( GeneratedsSuper ) : <EOL> """<STR_LIT>""" <EOL> subclass = None <EOL> superclass = None <EOL> def __init__ ( self , Version = None , Status_Code = None , Reason_Phrase = None ) : <EOL> self . Version = Version <EOL> self . Status_Code = Status_Code <EOL> self . Reason_Phrase = Reason_Phrase <EOL> def factory ( * args_ , ** kwargs_ ) : <EOL> if HTTPStatusLineType . subclass : <EOL> return HTTPStatusLineType . subclass ( * args_ , ** kwargs_ ) <EOL> else : <EOL> return HTTPStatusLineType ( * args_ , ** kwargs_ ) <EOL> factory = staticmethod ( factory ) <EOL> def get_Version ( self ) : return self . Version <EOL> def set_Version ( self , Version ) : self . Version = Version <EOL> def validate_StringObjectPropertyType ( self , value ) : <EOL> pass <EOL> def get_Status_Code ( self ) : return self . Status_Code <EOL> def set_Status_Code ( self , Status_Code ) : self . Status_Code = Status_Code <EOL> def validate_PositiveIntegerObjectPropertyType ( self , value ) : <EOL> pass <EOL> def get_Reason_Phrase ( self ) : return self . Reason_Phrase <EOL> def set_Reason_Phrase ( self , Reason_Phrase ) : self . Reason_Phrase = Reason_Phrase <EOL> def hasContent_ ( self ) : <EOL> if ( <EOL> self . Version is not None or <EOL> self . Status_Code is not None or <EOL> self . Reason_Phrase is not None <EOL> ) : <EOL> return True <EOL> else : <EOL> return False <EOL> def export ( self , lwrite , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , namespacedef_ = '<STR_LIT>' , pretty_print = True ) : <EOL> if pretty_print : <EOL> eol_ = '<STR_LIT:\n>' <EOL> else : <EOL> eol_ = '<STR_LIT>' <EOL> showIndent ( lwrite , level , pretty_print ) <EOL> lwrite ( '<STR_LIT>' % ( namespace_ , name_ , namespacedef_ and '<STR_LIT:U+0020>' + namespacedef_ or '<STR_LIT>' , ) ) <EOL> already_processed = set ( ) <EOL> self . exportAttributes ( lwrite , level , already_processed , namespace_ , name_ = '<STR_LIT>' ) <EOL> if self . hasContent_ ( ) : <EOL> lwrite ( '<STR_LIT>' % ( eol_ , ) ) <EOL> self . exportChildren ( lwrite , level + <NUM_LIT:1> , namespace_ , name_ , pretty_print = pretty_print ) <EOL> showIndent ( lwrite , level , pretty_print ) <EOL> lwrite ( '<STR_LIT>' % ( namespace_ , name_ , eol_ ) ) <EOL> else : <EOL> lwrite ( '<STR_LIT>' % ( eol_ , ) ) <EOL> def exportAttributes ( self , lwrite , level , already_processed , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' ) : <EOL> pass <EOL> def exportChildren ( self , lwrite , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , fromsubclass_ = False , pretty_print = True ) : <EOL> if pretty_print : <EOL> eol_ = '<STR_LIT:\n>' <EOL> else : <EOL> eol_ = '<STR_LIT>' <EOL> if self . Version is not None : <EOL> self . Version . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Status_Code is not None : <EOL> self . Status_Code . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Reason_Phrase is not None : <EOL> self . Reason_Phrase . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> def build ( self , node ) : <EOL> already_processed = set ( ) <EOL> self . buildAttributes ( node , node . attrib , already_processed ) <EOL> for child in node : <EOL> nodeName_ = Tag_pattern_ . match ( child . tag ) . groups ( ) [ - <NUM_LIT:1> ] <EOL> self . buildChildren ( child , node , nodeName_ ) <EOL> def buildAttributes ( self , node , attrs , already_processed ) : <EOL> pass <EOL> def buildChildren ( self , child_ , node , nodeName_ , fromsubclass_ = False ) : <EOL> if nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Version ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . PositiveIntegerObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Status_Code ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Reason_Phrase ( obj_ ) <EOL> class HostFieldType ( GeneratedsSuper ) : <EOL> """<STR_LIT>""" <EOL> subclass = None <EOL> superclass = None <EOL> def __init__ ( self , Domain_Name = None , Port = None ) : <EOL> self . Domain_Name = Domain_Name <EOL> self . Port = Port <EOL> def factory ( * args_ , ** kwargs_ ) : <EOL> if HostFieldType . subclass : <EOL> return HostFieldType . subclass ( * args_ , ** kwargs_ ) <EOL> else : <EOL> return HostFieldType ( * args_ , ** kwargs_ ) <EOL> factory = staticmethod ( factory ) <EOL> def get_Domain_Name ( self ) : return self . Domain_Name <EOL> def set_Domain_Name ( self , Domain_Name ) : self . Domain_Name = Domain_Name <EOL> def get_Port ( self ) : return self . Port <EOL> def set_Port ( self , Port ) : self . Port = Port <EOL> def hasContent_ ( self ) : <EOL> if ( <EOL> self . Domain_Name is not None or <EOL> self . Port is not None <EOL> ) : <EOL> return True <EOL> else : <EOL> return False <EOL> def export ( self , lwrite , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , namespacedef_ = '<STR_LIT>' , pretty_print = True ) : <EOL> if pretty_print : <EOL> eol_ = '<STR_LIT:\n>' <EOL> else : <EOL> eol_ = '<STR_LIT>' <EOL> showIndent ( lwrite , level , pretty_print ) <EOL> lwrite ( '<STR_LIT>' % ( namespace_ , name_ , namespacedef_ and '<STR_LIT:U+0020>' + namespacedef_ or '<STR_LIT>' , ) ) <EOL> already_processed = set ( ) <EOL> self . exportAttributes ( lwrite , level , already_processed , namespace_ , name_ = '<STR_LIT>' ) <EOL> if self . hasContent_ ( ) : <EOL> lwrite ( '<STR_LIT>' % ( eol_ , ) ) <EOL> self . exportChildren ( lwrite , level + <NUM_LIT:1> , namespace_ , name_ , pretty_print = pretty_print ) <EOL> showIndent ( lwrite , level , pretty_print ) <EOL> lwrite ( '<STR_LIT>' % ( namespace_ , name_ , eol_ ) ) <EOL> else : <EOL> lwrite ( '<STR_LIT>' % ( eol_ , ) ) <EOL> def exportAttributes ( self , lwrite , level , already_processed , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' ) : <EOL> pass <EOL> def exportChildren ( self , lwrite , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , fromsubclass_ = False , pretty_print = True ) : <EOL> if pretty_print : <EOL> eol_ = '<STR_LIT:\n>' <EOL> else : <EOL> eol_ = '<STR_LIT>' <EOL> if self . Domain_Name is not None : <EOL> self . Domain_Name . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Port is not None : <EOL> self . Port . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> def build ( self , node ) : <EOL> already_processed = set ( ) <EOL> self . buildAttributes ( node , node . attrib , already_processed ) <EOL> for child in node : <EOL> nodeName_ = Tag_pattern_ . match ( child . tag ) . groups ( ) [ - <NUM_LIT:1> ] <EOL> self . buildChildren ( child , node , nodeName_ ) <EOL> def buildAttributes ( self , node , attrs , already_processed ) : <EOL> pass <EOL> def buildChildren ( self , child_ , node , nodeName_ , fromsubclass_ = False ) : <EOL> if nodeName_ == '<STR_LIT>' : <EOL> obj_ = uri_object . URIObjectType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Domain_Name ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = port_object . PortObjectType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Port ( obj_ ) <EOL> class HTTPMethodType ( cybox_common . BaseObjectPropertyType ) : <EOL> """<STR_LIT>""" <EOL> subclass = None <EOL> superclass = cybox_common . BaseObjectPropertyType <EOL> def __init__ ( self , obfuscation_algorithm_ref = None , refanging_transform_type = None , has_changed = None , delimiter = '<STR_LIT>' , pattern_type = None , datatype = '<STR_LIT:string>' , refanging_transform = None , is_case_sensitive = True , bit_mask = None , appears_random = None , observed_encoding = None , defanging_algorithm_ref = None , is_obfuscated = None , regex_syntax = None , apply_condition = '<STR_LIT>' , trend = None , idref = None , is_defanged = None , id = None , condition = None , valueOf_ = None ) : <EOL> super ( HTTPMethodType , self ) . __init__ ( obfuscation_algorithm_ref , refanging_transform_type , has_changed , delimiter , pattern_type , datatype , refanging_transform , is_case_sensitive , bit_mask , appears_random , observed_encoding , defanging_algorithm_ref , is_obfuscated , regex_syntax , apply_condition , trend , idref , is_defanged , id , condition , valueOf_ ) <EOL> self . datatype = _cast ( None , datatype ) <EOL> self . valueOf_ = valueOf_ <EOL> def factory ( * args_ , ** kwargs_ ) : <EOL> if HTTPMethodType . subclass : <EOL> return HTTPMethodType . subclass ( * args_ , ** kwargs_ ) <EOL> else : <EOL> return HTTPMethodType ( * args_ , ** kwargs_ ) <EOL> factory = staticmethod ( factory ) <EOL> def get_datatype ( self ) : return self . datatype <EOL> def set_datatype ( self , datatype ) : self . datatype = datatype <EOL> def get_valueOf_ ( self ) : return self . valueOf_ <EOL> def set_valueOf_ ( self , valueOf_ ) : self . valueOf_ = valueOf_ <EOL> def hasContent_ ( self ) : <EOL> if ( <EOL> self . valueOf_ or <EOL> super ( HTTPMethodType , self ) . hasContent_ ( ) <EOL> ) : <EOL> return True <EOL> else : <EOL> return False <EOL> def export ( self , lwrite , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , namespacedef_ = '<STR_LIT>' , pretty_print = True ) : <EOL> if pretty_print : <EOL> eol_ = '<STR_LIT:\n>' <EOL> else : <EOL> eol_ = '<STR_LIT>' <EOL> showIndent ( lwrite , level , pretty_print ) <EOL> lwrite ( '<STR_LIT>' % ( namespace_ , name_ , namespacedef_ and '<STR_LIT:U+0020>' + namespacedef_ or '<STR_LIT>' , ) ) <EOL> already_processed = set ( ) <EOL> self . exportAttributes ( lwrite , level , already_processed , namespace_ , name_ = '<STR_LIT>' ) <EOL> if self . hasContent_ ( ) : <EOL> lwrite ( '<STR_LIT:>>' ) <EOL> lwrite ( quote_xml ( self . valueOf_ ) ) <EOL> self . exportChildren ( lwrite , level + <NUM_LIT:1> , namespace_ , name_ , pretty_print = pretty_print ) <EOL> lwrite ( '<STR_LIT>' % ( namespace_ , name_ , eol_ ) ) <EOL> else : <EOL> lwrite ( '<STR_LIT>' % ( eol_ , ) ) <EOL> def exportAttributes ( self , lwrite , level , already_processed , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' ) : <EOL> super ( HTTPMethodType , self ) . exportAttributes ( lwrite , level , already_processed , namespace_ , name_ = '<STR_LIT>' ) <EOL> if self . datatype is not None : <EOL> lwrite ( '<STR_LIT>' % ( quote_attrib ( self . datatype ) , ) ) <EOL> def exportChildren ( self , lwrite , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , fromsubclass_ = False , pretty_print = True ) : <EOL> super ( HTTPMethodType , self ) . exportChildren ( lwrite , level , '<STR_LIT>' , name_ , True , pretty_print = pretty_print ) <EOL> pass <EOL> def build ( self , node ) : <EOL> already_processed = set ( ) <EOL> self . buildAttributes ( node , node . attrib , already_processed ) <EOL> self . valueOf_ = get_all_text_ ( node ) <EOL> for child in node : <EOL> nodeName_ = Tag_pattern_ . match ( child . tag ) . groups ( ) [ - <NUM_LIT:1> ] <EOL> self . buildChildren ( child , node , nodeName_ ) <EOL> def buildAttributes ( self , node , attrs , already_processed ) : <EOL> value = find_attr_value_ ( '<STR_LIT>' , node ) <EOL> if value is not None : <EOL> self . datatype = value <EOL> super ( HTTPMethodType , self ) . buildAttributes ( node , attrs , already_processed ) <EOL> def buildChildren ( self , child_ , node , nodeName_ , fromsubclass_ = False ) : <EOL> pass <EOL> class HTTPSessionObjectType ( cybox_common . ObjectPropertiesType ) : <EOL> """<STR_LIT>""" <EOL> subclass = None <EOL> superclass = cybox_common . ObjectPropertiesType <EOL> def __init__ ( self , object_reference = None , Custom_Properties = None , xsi_type = None , HTTP_Request_Response = None ) : <EOL> super ( HTTPSessionObjectType , self ) . __init__ ( object_reference , Custom_Properties , xsi_type ) <EOL> if HTTP_Request_Response is None : <EOL> self . HTTP_Request_Response = [ ] <EOL> else : <EOL> self . HTTP_Request_Response = HTTP_Request_Response <EOL> def factory ( * args_ , ** kwargs_ ) : <EOL> if HTTPSessionObjectType . subclass : <EOL> return HTTPSessionObjectType . subclass ( * args_ , ** kwargs_ ) <EOL> else : <EOL> return HTTPSessionObjectType ( * args_ , ** kwargs_ ) <EOL> factory = staticmethod ( factory ) <EOL> def get_HTTP_Request_Response ( self ) : return self . HTTP_Request_Response <EOL> def set_HTTP_Request_Response ( self , HTTP_Request_Response ) : self . HTTP_Request_Response = HTTP_Request_Response <EOL> def add_HTTP_Request_Response ( self , value ) : self . HTTP_Request_Response . append ( value ) <EOL> def insert_HTTP_Request_Response ( self , index , value ) : self . HTTP_Request_Response [ index ] = value <EOL> def hasContent_ ( self ) : <EOL> if ( <EOL> self . HTTP_Request_Response or <EOL> super ( HTTPSessionObjectType , self ) . hasContent_ ( ) <EOL> ) : <EOL> return True <EOL> else : <EOL> return False <EOL> def export ( self , lwrite , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , namespacedef_ = '<STR_LIT>' , pretty_print = True ) : <EOL> if pretty_print : <EOL> eol_ = '<STR_LIT:\n>' <EOL> else : <EOL> eol_ = '<STR_LIT>' <EOL> showIndent ( lwrite , level , pretty_print ) <EOL> lwrite ( '<STR_LIT>' % ( namespace_ , name_ , namespacedef_ and '<STR_LIT:U+0020>' + namespacedef_ or '<STR_LIT>' , ) ) <EOL> already_processed = set ( ) <EOL> self . exportAttributes ( lwrite , level , already_processed , namespace_ , name_ = '<STR_LIT>' ) <EOL> if self . hasContent_ ( ) : <EOL> lwrite ( '<STR_LIT>' % ( eol_ , ) ) <EOL> self . exportChildren ( lwrite , level + <NUM_LIT:1> , namespace_ , name_ , pretty_print = pretty_print ) <EOL> showIndent ( lwrite , level , pretty_print ) <EOL> lwrite ( '<STR_LIT>' % ( namespace_ , name_ , eol_ ) ) <EOL> else : <EOL> lwrite ( '<STR_LIT>' % ( eol_ , ) ) <EOL> def exportAttributes ( self , lwrite , level , already_processed , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' ) : <EOL> super ( HTTPSessionObjectType , self ) . exportAttributes ( lwrite , level , already_processed , namespace_ , name_ = '<STR_LIT>' ) <EOL> def exportChildren ( self , lwrite , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , fromsubclass_ = False , pretty_print = True ) : <EOL> super ( HTTPSessionObjectType , self ) . exportChildren ( lwrite , level , '<STR_LIT>' , name_ , True , pretty_print = pretty_print ) <EOL> if pretty_print : <EOL> eol_ = '<STR_LIT:\n>' <EOL> else : <EOL> eol_ = '<STR_LIT>' <EOL> for HTTP_Request_Response_ in self . HTTP_Request_Response : <EOL> HTTP_Request_Response_ . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> def build ( self , node ) : <EOL> already_processed = set ( ) <EOL> self . buildAttributes ( node , node . attrib , already_processed ) <EOL> for child in node : <EOL> nodeName_ = Tag_pattern_ . match ( child . tag ) . groups ( ) [ - <NUM_LIT:1> ] <EOL> self . buildChildren ( child , node , nodeName_ ) <EOL> def buildAttributes ( self , node , attrs , already_processed ) : <EOL> super ( HTTPSessionObjectType , self ) . buildAttributes ( node , attrs , already_processed ) <EOL> def buildChildren ( self , child_ , node , nodeName_ , fromsubclass_ = False ) : <EOL> if nodeName_ == '<STR_LIT>' : <EOL> obj_ = HTTPRequestResponseType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . HTTP_Request_Response . append ( obj_ ) <EOL> super ( HTTPSessionObjectType , self ) . buildChildren ( child_ , node , nodeName_ , True ) <EOL> GDSClassesMapping = { <EOL> '<STR_LIT>' : cybox_common . BuildUtilityType , <EOL> '<STR_LIT>' : cybox_common . ErrorsType , <EOL> '<STR_LIT>' : cybox_common . EnvironmentVariableType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . IntegerObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . ErrorType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . IntegerObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . MetadataType , <EOL> '<STR_LIT>' : cybox_common . HashType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . ControlledVocabularyStringType , <EOL> '<STR_LIT>' : cybox_common . InternalStringsType , <EOL> '<STR_LIT>' : cybox_common . FuzzyHashStructureType , <EOL> '<STR_LIT>' : cybox_common . MetadataType , <EOL> '<STR_LIT>' : cybox_common . HashValueType , <EOL> '<STR_LIT>' : cybox_common . DigitalSignatureInfoType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . CodeSnippetsType , <EOL> '<STR_LIT>' : uri_object . URIObjectType , <EOL> '<STR_LIT>' : cybox_common . AnyURIObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . IntegerObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . InternationalizationSettingsType , <EOL> '<STR_LIT>' : cybox_common . ControlledVocabularyStringType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . HashSegmentsType , <EOL> '<STR_LIT>' : port_object . Layer4ProtocolType , <EOL> '<STR_LIT>' : cybox_common . IntegerObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . FunctionsType , <EOL> '<STR_LIT>' : address_object . AddressObjectType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . DateTimeObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . CompilerInformalDescriptionType , <EOL> '<STR_LIT>' : cybox_common . ObjectPropertiesType , <EOL> '<STR_LIT>' : cybox_common . PlatformSpecificationType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : uri_object . URIObjectType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . ErrorInstancesType , <EOL> '<STR_LIT>' : cybox_common . ControlledVocabularyStringType , <EOL> '<STR_LIT>' : cybox_common . CompilersType , <EOL> '<STR_LIT>' : cybox_common . ControlledVocabularyStringType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . ToolInformationType , <EOL> '<STR_LIT>' : cybox_common . BuildInformationType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . IntegerObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . HashListType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . IntegerObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . IntegerObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . PropertyType , <EOL> '<STR_LIT>' : cybox_common . ExtractedStringsType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . ToolSpecificDataType , <EOL> '<STR_LIT>' : cybox_common . PersonnelType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . StructuredTextType , <EOL> '<STR_LIT>' : cybox_common . ObjectPropertiesType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . ExecutionEnvironmentType , <EOL> '<STR_LIT>' : cybox_common . ConfigurationSettingsType , <EOL> '<STR_LIT>' : cybox_common . PlatformSpecificationType , <EOL> '<STR_LIT>' : cybox_common . HexBinaryObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . IntegerObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . ObjectPropertiesType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . PlatformIdentifierType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : uri_object . URIObjectType , <EOL> '<STR_LIT>' : cybox_common . DependenciesType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . IntegerObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . DateRangeType , <EOL> '<STR_LIT>' : uri_object . URIObjectType , <EOL> '<STR_LIT>' : cybox_common . HashListType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . StructuredTextType , <EOL> '<STR_LIT>' : cybox_common . FuzzyHashBlockType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . TimeType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . DateTimeObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . HexBinaryObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . ByteRunType , <EOL> '<STR_LIT>' : cybox_common . IntegerObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . ToolConfigurationType , <EOL> '<STR_LIT>' : cybox_common . ImportsType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : uri_object . URIObjectType , <EOL> '<STR_LIT>' : cybox_common . LibraryType , <EOL> '<STR_LIT>' : cybox_common . ToolReferencesType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . UsageContextAssumptionsType , <EOL> '<STR_LIT>' : cybox_common . HashValueType , <EOL> '<STR_LIT>' : cybox_common . CustomPropertiesType , <EOL> '<STR_LIT>' : cybox_common . PositiveIntegerObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . ConfigurationSettingType , <EOL> '<STR_LIT>' : cybox_common . LibrariesType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . IntegerObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . StructuredTextType , <EOL> '<STR_LIT>' : cybox_common . ObjectPropertiesType , <EOL> '<STR_LIT>' : cybox_common . BuildConfigurationType , <EOL> '<STR_LIT>' : uri_object . URIObjectType , <EOL> '<STR_LIT>' : cybox_common . DateTimeObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : address_object . AddressObjectType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . HashSegmentType , <EOL> '<STR_LIT>' : cybox_common . PositiveIntegerObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . CompilerType , <EOL> '<STR_LIT:Name>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . DependencyType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . DateTimeObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . IntegerObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . IntegerObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . SimpleHashValueType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . ExtractedStringType , <EOL> '<STR_LIT>' : cybox_common . ToolsInformationType , <EOL> '<STR_LIT>' : cybox_common . PlatformSpecificationType , <EOL> '<STR_LIT>' : cybox_common . FuzzyHashValueType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . DataSizeType , <EOL> '<STR_LIT>' : cybox_common . StructuredTextType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . ContributorType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : port_object . PortObjectType , <EOL> '<STR_LIT>' : cybox_common . IntegerObjectPropertyType , <EOL> } <EOL> USAGE_TEXT = """<STR_LIT>""" <EOL> def usage ( ) : <EOL> print ( USAGE_TEXT ) <EOL> sys . exit ( <NUM_LIT:1> ) <EOL> def get_root_tag ( node ) : <EOL> tag = Tag_pattern_ . match ( node . tag ) . groups ( ) [ - <NUM_LIT:1> ] <EOL> rootClass = GDSClassesMapping . get ( tag ) <EOL> if rootClass is None : <EOL> rootClass = globals ( ) . get ( tag ) <EOL> return tag , rootClass <EOL> def parse ( inFileName ) : <EOL> doc = parsexml_ ( inFileName ) <EOL> rootNode = doc . getroot ( ) <EOL> rootTag , rootClass = get_root_tag ( rootNode ) <EOL> if rootClass is None : <EOL> rootTag = '<STR_LIT>' <EOL> rootClass = HTTPSessionObjectType <EOL> rootObj = rootClass . factory ( ) <EOL> rootObj . build ( rootNode ) <EOL> doc = None <EOL> return rootObj <EOL> def parseEtree ( inFileName ) : <EOL> doc = parsexml_ ( inFileName ) <EOL> rootNode = doc . getroot ( ) <EOL> rootTag , rootClass = get_root_tag ( rootNode ) <EOL> if rootClass is None : <EOL> rootTag = '<STR_LIT>' <EOL> rootClass = HTTPSessionObjectType <EOL> rootObj = rootClass . factory ( ) <EOL> rootObj . build ( rootNode ) <EOL> doc = None <EOL> rootElement = rootObj . to_etree ( None , name_ = rootTag ) <EOL> content = etree_ . tostring ( rootElement , pretty_print = True , <EOL> xml_declaration = True , encoding = "<STR_LIT:utf-8>" ) <EOL> sys . stdout . write ( content ) <EOL> sys . stdout . write ( '<STR_LIT:\n>' ) <EOL> return rootObj , rootElement <EOL> def parseString ( inString ) : <EOL> from mixbox . vendor . six import StringIO <EOL> doc = parsexml_ ( StringIO ( inString ) ) <EOL> rootNode = doc . getroot ( ) <EOL> rootTag , rootClass = get_root_tag ( rootNode ) <EOL> if rootClass is None : <EOL> rootTag = '<STR_LIT>' <EOL> rootClass = HTTPSessionObjectType <EOL> rootObj = rootClass . factory ( ) <EOL> rootObj . build ( rootNode ) <EOL> doc = None <EOL> return rootObj <EOL> def main ( ) : <EOL> args = sys . argv [ <NUM_LIT:1> : ] <EOL> if len ( args ) == <NUM_LIT:1> : <EOL> parse ( args [ <NUM_LIT:0> ] ) <EOL> else : <EOL> usage ( ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> main ( ) <EOL> __all__ = [ <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" <EOL> ] </s>
<s> import sys <EOL> from mixbox . binding_utils import * <EOL> from . import cybox_common <EOL> from . import library_object <EOL> from . import win_handle_object <EOL> class WinHookType ( cybox_common . BaseObjectPropertyType ) : <EOL> """<STR_LIT>""" <EOL> subclass = None <EOL> superclass = cybox_common . BaseObjectPropertyType <EOL> def __init__ ( self , obfuscation_algorithm_ref = None , refanging_transform_type = None , has_changed = None , delimiter = '<STR_LIT>' , pattern_type = None , datatype = '<STR_LIT:string>' , refanging_transform = None , is_case_sensitive = True , bit_mask = None , appears_random = None , observed_encoding = None , defanging_algorithm_ref = None , is_obfuscated = None , regex_syntax = None , apply_condition = '<STR_LIT>' , trend = None , idref = None , is_defanged = None , id = None , condition = None , valueOf_ = None ) : <EOL> super ( WinHookType , self ) . __init__ ( obfuscation_algorithm_ref , refanging_transform_type , has_changed , delimiter , pattern_type , datatype , refanging_transform , is_case_sensitive , bit_mask , appears_random , observed_encoding , defanging_algorithm_ref , is_obfuscated , regex_syntax , apply_condition , trend , idref , is_defanged , id , condition , valueOf_ , ) <EOL> self . valueOf_ = valueOf_ <EOL> def factory ( * args_ , ** kwargs_ ) : <EOL> if WinHookType . subclass : <EOL> return WinHookType . subclass ( * args_ , ** kwargs_ ) <EOL> else : <EOL> return WinHookType ( * args_ , ** kwargs_ ) <EOL> factory = staticmethod ( factory ) <EOL> def get_valueOf_ ( self ) : return self . valueOf_ <EOL> def set_valueOf_ ( self , valueOf_ ) : self . valueOf_ = valueOf_ <EOL> def hasContent_ ( self ) : <EOL> if ( <EOL> self . valueOf_ or <EOL> super ( WinHookType , self ) . hasContent_ ( ) <EOL> ) : <EOL> return True <EOL> else : <EOL> return False <EOL> def export ( self , lwrite , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , namespacedef_ = '<STR_LIT>' , pretty_print = True ) : <EOL> if pretty_print : <EOL> eol_ = '<STR_LIT:\n>' <EOL> else : <EOL> eol_ = '<STR_LIT>' <EOL> showIndent ( lwrite , level , pretty_print ) <EOL> lwrite ( '<STR_LIT>' % ( namespace_ , name_ , namespacedef_ and '<STR_LIT:U+0020>' + namespacedef_ or '<STR_LIT>' , ) ) <EOL> already_processed = set ( ) <EOL> self . exportAttributes ( lwrite , level , already_processed , namespace_ , name_ = '<STR_LIT>' ) <EOL> if self . hasContent_ ( ) : <EOL> lwrite ( '<STR_LIT:>>' ) <EOL> lwrite ( quote_xml ( self . valueOf_ ) ) <EOL> self . exportChildren ( lwrite , level + <NUM_LIT:1> , namespace_ , name_ , pretty_print = pretty_print ) <EOL> lwrite ( '<STR_LIT>' % ( namespace_ , name_ , eol_ ) ) <EOL> else : <EOL> lwrite ( '<STR_LIT>' % ( eol_ , ) ) <EOL> def exportAttributes ( self , lwrite , level , already_processed , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' ) : <EOL> super ( WinHookType , self ) . exportAttributes ( lwrite , level , already_processed , namespace_ , name_ = '<STR_LIT>' ) <EOL> def exportChildren ( self , lwrite , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , fromsubclass_ = False , pretty_print = True ) : <EOL> super ( WinHookType , self ) . exportChildren ( lwrite , level , '<STR_LIT>' , name_ , True , pretty_print = pretty_print ) <EOL> pass <EOL> def build ( self , node ) : <EOL> already_processed = set ( ) <EOL> self . buildAttributes ( node , node . attrib , already_processed ) <EOL> self . valueOf_ = get_all_text_ ( node ) <EOL> for child in node : <EOL> nodeName_ = Tag_pattern_ . match ( child . tag ) . groups ( ) [ - <NUM_LIT:1> ] <EOL> self . buildChildren ( child , node , nodeName_ ) <EOL> def buildAttributes ( self , node , attrs , already_processed ) : <EOL> super ( WinHookType , self ) . buildAttributes ( node , attrs , already_processed ) <EOL> def buildChildren ( self , child_ , node , nodeName_ , fromsubclass_ = False ) : <EOL> pass <EOL> class WindowsHookObjectType ( cybox_common . ObjectPropertiesType ) : <EOL> """<STR_LIT>""" <EOL> subclass = None <EOL> superclass = cybox_common . ObjectPropertiesType <EOL> def __init__ ( self , object_reference = None , Custom_Properties = None , xsi_type = None , Type = None , Handle = None , Hooking_Function_Name = None , Hooking_Module = None , Thread_ID = None ) : <EOL> super ( WindowsHookObjectType , self ) . __init__ ( object_reference , Custom_Properties , xsi_type ) <EOL> self . Type = Type <EOL> self . Handle = Handle <EOL> self . Hooking_Function_Name = Hooking_Function_Name <EOL> self . Hooking_Module = Hooking_Module <EOL> self . Thread_ID = Thread_ID <EOL> def factory ( * args_ , ** kwargs_ ) : <EOL> if WindowsHookObjectType . subclass : <EOL> return WindowsHookObjectType . subclass ( * args_ , ** kwargs_ ) <EOL> else : <EOL> return WindowsHookObjectType ( * args_ , ** kwargs_ ) <EOL> factory = staticmethod ( factory ) <EOL> def get_Type ( self ) : return self . Type <EOL> def set_Type ( self , Type ) : self . Type = Type <EOL> def validate_WinHookType ( self , value ) : <EOL> pass <EOL> def get_Handle ( self ) : return self . Handle <EOL> def set_Handle ( self , Handle ) : self . Handle = Handle <EOL> def get_Hooking_Function_Name ( self ) : return self . Hooking_Function_Name <EOL> def set_Hooking_Function_Name ( self , Hooking_Function_Name ) : self . Hooking_Function_Name = Hooking_Function_Name <EOL> def validate_StringObjectPropertyType ( self , value ) : <EOL> pass <EOL> def get_Hooking_Module ( self ) : return self . Hooking_Module <EOL> def set_Hooking_Module ( self , Hooking_Module ) : self . Hooking_Module = Hooking_Module <EOL> def get_Thread_ID ( self ) : return self . Thread_ID <EOL> def set_Thread_ID ( self , Thread_ID ) : self . Thread_ID = Thread_ID <EOL> def validate_NonNegativeIntegerObjectPropertyType ( self , value ) : <EOL> pass <EOL> def hasContent_ ( self ) : <EOL> if ( <EOL> self . Type is not None or <EOL> self . Handle is not None or <EOL> self . Hooking_Function_Name is not None or <EOL> self . Hooking_Module is not None or <EOL> self . Thread_ID is not None or <EOL> super ( WindowsHookObjectType , self ) . hasContent_ ( ) <EOL> ) : <EOL> return True <EOL> else : <EOL> return False <EOL> def export ( self , lwrite , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , namespacedef_ = '<STR_LIT>' , pretty_print = True ) : <EOL> if pretty_print : <EOL> eol_ = '<STR_LIT:\n>' <EOL> else : <EOL> eol_ = '<STR_LIT>' <EOL> showIndent ( lwrite , level , pretty_print ) <EOL> lwrite ( '<STR_LIT>' % ( namespace_ , name_ , namespacedef_ and '<STR_LIT:U+0020>' + namespacedef_ or '<STR_LIT>' , ) ) <EOL> already_processed = set ( ) <EOL> self . exportAttributes ( lwrite , level , already_processed , namespace_ , name_ = '<STR_LIT>' ) <EOL> if self . hasContent_ ( ) : <EOL> lwrite ( '<STR_LIT>' % ( eol_ , ) ) <EOL> self . exportChildren ( lwrite , level + <NUM_LIT:1> , namespace_ , name_ , pretty_print = pretty_print ) <EOL> showIndent ( lwrite , level , pretty_print ) <EOL> lwrite ( '<STR_LIT>' % ( namespace_ , name_ , eol_ ) ) <EOL> else : <EOL> lwrite ( '<STR_LIT>' % ( eol_ , ) ) <EOL> def exportAttributes ( self , lwrite , level , already_processed , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' ) : <EOL> super ( WindowsHookObjectType , self ) . exportAttributes ( lwrite , level , already_processed , namespace_ , name_ = '<STR_LIT>' ) <EOL> def exportChildren ( self , lwrite , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , fromsubclass_ = False , pretty_print = True ) : <EOL> super ( WindowsHookObjectType , self ) . exportChildren ( lwrite , level , '<STR_LIT>' , name_ , True , pretty_print = pretty_print ) <EOL> if pretty_print : <EOL> eol_ = '<STR_LIT:\n>' <EOL> else : <EOL> eol_ = '<STR_LIT>' <EOL> if self . Type is not None : <EOL> self . Type . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Handle is not None : <EOL> self . Handle . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Hooking_Function_Name is not None : <EOL> self . Hooking_Function_Name . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Hooking_Module is not None : <EOL> self . Hooking_Module . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Thread_ID is not None : <EOL> self . Thread_ID . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> def build ( self , node ) : <EOL> already_processed = set ( ) <EOL> self . buildAttributes ( node , node . attrib , already_processed ) <EOL> for child in node : <EOL> nodeName_ = Tag_pattern_ . match ( child . tag ) . groups ( ) [ - <NUM_LIT:1> ] <EOL> self . buildChildren ( child , node , nodeName_ ) <EOL> def buildAttributes ( self , node , attrs , already_processed ) : <EOL> super ( WindowsHookObjectType , self ) . buildAttributes ( node , attrs , already_processed ) <EOL> def buildChildren ( self , child_ , node , nodeName_ , fromsubclass_ = False ) : <EOL> if nodeName_ == '<STR_LIT>' : <EOL> obj_ = WinHookType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Type ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = win_handle_object . WindowsHandleObjectType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Handle ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Hooking_Function_Name ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = library_object . LibraryObjectType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Hooking_Module ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . NonNegativeIntegerObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Thread_ID ( obj_ ) <EOL> super ( WindowsHookObjectType , self ) . buildChildren ( child_ , node , nodeName_ , True ) <EOL> GDSClassesMapping = { <EOL> '<STR_LIT>' : cybox_common . BuildUtilityType , <EOL> '<STR_LIT>' : cybox_common . EndiannessType , <EOL> '<STR_LIT>' : cybox_common . ErrorsType , <EOL> '<STR_LIT>' : cybox_common . TimeType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . MetadataType , <EOL> '<STR_LIT>' : cybox_common . HashType , <EOL> '<STR_LIT>' : cybox_common . NonNegativeIntegerObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . ControlledVocabularyStringType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . InternalStringsType , <EOL> '<STR_LIT>' : cybox_common . FuzzyHashStructureType , <EOL> '<STR_LIT>' : cybox_common . MetadataType , <EOL> '<STR_LIT>' : cybox_common . HashValueType , <EOL> '<STR_LIT>' : cybox_common . DigitalSignatureInfoType , <EOL> '<STR_LIT>' : cybox_common . CodeSnippetsType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . IntegerObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . DateTimeWithPrecisionType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . ToolReferenceType , <EOL> '<STR_LIT>' : cybox_common . ControlledVocabularyStringType , <EOL> '<STR_LIT>' : cybox_common . InternationalizationSettingsType , <EOL> '<STR_LIT>' : cybox_common . ToolConfigurationType , <EOL> '<STR_LIT>' : cybox_common . UnsignedLongObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . DateWithPrecisionType , <EOL> '<STR_LIT>' : cybox_common . FunctionsType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . UnsignedLongObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . PlatformSpecificationType , <EOL> '<STR_LIT>' : cybox_common . CompilerInformalDescriptionType , <EOL> '<STR_LIT>' : cybox_common . DateTimeWithPrecisionType , <EOL> '<STR_LIT>' : cybox_common . ObjectPropertiesType , <EOL> '<STR_LIT>' : cybox_common . PlatformSpecificationType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . UsageContextAssumptionsType , <EOL> '<STR_LIT>' : cybox_common . LibraryType , <EOL> '<STR_LIT>' : cybox_common . CompilersType , <EOL> '<STR_LIT>' : cybox_common . ControlledVocabularyStringType , <EOL> '<STR_LIT>' : cybox_common . ExtractedStringType , <EOL> '<STR_LIT>' : cybox_common . CustomPropertiesType , <EOL> '<STR_LIT>' : cybox_common . BuildInformationType , <EOL> '<STR_LIT>' : cybox_common . HashListType , <EOL> '<STR_LIT>' : cybox_common . LocationType , <EOL> '<STR_LIT>' : cybox_common . ErrorInstancesType , <EOL> '<STR_LIT>' : cybox_common . DateWithPrecisionType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . CompensationModelType , <EOL> '<STR_LIT>' : cybox_common . PropertyType , <EOL> '<STR_LIT>' : cybox_common . ExtractedStringsType , <EOL> '<STR_LIT>' : cybox_common . HexBinaryObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . PersonnelType , <EOL> '<STR_LIT>' : cybox_common . ObjectPropertiesType , <EOL> '<STR_LIT>' : cybox_common . ConfigurationSettingsType , <EOL> '<STR_LIT>' : cybox_common . SimpleHashValueType , <EOL> '<STR_LIT>' : cybox_common . HexBinaryObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . DateTimeWithPrecisionType , <EOL> '<STR_LIT>' : cybox_common . ObjectPropertiesType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . UnsignedLongObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . PlatformIdentifierType , <EOL> '<STR_LIT>' : cybox_common . ToolSpecificDataType , <EOL> '<STR_LIT>' : cybox_common . ExecutionEnvironmentType , <EOL> '<STR_LIT>' : cybox_common . IntegerObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . DependenciesType , <EOL> '<STR_LIT>' : cybox_common . IntegerObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . IntegerObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . DateRangeType , <EOL> '<STR_LIT>' : cybox_common . HashListType , <EOL> '<STR_LIT>' : cybox_common . HashSegmentsType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . StructuredTextType , <EOL> '<STR_LIT>' : cybox_common . FuzzyHashBlockType , <EOL> '<STR_LIT>' : cybox_common . DependencyType , <EOL> '<STR_LIT>' : cybox_common . ErrorType , <EOL> '<STR_LIT>' : cybox_common . UnsignedIntegerObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . HexBinaryObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . EnvironmentVariableType , <EOL> '<STR_LIT>' : cybox_common . ByteRunType , <EOL> '<STR_LIT>' : cybox_common . IntegerObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . IntegerObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . ImportsType , <EOL> '<STR_LIT>' : library_object . LibraryObjectType , <EOL> '<STR_LIT>' : cybox_common . ToolReferencesType , <EOL> '<STR_LIT>' : win_handle_object . WindowsHandleObjectType , <EOL> '<STR_LIT>' : cybox_common . UnsignedLongObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . DateTimeWithPrecisionType , <EOL> '<STR_LIT>' : cybox_common . HashValueType , <EOL> '<STR_LIT>' : cybox_common . ConfigurationSettingType , <EOL> '<STR_LIT>' : cybox_common . LocationType , <EOL> '<STR_LIT>' : cybox_common . LibrariesType , <EOL> '<STR_LIT>' : library_object . LibraryObjectType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : win_handle_object . WindowsHandleObjectType , <EOL> '<STR_LIT>' : cybox_common . StructuredTextType , <EOL> '<STR_LIT>' : cybox_common . ObjectPropertiesType , <EOL> '<STR_LIT>' : cybox_common . BuildConfigurationType , <EOL> '<STR_LIT>' : cybox_common . ExtractedFeaturesType , <EOL> '<STR_LIT>' : cybox_common . HexBinaryObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . IntegerObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . HashSegmentType , <EOL> '<STR_LIT>' : cybox_common . CompilerType , <EOL> '<STR_LIT:Name>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . IntegerObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . PlatformSpecificationType , <EOL> '<STR_LIT>' : cybox_common . FuzzyHashValueType , <EOL> '<STR_LIT>' : cybox_common . DataSizeType , <EOL> '<STR_LIT>' : cybox_common . StructuredTextType , <EOL> '<STR_LIT>' : cybox_common . DateTimeWithPrecisionType , <EOL> '<STR_LIT>' : cybox_common . ContributorType , <EOL> '<STR_LIT>' : cybox_common . ToolsInformationType , <EOL> '<STR_LIT>' : cybox_common . ToolInformationType , <EOL> } <EOL> USAGE_TEXT = """<STR_LIT>""" <EOL> def usage ( ) : <EOL> print ( USAGE_TEXT ) <EOL> sys . exit ( <NUM_LIT:1> ) <EOL> def get_root_tag ( node ) : <EOL> tag = Tag_pattern_ . match ( node . tag ) . groups ( ) [ - <NUM_LIT:1> ] <EOL> rootClass = GDSClassesMapping . get ( tag ) <EOL> if rootClass is None : <EOL> rootClass = globals ( ) . get ( tag ) <EOL> return tag , rootClass <EOL> def parse ( inFileName ) : <EOL> doc = parsexml_ ( inFileName ) <EOL> rootNode = doc . getroot ( ) <EOL> rootTag , rootClass = get_root_tag ( rootNode ) <EOL> if rootClass is None : <EOL> rootTag = '<STR_LIT>' <EOL> rootClass = WindowsHookObjectType <EOL> rootObj = rootClass . factory ( ) <EOL> rootObj . build ( rootNode ) <EOL> doc = None <EOL> sys . stdout . write ( '<STR_LIT>' ) <EOL> rootObj . export ( sys . stdout . write , <NUM_LIT:0> , name_ = rootTag , <EOL> namespacedef_ = '<STR_LIT>' , <EOL> pretty_print = True ) <EOL> return rootObj <EOL> def parseEtree ( inFileName ) : <EOL> doc = parsexml_ ( inFileName ) <EOL> rootNode = doc . getroot ( ) <EOL> rootTag , rootClass = get_root_tag ( rootNode ) <EOL> if rootClass is None : <EOL> rootTag = '<STR_LIT>' <EOL> rootClass = WindowsHookObjectType <EOL> rootObj = rootClass . factory ( ) <EOL> rootObj . build ( rootNode ) <EOL> doc = None <EOL> rootElement = rootObj . to_etree ( None , name_ = rootTag ) <EOL> content = etree_ . tostring ( rootElement , pretty_print = True , <EOL> xml_declaration = True , encoding = "<STR_LIT:utf-8>" ) <EOL> sys . stdout . write ( content ) <EOL> sys . stdout . write ( '<STR_LIT:\n>' ) <EOL> return rootObj , rootElement <EOL> def parseString ( inString ) : <EOL> from mixbox . vendor . six import StringIO <EOL> doc = parsexml_ ( StringIO ( inString ) ) <EOL> rootNode = doc . getroot ( ) <EOL> rootTag , rootClass = get_root_tag ( rootNode ) <EOL> if rootClass is None : <EOL> rootTag = '<STR_LIT>' <EOL> rootClass = WindowsHookObjectType <EOL> rootObj = rootClass . factory ( ) <EOL> rootObj . build ( rootNode ) <EOL> doc = None <EOL> sys . stdout . write ( '<STR_LIT>' ) <EOL> rootObj . export ( sys . stdout . write , <NUM_LIT:0> , name_ = "<STR_LIT>" , <EOL> namespacedef_ = '<STR_LIT>' ) <EOL> return rootObj <EOL> def main ( ) : <EOL> args = sys . argv [ <NUM_LIT:1> : ] <EOL> if len ( args ) == <NUM_LIT:1> : <EOL> parse ( args [ <NUM_LIT:0> ] ) <EOL> else : <EOL> usage ( ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> main ( ) <EOL> __all__ = [ <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" <EOL> ] </s>
<s> """<STR_LIT>""" <EOL> from __future__ import absolute_import <EOL> from . attribute_groups import DEFAULT_DELIM , PatternFieldGroup <EOL> from . properties import * <EOL> from . vocabs import VocabString <EOL> from . data_segment import DataSegment , DataSize <EOL> from . datetimewithprecision import DateTimeWithPrecision , DateWithPrecision <EOL> from . daterange import DateRange <EOL> from . digitalsignature import DigitalSignature , DigitalSignatureList <EOL> from . environment_variable import EnvironmentVariable , EnvironmentVariableList <EOL> from . hashes import Hash , HashList , HashName <EOL> from . object_properties import ObjectProperties , Property <EOL> from . structured_text import StructuredText <EOL> from . time import Time <EOL> from . tools import ToolInformation , ToolInformationList , ToolType <EOL> from . byterun import ByteRun , ByteRuns <EOL> from . contributor import Contributor , Personnel <EOL> from . extracted_string import ExtractedString , ExtractedStrings <EOL> from . platform_specification import PlatformSpecification , PlatformIdentifier <EOL> from . measuresource import InformationSourceType , MeasureSource <EOL> from . extracted_features import ExtractedFeatures </s>
<s> """<STR_LIT>""" <EOL> from mixbox import entities <EOL> from mixbox import fields <EOL> import cybox . bindings . cybox_core as core_binding <EOL> class ActionReference ( entities . Entity ) : <EOL> _binding = core_binding <EOL> _binding_class = core_binding . ActionReferenceType <EOL> _namespace = '<STR_LIT>' <EOL> action_id = fields . TypedField ( "<STR_LIT>" ) <EOL> def __init__ ( self , action_id = None ) : <EOL> super ( ActionReference , self ) . __init__ ( ) <EOL> self . action_id = action_id </s>
<s> from mixbox import entities <EOL> from mixbox import fields <EOL> from mixbox . vendor import six <EOL> import cybox . bindings . email_message_object as email_message_binding <EOL> from cybox . common import ObjectProperties , String , PositiveInteger , DateTime <EOL> from cybox . objects . address_object import Address , EmailAddress <EOL> class _Reference ( object ) : <EOL> """<STR_LIT>""" <EOL> object_reference = fields . TypedField ( "<STR_LIT>" ) <EOL> def __init__ ( self , object_reference = None ) : <EOL> super ( _Reference , self ) . __init__ ( ) <EOL> self . object_reference = object_reference <EOL> class _ReferenceList ( object ) : <EOL> """<STR_LIT>""" <EOL> def _fix_value ( self , value ) : <EOL> if isinstance ( value , six . string_types ) : <EOL> return self . _contained_type ( value ) <EOL> class AttachmentReference ( _Reference , entities . Entity ) : <EOL> _binding = email_message_binding <EOL> _binding_class = email_message_binding . AttachmentReferenceType <EOL> _namespace = "<STR_LIT>" <EOL> class LinkReference ( _Reference , entities . Entity ) : <EOL> _binding = email_message_binding <EOL> _binding_class = email_message_binding . LinkReferenceType <EOL> _namespace = "<STR_LIT>" <EOL> class Attachments ( _ReferenceList , entities . EntityList ) : <EOL> _binding = email_message_binding <EOL> _binding_class = email_message_binding . AttachmentsType <EOL> _binding_var = "<STR_LIT>" <EOL> _contained_type = AttachmentReference <EOL> _namespace = '<STR_LIT>' <EOL> class Links ( _ReferenceList , entities . EntityList ) : <EOL> _binding = email_message_binding <EOL> _binding_class = email_message_binding . LinksType <EOL> _binding_var = "<STR_LIT>" <EOL> _contained_type = LinkReference <EOL> _namespace = '<STR_LIT>' <EOL> class EmailRecipients ( entities . EntityList ) : <EOL> _binding = email_message_binding <EOL> _binding_class = email_message_binding . EmailRecipientsType <EOL> _binding_var = '<STR_LIT>' <EOL> _contained_type = EmailAddress <EOL> _namespace = '<STR_LIT>' <EOL> _try_cast = True <EOL> class ReceivedLine ( entities . Entity ) : <EOL> _binding = email_message_binding <EOL> _binding_class = email_message_binding . EmailReceivedLineType <EOL> _namespace = "<STR_LIT>" <EOL> from_ = fields . TypedField ( "<STR_LIT>" , String ) <EOL> by = fields . TypedField ( "<STR_LIT>" , String ) <EOL> via = fields . TypedField ( "<STR_LIT>" , String ) <EOL> with_ = fields . TypedField ( "<STR_LIT>" , String ) <EOL> for_ = fields . TypedField ( "<STR_LIT>" , String ) <EOL> id_ = fields . TypedField ( "<STR_LIT>" , String ) <EOL> timestamp = fields . TypedField ( "<STR_LIT>" , DateTime ) <EOL> class ReceivedLineList ( entities . EntityList ) : <EOL> _binding = email_message_binding <EOL> _binding_class = email_message_binding . EmailReceivedLineListType <EOL> _binding_var = "<STR_LIT>" <EOL> _contained_type = ReceivedLine <EOL> _namespace = "<STR_LIT>" <EOL> class EmailHeader ( entities . Entity ) : <EOL> _binding = email_message_binding <EOL> _binding_class = email_message_binding . EmailHeaderType <EOL> _namespace = "<STR_LIT>" <EOL> received_lines = fields . TypedField ( "<STR_LIT>" , ReceivedLineList ) <EOL> to = fields . TypedField ( "<STR_LIT>" , EmailRecipients ) <EOL> cc = fields . TypedField ( "<STR_LIT>" , EmailRecipients ) <EOL> bcc = fields . TypedField ( "<STR_LIT>" , EmailRecipients ) <EOL> from_ = fields . TypedField ( "<STR_LIT>" , EmailAddress ) <EOL> subject = fields . TypedField ( "<STR_LIT>" , String ) <EOL> in_reply_to = fields . TypedField ( "<STR_LIT>" , String ) <EOL> date = fields . TypedField ( "<STR_LIT>" , DateTime ) <EOL> message_id = fields . TypedField ( "<STR_LIT>" , String ) <EOL> sender = fields . TypedField ( "<STR_LIT>" , EmailAddress ) <EOL> reply_to = fields . TypedField ( "<STR_LIT>" , EmailAddress ) <EOL> errors_to = fields . TypedField ( "<STR_LIT>" , String ) <EOL> boundary = fields . TypedField ( "<STR_LIT>" , String ) <EOL> content_type = fields . TypedField ( "<STR_LIT>" , String ) <EOL> mime_version = fields . TypedField ( "<STR_LIT>" , String ) <EOL> precedence = fields . TypedField ( "<STR_LIT>" , String ) <EOL> user_agent = fields . TypedField ( "<STR_LIT>" , String ) <EOL> x_mailer = fields . TypedField ( "<STR_LIT>" , String ) <EOL> x_originating_ip = fields . TypedField ( "<STR_LIT>" , Address ) <EOL> x_priority = fields . TypedField ( "<STR_LIT>" , PositiveInteger ) <EOL> class EmailMessage ( ObjectProperties ) : <EOL> _binding = email_message_binding <EOL> _binding_class = email_message_binding . EmailMessageObjectType <EOL> _namespace = '<STR_LIT>' <EOL> _XSI_NS = "<STR_LIT>" <EOL> _XSI_TYPE = "<STR_LIT>" <EOL> header = fields . TypedField ( "<STR_LIT>" , EmailHeader ) <EOL> email_server = fields . TypedField ( "<STR_LIT>" , String ) <EOL> raw_body = fields . TypedField ( "<STR_LIT>" , String ) <EOL> raw_header = fields . TypedField ( "<STR_LIT>" , String ) <EOL> attachments = fields . TypedField ( "<STR_LIT>" , Attachments ) <EOL> links = fields . TypedField ( "<STR_LIT>" , Links ) <EOL> @ property <EOL> def to ( self ) : <EOL> return self . header . to <EOL> @ to . setter <EOL> def to ( self , value ) : <EOL> if not self . header : <EOL> self . header = EmailHeader ( ) <EOL> self . header . to = value <EOL> @ property <EOL> def from_ ( self ) : <EOL> return self . header . from_ <EOL> @ from_ . setter <EOL> def from_ ( self , value ) : <EOL> if not self . header : <EOL> self . header = EmailHeader ( ) <EOL> self . header . from_ = value <EOL> @ property <EOL> def subject ( self ) : <EOL> return self . header . subject <EOL> @ subject . setter <EOL> def subject ( self , value ) : <EOL> if not self . header : <EOL> self . header = EmailHeader ( ) <EOL> self . header . subject = value <EOL> @ property <EOL> def date ( self ) : <EOL> return self . header . date <EOL> @ date . setter <EOL> def date ( self , value ) : <EOL> if not self . header : <EOL> self . header = EmailHeader ( ) <EOL> self . header . date = value <EOL> @ property <EOL> def message_id ( self ) : <EOL> return self . header . message_id <EOL> @ message_id . setter <EOL> def message_id ( self , value ) : <EOL> if not self . header : <EOL> self . header = EmailHeader ( ) <EOL> self . header . message_id = value <EOL> @ property <EOL> def sender ( self ) : <EOL> return self . header . sender <EOL> @ sender . setter <EOL> def sender ( self , value ) : <EOL> if not self . header : <EOL> self . header = EmailHeader ( ) <EOL> self . header . sender = value <EOL> @ property <EOL> def reply_to ( self ) : <EOL> return self . header . reply_to <EOL> @ reply_to . setter <EOL> def reply_to ( self , value ) : <EOL> if not self . header : <EOL> self . header = EmailHeader ( ) <EOL> self . header . reply_to = value <EOL> @ property <EOL> def x_originating_ip ( self ) : <EOL> if not self . header : <EOL> return None <EOL> return self . header . x_originating_ip <EOL> @ x_originating_ip . setter <EOL> def x_originating_ip ( self , value ) : <EOL> if not self . header : <EOL> self . header = EmailHeader ( ) <EOL> self . header . x_originating_ip = value </s>
<s> from mixbox import fields <EOL> import cybox . bindings . socket_address_object as socket_address_binding <EOL> from cybox . objects . address_object import Address <EOL> from cybox . objects . port_object import Port <EOL> from cybox . objects . hostname_object import Hostname <EOL> from cybox . common import ObjectProperties <EOL> class SocketAddress ( ObjectProperties ) : <EOL> _binding = socket_address_binding <EOL> _binding_class = socket_address_binding . SocketAddressObjectType <EOL> _namespace = "<STR_LIT>" <EOL> _XSI_NS = "<STR_LIT>" <EOL> _XSI_TYPE = "<STR_LIT>" <EOL> ip_address = fields . TypedField ( "<STR_LIT>" , Address ) <EOL> hostname = fields . TypedField ( "<STR_LIT>" , Hostname ) <EOL> port = fields . TypedField ( "<STR_LIT>" , Port ) </s>
<s> from mixbox import entities <EOL> from mixbox import fields <EOL> import cybox . bindings . win_system_object as win_system_binding <EOL> from cybox . objects . system_object import System <EOL> from cybox . objects . win_handle_object import WinHandleList <EOL> from cybox . common import String , HexBinary <EOL> class GlobalFlag ( entities . Entity ) : <EOL> _binding = win_system_binding <EOL> _binding_class = win_system_binding . GlobalFlagType <EOL> _namespace = "<STR_LIT>" <EOL> abbreviation = fields . TypedField ( "<STR_LIT>" , String ) <EOL> destination = fields . TypedField ( "<STR_LIT>" , String ) <EOL> hexadecimal_value = fields . TypedField ( "<STR_LIT>" , HexBinary ) <EOL> symbolic_name = fields . TypedField ( "<STR_LIT>" , String ) <EOL> class GlobalFlagList ( entities . EntityList ) : <EOL> _binding = win_system_binding <EOL> _binding_class = win_system_binding . GlobalFlagListType <EOL> _binding_var = "<STR_LIT>" <EOL> _contained_type = GlobalFlag <EOL> _namespace = "<STR_LIT>" <EOL> class WinSystem ( System ) : <EOL> _binding = win_system_binding <EOL> _binding_class = win_system_binding . WindowsSystemObjectType <EOL> _namespace = "<STR_LIT>" <EOL> _XSI_NS = "<STR_LIT>" <EOL> _XSI_TYPE = "<STR_LIT>" <EOL> domain = fields . TypedField ( "<STR_LIT>" , String , multiple = True ) <EOL> global_flag_list = fields . TypedField ( "<STR_LIT>" , GlobalFlagList ) <EOL> netbios_name = fields . TypedField ( "<STR_LIT>" , String ) <EOL> open_handle_list = fields . TypedField ( "<STR_LIT>" , WinHandleList ) <EOL> product_id = fields . TypedField ( "<STR_LIT>" , String ) <EOL> product_name = fields . TypedField ( "<STR_LIT>" , String ) <EOL> registered_organization = fields . TypedField ( "<STR_LIT>" , String ) <EOL> registered_owner = fields . TypedField ( "<STR_LIT>" , String ) <EOL> windows_directory = fields . TypedField ( "<STR_LIT>" , String ) <EOL> windows_system_directory = fields . TypedField ( "<STR_LIT>" , String ) <EOL> windows_temp_directory = fields . TypedField ( "<STR_LIT>" , String ) </s>
<s> import unittest <EOL> from mixbox . vendor . six import u <EOL> from cybox . core import Frequency <EOL> from cybox . test import EntityTestCase <EOL> class TestFrequency ( EntityTestCase , unittest . TestCase ) : <EOL> klass = Frequency <EOL> _full_dict = { <EOL> '<STR_LIT>' : <NUM_LIT> , <EOL> '<STR_LIT>' : u ( "<STR_LIT>" ) , <EOL> '<STR_LIT>' : "<STR_LIT>" , <EOL> '<STR_LIT>' : "<STR_LIT>" , <EOL> } <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> unittest . main ( ) </s>
<s> import unittest <EOL> from mixbox . vendor . six import u <EOL> from cybox . core import Observables <EOL> from cybox . objects . link_object import Link <EOL> from cybox . objects . uri_object import URI <EOL> from cybox . test . objects import ObjectTestCase <EOL> class TestLink ( ObjectTestCase , unittest . TestCase ) : <EOL> object_type = "<STR_LIT>" <EOL> klass = Link <EOL> _full_dict = { <EOL> '<STR_LIT:value>' : u ( "<STR_LIT>" ) , <EOL> '<STR_LIT:type>' : URI . TYPE_URL , <EOL> '<STR_LIT>' : u ( "<STR_LIT>" ) , <EOL> '<STR_LIT>' : object_type , <EOL> } <EOL> def test_correct_namespace_output ( self ) : <EOL> link = Link ( ) <EOL> link . value = u ( "<STR_LIT>" ) <EOL> xml = Observables ( link ) . to_xml ( ) <EOL> self . assertTrue ( b"<STR_LIT>" in xml ) <EOL> self . assertTrue ( b"<STR_LIT>" not in xml ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> unittest . main ( ) </s>
<s> import unittest <EOL> from cybox . objects . win_kernel_hook_object import WinKernelHook <EOL> from cybox . test . objects import ObjectTestCase <EOL> class TestWinKernelHook ( ObjectTestCase , unittest . TestCase ) : <EOL> object_type = "<STR_LIT>" <EOL> klass = WinKernelHook <EOL> _full_dict = { <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : True , <EOL> '<STR_LIT>' : False , <EOL> '<STR_LIT>' : "<STR_LIT>" , <EOL> } , <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : True , <EOL> '<STR_LIT>' : "<STR_LIT>" , <EOL> } , <EOL> '<STR_LIT>' : <NUM_LIT> , <EOL> '<STR_LIT>' : "<STR_LIT>" , <EOL> '<STR_LIT>' : "<STR_LIT>" , <EOL> '<STR_LIT>' : "<STR_LIT>" , <EOL> '<STR_LIT>' : "<STR_LIT>" , <EOL> '<STR_LIT:type>' : "<STR_LIT>" , <EOL> '<STR_LIT>' : object_type , <EOL> } <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> unittest . main ( ) </s>
<s> """<STR_LIT>""" <EOL> from cybox . core import Observables <EOL> from cybox . objects . address_object import Address <EOL> from cybox . objects . email_message_object import EmailMessage <EOL> def main ( ) : <EOL> m = EmailMessage ( ) <EOL> m . to = [ "<STR_LIT>" , "<STR_LIT>" ] <EOL> m . from_ = "<STR_LIT>" <EOL> m . subject = "<STR_LIT>" <EOL> a = Address ( "<STR_LIT>" , Address . CAT_IPV4 ) <EOL> m . add_related ( a , "<STR_LIT>" , inline = False ) <EOL> print ( Observables ( [ m , a ] ) . to_xml ( ) ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> main ( ) </s>
<s> import os <EOL> import sys <EOL> import argparse <EOL> import theano . tensor as T <EOL> homepath = os . path . join ( '<STR_LIT:..>' , '<STR_LIT:..>' ) <EOL> if not homepath in sys . path : <EOL> sys . path . insert ( <NUM_LIT:0> , homepath ) <EOL> from dlearn . models . layer import FullConnLayer , ConvPoolLayer <EOL> from dlearn . models . nnet import NeuralNet <EOL> from dlearn . utils import actfuncs , costfuncs <EOL> from dlearn . utils . serialize import load_data , save_data <EOL> from dlearn . optimization import sgd <EOL> dataset_txt = """<STR_LIT>""" <EOL> output_txt = """<STR_LIT>""" <EOL> parser = argparse . ArgumentParser ( description = '<STR_LIT>' ) <EOL> parser . add_argument ( '<STR_LIT>' , '<STR_LIT>' , nargs = <NUM_LIT:1> , required = True , <EOL> metavar = '<STR_LIT:name>' , help = dataset_txt ) <EOL> parser . add_argument ( '<STR_LIT>' , '<STR_LIT>' , nargs = '<STR_LIT:?>' , default = None , <EOL> metavar = '<STR_LIT:name>' , help = output_txt ) <EOL> args = parser . parse_args ( ) <EOL> def train_model ( dataset ) : <EOL> X = T . tensor4 ( ) <EOL> A = T . matrix ( ) <EOL> layers = [ ] <EOL> layers . append ( ConvPoolLayer ( <EOL> input = X , <EOL> input_shape = ( <NUM_LIT:3> , <NUM_LIT> , <NUM_LIT> ) , <EOL> filter_shape = ( <NUM_LIT:32> , <NUM_LIT:3> , <NUM_LIT:5> , <NUM_LIT:5> ) , <EOL> pool_shape = ( <NUM_LIT:2> , <NUM_LIT:2> ) , <EOL> active_func = actfuncs . tanh , <EOL> flatten = False , <EOL> b = <NUM_LIT:0.0> <EOL> ) ) <EOL> layers . append ( ConvPoolLayer ( <EOL> input = layers [ - <NUM_LIT:1> ] . output , <EOL> input_shape = layers [ - <NUM_LIT:1> ] . output_shape , <EOL> filter_shape = ( <NUM_LIT:64> , <NUM_LIT:32> , <NUM_LIT:5> , <NUM_LIT:5> ) , <EOL> pool_shape = ( <NUM_LIT:2> , <NUM_LIT:2> ) , <EOL> active_func = actfuncs . tanh , <EOL> flatten = False , <EOL> b = <NUM_LIT:0.0> <EOL> ) ) <EOL> layers . append ( ConvPoolLayer ( <EOL> input = layers [ - <NUM_LIT:1> ] . output , <EOL> input_shape = layers [ - <NUM_LIT:1> ] . output_shape , <EOL> filter_shape = ( <NUM_LIT> , <NUM_LIT:64> , <NUM_LIT:3> , <NUM_LIT:3> ) , <EOL> pool_shape = ( <NUM_LIT:2> , <NUM_LIT:2> ) , <EOL> active_func = actfuncs . tanh , <EOL> flatten = True , <EOL> b = <NUM_LIT:0.0> <EOL> ) ) <EOL> layers . append ( FullConnLayer ( <EOL> input = layers [ - <NUM_LIT:1> ] . output , <EOL> input_shape = layers [ - <NUM_LIT:1> ] . output_shape , <EOL> output_shape = <NUM_LIT> , <EOL> dropout_ratio = <NUM_LIT:0.1> , <EOL> active_func = actfuncs . tanh <EOL> ) ) <EOL> layers . append ( FullConnLayer ( <EOL> input = layers [ - <NUM_LIT:1> ] . output , <EOL> input_shape = layers [ - <NUM_LIT:1> ] . output_shape , <EOL> output_shape = <NUM_LIT:11> , <EOL> dropout_input = layers [ - <NUM_LIT:1> ] . dropout_output , <EOL> active_func = actfuncs . sigmoid <EOL> ) ) <EOL> model = NeuralNet ( layers , X , layers [ - <NUM_LIT:1> ] . output ) <EOL> model . target = A <EOL> model . cost = costfuncs . binxent ( layers [ - <NUM_LIT:1> ] . dropout_output , A ) + <NUM_LIT> * model . get_norm ( <NUM_LIT:2> ) <EOL> model . error = costfuncs . binerr ( layers [ - <NUM_LIT:1> ] . output , A ) <EOL> sgd . train ( model , dataset , lr = <NUM_LIT> , momentum = <NUM_LIT> , <EOL> batch_size = <NUM_LIT:100> , n_epochs = <NUM_LIT> , <EOL> epoch_waiting = <NUM_LIT:10> ) <EOL> return model <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> dataset_file = '<STR_LIT>' . format ( args . dataset [ <NUM_LIT:0> ] ) <EOL> out_file = '<STR_LIT>' if args . output is None else '<STR_LIT>' . format ( args . output ) <EOL> dataset = load_data ( dataset_file ) <EOL> model = train_model ( dataset ) <EOL> save_data ( model , out_file ) </s>
<s> n_maps = [ <EOL> "<STR_LIT>" . format ( chr ( <NUM_LIT> ) ) , <EOL> "<STR_LIT>" . format ( chr ( <NUM_LIT> ) ) <EOL> ] <EOL> def source ( V ) : <EOL> for mapping in n_maps : <EOL> V . nvim_instance . command ( mapping ) </s>
<s> from sneakers . modules import Channel <EOL> from twython import Twython , TwythonError <EOL> import time <EOL> class Twitter ( Channel ) : <EOL> description = """<STR_LIT>""" <EOL> requiredParams = { <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT:key>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT:name>' : '<STR_LIT>' <EOL> } , <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT:key>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT:name>' : '<STR_LIT>' <EOL> } <EOL> } <EOL> max_length = <NUM_LIT> <EOL> max_hourly = <NUM_LIT:100> <EOL> def send ( self , data ) : <EOL> send_params = self . params [ '<STR_LIT>' ] <EOL> APP_KEY = send_params [ '<STR_LIT:key>' ] <EOL> APP_SECRET = send_params [ '<STR_LIT>' ] <EOL> OAUTH_TOKEN = send_params [ '<STR_LIT>' ] <EOL> OAUTH_TOKEN_SECRET = send_params [ '<STR_LIT>' ] <EOL> twitter = Twython ( APP_KEY , APP_SECRET , OAUTH_TOKEN , OAUTH_TOKEN_SECRET ) <EOL> twitter . update_status ( status = data ) <EOL> return <EOL> def receive ( self ) : <EOL> rec_params = self . params [ '<STR_LIT>' ] <EOL> APP_KEY = rec_params [ '<STR_LIT:key>' ] <EOL> APP_SECRET = rec_params [ '<STR_LIT>' ] <EOL> OAUTH_TOKEN = rec_params [ '<STR_LIT>' ] <EOL> OAUTH_TOKEN_SECRET = rec_params [ '<STR_LIT>' ] <EOL> SCREEN_NAME = rec_params [ '<STR_LIT:name>' ] <EOL> twitter = Twython ( APP_KEY , APP_SECRET , OAUTH_TOKEN , OAUTH_TOKEN_SECRET ) <EOL> user_timeline = twitter . get_user_timeline ( screen_name = SCREEN_NAME ) <EOL> tweets = [ ] <EOL> for x in user_timeline : <EOL> if '<STR_LIT:text>' in x : <EOL> tweets . append ( x [ '<STR_LIT:text>' ] ) <EOL> return tweets </s>
<s> from __future__ import print_function , division , absolute_import <EOL> import unittest <EOL> import os <EOL> import tempfile <EOL> from . . db import Database <EOL> class DbTests ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . _db = os . path . join ( tempfile . gettempdir ( ) , '<STR_LIT>' ) <EOL> self . _conn = Database ( db = self . _db ) <EOL> def tearDown ( self ) : <EOL> self . _conn . close <EOL> os . remove ( self . _db ) <EOL> def test_db ( self ) : <EOL> self . assertGreaterEqual ( self . _conn . insert_package ( '<STR_LIT>' ) , <NUM_LIT:1> ) <EOL> row = self . _conn . query_package ( '<STR_LIT>' ) <EOL> self . assertEqual ( row . id , <NUM_LIT:1> ) <EOL> self . assertGreaterEqual ( self . _conn . insert_name ( '<STR_LIT>' , row . id ) , <NUM_LIT:1> ) <EOL> row = self . _conn . query_all ( '<STR_LIT>' ) <EOL> self . assertDictEqual ( dict ( row [ <NUM_LIT:0> ] ) , <EOL> { '<STR_LIT:name>' : '<STR_LIT>' , '<STR_LIT>' : '<STR_LIT>' } ) <EOL> rows = self . _conn . query_package ( None ) <EOL> self . assertListEqual ( rows , [ '<STR_LIT>' ] ) </s>
<s> import unittest , os <EOL> from dash_test_util import * <EOL> from dashlivesim . dashlib import configprocessor <EOL> class TestConfigProcessor ( unittest . TestCase ) : <EOL> def testReadVodConfigFile ( self ) : <EOL> cfg_file = os . path . join ( VOD_CONFIG_DIR , '<STR_LIT>' ) <EOL> ifh = open ( cfg_file , "<STR_LIT:rb>" ) <EOL> vod_cfg = configprocessor . VodConfig ( ) <EOL> vod_cfg . read_config ( cfg_file ) </s>
<s> from __future__ import absolute_import <EOL> from . import compat <EOL> class ModelObjectLocalizationContext ( object ) : <EOL> def __init__ ( self , translation , context , object_type , object_name ) : <EOL> self . translation = translation <EOL> self . object_type = object_type <EOL> self . object_name = object_name <EOL> self . context = context <EOL> def get ( self , key , default = None ) : <EOL> try : <EOL> return self . translation [ key ] <EOL> except KeyError : <EOL> return self . context . get ( self . object_type , self . object_name , key , <EOL> default ) <EOL> def object_localization ( self , object_type , name ) : <EOL> try : <EOL> objects = self . translation [ object_type ] <EOL> except KeyError : <EOL> objects = self . context . translation . get ( object_type , { } ) <EOL> try : <EOL> trans = objects [ name ] <EOL> except KeyError : <EOL> return ModelObjectLocalizationContext ( { } , self . context , <EOL> object_type , name ) <EOL> if isinstance ( trans , compat . string_type ) : <EOL> trans = { "<STR_LIT:label>" : trans } <EOL> return ModelObjectLocalizationContext ( trans , self . context , <EOL> object_type , name ) <EOL> class LocalizationContext ( object ) : <EOL> def __init__ ( self , translation , parent = None ) : <EOL> self . translation = translation <EOL> self . parent = parent <EOL> def object_localization ( self , object_type , name ) : <EOL> try : <EOL> objects = self . translation [ object_type ] <EOL> except KeyError : <EOL> return ModelObjectLocalizationContext ( { } , self , object_type , name ) <EOL> try : <EOL> trans = objects [ name ] <EOL> except KeyError : <EOL> return ModelObjectLocalizationContext ( { } , self , object_type , name ) <EOL> if isinstance ( trans , compat . string_type ) : <EOL> trans = { "<STR_LIT:label>" : trans } <EOL> return ModelObjectLocalizationContext ( trans , self , object_type , name ) <EOL> def get ( self , object_type , object_name , key , default = None ) : <EOL> try : <EOL> objects = self . translation [ object_type ] <EOL> except KeyError : <EOL> return default <EOL> try : <EOL> trans = objects [ object_name ] <EOL> except KeyError : <EOL> return default <EOL> if isinstance ( trans , compat . string_type ) : <EOL> if key == "<STR_LIT:label>" : <EOL> return trans <EOL> else : <EOL> return default <EOL> return trans . get ( key , default ) <EOL> def _lookup_ns_translation ( self , context_type , name ) : <EOL> """<STR_LIT>""" <EOL> lookup = ns . translation_lookup ( lang ) <EOL> for trans in lookup : <EOL> if context_type in trans and name in trans [ context_type ] : <EOL> return trans [ context_type ] [ name ] <EOL> if self . parent : <EOL> return self . parent . translation ( contxet_type , name ) <EOL> else : <EOL> return { } <EOL> def _get_translation ( self , obj , type_ ) : <EOL> """<STR_LIT>""" <EOL> lookup = [ ] <EOL> visited = set ( ) <EOL> ns = self . namespace <EOL> while ns and ns not in visited : <EOL> if self . lang in ns . translations : <EOL> lookup . append ( ns . translation [ lang ] ) <EOL> visited . add ( ns ) <EOL> ns = ns . parent <EOL> lookup_map = { <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" <EOL> } <EOL> objkey = lookup_map [ type_ ] <EOL> for trans in lookup : <EOL> if objkey in trans and obj in trans [ objkey ] : <EOL> return trans [ objkey ] [ obj ] <EOL> return None </s>
<s> import unittest <EOL> from cubes import * <EOL> from . common import CubesTestCaseBase <EOL> from json import dumps <EOL> def printable ( obj ) : <EOL> return dumps ( obj , indent = <NUM_LIT:4> ) <EOL> class AuthTestCase ( CubesTestCaseBase ) : <EOL> def setUp ( self ) : <EOL> self . sales_cube = Cube ( "<STR_LIT>" ) <EOL> self . churn_cube = Cube ( "<STR_LIT>" ) <EOL> def test_empty ( self ) : <EOL> self . auth = SimpleAuthorizer ( ) <EOL> self . assertEqual ( [ ] , self . auth . authorize ( "<STR_LIT>" , [ self . sales_cube ] ) ) <EOL> def test_authorize ( self ) : <EOL> rights = { <EOL> "<STR_LIT>" : { "<STR_LIT>" : [ "<STR_LIT>" ] } <EOL> } <EOL> self . auth = SimpleAuthorizer ( rights = rights ) <EOL> self . assertEqual ( [ self . sales_cube ] , <EOL> self . auth . authorize ( "<STR_LIT>" , [ self . sales_cube ] ) ) <EOL> self . assertEqual ( [ ] , self . auth . authorize ( "<STR_LIT>" , [ self . churn_cube ] ) ) <EOL> def test_deny ( self ) : <EOL> rights = { <EOL> "<STR_LIT>" : { "<STR_LIT>" : [ "<STR_LIT>" ] } <EOL> } <EOL> self . auth = SimpleAuthorizer ( rights = rights ) <EOL> self . assertEqual ( [ self . churn_cube ] , self . auth . authorize ( "<STR_LIT>" , [ self . churn_cube ] ) ) <EOL> self . assertEqual ( [ ] , <EOL> self . auth . authorize ( "<STR_LIT>" , [ self . sales_cube ] ) ) <EOL> self . assertEqual ( [ ] , self . auth . authorize ( "<STR_LIT>" , [ self . churn_cube ] ) ) <EOL> def test_allow ( self ) : <EOL> rights = { <EOL> "<STR_LIT>" : { "<STR_LIT>" : [ "<STR_LIT>" ] } , <EOL> "<STR_LIT>" : { } <EOL> } <EOL> self . auth = SimpleAuthorizer ( rights = rights ) <EOL> self . assertEqual ( [ self . churn_cube ] , <EOL> self . auth . authorize ( "<STR_LIT>" , [ self . churn_cube ] ) ) <EOL> def test_order ( self ) : <EOL> rights = { <EOL> "<STR_LIT>" : { <EOL> "<STR_LIT>" : [ "<STR_LIT>" ] , <EOL> "<STR_LIT>" : [ "<STR_LIT>" ] <EOL> } , <EOL> "<STR_LIT>" : { <EOL> "<STR_LIT>" : [ "<STR_LIT>" ] , <EOL> "<STR_LIT>" : [ "<STR_LIT:*>" ] <EOL> } , <EOL> "<STR_LIT>" : { <EOL> "<STR_LIT>" : [ "<STR_LIT:*>" ] , <EOL> "<STR_LIT>" : [ "<STR_LIT>" ] <EOL> } , <EOL> "<STR_LIT>" : { <EOL> "<STR_LIT>" : [ "<STR_LIT:*>" ] , <EOL> "<STR_LIT>" : [ "<STR_LIT:*>" ] <EOL> } , <EOL> } <EOL> self . auth = SimpleAuthorizer ( rights = rights ) <EOL> self . assertEqual ( [ self . sales_cube ] , <EOL> self . auth . authorize ( "<STR_LIT>" , [ self . sales_cube ] ) ) <EOL> self . assertEqual ( [ self . sales_cube ] , <EOL> self . auth . authorize ( "<STR_LIT>" , [ self . sales_cube ] ) ) <EOL> self . assertEqual ( [ self . sales_cube ] , <EOL> self . auth . authorize ( "<STR_LIT>" , [ self . sales_cube ] ) ) <EOL> self . assertEqual ( [ self . sales_cube ] , <EOL> self . auth . authorize ( "<STR_LIT>" , [ self . sales_cube ] ) ) <EOL> self . auth = SimpleAuthorizer ( rights = rights , order = "<STR_LIT>" ) <EOL> self . assertEqual ( [ ] , <EOL> self . auth . authorize ( "<STR_LIT>" , [ self . sales_cube ] ) ) <EOL> self . assertEqual ( [ ] , <EOL> self . auth . authorize ( "<STR_LIT>" , [ self . sales_cube ] ) ) <EOL> self . assertEqual ( [ ] , <EOL> self . auth . authorize ( "<STR_LIT>" , [ self . sales_cube ] ) ) <EOL> self . assertEqual ( [ ] , <EOL> self . auth . authorize ( "<STR_LIT>" , [ self . sales_cube ] ) ) <EOL> def test_role ( self ) : <EOL> roles = { <EOL> "<STR_LIT>" : { "<STR_LIT>" : [ "<STR_LIT>" ] } <EOL> } <EOL> rights = { <EOL> "<STR_LIT>" : { "<STR_LIT>" : [ "<STR_LIT>" ] } <EOL> } <EOL> self . auth = SimpleAuthorizer ( rights = rights , roles = roles ) <EOL> self . assertEqual ( [ self . sales_cube ] , <EOL> self . auth . authorize ( "<STR_LIT>" , [ self . sales_cube ] ) ) <EOL> def test_role_inheritance ( self ) : <EOL> roles = { <EOL> "<STR_LIT>" : { "<STR_LIT>" : [ "<STR_LIT>" ] } , <EOL> "<STR_LIT>" : { "<STR_LIT>" : [ "<STR_LIT>" ] } <EOL> } <EOL> rights = { <EOL> "<STR_LIT>" : { "<STR_LIT>" : [ "<STR_LIT>" ] } <EOL> } <EOL> self . auth = SimpleAuthorizer ( rights = rights , roles = roles ) <EOL> self . assertEqual ( [ self . sales_cube ] , <EOL> self . auth . authorize ( "<STR_LIT>" , [ self . sales_cube ] ) ) </s>
<s> import setuptools <EOL> install_requires = [ <EOL> "<STR_LIT>" , <EOL> ] <EOL> setuptools . setup ( <EOL> name = '<STR_LIT>' , <EOL> version = '<STR_LIT>' , <EOL> license = '<STR_LIT>' , <EOL> description = """<STR_LIT>""" , <EOL> author = "<STR_LIT>" , <EOL> author_email = "<STR_LIT>" , <EOL> url = '<STR_LIT>' , <EOL> platforms = '<STR_LIT>' , <EOL> packages = [ '<STR_LIT>' ] , <EOL> zip_safe = True , <EOL> verbose = False , <EOL> install_requires = install_requires , <EOL> entry_points = { <EOL> '<STR_LIT>' : [ <EOL> '<STR_LIT>' <EOL> ] <EOL> } , <EOL> ) </s>
<s> import simplejson as json <EOL> from datadog import api <EOL> from datadog . dogshell . common import report_errors , report_warnings <EOL> class SearchClient ( object ) : <EOL> @ classmethod <EOL> def setup_parser ( cls , subparsers ) : <EOL> parser = subparsers . add_parser ( '<STR_LIT>' , help = "<STR_LIT>" ) <EOL> verb_parsers = parser . add_subparsers ( title = '<STR_LIT>' , dest = '<STR_LIT>' ) <EOL> verb_parsers . required = True <EOL> query_parser = verb_parsers . add_parser ( '<STR_LIT>' , help = "<STR_LIT>" ) <EOL> query_parser . add_argument ( '<STR_LIT>' , help = "<STR_LIT>" ) <EOL> query_parser . set_defaults ( func = cls . _query ) <EOL> @ classmethod <EOL> def _query ( cls , args ) : <EOL> api . _timeout = args . timeout <EOL> res = api . Infrastructure . search ( q = args . query ) <EOL> report_warnings ( res ) <EOL> report_errors ( res ) <EOL> if format == '<STR_LIT>' : <EOL> for facet , results in list ( res [ '<STR_LIT>' ] . items ( ) ) : <EOL> for idx , result in enumerate ( results ) : <EOL> if idx == <NUM_LIT:0> : <EOL> print ( '<STR_LIT:\n>' ) <EOL> print ( "<STR_LIT>" % ( facet , result ) ) <EOL> else : <EOL> print ( "<STR_LIT>" % ( '<STR_LIT:U+0020>' * len ( facet ) , result ) ) <EOL> elif format == '<STR_LIT>' : <EOL> print ( json . dumps ( res ) ) <EOL> else : <EOL> for facet , results in list ( res [ '<STR_LIT>' ] . items ( ) ) : <EOL> for result in results : <EOL> print ( "<STR_LIT>" % ( facet , result ) ) </s>
<s> import os <EOL> from contextlib import contextmanager <EOL> @ contextmanager <EOL> def preserve_environment_variable ( env_name ) : <EOL> environ_api_param = os . environ . get ( env_name ) <EOL> try : <EOL> yield <EOL> finally : <EOL> if environ_api_param is not None : <EOL> os . environ [ env_name ] = environ_api_param <EOL> else : <EOL> del os . environ [ env_name ] </s>
<s> """<STR_LIT>""" <EOL> from collections import defaultdict <EOL> import random <EOL> import time <EOL> class Metric ( object ) : <EOL> """<STR_LIT>""" <EOL> def add_point ( self , value ) : <EOL> """<STR_LIT>""" <EOL> raise NotImplementedError ( ) <EOL> def flush ( self , timestamp ) : <EOL> """<STR_LIT>""" <EOL> raise NotImplementedError ( ) <EOL> class Gauge ( Metric ) : <EOL> """<STR_LIT>""" <EOL> stats_tag = '<STR_LIT:g>' <EOL> def __init__ ( self , name , tags , host ) : <EOL> self . name = name <EOL> self . tags = tags <EOL> self . host = host <EOL> self . value = None <EOL> def add_point ( self , value ) : <EOL> self . value = value <EOL> def flush ( self , timestamp ) : <EOL> return [ ( timestamp , self . value , self . name , self . tags , self . host ) ] <EOL> class Counter ( Metric ) : <EOL> """<STR_LIT>""" <EOL> stats_tag = '<STR_LIT:c>' <EOL> def __init__ ( self , name , tags , host ) : <EOL> self . name = name <EOL> self . tags = tags <EOL> self . host = host <EOL> self . count = <NUM_LIT:0> <EOL> def add_point ( self , value ) : <EOL> self . count += value <EOL> def flush ( self , timestamp ) : <EOL> return [ ( timestamp , self . count , self . name , self . tags , self . host ) ] <EOL> class Histogram ( Metric ) : <EOL> """<STR_LIT>""" <EOL> stats_tag = '<STR_LIT:h>' <EOL> def __init__ ( self , name , tags , host ) : <EOL> self . name = name <EOL> self . tags = tags <EOL> self . host = host <EOL> self . max = float ( "<STR_LIT>" ) <EOL> self . min = float ( "<STR_LIT>" ) <EOL> self . sum = <NUM_LIT:0> <EOL> self . count = <NUM_LIT:0> <EOL> self . sample_size = <NUM_LIT:1000> <EOL> self . samples = [ ] <EOL> self . percentiles = [ <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ] <EOL> def add_point ( self , value ) : <EOL> self . max = self . max if self . max > value else value <EOL> self . min = self . min if self . min < value else value <EOL> self . sum += value <EOL> if self . count < self . sample_size : <EOL> self . samples . append ( value ) <EOL> else : <EOL> self . samples [ random . randrange ( <NUM_LIT:0> , self . sample_size ) ] = value <EOL> self . count += <NUM_LIT:1> <EOL> def flush ( self , timestamp ) : <EOL> if not self . count : <EOL> return [ ] <EOL> metrics = [ <EOL> ( timestamp , self . min , '<STR_LIT>' % self . name , self . tags , self . host ) , <EOL> ( timestamp , self . max , '<STR_LIT>' % self . name , self . tags , self . host ) , <EOL> ( timestamp , self . count , '<STR_LIT>' % self . name , self . tags , self . host ) , <EOL> ( timestamp , self . average ( ) , '<STR_LIT>' % self . name , self . tags , self . host ) <EOL> ] <EOL> length = len ( self . samples ) <EOL> self . samples . sort ( ) <EOL> for p in self . percentiles : <EOL> val = self . samples [ int ( round ( p * length - <NUM_LIT:1> ) ) ] <EOL> name = '<STR_LIT>' % ( self . name , int ( p * <NUM_LIT:100> ) ) <EOL> metrics . append ( ( timestamp , val , name , self . tags , self . host ) ) <EOL> return metrics <EOL> def average ( self ) : <EOL> return float ( self . sum ) / self . count <EOL> class MetricsAggregator ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , roll_up_interval = <NUM_LIT:10> ) : <EOL> self . _metrics = defaultdict ( lambda : { } ) <EOL> self . _roll_up_interval = roll_up_interval <EOL> def add_point ( self , metric , tags , timestamp , value , metric_class , sample_rate = <NUM_LIT:1> , host = None ) : <EOL> interval = timestamp - timestamp % self . _roll_up_interval <EOL> key = ( metric , host , tuple ( sorted ( tags ) ) if tags else tags ) <EOL> if key not in self . _metrics [ interval ] : <EOL> self . _metrics [ interval ] [ key ] = metric_class ( metric , tags , host ) <EOL> self . _metrics [ interval ] [ key ] . add_point ( value ) <EOL> def flush ( self , timestamp ) : <EOL> """<STR_LIT>""" <EOL> interval = timestamp - timestamp % self . _roll_up_interval <EOL> past_intervals = [ i for i in self . _metrics if i < interval ] <EOL> metrics = [ ] <EOL> for i in past_intervals : <EOL> for m in list ( self . _metrics . pop ( i ) . values ( ) ) : <EOL> metrics += m . flush ( i ) <EOL> return metrics </s>
<s> from itertools import chain <EOL> import os . path <EOL> import sys <EOL> from glad . lang . common . generator import Generator <EOL> from glad . lang . common . util import makefiledir <EOL> if sys . version_info >= ( <NUM_LIT:3> , <NUM_LIT:0> ) : <EOL> from io import StringIO <EOL> basestring = str <EOL> else : <EOL> from StringIO import StringIO <EOL> def _gl_types ( gen , f ) : <EOL> f . write ( '''<STR_LIT>''' ) <EOL> NIMTYPES = { <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : _gl_types <EOL> } , <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:bool>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' <EOL> } , <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:bool>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> } , <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' <EOL> } , <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' <EOL> } , <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : [ <EOL> ( '<STR_LIT>' , '<STR_LIT:0>' , None ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , '<STR_LIT:0>' , None ) , <EOL> ( '<STR_LIT>' , '<STR_LIT:0>' , None ) , <EOL> ( '<STR_LIT>' , '<STR_LIT:0>' , None ) , <EOL> ( '<STR_LIT>' , '<STR_LIT:1>' , None ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , '<STR_LIT:1>' , None ) , <EOL> ( '<STR_LIT>' , '<STR_LIT:1>' , None ) , <EOL> ( '<STR_LIT>' , '<STR_LIT:1>' , None ) , <EOL> ( '<STR_LIT>' , '<STR_LIT:1>' , None ) , <EOL> ( '<STR_LIT>' , '<STR_LIT:0>' , None ) , <EOL> ] , <EOL> '<STR_LIT>' : [ <EOL> ] , <EOL> '<STR_LIT>' : [ <EOL> ] , <EOL> '<STR_LIT>' : [ <EOL> ] <EOL> } , <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' <EOL> } , <EOL> '<STR_LIT>' : { } , <EOL> '<STR_LIT>' : { } , <EOL> '<STR_LIT>' : { } <EOL> } , <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : '<STR_LIT>' <EOL> } , <EOL> '<STR_LIT>' : { } , <EOL> '<STR_LIT>' : { } , <EOL> '<STR_LIT>' : { } <EOL> } <EOL> } <EOL> class NimGenerator ( Generator ) : <EOL> NAME = '<STR_LIT>' <EOL> NAME_LONG = '<STR_LIT>' <EOL> MODULE = '<STR_LIT>' <EOL> FILE_EXTENSION = '<STR_LIT>' <EOL> TYPE_DICT = NIMTYPES <EOL> LOAD_GL_PREFIX = '<STR_LIT>' <EOL> EXT_PREFIX = '<STR_LIT>' <EOL> def open ( self ) : <EOL> self . _f_gl = open ( self . make_path ( self . spec . NAME ) , '<STR_LIT:w>' ) <EOL> def close ( self ) : <EOL> self . _f_gl . close ( ) <EOL> def generate_header ( self ) : <EOL> self . _f_gl . write ( '<STR_LIT>' ) <EOL> self . _f_gl . write ( self . header ) <EOL> self . _f_gl . write ( '<STR_LIT>' ) <EOL> self . _f_gl . write ( '<STR_LIT>' ) <EOL> self . _f_gl . write ( '<STR_LIT>' ) <EOL> def generate_loader ( self , features , extensions ) : <EOL> f = self . _f_gl <EOL> rfeatures = features <EOL> if self . spec . NAME in ( '<STR_LIT>' , '<STR_LIT>' ) : <EOL> features = { '<STR_LIT>' : [ ] , '<STR_LIT>' : [ ] } <EOL> self . loader . write ( f ) <EOL> self . loader . write_has_ext ( f , self . get_version ( ) ) <EOL> written = set ( ) <EOL> for api , version in self . api . items ( ) : <EOL> for feature in features [ api ] : <EOL> f . write ( '<STR_LIT>' <EOL> . format ( feature . name ) ) <EOL> if self . spec . NAME == '<STR_LIT>' : <EOL> f . write ( '<STR_LIT>' . format ( self . EXT_PREFIX , <EOL> feature . name ) ) <EOL> for func in feature . functions : <EOL> self . write_func_definition ( f , func ) <EOL> f . write ( '<STR_LIT>' ) <EOL> for ext in extensions [ api ] : <EOL> if len ( list ( ext . functions ) ) == <NUM_LIT:0> or ext . name in written : <EOL> continue <EOL> f . write ( '<STR_LIT>' <EOL> . format ( ext . name ) ) <EOL> if self . spec . NAME == '<STR_LIT>' : <EOL> f . write ( '<STR_LIT>' . format ( self . EXT_PREFIX , <EOL> ext . name ) ) <EOL> for func in ext . functions : <EOL> self . write_func_definition ( f , func ) <EOL> f . write ( '<STR_LIT>' ) <EOL> written . add ( ext . name ) <EOL> f . write ( '<STR_LIT>' . format ( api . upper ( ) ) ) <EOL> if self . spec . NAME == '<STR_LIT>' : <EOL> for ext in extensions [ api ] : <EOL> f . write ( '<STR_LIT>' . format ( self . EXT_PREFIX , <EOL> ext . name ) ) <EOL> f . write ( '<STR_LIT>' ) <EOL> f . write ( '<STR_LIT>' . format ( api . upper ( ) ) ) <EOL> self . loader . write_find_core ( f ) <EOL> if self . spec . NAME == '<STR_LIT>' : <EOL> for feature in features [ api ] : <EOL> f . write ( '<STR_LIT>' <EOL> '<STR_LIT>' . format ( self . EXT_PREFIX , feature . name , <EOL> num = feature . number ) ) <EOL> f . write ( '<STR_LIT>' ) <EOL> loadername = '<STR_LIT>' if self . LOAD_GL_PREFIX else '<STR_LIT>' <EOL> f . write ( '<STR_LIT>' <EOL> . format ( self . LOAD_GL_PREFIX , loadername , api . upper ( ) ) ) <EOL> self . loader . write_begin_load ( f ) <EOL> f . write ( '<STR_LIT>' . format ( api . upper ( ) ) ) <EOL> for feature in features [ api ] : <EOL> f . write ( '<STR_LIT>' . format ( feature . name ) ) <EOL> f . write ( '<STR_LIT>' . format ( api . upper ( ) ) ) <EOL> for ext in extensions [ api ] : <EOL> if len ( list ( ext . functions ) ) == <NUM_LIT:0> : <EOL> continue <EOL> f . write ( '<STR_LIT>' . format ( ext . name ) ) <EOL> self . loader . write_end_load ( f ) <EOL> f . write ( '<STR_LIT:\n>' ) <EOL> def write_func_definition ( self , fobj , func ) : <EOL> func_name = self . map_func_name ( func ) <EOL> fobj . write ( '<STR_LIT>' . format ( func_name ) ) <EOL> self . write_function_declaration ( fobj , func ) <EOL> fobj . write ( '<STR_LIT>' . format ( func_name ) ) <EOL> def map_func_name ( self , func ) : <EOL> name = func . proto . name <EOL> m = self . TYPE_DICT [ '<STR_LIT>' ] [ self . spec . NAME ] <EOL> return m [ name ] if name in m else name <EOL> def generate_types ( self , types ) : <EOL> f = self . _f_gl <EOL> f . write ( '<STR_LIT>' ) <EOL> for ogl , d in sorted ( self . TYPE_DICT [ self . spec . NAME ] . items ( ) ) : <EOL> f . write ( '<STR_LIT>' . format ( ogl , d ) ) <EOL> self . TYPE_DICT [ '<STR_LIT>' ] [ self . spec . NAME ] ( self , f ) <EOL> f . write ( '<STR_LIT:\n>' ) <EOL> def generate_features ( self , features ) : <EOL> self . write_enums ( features ) <EOL> self . write_funcs ( features ) <EOL> def write_enums ( self , features ) : <EOL> f = self . _f_gl <EOL> f . write ( '<STR_LIT>' ) <EOL> for v in sorted ( self . TYPE_DICT [ '<STR_LIT>' ] [ self . spec . NAME ] ) : <EOL> self . write_enum ( f , * v ) <EOL> f . write ( '<STR_LIT:\n>' ) <EOL> written = set ( ) <EOL> for feature in features : <EOL> for enum in feature . enums : <EOL> if enum . group == '<STR_LIT>' : <EOL> written . add ( enum ) <EOL> continue <EOL> if not enum in written : <EOL> self . write_enum ( f , enum . name , enum . value ) <EOL> written . add ( enum ) <EOL> f . write ( '<STR_LIT:\n>' ) <EOL> def write_funcs ( self , features ) : <EOL> f = self . _f_gl <EOL> f . write ( '<STR_LIT>' ) <EOL> if self . spec . NAME == '<STR_LIT>' : <EOL> for feature in features : <EOL> self . write_boolean ( f , feature . name ) <EOL> f . write ( '<STR_LIT:\n>' ) <EOL> if self . spec . NAME in ( '<STR_LIT>' , '<STR_LIT>' ) : <EOL> for feature in features : <EOL> for func in feature . functions : <EOL> self . write_function_def ( f , func ) <EOL> f . write ( '<STR_LIT:\n>' ) <EOL> else : <EOL> self . write_functions ( f , set ( ) , set ( ) , features ) <EOL> f . write ( '<STR_LIT>' ) <EOL> def write_function_def ( self , fobj , func ) : <EOL> fobj . write ( '<STR_LIT>' . format ( func . proto . ret . to_nim ( ) , self . map_func_name ( func ) ) ) <EOL> fobj . write ( '<STR_LIT:U+002CU+0020>' . join ( param . type . to_nim ( ) for param in func . params ) ) <EOL> fobj . write ( '<STR_LIT>' ) <EOL> def generate_extensions ( self , extensions , enums , functions ) : <EOL> f = self . _f_gl <EOL> write = set ( ) <EOL> written = set ( enum . name for enum in enums ) | set ( function . proto . name for function in functions ) <EOL> f . write ( '<STR_LIT>' ) <EOL> for ext in extensions : <EOL> if self . spec . NAME == '<STR_LIT>' and not ext . name in written : <EOL> self . write_boolean ( f , ext . name ) <EOL> for enum in ext . enums : <EOL> if not enum . name in written and not enum . group == '<STR_LIT>' : <EOL> type = ( None if enum . group == '<STR_LIT>' <EOL> else '<STR_LIT>' ) <EOL> self . write_enum ( f , enum . name , enum . value , type ) <EOL> written . add ( enum . name ) <EOL> written . add ( ext . name ) <EOL> f . write ( '<STR_LIT:\n>' ) <EOL> self . write_functions ( f , write , written , extensions ) <EOL> f . write ( '<STR_LIT>' ) <EOL> def write_functions ( self , f , write , written , extensions ) : <EOL> for ext in extensions : <EOL> for func in ext . functions : <EOL> if not func . proto . name in written : <EOL> self . write_function_var ( f , func ) <EOL> write . add ( func ) <EOL> written . add ( func . proto . name ) <EOL> def write_function_var ( self , fobj , func ) : <EOL> fobj . write ( '<STR_LIT>' . format ( self . map_func_name ( func ) ) ) <EOL> self . write_function_declaration ( fobj , func ) <EOL> fobj . write ( '<STR_LIT:\n>' ) <EOL> def write_function_declaration ( self , fobj , func ) : <EOL> fobj . write ( '<STR_LIT>' . format ( self . map_func_name ( func ) ) ) <EOL> fobj . write ( '<STR_LIT:U+002CU+0020>' . join ( '<STR_LIT>' . format ( self . to_nim_param_name ( param . name ) , <EOL> param . type . to_nim ( ) ) <EOL> for param in func . params ) ) <EOL> fobj . write ( '<STR_LIT:)>' ) <EOL> ret = func . proto . ret . to_nim ( ) <EOL> if ( ret != '<STR_LIT>' ) : <EOL> fobj . write ( '<STR_LIT>' . format ( ret ) ) <EOL> fobj . write ( '<STR_LIT>' ) <EOL> NIM_KEYWORDS = [ <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT:end>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT:object>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT:type>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' <EOL> ] <EOL> def to_nim_param_name ( self , name ) : <EOL> return '<STR_LIT>' . format ( name ) if name in self . NIM_KEYWORDS else name <EOL> def make_path ( self , name ) : <EOL> path = os . path . join ( self . path , self . MODULE . split ( '<STR_LIT:.>' ) [ - <NUM_LIT:1> ] , <EOL> name . split ( '<STR_LIT:.>' ) [ - <NUM_LIT:1> ] + self . FILE_EXTENSION ) <EOL> makefiledir ( path ) <EOL> return path <EOL> def write_boolean ( self , fobj , name ) : <EOL> fobj . write ( '<STR_LIT>' . format ( self . EXT_PREFIX , name ) ) <EOL> def write_enum ( self , fobj , name , value , type = '<STR_LIT>' ) : <EOL> fobj . write ( '<STR_LIT>' . format ( self . map_enum_name ( name ) ) ) <EOL> if type : <EOL> fobj . write ( '<STR_LIT>' . format ( type , value ) ) <EOL> else : <EOL> fobj . write ( '<STR_LIT>' . format ( value ) ) <EOL> fobj . write ( '<STR_LIT:\n>' ) <EOL> def map_enum_name ( self , name ) : <EOL> m = self . TYPE_DICT [ '<STR_LIT>' ] [ self . spec . NAME ] <EOL> return m [ name ] if name in m else name <EOL> def get_version ( self ) : <EOL> return self . api [ self . spec . NAME ] </s>
<s> from flask import current_app <EOL> from flask_debugtoolbar . panels import DebugPanel <EOL> from jinja2 import PackageLoader , ChoiceLoader <EOL> import json <EOL> package_loader = PackageLoader ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> def _maybe_patch_jinja_loader ( jinja_env ) : <EOL> """<STR_LIT>""" <EOL> if not isinstance ( jinja_env . loader , ChoiceLoader ) : <EOL> jinja_env . loader = ChoiceLoader ( [ jinja_env . loader , package_loader ] ) <EOL> elif package_loader not in jinja_env . loader . loaders : <EOL> jinja_env . loader . loaders . append ( package_loader ) <EOL> class BanditDebugPanel ( DebugPanel ) : <EOL> name = "<STR_LIT>" <EOL> has_content = True <EOL> def __init__ ( self , * args , ** kwargs ) : <EOL> super ( BanditDebugPanel , self ) . __init__ ( * args , ** kwargs ) <EOL> _maybe_patch_jinja_loader ( self . jinja_env ) <EOL> def nav_title ( self ) : <EOL> return "<STR_LIT>" <EOL> def title ( self ) : <EOL> return "<STR_LIT>" <EOL> def url ( self ) : <EOL> return '<STR_LIT>' <EOL> def process_request ( self , request ) : <EOL> self . raw_cookie = request . cookies . get ( current_app . extensions [ '<STR_LIT>' ] . cookie_name , '<STR_LIT:{}>' ) <EOL> def content ( self ) : <EOL> context = self . context . copy ( ) <EOL> context [ '<STR_LIT>' ] = current_app . extensions [ '<STR_LIT>' ] . cookie_name <EOL> context [ '<STR_LIT>' ] = self . raw_cookie <EOL> context [ '<STR_LIT>' ] = current_app . config . get ( "<STR_LIT>" ) <EOL> context [ '<STR_LIT>' ] = current_app . config . get ( '<STR_LIT>' , tuple ( ) ) <EOL> context [ '<STR_LIT>' ] = current_app . extensions [ '<STR_LIT>' ] . bandits . iteritems ( ) <EOL> return self . render ( '<STR_LIT>' , context ) </s>
<s> import os <EOL> from firewoes . lib . hash import idify <EOL> from firewoes . lib . uniquify import uniquify <EOL> from sqlalchemy . orm . exc import NoResultFound <EOL> from debile . master . utils import emit <EOL> from debile . master . dud import Dud , DudFileException <EOL> from debile . master . filerepo import FileRepo , FilesAlreadyRegistered <EOL> from debile . master . orm import Builder , Job <EOL> def process_dud ( config , session , path ) : <EOL> try : <EOL> dud = Dud ( path ) <EOL> except Exception as e : <EOL> print ( '<STR_LIT>' . format ( <EOL> tag = path , <EOL> exception = type ( e ) , <EOL> args = e . args ) ) <EOL> return <EOL> try : <EOL> dud . validate ( ) <EOL> except Exception as e : <EOL> print ( '<STR_LIT>' . format ( <EOL> tag = path , <EOL> exception = type ( e ) , <EOL> args = e . args ) ) <EOL> return <EOL> try : <EOL> fingerprint = dud . validate_signature ( config [ '<STR_LIT>' ] [ '<STR_LIT>' ] ) <EOL> except DudFileException : <EOL> return reject_dud ( session , dud , "<STR_LIT>" ) <EOL> try : <EOL> builder = session . query ( Builder ) . filter_by ( pgp = fingerprint ) . one ( ) <EOL> except NoResultFound : <EOL> return reject_dud ( session , dud , "<STR_LIT>" ) <EOL> jid = dud . get ( "<STR_LIT>" , None ) <EOL> if jid is None : <EOL> return reject_dud ( session , dud , "<STR_LIT>" ) <EOL> job = session . query ( Job ) . get ( jid ) <EOL> if job is None : <EOL> return reject_dud ( session , dud , "<STR_LIT>" ) <EOL> if dud . get ( "<STR_LIT>" , None ) is None : <EOL> return reject_dud ( session , dud , "<STR_LIT>" ) <EOL> if job . builder != builder : <EOL> return reject_dud ( session , dud , "<STR_LIT>" ) <EOL> accept_dud ( config , session , dud , builder ) <EOL> def reject_dud ( session , dud , tag ) : <EOL> session . rollback ( ) <EOL> print "<STR_LIT>" . format ( <EOL> tag = tag , source = dud [ '<STR_LIT>' ] ) <EOL> emit ( '<STR_LIT>' , '<STR_LIT:result>' , { <EOL> "<STR_LIT>" : tag , <EOL> "<STR_LIT:source>" : dud [ '<STR_LIT>' ] , <EOL> } ) <EOL> for fp in [ dud . get_dud_file ( ) ] + dud . get_files ( ) : <EOL> os . unlink ( fp ) <EOL> def accept_dud ( config , session , dud , builder ) : <EOL> fire = dud . get_firehose ( ) <EOL> failed = True if dud . get ( '<STR_LIT>' , None ) == "<STR_LIT>" else False <EOL> job = session . query ( Job ) . get ( dud [ '<STR_LIT>' ] ) <EOL> fire , _ = idify ( fire ) <EOL> fire = uniquify ( session . bind , fire ) <EOL> result = job . new_result ( fire , failed ) <EOL> session . add ( result ) <EOL> try : <EOL> repo = FileRepo ( ) <EOL> repo . add_dud ( result . path , dud , config [ '<STR_LIT>' ] ) <EOL> except FilesAlreadyRegistered : <EOL> return reject_dud ( session , dud , "<STR_LIT>" ) <EOL> emit ( '<STR_LIT>' , '<STR_LIT:result>' , result . debilize ( ) ) <EOL> for fp in [ dud . get_dud_file ( ) ] + dud . get_files ( ) : <EOL> os . unlink ( fp ) </s>
<s> from debile . slave . wrappers . cppcheck import parse_cppcheck <EOL> from debile . slave . utils import cd <EOL> from debile . utils . commands import run_command <EOL> def cppcheck ( dsc , analysis ) : <EOL> run_command ( [ "<STR_LIT>" , "<STR_LIT>" , dsc , "<STR_LIT:source>" ] ) <EOL> with cd ( '<STR_LIT:source>' ) : <EOL> out , err , ret = run_command ( [ <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT:.>' , '<STR_LIT>' <EOL> ] ) <EOL> xmlbytes = err . encode ( ) <EOL> failed = False <EOL> if err . strip ( ) == '<STR_LIT>' : <EOL> return ( analysis , err , failed , None , None ) <EOL> for issue in parse_cppcheck ( xmlbytes ) : <EOL> analysis . results . append ( issue ) <EOL> if not failed and issue . severity in [ <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT:error>' , '<STR_LIT>' <EOL> ] : <EOL> failed = True <EOL> return ( analysis , err , failed , None , None ) <EOL> def version ( ) : <EOL> out , err , ret = run_command ( [ <EOL> '<STR_LIT>' , '<STR_LIT>' <EOL> ] ) <EOL> if ret != <NUM_LIT:0> : <EOL> raise Exception ( "<STR_LIT>" ) <EOL> name , version = out . split ( "<STR_LIT:U+0020>" ) <EOL> return ( name , version . strip ( ) ) </s>
<s> from debile . master . orm import Group <EOL> from debile . master . utils import init_master <EOL> config = init_master ( ) <EOL> g = Group ( name = "<STR_LIT:foo>" ) <EOL> def test_repo_info ( ) : <EOL> c = config [ '<STR_LIT>' ] <EOL> config [ '<STR_LIT>' ] = { <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> } <EOL> assert g . get_repo_info ( ) == { <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> } <EOL> config [ '<STR_LIT>' ] = c <EOL> def fnord ( group , conf ) : <EOL> return { "<STR_LIT:foo>" : "<STR_LIT:bar>" } <EOL> def test_repo_info ( ) : <EOL> c = config [ '<STR_LIT>' ] <EOL> config [ '<STR_LIT>' ] = { <EOL> "<STR_LIT>" : "<STR_LIT>" % ( __name__ ) <EOL> } <EOL> assert g . get_repo_info ( ) == { "<STR_LIT:foo>" : "<STR_LIT:bar>" } <EOL> config [ '<STR_LIT>' ] = c <EOL> def test_repo_props ( ) : <EOL> config [ '<STR_LIT>' ] <EOL> config [ '<STR_LIT>' ] = { <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> } <EOL> assert g . repo_path == "<STR_LIT>" <EOL> assert g . repo_url == "<STR_LIT>" <EOL> assert g . files_path == "<STR_LIT>" <EOL> assert g . files_url == "<STR_LIT>" <EOL> config [ '<STR_LIT>' ] = c </s>
<s> """<STR_LIT>""" <EOL> import datetime <EOL> from openid . association import Association <EOL> from openid . store . interface import OpenIDStore <EOL> from google . appengine . api import datastore <EOL> class DatastoreStore ( OpenIDStore ) : <EOL> """<STR_LIT>""" <EOL> def storeAssociation ( self , server_url , association ) : <EOL> """<STR_LIT>""" <EOL> entity = datastore . Entity ( '<STR_LIT>' ) <EOL> entity [ '<STR_LIT:url>' ] = server_url <EOL> entity [ '<STR_LIT>' ] = association . handle <EOL> entity [ '<STR_LIT>' ] = association . serialize ( ) <EOL> datastore . Put ( entity ) <EOL> def getAssociation ( self , server_url , handle = None ) : <EOL> """<STR_LIT>""" <EOL> query = datastore . Query ( '<STR_LIT>' , { '<STR_LIT>' : server_url } ) <EOL> if handle : <EOL> query [ '<STR_LIT>' ] = handle <EOL> results = query . Get ( <NUM_LIT:1> ) <EOL> if results : <EOL> association = Association . deserialize ( results [ <NUM_LIT:0> ] [ '<STR_LIT>' ] ) <EOL> if association . getExpiresIn ( ) > <NUM_LIT:0> : <EOL> return association <EOL> return None <EOL> def removeAssociation ( self , server_url , handle ) : <EOL> """<STR_LIT>""" <EOL> query = datastore . Query ( '<STR_LIT>' , <EOL> { '<STR_LIT>' : server_url , '<STR_LIT>' : handle } ) <EOL> results = query . Get ( <NUM_LIT:1> ) <EOL> if results : <EOL> datastore . Delete ( results [ <NUM_LIT:0> ] . key ( ) ) <EOL> def storeNonce ( self , nonce ) : <EOL> """<STR_LIT>""" <EOL> entity = datastore . Entity ( '<STR_LIT>' ) <EOL> entity [ '<STR_LIT>' ] = nonce <EOL> entity [ '<STR_LIT>' ] = datetime . datetime . now ( ) <EOL> datastore . Put ( entity ) <EOL> def useNonce ( self , nonce ) : <EOL> """<STR_LIT>""" <EOL> query = datastore . Query ( '<STR_LIT>' ) <EOL> query [ '<STR_LIT>' ] = nonce <EOL> query [ '<STR_LIT>' ] = ( datetime . datetime . now ( ) - <EOL> datetime . timedelta ( hours = <NUM_LIT:6> ) ) <EOL> results = query . Get ( <NUM_LIT:1> ) <EOL> if results : <EOL> datastore . Delete ( results [ <NUM_LIT:0> ] . key ( ) ) <EOL> return True <EOL> else : <EOL> return False <EOL> def getAuthKey ( self ) : <EOL> """<STR_LIT>""" <EOL> auth_key = '<STR_LIT>' <EOL> assert len ( auth_key ) == self . AUTH_KEY_LEN <EOL> return auth_key </s>
<s> from __future__ import absolute_import <EOL> from geocoder . base import Base <EOL> from geocoder . location import Location <EOL> class Ipinfo ( Base ) : <EOL> """<STR_LIT>""" <EOL> provider = '<STR_LIT>' <EOL> method = '<STR_LIT>' <EOL> def __init__ ( self , location = '<STR_LIT>' , ** kwargs ) : <EOL> self . location = location <EOL> if location . lower ( ) == '<STR_LIT>' : <EOL> self . location = '<STR_LIT>' <EOL> self . url = '<STR_LIT>' . format ( self . location ) <EOL> self . _initialize ( ** kwargs ) <EOL> def _catch_errors ( self ) : <EOL> content = self . content <EOL> if content and self . status_code == <NUM_LIT> : <EOL> self . error = content <EOL> @ property <EOL> def lat ( self ) : <EOL> loc = self . parse . get ( '<STR_LIT>' ) <EOL> if loc : <EOL> return Location ( loc ) . lat <EOL> @ property <EOL> def lng ( self ) : <EOL> loc = self . parse . get ( '<STR_LIT>' ) <EOL> if loc : <EOL> return Location ( loc ) . lng <EOL> @ property <EOL> def address ( self ) : <EOL> if self . city : <EOL> return '<STR_LIT>' . format ( self . city , self . state , self . country ) <EOL> elif self . state : <EOL> return '<STR_LIT>' . format ( self . state , self . country ) <EOL> elif self . country : <EOL> return '<STR_LIT>' . format ( self . country ) <EOL> else : <EOL> return '<STR_LIT>' <EOL> @ property <EOL> def postal ( self ) : <EOL> return self . parse . get ( '<STR_LIT>' ) <EOL> @ property <EOL> def city ( self ) : <EOL> return self . parse . get ( '<STR_LIT>' ) <EOL> @ property <EOL> def state ( self ) : <EOL> return self . parse . get ( '<STR_LIT>' ) <EOL> @ property <EOL> def country ( self ) : <EOL> return self . parse . get ( '<STR_LIT>' ) <EOL> @ property <EOL> def hostname ( self ) : <EOL> return self . parse . get ( '<STR_LIT>' ) <EOL> @ property <EOL> def ip ( self ) : <EOL> return self . parse . get ( '<STR_LIT>' ) <EOL> @ property <EOL> def org ( self ) : <EOL> return self . parse . get ( '<STR_LIT>' ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> g = Ipinfo ( '<STR_LIT>' ) <EOL> g . debug ( ) </s>