text:
package gov.samhsa.consent2share.service.consent;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyLong;
import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import echosign.api.clientv20.dto16.EmbeddedWidgetCreationResult;
import gov.samhsa.consent2share.common.AuthenticatedUser;
import gov.samhsa.consent2share.common.UserContext;
import gov.samhsa.consent2share.domain.consent.Consent;
import gov.samhsa.consent2share.domain.consent.ConsentPdfGenerator;
import gov.samhsa.consent2share.domain.consent.ConsentRepository;
import gov.samhsa.consent2share.domain.consent.SignedPDFConsent;
import gov.samhsa.consent2share.domain.consent.SignedPDFConsentRevocation;
import gov.samhsa.consent2share.domain.patient.Patient;
import gov.samhsa.consent2share.domain.patient.PatientRepository;
import gov.samhsa.consent2share.domain.provider.IndividualProviderRepository;
import gov.samhsa.consent2share.domain.provider.OrganizationalProvider;
import gov.samhsa.consent2share.domain.provider.OrganizationalProviderRepository;
import gov.samhsa.consent2share.domain.reference.ClinicalDocumentSectionTypeCodeRepository;
import gov.samhsa.consent2share.domain.reference.ClinicalDocumentTypeCodeRepository;
import gov.samhsa.consent2share.domain.reference.PurposeOfUseCodeRepository;
import gov.samhsa.consent2share.domain.reference.SensitivityPolicyCodeRepository;
import gov.samhsa.consent2share.infrastructure.EchoSignSignatureService;
import gov.samhsa.consent2share.service.consentexport.ConsentExportService;
import gov.samhsa.consent2share.service.dto.ConsentDto;
import gov.samhsa.consent2share.service.dto.ConsentListDto;
import gov.samhsa.consent2share.service.dto.ConsentPdfDto;
import gov.samhsa.consent2share.service.dto.ConsentRevokationPdfDto;

import java.util.ArrayList;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.function.Consumer;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import org.springframework.data.domain.Page;

/**
 * The Class ConsentServiceImplTest.
 */
@RunWith(MockitoJUnitRunner.class)
public class ConsentServiceImplTest {

	/** The consent repository. */
	@Mock
	ConsentRepository consentRepository;

	/** The consent pdf generator. */
	@Mock
	ConsentPdfGenerator consentPdfGenerator;

	/** The patient repository. */
	@Mock
	private PatientRepository patientRepository;

	/** The individual provider repository. */
	@Mock
	IndividualProviderRepository individualProviderRepository;

	/** The organizational provider repository. */
	@Mock
	OrganizationalProviderRepository organizationalProviderRepository;

	/** The clinical document type code repository. */
	@Mock
	ClinicalDocumentTypeCodeRepository clinicalDocumentTypeCodeRepository;

	/** The clinical document section type code repository. */
	@Mock
	ClinicalDocumentSectionTypeCodeRepository clinicalDocumentSectionTypeCodeRepository;

	/** The sensitivity policy code repository. */
	@Mock
	SensitivityPolicyCodeRepository sensitivityPolicyCodeRepository;

	/** The purpose of use code repository. */
	@Mock
	PurposeOfUseCodeRepository purposeOfUseCodeRepository;

	/** The echo sign signature service. */
	@Mock
	EchoSignSignatureService echoSignSignatureService;

	/** The consent check service. */
	@Mock
	ConsentCheckService consentCheckService;

	/** The user context. */
	@Mock
	UserContext userContext;

	@Mock
	ConsentExportService consentExportService;

	@Mock
	Set<ConsentAssertion> consentAssertions;

	@Mock
	PolicyIdService policyIdService;

	/** The cst. */
	@InjectMocks
	ConsentServiceImpl cst;

	byte[] DOCUMENT_BYTES = "text".getBytes();
	String DOCUMENT_FILE_NAME = "documentFileName";
	String DOCUMENT_NAME = "documentName";
	String SIGNED_DOCUMENT_URL = "signedDocumentUrl";
	String EMAIL = "consent2shar@gmail.com";
	String ECHOSIGN_API_KEY = "echoSignApiKey";
	String ECHOSIGN_SERVICE_URL = "echoSignServiceUrl";
	final String PATIENT_EID = "PATIENT_EID";
	final String PATIENT_LocalID = "PATIENT_LocalId";
	final String NPI_1 = "NPI_1";
	final String NPI_2 = "NPI_2";
	final String MRN = "MRN";

	/**
	 * Sets the up.
	 */
	@Before
	public void setUp() {
		Patient patient = mock(Patient.class);
		when(patientRepository.findByUsername(anyString())).thenReturn(patient);
		when(patientRepository.findOne(anyLong())).thenReturn(patient);
		when(patient.getEnterpriseIdentifier()).thenReturn(PATIENT_EID);
		when(patient.getMedicalRecordNumber()).thenReturn(PATIENT_LocalID);
		Set<OrganizationalProvider> ops = new HashSet<OrganizationalProvider>();
		OrganizationalProvider op1 = new OrganizationalProvider();
		OrganizationalProvider op2 = new OrganizationalProvider();
		op1.setNpi(NPI_1);
		op2.setNpi(NPI_2);
		ops.add(op1);
		ops.add(op2);
		when(patient.getOrganizationalProviders()).thenReturn(ops);
		when(patient.getMedicalRecordNumber()).thenReturn(MRN);

	}

	/**
	 * Test saveConsent. Check if repository is called.
	 */
	@Test
	public void testSaveConsent_Check_if_Repository_is_Called() {
		cst.saveConsent(mock(Consent.class));
		verify(consentRepository).save(any(Consent.class));
	}

	/**
	 * Test updateConsent. Check if repository is called.
	 */
	@Test
	public void testUpdateConsent_Check_if_Repository_is_Called() {
		cst.updateConsent(mock(Consent.class));
		verify(consentRepository).save(any(Consent.class));
	}

	/**
	 * Test deleteConsent. Check if repository is called.
	 */
	@Test
	public void testDeleteConsent_Check_if_Repository_is_Called() {
		cst.deleteConsent(mock(Consent.class));
		verify(consentRepository).delete(any(Consent.class));
	}

	/**
	 * Test deleteConsent. Check if repository and findConsent is called.
	 */
	@Test
	public void testDeleteConsent_Check_if_Repository_and_findConsent_is_called() {
		ConsentService cstspy = spy(cst);
		Consent consent = mock(Consent.class);
		when(cstspy.findConsent((long) 1)).thenReturn(consent);
		when(consent.getSignedPdfConsent()).thenReturn(null);
		boolean isDeleteSuccess = cstspy.deleteConsent((long) 1);
		assertTrue(isDeleteSuccess);
		verify(consentRepository).delete(any(Consent.class));
	}

	/**
	 * Test deleteConsent. Check if delete fails when getSignedPdfConsent is not
	 * null.
	 */
	@Test
	public void testDeleteConsent_Check_if_Delete_Fails_on_SignedPdf_Not_Null() {
		ConsentService cstspy = spy(cst);
		Consent consent = mock(Consent.class);
		SignedPDFConsent signedPDFConsent = mock(SignedPDFConsent.class);
		when(cstspy.findConsent((long) 1)).thenReturn(consent);
		Byte tempByte = new Byte("5");
		byte tempByteAry[] = { tempByte.byteValue() };
		when(signedPDFConsent.getSignedPdfConsentContent()).thenReturn(
				tempByteAry);
		when(consent.getSignedPdfConsent()).thenReturn(signedPDFConsent);
		boolean isDeleteSuccess = cstspy.deleteConsent((long) 1);
		assertFalse("Expected isDeleteSuccess to be false", isDeleteSuccess);
		verify(consentRepository, never()).delete(any(Consent.class));
	}

	/**
	 * Test countAllConsents. Check if repository is called.
	 */
	@Test
	public void testCountAllConsents_Check_if_Repository_is_Called() {
		when(consentRepository.count()).thenReturn((long) 321);
		cst.countAllConsents();
		verify(consentRepository).count();
	}

	/**
	 * Test findConsent. Check if repository is called.
	 */
	@Test
	public void testFindConsent_Check_if_Repository_is_Called() {
		Consent consent = mock(Consent.class);
		when(consentRepository.findOne(anyLong())).thenReturn(consent);
		cst.findConsent((long) 321);
		verify(consentRepository).findOne(anyLong());
	}

	/**
	 * Test findAllConsents. Check if repository is called.
	 */
	@Test
	public void testFindAllConsents_Check_if_Repository_is_Called() {
		@SuppressWarnings("unchecked")
		List<Consent> consentList = mock(List.class);
		when(consentRepository.findAll()).thenReturn(consentList);
		cst.findAllConsents();
		verify(consentRepository).findAll();
	}

	/**
	 * Test signConsent. Check if necessary domain bindings are set and
	 * repository is called.
	 */
	@Test
	public void testSignConsent_Check_if_Necessary_Domain_Bindings_are_Set_and_Repository_is_Called() {
		Consent consent = mock(Consent.class);
		Patient patient = mock(Patient.class);
		when(consentRepository.findOne(anyLong())).thenReturn(consent);

		ConsentService spy = spy(cst);
		ConsentPdfDto consentPdfDto = mock(ConsentPdfDto.class);
		SignedPDFConsent signedPdfConsent = mock(SignedPDFConsent.class);
		when(spy.makeSignedPdfConsent()).thenReturn(signedPdfConsent);
		when(consent.getPatient()).thenReturn(patient);
		when(patient.getEmail()).thenReturn("patient@consent2share.com");
		spy.signConsent(consentPdfDto);

		// all the anystring() should be replaced after we've decided what to
		// put there
		verify(signedPdfConsent).setDocumentId(anyString());
		verify(signedPdfConsent).setDocumentNameBySender(anyString());
		verify(signedPdfConsent).setDocumentMessageBySender(anyString());
		verify(signedPdfConsent).setSignerEmail(anyString());
		verify(signedPdfConsent).setDocumentSignedStatus(anyString());
		verify(consent).setSignedPdfConsent(signedPdfConsent);
		verify(consentRepository).save(any(Consent.class));
	}

	@Test
	public void testSignConsentRevokation() {
		Consent consent = mock(Consent.class);
		Patient patient = mock(Patient.class);
		when(consent.getPatient()).thenReturn(patient);
		when(patient.getFirstName()).thenReturn("John");
		when(patient.getLastName()).thenReturn("Doe");

		AuthenticatedUser user = mock(AuthenticatedUser.class);
		when(userContext.getCurrentUser()).thenReturn(user);

		when(user.getUsername()).thenReturn("mockedUser");
		when(consentRepository.findOne(anyLong())).thenReturn(consent);

		ConsentService spy = spy(cst);
		ConsentRevokationPdfDto consentRevokationPdfDto = mock(ConsentRevokationPdfDto.class);
		when(consentRevokationPdfDto.getRevokationType())
				.thenReturn("NO NEVER");
		SignedPDFConsentRevocation signedPDFConsentRevocation = mock(SignedPDFConsentRevocation.class);
		when(spy.makeSignedPDFConsentRevocation()).thenReturn(
				signedPDFConsentRevocation);
		spy.signConsentRevokation(consentRevokationPdfDto);

		verify(signedPDFConsentRevocation).setDocumentId(anyString());
		verify(signedPDFConsentRevocation).setDocumentNameBySender(anyString());
		verify(signedPDFConsentRevocation).setDocumentMessageBySender(
				anyString());
		verify(signedPDFConsentRevocation).setSignerEmail(anyString());
		verify(signedPDFConsentRevocation).setDocumentSignedStatus(anyString());
		verify(signedPDFConsentRevocation).setDocumentCreatedBy("Doe, John");
		verify(signedPDFConsentRevocation)
				.setDocumentSentOutForSignatureDateTime(any(Date.class));
		verify(consent).setSignedPdfConsentRevoke(signedPDFConsentRevocation);
		verify(consentRepository).save(any(Consent.class));
	}

