index
int64
repo_name
string
branch_name
string
path
string
content
string
import_graph
string
86,951
kadirturan0/PythonKampi
refs/heads/master
/Gun_6/ornek_Ogrenci_V_0_0_1.py
class Ogrenci: def ortalama(self): pass def __init__(self, numara, isim, soyisim, vize, final): self.numara = numara self.isim = isim self.soyisim = soyisim self.vize = vize self.final = final class Sinif: def ogrenci_ekle(self): ogrenciler = [] ...
{"/Gun_5/tekrar.py": ["/Gun_5/zar_atma_fonksiyonel.py"]}
86,952
kadirturan0/PythonKampi
refs/heads/master
/Gun_2/fonksiyonlar.py
def yazdir_soz(): print("Merhaba Dünya") print("Merhaba Mars") def iki_defa_yazdir(): yazdir_soz() yazdir_soz() #iki_defa_yazdir() def dondur_soz(): return "Merhaba Dünya" def yazdir(soz): print(soz) yazdir(dondur_soz()) def iki_yazdir(soz): print(soz) print(soz) #soz = dondur_soz(...
{"/Gun_5/tekrar.py": ["/Gun_5/zar_atma_fonksiyonel.py"]}
86,953
kadirturan0/PythonKampi
refs/heads/master
/Gun_2/ornek_kayit_programi_v_0_0_2.py
ogrenciler = { '1': {'vize': 80, "final": 90}, '2': {'vize': 60, "final": 100} } def ogrenci_ekle(): tmp_sayac = 0 while tmp_sayac != 4: ogr_no = input("Öğrenci No Giriniz:") tmp_sayac += 1 if tmp_sayac == 4: print("Deneme hakkınızı doldur...
{"/Gun_5/tekrar.py": ["/Gun_5/zar_atma_fonksiyonel.py"]}
86,954
kadirturan0/PythonKampi
refs/heads/master
/Gun_2/ornek_kayit_programi_v_0_0_1.py
#Kullanıcıya ne yapılması gerektiğini sor # 1) Öğrenci Ekle # 2) Öğrenci Sil # 3) Öğrencileri Görüntüle # 4) Çıkış #Öğrenci eklemek isteniyorsa #Öğrenci ismi, vize, final bilgilerini al #Sözlüğe ekle #Tekrar ana menüye döndür. #Öğrenci silmek isteniyorsa #Öğrencinin varlığını k...
{"/Gun_5/tekrar.py": ["/Gun_5/zar_atma_fonksiyonel.py"]}
86,955
kadirturan0/PythonKampi
refs/heads/master
/Gun_8/ornek_uyelik_sistemi_v_2.py
lass Kullanici: def _init_(self, k_adi, parola, eposta, isim, soyisim, veritabani = "ogrenciler.txt"): self.k_adi = k_adi self.parola = parola self.eposta = eposta self.isim = isim self.soyisim = soyisim if not self.varlik_kontrolu(self.k_adi): with open(v...
{"/Gun_5/tekrar.py": ["/Gun_5/zar_atma_fonksiyonel.py"]}
86,956
kadirturan0/PythonKampi
refs/heads/master
/Gun_10/web_kutuphanesi.py
from pprint import pprint import urllib.request with urllib.request.urlopen('https://www.kadirblog.com/') pprint(response.read())
{"/Gun_5/tekrar.py": ["/Gun_5/zar_atma_fonksiyonel.py"]}
86,957
kadirturan0/PythonKampi
refs/heads/master
/Gun_1/integer.py
x = 5 y = 10 print(x+y) #Toplar sonucu verir. a = "5" b = "10" print(x+y) # Birleştirir. c = 5.3 #Float değeri d = 2 print(c*d) print(type(c*d)) # İşlem sonucunun tipini verir. e = 5 f = 2 g = e/f print(g) #Sonuç float değer verir. print(type(g))
{"/Gun_5/tekrar.py": ["/Gun_5/zar_atma_fonksiyonel.py"]}
86,958
kadirturan0/PythonKampi
refs/heads/master
/Gun_9/requests.py
import requests api_token = 'VP6nq68wfKCWH4GtJQ1hN4l5aSCV3mFk' api_url_base = 'https://api.digitalocean.com/v2/'
{"/Gun_5/tekrar.py": ["/Gun_5/zar_atma_fonksiyonel.py"]}
86,959
kadirturan0/PythonKampi
refs/heads/master
/Gun_4/Genel_Tekrar.py
# # Print fonksiyonu ve özellikleri # print("Merhaba Bolu") # yuz_olcumu = "200" # tevellut = "1990" # print("Bizim köyün yüz ölçümü " + yuz_olcumu + " tevellutu " + tevellut) # print("bizim köyün yüz ölçümü {} tevellutu {}".format(yuz_olcumu,tevellut)) # print("Bizim köyün yüz ölçümü {yo} tevellutu {tv}".format(yo=yuz...
{"/Gun_5/tekrar.py": ["/Gun_5/zar_atma_fonksiyonel.py"]}
86,960
kadirturan0/PythonKampi
refs/heads/master
/Gun_5/ornek_uzaklik.py
import math # def uzaklik(x1,x2,y1,y2): # # formul = math.sqrt(pow(x2-x1,2) + pow(y2-y1,2)) # print(formul) # # uzaklik() # x1,x2,x3,x4 import math def uzaklik2(*args): x1,x2,y1,y2 = args formul = math.sqrt((pow(x2-x1,2) + pow(y2-y1,2))) print(formul) uzaklik2(3,6,3,6)
{"/Gun_5/tekrar.py": ["/Gun_5/zar_atma_fonksiyonel.py"]}
86,961
kadirturan0/PythonKampi
refs/heads/master
/Gun_5/ornek_sayiyi_yaziya_cevir_2.py
birler = ["sıfır","bir","iki","üç","dört","beş","altı","yedi","sekiz","dokuz"] onlar = ["on","yirmi","otuz","kırk","elli","altmış","yetmiş","seksen","doksan"] sayi = "123" sayi = sayi[::-1] okunus = [] okunus.append(birler[int(sayi[0])]) if len(sayi) >= 2: okunus.append(onlar[int(sayi[1])]) if len(sayi) >= 3: ...
{"/Gun_5/tekrar.py": ["/Gun_5/zar_atma_fonksiyonel.py"]}
86,962
kadirturan0/PythonKampi
refs/heads/master
/Gun_1/string.py
test_degiskeni = "Bu bir test değişkenidir" print(test_degiskeni.upper()) #String değerlerini büyük harf yapar. print(test_degiskeni.lower()) #String değerlerini küçük harf yapar. print(test_degiskeni.capitalize()) #String değerinin ilk karakterini büyük harf yapar. print(test_degiskeni.split()) #String değerindeki bo...
{"/Gun_5/tekrar.py": ["/Gun_5/zar_atma_fonksiyonel.py"]}
86,963
kadirturan0/PythonKampi
refs/heads/master
/Gun_5/ornek_sayiyi_yaziya_cevir_3.py
dizi = [ [None,"bir","iki","üç","dört","beş","altı","yedi","sekiz","dokuz"], [None,"on","yirmi","otuz","kırk","elli","altmış","yetmiş","seksen","doksan"]] sayi = "38" sayi = sayi[::-1] okunus = [] for i,s in enumerate(sayi): print(i,s) okunus.append(dizi[i][int(s)]) print(" ".join(reversed(okunus))) p...
{"/Gun_5/tekrar.py": ["/Gun_5/zar_atma_fonksiyonel.py"]}
86,964
kadirturan0/PythonKampi
refs/heads/master
/Gun_6/siniflar_2.py
class Ogrenci(object): def __init__(self,isim,soyisim,numara,anne_adi,baba_adi): self.isim= isim self.soyisim = soyisim self.numara = numara self.__anne_adi = anne_adi self.__baba_adi = baba_adi def ogrenci_goruntule(self): print("N:{} İ:{} S:{}".format( ...
{"/Gun_5/tekrar.py": ["/Gun_5/zar_atma_fonksiyonel.py"]}
86,965
kadirturan0/PythonKampi
refs/heads/master
/Gun_3/ornek_kayit_programi_v_0_0_4.py
# Öğrenci kayit işlemi # Öğrenci silme # Öğrencileri görüntüle # Öğrencileri temizleme def ogr_kayit(): print("Öğrenci Kayıt İşlemi") ogr_no = input("Öğrenci numarasını giriniz:") dosya.txt = open('veritabani.txt', 'w') dosya.txt.write("{}".format(ogr_no)) dosya.txt.close() ogr_adi = input(...
{"/Gun_5/tekrar.py": ["/Gun_5/zar_atma_fonksiyonel.py"]}
86,966
kadirturan0/PythonKampi
refs/heads/master
/Gun_5/ornek_alan_hesaplama.py
import math def hesapla(): y = int(input("Dairenin yarıcapını giriniz:")) cevre = (2*(math.pi)*y) print(cevre) alan = (math.pi*pow(y,2)) print(alan) hesapla()
{"/Gun_5/tekrar.py": ["/Gun_5/zar_atma_fonksiyonel.py"]}
86,967
kadirturan0/PythonKampi
refs/heads/master
/Gun_10/g_s_h_d.py
class Sinif: ornek = 'degeri' def __init__(self): self.ornek = 'degeri' print(Sinif.__dict__) guncel = setattr(Sinif,'ornek','degeri') print(guncel,Sinif.ornek) resp = getattr(Sinif,'ornek') print(resp) resp_2 = hasattr(Sinif,'baska') print(resp_2) delattr(Sinif,'ornek')
{"/Gun_5/tekrar.py": ["/Gun_5/zar_atma_fonksiyonel.py"]}
86,968
kadirturan0/PythonKampi
refs/heads/master
/Gun_10/get_pos_islemleri.py
from requests import get, post, put, delete, patch from pprint import pprint from json import dumps class ReqresApi: def __init__(self): self.url = "https://reqres.in/api/users" def kullanicilari_listele(self): resp = get(self.url) if resp.status_code==HTTPStatus.OK: retur...
{"/Gun_5/tekrar.py": ["/Gun_5/zar_atma_fonksiyonel.py"]}
86,969
kadirturan0/PythonKampi
refs/heads/master
/Gun_7/Class.py
class Canli: def __init__(self, enerji): self.enerji = enerji def iletisim(self): pass class Hayvan(Canli): def __init__(self,enerji,tur): self.enerji=enerji self.tur = tur super(Hayvan, self).__init__(enerji) def yemek_yer(self): return 'Besin tüketiliy...
{"/Gun_5/tekrar.py": ["/Gun_5/zar_atma_fonksiyonel.py"]}
86,970
kadirturan0/PythonKampi
refs/heads/master
/Gun_3/ornek_kayit_programi_v_0_0_3.py
ogrenciler = { '1': {'vize': 80, "final": 90}, '2': {'vize': 60, "final": 100} } try: dosya = open('ogrenciler.txt','a+') except Exception: dosya = open('ogrenciler.txt', 'x') for ogr_not,notlar in ogrenciler.items(): dosya.write("{} numaralı öğrenci vizesi: {} finali {}\n...
{"/Gun_5/tekrar.py": ["/Gun_5/zar_atma_fonksiyonel.py"]}
86,971
kadirturan0/PythonKampi
refs/heads/master
/Gun_6/ornek_Ogrenci_V_0_0_2.py
class Ogrenci: def __init__(self,isim, soyisim, numara, vize, final): self.isim = isim self.soyisim = soyisim self.numara = numara self.vize = vize self.final = final def goruntule(self): print(f"Ögrenci İsmi: {self.isim}\n" f"Öğrenci Numarası: {sel...
{"/Gun_5/tekrar.py": ["/Gun_5/zar_atma_fonksiyonel.py"]}
86,972
kadirturan0/PythonKampi
refs/heads/master
/Gun_10/kadirblog_istek_listesi.py
import requests import json def istek(): r = requests.get('https://reqres.in/api/users', allow_redirects=False) bilgi = {"page": 2} response_get = requests.get(r, params=bilgi) print(r.status_code) istek()
{"/Gun_5/tekrar.py": ["/Gun_5/zar_atma_fonksiyonel.py"]}
86,973
kadirturan0/PythonKampi
refs/heads/master
/Gun_9/js_obj_not.py
#JSON Anlatılacaktır. import json from pprint import pprint kullanıcilar = { "excelibur_13":{ "isim":"Sezer", "soyisim":"Bozkir", "eposta": "admin@sezerbozkir.com", "parola": "123" }, "excelibur_14": { "isim": "Elif", "soyisim": "türk", "eposta": "eli...
{"/Gun_5/tekrar.py": ["/Gun_5/zar_atma_fonksiyonel.py"]}
86,974
kadirturan0/PythonKampi
refs/heads/master
/Gun_2/while.py
sayac = 0 while True: sayac +=1 print("Sonsuza dek çalış") if sayac == 10: break #Döngüyü bitiriyor. sayac = 0 while True: sayac +=1 if sayac == 100: break if sayac % 2 ==0: continue print(sayac)
{"/Gun_5/tekrar.py": ["/Gun_5/zar_atma_fonksiyonel.py"]}
86,975
kadirturan0/PythonKampi
refs/heads/master
/Gun_9/main.py
import sys from pprint import pprint class ConsoleProgram: def __init__(self): self.main_choice="" self.choices_list = ["1","2","3","4"] def Main_page(self): print("Hoşgeldiniz") print("1. Kayıtları göster") print("2. Ekle") print("3. Güncelle") print(...
{"/Gun_5/tekrar.py": ["/Gun_5/zar_atma_fonksiyonel.py"]}
86,976
kadirturan0/PythonKampi
refs/heads/master
/Gun_7/ornek_siniflar.py
#Doum günümüze kaç gün kaç ay kaldığını hesaplayan program class Zaman_Sorusu(): def kalan_gun(self): pass def yas(self): pass b_gun = 28 b_ay = 8 b_yil = 2018 if __name__ == '__main__': dogum_gunu = input("Doğum Günü: ") dogum_ayi = input("Doğum Ayı: ") dogum_yili =...
{"/Gun_5/tekrar.py": ["/Gun_5/zar_atma_fonksiyonel.py"]}
86,977
kadirturan0/PythonKampi
refs/heads/master
/Gun_5/zar_atma_fonksiyonel.py
import random from random import randint def tahmin_sonucu(tahmin): gelen_zar = randint(1,6) print(f"Kandırmıyorum{gelen_zar}") return True if randint(1,6) == tahmin else False def main(): puan = 0 print("ZAR OYUNU") while True: tahmini= int(input("Lütfen tahmininizi giriniz:")) ...
{"/Gun_5/tekrar.py": ["/Gun_5/zar_atma_fonksiyonel.py"]}
86,978
kadirturan0/PythonKampi
refs/heads/master
/Gun_8/ornek_uyelik_sistemi.py
class Uyelik_Sistemi: def __init__(self,k_adi,parola,eposta,isim,soyisim): self.k_adi = k_adi self.parola = parola self.eposta = eposta self.isim = isim self.soyisim = soyisim def uye_ekle(self): uye_bilgi = open('uye_bilgileri.txt', 'a+') veriler = [] ...
{"/Gun_5/tekrar.py": ["/Gun_5/zar_atma_fonksiyonel.py"]}
86,979
kadirturan0/PythonKampi
refs/heads/master
/Gun_7/ornek_zaman_farkini_bul.py
class Zaman: def __init__(self, tarih): self.gun, self.ay, self.yil = map(int, tarih.split('/')) def __str__(self): return "{gun} / {ay} / {yil} ".format(**self.__dict__) def __sub__(self, other): return self.yil-other.yil def kalan_zaman(self,other): pass if __n...
{"/Gun_5/tekrar.py": ["/Gun_5/zar_atma_fonksiyonel.py"]}
86,980
kadirturan0/PythonKampi
refs/heads/master
/Gun_3/dosya_islemleri.py
dosya = open('dosya.txt.txt') #print(dosya.txt.read()) #Dosyayı okuma aişlevi görür. #print(dosya.txt.read()) #Dosya bir kez okunabiliyor. Tekrar okunması için farklı bir değişkene atanması gerekiyor. #icerik=dosya.txt.read() #print(icerik) satirlar = dosya.readline() #Dosyanın sadece ilk satırını okur. satirlar2 = do...
{"/Gun_5/tekrar.py": ["/Gun_5/zar_atma_fonksiyonel.py"]}
86,981
kadirturan0/PythonKampi
refs/heads/master
/Gun_5/ornek_sayiyi_yaziya_cevir.py
def sayi_yazdir(say): birler = ["sıfır","bir","iki","üç","dört","beş","altı","yedi","sekiz","dokuz"] onlar = ["on","yirmi","otuz","kırk","elli","altmış","yetmiş","seksen","doksan"] basamak_degeri = len(say) if basamak_degeri ==1: print(birler[int(say)]) elif basamak_degeri==2: if sa...
{"/Gun_5/tekrar.py": ["/Gun_5/zar_atma_fonksiyonel.py"]}
86,982
kadirturan0/PythonKampi
refs/heads/master
/Gun_4/kumeler.py
demet = ('a','b','c') #Değiştirilemez dizi = ['a','b','c'] #Değiştirilebilir kume = {'a','b','c','a'} #Her eleman en fazla bir kez bulunabilir. print(demet) print(dizi) print(kume) print(set(dizi)) sehir = 'ankara' sehir2 = 'istanbul' print(set(sehir)) sehir2_kume = set(sehir2) birlesik_kume = sehir2_kume.union(seh...
{"/Gun_5/tekrar.py": ["/Gun_5/zar_atma_fonksiyonel.py"]}
86,983
kadirturan0/PythonKampi
refs/heads/master
/Gun_9/csv_veri.py
import csv file_path = "data.csv" with open(file_path) as f: satirlar = csv.reader(f, deliiter=",") for row in satirlar
{"/Gun_5/tekrar.py": ["/Gun_5/zar_atma_fonksiyonel.py"]}
86,984
kadirturan0/PythonKampi
refs/heads/master
/Gun_9/ornek_rehber_uygulamasi.py
import json from pprint import pprint class Rehber: rehber_bilgileri = {} def bilgiler(self,adi,soyadi,numarasi): self.adi=adi self.soyadi=soyadi self.numarasi=numarasi def bilgi_yaz(self): self.adi = input("Ad: ") self.soyadi = input("Soyad: ") self.num...
{"/Gun_5/tekrar.py": ["/Gun_5/zar_atma_fonksiyonel.py"]}
86,985
kadirturan0/PythonKampi
refs/heads/master
/Gun_1/sozluk.py
sozluk = { 'one': 'bir', 'two':[2,10,3,1] } print(sozluk.get('two')) #Sözlükten ilgili kelimenin karşılığını gösterir. sozluk['one'] = 1 print(sozluk) sozluk.update({'two':2}) #Demeti güncellemenizi sağlar. sozluk.update({'three':3}) #Demeti güncellemenizi sağlar. print(sozluk) sozluk['four'] = 4 #Demete ek...
{"/Gun_5/tekrar.py": ["/Gun_5/zar_atma_fonksiyonel.py"]}
86,986
kadirturan0/PythonKampi
refs/heads/master
/Gun_2/for_ornek.py
vize_final_notlari = {} for i in range(2): ogrenci_ismi = input('Öğrenci İsmi:') vize_notu = int(input('Vize Notu:')) final_notu = int(input('Final Notu:')) ortalama = (vize_notu * 0.4 + final_notu * 0.6) print(ortalama) vize_final_notlari.update({ogrenci_ismi:{ 'vize':vize_notu, ...
{"/Gun_5/tekrar.py": ["/Gun_5/zar_atma_fonksiyonel.py"]}
86,987
kadirturan0/PythonKampi
refs/heads/master
/Gun_6/siniflar_1.py
class Motorsiklet(object): def __init__(self,lastik): self.lastik = lastik def gosterge(self): print(self.lastik) def get_lastik(self): return self.lastik def set_lastik(self,lastik): self.lastik = lastik sezer_hocanin_chopperi = Motorsiklet(2) sezer_hocanin_chopperi....
{"/Gun_5/tekrar.py": ["/Gun_5/zar_atma_fonksiyonel.py"]}
86,988
kadirturan0/PythonKampi
refs/heads/master
/Gun_5/ornek.py
def rakam(): rakam = ["0,""1","2","3","4","5","6","7","8","9"] birler = ["sıfır", "bir", "iki", "üç", "dört", "beş", "altı", "yedi", "sekiz", "dokuz"] sayi = input("Lütfen sayiyi giriniz:") sayi_degeri = len(sayi) if sayi_degeri == 1: if sayi ==rakam[]: print(birler[]) r...
{"/Gun_5/tekrar.py": ["/Gun_5/zar_atma_fonksiyonel.py"]}
86,989
kadirturan0/PythonKampi
refs/heads/master
/Gun_1/donusumler.py
x = "5" y = 2 z = int(x)/y # int(x) işlemi x değerini integer değerine dönüştürür. print(z) dogru = True yanlis = False print(dogru == False)
{"/Gun_5/tekrar.py": ["/Gun_5/zar_atma_fonksiyonel.py"]}
86,990
kadirturan0/PythonKampi
refs/heads/master
/Gun_5/tekrar.py
from Gun_5.zar_atma_fonksiyonel import tahmin_sonucu # Başka bir sayfadan fonksiyon çağırmaya yarar tahmin_sonucu()
{"/Gun_5/tekrar.py": ["/Gun_5/zar_atma_fonksiyonel.py"]}
86,991
kadirturan0/PythonKampi
refs/heads/master
/Gun_5/Matematik _Kutuphanesi.py
import math sayilar = (1,4,6,2,8,8,3,6) topla = math.fsum(sayilar) print(topla) print(math.log10(20)) print(math.cos(30)) print(math.pi[20])
{"/Gun_5/tekrar.py": ["/Gun_5/zar_atma_fonksiyonel.py"]}
86,992
kadirturan0/PythonKampi
refs/heads/master
/Gun_10/istek_kutuphanesi.py
import requests #pip install requests #sudo apt install python3-requests url = "https://sezerbozkir.com/" bilgi = {"page": 1, "rows":10} #GET ile istek response_get = requests.get(url,params=bilgi) #POST ile istek response_post = requests.post(url, data=bilgi) ##status print(response_post.status_code) print(respo...
{"/Gun_5/tekrar.py": ["/Gun_5/zar_atma_fonksiyonel.py"]}
86,993
kadirturan0/PythonKampi
refs/heads/master
/Gun_6/m_f_l_r.py
# def carpma(say,say2): # return say *say2 # # # # a = lambda say,say2:say*say2 #Yukarıdaki kod ile aynı işlevi görür. # print(a(10,15)) # # b = lambda deger:deger #Fonksiyon kullanmak yerine lambda kullanmak bazen daha cazip gelebilir. # print(b("Örnek")) # # def sayi_dondur(): # for say in range(1,10): # ...
{"/Gun_5/tekrar.py": ["/Gun_5/zar_atma_fonksiyonel.py"]}
86,994
kadirturan0/PythonKampi
refs/heads/master
/Gun_1/demetler.py
demet = (1,5,1,20) #Demetler ekleme ve çıkarma gibi işlemleri yapılmaz. print(dir(demet))
{"/Gun_5/tekrar.py": ["/Gun_5/zar_atma_fonksiyonel.py"]}
86,995
kadirturan0/PythonKampi
refs/heads/master
/Gun_1/Tekrar.py
ornek = "Bugün hava çok güzel" ornek2 = "Bugün Perşembe" ozel_sayim = 13 print(ornek.capitalize()) #İlk harfi büyük yapar. print(ornek.upper()) #Tümünü büyük yapar. print("Bugü hava çok güzel" + ornek) print("Bugün hava çok güzel: {}".format(ornek)) print("Bugün hava çok güzel:",ornek,ornek2, ozel_sayim) print(ozel_say...
{"/Gun_5/tekrar.py": ["/Gun_5/zar_atma_fonksiyonel.py"]}
86,996
kadirturan0/PythonKampi
refs/heads/master
/Gun_9/crud.py
import json import os import uuid class User: def __init__(self,isim,soyisim, numara): self.isim=isim self.soyisim=soyisim self.numara=numara class DatabaseMethods: def __init__(self): self.path= "database.json" self.Create_Database_If_Not_Exists() def Create_Dat...
{"/Gun_5/tekrar.py": ["/Gun_5/zar_atma_fonksiyonel.py"]}
86,997
kadirturan0/PythonKampi
refs/heads/master
/Gun_1/listeler.py
liste = [1, 2, 3, 4, 5, 7] print(liste) liste.append("armut") #Listenin sonuna eleman ekler. liste.insert(0, "elma") #Listenin başına eleman ekler. print(liste[2]) #Listenin 3.elemanını gösterir. Listelerde elemanlar sıfırdan başlar. liste.pop() #Listeden son elemanı almanızı sağlar. cikarilan =liste.pop() print(...
{"/Gun_5/tekrar.py": ["/Gun_5/zar_atma_fonksiyonel.py"]}
86,998
kadirturan0/PythonKampi
refs/heads/master
/Gun_5/ornek_zar_atma.py
import random def zar(): while True: puan=0 tahmin = int(input("Birinci zar tahmini:")) tahmin2 = int(input("İkinci zar tahmini:")) print("Çıkmak için x yazarak enter tuşuna basınız") x = random.randint(0,6) y = random.randint(0, 6) print(x,y) if ta...
{"/Gun_5/tekrar.py": ["/Gun_5/zar_atma_fonksiyonel.py"]}
86,999
kadirturan0/PythonKampi
refs/heads/master
/Gun_2/Tekrar.py
# # # def us_alma(deger_1, deger_2): # sonuc = deger_1**deger_2 # print("Sonuç:{}".format(sonuc)) # return sonuc # # try: # deger1 = input("Lütfen ilk değeri giriniz") # deger2 = input("Lütfen ikinci değeri giriniz") # sonucu = us_alma(deger1,deger2) # except ValueError as e: # print(e) # ...
{"/Gun_5/tekrar.py": ["/Gun_5/zar_atma_fonksiyonel.py"]}
87,000
kadirturan0/PythonKampi
refs/heads/master
/Gun_4/dosya.py
dosya_oku = open('dosya.txt','r')
{"/Gun_5/tekrar.py": ["/Gun_5/zar_atma_fonksiyonel.py"]}
87,075
gabriel-q-wang/Unsupervised-Image-Classification
refs/heads/master
/losses/supervised_loss.py
import numpy as np import os import sys curr_path = os.path.dirname(os.path.abspath(__file__)) sys.path.append(curr_path) sys.path.append(os.path.dirname(curr_path)) import torch import torch.nn as nn import torch.nn.functional as F from base_loss import BaseLoss class SupervisedLoss(BaseLoss): def __init__(self,...
{"/losses/__init__.py": ["/losses/base_loss.py", "/losses/supervised_loss.py"], "/networks/__init__.py": ["/networks/resnet.py", "/networks/alexnet.py"], "/inference.py": ["/model.py", "/custom_dataset.py"], "/model.py": ["/utils.py", "/networks/__init__.py", "/losses/__init__.py", "/custom_dataset.py"]}
87,076
gabriel-q-wang/Unsupervised-Image-Classification
refs/heads/master
/networks/resnet.py
import torch import torch.nn as nn import torchvision.models as models import torch.utils.model_zoo as model_zoo def resnet(num_layers, num_classes, pretrained=False): """ Link to pytorch resnet implementation: https://github.com/pytorch/vision/blob/master/torchvision/models/resnet.py Args: num_la...
{"/losses/__init__.py": ["/losses/base_loss.py", "/losses/supervised_loss.py"], "/networks/__init__.py": ["/networks/resnet.py", "/networks/alexnet.py"], "/inference.py": ["/model.py", "/custom_dataset.py"], "/model.py": ["/utils.py", "/networks/__init__.py", "/losses/__init__.py", "/custom_dataset.py"]}
87,077
gabriel-q-wang/Unsupervised-Image-Classification
refs/heads/master
/utils.py
import os import random import numpy as np import cv2 import matplotlib.pyplot as plt import json import re import yaml loader = yaml.SafeLoader # redefine regex for yaml loader so scientific-notation is read as floating-point loader.add_implicit_resolver( u'tag:yaml.org,2002:float', re.compile(u'''^(?: [...
{"/losses/__init__.py": ["/losses/base_loss.py", "/losses/supervised_loss.py"], "/networks/__init__.py": ["/networks/resnet.py", "/networks/alexnet.py"], "/inference.py": ["/model.py", "/custom_dataset.py"], "/model.py": ["/utils.py", "/networks/__init__.py", "/losses/__init__.py", "/custom_dataset.py"]}
87,078
gabriel-q-wang/Unsupervised-Image-Classification
refs/heads/master
/losses/__init__.py
from .base_loss import BaseLoss from .supervised_loss import SupervisedLoss
{"/losses/__init__.py": ["/losses/base_loss.py", "/losses/supervised_loss.py"], "/networks/__init__.py": ["/networks/resnet.py", "/networks/alexnet.py"], "/inference.py": ["/model.py", "/custom_dataset.py"], "/model.py": ["/utils.py", "/networks/__init__.py", "/losses/__init__.py", "/custom_dataset.py"]}
87,079
gabriel-q-wang/Unsupervised-Image-Classification
refs/heads/master
/networks/__init__.py
from .resnet import resnet from .alexnet import alexnet
{"/losses/__init__.py": ["/losses/base_loss.py", "/losses/supervised_loss.py"], "/networks/__init__.py": ["/networks/resnet.py", "/networks/alexnet.py"], "/inference.py": ["/model.py", "/custom_dataset.py"], "/model.py": ["/utils.py", "/networks/__init__.py", "/losses/__init__.py", "/custom_dataset.py"]}
87,080
gabriel-q-wang/Unsupervised-Image-Classification
refs/heads/master
/inference.py
import torch import numpy as np import os import matplotlib.pyplot as plt import glob import cv2 from model import Model from custom_dataset import * if __name__ == "__main__": yaml_path = "configs/infer_config.yaml" model = Model(yaml_path) model.inference()
{"/losses/__init__.py": ["/losses/base_loss.py", "/losses/supervised_loss.py"], "/networks/__init__.py": ["/networks/resnet.py", "/networks/alexnet.py"], "/inference.py": ["/model.py", "/custom_dataset.py"], "/model.py": ["/utils.py", "/networks/__init__.py", "/losses/__init__.py", "/custom_dataset.py"]}
87,081
gabriel-q-wang/Unsupervised-Image-Classification
refs/heads/master
/custom_dataset.py
import torch import numpy as np import torch.nn as nn from PIL import Image from scipy import ndimage, misc import matplotlib.pyplot as plt import torchvision.transforms as TF from torchvision.datasets import CIFAR10 from torchvision.transforms import ToPILImage from typing import Any, Callable, Optional, Tuple # Need...
{"/losses/__init__.py": ["/losses/base_loss.py", "/losses/supervised_loss.py"], "/networks/__init__.py": ["/networks/resnet.py", "/networks/alexnet.py"], "/inference.py": ["/model.py", "/custom_dataset.py"], "/model.py": ["/utils.py", "/networks/__init__.py", "/losses/__init__.py", "/custom_dataset.py"]}
87,082
gabriel-q-wang/Unsupervised-Image-Classification
refs/heads/master
/networks/alexnet.py
import torch import torch.nn as nn import torchvision.models as models # from torchvision.models.alexnet import AlexNet import torch.utils.model_zoo as model_zoo class AlexNet(nn.Module): def __init__(self, num_images: int = 3, num_classes: int = 1000) -> None: super(AlexNet, self).__init__() self...
{"/losses/__init__.py": ["/losses/base_loss.py", "/losses/supervised_loss.py"], "/networks/__init__.py": ["/networks/resnet.py", "/networks/alexnet.py"], "/inference.py": ["/model.py", "/custom_dataset.py"], "/model.py": ["/utils.py", "/networks/__init__.py", "/losses/__init__.py", "/custom_dataset.py"]}
87,083
gabriel-q-wang/Unsupervised-Image-Classification
refs/heads/master
/model.py
import numpy as np import matplotlib.pyplot as plt import cv2 import time import torch import torch.nn as nn import os import utils import networks from torch.utils.data import DataLoader import torch.nn.functional as F import torchvision import torchvision.transforms as TF from tensorboardX import SummaryWriter from l...
{"/losses/__init__.py": ["/losses/base_loss.py", "/losses/supervised_loss.py"], "/networks/__init__.py": ["/networks/resnet.py", "/networks/alexnet.py"], "/inference.py": ["/model.py", "/custom_dataset.py"], "/model.py": ["/utils.py", "/networks/__init__.py", "/losses/__init__.py", "/custom_dataset.py"]}
87,084
gabriel-q-wang/Unsupervised-Image-Classification
refs/heads/master
/losses/base_loss.py
import numpy as np import torch import torch.nn as nn import torch.nn.functional as F class BaseLoss(nn.Module): def __init__(self, config): super(BaseLoss, self).__init__() """ config is a dictionary containing all the parameters relevant to training """ self.config = conf...
{"/losses/__init__.py": ["/losses/base_loss.py", "/losses/supervised_loss.py"], "/networks/__init__.py": ["/networks/resnet.py", "/networks/alexnet.py"], "/inference.py": ["/model.py", "/custom_dataset.py"], "/model.py": ["/utils.py", "/networks/__init__.py", "/losses/__init__.py", "/custom_dataset.py"]}
87,109
chu604/pymps
refs/heads/master
/nsymmps/MPO.py
# -*- coding: utf-8 -*- # @Author: 1000787 # @Date: 2017-06-03 16:16:38 # @Last Modified by: 1000787 # @Last Modified time: 2018-03-07 17:23:53 from .DTensor import DTensor, contract, directSum, deparallelisationCompress, \ diag, fusion, svdCompress class MPO(list): """docstring for MPO""" def __init__(self, *a...
{"/nsymmps/MPO.py": ["/nsymmps/DTensor.py"], "/testmpslearn/mpslearn_cont_prob_learning_many.py": ["/mpslearn/core.py"], "/mpslearn/classifier.py": ["/mpslearn/core.py"], "/testmpslearn/mpslearn_mnist_less.py": ["/mpslearn/classifier.py"], "/nsymmps/measurement.py": ["/nsymmps/DTensor.py", "/nsymmps/update.py"], "/test...
87,110
chu604/pymps
refs/heads/master
/testmpslearn/mpslearn_cont_prob_learning_many.py
# -*- coding: utf-8 -*- """ Created on Sat Feb 10 06:03:41 2018 @author: dario """ import os, sys lib_path = os.path.abspath(os.path.join('..')) sys.path.insert(0, lib_path) #from mpslearn.classifier import mpsclassifier from mpslearn.kernellercont import mpskerneller from numpy import array, eye, ...
{"/nsymmps/MPO.py": ["/nsymmps/DTensor.py"], "/testmpslearn/mpslearn_cont_prob_learning_many.py": ["/mpslearn/core.py"], "/mpslearn/classifier.py": ["/mpslearn/core.py"], "/testmpslearn/mpslearn_mnist_less.py": ["/mpslearn/classifier.py"], "/nsymmps/measurement.py": ["/nsymmps/DTensor.py", "/nsymmps/update.py"], "/test...
87,111
chu604/pymps
refs/heads/master
/mpslearn/classifier.py
# -*- coding: utf-8 -*- # @Author: 1000787 # @Date: 2017-08-31 16:54:05 # @Last Modified by: guochu # @Last Modified time: 2018-01-13 11:52:19 from .core import simple_uniform_lattice, overlap, rvec2mps from .core import minimizeMPOOneSite, minimizeMPOTwoSite from numpy import eye class mpsclassifier: """docstrin...
{"/nsymmps/MPO.py": ["/nsymmps/DTensor.py"], "/testmpslearn/mpslearn_cont_prob_learning_many.py": ["/mpslearn/core.py"], "/mpslearn/classifier.py": ["/mpslearn/core.py"], "/testmpslearn/mpslearn_mnist_less.py": ["/mpslearn/classifier.py"], "/nsymmps/measurement.py": ["/nsymmps/DTensor.py", "/nsymmps/update.py"], "/test...
87,112
chu604/pymps
refs/heads/master
/testmpslearn/mpslearn_mnist_less.py
# -*- coding: utf-8 -*- # @Author: guochu # @Date: 2017-11-27 09:48:38 # @Last Modified by: guochu # @Last Modified time: 2017-11-30 15:48:54 import os, sys lib_path = os.path.abspath(os.path.join('..')) sys.path.insert(0, lib_path) from mpslearn.classifier import mpsclassifier from sklearn.datasets import load_di...
{"/nsymmps/MPO.py": ["/nsymmps/DTensor.py"], "/testmpslearn/mpslearn_cont_prob_learning_many.py": ["/mpslearn/core.py"], "/mpslearn/classifier.py": ["/mpslearn/core.py"], "/testmpslearn/mpslearn_mnist_less.py": ["/mpslearn/classifier.py"], "/nsymmps/measurement.py": ["/nsymmps/DTensor.py", "/nsymmps/update.py"], "/test...
87,113
chu604/pymps
refs/heads/master
/nsymmps/measurement.py
# -*- coding: utf-8 -*- # @Author: 1000787 # @Date: 2017-06-03 16:19:51 # @Last Modified by: 1000787 # @Last Modified time: 2018-03-07 17:03:28 from .DTensor import DTensor, contract, diag from .update import updateClefth1h2, updateCrighth1h2 from .update import updateCleftOpenh1h2, updateCrightOpenh1h2 from .upda...
{"/nsymmps/MPO.py": ["/nsymmps/DTensor.py"], "/testmpslearn/mpslearn_cont_prob_learning_many.py": ["/mpslearn/core.py"], "/mpslearn/classifier.py": ["/mpslearn/core.py"], "/testmpslearn/mpslearn_mnist_less.py": ["/mpslearn/classifier.py"], "/nsymmps/measurement.py": ["/nsymmps/DTensor.py", "/nsymmps/update.py"], "/test...
87,114
chu604/pymps
refs/heads/master
/testmpslearn/mpslearn_discrete_det_testing_many.py
# -*- coding: utf-8 -*- """ Created on Mon Feb 5 17:34:40 2018 @author: dario """ import os, sys lib_path = os.path.abspath(os.path.join('..')) sys.path.insert(0, lib_path) #from mpslearn.classifier import mpsclassifier from mpslearn.kerneller import mpskerneller from numpy import array, eye, ndarra...
{"/nsymmps/MPO.py": ["/nsymmps/DTensor.py"], "/testmpslearn/mpslearn_cont_prob_learning_many.py": ["/mpslearn/core.py"], "/mpslearn/classifier.py": ["/mpslearn/core.py"], "/testmpslearn/mpslearn_mnist_less.py": ["/mpslearn/classifier.py"], "/nsymmps/measurement.py": ["/nsymmps/DTensor.py", "/nsymmps/update.py"], "/test...
87,115
chu604/pymps
refs/heads/master
/nsymmps/update.py
# -*- coding: utf-8 -*- # @Author: 1000787 # @Date: 2017-05-30 15:25:38 # @Last Modified by: 1000787 # @Last Modified time: 2018-03-07 17:03:11 from .DTensor import DTensor, contract from numpy import zeros, sqrt # update heff from right using mpo def updateCright(hold, mpoj, mpsAj, mpsBj): Hnew = contract(mpsBj,...
{"/nsymmps/MPO.py": ["/nsymmps/DTensor.py"], "/testmpslearn/mpslearn_cont_prob_learning_many.py": ["/mpslearn/core.py"], "/mpslearn/classifier.py": ["/mpslearn/core.py"], "/testmpslearn/mpslearn_mnist_less.py": ["/mpslearn/classifier.py"], "/nsymmps/measurement.py": ["/nsymmps/DTensor.py", "/nsymmps/update.py"], "/test...
87,116
chu604/pymps
refs/heads/master
/nsymmps/MPS.py
from .DTensor import DTensor, contract, directSum, diag, svdCompress, qrCompress from .update import updateCrighth1h2, updateClefth1h2 from numpy import ones, sqrt, real, result_type, array from numpy.random import rand from scipy.linalg import norm from .reduceD import reduceDSingleSite class MPS(list): """docstring...
{"/nsymmps/MPO.py": ["/nsymmps/DTensor.py"], "/testmpslearn/mpslearn_cont_prob_learning_many.py": ["/mpslearn/core.py"], "/mpslearn/classifier.py": ["/mpslearn/core.py"], "/testmpslearn/mpslearn_mnist_less.py": ["/mpslearn/classifier.py"], "/nsymmps/measurement.py": ["/nsymmps/DTensor.py", "/nsymmps/update.py"], "/test...
87,117
chu604/pymps
refs/heads/master
/nsymmps/DTensor.py
# -*- coding: utf-8 -*- # @Author: 1000787 # @Date: 2017-07-18 20:23:35 # @Last Modified by: 1000787 # @Last Modified time: 2018-03-07 17:24:48 from numpy import result_type, kron, diag, ndarray from numpy import tensordot as contract from numpy import ndarray as DTensor from scipy.linalg import expm, svd, qr from ...
{"/nsymmps/MPO.py": ["/nsymmps/DTensor.py"], "/testmpslearn/mpslearn_cont_prob_learning_many.py": ["/mpslearn/core.py"], "/mpslearn/classifier.py": ["/mpslearn/core.py"], "/testmpslearn/mpslearn_mnist_less.py": ["/mpslearn/classifier.py"], "/nsymmps/measurement.py": ["/nsymmps/DTensor.py", "/nsymmps/update.py"], "/test...
87,118
chu604/pymps
refs/heads/master
/nsymmps/__init__.py
# -*- coding: utf-8 -*- # @Author: 1000787 # @Date: 2017-06-03 16:40:35 # @Last Modified by: 1000787 # @Last Modified time: 2018-03-07 17:01:16 from .MPO import MPO, createEmptyMPO from .MPS import MPS, createrandommps from .lattice import generateBosonOperator, generateSpinOperator, simple_uniform_lattice from .me...
{"/nsymmps/MPO.py": ["/nsymmps/DTensor.py"], "/testmpslearn/mpslearn_cont_prob_learning_many.py": ["/mpslearn/core.py"], "/mpslearn/classifier.py": ["/mpslearn/core.py"], "/testmpslearn/mpslearn_mnist_less.py": ["/mpslearn/classifier.py"], "/nsymmps/measurement.py": ["/nsymmps/DTensor.py", "/nsymmps/update.py"], "/test...
87,119
chu604/pymps
refs/heads/master
/mpslearn/kerneller.py
# -*- coding: utf-8 -*- # @Author: dario # @Date: 2017-12-12 10:08:05 # @Last Modified by: guochu # @Last Modified time: 2018-01-13 10:24:53 from .core import simple_uniform_lattice, overlap, dvec2mps, mps2dvec from .core import minimizeMPOOneSite, minimizeMPOTwoSite from numpy import eye from nsymmps.latt...
{"/nsymmps/MPO.py": ["/nsymmps/DTensor.py"], "/testmpslearn/mpslearn_cont_prob_learning_many.py": ["/mpslearn/core.py"], "/mpslearn/classifier.py": ["/mpslearn/core.py"], "/testmpslearn/mpslearn_mnist_less.py": ["/mpslearn/classifier.py"], "/nsymmps/measurement.py": ["/nsymmps/DTensor.py", "/nsymmps/update.py"], "/test...
87,120
chu604/pymps
refs/heads/master
/testmpslearn/mpslearn_mnist.py
# -*- coding: utf-8 -*- # @Author: guochu # @Date: 2017-11-21 09:41:34 # @Last Modified by: 1000787 # @Last Modified time: 2018-05-01 16:23:25 import os, sys lib_path = os.path.abspath(os.path.join('..')) sys.path.insert(0, lib_path) from mpslearn.classifier import mpsclassifier from sklearn.datasets import load_di...
{"/nsymmps/MPO.py": ["/nsymmps/DTensor.py"], "/testmpslearn/mpslearn_cont_prob_learning_many.py": ["/mpslearn/core.py"], "/mpslearn/classifier.py": ["/mpslearn/core.py"], "/testmpslearn/mpslearn_mnist_less.py": ["/mpslearn/classifier.py"], "/nsymmps/measurement.py": ["/nsymmps/DTensor.py", "/nsymmps/update.py"], "/test...
87,121
chu604/pymps
refs/heads/master
/nsymmps/lattice.py
# -*- coding: utf-8 -*- # @Author: 1000787 # @Date: 2017-06-03 16:22:43 # @Last Modified by: 1000787 # @Last Modified time: 2018-03-07 17:03:19 from .DTensor import DTensor, kron from numpy import ones, zeros, sqrt, array, ndarray from .MPO import MPO from .MPS import MPS def generateSpinOperator(): sx = array([[...
{"/nsymmps/MPO.py": ["/nsymmps/DTensor.py"], "/testmpslearn/mpslearn_cont_prob_learning_many.py": ["/mpslearn/core.py"], "/mpslearn/classifier.py": ["/mpslearn/core.py"], "/testmpslearn/mpslearn_mnist_less.py": ["/mpslearn/classifier.py"], "/nsymmps/measurement.py": ["/nsymmps/DTensor.py", "/nsymmps/update.py"], "/test...
87,122
chu604/pymps
refs/heads/master
/testmpslearn/mpslearn_cont_prob_testing.py
# -*- coding: utf-8 -*- """ Created on Sat Feb 10 06:33:47 2018 @author: dario """ import os, sys lib_path = os.path.abspath(os.path.join('..')) sys.path.insert(0, lib_path) #from mpslearn.classifier import mpsclassifier from mpslearn.kernellercont import mpskerneller from mpslearn.corecont im...
{"/nsymmps/MPO.py": ["/nsymmps/DTensor.py"], "/testmpslearn/mpslearn_cont_prob_learning_many.py": ["/mpslearn/core.py"], "/mpslearn/classifier.py": ["/mpslearn/core.py"], "/testmpslearn/mpslearn_mnist_less.py": ["/mpslearn/classifier.py"], "/nsymmps/measurement.py": ["/nsymmps/DTensor.py", "/nsymmps/update.py"], "/test...
87,123
chu604/pymps
refs/heads/master
/testmpslearn/mpslearn_discrete_det_learning_many.py
# -*- coding: utf-8 -*- """ Created on Tue Feb 6 22:06:25 2018 @author: dario """ import os, sys lib_path = os.path.abspath(os.path.join('..')) sys.path.insert(0, lib_path) #from mpslearn.classifier import mpsclassifier from mpslearn.kerneller import mpskerneller from numpy import array, eye, ndarra...
{"/nsymmps/MPO.py": ["/nsymmps/DTensor.py"], "/testmpslearn/mpslearn_cont_prob_learning_many.py": ["/mpslearn/core.py"], "/mpslearn/classifier.py": ["/mpslearn/core.py"], "/testmpslearn/mpslearn_mnist_less.py": ["/mpslearn/classifier.py"], "/nsymmps/measurement.py": ["/nsymmps/DTensor.py", "/nsymmps/update.py"], "/test...
87,124
chu604/pymps
refs/heads/master
/nsymmps/reduceD.py
# -*- coding: utf-8 -*- # @Author: 1000787 # @Date: 2017-07-19 09:13:59 # @Last Modified by: 1000787 # @Last Modified time: 2018-03-07 17:04:43 from .DTensor import contract def reduceDSingleSite(A, Cleft, Cright): B = contract(Cleft, A, ((1,), (0,))) return contract(B, Cright, ((2,), (1,))) def reduceDSingleBo...
{"/nsymmps/MPO.py": ["/nsymmps/DTensor.py"], "/testmpslearn/mpslearn_cont_prob_learning_many.py": ["/mpslearn/core.py"], "/mpslearn/classifier.py": ["/mpslearn/core.py"], "/testmpslearn/mpslearn_mnist_less.py": ["/mpslearn/classifier.py"], "/nsymmps/measurement.py": ["/nsymmps/DTensor.py", "/nsymmps/update.py"], "/test...
87,125
chu604/pymps
refs/heads/master
/mpslearn/core.py
# -*- coding: utf-8 -*- # @Author: 1000787 # @Date: 2017-08-31 16:48:20 # @Last Modified by: 1000787 # @Last Modified time: 2018-03-07 17:02:09 import os, sys lib_path = os.path.abspath(os.path.join('..')) sys.path.insert(0, lib_path) from nsymmps.DTensor import contract, svdCompress, qrCompress, diag from nsymmps ...
{"/nsymmps/MPO.py": ["/nsymmps/DTensor.py"], "/testmpslearn/mpslearn_cont_prob_learning_many.py": ["/mpslearn/core.py"], "/mpslearn/classifier.py": ["/mpslearn/core.py"], "/testmpslearn/mpslearn_mnist_less.py": ["/mpslearn/classifier.py"], "/nsymmps/measurement.py": ["/nsymmps/DTensor.py", "/nsymmps/update.py"], "/test...
87,126
18335617295/tpshop
refs/heads/master
/page/login_page.py
from selenium.webdriver.common.by import By from base.base_action import BaseAction class LoginPage(BaseAction): username = By.XPATH, "//*[@text='请输入手机号码']" password = By.XPATH, "//*[@index='4']" login_button = By.XPATH, "//*[@index='7']" def input_username(self, text): self.input(self.usern...
{"/page/login_page.py": ["/base/base_action.py"], "/page/my_page.py": ["/base/base_action.py"], "/page/page.py": ["/page/login_page.py", "/page/my_page.py"], "/scripts/test_login.py": ["/base/find_toast.py", "/page/page.py"]}
87,127
18335617295/tpshop
refs/heads/master
/base/base_action.py
from selenium.webdriver.common.by import By from selenium.webdriver.support.wait import WebDriverWait class BaseAction: def __init__(self, driver): self.driver = driver def find_element(self, feature, timeout=10.0, poll=1.0): by = feature[0] value = feature[1] return WebDriv...
{"/page/login_page.py": ["/base/base_action.py"], "/page/my_page.py": ["/base/base_action.py"], "/page/page.py": ["/page/login_page.py", "/page/my_page.py"], "/scripts/test_login.py": ["/base/find_toast.py", "/page/page.py"]}
87,128
18335617295/tpshop
refs/heads/master
/page/my_page.py
from selenium.webdriver.common.by import By from base.base_action import BaseAction class MyPage(BaseAction): login_button = By.XPATH, "//*[@text='登录/注册']" def click_login_button(self): self.click(self.login_button)
{"/page/login_page.py": ["/base/base_action.py"], "/page/my_page.py": ["/base/base_action.py"], "/page/page.py": ["/page/login_page.py", "/page/my_page.py"], "/scripts/test_login.py": ["/base/find_toast.py", "/page/page.py"]}
87,129
18335617295/tpshop
refs/heads/master
/base/read_login_data.py
import yaml def read_login_data(key): with open("..\data\login_data.yaml", "r", encoding="utf-8") as f: data = yaml.load(f)[key] data_list = list() for i in data.values(): data_list.append(i) return data_list if __name__ == '__main__': read_login_data('test_login'...
{"/page/login_page.py": ["/base/base_action.py"], "/page/my_page.py": ["/base/base_action.py"], "/page/page.py": ["/page/login_page.py", "/page/my_page.py"], "/scripts/test_login.py": ["/base/find_toast.py", "/page/page.py"]}
87,130
18335617295/tpshop
refs/heads/master
/base/find_toast.py
from selenium.webdriver.common.by import By from selenium.webdriver.support.wait import WebDriverWait def find_toast(driver, message, timeout=3): """ # message: 预期要获取的toast的部分消息 """ message1 = "//*[contains(@text,'" + message + "')]" try: print(message1) WebDriverWait(driver, timeo...
{"/page/login_page.py": ["/base/base_action.py"], "/page/my_page.py": ["/base/base_action.py"], "/page/page.py": ["/page/login_page.py", "/page/my_page.py"], "/scripts/test_login.py": ["/base/find_toast.py", "/page/page.py"]}
87,131
18335617295/tpshop
refs/heads/master
/page/page.py
from page.home_page import HomePage from page.login_page import LoginPage from page.my_page import MyPage class Page(object): def __init__(self, driver): self.driver = driver @property def my_page(self): return MyPage(self.driver) @property def home_page(self): return Hom...
{"/page/login_page.py": ["/base/base_action.py"], "/page/my_page.py": ["/base/base_action.py"], "/page/page.py": ["/page/login_page.py", "/page/my_page.py"], "/scripts/test_login.py": ["/base/find_toast.py", "/page/page.py"]}
87,132
18335617295/tpshop
refs/heads/master
/scripts/test_login.py
import time import pytest from base.find_toast import find_toast from base.base_analyze import analyze_file from base.base_driver import init_driver from page.page import Page class TestLogin(): def setup(self): self.driver = init_driver() self.page = Page(self.driver) def teardown(self): ...
{"/page/login_page.py": ["/base/base_action.py"], "/page/my_page.py": ["/base/base_action.py"], "/page/page.py": ["/page/login_page.py", "/page/my_page.py"], "/scripts/test_login.py": ["/base/find_toast.py", "/page/page.py"]}
87,201
Nipserk/sphinxcontrib-needs
refs/heads/master
/tests/test_services/test_service_basics.py
from pathlib import Path from sphinx_testing import with_app from sphinxcontrib.needs.services.base import BaseService from sphinxcontrib.needs.services.manager import ServiceManager class TestService(BaseService): options = ["custom_option", "exists"] def __init__(self, app, name, config, **kwargs): ...
{"/tests/test_services/test_service_basics.py": ["/sphinxcontrib/needs/services/base.py", "/sphinxcontrib/needs/services/manager.py"], "/sphinxcontrib/needs/services/base.py": ["/sphinxcontrib/needs/logging.py"], "/sphinxcontrib/needs/directives/needservice.py": ["/sphinxcontrib/needs/api/__init__.py", "/sphinxcontrib/...
87,202
Nipserk/sphinxcontrib-needs
refs/heads/master
/sphinxcontrib/needs/services/base.py
from sphinxcontrib.needs.logging import get_logger class BaseService: def __init__(self, *args, **kwargs): self.log = get_logger(__name__) def request(self, *args, **kwargs): raise NotImplementedError("Must be implemented by the service!")
{"/tests/test_services/test_service_basics.py": ["/sphinxcontrib/needs/services/base.py", "/sphinxcontrib/needs/services/manager.py"], "/sphinxcontrib/needs/services/base.py": ["/sphinxcontrib/needs/logging.py"], "/sphinxcontrib/needs/directives/needservice.py": ["/sphinxcontrib/needs/api/__init__.py", "/sphinxcontrib/...
87,203
Nipserk/sphinxcontrib-needs
refs/heads/master
/tests/test_needs_warning.py
from sphinx_testing import with_app @with_app(buildername="html", srcdir="doc_test/doc_needs_warnings") # , warningiserror=True) def test_needs_warnings(app, status, warning): app.build() # stdout warnings warnings = warning.getvalue() # check multiple warning registration assert 'invalid_statu...
{"/tests/test_services/test_service_basics.py": ["/sphinxcontrib/needs/services/base.py", "/sphinxcontrib/needs/services/manager.py"], "/sphinxcontrib/needs/services/base.py": ["/sphinxcontrib/needs/logging.py"], "/sphinxcontrib/needs/directives/needservice.py": ["/sphinxcontrib/needs/api/__init__.py", "/sphinxcontrib/...
87,204
Nipserk/sphinxcontrib-needs
refs/heads/master
/tests/test_external.py
import json from pathlib import Path from sphinx_testing import with_app @with_app(buildername="html", srcdir="doc_test/external_doc") # , warningiserror=True) def test_external_html(app, status, warning): app.build() html = Path(app.outdir, "index.html").read_text() assert ( '<a class="external...
{"/tests/test_services/test_service_basics.py": ["/sphinxcontrib/needs/services/base.py", "/sphinxcontrib/needs/services/manager.py"], "/sphinxcontrib/needs/services/base.py": ["/sphinxcontrib/needs/logging.py"], "/sphinxcontrib/needs/directives/needservice.py": ["/sphinxcontrib/needs/api/__init__.py", "/sphinxcontrib/...
87,205
Nipserk/sphinxcontrib-needs
refs/heads/master
/tests/test_import.py
import json from pathlib import Path from sphinx_testing import with_app @with_app(buildername="html", srcdir="doc_test/import_doc") # , warningiserror=True) def test_import_json(app, status, warning): app.build() html = Path(app.outdir, "index.html").read_text() assert "TEST IMPORT TITLE" in html a...
{"/tests/test_services/test_service_basics.py": ["/sphinxcontrib/needs/services/base.py", "/sphinxcontrib/needs/services/manager.py"], "/sphinxcontrib/needs/services/base.py": ["/sphinxcontrib/needs/logging.py"], "/sphinxcontrib/needs/directives/needservice.py": ["/sphinxcontrib/needs/api/__init__.py", "/sphinxcontrib/...
87,206
Nipserk/sphinxcontrib-needs
refs/heads/master
/tests/test_official_doc.py
import json import re import uuid from pathlib import Path from random import randrange import responses import six from nose.tools import raises from sphinx_testing import with_app from sphinxcontrib.needs.api.need import NeedsNoIdException from tests.data.service_github import ( GITHUB_ISSUE_SEARCH_ANSWER, ...
{"/tests/test_services/test_service_basics.py": ["/sphinxcontrib/needs/services/base.py", "/sphinxcontrib/needs/services/manager.py"], "/sphinxcontrib/needs/services/base.py": ["/sphinxcontrib/needs/logging.py"], "/sphinxcontrib/needs/directives/needservice.py": ["/sphinxcontrib/needs/api/__init__.py", "/sphinxcontrib/...
87,207
Nipserk/sphinxcontrib-needs
refs/heads/master
/sphinxcontrib/needs/directives/needservice.py
from docutils import nodes from docutils.parsers.rst import Directive from sphinxcontrib.needs.api import add_need from sphinxcontrib.needs.directives.need import NeedDirective from sphinxcontrib.needs.logging import get_logger class Needservice(nodes.General, nodes.Element): pass class NeedserviceDirective(Di...
{"/tests/test_services/test_service_basics.py": ["/sphinxcontrib/needs/services/base.py", "/sphinxcontrib/needs/services/manager.py"], "/sphinxcontrib/needs/services/base.py": ["/sphinxcontrib/needs/logging.py"], "/sphinxcontrib/needs/directives/needservice.py": ["/sphinxcontrib/needs/api/__init__.py", "/sphinxcontrib/...
87,208
Nipserk/sphinxcontrib-needs
refs/heads/master
/sphinxcontrib/needs/directives/utils.py
import re from typing import Tuple from docutils import nodes from sphinxcontrib.needs.defaults import TITLE_REGEX def no_needs_found_paragraph(): nothing_found = "No needs passed the filters" para = nodes.paragraph() nothing_found_node = nodes.Text(nothing_found, nothing_found) para += nothing_foun...
{"/tests/test_services/test_service_basics.py": ["/sphinxcontrib/needs/services/base.py", "/sphinxcontrib/needs/services/manager.py"], "/sphinxcontrib/needs/services/base.py": ["/sphinxcontrib/needs/logging.py"], "/sphinxcontrib/needs/directives/needservice.py": ["/sphinxcontrib/needs/api/__init__.py", "/sphinxcontrib/...
87,209
Nipserk/sphinxcontrib-needs
refs/heads/master
/tests/test_dynamic_functions.py
import re from pathlib import Path from sphinx_testing import with_app @with_app(buildername="html", srcdir="doc_test/doc_dynamic_functions") def test_doc_dynamic_functions(app, status, warning): app.build() html = Path(app.outdir, "index.html").read_text() assert "This is id SP_TOO_001" in html ass...
{"/tests/test_services/test_service_basics.py": ["/sphinxcontrib/needs/services/base.py", "/sphinxcontrib/needs/services/manager.py"], "/sphinxcontrib/needs/services/base.py": ["/sphinxcontrib/needs/logging.py"], "/sphinxcontrib/needs/directives/needservice.py": ["/sphinxcontrib/needs/api/__init__.py", "/sphinxcontrib/...
87,210
Nipserk/sphinxcontrib-needs
refs/heads/master
/sphinxcontrib/needs/diagrams_common.py
""" Diagrams common module, which stores all class definitions and functions, which get reused in diagram related directive. E.g. needflow and needsequence. """ import html import re import textwrap from docutils import nodes from docutils.parsers.rst import Directive, directives from sphinxcontrib.needs.logging imp...
{"/tests/test_services/test_service_basics.py": ["/sphinxcontrib/needs/services/base.py", "/sphinxcontrib/needs/services/manager.py"], "/sphinxcontrib/needs/services/base.py": ["/sphinxcontrib/needs/logging.py"], "/sphinxcontrib/needs/directives/needservice.py": ["/sphinxcontrib/needs/api/__init__.py", "/sphinxcontrib/...
87,211
Nipserk/sphinxcontrib-needs
refs/heads/master
/tests/test_role_need_template.py
from pathlib import Path from sphinx_testing import with_app @with_app(buildername="html", srcdir="doc_test/doc_role_need_template") def test_doc_build_html(app, status, warning): app.build() html = Path(app.outdir, "index.html").read_text() assert "ROLE NEED TEMPLATE" in html assert ( "[SP_...
{"/tests/test_services/test_service_basics.py": ["/sphinxcontrib/needs/services/base.py", "/sphinxcontrib/needs/services/manager.py"], "/sphinxcontrib/needs/services/base.py": ["/sphinxcontrib/needs/logging.py"], "/sphinxcontrib/needs/directives/needservice.py": ["/sphinxcontrib/needs/api/__init__.py", "/sphinxcontrib/...
87,212
Nipserk/sphinxcontrib-needs
refs/heads/master
/sphinxcontrib/needs/logging.py
import sphinx from pkg_resources import parse_version sphinx_version = sphinx.__version__ if parse_version(sphinx_version) >= parse_version("1.6"): from sphinx.util import logging else: import logging logging.basicConfig() # Only need to do this once def get_logger(name): return logging.getLogger(n...
{"/tests/test_services/test_service_basics.py": ["/sphinxcontrib/needs/services/base.py", "/sphinxcontrib/needs/services/manager.py"], "/sphinxcontrib/needs/services/base.py": ["/sphinxcontrib/needs/logging.py"], "/sphinxcontrib/needs/directives/needservice.py": ["/sphinxcontrib/needs/api/__init__.py", "/sphinxcontrib/...
87,213
Nipserk/sphinxcontrib-needs
refs/heads/master
/tests/test_broken_tags.py
from pathlib import Path from nose.tools import raises from sphinx_testing import with_app from sphinxcontrib.needs.api.need import NeedsTagNotAllowed @raises(NeedsTagNotAllowed) @with_app(buildername="html", srcdir="doc_test/broken_tags") def test_doc_build_html(app, status, warning): app.build() html = Pa...
{"/tests/test_services/test_service_basics.py": ["/sphinxcontrib/needs/services/base.py", "/sphinxcontrib/needs/services/manager.py"], "/sphinxcontrib/needs/services/base.py": ["/sphinxcontrib/needs/logging.py"], "/sphinxcontrib/needs/directives/needservice.py": ["/sphinxcontrib/needs/api/__init__.py", "/sphinxcontrib/...
87,214
Nipserk/sphinxcontrib-needs
refs/heads/master
/tests/test_extra_links.py
from pathlib import Path from sphinx_testing import with_app @with_app(buildername="html", srcdir="doc_test/doc_extra_links") def test_extra_links_html(app, status, warning): app.build() html = Path(app.outdir, "index.html").read_text() assert "TEST_001" in html assert "tested by" in html assert ...
{"/tests/test_services/test_service_basics.py": ["/sphinxcontrib/needs/services/base.py", "/sphinxcontrib/needs/services/manager.py"], "/sphinxcontrib/needs/services/base.py": ["/sphinxcontrib/needs/logging.py"], "/sphinxcontrib/needs/directives/needservice.py": ["/sphinxcontrib/needs/api/__init__.py", "/sphinxcontrib/...
87,215
Nipserk/sphinxcontrib-needs
refs/heads/master
/sphinxcontrib/needs/api/__init__.py
# flake8: noqa from .configuration import ( add_dynamic_function, add_extra_option, add_need_type, get_need_types, ) from .need import add_external_need, add_need, make_hashed_id
{"/tests/test_services/test_service_basics.py": ["/sphinxcontrib/needs/services/base.py", "/sphinxcontrib/needs/services/manager.py"], "/sphinxcontrib/needs/services/base.py": ["/sphinxcontrib/needs/logging.py"], "/sphinxcontrib/needs/directives/needservice.py": ["/sphinxcontrib/needs/api/__init__.py", "/sphinxcontrib/...
87,216
Nipserk/sphinxcontrib-needs
refs/heads/master
/tests/test_needextend.py
from pathlib import Path from sphinx_testing import with_app @with_app(buildername="html", srcdir="doc_test/doc_needextend") def test_doc_needextend_html(app, status, warning): app.build() index_html = Path(app.outdir, "index.html").read_text() assert "extend_test_003" in index_html assert ( ...
{"/tests/test_services/test_service_basics.py": ["/sphinxcontrib/needs/services/base.py", "/sphinxcontrib/needs/services/manager.py"], "/sphinxcontrib/needs/services/base.py": ["/sphinxcontrib/needs/logging.py"], "/sphinxcontrib/needs/directives/needservice.py": ["/sphinxcontrib/needs/api/__init__.py", "/sphinxcontrib/...