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 |
|---|---|---|---|---|---|---|
query_flight/tests/utils/test_sel.py | eskemojoe007/sw_web_app | 0 | 26700 | import pytest
from query_flight import utils
from query_flight.models import Search, Flight, Layover, Airport
from django.utils import timezone
# @pytest.fixture
# def basic_search():
# return Search.objects.create()
@pytest.fixture
def basic_sw_inputs():
return {'browser': 1, 'originationAirportCode': ['ATL... | 2.140625 | 2 |
compte/migrations/0003_auto_20210701_1337.py | bzg/acceslibre | 8 | 26701 | from django.contrib.auth import get_user_model
from django.db import migrations
from compte.models import UserPreferences
def add_preferences_to_users(apps, schema_editor):
users = get_user_model().objects.all()
for user in users:
UserPreferences.objects.create(user=user)
class Migration(migrations... | 2.1875 | 2 |
mechroutines/es/_routines/hr.py | sjklipp/mechdriver | 0 | 26702 | """ es_runners for coordinate scans
"""
import automol
import elstruct
from mechroutines.es.runner import scan
from mechroutines.es.runner import qchem_params
from mechlib.amech_io import printer as ioprinter
from phydat import phycon
def hindered_rotor_scans(
zma, spc_info, mod_thy_info, thy_save_fs,
... | 2.203125 | 2 |
start_training.py | DrInfy/TheHarvester | 6 | 26703 | import subprocess
wsl = "wsl python3.7 /mnt/" + YOUR_PATH_TO_HARVESTER
# to = "--timeout 900 -z"
to = "-p2 ai.terran.hard"
to2 = "-p2 ai.zerg.hard"
to3 = "-p2 ai.protoss.hard"
def ai_opponents(difficulty: str) -> str:
text = ""
for race in ["zerg", "protoss", "terran"]:
for build in ["rush", "timing",... | 2.0625 | 2 |
agents/train.py | yamamototakas/fxtrading | 0 | 26704 | <gh_stars>0
# -*- coding: utf-8 -*-
from trade_results_loader import *
from model import *
loader = TradeResultsLoader()
data = TradeResults(loader.retrieve_trade_data())
with Trainer() as trainer:
trainer.train(10001, data)
trainer.save("./model.ckpt")
| 1.890625 | 2 |
madlib.py | danhuyle508/madlib-cli | 0 | 26705 | import re
welcome_message = """
Welcome to the Mad Libs game! YOu will be prompted to enter certain types of words. These words will be used in a mad lib and printed out for you.
"""
def fill_mad_lib(file):
new_mad_lib = ''
#import pdb; pdb.set_trace()
with open('text.txt', 'r+') as f:
try:
... | 4.03125 | 4 |
src/abundance.py | Ilia-Abolhasani/modify_vamb | 111 | 26706 | import sys
import os
import argparse
import numpy as np
parser = argparse.ArgumentParser(
description="""Command-line bin abundance estimator.
Print the median RPKM abundance for each bin in each sample to STDOUT.
Will read the RPKM file into memory - beware.""",
formatter_class=argparse.RawDescriptionHelpForm... | 2.703125 | 3 |
miamidade/events.py | jayktee/scrapers-us-municipal | 67 | 26707 | from pupa.scrape import Scraper
from pupa.scrape import Event
import lxml.html
from datetime import datetime
import pytz
DUPLICATE_EVENT_URLS = ('http://miamidade.gov/wps/Events/EventDetail.jsp?eventID=445731',
'http://miamidade.gov/wps/Events/EventDetail.jsp?eventID=452515',
... | 2.9375 | 3 |
backend/research_note/migrations/0006_remove_researchnote_is_written.py | andy23512/research-note-system | 0 | 26708 | # Generated by Django 2.2.7 on 2019-11-12 16:03
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('research_note', '0005_auto_20191112_2255'),
]
operations = [
migrations.RemoveField(
model_name='researchnote',
name='is_wri... | 1.203125 | 1 |
Tools/nm_swift_demangle.py | kylefleming/XVim2 | 0 | 26709 | <filename>Tools/nm_swift_demangle.py<gh_stars>0
#!/usr/bin/env python3
import os
import shutil
import subprocess
os.chdir("..")
if os.path.exists("tmp"):
shutil.rmtree("tmp")
os.mkdir("tmp")
os.chdir("tmp")
modules = ['/Applications/Xcode.app/Contents/SharedFrameworks/SourceEditor.framework/SourceEditor'
... | 2.65625 | 3 |
retag_push.py | atiasn/sync-images | 0 | 26710 | <filename>retag_push.py
#!/usr/bin/python3
import os
def get_image_list():
with open('sync_images.txt', 'r') as f:
images = f.readlines()
sync_images = []
for img in images:
img = img.strip()
if 'docker.io/' in img:
sync_images.append(img.replace('docker.io/', ''))
... | 2.765625 | 3 |
Python/Buch_ATBS/Teil_2/Kapitel_17_Bildbearbeitung/04_texte_schreiben/04_texte_schreiben.py | Apop85/Scripts | 0 | 26711 | <reponame>Apop85/Scripts
# 04_texte_schreiben.py
# In diesem Beispiel geht es darum Texte in ein Bild zu schreiben mittels ImageFont aus dem Modul PIL
from PIL import Image, ImageFont, ImageDraw
import os
os.chdir(os.path.dirname(__file__))
target_file='.\\text_in_image.png'
if os.path.exists(target_file):
os.rem... | 3.015625 | 3 |
web.py | dujinle/AccountByTornado | 0 | 26712 | #!/usr/bin/python
import sys, os
import tornado.ioloop
import tornado.web
import tornado.httpserver
import logging
import logging.handlers
import re
from urllib import unquote
import config
from travellers import *
reload(sys)
sys.setdefaultencoding('utf8')
def deamon(chdir = False):
try:
if os.fork() > 0:
os... | 2.25 | 2 |
fluiddb/data/user.py | fluidinfo/fluiddb | 3 | 26713 | import crypt
import random
import re
from string import ascii_letters, digits
from uuid import uuid4
from storm.locals import (
Storm, DateTime, Int, Unicode, UUID, Reference, AutoReload, RawStr)
from fluiddb.data.exceptions import DuplicateUserError, MalformedUsernameError
from fluiddb.data.store import getMainS... | 2.390625 | 2 |
marqeta/response_models/business_proprietor_response_model.py | marqeta/marqeta-python | 21 | 26714 | from datetime import datetime, date
from marqeta.response_models.address_response_model import AddressResponseModel
from marqeta.response_models.identification_response_model import IdentificationResponseModel
from marqeta.response_models import datetime_object
import json
import re
class BusinessProprietorResponseMod... | 2.390625 | 2 |
Books/Book/urls.py | qq292/Books | 0 | 26715 | from django.contrib import admin
from django.urls import path
from django.views.generic import TemplateView
from .views import MainPage
urlpatterns = [
path('admin/', admin.site.urls),
path('', MainPage.as_view(), name='books'),
]
| 1.546875 | 2 |
tests/test_util.py | markusrobertjonsson/learning_simulator | 1 | 26716 | <filename>tests/test_util.py<gh_stars>1-10
import unittest
import LsUtil
class TestLsUtil(unittest.TestCase):
def setUp(self):
pass
def iseq(self, d1, d2):
for _, val in d1.items():
val.sort()
for _, val in d2.items():
val.sort()
self.assertEqual(d1, d... | 3.046875 | 3 |
code/vrf-chain-sim/find_pattern.py | filecoin-project/consensus | 43 | 26717 | <gh_stars>10-100
import numpy as np
import time
from math import floor
import multiprocessing as mp
import scipy.special
#Initialize parameters
Num_of_sim_per_proc = 1
start_time = time.time()
e = 5.
alpha = 0.33
ntot = 100
na = int(ntot*alpha)
nh = ntot - na
height = 5 #height of the attack
p=float(e)/float(1*ntot)
u... | 2.578125 | 3 |
lib/dblatex-0.3.2/lib/dbtexmf/dblatex/grubber/util.py | jonathanmorley/HR-XSL | 1 | 26718 | <reponame>jonathanmorley/HR-XSL
# This file is part of Rubber and thus covered by the GPL
# (c) <NAME>, 2002--2006
"""
This module contains utility functions and classes used by the main system and
by the modules for various tasks.
"""
try:
import hashlib
except ImportError:
# Fallback for python 2.4:
impo... | 2.515625 | 3 |
neopixel/main.py | morgulbrut/wemos-mupy | 0 | 26719 | <gh_stars>0
from machine import Pin
import neopixel
import time
class NeoMatrix:
def __init__(self, x, y):
self.colors = []
for i in range(x):
for j in range(x):
colors[i][j] = Color(0,0,0)
self.np = neopixel.NeoPixel(Pin(4, Pin.OUT),x*y)
self.np.write()
def set_pixel(self,x,y,r=0,g=0,b=0):
se... | 2.765625 | 3 |
tests/unit/request/request_builders/recurring_get_schedule_builder_test.py | Zhenay/python-sdk | 3 | 26720 | <reponame>Zhenay/python-sdk
import unittest
from platron.request.request_builders.recurring_get_schedule_builder import RecurringGetScheduleBuilder
class RecurringGetScheduleBuilderTest(unittest.TestCase):
def test_get_params(self):
builder = RecurringGetScheduleBuilder('12345')
params = builder... | 2.484375 | 2 |
malleus/api/domain/protos/timings_pb2.py | joelgerard/malleus | 0 | 26721 | <reponame>joelgerard/malleus
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: malleus/api/domain/protos/timings.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _m... | 1.257813 | 1 |
basic_newsletter/utils.py | CIGIHub/newsletter_generator | 0 | 26722 | from __future__ import unicode_literals
import os.path
from django.core.files.storage import default_storage as storage
from django.core.files.uploadedfile import SimpleUploadedFile
from django.utils.six import StringIO
from django.utils.encoding import smart_text
try:
import Image
except ImportError:
try:
... | 2.390625 | 2 |
Virtual-Air-Painting-master/Virtual-Air-Painting-master/app.py | NikisCodes/Machine-Learning | 2 | 26723 | <gh_stars>1-10
from flask import Flask, render_template, Response
import cam
import os
import cv2
app = Flask(__name__,template_folder='templates')
overlay_image=[]
header_img = "Images"
header_img_list = os.listdir(header_img)
for i in header_img_list:
image = cv2.imread(f'{header_img}/{i}')
overlay_image.... | 2.515625 | 3 |
src/kolibree-changelog/commit_parser.py | kolibree-git/gitchangelog | 2 | 26724 | import os
import re
from pathlib import Path
from urllib.parse import urlparse
from github import Github
class CommitParser(object):
github_access_token: str
repository: str
jira_project: str
jira_server: str
def __init__(self, repository, jira_project, jira_server, github_access_token):
... | 2.9375 | 3 |
flask_api/celery_tasks/sms/constants.py | FanLgchen/Celery- | 2 | 26725 | <filename>flask_api/celery_tasks/sms/constants.py<gh_stars>1-10
# 短信签名
SMS_SIGN = 'demo'
# 短信验证码模板ID
SMS_VERIFICATION_CODE_TEMPLATE_ID = 'SMS_151231777'
| 0.890625 | 1 |
intepreter_DM.py | arkasarius/python-IMDB-TFG | 1 | 26726 | <reponame>arkasarius/python-IMDB-TFG
import calculos as c
import os
import matplotlib.pyplot as plt
import numpy as np
movie="Men in black"
m="moviesdata"
g="actordata"
s='/'
apidata=os.listdir(m+s+movie)
actordata=os.listdir(g+s+movie)
print(movie)
print(apidata)
print(actordata)
DM=0.0 # 0.0 distancia minima posibl... | 2.765625 | 3 |
treqs/main.py | doctorgaby/treqs | 1 | 26727 | <filename>treqs/main.py
#!/usr/bin/env python
import getopt, sys, datetime, os
from treqs import mUSProcessor, mSysReqProcessor, mTCProcessor
def main(argv):
#Default paths for respective files (user stories, test cases, system requirements). Can be provided as function arguments.
usDir = 'requirements'
... | 2.453125 | 2 |
nudging/model/xregressor.py | UtrechtUniversity/nudging | 1 | 26728 | <reponame>UtrechtUniversity/nudging
import numpy as np
from sklearn.base import clone
from nudging.model.base import BaseModel
from nudging.model.biregressor import BiRegressor
class XRegressor(BaseModel):
"""Class for X-learner regression
See https://www.pnas.org/cgi/doi/10.1073/pnas.1804597116. It trains
... | 3.015625 | 3 |
manabi/apps/manabi_auth/tests.py | aehlke/manabi | 14 | 26729 | <reponame>aehlke/manabi
from manabi.test_helpers import ManabiTestCase
| 1.039063 | 1 |
v1/convert.py | jelson/aqi | 7 | 26730 | <reponame>jelson/aqi<gh_stars>1-10
#!/usr/bin/env python3
# One-time use script to convert previous log file format into JSON
import json
out = {}
for line in open("old-airq").readlines():
fields = line.split()
if 'PM 1.0' in line:
date = " ".join(fields[0:3])
out['pm1.0'] = fields[6]
if '... | 2.703125 | 3 |
src/vocab.py | janoschhaber/textstyletransfer | 0 | 26731 | import numpy as np
from numpy import linalg as LA
import pickle
from collections import Counter
import csv
class Vocabulary(object):
def __init__(self, vocab_file, emb_file='', dim_emb=0):
with open(vocab_file, 'rb') as f:
self.size, self.word2id, self.id2word = pickle.load(f)
self.dim_emb = dim_emb
... | 2.671875 | 3 |
model/algorithms/__init__.py | nertsam/DAGsched | 0 | 26732 | <reponame>nertsam/DAGsched
def required_model(name: object, kwargs: object) -> object:
required_fields = kwargs['required_fields'] if 'required_fields' in kwargs else []
task_f = kwargs['required_task_fields'] if 'required_task_fields' in kwargs else []
proc_f = kwargs['required_proc_fields'] if 'required_proc_fiel... | 2.390625 | 2 |
tests/test_ERC721_Pausable.py | georgercarder/cairo-contracts | 0 | 26733 | <reponame>georgercarder/cairo-contracts<filename>tests/test_ERC721_Pausable.py
import pytest
import asyncio
from starkware.starknet.testing.starknet import Starknet
from utils import Signer, str_to_felt, assert_revert
signer = Signer(123456789987654321)
# bools (for readability)
false = 0
true = 1
# random uint256 ... | 1.890625 | 2 |
python_scripts/countries_dates.py | tuxskar/elpythonista | 2 | 26734 | from datetime import datetime
import pytz
if __name__ == '__main__':
places_tz = ['Asia/Tokyo', 'Europe/Madrid', 'America/Argentina/Buenos_Aires', 'US/eastern', 'US/Pacific', 'UTC']
cities_name = ['Tokyo', 'Madrid', 'Buenos Aires', 'New York', 'California', 'UTC']
for place_tz, city_name in zip(places_tz, ... | 3.609375 | 4 |
algebra_utilities/structures/semigroup.py | computational-group-the-golden-ticket/AlgebraUtilities | 0 | 26735 | <filename>algebra_utilities/structures/semigroup.py
from algebra_utilities.objects.baseobjects import *
from algebra_utilities.structures.baseobjects import Printable
from algebra_utilities.utils.errors import UnexpectedTypeError
from algebra_utilities.utils.errors import NonAssociativeSetError
from algebra_utili... | 2.671875 | 3 |
output/models/nist_data/atomic/duration/schema_instance/nistschema_sv_iv_atomic_duration_pattern_1_xsd/__init__.py | tefra/xsdata-w3c-tests | 1 | 26736 | from output.models.nist_data.atomic.duration.schema_instance.nistschema_sv_iv_atomic_duration_pattern_1_xsd.nistschema_sv_iv_atomic_duration_pattern_1 import NistschemaSvIvAtomicDurationPattern1
__all__ = [
"NistschemaSvIvAtomicDurationPattern1",
]
| 1.054688 | 1 |
venv/lib/python3.7/site-packages/tigeropen/common/consts/service_types.py | CatTiger/vnpy | 0 | 26737 | # -*- coding: utf-8 -*-
"""
Created on 2018/9/20
@author: gaoan
"""
ORDER_NO = "order_no"
PREVIEW_ORDER = "preview_order"
PLACE_ORDER = "place_order"
CANCEL_ORDER = "cancel_order"
MODIFY_ORDER = "modify_order"
"""
账户/资产
"""
ACCOUNTS = "accounts"
ASSETS = "assets"
POSITIONS = "positions"
ORDERS = "orders"
ACTIVE_ORDE... | 1.617188 | 2 |
setup.py | ianhalpern/python-payment-processor | 12 | 26738 | <filename>setup.py<gh_stars>10-100
#!/usr/bin/python
from distutils.core import setup
setup(
name = 'payment_processor',
version = '0.2.0',
description = 'A simple payment gateway api wrapper',
author = '<NAME>',
author_email = '<EMAIL>',
url = 'https://launchpad.net/python-payment',... | 1.21875 | 1 |
src/ranking_utils/lightning/datasets.py | fknauf/ranking-utils | 0 | 26739 | <gh_stars>0
from pathlib import Path
from typing import Any, Tuple
import abc
import h5py
from torch.utils.data import Dataset
# inputs vary for each model, hence we use Any here
Input = Any
PairwiseTrainingInput = Tuple[Input, Input]
PointwiseTrainingInput = Tuple[Input, int]
ValTestInput = Tuple[int, int, Input, i... | 2.484375 | 2 |
tests/unit/lib/logs/test_formatter.py | OscarVanL/aws-sam-cli | 0 | 26740 | import json
from unittest import TestCase
from mock import Mock, patch, call
from nose_parameterized import parameterized
from samcli.lib.logs.formatter import LogsFormatter, LambdaLogMsgFormatters, KeywordHighlighter, JSONMsgFormatter
from samcli.lib.logs.event import LogEvent
class TestLogsFormatter_pretty_print_... | 2.5625 | 3 |
openconnect-cli.py | tcpipuk/OpenConnect-FE | 0 | 26741 | #!/usr/bin/env python3
import argparse, pexpect
from getpass import getpass
from time import sleep
# Set up argument parser
parser = argparse.ArgumentParser(prog='openconnect-cli', description='Automate logins to the OpenConnect SSL VPN client')
# Type of VPN to initiate
parser_type = parser.add_mutually_exclusive_g... | 2.4375 | 2 |
unittestdemo/unittestdemo01.py | caoyp2/PyProject01 | 0 | 26742 | <gh_stars>0
import unittest
#4.定义测试类,父类为unittest.TestCase。
#可继承unittest.TestCase的方法,如setUp和tearDown方法,不过此方法可以在子类重写,覆盖父类方法。
#可继承unittest.TestCase的各种断言方法。
class Test(unittest.TestCase):
#5.定义setUp()方法用于测试用例执行前的初始化工作。
#注意,所有类中方法的入参为self,定义方法的变量也要“self.变量”
def setUp(self):
print("开始。。。。。。。。")
self.num... | 3.53125 | 4 |
pytools/unit.py | ry-shika/Geister-cpp-lib | 8 | 26743 | <gh_stars>1-10
#!/usr/bin/env python
# -*- coding: utf-8 -*-
class Unit:
def __init__(self, x, y, color, name):
self.x = x
self.y = y
self.color = color
self.name = name
self.taken = False
class OpUnit(Unit):
def __init__(self, x, y, color, name):
super().__ini... | 2.6875 | 3 |
pull_scp/config.py | FNNDSC/pl-pull_scp | 0 | 26744 | <gh_stars>0
"""Remote host configuration."""
from os import getenv, path
from dotenv import load_dotenv
from .log import LOGGER
import pudb
# Load environment variables from .env
# Originally set to the "installation" directory of the app...
BASE_DIR = path.abspath(path.dirname(__file__))
# But using /tmp... | 2.0625 | 2 |
meltingpot/python/human_players/play_level_test.py | yunfanjiang/meltingpot | 0 | 26745 | # Copyright 2020 DeepMind Technologies Limited.
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 1.546875 | 2 |
Development/NASTRAN TRANSLATOR.py | toni-lv/AeroComBAT2 | 2 | 26746 | from pyNastran.bdf.bdf import BDF
model = BDF()
model.is_nx = True
section = 5
#filename = r'D:\SNC IAS\01 - FAST Program\05 - Modified Sections\01 - AeroComBAT Files\section_{}.dat'.format(section)
filename = r'C:\Users\benna\Desktop\Work Temp\SNC\FAST\SIMPLE_SECTIONS\CTRIA6_1_100.dat'
model.read_bdf(filename, xref=T... | 2.125 | 2 |
project-a/labels.py | achon22/cs231nLung | 2 | 26747 | <filename>project-a/labels.py
#!/usr/bin/env python
def main():
f = open('stage1_solution.csv')
ones = 0
zeros = 0
total = 0
for line in f:
if line[:3] == 'id,':
continue
line = line.strip().split(',')
label = int(line[1])
if label == 1:
ones += 1
total += 1
zeros = total-ones
print float(zeros)... | 3.375 | 3 |
03/code/Node.py | libchaos/algorithm-python | 2 | 26748 | <filename>03/code/Node.py
#!/usr/bin/env python
#coding: utf-8
class Node:
def __init__(self, elem=None, next=None):
self.elem = elem
self.next = next
if __name__ == "__main__":
n1 = Node(1, None)
n2 = Node(2, None)
n1.next = n2
| 2.890625 | 3 |
mc/history/History.py | zy-sunshine/falkon-pyqt5 | 1 | 26749 | <reponame>zy-sunshine/falkon-pyqt5
from PyQt5.Qt import QObject
from PyQt5.Qt import QDateTime
from PyQt5.Qt import QUrl
from PyQt5.Qt import pyqtSignal
from mc.app.Settings import Settings
from calendar import month_name
from .HistoryModel import HistoryModel
from mc.common.models import HistoryDbModel
from mc.common.... | 2.3125 | 2 |
pkg/iface/__init__.py | ToraNova/rapidflask | 0 | 26750 | <reponame>ToraNova/rapidflask<filename>pkg/iface/__init__.py
from flask_socketio import send, emit
from pkg.system.servlog import srvlog
#----------------------------------------------------------------------------------------
# External calls
# introduced u7
# The livelog functions allows other functions which are no... | 1.96875 | 2 |
Co-Simulation/Sumo/run_tracis_synchronization.py | uruzahe/carla | 0 | 26751 | <reponame>uruzahe/carla
# coding: utf-8
import argparse
import logging
import os
import sys
from util.func import (
data_from_json,
)
if 'SUMO_HOME' in os.environ:
sys.path.append(os.path.join(os.environ['SUMO_HOME'], 'tools'))
import traci
else:
sys.exit("Please declare environment variable 'SUMO_HO... | 2.28125 | 2 |
web/flask.py | ponyatov/metaLpy | 0 | 26752 | ## @file
## @defgroup flask flask
## @brief minimized Flask-based backend
## @ingroup web
import config
from core.env import *
from core.io import Dir
from .web import Web
from core.meta import Module
from core.time import *
from gen.js import jsFile
from gen.s import S
from web.html import htmlFile
import os, re
... | 2.140625 | 2 |
setup.py | iamsrp/pyfestival | 8 | 26753 | <reponame>iamsrp/pyfestival
#!/usr/bin/env python
from distutils.core import setup, Extension
from distutils.util import get_platform
import os
festival_include = os.environ.get("FESTIVAL_INCLUDE", '/usr/include/festival')
speech_tools_include = os.environ.get("SPECCH_INCLUDE", '/usr/include/speech_tools')
festival_li... | 2.078125 | 2 |
main.py | jhkloss/libg3n_parsing_notebook | 0 | 26754 | <reponame>jhkloss/libg3n_parsing_notebook
from parse_manual.parser import parse as parse_manual
from parse_pyparsing.parser import parse as parse_pyparsing
from parse_yaml.parser import parse as parse_yaml
from parse_xml.parser import parse as parse_xml
from timer.PerformanceTimer import PerformanceTimer
# Manual Pa... | 2.046875 | 2 |
src/test/python/apache/aurora/client/test_base.py | wfarner/aurora | 0 | 26755 | <gh_stars>0
#
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distri... | 1.9375 | 2 |
ms_deisotope/data_source/_vendor/AgilentD.py | mobiusklein/ms_deisotope | 18 | 26756 | <gh_stars>10-100
import os
import glob
import warnings
import logging
from collections import deque
from six import string_types as basestring
from lxml import etree
try:
log = logging.getLogger(os.path.basename(__file__))
except Exception:
log = None
from collections import OrderedDict, defaultdict
from wea... | 1.734375 | 2 |
prospector/client/cli/prospector_client.py | pombredanne/vulnerability-assessment-kb | 41 | 26757 | import logging
import sys
from datetime import datetime
import requests
from tqdm import tqdm
import log
from datamodel.advisory import AdvisoryRecord
from datamodel.commit import Commit
from filtering.filter import filter_commits
from git.git import GIT_CACHE, Git
from git.version_to_tag import get_tag_for_version
f... | 1.804688 | 2 |
masteronly.py | mbs5mz/cs3240-labdemo | 0 | 26758 | <filename>masteronly.py
print("This is the master branch") | 1.132813 | 1 |
pyethereum/config.py | CJentzsch/pyethereum | 0 | 26759 |
import os
import uuid
import StringIO
import ConfigParser
from pyethereum.utils import data_dir
from pyethereum.packeter import Packeter
from pyethereum.utils import sha3
def default_data_dir():
data_dir._set_default()
return data_dir.path
def default_config_path():
return os.path.join(default_data_dir(... | 2.25 | 2 |
sb_backend/app/service/setup/service_noseriesline.py | DmitriyGrigoriev/sb-fastapi | 0 | 26760 | from sqlmodel import SQLModel
from sb_backend.app.service.base.base_service import ServiceBase
from sb_backend.app.crud.setup.crud_noseriesline import CRUDBase, noseriesline
class ServiceBase(ServiceBase[CRUDBase, SQLModel, SQLModel]):
pass
noseriesline_s = ServiceBase(noseriesline)
| 1.867188 | 2 |
AllSpiders/00_Spider/29_js2.py | GongkunJiang/MySpider | 0 | 26761 | # coding=utf-8
from selenium import webdriver
import time
driver = webdriver.PhantomJS(executable_path=r'E:\Documents\Apps\phantomjs-2.1.1-windows\bin\phantomjs.exe')
driver.get("https://movie.douban.com/typerank?type_name=剧情&type=11&interval_id=100:90&action=")
# 向下滚动10000像素
js = "document.body.scrollTop=10000"
#js... | 2.59375 | 3 |
pony/orm/tests/test_f_strings.py | luckydonald/pony | 2,628 | 26762 | <filename>pony/orm/tests/test_f_strings.py
from sys import version_info
if version_info[:2] >= (3, 6):
from pony.orm.tests.py36_test_f_strings import * | 1.375 | 1 |
setup.py | hoosiki/notion-as-db | 0 | 26763 | <filename>setup.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup, find_packages
except ImportError:
from distutils.core import setup
with open('README.md') as readme_file:
readme = readme_file.read()
install_requireent = []
setup_requires = [
'pandas',
... | 1.515625 | 2 |
python/alejo/hackerrank_contact_list.py | alejodeveloper/algorithms-practices | 0 | 26764 | import sys
from collections import defaultdict
sys.stdin.readline()
my_results = defaultdict(int)
def add_contact(contact):
for index, _ in enumerate(contact):
my_contact = contact[0:index]
my_results[my_contact] +=1
for line in sys.stdin.readlines():
operation, contact = line.strip().split... | 3.328125 | 3 |
stacker_blueprints/asg.py | aengelas/stacker_blueprints | 43 | 26765 | import copy
from troposphere import (
Ref, FindInMap, Not, Equals, And, Condition, Join, ec2, autoscaling,
If, GetAtt, Output
)
from troposphere import elasticloadbalancing as elb
from troposphere.autoscaling import Tag as ASTag
from troposphere.route53 import RecordSetType
from stacker.blueprints.base import... | 1.9375 | 2 |
input/migrations/0016_auto_20190524_0055.py | JianaXu/productivity | 0 | 26766 | # Generated by Django 2.1.1 on 2019-05-24 00:55
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('input', '0015_auto_20190524_0052'),
]
operations = [
migrations.AlterField(
model_name='post',
name='c... | 1.515625 | 2 |
tools/decompiler/basicblock.py | miniupnp/sundog | 54 | 26767 | # Copyright (c) 2017 <NAME>
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
import opcodes
####### Basic blocks ########
class BasicBlock:
'''Basic block of instructions'''
def __init__(self, addr):
self.addr = ad... | 2.4375 | 2 |
data-pipeline/src/data_pipeline/datasets/exac/exac_regional_missense_constraint.py | broadinstitute/gnomadjs | 38 | 26768 | <filename>data-pipeline/src/data_pipeline/datasets/exac/exac_regional_missense_constraint.py
import hail as hl
def prepare_exac_regional_missense_constraint(path):
ds = hl.import_table(
path,
missing="",
types={
"transcript": hl.tstr,
"gene": hl.tstr,
"c... | 2.234375 | 2 |
smokey/ranger/ranger.py | godatadriven/hdp-smokey | 1 | 26769 | import os
import logging
import requests
import ambari.api as api
from utils.utils import logmethodcall
class RangerRequestError(Exception):
pass
class Ranger:
def __init__(self, request_timeout=10):
self.timeout = request_timeout
self.ranger_schema = os.environ.get('RANGER_SCHEMA', 'http'... | 2.15625 | 2 |
tests/player_state_test.py | the-gigi/dominion | 2 | 26770 | <filename>tests/player_state_test.py<gh_stars>1-10
import unittest
from dominion_game_engine.card_util import *
from dominion_game_engine.cards import *
from dominion_game_engine.player_state import PlayerState
class TestPlayerState(unittest.TestCase):
def setUp(self):
card_types = get_card_types().value... | 3.546875 | 4 |
setup.py | hyong/mercury-python | 0 | 26771 | <filename>setup.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
setup(name='mercury',
version='1.12.9',
description='Python Language pack for Mercury',
author='<NAME>',
author_email='<EMAIL>',
url='https://github.com/Accenture/mercury-python',
project_... | 1.28125 | 1 |
nailgun/nailgun/notifier.py | Zipfer/fuel-web | 1 | 26772 | <reponame>Zipfer/fuel-web
# -*- coding: utf-8 -*-
# Copyright 2013 Mirantis, Inc.
#
# 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
#
# http://www.apache.org/licenses/LICEN... | 1.5 | 2 |
tests/ansible/lib/callback/nice_stdout.py | jrosser/mitogen | 0 | 26773 | <reponame>jrosser/mitogen
from __future__ import unicode_literals
import io
from ansible.module_utils import six
try:
from ansible.plugins import callback_loader
except ImportError:
from ansible.plugins.loader import callback_loader
def printi(tio, obj, key=None, indent=0):
def write(s, *args):
... | 2.359375 | 2 |
dialRL/rl_train/callback.py | PawelMlyniec/Dail-a-ride | 1 | 26774 | import os
import numpy as np
import csv
import matplotlib.pyplot as plt
from moviepy.editor import *
from matplotlib.image import imsave
import matplotlib
matplotlib.use('Agg')
# import tensorflow as tf
# from stable_baselines.common.callbacks import BaseCallback, EvalCallback
# from stable_baselines.common.vec_env im... | 2.28125 | 2 |
train.py | tna-hub/text2sql | 0 | 26775 | <filename>train.py<gh_stars>0
import json
import torch
from sqlnet.utils import *
from sqlnet.model.seq2sql import Seq2SQL
from sqlnet.model.sqlnet import SQLNet
import numpy as np
import datetime
#import mxnet as mx
#from bert_embedding import BertEmbedding
import argparse
if __name__ == '__main__':
parser = argp... | 2.265625 | 2 |
py/py_0685_inverse_digit_sum_ii.py | lcsm29/project-euler | 0 | 26776 | # Solution of;
# Project Euler Problem 685: Inverse Digit Sum II
# https://projecteuler.net/problem=685
#
# Writing down the numbers which have a digit sum of 10 in ascending order, we
# get:$19, 28, 37, 46,55,64,73,82,91,109, 118,\dots$Let $f(n,m)$ be the
# $m^{\text{th}}$ occurrence of the digit sum $n$. For examp... | 3.296875 | 3 |
{{cookiecutter.github_repository_name}}/{{cookiecutter.app_name}}/apps/profiles/choices.py | powerdefy/cookiecutter-django-rest | 0 | 26777 | from django.db import models
class Role(models.IntegerChoices):
ADMIN = 0, 'Admin'
GENERAL = 1, 'General'
GUEST = 2, 'Guest'
ACCOUNTING = 3, 'Accounting'
IT = 4, 'IT'
| 2.046875 | 2 |
test_scripts/json_over_tcp.py | luozh05/Doc | 0 | 26778 | #!/usr/bin/env python
import socket
import sys
import json
#HOST="localhost"
HOST="172.20.1.11"
PORT=37568
def send_and_receive_msg(msg):
# Create a socket (SOCK_STREAM means a TCP socket)
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# Connect host:port
sock.connect((HOST, PORT))
# ... | 2.78125 | 3 |
test_api.py | atifar/mini-key-value | 0 | 26779 | def test_check_sanity(client):
resp = client.get('/sanity')
assert resp.status_code == 200
assert 'Sanity check passed.' == resp.data.decode()
# 'list collections' tests
def test_get_api_root(client):
resp = client.get('/', content_type='application/json')
assert resp.status_code == 200
resp_d... | 2.265625 | 2 |
demo.py | TOMMYWHY/acnet_mobilenet | 0 | 26780 | <gh_stars>0
p = touch.autograd.Variable()
| 1.109375 | 1 |
cosmoscope/server.py | cosmoscope/cosmo-server | 0 | 26781 | import logging
import signal
import gevent
import msgpack
from zerorpc import Publisher, Puller, Pusher, Server
import numpy as np
import jsonpickle
from .store import store
from .data import Data
from .operations.operation import Operation
from .utils.singleton import Singleton
__all__ = ['ServerAPI']
class Serve... | 2.15625 | 2 |
cexapi/cexapi.py | codarrenvelvindron/cex.io-api-python | 1 | 26782 | # -*- coding: utf-8 -*-
# Author: t0pep0
# e-mail: <EMAIL>
# Jabber: <EMAIL>
# BTC : 1ipEA2fcVyjiUnBqUx7PVy5efktz2hucb
# donate free =)
# Forked and modified by <NAME>
# Compatible Python3
import hmac
import hashlib
import time
import urllib.request, urllib.parse, urllib.error
import json
class Api(object):
__... | 2.125 | 2 |
Fourier/FourierType.py | SymmetricChaos/FiniteFields | 1 | 26783 | import numpy as np
from GeneralUtils import list_to_sum
class Fourier:
def __init__(self,amp=[1],freq=[1],ph=[0]):
self.amp = amp
self.freq = freq
self.ph = ph
def __str__(self):
out = []
for i in range(len(self.amp)):
if self.amp[i] != 1:
... | 3.046875 | 3 |
src/glados/es/ws2es/mappings_skeletons/es_chembl_tissue_mapping.py | chembl/GLaDOS | 33 | 26784 | # Elastic search mapping definition for the Molecule entity
from glados.es.ws2es.es_util import DefaultMappings
# Shards size - can be overridden from the default calculated value here
# shards = 3,
replicas = 1
analysis = DefaultMappings.COMMON_ANALYSIS
mappings = \
{
'properties':
{
... | 1.414063 | 1 |
top_book/book/views.py | mfarjami/DRF-top | 0 | 26785 | from rest_framework.decorators import api_view
from rest_framework.views import APIView
from rest_framework import status
from rest_framework.response import Response
from .models import Book
from .serializers import BookSerializer
# Create your views here.
class GetAllData(APIView):
def get(self, request):
... | 2.34375 | 2 |
mysite/urls.py | mnithya/cs3240-s15-team06-test | 0 | 26786 | from django.conf.urls import include, url
from django.contrib import admin
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
urlpatterns = [
# Examples:
# url(r'^$', 'mysite.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^$', '... | 1.890625 | 2 |
source/cf/defaults/lambdas/libs/videostream/videostream/__init__.py | vteremasov/aws-iot-kickstart | 8 | 26787 | <reponame>vteremasov/aws-iot-kickstart<filename>source/cf/defaults/lambdas/libs/videostream/videostream/__init__.py
'''
Module camera provides the VideoStream class which
offers a threaded interface to multiple types of cameras.
'''
from threading import Thread
import io
import os
import platform
import numpy as np # ... | 2.765625 | 3 |
JaxCQL/model.py | yisu0005/JaxCQL | 0 | 26788 | from functools import partial
from matplotlib.pyplot import xcorr
import numpy as np
import jax
import jax.numpy as jnp
import flax
from flax import linen as nn
import distrax
from .jax_utils import batch_to_jax, extend_and_repeat, next_rng
def update_target_network(main_params, target_params, tau):
return jax.... | 2.078125 | 2 |
prophet-gpl/tools/return_counter.py | jyi/ITSP | 18 | 26789 | <gh_stars>10-100
#!/usr/bin/env python
f = open("repair.log", "r");
lines = f.readlines();
cnt = 0;
for line in lines:
tokens = line.strip().split();
if (len(tokens) > 3):
if (tokens[0] == "Total") and (tokens[1] == "return"):
cnt += int(tokens[3]);
if (tokens[0] == "Total") and (tok... | 3.015625 | 3 |
pytorch_toolkit/instance_segmentation/segmentoly/rcnn/openvino_net.py | morkovka1337/openvino_training_extensions | 3 | 26790 | <filename>pytorch_toolkit/instance_segmentation/segmentoly/rcnn/openvino_net.py
"""
Copyright (c) 2019 Intel Corporation
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
http://www.apache.... | 1.929688 | 2 |
scuole/cohorts/apps.py | texastribune/scuole | 1 | 26791 | from django.apps import AppConfig
class CohortsConfig(AppConfig):
name = 'scuole.cohorts'
| 1.132813 | 1 |
conftest.py | gousteris/git-diff-conditional-buildkite-plugin | 19 | 26792 | """Place fixtures in this file for use across all test files"""
import pytest
@pytest.fixture(scope="function")
def logger(caplog):
caplog.set_level("DEBUG")
return caplog
@pytest.fixture
def log_and_exit_mock(mocker):
return mocker.patch("scripts.generate_pipeline.log_and_exit")
| 2.078125 | 2 |
subthalamic.py | ModelDBRepository/256624 | 0 | 26793 | import numpy as np
import moch
import soch
import os
import sys
import scipy.io
import thorns
def main(parseID):
parseIn = parseID + 'In.mat'
parseOut = parseID + 'Out.mat'
parse = scipy.io.loadmat(parseIn)
os.remove(parseIn)
lagSpace = 1. * parse['lagSpace'] / 1000
parsStruct =... | 2.09375 | 2 |
env/lib/python3.5/site-packages/cartopy/tests/test_img_tiles.py | project-pantheon/pantheon_glob_planner | 0 | 26794 | # (C) British Crown Copyright 2011 - 2018, Met Office
#
# This file is part of cartopy.
#
# cartopy is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option)... | 1.578125 | 2 |
utils/process_data.py | JiatianWu/tf-monodepth2 | 0 | 26795 | <filename>utils/process_data.py<gh_stars>0
import os
import pdb
import h5py
import pickle
import numpy as np
from scipy.io import loadmat
import cv2
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from PIL import Image
from PIL import ImageFont
from PIL import ImageDraw
import csv
import bisect
... | 2.078125 | 2 |
src/genome/visibles/sphere_gene.py | stu-smith/blender-evolution | 0 | 26796 | <reponame>stu-smith/blender-evolution<gh_stars>0
from ..gene import Gene
from ..scalar_gene_property import ScalarGeneProperty
from ..color_gene_property import ColorGeneProperty
from ...visible_objects.sphere import Sphere
class SphereGene(Gene):
def __init__(self):
self._size_property = ScalarGeneProp... | 2.609375 | 3 |
thrift/test/testset/generator.py | danobi/fbthrift | 0 | 26797 | # Copyright (c) Facebook, Inc. and its affiliates.
#
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | 2.109375 | 2 |
test/test_runner.py | antsankov/cufcq-new | 0 | 26798 | from tornado.testing import AsyncHTTPTestCase
import unittest
def run_tests(application):
BaseAsyncTest.application = application
BaseAsyncTest.database_name = application.settings['database_name']
BaseAsyncTest.conn = application.settings['conn']
testsuite = unittest.TestLoader().discover('test')
... | 2.390625 | 2 |
uber/views.py | sami-mai/Carpool-R-Us | 0 | 26799 | <gh_stars>0
from django.shortcuts import render
# Create your views here.
def landing(request):
title = "Home"
context = {"title": title}
return render(request, 'landing.html', context)
| 1.75 | 2 |