	/**
	 * Test findAllConsentsDtoByPatient .Verify consentListDtos add exact times
	 * as the number of consentListdto in the list.
	 */
	@Test
	public void testFindAllConsentsDtoByPatient_Verify_consentListDtos_add_exact_times_as_the_number_of_consentlistDto_in_the_List() {
		List<Consent> consents = new ArrayList<Consent>();
		List<Consent> spyConsents = spy(consents);
		for (int i = 0; i < 3; i++) {
			spyConsents.add(mock(Consent.class));
		}
		// for (Consent consent:spyConsents){
		// Set<ConsentIndividualProviderDisclosureIsMadeTo>
		// consentIndividualProviderDisclosureIsMadeToSet=
		// new HashSet<ConsentIndividualProviderDisclosureIsMadeTo>();
		// ConsentIndividualProviderDisclosureIsMadeTo
		// consentIndividualProviderDisclosureIsMadeTo=mock(ConsentIndividualProviderDisclosureIsMadeTo.class);
		// when(consentIndividualProviderDisclosureIsMadeTo.getIndividualProvider().getFirstName()).thenReturn("John");
		// when(consentIndividualProviderDisclosureIsMadeTo.getIndividualProvider().getLastName()).thenReturn("Doe");
		// consentIndividualProviderDisclosureIsMadeToSet.add(consentIndividualProviderDisclosureIsMadeTo);
		// when(consent.getProvidersDisclosureIsMadeTo()).thenReturn(consentIndividualProviderDisclosureIsMadeToSet);
		//
		// Set<ConsentOrganizationalProviderDisclosureIsMadeTo>
		// consentOrganizationalProviderDisclosureIsMadeToSet=
		// new HashSet<ConsentOrganizationalProviderDisclosureIsMadeTo>();
		// ConsentOrganizationalProviderDisclosureIsMadeTo
		// consentOrganizationalProviderDisclosureIsMadeTo=
		// mock(ConsentOrganizationalProviderDisclosureIsMadeTo.class);
		// when(consentOrganizationalProviderDisclosureIsMadeTo.getOrganizationalProvider().getOrgName()).thenReturn("abc company");
		// consentOrganizationalProviderDisclosureIsMadeToSet.add(consentOrganizationalProviderDisclosureIsMadeTo);
		// when(consent.getOrganizationalProvidersDisclosureIsMadeTo()).thenReturn(consentOrganizationalProviderDisclosureIsMadeToSet);
		//
		// }

		when(consentRepository.findByPatient(any(Patient.class))).thenReturn(
				spyConsents);
		ConsentService spy = spy(cst);
		@SuppressWarnings("unchecked")
		ArrayList<ConsentListDto> consentListDtos = mock(ArrayList.class);
		when(spy.makeConsentListDtos()).thenReturn(consentListDtos);
		spy.findAllConsentsDtoByPatient((long) 123);
		verify(consentListDtos, times(3)).add(any(ConsentListDto.class));
	}

	/**
	 * Test findConsentPdfDto when consent is signed.
	 */
	@Test
	public void testFindConsentPdfDto_when_Consent_is_Signed() {
		Consent consent = mock(Consent.class);
		SignedPDFConsent signedPDFConsent = mock(SignedPDFConsent.class);
		ConsentPdfDto consentPdfDto = mock(ConsentPdfDto.class);
		Patient patient = mock(Patient.class);
		byte[] signedPdfConsentContent = new byte[] { 1, 2, 3 };
		byte[] unsignedPdfConsentContent = new byte[] { 4, 5, 6 };

		when(patient.getFirstName()).thenReturn("John");
		when(patient.getLastName()).thenReturn("Doe");
		when(signedPDFConsent.getSignedPdfConsentContent()).thenReturn(
				signedPdfConsentContent);
		when(consent.getPatient()).thenReturn(patient);
		when(consent.getSignedPdfConsent()).thenReturn(signedPDFConsent);
		when(consent.getUnsignedPdfConsent()).thenReturn(
				unsignedPdfConsentContent);
		when(consent.getName()).thenReturn("A regular consent");
		when(consentRepository.findOne(anyLong())).thenReturn(consent);
		ConsentService cstSpy = spy(cst);
		when(cstSpy.makeConsentPdfDto()).thenReturn(consentPdfDto);

		cstSpy.findConsentPdfDto((long) 2);

		verify(consentPdfDto).setContent(signedPdfConsentContent);
		verify(consentPdfDto, never()).setContent(unsignedPdfConsentContent);
		verify(consentPdfDto).setFilename(anyString());
		verify(consentPdfDto).setConsentName("A regular consent");
		verify(consentPdfDto).setId((long) 2);
	}

	/**
	 * Test find consentPdfDto when consent is unsigned.
	 */
	@Test
	public void testFindConsentPdfDto_when_Consent_is_Unsigned() {
		Consent consent = mock(Consent.class);
		SignedPDFConsent signedPDFConsent = mock(SignedPDFConsent.class);
		ConsentPdfDto consentPdfDto = mock(ConsentPdfDto.class);
		Patient patient = mock(Patient.class);
		byte[] signedPdfConsentContent = null;
		byte[] unsignedPdfConsentContent = new byte[] { 4, 5, 6 };

		when(patient.getFirstName()).thenReturn("John");
		when(patient.getLastName()).thenReturn("Doe");
		when(signedPDFConsent.getSignedPdfConsentContent()).thenReturn(
				signedPdfConsentContent);
		when(consent.getPatient()).thenReturn(patient);
		when(consent.getSignedPdfConsent()).thenReturn(signedPDFConsent);
		when(consent.getUnsignedPdfConsent()).thenReturn(
				unsignedPdfConsentContent);
		when(consent.getName()).thenReturn("A regular consent");
		when(consentRepository.findOne(anyLong())).thenReturn(consent);
		ConsentService cstSpy = spy(cst);
		when(cstSpy.makeConsentPdfDto()).thenReturn(consentPdfDto);

		cstSpy.findConsentPdfDto((long) 2);

		verify(consentPdfDto, never()).setContent(signedPdfConsentContent);
		verify(consentPdfDto).setContent(unsignedPdfConsentContent);
		verify(consentPdfDto).setFilename(anyString());
		verify(consentPdfDto).setConsentName("A regular consent");
		verify(consentPdfDto).setId((long) 2);
	}

	/**
	 * Test isConsentBelongToThisUser when succeeds.
	 */
	@Test
	public void testIsConsentBelongToThisUser_when_succeeds() {
		Consent consent = mock(Consent.class);
		Patient patient = mock(Patient.class);

		when(patientRepository.findOne(anyLong())).thenReturn(patient);
		when(consentRepository.findOne(anyLong())).thenReturn(consent);
		when(consent.getPatient()).thenReturn(patient);
		Boolean result = cst.isConsentBelongToThisUser((long) 1, (long) 2);
		assertEquals(true, result);
	}

	/**
	 * Test isConsentBelongToThisUser when fails.
	 */
	@Test
	public void testIsConsentBelongToThisUser_when_fails() {
		Consent consent = mock(Consent.class);
		Patient patient = mock(Patient.class);
		Patient patient2 = mock(Patient.class);
		when(patientRepository.findOne(anyLong())).thenReturn(patient);
		when(consentRepository.findOne(anyLong())).thenReturn(consent);
		when(consent.getPatient()).thenReturn(patient2);
		Boolean result = cst.isConsentBelongToThisUser((long) 1, (long) 2);
		assertEquals(false, result);
	}

	/**
	 * Test save consent.
	 *
	 * @throws Exception
	 */
	@Test
	public void testSaveConsent() throws Exception {
		// Arrange
		ConsentService cstSpy = spy(cst);
		Consent consent = mock(Consent.class);
		String xacmlMock = "xacmlMock";
		String policyIdMock = "policyIdMock";
		when(cstSpy.makeConsent()).thenReturn(consent);
		when(consentExportService.exportConsent2XACML(any(Consent.class)))
				.thenReturn(xacmlMock);
		when(
				consentExportService
						.exportConsent2XacmlPdfConsentFrom(any(Consent.class)))
				.thenReturn(xacmlMock);
		when(
				consentExportService
						.exportConsent2XacmlPdfConsentTo(any(Consent.class)))
				.thenReturn(xacmlMock);
		ConsentDto consentDto = mock(ConsentDto.class);
		when(consentCheckService.getConflictConsent(consentDto)).thenReturn(
				null);
		when(policyIdService.generatePolicyId(consentDto, MRN)).thenReturn(
				policyIdMock);
		Set<String> organizationalProvidersDisclosureIsMadeTo = new HashSet<String>();
		organizationalProvidersDisclosureIsMadeTo.add(NPI_1);
		Set<String> organizationalProvidersPermittedToDisclose = new HashSet<String>();
		organizationalProvidersPermittedToDisclose.add(NPI_2);
		when(consentDto.getOrganizationalProvidersDisclosureIsMadeTo())
				.thenReturn(organizationalProvidersDisclosureIsMadeTo);
		when(consentDto.getOrganizationalProvidersPermittedToDisclose())
				.thenReturn(organizationalProvidersPermittedToDisclose);

		// Act
		cstSpy.saveConsent(consentDto, 0);

		// Assert
		verify(consentRepository).save(consent);
		verify(consentAssertions).forEach(any(Consumer.class));
	}

	/**
	 * Test if makeSignedPdfConsent return correct class.
	 */
	@Test
	public void testMakeSignedPdfConsent_return_correct_class() {
		Object object = cst.makeSignedPdfConsent();
		String className = object.getClass().getName();
		assertEquals(
				"gov.samhsa.consent2share.domain.consent.SignedPDFConsent",
				className);
	}

	/**
	 * Test if makeConsentPdfDto return correct class.
	 */
	@Test
	public void testMakeConsentPdfDto_return_correct_class() {
		Object object = cst.makeConsentPdfDto();
		String className = object.getClass().getName();
		assertEquals("gov.samhsa.consent2share.service.dto.ConsentPdfDto",
				className);
	}

	/**
	 * Test if makeConsentListDtos return correct class.
	 */
	@Test
	public void testMakeConsentListDtos_return_correct_class() {
		Object object = cst.makeConsentListDtos();
		String className = object.getClass().getName();
		assertEquals("java.util.ArrayList", className);
	}

	/**
	 * Test find consent entries.
	 */
	@Test
	public void testFindConsentEntries() {
		@SuppressWarnings("unchecked")
		Page<Consent> consentList = mock(Page.class);
		when(
				consentRepository
						.findAll(any(org.springframework.data.domain.PageRequest.class)))
				.thenReturn(consentList);
		Object object = cst.findConsentEntries(0, 5);
		verify(consentRepository).findAll(
				any(org.springframework.data.domain.PageRequest.class));
		assertEquals("java.util.LinkedList", object.getClass().getName());
	}

	/**
	 * Test if makeConsent return correct class.
	 */
	@Test
	public void testMakeConsent_return_correct_class() {
		Object object = cst.makeConsent();
		String className = object.getClass().getName();
		assertEquals("gov.samhsa.consent2share.domain.consent.Consent",
				className);
	}

	/**
	 * Test make consent dto_return_correct_class.
	 */
	@Test
	public void testMakeConsentDto_return_correct_class() {
		Object object = cst.makeConsentDto();
		assertEquals("gov.samhsa.consent2share.service.dto.ConsentDto", object
				.getClass().getName());
	}

	/**
	 * Test are there duplicates_when_there_are_duplicates.
	 */
	@Test
	public void testAreThereDuplicates_when_there_are_duplicates() {
		Set<String> set1 = new HashSet<String>();
		Set<String> set2 = new HashSet<String>();

		String a = "abc";
		String b = "efg";
		String c = "hij";
		String d = "klm";

		set1.add(a);
		set1.add(b);
		set1.add(c);
		set2.add(c);
		set2.add(d);

		assertEquals(true, cst.areThereDuplicatesInTwoSets(set1, set2));
	}

	/**
	 * Test are there duplicates_when_there_are_no_duplicates.
	 */
	@Test
	public void testAreThereDuplicates_when_there_are_no_duplicates() {
		Set<String> set1 = new HashSet<String>();
		Set<String> set2 = new HashSet<String>();

		String a = "abc";
		String b = "efg";
		String c = "hij";
		String d = "klm";

		set1.add(a);
		set1.add(b);
		set2.add(c);
		set2.add(d);

		assertEquals(false, cst.areThereDuplicatesInTwoSets(set1, set2));
	}

	@Test
	public void testFindConsentRevokationPdfDto() {
		ConsentService consentService = spy(cst);
		ConsentRevokationPdfDto consentRevokationPdfDto = mock(ConsentRevokationPdfDto.class);
		Consent consent = mock(Consent.class);
		SignedPDFConsentRevocation signedPDFConsentRevocation = mock(SignedPDFConsentRevocation.class);
		Patient patient = mock(Patient.class);

		when(consentService.makeConsentRevokationPdfDto()).thenReturn(
				consentRevokationPdfDto);
		when(consentRepository.findOne(anyLong())).thenReturn(consent);
		when(consent.getSignedPdfConsentRevoke()).thenReturn(
				signedPDFConsentRevocation);
		when(consent.getPatient()).thenReturn(patient);
		when(patient.getFirstName()).thenReturn("John");
		when(patient.getLastName()).thenReturn("Doe");
		when(signedPDFConsentRevocation.getContent()).thenReturn(
				new byte[] { 1, 2, 3 });

		consentService.findConsentRevokationPdfDto((long) 1);
		verify(consentRevokationPdfDto).setFilename(anyString());
		verify(consentRevokationPdfDto).setConsentName(anyString());
		verify(consentRevokationPdfDto).setId(anyLong());

	}

