text:
"""Test the with statement for Byterun."""

from __future__ import print_function
from . import vmtest

import six
PY3 = six.PY3

class TestWithStatement(vmtest.VmTestCase):

    def test_simple_context_manager(self):
        self.assert_ok("""\
            class NullContext(object):
                def __enter__(self):
                    l.append('i')
                    # __enter__ usually returns self, but doesn't have to.
                    return 17

                def __exit__(self, exc_type, exc_val, exc_tb):
                    l.append('o')
                    return False

            l = []
            for i in range(3):
                with NullContext() as val:
                    assert val == 17
                    l.append('w')
                l.append('e')
            l.append('r')
            s = ''.join(l)
            print("Look: %r" % s)
            assert s == "iwoeiwoeiwoer"
            """)

    def test_raise_in_context_manager(self):
        self.assert_ok("""\
            class NullContext(object):
                def __enter__(self):
                    l.append('i')
                    return self

                def __exit__(self, exc_type, exc_val, exc_tb):
                    assert exc_type is ValueError, \\
                        "Expected ValueError: %r" % exc_type
                    l.append('o')
                    return False

            l = []
            try:
                with NullContext():
                    l.append('w')
                    raise ValueError("Boo!")
                l.append('e')
            except ValueError:
                l.append('x')
            l.append('r')
            s = ''.join(l)
            print("Look: %r" % s)
            assert s == "iwoxr"
            """)

    def test_suppressed_raise_in_context_manager(self):
        self.assert_ok("""\
            class SuppressingContext(object):
                def __enter__(self):
                    l.append('i')
                    return self

                def __exit__(self, exc_type, exc_val, exc_tb):
                    assert exc_type is ValueError, \\
                        "Expected ValueError: %r" % exc_type
                    l.append('o')
                    return True

            l = []
            try:
                with SuppressingContext():
                    l.append('w')
                    raise ValueError("Boo!")
                l.append('e')
            except ValueError:
                l.append('x')
            l.append('r')
            s = ''.join(l)
            print("Look: %r" % s)
            assert s == "iwoer"
            """)

    def test_return_in_with(self):
        self.assert_ok("""\
            class NullContext(object):
                def __enter__(self):
                    l.append('i')
                    return self

                def __exit__(self, exc_type, exc_val, exc_tb):
                    l.append('o')
                    return False

            l = []
            def use_with(val):
                with NullContext():
                    l.append('w')
                    return val
                l.append('e')

            assert use_with(23) == 23
            l.append('r')
            s = ''.join(l)
            print("Look: %r" % s)
            assert s == "iwor"
            """)

    def test_continue_in_with(self):
        self.assert_ok("""\
            class NullContext(object):
                def __enter__(self):
                    l.append('i')
                    return self

                def __exit__(self, exc_type, exc_val, exc_tb):
                    l.append('o')
                    return False

            l = []
            for i in range(3):
                with NullContext():
                    l.append('w')
                    if i % 2:
                       continue
                    l.append('z')
                l.append('e')

            l.append('r')
            s = ''.join(l)
            print("Look: %r" % s)
            assert s == "iwzoeiwoiwzoer"
            """)

    def test_break_in_with(self):
        self.assert_ok("""\
            class NullContext(object):
                def __enter__(self):
                    l.append('i')
                    return self

                def __exit__(self, exc_type, exc_val, exc_tb):
                    l.append('o')
                    return False

            l = []
            for i in range(3):
                with NullContext():
                    l.append('w')
                    if i % 2:
                       break
                    l.append('z')
                l.append('e')

            l.append('r')
            s = ''.join(l)
            print("Look: %r" % s)
            assert s == "iwzoeiwor"
            """)

    def test_raise_in_with(self):
        self.assert_ok("""\
            class NullContext(object):
                def __enter__(self):
                    l.append('i')
                    return self

                def __exit__(self, exc_type, exc_val, exc_tb):
                    l.append('o')
                    return False

            l = []
            try:
                with NullContext():
                    l.append('w')
                    raise ValueError("oops")
                    l.append('z')
                l.append('e')
            except ValueError as e:
                assert str(e) == "oops"
                l.append('x')
            l.append('r')
            s = ''.join(l)
            print("Look: %r" % s)
            assert s == "iwoxr", "What!?"
            """)

    def test_at_context_manager_simplified(self):
        self.assert_ok("""\
            class GeneratorContextManager(object):
                def __init__(self, gen):
                    self.gen = gen

                def __enter__(self):
                    try:
                        return next(self.gen)
                    except StopIteration:
                        raise RuntimeError("generator didn't yield")

                def __exit__(self, type, value, traceback):
                    if type is None:
                        try:
                            next(self.gen)
                        except StopIteration:
                            return
                        else:
                            raise RuntimeError("generator didn't stop")
                    else:
                        if value is None:
                            value = type()
                        try:
                            self.gen.throw(type, value, traceback)
                            raise RuntimeError(
                                "generator didn't stop after throw()"
                            )
                        except StopIteration as exc:
                            return exc is not value
                        except:
                            if sys.exc_info()[1] is not value:
                                raise

            def contextmanager(func):
                def helper(*args, **kwds):
                    return GeneratorContextManager(func(*args, **kwds))
                return helper

            @contextmanager
            def my_context_manager(val):
                yield val

            with my_context_manager(17) as x:
                assert x == 17
            """)

    def test_at_context_manager_complete(self):
        # The complete code for an @contextmanager example, lifted from
        # the stdlib.
        self.assert_ok("""\
            from _functools import partial

            WRAPPER_ASSIGNMENTS = ('__module__', '__name__', '__doc__')
            WRAPPER_UPDATES = ('__dict__',)

            def update_wrapper(wrapper,
                            wrapped,
                            assigned = WRAPPER_ASSIGNMENTS,
                            updated = WRAPPER_UPDATES):
                for attr in assigned:
                    setattr(wrapper, attr, getattr(wrapped, attr))
                for attr in updated:
                    getattr(wrapper, attr).update(getattr(wrapped, attr, {}))
                # Return the wrapper so this can be used as a decorator
                # via partial().
                return wrapper

            def wraps(wrapped,
                    assigned = WRAPPER_ASSIGNMENTS,
                    updated = WRAPPER_UPDATES):
                return partial(update_wrapper, wrapped=wrapped,
                            assigned=assigned, updated=updated)

            class GeneratorContextManager(object):
                def __init__(self, gen):
                    self.gen = gen

                def __enter__(self):
                    try:
                        return next(self.gen)
                    except StopIteration:
                        raise RuntimeError("generator didn't yield")

                def __exit__(self, type, value, traceback):
                    if type is None:
                        try:
                            next(self.gen)
                        except StopIteration:
                            return
                        else:
                            raise RuntimeError("generator didn't stop")
                    else:
                        if value is None:
                            value = type()
                        try:
                            self.gen.throw(type, value, traceback)
                            raise RuntimeError(
                                "generator didn't stop after throw()"
                            )
                        except StopIteration as exc:
                            return exc is not value
                        except:
                            if sys.exc_info()[1] is not value:
                                raise

            def contextmanager(func):
                @wraps(func)
                def helper(*args, **kwds):
                    return GeneratorContextManager(func(*args, **kwds))
                return helper

            @contextmanager
            def my_context_manager(val):
                yield val

            with my_context_manager(17) as x:
                assert x == 17
            """)

    if PY3:
        def test_generator_with_context_manager(self):
            self.assert_ok("""\
                from contextlib import contextmanager

                def inner():
                    yield "I'm inner!"

                def foo():
                    yield from inner()

                    @contextmanager
                    def cmgr():
                        yield "Context Manager!"
                    raise StopIteration(cmgr())

                def main():
                    with (yield from foo()) as x:
                        print(x)

                def run(fn, *args):
                    x = fn(*args)
                    while True:
                        try:
                            print(next(x))
                        except StopIteration as e:
                            return e.value
                run(main)
            """)


