text:
#ifndef __IOHIDPowerUsage__
#define __IOHIDPowerUsage__

#ifndef __MACTYPES__
//#include <MacTypes.h>
#endif

#ifndef __MACERRORS__
//#include <MacErrors.h>
#endif

#ifdef __cplusplus
extern "C"
{
#endif

enum
{
	kHIDPage_PowerDevice = 0x84, 				/* Power Device Page */
	kHIDPage_BatterySystem = 0x85, 				/* Battery System Page */

	/* 	Usage Types:
		CA- Application Collection
		CL- logical Collection
		CP- Pyiscal Collection
		DF- Dynamic Flag
		DV- Dynamic Value
		SF- Static Flag
		SV- Static Value

		Usgae Implementations:
		I- Input
		O- Output
		F- Feature
	*/

	/* Power Device Page (0x84) */
	/* This section provides detailed descriptions of the usages employed by Power Devices. */
	kHIDUsage_PD_Undefined = 0x00,				/* Power Device Undefined Usage */
	kHIDUsage_PD_iName = 0x01,					/* CL- Power Device Name Index */
	kHIDUsage_PD_PresentStatus = 0x02,			/* CL- Power Device Present Status */
	kHIDUsage_PD_ChangedStatus = 0x03,			/* CA- Power Device Changed Status */
	kHIDUsage_PD_UPS = 0x04,					/* CA- Uninterruptible Power Supply */
	kHIDUsage_PD_PowerSupply = 0x05,			/* CA- Power Supply */
	/* Reserved 0x06 - 0x0F */
	kHIDUsage_PD_BatterySystem = 0x10,			/* CP- Battery System power module */
	kHIDUsage_PD_BatterySystemID = 0x11,		/* SV IF- Battery System ID */
	kHIDUsage_PD_Battery = 0x12,				/* CP- Battery */
	kHIDUsage_PD_BatteryID = 0x13,				/* SV IF- Battery ID */
	kHIDUsage_PD_Charger = 0x14,				/* CP- Charger */
	kHIDUsage_PD_ChargerID = 0x15,				/* SV IF- Charger ID */
	kHIDUsage_PD_PowerConverter = 0x16,			/* CP- Power Converter power module */
	kHIDUsage_PD_PowerConverterID = 0x17,		/* SV IF- Power Converter ID */
	kHIDUsage_PD_OutletSystem = 0x18,			/* CP- Outlet System power module */
	kHIDUsage_PD_OutletSystemID = 0x19,			/* SV IF-Outlet System ID */
	kHIDUsage_PD_Input = 0x1A,					/* CP- Power Device Input */
	kHIDUsage_PD_InputID = 0x1B,				/* SV IF- Power Device Input ID */
	kHIDUsage_PD_Output = 0x1C,					/* CP- Power Device Output */
	kHIDUsage_PD_OutputID = 0x1D,				/* SV IF- Power Device Output ID */
	kHIDUsage_PD_Flow = 0x1E,					/* CP- Power Device Flow */
	kHIDUsage_PD_FlowID = 0x1F,					/* Item IF- Power Device Flow ID */
	kHIDUsage_PD_Outlet = 0x20,					/* CP- Power Device Outlet */
	kHIDUsage_PD_OutletID = 0x21,				/* SV IF- Power Device Outlet ID */
	kHIDUsage_PD_Gang = 0x22,					/* CL/CP- Power Device Gang */
	kHIDUsage_PD_GangID = 0x23,					/* SV IF- Power Device Gang ID */
	kHIDUsage_PD_PowerSummary = 0x24,			/* CL/CP- Power Device Power Summary */
	kHIDUsage_PD_PowerSummaryID = 0x25,			/* SV IF- Power Device Power Summary ID */
	/* Reserved 0x26 - 0x2F */
	kHIDUsage_PD_Voltage = 0x30,				/* DV IF- Power Device Voltage */
	kHIDUsage_PD_Current = 0x31,				/* DV IF- Power Device Current */
	kHIDUsage_PD_Frequency = 0x32,				/* DV IF- Power Device Frequency */
	kHIDUsage_PD_ApparentPower = 0x33,			/* DV IF- Power Device Apparent Power */
	kHIDUsage_PD_ActivePower = 0x34,			/* DV IF- Power Device RMS Power */
	kHIDUsage_PD_PercentLoad = 0x35,			/* DV IF- Power Device Percent Load */
	kHIDUsage_PD_Temperature = 0x36,			/* DV IF- Power Device Temperature */
	kHIDUsage_PD_Humidity = 0x37,				/* DV IF- Power Device Humidity */
	kHIDUsage_PD_BadCount = 0x38,				/* DV IF- Power Device Bad Condition Count */
	/* Reserved 0x39 - 0x3F */
	kHIDUsage_PD_ConfigVoltage = 0x40,			/* SV/DV F- Power Device Nominal Voltage */
	kHIDUsage_PD_ConfigCurrent = 0x41,			/* SV/DV F- Power Device Nominal Current */
	kHIDUsage_PD_ConfigFrequency = 0x42,		/* SV/DV F- Power Device Nominal Frequency */
	kHIDUsage_PD_ConfigApparentPower = 0x43,	/* SV/DV F- Power Device Nominal Apparent Power */
	kHIDUsage_PD_ConfigActivePower = 0x44,		/* SV/DV F- Power Device Nominal RMS Power */
	kHIDUsage_PD_ConfigPercentLoad = 0x45,		/* SV/DV F- Power Device Nominal Percent Load */
	kHIDUsage_PD_ConfigTemperature = 0x46,		/* SV/DV F- Power Device Nominal Temperature */
	kHIDUsage_PD_ConfigHumidity = 0x47,			/* SV/DV F- Power Device Nominal Humidity */
	/* Reserved 0x48 - 0x4F */
	kHIDUsage_PD_SwitchOnControl = 0x50,		/* DV F- Power Device Switch On Control */
	kHIDUsage_PD_SwitchOffControl = 0x51,		/* DV F- Power Device Switch Off Control */
	kHIDUsage_PD_ToggleControl = 0x52,			/* DV F- Power Device Toogle Sequence Control */
	kHIDUsage_PD_LowVoltageTransfer = 0x53,		/* DV F- Power Device Min Transfer Voltage */
	kHIDUsage_PD_HighVoltageTransfer = 0x54,	/* DV F- Power Device Max Transfer Voltage */
	kHIDUsage_PD_DelayBeforeReboot = 0x55,		/* DV F- Power Device Delay Before Reboot */
	kHIDUsage_PD_DelayBeforeStartup = 0x56,		/* DV F- Power Device Delay Before Startup */
	kHIDUsage_PD_DelayBeforeShutdown = 0x57,	/* DV F- Power Device Delay Before Shutdown */
	kHIDUsage_PD_Test = 0x58,					/* DV F- Power Device Test Request/Result */
	kHIDUsage_PD_ModuleReset = 0x59,			/* DV F- Power Device Reset Request/Result */
	kHIDUsage_PD_AudibleAlarmControl = 0x5A,	/* DV F- Power Device Audible Alarm Control */
	/* Reserved 0x5B - 0x5F */
	kHIDUsage_PD_Present = 0x60,				/* DV IOF- Power Device Present */
	kHIDUsage_PD_Good = 0x61,					/* DV IOF- Power Device Good */
	kHIDUsage_PD_InternalFailure = 0x62,		/* DV IOF- Power Device Internal Failure */
	kHIDUsage_PD_VoltageOutOfRange = 0x63,		/* DV IOF- Power Device Voltage Out Of Range */
	kHIDUsage_PD_FrequencyOutOfRange = 0x64,	/* DV IOF- Power Device Frequency Out Of Range */
	kHIDUsage_PD_Overload = 0x65,				/* DV IOF- Power Device Overload */
	kHIDUsage_PD_OverCharged = 0x66,			/* DV IOF- Power Device Over Charged */
	kHIDUsage_PD_OverTemperature = 0x67,		/* DV IOF- Power Device Over Temperature */
	kHIDUsage_PD_ShutdownRequested = 0x68,		/* DV IOF- Power Device Shutdown Requested */
	kHIDUsage_PD_ShutdownImminent = 0x69,		/* DV IOF- Power Device Shutdown Imminent */
	/* Reserved 0x6A */
	kHIDUsage_PD_SwitchOnOff = 0x6B,			/* DV IOF- Power Device On/Off Switch Status */
	kHIDUsage_PD_Switchable = 0x6C,				/* DV IOF- Power Device Switchable */
	kHIDUsage_PD_Used = 0x6D,					/* DV IOF- Power Device Used */
	kHIDUsage_PD_Boost = 0x6E,					/* DV IOF- Power Device Boosted */
	kHIDUsage_PD_Buck = 0x6F,					/* DV IOF- Power Device Bucked */
	kHIDUsage_PD_Initialized = 0x70,			/* DV IOF- Power Device Initialized */
	kHIDUsage_PD_Tested = 0x71,					/* DV IOF- Power Device Tested */
	kHIDUsage_PD_AwaitingPower = 0x72,			/* DV IOF- Power Device Awaiting Power */
	kHIDUsage_PD_CommunicationLost = 0x73,		/* DV IOF- Power Device Communication Lost */
	/* Reserved 0x74 - 0xFC */
	kHIDUsage_PD_iManufacturer = 0xFD,			/* SV F- Power Device Manufacturer String Index */
	kHIDUsage_PD_iProduct = 0xFE,				/* SV F- Power Device Product String Index */
	kHIDUsage_PD_iserialNumber = 0xFF,			/* SV F- Power Device Serial Number String Index */

	/* Battery System Page (x85) */
	/* This section provides detailed descriptions of the usages employed by Battery Systems. */
	kHIDUsage_BS_Undefined = 0x00,				/* Battery System Undefined */
	kHIDUsage_BS_SMBBatteryMode = 0x01,			/* CL - SMB Mode */
	kHIDUsage_BS_SMBBatteryStatus = 0x02,		/* CL - SMB Status */
	kHIDUsage_BS_SMBAlarmWarning = 0x03,		/* CL - SMB Alarm Warning */
	kHIDUsage_BS_SMBChargerMode = 0x04,			/* CL - SMB Charger Mode */
	kHIDUsage_BS_SMBChargerStatus = 0x05,		/* CL - SMB Charger Status */
	kHIDUsage_BS_SMBChargerSpecInfo = 0x06,		/* CL - SMB Charger Extended Status */
	kHIDUsage_BS_SMBSelectorState = 0x07,		/* CL - SMB Selector State */
	kHIDUsage_BS_SMBSelectorPresets = 0x08,		/* CL - SMB Selector Presets */
	kHIDUsage_BS_SMBSelectorInfo = 0x09,		/* CL - SMB Selector Info */
	/* Reserved 0x0A - 0x0F */
	kHIDUsage_BS_OptionalMfgFunction1 = 0x10,	/* DV F - Battery System Optional SMB Mfg Function 1 */
	kHIDUsage_BS_OptionalMfgFunction2 = 0x11,	/* DV F - Battery System Optional SMB Mfg Function 2 */
	kHIDUsage_BS_OptionalMfgFunction3 = 0x12,	/* DV F - Battery System Optional SMB Mfg Function 3 */
	kHIDUsage_BS_OptionalMfgFunction4 = 0x13,	/* DV F - Battery System Optional SMB Mfg Function 4 */
	kHIDUsage_BS_OptionalMfgFunction5 = 0x14,	/* DV F - Battery System Optional SMB Mfg Function 5 */
	kHIDUsage_BS_ConnectionToSMBus = 0x15,		/* DF F - Battery System Connection To System Management Bus */
	kHIDUsage_BS_OutputConnection = 0x16,		/* DF F - Battery System Output Connection Status */
	kHIDUsage_BS_ChargerConnection = 0x17,		/* DF F - Battery System Charger Connection */
	kHIDUsage_BS_BatteryInsertion = 0x18,		/* DF F - Battery System Battery Insertion */
	kHIDUsage_BS_Usenext = 0x19,				/* DF F - Battery System Use Next */
	kHIDUsage_BS_OKToUse = 0x1A,				/* DF F - Battery System OK To Use */
	kHIDUsage_BS_BatterySupported = 0x1B,		/* DF F - Battery System Battery Supported */
	kHIDUsage_BS_SelectorRevision = 0x1C,		/* DF F - Battery System Selector Revision */
	kHIDUsage_BS_ChargingIndicator = 0x1D,		/* DF F - Battery System Charging Indicator */
	/* Reserved 0x1E - 0x27 */
	kHIDUsage_BS_ManufacturerAccess = 0x28,		/* DV F - Battery System Manufacturer Access */
	kHIDUsage_BS_RemainingCapacityLimit = 0x29,	/* DV F - Battery System Remaining Capacity Limit */
	kHIDUsage_BS_RemainingTimeLimit = 0x2A,		/* DV F - Battery System Remaining Time Limit */
	kHIDUsage_BS_AtRate = 0x2B,					/* DV F - Battery System At Rate... */
	kHIDUsage_BS_CapacityMode = 0x2C,			/* DV F - Battery System Capacity Mode */
	kHIDUsage_BS_BroadcastToCharger = 0x2D,		/* DV F - Battery System Broadcast To Charger */
	kHIDUsage_BS_PrimaryBattery = 0x2E,			/* DV F - Battery System Primary Battery */
	kHIDUsage_BS_ChargeController = 0x2F,		/* DV F - Battery System Charge Controller */
	/* Reserved 0x30 - 0x3F */
	kHIDUsage_BS_TerminateCharge = 0x40,		/* DF IOF - Battery System Terminate Charge */
	kHIDUsage_BS_TerminateDischarge = 0x41,		/* DF IOF - Battery System Terminate Discharge */
	kHIDUsage_BS_BelowRemainingCapacityLimit = 0x42, /* DF IOF - Battery System Below Remaining Capacity Limit */
	kHIDUsage_BS_RemainingTimeLimitExpired = 0x43, /* DF IOF - Battery System Remaining Time Limit Expired */
	kHIDUsage_BS_Charging = 0x44,				/* DF IOF - Battery System Charging */
	kHIDUsage_BS_Discharging = 0x45,			/* DV IOF - Battery System Discharging */
	kHIDUsage_BS_FullyCharged = 0x46,			/* DF IOF - Battery System Fully Charged */
	kHIDUsage_BS_FullyDischarged = 0x47,		/* DV IOF - Battery System Fully Discharged */
	kHIDUsage_BS_ConditioningFlag = 0x48,		/* DV IOF - Battery System Conditioning Flag */
	kHIDUsage_BS_AtRateOK = 0x49,				/* DV IOF - Battery System At Rate OK */
	kHIDUsage_BS_SMBErrorCode = 0x4A,			/* DF IOF - Battery System SMB Error Code */
	kHIDUsage_BS_NeedReplacement = 0x4B,		/* DF IOF - Battery System Need Replacement */
	/* Reserved 0x4C - 0x5F */
	kHIDUsage_BS_AtRateTimeToFull = 0x60,		/* DV IF - Battery System At Rate Time To Full */
	kHIDUsage_BS_AtRateTimeToEmpty = 0x61,		/* DV IF - Battery System At Rate Time To Empty */
	kHIDUsage_BS_AverageCurrent = 0x62,			/* DV IF - Battery System Average Current */
	kHIDUsage_BS_Maxerror = 0x63,				/* DV IF - Battery System Max Error */
	kHIDUsage_BS_RelativeStateOfCharge = 0x64,	/* DV IF - Battery System Relative State Of Charge */
	kHIDUsage_BS_AbsoluteStateOfCharge = 0x65,	/* DV IF - Battery System Absolute State Of Charge */
	kHIDUsage_BS_RemainingCapacity = 0x66,		/* DV IF - Battery System Remaining Capacity */
	kHIDUsage_BS_FullChargeCapacity = 0x67,		/* DV IF - Battery System Full Charge Capacity */
	kHIDUsage_BS_RunTimeToEmpty = 0x68,			/* DV IF - Battery System Run Time To Empty */
	kHIDUsage_BS_AverageTimeToEmpty = 0x69,		/* DV IF - Battery System Average Time To Empty */
	kHIDUsage_BS_AverageTimeToFull = 0x6A,		/* DV IF - Battery System Average Time To Full */
	kHIDUsage_BS_CycleCount = 0x6B,				/* DV IF - Battery System Cycle Count */
	/* Reserved 0x6C - 0x7F */
	kHIDUsage_BS_BattPackModelLevel = 0x80,		/* SV F - Battery System Batt Pack Model Level */
	kHIDUsage_BS_InternalChargeController = 0x81, /* SF F - Battery System Internal Charge Controller */
	kHIDUsage_BS_PrimaryBatterySupport = 0x82,	/* SF F - Battery System Primary Battery Support */
	kHIDUsage_BS_DesignCapacity = 0x83,			/* SV F - Battery System Design Capacity */
	kHIDUsage_BS_SpecificationInfo = 0x84,		/* SV F - Battery System Specification Info */
	kHIDUsage_BS_ManufacturerDate = 0x85,		/* SV F - Battery System Manufacturer Date */
	kHIDUsage_BS_SerialNumber = 0x86,			/* SV F - Battery System Serial Number */
	kHIDUsage_BS_iManufacturerName = 0x87,		/* SV F - Battery System Manufacturer Name Index */
	kHIDUsage_BS_iDevicename = 0x88,			/* SV F - Battery System Device Name Index */
	kHIDUsage_BS_iDeviceChemistry = 0x89,		/* SV F - Battery System Device Chemistry Index */
	kHIDUsage_BS_ManufacturerData = 0x8A,		/* SV F - Battery System Manufacturer Data */
	kHIDUsage_BS_Rechargable = 0x8B,			/* SV F - Battery System Rechargable */
	kHIDUsage_BS_WarningCapacityLimit = 0x8C,	/* SV F - Battery System Warning Capacity Limit */
	kHIDUsage_BS_CapacityGranularity1 = 0x8D,	/* SV F - Battery System Capacity Granularity 1 */
	kHIDUsage_BS_CapacityGranularity2 = 0x8E,	/* SV F - Battery System Capacity Granularity 2 */
	kHIDUsage_BS_iOEMInformation = 0x8F,		/* SV F - Battery System OEM Information Index */
	/* Reserved 0x90 - 0xBF */
	kHIDUsage_BS_InhibitCharge = 0xC0,			/* DF IOF - Battery System Inhibit Charge */
	kHIDUsage_BS_EnablePolling = 0xC1,			/* DF IOF - Battery System Enable Polling */
	kHIDUsage_BS_ResetToZero = 0xC2,			/* DF IOF - Battery System Reset To Zero */
	/* Reserved 0xC3 - 0xCF */
	kHIDUsage_BS_ACPresent = 0xD0,				/* DF IOF - Battery System AC Present */
	kHIDUsage_BS_BatteryPresent = 0xD1,			/* DF IOF - Battery System Battery Present */
	kHIDUsage_BS_PowerFail = 0xD2,				/* DF IOF - Battery System Power Fail */
	kHIDUsage_BS_AlarmInhibited = 0xD3,			/* DF IOF - Battery System Alarm Inhibited */
	kHIDUsage_BS_ThermistorUnderRange = 0xD4,	/* DF IOF - Battery System Thermistor Under Range */
	kHIDUsage_BS_ThermistorHot = 0xD5,			/* DF IOF - Battery System Thermistor Hot */
	kHIDUsage_BS_ThermistorCold = 0xD6,			/* DF IOF - Battery System Thermistor Cold */
	kHIDUsage_BS_ThermistorOverRange = 0xD7,	/* DF IOF - Battery System Thermistor Over Range */
	kHIDUsage_BS_VoltageOutOfRange = 0xD8,		/* DF IOF - Battery System Voltage Out Of Range */
	kHIDUsage_BS_CurrentOutOfRange = 0xD9,		/* DF IOF - Battery System Current Out Of Range */
	kHIDUsage_BS_CurrentNotRegulated = 0xDA,	/* DF IOF - Battery System Current Not Regulated */
	kHIDUsage_BS_VoltageNotRegulated = 0xDB,	/* DF IOF - Battery System Voltage Not Regulated */
	kHIDUsage_BS_MasterMode = 0xDC,				/* DF IOF - Battery System Master Mode */
	/* Reserved 0xDD - 0xEF */
	kHIDUsage_BS_ChargerSelectorSupport = 0xF0,	/* SF F- Battery System Charger Support Selector */
	kHIDUsage_BS_ChargerSpec = 0xF1,			/* SF F- Battery System Charger Specification */
	kHIDUsage_BS_Level2 = 0xF2,					/* SF F- Battery System Charger Level 2 */
	kHIDUsage_BS_Level3 = 0xF3					/* SF F- Battery System Charger Level 3 */
	/* Reserved 0xF2 - 0xFF */
};

#ifdef __cplusplus
}
#endif