	@Test
	public void testCreateConsentEmbeddedWidget() {
		Consent consent = mock(Consent.class);
		Patient patient = mock(Patient.class);
		when(consentRepository.findOne(anyLong())).thenReturn(consent);

		ConsentService spy = spy(cst);
		ConsentPdfDto consentPdfDto = mock(ConsentPdfDto.class);
		when(consentPdfDto.getContent()).thenReturn(DOCUMENT_BYTES);
		when(consentPdfDto.getFilename()).thenReturn(DOCUMENT_FILE_NAME);
		when(consentPdfDto.getConsentName()).thenReturn(DOCUMENT_NAME);
		when(consentPdfDto.getId()).thenReturn((long) 1);
		SignedPDFConsent signedPdfConsent = mock(SignedPDFConsent.class);
		when(spy.makeSignedPdfConsent()).thenReturn(signedPdfConsent);
		when(consent.getPatient()).thenReturn(patient);
		when(patient.getEmail()).thenReturn(EMAIL);
		EmbeddedWidgetCreationResult result = mock(EmbeddedWidgetCreationResult.class);
		when(
				echoSignSignatureService
						.createEmbeddedWidget(DOCUMENT_BYTES,
								DOCUMENT_FILE_NAME, DOCUMENT_NAME,
								null, EMAIL)).thenReturn(result);
		spy.createConsentEmbeddedWidget(consentPdfDto);

		verify(consentRepository).save(consent);
	}

	@Test
	public void testCreateRevocationEmbeddedWidget_when_revocation_type_is_emergency_only() {
		Consent consent = mock(Consent.class);
		Patient patient = mock(Patient.class);
		when(consentRepository.findOne(anyLong())).thenReturn(consent);

		ConsentService spy = spy(cst);
		ConsentRevokationPdfDto consentRevokationPdfDto = mock(ConsentRevokationPdfDto.class);
		when(consentRevokationPdfDto.getContent()).thenReturn(DOCUMENT_BYTES);
		when(consentRevokationPdfDto.getFilename()).thenReturn(
				DOCUMENT_FILE_NAME);
		when(consentRevokationPdfDto.getConsentName())
				.thenReturn(DOCUMENT_NAME);
		when(consentRevokationPdfDto.getId()).thenReturn((long) 1);
		when(consentRevokationPdfDto.getRevokationType()).thenReturn(
				"EMERGENCY ONLY");
		SignedPDFConsent signedPdfConsent = mock(SignedPDFConsent.class);
		when(spy.makeSignedPdfConsent()).thenReturn(signedPdfConsent);
		when(consent.getPatient()).thenReturn(patient);
		when(patient.getEmail()).thenReturn(EMAIL);
		EmbeddedWidgetCreationResult result = mock(EmbeddedWidgetCreationResult.class);
		when(
				echoSignSignatureService.createEmbeddedWidget(DOCUMENT_BYTES,
						DOCUMENT_FILE_NAME, DOCUMENT_NAME
								+ " Revocation", null, EMAIL)).thenReturn(
				result);
		spy.createRevocationEmbeddedWidget(consentRevokationPdfDto);

		verify(consentRepository).save(consent);
		verify(consent).setConsentRevokationType("EMERGENCY ONLY");
	}

	@Test
	public void testCreateRevocationEmbeddedWidget_when_revocation_type_is_no_never() {
		Consent consent = mock(Consent.class);
		Patient patient = mock(Patient.class);
		when(consentRepository.findOne(anyLong())).thenReturn(consent);

		ConsentService spy = spy(cst);
		ConsentRevokationPdfDto consentRevokationPdfDto = mock(ConsentRevokationPdfDto.class);
		when(consentRevokationPdfDto.getContent()).thenReturn(DOCUMENT_BYTES);
		when(consentRevokationPdfDto.getFilename()).thenReturn(
				DOCUMENT_FILE_NAME);
		when(consentRevokationPdfDto.getConsentName())
				.thenReturn(DOCUMENT_NAME);
		when(consentRevokationPdfDto.getId()).thenReturn((long) 1);
		when(consentRevokationPdfDto.getRevokationType())
				.thenReturn("NO NEVER");
		SignedPDFConsent signedPdfConsent = mock(SignedPDFConsent.class);
		when(spy.makeSignedPdfConsent()).thenReturn(signedPdfConsent);
		when(consent.getPatient()).thenReturn(patient);
		when(patient.getEmail()).thenReturn(EMAIL);
		EmbeddedWidgetCreationResult result = mock(EmbeddedWidgetCreationResult.class);
		when(
				echoSignSignatureService.createEmbeddedWidget(DOCUMENT_BYTES,
						DOCUMENT_FILE_NAME, DOCUMENT_NAME
								+ " Revocation", null, EMAIL)).thenReturn(
				result);
		spy.createRevocationEmbeddedWidget(consentRevokationPdfDto);

		verify(consentRepository).save(consent);
		verify(consent).setConsentRevokationType("NO NEVER");
	}

	@Test
	public void testGetConsentSignedStageWhenConsentIsSigned() {
		Consent consent = mock(Consent.class);
		SignedPDFConsent pdfConsent = mock(SignedPDFConsent.class);
		doReturn("SIGNED").when(pdfConsent).getDocumentSignedStatus();
		doReturn(pdfConsent).when(consent).getSignedPdfConsent();
		doReturn(consent).when(consentRepository).findOne(anyLong());
		assertEquals("CONSENT_SIGNED", cst.getConsentSignedStage((long) 1));
	}

	@Test
	public void testGetConsentSignedStageIsNotYetSigned() {
		Consent consent = mock(Consent.class);
		SignedPDFConsent pdfConsent = mock(SignedPDFConsent.class);
		doReturn("UNSIGNED").when(pdfConsent).getDocumentSignedStatus();
		doReturn(pdfConsent).when(consent).getSignedPdfConsent();
		doReturn(consent).when(consentRepository).findOne(anyLong());
		assertEquals("CONSENT_SAVED", cst.getConsentSignedStage((long) 1));
	}

	@Test
	public void testValidateConsentDate_when_null() {
		assertEquals(false, cst.validateConsentDate(null, null));
	}

	@Test
	public void testValidateConsentDate_when_startDate_is_previous() {
		assertEquals(false, cst.validateConsentDate(new Date(100, 06, 04),
				new Date(200, 06, 04)));
	}

	@Test
	public void testValidateConsentDate_when_startDate_is_previous_endDate() {
		assertEquals(false, cst.validateConsentDate(new Date(117, 06, 04),
				new Date(117, 06, 02)));
	}

	@Test
	public void testValidateConsentDate_true() {
		assertEquals(true, cst.validateConsentDate(new Date(117, 06, 04),
				new Date(117, 06, 19)));
	}

}


text:
import json
import collections

'''Maps input keys to channel outputs based on a JSON config file
'''
class Mapper:
    def __init__(self, filename):
        """Creates a new mapper."""
        self._load_mapping(filename)

    def map(self, key):
        """Maps the input key to the outputs in the mapping. Returns None if not found"""
        if key not in self.mapping:
            return None
        return self.mapping[key]

    def _load_mapping(self, filename):
        """Load the mapping from the file. Sets mapping to None if error occurred.
        Output channels are 0-indexed"""
        try:
            config = json.loads(open(filename, 'r').read())
            key_begin = config["keybegin"]
            key_end = config["keyend"]
            output_begin = config["outputbegin"]
            output_end = config["outputend"]
            mappings = config["mappings"]
            # TODO validation

            # Inclusive
            num_keys = key_end - key_begin + 1
            num_outputs = output_end - output_begin + 1
            if num_keys < 0 or num_outputs < 0:
                print("Invalid number of keys or outputs")
                return None

            # The final mapping is a dictionary with key=input and value=set of outputs
            # Essentially takes the config's many-to-many and makes it a one-to-many
            mapping = collections.defaultdict(set)
            for out_map in mappings:
                inputs = out_map["inputkeys"]
                outputs = out_map["outputchannels"]
                for key in inputs:
                    if key_begin <= key <= key_end:
                        for out in outputs:
                            if output_begin <= out <= output_end:
                                mapping[key].add(out)
                            else:
                                print("Ignoring output {}: not in range".format(out))
                    else:
                        print("Ignoring input key {}: out of range".format(key))
            self.mapping = mapping
        except json.JSONDecodeError as e:
            print(e)
            self.mapping = {}

redpajama_set_name: RedPajamaGithub


text:
import React from 'react';
import PropTypes from 'prop-types';
import TodoItem from './TodoItem';

const TodoList = ({ todos, completeTodo }) => (
  <ul>
    {todos.map((todo, index) => (
      <TodoItem key={index} {...todo} completeTodo={completeTodo} />
    ))}
  </ul>
);

TodoList.propTypes = {
  todos: PropTypes.arrayOf(
    PropTypes.shape({
      text: PropTypes.string.isRequired,
      completed: PropTypes.bool.isRequired
    }).isRequired
  ).isRequired,
  completeTodo: PropTypes.func.isRequired
};

export default TodoList;


text:
using System.Runtime.InteropServices;

namespace Spira.Battle
{
    [StructLayout(LayoutKind.Sequential, Pack = 1)]
    public struct BattleBinFileDescriptorHeader
    {
        public int Unknown00;
        public int Unknown04;
        public int AuthorOffset;
        public int NameOffset;
    }
}


text:
/* Write a program to print the numbers 1, 101 and 1001, each at a separate line. */

using System;

namespace PrintNumbers
{
    class PrintNumbers
    {
        static void Main(string[] args)
        {
            Console.WriteLine("1");
            Console.WriteLine("101");
            Console.WriteLine("1001");
        }
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<page xmlns="http://jboss.org/schema/seam/pages"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://jboss.org/schema/seam/pages http://jboss.org/schema/seam/pages-2.3.xsd"
       no-conversation-view-id="/home.xhtml" login-required="true"
       view-id="/profile/person/viewProfile.xhtml">

    <restrict>#{s:hasPermission('profile', 'access')}</restrict>

    <action execute="#{userProfileAction.show}" if="#{userProfileAction.person== null}" on-postback="false"/>

    <rewrite pattern="/profile/person/view" />

    <navigation from-action="#{userProfileAction.show}">
        <rule if-outcome="success">
            <begin-conversation join="true" flush-mode="manual" />
            <render view-id="/profile/person/viewProfile.xhtml" />
        </rule>

        <rule if-outcome="no_permissions">
            <end-conversation />
            <redirect view-id="/home.xhtml">
                <message severity="ERROR">You don't have permissions to modify profile</message>
            </redirect>
        </rule>

        <rule if-outcome="failure">
            <end-conversation/>
               <redirect view-id="/home.xhtml">
                <message severity="ERROR">Failed to load profile</message>
               </redirect>
           </rule>
    </navigation>

    <navigation from-action="#{userProfileAction.update}">
        <rule if-outcome="success">
            <redirect view-id="/profile/person/viewProfile.xhtml">
                <message severity="INFO">Profile '#{userProfileAction.person.displayName}' updated successfully</message>
            </redirect>
        </rule>

        <rule if-outcome="failure">
            <redirect view-id="/profile/person/viewProfile.xhtml">
                <message severity="INFO">Failed to update profile '#{userProfileAction.person.displayName}'</message>
            </redirect>
        </rule>
    </navigation>

    <navigation from-action="#{userProfileAction.cancel}">
        <end-conversation/>
        <redirect view-id="/home.xhtml">
            <message severity="INFO">Profile modification canceled</message>
        </redirect>
    </navigation>

</page>


text:
package com.raquo.domtypes.generic.defs.styles.keywords

trait CursorStyle[T] extends AutoStyle[T] with NoneStyle[T] {

  /** Default cursor, typically an arrow.  --MDN */
  lazy val default: T = buildStringValue("default")

  /** A context menu is available under the cursor.  --MDN */
  lazy val contextMenu: T = buildStringValue("context-menu")

  /** Indicating help is available.  --MDN */
  lazy val help: T = buildStringValue("help")

  /**
    * E.g. used when hovering over links, typically a hand.  --MDN */
  lazy val pointer: T = buildStringValue("pointer")

  /**
    * The program is busy in the background but the user can still interact
    * with the interface (unlike for wait).  --MDN
    */
  lazy val progress: T = buildStringValue("progress")

