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 |
|---|---|---|---|---|---|---|
tests/test_cuda_graph_helpers.py | hpi-epic/gpucsl | 5 | 31800 | <gh_stars>1-10
import cupy as cp
import numpy as np
import pandas as pd
import itertools
import math
import networkx as nx
from gpucsl.pc.kernel_management import get_module
function_names = [
"compact<6,6>",
]
module = get_module("helpers/graph_helpers.cu", function_names, ("-D", "PYTHON_TEST"))
def test_compac... | 2.03125 | 2 |
capsul/engine/module/python.py | servoz/capsul | 5 | 31801 | <filename>capsul/engine/module/python.py<gh_stars>1-10
# -*- coding: utf-8 -*-
''' Python configuration module for CAPSUL
This config module allows the customization of python executable and python path in process execution. It can (as every config module) assign specific config values for different environments (comp... | 2.796875 | 3 |
face.py/DetectFace.py | DNSKT/python | 4 | 31802 | import asyncio
import io
import glob
import os
import sys
import time
import uuid
import requests
from urllib.parse import urlparse
from io import BytesIO
# To install this module, run:
# python -m pip install Pillow
from PIL import Image, ImageDraw
from azure.cognitiveservices.vision.face import FaceClien... | 2.515625 | 3 |
examples/tesselation.py | 2dx/moderngl | 916 | 31803 | <gh_stars>100-1000
#!/usr/bin/env python3
'''Simple example of using tesselation to render a cubic Bézier curve'''
import numpy as np
import moderngl
from ported._example import Example
class Tessellation(Example):
title = "Tessellation"
gl_version = (4, 0)
def __init__(self, **kwargs):
super()... | 2.671875 | 3 |
setup.py | rahul0705/smv | 0 | 31804 | """
author: <NAME>
"""
import setuptools
setuptools.setup(
name="smv",
version="0.1",
packages=setuptools.find_packages(exclude=["tests"]),
author="<NAME>",
author_email="<EMAIL>",
description="It's like scp but for moving",
license="MIT",
test_suite="tests"
)
| 1.398438 | 1 |
py/ssm_report/charts.py | acorg/ssm-report | 0 | 31805 | import logging; module_logger = logging.getLogger(__name__)
from pathlib import Path
# ----------------------------------------------------------------------
def get_chart(virus_type, assay, lab, infix="", chart_dir=Path("merges")):
if virus_type in ["bvic", "byam"]:
vt = virus_type[:2] # virus_type[0] + ... | 2.4375 | 2 |
sciunit/base.py | russelljjarvis/sciun | 1 | 31806 | """The base class for many SciUnit objects."""
import sys
PLATFORM = sys.platform
PYTHON_MAJOR_VERSION = sys.version_info.major
if PYTHON_MAJOR_VERSION < 3: # Python 2
raise Exception('Only Python 3 is supported')
import json, git, pickle, hashlib
import numpy as np
import pandas as pd
from pathlib import Path... | 2.328125 | 2 |
arpym/tools/regularized_payoff.py | dpopadic/arpmRes | 6 | 31807 | <filename>arpym/tools/regularized_payoff.py
# -*- coding: utf-8 -*-"
from numpy import pi, exp, sqrt
from scipy.special import erf
def regularized_payoff(x, k_strk, h, method):
"""For details, see here:
Parameters
----------
x : array, shape (j_,)
k : scalar
method: string
... | 3.09375 | 3 |
functions/solution/functions_numstr_human.py | giserh/book-python | 1 | 31808 | <filename>functions/solution/functions_numstr_human.py
from typing import Union
NUMBER_DICT = {
'0': 'zero',
'1': 'one',
'2': 'two',
'3': 'three',
'4': 'four',
'5': 'five',
'6': 'six',
'7': 'seven',
'8': 'eight',
'9': 'nine',
'.': 'and',
}
def number_to_str(number: Union[i... | 4.09375 | 4 |
cJobObject.py | SkyLined/mWindowsAPI | 7 | 31809 | <filename>cJobObject.py
from mWindowsSDK import *;
from .fbIsValidHandle import fbIsValidHandle;
from .fbLastErrorIs import fbLastErrorIs;
from .fohOpenForProcessIdAndDesiredAccess import fohOpenForProcessIdAndDesiredAccess;
from .fsGetPythonISA import fsGetPythonISA;
from .fThrowLastError import fThrowLastError;
from ... | 1.945313 | 2 |
pyatmos/class_atmos.py | lcx366/ATMOS | 11 | 31810 | class ATMOS(object):
'''
class ATMOS
- attributes:
- self defined
- methods:
- None
'''
def __init__(self,info):
self.info = info
for key in info.keys():
setattr(self, key, info[key])
def __repr__(self):
return 'Instance of class AT... | 3.4375 | 3 |
core/views/directions.py | Egorka96/med-org-portal | 2 | 31811 | import dataclasses
import datetime
import json
import os
import tempfile
from core.excel.directions import DirectionsExcel
from django.conf import settings
from django.contrib import messages
from django.contrib.auth.mixins import PermissionRequiredMixin
from django.core.files import File
from django.shortcuts import ... | 1.890625 | 2 |
problem/10000~19999/17206/17206.py3.py | njw1204/BOJ-AC | 1 | 31812 | <filename>problem/10000~19999/17206/17206.py3.py
t=int(input())
if not (1 <= t <= 100000): exit(-1)
dp=[0]*100001
dp[3]=3
for i in range(4,100001):
if i%3==0 or i%7==0: dp[i]=i
dp[i]+=dp[i-1]
query=[*map(int,input().split())]
if len(query)!=t: exit(-1)
for i in query:
if not (10 <= int(i) <= 80000): exit(... | 2.453125 | 2 |
quantarhei/qm/liouvillespace/heom.py | slamavl/quantarhei | 14 | 31813 | <reponame>slamavl/quantarhei<filename>quantarhei/qm/liouvillespace/heom.py
# -*- coding: utf-8 -*-
"""
Representation of Hierarchical Equations of Motion
"""
import numpy
from ... import REAL, COMPLEX
from ..propagators.dmevolution import DensityMatrixEvolution
from ..hilbertspace.operators import ReducedDensityM... | 1.835938 | 2 |
pyOSA/_OSA_Jupyter.py | gregmoille/InstrumentControl | 3 | 31814 | <gh_stars>1-10
import numpy as np
import threading
import os
import plotly.graph_objects as go
import pandas as pd
import sys
import re
from scipy import constants as cts
from IPython.display import display, HTML
import time
work_dir = os.path.join(os.path.dirname(__file__), '../')
work_dir = os.path.abspath(work_dir)... | 2.0625 | 2 |
tests/timelog.py | cmanley/viewvc | 2 | 31815 |
import time
import profile
from vclib.ccvs import rcsparse
import viewvc
try:
import tparse
except ImportError:
tparse = None
def lines_changed(delta):
idx = 0
added = deleted = 0
while idx < len(delta):
op = delta[idx]
i = delta.find(' ', idx + 1)
j = delta.find('\n', i + 1)
line = int(de... | 2.515625 | 3 |
mysite/ct/migrations/0016_auto_20150626_0301.py | cjlee112/socraticqs2 | 8 | 31816 | from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('ct', '0015_migrate_fsm'),
]
operations = [
migrations.AlterField(
model_name='concept',
name='title',
field=models.CharField(max_length=200),
... | 1.695313 | 2 |
src/pipeline/__init__.py | euranova/DAEMA | 6 | 31817 | """ Contains the pipeline used to test models. """
| 0.96875 | 1 |
import_result.py | IsobelMarguarethe/Bilby-GWTC-1-Analysis-and-Verification | 6 | 31818 | <filename>import_result.py
#!/usr/bin/env python
""" Script to convert a result into the standard format of this directory """
import argparse
import bilby
import numpy as np
# Set a random seed so the resampling is reproducible
np.random.seed(1234)
parser = argparse.ArgumentParser()
parser.add_argument('result', h... | 2.90625 | 3 |
bauer_bsm/bsm/client.py | alkradhazar/test1 | 7 | 31819 | # BSM Python library and command line tool
#
# Copyright (C) 2020 chargeIT mobility GmbH
#
# SPDX-License-Identifier: Apache-2.0
from . import config
from . import md
from . import util as butil
from ..crypto import util as cutil
from ..sunspec.core import client as sclient
from ..sunspec.core import suns
from ..suns... | 1.53125 | 2 |
users/models.py | pnwclw/cyfmazyr | 1 | 31820 | <reponame>pnwclw/cyfmazyr
from django.contrib.auth.models import AbstractUser
from django.db import models
from django.utils import timezone
from django.utils.translation import ugettext as _
from simple_history.models import HistoricalRecords
from phonenumber_field.modelfields import PhoneNumberField
from internals.... | 2.25 | 2 |
google_play_scraper/constants/google_play.py | mrommel/google-play-scraper | 0 | 31821 | from enum import Enum
class Sort(int, Enum):
NEWEST = 2
MOST_RELEVANT = 1
| 2.65625 | 3 |
pystruct/utils/graph.py | dugu9sword/pystruct | 0 | 31822 | import numpy as np
def make_grid_edges(x, neighborhood=4, return_lists=False):
if neighborhood not in [4, 8]:
raise ValueError("neighborhood can only be '4' or '8', got %s" %
repr(neighborhood))
inds = np.arange(x.shape[0] * x.shape[1]).reshape(x.shape[:2])
inds = inds.ast... | 2.71875 | 3 |
Muscollo/Tests/plot_inverse_dynamics.py | chrisdembia/opensim-moco | 2 | 31823 | # -------------------------------------------------------------------------- #
# OpenSim Muscollo: plot_inverse_dynamics.py #
# -------------------------------------------------------------------------- #
# Copyright (c) 2017 Stanford University and the Authors #
# ... | 2.234375 | 2 |
xd/xview3/vessel_length/dataset/__init__.py | smly/xview3-kohei-solution | 2 | 31824 | <reponame>smly/xview3-kohei-solution
from dataclasses import dataclass
from pathlib import Path
import cv2
import numpy as np
import pandas as pd
import torch
from omegaconf import DictConfig
from torch.utils.data import DataLoader, Dataset
from xd.utils.configs import dynamic_load
@dataclass
class XView3DataSource... | 2.390625 | 2 |
master/scripts/paths.py | OPU-Surveillance-System/monitoring | 4 | 31825 | <gh_stars>1-10
"""
Define the environment paths
"""
#Path variables
TEMPLATE_PATH = "/home/scom/documents/opu_surveillance_system/monitoring/master/"
STATIC_PATH = "/home/scom/documents/opu_surveillance_system/monitoring/static/"
| 0.972656 | 1 |
tests/strategies/test_local_strategy.py | gijswobben/customs | 0 | 31826 | from flask.globals import request
import pytest
from flask import Flask
from typing import Dict
from customs import Customs
from customs.exceptions import UnauthorizedException
from customs.strategies import LocalStrategy
def test_local_strategy_initialization_without_customs():
class Local(LocalStrategy):
... | 2.59375 | 3 |
package/spack-omega-h/package.py | ctuning/ck-spack | 1 | 31827 | <filename>package/spack-omega-h/package.py
##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by <NAME>, <EMAIL>, All righ... | 1.507813 | 2 |
core/data.py | mohamadnosratian/Pricer | 0 | 31828 | import TmConv
import time
class Data():
def __init__(self, content):
self.content = content
self.corrent = '-'
self.object = {}
def update(self):
Cp, name = self.content.Update()
if Cp != self.corrent:
self.corrent = Cp
self.object = {
... | 3.078125 | 3 |
src/sage/categories/super_modules.py | LaisRast/sage | 0 | 31829 | r"""
Super modules
"""
#*****************************************************************************
# Copyright (C) 2015 <NAME> <tscrim at ucdavis.edu>
#
# Distributed under the terms of the GNU General Public License (GPL)
# http://www.gnu.org/licenses/
#*******************************************... | 2.109375 | 2 |
emissor/processing/api.py | cltl/GMRCAnnotation | 0 | 31830 | from abc import ABC
from typing import Iterable, Any, Tuple, Mapping
from emissor.persistence import ScenarioStorage
from emissor.persistence.persistence import ScenarioController
from emissor.representation.scenario import Signal, Modality
class DataPreprocessor(ABC):
def preprocess(self):
raise NotImpl... | 2.21875 | 2 |
pseudocode/scratch_code.py | AndrewBeers/DifferentialPrivacy_For_Quotes | 0 | 31831 | from colour import Color
from pprint import pprint
def test_function():
red = Color("red")
green = Color("green")
colors = list(red.range_to(green, 20))
# pprint(colors)
# pprint(dir(colors[0]))
for color in colors:
print(color.get_hex())
return
if __name__ == '__main__':
... | 3 | 3 |
src/ros_libav/common.py | ORANKWON/ros_libav | 0 | 31832 | <reponame>ORANKWON/ros_libav<gh_stars>0
# @Author: <NAME>
# @Date: 2018-07-10T08:20:17-07:00
# @Email: <EMAIL>
# @Project: ros-libav-node
# @Last modified by: jrojas
# @Last modified time: 2018-07-13T17:26:29-07:00
# @License: MIT License
# @Copyright: Copyright @ 2018, <NAME>
import rospy
import av
import av.fil... | 2.203125 | 2 |
zeri_di_funzioni/stima_ordine.py | Ro0t-set/metodi-numerici | 5 | 31833 | # -*- coding: utf-8 -*-
"""
Metodo per la stima dell'ordine
"""
import numpy as np
def stima_ordine(xks,num_iterazioni):
k = num_iterazioni - 3
return np.log(abs(xks[k+2]-xks[k+3])/abs(xks[k+1]-xks[k+2])) / np.log(abs(xks[k+1]-xks[k+2])/abs(xks[k]-xks[k+1])) | 3.4375 | 3 |
src/game_objects/projectiles/projectile.py | ozcer/Project-Ooze | 1 | 31834 | import pygame
from src.game_objects.dynamic import Dynamic
from src.game_objects.foes.foe import Foe
class Projectile(Dynamic):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
def decayable(self):
"""
Overriding decayable in GameObject
:ret... | 2.875 | 3 |
API/app/getLatLng.py | EdmundoSanchezM/Trobify | 0 | 31835 | <reponame>EdmundoSanchezM/Trobify
import requests
import urllib.parse
from bs4 import BeautifulSoup
from geopy.geocoders import Nominatim
def parseCoord (coord):
start = 0
for i in range(0, len(coord)):
if coord[i].isnumeric () or coord[i] == '-' :
start = i
break
coordAsSt... | 3.046875 | 3 |
python/echoserver.py | vesche/snippets | 7 | 31836 | <filename>python/echoserver.py
#!/usr/bin/env python
import socket
import sys
if len(sys.argv) == 2:
port = int(sys.argv[1])
else:
print('Usage: ./echoserver.py <port>')
sys.exit(1)
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind(('127.0.0.1', port))
s.listen(1)
while 1:
client, address... | 3.21875 | 3 |
Py Apple Dynamics V7.3 SRC/PA-Dynamics V7.3/PA_ATTITUDE.py | musen142/py-apple-dynamics | 1 | 31837 | <reponame>musen142/py-apple-dynamics<filename>Py Apple Dynamics V7.3 SRC/PA-Dynamics V7.3/PA_ATTITUDE.py
from math import sin,cos,pi
def cal_ges(PIT,ROL,l,b,w,x,Hc):
YA=0
P=PIT*pi/180
R=ROL*pi/180
Y=YA*pi/180
#腿1
ABl_x=l/2 - x -(l*cos(P)*cos(Y))/2 + (b*cos(P)*sin(Y))/2
ABl_y=w/2 - (b*(cos(R... | 2.171875 | 2 |
src/tau_clients/parsers.py | vmware-samples/tau-clients | 2 | 31838 | <filename>src/tau_clients/parsers.py
# Copyright 2021 VMware, Inc.
# SPDX-License-Identifier: BSD-2
import ipaddress
from typing import Any
from typing import Dict
from typing import Optional
from urllib import parse
import tau_clients
try:
import pymisp
except ImportError:
raise ImportError("This module requ... | 2.734375 | 3 |
HSI_Data_Preparation.py | fjpsxh/CNN_HSIC_MRF | 56 | 31839 | <filename>HSI_Data_Preparation.py<gh_stars>10-100
# -*- coding: utf-8 -*-
"""
Created on Sat Feb 18 16:21:13 2017
@author: <NAME>
This code is modified based on https://github.com/KGPML/Hyperspectral
"""
import scipy.io
import numpy as np
from random import shuffle
import random
import scipy.ndimage
from skimage.util ... | 2.578125 | 3 |
fedml_api/model/linear/har/encoders.py | ziqi-zhang/FedML | 0 | 31840 |
import torch
from torch import nn
from pdb import set_trace as st
def get_encoder(model_type):
model_type = model_type.lower().capitalize()
return eval("{}".format(model_type))
class Cnn1(nn.Module):
def __init__(self, data_size, n_classes):
"""
"""
super(Cnn1, self).__init__()
... | 2.78125 | 3 |
validadores/regras/valor.py | mayronceccon/olist-python-labs-project | 0 | 31841 | <filename>validadores/regras/valor.py
from .regra import Regra
class Valor(Regra):
def __init__(self, valor):
self.__valor = float(valor)
def is_valid(self):
if type(self.__valor) is not float and type(self.__valor) is not int:
raise Exception('Valor inválido')
| 3.640625 | 4 |
src/python/pants/backend/core/tasks/scm_publish.py | hythloday/pants | 11 | 31842 | <filename>src/python/pants/backend/core/tasks/scm_publish.py<gh_stars>10-100
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (nested_scopes, generators, division, absolute_import, with_statement,
... | 2.1875 | 2 |
abc/abc204/b/main.py | tonko2/AtCoder | 2 | 31843 | <reponame>tonko2/AtCoder<gh_stars>1-10
N = int(input())
A = list(map(int, input().split()))
ans = 0
for a in A:
if a > 10:
ans += a - 10
print(ans) | 2.703125 | 3 |
students/K33401/laboratory_works/Egorov_Michil/laboratory_work_2/room/models.py | EgorovM/ITMO_ICT_WebDevelopment_2021-2022 | 0 | 31844 | from django.db import models
class Room(models.Model):
SUBJECTS = (
('math', 'Математика'),
('inf', 'Информатика'),
('othr', 'Другое')
)
SUBJECTS_COLOR = (
('math', '#28a745'),
('inf', '#007bff'),
('othr', '#6c757d')
)
name = models.CharField(max_le... | 2.28125 | 2 |
pytalk/obsolete/message.py | henryz2004/pytalk | 3 | 31845 | <gh_stars>1-10
from pynet import socket_utility
class Message:
"""
Stores a string message and whether or not it is a notification (NTF) or plain message (MSG)
"""
def __init__(self, message):
self.message = message
def prepare(self, max_bytes=None):
return socket_u... | 3.109375 | 3 |
backend/keplerapi/api/migrations/0010_auto_20200627_2003.py | ADSPI/kepler | 2 | 31846 | # Generated by Django 3.0.3 on 2020-06-27 20:03
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0009_auto_20200625_2347'),
]
operations = [
migrations.AlterModelOptions(
name='hiredservice',
options={'orde... | 1.710938 | 2 |
Scripts/ReverseSearch/social_media.py | balswyan/senior-capstone-fall-2018 | 1 | 31847 | <filename>Scripts/ReverseSearch/social_media.py
import urllib2
from cookielib import CookieJar
import os
import re
import time
import json
cookies = CookieJar()
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cookies))
opener.addheaders = [('User-agent', 'Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.17 '
... | 2.953125 | 3 |
Server.py | ReFormationPro/SPSC | 0 | 31848 | <reponame>ReFormationPro/SPSC<filename>Server.py<gh_stars>0
import socket as Socket
import threading as Threading
from pprint import pprint
import Packet
def main():
serverThread = startServer()
#getCommands(serverThread)
print("Goodbye.")
def getCommands(serverThread):
print("Server Commands")
while True:
... | 2.796875 | 3 |
hackerrank/algorithms/general/kangaroo/kangaroo.py | nicklambourne/hackerrank-solutions | 0 | 31849 | <reponame>nicklambourne/hackerrank-solutions
#!/bin/python3
import sys
def kangaroo(x1, v1, x2, v2):
if (x1 < x2 and v1 <= v2) or (x2 < x1 and v2 <= v1):
return "NO"
if ((x2 - x1) % (v2-v1)) == 0:
return "YES"
return "NO"
x1, v1, x2, v2 = input().strip().split(' ')
x1, v1, x2, v2 = [int(x... | 3.9375 | 4 |
plugins/espcms_cms.py | cflq3/getcms | 22 | 31850 | <gh_stars>10-100
#!/usr/bin/env python
# encoding: utf-8
def run(whatweb, pluginname):
whatweb.recog_from_content(pluginname, "espcms")
whatweb.recog_from_file(pluginname, "templates/wap/cn/public/footer.html", "espcms")
| 1.429688 | 1 |
examples/02_current_price.py | sharebook-kr/coinonepy | 2 | 31851 | <filename>examples/02_current_price.py
import coinonepy
btc = coinonepy.get_current_price("btc")
btc_last_price = float(btc['last'])
print(btc_last_price) | 2.828125 | 3 |
tests/techniques/test_train_policy_gradient.py | alphagamatoe/AlphaToe | 172 | 31852 | <filename>tests/techniques/test_train_policy_gradient.py
import functools
from unittest import TestCase
from common.base_game_spec import BaseGameSpec
from common.network_helpers import create_network
from games.tic_tac_toe import TicTacToeGameSpec
from games.tic_tac_toe_x import TicTacToeXGameSpec
from techniques.tra... | 2.671875 | 3 |
paddlespeech/text/speechtask/punctuation_restoration/model/lstm.py | hysunflower/PaddleSpeech | 0 | 31853 | <reponame>hysunflower/PaddleSpeech<gh_stars>0
# Copyright (c) 2021 PaddlePaddle 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/lic... | 2.375 | 2 |
sdk/python/core/tests/test_sanity_augmentation.py | YDK-Solutions/ydk | 125 | 31854 | # ----------------------------------------------------------------
# Copyright 2016 Cisco Systems
#
# 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/LICENS... | 1.820313 | 2 |
src/telem.py | swharden/Telem-A-Gator | 0 | 31855 | <gh_stars>0
import time
import os
import glob
import datetime
import numpy
import threading
import subprocess
#import scipy.stats
from PyQt4 import QtCore, QtGui
import matplotlib
matplotlib.use('TkAgg')
matplotlib.rcParams['backend'] = 'TkAgg'
import pylab
def shortenTo(s,maxsize=100):
if len(s)<=maxsize: retu... | 2.34375 | 2 |
Gathered CTF writeups/2019-10-12-hitcon/lost_key/modulus.py | mihaid-b/CyberSakura | 1 | 31856 | <filename>Gathered CTF writeups/2019-10-12-hitcon/lost_key/modulus.py
import random
from crypto_commons.generic import bytes_to_long, multiply, factor, long_to_bytes
from crypto_commons.netcat.netcat_commons import nc, receive_until_match, receive_until, send
from crypto_commons.rsa.rsa_commons import gcd_multi
def ... | 1.929688 | 2 |
pincer/middleware/ready.py | shivamdurgbuns/Pincer | 0 | 31857 | <reponame>shivamdurgbuns/Pincer
# Copyright Pincer 2021-Present
# Full MIT License can be found in `LICENSE` at the project root.
"""
non-subscription event sent immediately after connecting,
contains server information
"""
from __future__ import annotations
from typing import TYPE_CHECKING
from ..commands import Ch... | 1.875 | 2 |
1177.py | oliveiraeverton/uri | 0 | 31858 | <reponame>oliveiraeverton/uri
vetor = []
entradaUsuario = int(input())
repetir = 1000
indice = 0
adicionar = 0
while(repetir > 0):
vetor.append(adicionar)
adicionar += 1
if(adicionar == entradaUsuario):
adicionar = 0
repetir -= 1
repetir = 1000
while(repetir>0):
repetir -= 1
print("N[{}] = {}".format(i... | 3.09375 | 3 |
conftest.py | RussellJQA/stg-python-webdriver-cert | 4 | 31859 | """
This module implements some pytest fixtures for use with Selenium WebDriver.
"""
import os
import time
import pytest
# pip installed
from dotenv import find_dotenv, load_dotenv
from selenium.webdriver import Chrome
from selenium.webdriver.remote.webdriver import WebDriver
from selenium.webdriver.support.wait impor... | 2.859375 | 3 |
api/lib/datafetcher/DataFetcher.py | NLeRoy917/indcovid | 0 | 31860 | import requests
import time
import pandas
class DataFetcher():
"""
Python interface for the CKAN Indiana Coronavirus Data Site.
URL: https://hub.mph.in.gov/dataset?q=COVID
"""
_session = requests.Session()
_session.headers = {
'application': 'IndCovid.com',
'User-Agent': '<EMAIL>',
'... | 3.4375 | 3 |
pybots/src/audio/vario.py | aivian/robots | 0 | 31861 | <gh_stars>0
from audio.sounds import beep
import numpy as np
import time
class VarioTone(object):
""" A class to make vario sounds
"""
def __init__(self, max_val=5.0):
""" Constructor
Arguments:
max_val: optional (defaults to 5), the saturation vario reading in
meters pe... | 2.9375 | 3 |
design.py | Raj-kar/Shuffle-Game-with-python | 0 | 31862 | from functions import decorate, ascii_text
def rules(): # Some Game rules, first shown at screen !
decorate(" ************************************************************ ")
decorate(" * * ")
decorate(" * Welcome to Word jumbling, Suffl... | 3.984375 | 4 |
Supernova/database/pack.py | Feliconut/PurdueCS324-LSST | 0 | 31863 | from shutil import copy, make_archive, rmtree
from os import mkdir, remove
from os.path import join, exists
from .io import DATA_PATH, fetch_locus
def pack(name, locus_ids, include_alerts=False):
if exists(name + '.zip'):
raise FileExistsError(name + '.zip')
DST_PATH = name + '_temp'
print(f'Creat... | 2.4375 | 2 |
utils/keychain.py | remcoroyen/ShallotNetwork | 0 | 31864 | <reponame>remcoroyen/ShallotNetwork<filename>utils/keychain.py
from Crypto.Util import number
def random_prime(bit_size):
return number.getPrime(bit_size)
def random_int(bit_size):
return number.getRandomInteger(bit_size)
class KeyChain:
def __init__(self):
self.keys = []
self.keyids =... | 3.03125 | 3 |
python3/dec-hexIPformatter.py | 7RU7H/hacking-scripts | 0 | 31865 | """
You can run this in the following format:
For decimal: python3 ip2dh.py D <Ip-address>
For Hexadecimal: python3 ip2dh.py H <Ip-address>
https://gist.github.com/mzfr
"""
#!/usr/bin/python3
import sys
if len(sys.argv) < 3:
print('\nYou must give desired format and IPv4 address as input...')
print('e.g.: D 1... | 3.453125 | 3 |
manage.py | diogenesjusto/flask_leaderboard | 5 | 31866 | <gh_stars>1-10
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_script import Manager
from flask_migrate import Migrate, MigrateCommand
from config import Config
from main import User, Submission
app = Flask(__name__)
# app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///app.db'
app.config.f... | 2.171875 | 2 |
settings.py | brandonivey/alertas | 0 | 31867 | <reponame>brandonivey/alertas
# -*- coding: utf-8 -*-
"""
eve-app settings
"""
# Use the MongoHQ sandbox as our backend.
MONGO_HOST = 'localhost'
MONGO_PORT = 27017
MONGO_USERNAME = ''
MONGO_PASSWORD = ''
MONGO_DBNAME = 'notifications'
# also, correctly set the API entry point
# SERVER_NAME = 'localhost'
# En... | 1.625 | 2 |
pygame_ui/__init__.py | oof6969696969/pygame_ui | 0 | 31868 | from lib.pygame_ui import UIManager, Widgets, Shapes, load_theme
| 1.171875 | 1 |
test/test_Motion/test_ForceMomentSystem.py | henrystoldt/MAPLEAF | 15 | 31869 | <reponame>henrystoldt/MAPLEAF
#Created by: <NAME>
#May 2019
#To run tests:
#In this file: [test_StandardAtmosphere.py]
#In all files in the current directory: [python -m unittest discover]
#Add [-v] for verbose output (displays names of all test functions)
import unittest
from MAPLEAF.Motion import ForceMomentSystem... | 2.734375 | 3 |
rebench/environment.py | tobega/ReBench | 0 | 31870 | import getpass
import os
import subprocess
from cpuinfo import get_cpu_info
from psutil import virtual_memory
try:
from urllib.parse import urlparse
except ImportError:
# Python 2.7
from urlparse import urlparse
def _encode_str(out):
as_string = out.decode('utf-8')
if as_string and as_string[-1... | 2.390625 | 2 |
pipupgrade/cli/__init__.py | codingCoffee/pipupgrade | 0 | 31871 | <gh_stars>0
# imports - compatibility imports
from __future__ import print_function
from pipupgrade._compat import input
# imports - standard imports
import inspect
# imports - module imports
from pipupgrade.cli.parser import get_parsed_args
from pipupgrade.util import get_if_empty, merge_dict
_ACCEPTABLE_YES ... | 2.4375 | 2 |
csv_to_table/urls.py | KariSpace/CRM_Sedicomm | 0 | 31872 | <gh_stars>0
from . import views
from django.contrib.auth import views as auth_views
from django.urls import path
urlpatterns = [ #Kari CSV_TO_TABLE Commit
path('csv_upload/', views.csv_table, name='csv_table'),
path('today/', views.today_table, name='today_table'),
path('search/', views.search, name='se... | 1.453125 | 1 |
tests/test_data_utils.py | claydodo/lineout | 0 | 31873 | from unittest import TestCase
from src.lineout.data import *
class TestDataUtils(TestCase):
def test_get_result_list(self):
sample_list = [{'id': 1, 'name': 'a'}, {'id': 2, 'name': 'b'}]
paginated = {
'count': 2,
'previous': None,
'next': None,
'resu... | 3 | 3 |
tests/core/sdo/tests.py | aceofwings/Cantactular | 3 | 31874 | <filename>tests/core/sdo/tests.py
# import unittest
# import os
# from gateway.can.sdo.message import SdoMessage
# from gateway.can.sdo.message import CommandByte
# class TestSdoMessage(unittest.TestCase):
# def setUp(self):
# self.sdoMessage = SdoMessage.getMessege(0x1018,0x01,0x00)
# self.anotherM... | 2.25 | 2 |
app/views/v2/scan_results.py | TLSInventory/backend | 1 | 31875 | from typing import List
import app.views.v1.misc
import app.db_models as db_models
from . import bp
from flask import request, jsonify
from loguru import logger
import flask_jwt_extended
import app.db_schemas as db_schemas
import app.utils.authentication_utils as authentication_utils
import app.actions as actions
... | 2.375 | 2 |
gameOfLife.py | andrewKv/pythonGraphicsPrograms | 0 | 31876 | <filename>gameOfLife.py
from Graphics import *
CELL_SIZE = 20
ROWS, COLUMNS = 40, 40
class Cell:
def __init__(self, pos):
self.pos = pos
self.alive = False
self.flipNextGen = False
def switch(self):
self.alive = not self.alive
def draw(self, win):
r = Rectangle(Poin... | 3.4375 | 3 |
projecteuler/projectEuler69.py | qingfengxia/python-projecteuler | 0 | 31877 | <reponame>qingfengxia/python-projecteuler
# -*- coding: utf-8 -*-
from __future__ import print_function, unicode_literals, absolute_import, division
"""
Find the value of n ≤ 1,000,000 for which n/φ(n) is a maximum.
"""
from factorization import primefactorize, totient
def problem69():
"""
in fact, ... | 3.734375 | 4 |
games/pathfinder.py | wnormandin/resources | 0 | 31878 | <reponame>wnormandin/resources
#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
import collections
import heapq
class Queue:
""" Basic queue implementation using collections.deque() """
def __init__(self):
self.elements = collections.deque()
def empty(self):
""" Test if queue is empty ""... | 3.546875 | 4 |
7. Trees/binary_euler_tour.py | vivek28111992/data_structure_and_algorithm_in_python_practice | 0 | 31879 | <reponame>vivek28111992/data_structure_and_algorithm_in_python_practice
# Binary Euler Tour
# A Binary Euler Tour base class providing a specialized tour for binary tree.
from eulerTour import EulerTour
class BinaryEulerTour(EulerTour):
"""Abstract base class for performing Euler tour of a binary tree.
This ... | 3.65625 | 4 |
wallet/admin.py | curanetwork/curwallet | 5 | 31880 | <reponame>curanetwork/curwallet<filename>wallet/admin.py
from django.contrib import admin
from base.conf import settings
admin.site.site_title = f'{settings.ICO_TOKEN_NAME} Wallet'
admin.site.site_header = f'{settings.ICO_TOKEN_NAME} Wallet Administration' | 1.195313 | 1 |
shoppinglist/models.py | christiankuhl/foodplanner | 0 | 31881 | <filename>shoppinglist/models.py
from django.db import models
# Create your models here.
class Ingredient(models.Model):
account = models.CharField(max_length=255)
member = models.CharField(max_length=255)
ref_meal = models.CharField(max_length=255,blank=True)
ref_date = models.DateFiel... | 2.46875 | 2 |
ppr-api/tests/unit/models/test_utils.py | pwei1018/ppr | 0 | 31882 | <gh_stars>0
# Copyright © 2019 Province of British Columbia
#
# 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 applicabl... | 2.71875 | 3 |
code.py | ChampLucky/olympic-hero | 0 | 31883 | <filename>code.py<gh_stars>0
# --------------
#Importing header files
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
#Path of the file
data=pd.read_csv(path)
data=data.rename(columns={"Total":"Total_Medals"})
data.head(10) ... | 3.421875 | 3 |
atester/tester.py | guchengxi1994/easy-api-tester | 2 | 31884 | import time
class Tester:
def __init__(self,
url,
api: str = "",
name: str = "",
params: str = "",
filepath: str = "") -> None:
self.url = url
self.api = api
self.name = name
self.params = params
... | 2.875 | 3 |
scripts/A-A/ctsslmate.py | warsocket/recon | 0 | 31885 | <reponame>warsocket/recon
#!/usr/bin/env python
import requests
import sys
domains = set()
for line in sys.stdin:
domain = line.strip()
certs = requests.get("https://certspotter.com/api/v0/certs?domain=%s" % domain).json()
try:
for cert in certs:
for domain in cert["dns_names"]:
... | 2.5 | 2 |
omnibot/services/slack/message.py | troybots/omnibot | 72 | 31886 | <reponame>troybots/omnibot
from omnibot import logging
from omnibot.services import stats
from omnibot.services import slack
from omnibot.services.slack import parser
logger = logging.getLogger(__name__)
class Message(object):
"""
Class for representing a parsed slack message.
"""
def __init__(self,... | 2.5 | 2 |
fixture/_base.py | berpress/MT5WT | 0 | 31887 | <filename>fixture/_base.py<gh_stars>0
import logging
logging.basicConfig(level=logging.INFO)
log = logging.getLogger("WebTerminal")
| 1.382813 | 1 |
ryu/app/DIjkstra_switch_13.py | mgrex97/ryu_competition | 1 | 31888 | <gh_stars>1-10
# coding=utf-8
# Copyright (C) 2011 Nippon Telegraph and Telephone 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.org/licenses/LICENSE-2.... | 1.75 | 2 |
cpo_pipeline/typing/__init__.py | DiDigsDNA/cpo-pipeline | 0 | 31889 | """
typing module
"""
from . import pipeline
from . import parsers
| 1.046875 | 1 |
gmit--exercise03--collatz--code-and-output--20180205d.py | g00364787/52167assessments | 0 | 31890 | <filename>gmit--exercise03--collatz--code-and-output--20180205d.py
# AUTHOR = <NAME>
# DATE = 2018-02-05
# STUDENT ID = G00364787
# EXERCISE 03
#
# filename= gmit--exercise03--collatz--20180205d.py
#
# the Collatz conjecture
print("The COLLATZ CONJECTURE")
# define the variables
num = ""
x = 0
# ... | 3.109375 | 3 |
concon.py | nejucomo/concon | 0 | 31891 | <reponame>nejucomo/concon<filename>concon.py<gh_stars>0
"""
concon (CONstrained CONtainers) provides usefully constrained container
subtypes as well as utilities for defining new constrained subtypes and
append-only dict modification.
There are two flavors of constraints: frozen and appendonly. The former
prevents an... | 2.734375 | 3 |
algorithms/search/tests/student/test_bfs.py | Tebs-Lab/learn-graph-theory | 9 | 31892 | <gh_stars>1-10
from graphs.reference_implementation import DirectedGraph, UndirectedGraph
from algorithms.search.student_implementation import breadth_first_search
def test_start_is_stop():
g = DirectedGraph()
g.add_edge('a', 'b')
g.add_edge('b', 'c')
g.add_edge('b', 'd')
g.add_edge('e', 'f')
... | 3.421875 | 3 |
levelTcricpr.py | scaralbi/dnaplotlib | 0 | 31893 | <gh_stars>0
import math
import dnaplotlib as dpl
import matplotlib.pyplot as plt
from matplotlib import gridspec
from matplotlib.patches import Polygon, Ellipse, Wedge, Circle, PathPatch
from matplotlib.path import Path
from matplotlib.lines import Line2D
from matplotlib.patheffects import Stroke
import matplotlib.patc... | 1.992188 | 2 |
program/convert_ui.py | Addision/ProtoExcelTool | 0 | 31894 | <reponame>Addision/ProtoExcelTool<filename>program/convert_ui.py<gh_stars>0
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
@File : convertUI.py
@Time : 2022/02/28 00:08:31
@Author : felix
@Version : 1.0
@Contact : <EMAIL>
@License : (C)Copyright 2021-2025, felix&lai
@Desc : None
'''
# her... | 2.015625 | 2 |
examples/django_app/sample/views.py | toonarmycaptain/pyflot | 3 | 31895 | import flot
import math
import datetime
from django.views.generic import TemplateView
class HomeView(TemplateView):
template_name = 'home.html'
def get_context_data(self, **kwargs):
xy10 = flot.Series(x=flot.XVariable(points=range(1, 10)),
y=flot.YVariable(points=range(1, 10... | 2.109375 | 2 |
wolfbot/sensors/avg_color.py | sunil3590/TIM | 1 | 31896 | import color_sensor_ISL29125
from time import time
cs = color_sensor_ISL29125.color_senser(1)
if cs.valid_init:
print "Valid color sensor"
else :
print "Color Sensor invalid"
t0 = time()
red_list = []
green_list = []
blue_list = []
for x in range(100):
stat = cs.readStatus()
if "" in stat: #"FLA... | 2.734375 | 3 |
test.py | JohnnyBruh/Repository | 0 | 31897 | print("yaaaay")
input() | 1.8125 | 2 |
getdata.py | krantirk/dash-120million-taxi-app | 103 | 31898 | <reponame>krantirk/dash-120million-taxi-app
import vaex
import os
# Open the main data
taxi_path = 's3://vaex/taxi/yellow_taxi_2012_zones.hdf5?anon=true'
# override the path, e.g. $ export TAXI_PATH=/data/taxi/yellow_taxi_2012_zones.hdf5
taxi_path = os.environ.get('TAXI_PATH', taxi_path)
df_original = vaex.open(taxi_pa... | 2.03125 | 2 |
commitsan/util.py | abusalimov/commitsan | 0 | 31899 | <gh_stars>0
from __future__ import (absolute_import, division,
print_function, unicode_literals)
from builtins import *
def unique(iterable, key=id):
"""
List unique elements, preserving order. Remember all elements ever seen.
"""
return unique_values((key(element), element) fo... | 3.03125 | 3 |