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 |
|---|---|---|---|---|---|---|
mysolution/day23_crab_cups/solve.py | abhabongse/aoc2020 | 0 | 12784351 | from __future__ import annotations
import itertools
from collections.abc import Iterator, Sequence
import more_itertools
from tqdm import trange
Arrows = dict[int, int]
def main():
# arrangement = [3, 8, 9, 1, 2, 5, 4, 6, 7]
arrangement = [4, 5, 9, 6, 7, 2, 8, 1, 3]
# Part 1
arrows = build_circula... | 3.34375 | 3 |
Python/openjudge/12560.py | bic-potato/codeforces_learning | 0 | 12784352 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Nov 25 15:05:59 2020
@author: zuoxichen
"""
def game_rule(i,j,arrayin,state_transfer):
if state_transfer.count(1)<2 or state_transfer.count(1)>3:
a=0
elif arrayin[i][j]==0 and state_transfer.count(1)==3:
a=1
else:
a=a... | 3.15625 | 3 |
markov_generator.py | bmd/markov-at-the-movies | 0 | 12784353 | <reponame>bmd/markov-at-the-movies<gh_stars>0
import random
from collections import defaultdict
class MarkovGenerator(object):
def __init__(self, corpus, tuple_size=3):
""" Initialize the MarkovGenerator object.
Digests the corpus of text provided as a list of tokens and creates a cache of
... | 3.4375 | 3 |
model/seedsortnet.py | Huanyu2019/Seedsortnet | 4 | 12784354 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Jan 12 15:44:11 2021
@author: lihuanyu
"""
import torch.nn as nn
import torch
import math
import torchsummary as summary
from torchstat import stat
import torch.nn.functional as F
from blurpool import BlurPool
__all__ = ["seedsortnet","seedsortnet75"]... | 2.4375 | 2 |
tracker/migrations/0002_processedblock.py | shapeshift-legacy/watchtower | 0 | 12784355 | <filename>tracker/migrations/0002_processedblock.py
# Generated by Django 2.0.7 on 2018-08-11 00:32
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('tracker', '0001_initial'),
]
operations = [
migrations.... | 1.632813 | 2 |
blog/models.py | mohammadanarul/Django-Blog-YT | 0 | 12784356 | <filename>blog/models.py
from email.mime import text
from django.db import models
from django.contrib.auth.models import User
from django.utils.translation import gettext_lazy as _
from django.db.models.signals import post_save
class Profile(models.Model):
GENDER_CHOICES = (
('Male', 'Male'),
('Fem... | 2.234375 | 2 |
spec/data/logic/_expr_transformer_spec.py | PhilHarnish/forge | 2 | 12784357 | import ast
import Numberjack
from data.logic import _dimension_factory, _expr_transformer, _model, \
_predicates, _reference, dsl
from spec.mamba import *
with description('_expr_transformer.ExprTransformer'):
with it('instantiates'):
expect(calling(_expr_transformer.ExprTransformer, None)).not_to(raise_erro... | 2.4375 | 2 |
games/views.py | sarahboyce/play-connect-four | 0 | 12784358 | <filename>games/views.py
from django.contrib.auth.mixins import LoginRequiredMixin, UserPassesTestMixin
from django.db.models import Q
from django.http import JsonResponse
from django.shortcuts import get_object_or_404
from django.views import generic
from .forms import GameForm
from .models import Game
class GameLi... | 2.25 | 2 |
crowdsourcing/interfaces/simulator.py | sbranson/online_crowdsourcing | 4 | 12784359 | import numpy as np
import os
import sys
import copy
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
sys.path.append(os.path.join(os.path.dirname(__file__),"../"))
from crowdsourcing.annotation_types.classification import *
def combine_dicts(ds):
v = {}
for d in ds:
for k i... | 2.046875 | 2 |
examples/time_price_bot.py | yuepaang/tiny_bot | 11 | 12784360 | <filename>examples/time_price_bot.py<gh_stars>10-100
from tiny_bot import *
store = RedisStore("test", "redis://localhost:6379/0")
class QueryAction(Action):
def run(self, bot, tracker, msg):
result = "从<%s>邮寄到<%s>,重量:<%s>,时间:<%s> 不要钱,哈哈!" % (
tracker._from, tracker.to, tracker.weight, tracke... | 2.5 | 2 |
camper/tests/test_waitinglist.py | mrtopf/camper | 13 | 12784361 | <gh_stars>10-100
from conftest import create_user
from camper import *
import pytest
@pytest.skip()
def test_subscribe_user(barcamp, app):
user = create_user(app, "user1")
barcamp.subscribe(user)
bc = app.get_barcamp("test")
assert unicode(user._id) in bc.subscribers
def test_register_user_duplicate... | 2.21875 | 2 |
graphlearning.py | shekkizh/GraphLearning | 1 | 12784362 | '''
GraphPy: Python Module for Graph-based learning algorithms. Efficient implementations of modern methods for graph-based semi-supervised learning, and graph clustering.
See README.md file for usage.
Author: <NAME>, 2020
'''
import numpy as np
import datetime
import matplotlib.pyplot as plt
import matplotlib
import... | 2.6875 | 3 |
ECE365/nlp/nlplab4_dist/lab4.py | debugevent90901/courseArchive | 0 | 12784363 | <reponame>debugevent90901/courseArchive
# All Import Statements Defined Here
# Note: Do not add to this list.
# All the dependencies you need, can be installed by running .
# ----------------
import numpy as np
import random
import scipy as sp
from sklearn.decomposition import TruncatedSVD
from sklearn.decomposition im... | 2.796875 | 3 |
Cogs/timerevents.py | xantbos/Discord.py-Cogs | 0 | 12784364 | <gh_stars>0
import discord
import asyncio
import pytz
import io
import os
import sys
from discord.ext import commands
from datetime import date, datetime, timedelta, timezone
from threading import Timer
from pytz import timezone
localland = timezone("Canada/Eastern")
class TimerCommands(commands.Cog):
def __init... | 2.640625 | 3 |
src/sssimp/utils.py | vincent38/sssimp | 8 | 12784365 | <gh_stars>1-10
import os
import sys
from pathlib import Path
import traceback
from typing import Type
from sssimp import APP_DIR
def mkdir(path):
"""
Creates a directory or the parent directory if `path` is not a directory.
Safely ignores if already exists
"""
path = Path(path)
if not path.is_... | 2.78125 | 3 |
networking_odl/agent/db_ovs_neutron_agent.py | dingboopt/wqq | 0 | 12784366 | # Copyright 2011 VMware, Inc.
# All Rights Reserved.
#
# 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 req... | 1.203125 | 1 |
problem_solving/algorithms/strings/q11_funny_string.py | mxdzi/hackerrank | 0 | 12784367 | #!/bin/python3
import math
import os
import random
import re
import sys
#
# Complete the 'funnyString' function below.
#
# The function is expected to return a STRING.
# The function accepts STRING s as parameter.
#
def funnyString(s):
# Write your code here
r = s[::-1]
if [abs(ord(s[i]) - ord(s[i+1])) f... | 4.03125 | 4 |
src/admin/models/tag_rules_es.py | mstrechen/advanced-news-scraper | 0 | 12784368 | from elasticsearch_dsl import Document, Integer, Percolator, Text
from admin.models.articles_es import SUPPORTED_LANGUAGES_ANALYZER_MAPPING
class TagRuleEs(Document):
tag_id = Integer()
query = Percolator()
title = Text(required=False, fields={
lang: Text(analyzer=analyzer)
for lang, ana... | 2.28125 | 2 |
setup.py | Tim55667757/FuzzyRoutines | 1 | 12784369 | <reponame>Tim55667757/FuzzyRoutines<filename>setup.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
import os
__version__ = '1.0' # identify main version of FuzzyRoutines
devStatus = '4 - Beta' # default build status, see: https://pypi.python.org/pypi?%3Aaction=list_classifiers
if 'TR... | 2.015625 | 2 |
sudoku.py | Y-o-Z/games | 0 | 12784370 | <reponame>Y-o-Z/games
# Sudoku → japanisches Akronym (griech. akros, onyma = Spitze, Namen)
# (= dos(denial-of-service)-attack on the brain ..)
# 9x9 grid with 9 3x3 subgrids, each subgrid, row, and column contains the numbers 1..9 once (+ unique solution)
from collections import deque
legal_entries = [-1, 1, 2, 3, ... | 3.5625 | 4 |
tests/test_JsonEncDecC.py | schrma/garminmanager | 0 | 12784371 | import datetime
import numpy as np
import garminmanager.utils.JsonEncDecC
import garminmanager.utils.FileWriterC
from garminmanager.enumerators.EnumHealthTypeC import EnumHealtTypeC
def test_encode_decode():
raw_data = garminmanager.RawDataC.RawDataC()
my_dates1 = {
datetime.datetime(2019,4,11,1,0... | 2.734375 | 3 |
XTWholeMountSegmentation.py | Menigedegna/Image-processing | 1 | 12784372 | <filename>XTWholeMountSegmentation.py
# -*- coding: utf-8 -*-
#
#
#==============================================================================
# Objectives of this PythonXT for Imaris:
# Segments nucleus, nucleolus and chromocenters into surfaces in DAPI channel,
# Segment FISH or Immunostaining signal into spo... | 2.046875 | 2 |
cli/user.py | sgtdarkskull/passwordManager | 0 | 12784373 | import os
import sql_query as sql
from styling import color
import password_checker
import password_generator
# Login Main class
class Login:
def __init__(self):
self.username = ''
self.password = ''
self.is_login = False
self.website = ''
self.account = ''
try:
... | 3.5625 | 4 |
scripts/localizer/text_processor.py | Theodeus/www.html5rocks.com | 4 | 12784374 | # Copyright 2012 Google Inc. All Rights Reserved.
# -*- coding: utf-8 -*-
#
# 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 require... | 2.09375 | 2 |
py/lib/utils/util.py | zjZSTU/YOLO_v1 | 8 | 12784375 | # -*- coding: utf-8 -*-
"""
@date: 2020/2/29 下午7:31
@file: util.py
@author: zj
@description:
"""
import numpy as np
import torch
import sys
def error(msg):
print(msg)
sys.exit(0)
def get_device():
return torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
def iou(pred_box, target_box):
... | 2.359375 | 2 |
utils/derivative_calculator.py | nomagiclab/balancing-ball | 4 | 12784376 | from collections import deque
N = 3
# Calculates mean of last N derivatives.
class DerivativeCalculator:
def __init__(self):
# Value doesn't matter as we won't use it.
self.last_x = None
self.last_time = 0
self.dx_list = deque(iterable=[0 for _ in range(N + 1)], maxlen=N + 1)
... | 3.75 | 4 |
pita/urls.py | Doktor/saltpita.com | 0 | 12784377 | from django.conf import settings
from django.conf.urls import url
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import include, path
from pita import views
urlpatterns = [
url(r'^admin/', admin.site.urls),
]
if settings.DEBUG:
urlpatterns += static(settings.STAT... | 1.9375 | 2 |
rsinc/rsinc.py | asch99/rsinc | 48 | 12784378 | # rsinc : two-way / bi-drectional sync for rclone
import argparse
import os
import subprocess
import logging
import re
from datetime import datetime
import ujson
import halo
from pyfiglet import Figlet
from .sync import sync, calc_states
from .rclone import make_dirs, lsl
from .packed import pack, merge, unpack, get... | 2.234375 | 2 |
tests/configure_bst_feature_api_ct.py | r-cc-c/ops-broadview | 0 | 12784379 | <reponame>r-cc-c/ops-broadview<gh_stars>0
'''
*
* (C) Copyright Broadcom Corporation 2015
*
* 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/LI... | 1.804688 | 2 |
orders/apps.py | Marlinekhavele/Ordering-pizza | 0 | 12784380 | <gh_stars>0
from django.apps import AppConfig
from django.contrib.auth.models import User
from accounts.models import Customer
from django.db.models.signals import post_save
from django.utils.translation import ugettext_lazy as _
from orders.signals import create_customer_order, save_customer_order
class OrdersConf... | 2 | 2 |
updater_main.py | luyu103713/variantDB_updater | 0 | 12784381 | <filename>updater_main.py
import optparse
import pymysql
import os
from lib import readFile,featuresRelyOn
from features import feature_process,map_back_to_hg19
from cut_file import count_time
class updater_opt:
def __init__(self):
parser = optparse.OptionParser()
parser.add_option("-i", "--inp... | 2.25 | 2 |
sorting_algorithms/quicksort_Lomuto.py | Pinkwjp/Hello-Algorithms | 0 | 12784382 | <reponame>Pinkwjp/Hello-Algorithms
"""quicksort with Lomuto partition scheme"""
from random import randint
from typing import List
def partition(A: List[int], low, high) -> int:
"""divide the list of numbers into two partitions
return the index of the pivot number
choosing the rightmost elem... | 4.15625 | 4 |
preprocessing/image.py | ahmedbally/Show-And-Tell-Keras | 0 | 12784383 | '''
Module to preprocess filckr8k image data
'''
import cv2
import numpy as np
import os
from _pickle import dump, load
from keras.applications.inception_v3 import InceptionV3
from keras.layers import Flatten
from keras.models import load_model
from keras.preprocessing import image
from keras.applications.inception_v3... | 2.53125 | 3 |
voicesBack/api/FileConverter.py | wdariasm/voices | 0 | 12784384 | import subprocess
import psycopg2
import multiprocessing
import threading
import os
import pathlib
import sendgrid
import datetime
import shutil
import boto3
from botocore.exceptions import ClientError
from boto3.dynamodb.conditions import Key, Attr
from sendgrid.helpers.mail import *
MAX_WORKERS = 1
PROJECT_ROOT = os... | 1.929688 | 2 |
backend/src/features/friend/mappers.py | ihsaro/socioworld | 0 | 12784385 | from features.friend.entities import Friendship
from features.friend.models import FriendshipOutput
def map_friendship_to_friendship_output(*, friendship: Friendship) -> FriendshipOutput:
return FriendshipOutput(
client_id=friendship.client_id,
friend_id=friendship.friend_id,
requested=fri... | 2.421875 | 2 |
mnist_py/models/get_layers_shapes.py | vijayagril/mnist_cnn_cuda | 0 | 12784386 | from train import models_initializers
model_name = 'basic_nn'
model = models_initializers.get(model_name)()
for l in model.layers:
print(f'{l.name} -- {l.input_shape} -- {l.output_shape}')
| 3.03125 | 3 |
caldera/utils/mp/_decorators.py | jvrana/caldera | 2 | 12784387 | <filename>caldera/utils/mp/_decorators.py
import inspect
from functools import wraps
from multiprocessing import Pool
from typing import Callable
from typing import List
from typing import Optional
from ._mp_tools import _resolved_sorted_handler
from ._mp_tools import _S
from ._mp_tools import _T
from ._mp_tools impor... | 2.234375 | 2 |
project.py | anton-kachurin/item-catalog | 3 | 12784388 | <reponame>anton-kachurin/item-catalog<gh_stars>1-10
from flask import Flask, render_template, request, redirect, url_for
from flask import jsonify, session, make_response, g
import os, random, string, json, httplib2, requests
from oauth2client.client import flow_from_clientsecrets
from oauth2client.client import Flow... | 2.546875 | 3 |
python/dynamic_graph/sot/torque_control/main.py | jviereck/sot-torque-control | 0 | 12784389 | <reponame>jviereck/sot-torque-control
# -*- coding: utf-8 -*-1
"""
2014, LAAS/CNRS
@author: <NAME>
"""
from dynamic_graph import plug
from dynamic_graph.sot.torque_control.se3_trajectory_generator import SE3TrajectoryGenerator
from dynamic_graph.sot.torque_control.create_entities_utils import create_trajectory_switch,... | 1.515625 | 2 |
click_man/__main__.py | smarlowucf/click-man | 1 | 12784390 | <gh_stars>1-10
"""
click-man - Generate man pages for click application
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module provides a click CLI command to
generate man pages from a click application.
:copyright: (c) 2016 by <NAME>.
:license: MIT, see LICENSE for more details.
"""
import os
import click... | 2.640625 | 3 |
goutdotcom/treatment/models.py | Spiewart/goutdotcom | 0 | 12784391 | <reponame>Spiewart/goutdotcom
from datetime import datetime, timezone
from decimal import *
from django.conf import settings
from django.core.validators import MaxValueValidator, MinValueValidator
from django.db import models
from django.db.models.fields.related import ForeignKey
from django.urls import reverse
from d... | 2.265625 | 2 |
WEB(BE)/drf/detection_status/urls.py | dev-taewon-kim/ai_web_RISKOUT_BTS | 1 | 12784392 | from django.urls import path
from .views import *
urlpatterns = [
path('analyze/', AnalyzedDataView.as_view(), name='analyze'),
path('trends/', TrendsDataView.as_view(), name='trends'),
path('wordcloud/', WordcloudDataView.as_view(), name='wordcloud'),
path('article/volume/', ArticleVolumeDataView.as_v... | 1.757813 | 2 |
src/netatmo/__init__.py | elcombato/netatmo | 33 | 12784393 | <filename>src/netatmo/__init__.py<gh_stars>10-100
from .netatmo import *
| 1.109375 | 1 |
jaraco/windows/privilege.py | jaraco/jaraco.windows | 21 | 12784394 | <gh_stars>10-100
import ctypes
from ctypes import wintypes
from .api import security
from .api import privilege
from .api import process
def get_process_token():
"""
Get the current process token
"""
token = wintypes.HANDLE()
res = process.OpenProcessToken(
process.GetCurrentProcess(), pr... | 2.625 | 3 |
unstrip.py | pzread/unstrip | 103 | 12784395 | <reponame>pzread/unstrip
import sys
import sqlite3
import msgpack
from scan import *
from mark import *
if __name__ == '__main__':
conn = sqlite3.connect('fin.db')
try:
conn.execute('CREATE TABLE flowfin (label text primary key,len int,fin blob,hash text);')
conn.execute('CREATE INDEX index_flo... | 2.203125 | 2 |
configs/bead/cascade_mask_rcnn_r50_fpn_1x_coco_type_6.py | anley1/Swin-Transformer-Object-Detection | 0 | 12784396 | <reponame>anley1/Swin-Transformer-Object-Detection
_base_ = [
'./cascade_mask_rcnn_r50_fpn.py',
'../_base_/datasets/bead_cropped_type_6_mask.py',
'../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py'
]
#checkpoint_config = dict(max_keep_ckpts=4)
| 0.996094 | 1 |
unimodal_irl/bv_maxlikelihood_irl.py | aaronsnoswell/UniModal-IRL | 2 | 12784397 | <filename>unimodal_irl/bv_maxlikelihood_irl.py
import copy
from pprint import pprint
import numpy as np
import warnings
import itertools as it
from numba import jit
from mdp_extras import (
Linear,
vi,
q_grad_fpi,
BoltzmannExplorationPolicy,
OptimalPolicy,
)
@jit(nopython=True)
def nb_smq_valu... | 2.359375 | 2 |
routes/case.py | SimoneCff/TW6-PJ-PAPC | 2 | 12784398 | from bson.json_util import dumps
from flask import request, render_template
from app import Carrello, app
from complements.db import SearchIntoDb, SearchviaAttributesCASE
from complements.forms import Searchfor, CaseSelect
@app.route('/case', methods=['POST', 'GET'])
def case():
form1 = Searchfor()
form2 = C... | 2.21875 | 2 |
Part 2/Chapter 02/Exercises/excercise_13.py | phuycke/Practice-of-computing-using-Python | 1 | 12784399 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: <NAME>
email: <EMAIL>
GitHub: phuycke
"""
#%%
asked = str(input('Input an integer: '))
while not asked.isdigit():
asked = str(input('Error: try again. Input an integer: '))
else:
print('The integer is : {}'.format(asked)) | 3.765625 | 4 |
pbc_utils.py | DrSuiunbek/pbc | 0 | 12784400 | <reponame>DrSuiunbek/pbc
import json
import rlp
from Crypto.Hash import keccak
def generate():
data = {
'Producers': ['P1', 'P2', 'P3'],
'Freighters': ['F1', 'F2'],
'Shops': ['S1', 'S2'],
'Miners': ['M1'],
'NetworkID': '2003',
'Password': '<P... | 2.796875 | 3 |
datazen/targets.py | vkottler/datazen | 2 | 12784401 | <filename>datazen/targets.py
"""
datazen - An interface for parsing and matching targets.
"""
# built-in
from collections import defaultdict
from copy import deepcopy
import re
from typing import Dict, Tuple, List, NamedTuple
# internal
from datazen.paths import (
advance_dict_by_path,
unflatten_dict,
for... | 2.734375 | 3 |
test.py | chensteven/sec-edgar | 0 | 12784402 | from secedgar.filings import Filing, FilingType
# This will download the past 15 10-Q filings made by Apple.
import pandas as pd
path = '/Users/schen/sec-scraper/data/cik_ticker.csv'
df = pd.read_csv(path, sep='|')
def run(df):
cik = list(df['CIK'])
names = list(df['Name'])
for c, n in zip(cik, names):
... | 3.109375 | 3 |
taskbooks/custom1.py | no-such-anthony/net-run | 1 | 12784403 | <filename>taskbooks/custom1.py
#from connections import get_connection, close_connection
def custom1(device, **kwargs):
# pop out any additional kwargs you may have passed
#tasks = kwargs.pop('tasks', [])
#connection_type = kwargs.pop('connection_type', '')
#connection_key = kwargs.pop('connect... | 2.8125 | 3 |
src/trainers/__init__.py | pomelyu/ML_HW | 0 | 12784404 | from .classification_trainer import ClassificationTrainer
from .gan_trainer import GANTrainer
from .regression_trainer import RegressionTrainer
from .trainer import Trainer
from .hw3_trainer import HW3Trainer
| 1.054688 | 1 |
adafruit_picam/camera/__init__.py | avirshup/adafruit-pi-cam | 0 | 12784405 | import typing as _t
from .base import Camera
from .mock import MockCamera
try:
from .pi import RaspberryPiCamera
except ImportError as exc:
assert exc.name == "picamera"
_rpi_exc = exc
RaspberryPiCamera = None
else:
_rpi_exc = None
def get_cls(fake: bool = False) -> _t.Type[Camera]:
if fake... | 2.34375 | 2 |
kata/07/string_end_with.py | vyahello/upgrade-python-kata | 0 | 12784406 | """
Complete the solution so that it returns true if the first argument(string) passed in ends with the 2nd argument (also a string).
"""
def solution(string: str, ending: str) -> bool:
"""Checks if given string ends with specific string.
Examples:
>>> assert solution("abcb", "cb")
>>> assert... | 4.25 | 4 |
codesmith/CodeCommit/PipelineTrigger/test_pipline_trigger.py | codesmith-gmbh/forge | 0 | 12784407 | import unittest
import codesmith.CodeCommit.PipelineTrigger.pipline_trigger as pt
import json
import io
import zipfile
COMMIT_REFERENCE = {
"commit": "5<PASSWORD>",
"ref": "refs/heads/master"
}
TAG_REFERENCE = {
"commit": "<PASSWORD>",
"ref": "refs/tags/v1.1.0"
}
class PipelineTriggerTest(unittest.Te... | 2.3125 | 2 |
diediedie/brick_lvm.py | WaltHP/hpe-openstack-tools | 1 | 12784408 | <reponame>WaltHP/hpe-openstack-tools<gh_stars>1-10
#!/usr/bin/python
# 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
#
# Unles... | 1.90625 | 2 |
handroll/date.py | iter8ve/handroll | 17 | 12784409 | # Copyright (c) 2017, <NAME>
from datetime import datetime
import time
def convert(date):
"""Convert a date string into a datetime instance. Assumes date string
is RfC 3339 format."""
time_s = time.strptime(date, '%Y-%m-%dT%H:%M:%S')
return datetime.fromtimestamp(time.mktime(time_s))
| 3.84375 | 4 |
src/network_utils_test.py | omid55/dynamic_sparse_balance_theory | 0 | 12784410 | # Omid55
# Test module for network_utils.
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
import networkx as nx
import pandas as pd
import numpy as np
import unittest
import datetime
import re
from parameterized import parameterized
import utils
import net... | 2.09375 | 2 |
domain-finder.py | luisrowley/domain-finder | 0 | 12784411 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Check for all required python dependencies first
try:
import sys
import argparse
import subprocess
import shlex
except ImportError, e:
python_install = raw_input("\nMissing required python dependencies: sys argparse subprocess shlex. Install them now? [y/n]")
if ... | 2.703125 | 3 |
XeroPoster.py | 6enno/FarmXero | 0 | 12784412 | # Goal: Push a journal to Xero
import json
import requests
import Secrets
from oauthlib.oauth2 import BackendApplicationClient
from requests_oauthlib import OAuth2Session
url = 'https://api.xero.com/api.xro/2.0/ManualJournals'
refreshUrl = "https://identity.xero.com/connect/token"
connectUrl ='https://api.xero.com/c... | 2.484375 | 2 |
gfyrslf/commands/hi.py | mstroud/python-matrix-gfyrslf | 0 | 12784413 | <gh_stars>0
import logging
from gfyrslf.command import GfyrslfCommand
class HelloCommand(GfyrslfCommand):
def __init__(self, cmdname, cfg):
super().__init__(cmdname, cfg)
self.description = "Replies \"Hi\" to a variety of greetings"
def event_handler(self, bot, room, event):
room.send_... | 2.390625 | 2 |
miRmedon_src/counter.py | Ally-s-Lab/miRmedon | 2 | 12784414 | <gh_stars>1-10
import pysam
from collections import Counter
def counter(bam):
bam_input = pysam.AlignmentFile(bam, 'rb')
haplotypes_counter = Counter()
alignments_list = []
for alignment in bam_input.fetch(until_eof=True):
if len(alignments_list) == 0:
alignments_list.append(alignme... | 2.4375 | 2 |
main.py | RyanMatheusRamello/ppt | 0 | 12784415 | <reponame>RyanMatheusRamello/ppt<gh_stars>0
import discord
import os
import time
import discord.ext
from discord.utils import get
from discord.ext import commands, tasks
from discord.ext.commands import has_permissions, CheckFailure, check
from random import randint
client = discord.Client()
client = commands.Bot(co... | 3.1875 | 3 |
src/meltano/core/job/finder.py | siilats/meltano | 122 | 12784416 | <reponame>siilats/meltano
"""Defines JobFinder."""
from datetime import datetime, timedelta
from .job import HEARTBEAT_VALID_MINUTES, HEARTBEATLESS_JOB_VALID_HOURS, Job, State
class JobFinder:
"""
Query builder for the `Job` model for a certain `elt_uri`.
"""
def __init__(self, job_id: str):
... | 2.328125 | 2 |
secse/scoring/docking_score_prediction.py | autodataming/SECSE | 1 | 12784417 | <filename>secse/scoring/docking_score_prediction.py
#!/usr/bin/env python
# -*- coding:utf-8 _*-
"""
@author: <NAME>
@file: docking_score_prediction.py
@time: 2021/10/27/14:26
"""
import argparse
import subprocess
from openbabel import openbabel
import pandas as pd
import os
import rdkit
from rdkit import Chem
from... | 2.1875 | 2 |
widgets/loading_bar.py | Thenujan-0/grub-editor | 1 | 12784418 | #!/usr/bin/python
import sys
from PyQt5.QtWidgets import QWidget, QApplication
from PyQt5.QtGui import QPainter, QColor, QFont,QPalette,QPolygonF,QBrush
from PyQt5.QtCore import Qt , QPointF,QRectF,QObject,pyqtSignal,QRunnable,pyqtSlot,QThreadPool,QTimer
import traceback
from time import sleep
class WorkerSignals(... | 2.78125 | 3 |
impl/status.py | HEG-INCIPIT/ARKetype | 9 | 12784419 | <filename>impl/status.py
# =============================================================================
#
# EZID :: status.py
#
# Periodic status reporting.
#
# This module should be imported at server startup so that its daemon
# thread is started.
#
# Author:
# <NAME> <<EMAIL>>
#
# License:
# Copyright (c) 2013,... | 1.945313 | 2 |
liczeniedoszesciu.py | SoGreeno/pygamethingidunno | 0 | 12784420 | import time
c = 1
print(c)
c += 1
print(c)
time.sleep(1)
c += 1
print(c)
time.sleep(1)
c += 1
print(c)
time.sleep(1)
c += 1
print(c)
time.sleep(1)
c += 1
print(c)
time.sleep(1)
print("jak by co")
time.sleep(0.5)
print("to kod jest z książki")
time.sleep(3)
print("nie kradziony")
time.sleep(2)
| 3.46875 | 3 |
scripts/offuscate_names.py | diego0020/lab_vision | 8 | 12784421 | <gh_stars>1-10
import os
import hmac
import base64
import glob
import hashlib
from itertools import izip
import csv
in_dir='/home/pabloa/imagenet_tiny/test'
out_dir='/home/pabloa/imagenet_tiny/test_o'
cats_file='/home/pabloa/imagenet_tiny/cats_o.csv'
key='<KEY>'
os.chdir(in_dir)
imgs = glob.glob('*/*.JPEG')
hashes =... | 2.625 | 3 |
src/bulk_mover/mover_classes/SANCBagger.py | StateArchivesOfNorthCarolina/sanc-repo-manager | 0 | 12784422 | <filename>src/bulk_mover/mover_classes/SANCBagger.py
import bagit
import os
class SANCBagger(object):
def __init__(self) -> None:
self.bag_to_open = None # type: str
self.tree_to_bag = None # type: str
self.working_bag = None # type: bagit.Bag
self.validation_error_details... | 2.203125 | 2 |
app/main/models/posts.py | NiHighlism/Minerva | 4 | 12784423 | """
DB Model for Posts and
relevant junction tables
"""
import datetime
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.sql import and_, select
from app.main import db
from app.main.models.base import Base
from app.main.models.comments import Comment
from app.main.models.movies import Movie
fr... | 2.96875 | 3 |
python/iot-sdk-demo/iotSdkDemo/Device/BatchGetDeviceState.py | aliyun/iot-api-demo | 86 | 12784424 | <gh_stars>10-100
#!/usr/bin/env python
#coding=utf-8
from aliyunsdkcore.client import AcsClient
from aliyunsdkcore.acs_exception.exceptions import ClientException
from aliyunsdkcore.acs_exception.exceptions import ServerException
from aliyunsdkiot.request.v20180120.BatchGetDeviceStateRequest import BatchGetDeviceState... | 1.851563 | 2 |
helpers/google.py | eoglethorpe/DEEPL | 1 | 12784425 | from django.conf import settings
import requests
import json
from NER.models import GoogleLocationCache
GOOGLE_GEOCODE_URL =\
'https://maps.googleapis.com/maps/api/geocode/json?key={}&address={}'
def get_google_geocode_url(location):
return GOOGLE_GEOCODE_URL.format(
getattr(settings, 'GOOGLE_API_... | 2.515625 | 3 |
examples/discovery.py | BenoitAnastay/aiohue | 14 | 12784426 | <reponame>BenoitAnastay/aiohue
"""AIOHue example for HUE bridge discovery."""
import asyncio
from os.path import abspath, dirname
from sys import path
path.insert(1, dirname(dirname(abspath(__file__))))
from aiohue.discovery import discover_nupnp
async def main():
"""Run code example."""
discovered_bridges ... | 2.421875 | 2 |
tasks/admin.py | housepig7/ops | 394 | 12784427 | <reponame>housepig7/ops
from django.contrib import admin
# Register your models here.
from .models import history,toolsscript
admin.site.register(history)
admin.site.register(toolsscript) | 1.351563 | 1 |
lib/evaluation.py | Julius-Syvis/PyTorch-Transformer-Studies | 0 | 12784428 | <filename>lib/evaluation.py
import time
import torch
from torchtext.data.metrics import bleu_score
class Translator:
def __init__(self, model, spacy_model, field_src, field_trg, device):
self.model = model
self.spacy_model = spacy_model
self.field_src = field_src
self.field_trg = f... | 2.40625 | 2 |
pythonScripts/BVDDataAnalyzer/SimulationFile.py | Yperidis/bvd_agent_based_model | 1 | 12784429 | #!/usr/bin/env python
import outputSpecification as outputSpec
import h5py as h5
import os
import numpy as np
import sys
def getFileNames(fileName):
filenames = []
path = ""
if fileName.lower().endswith('.txt'):
path = os.path.dirname(os.path.abspath(fileName))
with open(fileName) as f:
... | 2.890625 | 3 |
mapping/data_loader/h5_timeseries.py | syanga/model-augmented-mutual-information | 2 | 12784430 | <reponame>syanga/model-augmented-mutual-information<gh_stars>1-10
from torchvision import datasets, transforms
from ..base import BaseDataLoader
from torch.utils import data
import h5py
import numpy as np
import torch
class TimeseriesDataset(data.Dataset):
"""docstring for BackBlazeDataset"""
def __init__(sel... | 2.171875 | 2 |
numba/ir/generator/build.py | liuzhenhai/numba | 1 | 12784431 | # -*- coding: utf-8 -*-
"""
Generate a package with IR implementations and tools.
"""
from __future__ import print_function, division, absolute_import
import os
from textwrap import dedent
from itertools import chain
from . import generator
from . import formatting
from . import astgen
from . import visitorgen
from... | 2.078125 | 2 |
sdk/search/azure-search-documents/tests/test_index_documents_batch.py | rsdoherty/azure-sdk-for-python | 2,728 | 12784432 | <gh_stars>1000+
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import pytest
from azure.search.documents.models import IndexAction
from azure.search.documents import IndexDocumentsBatch
METHOD_NAMES = [
"add_... | 2.328125 | 2 |
_AceVision_testcodes/A6449/RS232_serial Pass NG code.py | lyj911111/OpenCV_Project | 0 | 12784433 | import serial
import cv2
# 시리얼 연결 실패시 오류 메시지 클래스
class errorMessage(Exception):
def __init__(self, msg='init_error_msg'):
self.msg = msg
def __str__(self):
return self.msg
# 초기 시리얼 연결
try:
print("Suceessfully connected with PLC")
ser = serial.Serial(
port='COM3',
baud... | 2.875 | 3 |
meiduo04/mall/utils/fastdfs/fdfsstorage.py | sunsyw/web | 0 | 12784434 |
from django.core.files.storage import Storage
"""
1.您的自定义存储系统必须是以下的子类 :django.core.files.storage.Storage
2.Django必须能够在没有任何参数的情况下实例化您的存储系统。
这意味着任何设置都应该来自:django.conf.settings
3.您的存储类必须实现_open()和_save() 方法,
以适合您的存储类中的任何其他方法一起。请参阅下面的这些方法。
4.您的存储类必须是可解构的, 以便在迁移中的字段上使用时可以对其进行序列化。
只要您的字段具有可自行序列化的参数,
就 可以使用 django.... | 2.5 | 2 |
2018/day11p2.py | JonSn0w/advent-of-code | 1 | 12784435 | import numpy as np
n = 300
serial = int(input())
grid = np.array([[int(str(((x+10)*y+serial)*(x+10))[-3])-5 for y in range(1, n+1)] for x in range(1, n+1)])
coord = (0, 0)
mVal, dim = 0, 0
for d in range(4, 2, -1):
squares = sum(grid[x:x-d+1 or None, y:y-d+1 or None] for x in range(d) for y in range(d))
val = ... | 3.21875 | 3 |
odoo-13.0/venv/lib/python3.8/site-packages/ImageDraw.py | VaibhavBhujade/Blockchain-ERP-interoperability | 3 | 12784436 | from PIL.ImageDraw import *
| 1.109375 | 1 |
OpenGLWrapper_JE/venv/Lib/site-packages/OpenGL/GL/ARB/explicit_uniform_location.py | JE-Chen/je_old_repo | 0 | 12784437 | <reponame>JE-Chen/je_old_repo
'''OpenGL extension ARB.explicit_uniform_location
This module customises the behaviour of the
OpenGL.raw.GL.ARB.explicit_uniform_location to provide a more
Python-friendly API
Overview (from the spec)
This extension provides a method to pre-assign uniform locations to
unif... | 1.882813 | 2 |
code/venv/lib/python3.8/site-packages/datadog_api_client/v2/model/logs_archive_integration_s3.py | Valisback/hiring-engineers | 0 | 12784438 | # Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2019-Present Datadog, Inc.
from datadog_api_client.v2.model_utils import (
ModelNormal,
cached_property,
... | 1.929688 | 2 |
venv/lib/python3.8/site-packages/debugpy/_vendored/pydevd/pydev_ipython/version.py | Retraces/UkraineBot | 2 | 12784439 | <reponame>Retraces/UkraineBot
/home/runner/.cache/pip/pool/94/b0/52/47c9ad945d5e0b3c3039e8e58dc840c9f4b2d28a43f1bd30fd08d1f7b4 | 0.871094 | 1 |
services/terminal/main.py | darqos/darqos | 0 | 12784440 | <reponame>darqos/darqos<gh_stars>0
#! /usr/bin/env python
# Copyright (C) 2020 <NAME>
import sys
import typing
from urllib.parse import urlparse
from datetime import datetime
import PyQt5
from PyQt5 import QtCore, QtWidgets
from PyQt5.QtGui import QColor, QKeySequence, QMouseEvent, QIcon, QPixmap
from PyQt5.QtWidgets... | 2.125 | 2 |
Scripts/Dealer/CustomThreads/Reconstruction/Reconstruction.py | Sk3pper/AASSS-PoC | 0 | 12784441 | <reponame>Sk3pper/AASSS-PoC
import threading
import os
from CustomThreads.groups import MODP2048
from CustomThreads.groups import parametres
from CustomThreads.PedersenUtilities.VSS import pedersenVerify
from CustomThreads.PedersenUtilities.VSS import pedersenRecover
from CustomThreads.PedersenUtilities.VSS import gen... | 1.789063 | 2 |
parallelism.py | JNY0606/parallelismForAllLang | 3 | 12784442 | import multiprocessing as p
import time
def doit():
''' check CPU parallelism
while True:
pass
#'''
time.sleep(1)
print('並行')
count=0
def main():
def listener(x):
global count
count+=1
time.sleep(1)
print(count)
threads=5
pool=p.Pool()
f... | 3.125 | 3 |
vega/language/types.py | philippwiesner/compiler | 0 | 12784443 | """Vega language types
Representation of vega variable types
The following variable types are defined here:
Basic Types: INT, FLOAT, CHAR, BOOL
Complex Types: Array, String
"""
from typing import List
from vega.language.token import Tag
from vega.language.token import Word
class Type(Word):
"""Simple type
... | 3.984375 | 4 |
intro_to_machine_learning/lesson/lesson_3_decision_trees/classifyDT.py | robinl3680/udacity-course | 68 | 12784444 | # -*- coding: utf-8 -*-
"""
Created on Sat Nov 29 18:17:51 2014
@author: tvu
"""
def classify(features_train, labels_train):
### your code goes here--should return a trained decision tree classifer
from sklearn import tree
clf = tree.DecisionTreeClassifier()
clf = clf.fit(features_train, labels_t... | 3.359375 | 3 |
scripts/bam2species_map.py | 861934367/cgat | 0 | 12784445 | <gh_stars>0
'''bam2species_map.py
=============================================
:Author: <NAME>
:Release: $Id$
:Date: |today|
:Tags: Python
Purpose
-------
Produce a mapping txt file between contigs a species based
on aligned reads.
Usage
-----
Example::
python bam2species_map.py --help
Type::
python bam2... | 3 | 3 |
bmsAccumulator.py | clean-code-craft-tcq-1/function-ext-python-UtkrshGupta | 0 | 12784446 | <reponame>clean-code-craft-tcq-1/function-ext-python-UtkrshGupta
from bmsConstants import bms_multilingual_logs_status_heading
from bmsConstants import bms_multilingual_logs
import bmsGlobalParam as bgp
def accumulateLogs(bms_error_report, log_mode):
if log_mode == 'on':
bms_log_report(bms_error_re... | 2.390625 | 2 |
frag_pele/Analysis/compute_atom_atom_distance.py | danielSoler93/FrAG_PELE | 26 | 12784447 | <gh_stars>10-100
import glob
import os
import argparse
import joblib
import mdtraj as md
import pandas as pd
def parseArguments():
"""
Parse the command-line options
:returns: str, int, int -- path to file to results folder,
index of the first atom,
index of the second atom... | 2.734375 | 3 |
Statistics/zscore.py | ankit-kushwaha-51/calculatorHw-1 | 0 | 12784448 | <gh_stars>0
from Statistics.PopulationSD import population_standard_deviation
def zscore(datapoint, a, b, c, d, e, f):
try:
datapoint = float(datapoint)
a = float(a)
b = float(b)
c = float(c)
d = float(d)
e = float(e)
f = float(f)
data = []
da... | 3.1875 | 3 |
setup.py | jpetrucciani/python-duckduckgo | 6 | 12784449 | <filename>setup.py
"""
pip setup.py for ddg3
"""
from setuptools import setup
__library__ = "ddg3"
__version__ = "VERSION"
with open("README.md") as readme:
LONG_DESCRIPTION = readme.read()
with open("requirements.txt") as requirements:
INSTALL_REQUIRES = requirements.read().split("\n")
INSTALL_REQUIRES... | 1.6875 | 2 |
inxs/contrib.py | Balletie/inxs | 0 | 12784450 | <reponame>Balletie/inxs
""" This module contains transformations that are supposedly of common interest. """
from lxml import etree
from inxs import (
TRAVERSE_DEPTH_FIRST, TRAVERSE_BOTTOM_TO_TOP, TRAVERSE_LEFT_TO_RIGHT, lib, utils,
Not, Rule,
SkipToNextElement, Transformation,
)
__all__ = []
# reduce_... | 2.328125 | 2 |