  /** The program is busy (sometimes an hourglass or a watch).  --MDN */
  lazy val waitCss: T = buildStringValue("wait")

  /** Indicating that cells can be selected.  --MDN */
  lazy val cell: T = buildStringValue("cell")

  /** Cross cursor, often used to indicate selection in a bitmap.  --MDN */
  lazy val crosshair: T = buildStringValue("crosshair")

  /** Indicating text can be selected, typically an I-beam.  --MDN */
  lazy val text: T = buildStringValue("text")

  /** Indicating that vertical text can be selected, typically a sideways I-beam  --MDN */
  lazy val verticalText: T = buildStringValue("vertical-text")

  /** Indicating an alias or shortcut is to be created.  --MDN */
  lazy val alias: T = buildStringValue("alias")

  /** Indicating that something can be copied  --MDN */
  lazy val copy: T = buildStringValue("copy")

  /** The hovered object may be moved.  --MDN */
  lazy val move: T = buildStringValue("move")

  /** Cursor showing that a drop is not allowed at the current location.  --MDN */
  lazy val noDrop: T = buildStringValue("no-drop")

  /** Cursor showing that something cannot be done.  --MDN */
  lazy val notAllowed: T = buildStringValue("not-allowed")

  /** Cursor showing that something can be scrolled in any direction (panned).  --MDN */
  lazy val allScroll: T = buildStringValue("all-scroll")

  /**
    * The item/column can be resized horizontally. Often rendered as arrows
    * pointing left and right with a vertical separating.  --MDN
    */
  lazy val colResize: T = buildStringValue("col-resize")

  /**
    * The item/row can be resized vertically. Often rendered as arrows pointing
    * up and down with a horizontal bar separating them.  --MDN
    */
  lazy val rowResize: T = buildStringValue("row-resize")

  /** The top edge is to be moved.  --MDN */
  lazy val nResize: T = buildStringValue("n-resize")

  /** The right edge is to be moved.  --MDN */
  lazy val eResize: T = buildStringValue("e-resize")

  /** The bottom edge is to be moved.  --MDN */
  lazy val sResize: T = buildStringValue("s-resize")

  /** The left edge is to be moved.  --MDN */
  lazy val wResize: T = buildStringValue("w-resize")

  /** The top-right corner is to be moved.  --MDN */
  lazy val neResize: T = buildStringValue("ne-resize")

  /** The top-left corner is to be moved.  --MDN */
  lazy val nwResize: T = buildStringValue("nw-resize")

  /** The bottom-right corner is to be moved.  --MDN */
  lazy val seResize: T = buildStringValue("se-resize")

  /** The bottom-left corner is to be moved.  --MDN */
  lazy val swResize: T = buildStringValue("sw-resize")

  /** The left and right edges are to be moved. */
  lazy val ewResize: T = buildStringValue("ew-resize")

  /** The top and bottom edges are to be moved. */
  lazy val nsResize: T = buildStringValue("ns-resize")

  /** The top right and bottom left corners are to be moved. */
  lazy val neswResize: T = buildStringValue("nesw-resize")

  /** The top left and bottom right corners are to be moved. */
  lazy val nwseResize: T = buildStringValue("nwse-resize")

  /** Indicates that something can be zoomed (magnified) in.  --MDN */
  lazy val zoomIn: T = buildStringValue("zoom-in")

  /** Indicates that something can be zoomed (magnified) out.  --MDN */
  lazy val zoomOut: T = buildStringValue("zoom-out")

  /** Indicates that something can be grabbed (dragged to be moved).  --MDN */
  lazy val grab: T = buildStringValue("grab")

  /** Indicates that something can be grabbed (dragged to be moved).  --MDN */
  lazy val grabbing: T = buildStringValue("grabbing")
}


text:
package gov.nist.javax.sip;

import java.security.cert.Certificate;

import javax.net.ssl.SSLPeerUnverifiedException;
import javax.sip.SipProvider;
import javax.sip.Transaction;

public interface TransactionExt extends Transaction {

    /**
     * Get the Sip Provider associated with this transaction
     */
    public SipProvider getSipProvider();

    /**
     * Returns the IP address of the upstream/downstream hop from which this message was initially received
     * @return the IP address of the upstream/downstream hop from which this message was initially received
     * @since 2.0
     */
    public String getPeerAddress();
    /**
     * Returns the port of the upstream/downstream hop from which this message was initially received
     * @return the port of the upstream/downstream hop from which this message was initially received
     * @since 2.0
     */
    public int getPeerPort();
    /**
     * Returns the name of the protocol with which this message was initially received
     * @return the name of the protocol with which this message was initially received
     * @since 2.0
     */
    public String getTransport();

    /**
     * return the ip address on which this message was initially received
     * @return the ip address on which this message was initially received
     */
    public String getHost();
    /**
     * return the port on which this message was initially received
     * @return the port on which this message was initially received
     */
    public int getPort();

    /**
     * Return the Cipher Suite that was used for the SSL handshake.
     *
     * @return     Returns the cipher suite in use by the session which was produced by the handshake.
     * @throw UnsupportedOperationException if this is not a secure client transaction.
     */
    public String getCipherSuite() throws UnsupportedOperationException;

    /**
     * Get the certificate(s) that were sent to the peer during handshaking.
     *@return the certificate(s) that were sent to the peer during handshaking.
     *@throw UnsupportedOperationException if this is not a secure client transaction.
     *
     */
   Certificate[] getLocalCertificates() throws UnsupportedOperationException;

    /**
     * @return the identity of the peer which was identified as part of defining the session.
     * @throws SSLPeerUnverifiedException
     * @throw UnsupportedOperationException if this is not a secure client transaction.
     */
   Certificate[]  getPeerCertificates() throws SSLPeerUnverifiedException;
}


text:
FROM ubuntu:18.04

RUN apt-get update
RUN apt-get install -y gcc


text:
package com.fridgester.fridgester;

import android.support.test.espresso.ViewInteraction;
import android.support.test.rule.ActivityTestRule;
import android.support.test.runner.AndroidJUnit4;
import android.test.InstrumentationTestCase;
import android.test.suitebuilder.annotation.LargeTest;
import android.view.View;

import org.hamcrest.core.IsInstanceOf;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;

import java.util.List;
import java.util.concurrent.TimeUnit;

import static android.support.test.espresso.Espresso.onView;
import static android.support.test.espresso.Espresso.pressBack;
import static android.support.test.espresso.action.ViewActions.click;
import static android.support.test.espresso.assertion.ViewAssertions.matches;
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
import static android.support.test.espresso.matcher.ViewMatchers.withId;
import static android.support.test.espresso.matcher.ViewMatchers.withText;
import static com.fridgester.fridgester.ActivityTestUtils.childAtPosition;
import static org.hamcrest.Matchers.allOf;

@LargeTest
@RunWith(AndroidJUnit4.class)
public class RecipeActivityTest extends InstrumentationTestCase {
    @Rule
    public ActivityTestRule<MainActivity> mActivityTestRule = new ActivityTestRule<>(MainActivity.class);

    List<BaseIngredient> baseIngredients;

    @Before
    public void setUp() {
        baseIngredients = FridgesterDB.getBaseIngredients();
    }

    /**
     * Verifies that the correct recipe information displays after clicking a returned recipe.
     * @throws Exception
     */
    @Test
    public void verifyCorrectRecipeInfoDisplays() throws Exception {
        //Click Manage Fridge
        ActivityTestUtils.clickManageFridge();
        TimeUnit.SECONDS.sleep(3);

        //Select Ingredients
        ActivityTestUtils.selectIngredient("tomato", mActivityTestRule);
        ActivityTestUtils.selectIngredient("basil", mActivityTestRule);
        ActivityTestUtils.selectIngredient("extra-virgin olive oil", mActivityTestRule);
        ActivityTestUtils.selectIngredient("red wine vinegar", mActivityTestRule);
        ActivityTestUtils.selectIngredient("salt ground black pepper", mActivityTestRule);

        //Generate Recipes
        ActivityTestUtils.clickGenerateRecipesButton();

        //Select Recipe
        ViewInteraction actionBarText = onView(
                allOf(withText("10-Minute Tomato Basil Salad"),
                        childAtPosition(
                                allOf(withId(R.id.recipe_list_text_layout),
                                        childAtPosition(
                                                IsInstanceOf.<View>instanceOf(android.widget.RelativeLayout.class),
                                                1)),
                                0),
                        isDisplayed()));
        actionBarText.check(matches(withText("10-Minute Tomato Basil Salad")));

        ViewInteraction relativeLayout = onView(
                allOf(childAtPosition(
                        withId(R.id.recipe_list),
                        0),
                        isDisplayed()));
        relativeLayout.perform(click());

        /**
         * Verification
         */

        //Verify action bar title is correct
        ViewInteraction textView = onView(
                allOf(withText("10-Minute Tomato Basil Salad"),
                        childAtPosition(
                                allOf(withId(R.id.action_bar),
                                        childAtPosition(
                                                withId(R.id.action_bar_container),
                                                0)),
                                0),
                        isDisplayed()));
        textView.check(matches(withText("10-Minute Tomato Basil Salad")));

        //Verify directions are correct
        ViewInteraction textView2 = onView(
                allOf(withId(R.id.recipe_text), withText("Directions\n\n• Combine tomato, basil, olive oil, vinegar, salt, and black pepper in a large bowl; toss until tomato wedges are evenly coated.\n\nIngredients\n\n• 1 large tomato, cut into wedges\n• 1 tablespoon chopped fresh basil\n• 1 tablespoon extra-virgin olive oil\n• 1 1/2 teaspoons red wine vinegar, or to taste\n• 1 pinch salt and ground black pepper to taste (optional)\n\nServing Size and Nutrition\n\n• Servings: 1.0\n• Calories: 162.7 kcal\n• Fat: 13.9 g\n• Protein: 1.7 g\n• Carbs: 7.7 g\n"),
                        childAtPosition(
                                allOf(withId(R.id.scrollView2),
                                        childAtPosition(
                                                IsInstanceOf.<View>instanceOf(android.widget.RelativeLayout.class),
                                                0)),
                                0),
                        isDisplayed()));
        textView2.check(matches(withText("Directions\n\n• Combine tomato, basil, olive oil, vinegar, salt, and black pepper in a large bowl; toss until tomato wedges are evenly coated.\n\nIngredients\n\n• 1 large tomato, cut into wedges\n• 1 tablespoon chopped fresh basil\n• 1 tablespoon extra-virgin olive oil\n• 1 1/2 teaspoons red wine vinegar, or to taste\n• 1 pinch salt and ground black pepper to taste (optional)\n\nServing Size and Nutrition\n\n• Servings: 1.0\n• Calories: 162.7 kcal\n• Fat: 13.9 g\n• Protein: 1.7 g\n• Carbs: 7.7 g\n")));

        //Verify Rate button is displayed
        ViewInteraction button = onView(
                allOf(withId(R.id.button2),
                        childAtPosition(
                                childAtPosition(
                                        withId(android.R.id.content),
                                        0),
                                2),
                        isDisplayed()));
        button.check(matches(isDisplayed()));

        //Verify rating bar is visible
        ViewInteraction ratingBar = onView(
                allOf(withId(R.id.ratingBar2),
                        childAtPosition(
                                childAtPosition(
                                        withId(android.R.id.content),
                                        0),
                                1),
                        isDisplayed()));
        ratingBar.check(matches(isDisplayed()));
    }

