This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const assert = require('chai').assert; | |
const socket = require('socket.io-client')("http://localhost:3000"); | |
/** | |
* function used to wait response on a channel | |
* | |
* @param {String} channel | |
* @param {Function} callback | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { xml } = require('@xmpp/client'); | |
function simpleMessage(to, from, type, message){ | |
return xml( | |
"message", | |
{to, from, type}, | |
xml("body", {},message) | |
) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import librtmp | |
import time | |
import re | |
class ParamsError(Exception): | |
"""Raised while download params are incorrect.""" | |
pass | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import imutils | |
try: | |
import cv2 | |
except ImportError: | |
from cv2 import cv2 | |
def order_points(pts): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends 'custom_auth/base.html' %} | |
{% block title %} Authentication page {% endblock %} | |
{% block content %} | |
<form method="post" action="{% url 'custom_auth:auth_view' %}"> | |
{% csrf_token %} | |
{{ form.as_p }} | |
<input type="submit" value="valider" /> | |
</form> | |
{% endblock %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.shortcuts import render | |
from django.views.generic import FormView | |
from .forms import AuthForm | |
from django.contrib.auth.decorators import login_required | |
from django.contrib import messages | |
from django.urls.base import reverse_lazy | |
from django.shortcuts import redirect | |
class AuthView(FormView): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/********************************* | |
* Server side of implementation | |
**********************************/ | |
var app = require('express')(); | |
var http = require('http').createServer(app); | |
var io = require('socket.io')(http); | |
app.get("/", (req, res) => { | |
res.render("client.ejs"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Test socket</title> | |
</head> | |
<body> | |
<form> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
from keras.preprocessing.image import ImageDataGenerator | |
from keras.models import Sequential | |
from keras.layers import Conv2D, MaxPooling2D, Dropout, Flatten, Dense, Activation, BatchNormalization | |
from sklearn.model_selection import train_test_split | |
import matplotlib.pyplot as plt | |
import os | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def validation_required(validator_function): | |
def decorator(function): | |
async def error(websocket, err): | |
await websocket.send(err) | |
async def wrapper(websocket, data): | |
status, err = validator_function(data) | |
if status: |