max_stars_repo_path stringlengths 3 269 | max_stars_repo_name stringlengths 4 119 | max_stars_count int64 0 191k | id stringlengths 1 7 | content stringlengths 6 1.05M | score float64 0.23 5.13 | int_score int64 0 5 |
|---|---|---|---|---|---|---|
model/contact.py | karolinahalawin/python_training | 0 | 12795851 | from sys import maxsize
class Contact:
def __init__(self, first_name=None, middle_name=None, last_name=None, nickname=None, title=None, company=None,
address=None, phone_home=None, phone_mobile=None, phone_work=None, fax=None, email_1=None,
email_2=None, email_3=None, homepage=N... | 2.65625 | 3 |
src/test/tests/databases/xform_precision.py | visit-dav/vis | 226 | 12795852 | # ----------------------------------------------------------------------------
# CLASSES: nightly
#
# Test Case: xform_precision.py
#
# Tests: Transform manager's conversion to float
#
# Programmer: <NAME>
# Date: September 24, 2006
#
# Modifications:
#
# <NAME>, Wed Jan 20 07:37:11 PST 2010
# ... | 1.765625 | 2 |
rustiql/view/tree_hook.py | pyrustic/rustiql | 1 | 12795853 | import tkinter as tk
from megawidget.tree import Hook
class TreeHook(Hook):
def __init__(self, parent_view, nodebar_builder, host):
self._parent_view = parent_view
self._nodebar_builder = nodebar_builder
self._host = host
self._stringvar_expander = tk.StringVar()
self._stri... | 2.65625 | 3 |
tests/test_services.py | lycantropos/monty | 0 | 12795854 | <gh_stars>0
import pytest
from hypothesis import given
from monty import monty
from tests import strategies
from tests.utils import Secured
@given(strategies.dockerhub_logins,
strategies.invalid_dockerhub_logins)
def test_load_dockerhub_user(dockerhub_login: str,
invalid_dockerhub... | 2.21875 | 2 |
code/solverADMMmodel7.py | qingzheli/partial-correlation-based-contrast-pattern-mining | 1 | 12795855 | <reponame>qingzheli/partial-correlation-based-contrast-pattern-mining<gh_stars>1-10
#For ICDM review only, please do not distribute
#ALL RIGHTS RESERVED
#ADMM solver for CPM-C model with parital correlation based translation function
import numpy as np
import copy
import time
class myADMMSolver:
def __init__(self,... | 2 | 2 |
cdd/doctrans.py | SamuelMarks/docstring2class | 0 | 12795856 | <reponame>SamuelMarks/docstring2class<gh_stars>0
"""
Helper to traverse the AST of the input file, extract the docstring out, parse and format to intended style, and emit
"""
from ast import fix_missing_locations
from copy import deepcopy
from operator import attrgetter
from cdd.ast_utils import cmp_ast
from cdd.cst ... | 2.90625 | 3 |
flikrWallpaper.py | DaemonF/Flikr-Wallpaper-Downloader | 0 | 12795857 | <gh_stars>0
import urllib, signal, os
import simplejson # install with pip
try:
import config
except:
print ("You must configure config.py.template and rename\n"
" it to config.py to use this tool.")
exit()
flikrApiUrl = "http://api.flickr.com/services/rest/?method=flickr.photos.search&api_key=2a5a2148ffc21588fac... | 2.59375 | 3 |
hardhat/recipes/python/attrs.py | stangelandcl/hardhat | 0 | 12795858 | from .base import SetupPyRecipe
class AttrsRecipe(SetupPyRecipe):
def __init__(self, *args, **kwargs):
super(AttrsRecipe, self).__init__(*args, **kwargs)
self.sha256 = 'e0d0eb91441a3b53dab4d9b743eafc1a' \
'c44476296a2053b6ca3af0b139faf87b'
self.pythons = ['python3']
... | 1.820313 | 2 |
BOJ/Q4949.py | hyungilk/ProblemSolving | 0 | 12795859 | # text = 'So when I die (the [first] I will see in (heaven) is a score list).'
# stack 클래스 생성
class Stack():
def __init__(self):
self.stack = []
def push(self, data):
self.stack.append(data)
def top(self):
if len(self.stack) == 0:
return -1
else:
ret... | 3.515625 | 4 |
Python Datascience/chapter8/app.py | Haji-Fuji/iGEM2018 | 0 | 12795860 | <gh_stars>0
import flask
import pandas as pd
from sklearn.linear_model import LinearRegression
train_X = pd.read_csv("blood_fat.csv")
train_y = train_X.pop("blood fat")
model = LinearRegression().fit(train_X, train_y)
app = flask.Flask(__name__)
@app.route("/")
def index():
return app.send_static_file("index.h... | 3.125 | 3 |
Sparrow/action/action_action.py | eleme/Sparrow | 75 | 12795861 | <filename>Sparrow/action/action_action.py<gh_stars>10-100
from django.forms.models import model_to_dict
from Sparrow.action.common_action import *
from dal.dao.action_dao import ActionDao
from django.contrib.auth.decorators import login_required
from Sparrow.action.response import *
from django.http.request import *
fr... | 1.960938 | 2 |
dashboard/utils/browse/book.py | TheBoringDude/zeta | 0 | 12795862 | from dashboard.utils.finder import Finder
import requests
class Book(Finder):
def search_book(self, query):
# search and get the response
resp = requests.get(self.open_library.replace("[query]", query)).json()["docs"]
return resp | 2.46875 | 2 |
monypy/__init__.py | ybibaev/monypy | 6 | 12795863 | from .doc import Doc
from .exceptions import DocumentDoesNotExist, DocumentInitDataError
from .manager import Manager
__version__ = '2.0.1'
__all__ = (
'Doc',
'Manager',
'DocumentInitDataError',
'DocumentDoesNotExist',
)
| 1.609375 | 2 |
car_core/tests/test_py_common.py | vstucar/vstucar | 0 | 12795864 | #!/usr/bin/python
# This file is licensed under MIT license.
# See the LICENSE file in the project root for more information.
import unittest
import rostest
import rosunit
import numpy as np
from numpy.testing import assert_almost_equal
from std_msgs.msg import Header
from geometry_msgs.msg import PoseStamped, Pose,... | 2.5 | 2 |
QaA/ask/test/FriendSearchViewTest.py | jedrzejkozal/QuestionsAndAnswers | 0 | 12795865 | <gh_stars>0
from django.shortcuts import reverse
from django.test import TestCase
from ..test.FriendsMixIn import *
from ..test.LoginMixIn import *
class FriendSearchViewTest(TestCase, FriendsMixIn, LoginMixIn):
def setUp(self):
self.create_users()
self.make_friends()
self.create_invitat... | 2.59375 | 3 |
qt__pyqt__pyside__pyqode/pyqt5__draw_text_with_word_wrap.py | DazEB2/SimplePyScripts | 117 | 12795866 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
from PyQt5.QtGui import QPixmap, QPainter, QFont
from PyQt5.QtWidgets import QApplication, QLabel
from PyQt5.QtCore import Qt, QRect
app = QApplication([])
text = "Hello World!"
pixmap = QPixmap(180, 130)
pixmap.fill(Qt.white)
painter = QPai... | 2.765625 | 3 |
SOMEChecker/some_finder.py | richard-clifford/Useful-Scripts | 0 | 12795867 | <filename>SOMEChecker/some_finder.py
import requests
import re
import ssl
targets = open("targets.txt", 'r').readlines()
for target in targets:
target = target.rstrip()
headers = {'User-Agent': 'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1)'}
response = requests.get(target.split('|')[0], headers=header... | 3 | 3 |
userena/contrib/umessages/signals.py | jdavidagudelo/django-userena-ce | 86 | 12795868 | from django.dispatch import Signal
# Arguments: "msg"
email_sent = Signal()
| 1.234375 | 1 |
simple_repr/__init__.py | mr-strawberry66/python-repr-generation | 1 | 12795869 | <gh_stars>1-10
"""Expose public methods of simple_repr module."""
from .simple_repr import SimpleRepr
__all__ = ["SimpleRepr"]
| 1.28125 | 1 |
data/real/so/dump_data.py | destinyyzy/tf_rmtpp | 40 | 12795870 | from __future__ import print_function
import psycopg2 as pg
import getpass as G
from collections import namedtuple
output_events = 'events.txt'
output_time = 'time.txt'
output_userids = 'userids.txt'
output_badge_labels = 'badges.csv'
SO_events = namedtuple('SO_events', ['times', 'events', 'badge_map', 'userids'])
d... | 2.859375 | 3 |
src/oauth2_routes.py | CSIRO-enviro-informatics/cosmoz-rest-wrapper | 0 | 12795871 | <reponame>CSIRO-enviro-informatics/cosmoz-rest-wrapper<filename>src/oauth2_routes.py
# -*- coding: utf-8 -*-
"""
Copyright 2019 CSIRO Land and Water
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
... | 1.851563 | 2 |
topologic/embedding/tsne.py | microsoft/topologic | 24 | 12795872 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import numpy as np
from typing import Union
from sklearn.manifold import TSNE
def tsne(
embedding: np.ndarray,
num_components: int = 2,
perplexity: float = 30.0,
early_exaggeration: float = 12.0,
learning... | 3.203125 | 3 |
tests/test.py | sokolegg/titanoboa | 0 | 12795873 | <reponame>sokolegg/titanoboa<gh_stars>0
import unittest
import os
import sequentia as seq
import pandas as pd
class TestProjector(unittest.TestCase):
def setUp(self):
demo = {'date': ['01-01-2019', '01-03-2019', '01-04-2019'],
'temperature': [1, 3, 4]}
df = pd.DataFrame(demo)
df['date'] = pd.to_datetime(df... | 2.703125 | 3 |
part_2/week_14/bubbleSort.py | eduardovivi/Intro-to-Computer-Science-with-Python-Part-1-and-2-IME-USP-Coursera | 16 | 12795874 | <filename>part_2/week_14/bubbleSort.py
def bubble_sort(lista):
for passnum in range(len(lista)-1,0,-1):
for i in range(passnum):
if lista[i]>lista[i+1]:
temp = lista[i]
lista[i] = lista[i+1]
lista[i+1] = temp
print(lista)
return... | 4.03125 | 4 |
src/main.py | anonymousicml2021/paper2888 | 85 | 12795875 | <gh_stars>10-100
import pathlib
import sys
from torchvision.utils import save_image
curr_path = pathlib.Path(__file__).parent.absolute()
sys.path.insert(0, str(curr_path / 'better_corruptions'))
import argparse
import os
from pathlib import Path
import cox.store
import cox.utils
import dill
import json
import numpy... | 2 | 2 |
scato/ui/splash.py | michurin/scato | 1 | 12795876 | splash='''bgcolor 0 0 0
color 0 1 0
jump .45 .43
left 35
scale .32
width .15
jump 0 1
iterate 60 begin
draw 0 .7
iterate 7 begin
draw 0.096441350201699999 -0.013433702204987999
scale 0.99371847379 right 3.27272727273 mixcolor 1 1 0 .012
end
draw 0 -.7
iterate 3 begin
draw 0.056730206001 -0.00790217776764
... | 0.949219 | 1 |
upload.py | hydrogen18/fairywren | 39 | 12795877 | import sys
import json
import os
import math
import subprocess
import urllib
import urllib2
import MultipartPostHandler
import cookielib
import hashlib
import base64
import types
import xml.dom.minidom
def mktorrent(target,announce,pieceLength,private):
cmd = ['/usr/bin/mktorrent']
cmd.append('--announce=' + announc... | 2.296875 | 2 |
sciencebeam_judge/evaluation_config.py | elifesciences/sciencebeam-judge | 0 | 12795878 | <reponame>elifesciences/sciencebeam-judge<gh_stars>0
from typing import Dict, List, NamedTuple, Optional
import yaml
from sciencebeam_utils.utils.string import parse_list
from .utils.string import parse_dict
from .utils.config import parse_config_as_dict
DEFAULT_EVALUATION_YAML_FILENAME = 'evaluation.yml'
class ... | 2.34375 | 2 |
Programs/table.py | jatiinyadav/Python | 0 | 12795879 | <filename>Programs/table.py
l1 = ['1','2','3']
l2 = ['4','5','6']
for i in l1:
for j in l2:
print(i,j)
print("--------")
i = 1
n = 2
while(i<=5):
print(n," * ", i , " = " , n*i)
i +=1
print("--------") | 3.46875 | 3 |
app.py | OPERANDOH2020/op-web-crawler | 0 | 12795880 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from time import sleep
import ConfigParser
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from flask import Flask
import atexit
import json
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
user_agent = ("Mozill... | 2.640625 | 3 |
voxel_globe/download/forms.py | ngageoint/voxel-globe | 28 | 12795881 | from django import forms
import voxel_globe.meta.models as models
class TiePointForm(forms.Form):
image_set = forms.ModelChoiceField(label="Image Set",
queryset=models.ImageSet.objects.all().order_by('name'))
class PointCloudForm(forms.Form):
point_cloud = forms.ModelChoiceField(label="Point Cloud",
... | 2.25 | 2 |
borax/ui/aiotk.py | kinegratii/borax | 51 | 12795882 | <gh_stars>10-100
# coding=utf8
import tkinter as tk
import asyncio
__all__ = ['run_loop']
async def run_loop(app, interval=0.05):
try:
while True:
app.update()
await asyncio.sleep(interval)
except tk.TclError as e:
if "application has been destroyed" not in e.args[0]:... | 2.765625 | 3 |
ejemplo1.py | 030701Ivan/mirepositorio | 0 | 12795883 | import cv2
import numpy as np
imagen = cv2.imread('imagen.jpg')
imagen = cv2.cvtColor(imagen,cv2.COLOR_BGR2RGB)
print(imagen.shape)
print(imagen[0][0][0])
imagen = cv2.resize(imagen,(256, 256))
imagen = cv2.imread('imagen.jpg')
imagen = cv2.cvtColor(imagen,cv2.COLOR_BGR2GRAY)
print(imagen.shape)
print(imagen[0][0])
... | 2.984375 | 3 |
foobar 2.2.py | SambhavG/Google-foobar | 0 | 12795884 | def solution(h, q):
returnList = []
for i in q:
if (i == pow(2, h)-1):
returnList.append(-1)
else:
currentLevel = h
currentTop = pow(2, h)-1
currentLower = 1
currentUpper = pow(2, h)-2
topList = []
whi... | 3.28125 | 3 |
Mundo 2/Ex066.py | FelipeDreissig/Prog-em-Py---CursoEmVideo | 0 | 12795885 | #soma sem considerar o flag
l = j = 0
print('Digite 999 para parar.')
while True:
c = int(input('Digite um número inteiro:\n'))
if c != 999:
j = j + c
l = l + 1
else:
break
print(f'Fim do programa.\nA soma é {j} e foram digitados {l} números.') | 3.625 | 4 |
mlmodels/model_tch/nbeats.py | gitter-badger/mlmodels | 1 | 12795886 | <reponame>gitter-badger/mlmodels
import os
import pandas as pd
import numpy as np
import torch
from torch import optim
from torch.nn import functional as F
####################################################################################################
from mlmodels.model_tch.nbeats.model import NBeatsNet
VERBOS... | 2.09375 | 2 |
lib/model/repn/relpn_target_layer.py | brbzjl/my_graph_rcnn | 4 | 12795887 | # --------------------------------------------------------
# Faster R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by <NAME> and <NAME>
# --------------------------------------------------------
# --------------------------------------------------------
# Reorg... | 1.960938 | 2 |
adminclass.py | desuraj/LMS | 1 | 12795888 | <filename>adminclass.py
import pickle
from function import*
###############################################################################
###################################################################
class Admin:
sdist={}
fdist={}
bdist={}
# def Main(self): ############## A... | 2.875 | 3 |
server/edd/campaign/urls.py | trussworks/edd | 13 | 12795889 | from django.contrib.auth.decorators import login_required
from django.urls import path
from . import views
app_name = "edd.campaign"
urlpatterns = [
path("campaign/", login_required(views.CampaignIndexView.as_view()), name="index"),
path(
"campaign/<int:page>/",
login_required(views.Campaign... | 1.96875 | 2 |
hknweb/course_surveys/views.py | erictang000/hknweb | 20 | 12795890 | <reponame>erictang000/hknweb<filename>hknweb/course_surveys/views.py
from django.views.generic import TemplateView
from hknweb.markdown_pages.models import MarkdownPage
from hknweb.academics.models import Course, Instructor
from hknweb.course_surveys.constants import (
Attr,
COURSE_SURVEY_PREFIX,
COURSE_S... | 2.28125 | 2 |
python codes/triangle.py | doom3007/Hacktoberfest2020 | 1 | 12795891 | <filename>python codes/triangle.py
# Lines count, changable.
PYRAMID_HEIGHT = 6
WALL = "|"
for line in range(1, PYRAMID_HEIGHT+1):
print(WALL + "*" * line + " " * (PYRAMID_HEIGHT - line) + WALL) | 3.5625 | 4 |
peach_invasion/ui/stats.py | tealc-indeed/peach_invasion | 2 | 12795892 | from peach_invasion.settings import Settings
from peach_invasion.ui.scoreboard import Scoreboard
class Stats:
""" Track gaming statistics """
def __init__(self, settings: Settings, scoreboard: Scoreboard):
self._settings = settings
self._scoreboard = scoreboard
# High score never res... | 2.9375 | 3 |
model.py | stanleefdz/Predict-Flight-Delays | 0 | 12795893 | # -*- coding: utf-8 -*-
"""Model.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1QPnK5YOh8kRYPOOue6txwrgUqwKOMS0I
"""
# # Use seaborn for pairplot
# !pip install -q seaborn
# !pip install tensorflow==2.0.0
# # Use some functions from tensorflow_... | 2.140625 | 2 |
video/migrations/0001_initial.py | Sinchard/myvideo | 0 | 12795894 | <reponame>Sinchard/myvideo
# Generated by Django 3.1.3 on 2020-12-03 07:17
from django.db import migrations, models
import django.db.models.deletion
import modelcluster.fields
import wagtail.core.fields
class Migration(migrations.Migration):
initial = True
dependencies = [
('wagtailcore', '0059_app... | 1.789063 | 2 |
ConfigRouter.py | Dogblack/click_ddos | 0 | 12795895 | <filename>ConfigRouter.py
import re
from define import *
'''
'rst_attack'
'echo_attack'
'smuf_attack'
'land_attack'
'red'
'''
class ConfigWriter(object):
def __init__(self,ControlPort,Ip,IpDst,IpBrodCast,GateWay,Mac):
#basic
self.Out_default = 'out :: Queue(1024) -> ToDevice('+GateWay+')\n'
... | 2.609375 | 3 |
main.py | dsymbol/reddit-nft-freebies | 8 | 12795896 | from datetime import datetime
from utils.api import API
from time import sleep
from config import *
import random
def load_file(file):
try:
l = []
with open(file, 'r') as f:
for line in f:
l.append(line.rstrip())
return l
except FileNotFoundErr... | 3.046875 | 3 |
fbcrawl/items.py | JoshuaKissoon/fbcrawl | 1 | 12795897 | # -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# https://doc.scrapy.org/en/latest/topics/items.html
import scrapy
from scrapy.loader.processors import TakeFirst, Join, MapCompose
from datetime import datetime, timedelta
def comments_strip(string,loader_context):... | 2.46875 | 2 |
messagebird/webhook.py | JornEngelbart/python-rest-api | 0 | 12795898 | from messagebird.base import Base
class Webhook(Base):
def __init__(self):
self.url = None
self.token = None
| 1.640625 | 2 |
bluedonkey.py | jadonk/BlueDonkey | 9 | 12795899 | #!/usr/bin/env python3
import os, sys, subprocess, socket
#import cgroups
def start_mjpg_streamer():
print("Starting up mjpg_streamer.")
# TODO: Add notification if either mjpg-streamer or
# cvfilter_py.so aren't installed
# TODO: Detect any error if process exits,
# such as the uvcvid... | 2.375 | 2 |
tests/ccxt_test.py | longniao/pointer_worker | 0 | 12795900 | <filename>tests/ccxt_test.py
# -*- coding: utf-8 -*-
import time
import ccxt
gateio = ccxt.gateio({
'proxies': {
'http': 'socks5://127.0.0.1:1080',
'https': 'socks5h://127.0.0.1:1080'
},
})
'''
symbol = 'ETH/USD'
timeframe = '5m'
limit = 300
since = bitmex.milliseconds() - limit * 60 * 1000
p... | 2.09375 | 2 |
models/user.py | linkian209/PyBitWarden | 0 | 12795901 | <reponame>linkian209/PyBitWarden<gh_stars>0
"""models.user
This Module contains the User Model
"""
import pyotp
from app import db
from models import funcs
from lib.bitwarden import Bitwarden
from sqlalchemy import sql
class User(db.Model):
"""
This model is used to store users.
Attributes:
id ... | 2.765625 | 3 |
deprecated/prototypes/acceptor/feedstock_acceptor.py | materials-data-facility/connect | 1 | 12795902 | import os
import json
from flask import Flask
from tqdm import tqdm
from ..validator.schema_validator import Validator
from ..utils.paths import get_path
app = Flask(__name__)
# Function to accept user-generated feedstock
# Args:
# path: Path to the feedstock
# remove_old: Should fully accepted feedstock be rem... | 2.640625 | 3 |
config.py | ada-shen/Interpret_quality | 1 | 12795903 | <filename>config.py
CONFIG = {
"shapley_batch_size": {
"pointnet2": 5,
"pointnet": 50,
"dgcnn": 5,
"gcnn": 10,
"pointconv": 20
},
"interaction_batch_size": {
"pointnet2": 25,
"pointnet": 100,
"dgcnn": 25,
"gcnn": 50,
"pointconv... | 1.15625 | 1 |
dataProcessor.py | Synapt1x/PythonDataProcessor | 0 | 12795904 | """
Data Processor
============================
Created by: <NAME>
For: Dr. <NAME> lab
----------------------------
This program was developed to automatically
format input excel data for statistical
analysis in the statistical analysis
software.
"""
from Tkinter import *
from ttk import Frame, Style
from ... | 3.1875 | 3 |
blueprints/loggers/demos/basic_logger_demo.py | keithpij/python-blueprints | 0 | 12795905 | <filename>blueprints/loggers/demos/basic_logger_demo.py
import argparse
import os
from blueprints.loggers import basic_logger
def log_sample_messages():
'''
Sends a sample message for each logging level.
'''
queue_name = 'orders'
message_data = {'customerId': 42, 'productId': 12345, 'quantity': 5... | 2.8125 | 3 |
monkey-broker.py | cferrisroig/monkey-broker | 0 | 12795906 | <reponame>cferrisroig/monkey-broker<filename>monkey-broker.py
# -*- coding: utf-8 -*-
"""
Created on Tue Dec 10 21:44:03 2019
@author: Christian
"""
##########################################
######## IMPORT LIBRARIES ########
##########################################
import datetime
#import pandas as pd
im... | 2.078125 | 2 |
Python Tkinter Text Bold and Italics Text/textWidgetBoldItalicsText.py | BrianMarquez3/Python-Course | 20 | 12795907 | <filename>Python Tkinter Text Bold and Italics Text/textWidgetBoldItalicsText.py
# Python Tkinter Text Bold and Italics Text
# Texto de Python Tkinter Texto en negrita y en cursiva
from tkinter import *
from tkinter import filedialog
from tkinter import font
root = Tk()
root.title('Python Tkinter Text Bold and Italic... | 4.09375 | 4 |
examples/verilator/mainsim.py | splhack/mantle | 33 | 12795908 | import os
os.environ['MANTLE'] = 'lattice'
from magma import *
from mantle import And, XOr
from simulator import testvectors
main = DefineCircuit('main', "a", In(Bit), "b", In(Bit), "c", In(Bit), "d", Out(Bit), 'CLK', In(Bit))
t = And(2)(main.a,main.b)
d = XOr(2)(t,main.c)
wire(d,main.d)
EndCircuit()
print(testvecto... | 2.265625 | 2 |
lib/model/dcr/dcr_layer.py | fregulationn/SANM | 0 | 12795909 | from __future__ import absolute_import
# --------------------------------------------------------
# Spatial Attention Network withFeature Mimicking
# Copyright (c) 2018 University of Illinois
# Licensed under The MIT License [see LICENSE for details]
# --------------------------------------------------------
# --------... | 1.867188 | 2 |
DTL/gui/widgets/progresswidget.py | rocktavious/DevToolsLib | 1 | 12795910 | <filename>DTL/gui/widgets/progresswidget.py
from DTL.qt import QtGui
from DTL.api import apiUtils
from DTL.gui import Core, Dialog
#------------------------------------------------------------
#------------------------------------------------------------
class ProgressWidget(Dialog):
#----------------------------... | 2.203125 | 2 |
onadata/apps/fsforms/models.py | awemulya/fieldsight-kobocat | 38 | 12795911 | from __future__ import unicode_literals
import datetime
import os
import json
import re
from django.contrib.auth.models import User
from django.contrib.contenttypes.fields import GenericRelation
from django.contrib.postgres.fields import ArrayField
from django.core.exceptions import ValidationError
from django.core.ur... | 1.539063 | 2 |
hardhat/recipes/python/pygit2.py | stangelandcl/hardhat | 0 | 12795912 | <gh_stars>0
from .base import PipBaseRecipe
class PyGit2Recipe(PipBaseRecipe):
def __init__(self, *args, **kwargs):
super(PyGit2Recipe, self).__init__(*args, **kwargs)
self.depends = ['libgit2']
self.name = 'pygit2'
self.version = '0.24.0'
| 1.929688 | 2 |
src/message_writers/database_message_writer.py | Kaltsoon/telegram-analytics | 0 | 12795913 | <reponame>Kaltsoon/telegram-analytics
from message_writers.message_writer import MessageWriter
from entities.message import Message
class DatabaseMessageWriter(MessageWriter):
def __init__(self, connection):
self._connection = connection
def write_messages(self, messages):
message_rows = [(me... | 2.46875 | 2 |
scripts/wiki_sp_tokenize_json.py | ceshine/modern_chinese_nlp | 42 | 12795914 | """SentencePiece Tokenization for Wiki Dataset
Example:
* python scripts/wiki_sp_tokenize_json.py --word --unigram
"""
import gzip
import json
import subprocess
from pathlib import Path
import sentencepiece as spm
import joblib
import numpy as np
import click
from tqdm import tqdm
from opencc import OpenCC
from wi... | 2.71875 | 3 |
paranuara/citizens/apps.py | SPLAYER-HD/Paranuara | 0 | 12795915 | <filename>paranuara/citizens/apps.py
"""Citizens app"""
# Django
from django.apps import AppConfig
class CitizensAppConfig(AppConfig):
"""Citizens app config"""
name = "paranuara.citizens"
verbose_name = 'Citizens'
| 1.476563 | 1 |
playground/jax_basic/test_pmap.py | yf225/alpa | 114 | 12795916 | <reponame>yf225/alpa
from functools import partial
import jax
from jax import lax
import jax.numpy as jnp
def debug_pmap():
@jax.pmap
def func(x, w):
return x @ w
y = func(jnp.ones((2, 4)), jnp.ones((2, 4)))
print(y, type(y))
def test_nested_pmap():
@partial(jax.pmap, axis_name='a0', i... | 2.09375 | 2 |
laboratory/strangedemo/criteo_predict.py | acmore/OpenEmbedding | 20 | 12795917 | <filename>laboratory/strangedemo/criteo_predict.py
import os
import json
import pandas
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--data', required=True)
parser.add_argument('--rows', type=int, required=True)
parser.add_argument('--model', required=True)
parser.add_argument('--host', requir... | 2.953125 | 3 |
spherical_stats/_watson.py | dschmitz89/spherical_stats | 1 | 12795918 | <filename>spherical_stats/_watson.py
import numpy as np
from scipy.special import erfi
from ._utils import rotation_matrix
from ._descriptive_stats import orientation_matrix
from numba import njit
from scipy.optimize import brentq
class Watson:
r"""
Watson distribution
.. note::
The Watson distri... | 2.984375 | 3 |
data/studio21_generated/introductory/3257/starter_code.py | vijaykumawat256/Prompt-Summarization | 0 | 12795919 | <gh_stars>0
def slogan_maker(array):
| 0.929688 | 1 |
tests/test_data/test_believers/test_meta_view.py | ffeldmann/edflow | 23 | 12795920 | <reponame>ffeldmann/edflow
import pytest
import numpy as np
import os
from edflow.data.believers.meta_view import MetaViewDataset
from edflow.util import walk, retrieve
def _setup(root, N=100, V=25):
from PIL import Image
super_root = os.path.join(root, "METAVIEW__test_data__METAVIEW")
super_root = os.p... | 2.125 | 2 |
WiFi/mp3/mp3/urls.py | jpan127/RJD-MP3 | 0 | 12795921 |
from django.conf.urls import url, include
from django.contrib import admin
from django.views.generic import TemplateView
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^', include('server.urls'), name='server'),
]
| 1.65625 | 2 |
Packages/Dead/demo/Script/tutorials/template_file.py | xylar/cdat | 62 | 12795922 | # Adapted for numpy/ma/cdms2 by convertcdms.py
# Import the modules needed for the tuturial
import vcs, cdms2 as cdms, cdutil, time, os, sys
# Open data file:
filepath = os.path.join(vcs.sample_data, 'clt.nc')
cdmsfile = cdms.open( filepath )
# Extract a 3 dimensional data set and get a subset of the time dimension
d... | 2.671875 | 3 |
bcbiovm/docker/install.py | kern3020/bcbio-nextgen-vm | 0 | 12795923 | """Install or upgrade a bcbio-nextgen installation.
"""
from __future__ import print_function
import os
import subprocess
import sys
import yaml
from bcbiovm.docker import manage, mounts
DEFAULT_IMAGE = "chapmanb/bcbio-nextgen-devel"
def full(args, dockerconf):
"""Full installaction of docker image and data.
... | 2.1875 | 2 |
SystemCode/neo.py | IRS-PM/IRS-PM-2021-07-05-IS03FT-Group-8-SnapYummy-Cooking-Assistant | 1 | 12795924 | import enum
from pandas.io.pytables import DuplicateWarning
from py2neo import Node, Relationship, Graph, NodeMatcher
import pandas as pd
from operator import itemgetter
from typing import List, Dict
import random
graph = Graph("http://localhost:7474", username="neo4j", password='<PASSWORD>')
main_ingr = set(['apple'... | 2.90625 | 3 |
gui.py | sp6hfe/CwGen | 0 | 12795925 | import cwgen
import os
import sys
import PySimpleGUI as sg
class CwGenUI:
# General
# GUI - window config
WINDOW_DESCRIPTION = 'CW training material generator by SP6HFE'
# GUI - text config
E2CW_VER_LOCAL_KEY = '-E2CW VER LOCAL-'
E2CW_VER_ONLINE_KEY = '-E2CW VER ONLINE-'
... | 2.328125 | 2 |
build/lib/dupecheck/chunks.py | spacerockzero/dupecheck-py | 0 | 12795926 | # TODO: use sliding windows instead of chunking.
# the chunking method fails when part of a dupe string
# crosses the border between chunks
import colorama
from colorama import Fore
from tqdm import trange, tqdm
import os
colorama.init(autoreset=True)
DEFAULT_MIN = 5
DEFAULT_MAX = 10
def striplist(l):
# clean ... | 3 | 3 |
script/run_ga.py | Tricker-z/CSE5001-GA-mTSP | 3 | 12795927 | <gh_stars>1-10
import os
import sys
import subprocess
from argparse import ArgumentParser
from pathlib import Path
from shlex import split
ga2path = {
'baseline' : 'GA/baseline/main.py',
'vns-ga' : 'GA/vns-ga/main.py',
'ipga' : 'GA/IPGA/main.py'
}
def parse_args():
parser = ArgumentParser(des... | 2.578125 | 3 |
counselor/filter.py | joergeschmann/counselor | 0 | 12795928 | class Operators:
"""Operator constants"""
OPERATOR_EQUALITY = "=="
OPERATOR_INEQUALITY = "!="
OPERATOR_EMPTY = "empty"
OPERATOR_NOT_EMPTY = "not empty"
OPERATOR_IN = "in"
OPERATOR_NOT_IN = "not in"
OPERATOR_CONTAINS = "contains"
OPERATOR_NOT_CONTAINS = "not contains"
class Fields... | 2.921875 | 3 |
tests/test_download_remote_sitemap.py | OneHappyForever/wayback-machine-archiver | 44 | 12795929 | <gh_stars>10-100
import pytest
from wayback_machine_archiver.archiver import download_remote_sitemap
from requests.adapters import HTTPAdapter
import requests
SITEMAP = """<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.o... | 2.25 | 2 |
agent/indy_catalyst_agent/messaging/connections/handlers/connection_response_handler.py | blhagadorn/indy-catalyst | 0 | 12795930 | """Connection response handler."""
from ...base_handler import BaseHandler, BaseResponder, RequestContext
from ..messages.connection_response import ConnectionResponse
from ..manager import ConnectionManager
from ...trustping.messages.ping import Ping
class ConnectionResponseHandler(BaseHandler):
"""Handler clas... | 2.4375 | 2 |
ascended/imath.py | xRiis/ascended | 2 | 12795931 | <filename>ascended/imath.py
# It's easy (and fun) to do math with custom objects as opposed to arrays and tuples, so each necessary point will
# be assigned to a Cartesian coordinate that fits somewhere on the pixel array
class CartesianVals:
def __init__(self, x, y):
self.x = x
self.y = y
# At... | 3.078125 | 3 |
self_supervised/vision/dino.py | jwuphysics/self_supervised | 243 | 12795932 | <gh_stars>100-1000
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/15 - dino.ipynb (unless otherwise specified).
__all__ = ['DINOHead', 'get_dino_aug_pipelines', 'DINOModel', 'DINO']
# Cell
from fastai.vision.all import *
from ..augmentations import *
from ..layers import *
from ..models.vision_transformer import *
... | 2.0625 | 2 |
iou.py | trojerz/keras-eardetection | 0 | 12795933 | def iou(rect1,rect2):
'''
Calculate the intersection ratio of two rectangles
: param rect1: the first rectangle. Denoted by X, y, W, h, where x, y are the coordinates of the upper right corner of the rectangle
: param rect2: the second rectangle.
: Return: returns intersection ratio, that is, inters... | 3.859375 | 4 |
face/common/constants.py | kkltcjk/face | 0 | 12795934 | <reponame>kkltcjk/face
import os
CONFIG_FILE = '/etc/face/face.conf'
LOG_DIR = '/var/log/face'
LOG_FILE = os.path.join(LOG_DIR, 'face.log')
| 1.703125 | 2 |
run.py | nbc-pet-task/functional.py | 2 | 12795935 | """test run
"""
def fun(*args):
print(args)
fun(1,2,3,4,5)
def add(a,b,c):
return a+b+c
p = (1,2,3)
q = (5,6,7)
print(p+q)
#print(type(*p))
print(add(*p))
print(add.__code__.co_argcount)
def curry(func):
len_func = func.__code__.co_argcount
def func_a(*a):
len_a = len(a)
def func... | 3.484375 | 3 |
seahub/help/urls.py | MJochim/seahub | 0 | 12795936 | <filename>seahub/help/urls.py
# Copyright (c) 2012-2016 Seafile Ltd.
from django.conf.urls import url, include
from django.views.generic import TemplateView
urlpatterns = [
url(r'^$', TemplateView.as_view(template_name="help/install.html") ),
url(r'^install/$', TemplateView.as_view(template_name="help/install.... | 2.109375 | 2 |
aws-inventory/lambda/inventory-buckets.py | falequin/antiope | 0 | 12795937 |
import boto3
from botocore.exceptions import ClientError
import json
import os
import time
import datetime
from dateutil import tz
from lib.account import *
from lib.common import *
import logging
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)
logging.getLogger('botocore').setLevel(logging.WARNING)
log... | 2.015625 | 2 |
main.py | suanyouyou/Hello-world | 0 | 12795938 | <filename>main.py<gh_stars>0
print("your name")
| 1.320313 | 1 |
portfolio/gui/ui_components/charts/balance_distribution_pie.py | timeerr/portfolio | 0 | 12795939 | #!/usr/bin/python3
from PyQt5.QtGui import QBrush, QColor, QPainter
from PyQt5.QtChart import QChartView, QChart, QPieSeries
from portfolio.utils import confighandler
from portfolio.db.fdbhandler import balances
from portfolio.db.cdbhandler import cbalances
from portfolio.gui.ui_components.fonts import ChartTitleFont... | 2.46875 | 2 |
bot_v0.0.1.py | jeeinn/wechat-web-robot | 1 | 12795940 | #coding=utf8
import re
import itchat
from itchat.content import *
'''
0.0.1版本
功能:
1.匹配群聊关键字 说 ,然后回复接受到的消息
'''
# 群聊监控
@itchat.msg_register(TEXT, isGroupChat = True)
def groupchat_reply(msg):
room_name = itchat.search_chatrooms(userName=msg[u'FromUserName'])
print(u"来自-%s-群聊消息|%s:%s"%(room_name[ u'NickName'],ms... | 2.75 | 3 |
archived/analysis/analyses/postgres-stats/process.py | HazyResearch/dd-genomics | 13 | 12795941 | #!/usr/bin/env python
# A script for seeing basic statistics about the number and type of gene mentions extracted
# Author: <NAME> <<EMAIL>>
# Created: 2015-01-25
import sys
from dd_analysis_utils import process_pg_statistics
if __name__ == '__main__':
if len(sys.argv) < 3:
print "Process.py: Insufficient argume... | 2.0625 | 2 |
convert.py | JackKenney/readings-ocr | 0 | 12795942 | <gh_stars>0
"""Converter from unsearchable PDFs to searchable PDFs."""
# Author: <NAME>
# Date: 2018/03/05
# This program requires the installation of 'pdfocr' by <NAME>
# Which can be found at https://launchpad.net/~gezakovacs/+archive/ubuntu/pdfocr/+build/7671902
# Place files to be scanned in the 'readings' directo... | 3.109375 | 3 |
modules/finance_range.py | redahe/opportuner | 2 | 12795943 | <reponame>redahe/opportuner
#!/usr/bin/python
import sys
import json
for line in sys.stdin.readlines():
data = json.loads(line)
symbol = data.pop('SYMBOL')
try:
pe = float(data['PE'] or 1000)
except:
pe = 1000
try:
dy = float(data['DY'] or 0)
except:
dy = 0
... | 2.765625 | 3 |
tailfile.py | finalstate/tailfile | 2 | 12795944 | #! /usr/bin/python3
# -*- coding: utf-8 -*-
####################################################################################################
import io
####################################################################################################
def TailFile(p_FileName, p_BufferSize=io.DEFAULT_BUFFER_SIZE,... | 3.671875 | 4 |
libcst/codemod/commands/add_trailing_commas.py | jschavesr/LibCST | 0 | 12795945 | # Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import argparse
import textwrap
from typing import Dict, Optional
import libcst as cst
from libcst.codemod import CodemodContext, VisitorBa... | 3 | 3 |
scripts/temporal_coding/izhikevich_step.py | embeddedlabsiu/snn_exploration_spinnaker | 1 | 12795946 | """
Tests with the Izhikevich neuron model.
"""
import numpy as np
import matplotlib.pyplot as plt
import pyNN.nest as sim
from pyNN.utility.plotting import Figure, Panel
# === Configure the simulator ================================================
duration = 100
dt = 0.01
sim.setup(timestep=dt, min_delay=0.1)
... | 2.8125 | 3 |
day_3_1.py | Nishant-Mishra/Advent_of_Code_2019 | 1 | 12795947 | #!/usr/bin/python3 -u
import sys
def puzzle(filename):
with open(filename, "r") as f:
path1 = f.readline()
path2 = f.readline()
path1_list_str = path1.strip("\n").split(",")
path2_list_str = path2.strip("\n").split(",")
# print(path1_list)
# print(path2_list)
... | 3.4375 | 3 |
scripts/retrieveSummary.py | ChaoXianSen/Duplex-Seq-Pipeline | 1 | 12795948 | import sys
from argparse import ArgumentParser
parser = ArgumentParser()
parser.add_argument('--indexes', dest='inFile', required=True,
help='Path to indexes file, one per line.')
parser.add_argument('--config', dest='config', required=True)
o=parser.parse_args()
outFile = open(f"{o.config}.summa... | 2.78125 | 3 |
algorithm/COMP90038/Graph/TopologicalSort.py | martindavid/code-sandbox | 0 | 12795949 | <filename>algorithm/COMP90038/Graph/TopologicalSort.py<gh_stars>0
from __future__ import print_function
from graph_list import Graph
def dfs(G, current_vert, visited, sequence):
visited[current_vert] = True # mark the visited node
#print("traversal: " + currentVert.get_vertex_ID())
sequence.append(curre... | 3.484375 | 3 |
setup.py | darkslab/Crawler | 0 | 12795950 | from pathlib import Path
from setuptools import find_packages, setup
long_description: str = (Path(__file__).parent.resolve() / "README.md").read_text(
encoding="utf-8"
)
setup(
name="crawler",
version="0.0.0",
description="A Web Crawler",
long_description=long_description,
long_description_co... | 1.507813 | 2 |