    /**
     * Verifies that a recipe's rating will persist
     * @throws Exception
     */
    @Test
    public void verifyRecipeRatingPersists() throws Exception {
        //Open a recipe
        ViewInteraction linearLayout = onView(
                allOf(childAtPosition(
                        withId(R.id.nav),
                        2),
                        isDisplayed()));
        linearLayout.perform(click());

        ViewInteraction relativeLayout = onView(
                allOf(childAtPosition(
                        withId(R.id.recipe_list),
                        0),
                        isDisplayed()));
        relativeLayout.perform(click());

        ViewInteraction ratingBar = onView(
                allOf(withId(R.id.ratingBar2),
                        childAtPosition(
                                childAtPosition(
                                        withId(android.R.id.content),
                                        0),
                                1),
                        isDisplayed()));
        ratingBar.check(matches(isDisplayed()));

        //Rate Recipe
        TimeUnit.SECONDS.sleep(3);
        ratingBar.perform(new SetRatingViewAction(3, "original"));

        ViewInteraction appCompatButton = onView(
                allOf(withId(R.id.button2), withText("Rate"), isDisplayed()));
        appCompatButton.perform(click());

        pressBack();

        //Navigate back to recipe
        ViewInteraction toggleButton = onView(
                allOf(withId(R.id.toggleButton), withText("All Recipes"), isDisplayed()));
        toggleButton.perform(click());

        ViewInteraction textView = onView(
                allOf(withId(R.id.recipe_list_title), withText("10-Minute Tomato Basil Salad"),
                        childAtPosition(
                                allOf(withId(R.id.recipe_list_text_layout),
                                        childAtPosition(
                                                IsInstanceOf.<View>instanceOf(android.widget.RelativeLayout.class),
                                                1)),
                                0),
                        isDisplayed()));

        textView.perform(click());

        //Verification
        TimeUnit.SECONDS.sleep(3);
        ratingBar.check(new RatingBarViewAssertion(3));

    }

}


text:
using System;
using System.Linq;
using System.Reflection;
using LtiLibrary.NetCore.Common;

namespace LtiLibrary.NetCore.Extensions
{
    /// <summary>
    /// Enum extensions.
    /// </summary>
    public static class EnumExtensions
    {
        /// <summary>
        /// Return the URN associated with this Enum value.
        /// </summary>
        public static string GetUrn(this Enum value)
        {
            return
                value.GetType()
                .GetRuntimeFields()
                .SingleOrDefault(f => f.Name == value.ToString())
                ?.GetCustomAttribute<UrnAttribute>()
                ?.Urn;
        }
    }
}


text:
<!DOCTYPE html>

<title>What Resources are specific to admin users?</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta content="sakai.resources" name="description">
<meta content="" name="search">
<link href="/library/skin/tool_base.css" media="screen" rel="stylesheet" type="text/css" charset="utf-8">
<link href="/library/skin/morpheus-default/tool.css" media="screen" rel="stylesheet" type="text/css" charset="utf-8">
<link href="/sakai-help-tool/css/help.css" media="screen" rel="stylesheet" type="text/css" charset="utf-8">
<link href="/library/js/jquery/featherlight/0.4.0/featherlight.min.css" media="screen" rel="stylesheet" type="text/css" charset="utf-8">

What Resources are specific to admin users?

The Resources tool within the Administration Workspace functions the same way as the Resources tool in other sites. However, within the Administration Workspace, Resources also provides access to files and directories in the system that non-admin users do not see.

Go to Resources.

Select Resources from the Tool Menu in the Administration Workspace.

View available directories.

