text:
package armbilling

import (
	"context"
	"errors"
	"github.com/Azure/azure-sdk-for-go/sdk/azcore"
	"github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
	armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime"
	"github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud"
	"github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
	"github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
	"net/http"
	"net/url"
	"strings"
)

// RoleAssignmentsClient contains the methods for the BillingRoleAssignments group.
// Don't use this type directly, use NewRoleAssignmentsClient() instead.
type RoleAssignmentsClient struct {
	host string
	pl   runtime.Pipeline
}

// NewRoleAssignmentsClient creates a new instance of RoleAssignmentsClient with the specified values.
// credential - used to authorize requests. Usually a credential from azidentity.
// options - pass nil to accept the default values.
func NewRoleAssignmentsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*RoleAssignmentsClient, error) {
	if options == nil {
		options = &arm.ClientOptions{}
	}
	ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint
	if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok {
		ep = c.Endpoint
	}
	pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options)
	if err != nil {
		return nil, err
	}
	client := &RoleAssignmentsClient{
		host: ep,
		pl:   pl,
	}
	return client, nil
}

// DeleteByBillingAccount - Deletes a role assignment for the caller on a billing account. The operation is supported for
// billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement.
// If the operation fails it returns an *azcore.ResponseError type.
// Generated from API version 2020-05-01
// billingAccountName - The ID that uniquely identifies a billing account.
// billingRoleAssignmentName - The ID that uniquely identifies a role assignment.
// options - RoleAssignmentsClientDeleteByBillingAccountOptions contains the optional parameters for the RoleAssignmentsClient.DeleteByBillingAccount
// method.
func (client *RoleAssignmentsClient) DeleteByBillingAccount(ctx context.Context, billingAccountName string, billingRoleAssignmentName string, options *RoleAssignmentsClientDeleteByBillingAccountOptions) (RoleAssignmentsClientDeleteByBillingAccountResponse, error) {
	req, err := client.deleteByBillingAccountCreateRequest(ctx, billingAccountName, billingRoleAssignmentName, options)
	if err != nil {
		return RoleAssignmentsClientDeleteByBillingAccountResponse{}, err
	}
	resp, err := client.pl.Do(req)
	if err != nil {
		return RoleAssignmentsClientDeleteByBillingAccountResponse{}, err
	}
	if !runtime.HasStatusCode(resp, http.StatusOK) {
		return RoleAssignmentsClientDeleteByBillingAccountResponse{}, runtime.NewResponseError(resp)
	}
	return client.deleteByBillingAccountHandleResponse(resp)
}

// deleteByBillingAccountCreateRequest creates the DeleteByBillingAccount request.
func (client *RoleAssignmentsClient) deleteByBillingAccountCreateRequest(ctx context.Context, billingAccountName string, billingRoleAssignmentName string, options *RoleAssignmentsClientDeleteByBillingAccountOptions) (*policy.Request, error) {
	urlPath := "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleAssignments/{billingRoleAssignmentName}"
	if billingAccountName == "" {
		return nil, errors.New("parameter billingAccountName cannot be empty")
	}
	urlPath = strings.ReplaceAll(urlPath, "{billingAccountName}", url.PathEscape(billingAccountName))
	if billingRoleAssignmentName == "" {
		return nil, errors.New("parameter billingRoleAssignmentName cannot be empty")
	}
	urlPath = strings.ReplaceAll(urlPath, "{billingRoleAssignmentName}", url.PathEscape(billingRoleAssignmentName))
	req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath))
	if err != nil {
		return nil, err
	}
	reqQP := req.Raw().URL.Query()
	reqQP.Set("api-version", "2020-05-01")
	req.Raw().URL.RawQuery = reqQP.Encode()
	req.Raw().Header["Accept"] = []string{"application/json"}
	return req, nil
}

// deleteByBillingAccountHandleResponse handles the DeleteByBillingAccount response.
func (client *RoleAssignmentsClient) deleteByBillingAccountHandleResponse(resp *http.Response) (RoleAssignmentsClientDeleteByBillingAccountResponse, error) {
	result := RoleAssignmentsClientDeleteByBillingAccountResponse{}
	if err := runtime.UnmarshalAsJSON(resp, &result.RoleAssignment); err != nil {
		return RoleAssignmentsClientDeleteByBillingAccountResponse{}, err
	}
	return result, nil
}

// DeleteByBillingProfile - Deletes a role assignment for the caller on a billing profile. The operation is supported for
// billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement.
// If the operation fails it returns an *azcore.ResponseError type.
// Generated from API version 2020-05-01
// billingAccountName - The ID that uniquely identifies a billing account.
// billingProfileName - The ID that uniquely identifies a billing profile.
// billingRoleAssignmentName - The ID that uniquely identifies a role assignment.
// options - RoleAssignmentsClientDeleteByBillingProfileOptions contains the optional parameters for the RoleAssignmentsClient.DeleteByBillingProfile
// method.
func (client *RoleAssignmentsClient) DeleteByBillingProfile(ctx context.Context, billingAccountName string, billingProfileName string, billingRoleAssignmentName string, options *RoleAssignmentsClientDeleteByBillingProfileOptions) (RoleAssignmentsClientDeleteByBillingProfileResponse, error) {
	req, err := client.deleteByBillingProfileCreateRequest(ctx, billingAccountName, billingProfileName, billingRoleAssignmentName, options)
	if err != nil {
		return RoleAssignmentsClientDeleteByBillingProfileResponse{}, err
	}
	resp, err := client.pl.Do(req)
	if err != nil {
		return RoleAssignmentsClientDeleteByBillingProfileResponse{}, err
	}
	if !runtime.HasStatusCode(resp, http.StatusOK) {
		return RoleAssignmentsClientDeleteByBillingProfileResponse{}, runtime.NewResponseError(resp)
	}
	return client.deleteByBillingProfileHandleResponse(resp)
}

// deleteByBillingProfileCreateRequest creates the DeleteByBillingProfile request.
func (client *RoleAssignmentsClient) deleteByBillingProfileCreateRequest(ctx context.Context, billingAccountName string, billingProfileName string, billingRoleAssignmentName string, options *RoleAssignmentsClientDeleteByBillingProfileOptions) (*policy.Request, error) {
	urlPath := "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingRoleAssignments/{billingRoleAssignmentName}"
	if billingAccountName == "" {
		return nil, errors.New("parameter billingAccountName cannot be empty")
	}
	urlPath = strings.ReplaceAll(urlPath, "{billingAccountName}", url.PathEscape(billingAccountName))
	if billingProfileName == "" {
		return nil, errors.New("parameter billingProfileName cannot be empty")
	}
	urlPath = strings.ReplaceAll(urlPath, "{billingProfileName}", url.PathEscape(billingProfileName))
	if billingRoleAssignmentName == "" {
		return nil, errors.New("parameter billingRoleAssignmentName cannot be empty")
	}
	urlPath = strings.ReplaceAll(urlPath, "{billingRoleAssignmentName}", url.PathEscape(billingRoleAssignmentName))
	req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath))
	if err != nil {
		return nil, err
	}
	reqQP := req.Raw().URL.Query()
	reqQP.Set("api-version", "2020-05-01")
	req.Raw().URL.RawQuery = reqQP.Encode()
	req.Raw().Header["Accept"] = []string{"application/json"}
	return req, nil
}

// deleteByBillingProfileHandleResponse handles the DeleteByBillingProfile response.
func (client *RoleAssignmentsClient) deleteByBillingProfileHandleResponse(resp *http.Response) (RoleAssignmentsClientDeleteByBillingProfileResponse, error) {
	result := RoleAssignmentsClientDeleteByBillingProfileResponse{}
	if err := runtime.UnmarshalAsJSON(resp, &result.RoleAssignment); err != nil {
		return RoleAssignmentsClientDeleteByBillingProfileResponse{}, err
	}
	return result, nil
}

// DeleteByInvoiceSection - Deletes a role assignment for the caller on an invoice section. The operation is supported for
// billing accounts with agreement type Microsoft Customer Agreement.
// If the operation fails it returns an *azcore.ResponseError type.
// Generated from API version 2020-05-01
// billingAccountName - The ID that uniquely identifies a billing account.
// billingProfileName - The ID that uniquely identifies a billing profile.
// invoiceSectionName - The ID that uniquely identifies an invoice section.
// billingRoleAssignmentName - The ID that uniquely identifies a role assignment.
// options - RoleAssignmentsClientDeleteByInvoiceSectionOptions contains the optional parameters for the RoleAssignmentsClient.DeleteByInvoiceSection
// method.
func (client *RoleAssignmentsClient) DeleteByInvoiceSection(ctx context.Context, billingAccountName string, billingProfileName string, invoiceSectionName string, billingRoleAssignmentName string, options *RoleAssignmentsClientDeleteByInvoiceSectionOptions) (RoleAssignmentsClientDeleteByInvoiceSectionResponse, error) {
	req, err := client.deleteByInvoiceSectionCreateRequest(ctx, billingAccountName, billingProfileName, invoiceSectionName, billingRoleAssignmentName, options)
	if err != nil {
		return RoleAssignmentsClientDeleteByInvoiceSectionResponse{}, err
	}
	resp, err := client.pl.Do(req)
	if err != nil {
		return RoleAssignmentsClientDeleteByInvoiceSectionResponse{}, err
	}
	if !runtime.HasStatusCode(resp, http.StatusOK) {
		return RoleAssignmentsClientDeleteByInvoiceSectionResponse{}, runtime.NewResponseError(resp)
	}
	return client.deleteByInvoiceSectionHandleResponse(resp)
}

// deleteByInvoiceSectionCreateRequest creates the DeleteByInvoiceSection request.
func (client *RoleAssignmentsClient) deleteByInvoiceSectionCreateRequest(ctx context.Context, billingAccountName string, billingProfileName string, invoiceSectionName string, billingRoleAssignmentName string, options *RoleAssignmentsClientDeleteByInvoiceSectionOptions) (*policy.Request, error) {
	urlPath := "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingRoleAssignments/{billingRoleAssignmentName}"
	if billingAccountName == "" {
		return nil, errors.New("parameter billingAccountName cannot be empty")
	}
	urlPath = strings.ReplaceAll(urlPath, "{billingAccountName}", url.PathEscape(billingAccountName))
	if billingProfileName == "" {
		return nil, errors.New("parameter billingProfileName cannot be empty")
	}
	urlPath = strings.ReplaceAll(urlPath, "{billingProfileName}", url.PathEscape(billingProfileName))
	if invoiceSectionName == "" {
		return nil, errors.New("parameter invoiceSectionName cannot be empty")
	}
	urlPath = strings.ReplaceAll(urlPath, "{invoiceSectionName}", url.PathEscape(invoiceSectionName))
	if billingRoleAssignmentName == "" {
		return nil, errors.New("parameter billingRoleAssignmentName cannot be empty")
	}
	urlPath = strings.ReplaceAll(urlPath, "{billingRoleAssignmentName}", url.PathEscape(billingRoleAssignmentName))
	req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath))
	if err != nil {
		return nil, err
	}
	reqQP := req.Raw().URL.Query()
	reqQP.Set("api-version", "2020-05-01")
	req.Raw().URL.RawQuery = reqQP.Encode()
	req.Raw().Header["Accept"] = []string{"application/json"}
	return req, nil
}