text:
<?php
// autogenerated file 05.05.2008 16:30
// $Id: $
// $Log: $
//
require_once 'EbatNs_FacetType.php';

/**
 *
 *
 *
 * @property string Ascending
 * @property string Descending
 * @property string CustomCode
 */
class EbatNsCsSetExt_SortOrderCodeType extends EbatNs_FacetType
{
	const CodeType_Ascending = 'Ascending';
	const CodeType_Descending = 'Descending';
	const CodeType_CustomCode = 'CustomCode';

	/**
	 * @return
	 */
	function __construct()
	{
		parent::__construct('EbatNsCsSetExt_SortOrderCodeType', 'http://www.intradesys.com/Schemas/ebay/AttributeData_Extension.xsd');

	}
}

$Facet_EbatNsCsSetExt_SortOrderCodeType = new EbatNsCsSetExt_SortOrderCodeType();

?>

redpajama_set_name: RedPajamaGithub


text:
install:
	mkdir server
	go build -buildmode=plugin -o server/http.so plugins/transports/http/main.go
	go build -buildmode=plugin -o server/base32.so plugins/encoders/base32/main.go
	go build -buildmode=plugin -o server/base64.so plugins/encoders/base64/main.go
	go build -buildmode=plugin -o server/hex.so plugins/encoders/hex/main.go
	go build -buildmode=plugin -o server/des.so plugins/crypto/des/main.go
	go build -buildmode=plugin -o server/rc4.so plugins/crypto/rc4/main.go
	go build -buildmode=plugin -o server/aes_ctr.so plugins/crypto/aes_ctr/main.go
	go build -buildmode=plugin -o server/basic.so plugins/info/basic/main.go
	mkdir server/plugins
	go build -buildmode=plugin -o server/plugins/shellcode.so plugins/payloads/shellcode/main.go
	cd cmd/menu && go get -v && go build -v
	mv cmd/menu/menu server/
	cp config.toml server/
	cp http.toml server/