              Zoom

Admin users may browse any of the following folders to view files on the system:

The attachment directory contains files uploaded within individual sites as part of a message attachment, a quiz, etc.

The group directory contains files uploaded to the Resources tool within individual sites. Sub-directories within this folder are named with the title of the site.

The group-user directory contains all of the folders and files associate with the Drop Box tool in individual sites.

The private directory contains files uploaded to the Profile tool (i.e. users' Photo Gallery or Profile Images).

The public directory contains files which can be viewed by all users in the system. Admin users should place files in this location if they wish to share them with all users in the system - for example, images to be used in Message of the Day notifications.

The user directory contains files uploaded to individual users' Home sites.


text:
import logging
from gym_mupen64plus.envs.MarioKart64.mario_kart_env import MarioKartEnv
from gym_mupen64plus.envs.Smash.smash_env import SmashEnv

logger = logging.getLogger(__name__)


text:
<?xml version="1.0" encoding="utf-8"?>
<PublishProfile xmlns="http://schemas.microsoft.com/2015/05/fabrictools">
  <!-- ClusterConnectionParameters allows you to specify the PowerShell parameters to use when connecting to the Service Fabric cluster.
       Valid parameters are any that are accepted by the Connect-ServiceFabricCluster cmdlet.

       For a local cluster, you would typically not use any parameters.
         For example: <ClusterConnectionParameters />
  -->
  <ClusterConnectionParameters />
  <ApplicationParameterFile Path="..\ApplicationParameters\Local.1Node.xml" />
  <UpgradeDeployment Mode="UnmonitoredAuto" Enabled="false">
    <Parameters UpgradeReplicaSetCheckTimeoutSec="1" Force="True" />
  </UpgradeDeployment>
</PublishProfile>


text:
package main

// Imports and register the gorpc queryservice server

import (
	_ "github.com/youtube/vitess/go/vt/tabletserver/gorpcqueryservice"
)


text:
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools"  tools:ignore="MissingTranslation" >

    <string name="app_name">Newtifry</string>
	<string name="backend_url">newtifry.appspot.com</string>
</resources>


text:
package giki.runtime;

public class Machine {
	public static class Frame implements Input, Output {
		public Frame parent;
		public int i;
		public final Input input;
		public final Output output;
		public final Instruction[] code;

		public Instruction call;

		// TODO: Consider: Maybe variables should map to singulars and inters to plurals?
		public Symbol[] variables;
		public Stream[] inters;

		public static final int INPUT_SOURCE = 0;
		public static final int INPUT_INTER = 1;
		public static final int INPUT_VARIABLE = 2;
		public static final int INPUT_MAP_SLOT = 3;

		public static final int OUTPUT_TARGET = 0;
		public static final int OUTPUT_INTER = 1;
		public static final int OUTPUT_VARIABLE = 2;
		public static final int OUTPUT_MAP_SLOT = 3;

		public Frame(Frame parent, Input input, Output output, Instruction[] code, Symbol[] variables, int interCount) {
			this.parent = parent;
			this.input = input;
			this.output = output;
			this.code = code;
			this.variables = variables;
			inters = new Stream[interCount];
		}

		@Override
		public void put(Symbol symbol) {
			switch(call.outputType) {
			case Frame.OUTPUT_VARIABLE: {
				variables[call.outputOrdinal] = symbol;
				break;
			}
			}
		}

		@Override
		public void closeOutput() { }

		@Override
		public boolean atEnd() {
			switch(call.inputType) {
			case Frame.INPUT_VARIABLE:
				return false;
			}

			return false;
		}

		@Override
		public Symbol peek() {
			switch(call.inputType) {
			case Frame.INPUT_VARIABLE: {
				return variables[call.inputOrdinal];
			}
			}

			return null;
		}

		@Override
		public Symbol consume() {
			switch(call.inputType) {
			case Frame.INPUT_VARIABLE: {
				return variables[call.inputOrdinal];
			}
			}

			return null;
		}

		@Override
		public void closeInput() { }

		@Override
		public Symbol peek(int ahead) {
			// TODO Auto-generated method stub
			return null;
		}
	}

	public static final int RESULT_ABSENT = 0;
	public static final int RESULT_ACCEPTED = 1;
	public static final int RESULT_REJECTED = 2;

	private int result;
	private Frame frame;

	public Machine(Input input, Output output, Instruction[] code, Symbol[] variables, int interCount) {
		frame = new Frame(null, input, output, code, variables, interCount);
	}

	public int getResult() {
		return result;
	}

	private final void put(Instruction instruction, Symbol symbol) {
		switch(instruction.outputType) {
		case Frame.OUTPUT_TARGET:
			frame.output.put(symbol);
			break;
		case Frame.OUTPUT_INTER:
			frame.inters[instruction.outputOrdinal].put(symbol);
			break;
		case Frame.OUTPUT_VARIABLE:
			frame.variables[instruction.outputOrdinal] = symbol;
			break;
		case Frame.OUTPUT_MAP_SLOT: {
			// HACK: Only a single level of slots is assumed
			Symbol.Map map = (Symbol.Map)frame.variables[instruction.outputOrdinal];
			map.put(instruction.outputSlotPath[0], symbol);
			break;
		}
		}
	}

	private final Symbol peek(Instruction instruction) {
		switch(instruction.inputType) {
		case Frame.INPUT_SOURCE:
			return frame.input.peek();
		case Frame.INPUT_INTER:
			return frame.inters[instruction.inputOrdinal].peek();
		case Frame.INPUT_VARIABLE:
			return frame.variables[instruction.inputOrdinal];
		case Frame.INPUT_MAP_SLOT: {
			// HACK: Only a single level of slots is assumed
			Symbol.Map map = (Symbol.Map)frame.variables[instruction.inputOrdinal];
			return map.get(instruction.inputSlotPath[0]);
		}
		}

		return null;
	}

	private final Symbol consume(Instruction instruction) {
		switch(instruction.inputType) {
		case Frame.INPUT_SOURCE:
			return frame.input.consume();
		case Frame.INPUT_INTER:
			return frame.inters[instruction.inputOrdinal].consume();
		case Frame.INPUT_VARIABLE:
			return frame.variables[instruction.inputOrdinal];
		case Frame.INPUT_MAP_SLOT: {
			// HACK: Only a single level of slots is assumed
			Symbol.Map map = (Symbol.Map)frame.variables[instruction.inputOrdinal];
			return map.get(instruction.inputSlotPath[0]);
		}
		}

		return null;
	}

	private final boolean atEnd(Instruction instruction) {
		switch(instruction.inputType) {
		case Frame.INPUT_SOURCE:
			return frame.input.atEnd();
		case Frame.INPUT_INTER:
			return frame.inters[instruction.inputOrdinal].atEnd();
		case Frame.INPUT_VARIABLE:
			return false;
		case Frame.INPUT_MAP_SLOT:
			return false;
		}

		return false;
	}

	private int maxCheckPoints = 10000;

	public void evaluate() {
		int checkPoints = 0;
		finish:
		while(true) {
			Instruction instruction = frame.code[frame.i];

			switch(instruction.type) {
			case Instruction.TYPE_QUOTE: {
				Symbol symbol = (Symbol)instruction.operand;
				put(instruction, symbol);
				break;
			}
			case Instruction.TYPE_ACCEPT_FINISH: {
				result = RESULT_ACCEPTED;
				break finish;
			}
			case Instruction.TYPE_REJECT_FINISH: {
				result = RESULT_REJECTED;
				break finish;
			}
			case Instruction.TYPE_ACCEPT_FRAME: {
				frame = frame.parent;
				break;
			}
			case Instruction.TYPE_REJECT_FRAME: {
				frame = frame.parent;
				frame.i = frame.code[frame.i].falseJump;
				continue;
			}
			case Instruction.TYPE_PEEK: {
				Symbol symbol = peek(instruction);
				if(symbol == null) {
					frame.i = instruction.falseJump;
					continue;
				}
				put(instruction, symbol);
				break;
			}
			case Instruction.TYPE_MOVE: {
				Symbol symbol = consume(instruction);
				if(symbol == null) {
					frame.i = instruction.falseJump;
					continue;
				}
				put(instruction, symbol);
				break;
			}
			case Instruction.TYPE_CONSUME: {
				Symbol symbol = consume(instruction);
				if(symbol == null) {
					frame.i = instruction.falseJump;
					continue;
				}
				break;
			}
			case Instruction.TYPE_JUMP: {
				frame.i = (int)instruction.operand;
				continue;
			}
			case Instruction.TYPE_PIPE_START: {
				frame.inters[instruction.outputOrdinal] = new IOBuffer();
				break;
			}
			case Instruction.TYPE_PIPE_INTER: {
				frame.inters[instruction.outputOrdinal].pipe();
				break;
			}
			case Instruction.TYPE_PIPE_END: {
				frame.inters[instruction.outputOrdinal].pipe();
				break;
			}
			case Instruction.TYPE_SET_OUTPUT_NEW_INTER: {
				frame.inters[instruction.outputOrdinal] = new IOBuffer();
				break;
			}
			case Instruction.TYPE_PEEK_EQUALS_CONSUME: {
				Symbol symbol = peek(instruction);
				if(symbol == null) {
					frame.i = instruction.falseJump;
					continue;
				}
				Symbol other = (Symbol)instruction.operand;
				if(!symbol.equals(other)) {
					frame.i = instruction.falseJump;
					continue;
				}
				consume(instruction);
				break;
			}
			case Instruction.TYPE_EOF: {
				if(!atEnd(instruction)) {
					frame.i = instruction.falseJump;
					continue;
				}
				break;
			}
			case Instruction.TYPE_NEW_MAP: {
				put(instruction, new Symbol.Map());
				break;
			}
			case Instruction.TYPE_PUSH_FRAME: {
				CodeBuilder.Build moduleBuild = (CodeBuilder.Build)instruction.operand;

				Input input = null;

				switch(instruction.inputType) {
				case Frame.INPUT_SOURCE:
					input = frame.input;
					break;
				case Frame.INPUT_INTER:
					input = frame.inters[instruction.inputOrdinal];
					break;
				case Frame.INPUT_VARIABLE:
					input = frame;
					frame.call = instruction;
					break;
				}

				Output output = null;

				switch(instruction.outputType) {
				case Frame.OUTPUT_TARGET:
					output = frame.output;
					break;
				case Frame.OUTPUT_INTER:
					output = frame.inters[instruction.outputOrdinal];
					break;
				case Frame.OUTPUT_VARIABLE:
					output = frame;
					frame.call = instruction;
					break;
				}

				frame = new Frame(frame, input, output, moduleBuild.code, new Symbol[moduleBuild.variableCount], moduleBuild.interCount);
				continue;
			}
			case Instruction.TYPE_PEEK_GTE: {
				// TODO: Support comparison among more than Identifiers
				Symbol symbol = peek(instruction);
				if(symbol != null && symbol instanceof Symbol.Identifier) {
					Symbol.Identifier lhs = (Symbol.Identifier)symbol;
					Symbol.Identifier rhs = (Symbol.Identifier)instruction.operand;
					if(lhs.name.charAt(0) < rhs.name.charAt(0)) {
						frame.i = instruction.falseJump;
						continue;
					}
				}
				break;
			}
			case Instruction.TYPE_PEEK_LTE: {
				// TODO: Support comparison among more than Identifiers
				Symbol symbol = peek(instruction);
				if(symbol != null && symbol instanceof Symbol.Identifier) {
					Symbol.Identifier lhs = (Symbol.Identifier)symbol;
					Symbol.Identifier rhs = (Symbol.Identifier)instruction.operand;
					if(lhs.name.charAt(0) > rhs.name.charAt(0)) {
						frame.i = instruction.falseJump;
						continue;
					}
				}
				break;
			}
			case Instruction.TYPE_MAP_UNION: {
				Symbol lhs = consume(instruction);
				Symbol rhs = consume(instruction);

				if(lhs != null && rhs != null && lhs instanceof Symbol.Map && rhs instanceof Symbol.Map) {
					Symbol union = ((Symbol.Map)lhs).composeWith((Symbol.Map)rhs);
					put(instruction, union);
				} else {
					frame.i = instruction.falseJump;
					continue;
				}
				break;
			}
			case Instruction.TYPE_FILE: {
				Symbol symbol = consume(instruction);

				if(symbol instanceof Symbol.Identifier) {
					Container.File file = new Container.File(((Symbol.Identifier)symbol).name);
					put(instruction, file);
				} else {
					frame.i = instruction.falseJump;
					continue;
				}
				break;
			}

			case Instruction.TYPE_AS_INTER_INPUT: {
				Symbol symbol = peek(instruction);
				if(symbol != null && symbol instanceof Container) {
					int ordinal = (int)instruction.operand;
					frame.inters[ordinal] = ((Container)symbol).createInput();
				} else {
					frame.i = instruction.falseJump;
					continue;
				}
				break;
			}
			case Instruction.TYPE_CLOSE_INTER_INPUT: {
				int ordinal = (int)instruction.operand;
				frame.inters[ordinal].closeInput();
				break;
			}

			case Instruction.TYPE_AS_INTER_OUTPUT: {
				Symbol symbol = peek(instruction);
				if(symbol != null && symbol instanceof Container) {
					int ordinal = (int)instruction.operand;
					frame.inters[ordinal] = ((Container)symbol).createOutput();
				} else {
					frame.i = instruction.falseJump;
					continue;
				}
				break;
			}
			case Instruction.TYPE_CLOSE_INTER_OUTPUT: {
				int ordinal = (int)instruction.operand;
				frame.inters[ordinal].closeOutput();
				break;
			}
			case Instruction.TYPE_REIFY_INTER: {
				int ordinal = (int)instruction.operand;
				put(instruction, frame.inters[ordinal].reify());
				break;
			}

			case Instruction.TYPE_QUOTE_OUTPUT_TARGET: {
				frame.output.put((Symbol)instruction.operand);
				break;
			}
			case Instruction.TYPE_QUOTE_OUTPUT_INTER: {
				frame.inters[instruction.outputOrdinal].put((Symbol)instruction.operand);
				break;
			}
			case Instruction.TYPE_QUOTE_OUTPUT_VARIABLE: {
				frame.variables[instruction.outputOrdinal] = (Symbol)instruction.operand;
				break;
			}
			case Instruction.TYPE_QUOTE_OUTPUT_MAP_SLOT: {
				((Symbol.Map)frame.variables[instruction.outputOrdinal]).put(instruction.outputSlotPath[0], (Symbol)instruction.operand);
				break;
			}

			case Instruction.TYPE_CHECK_POINT: {
				synchronized (this) {
					checkPoints++;

					if(checkPoints >= maxCheckPoints) {
						frame.i++;
						break finish;
					}
				}
			}
			}

			frame.i++;
		}
	}

	public static String resultToString(int result) {
		switch(result) {
		case Machine.RESULT_ABSENT:
			return "Absent";
		case Machine.RESULT_ACCEPTED:
			return "Accepted";
		case Machine.RESULT_REJECTED:
			return "Rejected";
		}

		return "<INVALID RESULT>";
	}
}


text:
<mat-toolbar color="primary" class="mat-elevation-z6">
  {{name}}

        <button mat-icon-button color="basic" (click)="openDialog()" *ngIf="router.url.includes('/brew/')">
            <mat-icon class="mat-24" aria-label="Brew setup">settings</mat-icon>
        </button>
        <button mat-button *ngIf="!auth.isAuthenticated()" (click)="auth.login()">Log In</button>
        <button mat-button
                [matMenuTriggerFor]="menu"
                *ngIf="auth.isAuthenticated()">
            <mat-icon>account_box</mat-icon>
            {{userName}}
        </button>
        <mat-menu #menu="matMenu">
            <button mat-menu-item (click)="auth.logout()">
                Log out
            </button>
        </mat-menu>

</mat-toolbar>

  <router-outlet></router-outlet>


text:
#pragma once
#include <aws/ds/DirectoryService_EXPORTS.h>
#include <aws/ds/DirectoryServiceRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/ds/model/IpRoute.h>
#include <utility>

namespace Aws
{
namespace DirectoryService
{
namespace Model
{

  /**
   */
  class AWS_DIRECTORYSERVICE_API AddIpRoutesRequest : public DirectoryServiceRequest
  {
  public:
    AddIpRoutesRequest();
    Aws::String SerializePayload() const override;

    Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override;

    /**
     *
Identifier (ID) of the directory to which to add the address block.

     */
    inline const Aws::String& GetDirectoryId() const{ return m_directoryId; }

    /**
     *
Identifier (ID) of the directory to which to add the address block.

     */
    inline void SetDirectoryId(const Aws::String& value) { m_directoryIdHasBeenSet = true; m_directoryId = value; }

    /**
     *
Identifier (ID) of the directory to which to add the address block.

     */
    inline void SetDirectoryId(Aws::String&& value) { m_directoryIdHasBeenSet = true; m_directoryId = std::move(value); }

    /**
     *
Identifier (ID) of the directory to which to add the address block.

     */
    inline void SetDirectoryId(const char* value) { m_directoryIdHasBeenSet = true; m_directoryId.assign(value); }

    /**
     *
Identifier (ID) of the directory to which to add the address block.

     */
    inline AddIpRoutesRequest& WithDirectoryId(const Aws::String& value) { SetDirectoryId(value); return *this;}

    /**
     *
Identifier (ID) of the directory to which to add the address block.

     */
    inline AddIpRoutesRequest& WithDirectoryId(Aws::String&& value) { SetDirectoryId(std::move(value)); return *this;}

    /**
     *
Identifier (ID) of the directory to which to add the address block.

     */
    inline AddIpRoutesRequest& WithDirectoryId(const char* value) { SetDirectoryId(value); return *this;}

    /**
     *
IP address blocks, using CIDR format, of the traffic to route. This is often
     * the IP address block of the DNS server used for your on-premises domain.

     */
    inline const Aws::Vector<IpRoute>& GetIpRoutes() const{ return m_ipRoutes; }

    /**
     *
IP address blocks, using CIDR format, of the traffic to route. This is often
     * the IP address block of the DNS server used for your on-premises domain.

     */
    inline void SetIpRoutes(const Aws::Vector<IpRoute>& value) { m_ipRoutesHasBeenSet = true; m_ipRoutes = value; }

    /**
     *
IP address blocks, using CIDR format, of the traffic to route. This is often
     * the IP address block of the DNS server used for your on-premises domain.

     */
    inline void SetIpRoutes(Aws::Vector<IpRoute>&& value) { m_ipRoutesHasBeenSet = true; m_ipRoutes = std::move(value); }

    /**
     *
IP address blocks, using CIDR format, of the traffic to route. This is often
     * the IP address block of the DNS server used for your on-premises domain.

     */
    inline AddIpRoutesRequest& WithIpRoutes(const Aws::Vector<IpRoute>& value) { SetIpRoutes(value); return *this;}

    /**
     *
IP address blocks, using CIDR format, of the traffic to route. This is often
     * the IP address block of the DNS server used for your on-premises domain.

     */
    inline AddIpRoutesRequest& WithIpRoutes(Aws::Vector<IpRoute>&& value) { SetIpRoutes(std::move(value)); return *this;}

    /**
     *
IP address blocks, using CIDR format, of the traffic to route. This is often
     * the IP address block of the DNS server used for your on-premises domain.

     */
    inline AddIpRoutesRequest& AddIpRoutes(const IpRoute& value) { m_ipRoutesHasBeenSet = true; m_ipRoutes.push_back(value); return *this; }

    /**
     *
IP address blocks, using CIDR format, of the traffic to route. This is often
     * the IP address block of the DNS server used for your on-premises domain.

     */
    inline AddIpRoutesRequest& AddIpRoutes(IpRoute&& value) { m_ipRoutesHasBeenSet = true; m_ipRoutes.push_back(std::move(value)); return *this; }

    /**
     *
If set to true, updates the inbound and outbound rules of the security group
     * that has the description: "AWS created security group for directory ID
     * directory controllers." Following are the new rules:

Inbound:

     *

Type: Custom UDP Rule, Protocol: UDP, Range: 88, Source: 0.0.0.0/0

     *

Type: Custom UDP Rule, Protocol: UDP, Range: 123, Source:
     * 0.0.0.0/0

Type: Custom UDP Rule, Protocol: UDP, Range: 138,
     * Source: 0.0.0.0/0

Type: Custom UDP Rule, Protocol: UDP, Range:
     * 389, Source: 0.0.0.0/0

Type: Custom UDP Rule, Protocol: UDP,
     * Range: 464, Source: 0.0.0.0/0

Type: Custom UDP Rule, Protocol:
     * UDP, Range: 445, Source: 0.0.0.0/0

Type: Custom TCP Rule,
     * Protocol: TCP, Range: 88, Source: 0.0.0.0/0

Type: Custom TCP
     * Rule, Protocol: TCP, Range: 135, Source: 0.0.0.0/0

Type:
     * Custom TCP Rule, Protocol: TCP, Range: 445, Source: 0.0.0.0/0

     *
Type: Custom TCP Rule, Protocol: TCP, Range: 464, Source: 0.0.0.0/0

     *

Type: Custom TCP Rule, Protocol: TCP, Range: 636, Source: 0.0.0.0/0

     *

Type: Custom TCP Rule, Protocol: TCP, Range: 1024-65535, Source:
     * 0.0.0.0/0

Type: Custom TCP Rule, Protocol: TCP, Range:
     * 3268-33269, Source: 0.0.0.0/0

Type: DNS (UDP), Protocol: UDP,
     * Range: 53, Source: 0.0.0.0/0

Type: DNS (TCP), Protocol: TCP,
     * Range: 53, Source: 0.0.0.0/0

Type: LDAP, Protocol: TCP, Range:
     * 389, Source: 0.0.0.0/0

Type: All ICMP, Protocol: All, Range:
     * N/A, Source: 0.0.0.0/0

Outbound:

Type:
     * All traffic, Protocol: All, Range: All, Destination: 0.0.0.0/0

     *
These security rules impact an internal network interface that is not exposed
     * publicly.

     */
    inline bool GetUpdateSecurityGroupForDirectoryControllers() const{ return m_updateSecurityGroupForDirectoryControllers; }

    /**
     *
If set to true, updates the inbound and outbound rules of the security group
     * that has the description: "AWS created security group for directory ID
     * directory controllers." Following are the new rules:

Inbound:

     *

Type: Custom UDP Rule, Protocol: UDP, Range: 88, Source: 0.0.0.0/0

     *

Type: Custom UDP Rule, Protocol: UDP, Range: 123, Source:
     * 0.0.0.0/0

Type: Custom UDP Rule, Protocol: UDP, Range: 138,
     * Source: 0.0.0.0/0

Type: Custom UDP Rule, Protocol: UDP, Range:
     * 389, Source: 0.0.0.0/0

Type: Custom UDP Rule, Protocol: UDP,
     * Range: 464, Source: 0.0.0.0/0

Type: Custom UDP Rule, Protocol:
     * UDP, Range: 445, Source: 0.0.0.0/0

Type: Custom TCP Rule,
     * Protocol: TCP, Range: 88, Source: 0.0.0.0/0

Type: Custom TCP
     * Rule, Protocol: TCP, Range: 135, Source: 0.0.0.0/0

Type:
     * Custom TCP Rule, Protocol: TCP, Range: 445, Source: 0.0.0.0/0

     *
Type: Custom TCP Rule, Protocol: TCP, Range: 464, Source: 0.0.0.0/0

     *

Type: Custom TCP Rule, Protocol: TCP, Range: 636, Source: 0.0.0.0/0

     *

Type: Custom TCP Rule, Protocol: TCP, Range: 1024-65535, Source:
     * 0.0.0.0/0

Type: Custom TCP Rule, Protocol: TCP, Range:
     * 3268-33269, Source: 0.0.0.0/0

Type: DNS (UDP), Protocol: UDP,
     * Range: 53, Source: 0.0.0.0/0

Type: DNS (TCP), Protocol: TCP,
     * Range: 53, Source: 0.0.0.0/0

Type: LDAP, Protocol: TCP, Range:
     * 389, Source: 0.0.0.0/0

Type: All ICMP, Protocol: All, Range:
     * N/A, Source: 0.0.0.0/0

Outbound:

Type:
     * All traffic, Protocol: All, Range: All, Destination: 0.0.0.0/0

     *
These security rules impact an internal network interface that is not exposed
     * publicly.

     */
    inline void SetUpdateSecurityGroupForDirectoryControllers(bool value) { m_updateSecurityGroupForDirectoryControllersHasBeenSet = true; m_updateSecurityGroupForDirectoryControllers = value; }

    /**
     *
If set to true, updates the inbound and outbound rules of the security group
     * that has the description: "AWS created security group for directory ID
     * directory controllers." Following are the new rules:

Inbound:

     *

Type: Custom UDP Rule, Protocol: UDP, Range: 88, Source: 0.0.0.0/0

     *

Type: Custom UDP Rule, Protocol: UDP, Range: 123, Source:
     * 0.0.0.0/0

Type: Custom UDP Rule, Protocol: UDP, Range: 138,
     * Source: 0.0.0.0/0

Type: Custom UDP Rule, Protocol: UDP, Range:
     * 389, Source: 0.0.0.0/0

Type: Custom UDP Rule, Protocol: UDP,
     * Range: 464, Source: 0.0.0.0/0

Type: Custom UDP Rule, Protocol:
     * UDP, Range: 445, Source: 0.0.0.0/0

Type: Custom TCP Rule,
     * Protocol: TCP, Range: 88, Source: 0.0.0.0/0

Type: Custom TCP
     * Rule, Protocol: TCP, Range: 135, Source: 0.0.0.0/0

Type:
     * Custom TCP Rule, Protocol: TCP, Range: 445, Source: 0.0.0.0/0

     *
Type: Custom TCP Rule, Protocol: TCP, Range: 464, Source: 0.0.0.0/0

     *

Type: Custom TCP Rule, Protocol: TCP, Range: 636, Source: 0.0.0.0/0

     *

Type: Custom TCP Rule, Protocol: TCP, Range: 1024-65535, Source:
     * 0.0.0.0/0

Type: Custom TCP Rule, Protocol: TCP, Range:
     * 3268-33269, Source: 0.0.0.0/0

Type: DNS (UDP), Protocol: UDP,
     * Range: 53, Source: 0.0.0.0/0

Type: DNS (TCP), Protocol: TCP,
     * Range: 53, Source: 0.0.0.0/0

Type: LDAP, Protocol: TCP, Range:
     * 389, Source: 0.0.0.0/0

Type: All ICMP, Protocol: All, Range:
     * N/A, Source: 0.0.0.0/0

Outbound:

Type:
     * All traffic, Protocol: All, Range: All, Destination: 0.0.0.0/0

     *
These security rules impact an internal network interface that is not exposed
     * publicly.

     */
    inline AddIpRoutesRequest& WithUpdateSecurityGroupForDirectoryControllers(bool value) { SetUpdateSecurityGroupForDirectoryControllers(value); return *this;}

  private:
    Aws::String m_directoryId;
    bool m_directoryIdHasBeenSet;
    Aws::Vector<IpRoute> m_ipRoutes;
    bool m_ipRoutesHasBeenSet;
    bool m_updateSecurityGroupForDirectoryControllers;
    bool m_updateSecurityGroupForDirectoryControllersHasBeenSet;
  };

} // namespace Model
} // namespace DirectoryService
} // namespace Aws


text:
IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P'  AND SCHEMA_NAME([schema_id]) = 'EPONS' AND QUOTENAME(name) = '[FindPatientAvatarById]')
DROP PROCEDURE [EPONS].[FindPatientAvatarById]
GO

CREATE PROCEDURE [EPONS].[FindPatientAvatarById]
@patientId UNIQUEIDENTIFIER
AS
SELECT [Avatar] FROM [Patient].[Details] WHERE [PatientId] = @patientId

EXEC [Audit].[CreateLogEntry] '[EPONS].[FindPatientAvatarById]', 'Executed'


text:
\begin{titlepage}
\begin{center}
SAND2008-xxxx\\
DRAFT\\
Draft Date: \today\\
\end{center}

\vspace{1.0in}

\begin{center}
{\Huge\bf EXODUS:\\ A Finite Element Data Model\\}
\vspace{1.0in}
{\large Gregory D. Sjaardema\\
	Larry A. Schoof\\
	Victor R. Yarberry\\
	Computational Mechanics and Visualization Department\\
	Sandia National Laboratories\\
	Albuquerque, NM 87185}
\end{center}
\vspace{1.0in}
\begin{center}
\large\bf Abstract
\end{center}

\exo{} is a model developed to store and retrieve data for finite
element analyses. It is used for preprocessing (problem definition),
postprocessing (results visualization), as well as code to code data
transfer. An \exo{} data file is a random access, machine independent,
binary file that is written and read via C, C++, or Fortran library
routines which comprise the Application Programming Interface (API).

\end{titlepage}


text:
<?php

namespace LegalThings\DataEnricher\Processor;

use LegalThings\DataEnricher\Node;
use LegalThings\DataEnricher\Processor;

/**
 * @covers LegalThings\DataEnricher\Processor\Equal
 */
class EqualTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @var Processor\Equal;
     */
    protected $processor;

    public function setUp()
    {
        $this->processor = new Processor\Equal('<equal>');
    }

    public function instructionProvider()
    {
        return [
            [['string1', 'string1'], true],
            [['string1', 'string2'], false],
            [[true, true], true],
            [[false, false], true],
            [[true, false], false],
            [[['foo'], ['foo']], true],
            [[['foo'], ['bar']], false]
        ];
    }

    /**
     * @dataProvider instructionProvider
     *
     * @param string|object|array $instruction
     * @param object              $source
     * @param array|object        $target
     * @param string|object|array $result
     */
    public function testApplyToNode($instruction, $result)
    {
        $node = $this->createMock(Node::class);

        $node->expects($this->atLeastOnce())
            ->method('getInstruction')
            ->with($this->processor)
            ->willReturn($instruction);

        $node->expects($this->atLeastOnce())
            ->method('setResult')
            ->with($result);

        $this->processor->applyToNode($node);
    }
}


text:
#ifndef RenderSVGResource_h
#define RenderSVGResource_h

#include "core/rendering/svg/RenderSVGShape.h"
#include "core/svg/SVGDocumentExtensions.h"

namespace WebCore {

enum RenderSVGResourceType {
    MaskerResourceType,
    MarkerResourceType,
    PatternResourceType,
    LinearGradientResourceType,
    RadialGradientResourceType,
    SolidColorResourceType,
    FilterResourceType,
    ClipperResourceType
};

// If this enum changes change the unsigned bitfields using it.
enum RenderSVGResourceMode {
    ApplyToDefaultMode = 1 << 0, // used for all resources except gradient/pattern
    ApplyToFillMode    = 1 << 1,
    ApplyToStrokeMode  = 1 << 2,
    ApplyToTextMode    = 1 << 3 // used in combination with ApplyTo{Fill|Stroke}Mode
};

class Color;
class FloatRect;
class GraphicsContext;
class Path;
class RenderObject;
class RenderStyle;
class RenderSVGResourceSolidColor;

class RenderSVGResource {
public:
    RenderSVGResource() { }
    virtual ~RenderSVGResource() { }