// deleteByInvoiceSectionHandleResponse handles the DeleteByInvoiceSection response.
func (client *RoleAssignmentsClient) deleteByInvoiceSectionHandleResponse(resp *http.Response) (RoleAssignmentsClientDeleteByInvoiceSectionResponse, error) {
	result := RoleAssignmentsClientDeleteByInvoiceSectionResponse{}
	if err := runtime.UnmarshalAsJSON(resp, &result.RoleAssignment); err != nil {
		return RoleAssignmentsClientDeleteByInvoiceSectionResponse{}, err
	}
	return result, nil
}

// GetByBillingAccount - Gets a role assignment for the caller on a billing account. The operation is supported for billing
// accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement.
// If the operation fails it returns an *azcore.ResponseError type.
// Generated from API version 2020-05-01
// billingAccountName - The ID that uniquely identifies a billing account.
// billingRoleAssignmentName - The ID that uniquely identifies a role assignment.
// options - RoleAssignmentsClientGetByBillingAccountOptions contains the optional parameters for the RoleAssignmentsClient.GetByBillingAccount
// method.
func (client *RoleAssignmentsClient) GetByBillingAccount(ctx context.Context, billingAccountName string, billingRoleAssignmentName string, options *RoleAssignmentsClientGetByBillingAccountOptions) (RoleAssignmentsClientGetByBillingAccountResponse, error) {
	req, err := client.getByBillingAccountCreateRequest(ctx, billingAccountName, billingRoleAssignmentName, options)
	if err != nil {
		return RoleAssignmentsClientGetByBillingAccountResponse{}, err
	}
	resp, err := client.pl.Do(req)
	if err != nil {
		return RoleAssignmentsClientGetByBillingAccountResponse{}, err
	}
	if !runtime.HasStatusCode(resp, http.StatusOK) {
		return RoleAssignmentsClientGetByBillingAccountResponse{}, runtime.NewResponseError(resp)
	}
	return client.getByBillingAccountHandleResponse(resp)
}

// getByBillingAccountCreateRequest creates the GetByBillingAccount request.
func (client *RoleAssignmentsClient) getByBillingAccountCreateRequest(ctx context.Context, billingAccountName string, billingRoleAssignmentName string, options *RoleAssignmentsClientGetByBillingAccountOptions) (*policy.Request, error) {
	urlPath := "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleAssignments/{billingRoleAssignmentName}"
	if billingAccountName == "" {
		return nil, errors.New("parameter billingAccountName cannot be empty")
	}
	urlPath = strings.ReplaceAll(urlPath, "{billingAccountName}", url.PathEscape(billingAccountName))
	if billingRoleAssignmentName == "" {
		return nil, errors.New("parameter billingRoleAssignmentName cannot be empty")
	}
	urlPath = strings.ReplaceAll(urlPath, "{billingRoleAssignmentName}", url.PathEscape(billingRoleAssignmentName))
	req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath))
	if err != nil {
		return nil, err
	}
	reqQP := req.Raw().URL.Query()
	reqQP.Set("api-version", "2020-05-01")
	req.Raw().URL.RawQuery = reqQP.Encode()
	req.Raw().Header["Accept"] = []string{"application/json"}
	return req, nil
}

// getByBillingAccountHandleResponse handles the GetByBillingAccount response.
func (client *RoleAssignmentsClient) getByBillingAccountHandleResponse(resp *http.Response) (RoleAssignmentsClientGetByBillingAccountResponse, error) {
	result := RoleAssignmentsClientGetByBillingAccountResponse{}
	if err := runtime.UnmarshalAsJSON(resp, &result.RoleAssignment); err != nil {
		return RoleAssignmentsClientGetByBillingAccountResponse{}, err
	}
	return result, nil
}

// GetByBillingProfile - Gets a role assignment for the caller on a billing profile. The operation is supported for billing
// accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement.
// If the operation fails it returns an *azcore.ResponseError type.
// Generated from API version 2020-05-01
// billingAccountName - The ID that uniquely identifies a billing account.
// billingProfileName - The ID that uniquely identifies a billing profile.
// billingRoleAssignmentName - The ID that uniquely identifies a role assignment.
// options - RoleAssignmentsClientGetByBillingProfileOptions contains the optional parameters for the RoleAssignmentsClient.GetByBillingProfile
// method.
func (client *RoleAssignmentsClient) GetByBillingProfile(ctx context.Context, billingAccountName string, billingProfileName string, billingRoleAssignmentName string, options *RoleAssignmentsClientGetByBillingProfileOptions) (RoleAssignmentsClientGetByBillingProfileResponse, error) {
	req, err := client.getByBillingProfileCreateRequest(ctx, billingAccountName, billingProfileName, billingRoleAssignmentName, options)
	if err != nil {
		return RoleAssignmentsClientGetByBillingProfileResponse{}, err
	}
	resp, err := client.pl.Do(req)
	if err != nil {
		return RoleAssignmentsClientGetByBillingProfileResponse{}, err
	}
	if !runtime.HasStatusCode(resp, http.StatusOK) {
		return RoleAssignmentsClientGetByBillingProfileResponse{}, runtime.NewResponseError(resp)
	}
	return client.getByBillingProfileHandleResponse(resp)
}

// getByBillingProfileCreateRequest creates the GetByBillingProfile request.
func (client *RoleAssignmentsClient) getByBillingProfileCreateRequest(ctx context.Context, billingAccountName string, billingProfileName string, billingRoleAssignmentName string, options *RoleAssignmentsClientGetByBillingProfileOptions) (*policy.Request, error) {
	urlPath := "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingRoleAssignments/{billingRoleAssignmentName}"
	if billingAccountName == "" {
		return nil, errors.New("parameter billingAccountName cannot be empty")
	}
	urlPath = strings.ReplaceAll(urlPath, "{billingAccountName}", url.PathEscape(billingAccountName))
	if billingProfileName == "" {
		return nil, errors.New("parameter billingProfileName cannot be empty")
	}
	urlPath = strings.ReplaceAll(urlPath, "{billingProfileName}", url.PathEscape(billingProfileName))
	if billingRoleAssignmentName == "" {
		return nil, errors.New("parameter billingRoleAssignmentName cannot be empty")
	}
	urlPath = strings.ReplaceAll(urlPath, "{billingRoleAssignmentName}", url.PathEscape(billingRoleAssignmentName))
	req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath))
	if err != nil {
		return nil, err
	}
	reqQP := req.Raw().URL.Query()
	reqQP.Set("api-version", "2020-05-01")
	req.Raw().URL.RawQuery = reqQP.Encode()
	req.Raw().Header["Accept"] = []string{"application/json"}
	return req, nil
}

// getByBillingProfileHandleResponse handles the GetByBillingProfile response.
func (client *RoleAssignmentsClient) getByBillingProfileHandleResponse(resp *http.Response) (RoleAssignmentsClientGetByBillingProfileResponse, error) {
	result := RoleAssignmentsClientGetByBillingProfileResponse{}
	if err := runtime.UnmarshalAsJSON(resp, &result.RoleAssignment); err != nil {
		return RoleAssignmentsClientGetByBillingProfileResponse{}, err
	}
	return result, nil
}

// GetByInvoiceSection - Gets a role assignment for the caller on an invoice section. The operation is supported for billing
// accounts with agreement type Microsoft Customer Agreement.
// If the operation fails it returns an *azcore.ResponseError type.
// Generated from API version 2020-05-01
// billingAccountName - The ID that uniquely identifies a billing account.
// billingProfileName - The ID that uniquely identifies a billing profile.
// invoiceSectionName - The ID that uniquely identifies an invoice section.
// billingRoleAssignmentName - The ID that uniquely identifies a role assignment.
// options - RoleAssignmentsClientGetByInvoiceSectionOptions contains the optional parameters for the RoleAssignmentsClient.GetByInvoiceSection
// method.
func (client *RoleAssignmentsClient) GetByInvoiceSection(ctx context.Context, billingAccountName string, billingProfileName string, invoiceSectionName string, billingRoleAssignmentName string, options *RoleAssignmentsClientGetByInvoiceSectionOptions) (RoleAssignmentsClientGetByInvoiceSectionResponse, error) {
	req, err := client.getByInvoiceSectionCreateRequest(ctx, billingAccountName, billingProfileName, invoiceSectionName, billingRoleAssignmentName, options)
	if err != nil {
		return RoleAssignmentsClientGetByInvoiceSectionResponse{}, err
	}
	resp, err := client.pl.Do(req)
	if err != nil {
		return RoleAssignmentsClientGetByInvoiceSectionResponse{}, err
	}
	if !runtime.HasStatusCode(resp, http.StatusOK) {
		return RoleAssignmentsClientGetByInvoiceSectionResponse{}, runtime.NewResponseError(resp)
	}
	return client.getByInvoiceSectionHandleResponse(resp)
}

// getByInvoiceSectionCreateRequest creates the GetByInvoiceSection request.
func (client *RoleAssignmentsClient) getByInvoiceSectionCreateRequest(ctx context.Context, billingAccountName string, billingProfileName string, invoiceSectionName string, billingRoleAssignmentName string, options *RoleAssignmentsClientGetByInvoiceSectionOptions) (*policy.Request, error) {
	urlPath := "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingRoleAssignments/{billingRoleAssignmentName}"
	if billingAccountName == "" {
		return nil, errors.New("parameter billingAccountName cannot be empty")
	}
	urlPath = strings.ReplaceAll(urlPath, "{billingAccountName}", url.PathEscape(billingAccountName))
	if billingProfileName == "" {
		return nil, errors.New("parameter billingProfileName cannot be empty")
	}
	urlPath = strings.ReplaceAll(urlPath, "{billingProfileName}", url.PathEscape(billingProfileName))
	if invoiceSectionName == "" {
		return nil, errors.New("parameter invoiceSectionName cannot be empty")
	}
	urlPath = strings.ReplaceAll(urlPath, "{invoiceSectionName}", url.PathEscape(invoiceSectionName))
	if billingRoleAssignmentName == "" {
		return nil, errors.New("parameter billingRoleAssignmentName cannot be empty")
	}
	urlPath = strings.ReplaceAll(urlPath, "{billingRoleAssignmentName}", url.PathEscape(billingRoleAssignmentName))
	req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath))
	if err != nil {
		return nil, err
	}
	reqQP := req.Raw().URL.Query()
	reqQP.Set("api-version", "2020-05-01")
	req.Raw().URL.RawQuery = reqQP.Encode()
	req.Raw().Header["Accept"] = []string{"application/json"}
	return req, nil
}

// getByInvoiceSectionHandleResponse handles the GetByInvoiceSection response.
func (client *RoleAssignmentsClient) getByInvoiceSectionHandleResponse(resp *http.Response) (RoleAssignmentsClientGetByInvoiceSectionResponse, error) {
	result := RoleAssignmentsClientGetByInvoiceSectionResponse{}
	if err := runtime.UnmarshalAsJSON(resp, &result.RoleAssignment); err != nil {
		return RoleAssignmentsClientGetByInvoiceSectionResponse{}, err
	}
	return result, nil
}