clean:
	rm -r server


text:
<title>
AKI - Adnkronos international                Algeria: Al-Qaeda claims northern attack
</title>

<link rel="shortcut icon" href="../img/favicon.ico" type="image/x-icon">

<link href="http://www.adnkronos.com/RSS/RSS_Ultimora.xml" rel="alternate" type="application/rss+xml" title="rss">

Giuseppe Marra Communications

-

today's themes

:

Middle East

Serbia

Iraq

<form action="javascript:void(0)" name="adnsearch">

<input name="words" value="" class="text" size="63" maxlength="50" type="text">

<input src="../img/trova.gif" name="HTDigSearch" type="image">

<input name="cerca" value="../ext/adnsearch_int.php" checked="checked" type="radio">

this site
<input name="cerca" value="../ext/adnsearch_ext.php" type="radio">

the web

</form>

Security

Algeria: Al-Qaeda claims northern attack

Naciriya, 2 Jan. (AKI) - Al-Qaeda in the Islamic Maghreb has claimed Wednesday's deadly bomb attack against a police station in the northern town of Niciriya, in Boumerdes province, east of Algiers, Arabic satellite TV network al-Arabiya reported.

A suicide bomber, named as Abdullah, blew himself up in the attack, in which a truck with 500 kilgrammes of TNT explosives, Al-Qaeda in the Islamic Maghreb said, quoted by al-Arabiya.

The bombing killed at least three people and wounded seven, according to the interior ministry. It provided no further details of the attack.

Close to 50 people were killed in militant attacks in Algeria in December, the last of which was in the Boumerdes area on 26 December.

Two police officers were killed and two more injured in a remotely detonated bombing that targeted a road patrol.

A total 41 people were killed and many were wounded in two suicide attacks at the Supreme Court and the office of the UN refugee agency in Algiers.

The attacks were claimed by al-Qaeda in the Islamic Maghreb. The terror formation grew out of the local Islamist insurgency movement, the Salafite Group for Preaching and Combat (GPSC).

Up to 200,000 people are estimated to have been killed in Algeria since 1992, when an insurgeny erupted after the army annulled polls a now-banned Islamist party was poised to win.

<link href="/IGN/Overture/2Level.php_files/overture.css" type="text/css" rel="stylesheet">

segnala questa notizia su:

print

send

All news about

SECURITY

all news

le notizie

15:44

Italy: University staff and students protest against papal visit

13:53

Iraq: Rice makes surprise visit to Baghdad

12:26

Serbia: War crimes defendant attacks prosecutors

12:00

Afghanistan: Militant arrested over Kabul hotel bombing

11:43

Iraq: Athletes seek political asylum in Cyprus

11:27

Middle East: Israeli raids kill at least ten militants in Gaza

11:23

Middle East: Israeli raids kill at least ten militants in Gaza

11:09

Pakistan: Seven soldiers killed in Taliban ambush in border area

15:46

Libano: al-Jazeera, un morto e 8 feriti in esplosione Beirut

15:43

Libano: al-Jazeera, esplosione a Beirut

15:15

Turchia: stampa, Ankara mira a diventare centro regionale per arricchimento uranio

15:11

Terrorismo: cinque ex generali Nato propongono direttorio transatlantico

15:09

