text:
import {Buffer} from 'node:buffer';
import path from 'node:path';
import {fileURLToPath} from 'node:url';

import test from '@ava/test';
import {execaNode} from 'execa';
import replaceString from 'replace-string';

const cliPath = fileURLToPath(new URL('../../entrypoints/cli.mjs', import.meta.url));
const ttySimulator = fileURLToPath(new URL('simulate-tty.cjs', import.meta.url));

const TEST_AVA_IMPORT_FROM = path.join(process.cwd(), 'entrypoints/main.cjs');

const normalizePosixPath = string => replaceString(string, '\\', '/');
const normalizePath = (root, file) => normalizePosixPath(path.posix.normalize(path.relative(root, file)));

const compareStatObjects = (a, b) => {
	if (a.file < b.file) {
		return -1;
	}

	if (a.file > b.file) {
		return 1;
	}

	if (a.title < b.title) {
		return -1;
	}

	return 1;
};

export const cwd = (...paths) => path.join(path.dirname(fileURLToPath(test.meta.file)), 'fixtures', ...paths);
export const cleanOutput = string => string.replace(/^\W+/, '').replace(/\W+\n+$/g, '').trim();

const NO_FORWARD_PREFIX = Buffer.from('🤗', 'utf8');

const forwardErrorOutput = async from => {
	for await (const message of from) {
		if (NO_FORWARD_PREFIX.compare(message, 0, 4) !== 0) {
			process.stderr.write(message);
		}
	}
};

export const fixture = async (args, options = {}) => {
	const workingDir = options.cwd || cwd();
	const running = execaNode(cliPath, args, {
		...options,
		env: {
			...options.env,
			AVA_EMIT_RUN_STATUS_OVER_IPC: 'I\'ll find a payphone baby / Take some time to talk to you',
			TEST_AVA_IMPORT_FROM,
		},
		cwd: workingDir,
		serialization: 'advanced',
		nodeOptions: ['--require', ttySimulator],
	});

	// Besides buffering stderr, if this environment variable is set, also pipe
	// to stderr. This can be useful when debugging the tests.
	if (process.env.DEBUG_TEST_AVA) {
		// Running.stderr.pipe(process.stderr);
		forwardErrorOutput(running.stderr);
	}

	const errors = new WeakMap();
	const logs = new WeakMap();
	const stats = {
		failed: [],
		failedHooks: [],
		internalErrors: [],
		processExits: [],
		passed: [],
		selectedTestCount: 0,
		sharedWorkerErrors: [],
		skipped: [],
		todo: [],
		uncaughtExceptions: [],
		getError(statObject) {
			return errors.get(statObject);
		},
		getLogs(statObject) {
			return logs.get(statObject);
		},
	};

	running.on('message', statusEvent => {
		switch (statusEvent.type) {
			case 'hook-failed': {
				const {title, testFile} = statusEvent;
				const statObject = {title, file: normalizePath(workingDir, testFile)};
				errors.set(statObject, statusEvent.err);
				stats.failedHooks.push(statObject);
				break;
			}

			case 'internal-error': {
				const {testFile} = statusEvent;
				const statObject = {file: normalizePath(workingDir, testFile)};
				errors.set(statObject, statusEvent.err);
				stats.internalErrors.push(statObject);
				break;
			}

			case 'process-exit': {
				const {testFile} = statusEvent;
				const statObject = {file: normalizePath(workingDir, testFile)};
				stats.processExits.push(statObject);
				break;
			}

			case 'selected-test': {
				stats.selectedTestCount++;
				if (statusEvent.skip) {
					const {title, testFile} = statusEvent;
					stats.skipped.push({title, file: normalizePath(workingDir, testFile)});
				}

				if (statusEvent.todo) {
					const {title, testFile} = statusEvent;
					stats.todo.push({title, file: normalizePath(workingDir, testFile)});
				}

				break;
			}

			case 'shared-worker-error': {
				const {message, name, stack} = statusEvent.err;
				stats.sharedWorkerErrors.push({message, name, stack});
				break;
			}

			case 'test-passed': {
				const {title, testFile} = statusEvent;
				const statObject = {title, file: normalizePath(workingDir, testFile)};
				stats.passed.push(statObject);
				logs.set(statObject, statusEvent.logs);
				break;
			}

			case 'test-failed': {
				const {title, testFile} = statusEvent;
				const statObject = {title, file: normalizePath(workingDir, testFile)};
				errors.set(statObject, statusEvent.err);
				stats.failed.push(statObject);
				logs.set(statObject, statusEvent.logs);
				break;
			}

			case 'uncaught-exception': {
				const {message, name, stack} = statusEvent.err;
				stats.uncaughtExceptions.push({message, name, stack});
				break;
			}

			default:
				break;
		}
	});

	try {
		return {
			stats,
			...await running,
		};
	} catch (error) {
		throw Object.assign(error, {stats});
	} finally {
		stats.failed.sort(compareStatObjects);
		stats.failedHooks.sort(compareStatObjects);
		stats.passed.sort(compareStatObjects);
		stats.skipped.sort(compareStatObjects);
		stats.todo.sort(compareStatObjects);
	}
};


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Lecidea alboatra f. alboatra (Hoffm.) Chev.