// NewListByBillingAccountPager - Lists the role assignments for the caller on a billing account. The operation is supported
// for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement.
// If the operation fails it returns an *azcore.ResponseError type.
// Generated from API version 2020-05-01
// billingAccountName - The ID that uniquely identifies a billing account.
// options - RoleAssignmentsClientListByBillingAccountOptions contains the optional parameters for the RoleAssignmentsClient.ListByBillingAccount
// method.
func (client *RoleAssignmentsClient) NewListByBillingAccountPager(billingAccountName string, options *RoleAssignmentsClientListByBillingAccountOptions) *runtime.Pager[RoleAssignmentsClientListByBillingAccountResponse] {
	return runtime.NewPager(runtime.PagingHandler[RoleAssignmentsClientListByBillingAccountResponse]{
		More: func(page RoleAssignmentsClientListByBillingAccountResponse) bool {
			return page.NextLink != nil && len(*page.NextLink) > 0
		},
		Fetcher: func(ctx context.Context, page *RoleAssignmentsClientListByBillingAccountResponse) (RoleAssignmentsClientListByBillingAccountResponse, error) {
			var req *policy.Request
			var err error
			if page == nil {
				req, err = client.listByBillingAccountCreateRequest(ctx, billingAccountName, options)
			} else {
				req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink)
			}
			if err != nil {
				return RoleAssignmentsClientListByBillingAccountResponse{}, err
			}
			resp, err := client.pl.Do(req)
			if err != nil {
				return RoleAssignmentsClientListByBillingAccountResponse{}, err
			}
			if !runtime.HasStatusCode(resp, http.StatusOK) {
				return RoleAssignmentsClientListByBillingAccountResponse{}, runtime.NewResponseError(resp)
			}
			return client.listByBillingAccountHandleResponse(resp)
		},
	})
}

// listByBillingAccountCreateRequest creates the ListByBillingAccount request.
func (client *RoleAssignmentsClient) listByBillingAccountCreateRequest(ctx context.Context, billingAccountName string, options *RoleAssignmentsClientListByBillingAccountOptions) (*policy.Request, error) {
	urlPath := "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleAssignments"
	if billingAccountName == "" {
		return nil, errors.New("parameter billingAccountName cannot be empty")
	}
	urlPath = strings.ReplaceAll(urlPath, "{billingAccountName}", url.PathEscape(billingAccountName))
	req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath))
	if err != nil {
		return nil, err
	}
	reqQP := req.Raw().URL.Query()
	reqQP.Set("api-version", "2020-05-01")
	req.Raw().URL.RawQuery = reqQP.Encode()
	req.Raw().Header["Accept"] = []string{"application/json"}
	return req, nil
}

// listByBillingAccountHandleResponse handles the ListByBillingAccount response.
func (client *RoleAssignmentsClient) listByBillingAccountHandleResponse(resp *http.Response) (RoleAssignmentsClientListByBillingAccountResponse, error) {
	result := RoleAssignmentsClientListByBillingAccountResponse{}
	if err := runtime.UnmarshalAsJSON(resp, &result.RoleAssignmentListResult); err != nil {
		return RoleAssignmentsClientListByBillingAccountResponse{}, err
	}
	return result, nil
}

// NewListByBillingProfilePager - Lists the role assignments for the caller on a billing profile. The operation is supported
// for billing accounts with agreement type Microsoft Customer Agreement.
// If the operation fails it returns an *azcore.ResponseError type.
// Generated from API version 2020-05-01
// billingAccountName - The ID that uniquely identifies a billing account.
// billingProfileName - The ID that uniquely identifies a billing profile.
// options - RoleAssignmentsClientListByBillingProfileOptions contains the optional parameters for the RoleAssignmentsClient.ListByBillingProfile
// method.
func (client *RoleAssignmentsClient) NewListByBillingProfilePager(billingAccountName string, billingProfileName string, options *RoleAssignmentsClientListByBillingProfileOptions) *runtime.Pager[RoleAssignmentsClientListByBillingProfileResponse] {
	return runtime.NewPager(runtime.PagingHandler[RoleAssignmentsClientListByBillingProfileResponse]{
		More: func(page RoleAssignmentsClientListByBillingProfileResponse) bool {
			return page.NextLink != nil && len(*page.NextLink) > 0
		},
		Fetcher: func(ctx context.Context, page *RoleAssignmentsClientListByBillingProfileResponse) (RoleAssignmentsClientListByBillingProfileResponse, error) {
			var req *policy.Request
			var err error
			if page == nil {
				req, err = client.listByBillingProfileCreateRequest(ctx, billingAccountName, billingProfileName, options)
			} else {
				req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink)
			}
			if err != nil {
				return RoleAssignmentsClientListByBillingProfileResponse{}, err
			}
			resp, err := client.pl.Do(req)
			if err != nil {
				return RoleAssignmentsClientListByBillingProfileResponse{}, err
			}
			if !runtime.HasStatusCode(resp, http.StatusOK) {
				return RoleAssignmentsClientListByBillingProfileResponse{}, runtime.NewResponseError(resp)
			}
			return client.listByBillingProfileHandleResponse(resp)
		},
	})
}

// listByBillingProfileCreateRequest creates the ListByBillingProfile request.
func (client *RoleAssignmentsClient) listByBillingProfileCreateRequest(ctx context.Context, billingAccountName string, billingProfileName string, options *RoleAssignmentsClientListByBillingProfileOptions) (*policy.Request, error) {
	urlPath := "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingRoleAssignments"
	if billingAccountName == "" {
		return nil, errors.New("parameter billingAccountName cannot be empty")
	}
	urlPath = strings.ReplaceAll(urlPath, "{billingAccountName}", url.PathEscape(billingAccountName))
	if billingProfileName == "" {
		return nil, errors.New("parameter billingProfileName cannot be empty")
	}
	urlPath = strings.ReplaceAll(urlPath, "{billingProfileName}", url.PathEscape(billingProfileName))
	req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath))
	if err != nil {
		return nil, err
	}
	reqQP := req.Raw().URL.Query()
	reqQP.Set("api-version", "2020-05-01")
	req.Raw().URL.RawQuery = reqQP.Encode()
	req.Raw().Header["Accept"] = []string{"application/json"}
	return req, nil
}

// listByBillingProfileHandleResponse handles the ListByBillingProfile response.
func (client *RoleAssignmentsClient) listByBillingProfileHandleResponse(resp *http.Response) (RoleAssignmentsClientListByBillingProfileResponse, error) {
	result := RoleAssignmentsClientListByBillingProfileResponse{}
	if err := runtime.UnmarshalAsJSON(resp, &result.RoleAssignmentListResult); err != nil {
		return RoleAssignmentsClientListByBillingProfileResponse{}, err
	}
	return result, nil
}

// NewListByInvoiceSectionPager - Lists the role assignments for the caller on an invoice section. The operation is supported
// for billing accounts with agreement type Microsoft Customer Agreement.
// If the operation fails it returns an *azcore.ResponseError type.
// Generated from API version 2020-05-01
// billingAccountName - The ID that uniquely identifies a billing account.
// billingProfileName - The ID that uniquely identifies a billing profile.
// invoiceSectionName - The ID that uniquely identifies an invoice section.
// options - RoleAssignmentsClientListByInvoiceSectionOptions contains the optional parameters for the RoleAssignmentsClient.ListByInvoiceSection
// method.
func (client *RoleAssignmentsClient) NewListByInvoiceSectionPager(billingAccountName string, billingProfileName string, invoiceSectionName string, options *RoleAssignmentsClientListByInvoiceSectionOptions) *runtime.Pager[RoleAssignmentsClientListByInvoiceSectionResponse] {
	return runtime.NewPager(runtime.PagingHandler[RoleAssignmentsClientListByInvoiceSectionResponse]{
		More: func(page RoleAssignmentsClientListByInvoiceSectionResponse) bool {
			return page.NextLink != nil && len(*page.NextLink) > 0
		},
		Fetcher: func(ctx context.Context, page *RoleAssignmentsClientListByInvoiceSectionResponse) (RoleAssignmentsClientListByInvoiceSectionResponse, error) {
			var req *policy.Request
			var err error
			if page == nil {
				req, err = client.listByInvoiceSectionCreateRequest(ctx, billingAccountName, billingProfileName, invoiceSectionName, options)
			} else {
				req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink)
			}
			if err != nil {
				return RoleAssignmentsClientListByInvoiceSectionResponse{}, err
			}
			resp, err := client.pl.Do(req)
			if err != nil {
				return RoleAssignmentsClientListByInvoiceSectionResponse{}, err
			}
			if !runtime.HasStatusCode(resp, http.StatusOK) {
				return RoleAssignmentsClientListByInvoiceSectionResponse{}, runtime.NewResponseError(resp)
			}
			return client.listByInvoiceSectionHandleResponse(resp)
		},
	})
}

// listByInvoiceSectionCreateRequest creates the ListByInvoiceSection request.
func (client *RoleAssignmentsClient) listByInvoiceSectionCreateRequest(ctx context.Context, billingAccountName string, billingProfileName string, invoiceSectionName string, options *RoleAssignmentsClientListByInvoiceSectionOptions) (*policy.Request, error) {
	urlPath := "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingRoleAssignments"
	if billingAccountName == "" {
		return nil, errors.New("parameter billingAccountName cannot be empty")
	}
	urlPath = strings.ReplaceAll(urlPath, "{billingAccountName}", url.PathEscape(billingAccountName))
	if billingProfileName == "" {
		return nil, errors.New("parameter billingProfileName cannot be empty")
	}
	urlPath = strings.ReplaceAll(urlPath, "{billingProfileName}", url.PathEscape(billingProfileName))
	if invoiceSectionName == "" {
		return nil, errors.New("parameter invoiceSectionName cannot be empty")
	}
	urlPath = strings.ReplaceAll(urlPath, "{invoiceSectionName}", url.PathEscape(invoiceSectionName))
	req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath))
	if err != nil {
		return nil, err
	}
	reqQP := req.Raw().URL.Query()
	reqQP.Set("api-version", "2020-05-01")
	req.Raw().URL.RawQuery = reqQP.Encode()
	req.Raw().Header["Accept"] = []string{"application/json"}
	return req, nil
}

// listByInvoiceSectionHandleResponse handles the ListByInvoiceSection response.
func (client *RoleAssignmentsClient) listByInvoiceSectionHandleResponse(resp *http.Response) (RoleAssignmentsClientListByInvoiceSectionResponse, error) {
	result := RoleAssignmentsClientListByInvoiceSectionResponse{}
	if err := runtime.UnmarshalAsJSON(resp, &result.RoleAssignmentListResult); err != nil {
		return RoleAssignmentsClientListByInvoiceSectionResponse{}, err
	}
	return result, nil
}


text:
'''
Python script to crunch sprite assets in Unity by a constant value (for reducing filesize with big images
This automatically applies to .meta files, so nothing changes in game, and it works on Multiple sprite assets as well.
PIL (Python Image Library) needs to be installed to use this.

@author: Brian Intile
'''