Iraq: studenti curdi in sciopero, sotto accusa l'ateneo di Sulaymaniya

14:58

Italia-India: Akbar, la nostra forza e' l'unita' nella diversita' (2)

14:58

Libano: si scioglie gruppo armato 'Jund al-Sham'

14:58

Italia-India: Akbar, la nostra forza e' l'unita' nella diversita'

15:32

??????? ????? ???????? ?????? ????? ?????????? ?? ??????

15:26

????? ???? ????? ????????? ?????? ???? ??? ??? ???????? ????? ????????

15:15

??? ?????? ?? ????? ????? ?????? ?????? ?????? ??????? ??? ???????

15:07

???? ????? ???? ???????? ????????: ?? ???? ??? ?????? ??????? ???? ????

14:59

???? ?????? ???? ???????: ??? ??? ???? ?? ????? ?????? ?????? ?????

14:26

???? ????? ??????? ????????? ??????? ?? ???: ????? ???? ?????? ???????? ??? ???????

14:15

??????: ????? ???? ???? ????? ????? ???? ??????? ?????? ????? ?????? ??????

13:43

??????? ?????: ????? ???? ???? ?????? ????? ????????? ??? ?????? ?????? ???? ?????

Features

Business

Kosovo: Natural resources key to the future, say experts

Business

Iran: Focus - Sanctions disrupt the economy

Business

Italy: Country 'depressed' but not in economic decline say experts

Security

Terrorism: European attacks 'inevitable' as al Qaeda influence spreads, say experts

culture and media

Science: Italo-American scientists  patent the 'music' of DNA cells

 AKI English

home

politics

business

security

culture and media

religion

sport

video

photogallery

all news

AKI Italiano

AKI Arabic

AKI Crises Today

IGN

Salute

Metropolisinfo

LabItalia

Musei on line

Palazzo dell'

Informazione

Prontoitalia

Immediapress

highlights

'Lupercal' unearthed

info

about  GMC  group

rss

Contacts

adnkronos international

aki crises today

© 2007 Giuseppe Marra Communications - Partita IVA 01145141006

AKI - Adnkronos International - Testata giornalistica registrata. Registrazione numero 156  del 7 aprile 2003  presso il Tribunale di Roma. Direttore responsabile Giuseppe Pasquale Marra


text:
<!doctype html>

		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">

		<title>Accessibility Matters.</title>

		<link rel="stylesheet" href="css/reveal.css">
		<link rel="stylesheet" href="css/theme/white.css">

		<link rel="stylesheet" href="lib/css/zenburn.css">

						Accessibility is important. Let's do something about it.

						Just as the title says, I'm here to talk to y'all about accessibility, why it's super important, how you can make it a priority at your company, and I'm also going to leave you with some tips to start implementing and testing it in your work.

Hi! I'm Ally Palanzi.

Front-End Engineer @ Nava

@mylifeasalllly

						My name is Ally Palanzi and I'm a front-end engineer at Nava, working on HealthCare.gov.

allypalanzi.com/a11y-codepen

						At this URL you can find slides, if you want to follow along. I'll also tweet this!

						How many of you include accessibility in your work flow currently?

						So what is accessibility anyways?

Accessibility (a11y) refers to the design of products, devices, services, or environments for people who experience disabilities.

						Read the dang slide

						In 2001 the World Health Organization redefined disability as: "a mismatch in interaction between the features of a person's body and the features of the environment in which they live."

						read the slide

Our work can create or remove mismatches in interaction.

						As designers, developers and people who make stuff, our work can create or remove these mismatches in interaction

The impact of disability is radically changed on the Web because the Web removes barriers to communication and interaction that many people face in the physical world.

					W3C Accessibility

By designing with disabilities in mind, we create better products for everyone.

						By designing with disabilities in mind, we create better products for everyone.

						It's important to not think of disability as something that only effects a subset of users. It's not something you can tell from your analytics, you can't see who's using a screen reader on your webpage, and there's not a great way to test for if folks are only using keyboards to interact with your site.

Disability affects all of us at some point.

Permanent

Temporary

Situational

						Microsoft Design

						Disability can effect anyone at some point in their life, or even all within a day.

						Disability can be permanent, temporary, or situational.

						A user who might be using your website with a mouse one morning could have a child in their arms later that night, and only able to interact with your page via a keyboard.

Ok, but why should we care?