### Remarks
null

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--  Copyright (C) 2013 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
 -->

<resources xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
    <string name="app_name" msgid="4076638519189386225">"Muestra de Chips"</string>
    <string name="email_addresses" msgid="5320415175940315400">"Direcciones de correo electrónico"</string>
    <string name="phone_numbers" msgid="7836326833170390688">"Números de teléfono"</string>
</resources>


text:
"""
Antigrain Geometry Path Collection

This collection provides antialiased and accurate paths with caps and joins. It
is memory hungry (x8) and slow (x.25) so it is to be used sparingly, mainly for
thick paths where quality is critical.
"""
import numpy as np
from glumpy import gl, library
from glumpy.transforms import Position, Viewport
from . collection import Collection

class AggPathCollection(Collection):
    """
    Antigrain Geometry Path Collection

    This collection provides antialiased and accurate paths with caps and
    joins. It is memory hungry (x8) and slow (x.25) so it is to be used
    sparingly, mainly for thick paths where quality is critical.
    """

    def __init__(self, user_dtype=None, transform=None, viewport=None,
                 vertex=None, fragment=None, **kwargs):
        """
        Initialize the collection.

        Parameters
        ----------

        user_dtype: list
            The base dtype can be completed (appended) by the used_dtype. It
            only make sense if user also provide vertex and/or fragment shaders

        viewport: glumpy.Transforms
            The viewport to use to rende the collection

        transform: glumpy.Tranforms
            The default vertex shader apply the supplied transform to the
            vertices positions before computing the actual vertices positions
            for path thickness. Note that it is necessary to add the
            glumpy.transforms.Viewport transform at the end of the supplied transform.

        vertex: string
            Vertex shader code

        fragment: string
            Fragment  shader code

        caps : string
            'local', 'shared' or 'global'

        join : string
            'local', 'shared' or 'global'

        color : string
            'local', 'shared' or 'global'

        miter_limit : string
            'local', 'shared' or 'global'

        linewidth : string
            'local', 'shared' or 'global'

        antialias : string
            'local', 'shared' or 'global'
        """

        base_dtype = [ ('p0',         (np.float32, 3), '!local', (0,0,0)),
                       ('p1',         (np.float32, 3), '!local', (0,0,0)),
                       ('p2',         (np.float32, 3), '!local', (0,0,0)),
                       ('p3',         (np.float32, 3), '!local', (0,0,0)),
                       ('uv',         (np.float32, 2), '!local', (0,0)),

                       ('caps',       (np.float32, 2), 'global', (0,0)),
                       ('join',       (np.float32, 1), 'global', 0),
                       ('color',      (np.float32, 4), 'global', (0,0,0,1)),
                       ('miter_limit',(np.float32, 1), 'global', 4),
                       ('linewidth',  (np.float32, 1), 'global', 1),
                       ('antialias',  (np.float32, 1), 'global', 1) ]

        dtype = base_dtype
        if user_dtype:
            dtype.extend(user_dtype)

        if vertex is None:
            vertex = library.get('collections/agg-path.vert')
        if fragment is None:
            fragment = library.get('collections/agg-path.frag')

        Collection.__init__(self, dtype=dtype, itype=np.uint32, mode=gl.GL_TRIANGLES,
                            vertex=vertex, fragment=fragment, **kwargs)

        # Set hooks if necessary
        program = self._programs[0]
        if "transform" in program.hooks:
            if transform is not None:
                program["transform"] = transform
            else:
                program["transform"] = Position() + Viewport()

        if "viewport" in program.hooks:
            if viewport is not None:
                program["viewport"] = viewport
            else:
                program["viewport"] = Viewport()

    def append(self, P, closed=False, itemsize=None, **kwargs):
        """
        Append a new set of vertices to the collection.

        For kwargs argument, n is the number of vertices (local) or the number
        of item (shared)

        Parameters
        ----------

        P : np.array
            Vertices positions of the path(s) to be added

        closed: bool
            Whether path(s) is/are closed

        itemsize: int or None
            Size of an individual path

        caps : list, array or 2-tuple
           Path start /end cap

        join : list, array or float
           path segment join

        color : list, array or 4-tuple
           Path color

        miter_limit : list, array or float
           Miter limit for join

        linewidth : list, array or float
           Path linewidth

        antialias : list, array or float
           Path antialias area
        """

        itemsize  = itemsize or len(P)
        itemcount = len(P)//itemsize

        # Computes the adjacency information
        n,p = len(P), P.shape[-1]
        Z = np.tile(P,2).reshape(2*len(P),p)
        V = np.empty(n, dtype=self.vtype)

        V['p0'][1:-1]= Z[0::2][:-2]
        V['p1'][:-1] = Z[1::2][:-1]
        V['p2'][:-1] = Z[1::2][+1:]
        V['p3'][:-2] = Z[0::2][+2:]

        # Apply default values on vertices
        for name in self.vtype.names:
            if name not in ['collection_index', 'p0', 'p1', 'p2', 'p3']:
                V[name] = kwargs.get(name, self._defaults[name])

        # Extract relevant segments only
        V = (V.reshape(n//itemsize, itemsize)[:,:-1])
        if closed:
            V['p0'][:, 0] = V['p2'][:,-1]
            V['p3'][:,-1] = V['p1'][:, 0]
        else:
            V['p0'][:, 0] = V['p1'][:, 0]
            V['p3'][:,-1] = V['p2'][:,-1]
        V = V.ravel()

        # Quadruple each point (we're using 2 triangles / segment)
        # No shared vertices between segment because of joins
        V = np.repeat(V,4,axis=0).reshape((len(V),4))
        V['uv'] = (-1,-1), (-1,+1), (+1,-1), (+1,+1)
        V = V.ravel()

        n = itemsize
        if closed:
            I = np.resize(np.array([0,1,2, 1,2,3], dtype=np.uint32),n*2*3)
            I += np.repeat( 4*np.arange(n, dtype=np.uint32), 6)
            I[-6:] = 4*n-6,4*n-5,0,4*n-5,0,1
        else:
            I = np.resize(np.array([0,1,2, 1,2,3], dtype=np.uint32),(n-1)*2*3)
            I += np.repeat( 4*np.arange(n-1, dtype=np.uint32), 6)
        I = I.ravel()

        # Uniforms
        if self.utype:
            U = np.zeros(itemcount, dtype=self.utype)
            for name in self.utype.names:
                if name not in ["__unused__"]:
                    U[name] = kwargs.get(name, self._defaults[name])
        else:
            U = None

        Collection.append(self, vertices=V, uniforms=U,
                          indices=I, itemsize=itemsize*4-4)

    def draw(self, mode = gl.GL_TRIANGLES):
        """ Draw collection """

        gl.glDepthMask(gl.GL_FALSE)
        Collection.draw(self, mode)
        gl.glDepthMask(gl.GL_TRUE)


text:
<?php
define("HOST", "localhost"); // The host you want to connect to.
define("USER", "admin_info"); // The database username.
define("PASSWORD", "mLR7ZV7HnDsPQ4ts"); // The database password.
define("DATABASE", "admin_info"); // The database name.

$mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE);
// If you are connecting via TCP/IP rather than a UNIX socket remember to add the port number as a parameter.
?>


text:
"""The test for the Facebook notify module."""
import unittest
import requests_mock

import homeassistant.components.notify.facebook as facebook

class TestFacebook(unittest.TestCase):
    """Tests for Facebook notifification service."""

    def setUp(self):
        """Set up test variables."""
        access_token = "page-access-token"
        self.facebook = facebook.FacebookNotificationService(access_token)

    @requests_mock.Mocker()
    def test_send_simple_message(self, mock):
        """Test sending a simple message with success."""
        mock.register_uri(
            requests_mock.POST,
            facebook.BASE_URL,
            status_code=200
        )

        message = "This is just a test"
        target = ["+15555551234"]

        self.facebook.send_message(message=message, target=target)
        self.assertTrue(mock.called)
        self.assertEqual(mock.call_count, 1)

        expected_body = {
            "recipient": {"phone_number": target[0]},
            "message": {"text": message}
        }
        self.assertEqual(mock.last_request.json(), expected_body)

        expected_params = {"access_token": ["page-access-token"]}
        self.assertEqual(mock.last_request.qs, expected_params)

    @requests_mock.Mocker()
    def test_sending_multiple_messages(self, mock):
        """Test sending a message to multiple targets."""
        mock.register_uri(
            requests_mock.POST,
            facebook.BASE_URL,
            status_code=200
        )

        message = "This is just a test"
        targets = ["+15555551234", "+15555551235"]

        self.facebook.send_message(message=message, target=targets)
        self.assertTrue(mock.called)
        self.assertEqual(mock.call_count, 2)

        for idx, target in enumerate(targets):
            request = mock.request_history[idx]
            expected_body = {
                "recipient": {"phone_number": target},
                "message": {"text": message}
            }
            self.assertEqual(request.json(), expected_body)

            expected_params = {"access_token": ["page-access-token"]}
            self.assertEqual(request.qs, expected_params)

    @requests_mock.Mocker()
    def test_send_message_attachment(self, mock):
        """Test sending a message with a remote attachment."""
        mock.register_uri(
            requests_mock.POST,
            facebook.BASE_URL,
            status_code=200
        )

        message = "This will be thrown away."
        data = {
            "attachment": {
                "type": "image",
                "payload": {"url": "http://www.example.com/image.jpg"}
            }
        }
        target = ["+15555551234"]

        self.facebook.send_message(message=message, data=data, target=target)
        self.assertTrue(mock.called)
        self.assertEqual(mock.call_count, 1)

        expected_body = {
            "recipient": {"phone_number": target[0]},
            "message": data
        }
        self.assertEqual(mock.last_request.json(), expected_body)

        expected_params = {"access_token": ["page-access-token"]}
        self.assertEqual(mock.last_request.qs, expected_params)

    @requests_mock.Mocker()
    def test_send_targetless_message(self, mock):
        """Test sending a message without a target."""
        mock.register_uri(
            requests_mock.POST,
            facebook.BASE_URL,
            status_code=200
        )

        self.facebook.send_message(message="goin nowhere")
        self.assertFalse(mock.called)

    @requests_mock.Mocker()
    def test_send_message_with_400(self, mock):
        """Test sending a message with a 400 from Facebook."""
        mock.register_uri(
            requests_mock.POST,
            facebook.BASE_URL,
            status_code=400,
            json={
                "error": {
                    "message": "Invalid OAuth access token.",
                    "type": "OAuthException",
                    "code": 190,
                    "fbtrace_id": "G4Da2pFp2Dp"
                }
            }
        )
        self.facebook.send_message(message="nope!", target=["+15555551234"])
        self.assertTrue(mock.called)
        self.assertEqual(mock.call_count, 1)


text:
package org.familysearch.platform.ct;

import org.codehaus.enunciate.json.JsonIgnore;
import org.codehaus.enunciate.qname.XmlQNameEnumRef;
import org.gedcomx.common.URI;
import org.gedcomx.rt.json.JsonElementWrapper;

import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;

/**
 * Information about a match.
 */
@XmlRootElement
@JsonElementWrapper ( name = "matchInfo" )
@XmlType ( name = "MatchInfo" )
public class MatchInfo {

  private URI collection;
  private URI status;

  public MatchInfo() {
  }

  /**
   * The collection in which this match was found.
   *
   * @return The collection in which this match was found.
   */
  @XmlAttribute
  public URI getCollection() {
    return collection;
  }

  /**
   * The collection in which this match was found.
   *
   * @param collection The collection in which this match was found.
   */
  public void setCollection(URI collection) {
    this.collection = collection;
  }

  /**
   * The system in which this match was found.
   *
   * @return The system in which this match was found.
   * @deprecated Use get/setCollection
   */
  @XmlTransient
  @JsonIgnore
  @org.codehaus.jackson.annotate.JsonIgnore
  public URI getSystem() {
    return getCollection();
  }

  /**
   * The system in which this match was found.
   *
   * @param system The system in which this match was found.
   * @deprecated Use get/setCollection
   */
  @JsonIgnore
  @org.codehaus.jackson.annotate.JsonIgnore
  public void setSystem(URI system) {
    setCollection(system);
  }

  /**
   * The enum referencing the known collection of this match.
   *
   * @return The enum referencing the known collection of this match.
   */
  @XmlTransient
  @JsonIgnore
  @org.codehaus.jackson.annotate.JsonIgnore
  public MatchCollection getKnownCollection() {
    return getCollection() == null ? null : MatchCollection.fromQNameURI(getCollection());
  }

  /**
   * The enum referencing the known collection of this match.
   *
   * @param knownCollection The enum referencing the known collection of this match.
   */
  @JsonIgnore
  @org.codehaus.jackson.annotate.JsonIgnore
  public void setKnownCollection(MatchCollection knownCollection) {
    setCollection(knownCollection == null ? null : knownCollection.toQNameURI());
  }

  /**
   * The way this match has been resolved.
   *
   * @return The way this match has been resolved.
   */
  @XmlAttribute
  @XmlQNameEnumRef (MatchStatus.class)
  public URI getStatus() {
    return status;
  }

  /**
   * The way this match has been resolved.
   *
   * @param status The way this match has been resolved.
   */
  public void setStatus(URI status) {
    this.status = status;
  }

  /**
   * The enum referencing the known resolution of this match.
   *
   * @return The enum referencing the known resolution of this match.
   */
  @XmlTransient
  @JsonIgnore
  @org.codehaus.jackson.annotate.JsonIgnore
  public MatchStatus getKnownStatus() {
    return getStatus() == null ? null : MatchStatus.fromQNameURI(getStatus());
  }

  /**
   * The enum referencing the known resolution of this match.
   *
   * @param knownResolution The enum referencing the known resolution of this match.
   */
  @JsonIgnore
  @org.codehaus.jackson.annotate.JsonIgnore
  public void setKnownStatus(MatchStatus knownResolution) {
    setStatus(knownResolution == null ? null : knownResolution.toQNameURI());
  }
}


text:
var cliente = $('#form_clientes');
var error = $('.alert-danger', cliente);
var success = $('.alert-success', cliente);

cliente.validate({
  errorElement: 'span', //default input error message container
  errorClass: 'help-block help-block-error', // default input error message class
  focusInvalid: false, // do not focus the last invalid input
  ignore: "",
  rules: {
    nro_doc: {
      required: true
    },
    nombre: {
      required: true
    },
    razon_social: {
      required: true
    },
    email : {
      email: true
    }
  },

  invalidHandler: function (event, validator) { //display error alert on form submit
    success.hide();
    error.show();
    Metronic.scrollTo(error, -200);
  },

  errorPlacement: function (error, element) { // render error placement for each input type
    if (element.parent(".input-group").size() > 0) error.insertAfter(element.parent(".input-group"));
  },

  highlight: function (element) { // hightlight error inputs
    $(element).closest('.form-group').addClass('has-error'); // set error class to the control group
  },

  unhighlight: function (element) { // revert the change dony by hightlight
    $(element).closest('.form-group').removeClass('has-error'); // set error class to the control group
  },

  success: function (label, element) {
    label.closest('.control-group').removeClass('has-error'); // set success class to the control group
  },
  submitHandler: function (form) {
    error.hide();
    success.show();
    form.submit();
  }
});