index
int64
repo_name
string
branch_name
string
path
string
content
string
import_graph
string
16,763
red23495/random_util
refs/heads/master
/Python/Algebra/binary_exponentiation.py
def mod_pow(base, power, mod=None): """ Implements divide and conquere binary exponetiation algorithm Complexity: O(log power) source: https://cp-algorithms.com/algebra/binary-exp.html Params: @base: base number which needs to be multiplied @power: power to which base should be raised @...
{"/Python/Algebra/test/test_binary_exponentiation.py": ["/Python/Algebra/binary_exponentiation.py"]}
16,815
MydonSolutions/SNAPpyPackets
refs/heads/master
/send_udp.py
import socket from SNAPPacket import SNAPPacket import time channels = 256 def alternate(i, evenVal, oddVal): return evenVal if i%2==0 else oddVal def int8Comp4(i, realMul, realDiv, realBias, imagMul, imagDiv, imagBias): return alternate(i, (int((realMul*i)/realDiv) + realBias)%8, (int((imagMul*i)/imagDiv) +...
{"/send_udp.py": ["/SNAPPacket.py"], "/receive_udp.py": ["/SNAPPacket.py"]}
16,816
MydonSolutions/SNAPpyPackets
refs/heads/master
/receive_udp.py
#https://wiki.python.org/moin/UdpCommunication import socket from SNAPPacket import SNAPPacket UDP_IP = "0.0.0.0" UDP_PORT = 4015 sock = socket.socket(socket.AF_INET, # Internet socket.SOCK_DGRAM) # UDP sock.bind((UDP_IP, UDP_PORT)) while True: data, addr = sock.recvfrom(8192+16) # buffer s...
{"/send_udp.py": ["/SNAPPacket.py"], "/receive_udp.py": ["/SNAPPacket.py"]}
16,817
MydonSolutions/SNAPpyPackets
refs/heads/master
/SNAPPacket.py
mask4bits = ((1 << 4) -1) import numpy as np mask8bits = ((1 << 8) -1) mask16bits = ((1 << 16) -1) mask64bits = ((1 << 64) -1) class SNAPPacket(object): """ ATA SNAP Firmware Manual, Release 2.0.0 --------------------------------------- Section 2.3.2 "Output Data Formats: Voltage Packets", pg 5 ht...
{"/send_udp.py": ["/SNAPPacket.py"], "/receive_udp.py": ["/SNAPPacket.py"]}
16,840
sumitnicmar/PetCover
refs/heads/main
/projectwork/testapp/models.py
from django.db import models from django.utils import timezone from django.contrib.auth.models import User from django.db.models.constraints import UniqueConstraint # Create your models here. class Doctor(models.Model): user = models.OneToOneField(User,related_name='doctor', null=True, on_delete=models.CASCADE) ...
{"/projectwork/testapp/forms.py": ["/projectwork/testapp/models.py"], "/projectwork/testapp/views.py": ["/projectwork/testapp/decorators.py"]}
16,841
sumitnicmar/PetCover
refs/heads/main
/projectwork/testapp/migrations/0009_auto_20210202_1301.py
# Generated by Django 3.1.3 on 2021-02-02 07:31 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('testapp', '0008_auto_20210201_1716'), ] operations = [ migrations.AlterField( model_name='appointment', name='timesl...
{"/projectwork/testapp/forms.py": ["/projectwork/testapp/models.py"], "/projectwork/testapp/views.py": ["/projectwork/testapp/decorators.py"]}
16,842
sumitnicmar/PetCover
refs/heads/main
/projectwork/testapp/migrations/0010_auto_20210202_1303.py
# Generated by Django 3.1.3 on 2021-02-02 07:33 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('testapp', '0009_auto_20210202_1301'), ] operations = [ migrations.AlterField( model_name='appointment', name='timesl...
{"/projectwork/testapp/forms.py": ["/projectwork/testapp/models.py"], "/projectwork/testapp/views.py": ["/projectwork/testapp/decorators.py"]}
16,843
sumitnicmar/PetCover
refs/heads/main
/projectwork/testapp/decorators.py
from django.http import HttpResponse from django.shortcuts import redirect def authenticaton(view_func): def wraper_func(request,*args,**kwargs): if request.user.is_authenticated: return redirect('userhome') else: return view_func(request,*args,**kwargs) return wraper_fu...
{"/projectwork/testapp/forms.py": ["/projectwork/testapp/models.py"], "/projectwork/testapp/views.py": ["/projectwork/testapp/decorators.py"]}
16,844
sumitnicmar/PetCover
refs/heads/main
/projectwork/testapp/migrations/0003_auto_20210130_2238.py
# Generated by Django 3.1.3 on 2021-01-30 17:08 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('testapp', '0002_appointment_doctor'), ] operations = [ migrations.AlterField( model_name='doctor', name='number', ...
{"/projectwork/testapp/forms.py": ["/projectwork/testapp/models.py"], "/projectwork/testapp/views.py": ["/projectwork/testapp/decorators.py"]}
16,845
sumitnicmar/PetCover
refs/heads/main
/projectwork/testapp/admin.py
from django.contrib import admin from testapp.models import Customer,Doctor,Appointment # Register your models here. admin.site.register(Customer) admin.site.register(Doctor) admin.site.register(Appointment)
{"/projectwork/testapp/forms.py": ["/projectwork/testapp/models.py"], "/projectwork/testapp/views.py": ["/projectwork/testapp/decorators.py"]}
16,846
sumitnicmar/PetCover
refs/heads/main
/projectwork/testapp/migrations/0016_customer_name.py
# Generated by Django 3.1.3 on 2021-02-14 15:13 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('testapp', '0015_auto_20210214_2039'), ] operations = [ migrations.AddField( model_name='customer', name='name', ...
{"/projectwork/testapp/forms.py": ["/projectwork/testapp/models.py"], "/projectwork/testapp/views.py": ["/projectwork/testapp/decorators.py"]}
16,847
sumitnicmar/PetCover
refs/heads/main
/projectwork/testapp/migrations/0002_appointment_doctor.py
# Generated by Django 3.1.3 on 2021-01-30 16:54 from django.conf import settings from django.db import migrations, models import django.db.models.deletion import django.utils.timezone class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ...
{"/projectwork/testapp/forms.py": ["/projectwork/testapp/models.py"], "/projectwork/testapp/views.py": ["/projectwork/testapp/decorators.py"]}
16,848
sumitnicmar/PetCover
refs/heads/main
/projectwork/testapp/migrations/0015_auto_20210214_2039.py
# Generated by Django 3.1.3 on 2021-02-14 15:09 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('testapp', '0014_auto_20210209_0032'), ] operations = [ migrations.RemoveField( model_name='customer', name='email', ...
{"/projectwork/testapp/forms.py": ["/projectwork/testapp/models.py"], "/projectwork/testapp/views.py": ["/projectwork/testapp/decorators.py"]}
16,849
sumitnicmar/PetCover
refs/heads/main
/projectwork/testapp/forms.py
from django import forms from django.contrib.auth.models import User from django.contrib.auth.forms import UserCreationForm from .models import Customer,Appointment from datetime import date '''from datetimewidget.widgets import DateTimeWidget''' class CreateUserForm(UserCreationForm): class Meta: mod...
{"/projectwork/testapp/forms.py": ["/projectwork/testapp/models.py"], "/projectwork/testapp/views.py": ["/projectwork/testapp/decorators.py"]}
16,850
sumitnicmar/PetCover
refs/heads/main
/projectwork/testapp/migrations/0011_auto_20210202_2101.py
# Generated by Django 3.1.3 on 2021-02-02 15:31 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('testapp', '0010_auto_202...
{"/projectwork/testapp/forms.py": ["/projectwork/testapp/models.py"], "/projectwork/testapp/views.py": ["/projectwork/testapp/decorators.py"]}
16,851
sumitnicmar/PetCover
refs/heads/main
/projectwork/testapp/views.py
from django.shortcuts import render,redirect from testapp.forms import CreateUserForm,CustomerForm,AppointmentForm,UpdateAppointmentForm,UpdateUserForm from django.shortcuts import get_object_or_404 from testapp.models import Appointment from django.contrib.auth.models import User from django.contrib import messages ...
{"/projectwork/testapp/forms.py": ["/projectwork/testapp/models.py"], "/projectwork/testapp/views.py": ["/projectwork/testapp/decorators.py"]}
16,852
sumitnicmar/PetCover
refs/heads/main
/projectwork/testapp/migrations/0004_auto_20210201_1458.py
# Generated by Django 3.1.3 on 2021-02-01 09:28 import django.contrib.auth.models from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('testapp', '0003_auto_20210130_2238'), ] operations = [ migrations.AlterFi...
{"/projectwork/testapp/forms.py": ["/projectwork/testapp/models.py"], "/projectwork/testapp/views.py": ["/projectwork/testapp/decorators.py"]}
16,853
sumitnicmar/PetCover
refs/heads/main
/projectwork/projectwork/urls.py
"""projectwork URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/3.1/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-b...
{"/projectwork/testapp/forms.py": ["/projectwork/testapp/models.py"], "/projectwork/testapp/views.py": ["/projectwork/testapp/decorators.py"]}
16,854
sumitnicmar/PetCover
refs/heads/main
/projectwork/testapp/migrations/0012_appointment_status.py
# Generated by Django 3.1.3 on 2021-02-05 07:21 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('testapp', '0011_auto_20210202_2101'), ] operations = [ migrations.AddField( model_name='appointment', name='status',...
{"/projectwork/testapp/forms.py": ["/projectwork/testapp/models.py"], "/projectwork/testapp/views.py": ["/projectwork/testapp/decorators.py"]}
16,855
sumitnicmar/PetCover
refs/heads/main
/projectwork/testapp/migrations/0006_auto_20210201_1633.py
# Generated by Django 3.1.3 on 2021-02-01 11:03 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('testapp', '0005_auto_202...
{"/projectwork/testapp/forms.py": ["/projectwork/testapp/models.py"], "/projectwork/testapp/views.py": ["/projectwork/testapp/decorators.py"]}
16,860
VelDia/Cult_game
refs/heads/master
/Tutorial.py
# Tutorial part from Characters import People, NPC, MainCharacter, Character from character_data import* #from random import randint, choice #================================================ # Tutorial NPC #================================================ npc1 = NPC('Andrew', 27, 1, 50, 0) npc2 = NPC('Bob', 32, ...
{"/Tutorial.py": ["/Characters.py", "/character_data.py"], "/Characters.py": ["/character_data.py", "/npc_data.py"]}
16,861
VelDia/Cult_game
refs/heads/master
/character_data.py
# File with Сharacter phrases characterGreeting = ['Oh, hi', 'What\'s up?', 'With God to you I come'] characterRecruitmentSoft = ['Lets talk about religion', 'Wanna see something cool?', 'Would you mind to go to our church?'] characterRecruitmentSoftBad = ['I need people for making cult', 'Join our religion', 'Hey, I...
{"/Tutorial.py": ["/Characters.py", "/character_data.py"], "/Characters.py": ["/character_data.py", "/npc_data.py"]}
16,862
VelDia/Cult_game
refs/heads/master
/Characters.py
# Main Character logic # And NPC logic from random import choice, randint #from Tutorial import Visit from character_data import characterGreeting from npc_data import* import time, threading #================================================ # Main Character logic #================================================ ...
{"/Tutorial.py": ["/Characters.py", "/character_data.py"], "/Characters.py": ["/character_data.py", "/npc_data.py"]}
16,863
VelDia/Cult_game
refs/heads/master
/npc_data.py
# File with NPC phrases npcMaleNames = ['John', 'Boris', 'Andrew', 'Emmet', 'Eliot', 'Bob', 'Steve', 'Tony', 'Michel', 'Peter', 'Frank', 'George'] npcFemaleNames = ['Lara', 'Emma', 'Natasha', 'Scarlet', 'Helen', 'Linda', 'Rachel', 'Tina', 'Sofi', 'Clara', 'Eleonor', 'Sonya'] npcGreeting = ['Hello', 'Main respecturen'...
{"/Tutorial.py": ["/Characters.py", "/character_data.py"], "/Characters.py": ["/character_data.py", "/npc_data.py"]}
16,864
VelDia/Cult_game
refs/heads/master
/Web_GUI_test.py
import eel import pickle fileName = 'data' fileExistsFlag = False eel.init('web') try: infile = open(fileName,'rb') user_info = pickle.load(infile) infile.close() print(user_info) fileExistsFlag = True except IOError: print("Enter data please") @eel.expose def get_info(name, gender, age): if str(name) == ''...
{"/Tutorial.py": ["/Characters.py", "/character_data.py"], "/Characters.py": ["/character_data.py", "/npc_data.py"]}
16,865
VelDia/Cult_game
refs/heads/master
/Perlin_noise/Playing_perlin.py
from perlin import PerlinNoiseFactory import PIL.Image size = 800 res = 40 frames = 1 frameres = 5 space_range = size//res frame_range = frames//frameres pnf = PerlinNoiseFactory(3, octaves=3, tile=(space_range, space_range, frame_range)) for t in range(frames): img = PIL.Image.new('L', (size, size)) for x i...
{"/Tutorial.py": ["/Characters.py", "/character_data.py"], "/Characters.py": ["/character_data.py", "/npc_data.py"]}
16,866
hitswint/TemperatureMonitor
refs/heads/master
/TM/urls.py
from django.conf.urls import url from TM.views import index, index_plot # from swint.models import Article, Category urlpatterns = [ url(r'^$', index, name='index-view'), url(r'^plot$', index_plot, name='index-plot-view'), ]
{"/TM/urls.py": ["/TM/views.py"], "/TM/views.py": ["/TM/models.py", "/TM/gl.py"]}
16,867
hitswint/TemperatureMonitor
refs/heads/master
/TM/models.py
from django.db import models # * ArticleSwint class Temperature(models.Model): """Model for Articles.""" time = models.DateTimeField(verbose_name=u"时间", auto_now_add=True) value = models.TextField(verbose_name=u"温度") class Meta(): ordering = [ 'time', ] def __unicode...
{"/TM/urls.py": ["/TM/views.py"], "/TM/views.py": ["/TM/models.py", "/TM/gl.py"]}
16,868
hitswint/TemperatureMonitor
refs/heads/master
/TM/views.py
# from django.shortcuts import render from django.shortcuts import render_to_response from django.http import HttpResponse # from django.views.generic import ListView # from django.conf import settings from TM.models import Temperature # import logging from django.views.decorators.csrf import csrf_exempt import sqlite3...
{"/TM/urls.py": ["/TM/views.py"], "/TM/views.py": ["/TM/models.py", "/TM/gl.py"]}
16,869
hitswint/TemperatureMonitor
refs/heads/master
/TM/gl.py
ON_OFF = 0
{"/TM/urls.py": ["/TM/views.py"], "/TM/views.py": ["/TM/models.py", "/TM/gl.py"]}
16,870
thoklei/bigdatachallenge
refs/heads/master
/models.py
import numpy as np import tensorflow as tf import tensorflow.keras.layers as layers from AutoconLayer import AutoconLayer def get_bartimaeus(sequence_length, rec_units, drop1, dense_units, drop2): model = tf.keras.Sequential() model.add(layers.LSTM(rec_units, input_shape=[sequence_length,19])) model.add...
{"/models.py": ["/AutoconLayer.py"], "/abgabe.py": ["/utils.py"], "/lstm_network.py": ["/utils.py", "/models.py"], "/extend_training.py": ["/utils.py"], "/AutoconLayer.py": ["/autoconceptor.py"]}
16,871
thoklei/bigdatachallenge
refs/heads/master
/utils.py
import sys import os import csv import itertools import numpy as np import pandas as pd import tensorflow as tf import matplotlib.pyplot as plt from scipy import signal from scipy import ndimage from multiprocessing import Pool from multiprocessing.dummy import Pool as ThreadPool classes = ['run', 'walk', 'stand',...
{"/models.py": ["/AutoconLayer.py"], "/abgabe.py": ["/utils.py"], "/lstm_network.py": ["/utils.py", "/models.py"], "/extend_training.py": ["/utils.py"], "/AutoconLayer.py": ["/autoconceptor.py"]}
16,872
thoklei/bigdatachallenge
refs/heads/master
/abgabe.py
import numpy as np import tensorflow as tf import pandas as pd from utils import read_recurrent_dataset from tensorflow.keras import layers name = "shorty_mit0806_full" sequence_length = 30 classes = ['run', 'walk', 'stand', 'sit', 'sit-to-stand', 'stand-to-sit', 'stair-up', 'stair-down', 'jump-one-leg', '...
{"/models.py": ["/AutoconLayer.py"], "/abgabe.py": ["/utils.py"], "/lstm_network.py": ["/utils.py", "/models.py"], "/extend_training.py": ["/utils.py"], "/AutoconLayer.py": ["/autoconceptor.py"]}
16,873
thoklei/bigdatachallenge
refs/heads/master
/autoconceptor.py
""" The Autoconceptor, adapted from Jaeger 2017, and the DynStateTuple that is used to store the conceptor matrix. """ import numpy as np import collections import tensorflow as tf from tensorflow.python.ops import init_ops from tensorflow.contrib.layers.python.layers import layers from tensorflow.python.layers import...
{"/models.py": ["/AutoconLayer.py"], "/abgabe.py": ["/utils.py"], "/lstm_network.py": ["/utils.py", "/models.py"], "/extend_training.py": ["/utils.py"], "/AutoconLayer.py": ["/autoconceptor.py"]}
16,874
thoklei/bigdatachallenge
refs/heads/master
/lstm_network.py
import numpy as np import tensorflow as tf from utils import * from tensorflow.keras import layers from models import * name = "BigRandomAvoider" sequence_length = 80 batchsize = 32 data = "/Users/thomasklein/Projects/BremenBigDataChallenge2019/bigdatachallenge/data/sparse/rawdata.tfrecords" model_path = "/Users/th...
{"/models.py": ["/AutoconLayer.py"], "/abgabe.py": ["/utils.py"], "/lstm_network.py": ["/utils.py", "/models.py"], "/extend_training.py": ["/utils.py"], "/AutoconLayer.py": ["/autoconceptor.py"]}
16,875
thoklei/bigdatachallenge
refs/heads/master
/network.py
import numpy as np import tensorflow as tf from tfrecord_converter import read_dataset from tensorflow.keras import layers model = tf.keras.Sequential() model.add(layers.Dense(64, activation='tanh', input_shape=(30,))) #set value to shape-1 model.add(layers.Dense(64, activation='tanh')) model.add(layers.Dense(22, ...
{"/models.py": ["/AutoconLayer.py"], "/abgabe.py": ["/utils.py"], "/lstm_network.py": ["/utils.py", "/models.py"], "/extend_training.py": ["/utils.py"], "/AutoconLayer.py": ["/autoconceptor.py"]}
16,876
thoklei/bigdatachallenge
refs/heads/master
/legacy/tfrecord_converter.py
import numpy as np import pandas as pd import tensorflow as tf #tf.enable_eager_execution() def _float_feature(value): """Returns a float_list from a float / double.""" return tf.train.Feature(float_list=tf.train.FloatList(value=[value])) def _int64_feature(value): """Returns an int64_list from a bo...
{"/models.py": ["/AutoconLayer.py"], "/abgabe.py": ["/utils.py"], "/lstm_network.py": ["/utils.py", "/models.py"], "/extend_training.py": ["/utils.py"], "/AutoconLayer.py": ["/autoconceptor.py"]}
16,877
thoklei/bigdatachallenge
refs/heads/master
/extend_training.py
import numpy as np import tensorflow as tf from utils import * from tensorflow.keras import layers name = "big_ohne_r2" sequence_length = 80 data = "/Users/thomasklein/Projects/BremenBigDataChallenge2019/bigdatachallenge/data/sparse/rawdata.tfrecords" model_path = "/Users/thomasklein/Projects/BremenBigDataChalleng...
{"/models.py": ["/AutoconLayer.py"], "/abgabe.py": ["/utils.py"], "/lstm_network.py": ["/utils.py", "/models.py"], "/extend_training.py": ["/utils.py"], "/AutoconLayer.py": ["/autoconceptor.py"]}
16,878
thoklei/bigdatachallenge
refs/heads/master
/AutoconLayer.py
import collections import tensorflow as tf import numpy as np import tensorflow.keras.layers as layers from tensorflow.python.ops import init_ops from autoconceptor import Autoconceptor class AutoconLayer(layers.RNN): def __init__(self, output_dim, alpha, lam, batchsize, activation=tf.nn.tanh, layer_norm=False, ...
{"/models.py": ["/AutoconLayer.py"], "/abgabe.py": ["/utils.py"], "/lstm_network.py": ["/utils.py", "/models.py"], "/extend_training.py": ["/utils.py"], "/AutoconLayer.py": ["/autoconceptor.py"]}
16,947
Abuelodelanada/hume
refs/heads/master
/humetools.py
#!/usr/bin/env python3 import sys import argparse class NotImplementedAction(argparse.Action): """ This class allows to work on getting your Argparse object ready even if nothing useful happens when used. Usage: Just set action=NotImplementedAction when calling add_argument, like this: import ar...
{"/hume.py": ["/humetools.py"]}
16,948
Abuelodelanada/hume
refs/heads/master
/humed.py
#!/usr/bin/python3 import zmq import json import pidfile import sqlite3 import datetime # import systemd.daemon from pprint import pprint DEBUG = True # TODO: set to False :P # hume is VERY related to logs # better /var/humed/humed.sqlite3 ? DBPATH = '/var/log/humed.sqlite3' if DEBUG: DBPATH = './humed.sqlite3' ...
{"/hume.py": ["/humetools.py"]}
16,949
Abuelodelanada/hume
refs/heads/master
/hume.py
#!/usr/bin/env python3 import os import zmq import sys import stat import psutil import argparse import json from pprint import pprint from humetools import NotImplementedAction class Hume(): def __init__(self, args): # self.config = {'url': 'ipc:///tmp/hume.sock'} self.config = {'url': 'tcp://12...
{"/hume.py": ["/humetools.py"]}
16,950
aybry/trussDFEM
refs/heads/master
/testModels.py
import numpy as np from plotsAndTables import nodeTableFunc, elemTableFunc # NODES # node nr | x-coord | y-coord # ELEMENTS # element nr | start node | end node # BEARINGS # bearing type | node | orientation # LOADS # load nr | node | orientation | magnitude def truss1(): nodes = np.array([[1,0...
{"/testModels.py": ["/plotsAndTables.py"], "/convert.py": ["/testModels.py"], "/solver.py": ["/plotsAndTables.py"], "/trussDFEM.py": ["/testModels.py", "/plotsAndTables.py", "/solver.py"]}
16,951
aybry/trussDFEM
refs/heads/master
/convert.py
import testModels, json i = 1 while i <= 5: next_func = 'truss' + str(i) [nodes, elements, bearings, loads, nodeTable, elemTable, A, E, poiss] = getattr(testModels, next_func)() nodes_json = '{"nodes": {' elements_json = '{"elements": {' bearings_json = '{"bearings": {' loads_json = '{...
{"/testModels.py": ["/plotsAndTables.py"], "/convert.py": ["/testModels.py"], "/solver.py": ["/plotsAndTables.py"], "/trussDFEM.py": ["/testModels.py", "/plotsAndTables.py", "/solver.py"]}
16,952
aybry/trussDFEM
refs/heads/master
/plotsAndTables.py
import numpy as np import matplotlib.pyplot as plt from terminaltables import SingleTable as SingTab def updatePlot(nodes, nodesNew, elements, bearings, loads, fromSolver): fig = plt.figure() ax = fig.add_subplot(111) alphaNew = 1 if fromSolver == 1: alphaOrig = 0.2 # if coming from ...
{"/testModels.py": ["/plotsAndTables.py"], "/convert.py": ["/testModels.py"], "/solver.py": ["/plotsAndTables.py"], "/trussDFEM.py": ["/testModels.py", "/plotsAndTables.py", "/solver.py"]}
16,953
aybry/trussDFEM
refs/heads/master
/solver.py
import numpy as np from numpy.linalg import solve as npsolve from terminaltables import SingleTable as SingTab from plotsAndTables import * def solver(nodes, elements, bearings, loads, nodeTable, elemTable, A, E): np.set_printoptions(precision = 4) # how many decimal places print ('\n -------------\...
{"/testModels.py": ["/plotsAndTables.py"], "/convert.py": ["/testModels.py"], "/solver.py": ["/plotsAndTables.py"], "/trussDFEM.py": ["/testModels.py", "/plotsAndTables.py", "/solver.py"]}
16,954
aybry/trussDFEM
refs/heads/master
/trussDFEM.py
# Program for calculating the deformation of a simple truss via FEM import numpy as np import matplotlib.pyplot as plt import os from terminaltables import SingleTable as SingTab from testModels import * from plotsAndTables import * from solver import * def main(): clearScreen = os.system('cls') ...
{"/testModels.py": ["/plotsAndTables.py"], "/convert.py": ["/testModels.py"], "/solver.py": ["/plotsAndTables.py"], "/trussDFEM.py": ["/testModels.py", "/plotsAndTables.py", "/solver.py"]}
16,966
MCMXCIII/Django-Blog
refs/heads/master
/blog/forms.py
from django import forms from .models import Files #For Class Meta it links back to the mode check the model to make changes. class FileForm(forms.ModelForm): class Meta: model = Files fields = ('description', 'video', )
{"/blog/forms.py": ["/blog/models.py"], "/blog/admin.py": ["/blog/models.py"], "/blog/views.py": ["/blog/models.py", "/blog/forms.py"]}
16,967
MCMXCIII/Django-Blog
refs/heads/master
/blog/admin.py
from django.contrib import admin from .models import Post from .models import Video # Register your models here. # new Models admin.site.register(Post) admin.site.register(Video)
{"/blog/forms.py": ["/blog/models.py"], "/blog/admin.py": ["/blog/models.py"], "/blog/views.py": ["/blog/models.py", "/blog/forms.py"]}
16,968
MCMXCIII/Django-Blog
refs/heads/master
/blog/migrations/0004_auto_20180225_2048.py
# Generated by Django 2.0 on 2018-02-26 01:48 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('blog', '0003_auto_20180225_1152'), ] operations = [ migrations.RemoveField( model_name='video', name='title', ), ...
{"/blog/forms.py": ["/blog/models.py"], "/blog/admin.py": ["/blog/models.py"], "/blog/views.py": ["/blog/models.py", "/blog/forms.py"]}
16,969
MCMXCIII/Django-Blog
refs/heads/master
/blog/views.py
#Remeber that these functions have to be impoted, check docs! from django.shortcuts import render from django.shortcuts import redirect #Reference the Post model from earlier from .models import Post from .models import Video from .forms import FileForm # Create your views here. def index(request): posts = Post.o...
{"/blog/forms.py": ["/blog/models.py"], "/blog/admin.py": ["/blog/models.py"], "/blog/views.py": ["/blog/models.py", "/blog/forms.py"]}
16,970
MCMXCIII/Django-Blog
refs/heads/master
/questions.py
from discord.ext import commands from random import choice, shuffle import aiohttp import functools import asyncio class query: def __init__(self,bot): self.bot = bot @commands.group(name="question", no_pm=True,pass_context=True) async def getquestion(self,ctx): """Built in Helpdesk style ticketing sy...
{"/blog/forms.py": ["/blog/models.py"], "/blog/admin.py": ["/blog/models.py"], "/blog/views.py": ["/blog/models.py", "/blog/forms.py"]}
16,971
MCMXCIII/Django-Blog
refs/heads/master
/blog/migrations/0005_auto_20180225_2056.py
# Generated by Django 2.0 on 2018-02-26 01:56 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('blog', '0004_auto_20180225_2048'), ] operations = [ migrations.AddField( model_name='video', name='title', ...
{"/blog/forms.py": ["/blog/models.py"], "/blog/admin.py": ["/blog/models.py"], "/blog/views.py": ["/blog/models.py", "/blog/forms.py"]}
16,972
MCMXCIII/Django-Blog
refs/heads/master
/blog/models.py
from django.db import models from django.utils import timezone #new models forms. # Create your models here. # New models here # Post Model for Blog not Tube class Post(models.Model): title = models.CharField(max_length=250) body = models.TextField() date_pub = models.DateTimeField(default=timezone.now) ...
{"/blog/forms.py": ["/blog/models.py"], "/blog/admin.py": ["/blog/models.py"], "/blog/views.py": ["/blog/models.py", "/blog/forms.py"]}
16,973
MCMXCIII/Django-Blog
refs/heads/master
/blog/migrations/0007_auto_20180226_1222.py
# Generated by Django 2.0 on 2018-02-26 17:22 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('blog', '0006_auto_20180225_2057'), ] operations = [ migrations.AddField( model_name='video', name='allow_comments', ...
{"/blog/forms.py": ["/blog/models.py"], "/blog/admin.py": ["/blog/models.py"], "/blog/views.py": ["/blog/models.py", "/blog/forms.py"]}
17,005
rakesh329/Simulating-a-disease-spread-and-visualizing-curve-using-python
refs/heads/main
/Social_connections.py
""" Written by : Rakesh Namballa Started date : 23/05/2020 Last edited: 08/06/2020 Description: " Representing social connections " In this code we create objects for all the people and add friends to each person depending on the sample txt file. Sample file consist of all the Person names along with their respective f...
{"/Visualise_curve.py": ["/Simulate_disease_spread.py"], "/Simulate_disease_spread.py": ["/Social_connections.py"]}
17,006
rakesh329/Simulating-a-disease-spread-and-visualizing-curve-using-python
refs/heads/main
/Visualise_curve.py
""" Written by : Rakesh Namballa Started date : 23/05/2020 Last edited: 08/06/2020 Description: " Visualise the curve " In this code we create a count vs days graph and visualise the graph """ """ Test scenario A: An uncontained outbreak Number of days: 30 Meeting probability: 0.6 Patient zero health: 25 health po...
{"/Visualise_curve.py": ["/Simulate_disease_spread.py"], "/Simulate_disease_spread.py": ["/Social_connections.py"]}
17,007
rakesh329/Simulating-a-disease-spread-and-visualizing-curve-using-python
refs/heads/main
/Simulate_disease_spread.py
""" Written by : Rakesh Namballa Started date : 26/05/2020 Last edited: 08/06/2020 Description: " Simulate disease spread " In this code we create objects for all the patients and add friends to each person depending on the sample txt file. We run a simulation to check the no:of effected people and return a count for ...
{"/Visualise_curve.py": ["/Simulate_disease_spread.py"], "/Simulate_disease_spread.py": ["/Social_connections.py"]}
17,035
FlameDavid92/Python-ProgettazioneDiAlgoritmi
refs/heads/main
/puntiDiArticolazione.py
''' C'è una certa parentela tra i punti di articolazione e i ponti. Se {u, v} è un ponte tale che u ha grado almeno 2, allora u è un punto di articolazione. Però se u è un punto di articolazione, non è detto che qualche arco incidente in u sia un ponte. Punti di articolazione Vediamo allora come trovare i punti di art...
{"/eserciziBFS.py": ["/BFS.py"]}
17,036
FlameDavid92/Python-ProgettazioneDiAlgoritmi
refs/heads/main
/forteConnessione.py
import simpleStackQueue ''' Discussione dell'esercizio [sensi unici] La rete viaria della cittadina può essere rappresentata facilmente tramite un grafo diretto in cui i nodi sono gli incroci di due o più strade e ogni arco corrisponde a una strada (tra due incroci). Allora la proprietà che vorrebbe il sindaco equival...
{"/eserciziBFS.py": ["/BFS.py"]}
17,037
FlameDavid92/Python-ProgettazioneDiAlgoritmi
refs/heads/main
/eseBacktracking.py
def printSottSeqCresc(n, X, sol, u, z, check, k): if k == n: print(sol) return sol[k] = -1 printSottSeqCresc(n, X, sol, u, z, check, k+1) if X[k] == 0 and check == 0: sol[k] = 0 printSottSeqCresc(n, X, sol, u, z+1, 0, k+1) elif X[k] == 1 and z >= (u+1): sol[k]...
{"/eserciziBFS.py": ["/BFS.py"]}
17,038
FlameDavid92/Python-ProgettazioneDiAlgoritmi
refs/heads/main
/BFS.py
import collections import math def BFS(G, u): P = [-1 for _ in G] # array dei padri DIST = [-1 for _ in G] # array delle distanze P[u] = u # radice dell'albero BFS DIST[u] = 0 Q = collections.deque() Q.append(u) # accoda u alla coda while len(Q) != 0: v = Q.popleft() # preleva...
{"/eserciziBFS.py": ["/BFS.py"]}
17,039
FlameDavid92/Python-ProgettazioneDiAlgoritmi
refs/heads/main
/esercizioDfsTrovaPonti2.py
''' Discussione dell'esercizio [strade critiche] Possiamo rappresentare la rete viaria con un grafo G non diretto in cui i nodi sono gli incroci e due nodi sono collegati da un arco se c'è una strada che collega i corrispondenti incroci. Per ipotesi G è un grafo connesso. Una strada critica corrisponde a un ponte del g...
{"/eserciziBFS.py": ["/BFS.py"]}
17,040
FlameDavid92/Python-ProgettazioneDiAlgoritmi
refs/heads/main
/DFS.py
import simpleStackQueue def dfs(G, u): VIS = [] S = simpleStackQueue.Stack() S.push(u) VIS.append(u) while S.size() >= 1: v = S.top() check = 0 for w in G[v]: if w not in VIS: VIS.append(w) S.push(w) check = 1 ...
{"/eserciziBFS.py": ["/BFS.py"]}
17,041
FlameDavid92/Python-ProgettazioneDiAlgoritmi
refs/heads/main
/eserciziBFS.py
import BFS import collections import math ''' Esercizio [dall'albero alle distanze] Dato un vettore dei padri P che rappresenta l'albero di una BFS a partire da un nodo u, dare un algoritmo che calcola il corrispondente array Dist delle distanze da u in tempo O(n). ''' def calcolaDistanzeArrayPadriBFS(P): def dist...
{"/eserciziBFS.py": ["/BFS.py"]}
17,042
FlameDavid92/Python-ProgettazioneDiAlgoritmi
refs/heads/main
/esePD.py
import collections def EQ_BIP(S, x): if x % 2 != 0: print("Il valore totale della sequenza è dispari, la sequenza non è bipartibile!") return False, None T = [[False for _ in range(0, int(x/2)+1)] for _ in range(0, len(S))] for i in range(0, len(S)): T[i][0] = True for c in ran...
{"/eserciziBFS.py": ["/BFS.py"]}
17,043
FlameDavid92/Python-ProgettazioneDiAlgoritmi
refs/heads/main
/bicolorazione.py
import simpleStackQueue ''' COLORAZIONE DI UN GRAFO -Dato un grafo si vogliono colorare i nodi usando il numero minimo di colori che garantiscono che due qualsiasi nodi adiacenti hanno colori diversi. Problema: sapere se esiste e in tal caso trovare una cosidetta 2-colorazione del nostro grafo. Un altro modo di vede...
{"/eserciziBFS.py": ["/BFS.py"]}
17,044
FlameDavid92/Python-ProgettazioneDiAlgoritmi
refs/heads/main
/eserciziDfs2.py
import copy ''' Esercizio [pozzo] In un grafo diretto, un nodo si dice pozzo universale se ha grado entrante n − 1 e grado uscente 0. Dimostrare che un grafo diretto non può avere più di un pozzo universale. Descrivere un algoritmo che preso un grafo diretto G, rappresentato tramite matrice di adiacenza, determina se G...
{"/eserciziBFS.py": ["/BFS.py"]}
17,045
FlameDavid92/Python-ProgettazioneDiAlgoritmi
refs/heads/main
/prinSottSeqCresc.py
# N[i] = numero delle sottosequenze crescenti di S[0..i] che terminano in i def numSottSeqCresc(S, n): N = [0 for _ in range(0, n)] N[0] = 1 nsc = 1 for i in range(1, n): N[i] = 1 for j in range(0, i): if S[j] < S[i]: N[i] = N[i] + N[j] nsc = nsc + N...
{"/eserciziBFS.py": ["/BFS.py"]}
17,046
FlameDavid92/Python-ProgettazioneDiAlgoritmi
refs/heads/main
/eserciziDfs.py
import copy ''' Esercizio [archi] Vogliamo scrivere un algoritmo che esegue una DFS su un grafo diretto e ritorna il numero di archi dell'albero della DFS, il numero di archi all'indietro, il numero di archi in avanti e il numero di archi di attraversamento. ''' def dfsRecArchi(G, u, VIS, contatori, c): c += 1 ...
{"/eserciziBFS.py": ["/BFS.py"]}
17,047
FlameDavid92/Python-ProgettazioneDiAlgoritmi
refs/heads/main
/ordinareGrafo.py
#import simpleStackQueue import collections ''' !!!Se un grafo è aciclico, esiste almeno un nodo che non ha archi entranti.!!! dim: Se così non fosse potremmo partire da un nodo v1 e prendere un suo arco entrante che esce da un nodo v2, poi prendere un arco entrante in v2 e uscente da un nodo v3 diverso dai primi due ...
{"/eserciziBFS.py": ["/BFS.py"]}
17,048
FlameDavid92/Python-ProgettazioneDiAlgoritmi
refs/heads/main
/componentiConnesse.py
import simpleStackQueue ''' Per tenere traccia delle componenti connesse si può usare un array che ad ogni nodo assegna l'indice della sua componente connessa (gli indici sono determinati dall'ordine con cui sono trovate le componenti) ''' def dfsCC(G, node, arrayCc, countComp): S = simpleStackQueue.Stack() ...
{"/eserciziBFS.py": ["/BFS.py"]}
17,049
FlameDavid92/Python-ProgettazioneDiAlgoritmi
refs/heads/main
/classificazioneArchiDfsECicli.py
''' Consideriamo un qualsiasi arco diretto (x, y) non appartenente all'albero della DFS. Per gli intervalli di visita di x e y sono possibili solamente i seguenti casi: - Gli intervalli di x e y sono disgiunti: non può essere t(x) < t(y) perchè l'arco (x, y) avrebbe forzato la visita di y durante la visita da x e i ...
{"/eserciziBFS.py": ["/BFS.py"]}
17,050
apragacz/functoolsplus
refs/heads/master
/functoolsplus/hof.py
from collections.abc import Iterable from functoolsplus.abc import Filterable, Foldable, Functor, Monad from functoolsplus.utils.implementations import get_impl, provide_impl_for from functoolsplus.utils.singletons import Missing def map(func, obj): return _generic_higher_order_func(Functor, 'map', '__map__', fu...
{"/functoolsplus/hof.py": ["/functoolsplus/abc.py", "/functoolsplus/utils/implementations.py", "/functoolsplus/utils/singletons.py"], "/tests/containers/test_lazy.py": ["/functoolsplus/containers/lazy.py"], "/tests/strategies.py": ["/tests/functions.py"], "/tests/collections/test_stream.py": ["/functoolsplus/__init__.p...
17,051
apragacz/functoolsplus
refs/heads/master
/tests/containers/test_lazy.py
import pytest from functoolsplus.containers.lazy import LazyValue, Unevaluated def test_with_value_evaluator(): lv = LazyValue(lambda: 42) assert not lv.is_evaluated() assert lv.raw_value is Unevaluated assert str(lv) == 'LazyValue(<unevaluated>)' value = lv.value assert value == 42 asse...
{"/functoolsplus/hof.py": ["/functoolsplus/abc.py", "/functoolsplus/utils/implementations.py", "/functoolsplus/utils/singletons.py"], "/tests/containers/test_lazy.py": ["/functoolsplus/containers/lazy.py"], "/tests/strategies.py": ["/tests/functions.py"], "/tests/collections/test_stream.py": ["/functoolsplus/__init__.p...
17,052
apragacz/functoolsplus
refs/heads/master
/tests/strategies.py
from functools import partial from hypothesis import strategies as st from tests.functions import always_false, always_true, identity def build_add_function(n): return set_function_name(f'add_{_integer_to_id(n)}')(lambda x: x + n) def build_mul_function(n): return set_function_name(f'mul_{_integer_to_id(n...
{"/functoolsplus/hof.py": ["/functoolsplus/abc.py", "/functoolsplus/utils/implementations.py", "/functoolsplus/utils/singletons.py"], "/tests/containers/test_lazy.py": ["/functoolsplus/containers/lazy.py"], "/tests/strategies.py": ["/tests/functions.py"], "/tests/collections/test_stream.py": ["/functoolsplus/__init__.p...
17,053
apragacz/functoolsplus
refs/heads/master
/functoolsplus/utils/singletons.py
def new_singleton(cls): if not hasattr(cls, '__instance__'): cls.__instance__ = object.__new__(cls) return cls.__instance__ class MissingType(object): def __new__(cls): return new_singleton(cls) Missing = MissingType()
{"/functoolsplus/hof.py": ["/functoolsplus/abc.py", "/functoolsplus/utils/implementations.py", "/functoolsplus/utils/singletons.py"], "/tests/containers/test_lazy.py": ["/functoolsplus/containers/lazy.py"], "/tests/strategies.py": ["/tests/functions.py"], "/tests/collections/test_stream.py": ["/functoolsplus/__init__.p...
17,054
apragacz/functoolsplus
refs/heads/master
/tests/collections/test_stream.py
import pytest from hypothesis import given from hypothesis import strategies as st from functoolsplus import filter as generic_filter from functoolsplus import flatmap from functoolsplus import map as generic_map from functoolsplus import unit from functoolsplus.collections import Stream from tests import strategies a...
{"/functoolsplus/hof.py": ["/functoolsplus/abc.py", "/functoolsplus/utils/implementations.py", "/functoolsplus/utils/singletons.py"], "/tests/containers/test_lazy.py": ["/functoolsplus/containers/lazy.py"], "/tests/strategies.py": ["/tests/functions.py"], "/tests/collections/test_stream.py": ["/functoolsplus/__init__.p...
17,055
apragacz/functoolsplus
refs/heads/master
/setup.py
#!/usr/bin/env python import os.path import re from setuptools import find_packages, setup ROOT_DIR = os.path.dirname(__file__) def read_contents(local_filepath): with open(os.path.join(ROOT_DIR, local_filepath), 'rt') as f: return f.read() def get_requirements(requirements_filepath): ''' Retu...
{"/functoolsplus/hof.py": ["/functoolsplus/abc.py", "/functoolsplus/utils/implementations.py", "/functoolsplus/utils/singletons.py"], "/tests/containers/test_lazy.py": ["/functoolsplus/containers/lazy.py"], "/tests/strategies.py": ["/tests/functions.py"], "/tests/collections/test_stream.py": ["/functoolsplus/__init__.p...
17,056
apragacz/functoolsplus
refs/heads/master
/functoolsplus/collections/lists.py
from collections.abc import Sequence from functoolsplus.collections.base import SingleLinkedStruct from functoolsplus.utils.singletons import new_singleton class SingleLinkedList(SingleLinkedStruct, Sequence): def __new__(cls, iterable=None): if iterable is None: iterable = [] return...
{"/functoolsplus/hof.py": ["/functoolsplus/abc.py", "/functoolsplus/utils/implementations.py", "/functoolsplus/utils/singletons.py"], "/tests/containers/test_lazy.py": ["/functoolsplus/containers/lazy.py"], "/tests/strategies.py": ["/tests/functions.py"], "/tests/collections/test_stream.py": ["/functoolsplus/__init__.p...
17,057
apragacz/functoolsplus
refs/heads/master
/tests/functions.py
def identity(x): return x def always_false(x): return False def always_true(x): return True def add(x, y): return x + y
{"/functoolsplus/hof.py": ["/functoolsplus/abc.py", "/functoolsplus/utils/implementations.py", "/functoolsplus/utils/singletons.py"], "/tests/containers/test_lazy.py": ["/functoolsplus/containers/lazy.py"], "/tests/strategies.py": ["/tests/functions.py"], "/tests/collections/test_stream.py": ["/functoolsplus/__init__.p...
17,058
apragacz/functoolsplus
refs/heads/master
/tests/containers/test_pipes.py
from functools import partial import pytest from hypothesis import given from hypothesis import strategies as st from functoolsplus import filter, map from functoolsplus.containers.pipes import P def test_chain_methods_cons(): pipe = ( P .filter(lambda x: x % 2 == 1) .map(lambda x: x + 1...
{"/functoolsplus/hof.py": ["/functoolsplus/abc.py", "/functoolsplus/utils/implementations.py", "/functoolsplus/utils/singletons.py"], "/tests/containers/test_lazy.py": ["/functoolsplus/containers/lazy.py"], "/tests/strategies.py": ["/tests/functions.py"], "/tests/collections/test_stream.py": ["/functoolsplus/__init__.p...
17,059
apragacz/functoolsplus
refs/heads/master
/functoolsplus/utils/implementations.py
from collections import OrderedDict, defaultdict, namedtuple ImplEntry = namedtuple('ImplEntry', [ 'base_cls', 'impl_cls', ]) _impementations_registry = defaultdict(OrderedDict) def provide_impl_for(abc_class, base_class): def decorator(impl_cls): impl_reg = _impementations_registry[abc_class....
{"/functoolsplus/hof.py": ["/functoolsplus/abc.py", "/functoolsplus/utils/implementations.py", "/functoolsplus/utils/singletons.py"], "/tests/containers/test_lazy.py": ["/functoolsplus/containers/lazy.py"], "/tests/strategies.py": ["/tests/functions.py"], "/tests/collections/test_stream.py": ["/functoolsplus/__init__.p...
17,060
apragacz/functoolsplus
refs/heads/master
/tests/collections/test_single_linked_list.py
import pytest from hypothesis import given from hypothesis import strategies as st from functoolsplus import filter as generic_filter from functoolsplus import flatmap from functoolsplus import map as generic_map from functoolsplus import unit from functoolsplus.collections import SingleLinkedList from tests import st...
{"/functoolsplus/hof.py": ["/functoolsplus/abc.py", "/functoolsplus/utils/implementations.py", "/functoolsplus/utils/singletons.py"], "/tests/containers/test_lazy.py": ["/functoolsplus/containers/lazy.py"], "/tests/strategies.py": ["/tests/functions.py"], "/tests/collections/test_stream.py": ["/functoolsplus/__init__.p...
17,061
apragacz/functoolsplus
refs/heads/master
/functoolsplus/collections/__init__.py
from .lists import SingleLinkedList # noqa: F401 from .streams import Stream # noqa: F401
{"/functoolsplus/hof.py": ["/functoolsplus/abc.py", "/functoolsplus/utils/implementations.py", "/functoolsplus/utils/singletons.py"], "/tests/containers/test_lazy.py": ["/functoolsplus/containers/lazy.py"], "/tests/strategies.py": ["/tests/functions.py"], "/tests/collections/test_stream.py": ["/functoolsplus/__init__.p...
17,062
apragacz/functoolsplus
refs/heads/master
/functoolsplus/collections/base.py
import abc from collections.abc import Iterable, Reversible from itertools import islice from functoolsplus.abc import Filterable, Functor, Monad class SingleLinkedStruct(Iterable, Filterable, Functor, Monad): @classmethod @abc.abstractclassmethod def get_empty(cls): raise NotImplementedError() ...
{"/functoolsplus/hof.py": ["/functoolsplus/abc.py", "/functoolsplus/utils/implementations.py", "/functoolsplus/utils/singletons.py"], "/tests/containers/test_lazy.py": ["/functoolsplus/containers/lazy.py"], "/tests/strategies.py": ["/tests/functions.py"], "/tests/collections/test_stream.py": ["/functoolsplus/__init__.p...
17,063
apragacz/functoolsplus
refs/heads/master
/tests/test_hof.py
import pytest from hypothesis import given from hypothesis import strategies as st from functoolsplus import filter as generic_filter from functoolsplus import flatmap, fold from functoolsplus import map as generic_map from functoolsplus import unit from functoolsplus.abc import Filterable, Foldable, Functor, Monad fr...
{"/functoolsplus/hof.py": ["/functoolsplus/abc.py", "/functoolsplus/utils/implementations.py", "/functoolsplus/utils/singletons.py"], "/tests/containers/test_lazy.py": ["/functoolsplus/containers/lazy.py"], "/tests/strategies.py": ["/tests/functions.py"], "/tests/collections/test_stream.py": ["/functoolsplus/__init__.p...
17,064
apragacz/functoolsplus
refs/heads/master
/functoolsplus/abc.py
import abc from functoolsplus.utils.singletons import Missing class Functor(metaclass=abc.ABCMeta): @abc.abstractmethod def __map__(self, func): return NotImplemented @classmethod def __subclasshook__(cls, C): if cls is Functor: return _check_methods(C, '__map__') ...
{"/functoolsplus/hof.py": ["/functoolsplus/abc.py", "/functoolsplus/utils/implementations.py", "/functoolsplus/utils/singletons.py"], "/tests/containers/test_lazy.py": ["/functoolsplus/containers/lazy.py"], "/tests/strategies.py": ["/tests/functions.py"], "/tests/collections/test_stream.py": ["/functoolsplus/__init__.p...
17,065
apragacz/functoolsplus
refs/heads/master
/functoolsplus/collections/streams.py
from functools import partial from functoolsplus.collections.base import SingleLinkedStruct from functoolsplus.containers.lazy import LazyValue from functoolsplus.hof import filter as generic_filter from functoolsplus.hof import flatmap from functoolsplus.hof import map as generic_map from functoolsplus.utils.singleto...
{"/functoolsplus/hof.py": ["/functoolsplus/abc.py", "/functoolsplus/utils/implementations.py", "/functoolsplus/utils/singletons.py"], "/tests/containers/test_lazy.py": ["/functoolsplus/containers/lazy.py"], "/tests/strategies.py": ["/tests/functions.py"], "/tests/collections/test_stream.py": ["/functoolsplus/__init__.p...
17,066
apragacz/functoolsplus
refs/heads/master
/functoolsplus/__init__.py
from functoolsplus.containers.pipes import P, Pipe, PipeRegistry # noqa: F401 from functoolsplus.containers.pipes import default_registry as default_pipe_registry # noqa: F401, E501 from functoolsplus.hof import filter, flatmap, fold, map, unit # noqa: F401 __version__ = '0.0.1'
{"/functoolsplus/hof.py": ["/functoolsplus/abc.py", "/functoolsplus/utils/implementations.py", "/functoolsplus/utils/singletons.py"], "/tests/containers/test_lazy.py": ["/functoolsplus/containers/lazy.py"], "/tests/strategies.py": ["/tests/functions.py"], "/tests/collections/test_stream.py": ["/functoolsplus/__init__.p...
17,067
apragacz/functoolsplus
refs/heads/master
/functoolsplus/containers/pipes.py
from collections.abc import Callable, Mapping from functools import partial from functoolsplus.hof import filter as generic_filter from functoolsplus.hof import flatmap, fold from functoolsplus.hof import map as generic_map from functoolsplus.utils.singletons import Missing class PipeRegistry(Mapping): def __in...
{"/functoolsplus/hof.py": ["/functoolsplus/abc.py", "/functoolsplus/utils/implementations.py", "/functoolsplus/utils/singletons.py"], "/tests/containers/test_lazy.py": ["/functoolsplus/containers/lazy.py"], "/tests/strategies.py": ["/tests/functions.py"], "/tests/collections/test_stream.py": ["/functoolsplus/__init__.p...
17,068
apragacz/functoolsplus
refs/heads/master
/functoolsplus/containers/lazy.py
from functoolsplus.abc import Functor from functoolsplus.utils.singletons import new_singleton class UnevaluatedType(object): def __new__(cls): return new_singleton(cls) def __repr__(self): return '<unevaluated>' def __str__(self): return repr(self) Unevaluated = UnevaluatedTy...
{"/functoolsplus/hof.py": ["/functoolsplus/abc.py", "/functoolsplus/utils/implementations.py", "/functoolsplus/utils/singletons.py"], "/tests/containers/test_lazy.py": ["/functoolsplus/containers/lazy.py"], "/tests/strategies.py": ["/tests/functions.py"], "/tests/collections/test_stream.py": ["/functoolsplus/__init__.p...
17,082
fagan2888/Python-Weighted-Means
refs/heads/master
/test_solution.py
#To test in terminal call: pytest test_solution.py -v --durations=1 import solution import pytest import numpy as np def test_three_groups(): vals = [1, 2, 3, 8, 5] grps_1 = ['USA', 'USA', 'USA', 'USA', 'USA'] grps_2 = ['MA', 'MA', 'MA', 'RI', 'RI'] grps_3 = ['WEYMOUTH', 'BOSTON', 'BOSTON', ...
{"/test_solution.py": ["/solution.py"]}
17,083
fagan2888/Python-Weighted-Means
refs/heads/master
/solution.py
import numpy as np def group_adjust(vals,groups,weights): #Check if inputs are appropriate for j in groups: if len(j) != len(vals): raise ValueError('Size of each group must be same as size of val list') if len(groups) != len(weights): raise ValueError('Number of weigh...
{"/test_solution.py": ["/solution.py"]}
17,098
ctrlcctrlv/WhergBot
refs/heads/master
/Plugins/LastSeen/lastseen.py
#!/usr/bin/env python import sqlite3 import time class Seen(object): def __init__(self, database=":memory:"): self.database = database self.Conn = sqlite3.connect(self.database, check_same_thread = False) self.Cursor = self.Conn.cursor() self.Cursor.execute("CREATE TABLE IF NOT EXISTS lastseen (nick TEXT PRI...
{"/Plugins/Gentbot/Main.py": ["/Plugins/Gentbot/Settings.py"]}
17,099
ctrlcctrlv/WhergBot
refs/heads/master
/Plugins/LastSeen/Settings.py
Settings = {"database": "LastSeen.sql3" ,"timestamp": "%h %d, %Y around %I:%M:%S %p" # 12 hr w/ am/pm # ,"timestamp": "%h %d, %Y around %H:%M:%S" # 24 hr format ,"blacklist": ["#opers", "#services"] }
{"/Plugins/Gentbot/Main.py": ["/Plugins/Gentbot/Settings.py"]}
17,100
ctrlcctrlv/WhergBot
refs/heads/master
/Plugins/Gentbot/Settings.py
Settings = { 'allowed':['Ferus!anonymous@the.interwebs'] ,'gentbot': { 'replyrate': 15 ,"data_dir": "Plugins/Gentbot/data/" #data dir ,"num_contexts": 0 # Total word contextx ,"num_words": 0 # Total unique words known ,"max_words": 12000 # Max limit in the number of words known ,"learning": True # Allow t...
{"/Plugins/Gentbot/Main.py": ["/Plugins/Gentbot/Settings.py"]}
17,101
ctrlcctrlv/WhergBot
refs/heads/master
/Plugins/Gentbot/Main.py
#! /usr/bin/env python from time import sleep from threading import Thread try: import queue except ImportError: import Queue as queue from . import pyborg from .Settings import Settings class TwitterOutput(object): def __init__(self, oauth_keys): twitter = __import__('twitter') self.apiHandle = twitter.Api(**...
{"/Plugins/Gentbot/Main.py": ["/Plugins/Gentbot/Settings.py"]}
17,102
ctrlcctrlv/WhergBot
refs/heads/master
/Plugins/UrbanDictionary/Main.py
#!/usr/bin/env python import requests import re import json from html import entities as htmlentitydefs import logging logger = logging.getLogger("UrbanDictionary") from Parser import Locker Locker = Locker(5) from .Settings import Settings def convert(text): """Decode HTML entities in the given text.""" try: i...
{"/Plugins/Gentbot/Main.py": ["/Plugins/Gentbot/Settings.py"]}
17,103
ctrlcctrlv/WhergBot
refs/heads/master
/Config.py
#!/usr/bin/env python Global = { "unwantedchars": "\x03(?:[0-9]{1,2})?(?:,[0-9]{1,2})?|\x02|\x07|\x1F" } Servers = { "DatNode": {"host": "mempsimoiria.datnode.net" ,"port": 6697 ,"nick": "Wherg" ,"realname": "WhergBot 2.0 [Ferus]" ,"ident": "Wherg" ,"channels": "#boats" ,"ssl": True ,"enabled": True...
{"/Plugins/Gentbot/Main.py": ["/Plugins/Gentbot/Settings.py"]}