a.k.a. what to tell your boss

						So, I get it. It can be hard to advocate for accessibility when you don't have analytics to prove progress or improvements, but you've just gotta trust the facts.

It's better for business

Device independence

Usability

Design for older users

SEO

						Building accessible products and websites is truly better for business.

						A lot of thinking about accessibility feeds into other best practices such as device independence — your product should work across devices.

						your product should be usable,
						older users should be able to use your site,

						and a word all important execs and clients  like to hear: SEO. If a screen reader can access your site properly, so can google's indexing crawler.

Case studies show that accessible websites have better search results, reduced maintenance, and increased audience reach.

					W3C Accessibility Overview

						Case studies show that accessible websites are just better overall — better search results, less maintenance, and increased audience reach.

Accessibility supports social inclusion, allowing us to hire more diversely & reach a diverse audience.

						Everyone should want to hire more diversely & reach diverse audiences — accessibility supports social inclusion

Scary legal things!!

						Also scary legal things! Companies like Netflix and Sweegreen have already experienced lawsuits for having accessibility issues.

						Things like creating internal tools that employees are required to use to get their job done, if inaccessible, might mean that you can't hire as diversely as you should, or it might mean you're disadvantaging disabled employees to do their job.

						This obviously very important for someone like me who works with the government, but was also equally important for my previous jobs in journalism as we create tools for our reporters to publish content on our websites.

Many countries are recognizing and acting upon the need to ensure access to the web for people with disabilities.

					Web Aim

						Many countries are recognizing and acting upon the need to ensure access to the web for people with disabilities.

A common approach throughout the world is for nations to adopt the Web Content Accessibility Guidelines.

						WCAG is developed through the W3C process & explains how to make web content more accessible to people with disabilities

USA 🇺🇸

Section 508 of the Rehabilitation Act means that all users, regardless of disability status, can access technology.

					 	It is a mandate for government agencies, federally funded non-profits, public colleges and schools to pass a certain standard of accessibility.

Australia 🇦🇺

World Wide Web Access: Disability Discrimination Act Advisory Notes requires equal access for people with a disability where it can reasonably be provided.

					 	Similarly to the US 508 compliance this mandates for government, banking, and education sites to be accessible.

Europe 🇪🇺

EU Charter of Fundamental Rights Article 21 prohibits discrimination based on grounds of disability, among others.

...and more!

					WebAIM World Laws

					 	Each country is slightly different, but it's important to be aware of what accessibility laws pertain to your work.

And if this still doesn't convince your stakeholders...

Ask for forgiveness later

					 	Build accessibility in! No one is going to be mad at you for making your products accessible (I hope).

Accessibility best practicies

						Okay, so enough of that. I'm going to teach you something you can start using immediately.

Make sure there is enough contrast between text and its background color.

Don't indicate important information using color alone

Pair values of colors together (not only hues) to increase contrast

Design accessible forms

Fields should have labels that are always present, error messages should be clear

Build accessible forms

Always have labels, don't rely on placeholder text

Labels should not disappear on form focus

Use fieldset and legend for larger forms like a checklist

<label for="name">Name:</label>
<input id="name" type="text" name="name">

<fieldset>
  <legend>Select your pizza toppings:</legend>

  <input id="ham" type="checkbox" name="toppings" value="ham">
  <label for="ham">Ham</label>
  <input id="pepperoni" type="checkbox" name="toppings" value="pepperoni">
  <label for="pepperoni">Pepperoni</label>
</fieldset>

Use semantic HTML

Limit div soup, strip unnecessary HTML elements

Use headings  h1-h6  for content structure

Avoid skipping headings in the same sections

It's okay to have multiple of the same heading on a page.

<html lang="en">
 <head>
  <title></title>
 </head>
 <body>
  <header></header>
  <nav></nav>
  <section></section>
  <article></article>
  <aside></aside>
  <footer></footer>
 </body>
</html>

						W3C HTML5 Semantic Elements

HTML Landmarks

These landmarks help define specific areas that a user might want to seek out and can save them a lot of time.

<header> for role="banner"

<main> for role="main"

<nav> for role="navigation"

<footer> for role="contentinfo"

<aside> for role="complementary"

HTML document should have a language attribute

						<html lang="en"> </html>

Focus States

NEVER remove focus states from elements

Design better ones or leave them as-is

These should not be subtle – they should stand out so users can tell what item they are tabbing to

*:focus {
 outline: none; //BAD!!!
}

Know when to use buttons vs. links

