index
int64
repo_name
string
branch_name
string
path
string
content
string
import_graph
string
20,001
AvatarGanymede/ChinesePaintingStyle
refs/heads/master
/models/__init__.py
from . import cycle_gan def create_model(isTrain): instance = cycle_gan.CycleGANModel(isTrain) print("model [%s] was created" % type(instance).__name__) return instance
{"/models/models.py": ["/utils/params.py"], "/test.py": ["/utils/__init__.py", "/models/__init__.py", "/utils/params.py"], "/main.py": ["/gui/chinesepaintings.py", "/models/__init__.py", "/edge/hed.py", "/utils/params.py", "/utils/__init__.py"], "/utils/__init__.py": ["/utils/dataset.py", "/utils/params.py"], "/gui/chi...
20,002
AvatarGanymede/ChinesePaintingStyle
refs/heads/master
/gui/notitle.py
#!/usr/bin/env python # -*- coding:utf-8 -*- # Author: jyroy import sys from PyQt5.QtCore import Qt, pyqtSignal, QPoint from PyQt5.QtGui import QFont from PyQt5.QtWidgets import QHBoxLayout, QLabel, QSpacerItem, QSizePolicy from PyQt5.QtWidgets import QWidget, QPushButton # 样式 StyleSheet = """ /*标题栏*/ TitleBar { ...
{"/models/models.py": ["/utils/params.py"], "/test.py": ["/utils/__init__.py", "/models/__init__.py", "/utils/params.py"], "/main.py": ["/gui/chinesepaintings.py", "/models/__init__.py", "/edge/hed.py", "/utils/params.py", "/utils/__init__.py"], "/utils/__init__.py": ["/utils/dataset.py", "/utils/params.py"], "/gui/chi...
20,003
AvatarGanymede/ChinesePaintingStyle
refs/heads/master
/utils/dataset.py
import os from PIL import Image import random import torchvision.transforms as transforms from utils.params import opt IMG_EXTENSIONS = [ '.jpg', '.JPG', '.jpeg', '.JPEG', '.png', '.PNG', '.ppm', '.PPM', '.bmp', '.BMP', '.tif', '.TIF', '.tiff', '.TIFF', ] def get_transform(method=Image.BICUBIC): trans...
{"/models/models.py": ["/utils/params.py"], "/test.py": ["/utils/__init__.py", "/models/__init__.py", "/utils/params.py"], "/main.py": ["/gui/chinesepaintings.py", "/models/__init__.py", "/edge/hed.py", "/utils/params.py", "/utils/__init__.py"], "/utils/__init__.py": ["/utils/dataset.py", "/utils/params.py"], "/gui/chi...
20,004
AvatarGanymede/ChinesePaintingStyle
refs/heads/master
/models/cycle_gan.py
import torch import itertools from utils.image_pool import ImagePool from utils.params import opt from . import models from . import gan_loss import os from collections import OrderedDict class CycleGANModel: def __init__(self, isTrain): """Initialize the CycleGAN class. Parameters: ...
{"/models/models.py": ["/utils/params.py"], "/test.py": ["/utils/__init__.py", "/models/__init__.py", "/utils/params.py"], "/main.py": ["/gui/chinesepaintings.py", "/models/__init__.py", "/edge/hed.py", "/utils/params.py", "/utils/__init__.py"], "/utils/__init__.py": ["/utils/dataset.py", "/utils/params.py"], "/gui/chi...
20,005
AvatarGanymede/ChinesePaintingStyle
refs/heads/master
/edge/hed.py
import cv2 as cv import os import numpy as np import matplotlib.image as mp from skimage import img_as_ubyte from PIL import Image class CropLayer(object): def __init__(self, params, blobs): self.xstart = 0 self.xend = 0 self.ystart = 0 self.yend = 0 # Our layer receives two i...
{"/models/models.py": ["/utils/params.py"], "/test.py": ["/utils/__init__.py", "/models/__init__.py", "/utils/params.py"], "/main.py": ["/gui/chinesepaintings.py", "/models/__init__.py", "/edge/hed.py", "/utils/params.py", "/utils/__init__.py"], "/utils/__init__.py": ["/utils/dataset.py", "/utils/params.py"], "/gui/chi...
20,006
AvatarGanymede/ChinesePaintingStyle
refs/heads/master
/utils/params.py
opt = dict( load_size=286, # scale images to this size crop_size=256, # then crop to this size batch_size=1, # input batch size num_threads=1, # treads for loading data gpu_ids=[0], # id of gpu lambda_identity=0....
{"/models/models.py": ["/utils/params.py"], "/test.py": ["/utils/__init__.py", "/models/__init__.py", "/utils/params.py"], "/main.py": ["/gui/chinesepaintings.py", "/models/__init__.py", "/edge/hed.py", "/utils/params.py", "/utils/__init__.py"], "/utils/__init__.py": ["/utils/dataset.py", "/utils/params.py"], "/gui/chi...
20,008
matthew-sessions/DS7_Unit3_print4
refs/heads/master
/aq_dashboard.py
from flask import Flask, render_template, request, redirect, url_for import openaq_py from get_data import * from flask_sqlalchemy import SQLAlchemy import pygal app = Flask(__name__) app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///db.sqlite3' DB = SQLAlchemy(app) class Record(DB.Model): id = DB.Column(DB.I...
{"/aq_dashboard.py": ["/get_data.py"]}
20,009
matthew-sessions/DS7_Unit3_print4
refs/heads/master
/get_data.py
import openaq_py def data_grab(city, parameter): """Basic fucntion to get the base data""" api = openaq_py.OpenAQ() status, body = api.measurements(city=city, parameter=parameter) li = [(i['date']['utc'], i['value']) for i in body['results']] return li def drop_downs(): api = openaq_py.OpenA...
{"/aq_dashboard.py": ["/get_data.py"]}
20,013
fatimaavila/linkQueueFlask
refs/heads/master
/queue.py
from linked_list import LinkedList,Node import __main__ class Queue(LinkedList,Node): def __repr__(self): node = self.head nodes = [] __main__.linksy.clear() while node is not None: nodes.append('<a href="'+node.data.split("|")[0]+'" target="_blank">'+node.data.split("|")[1]+'</a>') __mai...
{"/queue.py": ["/linked_list.py"], "/main.py": ["/linked_list.py", "/queue.py", "/sort.py", "/search.py"]}
20,014
fatimaavila/linkQueueFlask
refs/heads/master
/sort.py
# Python program for implementation of Selection def selSort(A): for i in range(len(A)): # Find the minimum element in remaining # unsorted array min_idx = i for j in range(i+1, len(A)): if ord(A[min_idx].split("|")[2]) > ord(A[j].split("|")[2]): min_idx = j # Swap the...
{"/queue.py": ["/linked_list.py"], "/main.py": ["/linked_list.py", "/queue.py", "/sort.py", "/search.py"]}
20,015
fatimaavila/linkQueueFlask
refs/heads/master
/main.py
from flask import Flask, render_template, request from random import choice from linked_list import LinkedList, Node from queue import Queue from sort import selSort from search import linearSearch #from search import linearSearch web_site = Flask(__name__) lista2 = Queue() linksy = [] sorteado = [] def gen_html(...
{"/queue.py": ["/linked_list.py"], "/main.py": ["/linked_list.py", "/queue.py", "/sort.py", "/search.py"]}
20,016
fatimaavila/linkQueueFlask
refs/heads/master
/search.py
def linearSearch(array, x): n = len(array) # Going through array sequencially for i in range(0, n): nombre = array[i].split("|")[1] if (x in nombre): return i return -1
{"/queue.py": ["/linked_list.py"], "/main.py": ["/linked_list.py", "/queue.py", "/sort.py", "/search.py"]}
20,017
fatimaavila/linkQueueFlask
refs/heads/master
/linked_list.py
class Node: def __init__(self, data): self.data = data self.next = None def __repr__(self): return "Data: " + self.data class LinkedList: def __init__(self): self.head = None def __repr__(self): node = self.head nodes = [] while node is not None: nodes.append(node.data) ...
{"/queue.py": ["/linked_list.py"], "/main.py": ["/linked_list.py", "/queue.py", "/sort.py", "/search.py"]}
20,035
SengerM/myplotlib
refs/heads/master
/myplotlib/utils.py
from time import sleep import datetime def get_timestamp(): """ Returns a numeric string with a timestamp. It also halts the execution of the program during 10 micro seconds to ensure that all returned timestamps are different and unique. Returns ------- str String containing the timestamp. Format isYYYYMM...
{"/tests/test_error_band.py": ["/myplotlib/__init__.py"], "/myplotlib/wrapper_matplotlib.py": ["/myplotlib/figure.py"], "/tests/test_plot.py": ["/myplotlib/__init__.py"], "/tests/test_fill_between.py": ["/myplotlib/__init__.py"], "/myplotlib/wrapper_saods9.py": ["/myplotlib/figure.py"], "/tests/test_markers.py": ["/myp...
20,036
SengerM/myplotlib
refs/heads/master
/tests/test_error_band.py
import myplotlib as mpl import numpy as np def calc_error(y): return ((y**2)**.5)*.1 + max(y*.01) x = np.linspace(-1,1) y = [ x**3, np.cos(x), x**2, np.exp(x), x, 2*x, 3*(x**2)**.5, -x, np.log(x**2)/8, ] for package in ['plotly']: fig = mpl.manager.new( title = f'Fill between with {package}', subtitle...
{"/tests/test_error_band.py": ["/myplotlib/__init__.py"], "/myplotlib/wrapper_matplotlib.py": ["/myplotlib/figure.py"], "/tests/test_plot.py": ["/myplotlib/__init__.py"], "/tests/test_fill_between.py": ["/myplotlib/__init__.py"], "/myplotlib/wrapper_saods9.py": ["/myplotlib/figure.py"], "/tests/test_markers.py": ["/myp...
20,037
SengerM/myplotlib
refs/heads/master
/myplotlib/figure.py
import numpy as np import warnings from shutil import copyfile import plotly.graph_objects as go class MPLFigure: """ This class defines the interface to be implemented in the subclasses and does all the validation of arguments. For example "title" must be a string, this is validated in this class. How to write th...
{"/tests/test_error_band.py": ["/myplotlib/__init__.py"], "/myplotlib/wrapper_matplotlib.py": ["/myplotlib/figure.py"], "/tests/test_plot.py": ["/myplotlib/__init__.py"], "/tests/test_fill_between.py": ["/myplotlib/__init__.py"], "/myplotlib/wrapper_saods9.py": ["/myplotlib/figure.py"], "/tests/test_markers.py": ["/myp...
20,038
SengerM/myplotlib
refs/heads/master
/myplotlib/wrapper_matplotlib.py
from .figure import MPLFigure import numpy as np class MPLMatplotlibWrapper(MPLFigure): def __init__(self): super().__init__() import matplotlib.pyplot as plt # Import here so if the user does not plot with this package, it does not need to be installed. import matplotlib.colors as colors # Import here so if th...
{"/tests/test_error_band.py": ["/myplotlib/__init__.py"], "/myplotlib/wrapper_matplotlib.py": ["/myplotlib/figure.py"], "/tests/test_plot.py": ["/myplotlib/__init__.py"], "/tests/test_fill_between.py": ["/myplotlib/__init__.py"], "/myplotlib/wrapper_saods9.py": ["/myplotlib/figure.py"], "/tests/test_markers.py": ["/myp...
20,039
SengerM/myplotlib
refs/heads/master
/tests/test_plot.py
import myplotlib as mpl import numpy as np x = np.linspace(1,3) y = x**3 for package in ['matplotlib', 'plotly']: fig = mpl.manager.new( title = f'simple plot with {package}', subtitle = f'This is a test', xlabel = 'x axis', ylabel = 'y axis', package = package, ) fig.plot( x, y, label = 'Simple p...
{"/tests/test_error_band.py": ["/myplotlib/__init__.py"], "/myplotlib/wrapper_matplotlib.py": ["/myplotlib/figure.py"], "/tests/test_plot.py": ["/myplotlib/__init__.py"], "/tests/test_fill_between.py": ["/myplotlib/__init__.py"], "/myplotlib/wrapper_saods9.py": ["/myplotlib/figure.py"], "/tests/test_markers.py": ["/myp...
20,040
SengerM/myplotlib
refs/heads/master
/tests/test_fill_between.py
import myplotlib as mpl import numpy as np x = np.linspace(-1,1) y = x**3 for package in ['matplotlib', 'plotly']: fig = mpl.manager.new( title = f'Fill between with {package}', subtitle = f'This is a test', xlabel = 'x axis', ylabel = 'y axis', package = package, ) fig.fill_between( x, y, label =...
{"/tests/test_error_band.py": ["/myplotlib/__init__.py"], "/myplotlib/wrapper_matplotlib.py": ["/myplotlib/figure.py"], "/tests/test_plot.py": ["/myplotlib/__init__.py"], "/tests/test_fill_between.py": ["/myplotlib/__init__.py"], "/myplotlib/wrapper_saods9.py": ["/myplotlib/figure.py"], "/tests/test_markers.py": ["/myp...
20,041
SengerM/myplotlib
refs/heads/master
/myplotlib/wrapper_saods9.py
from .figure import MPLFigure class MPLSaoImageDS9Wrapper(MPLFigure): """ This is a very specific type of figure, intended to be used with images. """ DIRECTORY_FOR_TEMPORARY_FILES = '.myplotlib_ds9_temp' _norm = 'lin' def __init__(self): super().__init__() import os self.os = os from astropy.io impo...
{"/tests/test_error_band.py": ["/myplotlib/__init__.py"], "/myplotlib/wrapper_matplotlib.py": ["/myplotlib/figure.py"], "/tests/test_plot.py": ["/myplotlib/__init__.py"], "/tests/test_fill_between.py": ["/myplotlib/__init__.py"], "/myplotlib/wrapper_saods9.py": ["/myplotlib/figure.py"], "/tests/test_markers.py": ["/myp...
20,042
SengerM/myplotlib
refs/heads/master
/tests/test_markers.py
import myplotlib as mpl import numpy as np x = np.linspace(0,1) for package in ['plotly', 'matplotlib']: fig = mpl.manager.new( title = 'Markers test', package = package, ) fig.plot( x, x**3, label = 'No markers', ) for marker in ['.','x','+','o']: fig.plot( x, x**np.random.rand(), marker = ...
{"/tests/test_error_band.py": ["/myplotlib/__init__.py"], "/myplotlib/wrapper_matplotlib.py": ["/myplotlib/figure.py"], "/tests/test_plot.py": ["/myplotlib/__init__.py"], "/tests/test_fill_between.py": ["/myplotlib/__init__.py"], "/myplotlib/wrapper_saods9.py": ["/myplotlib/figure.py"], "/tests/test_markers.py": ["/myp...
20,043
SengerM/myplotlib
refs/heads/master
/myplotlib/wrapper_plotly.py
from .figure import MPLFigure import numpy as np class MPLPlotlyWrapper(MPLFigure): LINESTYLE_TRANSLATION = { 'solid': None, 'none': None, 'dashed': 'dash', 'dotted': 'dot', } def __init__(self): super().__init__() import plotly.graph_objects as go # Import here so if the user does not plot with this...
{"/tests/test_error_band.py": ["/myplotlib/__init__.py"], "/myplotlib/wrapper_matplotlib.py": ["/myplotlib/figure.py"], "/tests/test_plot.py": ["/myplotlib/__init__.py"], "/tests/test_fill_between.py": ["/myplotlib/__init__.py"], "/myplotlib/wrapper_saods9.py": ["/myplotlib/figure.py"], "/tests/test_markers.py": ["/myp...
20,044
SengerM/myplotlib
refs/heads/master
/tests/test_hist.py
import myplotlib as mpl import numpy as np samples = [np.random.randn(999)*2*i for i in range(3)] for package in ['matplotlib', 'plotly']: fig = mpl.manager.new( title = f'simple histogram with {package}', subtitle = f'This is a test', xlabel = 'x axis', ylabel = 'y axis', package = package, ) for idx,s ...
{"/tests/test_error_band.py": ["/myplotlib/__init__.py"], "/myplotlib/wrapper_matplotlib.py": ["/myplotlib/figure.py"], "/tests/test_plot.py": ["/myplotlib/__init__.py"], "/tests/test_fill_between.py": ["/myplotlib/__init__.py"], "/myplotlib/wrapper_saods9.py": ["/myplotlib/figure.py"], "/tests/test_markers.py": ["/myp...
20,045
SengerM/myplotlib
refs/heads/master
/myplotlib/__init__.py
from .wrapper_matplotlib import MPLMatplotlibWrapper from .wrapper_plotly import MPLPlotlyWrapper from .wrapper_saods9 import MPLSaoImageDS9Wrapper from .utils import get_timestamp import os import __main__ from pathlib import Path import warnings warnings.warn(f'The package "myplotlib" is deprecated, not maintained a...
{"/tests/test_error_band.py": ["/myplotlib/__init__.py"], "/myplotlib/wrapper_matplotlib.py": ["/myplotlib/figure.py"], "/tests/test_plot.py": ["/myplotlib/__init__.py"], "/tests/test_fill_between.py": ["/myplotlib/__init__.py"], "/myplotlib/wrapper_saods9.py": ["/myplotlib/figure.py"], "/tests/test_markers.py": ["/myp...
20,046
SengerM/myplotlib
refs/heads/master
/tests/test_contour_colormap.py
import myplotlib as mpl import numpy as np x = np.linspace(-1,1) y = x xx, yy = np.meshgrid(x,y) zz = xx**4 + yy**2 + np.random.rand(*xx.shape)*.1 for package in ['matplotlib', 'plotly']: fig = mpl.manager.new( title = f'colormap with {package} linear scale', subtitle = f'This is a test', xlabel = 'x axis', ...
{"/tests/test_error_band.py": ["/myplotlib/__init__.py"], "/myplotlib/wrapper_matplotlib.py": ["/myplotlib/figure.py"], "/tests/test_plot.py": ["/myplotlib/__init__.py"], "/tests/test_fill_between.py": ["/myplotlib/__init__.py"], "/myplotlib/wrapper_saods9.py": ["/myplotlib/figure.py"], "/tests/test_markers.py": ["/myp...
20,049
woblob/UI-Select_text_to_print
refs/heads/main
/edittab.py
from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * from lxml import etree as et import datetime class NameItem(QStandardItem): def __init__(self, txt): super().__init__() self.setEditable(True) self.setText(txt) self.setCheckState(Qt.Unchecked) ...
{"/main.py": ["/selecttab.py", "/edittab.py"]}
20,050
woblob/UI-Select_text_to_print
refs/heads/main
/main.py
from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * import sys import lxml.etree as et from selecttab import SelectTab from edittab import EditTab # Edycja elementu: zrobione jako klikanie # zebranie info co drukowac: zrobione # zapis do pliku: zrobione # potwierdzenie zapisu: zrobione #...
{"/main.py": ["/selecttab.py", "/edittab.py"]}
20,051
woblob/UI-Select_text_to_print
refs/heads/main
/selecttab.py
from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * import sys from docx import Document class SelectTab(QWidget): def __init__(self, link): super().__init__() self.database = link.database self.tree_model = link.tree_model self.signal = link.send_sig...
{"/main.py": ["/selecttab.py", "/edittab.py"]}
20,057
vvojvoda/django_iban_test
refs/heads/master
/nulliban/tests.py
from django.test import TestCase # Create your tests here. from nulliban.models import NullIban class NullIbanTest(TestCase): def test_null_iban_field(self): iban = NullIban() iban.save()
{"/nulliban/tests.py": ["/nulliban/models.py"]}
20,058
vvojvoda/django_iban_test
refs/heads/master
/nulliban/models.py
from django.db import models from django_iban.fields import IBANField class NullIban(models.Model): iban = IBANField(null=True, blank=True)
{"/nulliban/tests.py": ["/nulliban/models.py"]}
20,060
DiegoVilela/internalize
refs/heads/main
/cis/mixins.py
from django.contrib.auth.mixins import UserPassesTestMixin class UserApprovedMixin(UserPassesTestMixin): """ Deny access to unapproved users. """ def test_func(self): return self.request.user.is_authenticated and self.request.user.is_approved class AddClientMixin: """ Add the client ...
{"/cis/tests/tests_views.py": ["/cis/models.py", "/accounts/models.py"], "/cis/forms.py": ["/cis/models.py"], "/cis/tests/tests_functionals.py": ["/accounts/models.py", "/cis/models.py", "/cis/urls.py"], "/accounts/tests.py": ["/accounts/models.py", "/cis/models.py"], "/cis/tests/tests_models.py": ["/accounts/models.py...
20,061
DiegoVilela/internalize
refs/heads/main
/cis/tests/tests_views.py
from datetime import timedelta from collections import namedtuple from dataclasses import dataclass from django.utils import timezone from django.test import TestCase from django.shortcuts import reverse from ..models import Client, Place, Appliance, Manufacturer, CI, Contract from accounts.models import User @datac...
{"/cis/tests/tests_views.py": ["/cis/models.py", "/accounts/models.py"], "/cis/forms.py": ["/cis/models.py"], "/cis/tests/tests_functionals.py": ["/accounts/models.py", "/cis/models.py", "/cis/urls.py"], "/accounts/tests.py": ["/accounts/models.py", "/cis/models.py"], "/cis/tests/tests_models.py": ["/accounts/models.py...
20,062
DiegoVilela/internalize
refs/heads/main
/cis/forms.py
from django import forms from .models import CI, Place, Appliance, Client class UploadCIsForm(forms.Form): file = forms.FileField() class CIForm(forms.ModelForm): appliances = forms.ModelMultipleChoiceField(queryset=None) place = forms.ModelChoiceField(queryset=None) def __init__(self, *args, **kw...
{"/cis/tests/tests_views.py": ["/cis/models.py", "/accounts/models.py"], "/cis/forms.py": ["/cis/models.py"], "/cis/tests/tests_functionals.py": ["/accounts/models.py", "/cis/models.py", "/cis/urls.py"], "/accounts/tests.py": ["/accounts/models.py", "/cis/models.py"], "/cis/tests/tests_models.py": ["/accounts/models.py...
20,063
DiegoVilela/internalize
refs/heads/main
/cis/tests/tests_functionals.py
""" Functional tests. Requires Selenium and geckodriver. """ from django.conf import settings from django.test import tag from django.contrib.staticfiles.testing import StaticLiveServerTestCase from selenium.webdriver.firefox.webdriver import WebDriver from selenium.webdriver.common.keys import Keys from selenium.web...
{"/cis/tests/tests_views.py": ["/cis/models.py", "/accounts/models.py"], "/cis/forms.py": ["/cis/models.py"], "/cis/tests/tests_functionals.py": ["/accounts/models.py", "/cis/models.py", "/cis/urls.py"], "/accounts/tests.py": ["/accounts/models.py", "/cis/models.py"], "/cis/tests/tests_models.py": ["/accounts/models.py...
20,064
DiegoVilela/internalize
refs/heads/main
/accounts/models.py
from django.db import models from django.contrib.auth.models import AbstractUser, UserManager class UserClientManager(UserManager): def get_queryset(self): return super().get_queryset().select_related('client') class User(AbstractUser): client = models.ForeignKey('cis.Client', on_delete=models.CASCA...
{"/cis/tests/tests_views.py": ["/cis/models.py", "/accounts/models.py"], "/cis/forms.py": ["/cis/models.py"], "/cis/tests/tests_functionals.py": ["/accounts/models.py", "/cis/models.py", "/cis/urls.py"], "/accounts/tests.py": ["/accounts/models.py", "/cis/models.py"], "/cis/tests/tests_models.py": ["/accounts/models.py...
20,065
DiegoVilela/internalize
refs/heads/main
/accounts/tests.py
from django.test import TestCase from django.db.utils import IntegrityError from .models import User from cis.models import Client class UserTest(TestCase): @classmethod def setUpTestData(cls): cls.user = User.objects.create_user(username='new', email='new@example.com') def test_is_approved_retu...
{"/cis/tests/tests_views.py": ["/cis/models.py", "/accounts/models.py"], "/cis/forms.py": ["/cis/models.py"], "/cis/tests/tests_functionals.py": ["/accounts/models.py", "/cis/models.py", "/cis/urls.py"], "/accounts/tests.py": ["/accounts/models.py", "/cis/models.py"], "/cis/tests/tests_models.py": ["/accounts/models.py...
20,066
DiegoVilela/internalize
refs/heads/main
/internalize/settings.py
""" Django settings for internalize project. Generated by 'django-admin startproject' using Django 3.1.5. For more information on this file, see https://docs.djangoproject.com/en/3.2/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/3.2/ref/settings/ """ import d...
{"/cis/tests/tests_views.py": ["/cis/models.py", "/accounts/models.py"], "/cis/forms.py": ["/cis/models.py"], "/cis/tests/tests_functionals.py": ["/accounts/models.py", "/cis/models.py", "/cis/urls.py"], "/accounts/tests.py": ["/accounts/models.py", "/cis/models.py"], "/cis/tests/tests_models.py": ["/accounts/models.py...
20,067
DiegoVilela/internalize
refs/heads/main
/cis/tests/tests_models.py
from django.shortcuts import reverse from django.test import TestCase from django.db.utils import IntegrityError from accounts.models import User from ..models import Client, Place, Manufacturer, Contract, Appliance, CI, CIPack CLIENT_NAME = 'Client A' PLACE_NAME = 'Main' MANUFACTURER = 'Cisco Systems' CONTRACT_NAME ...
{"/cis/tests/tests_views.py": ["/cis/models.py", "/accounts/models.py"], "/cis/forms.py": ["/cis/models.py"], "/cis/tests/tests_functionals.py": ["/accounts/models.py", "/cis/models.py", "/cis/urls.py"], "/accounts/tests.py": ["/accounts/models.py", "/cis/models.py"], "/cis/tests/tests_models.py": ["/accounts/models.py...
20,068
DiegoVilela/internalize
refs/heads/main
/cis/tests/tests_loader.py
from pathlib import Path from collections import namedtuple from openpyxl import Workbook from django.test import TestCase from accounts.models import User from ..models import Client, Place, Contract, Manufacturer from ..loader import CILoader from ..cis_mapping import CIS_SHEET, \ APPLIANCES_SHEET SPREADSHEET_F...
{"/cis/tests/tests_views.py": ["/cis/models.py", "/accounts/models.py"], "/cis/forms.py": ["/cis/models.py"], "/cis/tests/tests_functionals.py": ["/accounts/models.py", "/cis/models.py", "/cis/urls.py"], "/accounts/tests.py": ["/accounts/models.py", "/cis/models.py"], "/cis/tests/tests_models.py": ["/accounts/models.py...
20,069
DiegoVilela/internalize
refs/heads/main
/cis/migrations/0001_initial.py
# Generated by Django 3.2 on 2021-04-28 17:16 from django.conf import settings import django.core.validators from django.db import migrations, models import django.db.models.deletion import fernet_fields.fields class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappa...
{"/cis/tests/tests_views.py": ["/cis/models.py", "/accounts/models.py"], "/cis/forms.py": ["/cis/models.py"], "/cis/tests/tests_functionals.py": ["/accounts/models.py", "/cis/models.py", "/cis/urls.py"], "/accounts/tests.py": ["/accounts/models.py", "/cis/models.py"], "/cis/tests/tests_models.py": ["/accounts/models.py...
20,070
DiegoVilela/internalize
refs/heads/main
/cis/admin.py
from django.contrib import admin, messages from django.contrib.admin import AdminSite from django.db import DatabaseError, transaction from django.db.models import QuerySet from django.urls import reverse from django.utils.html import format_html from django.utils.safestring import mark_safe from django.utils.translati...
{"/cis/tests/tests_views.py": ["/cis/models.py", "/accounts/models.py"], "/cis/forms.py": ["/cis/models.py"], "/cis/tests/tests_functionals.py": ["/accounts/models.py", "/cis/models.py", "/cis/urls.py"], "/accounts/tests.py": ["/accounts/models.py", "/cis/models.py"], "/cis/tests/tests_models.py": ["/accounts/models.py...
20,071
DiegoVilela/internalize
refs/heads/main
/cis/models.py
from typing import Tuple, NewType from django.contrib import admin from django.core.validators import MinValueValidator, MaxValueValidator from django.db import models from django.urls import reverse from django.utils import timezone from fernet_fields import EncryptedCharField from accounts.models import User CIId...
{"/cis/tests/tests_views.py": ["/cis/models.py", "/accounts/models.py"], "/cis/forms.py": ["/cis/models.py"], "/cis/tests/tests_functionals.py": ["/accounts/models.py", "/cis/models.py", "/cis/urls.py"], "/accounts/tests.py": ["/accounts/models.py", "/cis/models.py"], "/cis/tests/tests_models.py": ["/accounts/models.py...
20,072
DiegoVilela/internalize
refs/heads/main
/cis/urls.py
from django.urls import path from . import views app_name = 'cis' urlpatterns = [ path('cis/<status>/', views.CIListView.as_view(), name='ci_list'), path('ci/create/', views.CICreateView.as_view(), name='ci_create'), path('ci/upload/', views.ci_upload, name='ci_upload'), path('ci/<int:pk>', views.CIDe...
{"/cis/tests/tests_views.py": ["/cis/models.py", "/accounts/models.py"], "/cis/forms.py": ["/cis/models.py"], "/cis/tests/tests_functionals.py": ["/accounts/models.py", "/cis/models.py", "/cis/urls.py"], "/accounts/tests.py": ["/accounts/models.py", "/cis/models.py"], "/cis/tests/tests_models.py": ["/accounts/models.py...
20,073
DiegoVilela/internalize
refs/heads/main
/cis/views.py
from django.db import DatabaseError from django.shortcuts import render, redirect from django.utils.translation import ngettext from django.views.generic import ListView, DetailView, CreateView, UpdateView from django.contrib.auth.decorators import login_required from django.contrib.auth.mixins import LoginRequiredMixi...
{"/cis/tests/tests_views.py": ["/cis/models.py", "/accounts/models.py"], "/cis/forms.py": ["/cis/models.py"], "/cis/tests/tests_functionals.py": ["/accounts/models.py", "/cis/models.py", "/cis/urls.py"], "/accounts/tests.py": ["/accounts/models.py", "/cis/models.py"], "/cis/tests/tests_models.py": ["/accounts/models.py...
20,074
DiegoVilela/internalize
refs/heads/main
/accounts/admin.py
from django.contrib import admin from django.contrib.auth.admin import UserAdmin from django.utils.translation import gettext, gettext_lazy as _ from .forms import CustomUserCreationForm, CustomUserChangeForm from .models import User @admin.register(User) class CustomUserAdmin(UserAdmin): add_form = CustomUserCr...
{"/cis/tests/tests_views.py": ["/cis/models.py", "/accounts/models.py"], "/cis/forms.py": ["/cis/models.py"], "/cis/tests/tests_functionals.py": ["/accounts/models.py", "/cis/models.py", "/cis/urls.py"], "/accounts/tests.py": ["/accounts/models.py", "/cis/models.py"], "/cis/tests/tests_models.py": ["/accounts/models.py...
20,075
DiegoVilela/internalize
refs/heads/main
/cis/cis_mapping.py
""" Field names and their column location (zero-indexed) on the spreadsheet """ CIS_SHEET = 'cis' # Fields in "cis" sheet HOSTNAME = 0 IP = 1 DESCRIPTION = 2 DEPLOYED = 3 BUSINESS_IMPACT = 4 # Site fields in "cis" sheet PLACE = 5 PLACE_DESCRIPTION = 6 # Contract fields in "cis" sheet CONTRACT = 7 CONTRACT_BEGIN = 8 ...
{"/cis/tests/tests_views.py": ["/cis/models.py", "/accounts/models.py"], "/cis/forms.py": ["/cis/models.py"], "/cis/tests/tests_functionals.py": ["/accounts/models.py", "/cis/models.py", "/cis/urls.py"], "/accounts/tests.py": ["/accounts/models.py", "/cis/models.py"], "/cis/tests/tests_models.py": ["/accounts/models.py...
20,076
DiegoVilela/internalize
refs/heads/main
/cis/loader.py
import logging from collections import namedtuple from openpyxl import load_workbook from django.db import IntegrityError, transaction from typing import Set from .models import Client, Place, CI, Appliance, Contract, Manufacturer from .cis_mapping import HOSTNAME, IP, DESCRIPTION, \ DEPLOYED, BUSINESS_IMPACT, PL...
{"/cis/tests/tests_views.py": ["/cis/models.py", "/accounts/models.py"], "/cis/forms.py": ["/cis/models.py"], "/cis/tests/tests_functionals.py": ["/accounts/models.py", "/cis/models.py", "/cis/urls.py"], "/accounts/tests.py": ["/accounts/models.py", "/cis/models.py"], "/cis/tests/tests_models.py": ["/accounts/models.py...
20,078
brunocvs7/reputation_score
refs/heads/master
/src/data_acquisition.py
# Libs import twint # Functions def get_tweets(query, since, until): """Function to get tweets using a query (string with terms) and two dates, specifying a range to search . Parameters: query (string): query with terms to be used in the search. since (string): string with the initial date. ...
{"/main.py": ["/src/data_acquisition.py"]}
20,079
brunocvs7/reputation_score
refs/heads/master
/main.py
# Libs import os import datetime import pandas as pd from src.data_acquisition import get_tweets # Constants CURRENT_PATH = os.getcwd() DATA_OUTPUT_NAME_RAW = '' DATA_OUTPUT_PATH_RAW = os.path.join(CURRENT_PATH, 'data', 'raw', DATA_OUTPUT_NAME_RAW) INITIAL_DATE = '' FINAL_DATE = '' QUERY = '' # Data Structures range...
{"/main.py": ["/src/data_acquisition.py"]}
20,090
sykuningen/lil_amazons
refs/heads/master
/src/amazons_logic.py
# Tile meanings BLANK = -1 BURNED = -2 class AmazonsLogic: def validMove(self, board, piece, to): # Trying to move to the same tile? if piece == to: return False # Trying to move vertically? elif piece['x'] == to['x']: bgn = min(piece['y'], to['y']) ...
{"/src/Lobby.py": ["/src/Logger.py"], "/server.py": ["/src/Game.py", "/src/Lobby.py", "/src/Logger.py", "/src/User.py"], "/src/Game.py": ["/src/Logger.py", "/src/amazons_logic.py"]}
20,091
sykuningen/lil_amazons
refs/heads/master
/src/Lobby.py
from .Logger import logger class Lobby: def __init__(self, lobby_id, owner): self.id = lobby_id self.owner = owner self.users = [] # All users currently in the lobby self.players = [] # Users that are in the actual players list self.started = False # Whether the...
{"/src/Lobby.py": ["/src/Logger.py"], "/server.py": ["/src/Game.py", "/src/Lobby.py", "/src/Logger.py", "/src/User.py"], "/src/Game.py": ["/src/Logger.py", "/src/amazons_logic.py"]}
20,092
sykuningen/lil_amazons
refs/heads/master
/src/User.py
class User: def __init__(self, sid, ai_player=False): self.sid = sid self.logged_in = False self.username = None self.lobby = None # AI self.ai_player = ai_player if ai_player: self.username = 'AI Player' def setUsername(self, username): ...
{"/src/Lobby.py": ["/src/Logger.py"], "/server.py": ["/src/Game.py", "/src/Lobby.py", "/src/Logger.py", "/src/User.py"], "/src/Game.py": ["/src/Logger.py", "/src/amazons_logic.py"]}
20,093
sykuningen/lil_amazons
refs/heads/master
/server.py
import eventlet import os import socketio from src.Game import Game from src.Lobby import Lobby from src.Logger import logger from src.User import User # *============================================================= SERVER INIT static_files = { '/': 'pages/index.html', '/css/defa...
{"/src/Lobby.py": ["/src/Logger.py"], "/server.py": ["/src/Game.py", "/src/Lobby.py", "/src/Logger.py", "/src/User.py"], "/src/Game.py": ["/src/Logger.py", "/src/amazons_logic.py"]}
20,094
sykuningen/lil_amazons
refs/heads/master
/src/Logger.py
class Logger: def __init__(self): self.listeners = [] self.messages = [] def setSIO(self, sio): self.sio = sio def addListener(self, sid): if sid not in self.listeners: self.listeners.append(sid) def removeListener(self, sid): if sid in self.listene...
{"/src/Lobby.py": ["/src/Logger.py"], "/server.py": ["/src/Game.py", "/src/Lobby.py", "/src/Logger.py", "/src/User.py"], "/src/Game.py": ["/src/Logger.py", "/src/amazons_logic.py"]}
20,095
sykuningen/lil_amazons
refs/heads/master
/src/Game.py
import json from .Logger import logger from .amazons_logic import AmazonsLogic # Tile meanings BLANK = -1 BURNED = -2 class Board: def __init__(self, width, height): self.width = width self.height = height self.board = [[BLANK for y in range(height)] for x in range(width)] def pla...
{"/src/Lobby.py": ["/src/Logger.py"], "/server.py": ["/src/Game.py", "/src/Lobby.py", "/src/Logger.py", "/src/User.py"], "/src/Game.py": ["/src/Logger.py", "/src/amazons_logic.py"]}
20,103
huhailang9012/audio-extractor
refs/heads/main
/extractor.py
import os import os.path from database.repository import select_by_md5, storage import hashlib audio_dir = "/data/files/audios/" def extract(video_id: str, local_video_path: str): audio_name, audio_extension, local_audio_path = convert_one(local_video_path) with open(local_audio_path, 'rb') as fp: da...
{"/extractor.py": ["/database/repository.py"], "/database/repository.py": ["/audio.py"], "/controller.py": ["/extractor.py", "/database/repository.py"]}
20,104
huhailang9012/audio-extractor
refs/heads/main
/audio.py
class Audio(object): def __init__(self, id: str, name: str, md5: str, video_id: str, local_audio_path: str, format: str, date_created: str): self.id = id self.name = name self.md5 = md5 self.video_id = video_id self.local_audio_path = local_audio_path ...
{"/extractor.py": ["/database/repository.py"], "/database/repository.py": ["/audio.py"], "/controller.py": ["/extractor.py", "/database/repository.py"]}
20,105
huhailang9012/audio-extractor
refs/heads/main
/database/repository.py
import json from datetime import datetime import uuid import hashlib from typing import Dict from audio import Audio from database.database_pool import PostgreSql def insert(id: str, name: str, format: str, md5: str, local_audio_path: str, video_id: str, date_created: str): """ insert into videos ...
{"/extractor.py": ["/database/repository.py"], "/database/repository.py": ["/audio.py"], "/controller.py": ["/extractor.py", "/database/repository.py"]}
20,106
huhailang9012/audio-extractor
refs/heads/main
/controller.py
from fastapi import FastAPI, Query import extractor as ex from database.repository import select_by_ids from typing import List import json app = FastAPI() @app.get("/audio/extract") def audio_extract(video_id: str, local_video_path: str): print('audio_extract') audio_id, local_audio_path = ex.extract(video_i...
{"/extractor.py": ["/database/repository.py"], "/database/repository.py": ["/audio.py"], "/controller.py": ["/extractor.py", "/database/repository.py"]}
20,108
pawissanutt/MutatedSnake
refs/heads/master
/MutatedSnake.py
import arcade from Models import World, Snake SCREEN_HEIGHT = 600 SCREEN_WIDTH = 600 class ModelSprite(arcade.Sprite): def __init__(self, *args, **kwargs): self.model = kwargs.pop('model', None) super().__init__(*args, **kwargs) def sync_with_model(self): if self.model: ...
{"/MutatedSnake.py": ["/Models.py"]}
20,109
pawissanutt/MutatedSnake
refs/heads/master
/Models.py
import math import arcade.key import time import random class Model: def __init__(self, world, x, y, angle): self.world = world self.x = x self.y = y self.angle = angle self.lastx = [x,x,x,x,x] self.lasty = [y,y,y,y,y] self.last_angle = [angle,angle,angle,ang...
{"/MutatedSnake.py": ["/Models.py"]}
20,111
RobertNFisher/KNN
refs/heads/master
/KNN2.py
""" K-NN Model """ import math k = 9 """ Finds the Edistance by taking square root of the summation of the square differences of given features x compared to given features yacross n iterations """ def eDistance(x, y, n): ED = 0 for index in range(n): ED += math.pow(float(x[index]) - floa...
{"/Test.py": ["/PreProcessor.py", "/KNN2.py"]}
20,112
RobertNFisher/KNN
refs/heads/master
/Test.py
""" Name: Robert Fisher Date: 9/16/2019 Class: Machine Learning Prof.: C. Hung """ """ Main Class """ import PreProcessor as pP import KNN2 featureRemovalIndex = -1 irisData = pP.preProcessor("iris.data") studentData = pP.preProcessor("student-mat.csv") data = irisData.getData() data = studentDa...
{"/Test.py": ["/PreProcessor.py", "/KNN2.py"]}
20,113
RobertNFisher/KNN
refs/heads/master
/PreProcessor.py
""" Pre-Processor """ import csv import random as rndm class preProcessor: def __init__(self, filename): data = [] self.test_data = [] self.train_data = [] # Opens CSV file and seperates rows with open(filename) as iData: file = csv.reader(iData, delimiter= ','...
{"/Test.py": ["/PreProcessor.py", "/KNN2.py"]}
20,137
zhucer2003/DAPPER
refs/heads/master
/mods/LorenzXY/defaults.py
# Inspired by berry2014linear, mitchell2014 and Hanna Arnold's thesis. from common import * from mods.LorenzXY.core import nX,m,dxdt,dfdx,plot_state # Wilks2005 uses dt=1e-4 with RK4 for the full model, # and dt=5e-3 with RK2 for the forecast/truncated model. # Typically dt0bs = 0.01 and dt = dtObs/10 for truth. # B...
{"/mods/LorenzXY/defaults.py": ["/mods/LorenzXY/core.py"], "/mods/LorenzXY/truncated.py": ["/mods/LorenzXY/core.py", "/mods/LorenzXY/defaults.py"], "/mods/LorenzXY/illust_parameterizations.py": ["/mods/LorenzXY/core.py", "/mods/LorenzXY/defaults.py"]}
20,138
zhucer2003/DAPPER
refs/heads/master
/mods/LorenzXY/truncated.py
# Use truncated models and larger dt. from common import * from mods.LorenzXY.core import nX,dxdt_detp from mods.LorenzXY.defaults import t t = t.copy() t.dt = 0.05 f = { 'm' : nX, 'model': with_rk4(dxdt_detp,autonom=True), 'noise': 0, } X0 = GaussRV(C=0.01*eye(nX)) h = partial_direct_ob...
{"/mods/LorenzXY/defaults.py": ["/mods/LorenzXY/core.py"], "/mods/LorenzXY/truncated.py": ["/mods/LorenzXY/core.py", "/mods/LorenzXY/defaults.py"], "/mods/LorenzXY/illust_parameterizations.py": ["/mods/LorenzXY/core.py", "/mods/LorenzXY/defaults.py"]}
20,139
zhucer2003/DAPPER
refs/heads/master
/mods/LorenzXY/core.py
#################################### # Lorenz95 two-scale/layer version #################################### # See Wilks 2005 "Effects of stochastic parametrizations in the Lorenz '96 system" # X: large amp, low frequency vars: convective events # Y: small amp, high frequency vars: large-scale synoptic events # # Typ...
{"/mods/LorenzXY/defaults.py": ["/mods/LorenzXY/core.py"], "/mods/LorenzXY/truncated.py": ["/mods/LorenzXY/core.py", "/mods/LorenzXY/defaults.py"], "/mods/LorenzXY/illust_parameterizations.py": ["/mods/LorenzXY/core.py", "/mods/LorenzXY/defaults.py"]}
20,140
zhucer2003/DAPPER
refs/heads/master
/mods/LorenzXY/illust_parameterizations.py
# Plot scattergram of "unresolved tendency" # and the parameterization that emulate it. # We plot the diff: # model_step/dt - true_step/dt (1) # Whereas Wilks plots # model_dxdt - true_step/dt (2) # Another option is: # model_dxdt - true_dxdt (3) # Thus, for us (eqn 1), the model integration s...
{"/mods/LorenzXY/defaults.py": ["/mods/LorenzXY/core.py"], "/mods/LorenzXY/truncated.py": ["/mods/LorenzXY/core.py", "/mods/LorenzXY/defaults.py"], "/mods/LorenzXY/illust_parameterizations.py": ["/mods/LorenzXY/core.py", "/mods/LorenzXY/defaults.py"]}
20,144
rtvasu/ant-colony-tsp
refs/heads/main
/aco-a.py
from parameters import * import numpy as np def euclidean(c1, c2): return pow(pow(c1[0] - c2[0], 2) + pow(c1[1] - c2[1], 2), 0.5) def parse(filename): with open(filename) as f: content = f.readlines() for line in content: l = line.strip().split() content[int(l[0]) - 1]...
{"/aco-a.py": ["/parameters.py"]}
20,145
rtvasu/ant-colony-tsp
refs/heads/main
/parameters.py
filename = 'bays29.tsp' numAntsList = [30, 125] initPheromoneAmt = 0.0001 numCities = 29 alphaList = [9, 5, 2] betaList = [12, 2, 1] maxIter = 500 evapRate = 0.2 q0 = 0.6 decayCoeffList = [0.2, 0.4, 0.6]
{"/aco-a.py": ["/parameters.py"]}
20,146
racai-ai/ro-ud-autocorrect
refs/heads/master
/fixutils/__init__.py
import sys import os fix_str_const = "{0}: {1}/{2} -> {3}" fix_str_const2 = "{0}: attributes missing for MSD {1}" def read_conllu_file(file: str) -> tuple: """Reads a CoNLL-U format file are returns it.""" print("{0}: reading corpus {1}".format( read_conllu_file.__name__, file), file=sys.stderr, flus...
{"/mark-all.py": ["/fixutils/__init__.py", "/markutils/oblnmod.py"], "/fixutils/numerals.py": ["/fixutils/__init__.py"], "/fixutils/words.py": ["/fixutils/__init__.py"], "/fix-all.py": ["/fixutils/__init__.py", "/fixutils/numerals.py", "/fixutils/words.py", "/fixutils/syntax.py", "/fixutils/punctuation.py"]}
20,147
racai-ai/ro-ud-autocorrect
refs/heads/master
/fixutils/syntax.py
import sys import re _todo_rx = re.compile('ToDo=([^|_]+)') def fix_aux_pass(sentence: list) -> None: """Takes a sentence as returned by conll.read_conllu_file() and makes sure that if an aux:pass is present the subject is also passive.""" auxpass_head = 0 for parts in sentence: drel = parts...
{"/mark-all.py": ["/fixutils/__init__.py", "/markutils/oblnmod.py"], "/fixutils/numerals.py": ["/fixutils/__init__.py"], "/fixutils/words.py": ["/fixutils/__init__.py"], "/fix-all.py": ["/fixutils/__init__.py", "/fixutils/numerals.py", "/fixutils/words.py", "/fixutils/syntax.py", "/fixutils/punctuation.py"]}
20,148
racai-ai/ro-ud-autocorrect
refs/heads/master
/fixutils/punctuation.py
import re _paired_punct_left = '({[„' _paired_punct_right = ')}]”' _delete_prev_space_punct = ',:;.%' # Patterns with UPOSes and punctuation in the middle. # Empty string means any UPOS. _delete_all_space_patterns_punct = [ ['NUM', ',', 'NUM'], ['NUM', '-', 'NUM'], ['', '/', ''] ] _space_after_no_strconst ...
{"/mark-all.py": ["/fixutils/__init__.py", "/markutils/oblnmod.py"], "/fixutils/numerals.py": ["/fixutils/__init__.py"], "/fixutils/words.py": ["/fixutils/__init__.py"], "/fix-all.py": ["/fixutils/__init__.py", "/fixutils/numerals.py", "/fixutils/words.py", "/fixutils/syntax.py", "/fixutils/punctuation.py"]}
20,149
racai-ai/ro-ud-autocorrect
refs/heads/master
/markutils/oblnmod.py
import sys import re _verbadjadv_rx = re.compile('^[VAR]') _substpronnum_rx = re.compile('^([NPM]|Y[np])') def mark_obl(sentence: list) -> None: """ - obl care nu au ca head verbe, adjective sau adverbe; """ for parts in sentence: head = int(parts[6]) drel = parts[7] if drel ...
{"/mark-all.py": ["/fixutils/__init__.py", "/markutils/oblnmod.py"], "/fixutils/numerals.py": ["/fixutils/__init__.py"], "/fixutils/words.py": ["/fixutils/__init__.py"], "/fix-all.py": ["/fixutils/__init__.py", "/fixutils/numerals.py", "/fixutils/words.py", "/fixutils/syntax.py", "/fixutils/punctuation.py"]}
20,150
racai-ai/ro-ud-autocorrect
refs/heads/master
/mark-all.py
import sys from pathlib import Path from fixutils import read_conllu_file from markutils.oblnmod import mark_nmod, mark_obl if __name__ == '__main__': conllu_file = sys.argv[1] if len(sys.argv) != 2: print("Usage: python3 mark-all.py <.conllu file>", file=sys.stderr) exit(1) # end if ...
{"/mark-all.py": ["/fixutils/__init__.py", "/markutils/oblnmod.py"], "/fixutils/numerals.py": ["/fixutils/__init__.py"], "/fixutils/words.py": ["/fixutils/__init__.py"], "/fix-all.py": ["/fixutils/__init__.py", "/fixutils/numerals.py", "/fixutils/words.py", "/fixutils/syntax.py", "/fixutils/punctuation.py"]}
20,151
racai-ai/ro-ud-autocorrect
refs/heads/master
/fixutils/numerals.py
import sys import re from . import fix_str_const, fix_str_const2, morphosyntactic_features _num_rx = re.compile('^[0-9]+([.,][0-9]+)?$') _int_rx = re.compile('^[0-9]+([.,][0-9]+)?(-|﹘|‐|‒|–|—)[0-9]+([.,][0-9]+)?$') _romans = [ 'I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX', 'X', 'XI', 'XII', 'XIII', 'X...
{"/mark-all.py": ["/fixutils/__init__.py", "/markutils/oblnmod.py"], "/fixutils/numerals.py": ["/fixutils/__init__.py"], "/fixutils/words.py": ["/fixutils/__init__.py"], "/fix-all.py": ["/fixutils/__init__.py", "/fixutils/numerals.py", "/fixutils/words.py", "/fixutils/syntax.py", "/fixutils/punctuation.py"]}
20,152
racai-ai/ro-ud-autocorrect
refs/heads/master
/fixutils/words.py
import sys import re from . import fix_str_const, fix_str_const2, morphosyntactic_features _letter_rx = re.compile('^[a-zA-ZșțăîâȘȚĂÎÂ]$') _month_rx = re.compile('^(ianuarie|februarie|martie|aprilie|mai|iunie|iulie|august|septembrie|noiembrie|decembrie)$', re.IGNORECASE) def fix_letters(sentence: list) -> None: "...
{"/mark-all.py": ["/fixutils/__init__.py", "/markutils/oblnmod.py"], "/fixutils/numerals.py": ["/fixutils/__init__.py"], "/fixutils/words.py": ["/fixutils/__init__.py"], "/fix-all.py": ["/fixutils/__init__.py", "/fixutils/numerals.py", "/fixutils/words.py", "/fixutils/syntax.py", "/fixutils/punctuation.py"]}
20,153
racai-ai/ro-ud-autocorrect
refs/heads/master
/fix-all.py
import sys from pathlib import Path from fixutils import read_conllu_file from fixutils.numerals import fix_numerals from fixutils.words import fix_letters, fix_months, fix_to_be from fixutils.syntax import fix_aux_pass, remove_todo, fix_nmod2obl from fixutils.punctuation import add_space_after_no if __name__ == '__ma...
{"/mark-all.py": ["/fixutils/__init__.py", "/markutils/oblnmod.py"], "/fixutils/numerals.py": ["/fixutils/__init__.py"], "/fixutils/words.py": ["/fixutils/__init__.py"], "/fix-all.py": ["/fixutils/__init__.py", "/fixutils/numerals.py", "/fixutils/words.py", "/fixutils/syntax.py", "/fixutils/punctuation.py"]}
20,155
Cedric-Liu/Coding-Journal
refs/heads/master
/Text Analysis and GCP Deployment/conftest.py
import os import pytest @pytest.fixture def rootdir(): return os.path.dirname(os.path.abspath(__file__)) @pytest.fixture def datadir(rootdir): return os.path.join(rootdir, 'data')
{"/Text Analysis and GCP Deployment/music1030/fuzzy_test.py": ["/Text Analysis and GCP Deployment/music1030/fuzzy.py"], "/Text Analysis and GCP Deployment/music1030/billboard_test.py": ["/Text Analysis and GCP Deployment/music1030/billboard.py"]}
20,156
Cedric-Liu/Coding-Journal
refs/heads/master
/Text Analysis and GCP Deployment/music1030/fuzzy.py
from collections import Counter from typing import List import pandas as pd def jaccard_similarity(a: str, b: str) -> float: """Takes in two strings and computes their letter-wise Jaccard similarity for bags. Case should be ignored. """ # TODO: Task 3 # YOUR CODE HERE ...
{"/Text Analysis and GCP Deployment/music1030/fuzzy_test.py": ["/Text Analysis and GCP Deployment/music1030/fuzzy.py"], "/Text Analysis and GCP Deployment/music1030/billboard_test.py": ["/Text Analysis and GCP Deployment/music1030/billboard.py"]}
20,157
Cedric-Liu/Coding-Journal
refs/heads/master
/Text Analysis and GCP Deployment/main.py
import flask import pandas as pd from music1030.billboard import clean_billboard from music1030.spotify import clean_spotify_tracks def handle_billboard(request: flask.Request): """ :param request: a flask Request containing the JSON data :return: a """ data = request.get_json() df = pd.Data...
{"/Text Analysis and GCP Deployment/music1030/fuzzy_test.py": ["/Text Analysis and GCP Deployment/music1030/fuzzy.py"], "/Text Analysis and GCP Deployment/music1030/billboard_test.py": ["/Text Analysis and GCP Deployment/music1030/billboard.py"]}
20,158
Cedric-Liu/Coding-Journal
refs/heads/master
/Data Structure and Algorithms/Group Anagrams.py
# def groupAnagrams(strs): # def is_anagram(a, b): # count = {} # for char in a: # count[char] = count.get(char, 0) + 1 # for char in b: # if not char in count.keys(): # return False # else: # count[char] -= 1 # ...
{"/Text Analysis and GCP Deployment/music1030/fuzzy_test.py": ["/Text Analysis and GCP Deployment/music1030/fuzzy.py"], "/Text Analysis and GCP Deployment/music1030/billboard_test.py": ["/Text Analysis and GCP Deployment/music1030/billboard.py"]}
20,159
Cedric-Liu/Coding-Journal
refs/heads/master
/Text Analysis and GCP Deployment/main_test.py
import json import requests # TODO: You should put your cloud function URL here. # The URL below links to the TA version BILLBOARD_URL = 'https://us-central1-personal-198408.cloudfunctions.net' \ '/handle_billboard' SPOTIFY_URL = 'https://us-central1-personal-198408.cloudfunctions.net' \ ...
{"/Text Analysis and GCP Deployment/music1030/fuzzy_test.py": ["/Text Analysis and GCP Deployment/music1030/fuzzy.py"], "/Text Analysis and GCP Deployment/music1030/billboard_test.py": ["/Text Analysis and GCP Deployment/music1030/billboard.py"]}
20,160
Cedric-Liu/Coding-Journal
refs/heads/master
/Data Structure and Algorithms/Longest Palindromic Substring.py
#Given a string s, find the longest palindromic substring in s. You may assume # that the maximum length of s is 1000. def longestPalindrome(s: str) -> str: left, right = 0, len(s) - 1 def is_palindrome(sub): left, right = 0, len(sub) - 1 while left <= right: if sub[left] != sub[rig...
{"/Text Analysis and GCP Deployment/music1030/fuzzy_test.py": ["/Text Analysis and GCP Deployment/music1030/fuzzy.py"], "/Text Analysis and GCP Deployment/music1030/billboard_test.py": ["/Text Analysis and GCP Deployment/music1030/billboard.py"]}
20,161
Cedric-Liu/Coding-Journal
refs/heads/master
/Text Analysis and GCP Deployment/music1030/fuzzy_test.py
import os import pandas as pd import pytest from .fuzzy import jaccard_similarity, fuzzy_merge def test_jaccard(): assert jaccard_similarity('a', 'b') == 0 assert jaccard_similarity('c', 'c') == 1 assert jaccard_similarity('C', 'c') == 1 assert jaccard_similarity('ace', 'acd') == 2 / 4 def test_fu...
{"/Text Analysis and GCP Deployment/music1030/fuzzy_test.py": ["/Text Analysis and GCP Deployment/music1030/fuzzy.py"], "/Text Analysis and GCP Deployment/music1030/billboard_test.py": ["/Text Analysis and GCP Deployment/music1030/billboard.py"]}
20,162
Cedric-Liu/Coding-Journal
refs/heads/master
/Text Analysis and GCP Deployment/music1030/billboard_test.py
import os import pandas as pd from .billboard import clean_artist_col, clean_billboard def test_prune_dummy(): dummy1 = pd.Series(data=['Major Lazer & DJ Snake Featuring MO']) pruned1 = clean_artist_col(dummy1) assert pruned1[0] == 'major lazer' dummy2 = pd.Series(data=['Selena Gomez Featuring A$AP ...
{"/Text Analysis and GCP Deployment/music1030/fuzzy_test.py": ["/Text Analysis and GCP Deployment/music1030/fuzzy.py"], "/Text Analysis and GCP Deployment/music1030/billboard_test.py": ["/Text Analysis and GCP Deployment/music1030/billboard.py"]}
20,163
Cedric-Liu/Coding-Journal
refs/heads/master
/Model Building From Scratch/logistic_regression.py
import numpy as np import pandas as pd from sklearn import preprocessing from sklearn.model_selection import train_test_split def preprocess(): """Return the preprocessed data set""" data = pd.read_csv('weatherAUS.csv') # Drop certain features any any data with null values data = data.drop(['Sunshine...
{"/Text Analysis and GCP Deployment/music1030/fuzzy_test.py": ["/Text Analysis and GCP Deployment/music1030/fuzzy.py"], "/Text Analysis and GCP Deployment/music1030/billboard_test.py": ["/Text Analysis and GCP Deployment/music1030/billboard.py"]}
20,164
Cedric-Liu/Coding-Journal
refs/heads/master
/Text Analysis and GCP Deployment/music1030/spotify.py
from typing import List, Dict import pandas as pd # YOUR CODE HERE def clean_spotify_tracks(tracks: List[Dict]) -> pd.DataFrame: # TODO: Task 5 # YOUR CODE HERE pass
{"/Text Analysis and GCP Deployment/music1030/fuzzy_test.py": ["/Text Analysis and GCP Deployment/music1030/fuzzy.py"], "/Text Analysis and GCP Deployment/music1030/billboard_test.py": ["/Text Analysis and GCP Deployment/music1030/billboard.py"]}
20,165
Cedric-Liu/Coding-Journal
refs/heads/master
/Text Analysis and GCP Deployment/music1030/billboard.py
import re import pandas as pd def clean_artist_col(artist_names: pd.Series) -> pd.Series: # TODO: Task 9 # YOUR CODE HERE pass def clean_billboard(df: pd.DataFrame) -> pd.DataFrame: """Returns a cleaned billboard DataFrame. :param df: the billboard DataFrame :return a new cleaned DataFrame ...
{"/Text Analysis and GCP Deployment/music1030/fuzzy_test.py": ["/Text Analysis and GCP Deployment/music1030/fuzzy.py"], "/Text Analysis and GCP Deployment/music1030/billboard_test.py": ["/Text Analysis and GCP Deployment/music1030/billboard.py"]}
20,166
Cedric-Liu/Coding-Journal
refs/heads/master
/Data Structure and Algorithms/Tree and Traverse Methods.py
class Node(object): """Node""" def __init__(self, elem=-1, lchild=None, rchild=None): self.elem = elem self.lchild = lchild self.rchild = rchild class Tree(object): """Tree""" def _init_(self): self.root = Node() sefl.myQueue = []
{"/Text Analysis and GCP Deployment/music1030/fuzzy_test.py": ["/Text Analysis and GCP Deployment/music1030/fuzzy.py"], "/Text Analysis and GCP Deployment/music1030/billboard_test.py": ["/Text Analysis and GCP Deployment/music1030/billboard.py"]}
20,167
Cedric-Liu/Coding-Journal
refs/heads/master
/Model Building From Scratch/svm.py
import matplotlib.pyplot as plt import numpy as np import scipy import cvxpy as cp from sklearn import preprocessing from sklearn.model_selection import train_test_split import pandas as pd def preprocess(): data = pd.read_csv('weatherAUS.csv') # Drop certain features any any data with null values data =...
{"/Text Analysis and GCP Deployment/music1030/fuzzy_test.py": ["/Text Analysis and GCP Deployment/music1030/fuzzy.py"], "/Text Analysis and GCP Deployment/music1030/billboard_test.py": ["/Text Analysis and GCP Deployment/music1030/billboard.py"]}
20,168
Cedric-Liu/Coding-Journal
refs/heads/master
/Model Building From Scratch/CNN.py
import numpy as np from functools import reduce class Conv2D(object): def __init__(self, shape, output_channels, ksize=3, stride=1, method='VALID'): self.input_shape = shape self.output_channels = output_channels self.input_channels = shape[-1] self.batchsize = shape[0] sel...
{"/Text Analysis and GCP Deployment/music1030/fuzzy_test.py": ["/Text Analysis and GCP Deployment/music1030/fuzzy.py"], "/Text Analysis and GCP Deployment/music1030/billboard_test.py": ["/Text Analysis and GCP Deployment/music1030/billboard.py"]}
20,169
Cedric-Liu/Coding-Journal
refs/heads/master
/Data Structure and Algorithms/K Closest Points to Origin.py
# We have a list of points on the plane. # Find the K closest points to the origin (0, 0). def kClosest(points, K): def cal_square_dis(point): return point[0] ** 2 + point[1] ** 2 square_dis = [cal_square_dis(point) for point in points] max_heap = [i for i in range(K)] curr_max = max([square_di...
{"/Text Analysis and GCP Deployment/music1030/fuzzy_test.py": ["/Text Analysis and GCP Deployment/music1030/fuzzy.py"], "/Text Analysis and GCP Deployment/music1030/billboard_test.py": ["/Text Analysis and GCP Deployment/music1030/billboard.py"]}
20,170
Cedric-Liu/Coding-Journal
refs/heads/master
/Data Structure and Algorithms/First Unique Character in a String.py
#Given a string, find the first non-repeating character in # it and return it's index. If it doesn't exist, return -1. def firstUniqChar(s: str) -> int: if not s: return -1 count = {} for char in s: count[char] = count.get(char, 0) + 1 distinct = list(filter(lambda x: count[x] == 1, [ke...
{"/Text Analysis and GCP Deployment/music1030/fuzzy_test.py": ["/Text Analysis and GCP Deployment/music1030/fuzzy.py"], "/Text Analysis and GCP Deployment/music1030/billboard_test.py": ["/Text Analysis and GCP Deployment/music1030/billboard.py"]}
20,183
annabjorgo/keypad
refs/heads/master
/kpc_agent.py
import keypad import led_board from led_board import Led_board import rule import GPIOSimulator_v5 class Agent: """Random doc:)""" def __init__(self): self.keypad = keypad.KeyPad() self.led_board = Led_board() self.pathname = 'password.txt' self.override_signal = None ...
{"/kpc_agent.py": ["/keypad.py", "/led_board.py", "/rule.py"], "/fsm.py": ["/kpc_agent.py", "/rule.py"]}
20,184
annabjorgo/keypad
refs/heads/master
/fsm.py
from kpc_agent import Agent from rule import Rule class FSM(): """The Finite State Machine""" def __init__(self): """The FSM begins in state S-Init""" self.state = "S-init" self.agent = Agent() self.fsm_rule_list = [ Rule('S-init', 'S-read', signal_is_any_symbol, s...
{"/kpc_agent.py": ["/keypad.py", "/led_board.py", "/rule.py"], "/fsm.py": ["/kpc_agent.py", "/rule.py"]}
20,185
annabjorgo/keypad
refs/heads/master
/led_board.py
from GPIOSimulator_v5 import * import time GPIO = GPIOSimulator() class Led_board: """ A charliplexed circuit with 6 leds and 3 pins""" def setup(self): GPIO.cleanup() GPIO.setup(PIN_CHARLIEPLEXING_0, GPIO.IN, state=GPIO.LOW) GPIO.setup(PIN_CHARLIEPLEXING_1, GPIO.IN, state=GPIO.LOW) ...
{"/kpc_agent.py": ["/keypad.py", "/led_board.py", "/rule.py"], "/fsm.py": ["/kpc_agent.py", "/rule.py"]}
20,186
annabjorgo/keypad
refs/heads/master
/keypad.py
import sys from GPIOSimulator_v5 import * import time GPIO = GPIOSimulator() class KeyPad: key_coord = {(3, 7): '1', (3, 8): '2', (3, 9): '3', (4, 7): '4', (4, 8): '5', (4, 9): '6', (5, 7): '7', (5, 8): '8', (5, 9): '9', (6, 7): '*', (6, 8): '0', (6, 9): '#'} ...
{"/kpc_agent.py": ["/keypad.py", "/led_board.py", "/rule.py"], "/fsm.py": ["/kpc_agent.py", "/rule.py"]}
20,187
annabjorgo/keypad
refs/heads/master
/rule.py
import inspect from inspect import isfunction class Rule(): def __init__(self, state1, state2, signal, action): """State1 og state2 are strings. Action is a function that tells the agent what to do. Signal can be a symbol or a function that takes in a symbol and returns true if the symbol is vali...
{"/kpc_agent.py": ["/keypad.py", "/led_board.py", "/rule.py"], "/fsm.py": ["/kpc_agent.py", "/rule.py"]}
20,192
DevinDeSilva/BookLibrary
refs/heads/main
/Library/models.py
import os import re from django.conf import settings # Create your models here. def getBooks(search_str, search_by): books = readTxt(search_str, search_by) print("get books") return books def addBook(title, author, genre, height, publication, file_name='books_list.txt', data_dir=os.path.jo...
{"/Library/views.py": ["/Library/forms/RegisterBookForm.py", "/Library/forms/DeleteBookForm.py"]}