#endif /* __IOHIDPowerUsage__ */


text:
import os

if __name__ == '__main__':
    import sys
    pkg_dir = os.path.split(os.path.abspath(__file__))[0]
    parent_dir, pkg_name = os.path.split(pkg_dir)
    is_pygame_pkg = (pkg_name == 'tests' and
                     os.path.split(parent_dir)[1] == 'pygame')
    if not is_pygame_pkg:
        sys.path.insert(0, parent_dir)
else:
    is_pygame_pkg = __name__.startswith('pygame.tests.')

import unittest
import pygame
from pygame.compat import as_unicode

################################################################################

class EventTypeTest(unittest.TestCase):
    def test_Event(self):
        # __doc__ (as of 2008-08-02) for pygame.event.Event:

          # pygame.event.Event(type, dict): return Event
          # pygame.event.Event(type, **attributes): return Event
          # create a new event object
          #
          # Creates a new event with the given type. The event is created with
          # the given attributes and values. The attributes can come from a
          # dictionary argument, or as string keys from a dictionary.
          #
          # The given attributes will be readonly attributes on the new event
          # object itself. These are the only attributes on the Event object,
          # there are no methods attached to Event objects.

        e = pygame.event.Event(pygame.USEREVENT, some_attr=1, other_attr='1')

        self.assertEquals(e.some_attr, 1)
        self.assertEquals(e.other_attr, "1")

        # Event now uses tp_dictoffset and tp_members: request 62
        # on Motherhamster Bugzilla.
        self.assertEquals(e.type, pygame.USEREVENT)
        self.assert_(e.dict is e.__dict__)
        e.some_attr = 12
        self.assertEquals(e.some_attr, 12)
        e.new_attr = 15
        self.assertEquals(e.new_attr, 15)

        # For Python 2.x a TypeError is raised for a readonly member;
        # for Python 3.x it is an AttributeError.
        self.assertRaises((TypeError, AttributeError), setattr, e, 'type', 0)
        self.assertRaises((TypeError, AttributeError), setattr, e, 'dict', None)

        # Ensure attributes are visible to dir(), part of the original
        # posted request.
        d = dir(e)
        self.assert_('type' in d)
        self.assert_('dict' in d)
        self.assert_('__dict__' in d)
        self.assert_('some_attr' in d)
        self.assert_('other_attr' in d)
        self.assert_('new_attr' in d)

    def test_as_str(self):
        # Bug reported on Pygame mailing list July 24, 2011:
        # For Python 3.x str(event) to raises an UnicodeEncodeError when
        # an event attribute is a string with a non-ascii character.
        try:
            str(pygame.event.Event(1, a=as_unicode(r"\xed")))
        except UnicodeEncodeError:
            self.fail("Event object raised exception for non-ascii character")
        # Passed.

race_condition_notification = """
This test is dependent on timing. The event queue is cleared in preparation for
tests. There is a small window where outside events from the OS may have effected
results. Try running the test again.
"""