import os

from PIL import Image
import PIL

def get_immediate_subdirectories(directory):
    return [name for name in os.listdir(directory)
            if os.path.isdir(os.path.join(directory, name))]

def browse_for_traits(directory, recurse, mult):
    for dir_0 in os.listdir(directory):
        if (os.path.isfile(directory + u'\\' + dir_0) & ((dir_0.split('.')[-1].lower() == u'png'.lower()) | (dir_0.split('.')[-1].lower() == u'jpg'.lower()))):
            change_value_names(directory + '\\' + dir_0, mult)
    if (recurse):
        directories = get_immediate_subdirectories(directory)
        for x in range (0, len(directories)):
            browse_for_traits(directory + '\\' + directories[x], recurse, mult)

def count_leading_whitespace(line):
    for x in range(len(line)):
        if (line[x] != ' '):
            return x
    return len(line)

def multiply_bounds(contents, mult):
    in_rect = False
    whitespace_count = 0
    for x in range(len(contents)):
        if (in_rect):
            if (count_leading_whitespace(contents[x]) == whitespace_count):
                category = contents[x].split(':')[0].split(' ')[-1]
                if (category == 'x' or category == 'y' or category == 'width' or category == 'height'):
                    number = contents[x].split(' ')[-1]
                    contents[x] = contents[x].replace(number, str(int(float(number) * mult)))
            else:
                in_rect = False
        elif (contents[x].split(' ')[-1] == 'rect:'):
            whitespace_count = count_leading_whitespace(contents[x]) + 2
            in_rect = True
        elif (contents[x][count_leading_whitespace(contents[x]):].split(':')[0] == "spritePixelsToUnits"):
            number = contents[x].split(' ')[-1]
            result = float(float(number) * mult)
            if (result % 1 == 0):
                result = int(result)
            contents[x] = contents[x].replace(number, str(result))
    return contents

def change_value_names(name, mult):
    if not (os.path.isfile(name)):
        print("File " + name + " not found")
        return
    img = Image.open(name)
    width = int(float(img.size[0]) * mult)
    height = int(float(img.size[1] * mult))
    img = img.resize((width, height), PIL.Image.ANTIALIAS)
    img.save(name)

    if not (os.path.isfile(name + '.meta')):
        print("File " + name + " has no associated .meta file")
        return
    f = open(name + '.meta', 'r')
    contents = multiply_bounds(f.read().split('\n'), mult)
    f.close()
    f = open(name + '.meta', 'w')

    f.write(contents[0])
    for x in range(1, len(contents)):
        f.write('\n' + contents[x])
    f.close()

file_path = os.path.dirname(os.path.realpath(__file__))
#file_path = str(file_path, 'utf8')

while True:
    command = input("Unity Sprite Resizer, this will rescale your image(s) and adjust the .meta accordingly for split sprites."
    + "\nEnter an image filename to resize that sprite by a constant."
    + "\nEnter 'a' to resize all sprites in the folder by a constant. (pngs or jpgs only)"
    + "\nEnter 'r' to resize all sprites in the folder AND all subfolders by a constant. (pngs or jpgs only)"
    + "\nEnter 'q' to quit:\n")
    if command == 'q':
        break
    mult = float(input("Enter the number you wish to multiply each dimension by (use values <1 for crunching assets):\n"))

    if command == 'a':
        browse_for_traits(file_path, False, mult)
    elif command == 'r':
        browse_for_traits(file_path, True, mult)
    else:
        change_value_names(file_path + '\\' + command, mult)

redpajama_set_name: RedPajamaGithub


text:
@class HYBlockTitleView;
@class HYBlockTwoSubView;

@interface HYBlockTwoView : UIView

@property (nonatomic,strong) HYBlockTitleView * blockTitleView;
@property (nonatomic,strong) HYBlockTwoSubView * blockTwoSubView;

@end


text:
<!DOCTYPE html>

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=7,IE=9">

    <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no">
    <title>Overview Map</title>
    <link rel="stylesheet" href="http://serverapi.arcgisonline.com/jsapi/arcgis/3.4/js/dojo/dijit/themes/claro/claro.css">
    <link rel="stylesheet" href="http://serverapi.arcgisonline.com/jsapi/arcgis/3.4/js/esri/css/esri.css">
	<link rel="stylesheet" href="css/examples.css">
	<link rel="stylesheet" href="css/project.css">


text:
import {AbstractObject} from "./_abstract_object";

export class Transformation extends AbstractObject {

  public getType(): string {
    return "XSLT";
  }

  public getAllowedNaming() {
    return {
      maxLength: 40,
      allowNamespace: true,
    };
  }

  public getDescription(): string | undefined {
    // todo
    return undefined;
  }
}


text:
package org.roaringbitmap.realdata.wrapper;

import java.io.DataOutputStream;
import java.io.IOException;
import java.util.Iterator;

import org.roaringbitmap.FastAggregation;
import org.roaringbitmap.IntConsumer;
import org.roaringbitmap.RoaringBitmap;

final class RoaringBitmapWrapper implements Bitmap {

  private final RoaringBitmap bitmap;

  RoaringBitmapWrapper(RoaringBitmap bitmap) {
    this.bitmap = bitmap;
  }

  @Override
  public boolean contains(int i) {
    return bitmap.contains(i);
  }

  @Override
  public int last() {
    return bitmap.getReverseIntIterator().next();
  }

  @Override
  public int cardinality() {
    return bitmap.getCardinality();
  }

  @Override
  public BitmapIterator iterator() {
    return new RoaringIteratorWrapper(bitmap.getIntIterator());
  }

  @Override
  public BitmapIterator reverseIterator() {
    return new RoaringIteratorWrapper(bitmap.getReverseIntIterator());
  }

  @Override
  public Bitmap and(Bitmap other) {
    return new RoaringBitmapWrapper(
        RoaringBitmap.and(bitmap, ((RoaringBitmapWrapper) other).bitmap));
  }

  @Override
  public Bitmap or(Bitmap other) {
    return new RoaringBitmapWrapper(
        RoaringBitmap.or(bitmap, ((RoaringBitmapWrapper) other).bitmap));
  }

  @Override
  public Bitmap ior(Bitmap other) {
    bitmap.or(((RoaringBitmapWrapper) other).bitmap);
    return this;
  }

  @Override
  public Bitmap flip(int rangeStart, int rangeEnd) {
    return new RoaringBitmapWrapper(RoaringBitmap.flip(bitmap, rangeStart, rangeEnd));
  }

  @Override
  public Bitmap xor(Bitmap other) {
    return new RoaringBitmapWrapper(
        RoaringBitmap.xor(bitmap, ((RoaringBitmapWrapper) other).bitmap));
  }

  @Override
  public Bitmap andNot(Bitmap other) {
    return new RoaringBitmapWrapper(
        RoaringBitmap.andNot(bitmap, ((RoaringBitmapWrapper) other).bitmap));
  }

  @Override
  public BitmapAggregator naiveAndAggregator() {
    return new BitmapAggregator() {
      @Override
      public Bitmap aggregate(Iterable<Bitmap> bitmaps) {
        Iterator<RoaringBitmap> iterator = toRoaringBitmapIterator(bitmaps);
        return new RoaringBitmapWrapper(FastAggregation.naive_and(iterator));
      }
    };
  }

  @Override
  public BitmapAggregator naiveOrAggregator() {
    return new BitmapAggregator() {
      @Override
      public Bitmap aggregate(final Iterable<Bitmap> bitmaps) {
        Iterator<RoaringBitmap> iterator = toRoaringBitmapIterator(bitmaps);
        return new RoaringBitmapWrapper(FastAggregation.naive_or(iterator));
      }
    };
  }

  @Override
  public BitmapAggregator priorityQueueOrAggregator() {
    return new BitmapAggregator() {
      @Override
      public Bitmap aggregate(final Iterable<Bitmap> bitmaps) {
        Iterator<RoaringBitmap> iterator = toRoaringBitmapIterator(bitmaps);
        return new RoaringBitmapWrapper(FastAggregation.priorityqueue_or(iterator));
      }
    };
  }

  private Iterator<RoaringBitmap> toRoaringBitmapIterator(final Iterable<Bitmap> bitmaps) {
    return new Iterator<RoaringBitmap>() {
      final Iterator<Bitmap> i = bitmaps.iterator();

      @Override
      public boolean hasNext() {
        return i.hasNext();
      }

      @Override
      public void remove() {
        throw new UnsupportedOperationException();
      }

      @Override
      public RoaringBitmap next() {
        return ((RoaringBitmapWrapper) i.next()).bitmap;
      }
    };
  }

  @Override
  public void forEach(IntConsumer ic) {
    bitmap.forEach(ic);
  }

  @Override
  public void serialize(DataOutputStream dos) throws IOException {
    bitmap.serialize(dos);
  }

  @Override
  public Bitmap clone() {
    return new RoaringBitmapWrapper(bitmap.clone());
  }

}


text:
class StandardDeviation
  attr_reader :array

  def initialize(incoming_array)
    @array = incoming_array
  end

  def standard_deviation
    result = Math.sqrt(sample_variance)

    return 0.0 if result.nan?

    result
  end

  def num_standards_from_the_mean(value)
    return 0.0 if value.nil?
    return 0.0 if standard_deviation.zero?

    ((value - mean) / standard_deviation).abs
  end

  def sum
    array.inject(0) { |accum, i| accum + i }
  end

  def mean
    return 0.0 if array.length.zero?

    sum / array.length.to_f
  end

  def sample_variance
    m = mean
    calc_sum = array.inject(0) { |accum, i| accum + (i - m)**2 }
    calc_sum / (array.length - 1).to_f
  end
end


text:
package testing

import (
	"testing"

	"github.com/gophercloud/gophercloud/openstack/identity/v3/domains"
	"github.com/gophercloud/gophercloud/pagination"
	th "github.com/gophercloud/gophercloud/testhelper"
	"github.com/gophercloud/gophercloud/testhelper/client"
)

func TestListDomains(t *testing.T) {
	th.SetupHTTP()
	defer th.TeardownHTTP()
	HandleListDomainsSuccessfully(t)

	count := 0
	err := domains.List(client.ServiceClient(), nil).EachPage(func(page pagination.Page) (bool, error) {
		count++

		actual, err := domains.ExtractDomains(page)
		th.AssertNoErr(t, err)

		th.CheckDeepEquals(t, ExpectedDomainsSlice, actual)

		return true, nil
	})
	th.AssertNoErr(t, err)
	th.CheckEquals(t, count, 1)
}

func TestListDomainsAllPages(t *testing.T) {
	th.SetupHTTP()
	defer th.TeardownHTTP()
	HandleListDomainsSuccessfully(t)

	allPages, err := domains.List(client.ServiceClient(), nil).AllPages()
	th.AssertNoErr(t, err)
	actual, err := domains.ExtractDomains(allPages)
	th.AssertNoErr(t, err)
	th.CheckDeepEquals(t, ExpectedDomainsSlice, actual)
}