Linking to something outside the page? Use an anchor tag.

Performing an action on the page? Use a button.

Search it here
<button type="button">Submit this form</button>

Make links descriptive

"click here" vs. "read more about cute puppies"

This is also helpful for SEO!

Write good alt text for your images, hide decorative images

<img src="catomg.jpg" alt="cute fluffy cat">
<img src="border.png" aria-hidden="true">

Accessible Inline SVGs

SVGs are often used as icons on interactive elements in sites. The SVG should have a title or description, then you can use the aria-labelledby attribute to tell the screen reader what element to use to describe the SVG.

<svg aria-labelledby="title">
 <title id="title">Green rectangle</title>
 <rect width="75" height="50" rx="20" ry="20" fill="#90ee90" stroke="#228b22" stroke-fill="1" />
</svg>

					Sitepoint Tips for Creating Accessible SVG

If an experience cannot be made accessible, create another route for assistive tech.

Maps, charts, graphs might be more accessible as HTML tables.

Allow viewport zooming

<meta name="viewport" content="maximum-scale=1">

Support keyboard navigation

Users should be able to tab through the entire page

Don't allow "keyboard traps"

Okay accessibility is cool or whatever but now what?

Accessibility is everyone's responsibility

Don't hesitate to push back on inaccessible designs

Semantic HTML goes a long way

Testing best practices

Navigate the page with your keyboard

Add accessibility to your project checklist just as you would any other function or feature

Include a11y in your device/browser QA process

Test early and often!

Celebrating wins!

Tota11y bookmarklet

Colour Contrast Analyser

Let's make our work better!

Tools & Resources:

Vox Product Accessibility Guidelines

WAVE Chrome extension

Colorsafe: To make accessible palettes

Color Oracle: To simulate color blindness

Microsoft Inclusive Design Toolkit

Interactive WCAG

508 Compliance Checker

Web Content Accessibility Guidelines

W3C Markup Validation

Thank you!

@mylifeasalllly

#codependc

@mylifeasalllly


text:
"""Tests for the McAfee AV Log parser."""

import unittest

# pylint: disable=unused-import
from plaso.formatters import mcafeeav as mcafeeav_formatter
from plaso.lib import event
from plaso.lib import eventdata
from plaso.parsers import mcafeeav
from plaso.parsers import test_lib

class McafeeAccessProtectionUnitTest(test_lib.ParserTestCase):
  """Tests for the McAfee AV Log parser."""

  def setUp(self):
    """Sets up the needed objects used throughout the test."""
    pre_obj = event.PreprocessObject()
    self._parser = mcafeeav.McafeeAccessProtectionParser(pre_obj)

  def testParse(self):
    """Tests the Parse function."""
    test_file = self._GetTestFilePath(['AccessProtectionLog.txt'])
    event_generator = self._ParseFile(self._parser, test_file)
    event_objects = self._GetEventObjects(event_generator)

    # The file contains 14 lines which results in 14 event objects.
    self.assertEquals(len(event_objects), 14)

    # Test that the UTF-8 byte order mark gets removed from the first line.
    event_object = event_objects[0]

    self.assertEquals(event_object.timestamp, 1380292946000000)

    # Test this entry:
    # 9/27/2013 2:42:26 PM  Blocked by Access Protection rule
    #   SOMEDOMAIN\someUser C:\Windows\System32\procexp64.exe C:\Program Files
    # (x86)\McAfee\Common Framework\UdaterUI.exe  Common Standard
    # Protection:Prevent termination of McAfee processes  Action blocked :
    # Terminate

    event_object = event_objects[1]

    self.assertEquals(event_object.timestamp, 1380292959000000)
    self.assertEquals(event_object.username, u'SOMEDOMAIN\\someUser')
    self.assertEquals(
        event_object.full_path, u'C:\\Windows\\System32\\procexp64.exe')

    expected_msg = (
        u'File Name: C:\\Windows\\System32\\procexp64.exe '
        u'User: SOMEDOMAIN\\someUser '
        u'C:\\Program Files (x86)\\McAfee\\Common Framework\\Frame'
        u'workService.exe '
        u'Blocked by Access Protection rule  '
        u'Common Standard Protection:Prevent termination of McAfee processes '
        u'Action blocked : Terminate')
    expected_msg_short = (
        u'C:\\Windows\\System32\\procexp64.exe '
        u'Action blocked : Terminate')

    self._TestGetMessageStrings(event_object, expected_msg, expected_msg_short)

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


