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 |
|---|---|---|---|---|---|---|
tangotest/__main__.py | tsoenen/tng-sdk-test | 0 | 12797951 | import argparse
from tangotest.tangotools import create_vnv_test
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Prepare tests for uploading to the V&V platform.')
parser.add_argument('tests_path', help='The path to the directory with test files')
parser.add_argument('ns_package_p... | 2.359375 | 2 |
api/states/apiviews.py | Mastersam07/ncovid-19-api | 17 | 12797952 | <reponame>Mastersam07/ncovid-19-api<gh_stars>10-100
from rest_framework import generics, viewsets
from rest_framework.generics import get_object_or_404
from rest_framework.views import APIView
from rest_framework.response import Response
from .models import Data
from .serializers import StateSerializer # CaseSerializ... | 2.09375 | 2 |
python_parikshith21/Day46.py | 01coders/50-Days-Of-Code | 0 | 12797953 | <gh_stars>0
# -*- coding: utf-8 -*-
"""
Created on Wed Jun 25 14:33:03 2019
@author: Parikshith.H
"""
import numpy as np
arr = np.array([[1, 5, 6],
[4, 7, 2],
[3, 1, 9]])
# maximum element of array
print ("Largest element is:", arr.max())
print ("Row-wise maximum elements:"... | 4 | 4 |
simulators/fires/UrbanForest.py | rptamin/ddrl-firefighting | 7 | 12797954 | <gh_stars>1-10
from collections import defaultdict
import itertools
import numpy as np
from simulators.fires.ForestElements import Tree, SimpleUrban
from simulators.Simulator import Simulator
class UrbanForest(Simulator):
"""
A simulator for a lattice-based forest with urban elements. Based on the LatticeFor... | 2.8125 | 3 |
scrabbler/__init__.py | astralcai/scrabble-solver | 3 | 12797955 | <reponame>astralcai/scrabble-solver
from scrabbler.scrabbler import Game
| 0.953125 | 1 |
bin/ColorBoard.py | hfally/mysql-autorestore | 0 | 12797956 | colors = {
'HEADER' : '\033[95m',
'OKBLUE' : '\033[94m',
'OKGREEN' : '\033[0;32m',
'YELLOW' : '\033[0;33m',
'FAIL' : '\033[31m',
'ENDC' : '\033[0m',
'BOLD' : '\033[1m',
'UNDERLINE' : '\033[4m',
'BGRED' : '\033[41;37m'
}
# Handle coloration
def colorize(string, color):
return colors[color.upper()] + strin... | 3.03125 | 3 |
code-lab/blender/active_object_bbox_loc_rot_dimension.py | kant/AI-Resources | 0 | 12797957 | <gh_stars>0
"""Get the location, rotation(radian) and dimension of selected object bounding box.
References
- https://blender.stackexchange.com/questions/14070/create-and-export-bounding-boxes-for-objects
"""
import bpy
selected = bpy.context.selected_objects
for obj in selected:
#ensure origin is centered on b... | 2.890625 | 3 |
example/docs/conf.py | zenitysec/sphinx-rego | 13 | 12797958 | project = 'sphinx-rego example'
copyright = '2021, sphinx-rego'
author = 'sphinx-rego'
release = '1'
extensions = ["sphinxrego.ext"]
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
html_theme = 'alabaster'
| 0.9375 | 1 |
python-libs/histogram.py | bilbopingouin/simple-stats-tools | 0 | 12797959 | # This create an array to plot an histogram as
# ^
# | +-+
# | +-+ | +-+
# | | | +-+ |
# | +-+ | | | +-+
# | | | | | | | +-+
# +---+-+-+-+-+-+-+-+------->
# Vm Vmax
class histogram:
def __init__(self, vmin, vmax, nbins):
self.init_values(vmin, vmax, nbins)
... | 3.84375 | 4 |
app.py | manojvirat457/Resume-Matching | 0 | 12797960 | # from scripts import tabledef
# from scripts import forms
# from scripts import helpers
from flask import Flask, redirect, url_for, render_template, request, session
import json
import sys
import os
# import stripe
import pandas as pd
from werkzeug.utils import secure_filename
from sklearn.preprocessing import Polynom... | 1.875 | 2 |
strategist/tests/factories.py | OpenMatchmaking/microservice-strategist | 0 | 12797961 | from uuid import uuid4
def generate_player_data(event_name, rating):
return {
"id": str(uuid4()),
"response-queue": "{}-response-queue".format(str(uuid4())),
"event-name": event_name,
"detail": {
"rating": rating,
"content": {}
}
}
| 2.625 | 3 |
tests/test_mt2_tombs.py | tpgillam/mt2 | 3 | 12797962 | """Tests for the variant of MT2 by <NAME>."""
from typing import Optional, Union
import numpy
import pytest
from .common import mt2_lester, mt2_tombs
def test_simple_example():
computed_val = mt2_tombs(100, 410, 20, 150, -210, -300, -200, 280, 100, 100)
assert computed_val == pytest.approx(412.628)
def t... | 2.515625 | 3 |
ex092.py | raphael-abrantes/exercises-python | 0 | 12797963 | from datetime import datetime
pessoa = dict()
anohoje = datetime.now().year
pessoa['nome'] = str(input('Informe o nome: ')).strip().title()
nasc = int(input('Informe o ano de nascimento: '))
pessoa['idade'] = anohoje - nasc
pessoa['ctps'] = int(input('Informe a CTPS (0 se não tiver): '))
if pessoa['ctps'] !=... | 3.671875 | 4 |
multithread/mtfacfib.py | hero0926/PythonPlayground | 0 | 12797964 | # 싱글 스레드랑 멀티 스레드 비교하기
from myThread import MyThread
from time import ctime, sleep
# 피보나치, 팩토리얼, 합계를 싱글스레드랑 멀티스레드에서 실행시켜 보았다.
def fib(x) :
sleep(0.005)
if x<2 : return 1
return (fib(x-2)+fib(x-1))
def fac(x) :
sleep(0.1)
if x<2 : return 1
refutn (x*(fac(x-1))
def sum(x) :
sleep(0.1)
if x<2 : ret... | 3.84375 | 4 |
pyDcmConverter/dicomgui.py | ChenglongWang/pythonDicomConverter | 4 | 12797965 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# dicomgui.py
"""Main app file that convert DICOM data via a wxPython GUI dialog."""
# Copyright (c) 2018-2020 <NAME>
# Copyright (c) 2009-2017 <NAME>
# Copyright (c) 2009 <NAME>
# This file is part of dicompyler, released under a BSD license.
# See the file license.txt ... | 2.390625 | 2 |
datasets/davis.py | sallymmx/TransVOS | 20 | 12797966 | <reponame>sallymmx/TransVOS
import os
import numpy as np
from glob import glob
import random
import torch
from torch.utils import data
import torchvision.transforms as TF
import datasets.transform as mytrans
from utils.system import load_image_in_PIL, gct
import matplotlib.pyplot as plt
from PIL import Im... | 2.21875 | 2 |
code/ch17/17.1.1.majorityElement.py | leetcode-pp/leetcode-pp1 | 22 | 12797967 | <gh_stars>10-100
class Solution:
def majorityElement(self, nums: List[int]) -> List[int]:
n = len(nums)
res = []
cnt1 = 0
cnt2 = 0
n1 = None
n2 = None
# 筛选出现次数最多的前两个
for num in nums:
if num == n1:
cnt1 += 1
elif... | 2.984375 | 3 |
common/code/snippets/txt/ssh.py | nevesnunes/env | 4 | 12797968 | <filename>common/code/snippets/txt/ssh.py
import paramiko
import datetime
import subprocess # run it locally if you want, use this for Bash commands
def run_netflow_cmd(command):
rwflow_server_ip = "192.168.3.11" # SiLK box
user_name="netflow"
keyfile="/home/marius/.ssh/id_rsa"
ssh = paramiko.SSHC... | 2.59375 | 3 |
models/inclusive_gateway.py | THM-MA/XSDATA-waypoint | 0 | 12797969 | from dataclasses import dataclass
from .t_inclusive_gateway import TInclusiveGateway
__NAMESPACE__ = "http://www.omg.org/spec/BPMN/20100524/MODEL"
@dataclass
class InclusiveGateway(TInclusiveGateway):
class Meta:
name = "inclusiveGateway"
namespace = "http://www.omg.org/spec/BPMN/20100524/MODEL"
| 1.921875 | 2 |
tests/testArUco.py | snavas/PyMote | 3 | 12797970 | <reponame>snavas/PyMote
import numpy as np
import cv2
from cv2 import aruco
# https://mecaruco2.readthedocs.io/en/latest/notebooks_rst/Aruco/Aruco.html
aruco_dict = aruco.Dictionary_get(aruco.DICT_6X6_250)
image = cv2.imread("../tests/aruco.jpg")
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
aruco_dict = aruco.Di... | 2.546875 | 3 |
ls-tree/python/main.py | danielo515/explore-new-languages | 0 | 12797971 | import os
from os import listdir
from argparse import ArgumentParser
from os.path import isdir,join
middle = '├'
pipe = '│'
last = '└'
scale = 2
def traverse(path, parents='', depth=0, isLast=True):
tree = [(path, parents, depth, isLast)]
realPath = join(parents,path)
files = listdir(realPath)
... | 3.203125 | 3 |
keystone/config.py | savi-dev/keystone | 0 | 12797972 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 OpenStack LLC
#
# 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 requ... | 1.976563 | 2 |
backend/tests/session/test_session_login_user.py | fjacob21/mididecweb | 0 | 12797973 | from datetime import datetime, timedelta
import pytz
from bcrypt_hash import BcryptHash
import pytest
from src.users import Users
from src.events import Events
from src.stores import MemoryStore
from src.session import Session
def test_login_user():
store = MemoryStore()
users = Users(store)
params = {}
... | 2.265625 | 2 |
tests/unit/test_sessions.py | irvansemestanya/vault-cli | 52 | 12797974 | <reponame>irvansemestanya/vault-cli<filename>tests/unit/test_sessions.py<gh_stars>10-100
import os
import pytest
from vault_cli import sessions
@pytest.fixture
def reset_requests_ca_bundle():
requests_ca_bundle = os.environ.get("REQUESTS_CA_BUNDLE")
os.environ.pop("REQUESTS_CA_BUNDLE", None)
yield
i... | 2.046875 | 2 |
tensorflow/contrib/distributions/python/kernel_tests/estimator_test.py | tianyapiaozi/tensorflow | 848 | 12797975 | # Copyright 2017 The TensorFlow Authors. 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 required by applica... | 1.789063 | 2 |
seahub/organizations/api/users.py | samuelduann/seahub | 420 | 12797976 | # Copyright (c) 2012-2016 Seafile Ltd.
import logging
from rest_framework import status
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework.authentication import SessionAuthentication
from seaserv import ccnet_api
from seahub.api2.permissions import IsProVersion... | 1.9375 | 2 |
perfect.py | CrownCrafter/School | 0 | 12797977 | <filename>perfect.py
#!/usr/bin/env python3
x = int(input("Enter number "))
p = x
i = 1
sum = 0
while(True):
if(x // (10 ** i) == 0):
dig = i
break
i += 1
i = 1
factors=[]
while(i < x):
if(x % i == 0):
factors.append(i)
i += 1
for i in range(0, len(factors)):
sum += factors[... | 3.875 | 4 |
app/recommendation/migrations/0003_auto_20181115_2259.py | A2ed/affective-recommendation | 0 | 12797978 | <gh_stars>0
# Generated by Django 2.1.3 on 2018-11-15 22:59
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('recommendation', '0002_auto_20181115_2204'),
]
operations = [
migrations.RemoveField(
model_name='state',
... | 1.40625 | 1 |
helpers/move_detection.py | playingwithai/rock_paper_scissors_part3 | 0 | 12797979 | import logging
import os
from enum import Enum
from imageai.Prediction.Custom import CustomImagePrediction
# Show only errors in console
logging.getLogger("tensorflow").setLevel(logging.ERROR)
class MovesEnum(int, Enum):
ROCK = 0
PAPER = 1
SCISSORS = 2
class ModelTypeEnum(Enum):
"""
An helper ... | 2.890625 | 3 |
fuzzy_modeling/tests/models/test_system_model.py | arruda/cloudfuzzy | 2 | 12797980 | <gh_stars>1-10
# -*- coding: utf-8 -*-
import inspect
import mock
from django.test import TestCase
from fuzzy_modeling.tests.utils import ResetMock
from fuzzy_modeling.models.systems import SystemModel
from fuzzy.System import System
class SystemModelTest(TestCase, ResetMock):
def setUp(self):
# se... | 2.703125 | 3 |
markovdwp/priors/vamp.py | ivannz/MarkovDWP | 0 | 12797981 | <gh_stars>0
import math
import torch
class VAMP(torch.nn.Module):
"""Varational Mixture of Posteriors prior by <NAME> Welling (2017).
URL
---
https://arxiv.org/abs/1705.07120
"""
def __init__(self, encoder, n_sample=50):
super().__init__()
self.encoder = encoder
# pse... | 2.71875 | 3 |
09-revisao/practice_python/cows_and_bulls.py | lcnodc/codes | 1 | 12797982 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Exercise 18: Cows And Bulls
Create a program that will play the “cows and bulls” game with the user.
The game works like this:
Randomly generate a 4-digit number. Ask the user to guess a 4-digit
number.
For every digit that the user guessed correctly in the correct pl... | 4.375 | 4 |
finliveapp/migrations/0028_gasmeasurement_unique gas measurement.py | FinLiveRI/FinLiveApp | 0 | 12797983 | <reponame>FinLiveRI/FinLiveApp<filename>finliveapp/migrations/0028_gasmeasurement_unique gas measurement.py
# Generated by Django 3.2.4 on 2021-12-14 11:17
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('finliveapp', '0027_gassystem_wind_direction'),
... | 1.554688 | 2 |
models.py | DSRnD/UMLs | 0 | 12797984 | <reponame>DSRnD/UMLs
import torch
import torch.nn as nn
import torch.nn.functional as F
import random
import numpy as np
import torch.autograd as autograd
class NegativeSampling(nn.Module):
"""Negative sampling loss as proposed by <NAME> al. in Distributed
Representations of Words and Phrases and thei... | 2.96875 | 3 |
src/screensketch/screenspec/reader/xml.py | perfidia/screensketch | 1 | 12797985 | '''
Created on Apr 12, 2013
@author: <NAME>
'''
from lxml import etree
from StringIO import StringIO
from screensketch.screenspec import model
class XMLReader(object):
def __init__(self, input_data):
self.input_data = input_data
self.retval = None;
def __parseComponent(self, node, parent):
items = node.item... | 2.421875 | 2 |
Leetcode/0652. Find Duplicate Subtrees/0652.py | Next-Gen-UI/Code-Dynamics | 0 | 12797986 | <reponame>Next-Gen-UI/Code-Dynamics
class Solution:
def findDuplicateSubtrees(self, root: Optional[TreeNode]) -> List[Optional[TreeNode]]:
ans = []
count = Counter()
def encode(root: Optional[TreeNode]) -> str:
if not root:
return ''
left = encode(root.left)
right = encode(root... | 2.9375 | 3 |
events/on_error.py | DangVietH/DangVietBot | 2 | 12797987 | from discord.ext import commands
import discord
import datetime
class OnError(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.Cog.listener()
async def on_command_error(self, ctx, error):
ignore = (commands.CommandNotFound, discord.NotFound, discord.Forbidden)
if ... | 2.640625 | 3 |
scripts/addons/context_browser/preferences.py | Tilapiatsu/blender-custom_conf | 2 | 12797988 | <reponame>Tilapiatsu/blender-custom_conf<filename>scripts/addons/context_browser/preferences.py
import bpy
from .addon import ADDON_ID, temp_prefs, prefs, ic
from .utils.collection_utils import sort_collection
from .ops.context_browser import CB_OT_browser
class BookmarkItem(bpy.types.PropertyGroup):
path = bpy.p... | 1.953125 | 2 |
net/lstm.py | workofart/brawlstars-ai | 12 | 12797989 | <filename>net/lstm.py<gh_stars>10-100
import numpy as np
import tensorflow as tf
import tflearn
import os
def get_movement_model(steps):
# Network building
net = tflearn.input_data(shape=[None, steps, 128], name='net1_layer1')
net = tflearn.lstm(net, n_units=256, return_seq=True, name='net1_layer2')
ne... | 2.671875 | 3 |
basics/deque_example.py | examplehub/Python | 9 | 12797990 | def main() -> None:
"""
>>> from collections import deque
>>> queue = deque(["Python", "Java", "C"])
>>> len(queue)
3
>>> queue
deque(['Python', 'Java', 'C'])
>>> queue.popleft()
'Python'
>>> queue.popleft()
'Java'
>>> queue.clear()
>>> len(queue)
0
>>> queue
... | 3.078125 | 3 |
downstream/tinypersons/configs2/TinyPerson/base/retinanet_r50_fpns4_1x_TinyPerson640_clipg.py | bwconrad/solo-learn | 37 | 12797991 | <gh_stars>10-100
_base_ = [
'./retinanet_r50_fpn_1x_TinyPerson640.py'
]
optimizer = dict(type='SGD', lr=0.02, momentum=0.9, weight_decay=0.0001) # 4 gpu
optimizer_config = dict(_delete_=True, grad_clip=dict(max_norm=1, norm_type=2)) # add grad clip
# model settings
model = dict(
neck=dict(
s... | 1.492188 | 1 |
tests/modules/transformer/bimodal_attention_test.py | MSLars/allennlp | 11,433 | 12797992 | <gh_stars>1000+
import torch
import pytest
from allennlp.common import Params
from allennlp.modules.transformer import BiModalAttention
@pytest.fixture
def params_dict():
return {
"hidden_size1": 6,
"hidden_size2": 4,
"combined_hidden_size": 16,
"num_attention_heads": 2,
"... | 2.25 | 2 |
People/Juan/Week 2/Calendar.py | rmorgan10/ExpertPythonProgramming | 2 | 12797993 | #!/usr/bin/env python3
from typing import List, Dict
from datetime import date, datetime
from calendar import monthrange
import os
from typing import TypeVar, Tuple
from benedict import benedict
from Events import Event
from CalendarErrors import BreakoutError, MainError
from Prompt import prompt_user_date, parse_use... | 3.96875 | 4 |
setup.py | axel-sirota/IEEE-CICD | 0 | 12797994 | <filename>setup.py
from setuptools import setup
setup(name='funniest_ieee',
version='0.5',
description='The funniest_ieee joke in the world',
url='https://github.com/axel-sirota/IEEE-CICD',
author='<NAME>',
author_email='<EMAIL>',
license='MIT',
KEYWORDS = ["class", "attribute... | 1.226563 | 1 |
Python/sum.py | AbdalrohmanGitHub/Logik | 13 | 12797995 | <gh_stars>10-100
# This program reads a number n and computes the sum 1 + 2 + ... + n.
n = input('Type a natural number and press return: ')
n = int(n)
s = { i for i in range(1, n+1) }
s = sum(s)
print('The sum 1 + 2 + ... + ', n, ' is equal to ', s, '.', sep= '')
| 3.875 | 4 |
enrollment/views/__init__.py | Siikakala/kompassi | 0 | 12797996 | <reponame>Siikakala/kompassi
# encoding: utf-8
from .enrollment_event_box_context import enrollment_event_box_context
from .enrollment_enroll_view import enrollment_enroll_view
from .enrollment_admin_view import enrollment_admin_view
from .enrollment_admin_special_diets_view import enrollment_admin_special_diets_vie... | 0.847656 | 1 |
environments/metaworld/reach_ml1.py | bryanoliveira/varibad | 0 | 12797997 | import numpy as np
import gym
from random import randint
from metaworld.benchmarks import ML1
class ReachML1Env(gym.Env):
def __init__(self, max_episode_steps=150,out_of_distribution=False, n_train_tasks=50, n_test_tasks=10, **kwargs):
super(ReachML1Env, self).__init__()
self.train_env = ML1.get_t... | 2.46875 | 2 |
day20.py | hubbardgary/AdventOfCode | 0 | 12797998 | # --- Day 20: Infinite Elves and Infinite Houses ---
#
# To keep the Elves busy, Santa has them deliver some presents by hand, door-to-door. He sends them down a street with
# infinite houses numbered sequentially: 1, 2, 3, 4, 5, and so on.
#
# Each Elf is assigned a number, too, and delivers presents to houses based o... | 3.875 | 4 |
default.py | aerth/plugin.audio.partymoder | 0 | 12797999 | # partymoder xbmc add-on
# Copyright 2017 aerth <<EMAIL>>
# Released under the terms of the MIT License
import xbmc
xbmc.executebuiltin('xbmc.PlayerControl(Partymode(music)', True)
xbmc.executebuiltin('xbmc.PlayerControl(repeatall)', True)
xbmc.executebuiltin("Action(Fullscreen)", True)
| 1.734375 | 2 |
src/third_party/angle/third_party/glmark2/src/waflib/Tools/dmd.py | goochen/naiveproxy | 2,151 | 12798000 | <reponame>goochen/naiveproxy
#! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
import sys
from waflib.Tools import ar,d
from waflib.Configure import conf
@conf
def find_dmd(conf):
conf.find_program(['dmd','dmd2','ldc'],var='D')
out=conf.cmd_and_lo... | 1.757813 | 2 |
blog/admin.py | sandipsandal/Just-A-Thought | 0 | 12798001 | from django.contrib import admin
from blog.models import Post, BlogComment, Category
# Register your models here.
admin.site.register((BlogComment,)) # it must be in tupple formate
admin.site.register(Category)
@admin.register(Post)
class PostAdmin(admin.ModelAdmin):
class Media:
js = ("tinyInject.js",)
| 1.765625 | 2 |
backend/appengine/routes/subjects/edit.py | MarcosVn/turinginformatica | 0 | 12798002 | <filename>backend/appengine/routes/subjects/edit.py
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from google.appengine.ext import ndb
from course.course_model import Subject, Course
from config.template_middleware import TemplateResponse
from gaecookie.decorator import no_csrf
from g... | 2.234375 | 2 |
code/Algorithms/RandomChoice.py | BogyMitutoyoCTL/Snake-AI-2021.1 | 0 | 12798003 | <filename>code/Algorithms/RandomChoice.py
from random import random
from Algorithms.Algorithms import Algorithm
from GameData import GameData
class RandomChoice(Algorithm):
def __init__(self):
super().__init__()
"""
A stupid algorithm that returns a random value.
This can be used for comparis... | 3.71875 | 4 |
network/revsh/revsrv.py | dogoncouch/dogoncouch-misc | 3 | 12798004 | #!/usr/bin/env python3
# MIT License
#
# Copyright (c) 2018 <NAME> (<EMAIL>)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
... | 1.953125 | 2 |
testing/test_GitWrapper_committing.py | jkpubsrc/python-module-jk-git | 0 | 12798005 | <filename>testing/test_GitWrapper_committing.py
#!/usr/bin/python3
import os
import typing
import tempfile
import jk_json
import jk_logging
import jk_typing
import jk_git
from TestHelper import TestHelper
with jk_logging.wrapMain() as log:
with TestHelper(log) as th:
th.createRepository(log)
th.createS... | 2.609375 | 3 |
src/urh/ui/ui_analysis_frame.py | awesome-archive/urh | 1 | 12798006 | <filename>src/urh/ui/ui_analysis_frame.py
# -*- coding: utf-8 -*-
#
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_FAnalysis(object):
def setupUi(self, FAnalysis):
FAnalysis.setObjectName("FAnalysis")
FAnalysis.resize(1372, 907)
... | 2.015625 | 2 |
view_all_videos.py | ethall/LED-Timeline | 1 | 12798007 | <filename>view_all_videos.py
import os
import cv2 as cv
from _util import Scrubber, get_frames
from p01_extract_valid_frames import extract_valid_frames
from p02_denoise import denoise
from p03_gray import to_grayscale
from p04_diff import to_intensity_difference
if not os.path.exists("target_p01_valid.mp4"):
e... | 2.765625 | 3 |
slash/core/runnable_test_factory.py | omergertel/slash | 0 | 12798008 | from .metadata import Metadata
class RunnableTestFactory(object):
def __init__(self, file_path='', module_name='', factory_name=''):
super(RunnableTestFactory, self).__init__()
self.file_path = file_path
self.module_name = module_name
self.factory_name = factory_name
def gene... | 2.4375 | 2 |
shardingpy/parsing/parser/context/condition.py | hongfuli/sharding-py | 1 | 12798009 | # -*- coding: utf-8 -*-
from collections import OrderedDict, defaultdict
from shardingpy.api.algorithm.sharding.values import ListShardingValue, RangeShardingValue
from shardingpy.constant import ShardingOperator
from shardingpy.exception import UnsupportedOperationException
from shardingpy.parsing.parser.expressionpa... | 2.265625 | 2 |
predict.py | Muxxs/SocialModel | 0 | 12798010 | <filename>predict.py
# coding=utf-8
import tensorflow as tf
import random
def get_data(nums):
import os
x_train = [] # 4*1
y_train = [] # 1*1
for i in range(nums):
NewList = []
for m in list([0, 1, 2, 3]):
NewList.append(random.random() // 0.1)
x_train.append(New... | 2.828125 | 3 |
wowheadquesttracker/helix.py | LairdStreak/MyPyPlayGround | 0 | 12798011 | <gh_stars>0
# Python program to draw
# Spiral Helix Pattern
# using Turtle Programming
import turtle
loadWindow = turtle.Screen()
turtle.speed(2)
for i in range(100):
turtle.circle(5*i)
turtle.circle(-5*i)
turtle.left(i)
turtle.exitonclick() | 3.90625 | 4 |
test/test_huffman.py | fat-crocodile/comression | 1 | 12798012 | import sys
sys.path.insert(0, '../src')
from prefix_code import Encoder, Decoder
from huffman import make_code_symbols as make_code
from bounded_huffman import make_code_symbols as make_ll_code # ll for lenght-limited
class DummyInputStream(object):
def __init__(self, data):
self.data = iter(data)
... | 2.796875 | 3 |
robotice/utils/extensions/comparators/fuzzy/base.py | robotice/robotice | 2 | 12798013 |
import re
import logging
from time import time
from datetime import datetime
from celery.task import task
from celery.execute import send_task
from celery.signals import celeryd_after_setup
from robotice.reactor.tasks import commit_action
from robotice.reasoner.comparators import BaseComparator
logger = logging.ge... | 2.1875 | 2 |
src/model/ca_mtl.py | Daupler/CA-MTL | 0 | 12798014 | import re
import logging
from dataclasses import dataclass, field
from typing import List, Optional
import torch
import torch.nn as nn
from transformers import BertPreTrainedModel
from src.model.decoder import Decoder
from src.model.encoders.bert import _BertEncoder
from src.model.encoders.ca_mtl_base import CaMtlBas... | 2.296875 | 2 |
src/server.py | dashaomai/wx_social_server | 0 | 12798015 | <gh_stars>0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
from flask import Flask, request, redirect, url_for
from writer import parse_sns
UPLOAD_FOLDER = 'uploads'
ALLOWED_EXTENSIONS = set(['json'])
app = Flask(__name__)
app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER
def allowed_file(filename):
return ... | 2.578125 | 3 |
src/setting.py | willyii/CarND-Advanced-Lane-Lines | 0 | 12798016 | <reponame>willyii/CarND-Advanced-Lane-Lines<gh_stars>0
CALIBRATION_PATH = "./param/calibration_param.npz"
| 1.1875 | 1 |
modules/configure/call_server.py | Forcepoint/fp-bd-secure-xmas | 0 | 12798017 | import os
from colorama import Fore, init
# Current file directory details
file = os.path.realpath(__file__)
filedir = os.path.dirname(file)
parentdir = os.path.dirname(filedir)
# Initialise colors for terminal
init()
# Print out header
print(Fore.CYAN + '-' * 13 + Fore.RESET)
print('Call Server')
print(Fore.CYAN + ... | 2.5 | 2 |
core/app/notification/out/free_carrier_messaging.py | EmixMaxime/mx-home-security | 2 | 12798018 | <reponame>EmixMaxime/mx-home-security
from urllib import parse
import requests
from notification.models import UserFreeCarrier
class FreeCarrierMessaging:
def send_message(self, credential: UserFreeCarrier, message, *args):
if message is None:
return
data = {
'user': cr... | 2.453125 | 2 |
openstates/openstates-master/openstates/in/utils.py | Jgorsick/Advocacy_Angular | 0 | 12798019 | import requests
def get_with_increasing_timeout(scraper,link,fail=False,kwargs={}):
#if fail is true, we want to throw an error if we can't
#access the page we need
#if it's false, throw a warning and keep going
timeout_length = 2
html = None
while timeout_length < 65 and html is None:
... | 3.328125 | 3 |
src/guess_combinator_test.py | RasPat1/wordle-world-whirl | 0 | 12798020 | import unittest
from filter import Filter
from differ import Differ
from guess_combinator import GuessCombinator
class TestGuessCombinator(unittest.TestCase):
def test_it_exists(self):
self.assertNotEqual(GuessCombinator(), None)
def test_it_returns_a_best_guess(self):
# solution_unknown
corpus = ["... | 3.078125 | 3 |
tapqir/models/hmm.py | gelles-brandeis/tapqir | 2 | 12798021 | # Copyright Contributors to the Tapqir project.
# SPDX-License-Identifier: Apache-2.0
"""
hmm
^^^
"""
import math
from typing import Union
import torch
import torch.distributions.constraints as constraints
from pyro.distributions.hmm import _logmatmulexp
from pyro.ops.indexing import Vindex
from pyroapi import distr... | 1.78125 | 2 |
ude_gym_bridge/gym_env_remote_runner.py | aws-deepracer/ude-gym-bridge | 1 | 12798022 | <reponame>aws-deepracer/ude-gym-bridge
#################################################################################
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. #
# #
# Licensed under the Apache Licen... | 2.015625 | 2 |
my_credentials/config.py | eurodatacube/edc-my-credentials | 0 | 12798023 | # no config for now
| 1.109375 | 1 |
flask_occam/converters.py | bprinty/Flask-Occam | 2 | 12798024 |
# imports
# -------
import re
from werkzeug.routing import BaseConverter
from werkzeug.exceptions import NotFound
# helpers
# -------
MODELS = dict()
def class_registry(cls):
"""
Function for dynamically getting class
registry dictionary from specified model.
"""
try:
return dict(cls._s... | 2.375 | 2 |
baselines/tm_generation/h_test_model.py | lhf-labs/tm-dataset | 4 | 12798025 | import os
import json
import torch
from transformers import GPT2LMHeadModel, GPT2Tokenizer, AutoTokenizer, GPT2Config
PATH = './models'
OUTPUT_PATH = './output/'
if __name__ == '__main__':
#tokenizer = AutoTokenizer.from_pretrained("./models")
# add the EOS token as PAD token to avoid warnings
#tokenize... | 2.5 | 2 |
Dependencies/pykeyboard/mac.py | CamelBackNotation/hackdfw | 1 | 12798026 | #Copyright 2013 <NAME>
#
#This program is free software: you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation, either version 3 of the License, or
#(at your option) any later version.
#
#This program is distributed in the hope that it ... | 1.65625 | 2 |
python/features/tfeat.py | albutko/vlb | 1 | 12798027 | <gh_stars>1-10
"""
TFeat Implementation
Author: <NAME>
"""
import sys
import os
import torch
from torch import nn
import torch.nn.functional as F
import numpy as np
import cv2
from features.DetectorDescriptorTemplate import DetectorAndDescriptor
import features.feature_utils as utils
dirname = os.path.dirname(__fil... | 1.921875 | 2 |
tests/integration/test_mzml_input.py | Linington-Lab/metabolate- | 1 | 12798028 | <gh_stars>1-10
import os
import tempfile
from pathlib import Path
from zipfile import ZipFile
import shutil
import pandas as pd
import numpy as np
import time
from npanalyst import configuration, cli
from pandas._testing import assert_series_equal
# # Helper functions
def dataframe_assertion(reference_path, test_pa... | 2.296875 | 2 |
axiom/test/strategies.py | opacam/axiom | 23 | 12798029 | """
Hypothesis strategies for generating Axiom-related data.
"""
from epsilon.extime import Time
from hypothesis import strategies as st
from hypothesis.extra.datetime import datetimes
from axiom.attributes import LARGEST_NEGATIVE, LARGEST_POSITIVE
def axiomText(*a, **kw):
"""
Strategy for generating Axiom-... | 2.84375 | 3 |
nets/VGG16.py | SekiroRong/YOLOP | 1 | 12798030 | <reponame>SekiroRong/YOLOP<gh_stars>1-10
# -*- coding = utf-8 -*-
# @Time : 2022/1/8 15:41
# @Author : 戎昱
# @File : VGG16.py
# @Software : PyCharm
# @Contact : <EMAIL>
# @github : https://github.com/SekiroRong
import math
from collections import OrderedDict
import torch
import torch.nn as nn
import torch.n... | 2.3125 | 2 |
Message Bomber/Message Bomber using File.py | SaiAshish-Konchada/Python-Projects-for-Beginners | 5 | 12798031 | # importing the required libraries
import pyautogui, time
# delay to switch windows
time.sleep(10)
# content you want to spam with
f = open("idoc.pub_green-lantern-movie-script.txt", 'r')
# loop to spam
for word in f:
# fetch and type each word from the file
pyautogui.write(word)
# press enter to send the ... | 3.09375 | 3 |
kgcnn/ops/scatter.py | thegodone/gcnn_keras | 47 | 12798032 | import tensorflow as tf
@tf.function
def tensor_scatter_nd_ops_by_name(segment_name, tensor, indices, updates, name=None):
"""Scatter operation chosen by name that pick tensor_scatter_nd functions.
Args:
segment_name (str): Operation to update scattered updates. Either 'sum' or 'min' etc.
ten... | 3.015625 | 3 |
Latest/venv/Lib/site-packages/pyface/wx/shell.py | adamcvj/SatelliteTracker | 1 | 12798033 | <reponame>adamcvj/SatelliteTracker<filename>Latest/venv/Lib/site-packages/pyface/wx/shell.py
#------------------------------------------------------------------------------
# Copyright (c) 2005, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license in... | 1.703125 | 2 |
redteamvillage2021/pie/exploit.py | nhtri2003gmail/ctf-write-ups | 101 | 12798034 | <gh_stars>100-1000
#!/usr/bin/env python3
from pwn import *
binary = context.binary = ELF('./pie')
if args.REMOTE:
p = remote('pwnremote.threatsims.com', 9002)
else:
p = process(binary.path)
p.sendlineafter('?\n','%11$10p%15$10p')
p.recvuntil('command: ')
canary = int(p.recv(10),16)
log.info('canary: ' + hex(cana... | 1.859375 | 2 |
src/data/azure_storage_utils.py | lukk60/RETrends | 0 | 12798035 | # Utility functions to access azure data storage
import json, os
from azure.storage.blob import BlockBlobService, PublicAccess
def load_text_file(containerName, blobName, accountName, accountKey):
'''
load the file specified from azure block blob storage. if the file is not
found return an empty dictiona... | 3.203125 | 3 |
run_tests.py | wsmith323/constantmodel | 2 | 12798036 | <filename>run_tests.py
#!/usr/bin/env python
import os
import subprocess
import sys
def install_dependencies():
print("\nInstalling test dependencies...\n")
try:
subprocess.check_output("pip install -r test_requirements.txt", shell=True,
stderr=subprocess.STDOUT)
e... | 2.0625 | 2 |
booksite/booksite/book/schema.py | LoyalWilliams/bookspider | 39 | 12798037 | <reponame>LoyalWilliams/bookspider<filename>booksite/booksite/book/schema.py
# -*- coding: utf-8 -*-
from graphene import relay, ObjectType, AbstractType
from graphene_django import DjangoObjectType
from graphene_django.filter import DjangoFilterConnectionField
from .models import Book, BookPage
class BookPageNode(D... | 2.15625 | 2 |
_unittests/ut_special/test_tsp_bresenham.py | Jerome-maker/ensae_teaching_cs | 73 | 12798038 | <reponame>Jerome-maker/ensae_teaching_cs<gh_stars>10-100
"""
@brief test log(time=10s)
"""
import unittest
import random
from ensae_teaching_cs.special.tsp_bresenham import draw_line, draw_ellipse
class TestTspBresenham(unittest.TestCase):
def test_bresenham(self):
x, y = 500, 500
for n in ... | 2.875 | 3 |
architecture/editor_manager.py | hkdeman/termineditor | 0 | 12798039 | from curses.textpad import rectangle
import curses
ORIGIN_Y, ORIGIN_X = 5,2
class EditorManager:
def __init__(self,std_scr):
self.std_scr = std_scr
self.height, self.width = self.std_scr.getmaxyx()
self.origin_y, self.origin_x = 5, 2
self.canvas_height, self.canvas_width = self.h... | 2.703125 | 3 |
pybpodapi/com/messaging/debug.py | ckarageorgkaneen/pybpod-api | 1 | 12798040 | # !/usr/bin/python3
# -*- coding: utf-8 -*-
from pybpodapi.com.messaging.base_message import BaseMessage
class DebugMessage(BaseMessage):
""" Information line for things like experiment name , task name, board id, etc. """
MESSAGE_TYPE_ALIAS = "debug"
MESSAGE_COLOR = (200, 200, 200)
| 1.9375 | 2 |
metaphor/tableau/__main__.py | MetaphorData/connectors | 5 | 12798041 | from metaphor.common.cli import cli_main
from .extractor import TableauExtractor
if __name__ == "__main__":
cli_main("Tableau metadata extractor", TableauExtractor)
| 1.140625 | 1 |
generate/generate/tests/__init__.py | flamencist/browser-extensions | 102 | 12798042 | def dummy_config():
return {
'uuid': 'TEST-UUID',
'main': {
'server': 'https://test.forge.io/api/'
}
} | 1.4375 | 1 |
opentutorials_python2/opentutorials_python2/20_Object_and_Module/1_Object_and_Module.py | dongrami0425/Python_OpenCV-Study | 0 | 12798043 | <filename>opentutorials_python2/opentutorials_python2/20_Object_and_Module/1_Object_and_Module.py
# < 객체와 모듈 >
import lib # 모듈을 가져올 때 import 모듈_명
obj = lib.A() # lib라는 모듈의 A클래스에 대한 인스턴스화
print(obj.a())
| 1.914063 | 2 |
mt940_v2.py | bvermeulen/mt940---simple | 0 | 12798044 | #!/usr/bin/env python
import re
import sys
import decimal
from mt940m_v2 import ParseMT940
D = decimal.Decimal
# read and concatenate entire MT940 contents and add '-ABN' to make sure the last record is captured
if len(sys.argv)== 2:
argf = sys.argv[1]
else:
print('please provide a valid MT940 file')
exit... | 2.96875 | 3 |
PokeBot/Load.py | danrneal/PokeBot | 0 | 12798045 | <filename>PokeBot/Load.py
import logging
import json
import sys
from collections import OrderedDict
from .Utilities.GenUtils import get_path
log = logging.getLogger('LoadConfig')
def parse_rules_file(manager, filename):
if str(filename).lower() == 'none':
return
filepath = get_path(filename)
rule... | 2.6875 | 3 |
Labyrint/Agent.py | flikkes/intelligente_agenten | 0 | 12798046 | import sys
import os
import Labyrinth
import time
import threading
class Agent:
num = 0
x = 0
y = 0
labyrinth = None
callback = None
def __init__(self, x, y, labyrinth, callback):
self.num = time.time()*1000
self.x = x
self.y = y
self.labyrinth = labyrinth
... | 3.421875 | 3 |
adaptive_subgraph_collection/find_chains_in_full_KB.py | rajarshd/CBR-SUBG | 7 | 12798047 | <filename>adaptive_subgraph_collection/find_chains_in_full_KB.py<gh_stars>1-10
import os
from collections import defaultdict
from tqdm import tqdm
import pickle
from numpy.random import default_rng
import numpy as np
import argparse
import wandb
rng = default_rng()
from adaptive_subgraph_collection.adaptive_utils impo... | 2.21875 | 2 |
instance_data/problem_printer.py | LuddeWessen/assembly-robot-manager-minizinc | 3 | 12798048 | # MIT License
#
# Copyright (c) 2021 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, di... | 2.296875 | 2 |
src/settings.py | weskleydamasceno/Sorveteria_backend | 0 | 12798049 | #
# Configurações da aplicação
#
import os
from os.path import abspath
DEBUG = True
SECRET_KEY = 'a secret key'
# diretório base
basedir = os.path.abspath(os.path.dirname(__name__))
# diretório base da aplicação
BASE_DIR = basedir
# connection string: mysql://usuario:senha@host/nomedobanco
SQLALCHEMY_DATABASE_URI ... | 2.03125 | 2 |
ds/beis_indicators/utils/geo_utils.py | nestauk/beis-indicators | 4 | 12798050 | <filename>ds/beis_indicators/utils/geo_utils.py
import geopandas as gpd
import os
from urllib.request import urlretrieve
from zipfile import ZipFile
from beis_indicators.utils.nuts_utils import NUTS_INTRODUCED, NUTS_ENFORCED
def get_shape(file_name, path):
'''
Utility function to extract and the shapefile
... | 3.34375 | 3 |