class EventModuleTest(unittest.TestCase):
    def setUp(self):
        # flush events
        pygame.display.init()
        pygame.event.clear()
        self.assert_(not pygame.event.get())

    def tearDown(self):
        pygame.display.quit()

    def test_set_blocked(self):
        # __doc__ (as of 2008-06-25) for pygame.event.set_blocked:

          # pygame.event.set_blocked(type): return None
          # pygame.event.set_blocked(typelist): return None
          # pygame.event.set_blocked(None): return None
          # control which events are allowed on the queue

        pygame.event.set_blocked(2)

        self.assert_(pygame.event.get_blocked(2))

        pygame.event.post(pygame.event.Event(2))

        events = pygame.event.get()
        should_be_blocked = [e for e in events if e.type == 2]

        self.assertEquals(should_be_blocked, [])

    def test_post__and_poll(self):
        # __doc__ (as of 2008-06-25) for pygame.event.post:

          # pygame.event.post(Event): return None
          # place a new event on the queue

        e1 = pygame.event.Event(pygame.USEREVENT, attr1='attr1')

        pygame.event.post(e1)

        posted_event = pygame.event.poll()
        self.assertEquals (
            e1.attr1, posted_event.attr1, race_condition_notification
        )

        # fuzzing event types
        for i in range(1, 11):
            pygame.event.post(pygame.event.Event(i))
            self.assertEquals (
                pygame.event.poll().type, i, race_condition_notification
            )
    def test_post_large_user_event(self):
        pygame.event.post(pygame.event.Event(pygame.USEREVENT, {'a': "a" * 1024}))

        e = pygame.event.poll()
        self.assertEquals(e.type, pygame.USEREVENT)
        self.assertEquals(e.a, "a" * 1024)

    def test_get(self):
        # __doc__ (as of 2008-06-25) for pygame.event.get:

          # pygame.event.get(): return Eventlist
          # pygame.event.get(type): return Eventlist
          # pygame.event.get(typelist): return Eventlist
          # get events from the queue

        # Put 10 events on the queue
        for _ in range(1, 11):
            pygame.event.post(pygame.event.Event(pygame.USEREVENT))

        self.assert_ ( len(pygame.event.get()) >= 10 )

    def test_clear(self):

        # __doc__ (as of 2008-06-25) for pygame.event.clear:

          # pygame.event.clear(): return None
          # pygame.event.clear(type): return None
          # pygame.event.clear(typelist): return None
          # remove all events from the queue

        for _ in range(1, 11):
            pygame.event.post(pygame.event.Event(_))

        self.assert_(pygame.event.poll())  # there are some events on queue

        pygame.event.clear()

        self.assert_(not pygame.event.poll(), race_condition_notification)

    def test_event_name(self):

        # __doc__ (as of 2008-06-25) for pygame.event.event_name:

          # pygame.event.event_name(type): return string
          # get the string name from and event id

        self.assertEquals(pygame.event.event_name(2), "KeyDown")
        self.assertEquals(pygame.event.event_name(24), "UserEvent")

    def test_wait(self):
        # __doc__ (as of 2008-06-25) for pygame.event.wait:

          # pygame.event.wait(): return Event
          # wait for a single event from the queue

        pygame.event.post ( pygame.event.Event(2) )
        self.assert_(pygame.event.wait())

    def test_peek(self):

        # __doc__ (as of 2008-06-25) for pygame.event.peek:

          # pygame.event.peek(type): return bool
          # pygame.event.peek(typelist): return bool
          # test if event types are waiting on the queue

        event_types = [2, 3, 4]

        for event_type in event_types:
            pygame.event.post (
                pygame.event.Event(event_type)
            )
            self.assert_(pygame.event.peek(event_type))

        self.assert_(pygame.event.peek(event_types))

    def test_set_allowed(self):
        # __doc__ (as of 2008-06-25) for pygame.event.set_allowed:

          # pygame.event.set_allowed(type): return None
          # pygame.event.set_allowed(typelist): return None
          # pygame.event.set_allowed(None): return None
          # control which events are allowed on the queue

        pygame.event.set_blocked(2)
        self.assert_(pygame.event.get_blocked(2))
        pygame.event.set_allowed(2)
        self.assert_(not pygame.event.get_blocked(2))

    def test_pump(self):
        # __doc__ (as of 2008-06-25) for pygame.event.pump:

          # pygame.event.pump(): return None
          # internally process pygame event handlers

        # see it doesn't cause an error
        pygame.event.pump()

    def test_set_grab__and_get_symmetric(self):

        # __doc__ (as of 2008-06-25) for pygame.event.set_grab:

          # pygame.event.set_grab(bool): return None
          # control the sharing of input devices with other applications

        # If we don't have a real display, don't do the test.
        if os.environ.get('SDL_VIDEODRIVER') == 'dummy':
            return

        pygame.event.set_grab(True)
        self.assert_(pygame.event.get_grab())
        pygame.event.set_grab(False)
        self.assert_(not pygame.event.get_grab())

    def test_event_equality(self):
        a = pygame.event.Event(1, a=1)
        b = pygame.event.Event(1, a=1)
        c = pygame.event.Event(2, a=1)
        d = pygame.event.Event(1, a=2)

        self.failUnless(a == a)
        self.failIf(a != a)
        self.failUnless(a == b)
        self.failIf(a != b)
        self.failUnless(a !=  c)
        self.failIf(a == c)
        self.failUnless(a != d)
        self.failIf(a == d)

    def todo_test_get_blocked(self):

        # __doc__ (as of 2008-08-02) for pygame.event.get_blocked:

          # pygame.event.get_blocked(type): return bool
          # test if a type of event is blocked from the queue
          #
          # Returns true if the given event type is blocked from the queue.

        self.fail()

    def todo_test_get_grab(self):

        # __doc__ (as of 2008-08-02) for pygame.event.get_grab:

          # pygame.event.get_grab(): return bool
          # test if the program is sharing input devices
          #
          # Returns true when the input events are grabbed for this application.
          # Use pygame.event.set_grab() to control this state.
          #

        self.fail()

    def todo_test_poll(self):

        # __doc__ (as of 2008-08-02) for pygame.event.poll:

          # pygame.event.poll(): return Event
          # get a single event from the queue
          #
          # Returns a single event from the queue. If the event queue is empty
          # an event of type pygame.NOEVENT will be returned immediately. The
          # returned event is removed from the queue.
          #

        self.fail()

################################################################################

if __name__ == '__main__':
    unittest.main()

redpajama_set_name: RedPajamaGithub


text:
#ifndef DEBUG_H
#define DEBUG_H

#include <math.h>
#include <core/Commons.h>
#include <util/Shader.h>

namespace gl
{
	void init();
	void update(const mat4&);
	void setColor(const vec4&);
	void rotate(float, const vec3&);
	void translate(const vec3&);

	void viewport(const vec4&);
	void clearColor(const vec4&);
	void clear();

	void begin();
	void end();
	void drawLine(const vec2&, const vec2&);
	void drawLine(const vec3&, const vec3&);
	void drawWireCube(const vec3&, const vec3&);
	void drawVector(const vec3&, const vec3&, float, float);

	mat4 getModelViewProjection();
}

#endif


text:
@implementation NSArray (SAGExtensions)
- (id) sag_safeObjectAtIndex:(NSUInteger) index
{
    if (index < self.count)
    {
        return [self objectAtIndex:index];
    }

    return nil;
}
@end