text:
<?php

namespace Fuel\Fieldset\Input;

/**
 * Defines a radio button
 *
 * @package Fuel\Fieldset\Input
 * @since   2.0
 * @author  Fuel Development Team
 */
class Radio extends Toggle
{

	/**
	 * @param string $name
	 * @param array  $attributes
	 * @param mixed  $value
	 *
	 * @since 2.0
	 */
	public function __construct($name = '', array $attributes = [], $value = null)
	{
		$attributes['type'] = 'radio';
		parent::__construct($name, $attributes, $value);
	}

}


text:
using System.Net;

namespace Microsoft.AspNetCore.Http.Features;

/// <summary>
/// Default implementation for <see cref="IHttpConnectionFeature"/>.
/// </summary>
public class HttpConnectionFeature : IHttpConnectionFeature
{
    /// <inheritdoc />
    public string ConnectionId { get; set; } = default!;

    /// <inheritdoc />
    public IPAddress? LocalIpAddress { get; set; }

    /// <inheritdoc />
    public int LocalPort { get; set; }

    /// <inheritdoc />
    public IPAddress? RemoteIpAddress { get; set; }

    /// <inheritdoc />
    public int RemotePort { get; set; }
}


text:
package instance

import (
	"testing"

	"github.com/kubernetes-incubator/service-catalog/pkg/apis/servicecatalog"
	checksum "github.com/kubernetes-incubator/service-catalog/pkg/apis/servicecatalog/checksum/unversioned"
)

func instanceWithFalseReadyCondition() *servicecatalog.Instance {
	return &servicecatalog.Instance{
		Spec: servicecatalog.InstanceSpec{
			ServiceClassName: "test-serviceclass",
			PlanName:         "test-plan",
		},
		Status: servicecatalog.InstanceStatus{
			Conditions: []servicecatalog.InstanceCondition{
				{
					Type:   servicecatalog.InstanceConditionReady,
					Status: servicecatalog.ConditionFalse,
				},
			},
		},
	}
}

func instanceWithTrueReadyCondition() *servicecatalog.Instance {
	return &servicecatalog.Instance{
		Spec: servicecatalog.InstanceSpec{
			ServiceClassName: "test-serviceclass",
			PlanName:         "test-plan",
		},
		Status: servicecatalog.InstanceStatus{
			Conditions: []servicecatalog.InstanceCondition{
				{
					Type:   servicecatalog.InstanceConditionReady,
					Status: servicecatalog.ConditionTrue,
				},
			},
		},
	}
}

func TestValidateUpdateStatusPrepareForUpdate(t *testing.T) {
	cases := []struct {
		name                string
		old                 *servicecatalog.Instance
		newer               *servicecatalog.Instance
		shouldChecksum      bool
		checksumShouldBeSet bool
	}{
		{
			name:                "not ready -> not ready",
			old:                 instanceWithFalseReadyCondition(),
			newer:               instanceWithFalseReadyCondition(),
			shouldChecksum:      false,
			checksumShouldBeSet: false,
		},
		{
			name: "not ready -> not ready, checksum already set",
			old: func() *servicecatalog.Instance {
				i := instanceWithFalseReadyCondition()
				cs := "22081-9471-471"
				i.Status.Checksum = &cs
				return i
			}(),
			newer:               instanceWithFalseReadyCondition(),
			shouldChecksum:      false,
			checksumShouldBeSet: true,
		},
		{
			name:           "not ready -> ready",
			old:            instanceWithFalseReadyCondition(),
			newer:          instanceWithTrueReadyCondition(),
			shouldChecksum: true,
		},
	}

	for _, tc := range cases {
		strategy := instanceStatusUpdateStrategy
		strategy.PrepareForUpdate(nil /* api context */, tc.newer, tc.old)

		if tc.shouldChecksum {
			if tc.newer.Status.Checksum == nil {
				t.Errorf("%v: Checksum should have been set", tc.name)
				continue
			}

			if e, a := checksum.InstanceSpecChecksum(tc.newer.Spec), *tc.newer.Status.Checksum; e != a {
				t.Errorf("%v: Checksum was incorrect; expected %v got %v", tc.name, e, a)
			}
		} else if tc.checksumShouldBeSet != (tc.newer.Status.Checksum != nil) {
			t.Errorf("%v: expected checksum to be populated, but was nil", tc.name)
		}
	}
}