text
stringlengths
0
1.05M
meta
dict
#!/bin/env python2 import WikiwhoRelationships from copy import deepcopy from sys import argv,exit import getopt import numpy as np import math import random import cgi from structures.Word import Word import operator #from django.utils import simplejson context = {} context_obj = {} random.seed(3) def getGraph(f...
{ "repo_name": "wikiwho/whovis", "path": "wikigraph.py", "copies": "1", "size": "62820", "license": "mit", "hash": -941332311221818500, "line_mean": 46.0209580838, "line_max": 346, "alpha_frac": 0.4313276027, "autogenerated": false, "ratio": 4.165506266162721, "config_test": false, "has_no_key...
#!/bin/env python2 import WikiwhoRelationships from copy import deepcopy import operator from sys import argv,exit import getopt from wmf import dump #from django.utils import simplejson def getStatsOfFile(revisions, order, relations, talk_pages): all_authors = set([]) top_authors = {} k = 5 ...
{ "repo_name": "wikiwho/whovis", "path": "wikiauthors.py", "copies": "1", "size": "12630", "license": "mit", "hash": 8191851563440362000, "line_mean": 37.7423312883, "line_max": 192, "alpha_frac": 0.5574821853, "autogenerated": false, "ratio": 3.92846034214619, "config_test": false, "has_no_ke...
#!/bin/env python2 # NOTE: this was converted from GenPythonModule.sh and updated to be a little # more cross-platform. JDH Nov 2013 import shutil import distutils.dir_util import glob import os import sys def touch(fname, times=None): with file(fname, 'a'): os.utime(fname, times) def find_and_delet...
{ "repo_name": "rkwitt/quicksilver", "path": "3rd_party_software/pyca/GenPythonModule.py", "copies": "1", "size": "2236", "license": "apache-2.0", "hash": 3286250716644072000, "line_mean": 26.95, "line_max": 77, "alpha_frac": 0.6033094812, "autogenerated": false, "ratio": 3.096952908587258, "con...
# This file is part of OpenQUA. # # Copyright (c) 2014 Derecho and contributors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright...
{ "repo_name": "openqua/openqua", "path": "scrapers/repeater_veron.py", "copies": "1", "size": "4736", "license": "bsd-3-clause", "hash": 7068367541870033000, "line_mean": 42.4495412844, "line_max": 87, "alpha_frac": 0.6560388514, "autogenerated": false, "ratio": 3.87244480784955, "config_test":...
# This file is part of OpenQUA. # # Copyright (c) 2014 Iain R. Learmonth and contributors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above...
{ "repo_name": "openqua/openqua", "path": "scrapers/repeater_irts.py", "copies": "1", "size": "3416", "license": "bsd-3-clause", "hash": -8678308755064131000, "line_mean": 43.3636363636, "line_max": 126, "alpha_frac": 0.718676815, "autogenerated": false, "ratio": 3.8862343572241183, "config_test...
#!/bin/env python2 # TODO: grid based map system from sys import argv from os import path import pygame from pygame.locals import QUIT, KEYDOWN, MOUSEBUTTONDOWN, K_q, K_ESCAPE, K_u, K_a from pygame import image, time, mouse from ui.button import ImageButton, TextButton from ui.interfaces import UIString, UIElement ...
{ "repo_name": "ROBOMonkeys/tower-defense-game", "path": "main.py", "copies": "1", "size": "5528", "license": "bsd-3-clause", "hash": -5691480560373873000, "line_mean": 31.9047619048, "line_max": 94, "alpha_frac": 0.5095875543, "autogenerated": false, "ratio": 3.5435897435897434, "config_test": ...
#!/bin/env python2 #!/usr/bin/env python #******************************************************************************* # # Filename : make_run_val_simfit.py # Description : Generating scripts for command RunValGenFit # Author : Yi-Mu "Enoch" Chen [ ensc@hep1.phys.ntu.edu.tw ] # #********************...
{ "repo_name": "NTUHEP-Tstar/TstarAnalysis", "path": "LimitCalc/genValSimPlotCmd.py", "copies": "1", "size": "1627", "license": "mit", "hash": 6533426303718834000, "line_mean": 29.1296296296, "line_max": 119, "alpha_frac": 0.5629993854, "autogenerated": false, "ratio": 3.280241935483871, "config...
#! /bin/env python2 # -*- coding: utf-8 -*- import numpy as np import networkx as nx import matplotlib.pyplot as plt import random as rd N = 100 M = 120 MAX = N + M + 1 MAX_EDGE = 1000 MAX_DEG = 450 ITERATIONS = 100000 S1 = 0. T1 = 1. S2 = 0. T2 = 1. beta = 0.1 NUMGRAPH = 10 NUMSIM = 10 # ini...
{ "repo_name": "kaslusimoes/SummerSchool2016", "path": "python/oldsimulation.py", "copies": "1", "size": "5797", "license": "apache-2.0", "hash": 7102955753968053000, "line_mean": 22.9870689655, "line_max": 91, "alpha_frac": 0.4781783681, "autogenerated": false, "ratio": 2.8333333333333335, "con...
from .bst import BinarySearchTree, TreeNode class AVLTree(BinarySearchTree): ''' Author: Brad Miller Date: 1/15/2005 Description: Imlement a binary search tree with the following interface functions: __contains__(y) <==> y in x __getitem__(y) ...
{ "repo_name": "ArcherSys/ArcherSys", "path": "skulpt/src/lib/pythonds/trees/balance.py", "copies": "1", "size": "3936", "license": "mit", "hash": -3030934429641344000, "line_mean": 34.4594594595, "line_max": 89, "alpha_frac": 0.5467479675, "autogenerated": false, "ratio": 4.2459546925566345, "c...
from django.core.exceptions import ObjectDoesNotExist from django.views.generic.base import TemplateView from website.apps.home.models import Simulation class HomeView(TemplateView): template_name = "home/home.html" def get_context_data(self, **kwargs): # Get the most recent simulation so that click...
{ "repo_name": "vecnet/zika", "path": "website/apps/home/views/__init__.py", "copies": "1", "size": "1328", "license": "mpl-2.0", "hash": 8386059145360953000, "line_mean": 36.9428571429, "line_max": 109, "alpha_frac": 0.6829819277, "autogenerated": false, "ratio": 3.9523809523809526, "config_tes...
import datetime from django.shortcuts import get_object_or_404 from django.views.generic.base import TemplateView from website.apps.home.models import Location, Data, Simulation, Totals from website.utils.time import datetime_to_unix_timestamp_notz # @method_decorator(login_required, name='dispatch') class ChartVie...
{ "repo_name": "ecaldwe1/zika", "path": "website/apps/home/views/ChartView.py", "copies": "2", "size": "4979", "license": "mpl-2.0", "hash": -5195029547169695000, "line_mean": 38.2047244094, "line_max": 137, "alpha_frac": 0.676641896, "autogenerated": false, "ratio": 3.650293255131965, "config_t...
from django.conf.urls import url from website.apps.home.views.upload_job_view import upload_job_view from website.apps.home.views.ListModelView import ListModelView from website.apps.home.views.ChartView import ChartView, CountryTotalChartView from website.apps.home.views.MapView import MapView, csv_for_map_view from...
{ "repo_name": "vecnet/zika", "path": "website/apps/home/urls.py", "copies": "1", "size": "2145", "license": "mpl-2.0", "hash": -4769037206640539000, "line_mean": 45.6304347826, "line_max": 117, "alpha_frac": 0.6951048951, "autogenerated": false, "ratio": 3.201492537313433, "config_test": false,...
from django.contrib.auth.models import User from django.db import models class PageVisit(models.Model): host = models.TextField() url = models.TextField() querystring = models.TextField() # GET, POST, etc action = models.TextField() http_code = models.TextField() http_referrer = models.Te...
{ "repo_name": "vecnet/zika", "path": "website/apps/big_brother/models.py", "copies": "2", "size": "1696", "license": "mpl-2.0", "hash": 2114004598037558000, "line_mean": 32.2549019608, "line_max": 72, "alpha_frac": 0.6845518868, "autogenerated": false, "ratio": 3.7439293598233996, "config_test"...
from django.contrib import admin from django.contrib.admin import SimpleListFilter from website.apps.big_brother.models import PageVisit, TrackingCode from django.utils.translation import ugettext_lazy as _ class MacedFilter(SimpleListFilter): title = _("S.O.B.E.R items") parameter_name = "shoe_maced_items" ...
{ "repo_name": "vecnet/zika", "path": "website/apps/big_brother/admin.py", "copies": "2", "size": "1587", "license": "mpl-2.0", "hash": 871720343095850000, "line_mean": 35.9069767442, "line_max": 93, "alpha_frac": 0.6994328922, "autogenerated": false, "ratio": 3.5110619469026547, "config_test": ...
from django.core.exceptions import PermissionDenied from django.http.response import HttpResponse, JsonResponse from django.views.decorators.csrf import csrf_exempt from rest_framework.parsers import JSONParser from website.apps.home.models import UploadJob from website.apps.home.serializers import UploadJobSerialize...
{ "repo_name": "ecaldwe1/zika", "path": "website/apps/home/views/upload_job_view.py", "copies": "2", "size": "1693", "license": "mpl-2.0", "hash": 5047725155248593000, "line_mean": 34.2708333333, "line_max": 71, "alpha_frac": 0.7135262847, "autogenerated": false, "ratio": 4.109223300970874, "con...
from django.db.transaction import atomic from website.apps.big_brother.models import PageVisit import logging logger = logging.getLogger(__name__) class BigBrotherMiddleware: def process_request(self, request, *args, **kwargs): user = request.user host =request.META.get("HTTP_HOST", "") q...
{ "repo_name": "vecnet/zika", "path": "website/apps/big_brother/middleware.py", "copies": "2", "size": "2800", "license": "mpl-2.0", "hash": -2374060941062363600, "line_mean": 40.1764705882, "line_max": 107, "alpha_frac": 0.5985714286, "autogenerated": false, "ratio": 4.24886191198786, "config_t...
from django.test.testcases import TestCase from django.test.utils import override_settings from django.urls.base import reverse class GoogleAnalyticsCodeTest(TestCase): def setUp(self): self.client.login(username="admin", password="1") @override_settings(DISABLE_GOOGLE_ANALYTICS=False,) def test...
{ "repo_name": "vecnet/zika", "path": "website/tests/test_google_analytics.py", "copies": "1", "size": "1370", "license": "mpl-2.0", "hash": -2843051877563572000, "line_mean": 40.5151515152, "line_max": 96, "alpha_frac": 0.7204379562, "autogenerated": false, "ratio": 3.624338624338624, "config_t...
import logging import os from django.http.response import HttpResponse from website.apps.big_brother.models import TrackingCode logger = logging.getLogger(__name__) static_dir = os.path.join(os.path.dirname((os.path.abspath(__file__))), "static", "big_brother") def tracking_code_view(request, tracking_code, callb...
{ "repo_name": "vecnet/zika", "path": "website/apps/big_brother/views.py", "copies": "2", "size": "1658", "license": "mpl-2.0", "hash": -6112402382365782000, "line_mean": 32.8367346939, "line_max": 96, "alpha_frac": 0.6809408926, "autogenerated": false, "ratio": 3.527659574468085, "config_test":...
import os from django.core.management.base import BaseCommand from django.core.management import call_command from django.db import connection from django import db from website.management.commands.backup_db import backup class Command(BaseCommand): def add_arguments(self, parser): # Named (optional) a...
{ "repo_name": "ecaldwe1/zika", "path": "website/management/commands/reset.py", "copies": "2", "size": "3380", "license": "mpl-2.0", "hash": 9185045725381680000, "line_mean": 40.7283950617, "line_max": 134, "alpha_frac": 0.6162721893, "autogenerated": false, "ratio": 4.4298820445609435, "config_...
#!/bin/env python3.5 import math def test_func(x): return x*x*x+1.1*x*x+0.9*x-1.4 def df_test_func(x): return 3*x*x+2.2*x+0.9 # binary seperation def binary_seperation(func, x, ap=0.001): list(x).sort() x2 = x.pop() x1 = x.pop() y1 = func(x1) y2 = func(x2) if y1 == 0: re...
{ "repo_name": "free-free/algorithm", "path": "equation_solution.py", "copies": "1", "size": "1546", "license": "apache-2.0", "hash": -739280548816611100, "line_mean": 19.6133333333, "line_max": 57, "alpha_frac": 0.4411384217, "autogenerated": false, "ratio": 2.702797202797203, "config_test": fa...
#!/bin/env python3.5 import os import logging import json import sys from flask import Flask, render_template, jsonify from flask.ext.bower import Bower from flask.ext.bcrypt import Bcrypt import config from model.shared import db, ma from model.data_models import University, Company from model.data_schema import * a...
{ "repo_name": "mariasabastian/uninetz.club", "path": "app.py", "copies": "1", "size": "3537", "license": "apache-2.0", "hash": -1456201753326503700, "line_mean": 26.4263565891, "line_max": 79, "alpha_frac": 0.7127509189, "autogenerated": false, "ratio": 3.1356382978723403, "config_test": false,...
#!/bin/env python3.6 import logging import os import re import shutil import subprocess GIT_ROOT = "/home/ladders/git/ladders" WEB_ROOT = "/home/ladders/web" API_ROOT = "/home/ladders/api" UWSGI_MASTER_PIPE = "/tmp/ladders.master" def main() -> None: logging.basicConfig() logging.info("Checking out git.") ...
{ "repo_name": "lrem/ladders", "path": "prod/deploy.py", "copies": "1", "size": "2127", "license": "mit", "hash": -6094924605466980000, "line_mean": 32.234375, "line_max": 76, "alpha_frac": 0.6257639868, "autogenerated": false, "ratio": 3.2874806800618237, "config_test": false, "has_no_keyword...
#!/bin/env python3.6 import re import sys import os import subprocess def message(msg): sys.stdout.write(f'\u001B[33;1m{msg}\u001B[39m\n') GIT_PROPERTIES = 'alvisnlp-core/target/classes/fr/inra/maiage/bibliome/alvisnlp/core/app/AlvisNLPGit.properties' PROP_TAG = re.compile(r'^git\.closest\.tag\.name=(?P<major>\...
{ "repo_name": "Bibliome/alvisnlp", "path": "release.py", "copies": "1", "size": "3022", "license": "apache-2.0", "hash": 2635434330502189000, "line_mean": 34.5529411765, "line_max": 152, "alpha_frac": 0.6376571807, "autogenerated": false, "ratio": 3.0310932798395185, "config_test": false, "ha...
#! /bin/env python3 ''' Class that represents a bit mask. It has methods representing all the bitwise operations plus some additional features. The methods return a new BitMask object or a boolean result. See the bits module for more on the operations provided. ''' # For testing API, "BitMask" API can be "see". __all_...
{ "repo_name": "djsilenceboy/LearnTest", "path": "Python_Test/PySample1/com/djs/learn/module/bitwise/Bitmask.py", "copies": "1", "size": "1147", "license": "apache-2.0", "hash": 5081815473569735000, "line_mean": 21.4901960784, "line_max": 57, "alpha_frac": 0.5902353967, "autogenerated": false, "ra...
#!/bin/env python3 # -*- code:utf-8 -*- from selenium import webdriver import bs4,requests,re,pymongo,time Client = pymongo.MongoClient("localhost",27017) Database = Client["sh_muniaocom"] Datatables = Database[time.strftime("sh_%Y%m%d")] headers = { "User-Agent":"Mozilla/5.0 (Linux; Android 5.0; SM-G900P Build/L...
{ "repo_name": "erlinux/ToolsProject", "path": "Python/爬虫/collectionhouse/muniao.py", "copies": "1", "size": "2963", "license": "mit", "hash": -3402427096343080400, "line_mean": 50.5263157895, "line_max": 154, "alpha_frac": 0.6254681648, "autogenerated": false, "ratio": 2.907920792079208, "confi...
#!/bin/env python3 # -*- code:utf-8 -*- import bs4,time,pymongo,requests,html2text import itertools Client = pymongo.MongoClient("localhost",27017) Database = Client["sh_xiaozhucom"] Datatables = Database[time.strftime("sh_%Y%m%d")] h = html2text.HTML2Text() h.ignore_links = True Num = 0 for i in range(1,14,1): ...
{ "repo_name": "erlinux/ToolsProject", "path": "Python/爬虫/collectionhouse/xiaozhu.py", "copies": "1", "size": "2421", "license": "mit", "hash": 8731954217445542000, "line_mean": 48.2448979592, "line_max": 145, "alpha_frac": 0.5404061334, "autogenerated": false, "ratio": 3.5174927113702625, "conf...
import requests import json import sys # 企业号及应用相关信息 corp_id = 'ww693610bce321bcef' corp_secret = 'NgsWEKCB0jtt4J2Igkns3qTV51cBX-Nyu9o2thtYp58' agent_id = 1000002 # 存放access_token文件路径 file_path = 'access_token.log' def get_access_token_from_file(): try: f = open(file_path, 'r+') this_access_token = f.read() pri...
{ "repo_name": "gavinshaw/py_learning", "path": "tips/zabbix_weixin_notify.py", "copies": "1", "size": "2173", "license": "mit", "hash": 9053159595032190000, "line_mean": 22.578313253, "line_max": 112, "alpha_frac": 0.6826775677, "autogenerated": false, "ratio": 2.13646288209607, "config_test": ...
import random import requests from bs4 import BeautifulSoup import json import sqlite3 import sys import re import time #!/bin/env python3 # coding=utf-8 # Date : 2016-11-22 19:43:42 # Author : Statby # Description : import random import requests from bs4 import BeautifulSoup import json import ...
{ "repo_name": "statby/spider", "path": "house_spider/main.py", "copies": "1", "size": "14335", "license": "mit", "hash": 866636231831568300, "line_mean": 44.9064516129, "line_max": 252, "alpha_frac": 0.5868877802, "autogenerated": false, "ratio": 3.43743961352657, "config_test": false, "has_n...
import requests from bs4 import BeautifulSoup def get_area_url(): #获取所有未过滤所有地区url列表 data = [] headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36',} site = 'http://alexa.chinaz.com/Country/index.html' req = requests...
{ "repo_name": "statby/spider", "path": "top-website-ranking/get_area_url.py", "copies": "1", "size": "3789", "license": "mit", "hash": -1365460184307768800, "line_mean": 22.6496815287, "line_max": 141, "alpha_frac": 0.7347158632, "autogenerated": false, "ratio": 2.551890034364261, "config_test"...
import requests from bs4 import BeautifulSoup import xlsxwriter from get_area_url import get_urls def get_data(page, area='index_CN'): #获取单页网站排名信息 data = [] headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36',} if pag...
{ "repo_name": "statby/spider", "path": "top-website-ranking/get_different_area_site_ranking.py", "copies": "1", "size": "3422", "license": "mit", "hash": 9116600213461528000, "line_mean": 32.2727272727, "line_max": 141, "alpha_frac": 0.6017000607, "autogenerated": false, "ratio": 2.95691202872531...
import requests from bs4 import BeautifulSoup import time import xlwt import xlsxwriter def get_data(page, area='Global'): #获取单页网站排名信息 data = [] headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36',} if page == 1: ...
{ "repo_name": "statby/spider", "path": "top-website-ranking/get_global_site_ranking.py", "copies": "1", "size": "2945", "license": "mit", "hash": 4335492293504703000, "line_mean": 29.8152173913, "line_max": 141, "alpha_frac": 0.5855379189, "autogenerated": false, "ratio": 3.015957446808511, "co...
#!/bin/env python3 # -*- coding:utf-8 -*- from bs4 import BeautifulSoup from requests import get from nltk import word_tokenize, tag, data from nltk.corpus import stopwords import re class WebPageContent(object): def __init__(self, pages): self.initialize() self.get_content(pages) def initi...
{ "repo_name": "wagnersouz4/miningDTH", "path": "miningdth/modules/webpage_content.py", "copies": "1", "size": "5186", "license": "mit", "hash": -5994600452932696000, "line_mean": 36.8540145985, "line_max": 90, "alpha_frac": 0.4924797532, "autogenerated": false, "ratio": 3.8875562218890556, "con...
#!/bin/env python3 # coding=utf-8 from functools import reduce import sys is_py3k = bool(sys.version_info[0] == 3) class IdGenerator: """id 生成器""" def __init__(self): self.id = -1 def next(self): self.id += 1 return self.id class Queue(list): """普通队列""" def pop(self,...
{ "repo_name": "ifplusor/actrie", "path": "utils/LRAnalyzer.py", "copies": "1", "size": "23264", "license": "bsd-3-clause", "hash": -539846768760864400, "line_mean": 31.1414427157, "line_max": 140, "alpha_frac": 0.4968755501, "autogenerated": false, "ratio": 3.642834241744149, "config_test": fal...
#!/bin/env python3 # -*- coding: utf-8 -*- from __future__ import print_function from datetime import datetime from pdfrw import PdfReader from tika import parser from elasticsearch import Elasticsearch from PIL import Image from PIL import ImageFilter import sys import email import re import logging import coloredlog...
{ "repo_name": "kyilmaz80/emailrelay-dlp", "path": "parse_msg.py", "copies": "1", "size": "26694", "license": "mit", "hash": 5894565225052553000, "line_mean": 35.2676630435, "line_max": 79, "alpha_frac": 0.5432510396, "autogenerated": false, "ratio": 4.09088122605364, "config_test": false, "ha...
#!/bin/env python3 # coding = utf-8 import os import re import json try: import lpd except ImportError: import sys sys.path.append('../lpd') import lpd import load_txt import get_html from utils.ps_tt import words import conf __version__ = '1.0.1' editor = 'Louis George Alexander' def load_b...
{ "repo_name": "meng89/nce", "path": "nce.py", "copies": "1", "size": "5040", "license": "mit", "hash": 8050107447055616000, "line_mean": 25.387434555, "line_max": 116, "alpha_frac": 0.5456349206, "autogenerated": false, "ratio": 3.539325842696629, "config_test": false, "has_no_keywords": fals...
#!/bin/env python3 # -*- coding: utf-8 -*- import re import logging __version__ = '0.2.0' lpd = [] lpd_d = {} def split_main_words(s): words = [word.strip().replace('|', '') for word in s.split(',')] news_words = [words[0]] for word in words[1:]: if word.endswith('\~'): new_word...
{ "repo_name": "meng89/lpd", "path": "lpd.py", "copies": "1", "size": "9696", "license": "mit", "hash": -9206767765686687000, "line_mean": 28.1355421687, "line_max": 119, "alpha_frac": 0.4614907474, "autogenerated": false, "ratio": 3.4857657657657657, "config_test": false, "has_no_keywords": f...
#!/bin/env python3 # -*- coding: utf-8 -*- import socket import parse_msg import os import sys import re import logging import csv import params from threading import Thread """ EmailRelay eml parse threaded server process date 170707 """ __author__ = "Koray YILMAZ" __email__ = 'kyilmaz80@gmail.com' __version__ = "1....
{ "repo_name": "kyilmaz80/emailrelay-dlp", "path": "parse_server.py", "copies": "1", "size": "3399", "license": "mit", "hash": 8659178401770771000, "line_mean": 28.8157894737, "line_max": 75, "alpha_frac": 0.6060606061, "autogenerated": false, "ratio": 3.643086816720257, "config_test": false, ...
""" .. moduleauthor:: Julian Bieber <schaf.xx@gmail.com> """ import os, logging from lxml import html import click from tabulate import tabulate CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help']) def parse_index_file(path): with open(path, 'r') as f: content = f.read() tree = html.fromstri...
{ "repo_name": "AFriemann/LowCarb", "path": "tools/check-coverage.py", "copies": "1", "size": "2907", "license": "mit", "hash": 4313895445979748400, "line_mean": 35.7974683544, "line_max": 136, "alpha_frac": 0.5896112831, "autogenerated": false, "ratio": 3.8099606815203146, "config_test": false,...
#!/bin/env python3 # -*- coding: utf-8 -*- """ Class to make morse sounds from English characters. We use a state machine to send well-formed morse code. morse = SendMorse() ------------------- morse.set_speeds(chars_per_minute, words_per_minute) ---------------------------------------------------- (cwpm, wpm) = m...
{ "repo_name": "rzzzwilson/morse", "path": "morse_trainer/send_morse.py", "copies": "1", "size": "7532", "license": "mit", "hash": 4892706619819373000, "line_mean": 32.1806167401, "line_max": 80, "alpha_frac": 0.502920871, "autogenerated": false, "ratio": 3.64922480620155, "config_test": false, ...
#!/bin/env python3 # -*- coding: utf-8 -*- """ Class to read morse sounds from the internal microphone and return the English characters. The code can read dynamic parameters from a JSON file. The dynamic parameters (possibly changed) can be save back to a file. morse = ReadMorse() ---------------- morse.load_para...
{ "repo_name": "rzzzwilson/morse", "path": "morse_trainer/receive_morse.py", "copies": "1", "size": "11019", "license": "mit", "hash": 7096588801234281000, "line_mean": 29.6935933148, "line_max": 81, "alpha_frac": 0.4537616844, "autogenerated": false, "ratio": 4.002542680711951, "config_test": f...
#!/bin/env python3 # -*- coding: utf-8 -*- """ Converts a single-column CSV into ami-dictionary XML-format. """ import argparse import os import csv from lxml import etree parser = argparse.ArgumentParser(description='Converts a single-column CSV into ami-dictionary XML-format.') parser.add_argument('--input', dest=...
{ "repo_name": "ContentMine/pyCProject", "path": "pycproject/convert2amidict.py", "copies": "1", "size": "2322", "license": "mit", "hash": 566605336767161700, "line_mean": 29.5526315789, "line_max": 108, "alpha_frac": 0.6520241171, "autogenerated": false, "ratio": 3.6394984326018807, "config_tes...
""" Extracting information from transparenzdatenbank.at Output from the #gutedaten Hackathon in Graz, Sat. 28. Nov. 2015 """ __author__ = "Christopher Kittel" __copyright__ = "Copyright 2015" __license__ = "MIT" __version__ = "0.0.3" __maintainer__ = "Christopher Kittel" __email__ = "web@christopherkittel.eu" __st...
{ "repo_name": "OKFNat/agroScraper", "path": "code/agroscraper.py", "copies": "1", "size": "7992", "license": "mit", "hash": -3138459877418420700, "line_mean": 31.8888888889, "line_max": 154, "alpha_frac": 0.5752002002, "autogenerated": false, "ratio": 3.5726419311578006, "config_test": false, ...
#!/bin/env python3 # -*- coding: utf-8 -*- """ Provides basic function to read a ContentMine CProject and CTrees into python datastructures. """ # import file io import re import os import glob from lxml import etree import json from collections import Counter import pandas as pd # import data handling from bs4 imp...
{ "repo_name": "ContentMine/pyCProject", "path": "pycproject/readctree.py", "copies": "1", "size": "14343", "license": "mit", "hash": 4177436037958062000, "line_mean": 31.9724137931, "line_max": 97, "alpha_frac": 0.5401241023, "autogenerated": false, "ratio": 4.152576722640417, "config_test": fa...
#!/bin/env python3 # -*- coding: utf-8 -*- """ Test the 'send_morse' module. """ import sys import os import getopt from send_morse import SendMorse # get program name from sys.argv prog_name = sys.argv[0] if prog_name.endswith('.py'): prog_name = prog_name[:-3] def usage(msg=None): if msg: print((...
{ "repo_name": "rzzzwilson/morse", "path": "morse_trainer/test_send_morse.py", "copies": "1", "size": "1444", "license": "mit", "hash": -5341412244579929000, "line_mean": 20.8787878788, "line_max": 74, "alpha_frac": 0.5519390582, "autogenerated": false, "ratio": 2.888, "config_test": false, "h...
#!/bin/env python3 # -*- coding: utf-8 -*- """ This is a scraper for the Austrian Lobbying-Register. It fetches the HTML, saves it locally and converts the relevant data into a json file. """ import re from datetime import datetime, date import time import json import os import urllib.request from bs4 import Beautifu...
{ "repo_name": "OKFNat/lobbyscraper", "path": "code/lobbyscraper.py", "copies": "1", "size": "19855", "license": "mit", "hash": -952562919577623000, "line_mean": 36.1065420561, "line_max": 424, "alpha_frac": 0.5795385855, "autogenerated": false, "ratio": 3.6292504570383914, "config_test": false,...
#!/bin/env python3 # -*- coding: utf-8 -*- ''' This script recreate a 'gallery' folder and put all pictures in the correct folder by reading the piwigo database. Be aware than it creates a 'flat structure' : no complex subdirectories, one folder is one album. Maybe you will have duplicates pictures, because they were ...
{ "repo_name": "AntoineVe/piwigo_unvirtualize", "path": "piwigo_unvirtualize.py", "copies": "1", "size": "3993", "license": "mit", "hash": -8058030470932367000, "line_mean": 38.5346534653, "line_max": 113, "alpha_frac": 0.6178312046, "autogenerated": false, "ratio": 3.527385159010601, "config_te...
#!/bin/env python3 # -*- coding: utf-8 -*- #Python3 version import xlrd import xml.etree.ElementTree as ET from xml.dom import minidom def read_xls(filename): data = xlrd.open_workbook(filename) table = data.sheet_by_index(0) nrows = table.nrows d = {} for i in range(nrows): d[st...
{ "repo_name": "starlightme/My-Solutions-For-Show-Me-the-Code", "path": "Jimmy66/0017/0017(2).py", "copies": "1", "size": "1041", "license": "mpl-2.0", "hash": -1300870667533909000, "line_mean": 24.4, "line_max": 87, "alpha_frac": 0.5931034483, "autogenerated": false, "ratio": 3.002958579881657, ...
import datetime import pytz from django.contrib.auth.models import User from django.test.testcases import TestCase from website.apps.home.models import UploadJob class UploadJobModelTest(TestCase): def setUp(self): self.user = User.objects.create(username="user") def test_duration_new_1(self): ...
{ "repo_name": "vecnet/zika", "path": "website/apps/home/tests/models/test_upload_job.py", "copies": "2", "size": "5130", "license": "mpl-2.0", "hash": 8217765168208319000, "line_mean": 37, "line_max": 97, "alpha_frac": 0.6298245614, "autogenerated": false, "ratio": 3.7200870195794056, "config_t...
from django.contrib.auth.models import User from django.core.files.base import ContentFile from django.core.management import call_command from django.test.testcases import TestCase from website.apps.home.models import UploadJob, Simulation, SimulationModel class LoadDataTest(TestCase): def setUp(self): ...
{ "repo_name": "vecnet/zika", "path": "website/apps/home/tests/commands/test_load_data.py", "copies": "2", "size": "2528", "license": "mpl-2.0", "hash": 5352068466714592000, "line_mean": 44.9818181818, "line_max": 215, "alpha_frac": 0.6768196203, "autogenerated": false, "ratio": 3.5605633802816903...
from django.core.management.base import BaseCommand from website.apps.home.models import UploadJob from website.apps.home.utils import load_simulation_file job = None import signal import sys def signal_handler(signal, frame): print('SIGTERM handler activated: %s' % signal) global job job.status = Uploa...
{ "repo_name": "ecaldwe1/zika", "path": "website/apps/home/management/commands/load_data.py", "copies": "2", "size": "2043", "license": "mpl-2.0", "hash": 1094263554198767600, "line_mean": 34.8421052632, "line_max": 108, "alpha_frac": 0.6696035242, "autogenerated": false, "ratio": 3.78333333333333...
import csv import logging import time from django.core.exceptions import ObjectDoesNotExist from django.db import connection from django.utils.timezone import now from website.apps.home.models import Location, Data, Simulation, SimulationModel, Totals, UploadJob logger = logging.getLogger(__name__) def load_simul...
{ "repo_name": "vecnet/zika", "path": "website/apps/home/utils.py", "copies": "2", "size": "7317", "license": "mpl-2.0", "hash": -1011631646751530800, "line_mean": 43.3454545455, "line_max": 117, "alpha_frac": 0.569769031, "autogenerated": false, "ratio": 4.031404958677686, "config_test": false,...
import datetime from django.contrib.auth.models import User from django.core.files.base import ContentFile from django.test.testcases import TestCase from website.apps.home.models import UploadJob, Simulation, Data, SimulationModel, Totals from website.apps.home.utils import load_simulation_file class LoadSimulatio...
{ "repo_name": "vecnet/zika", "path": "website/apps/home/tests/utils/test_load_simulation_file.py", "copies": "2", "size": "9418", "license": "mpl-2.0", "hash": 7233215578001206000, "line_mean": 54.4, "line_max": 215, "alpha_frac": 0.6723295817, "autogenerated": false, "ratio": 3.2735488355926314,...
#!/bin/env python3 # -*- coding: utf-8 -*- ''' Утиліта для полегшення імпорта данних Written by Andriy Danyleiko and Liudmyla Kislitsyna Send bugs to andrii.danyleiko@gmail.com ''' import math import sys import urllib.request import random import fastkml import overpy import lxml.html def get_pass_from_overpass(lon...
{ "repo_name": "DefteZ/westra2osm", "path": "westra2osm_lib.py", "copies": "1", "size": "7392", "license": "mit", "hash": -8570734918874742000, "line_mean": 32.8701923077, "line_max": 153, "alpha_frac": 0.5990063875, "autogenerated": false, "ratio": 3.0068288518992743, "config_test": false, "h...
#!/bin/env python3 # -*- coding: utf-8 -*- ''' Utility for mountain pass validation Written by Andriy Danyleiko and Liudmyla Kislitsyna Send bugs to andrii.danyleiko@gmail.com or by github https://github.com/DefteZ/westra2osm/ ''' import sys, argparse, codecs import datetime #import pygpx, gpxpy.gpx import westra2osm...
{ "repo_name": "DefteZ/westra2osm", "path": "pass_validator.py", "copies": "1", "size": "8253", "license": "mit", "hash": -3714244088244420600, "line_mean": 34.3761061947, "line_max": 227, "alpha_frac": 0.5889931207, "autogenerated": false, "ratio": 2.9832089552238807, "config_test": false, "h...
"""Module to define a molecule to use for simulation.""" import logging from itertools import combinations_with_replacement from typing import Any, Dict, List, Tuple import hoomd import hoomd.md import numpy as np from .math_helper import rotate_vectors logger = logging.getLogger(__name__) class Molecule(object)...
{ "repo_name": "malramsay64/MD-Molecules-Hoomd", "path": "statdyn/molecules.py", "copies": "1", "size": "10101", "license": "mit", "hash": -6405470635867438000, "line_mean": 35.9963369963, "line_max": 101, "alpha_frac": 0.6137623762, "autogenerated": false, "ratio": 3.965449548488418, "config_te...
from flask import Flask, request, render_template import json from pathlib import Path import requests import dspl2 from dspl2 import ( Dspl2JsonLdExpander, Dspl2RdfExpander, InternetFileGetter, JsonToKwArgsDict, LoadGraph, FrameGraph, UploadedFileGetter) def _Display(template, json_val): return render_te...
{ "repo_name": "google/dspl", "path": "tools/dspl2/scripts/dspl2-pretty-print-server.py", "copies": "1", "size": "2678", "license": "bsd-3-clause", "hash": -239917395198081120, "line_mean": 31.6585365854, "line_max": 68, "alpha_frac": 0.57356236, "autogenerated": false, "ratio": 4.113671274961598,...
"""Check Gentoo services with rc-status command This script populates .1.3.6.1.4.1.34741.3 subtree of an SNMP server. """ import re import subprocess from optparse import OptionParser # BR OID for services OID_PREFIX = '.1.3.6.1.4.1.34741.3' def rc_status(params): """Run rc-status with parameters and parse the...
{ "repo_name": "BinetReseau/SNMP_Services", "path": "snmp_gentoo_services.py", "copies": "1", "size": "5870", "license": "mit", "hash": -334557417644141800, "line_mean": 28.0495049505, "line_max": 79, "alpha_frac": 0.5673142468, "autogenerated": false, "ratio": 3.556363636363636, "config_test": ...
#!/bin/env python3 def num_vowels(word): return sum(word.count(c) for c in "aeiou") def bad_string(word): return "ab" in word or "cd" in word or "pq" in word or "xy" in word def double_char(word): for i in range(0, len(word)-1): if word[i] == word[i+1]: return True return False ...
{ "repo_name": "f-koehler/adventofcode", "path": "d05.py", "copies": "1", "size": "1093", "license": "mit", "hash": 3193315118230594600, "line_mean": 20.431372549, "line_max": 71, "alpha_frac": 0.5745654163, "autogenerated": false, "ratio": 3.195906432748538, "config_test": false, "has_no_keyw...
import nfa, itertools from collections import deque class DFA: def __init__(self): self.transitions = {} self.accept = set() self.start_state = 0 self.alphabet = frozenset() def add_transition(self, from_state, on_char, to_state): if from_state not in self.transitions: self.transitions[from_state] = ...
{ "repo_name": "stack-overflow/py_finite_state", "path": "dfa.py", "copies": "1", "size": "5085", "license": "mit", "hash": -8779856474095895000, "line_mean": 23.1042654028, "line_max": 79, "alpha_frac": 0.6682399213, "autogenerated": false, "ratio": 2.5552763819095476, "config_test": true, "h...
#!/bin/env python3 dsript="""\ #=============================================================================== # # FILE: selective-backup.py # # USAGE: ./selective-backup.py [-o] [-l] [-r] file1 [file2]...[folder1... # # DESCRIPTION: Duplicate a directory to a given location using ...
{ "repo_name": "MikeDacre/mike_tools", "path": "bin/backup.py", "copies": "1", "size": "9534", "license": "unlicense", "hash": 5201853414009362000, "line_mean": 39.9184549356, "line_max": 169, "alpha_frac": 0.5657646318, "autogenerated": false, "ratio": 4.166958041958042, "config_test": false, ...
#! /bin/env python3 # encoding: utf-8 # exam - Exam baker (c) Baltasar 2017 MIT license <jbgarcia@uvigo.es> from __future__ import print_function import sys import os import json import zipfile import unicodedata import subprocess AppInfo = { "name": "exam", "version": "v0.3 20171105" } ExcludedFilesByEx...
{ "repo_name": "Baltasarq/ExamenDIA", "path": "exam.py", "copies": "1", "size": "13432", "license": "mit", "hash": -4125937949782577700, "line_mean": 28.9821428571, "line_max": 79, "alpha_frac": 0.5265038714, "autogenerated": false, "ratio": 3.4574002574002574, "config_test": false, "has_no_ke...
#!/bin/env python3 ## Evan Widloski - 2017-05-01 - Graphical Tuning Script for redrum ## Check scores for images of various ratios, resolutions, views ## Shows individual scores before and after logistic discrimination ## Note: Images tested in tune.py must be in the redrum cache ## examples: ## tune.py D331RXf P7I7...
{ "repo_name": "Evidlo/redrum", "path": "redrum/tune.py", "copies": "2", "size": "2930", "license": "mit", "hash": 348477935117280830, "line_mean": 38.5945945946, "line_max": 140, "alpha_frac": 0.5597269625, "autogenerated": false, "ratio": 3.5005973715651133, "config_test": false, "has_no_key...
import re, shlex, os, sys, shutil from pathlib import Path # scrubpy version scrubpyversion = "2016-10-03a" # Define functions def removeComments(string): #string = re.sub(re.compile("/\*.*?\*/",re.DOTALL ) ,"", string) #string = re.sub(re.compile("//.*?\n" ) ,"" ,string) pattern = r"(\".*?\"|\'.*?\')|(/\*....
{ "repo_name": "bgstack15/ansible01", "path": "inc/scrub.py", "copies": "1", "size": "4351", "license": "unlicense", "hash": -8400864135638894000, "line_mean": 34.958677686, "line_max": 129, "alpha_frac": 0.6612273041, "autogenerated": false, "ratio": 3.2812971342383106, "config_test": false, ...
#!/bin/env python3 # first three octet identify organization # organizationally unique identifier(OUI) # following three(MAC-48 and EUI-48) or # five (EUI-64) octets are assigned by that # organization - arbitrarily # locally administered addresses do not contain OUI's # difference of universal/local, setting the se...
{ "repo_name": "dgengtek/scripts", "path": "network/mac_generate.py", "copies": "1", "size": "7231", "license": "mit", "hash": 4211404308173947400, "line_mean": 24.825, "line_max": 76, "alpha_frac": 0.5790347117, "autogenerated": false, "ratio": 3.3461360481258677, "config_test": false, "has_n...
#!/bin/env python3 from base64 import b64encode from os import environ from json import dumps from os.path import exists, join from sys import stderr, stdout from string import Template def slurp(filename, as_template=True): with open("cloud-config/" + filename, "r") as config: if as_template: ...
{ "repo_name": "rcarmo/azure-docker-swarm-cluster", "path": "genparams.py", "copies": "1", "size": "1876", "license": "mit", "hash": 4477966045167457300, "line_mean": 27, "line_max": 87, "alpha_frac": 0.5943496802, "autogenerated": false, "ratio": 3.29701230228471, "config_test": false, "has_n...
#!/bin/env python3 from collections import namedtuple from itertools import cycle Position = namedtuple("Position", ["row", "col"]) def is_seat(s): return s == '#' or s == 'L' def is_occupied(s): return s == '#' def adjacent_seats(seats, p: Position): res = [] for r, c in [(p.row, p.col - 1), (p....
{ "repo_name": "bbglab/adventofcode", "path": "2020/jordi/day11/part1and2.py", "copies": "1", "size": "2631", "license": "mit", "hash": 2750177954948946000, "line_mean": 30.3214285714, "line_max": 193, "alpha_frac": 0.5929304447, "autogenerated": false, "ratio": 2.9661781285231115, "config_test"...
#!/bin/env python3 from copy import deepcopy import re spells = [ "Magic Missile", "Drain", "Shield", "Poison", "Recharge" ] costs = { "Magic Missile": 53, "Drain": 73, "Shield": 113, "Poison": 173, "Recharge": 229 } cast_damages = { "Magic Missile": 4, "Drain": 2, ...
{ "repo_name": "f-koehler/adventofcode", "path": "d22.py", "copies": "1", "size": "3095", "license": "mit", "hash": 4918147717011321000, "line_mean": 20.0544217687, "line_max": 68, "alpha_frac": 0.5583198708, "autogenerated": false, "ratio": 2.933649289099526, "config_test": false, "has_no_key...
#!/bin/env python3 from .crypto import * from time import time from .forms import * import logging # from .chat_server import str2hex import json class Client: def __init__(self, websocket, send_limiter, room_name=None, name='NaN'): self.name = name self.id = None self.websocket = websocket...
{ "repo_name": "Zaeb0s/websocket-chat-server", "path": "websocketchat/client.py", "copies": "1", "size": "7806", "license": "mit", "hash": -8009460609987072000, "line_mean": 35.6478873239, "line_max": 132, "alpha_frac": 0.4883423008, "autogenerated": false, "ratio": 3.774661508704062, "config_te...
#!/bin/env python3 # from distutils.core import setup from setuptools import setup from ewebsockets import __version__ import sys def readme(): with open('README.rst') as f: return f.read() print('Current version: ', __version__) version = __version__.split('.') if sys.argv[-1] == 'minor': version...
{ "repo_name": "Zaeb0s/epoll-websocket-server", "path": "setup.py", "copies": "1", "size": "1620", "license": "mit", "hash": 7199973867522075000, "line_mean": 27.9285714286, "line_max": 110, "alpha_frac": 0.6228395062, "autogenerated": false, "ratio": 3.3891213389121337, "config_test": false, ...
#!/bin/env python3 # from distutils.core import setup from setuptools import setup from loopfunction import __version__ import sys def readme(): with open('README.rst') as f: return f.read() print('Current version: ', __version__) version = __version__.split('.') if sys.argv[-1] == 'minor': version...
{ "repo_name": "Zaeb0s/loop-function", "path": "setup.py", "copies": "1", "size": "1549", "license": "mit", "hash": -3933826493575703600, "line_mean": 27.6851851852, "line_max": 85, "alpha_frac": 0.6229825694, "autogenerated": false, "ratio": 3.4808988764044946, "config_test": false, "has_no_k...
#!/bin/env python3 from field import FieldValue from random import randint, choice import math def make_c_source(prime=2**31-1): n = math.ceil(math.log2(prime) / 8) + 1 F = lambda i: FieldValue(i, prime) h = lambda i: hex(i)[2:] def random(): """ Generates a number with a uniformly random numb...
{ "repo_name": "boppreh/ecc", "path": "make_tests.py", "copies": "1", "size": "2517", "license": "mit", "hash": 7013353558991690000, "line_mean": 35.4782608696, "line_max": 133, "alpha_frac": 0.5649582837, "autogenerated": false, "ratio": 3.0179856115107913, "config_test": true, "has_no_keywor...
#!/bin/env python3 from __future__ import print_function import re import markdown from sys import argv from .util import * try: input = raw_input except NameError: pass class Pytem: templates = {} global_tags = {} def __init__(self, templatedir, globalfile=None): self.templates = self._...
{ "repo_name": "wastevensv/pytem", "path": "pytem.py", "copies": "1", "size": "4768", "license": "mit", "hash": 939545540950082600, "line_mean": 36.5433070866, "line_max": 95, "alpha_frac": 0.5209731544, "autogenerated": false, "ratio": 4.106804478897502, "config_test": false, "has_no_keywords...
#!/bin/env python3 from __future__ import print_function import re import os import sys from pprint import pprint PEER = re.compile(r'[0-9]+(?:\.[0-9]+){3}') def main(): filename = sys.argv[1] files = [] if os.path.exists(os.path.abspath(filename)): files.append(filename) elif filename == '--a...
{ "repo_name": "ryanordille/vuze-log-fairness", "path": "fairness.py", "copies": "1", "size": "1698", "license": "mit", "hash": 576432855321126800, "line_mean": 24.3432835821, "line_max": 75, "alpha_frac": 0.5795053004, "autogenerated": false, "ratio": 3.3294117647058825, "config_test": false, ...
#!/bin/env python3 from itertools import chain # add additional alias tags if one is found from the set tag_alias_map = [ {"salt", "saltstack"}, {"life", "private"}, {"install", "setup"}, {"log", "logging"}, {"mail", "e-mail"}, {"story", "userstory"}, {"virt", "v...
{ "repo_name": "dgengtek/dotfiles", "path": "taskwarrior/.task/hooks/task_tags_relation_mapping.py", "copies": "1", "size": "6095", "license": "mit", "hash": 8255012326675806000, "line_mean": 38.0641025641, "line_max": 91, "alpha_frac": 0.4702986544, "autogenerated": false, "ratio": 3.576291079812...
#!/bin/env python3 from itertools import combinations from functools import reduce from operator import mul def measure_entanglement(x): return reduce(mul, x, 1) def is_splittable(packages, target, compartments): for length in range(1, len(packages)-compartments+1): for comb in (c for c in combinati...
{ "repo_name": "f-koehler/adventofcode", "path": "d24.py", "copies": "1", "size": "1667", "license": "mit", "hash": 5708659650639401000, "line_mean": 35.2391304348, "line_max": 91, "alpha_frac": 0.650269946, "autogenerated": false, "ratio": 3.988038277511962, "config_test": false, "has_no_keyw...
#!/bin/env python3 from pathlib import Path import re import sys script_dir = Path(sys.argv[0]).parent default_fs = ( list(Path('src').glob('*.*pp')) + list(Path('src/bin').glob('*.*pp')) + [Path('src/sim.i')] + list(Path('pyparm').glob('*.py')) + list(Path('pyparm/examples'...
{ "repo_name": "wackywendell/parm", "path": "src/namereplacer.py", "copies": "1", "size": "1551", "license": "bsd-3-clause", "hash": 1768114733931571500, "line_mean": 27.7222222222, "line_max": 101, "alpha_frac": 0.5460992908, "autogenerated": false, "ratio": 2.882899628252788, "config_test": fa...
from pathlib import Path CARGO_CONF = ( ('name', '"programming-challenges"'), ('version', '"0.1.0"'), ('authors', '["Alexey Golubev <dr.freecx@gmail.com>"]') ) CARGO_DEPS = (('lazy_static', '"*"'), ('time', '"*"')) CARGO_EXTRA = ( ('sdl2', { 'version': '"*"', 'default-features': 'false...
{ "repo_name": "FreeCX/programming-challenges", "path": "build.py", "copies": "1", "size": "1246", "license": "unlicense", "hash": -8131688700271944000, "line_mean": 30.15, "line_max": 99, "alpha_frac": 0.507223114, "autogenerated": false, "ratio": 2.8976744186046512, "config_test": false, "ha...
#!/bin/env python3 from pyqtgraph.Qt import QtGui, QtCore import numpy as np import pyqtgraph as pg from threading import Thread from threading import Timer import serial import argparse import serial.tools.list_ports import signal import sys import time pg.setConfigOption('background', 'w') pg.setConfigOption('foregr...
{ "repo_name": "minils/SerialPlotPy", "path": "serialplot.py", "copies": "1", "size": "4584", "license": "mit", "hash": 7003534626733650000, "line_mean": 29.56, "line_max": 116, "alpha_frac": 0.5986038394, "autogenerated": false, "ratio": 3.3705882352941177, "config_test": false, "has_no_keywo...
#!/bin/env python3 from pyquery import PyQuery as pq from pathlib import Path import os import argparse import re import requests def lead0(num, max): return str(num).zfill(len(str(max))) def terminal_size(): try: import fcntl import termios import struct th, tw, hp, wp = st...
{ "repo_name": "TilCreator/Tapastic-Comic-Downloader", "path": "tapas-dl.py", "copies": "1", "size": "11896", "license": "mit", "hash": -8863121167300171000, "line_mean": 40.7403508772, "line_max": 301, "alpha_frac": 0.580531271, "autogenerated": false, "ratio": 3.7163386441736956, "config_test"...
#!/bin/env python3 from random import randint import base64, hashlib from .bytes_convert import * from .exceptions import * def masking_algorithm(data, key): length = len(data) result = bytearray(length) for i in range(length): result[i] = data[i] ^ key[i % 4] return bytes(result) #opcodes c...
{ "repo_name": "Zaeb0s/epoll-websocket-server", "path": "ewebsockets/RFC6455.py", "copies": "1", "size": "8190", "license": "mit", "hash": -3748782842919703600, "line_mean": 34.3017241379, "line_max": 111, "alpha_frac": 0.5771672772, "autogenerated": false, "ratio": 3.321167883211679, "config_te...
#! /bin/env python3 ''' Functional wrapper around the bitwise operators. Designed to make their use more intuitive to users not familiar with the underlying C operators. Extends the functionality with bitmask read/set operations. The inputs are integer values and return types are 16 bit integers or boolean. bit indexe...
{ "repo_name": "djsilenceboy/LearnTest", "path": "Python_Test/PySample1/com/djs/learn/module/bitwise/Bits.py", "copies": "1", "size": "1466", "license": "apache-2.0", "hash": 3747178575249582000, "line_mean": 19.3611111111, "line_max": 59, "alpha_frac": 0.6105047749, "autogenerated": false, "ratio...
#!/bin/env python3 # generate passwords # TODO: generate passwords first then build aligned output table format import sys import random import click import string @click.command("pwgen.py") @click.argument("length", default=16) @click.option( "character_filter", "-f", "--filter", hel...
{ "repo_name": "dgengtek/scripts", "path": "admin/pwgen.py", "copies": "1", "size": "2978", "license": "mit", "hash": 6174205635110020000, "line_mean": 24.025210084, "line_max": 74, "alpha_frac": 0.5721961048, "autogenerated": false, "ratio": 3.9759679572763686, "config_test": false, "has_no_k...
#!/bin/env python3 # get the updated list from http://standards.ieee.org/regauth/oui/oui.txt import re import sys import json import argparse import yaml import xml.etree.ElementTree as ET from xml.dom import minidom class OUIReader( object ): def process( self, iFile="oui.txt" ): content = self.readFile( iFile )...
{ "repo_name": "vagabondcoder/django-oui", "path": "oui/management/commands/oui_to.py", "copies": "1", "size": "5077", "license": "mit", "hash": -3261910557915555300, "line_mean": 28.5174418605, "line_max": 111, "alpha_frac": 0.6165058105, "autogenerated": false, "ratio": 2.912794033275961, "con...
#!/bin/env python3 """Graph a family of level surfaces for a function of three variables. Example function: f(x,y,z)=z/sqrt(x**2+y**2)""" import sys import numpy as np import sympy from sympy.abc import x, y, z, C from matplotlib import cm, pyplot as plt from mpl_toolkits.mplot3d import Axes3D def repeat(an_object):...
{ "repo_name": "cheeseywhiz/cheeseywhiz", "path": "apcsp/graph.py", "copies": "1", "size": "4106", "license": "mit", "hash": 396990045167036900, "line_mean": 29.6417910448, "line_max": 77, "alpha_frac": 0.6091086215, "autogenerated": false, "ratio": 3.3436482084690553, "config_test": false, "h...
#!/bin/env/python3 # http://pythonhosted.org/spectrum/ import spectral as sp import matplotlib.pyplot as plt from os.path import join, split, realpath import pandas as pd from dvm.config_ini import getConfigOrCopyDefaultFile from dvm import load_REE_SWIR ######## LOAD CONFIG ######## APP_DIR = join(split(realpath(__...
{ "repo_name": "Vincentyao1995/Globalink2017-UBC", "path": "Matt_testing/check_data.py", "copies": "1", "size": "3054", "license": "mit", "hash": 5424904296271336000, "line_mean": 30.8229166667, "line_max": 118, "alpha_frac": 0.7203667322, "autogenerated": false, "ratio": 2.8409302325581396, "co...
#!/bin/env python3 if __name__ == "__main__": x = 0 y = 0 visited = dict() visited[0] = [0] num_visited = 1 with open("d03.txt") as f: commands = f.read().strip() for cmd in commands: if cmd == "^": y += 1 elif cmd == ">": x += 1 elif...
{ "repo_name": "f-koehler/adventofcode", "path": "d03.py", "copies": "1", "size": "2071", "license": "mit", "hash": -3893010615316694500, "line_mean": 23.6547619048, "line_max": 49, "alpha_frac": 0.3766296475, "autogenerated": false, "ratio": 3.967432950191571, "config_test": false, "has_no_ke...
#!/bin/env python3 import argparse from collections import namedtuple import logging as log import os from os import getcwd from os.path import exists, isdir, isfile import shutil import sys _QueueItem = namedtuple('QueueItem', ['is_file', 'path']) test = True def _load_stack(save_file): stack = list() if o...
{ "repo_name": "jkleve/Push-Copy-Pop", "path": "pcp.py", "copies": "1", "size": "6390", "license": "mit", "hash": -5995561817189153000, "line_mean": 26.0762711864, "line_max": 83, "alpha_frac": 0.5222222222, "autogenerated": false, "ratio": 3.875075803517283, "config_test": false, "has_no_keyw...
#!/bin/env python3 import argparse import json import os import random import time from markov import Group, Model CONFIG_FILE = None def loop(model, delay = 0, timeout = 0, maxlen = 0, output_file = ''): group = model.random_group() start = time.time() print(group,end=' ') count = 0 while (timeout == 0 or ti...
{ "repo_name": "calvinkoder/markov", "path": "run.py", "copies": "1", "size": "3631", "license": "mit", "hash": -3618696070726416000, "line_mean": 29.7796610169, "line_max": 173, "alpha_frac": 0.6601487194, "autogenerated": false, "ratio": 3.008285004142502, "config_test": false, "has_no_keywo...
#!/bin/env python3 import argparse import subprocess import os parser = argparse.ArgumentParser(""" Simple program for wrapping around vscode deploy reloaded to work around none standard SSH configurations """) parser.add_argument( 'filelist', nargs='+', type=str, help='List of file to change (p...
{ "repo_name": "enochnotsocool/UnixConfig", "path": "py_script/vscode_sync_over_kerberos.py", "copies": "1", "size": "1731", "license": "mit", "hash": 9176095113052143000, "line_mean": 28.3559322034, "line_max": 81, "alpha_frac": 0.5990756788, "autogenerated": false, "ratio": 4.0729411764705885, ...
#!/bin/env python3 import bs4,requests,re,time def writeList(location="./"): response = requests.get("http://www.mayi.com/shanghai/1") response.encoding="utf-8" soup = bs4.BeautifulSoup(response.content,"lxml") for i2031 in set(soup.select('#page > input[type="hidden"]')): # 话说我在弄一个个人的房屋项目,计算什么...
{ "repo_name": "erlinux/ToolsProject", "path": "Python/爬虫/collectionhouse/mayi/contect_of_url.py", "copies": "1", "size": "1354", "license": "mit", "hash": -6759305388851014000, "line_mean": 44.4615384615, "line_max": 100, "alpha_frac": 0.5812182741, "autogenerated": false, "ratio": 2.477987421383...
#!/bin/env python3 import configparser import datetime import os import re import subprocess import sys regex_repo_entry = re.compile( r"^(?P<remote>[\w\d@\.\:\-\/]+)(?:\s+\[(?P<remote_options>.*)\])?\s+->\s*(?P<local>[\w\d\.\-\/]+)\s+(?:\[(?P<local_options>.*)\])?$" ) repository_dir = None repository_file = None...
{ "repo_name": "f-koehler/gitmirror.py", "path": "gitmirror.py", "copies": "1", "size": "3505", "license": "mit", "hash": 3757274304593707000, "line_mean": 29.4782608696, "line_max": 136, "alpha_frac": 0.5340941512, "autogenerated": false, "ratio": 3.6472424557752343, "config_test": true, "has...
#!/bin/env python3 import COPASI dm = COPASI.CRootContainer.addDatamodel() def create_datahandler(names): """initialize datahandler from display names """ dh = COPASI.CDataHandler() for name in names: obj = dm.findObjectByDisplayName(name) if not obj: print('no object for name {0}'.forma...
{ "repo_name": "copasi/COPASI", "path": "copasi/bindings/python/examples/custom_output.py", "copies": "1", "size": "1243", "license": "artistic-2.0", "hash": 5682260119509272000, "line_mean": 24.8958333333, "line_max": 88, "alpha_frac": 0.6629123089, "autogenerated": false, "ratio": 3.170918367346...
#!/bin/env python3 import cv2 import numpy as np def main(): capture = cv2.VideoCapture(0) if capture.isOpened() is False: raise("IO Error") # setting capture.set(cv2.CAP_PROP_FPS, 12) capture.set(cv2.CAP_PROP_FRAME_WIDTH, 960) capture.set(cv2.CAP_PROP_FRAME_HEIGHT, 720) ...
{ "repo_name": "Babibubebon/SpheroBreakout", "path": "main.py", "copies": "1", "size": "2143", "license": "mit", "hash": 1959872969951733800, "line_mean": 26.0253164557, "line_max": 78, "alpha_frac": 0.5400468384, "autogenerated": false, "ratio": 3.0942028985507246, "config_test": false, "has_...
#!/bin/env python3 import datetime as dt import subprocess as sp from time import sleep class Timer: def __init__(self, start, stop, action, undo_action): self.start = [int(x) for x in start.split('.')] self.stop = [int(x) for x in stop.split('.')] self.action = action self.undo_a...
{ "repo_name": "IDex/scripts", "path": "redshiftplus/redshiftplus/redshiftplus.py", "copies": "1", "size": "1139", "license": "mit", "hash": -501942668080683300, "line_mean": 21.78, "line_max": 109, "alpha_frac": 0.5294117647, "autogenerated": false, "ratio": 3.615873015873016, "config_test": fa...
#!/bin/env python3 import datetime import discord import requests from alphaGG.command import Command from alphaGG.data import Database import sqlite3 """" Commands to interact with the API of SC2CM https://github.com/pundurs/sc2cm """ SC2CM_HOST = 'http://t11.ka2.lv' class Top(Command): command = 'top' he...
{ "repo_name": "pundurs/alpha-gg", "path": "alphaGG/commands/sc2cm.py", "copies": "1", "size": "11348", "license": "mit", "hash": -1744929812998599700, "line_mean": 34.133126935, "line_max": 116, "alpha_frac": 0.5290800141, "autogenerated": false, "ratio": 3.8863013698630136, "config_test": fals...
#!/bin/env python3 import esockets import logging, sys import threading root = logging.getLogger() root.setLevel(logging.DEBUG) ch = logging.StreamHandler(sys.stdout) ch.setLevel(logging.DEBUG) formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s') ch.setFormatter(formatter) root.addHand...
{ "repo_name": "Zaeb0s/epoll-socket-server", "path": "echo_server.py", "copies": "1", "size": "1183", "license": "mit", "hash": 9120700822530318000, "line_mean": 27.1904761905, "line_max": 85, "alpha_frac": 0.6931530008, "autogenerated": false, "ratio": 3.878688524590164, "config_test": false, ...
#!/bin/env python3 import esockets import threading import socket import time import logging import sys from time import sleep import maxthreads root = logging.getLogger() root.setLevel(logging.DEBUG) ch = logging.StreamHandler(sys.stdout) ch.setLevel(logging.DEBUG) formatter = logging.Formatter('%(asctime)s - %(name)...
{ "repo_name": "Zaeb0s/epoll-socket-server", "path": "test.py", "copies": "1", "size": "2360", "license": "mit", "hash": -8991435825359738000, "line_mean": 23.5833333333, "line_max": 85, "alpha_frac": 0.6309322034, "autogenerated": false, "ratio": 3.319268635724332, "config_test": false, "has_...
#!/bin/env python3 import ewebsockets import logging, sys from websocket import create_connection root = logging.getLogger() root.setLevel(logging.DEBUG) ch = logging.StreamHandler(sys.stdout) ch.setLevel(logging.DEBUG) formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s') ch.setFormat...
{ "repo_name": "Zaeb0s/epoll-websocket-server", "path": "echo_server.py", "copies": "1", "size": "1323", "license": "mit", "hash": 1967183379288728800, "line_mean": 26.5625, "line_max": 101, "alpha_frac": 0.7074829932, "autogenerated": false, "ratio": 3.4097938144329896, "config_test": false, ...
#!/bin/env python3 import http.server import random import string import click @click.command() @click.argument("port", required=False) @click.option("-s", "--server", default="0.0.0.0") def main(port, server): if not port: port = 8888 http_server = http.server.HTTPServer((server, port), PostHandler) ...
{ "repo_name": "dgengtek/scripts", "path": "network/http_server_upload.py", "copies": "2", "size": "1460", "license": "mit", "hash": 3410286279187933700, "line_mean": 24.1724137931, "line_max": 77, "alpha_frac": 0.6212328767, "autogenerated": false, "ratio": 3.3181818181818183, "config_test": fa...
#!/bin/env python3 import http.server import string import click import pathlib import urllib.parse import os @click.command() @click.argument("port", required=False) @click.option("-s", "--server", default="0.0.0.0") def main(port, server): if not port: port = 8888 http_server = http.server.HTTPServe...
{ "repo_name": "dgengtek/scripts", "path": "network/http_server_cat.py", "copies": "2", "size": "2212", "license": "mit", "hash": 1413580503501329700, "line_mean": 28.8918918919, "line_max": 96, "alpha_frac": 0.5773056058, "autogenerated": false, "ratio": 3.4779874213836477, "config_test": false...