repo_name
stringlengths
6
97
path
stringlengths
3
341
text
stringlengths
8
1.02M
dmgav/dpcmaps
dpcmaps/pyspecfile.py
""" SPEC file format writer ... and partial reader, but it's recommended to use Specfile instead """ import re import os import time import itertools import numpy as np TIME_FORMAT = "%a %b %d %H:%M:%S %Y" def split_sequence(iterable, size): """ Take an iterable sequence (not just lists), and split it into ...
dmgav/dpcmaps
dpcmaps/dpc_batch_gui.py
<filename>dpcmaps/dpc_batch_gui.py """ Created on Feb 23, 2017 @author: <NAME>, 2nd Look """ from __future__ import division import sys import os from PyQt5.QtWidgets import ( QMainWindow, QWidget, QVBoxLayout, QHBoxLayout, QGroupBox, QCheckBox, QLabel, QLineEdit, QPushButton, ...
dmgav/dpcmaps
dpcmaps/dpc_batch.py
""" Created on Feb 23, 2017 @author: <NAME>, 2nd Look """ from __future__ import print_function, division import sys import os import numpy as np import multiprocessing as mp import h5py import PIL try: from tifffile import imsave havetiff = True except ImportError as ex: print("[!] Import error - tifffi...
tcal42/actralyze
app.py
import streamlit as st import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns from sklearn import preprocessing # Import VADER sentiment analyzer. from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer analyzer = SentimentIntensityAnalyzer() st.title('Actralyze ...
bentech/tquery
tmp/pythonweb/webserver.py
#!/usr/bin/python # Copyright <NAME> , turtlemeat.com # Modified by nikomu @ code.google.com import string,cgi,time from os import curdir, sep from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer import os # os. path CWD = os.path.abspath('.') ## print CWD # PORT = 8080 UPLOAD_PAGE = 'uplo...
bentech/tquery
plugins/cannonjs/vendor/cannon.js/utils/build.py
<reponame>bentech/tquery #!/usr/bin/env python try: import argparse ap = 1 except ImportError: import optparse ap = 0 import os import tempfile import sys from JSCompress import JSCompressor COMMON_FILES = ['Cannon.js', 'collision/Broadphase.js', 'collision/NaiveBroadphase.js', 'math/Mat3.js', 'math/Vec3...
HamidrezaZarrabi/BlessMark
utils.py
<filename>utils.py import h5py import numpy as np from copy import deepcopy # -------- My normalized correlation function def my_nc(watermark_extr, watermark_orig): assert(np.shape(watermark_extr) == np.shape(watermark_orig)) extr = deepcopy(watermark_extr) orig = deepcopy(watermark_orig) height, widt...
HamidrezaZarrabi/BlessMark
main.py
import argparse import os import numpy as np import time import scipy.io as sio import shutil from tqdm import tqdm from PIL import Image from embedding import embedding from extraction import extraction from skimage.measure import compare_psnr as psnr from utils import my_nc # ---------------------------- Parser argu...
HamidrezaZarrabi/BlessMark
extraction.py
import cv2 import os import tensorflow as tf from utils import * from copy import deepcopy model_from_json = tf.keras.models.model_from_json def extraction(img_marked, img_size, block_size, th, coef, cap, segment_model_pth, class_model_path): if img_marked.ndim == 2: # Grayscale image img_mar...
HamidrezaZarrabi/BlessMark
embedding.py
<reponame>HamidrezaZarrabi/BlessMark import cv2 import os import tensorflow as tf from utils import * from copy import deepcopy model_from_json = tf.keras.models.model_from_json def embedding(img_orig, img_size, mark, block_size, th, coef, segment_model_path): if img_orig.ndim == 2: # Grayscale image ...
dtglidden/hotspot-exon-paper
scripts/usage_by_HI_score.py
import sys from os.path import join from numpy import mean import numpy as np import argparse chroms = set(['chr'+str(i) for i in range(1,23)] + ['chrY', 'chrX', 'chrM']) if __name__ == '__main__' : parser = argparse.ArgumentParser() parser.add_argument('--anno_path', help='Path to GENCODE GTF annotation file') p...
dtglidden/hotspot-exon-paper
scripts/splice_site_usage.py
<reponame>dtglidden/hotspot-exon-paper import sys from os.path import join from intervaltree import Interval, IntervalTree import numpy as np import time import argparse site_types = ['3p', '5p'] chroms = set(['chr'+str(i) for i in range(1,23)] + ['chrY', 'chrX']) def parse_annotation(anno_path): print(time.strftim...
dtglidden/hotspot-exon-paper
scripts/estimate_hotspot_prevalence.py
import sys from os.path import join from numpy import mean, concatenate, searchsorted import matplotlib.pyplot as plt import time import argparse chroms = set(['chr'+str(i) for i in range(1,23)] + ['chrY', 'chrX']) def parse_annotation(anno_path): id_to_name, name_to_id = {}, {} gene_tx = {} with open(anno_path) ...
dtglidden/hotspot-exon-paper
lib/ss_usage.py
<gh_stars>0 #!/usr/bin/env python # Make sure you already loaded the 'Python' module (python 3) import sj2psi as sj import tempfile def get_usage(filename): # Convert this to a Dict so it can be imported into R code via rPython df = sj.get_psis(sj.read_sj_out_tab(filename), min_unique=0, min_multimap=0) fh, fn ...
dtglidden/hotspot-exon-paper
scripts/usage_by_introns.py
import sys from os.path import join from numpy import mean import argparse chroms = set(['chr'+str(i) for i in range(1,23)] + ['chrY', 'chrX', 'chrM']) if __name__ == '__main__' : parser = argparse.ArgumentParser() parser.add_argument('--anno_path', help='Path to GENCODE GTF annotation file') parser.add_argument(...
zcybupt/RFBNet_With_GUI
RFB_GUI.py
from __future__ import print_function import sys import torch import torch.backends.cudnn as cudnn import numpy as np from data import BaseTransform, VOC_300, VOC_512 import cv2 from layers.functions import Detect, PriorBox import matplotlib.patches as patches from collections import OrderedDict from PyQt5 import QtWid...
dapianzi/pics
cats/models.py
<filename>cats/models.py<gh_stars>0 from django.db import models from django.contrib.auth.models import User,GroupManager from . import managers # Create your models here. class ViewLog(models.Model): author = models.ForeignKey( User, on_delete=models.CASCADE, # 默认为id字段,其他字段需要用'unique'索引 ...
dapianzi/pics
pics/utils.py
<filename>pics/utils.py # coding=utf-8 import re import json from django.http import HttpResponse def _ajax_return(status_code=0, msg='', data=None): return HttpResponse(json.dumps({ 'code': status_code, 'msg': msg, 'content': data, })) def _ajax_success(data=None): return _ajax_...
dapianzi/pics
cats/migrations/0012_auto_20171226_1821.py
# -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2017-12-26 10:21 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_depende...
dapianzi/pics
cats/urls.py
from django.conf.urls import url from . import views urlpatterns = [ url(r'^$', views.IndexView.as_view(), name='home'), url(r'^signin', views.SigninView.as_view(), name='signin'), url(r'^ajaxsignin', views.AjaxSignin.as_view(), name='ajaxsignin'), url(r'^signout', views.signout, name='signout'), u...
dapianzi/pics
cats/migrations/0008_merge_20171226_1731.py
<filename>cats/migrations/0008_merge_20171226_1731.py # -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2017-12-26 09:31 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('cats', '0007_delete_viewlog'), ('cats'...
dapianzi/pics
spider/views.py
# coding=utf-8 import os import time import json from django.shortcuts import render, get_object_or_404 from django.views.generic import View from django.db.models import ObjectDoesNotExist from pics.utils import _ajax_error, _ajax_success, _is_doubtful from . import models as spider_models # Create your views here...
dapianzi/pics
cats/migrations/0002_auto_20171226_1710.py
<reponame>dapianzi/pics # -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2017-12-26 09:10 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('cats', '0001_initial'), ] operations = [ migrations.AlterMo...
dapianzi/pics
pics/middleware.py
import re class UserAssignMiddleware(object): def __init__(self, get_response): self.get_response = get_response # One-time configuration and initialization. def __call__(self, request): # Code to be executed for each request before # the view (and later middleware) are called...
dapianzi/pics
spider/admin.py
<gh_stars>0 from django.contrib import admin from django.http import HttpResponse, StreamingHttpResponse from django.core import serializers from spider.models import Spider, ContentType, SpiderTask, BlackList # Register your models here. @admin.register(ContentType) class ContentTypeAdmin(admin.ModelAdmin): # 列表项...
dapianzi/pics
cats/managers.py
<filename>cats/managers.py<gh_stars>0 from django.db import models # db manager class ImgManager(models.Manager): ''' custom img model manager ''' def get_queryset(self): return super(ImgManager, self).get_queryset().filter(img_status=0) def with_info(self, offset=0, limit=30): fro...
dapianzi/pics
spider/urls.py
<filename>spider/urls.py from django.conf.urls import url from . import views urlpatterns = [ url(r'^$', views.IndexView.as_view(), name='home'), url(r'^result', views.GetResult.as_view(), name='get'), ]
dapianzi/pics
spider/models.py
<filename>spider/models.py # coding=utf-8 from django.db import models # Create your models here. class Config(models.Model): """ 配置信息 """ CONF_TYPE = ( (1, 'int'), (2, 'str'), (3, 'float'), (4, 'json'), ) conf_key = models.CharField('配置项', max_length=50, defaul...
dapianzi/pics
spider/migrations/0001_initial.py
<gh_stars>0 # -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2018-01-11 11:18 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ mig...
dapianzi/pics
cats/migrations/0009_viewlog.py
<gh_stars>0 # -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2017-12-26 09:39 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ...
dapianzi/pics
cats/forms.py
from django.forms import Form class SigninForm(Form): error = '' def is_valid(self): return True def is_multipart(self): return False class SuggestForm(Form): def is_valid(self): return True
dapianzi/pics
cats/views.py
from django.views.generic.base import View,TemplateView,RedirectView from django.shortcuts import render,redirect,get_object_or_404,get_list_or_404 from django.http import HttpResponse,Http404,HttpResponseRedirect from django.core.urlresolvers import reverse from django.contrib.auth import authenticate,login,logout fro...
mercuree/reapy
reapy/reascript_api/network/client.py
<gh_stars>0 from reapy.errors import DisconnectedClientError, DistError from reapy.tools import json from .socket import Socket class Client(Socket): def __init__(self, port): super(Client, self).__init__() self._connect(port) def _connect(self, port): super(Client, self).connect(("l...
mercuree/reapy
reapy/tools/inside_reaper.py
import contextlib import reapy if not reapy.is_inside_reaper(): from . import dist_program class InsideReaper(contextlib.ContextDecorator): """ Context manager for efficient calls from outside REAPER. It can also be used as a function decorator. Examples -------- Instead of running: ...
mercuree/reapy
reapy/tools/dist_program.py
<gh_stars>0 """Define distant Program class.""" import reapy from reapy.errors import DisabledDistAPIError, DisabledDistAPIWarning from . import program if not reapy.is_inside_reaper(): try: from reapy.reascript_api.network import Client, WebInterface WEB_INTERFACE = WebInterface(reapy.config.WEB_...
mercuree/reapy
setup.py
<reponame>mercuree/reapy from setuptools import setup, find_packages from os import path here = path.abspath(path.dirname(__file__)) with open(path.join(here, "README.md")) as f: long_description = f.read() setup( name="python-reapy", version="0.3.0", description="A pythonic wrapper for REAPER's Rea...
mercuree/reapy
reapy/core/track/send.py
import reapy from reapy import reascript_api as RPR from reapy.core import ReapyObject from reapy.tools import Program class Send(ReapyObject): _class_name = "Send" def __init__(self, track=None, index=0, track_id=None, type="send"): if track_id is None: message = "One of `track` or `tra...
mercuree/reapy
reapy/reascripts/activate_reapy_server.py
<filename>reapy/reascripts/activate_reapy_server.py<gh_stars>0 """ Activate ``reapy`` server. Running this ReaScript from inside REAPER sets the ``reapy`` server that receives and executes API calls requests from outside. It will automatically be run when importing ``reapy`` from outside, if it is enabled. """ import...
mercuree/reapy
reapy/tools/__init__.py
<gh_stars>0 """Define tools such as Program and custom json module.""" import reapy from .inside_reaper import InsideReaper if not reapy.is_inside_reaper(): from .dist_program import Program else: from .program import Program
mercuree/reapy
reapy/core/item/item.py
<reponame>mercuree/reapy import reapy from reapy import reascript_api as RPR from reapy.core import ReapyObject from reapy.tools import Program class Item(ReapyObject): _class_name = "Item" def __init__(self, id): self.id = id def __eq__(self, other): return self.id == other.id and isin...
mercuree/reapy
reapy/reascript_api/network/server.py
"""Define Server class.""" import reapy from reapy import reascript_api as RPR from reapy.tools import json from .socket import Socket import socket import traceback if reapy.is_inside_reaper(): from reapy.tools.program import Program class Server(Socket): """ Server part of the ``reapy`` dist API. ...
mercuree/reapy
reapy/tools/json.py
"""Encode and decode ``reapy`` objects as JSON.""" import importlib import json class ClassCache(dict): _core = None def __missing__(self, key): if self._core is None: # The import is here because otherwise there is an import loop # and to perform import just once. ...
mercuree/reapy
reapy/tools/program.py
<gh_stars>0 """ Define base Program class. Notes ----- Runing ``from reapy.tools import Program`` only imports this ``Program`` class if called from inside REAPER. If not, then the subclass ``reapy.tools.dist_program.Program``, which overrides ``Program.run``, is imported. """ import reapy from reapy import reascript...
mercuree/reapy
reapy/reascript_api/__init__.py
<reponame>mercuree/reapy<filename>reapy/reascript_api/__init__.py import reapy import sys if reapy.is_inside_reaper(): # Import functions without the useless starting "RPR_". import reaper_python as _RPR __all__ = [s[4:] for s in _RPR.__dict__ if s.startswith("RPR_")] for s in __all__: ...
mercuree/reapy
reapy/reascript_api/dist_api.py
import reapy if not reapy.is_inside_reaper(): try: from reapy_generated_api import __all__ from reapy_generated_api import * except ImportError: # Happens when ``reapy`` dist API is disabled __all__ = []
mercuree/reapy
reapy/reascript_api/network/socket.py
import socket class Socket: """ Wrapped `socket` that can send and receive data of any length. """ def __init__(self, s=None): self._socket = socket.socket() if s is None else s @staticmethod def _non_blocking(f): """ Modify a socket method so that it returns `None` ...
mercuree/reapy
reapy/core/project/marker.py
import reapy from reapy import reascript_api as RPR from reapy.core import ReapyObject from reapy.tools import Program class Marker(ReapyObject): _class_name = "Marker" def __init__( self, parent_project=None, index=None, parent_project_id=None ): if parent_project_id is None: ...
mercuree/reapy
reapy/core/fx/fx_param.py
<gh_stars>0 import reapy import reapy.reascript_api as RPR from reapy.core import ReapyObject, ReapyObjectList from reapy.errors import DistError from reapy.tools import Program class FXParam(float): """FX parameter.""" def __init__(self, value, parent_list, index, functions): float.__init__(value) ...
kevinxin90/bte_schema_web
src/app.py
<reponame>kevinxin90/bte_schema_web import tornado.auth import tornado.escape import tornado.ioloop import tornado.options import tornado.web import os.path #from handlers.displayhandler import DisplayHandler class HomeHandler(tornado.web.RequestHandler): @tornado.web.addslash def get(self): self.ren...
kevinxin90/bte_schema_web
src/handlers/displayhandler.py
<reponame>kevinxin90/bte_schema_web import tornado.web import tornado.template from networkx.readwrite import json_graph import json from biothings_explorer.registry import Registry from biothings_explorer.connect import ConnectTwoConcepts reg = Registry() colors = {1: 'green', 2: 'red', 3: 'rgba(255,168,7)'} clas...
Abhir1902/HackotberFest2021
Instabot.py
from instabot import Bot b = Bot() choice = int(input("Login : 1 \nUpload image : 2 \nFollow : 3 \nSend message : 4\n")) print("") while(choice!=5): if(choice==1): p=input("Enter the username : ") q=input("Enter the password : ") b.login(username=p,password=q) if(choice==2): m = ...
sienaiwun/Unity_TiledResource
Assets/image_generator.py
from PIL import Image from PIL import ImageDraw from PIL import ImageFont import os image_dir_name = "images" texture_scale = 1 image_name_prefix = "image_" def to_scale_size(input): return (int)(input*texture_scale) texture_size = to_scale_size(512) def image_char(char, image_size, font_size, outline_lenght, ...
sienaiwun/Unity_TiledResource
Assets/tiles_generator.py
from PIL import Image import os import math import shutil from image_generator import texture_size tiles_dir_name = "StreamingAssets" cache_dir_name_prefix = "cache" table_Size = 32 padding_size = 0 dimension_size = texture_size class PixelData: def __init__(self, size, path, name): self._component_count ...
bedirhansaglam/PythonMachineLearning
PythonMachineLearning/NavieBayes.py
# -*- coding: utf-8 -*- """ Created on Tue Jan 02 00:11:04 2018 @author: Bedirhan """ def default_training_data(): training_data=[] training_data.append(("futbol","spor")) training_data.append(("basketbol","spor")) training_data.append(("tenis","spor")) training_data.append(("voleybol","spor")) ...
bedirhansaglam/PythonMachineLearning
PythonMachineLearning/tasarim.py
<reponame>bedirhansaglam/PythonMachineLearning # -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'tasarim.ui' # # Created: Tue Jan 02 18:48:48 2018 # by: PyQt4 UI code generator 4.11.3 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _f...
bedirhansaglam/PythonMachineLearning
PythonMachineLearning/knn.py
# -*- coding: utf-8 -*- """ Created on Tue Dec 19 19:50:49 2017 @author: Bedirhan """ import matplotlib.pyplot as plt def dataload_knn(): veriListesi=[] veriListesi.append((2,4,"kotu")) veriListesi.append((3,6,"iyi")) veriListesi.append((4,10,"kotu")) veriListesi.append((3,4,"iyi")) veriListes...
bedirhansaglam/PythonMachineLearning
PythonMachineLearning/dialog_form.py
# -*- coding: utf-8 -*- """ Created on Wed Nov 29 18:12:45 2017 @author: Bedirhan """ import sys from PyQt4 import QtGui from Main import MainWindow def main(): app=QtGui.QApplication(sys.argv) mainWindow=MainWindow() mainWindow.show() return app.exec_() if __name__=="__main__": m...
bedirhansaglam/PythonMachineLearning
PythonMachineLearning/ParkinsonDataSet.py
# -*- coding: utf-8 -*- """ Created on Tue Dec 26 21:29:46 2017 @author: Bedirhan """ import os import numpy as np def saveData(filename,data): db=np.array(data) f=open(filename,'w') for i,a in enumerate(db): for p,j in enumerate(db[i]): if p!=(len(db[i])-1): f.write(j...
bedirhansaglam/PythonMachineLearning
PythonMachineLearning/kmeans.py
# -*- coding: utf-8 -*- from math import sqrt from math import pow from matplotlib import pyplot as plt #rastgele etiketlenmiş verisetimiz mevcut def data(): veriListesi1=[] veriListesi1.append((4,2,"c1")) veriListesi1.append((6,4,"c2")) veriListesi1.append((5,1,"c2")) veriListesi1.append((10,6,"...
bedirhansaglam/PythonMachineLearning
PythonMachineLearning/Normalizasyon.py
<reponame>bedirhansaglam/PythonMachineLearning # -*- coding: utf-8 -*- """ Created on Sat Dec 30 21:59:11 2017 @author: Bedirhan """ import statistics import numpy as np def zscore(data): zscoredata=[] standart_sapma=statistics.stdev(data) ortalama=statistics.mean(data) for d in data: z=(d-ort...
bedirhansaglam/PythonMachineLearning
PythonMachineLearning/KNNCluster.py
<filename>PythonMachineLearning/KNNCluster.py<gh_stars>1-10 # -*- coding: utf-8 -*- """ ---- KNN Kümeleme ----- Rastgele dataset oluşturuyoruz , oluşturduğumuz noktaların (0,0) noktasına olan uzaklığını buluyoruz (Minkowski,<NAME>). Daha sonra orijine en yakın noktayı ve en uzak noktayı belirliyoruz bu 2 nokta 2 grubun...
bedirhansaglam/PythonMachineLearning
PythonMachineLearning/Main.py
<reponame>bedirhansaglam/PythonMachineLearning # -*- coding: utf-8 -*- """ Created on Wed Nov 29 18:13:38 2017 @author: Bedirhan """ from PyQt4 import QtGui from PyQt4 import QtCore from PyQt4.QtGui import * from PyQt4.QtCore import * from PyQt4.QtGui import * import matplotlib.pyplot as plt import numpy from PIL.Ima...
Ruila/PythonCrwalerMarathon_Day25
scrapy_demo/spiders/ettoday.py
import scrapy from scrapy_demo.items import ScrapyDemoItem class EttodaySpider(scrapy.Spider): name = 'ettoday' allowed_domains = ['www.ettoday.net'] start_urls = ['https://www.ettoday.net/news/20201004/1824032.html','https://www.ettoday.net/news/20210120/1902773.html'] def parse(self, response): ...
Omoshirokunai/holmes
ela.py
<filename>ela.py """ error level analysis script that displays the output of ela on an image gotten from holmes.py """ from PIL import Image, ImageChops, ImageEnhance import sys, os.path import start_screen import streamlit as st def convert_to_ela_image(path, quality): filename = path resaved_filename = fi...
Omoshirokunai/holmes
quantization_table.py
""" Quantiztion table viewer this is a script that extracts chrominance and luminace quantization tables of an image then from a list of available tables we can deduce the software used to export the image this can come in handy in cases where metadata has also been tampered with or is not available. """ import stream...
Omoshirokunai/holmes
start_screen.py
<filename>start_screen.py import os import easygui as g import streamlit as st from PIL import Image currdir = os.getcwd() title = 'Choose your image' def browseforimage(): valid_images=[".png",".jpg",".bmp"] while True: try: filename = g.fileopenbox(title="pick image",filetypes=[['.png',"....
Omoshirokunai/holmes
metadata.py
<filename>metadata.py """ metadata viewer This script extracts the exif metadata from the image in main.py and displays it in a streamlit dataframe """ import streamlit as st from skimage.io import imread import pandas as pd import exifview import start_screen def app(): try: im = str(start_screen.x) ...
Omoshirokunai/holmes
exifview.py
<reponame>Omoshirokunai/holmes import sys from PIL import Image from PIL.ExifTags import TAGS """ Get exif metadata of an image. function that takes an image path as a str and returns a dictionary containing the image's exif metadata Args: filepath: Get metadata from this file. Returns: ...
Omoshirokunai/holmes
holmes.py
""" holmes main script This the main streamlit script that contains page navigation and image to be processed """ import metadata import quantization_table import streamlit as st import ela import os import start_screen import easygui as g from skimage.io import imread import pandas as pd import exifview # st.set_pa...
shatiilrahman/Machine-Learning
_apachespark_online_installation_template.py
<filename>_apachespark_online_installation_template.py # -*- coding: utf-8 -*- """_ApacheSpark_online_installation_Template Automatically generated by Colaboratory. Original file is located at https://colab.research.google.com/drive/1pht4oqcZBSGH9dXJe7VsykROTXyGWByi """ #Apache_Spark !apt-get install openjdk-8-...
pkakhandiki277/DiagnoX
data_loader.py
<filename>data_loader.py from glob import glob import os import xml.etree.ElementTree as ET import random import cv2 class Dataset(object): def __init__(self, xmls_path, images_path, positive_classes): self.xml_files = glob(os.path.join(xmls_path, "*.xml")) self.image_files = glob(os.path.join(im...
pkakhandiki277/DiagnoX
train.py
from sklearn.externals import joblib from sklearn.svm import LinearSVC from hog import HOG from data_loader import Dataset import argparse from skimage.transform import rescale, resize, downscale_local_mean from skimage.color import rgb2gray from sklearn.model_selection import train_test_split from sklearn.metrics impo...
pkakhandiki277/DiagnoX
hog.py
<filename>hog.py from skimage import feature class HOG: def __init__(self, orientations=9, pixelsPerCell=(8, 8), cellsPerBlock=(3, 3), transform=False): cellsPerBlock = (3, 3) self.orientations = orientations self.pixelsPerCell = pixelsPerCell self.cellsPerBlock = cellsPerBlock ...
YuMurata/Tournament
Tournament/tournament.py
from enum import Enum, auto from random import sample import logging import typing from .player import TwoPlayer, PlayerList class TournamentException(Exception): pass class RoundException(TournamentException): pass class MatchException(TournamentException): pass class CompeteException(TournamentEx...
YuMurata/Tournament
Tournament/player.py
<filename>Tournament/player.py from abc import ABCMeta, abstractclassmethod import typing class Player(metaclass=ABCMeta): ''' implement --- decode(self) decode so that you can compare - - - player has __init__(self, param: typing.Any, score: int = 1) ''' def __init__(self, para...
YuMurata/Tournament
Tournament/__init__.py
from .tournament import Tournament, TournamentException from .tournament import GameWin, CompleteException from .player import Player, PlayerList
laulin/pihole-blacklist
get_top_1000000.py
from parser import get_list import re from pprint import pprint from multiprocessing import Pool import multiprocessing def scrap_stuffgate(index): url = "http://stuffgate.com/stuff/website/top-{}-sites".format(index) print(url) get = True while get: try: page = get_list(url) ...
laulin/pihole-blacklist
get_blacklists.py
import yaml from pprint import pprint from parser import Parser from multiprocessing import Pool from glob import glob from pathlib import Path def get_blacklist(name, parameters): print(name) parser = Parser(parameters["url"], parameters["format"]) domain_list = parser.parse() Path("blacklists").mkdi...
laulin/pihole-blacklist
parser.py
import re import requests import yaml import tldextract from urllib.parse import urlparse from pprint import pprint def get_list(url): response = requests.get(url) return response.text class Parser: def __init__(self, url, list_type): self._url = url self._list_type = list_type def p...
junhuih/DFP-Project
twitter_comment.py
<filename>twitter_comment.py # -*- coding: utf-8 -*- """ @author: <NAME>, <NAME>, <NAME>, <NAME> """ import requests # credential bearer_token = "REPLACE_WITH_YOUR_OWN" # Get the top twitter comment from twitter through API def get_twitter_comments(school_name): try: url = "https://api.twitter.com/2/twee...
junhuih/DFP-Project
helpers.py
<reponame>junhuih/DFP-Project # -*- coding: utf-8 -*- """ @author: <NAME>, <NAME>, <NAME>, <NAME> """ import pandas as pd all_states = [ "AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DE", "FL", "GA", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", ...
junhuih/DFP-Project
average_stats.py
# -*- coding: utf-8 -*- """ @author: <NAME>, <NAME>, <NAME>, <NAME> """ import pandas as pd import helpers as h import numpy as np us_state_to_abbrev = { "Alabama": "AL", "Alaska": "AK", "Arizona": "AZ", "Arkansas": "AR", "California": "CA", "Colorado": "CO", "Connecticut": "CT", "Dela...
junhuih/DFP-Project
search_colleges.py
# -*- coding: utf-8 -*- """ @author: <NAME>, <NAME>, <NAME>, <NAME> """ import twitter_comment as tc import fbi_crime_data as fbi import pandas as pd import matplotlib.pyplot as plt import helpers as h #######################Display the data####################### def search_colleges(college, dataframe): college...
junhuih/DFP-Project
fetch_all_data.py
# -*- coding: utf-8 -*- """ @author: <NAME>, <NAME>, <NAME>, <NAME> """ # import os import time import random import requests import numpy as np import pandas as pd from bs4 import BeautifulSoup from selenium import webdriver from urllib.request import urlopen from pandas.core.frame import DataFrame from user_agent im...
junhuih/DFP-Project
user_agent.py
<reponame>junhuih/DFP-Project # *********************************************************************************# # NOTICE: # This file is not created by our group. # It is a useful helper to simulate the user clicks when parsing through websites. # *********************************************************************...
junhuih/DFP-Project
bestcolleges_helper.py
<gh_stars>0 # -*- coding: utf-8 -*- """ @author: <NAME>, <NAME>, <NAME>, <NAME> """ # Importing required packages import numpy as np import pandas as pd from fuzzywuzzy import fuzz from fuzzywuzzy import process # Declaring global variables bestcolleges_data_path = "bestcolleges_careers.csv" bestcolleges_data = pd.re...
junhuih/DFP-Project
recommender_helper.py
<reponame>junhuih/DFP-Project<filename>recommender_helper.py # -*- coding: utf-8 -*- """ @author: <NAME>, <NAME>, <NAME>, <NAME> """ import pandas as pd merged_data_path = "merged_data.xlsx" merged_data = pd.read_excel(merged_data_path, index_col=0) def view_recommendations(preferred_state, sat_score, total_4_year...
junhuih/DFP-Project
college_helper.py
# -*- coding: utf-8 -*- """ @author: <NAME>, <NAME>, <NAME>, <NAME> """ # This is our main program file that displays the menu for the user to use import helpers as h import search_colleges as sc import average_stats as avg_stat import recommender_helper as r_helper import bestcolleges_helper as bs_helper import fet...
snub-fighter/python-bitrue
bitrue/examples/trades_to_csv.py
<gh_stars>1-10 from bitrue.client import Client import pandas as pd if __name__ == '__main__': client = Client(api_key='', api_secret='', ) trades = client.get_my_trades() df = pd.DataFrame(trades) df = df[['symbol','id','orderId','origClientOrderId','price','q...
snub-fighter/python-bitrue
bitrue/examples/check_open_orders.py
from bitrue.client import Client from tabulate import tabulate from pprint import pprint if __name__ == '__main__': client = Client(api_key='<KEY>', api_secret='<KEY>', ) open_orders = client.get_open_orders(symbol='XRPUSDT') #pprint(open_orders) order_formatted ...
snub-fighter/python-bitrue
setup.py
#!/usr/bin/env python3 import os from setuptools import setup # get key package details from bitrue/__version__.py about = {} # type: ignore here = os.path.abspath(os.path.dirname(__file__)) with open(os.path.join(here, 'bitrue', '__version__.py')) as f: exec(f.read(), about) # package configuration - for ref...
snub-fighter/python-bitrue
bitrue/examples/full_trade_cycle.py
from bitrue.client import Client from tabulate import tabulate from pprint import pprint import os import time if __name__ == '__main__': RECV_WINDOW = 6000000 client = Client(api_key='', api_secret='', ) sell_price = 1.5 sell_qty = 5 buyback_price = .40 ...
snub-fighter/python-bitrue
bitrue/examples/historical_trades.py
from bitrue.client import Client if __name__ == '__main__': client = Client(api_key='', api_secret='', ) trades = client.get_my_trades() print(client._order_format_print(trades)) ''' symbol id orderId origClientOrderId price qty comm...
snub-fighter/python-bitrue
bitrue/__version__.py
""" __version__.py ~~~~~~~~~~~~~~ Information about the current version of the py-package-template package. """ __title__ = 'bitrue-python' __description__ = 'A python package to communicate with Bitrue API' __version__ = '0.0.2' __author__ = '<NAME>' __author_email__ = '<EMAIL>' __license__ = 'MIT' __url__ = 'https:...
tianhwu/microblog
upload.py
from flask import Flask, render_template, request from flask_uploads import UploadSet, configure_uploads, DATA #loads data manipulation import pandas as pd import numpy as np import matplotlib.pyplot as plt import os from datetime import datetime, timedelta #loads mapping import folium from folium import plugins fro...
tianhwu/microblog
simpleupload.py
from flask import Flask, render_template, request from flask_uploads import UploadSet, configure_uploads, DATA import pandas as pd app = Flask(__name__) loc_data = UploadSet('data', DATA) #app.config['UPLOADED_DEFAULTS_DEST'] = 'static/img' app.config['UPLOADED_DATA_DEST'] = 'static/img' configure_uploads(app, loc_...
tianhwu/microblog
hello.py
<gh_stars>0 from flask import Flask from flask import request from flask_uploads import UploadSet, configure_uploads, IMAGES from flask import render_template import pandas as pd app = Flask(__name__) @app.route('/') def index(): return "welcome to the index" @app.route('/hayabusa') def hello_world(): ret...
debrine/Bank-Reconciliation
BankReconciliation.py
<gh_stars>0 from tkinter import * from tkinter import ttk from tkinter import filedialog from csv import reader from openpyxl import load_workbook import datetime from openpyxl import Workbook from openpyxl.utils import get_column_letter from openpyxl.styles import Font, Border, Side #global variables bank_statement_...
liualexiang/liualexiang.github.io
_posts/modify_front_matter.py
import os,re,codecs def get_docs_list(): docs_list=[] for path, subdirs, files in os.walk("."): for name in files: if len(name.split(".")) == 2 and name.split(".")[1] == "md": docs_list.append(os.path.join(path, name)) return docs_list def get_doc_title(file): with ...
liualexiang/liualexiang.github.io
_posts/modify_md_name_with_time.py
import os fileStartDate = "2021-01-01" def update_md_file_name(): docs_list=[] for path, subdirs, files in os.walk("."): for name in files: if len(name.split(".")) == 2 and name.split(".")[1] == "md": newName = fileStartDate + "-" + name print("old name is{n...