func TestGetDomain(t *testing.T) {
	th.SetupHTTP()
	defer th.TeardownHTTP()
	HandleGetDomainSuccessfully(t)

	actual, err := domains.Get(client.ServiceClient(), "9fe1d3").Extract()
	th.AssertNoErr(t, err)
	th.CheckDeepEquals(t, SecondDomain, *actual)
}

func TestCreateDomain(t *testing.T) {
	th.SetupHTTP()
	defer th.TeardownHTTP()
	HandleCreateDomainSuccessfully(t)

	createOpts := domains.CreateOpts{
		Name: "domain two",
	}

	actual, err := domains.Create(client.ServiceClient(), createOpts).Extract()
	th.AssertNoErr(t, err)
	th.CheckDeepEquals(t, SecondDomain, *actual)
}

func TestDeleteDomain(t *testing.T) {
	th.SetupHTTP()
	defer th.TeardownHTTP()
	HandleDeleteDomainSuccessfully(t)

	res := domains.Delete(client.ServiceClient(), "9fe1d3")
	th.AssertNoErr(t, res.Err)
}

func TestUpdateDomain(t *testing.T) {
	th.SetupHTTP()
	defer th.TeardownHTTP()
	HandleUpdateDomainSuccessfully(t)

	var description = "Staging Domain"
	updateOpts := domains.UpdateOpts{
		Description: &description,
	}

	actual, err := domains.Update(client.ServiceClient(), "9fe1d3", updateOpts).Extract()
	th.AssertNoErr(t, err)
	th.CheckDeepEquals(t, SecondDomainUpdated, *actual)
}


text:
#region LICENSE
// Copyright (C) 2015 by Sherif Elmetainy (Grendiser@Kazzak-EU)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#endregion

using System;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using WOWSharp.Core.Serialization;

namespace WOWSharp.Warcraft
{
    /// <summary>
    /// Guild news feed entry
    /// </summary>
    [JsonObject(MemberSerialization.OptIn)]
    public class GuildNewsItem
    {
        /// <summary>
        ///   gets or sets achievement
        /// </summary>
        [JsonProperty(PropertyName="achievement")]
        public Achievement Achievement
        {
            get;
            set;
        }

        /// <summary>
        ///   gets or sets item id
        /// </summary>
        [JsonProperty(PropertyName="itemId")]
        public int ItemId
        {
            get;
            set;
        }

        /// <summary>
        ///   gets or sets name of the character to which the news item is related
        /// </summary>
        [JsonProperty(PropertyName="character")]
        public string CharacterName
        {
            get;
            set;
        }

        /// <summary>
        ///   Event date in Utc
        /// </summary>
        [JsonProperty(PropertyName="timestamp")]
        [JsonConverter(typeof(DatetimeMillisecondsConverter))]
        public DateTimeOffset DateTime
        {
            get;
            set;
        }

        /// <summary>
        /// Level up
        /// </summary>
        [JsonProperty(PropertyName="levelUp")]
        public int LevelUp
        {
            get;
            set;
        }

        /// <summary>
        ///   gets or sets name of the type of the news item
        /// </summary>
        [JsonProperty(PropertyName="type")]
        [JsonConverter(typeof(StringEnumConverter))]
        public GuildNewsItemType GuildNewsItemType
        {
            get;
            set;
        }

        /// <summary>
        ///   String representation for debugging purposes
        /// </summary>
        /// <returns> String representation for debugging purposes </returns>
        public override string ToString()
        {
            switch (GuildNewsItemType)
            {
                case GuildNewsItemType.GuildAchievement:
                    return "Guild Achievement: " + CharacterName + " " + Achievement;
                case GuildNewsItemType.PlayerAchievement:
                    return "Player Achievement: " + CharacterName + " " + Achievement;
                case GuildNewsItemType.ItemPurchase:
                    return "Item Purchase: " + CharacterName + ItemId;
                case GuildNewsItemType.ItemLoot:
                    return "Item Loot: " + CharacterName + ItemId;
                case GuildNewsItemType.ItemCraft:
                    return "Item Craft: " + CharacterName + ItemId;
                case GuildNewsItemType.GuildLevelUp:
                    return "Guild Level: " + LevelUp;
                default:
                    return GuildNewsItemType.ToString();
            }
        }
    }
}


text:
<bill session="115" type="h" number="1253" updated="2017-09-29T07:15:51Z">
  <state datetime="2017-02-28">REFERRED</state>
  <status>
    <introduced datetime="2017-02-28"/>
  </status>
  <introduced datetime="2017-02-28"/>
  <titles>
    <title type="short" as="introduced">Mental Health and Substance Abuse Treatment Accessibility Act of 2017</title>
    <title type="short" as="introduced">Mental Health and Substance Abuse Treatment Accessibility Act of 2017</title>
    <title type="official" as="introduced">To authorize the Secretary of Health and Human Services to make loans and loan guarantees for constructing or renovating, or planning construction or renovation of, qualified psychiatric and substance abuse treatment facilities, and for other purposes.</title>
    <title type="display">Mental Health and Substance Abuse Treatment Accessibility Act of 2017</title>
  </titles>
  <sponsor bioguide_id="K000381"/>
  <cosponsors>
    <cosponsor bioguide_id="B000574" joined="2017-05-22"/>
    <cosponsor bioguide_id="B001303" joined="2017-05-16"/>
    <cosponsor bioguide_id="C001101" joined="2017-04-26"/>
    <cosponsor bioguide_id="C001092" joined="2017-06-15"/>
    <cosponsor bioguide_id="C000714" joined="2017-03-20"/>
    <cosponsor bioguide_id="G000581" joined="2017-09-28"/>
    <cosponsor bioguide_id="G000410" joined="2017-04-28"/>
    <cosponsor bioguide_id="H001056" joined="2017-02-28"/>
    <cosponsor bioguide_id="J000298" joined="2017-06-15"/>
    <cosponsor bioguide_id="J000126" joined="2017-02-28"/>
    <cosponsor bioguide_id="K000009" joined="2017-07-11"/>
    <cosponsor bioguide_id="L000567" joined="2017-06-15"/>
    <cosponsor bioguide_id="M001151" joined="2017-02-28"/>
    <cosponsor bioguide_id="P000258" joined="2017-05-17"/>
    <cosponsor bioguide_id="R000576" joined="2017-05-11"/>
    <cosponsor bioguide_id="R000609" joined="2017-06-27"/>
    <cosponsor bioguide_id="S001193" joined="2017-03-16"/>
    <cosponsor bioguide_id="V000132" joined="2017-05-16"/>
    <cosponsor bioguide_id="W000799" joined="2017-05-22"/>
    <cosponsor bioguide_id="W000808" joined="2017-09-27"/>
  </cosponsors>
  <actions>
    <action datetime="2017-02-28">
      <text>Introduced in House</text>
    </action>
    <action datetime="2017-02-28" state="REFERRED">
      <text>Referred to the House Committee on Energy and Commerce.</text>
    </action>
    <action datetime="2017-03-03">
      <text>Referred to the Subcommittee on Health.</text>
    </action>
  </actions>
  <committees>
    <committee subcommittee="" code="HSIF" name="House Energy and Commerce" activity="Referral"/>
    <committee subcommittee="Health" code="HSIF14" name="House Energy and Commerce" activity="Referral"/>
  </committees>
  <relatedbills/>
  <subjects>
    <term name="Health"/>
    <term name="Drug, alcohol, tobacco use"/>
    <term name="Government lending and loan guarantees"/>
    <term name="Government trust funds"/>
    <term name="Health care coverage and access"/>
    <term name="Health facilities and institutions"/>
    <term name="Health programs administration and funding"/>
    <term name="Medicaid"/>
    <term name="Mental health"/>
  </subjects>
  <amendments/>
  <summary date="2017-02-28T05:00:00Z" status="Introduced in House">Mental Health and Substance Abuse Treatment Accessibility Act of 2017

This bill amends the Public Health Service Act to permit the Department of Health and Human Services to make loans and loan guarantees: (1) for construction or renovation of psychiatric or substance abuse treatment facilities, and (2) to refinance such loans and loan guarantees. The bill establishes terms and conditions for these loans and loan guarantees.

The bill establishes the Mental Health and Substance Use Treatment Trust Fund. Revenues from the loans and loan guarantees that exceed the cost of carrying out the program may be appropriated to the fund. Amounts in the fund are available for block grants for community mental health services.</summary>
  <committee-reports/>
</bill>


text:
struct SPPInfo;

// ïîñòïðîöåññ
class ENGINE_API CEffectorPP : public SBaseEffector {
    EEffectorPPType eType;
    bool bFreeOnRemove;

protected:
    float fLifeTime;

public:
    CEffectorPP(EEffectorPPType type, f32 lifeTime, bool free_on_remove = true);
    CEffectorPP() : bFreeOnRemove(true), fLifeTime(0.0f), bOverlap(true){};
    virtual ~CEffectorPP();
    BENCH_SEC_SCRAMBLEVTBL1
    virtual BOOL Process(SPPInfo& PPInfo);
    virtual BOOL Valid() { return fLifeTime > 0.0f; }
    IC EEffectorPPType Type() const { return eType; }
    IC bool FreeOnRemove() const { return bFreeOnRemove; }
    IC void SetType(EEffectorPPType t) { eType = t; }
    virtual void Stop(float speed) { fLifeTime = 0.0f; };

    bool bOverlap;
};


text:
FROM biocontainers/biocontainers:vdebian-buster-backports_cv1
MAINTAINER biocontainers <biodocker@gmail.com>
LABEL    software="emboss-lib" \
    base_image="biocontainers/biocontainers:vdebian-buster-backports_cv1" \
    container="emboss-lib" \
    about.summary="EMBOSS Libraries" \
    about.home="http://emboss.sourceforge.net" \
    software.version="6.6.0dfsg-7b1-deb" \
    upstream.version="6.6.0" \
    version="1" \
    about.license="custom, see /usr/share/doc/emboss-lib/copyright" \
    about.license_file="/usr/share/doc/emboss-lib/copyright" \
    about.tags="devel::lang:c, devel::library, field::biology,:biology:bioinformatics, implemented-in::c,:commandline, role::devel-lib, role::program,:shared-lib"

USER root
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && (apt-get install -t buster-backports -y emboss-lib || apt-get install -y emboss-lib) && apt-get clean && apt-get purge && rm -rf /var/lib/apt/lists/* /tmp/*
USER biodocker


text:
from pyamf.remoting.client import RemotingService

client = RemotingService('http://demo.pyamf.org/gateway/recordset')
service = client.getService('service')

print service.getLanguages()


text:
package mil.nga.geopackage;

import java.sql.SQLException;

import org.junit.Test;

/**
 * Test GeoPackage from an imported database
 *
 * @author osbornb
 */
public class GeoPackageImportTest extends ImportGeoPackageTestCase {

	/**
	 * Constructor
	 */
	public GeoPackageImportTest() {

	}

	/**
	 * Test create feature table with metadata
	 *
	 * @throws SQLException
	 */
	@Test
	public void testCreateFeatureTableWithMetadata() throws SQLException {

		GeoPackageTestUtils.testCreateFeatureTableWithMetadata(geoPackage);

	}

