-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathymc_LIB.py
85 lines (58 loc) · 2.29 KB
/
ymc_LIB.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
import requests
import socket
import torch
import random
#affiche l'adresse IP
def ip_adresse():
hostname = socket.gethostname()
ip_adresse = socket.gethostbyname(hostname)
return f'votre ip adresse es {ip_adresse}'
#liste tou les methode d'un pacquet
def method_list(*args):
for method in dir(*args):
if '__' not in method:
# print(method)
return method
def compare_list(list:list,list2:list):
resultat = set(list) & set(list2)
if len(resultat) > 0:
# print(f'IL ya {len(resultat)} element en commun: {resultat}')
return f'IL ya {len(resultat)} element en commun: {resultat}'
if len(resultat) == 0:
print("pas d'element en commun ")
return "pas d'element en commun "
# generateur de Nom et prenom
def generateur_nom(nombre:int):
noms_fictif = []
liste_noms = ["Smith", "Johnson", "Williams", "Jones", "Brown", "Davis", "Miller",
"Wilson", "Moore", "Taylor", "Anderson", "Thomas", "Jackson", "White",
"Harris", "Martin", "Thompson", "Garcia", "Martinez", "Robinson","Toure"]
liste_prenoms = ["Emma", "Liam", "Olivia", "Noah", "Ava", "Isabella", "Sophia", "Mia",
"Charlotte", "Amelia", "Harper", "Evelyn", "Abigail", "Emily", "Elizabeth",
"Mila", "Ella", "Avery", "Sofia", "Camila","Mohamed Ali"]
for _ in range(nombre):
nom = random.choice(liste_noms)
prenom = ''.join(random.choices(liste_prenoms))
noms_fictif.append(f"{prenom} {nom}")
# print(noms_fictif)
return (noms_fictif)
#fonction pour connaitre la taille de la sortie OUTSIZE dans un reseau de neurone
def output_size(input,kernel_size):
input_size = input
stride = 1
padding = 0
get_output_size = (input_size - kernel_size + 2 * padding ) // stride +1
output_size = get_output_size
output_size = get_output_size
output_size = get_output_size
output_size = get_output_size
# print(f'Output size afer conv Layers: {output_size}')
return f'Output size afer conv Layers: {output_size}'
output_size(28,3)
# resultat = set(Afro_quote_1) & set(Afro_quote_2)
#
#
# if len(resultat) > 0:
# print(f'il ya {len(resultat)}, element commun : {resultat}')
# else:
# print("il n'ya pas d'element commun ")