    virtual void removeAllClientsFromCache(bool markForInvalidation = true) = 0;
    virtual void removeClientFromCache(RenderObject*, bool markForInvalidation = true) = 0;

    virtual bool applyResource(RenderObject*, RenderStyle*, GraphicsContext*&, unsigned short resourceMode) = 0;
    virtual void postApplyResource(RenderObject*, GraphicsContext*&, unsigned short, const Path*, const RenderSVGShape*) { }
    virtual FloatRect resourceBoundingBox(RenderObject*) = 0;

    virtual RenderSVGResourceType resourceType() const = 0;

    template<class Renderer>
    Renderer* cast()
    {
        if (Renderer::s_resourceType == resourceType())
            return static_cast<Renderer*>(this);

        return 0;
    }

    // Helper utilities used in the render tree to access resources used for painting shapes/text (gradients & patterns & solid colors only)
    static RenderSVGResource* fillPaintingResource(RenderObject*, const RenderStyle*, Color& fallbackColor);
    static RenderSVGResource* strokePaintingResource(RenderObject*, const RenderStyle*, Color& fallbackColor);
    static RenderSVGResourceSolidColor* sharedSolidPaintingResource();

    static void markForLayoutAndParentResourceInvalidation(RenderObject*, bool needsLayout = true);
};

}

#endif


text:
package com.example.texttospeech;

// [START tts_quickstart]
// Imports the Google Cloud client library
import com.google.cloud.texttospeech.v1beta1.AudioConfig;
import com.google.cloud.texttospeech.v1beta1.AudioEncoding;
import com.google.cloud.texttospeech.v1beta1.SsmlVoiceGender;
import com.google.cloud.texttospeech.v1beta1.SynthesisInput;
import com.google.cloud.texttospeech.v1beta1.SynthesizeSpeechResponse;
import com.google.cloud.texttospeech.v1beta1.TextToSpeechClient;
import com.google.cloud.texttospeech.v1beta1.VoiceSelectionParams;
import com.google.protobuf.ByteString;
import java.io.FileOutputStream;
import java.io.OutputStream;

/**
 * Google Cloud TextToSpeech API sample application. Example usage: mvn package exec:java
 * -Dexec.mainClass='com.example.texttospeech.QuickstartSampleBeta'
 */
public class QuickstartSampleBeta {

  /** Demonstrates using the Text-to-Speech API. */
  public static void main(String... args) throws Exception {
    // Instantiates a client
    try (TextToSpeechClient textToSpeechClient = TextToSpeechClient.create()) {
      // Set the text input to be synthesized
      SynthesisInput input = SynthesisInput.newBuilder().setText("Hello, World!").build();

      // Build the voice request, select the language code ("en-US") and the ssml voice gender
      // ("neutral")
      VoiceSelectionParams voice =
          VoiceSelectionParams.newBuilder()
              .setLanguageCode("en-US")
              .setSsmlGender(SsmlVoiceGender.NEUTRAL)
              .build();

      // Select the type of audio file you want returned
      AudioConfig audioConfig =
          AudioConfig.newBuilder().setAudioEncoding(AudioEncoding.MP3).build();

      // Perform the text-to-speech request on the text input with the selected voice parameters and
      // audio file type
      SynthesizeSpeechResponse response =
          textToSpeechClient.synthesizeSpeech(input, voice, audioConfig);

      // Get the audio contents from the response
      ByteString audioContents = response.getAudioContent();

      // Write the response to the output file.
      try (OutputStream out = new FileOutputStream("output.mp3")) {
        out.write(audioContents.toByteArray());
        System.out.println("Audio content written to file \"output.mp3\"");
      }
    }
  }
}
// [END tts_quickstart]


text:
package eu.bcvsolutions.idm.core.config.domain;

import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.unit.DataSize;
import org.springframework.util.unit.DataUnit;

import eu.bcvsolutions.idm.core.api.config.domain.AbstractConfiguration;
import eu.bcvsolutions.idm.core.api.config.domain.IdentityConfiguration;
import eu.bcvsolutions.idm.core.api.config.domain.PrivateIdentityConfiguration;
import eu.bcvsolutions.idm.core.api.domain.ContractState;

/**
 * Configuration for identity (private - sec).
 *
 * @author Radek Tomiška
 *
 */
@Component("privateIdentityConfiguration")
public class DefaultPrivateIdentityConfiguration extends AbstractConfiguration implements PrivateIdentityConfiguration {