	/**
	 * Test create feature table with metadata and id column
	 *
	 * @throws SQLException
	 */
	@Test
	public void testCreateFeatureTableWithMetadataIdColumn()
			throws SQLException {

		GeoPackageTestUtils
				.testCreateFeatureTableWithMetadataIdColumn(geoPackage);

	}

	/**
	 * Test create feature table with metadata and additional columns
	 *
	 * @throws SQLException
	 */
	@Test
	public void testCreateFeatureTableWithMetadataAdditionalColumns()
			throws SQLException {

		GeoPackageTestUtils.testCreateFeatureTableWithMetadataAdditionalColumns(
				geoPackage);

	}

	/**
	 * Test create feature table with metadata, id column, and additional
	 * columns
	 *
	 * @throws SQLException
	 */
	@Test
	public void testCreateFeatureTableWithMetadataIdColumnAdditionalColumns()
			throws SQLException {

		GeoPackageTestUtils
				.testCreateFeatureTableWithMetadataIdColumnAdditionalColumns(
						geoPackage);

	}

	/**
	 * Test delete tables
	 *
	 * @throws SQLException
	 */
	@Test
	public void testDeleteTables() throws SQLException {

		GeoPackageTestUtils.testDeleteTables(geoPackage);

	}

	/**
	 * Test bounds
	 *
	 * @throws SQLException
	 *             upon error
	 */
	@Test
	public void testBounds() throws SQLException {

		GeoPackageTestUtils.testBounds(geoPackage);

	}

	/**
	 * Test vacuum
	 */
	@Test
	public void testVacuum() {

		GeoPackageTestUtils.testVacuum(geoPackage);

	}

	/**
	 * Test table types
	 *
	 * @throws SQLException
	 *             upon error
	 */
	@Test
	public void testTableTypes() throws SQLException {

		GeoPackageTestUtils.testTableTypes(geoPackage);

	}

}


text:
using UnityEngine;
using System.Collections;

public class IllnessGenerator{

	/// <summary>
	/// Generates a new illness.
	/// </summary>
	/// <returns>The name of illness as a string.</returns>
	public string getIllness()
	{
		string illness, prefix, suffix;
		prefix = getPrefix (); // First part of name (body part)
		suffix = getSuffix (); // Second part of name (ailment)

		// If ailment begins with '-' (like "-itis"), do not add space between words.
		if (suffix [0] == '-')
		{
				illness = prefix + suffix;
		}
		else // Otherwise add a space between words
		{
				illness = prefix + " " + suffix;
		}

		return illness;
	}

	// Gets first half of name from database
	private string getPrefix()
	{
		// Database Access function
		return DBaccess.getIllnessBodyPart();
	}

	// Gets second half of name from database
	private string getSuffix()
	{
		// Database Access function
		return DBaccess.getIllnessAilment();
	}
}


text:
//add all start markers on map
var activeInfoWindow;

function addAllStartMarkers(map) {
    console.log("add all markers");
    var startMarker;
    var finishMarker;
    var routeAddresses;
    for (var i in shipments) {
        if((getLastShipmentStatus() == "in progress"||getLastShipmentStatus() == "paused") && shipments[i]._id == getLastShipmentId()){
            currentShipment = shipments[i];
            selectedMarkerIndex = i;
            isStartMarkerSelected = true;
        }
        if (!!shipments[i].route) {
            routeAddresses = {
                start: shipments[i].route.start,
                finish: shipments[i].route.finish
            };
            addresses.push(routeAddresses);

            //creates start marker
            startMarker = new google.maps.Marker({
                position: new google.maps.LatLng(shipments[i].route.start_lat, shipments[i].route.start_long),
                map: map,
                icon: 'images/start_marker.png'
            });
            startMarkers.push(startMarker);

            //add start marker click listener
            google.maps.event.addListener(startMarker, 'click', function () {
                if (!isStartMarkerSelected) {
                    $("#alertcontainer").css("display", "block");
                    $("#message-confirm").css("display", "block");
                    $("#step-number-label").text("Step 1");
                    $("#step-name-label").text("Pickup");
                    selectedMarkerIndex = startMarkers.indexOf(this);
                    currentShipment = shipments[selectedMarkerIndex];
                    setConfirmAddressText();
                    hideMarkers(map);
                    isStartMarkerSelected = true;
                }
            });

            showMarkers();

            //creates finish marker
            finishMarker = new google.maps.Marker({
                position: new google.maps.LatLng(shipments[i].route.finish_lat, shipments[i].route.finish_long),
                map: map,
                icon: 'images/finish_marker.png'
            });
            finishMarker.setMap(null);
            finishMarkers.push(finishMarker);
        }
    }
}

//hides all markers on map except selected
function hideMarkers(map) {
    clearMarkers();
    startMarkers[selectedMarkerIndex].setMap(map);
    finishMarkers[selectedMarkerIndex].setMap(map);
}

//hides all markers
function clearMarkers() {
    setAllMap(null);
    clearFinishMarkers();
}

//hides finish markers
function clearFinishMarkers() {
    for (var i = 0; i < finishMarkers.length; i++) {
        if (!!finishMarkers[i]) {
            finishMarkers[i].setMap(null);
        }
    }
}

//shows start markers and hides finish markers
function showMarkers() {
    if (!!map) {
        setAllMap(map);
        clearFinishMarkers();
    }
}

//set visibility of start markers
function setAllMap(map) {
    console.log("markers count " + startMarkers.length);
    for (var i = 0; i < startMarkers.length; i++) {
        if (!!startMarkers[i]) {
            startMarkers[i].setMap(map);
        }
    }
}

function clearRestaurantMarkers() {
    hideRestaurantMarkers();
    google.maps.event.clearListeners(map, 'idle');
    google.maps.event.clearListeners(map, 'zoom_change');
    restaurantMarkers = [];
}

function createRestaurantMarker(place, index){
    var placeLoc = place.geometry.location;
    var marker=new google.maps.Marker({
        map: map,
        position: placeLoc,
        clickable: true
    });

    var name = "";
    var address = "";
    var phoneNumber = "";

    if(place.name){
        name = place.name;
    }

    if(place.vicinity){
        address = place.vicinity;
    }

    if(place.international_phone_number){
        phoneNumber = place.international_phone_number;
    }

    marker.info = new google.maps.InfoWindow({
        content:  '
' + name + '
 ' +address+'
' + phoneNumber + '
'
    });

    google.maps.event.addListener(marker, 'click', function() {
        if(activeInfoWindow){
            activeInfoWindow.close();
        }
        activeInfoWindow = marker.info;
        marker.info.open(map, marker);
    });

    if(map.getZoom() < zoomLevel){
        marker.setVisible(false);
    }
    restaurantMarkers[index].push(marker);
    return marker;
}

function showPOIbyIndex(index) {
    for (var j = 0; j < restaurantMarkers[index].length; j++) {
        if (restaurantMarkers[index][j]) {
            restaurantMarkers[index][j].setVisible(true);
        }
    }
}

function hidePOIbyIndex(index) {
    for (var j = 0; j < restaurantMarkers[index].length; j++) {
        if (restaurantMarkers[index][j]) {
            restaurantMarkers[index][j].setVisible(false);
        }
    }
}

function showRestaurantMarkers(){
    for (var i = 0; i < restaurantMarkers.length; i++) {
        for(var j=0;j < restaurantMarkers[i].length;j++) {
            restaurantMarkers[i][j].setVisible(true);
        }
    }
}

function hideRestaurantMarkers(){
    console.log("hide restaurant markers");
    for (var i = 0; i < restaurantMarkers.length; i++) {
        if(restaurantMarkers[i]) {
            for (var j = 0; j < restaurantMarkers[i].length; j++) {
                if (restaurantMarkers[i][j]) {
                    restaurantMarkers[i][j].setVisible(false);
                    restaurantMarkers[i][j].info.close();
                }
            }
        }
    }
}

function createPOIMarkers(boundsLatLng, index) {
    var request = {
        bounds: boundsLatLng,
        types: ['airport', 'bank', "department_store", "embassy", "gas_station",
            "hospital", "library", "pharmacy", "post_office", "university"]
    };

    if (getRestaurantMarkerStatus() == "enabled") {
        service.search(request, function (results, status) {
            if (status == google.maps.places.PlacesServiceStatus.OK) {
                var markerCount = 4;
                if (results.length < 4) {
                    markerCount = results.length;
                }
                if (!restaurantMarkers[index]) {
                    restaurantMarkers[index] = new Array(markerCount);
                }
                console.log("marker count " + markerCount);
                for (var i = 0; i < markerCount; i++) {
                    if (results[i]) {
                        createRestaurantMarker(results[i], index);
                    }
                }
            }
        });
    }
}


text:
RSTAMP = v1.0

.PHONY: run score
run: $(OUTFILE) rerun score

score:
	@echo "Check run1.log and run2.log for results."
	@echo "See README.md for run and reporting rules."

ifndef PORT_DIR
# Ports for a couple of common self hosted platforms
UNAME=$(shell if command -v uname 2> /dev/null; then uname ; fi)
ifneq (,$(findstring CYGWIN,$(UNAME)))
PORT_DIR=cygwin
endif
ifneq (,$(findstring Linux,$(UNAME)))
MACHINE=$(shell uname -m)
ifneq (,$(findstring 64,$(MACHINE)))
PORT_DIR=linux64
else
PORT_DIR=linux
endif
endif
endif
ifndef PORT_DIR
$(error PLEASE define PORT_DIR! (e.g. make PORT_DIR=simple))
endif
vpath %.c $(PORT_DIR)
vpath %.h $(PORT_DIR)
vpath %.mak $(PORT_DIR)
include $(PORT_DIR)/core_portme.mak

ifndef ITERATIONS
ITERATIONS=0
endif
ifdef REBUILD
FORCE_REBUILD=force_rebuild
endif

CFLAGS += -DITERATIONS=$(ITERATIONS)

CORE_FILES = core_list_join core_main core_matrix core_state core_util
ORIG_SRCS = $(addsuffix .c,$(CORE_FILES))
SRCS = $(ORIG_SRCS) $(PORT_SRCS)
OBJS = $(addprefix $(OPATH),$(addsuffix $(OEXT),$(CORE_FILES)) $(PORT_OBJS))
OUTNAME = coremark$(EXE)
OUTFILE = $(OPATH)$(OUTNAME)
LOUTCMD = $(OFLAG) $(OUTFILE) $(LFLAGS_END)
OUTCMD = $(OUTFLAG) $(OUTFILE) $(LFLAGS_END)

HEADERS = coremark.h
CHECK_FILES = $(ORIG_SRCS) $(HEADERS)

$(OPATH):
	$(MKDIR) $(OPATH)

.PHONY: compile link
ifdef SEPARATE_COMPILE
$(OPATH)$(PORT_DIR):
	$(MKDIR) $(OPATH)$(PORT_DIR)

compile: $(OPATH) $(OPATH)$(PORT_DIR) $(OBJS) $(HEADERS)
link: compile
	$(LD) $(LFLAGS) $(XLFLAGS) $(OBJS) $(LOUTCMD)