text:
<?xml version="1.0"?>
<doc>
    <assembly>
        <name>Common.Logging.EntLib60</name>
    </assembly>
    <members>
        <member name="T:AssemblyDoc">

            <para>
            This assembly contains the adapter to plug Microsoft Enterprise Logging Library 6.0. into the Common.Logging infrastructure.
            </para>
            <para>For an example on how to configure
            <list type="bullet">
            <item>Common.Logging to render its output to Entlib, see <see cref="T:Common.Logging.EntLib.EntLibLoggerFactoryAdapter"/>.</item>
            <item>Entlib to render its output to Common.Logging use <see cref="T:Common.Logging.EntLib.CommonLoggingEntlibTraceListener"/>.</item>
            </list>
            </para>

        </member>
        <member name="T:Common.Logging.EntLib.CommonLoggingEntlibTraceListener">

            Use this <see cref="T:System.Diagnostics.TraceListener"/> implementation to route all Entlib logging events to the
            Common.Logging infrastructure.

            <remarks>
            See <see cref="T:Common.Logging.EntLib.CommonLoggingEntlibTraceListenerData"/> for a list of properties to configure.
            </remarks>
            <example>
            To route all <see cref="T:Microsoft.Practices.EnterpriseLibrary.Logging.Logger"/> events to Common.Logging, configure <see cref="T:Common.Logging.EntLib.CommonLoggingEntlibTraceListener"/>:

            <?xml version="1.0" encoding="utf-8"?>
            <configuration>
                <configSections>
                    <section name="loggingConfiguration"
            type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings,
            Microsoft.Practices.EnterpriseLibrary.Logging" />
                </configSections>
                <loggingConfiguration name="Logging Application Block" tracingEnabled="true"
                    defaultCategory="General" logWarningsWhenNoCategoriesMatch="true">
                    <listeners>
                        <add name="Common.Logging Listener"
                             type="Common.Logging.EntLib.CommonLoggingEntlibTraceListener, Common.Logging.EntLib"
                             listenerDataType="Common.Logging.EntLib.CommonLoggingEntlibTraceListenerData,
            Common.Logging.EntLib"
                             loggerNameFormat="{listenerName}.{sourceName}"
                             formatter="Text Formatter"
                             />
                    </listeners>
                    <formatters>
                        <add template="Timestamp: {timestamp}&#xD;&#xA;Message: {message}&#xD;&#xA;Category:
            {category}&#xD;&#xA;Priority: {priority}&#xD;&#xA;EventId: {eventid}&#xD;&#xA;Severity:
            {severity}&#xD;&#xA;Title:{title}&#xD;&#xA;Machine: {machine}&#xD;&#xA;Application Domain:
            {appDomain}&#xD;&#xA;Process Id: {processId}&#xD;&#xA;Process Name: {processName}&#xD;&#xA;Win32
            Thread Id: {win32ThreadId}&#xD;&#xA;Thread Name: {threadName}&#xD;&#xA;Extended Properties:
            {dictionary({key} - {value}&#xD;&#xA;)}"
                            type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter,
            Microsoft.Practices.EnterpriseLibrary.Logging"
                            name="Text Formatter" />
                    </formatters>
                    <specialSources>
                        <allEvents switchValue="All" name="All Events">
                            <listeners>
                                <add name="Test Capturing Listener" />
                            </listeners>
                        </allEvents>
                    </specialSources>
                </loggingConfiguration>
            </configuration>

            </example>
            <author>Erich Eichinger</author>
        </member>
        <member name="M:Common.Logging.EntLib.CommonLoggingEntlibTraceListener.#ctor(Common.Logging.EntLib.CommonLoggingEntlibTraceListenerData,Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.ILogFormatter)">

            Initializes this instance from <see cref="T:Common.Logging.EntLib.CommonLoggingEntlibTraceListenerData"/> configuration
            information.

        </member>
        <member name="M:Common.Logging.EntLib.CommonLoggingEntlibTraceListener.Write(System.String)">

            NOT USED BY ENTLIB

            <exception cref="T:System.NotImplementedException"/>
        </member>
        <member name="M:Common.Logging.EntLib.CommonLoggingEntlibTraceListener.WriteLine(System.String)">

            NOT USED BY ENTLIB

            <exception cref="T:System.NotImplementedException"/>
        </member>
        <member name="M:Common.Logging.EntLib.CommonLoggingEntlibTraceListener.TraceData(System.Diagnostics.TraceEventCache,System.String,System.Diagnostics.TraceEventType,System.Int32,System.Object)">

            Overridden to redirect to call <see cref="M:Common.Logging.EntLib.CommonLoggingEntlibTraceListener.Log(System.Diagnostics.TraceEventType,System.String,System.Int32,System.String,System.Object[])"/>.

        </member>
        <member name="M:Common.Logging.EntLib.CommonLoggingEntlibTraceListener.Log(System.Diagnostics.TraceEventType,System.String,System.Int32,System.String,System.Object[])">

            Logs the given message to the Common.Logging infrastructure

        </member>
        <member name="P:Common.Logging.EntLib.CommonLoggingEntlibTraceListener.LoggerNameFormat">

            Format to use for creating the logger name. Defaults to "{listenerName}.{sourceName}".

            <remarks>
            Available placeholders are:
            <list type="bullet">
            <item>{listenerName}: the configured name of this listener instance.</item>
            <item>{sourceName}: the trace source name an event originates from (see e.g. <see cref="M:System.Diagnostics.TraceListener.TraceEvent(System.Diagnostics.TraceEventCache,System.String,System.Diagnostics.TraceEventType,System.Int32,System.String,System.Object[])"/>.</item>
            </list>
            </remarks>
        </member>
        <member name="T:Common.Logging.EntLib.CommonLoggingEntlibTraceListener.LogEntryMessage">

            The message object to be logged. Overrides <see cref="M:Common.Logging.EntLib.CommonLoggingEntlibTraceListener.LogEntryMessage.ToString"/> to format
            the associated <see cref="T:Microsoft.Practices.EnterpriseLibrary.Logging.LogEntry"/>

        </member>
        <member name="T:Common.Logging.EntLib.CommonLoggingEntlibTraceListenerData">

            Represents the configuration settings that describe a <see cref="T:Common.Logging.EntLib.CommonLoggingEntlibTraceListener"/>.

        </member>
        <member name="M:Common.Logging.EntLib.CommonLoggingEntlibTraceListenerData.#ctor">

            Initializes a new instance of the <see cref="T:Common.Logging.EntLib.CommonLoggingEntlibTraceListenerData"/> class.

        </member>
        <member name="M:Common.Logging.EntLib.CommonLoggingEntlibTraceListenerData.#ctor(System.String,System.String)">

            Initializes a new instance of the <see cref="T:Common.Logging.EntLib.CommonLoggingEntlibTraceListenerData"/> class.

            <param name="loggerNameFormat">The logger name format.</param>
            <param name="formatterName">Name of the formatter.</param>
        </member>
        <member name="M:Common.Logging.EntLib.CommonLoggingEntlibTraceListenerData.#ctor(System.String,System.String,System.String)">

            Initializes a new instance of the <see cref="T:Common.Logging.EntLib.CommonLoggingEntlibTraceListenerData"/> class.

            <param name="name">The name.</param>
            <param name="loggerNameFormat">The logger name format.</param>
            <param name="formatterName">Name of the formatter.</param>
        </member>
        <member name="M:Common.Logging.EntLib.CommonLoggingEntlibTraceListenerData.#ctor(System.String,System.String,System.String,System.Diagnostics.TraceOptions)">

            Initializes a new instance of the <see cref="T:Common.Logging.EntLib.CommonLoggingEntlibTraceListenerData"/> class.

            <param name="name">The name.</param>
            <param name="loggerNameFormat">The logger name format.</param>
            <param name="formatterName">Name of the formatter.</param>
            <param name="traceOutputOptions">The trace output options.</param>
        </member>
        <member name="M:Common.Logging.EntLib.CommonLoggingEntlibTraceListenerData.#ctor(System.String,System.Type,System.String,System.String,System.Diagnostics.TraceOptions)">

            Initializes a new instance of the <see cref="T:Common.Logging.EntLib.CommonLoggingEntlibTraceListenerData"/> class.

            <param name="name">The name.</param>
            <param name="traceListenerType">Type of the trace listener.</param>
            <param name="loggerNameFormat">The logger name format.</param>
            <param name="formatterName">Name of the formatter.</param>
            <param name="traceOutputOptions">The trace output options.</param>
        </member>
        <member name="M:Common.Logging.EntLib.CommonLoggingEntlibTraceListenerData.CoreBuildTraceListener(Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings)">

            Builds the <see cref="T:System.Diagnostics.TraceListener"/> object represented by this configuration object.

            <param name="settings">The logging configuration settings.</param>
            <returns>
            An <see cref="T:Common.Logging.Entlib.CommonLoggingEntlibTraceListener"/>.

            </returns>
        </member>
        <member name="P:Common.Logging.EntLib.CommonLoggingEntlibTraceListenerData.LoggerNameFormat">

            The logger name format to use for creating logger names from <see cref="P:Microsoft.Practices.EnterpriseLibrary.Common.Configuration.NamedConfigurationElement.Name"/> and

        </member>
        <member name="P:Common.Logging.EntLib.CommonLoggingEntlibTraceListenerData.Formatter">

            Gets or Sets the formatter name

        </member>
        <member name="T:Common.Logging.EntLib.EntLibLogger">

            Concrete implementation of <see cref="T:Common.Logging.ILog"/> interface specific to Enterprise Logging 4.1.

            <remarks>
            Instances are created by the <see cref="T:Common.Logging.EntLib.EntLibLoggerFactoryAdapter"/>. <see cref="P:Common.Logging.EntLib.EntLibLoggerFactoryAdapter.DefaultPriority"/>
            is used for logging a <see cref="T:Microsoft.Practices.EnterpriseLibrary.Logging.LogEntry"/> to <see cref="M:Microsoft.Practices.EnterpriseLibrary.Logging.LogWriter.Write(Microsoft.Practices.EnterpriseLibrary.Logging.LogEntry)"/>.
            The category name used is the name passed into <see cref="M:Common.Logging.LogManager.GetLogger(System.String)"/>. For configuring logging, see <see cref="T:Common.Logging.EntLib.EntLibLoggerFactoryAdapter"/>.
            </remarks>
            <seealso cref="T:Common.Logging.ILog"/>
            <seealso cref="T:Common.Logging.EntLib.EntLibLoggerFactoryAdapter"/>
            <author>Mark Pollack</author>
            <author>Erich Eichinger</author>
        </member>
        <member name="M:Common.Logging.EntLib.EntLibLogger.#ctor(System.String,Microsoft.Practices.EnterpriseLibrary.Logging.LogWriter,Common.Logging.EntLib.EntLibLoggerSettings)">

            Initializes a new instance of the <see cref="T:Common.Logging.EntLib.EntLibLogger"/> class.

            <param name="category">The category.</param>
            <param name="logWriter">the <see cref="P:Common.Logging.EntLib.EntLibLogger.LogWriter"/> to write log events to.</param>
            <param name="settings">the logger settings</param>
        </member>
        <member name="M:Common.Logging.EntLib.EntLibLogger.WriteInternal(Common.Logging.LogLevel,System.Object,System.Exception)">

            Actually sends the message to the EnterpriseLogging log system.

            <param name="logLevel">the level of this log event.</param>
            <param name="message">the message to log</param>
            <param name="exception">the exception to log (may be null)</param>
        </member>
        <member name="M:Common.Logging.EntLib.EntLibLogger.ShouldLog(Microsoft.Practices.EnterpriseLibrary.Logging.LogEntry)">

            May be overridden for custom filter logic

            <param name="log"></param>
            <returns></returns>
        </member>
        <member name="M:Common.Logging.EntLib.EntLibLogger.WriteLog(Microsoft.Practices.EnterpriseLibrary.Logging.LogEntry)">

            Write the fully populated event to the log.

        </member>
        <member name="M:Common.Logging.EntLib.EntLibLogger.GetTraceEventType(Common.Logging.LogLevel)">

            Translates a <see cref="T:Common.Logging.LogLevel"/> to a <see cref="T:System.Diagnostics.TraceEventType"/>.

        </member>
        <member name="M:Common.Logging.EntLib.EntLibLogger.CreateLogEntry(System.Diagnostics.TraceEventType)">

            Creates a minimal log entry instance that will be passed into <see cref="M:Microsoft.Practices.EnterpriseLibrary.Logging.Logger.ShouldLog(Microsoft.Practices.EnterpriseLibrary.Logging.LogEntry)"/>
            to asap decide, whether this event should be logged.

            <param name="traceEventType">trace event severity.</param>
            <returns></returns>
        </member>
        <member name="M:Common.Logging.EntLib.EntLibLogger.PopulateLogEntry(Microsoft.Practices.EnterpriseLibrary.Logging.LogEntry,System.Object,System.Exception)">

            Configures the log entry.

            <param name="log">The log.</param>
            <param name="message">The message.</param>
            <param name="ex">The ex.</param>
        </member>
        <member name="M:Common.Logging.EntLib.EntLibLogger.AddExceptionInfo(Microsoft.Practices.EnterpriseLibrary.Logging.LogEntry,System.Exception)">

            Adds the exception info.

            <param name="log">The log entry.</param>
            <param name="exception">The exception.</param>
            <returns></returns>
        </member>
        <member name="P:Common.Logging.EntLib.EntLibLogger.Category">

            The category of this logger

        </member>
        <member name="P:Common.Logging.EntLib.EntLibLogger.Settings">

            The settings used by this logger

        </member>
        <member name="P:Common.Logging.EntLib.EntLibLogger.LogWriter">

            The <see cref="P:Common.Logging.EntLib.EntLibLogger.LogWriter"/> used by this logger.

        </member>
        <member name="P:Common.Logging.EntLib.EntLibLogger.IsTraceEnabled">

            Gets a value indicating whether this instance is trace enabled.

        </member>
        <member name="P:Common.Logging.EntLib.EntLibLogger.IsDebugEnabled">

            Gets a value indicating whether this instance is debug enabled.

        </member>
        <member name="P:Common.Logging.EntLib.EntLibLogger.IsInfoEnabled">

            Gets a value indicating whether this instance is info enabled.

        </member>
        <member name="P:Common.Logging.EntLib.EntLibLogger.IsWarnEnabled">

            Gets a value indicating whether this instance is warn enabled.

        </member>
        <member name="P:Common.Logging.EntLib.EntLibLogger.IsErrorEnabled">

            Gets a value indicating whether this instance is error enabled.

        </member>
        <member name="P:Common.Logging.EntLib.EntLibLogger.IsFatalEnabled">

            Gets a value indicating whether this instance is fatal enabled.

        </member>
        <member name="T:Common.Logging.EntLib.EntLibLoggerFactoryAdapter">

            Adapts the EnterpriseLibrary 6.0 logging system to Common.Logging.

            <remarks>
            The following configuration property values may be configured:
            <list type="bullet">
                <item>DefaultPriority (see <see cref="P:Common.Logging.EntLib.EntLibLoggerFactoryAdapter.DefaultPriority"/>)</item>
                <item>ExceptionFormat (see <see cref="P:Common.Logging.EntLib.EntLibLoggerFactoryAdapter.ExceptionFormat"/>)</item>
            </list>
            </remarks>
            <example>
            The following snippet shows how to configure EntLib logging for Common.Logging:

            <configuration>
              <configSections>
                  <section name="logging" type="Common.Logging.ConfigurationSectionHandler, Common.Logging" />
                  <section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
              </configSections>
              <common>
                <logging>
                  <factoryAdapter type="Common.Logging.EntLib.EntLibLoggerFactoryAdapter, Common.Logging.EntLib41">
                    <arg key="DefaultPriority" value="-1" />
                  </factoryAdapter>
                </logging>
              </common>
              <loggingConfiguration name="Logging Application Block"
            <-- configure enterprise logging application block here -->
            ...
              </loggingConfiguration>
            </configuration>

            </example>
            <author>Mark Pollack</author>
            <author>Erich Eichinger</author>
        </member>
        <member name="M:Common.Logging.EntLib.EntLibLoggerFactoryAdapter.#ctor">

            Initializes a new instance of the <see cref="T:Common.Logging.EntLib.EntLibLoggerFactoryAdapter"/> class.

        </member>
        <member name="M:Common.Logging.EntLib.EntLibLoggerFactoryAdapter.#ctor(System.Int32,System.String,Microsoft.Practices.EnterpriseLibrary.Logging.LogWriter)">

            Initializes a new instance of the <see cref="T:Common.Logging.EntLib.EntLibLoggerFactoryAdapter"/> class
            with the specified configuration parameters.

            <param name="defaultPriority">defaults to <see cref="F:Common.Logging.EntLib.EntLibLoggerSettings.DEFAULTPRIORITY"/></param>
            <param name="exceptionFormat">defaults to <see cref="F:Common.Logging.EntLib.EntLibLoggerSettings.DEFAULTEXCEPTIONFORMAT"/></param>
            <param name="logWriter">a <see cref="P:Common.Logging.EntLib.EntLibLoggerFactoryAdapter.LogWriter"/> instance to use</param>
        </member>
        <member name="M:Common.Logging.EntLib.EntLibLoggerFactoryAdapter.#ctor(Common.Logging.Configuration.NameValueCollection)">

            Initializes a new instance of the <see cref="T:Common.Logging.EntLib.EntLibLoggerFactoryAdapter"/> class.

            <remarks>passed in values are not used, configuration is external to EntLib logging API</remarks>
            <param name="properties">The properties.</param>
        </member>
        <member name="M:Common.Logging.EntLib.EntLibLoggerFactoryAdapter.CreateLogger(System.String)">

            Creates a new <see cref="T:Common.Logging.EntLib.EntLibLogger"/> instance.

        </member>
        <member name="M:Common.Logging.EntLib.EntLibLoggerFactoryAdapter.CreateLogger(System.String,Microsoft.Practices.EnterpriseLibrary.Logging.LogWriter,Common.Logging.EntLib.EntLibLoggerSettings)">

            Creates a new <see cref="T:Common.Logging.EntLib.EntLibLogger"/> instance.

        </member>
        <member name="P:Common.Logging.EntLib.EntLibLoggerFactoryAdapter.DefaultPriority">

            The default priority used to log events.

            <remarks>defaults to <see cref="F:Common.Logging.EntLib.EntLibLoggerSettings.DEFAULTPRIORITY"/></remarks>
        </member>
        <member name="P:Common.Logging.EntLib.EntLibLoggerFactoryAdapter.ExceptionFormat">

            The format string used for formatting exceptions

            <remarks>
            defaults to <see cref="F:Common.Logging.EntLib.EntLibLoggerSettings.DEFAULTEXCEPTIONFORMAT"/>
            </remarks>
        </member>
        <member name="P:Common.Logging.EntLib.EntLibLoggerFactoryAdapter.LogWriter">

            the <see cref="F:Common.Logging.EntLib.EntLibLoggerFactoryAdapter._logWriter"/> to write log events to.

            <remarks>
            defaults to <see cref="P:Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Writer"/>.
            </remarks>
        </member>
        <member name="T:Common.Logging.EntLib.EntLibLoggerSettings">

            Holds configuration settings for <see cref="T:Common.Logging.EntLib.EntLibLogger"/>s.

            <author>Erich Eichinger</author>
        </member>
        <member name="F:Common.Logging.EntLib.EntLibLoggerSettings.DEFAULTPRIORITY">

            the default priority used for logging.

        </member>
        <member name="F:Common.Logging.EntLib.EntLibLoggerSettings.DEFAULTEXCEPTIONFORMAT">

            the default <see cref="F:Common.Logging.EntLib.EntLibLoggerSettings.exceptionFormat"/> used for formatting error message

            <remarks>
            "Exception[ message = $(exception.message), source = $(exception.source), targetsite = $(exception.targetsite), stacktrace = $(exception.stacktrace) ]"
            </remarks>
        </member>
        <member name="F:Common.Logging.EntLib.EntLibLoggerSettings.priority">

            the default priority to be used.

        </member>
        <member name="F:Common.Logging.EntLib.EntLibLoggerSettings.exceptionFormat">

            the exception format to be used.

        </member>
        <member name="M:Common.Logging.EntLib.EntLibLoggerSettings.#ctor(System.Int32,System.String)">

            Initializes a new instance.

        </member>
        <member name="T:Common.Logging.EntLib.NamespaceDoc">

            <para>
            This namespace contains the implementations to plug Microsoft Enterprise Logging Library 6.0. into the Common.Logging infrastructure.
            </para>
            <para>For an example on how to configure
            <list type="bullet">
            <item>Common.Logging to render its output to Entlib, see <see cref="T:Common.Logging.EntLib.EntLibLoggerFactoryAdapter"/>.</item>
            <item>Entlib to render its output to Common.Logging use <see cref="T:Common.Logging.EntLib.CommonLoggingEntlibTraceListener"/>.</item>
            </list>
            </para>

        </member>
        <member name="T:Common.Logging.EntLib.SeverityFilter">

            Filters <see cref="T:Microsoft.Practices.EnterpriseLibrary.Logging.LogEntry"/>s by severity (see <see cref="T:System.Diagnostics.TraceEventType"/>).

            <author>Erich Eichinger</author>
        </member>
        <member name="M:Common.Logging.EntLib.SeverityFilter.#ctor(System.String,System.Int32)">

            Creates a new filter instance

        </member>
        <member name="M:Common.Logging.EntLib.SeverityFilter.#ctor(System.String,System.Diagnostics.TraceEventType)">

            Creates a new filter instance

        </member>
        <member name="M:Common.Logging.EntLib.SeverityFilter.#ctor(Common.Logging.Configuration.NameValueCollection)">

            Creates a new filter instance

        </member>
        <member name="M:Common.Logging.EntLib.SeverityFilter.Filter(Microsoft.Practices.EnterpriseLibrary.Logging.LogEntry)">

            Check, if <paramref name="log"/> severity matches <see cref="F:Common.Logging.EntLib.SeverityFilter.severityMask"/>.

            <param name="log"></param>
            <returns></returns>
        </member>
        <member name="M:Common.Logging.EntLib.SeverityFilter.ShouldLog(System.Diagnostics.TraceEventType)">

            Checks, whether the specified severity is allowed to log.

        </member>
        <member name="P:Common.Logging.EntLib.SeverityFilter.SeverityMask">

            Bitmask to identify severity levels that should be logged.

        </member>
    </members>
</doc>


text:
#region BSD License

#endregion

namespace Clide.Solution.Implementation
{
    using System.ComponentModel.Composition;

    // TODO: see if the [MetadataAttribute] can be applied on the TreeNodeFactoryAttribute base class instead.
    [MetadataAttribute]
    internal class FallbackFactoryAttribute : TreeNodeFactoryAttribute
	{
        public FallbackFactoryAttribute()
            : base(true)
		{
		}
	}
}


text:
<!DOCTYPE html>

  <meta charset="utf-8"> <meta name="description" content="Documentation for Selenium">

 <link rel="icon" href="https://seleniumhq.github.io/docs/site/es/images/favicon.png" type="image/png">

  <title>404 Page not found</title>

    <link href="https://seleniumhq.github.io/docs/site/es/css/nucleus.css?1571349419" rel="stylesheet">
    <link href="https://seleniumhq.github.io/docs/site/es/css/fontawesome-all.min.css?1571349419" rel="stylesheet">
    <link href="https://seleniumhq.github.io/docs/site/es/css/hybrid.css?1571349419" rel="stylesheet">
    <link href="https://seleniumhq.github.io/docs/site/es/css/featherlight.min.css?1571349419" rel="stylesheet">
    <link href="https://seleniumhq.github.io/docs/site/es/css/perfect-scrollbar.min.css?1571349419" rel="stylesheet">
    <link href="https://seleniumhq.github.io/docs/site/es/css/theme.css?1571349419" rel="stylesheet">
    <link href="https://seleniumhq.github.io/docs/site/es/css/hugo-theme.css?1571349419" rel="stylesheet">

      <link href="https://seleniumhq.github.io/docs/site/es/css/theme-selenium.css?1571349419" rel="stylesheet">

Error

Ups. Parece que la página no existe ¯\_(ツ)_/¯.

Ir al inicio


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Bull. trimest. Soc. mycol. Fr. 99(1): 65 (1983)

#### Original name
Cortinarius planodepressus Rob. Henry

### Remarks
null


text:
package lavaplayer.filter;

import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.ShortBuffer;
import java.util.Collection;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import lavaplayer.format.AudioDataFormat;
import lavaplayer.track.playback.AudioProcessingContext;

/**
 * Collects buffers of the required chunk size and passes them on to audio post processors.
 */
public class FinalPcmAudioFilter implements FloatPcmAudioFilter, ShortPcmAudioFilter, SplitShortPcmAudioFilter {
  private static final Logger log = LoggerFactory.getLogger(FinalPcmAudioFilter.class);
  private static final short[] zeroPadding = new short[128];

  private final AudioDataFormat format;
  private final ShortBuffer frameBuffer;
  private final Collection<AudioPostProcessor> postProcessors;

  private long ignoredFrames;
  private long timecodeBase;
  private long timecodeSampleOffset;

  /**
   * @param context Configuration and output information for processing
   * @param postProcessors Post processors to pass the final audio buffers to
   */
  public FinalPcmAudioFilter(AudioProcessingContext context, Collection<AudioPostProcessor> postProcessors) {
    this.format = context.outputFormat;
    this.frameBuffer = ByteBuffer.allocateDirect(format.bufferSize(2)).order(ByteOrder.nativeOrder()).asShortBuffer();
    this.postProcessors = postProcessors;

    timecodeBase = 0;
    timecodeSampleOffset = 0;
  }

  private short decodeSample(float sample) {
    return (short) Math.min(Math.max((int)(sample * 32768.f), -32768), 32767);
  }

  @Override
  public void seekPerformed(long requestedTime, long providedTime) {
    frameBuffer.clear();
    ignoredFrames = requestedTime > providedTime ? (requestedTime - providedTime) * format.channelCount * format.sampleRate / 1000L : 0;
    timecodeBase = Math.max(requestedTime, providedTime);
    timecodeSampleOffset = 0;

    if (ignoredFrames > 0) {
      log.debug("Ignoring {} frames due to inaccurate seek (requested {}, provided {}).", ignoredFrames, requestedTime, providedTime);
    }
  }

  @Override
  public void flush() throws InterruptedException {
    if (frameBuffer.position() > 0) {
      fillFrameBuffer();
      dispatch();
    }
  }

  @Override
  public void close() {
    for (AudioPostProcessor postProcessor : postProcessors) {
      postProcessor.close();
    }
  }

  private void fillFrameBuffer() {
    while (frameBuffer.remaining() >= zeroPadding.length) {
      frameBuffer.put(zeroPadding);
    }

    while (frameBuffer.remaining() > 0) {
      frameBuffer.put((short) 0);
    }
  }

  @Override
  public void process(short[] input, int offset, int length) throws InterruptedException {
    for (int i = 0; i < length; i++) {
      if (ignoredFrames > 0) {
        ignoredFrames--;
      } else {
        frameBuffer.put(input[offset + i]);

        dispatch();
      }
    }
  }

  @Override
  public void process(short[][] input, int offset, int length) throws InterruptedException {
    int secondChannelIndex = Math.min(1, input.length - 1);

    for (int i = 0; i < length; i++) {
      if (ignoredFrames > 0) {
        ignoredFrames -= 2;
      } else {
        frameBuffer.put(input[0][offset + i]);
        frameBuffer.put(input[secondChannelIndex][offset + i]);

        dispatch();
      }
    }
  }

  @Override
  public void process(ShortBuffer buffer) throws InterruptedException {
    ShortBuffer local = buffer.duplicate();

    while (buffer.remaining() > 0) {
      if (ignoredFrames > 0) {
        ignoredFrames--;
      } else {
        int chunk = Math.min(buffer.remaining(), frameBuffer.remaining());
        local.position(buffer.position());
        local.limit(local.position() + chunk);

        frameBuffer.put(local);
        dispatch();

        buffer.position(buffer.position() + chunk);
      }
    }
  }

  @Override
  public void process(float[][] buffer, int offset, int length) throws InterruptedException {
    int secondChannelIndex = Math.min(1, buffer.length - 1);

    for (int i = 0; i < length; i++) {
      if (ignoredFrames > 0) {
        ignoredFrames -= 2;
      } else {
        frameBuffer.put(decodeSample(buffer[0][offset + i]));
        frameBuffer.put(decodeSample(buffer[secondChannelIndex][offset + i]));

        dispatch();
      }
    }
  }

  private void dispatch() throws InterruptedException {
    if (!frameBuffer.hasRemaining()) {
      long timecode = timecodeBase + timecodeSampleOffset * 1000 / format.sampleRate;
      frameBuffer.clear();

      for (AudioPostProcessor postProcessor : postProcessors) {
        postProcessor.process(timecode, frameBuffer);
      }

      frameBuffer.clear();

      timecodeSampleOffset += format.chunkSampleCount;
    }
  }
}


text:
**⚠ This project is not maintained anymore, and I'm looking for a kind person who can take it over from me.
If you can inherit this project, please send a pull request to this README.md linking to your project so that we can direct people to the new home.**

Further maintenance of the repo can be found here:
* [scommons/statictags](https://github.com/scommons/statictags)

[![Build Status](https://travis-ci.org/shogowada/statictags.svg?branch=master)](https://travis-ci.org/shogowada/statictags)

|Platform|Artifact|Scala Version|Scala JS Version|
|---|---|---|---|
|JVM|```"io.github.shogowada" %% "statictags" % "2.5.0"```|2.11, 2.12|NA|
|JS|```"io.github.shogowada" %%% "statictags" % "2.5.0"```|2.11, 2.12|0.6.14+|

Static Tags makes it easy for you to write HTML in Scala.

- [Examples](#examples)
- [Step by Step](#step-by-step)
- [Notable Features](#notable-features)
- [Extending Static Tags](#extending-static-tags)

## Examples

All Static Tags element can be converted to HTML via ```toString``` method.

```scala
import io.github.shogowada.statictags.StaticTags._

class ToUpperCase(text: String) {
  override def toString: String = text.toUpperCase
}

val example = <.div(^.id := "example")(
  <.p(^.`class` := Seq("main-paragraph", "main-paragraph-bold"))("This is a paragraph."),
  "This is a text.",
  new ToUpperCase("Anything other than Static Tags element is converted to string.")
)

println(example)
```

The above code will output the minified version of the following HTML.

```html
<div id="example">
  <p class="main-paragraph main-paragraph-bold">This is a paragraph.</p>
  This is a text.
  ANYTHING OTHER THAN STATIC TAGS ELEMENT IS CONVERTED TO STRING.
</div>
```

Note that when you use Static Tags, for example, you don't need to worry if the ```class``` attribute value was space delimited or comma delimited. You can just give it a collection of strings, and Static Tags takes care the rest for you. This is one of many advantages of using Static Tags!

## Step by Step

1. Import Static Tags.
    - ```import io.github.shogowada.statictags.StaticTags._```
2. Start with ```<``` to write element.
    - ```<.div```
    - Think of ```<``` as the opening of standard tags (E.g. ```<div>```).
3. Start with ```^``` to write attributes and pass it to the first parameter group.
    - ```<.div(^.id := "foo")```
4. Pass child elements to the second parameter group.
    - ```<.div(^.id := "foo")("bar")```

## Notable Features

### Flattening attributes and elements

```scala
<.div()(
  "When the element is an option,",
  None,
  Some("it will be flattened."),
  Seq(
    "Elements in sequence",
    "will be flattened too."
  )
)
```
is equlvalent of
```scala
<.div()(
  "When the element is an option,",
  "it will be flattened.",
  "Elements in sequence",
  "will be flattened too."
)
```

You can do the same for attributes.

### Dynamically writing elements and attributes

You can dynamically write elements and attributes by using `<(String)` for elements and `^(String)` for attributes.

```scala
<("foo")(
  ^("a") := "A",
  ^("b") := true,
  ^("c") := false
)()
```
```html
<foo a="A" b></foo>
```

However, if it is a custom attribute that's specific to your application, we'd recommend [extending Static Tags](#extending-static-tags) so that you get full benefit of the Scala's strong type system.

If it is a standard element or attribute that's missing in the library, we'd appreciate if you could [create an issue](https://github.com/shogowada/statictags/issues) or PR.

### Static "type" attribute values

All the standard "type" attribute values are defined. You can assess them like this:

```scala
<.input(^.`type`.password)()
```

It will construct the following HTML:

```html
<input type="password">
```

### Static media types

All the standard media types are defined at `MediaTypes` object.

Example:
```scala
import io.github.shogowada.statictags.MediaTypes

MediaTypes.`application/json`
```

## Extending Static Tags

You can add your own elements and attributes, as well as your own deserializer. And it's super easy!

```scala
case class MyElementWrapper(element: Element)

object MyStaticTags extends StaticTags {

  class MyElements extends Elements {
    lazy val myElement = ElementSpec(name = "myElement")
  }

  class MyAttributes extends Attributes {

    case class MyAttributeSpec(name: String) extends AttributeSpec {
      def :=(value: Int) = { // Create an attribute with := operator
        Attribute[Int](name = name, value = value)
      }

      lazy val one = this := 1 // Or have an attribute as constant

      def sumOf(lhs: Int, rhs: Int) = { // Or create an attribute with custom function
        this := (lhs + rhs)
      }
    }

    lazy val myAttribute = MyAttributeSpec("myAttribute")
  }

  override val < = new MyElements
  override val ^ = new MyAttributes

  implicit def asMyElementWrapper(element: Element): MyElementWrapper = {
    // You can implicitly convert it into whatever you want!
    MyElementWrapper(element)
  }
}
```

If you had code like above, you can use it like below.

```scala
import MyStaticTags._ // This imports all of your custom code, including implicit conversion

val element = <.div(
  ^.myAttribute.one
)(
  <.myElement(
    ^.`class` := Seq("my-element"),
    ^.myAttribute := 2
  )(
    <.p(
      ^.myAttribute.sumOf(1, 2)
    )("How easy it is to extend the StaticTags!")
  )
)

println(element) // Use it as HTML string

val myElementWrapper: MyElementWrapper = element // Use it as your custom element
```

If you want to create an add-on to Static Tags instead of building something on top of it, you can create an implicit class of ```Elements``` and ```Attributes``` too.


text:
.class public Lcom/htc/opensense/social/UploadDataHelper;
.super Ljava/lang/Object;
.source "UploadDataHelper.java"

# static fields
.field public static final DELAY_MILLIS:I = 0x1388

.field private static INSERT_LIMIT:I

.field private static LOG_TAG:Ljava/lang/String;

# direct methods
.method static constructor <clinit>()V
    .locals 1

    .prologue
    .line 32
    const-string v0, "ReceiverHelper"

    sput-object v0, Lcom/htc/opensense/social/UploadDataHelper;->LOG_TAG:Ljava/lang/String;

    .line 34
    const/16 v0, 0xa

    sput v0, Lcom/htc/opensense/social/UploadDataHelper;->INSERT_LIMIT:I

    return-void
.end method

.method public constructor <init>()V
    .locals 0

    .prologue
    .line 30
    invoke-direct/range {p0 .. p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method public static declared-synchronized batchUpload(Landroid/content/Context;[Landroid/content/ContentValues;Landroid/content/ContentValues;)I
    .locals 18
    .parameter "context"
    .parameter "uploadValues"
    .parameter "batchValue"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Landroid/database/SQLException;
        }
    .end annotation

    .prologue
    .line 173
    const-class v16, Lcom/htc/opensense/social/UploadDataHelper;

    monitor-enter v16

    :try_start_0
    invoke-virtual/range {p0 .. p0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v1

    .line 174
    .local v1, cr:Landroid/content/ContentResolver;
    const/4 v7, -0x1

    .line 175
    .local v7, batch_id:I
    sget-object v3, Lcom/htc/opensense/social/UploadDataHelper;->LOG_TAG:Ljava/lang/String;

    const-string v4, "batch upload"

    invoke-static {v3, v4}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 176
    const/4 v10, 0x0

    .local v10, i:I
    :goto_0
    move-object/from16 v0, p1

    array-length v3, v0

    if-ge v10, v3, :cond_1

    .line 177
    aget-object v3, p1, v10

    const-string v4, "mode"

    invoke-virtual {v3, v4}, Landroid/content/ContentValues;->get(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Ljava/lang/Integer;

    invoke-virtual {v3}, Ljava/lang/Integer;->intValue()I
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    move-result v3

    const/4 v4, 0x1

    if-eq v3, v4, :cond_0

    .line 178
    const/4 v3, -0x1

    .line 236
    :goto_1
    monitor-exit v16

    return v3

    .line 176
    :cond_0
    add-int/lit8 v10, v10, 0x1

    goto :goto_0

    .line 181
    :cond_1
    :try_start_1
    sget-object v3, Lcom/htc/opensense/social/UploadDataHelper;->LOG_TAG:Ljava/lang/String;

    const-string v4, "batch upload start insert"

    invoke-static {v3, v4}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 187
    sget-object v3, Lcom/htc/opensense/social/Uploads;->BACTH_CONTENT_URI:Landroid/net/Uri;

    move-object/from16 v0, p2

    invoke-virtual {v1, v3, v0}, Landroid/content/ContentResolver;->insert(Landroid/net/Uri;Landroid/content/ContentValues;)Landroid/net/Uri;

    move-result-object v2

    .line 188
    .local v2, batchUri:Landroid/net/Uri;
    if-nez v2, :cond_2

    .line 189
    new-instance v3, Landroid/database/SQLException;

    const-string v4, "Could not insert update upload"

    invoke-direct {v3, v4}, Landroid/database/SQLException;-><init>(Ljava/lang/String;)V

    throw v3
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    .line 173
    .end local v1           #cr:Landroid/content/ContentResolver;
    .end local v2           #batchUri:Landroid/net/Uri;
    .end local v7           #batch_id:I
    .end local v10           #i:I
    :catchall_0
    move-exception v3

    monitor-exit v16

    throw v3

    .line 193
    .restart local v1       #cr:Landroid/content/ContentResolver;
    .restart local v2       #batchUri:Landroid/net/Uri;
    .restart local v7       #batch_id:I
    .restart local v10       #i:I
    :cond_2
    const/4 v3, 0x1

    :try_start_2
    new-array v3, v3, [Ljava/lang/String;

    const/4 v4, 0x0

    const-string v5, "_id"

    aput-object v5, v3, v4

    const/4 v4, 0x0

    const/4 v5, 0x0

    const/4 v6, 0x0

    invoke-virtual/range {v1 .. v6}, Landroid/content/ContentResolver;->query(Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v8

    .line 196
    .local v8, cursor:Landroid/database/Cursor;
    invoke-interface {v8}, Landroid/database/Cursor;->moveToNext()Z

    move-result v3

    if-eqz v3, :cond_3

    .line 197
    const-string v3, "_id"

    invoke-interface {v8, v3}, Landroid/database/Cursor;->getColumnIndexOrThrow(Ljava/lang/String;)I

    move-result v3

    invoke-interface {v8, v3}, Landroid/database/Cursor;->getInt(I)I

    move-result v7

    .line 198
    sget-object v3, Lcom/htc/opensense/social/UploadDataHelper;->LOG_TAG:Ljava/lang/String;

    new-instance v4, Ljava/lang/StringBuilder;

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

    const-string v5, "1batch id: "

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4, v7}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-static {v3, v4}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 200
    :cond_3
    invoke-interface {v8}, Landroid/database/Cursor;->close()V

    .line 204
    new-instance v12, Ljava/util/ArrayList;

    invoke-direct {v12}, Ljava/util/ArrayList;-><init>()V

    .line 205
    .local v12, operations:Ljava/util/ArrayList;,"Ljava/util/ArrayList<Landroid/content/ContentProviderOperation;>;"
    move-object/from16 v0, p1

    array-length v11, v0

    .line 206
    .local v11, length:I
    const/4 v10, 0x0

    :goto_2
    if-ge v10, v11, :cond_6

    .line 207
    aget-object v14, p1, v10

    .line 208
    .local v14, value:Landroid/content/ContentValues;
    const-string v3, "batch_id"

    invoke-static {v7}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v4

    invoke-virtual {v14, v3, v4}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Integer;)V

    .line 209
    const-string v3, "status"

    const/16 v4, 0xbe

    invoke-static {v4}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v4

    invoke-virtual {v14, v3, v4}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Integer;)V

    .line 210
    invoke-static {v14}, Lcom/htc/opensense/social/UploadDataHelper;->getInsertItemOperation(Landroid/content/ContentValues;)Landroid/content/ContentProviderOperation$Builder;

    move-result-object v3

    invoke-virtual {v3}, Landroid/content/ContentProviderOperation$Builder;->build()Landroid/content/ContentProviderOperation;

    move-result-object v3

    invoke-virtual {v12, v3}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    .line 211
    sget v3, Lcom/htc/opensense/social/UploadDataHelper;->INSERT_LIMIT:I

    rem-int v3, v10, v3

    sget v4, Lcom/htc/opensense/social/UploadDataHelper;->INSERT_LIMIT:I
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_0

    add-int/lit8 v4, v4, -0x1

    if-eq v3, v4, :cond_4

    add-int/lit8 v3, v11, -0x1

    if-ne v10, v3, :cond_5

    .line 213
    :cond_4
    :try_start_3
    sget-object v3, Lcom/htc/opensense/social/UploadDataHelper;->LOG_TAG:Ljava/lang/String;

    const-string v4, "apply batch"

    invoke-static {v3, v4}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 214
    const-string v3, "uploads"

    invoke-virtual {v1, v3, v12}, Landroid/content/ContentResolver;->applyBatch(Ljava/lang/String;Ljava/util/ArrayList;)[Landroid/content/ContentProviderResult;

    .line 215
    invoke-virtual {v12}, Ljava/util/ArrayList;->clear()V
    :try_end_3
    .catchall {:try_start_3 .. :try_end_3} :catchall_0
    .catch Landroid/os/RemoteException; {:try_start_3 .. :try_end_3} :catch_0
    .catch Landroid/content/OperationApplicationException; {:try_start_3 .. :try_end_3} :catch_1

    .line 206
    :cond_5
    :goto_3
    add-int/lit8 v10, v10, 0x1

    goto :goto_2

    .line 216
    :catch_0
    move-exception v9

    .line 218
    .local v9, e:Landroid/os/RemoteException;
    :try_start_4
    invoke-virtual {v9}, Landroid/os/RemoteException;->printStackTrace()V

    goto :goto_3

    .line 219
    .end local v9           #e:Landroid/os/RemoteException;
    :catch_1
    move-exception v9

    .line 221
    .local v9, e:Landroid/content/OperationApplicationException;
    invoke-virtual {v9}, Landroid/content/OperationApplicationException;->printStackTrace()V

    goto :goto_3

    .line 226
    .end local v9           #e:Landroid/content/OperationApplicationException;
    .end local v14           #value:Landroid/content/ContentValues;
    :cond_6
    new-instance v13, Landroid/content/Intent;

    invoke-direct {v13}, Landroid/content/Intent;-><init>()V

    .line 227
    .local v13, uploadService:Landroid/content/Intent;
    new-instance v3, Landroid/content/ComponentName;

    const-string v4, "com.htc.providers.uploads"

    const-string v5, "com.htc.providers.uploads.UploadService"

    invoke-direct {v3, v4, v5}, Landroid/content/ComponentName;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    invoke-virtual {v13, v3}, Landroid/content/Intent;->setComponent(Landroid/content/ComponentName;)Landroid/content/Intent;

    .line 230
    move-object/from16 v0, p0

    invoke-virtual {v0, v13}, Landroid/content/Context;->startService(Landroid/content/Intent;)Landroid/content/ComponentName;

    .line 231
    sget-object v3, Lcom/htc/opensense/social/Uploads;->UPLOADS_CONTENT_URI:Landroid/net/Uri;

    const/4 v4, 0x0

    invoke-virtual {v1, v3, v4}, Landroid/content/ContentResolver;->notifyChange(Landroid/net/Uri;Landroid/database/ContentObserver;)V

    .line 232
    new-instance v15, Landroid/content/ContentValues;

    invoke-direct {v15}, Landroid/content/ContentValues;-><init>()V

    .line 233
    .local v15, values:Landroid/content/ContentValues;
    const-string v3, "status"

    const/16 v4, 0xbd

    invoke-static {v4}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v4

    invoke-virtual {v15, v3, v4}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Integer;)V

    .line 234
    sget-object v3, Lcom/htc/opensense/social/Uploads;->UPLOADS_CONTENT_URI:Landroid/net/Uri;

    const-string v4, "batch_id=?"

    const/4 v5, 0x1

    new-array v5, v5, [Ljava/lang/String;

    const/4 v6, 0x0

    invoke-static {v7}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v17

    aput-object v17, v5, v6

    invoke-virtual {v1, v3, v15, v4, v5}, Landroid/content/ContentResolver;->update(Landroid/net/Uri;Landroid/content/ContentValues;Ljava/lang/String;[Ljava/lang/String;)I
    :try_end_4
    .catchall {:try_start_4 .. :try_end_4} :catchall_0

    move v3, v7

    .line 236
    goto/16 :goto_1
.end method

.method public static fillBatchValue(Ljava/util/HashMap;ILjava/lang/String;Ljava/lang/String;)Landroid/content/ContentValues;
    .locals 7
    .parameter
    .parameter "createMode"
    .parameter "service"
    .parameter "title"
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/HashMap",
            "<",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            ">;I",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            ")",
            "Landroid/content/ContentValues;"
        }
    .end annotation

    .prologue
    .local p0, selectAlbum:Ljava/util/HashMap;,"Ljava/util/HashMap<Ljava/lang/String;Ljava/lang/String;>;"
    const/4 v6, 0x0

    .line 74
    new-instance v3, Landroid/content/ContentValues;

    invoke-direct {v3}, Landroid/content/ContentValues;-><init>()V

    .line 75
    .local v3, value:Landroid/content/ContentValues;
    const-string v4, "album_id"

    invoke-virtual {p0, v4}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v4

    check-cast v4, Ljava/lang/String;

    const-string v5, "-1"

    invoke-virtual {v4, v5}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v4

    if-eqz v4, :cond_0

    .line 77
    const-string v4, "aid"

    const-string v5, "-1"

    invoke-virtual {v3, v4, v5}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    .line 78
    const-string v4, "create_album_mode"

    invoke-static {v6}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v5

    invoke-virtual {v3, v4, v5}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Integer;)V

    .line 79
    const-string v4, "move_to_album"

    const/4 v5, 0x1

    invoke-static {v5}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v5

    invoke-virtual {v3, v4, v5}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Integer;)V

    .line 97
    :goto_0
    const-string v4, "service_provider"

    invoke-virtual {v3, v4, p2}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    .line 98
    const-string v4, "service_title"

    invoke-virtual {v3, v4, p3}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    .line 100
    return-object v3

    .line 81
    :cond_0
    const-string v4, "album_id"

    invoke-virtual {p0, v4}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/String;

    .line 82
    .local v0, aid:Ljava/lang/String;
    const-string v4, "album_name"

    invoke-virtual {p0, v4}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Ljava/lang/String;

    .line 83
    .local v1, albumName:Ljava/lang/String;
    const-string v4, "description"

    invoke-virtual {p0, v4}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/lang/String;

    .line 84
    .local v2, description:Ljava/lang/String;
    if-eqz v1, :cond_1

    .line 85
    const-string v4, "album_name"

    invoke-virtual {v3, v4, v1}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    .line 86
    :cond_1
    if-eqz v2, :cond_2

    .line 87
    const-string v4, "description"

    invoke-virtual {v3, v4, v2}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    .line 88
    :cond_2
    const-string v4, "aid"

    invoke-virtual {v3, v4, v0}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    .line 89
    const-string v4, "create_album_mode"

    invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v5

    invoke-virtual {v3, v4, v5}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Integer;)V

    .line 90
    const-string v4, "description"

    invoke-virtual {v3, v4, v2}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    .line 91
    const-string v4, "visible"

    invoke-virtual {p0, v4}, Ljava/util/HashMap;->containsKey(Ljava/lang/Object;)Z

    move-result v4

    if-eqz v4, :cond_3

    .line 92
    const-string v5, "privacy"

    const-string v4, "visible"

    invoke-virtual {p0, v4}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v4

    check-cast v4, Ljava/lang/String;

    invoke-static {v4}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I

    move-result v4

    invoke-static {v4}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v4

    invoke-virtual {v3, v5, v4}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Integer;)V

    goto :goto_0

    .line 95
    :cond_3
    const-string v4, "privacy"

    invoke-static {v6}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v5

    invoke-virtual {v3, v4, v5}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Integer;)V

    goto :goto_0
.end method

.method public static fillValues(Lcom/htc/socialnetwork/PhotoMetaData;I)Landroid/content/ContentValues;
    .locals 5
    .parameter "photo"
    .parameter "isPublic"

    .prologue
    const/4 v4, 0x1

    .line 49
    new-instance v0, Ljava/io/File;

    iget-object v2, p0, Lcom/htc/socialnetwork/PhotoMetaData;->path:Ljava/lang/String;

    invoke-direct {v0, v2}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 50
    .local v0, uFile:Ljava/io/File;
    new-instance v1, Landroid/content/ContentValues;

    invoke-direct {v1}, Landroid/content/ContentValues;-><init>()V

    .line 52
    .local v1, value:Landroid/content/ContentValues;
    const-string v2, "mode"

    invoke-static {v4}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v3

    invoke-virtual {v1, v2, v3}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Integer;)V

    .line 53
    const-string v2, "method"

    invoke-static {v4}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v3

    invoke-virtual {v1, v2, v3}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Integer;)V

    .line 54
    const-string v2, "hint"

    invoke-virtual {v0}, Ljava/io/File;->getName()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v1, v2, v3}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    .line 55
    const-string v2, "_data"

    invoke-virtual {v0}, Ljava/io/File;->getPath()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v1, v2, v3}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    .line 56
    const-string v2, "file_uri"

    iget-object v3, p0, Lcom/htc/socialnetwork/PhotoMetaData;->uri:Ljava/lang/String;

    invoke-virtual {v1, v2, v3}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    .line 57
    const-string v2, "mimetype"

    iget-object v3, p0, Lcom/htc/socialnetwork/PhotoMetaData;->mimeType:Ljava/lang/String;

    invoke-virtual {v1, v2, v3}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    .line 58
    const-string v2, "visibility"

    invoke-static {v4}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v3

    invoke-virtual {v1, v2, v3}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Integer;)V

    .line 60
    const-string v2, "total_bytes"

    invoke-virtual {v0}, Ljava/io/File;->length()J

    move-result-wide v3

    invoke-static {v3, v4}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v3

    invoke-virtual {v1, v2, v3}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Long;)V

    .line 61
    const-string v2, "title"

    iget-object v3, p0, Lcom/htc/socialnetwork/PhotoMetaData;->title:Ljava/lang/String;

    invoke-virtual {v1, v2, v3}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    .line 62
    const-string v2, "description"

    iget-object v3, p0, Lcom/htc/socialnetwork/PhotoMetaData;->description:Ljava/lang/String;

    invoke-virtual {v1, v2, v3}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    .line 63
    const-string v2, "privacy"

    invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v3

    invoke-virtual {v1, v2, v3}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Integer;)V

    .line 64
    return-object v1
.end method

.method public static getInsertItemOperation(Landroid/content/ContentValues;)Landroid/content/ContentProviderOperation$Builder;
    .locals 1
    .parameter "values"

    .prologue
    .line 245
    sget-object v0, Lcom/htc/opensense/social/Uploads;->UPLOADS_CONTENT_URI:Landroid/net/Uri;

    invoke-static {v0}, Landroid/content/ContentProviderOperation;->newInsert(Landroid/net/Uri;)Landroid/content/ContentProviderOperation$Builder;

    move-result-object v0

    invoke-virtual {v0, p0}, Landroid/content/ContentProviderOperation$Builder;->withValues(Landroid/content/ContentValues;)Landroid/content/ContentProviderOperation$Builder;

    move-result-object v0

    return-object v0
.end method

.method public static getPhotoMetaDataByUri(Landroid/content/Context;Landroid/net/Uri;Ljava/lang/String;)Lcom/htc/socialnetwork/PhotoMetaData;
    .locals 12
    .parameter "context"
    .parameter "image"
    .parameter "mimeType"

    .prologue
    const/4 v3, 0x0

    .line 117
    sget-object v0, Lcom/htc/opensense/social/UploadDataHelper;->LOG_TAG:Ljava/lang/String;

    new-instance v1, Ljava/lang/StringBuilder;

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

    const-string v2, "image "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 118
    invoke-virtual {p1}, Landroid/net/Uri;->toString()Ljava/lang/String;

    move-result-object v0

    const-string v1, "content:"

    invoke-virtual {v0, v1}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_3

    .line 119
    invoke-virtual {p0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v1

    move-object v0, p0

    move-object v2, p1

    move-object v4, v3

    move-object v5, v3

    move-object v6, v3

    invoke-static/range {v0 .. v6}, Lcom/google/android/mms/util/SqliteWrapper;->query(Landroid/content/Context;Landroid/content/ContentResolver;Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v7

    .line 121
    .local v7, c:Landroid/database/Cursor;
    if-eqz v7, :cond_2

    .line 122
    invoke-interface {v7}, Landroid/database/Cursor;->moveToNext()Z

    move-result v0

    if-eqz v0, :cond_1

    .line 123
    const-string v0, "_data"

    invoke-interface {v7, v0}, Landroid/database/Cursor;->getColumnIndexOrThrow(Ljava/lang/String;)I

    move-result v0

    invoke-interface {v7, v0}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v10

    .line 125
    .local v10, filePath:Ljava/lang/String;
    new-instance v11, Ljava/io/File;

    invoke-direct {v11, v10}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 126
    .local v11, uFile:Ljava/io/File;
    new-instance v8, Lcom/htc/socialnetwork/PhotoMetaData;

    invoke-direct {v8}, Lcom/htc/socialnetwork/PhotoMetaData;-><init>()V

    .line 127
    .local v8, data:Lcom/htc/socialnetwork/PhotoMetaData;
    invoke-virtual {v11}, Ljava/io/File;->getPath()Ljava/lang/String;

    move-result-object v0

    iput-object v0, v8, Lcom/htc/socialnetwork/PhotoMetaData;->path:Ljava/lang/String;

    .line 128
    invoke-virtual {v11}, Ljava/io/File;->getName()Ljava/lang/String;

    move-result-object v0

    iput-object v0, v8, Lcom/htc/socialnetwork/PhotoMetaData;->title:Ljava/lang/String;

    .line 129
    iput-object p2, v8, Lcom/htc/socialnetwork/PhotoMetaData;->mimeType:Ljava/lang/String;

    .line 130
    invoke-virtual {v11}, Ljava/io/File;->canRead()Z

    move-result v0

    if-nez v0, :cond_0

    .line 131
    invoke-virtual {p1}, Landroid/net/Uri;->toString()Ljava/lang/String;

    move-result-object v0

    iput-object v0, v8, Lcom/htc/socialnetwork/PhotoMetaData;->uri:Ljava/lang/String;

    .line 147
    .end local v7           #c:Landroid/database/Cursor;
    .end local v8           #data:Lcom/htc/socialnetwork/PhotoMetaData;
    .end local v10           #filePath:Ljava/lang/String;
    .end local v11           #uFile:Ljava/io/File;
    :cond_0
    :goto_0
    return-object v8

    .line 134
    .restart local v7       #c:Landroid/database/Cursor;
    :cond_1
    invoke-interface {v7}, Landroid/database/Cursor;->close()V

    .end local v7           #c:Landroid/database/Cursor;
    :cond_2
    move-object v8, v3

    .line 147
    goto :goto_0

    .line 137
    :cond_3
    new-instance v9, Ljava/io/File;

    invoke-virtual {p1}, Landroid/net/Uri;->getPath()Ljava/lang/String;

    move-result-object v0

    invoke-direct {v9, v0}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 138
    .local v9, file:Ljava/io/File;
    invoke-virtual {v9}, Ljava/io/File;->exists()Z

    move-result v0

    if-eqz v0, :cond_2

    .line 139
    sget-object v0, Lcom/htc/opensense/social/UploadDataHelper;->LOG_TAG:Ljava/lang/String;

    new-instance v1, Ljava/lang/StringBuilder;

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

    const-string v2, "meta file "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v9}, Ljava/io/File;->getPath()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 140
    new-instance v8, Lcom/htc/socialnetwork/PhotoMetaData;

    invoke-direct {v8}, Lcom/htc/socialnetwork/PhotoMetaData;-><init>()V

    .line 141
    .restart local v8       #data:Lcom/htc/socialnetwork/PhotoMetaData;
    invoke-virtual {v9}, Ljava/io/File;->getPath()Ljava/lang/String;

    move-result-object v0

    iput-object v0, v8, Lcom/htc/socialnetwork/PhotoMetaData;->path:Ljava/lang/String;

    .line 142
    invoke-virtual {v9}, Ljava/io/File;->getName()Ljava/lang/String;

    move-result-object v0

    iput-object v0, v8, Lcom/htc/socialnetwork/PhotoMetaData;->title:Ljava/lang/String;

    .line 143
    iput-object p2, v8, Lcom/htc/socialnetwork/PhotoMetaData;->mimeType:Ljava/lang/String;

    goto :goto_0
.end method

.method public static getPhotoMetaDataFromBundle(Landroid/content/Context;Landroid/os/Bundle;)Lcom/htc/socialnetwork/PhotoMetaData;
    .locals 3
    .parameter "context"
    .parameter "bundle"

    .prologue
    .line 156
    const-string v2, "mimeType"

    invoke-virtual {p1, v2}, Landroid/os/Bundle;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    .line 157
    .local v1, mimeType:Ljava/lang/String;
    const-string v2, "uri"

    invoke-virtual {p1, v2}, Landroid/os/Bundle;->getParcelable(Ljava/lang/String;)Landroid/os/Parcelable;

    move-result-object v2

    check-cast v2, Landroid/net/Uri;

    invoke-static {p0, v2, v1}, Lcom/htc/opensense/social/UploadDataHelper;->getPhotoMetaDataByUri(Landroid/content/Context;Landroid/net/Uri;Ljava/lang/String;)Lcom/htc/socialnetwork/PhotoMetaData;

    move-result-object v0

    .line 159
    .local v0, data:Lcom/htc/socialnetwork/PhotoMetaData;
    if-nez v0, :cond_0

    .line 160
    const/4 v0, 0x0

    .line 163
    .end local v0           #data:Lcom/htc/socialnetwork/PhotoMetaData;
    :goto_0
    return-object v0

    .line 161
    .restart local v0       #data:Lcom/htc/socialnetwork/PhotoMetaData;
    :cond_0
    const-string v2, "title"

    invoke-virtual {p1, v2}, Landroid/os/Bundle;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    iput-object v2, v0, Lcom/htc/socialnetwork/PhotoMetaData;->title:Ljava/lang/String;

    .line 162
    const-string v2, "description"

    invoke-virtual {p1, v2}, Landroid/os/Bundle;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    iput-object v2, v0, Lcom/htc/socialnetwork/PhotoMetaData;->description:Ljava/lang/String;

    goto :goto_0
.end method


text:
<?php

namespace Symfony\Component\Security\Core\Encoder;

/**
 * PasswordEncoderInterface is the interface for all encoders.
 *
 * @author Fabien Potencier <fabien@symfony.com>
 */
interface PasswordEncoderInterface
{
    /**
     * Encodes the raw password.
     *
     * @param string $raw  The password to encode
     * @param string $salt The salt
     *
     * @return string The encoded password
     */
    public function encodePassword($raw, $salt);

    /**
     * Checks a raw password against an encoded password.
     *
     * @param string $encoded An encoded password
     * @param string $raw     A raw password
     * @param string $salt    The salt
     *
     * @return bool true if the password is valid, false otherwise
     */
    public function isPasswordValid($encoded, $raw, $salt);
}


text:
#include <elf.c>

#include "test.h"
#include "elf.t"

#include "mmu.h"

#define INIT_PID  1
#define INIT_PATH "/sbin/init"

static void setup(void) {
  page_init();
  fs_init();

  mmu_init();
  mmu_enable();
}

static void assert_pattern(int pat, uint8_t *start, uint8_t *end) {
  uint8_t *current;

  TEST_ASSERT(start < end);

  for (current = start; current < end; ++current) {
    TEST_ASSERT(*current == pat);
  }
}

TEST(test_elf) {
  struct elf_executable executable;

  uint8_t *text, *data;
  uint32_t text_start, text_end;
  uint32_t data_start, data_end;
  uint32_t fill_start, fill_end;

  setup();
  elf_load(INIT_PATH, &executable);

  text = page_address(executable.text.page);
  data = page_address(executable.data.page);

  text_start = executable.text.addr;
  text_end   = executable.text.addr + executable.text.memory_size;
  data_start = executable.data.addr;
  data_end   = executable.data.addr + executable.data.memory_size;
  TEST_ASSERT(text_start <= text_end);
  TEST_ASSERT(text_end <= data_start);
  TEST_ASSERT(data_start <= data_end);

  fill_start = text_start - 0x1000;
  fill_end   = data_end   + 0x1000;
  TEST_ASSERT(fill_start < fill_end);

  mmu_alloc(INIT_PID, fill_start, fill_end - fill_start);
  mmu_set_ttb(INIT_PID);

  memset((char*)fill_start, 0xff, fill_end - fill_start);
  elf_copy(&executable);

  TEST_ASSERT(!memcmp(text, (void*)executable.text.addr, executable.text.memory_size));
  TEST_ASSERT(!memcmp(data, (void*)executable.data.addr, executable.data.file_size));

  assert_pattern(
    0x00,
    (uint8_t*)executable.data.addr + executable.data.file_size,
    (uint8_t*)executable.data.addr + executable.data.memory_size
  );

  assert_pattern(0xff, (uint8_t*)fill_start, (uint8_t*)text_start);
  assert_pattern(0xff, (uint8_t*)text_end,   (uint8_t*)data_start);
  assert_pattern(0xff, (uint8_t*)data_end,   (uint8_t*)fill_end);

  elf_release(&executable);
  TEST_ASSERT(!executable.text.page);
  TEST_ASSERT(!executable.data.page);
}


text:
module Types::PaginationInterface
  include Types::BaseInterface

  description <<~MARKDOWN
    PaginationInterface provides a way to use offset-based pagination on a list of objects. This
    is useful for UIs such as Intercode's table views, which provide a way to jump between numbered
    pages.

    Page numbers in PaginationInterface are 1-based (so, the first page is page 1, then page 2,
    etc.) The number of items per page can be controlled via the per_page argument on paginated
    fields. It defaults to 20, and can go up to 200.

    Offset-based pagination is different from
    [Relay's cursor-based pagination](https://relay.dev/graphql/connections.htm) that is more
    commonly used in GraphQL APIs. We chose to go with an offset-based approach due to our UI
    needs, but if a cursor-based approach is desirable in the future, we may also implement Relay
    connections alongside our existing pagination fields.
  MARKDOWN

  field :total_entries, Integer, null: false, camelize: false do
    description 'The total number of items in the paginated list (across all pages)'
  end
  field :total_pages, Integer, null: false, camelize: false do
    description 'The total number of pages in the paginated list'
  end
  field :current_page, Integer, null: false, camelize: false do
    description 'The number of the page currently being returned in this query'
  end
  field :per_page, Integer, null: false, camelize: false do
    description 'The number of items per page currently being returned in this query'
  end

  definition_methods do
    def resolve_type(obj, _ctx)
      "Types::#{obj.klass.name}Type".safe_constantize
    end
  end
end


text:
<?php
require __DIR__ . '/src/APIs/Module.php';


text:
package com.ait.tooling.server.core.test;

import org.junit.AfterClass;
import org.junit.BeforeClass;

import com.ait.tooling.server.core.logging.MDC;
import com.ait.tooling.server.core.support.spring.testing.cucumber.ServerCoreCucumberTest;

public class RunCukesTest extends ServerCoreCucumberTest
{
    @BeforeClass
    public static void setUp() throws Exception
    {
        MDC.put("session", support().uuid() + "-GLOBAL");

        TestingOps.setupServerCoreDefault("classpath:/com/ait/tooling/server/core/test/ApplicationContext.xml", "classpath:/com/ait/tooling/server/core/config/CoreApplicationContext.xml");
    }

    @AfterClass
    public static void tearDown()
    {
        TestingOps.closeServerCoreDefault();
    }
}