	private static final org.slf4j.Logger LOG = org.slf4j.LoggerFactory.getLogger(DefaultPrivateIdentityConfiguration.class);
	//
	@Autowired private IdentityConfiguration publicConfiguration;

	@Override
	public IdentityConfiguration getPublicConfiguration() {
		return publicConfiguration;
	}

	@Override
	public long getProfileImageMaxFileSize() {
		String maxFileSize = getConfigurationService().getValue(PROPERTY_IDENTITY_PROFILE_IMAGE_MAX_FILE_SIZE);
		if (StringUtils.isBlank(maxFileSize)) {
			return DataSize.parse(DEFAULT_IDENTITY_PROFILE_IMAGE_MAX_FILE_SIZE).toBytes();
		}
		//
		return DataSize.parse(maxFileSize, DataUnit.BYTES).toBytes();
	}

	@Override
	public boolean isCreateDefaultContractEnabled() {
		// new configuration - higher priority
		String newConfiguration = getConfigurationService().getValue(PROPERTY_IDENTITY_CREATE_DEFAULT_CONTRACT_ENABLED);
		if (StringUtils.isNotBlank(newConfiguration)) {
			return Boolean.parseBoolean(newConfiguration);
		}
		// backward compatible
		@SuppressWarnings("deprecation")
		String previousConfiguration = getConfigurationService().getValue(IdentityConfiguration.PROPERTY_IDENTITY_CREATE_DEFAULT_CONTRACT);
		if (StringUtils.isNotBlank(previousConfiguration)) {
			return Boolean.parseBoolean(previousConfiguration);
		}
		// default (same as previous)
		return DEFAULT_IDENTITY_CREATE_DEFAULT_CONTRACT_ENABLED;
	}

	@Override
	public String getCreateDefaultContractPosition() {
		return getConfigurationService().getValue(PROPERTY_IDENTITY_CREATE_DEFAULT_CONTRACT_POSITION, DEFAULT_IDENTITY_CREATE_DEFAULT_CONTRACT_POSITION);
	}

	@Override
	public Long getCreateDefaultContractExpiration() {
		return getConfigurationService().getLongValue(PROPERTY_IDENTITY_CREATE_DEFAULT_CONTRACT_EXPIRATION);
	}

	@Override
	public ContractState getCreateDefaultContractState() {
		String contractState = getConfigurationService().getValue(PROPERTY_IDENTITY_CREATE_DEFAULT_CONTRACT_STATE);
		if (StringUtils.isBlank(contractState)) {
			return null;
		}
		//
		try {
			return ContractState.valueOf(contractState.trim().toUpperCase());
		} catch (IllegalArgumentException ex) {
			LOG.warn("Default contract state [{}] is wrongly configured. Contract will be valid by default, fix configuration property [{}]",
					contractState, PROPERTY_IDENTITY_CREATE_DEFAULT_CONTRACT_STATE,  ex);
			return null;
		}
	}
}


text:
package org.apache.eagle.app.test;

import com.google.inject.Guice;
import com.google.inject.Inject;
import com.google.inject.Injector;
import org.apache.eagle.metadata.model.ApplicationEntity;
import org.apache.eagle.metadata.service.ApplicationStatusUpdateService;
import org.junit.Assert;
import org.junit.Before;

public class ApplicationTestBase {
    private Injector injector;

    @Inject
    ApplicationStatusUpdateService statusUpdateService;

    @Before
    public void setUp() {
        injector = Guice.createInjector(new ApplicationTestGuiceModule());
        injector.injectMembers(this);
    }

    protected Injector injector() {
        return injector;
    }

    protected void awaitApplicationStop(ApplicationEntity applicationEntity) throws InterruptedException {
        int attempt = 0;
        while (attempt < 30) {
            attempt ++;
            if (applicationEntity.getStatus() == ApplicationEntity.Status.STOPPED
                    || applicationEntity.getStatus() == ApplicationEntity.Status.INITIALIZED) {
                break;
            } else {
                statusUpdateService.updateApplicationEntityStatus(applicationEntity);
                Thread.sleep(1000);
            }
        }
        if (attempt >= 30) {
            Assert.fail("Failed to wait for application to STOPPED after 10 attempts");
        }
    }

    protected void awaitApplicationStatus(ApplicationEntity applicationEntity, ApplicationEntity.Status status) throws InterruptedException {
        int attempt = 0;
        while (attempt < 30) {
            attempt ++;
            if (applicationEntity.getStatus() == status) {
                break;
            } else {
                statusUpdateService.updateApplicationEntityStatus(applicationEntity);
                Thread.sleep(1000);
            }
        }
        if (attempt >= 30) {
            Assert.fail("Failed to wait for application to STOPPED after 10 attempts");
        }
    }
}


text:
import React          from "react";
import TernaryPlot    from "./ternary-plot";
import Slider         from "./slider";
import DescriptorList from "./descriptor-list";

const ComponentWithDefaultSelected = component => props => {
	let descriptors;
	// If there is no selection, and there are exactly three descriptors to choose from
	if (!props.selected.length && (descriptors = Object.keys(props.context).filter(label => label != "__description")).length === 3)
		return component({...props, selected: descriptors});

	// Otherwise invoke the component without modifying props
	return component(props);
};

const StatelessCell = props => {
	const plot_label = name => {
		if (!props.context[name])
			return name;
		else
		if (props.children.length && props.children[0].title === name)
			return  props.onRemoveClick(e, props.children[0].id)}>{name};
		else
			return  props.onLabelClick(e, name)}>{name}; // eslint-disable-line react/prop-types
	};

	const button_label = num_selected =>
		num_selected === 3 ? "Next" : `Choose ${3 - num_selected} more`;

	return (

			{props.title &&

{props.title}
}
			{!props.has_done_step_0 &&

{"Pick three things to compare" + (props.context.__description || "") + "."}

					<DescriptorList items={Object.keys(props.context).filter(name => name != "__description")}
						selected={props.selected}
						onSelection={selected => props.onChange({selected})} />
					<button disabled={props.selected.length != 3}
						onClick={_ => props.onChange({severity: 0.5, ratios:[0.3333, 0.3333, 0.3333], selected:props.selected, has_done_step_0:true})}>
						{button_label(props.selected.length)}
					</button>

}
			{props.has_done_step_0 &&

					{props.giveInstructions &&

← 1. Move the red dot to show how important each item is to you
}
					<TernaryPlot values={props.ratios} labels={props.selected.map(plot_label)}
						onChange={ratios => props.onChange({ratios, has_done_step_1:true})} />
					{props.giveInstructions && props.has_done_step_2 &&

← 3. Click on a label to give further detail
}
					{props.giveInstructions && props.has_done_step_1 &&

← 2. Adjust the slider to describe how severe the problem is
}
					<Slider value={props.severity}
						onChange={severity => props.onChange({severity, has_done_step_1:true, has_done_step_2:true})} />

}

	);
};

StatelessCell.PropTypes = {
	children:      React.PropTypes.array,
	title:         React.PropTypes.string,
	context:       React.PropTypes.object.isRequired,
	selected:      React.PropTypes.arrayOf(React.PropTypes.string),
	ratios:        React.PropTypes.arrayOf(React.PropTypes.number),
	severity:      React.PropTypes.number,
	onChange:      React.PropTypes.func.isRequired,
	onCopyClick:   React.PropTypes.func.isRequired,
	onLabelClick:  React.PropTypes.func.isRequired,
	onRemoveClick: React.PropTypes.func.isRequired,
};

const Cell = ComponentWithDefaultSelected(StatelessCell);
Cell.PropTypes = StatelessCell.PropTypes;

export default Cell;


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Collema pycnocarpum f. pycnocarpum

### Remarks
null


text:
<?php

  $api_call = true;
  require_once('../lib/php/constants.php');
  require_once('../lib/php/classloader.php');
  spl_autoload_register('loadClass');


text:
namespace llvm {
namespace MachO {
class InterfaceFile;
} // end namespace MachO

template <class AllocatorTy>
class StringSet;
} // end namespace llvm

namespace swift {

class FileUnit;
class ModuleDecl;
struct TBDGenOptions;

class TBDGenDescriptor final {
  using FileOrModule = llvm::PointerUnion<FileUnit *, ModuleDecl *>;
  FileOrModule Input;
  const TBDGenOptions &Opts;

  TBDGenDescriptor(FileOrModule input, const TBDGenOptions &opts)
      : Input(input), Opts(opts) {
    assert(input);
  }

public:
  /// Returns the file or module we're emitting TBD for.
  FileOrModule getFileOrModule() const { return Input; }

  /// If the input is a single file, returns that file. Otherwise returns
  /// \c nullptr.
  FileUnit *getSingleFile() const;

  /// Returns the parent module for TBD emission.
  ModuleDecl *getParentModule() const;

  /// Returns the TBDGen options.
  const TBDGenOptions &getOptions() const { return Opts; }

  bool operator==(const TBDGenDescriptor &other) const;
  bool operator!=(const TBDGenDescriptor &other) const {
    return !(*this == other);
  }

  static TBDGenDescriptor forFile(FileUnit *file, const TBDGenOptions &opts) {
    return TBDGenDescriptor(file, opts);
  }

  static TBDGenDescriptor forModule(ModuleDecl *M, const TBDGenOptions &opts) {
    return TBDGenDescriptor(M, opts);
  }
};

llvm::hash_code hash_value(const TBDGenDescriptor &desc);
void simple_display(llvm::raw_ostream &out, const TBDGenDescriptor &desc);
SourceLoc extractNearestSourceLoc(const TBDGenDescriptor &desc);

using TBDFileAndSymbols =
    std::pair<llvm::MachO::InterfaceFile, llvm::StringSet<>>;

/// Computes the TBD file and public symbols for a given module or file.
class GenerateTBDRequest
    : public SimpleRequest<GenerateTBDRequest,
                           TBDFileAndSymbols(TBDGenDescriptor),
                           RequestFlags::Uncached> {
public:
  using SimpleRequest::SimpleRequest;

private:
  friend SimpleRequest;

  // Evaluation.
  TBDFileAndSymbols evaluate(Evaluator &evaluator, TBDGenDescriptor desc) const;
};

/// Report that a request of the given kind is being evaluated, so it
/// can be recorded by the stats reporter.
template <typename Request>
void reportEvaluatedRequest(UnifiedStatsReporter &stats,
                            const Request &request);

/// The zone number for TBDGen.
#define SWIFT_TYPEID_ZONE TBDGen
#define SWIFT_TYPEID_HEADER "swift/AST/TBDGenTypeIDZone.def"
#include "swift/Basic/DefineTypeIDZone.h"
#undef SWIFT_TYPEID_ZONE
#undef SWIFT_TYPEID_HEADER

// Set up reporting of evaluated requests.
#define SWIFT_REQUEST(Zone, RequestType, Sig, Caching, LocOptions)             \
template<>                                                                     \
inline void reportEvaluatedRequest(UnifiedStatsReporter &stats,                \
                                   const RequestType &request) {               \
  ++stats.getFrontendCounters().RequestType;                                   \
}
#include "swift/AST/TBDGenTypeIDZone.def"
#undef SWIFT_REQUEST

} // end namespace swift

#endif // SWIFT_TBDGEN_REQUESTS_H


text:
using UnityEngine.Rendering;
using UnityEngine.Serialization;

namespace UnityEngine.Experimental.Rendering.HDPipeline
{
    [VolumeComponentMenu("Lighting/Volumetric fog quality")]
    public class VolumetricLightingController : VolumeComponent
    {
        [Tooltip("Sets the distance (in meters) from the Camera's Near Clipping Plane to the back of the Camera's volumetric lighting buffer.")]
        public MinFloatParameter depthExtent = new MinFloatParameter(64.0f, 0.1f);
        [Tooltip("Controls the distribution of slices along the Camera's focal axis. 0 is exponential distribution and 1 is linear distribution.")]
        [FormerlySerializedAs("depthDistributionUniformity")]
        public ClampedFloatParameter sliceDistributionUniformity = new ClampedFloatParameter(0.75f, 0, 1);

        VolumetricLightingController()
        {
            displayName = "Volumetric fog quality";
        }
    }
} // UnityEngine.Experimental.Rendering.HDPipeline