else

compile: $(OPATH) $(SRCS) $(HEADERS)
	$(CC) $(CFLAGS) $(XCFLAGS) $(SRCS) $(OUTCMD)
link: compile
	@echo "Link performed along with compile"

endif

$(OUTFILE): $(SRCS) $(HEADERS) Makefile core_portme.mak $(FORCE_REBUILD)
	$(MAKE) port_prebuild
	$(MAKE) link
	$(MAKE) port_postbuild

.PHONY: rerun
rerun:
	$(MAKE) XCFLAGS="$(XCFLAGS) -DPERFORMANCE_RUN=1" load run1.log
	$(MAKE) XCFLAGS="$(XCFLAGS) -DVALIDATION_RUN=1" load run2.log

PARAM1=$(PORT_PARAMS) 0x0 0x0 0x66 $(ITERATIONS)
PARAM2=$(PORT_PARAMS) 0x3415 0x3415 0x66 $(ITERATIONS)
PARAM3=$(PORT_PARAMS) 8 8 8 $(ITERATIONS)

run1.log-PARAM=$(PARAM1) 7 1 2000
run2.log-PARAM=$(PARAM2) 7 1 2000
run3.log-PARAM=$(PARAM3) 7 1 1200

run1.log run2.log run3.log: load
	$(MAKE) port_prerun
	$(RUN) $(OUTFILE) $($(@)-PARAM) > $(OPATH)$@
	$(MAKE) port_postrun

.PHONY: gen_pgo_data
gen_pgo_data: run3.log

.PHONY: load
load: $(OUTFILE)
	$(MAKE) port_preload
	$(LOAD) $(OUTFILE)
	$(MAKE) port_postload

.PHONY: clean
clean:
	rm -f $(OUTFILE) $(OPATH)*.log *.info $(OPATH)index.html $(PORT_CLEAN)

.PHONY: force_rebuild
force_rebuild:
	echo "Forcing Rebuild"

.PHONY: check
check:
	md5sum -c coremark.md5

ifdef ETC
# Targets related to testing and releasing CoreMark. Not part of the general release!
include Makefile.internal
endif


text:
<?php if($this->session->flashdata('success') !== FALSE): ?>

×
<?php echo $this->session->flashdata('success') ?>

<?php endif; ?>

<?php if($this->session->flashdata('error') !== FALSE): ?>

×
<?php echo $this->session->flashdata('error') ?>

<?php endif; ?>

<?php if($this->session->flashdata('warning') !== FALSE): ?>

×
<?php echo $this->session->flashdata('warning') ?>

<?php endif; ?>


text:
<?php

namespace PDepend\Source\AST;

use PDepend\Source\ASTVisitor\ASTVisitor;

/**
 * This class represents a block of elements for a match expression.
 *
 * <code>
 * match (4) {
 *   4.0 => 'Nope',
 *   "4" => 'Nope',
 *   4 => "That's it",
 *   default => thrown new \Exception('quit'),
 * }
 * </code>
 *
 * @copyright 2008-2017 Manuel Pichler. All rights reserved.
 * @license http://www.opensource.org/licenses/bsd-license.php BSD License
 *
 * @since 2.9.0
 */
class ASTMatchBlock extends ASTExpression
{
    /**
     * Accept method of the visitor design pattern. This method will be called
     * by a visitor during tree traversal.
     *
     * @param ASTVisitor $visitor The calling visitor instance.
     *
     * @since  0.9.12
     */
    public function accept(ASTVisitor $visitor, $data = null)
    {
        return $visitor->visitMatchBlock($this, $data);
    }
}


text:
package com.report;

import org.openqa.selenium.WebDriver;

public interface IReport {
public void GetDateTime();

//************************************************************************************************************
//  *** CREATE REPORT FILE ***
//************************************************************************************************************
public void CreateReport();

//************************************************************************************************************
//*** CLOSE REPORT FILE ***
//************************************************************************************************************
public void CloseReport();

//************************************************************************************************************
//   *** CREATE TABLE HEADER OF REPORT FILE ***
//************************************************************************************************************
public void CreateTableHeader(String sTestScenario, String sTestStep, int sIteration);

//************************************************************************************************************
//*** CREATE TEST Case Footer OF REPORT FILE ***
//************************************************************************************************************
public void CreateTableFooter(int iteration);

//************************************************************************************************************
//      *** WRITE TEST CASE EXECUTION RESULT IN REPORT FILE ***
//************************************************************************************************************
public void Pass(String tParent, String tAction, String tObject, String sTestData, String sVerificationStep);

//************************************************************************************************************
// *** WRITE TEST CASE PASS RESULT IN REPORT FILE ***
//************************************************************************************************************
public void Fail(String tParent, String tAction, String tObject, String sTestData, String sVerificationStep);

//************************************************************************************************************
// *** WRITE TEST CASE FAIL RESULT IN REPORT FILE ***
//************************************************************************************************************
public String Snap_Shots(WebDriver driver);

//************************************************************************************************************
//*** OPEN HTML REPORT FILE AT THE END OF EXECUTION ***
//************************************************************************************************************
public void openReport();
}


text:
require "spec_helper"

describe BookingSync::API::Client::Fees do
  let(:client) { BookingSync::API::Client.new(test_access_token) }

  before { |ex| @casette_base_path = casette_path(casette_dir, ex.metadata) }

  describe ".fees", :vcr do
    it "returns fees" do
      expect(client.fees).not_to be_empty
      assert_requested :get, bs_url("fees")
    end
  end

  describe ".fee", :vcr do
    let(:prefetched_fee_id) {
      find_resource("#{@casette_base_path}_fees/returns_fees.yml", "fees")[:id]
    }

    it "returns a single fee" do
      fee = client.fee(prefetched_fee_id)
      expect(fee.id).to eq prefetched_fee_id
    end
  end

  describe ".create_fee", :vcr do
    let(:attributes) do
      {
        name_en: "New fee",
        rate: 10,
        rate_kind: "fixed",
        downpayment_percentage: 10
      }
    end

    it "creates a new fee" do
      client.create_fee(attributes)
      assert_requested :post, bs_url("fees"),
        body: { fees: [attributes] }.to_json
    end

    it "returns newly created fee" do
      VCR.use_cassette("BookingSync_API_Client_Fees/_create_fee/creates_a_new_fee") do
        fee = client.create_fee(attributes)
        expect(fee.name).to eq(en: "New fee")
        expect(fee.rate).to eq "10.0"
        expect(fee.rate_kind).to eq "fixed"
        expect(fee.downpayment_percentage).to eq "10.0"
      end
    end
  end
end


text:
echo "\nInstalling NPM modules for Grunt.js.";
cd ../;
npm update;

# echo "\nLinking Git Hooks."
# ln -s dev-assets/pre-commit.sh .git/hooks/pre-commit

echo "\nUpdating Bower components."
bower update;

echo "\nUpdating theme Composer requirements";
composer update

echo "\nInstalling development WordPress plugins"
cp dev-assets/composer-plugins.json ../../../composer.json;
cd ../../../;
composer update;


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:padding="10dp">

        <EditText
            android:id="@+id/et_user"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:hint="用户名"/>

        <EditText
            android:id="@+id/et_age"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:hint="年龄"/>

        <EditText
            android:id="@+id/et_desc"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:hint="简介"
            android:lines="2"/>

        <RadioGroup
            android:id="@+id/mRadioGroup"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal">

            <RadioButton
                android:id="@+id/rb_boy"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:checked="true"
                android:text="男"/>

            <RadioButton
                android:id="@+id/rb_girl"
                android:layout_marginLeft="15dp"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="女"/>

        </RadioGroup>

        <EditText
            android:id="@+id/et_pass"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:hint="密码"
            android:inputType="textPassword"/>

        <EditText
            android:id="@+id/et_password"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:hint="再输入一次"
            android:inputType="textPassword"/>

        <EditText
            android:id="@+id/et_email"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:hint="邮箱"/>

        <TextView
            android:text="注册成功需要前往邮箱验证,否则无法登录"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:textColor="@color/colorAccent"
            android:textSize="15sp"/>

        <Button
            android:id="@+id/btnRegistered"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="注册"
            android:background="@drawable/button_bg"
            android:textColor="@android:color/white"/>

    </LinearLayout>
</LinearLayout>


text:
namespace onut
{
    OHttpRef Http::create()
    {
        return std::shared_ptr<Http>(new HttpCURL());
    }

    HttpCURL::HttpCURL()
    {
        curl_global_init(CURL_GLOBAL_SSL);
    }

    HttpCURL::~HttpCURL()
    {
        curl_global_cleanup();
    }

    static size_t curlWrite(void *buffer, size_t size, size_t nmemb, void *userp)
    {
        auto& ret = *(Http::Body*)userp;
        auto totalSize = size * nmemb;
        auto pos = ret.size();
        ret.resize(pos + totalSize);
        memcpy(ret.data() + pos, buffer, totalSize);
        return totalSize;
    }

    std::string HttpCURL::post(const std::string& url, const Body& body, const ErrorCallback& onError)
    {
        auto easyhandle = curl_easy_init();
        if (!easyhandle)
        {
            if (onError)
            {
                onError(0, "curl_easy_init failed");
            }
            return {};
        }

        Body ret;

        curl_easy_setopt(easyhandle, CURLOPT_URL, url.c_str());
        curl_easy_setopt(easyhandle, CURLOPT_POST, 1);
        curl_easy_setopt(easyhandle, CURLOPT_POSTFIELDSIZE, (long)body.size());
        curl_easy_setopt(easyhandle, CURLOPT_POSTFIELDS, (char*)body.data());
        curl_easy_setopt(easyhandle, CURLOPT_WRITEDATA, &ret);
        curl_easy_setopt(easyhandle, CURLOPT_WRITEFUNCTION, curlWrite);
        auto performRet = curl_easy_perform(easyhandle);
        curl_easy_cleanup(easyhandle);

        if (performRet != CURLE_OK)
        {
            if (onError)
            {
                onError(0, "curl_easy_perform failed");
            }
            return {};
        }

        if (ret.empty()) return "";
        if (ret[ret.size() - 1] != 0) ret.push_back(0);

        return (char*)ret.data();
    }

    Http::Body HttpCURL::get(const std::string& url, const Arguments& arguments, const ErrorCallback& onError)
    {
        auto args = packArguments(arguments);
        auto fullUrl = url;
        if (!args.empty())
        {
            fullUrl = url + "?" + args;
        }

        auto easyhandle = curl_easy_init();
        if (!easyhandle)
        {
            if (onError)
            {
                onError(0, "curl_easy_init failed");
            }
            return {};
        }

        Body ret;

        curl_easy_setopt(easyhandle, CURLOPT_URL, fullUrl.c_str());
        curl_easy_setopt(easyhandle, CURLOPT_WRITEDATA, &ret);
        curl_easy_setopt(easyhandle, CURLOPT_WRITEFUNCTION, curlWrite);
        auto performRet = curl_easy_perform(easyhandle);
        curl_easy_cleanup(easyhandle);

        if (performRet != CURLE_OK)
        {
            if (onError)
            {
                onError(0, "curl_easy_perform failed");
            }
            return {};
        }

        return std::move(ret);
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:context="com.hannesdorfmann.adapterdelegates4.sample.animations.AnimationDiffUtilsActivity"
    >

  <androidx.recyclerview.widget.RecyclerView
      android:id="@+id/recyclerView"
      android:layout_width="match_parent"
      android:layout_height="0dp"
      android:layout_weight="1"
      />

  <LinearLayout
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:orientation="horizontal"
      android:paddingLeft="8dp"
      android:paddingRight="8dp"
      >

    <Button
        android:id="@+id/add"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginLeft="8dp"
        android:layout_marginRight="8dp"
        android:text="Add"
        />
    <Button
        android:id="@+id/remove"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginLeft="8dp"
        android:layout_marginRight="8dp"
        android:text="Remove"
        />
    <Button
        android:id="@+id/update"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginLeft="8dp"
        android:layout_marginRight="8dp"
        android:text="update"
        />
    <Button
        android:id="@+id/move"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginLeft="8dp"
        android:layout_marginRight="8dp"
        android:text="move"
        />

  </LinearLayout>

</LinearLayout>


text:
package net.drewgottlieb.soapy;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

/**
 * Created by drew on 7/5/15.
 */
public class SpotifyPlaylist {
    private String name = null;
    private String uri = null;
    private String imageUrl = null;
    private String lastPlayedSong = null;
    private int totalTracks = 0;

    public SpotifyPlaylist(JSONObject jPlaylist) throws JSONException {
        uri = jPlaylist.getString("uri");

        if (jPlaylist.has("name")) {
            name = jPlaylist.getString("name");
        }

        if (jPlaylist.has("images")) {
            JSONArray jImages = jPlaylist.getJSONArray("images");
            if (jImages.length() > 0) {
                JSONObject jSmallestImage = jImages.getJSONObject(0);
                int smallestHeight = jSmallestImage.getInt("height");
                for (int i = 1; i < jImages.length(); i++) {
                    JSONObject jImage = jImages.getJSONObject(i);
                    int height = jImage.getInt("height");
                    if (height < smallestHeight) {
                        jSmallestImage = jImage;
                        smallestHeight = height;
                    }
                }
                imageUrl = jSmallestImage.getString("url");
            }
        }

        if (jPlaylist.has("lastPlayedSong")) {
            lastPlayedSong = jPlaylist.getString("lastPlayedSong");
        }

        if (jPlaylist.has("tracks")) {
            JSONObject jTracks = jPlaylist.getJSONObject("tracks");
            totalTracks = jTracks.getInt("total");
        }
    }

    public String getName() {
        return this.name;
    }

    @Override
    public String toString() {
        return this.getName() + " (" + this.getURI() + ")";
    }

    public String getURI() {
        return this.uri;
    }

    public String getImageURL() {
        return this.imageUrl;
    }

    public int getTotalTracks() {
        return this.totalTracks;
    }

    public void setLastPlayedSong(String uri) {
        lastPlayedSong = uri;
    }

    public String getLastPlayedSong() {
        return lastPlayedSong;
    }
}


text:
APP_ENGINE = True
ENABLE_JASMINE = False
LOGIN_MANAGER = 'ggrc.login.appengine'
FULLTEXT_INDEXER = 'ggrc.fulltext.mysql.MysqlIndexer'
# Cannot access filesystem on AppEngine or when using SDK
AUTOBUILD_ASSETS = False
SQLALCHEMY_RECORD_QUERIES = False
MEMCACHE_MECHANISM = True
CALENDAR_MECHANISM = False
BACKGROUND_COLLECTION_POST_SLEEP = 2.5  # seconds


text:
require 'generators/supporting_cast/generator_helpers'

module SupportingCast
  module Generators
    class SslCertificateGenerator < Rails::Generators::Base
      include GeneratorHelpers

      desc "Generate ssl certificate files"

      def openssl
        inside('config/nginx') do
          run('rm server.key server.csr server.crt')

          # generate private key and certificate signing request
          run('openssl req -new -nodes -keyout server.key -out server.csr')

          # generate certificate
          run('openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt')
        end
      end

      def own
        inside('config/nginx') do
          run('chmod 400 *.key *.crt')
          run('sudo chown root *.key *.crt')
        end
      end

    end
  end
end


text:
module OneviewCookbook
  module API2400
    module Synergy
      # ConnectionTemplate API2400 Synergy provider
      class ConnectionTemplateProvider < OneviewCookbook::API2200::Synergy::ConnectionTemplateProvider
      end
    end
  end
end


text:
define(
		[	'src/VisualEditor',
			'src/cslStyles',
			'src/debug'
		],
		function (
			CSLEDIT_VisualEditor,
			CSLEDIT_cslStyles,
			debug
		) {
	module('CSLEDIT_cslStyles');

	test('styles', function () {
		var defaultMasterId = CSLEDIT_cslStyles.styles().masterIdFromId[CSLEDIT_cslStyles.defaultStyleId],
			numStyles = Object.keys(CSLEDIT_cslStyles.styles().masterIdFromId).length;

		equal(defaultMasterId, CSLEDIT_cslStyles.defaultStyleId, "default style is master");

		ok(numStyles > 2000, "enough styles");
		equal(numStyles, Object.keys(CSLEDIT_cslStyles.styles().styleTitleFromId).length, "enough titles");

		debug.log("Total number of styles: " + numStyles);
	});

	test('examples', function () {
		ok(Object.keys(CSLEDIT_cslStyles.exampleCitations().exampleCitationsFromMasterId).length > 500);

		debug.log("Number of example citations: " +
			CSLEDIT_cslStyles.exampleCitations().exampleCitationsFromMasterId.length);
	});

	test('style id generation', function () {
		var numSuccesses = 0,
			failures = [],
			successRate,
			tolerance = 0.86;

		// check that we generate titles the same as the existing repo ones
		$.each(CSLEDIT_cslStyles.styles().styleTitleFromId, function (id, title) {
			var generatedId = CSLEDIT_cslStyles.generateStyleId(title);

			if (generatedId === id) {
				numSuccesses++;
			} else {
				failures.push({
					title : title,
					id : id,
					generatedId : generatedId
				});
			}
		});

		successRate = numSuccesses / (numSuccesses + failures.length);
		debug.log("success rate = " + successRate);
		ok(successRate > tolerance, "success rate = " + Math.round(successRate * 100) +
				"% (minimum tolerance = " + Math.round(100 * tolerance) + "%)");

		if (successRate <= tolerance) {
			// show failures
			$.each(failures, function (i, fail) {
				equal(fail.generatedId, fail.id, fail.title);
			});
		}
	});
});


text:
angular
  .module('horizon.dashboard.project.vitrage')
  .directive('hzNetwork', hzNetwork);

function hzNetwork() {
  var directive = {
    link: link,
    templateUrl: STATIC_URL + 'dashboard/project/layout/main/network/network.html',
    restrict: 'E'
  };
  return directive;

  function link(scope, element, attrs) {

  }
}


text:
#import "CPTDefinitions.h"

/// @file

@class CPTLegendEntry;
@class CPTPlot;
@class CPTTextStyle;

/**
 *  @brief An array of CPTLegendEntry objects.
 **/
typedef NSArray<CPTLegendEntry *> CPTLegendEntryArray;

/**
 *  @brief A mutable array of CPTLegendEntry objects.
 **/
typedef NSMutableArray<CPTLegendEntry *> CPTMutableLegendEntryArray;

@interface CPTLegendEntry : NSObject<NSCoding, NSSecureCoding>

/// @name Plot Info
/// @{
@property (nonatomic, readwrite, cpt_weak_property, nullable) CPTPlot *plot;
@property (nonatomic, readwrite, assign) NSUInteger index;
/// @}

/// @name Formatting
/// @{
@property (nonatomic, readwrite, strong, nullable) CPTTextStyle *textStyle;
/// @}

/// @name Layout
/// @{
@property (nonatomic, readwrite, assign) NSUInteger row;
@property (nonatomic, readwrite, assign) NSUInteger column;
@property (nonatomic, readonly) CGSize titleSize;
/// @}

/// @name Drawing
/// @{
-(void)drawTitleInRect:(CGRect)rect inContext:(nonnull CGContextRef)context scale:(CGFloat)scale;
/// @}

@end


text:
using StrategyPattern.Comparatos;
using System;
using System.Collections.Generic;

namespace StrategyPattern
{
    public class StartUp
    {
        public static void Main()
        {
            SortedSet<Person> peopleSortedByName = new SortedSet<Person>(new NameComparator());
            SortedSet<Person> peopleSortedByAge = new SortedSet<Person>(new AgeComparator());

            int peopleCount = int.Parse(Console.ReadLine());
            for (int i = 0; i < peopleCount; i++)
            {
                var personTokens = Console.ReadLine().Split();
                Person person = new Person(personTokens[0], int.Parse(personTokens[1]));

                peopleSortedByName.Add(person);
                peopleSortedByAge.Add(person);
            }

            foreach (var person in peopleSortedByName)
            {
                Console.WriteLine(person);
            }

            foreach (var person in peopleSortedByAge)
            {
                Console.WriteLine(person);
            }
        }
    }
}


text:
package org.reldb.ldi.calc.calculator;

import java.util.*;

/** A crude stack-based calculator engine, rather like those old RPN-based HPs
 * but without any keys or display.  It's just the processor.  Eg., to calculate
 * 10 - 2:
 *
 *  push_integer("10");
 *  push_integer("2");
 *  subtract();
 *  System.out.println(pop());
 */
public class Calculator {

	private Stack<Value> stack = new Stack<Value>();

	public void push(Value v) {
		stack.push(v);
	}

	public Value pop() {
		return (Value)stack.pop();
	}

	public void or() {
		push(pop().or(pop()));
	}

	public void and() {
		push(pop().and(pop()));
	}

	public void eq() {
		push(pop().eq(pop()));
	}

	public void neq() {
		push(pop().neq(pop()));
	}

	public void gte() {
		Value v2 = pop();
		push(pop().gte(v2));
	}

	public void lte() {
		Value v2 = pop();
		push(pop().lte(v2));
	}

	public void gt() {
		Value v2 = pop();
		push(pop().gt(v2));
	}

	public void lt() {
		Value v2 = pop();
		push(pop().lt(v2));
	}

	public void add() {
		push(pop().add(pop()));
	}

	public void subtract() {
		Value v2 = pop();
		push(pop().subtract(v2));
	}

	public void mult() {
		push(pop().mult(pop()));
	}

	public void div() {
		Value v2 = pop();
		push(pop().div(v2));
	}

	public void not() {
		push(pop().not());
	}

	public void unary_plus() {
		push(pop().unary_plus());
	}

	public void unary_minus() {
		push(pop().unary_minus());
	}

	public void push_integer(String s) {
		push(new ValueInteger(Integer.parseInt(s)));
	}

	public void push_floating(String s) {
		throw new ExceptionSemantic("Floating point values are not implemented yet.");
	}

	public void push_boolean(boolean b) {
		push(new ValueBoolean(b));
	}
}