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 |
|---|---|---|---|---|---|---|
CHT/update_het_probs.py | aryam7/WASP | 72 | 12787651 | <filename>CHT/update_het_probs.py
import gzip
import argparse
import math
import sys
from argparse import ArgumentParser
import tables
import util
def parse_options():
parser = ArgumentParser(description="""This script adjusts
heterozygote probabilities in CHT files to account for
... | 2.84375 | 3 |
server.py | mudo121/vizbox | 0 | 12787652 | <filename>server.py<gh_stars>0
#! /usr/bin/env python
import json
import signal
import sys
from socket import error
import time
from tornado.ioloop import IOLoop
from tornado.web import Application, RequestHandler, StaticFileHandler
from tornado.websocket import WebSocketHandler
from backendbase import BackendBase
f... | 2.34375 | 2 |
python/decorator_test.py | walterfan/snippets | 1 | 12787653 | registry = []
def register(func):
print("register function {}".format(func))
registry.append(func)
return func
@register
def hello():
print("hello")
@register
def world():
print("world")
if __name__ == '__main__':
hello()
world()
for func in registry:
print("there is a registered {}".format(func)) | 3.1875 | 3 |
xbot/xsql.py | xinthral/streamlabs | 0 | 12787654 | <reponame>xinthral/streamlabs
"""
SLCB runs on IronPython, those cheeky whores:
https://stackoverflow.com/a/66794423/13825434
"""
try:
import sqlite3
except:
import clr
clr.AddReference("IronPython.SQLite.dll")
clr.AddReference("IronPython.Modules.dll")
finally:
import re
import sqlite3
class D... | 2.53125 | 3 |
CURSO UDEMY/EXERCICIOS/EX008.py | CamilliCerutti/Exercicios-de-Python-curso-em-video | 0 | 12787655 | """
CRIE UMA FUNÇÃO QUE RECEBA 2 NÚMEROS. O PRIMEIRO É UM VALOR E O SEGUNDO UM PERCENTUAL. RETORNE O VALOR DO PRIMEIRO NUMERO SOMADO DO AUMENTO DO PERCENTUAL DO MESMO.
"""
n1 = int(input('Digite um numero: '))
porcentagem = int(input('Digite o percentual: '))
def soma(num = n1, porcento = porcentagem):
valor_des... | 3.71875 | 4 |
parser.py | hrw/fosdem-videos | 4 | 12787656 | <reponame>hrw/fosdem-videos
#!/usr/bin/python3
from datetime import date, datetime
from jinja2 import Environment, FileSystemLoader
import xml.etree.ElementTree as ET
import sys
xml_file = 'xml'
if len(sys.argv) > 1:
xml_file = sys.argv[1]
tree = ET.parse(xml_file)
root = tree.getroot()
talks = []
show_webm = F... | 2.40625 | 2 |
acq4/util/Canvas/items/ImageCanvasItem.py | tropp/ACQ4 | 0 | 12787657 | # -*- coding: utf-8 -*-
from acq4.pyqtgraph.Qt import QtCore, QtGui
from CanvasItem import CanvasItem
import numpy as np
import scipy.ndimage as ndimage
import acq4.pyqtgraph as pg
import acq4.util.DataManager as DataManager
import acq4.util.debug as debug
class ImageCanvasItem(CanvasItem):
def __init__(self, imag... | 2.40625 | 2 |
App.py | goph-R/NodeEditor | 0 | 12787658 | <gh_stars>0
import os
from PySide2.QtCore import QObject, QCoreApplication, QSettings
from PySide2.QtWidgets import QApplication
from MainWindow import MainWindow
from Style import Style
class App(QObject):
def __init__(self, args):
super(App, self).__init__()
QCoreApplication.setO... | 2.265625 | 2 |
app/room/games/fibbing_it.py | hmajid2301/banter-bus-core-api | 0 | 12787659 | from app.game_state.game_state_models import (
FibbingItQuestion,
FibbingItState,
GameState,
NextQuestion,
UpdateQuestionRoundState,
)
from app.player.player_models import Player
from app.room.games.abstract_game import AbstractGame
from app.room.games.exceptions import UnexpectedGameStateType
from ... | 2.265625 | 2 |
sem_seg/train-apollo.py | ahmed-anas/thesis-pointnet | 1 | 12787660 |
import os
# os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
import math
import argparse
import math
import h5py
import numpy as np
import tensorflow as tf
# os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
# tf.logging.set_verbosity(tf.logging.ERROR)
import socket
import sys
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
RO... | 1.96875 | 2 |
utils/img_visual.py | Memoristor/LightWeight-HRRSI | 2 | 12787661 | <reponame>Memoristor/LightWeight-HRRSI<filename>utils/img_visual.py<gh_stars>1-10
# coding=utf-8
# import matplotlib
# matplotlib.use('Agg')
from matplotlib import pyplot as plt, patches
from PIL import Image
import numpy as np
import cv2
__all__ = ['VisualByPlt', 'VisualByCV2']
class VisualByPlt(object):
"""
... | 2.9375 | 3 |
scripts/mut_floydwarshall.py | dew-uff/versioned-prov | 1 | 12787662 | from datetime import datetime
from pprint import pprint
import extensible_provn.view.mutable_prov
import annotations as prov
HIDE = prov.HIDE
SPECIFIC = prov.SPECIFIC
prov.reset_prov("../generated/mutable_prov/")
prov.STATS_VIEW = 1
def time():
return datetime.now().strftime("%Y-%m-%dT%H:%M:%S.%f")
def cond(en... | 2.28125 | 2 |
qlcp21a/JZ_plotting.py | RapidLzj/QLCP21A | 0 | 12787663 | # -*- coding: utf-8 -*-
"""
201901, Dr. <NAME>, Beijing & Xinglong, NAOC
202101-? Dr. <NAME> & Dr./Prof. <NAME>
Light_Curve_Pipeline
v3 (2021A) Upgrade from former version, remove unused code
"""
import numpy as np
import matplotlib
#matplotlib.use('Agg')
from matplotlib import pyplot as plt
from .JZ_... | 1.984375 | 2 |
egg/zoo/visA/callbacks.py | chan0park/EGG | 0 | 12787664 | <reponame>chan0park/EGG<filename>egg/zoo/visA/callbacks.py<gh_stars>0
import math
import warnings
import json
import logging
from typing import Dict, Any, Callable, Optional, List, Union, cast
import torch
from torch.utils.data import DataLoader
import numpy as np
from scipy import stats
from egg.core import Callback... | 1.851563 | 2 |
web/migrations/0008_auto_20160901_1912.py | acuestap/smarttools_test | 0 | 12787665 | <reponame>acuestap/smarttools_test
# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-09-02 00:12
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('web', '0007_auto_20160901_0641'),
]
operations = [... | 1.671875 | 2 |
integration_tests/cfg/ows_test_cfg_bad.py | LiamOSullivan/datacube-ows | 4 | 12787666 | <reponame>LiamOSullivan/datacube-ows<filename>integration_tests/cfg/ows_test_cfg_bad.py
# pylint: skip-file
# This file is part of datacube-ows, part of the Open Data Cube project.
# See https://opendatacube.org for more information.
#
# Copyright (c) 2017-2021 OWS Contributors
# SPDX-License-Identifier: Apache-2.0
#... | 1.921875 | 2 |
tests/unit-tests/test_config_titlefix.py | hazemelraffiee/confluencebuilder | 90 | 12787667 | <filename>tests/unit-tests/test_config_titlefix.py
# -*- coding: utf-8 -*-
"""
:copyright: Copyright 2020-2022 Sphinx Confluence Builder Contributors (AUTHORS)
:license: BSD-2-Clause (LICENSE)
"""
from tests.lib.testcase import ConfluenceTestCase
from tests.lib.testcase import setup_builder
from tests.lib import parse... | 2.09375 | 2 |
ConverString.py | shatheesh171/divide_and_conquer_algos | 0 | 12787668 | def findMinOperation(s1,s2,index1,index2):
if index1==len(s1):
return len(s2)-index2
if index2==len(s2):
return len(s1)-index1
if s1[index1]==s2[index2]:
return findMinOperation(s1,s2,index1+1,index2+1)
else:
insertOp=1+findMinOperation(s1,s2,index1+1,index2)
del... | 3.515625 | 4 |
spylls/hunspell/algo/trie.py | strepon/spylls | 0 | 12787669 | from collections import defaultdict
class Leaf: # pylint: disable=too-few-public-methods,missing-class-docstring
def __init__(self):
self.payloads = []
self.children = defaultdict(Leaf)
class Trie:
"""
`Trie <https://en.wikipedia.org/wiki/Trie>`_ is a data structure for effective pre... | 3.1875 | 3 |
vmprofile/migrations/0007_auto_20160915_1542.py | mattip/vmprof-server | 0 | 12787670 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-09-15 15:42
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import vmprofile.models
import uuid
def forward_func(apps, schema_editor):
RuntimeData = apps.... | 1.882813 | 2 |
scikit/sk_diag_under_and_over_fitting.py | abondar24/deepLearnPython | 1 | 12787671 | <filename>scikit/sk_diag_under_and_over_fitting.py
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn.preprocessing import LabelEncoder
from sklearn.cross_validation import train_test_split
from sklearn.preprocessing import StandardScaler
from sklearn.linear_model import LogisticRegres... | 2.796875 | 3 |
tests/unit/conftest.py | ckornacker/aws-gate | 369 | 12787672 | <reponame>ckornacker/aws-gate
import os
import boto3
import placebo
import pytest
@pytest.fixture(name="session")
def placebo_session(request):
session_kwargs = {"region_name": os.environ.get("AWS_DEFAULT_REGION", "eu-west-1")}
profile_name = os.environ.get("PLACEBO_PROFILE", None)
if profile_name:
... | 1.953125 | 2 |
Classes/Wrappers/BattleLogPlayerEntry.py | Enjoyop/BSDS-V42 | 16 | 12787673 | from Classes.Wrappers.PlayerDisplayData import PlayerDisplayData
class BattleLogPlayerEntry:
def encode(calling_instance, fields):
pass
def decode(calling_instance, fields):
fields["BattleLogEntry"] = {}
fields["BattleLogEntry"]["Unkown1"] = calling_instance.readVInt()
fields["... | 2.8125 | 3 |
source/modules/beeline.py | telegrambotdev/telegram.email.notify | 0 | 12787674 | # -*- coding: utf-8 -*-
"""
Beeline.ru
"""
from html2text import convert
from . import by_subj, NBSP, BUTTONS
MARK_INBOX = 'В Ваш почтовый ящик '
MARK_CLOUD_GO = 'Прослушать сообщение можно в web-интерфейсе управления услугой'
def voice_mail(_subj, text):
"""
voice mail
"""
pos_start = text.index(MAR... | 2.875 | 3 |
pyramid_scaffold/models/mymodel.py | regenalgrant/pyramid_scaffold | 0 | 12787675 | import bcrypt
from sqlalchemy import (
Column,
Index,
Integer,
Unicode,
Date,
)
from .meta import Base
class Entry(Base):
__tablename__ = 'entries'
id = Column(Integer, primary_key=True)
title = Column(Unicode)
body = Column(Unicode)
category = Column(Unicode)
tags = Colum... | 2.28125 | 2 |
p4/pox_module/cs640/vnethandler.py | zhaoyi3264/cs640 | 3 | 12787676 | <gh_stars>1-10
from pox.core import core
import pox.openflow.libopenflow_01 as of
from pox.lib.revent import *
from pox.lib.util import dpidToStr
from pox.lib.util import str_to_bool
from pox.lib.recoco import Timer
from pox.lib.packet import ethernet
import time
import threading
import asyncore
import collections
imp... | 1.921875 | 2 |
frontends/python3/ProgInfo.py | Chengifei/SySSFEs | 1 | 12787677 | <gh_stars>1-10
################################################################################
# Copyright 2017-2018 by <NAME>
#
# 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://... | 1.757813 | 2 |
tests/test_async.py | fruch/rpyc | 0 | 12787678 | import time
from nose.tools import raises
import rpyc
class Test_Async(object):
def __init__(self):
pass
def setup(self):
self.conn = rpyc.classic.connect_thread()
self.a_sleep = rpyc.async(self.conn.modules.time.sleep)
self.a_int = rpyc.async(self.conn.modules.__builtin__.in... | 2.453125 | 2 |
django/bot/users/migrations/0001_initial.py | AngelOnFira/megagame-controller | 0 | 12787679 | # Generated by Django 3.2.8 on 2021-11-20 23:06
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
("players", "0001_initial"),
]
operations = [
migrations.CreateModel(
name="M... | 2 | 2 |
setup.py | gsevla/pyYDL | 0 | 12787680 | <reponame>gsevla/pyYDL<gh_stars>0
import os
from setuptools import setup
with open('README.md') as readme_file:
readme = readme_file.read()
this = os.path.dirname(os.path.realpath(__file__))
def read(name):
with open(os.path.join(this, name)) as f:
return f.read()
setup(
name='pyydl',
versio... | 1.757813 | 2 |
app/tests.py | nevooronni/RideAlong | 1 | 12787681 | from django.test import TestCase
from .models import Driver,Rider,DriverProfile,RiderProfile,RiderReview,DriverReview
class DriverTestClass(TestCase):
'''
test for driver class
'''
def setUp(self):
'''
setup method
'''
self.driver = Driver(first_name = "Neville",last_name = "Oronni",email = "<EMAIL>",phone... | 2.8125 | 3 |
app/resources/drug.py | thehyve/rest_api | 15 | 12787682 | <reponame>thehyve/rest_api
import time
import json
from flask import current_app, request
from flask_restful import abort, Resource
from app.common.response_templates import CTTVResponse
from app.common.results import RawResult
class Drug(Resource):
def get(self, drug_id):
start_time = time.time()
... | 2.484375 | 2 |
general-practice/Exercises solved/w3resource/challenges/challenge2.py | lugabrielbueno/Projeto | 0 | 12787683 | <filename>general-practice/Exercises solved/w3resource/challenges/challenge2.py
# Write a Python program to check if a given positive integer is a power of three
def ispower3(num):
count = 0
for x in range(1000):
if 3**x == num:
count += 1
return count > 0
print(ispower3(9))
print(ispow... | 4.4375 | 4 |
config.py | lok-i/AntennaEvolutionStrategy | 2 | 12787684 | <reponame>lok-i/AntennaEvolutionStrategy
from src.AntennaArray import PatchAntennaArray
from src.PatchTopology import *
import time
# EXPERIMENTE PARAMETERS
PATCH_TOPOLOGY = 'Spiral2'# None
NO_OF_GENERATIONS = 25
NO_OF_PATCHES = 25 # give a perfect square for grid
# ------------------------------------------------... | 2.3125 | 2 |
authlib/deprecate.py | YPCrumble/authlib | 3,172 | 12787685 | import warnings
class AuthlibDeprecationWarning(DeprecationWarning):
pass
warnings.simplefilter('always', AuthlibDeprecationWarning)
def deprecate(message, version=None, link_uid=None, link_file=None):
if version:
message += '\nIt will be compatible before version {}.'.format(version)
if link_... | 2.390625 | 2 |
ansible/roles/cumulus/files/amis.py | Kitware/HPCCloud-deploy | 18 | 12787686 | import boto.ec2
import sys
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('aws_access_key_id')
parser.add_argument('aws_secret_access_key')
parser.add_argument('region')
config = parser.parse_args()
conn = boto.ec2.connect_to_region(config.region,
aws_access_... | 2.46875 | 2 |
myblog/blog_api/models.py | EUGINELETHAL/BLOG-API | 0 | 12787687 | <gh_stars>0
# Create your models here.
# -*- coding: utf-8 -*-
from django.db import models
from django.contrib.auth.models import User
class Category(models.Model):
"""
Defines a blog category
"""
name = models.CharField(max_length=150)
def __str__(self):
return self.name
class Artic... | 2.53125 | 3 |
python/mypython3.py | Georgakopoulos-Sp/Adlr | 1 | 12787688 |
import numpy as np
#import matplotlib.pyplot as plt
# Make sure that caffe is on the python path:
caffe_root = '/home/legolas/CNN_libs/caffe_mike/caffe/python/caffe' # this file is expected to be in {caffe_root}/examples
import sys
sys.path.insert(0, caffe_root + 'python')
import caffe
#net = caffe.Net( net_def_pr... | 2.1875 | 2 |
tools/update-dependencies.py | dfjxs/l2tdevtools | 0 | 12787689 | <filename>tools/update-dependencies.py<gh_stars>0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# pylint: disable=invalid-name
"""Script to update the dependencies in various configuration files."""
from __future__ import unicode_literals
import io
import os
import sys
from l2tdevtools import dependencies
from l2tde... | 2.03125 | 2 |
vagrancy/cli/__init__.py | seeraven/vagrancyCtrl | 0 | 12787690 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2020 by <NAME> <<EMAIL>>
# All rights reserved.
# This file is part of vagrancyCtrl (https://github.com/seeraven/vagrancyCtrl)
# and is released under the "BSD 3-Clause License". Please see the LICENSE file
# that is included as part of this package.
#
"""Command line interface... | 1.859375 | 2 |
daisy_server.py | J-Pai/408DaisyJetson | 1 | 12787691 | <gh_stars>1-10
#!/usr/bin/env python3
from flask import Flask, render_template, Response
from flask_httpauth import HTTPBasicAuth
import argparse
from multiprocessing.managers import SyncManager
from queue import Empty
import io
import base64
import matplotlib.pyplot as plt
from pymongo import MongoClient
MONGODB_URI... | 2.453125 | 2 |
stubs/micropython-esp32-1_13-103/btree.py | RonaldHiemstra/micropython-stubs | 38 | 12787692 | """
Module: 'btree' on esp32 1.13.0-103
"""
# MCU: (sysname='esp32', nodename='esp32', release='1.13.0', version='v1.13-103-gb137d064e on 2020-10-09', machine='ESP32 module (spiram) with ESP32')
# Stubber: 1.3.4
DESC = 2
INCL = 1
def open():
pass
| 1.515625 | 2 |
venv/lib/python2.7/site-packages/jinja/parser.py | mallika2011/Recreating-VLabs-CSO-Experiment | 7 | 12787693 | <reponame>mallika2011/Recreating-VLabs-CSO-Experiment
# -*- coding: utf-8 -*-
"""
jinja.parser
~~~~~~~~~~~~
Implements the template parser.
The Jinja template parser is not a real parser but a combination of the
python compiler package and some postprocessing. The tokens yielded by
the lexer a... | 2.375 | 2 |
Project 16 -- Skin-Cancer-Detection-CNN-Keras/get_dataset.py | Vauke/Deep-Neural-Networks-HealthCare | 2 | 12787694 | <gh_stars>1-10
from download_dataset_subset import download_dataset_subset, validate_image
import re
import os
import shutil
import requests
from os.path import join
from threading import Thread
from PIL import Image
# Required Parameters:
# Specify the current dataset size
size = 13786
# Optional parameters:
# Spec... | 2.78125 | 3 |
DailyProgrammer/DP20130111C.py | DayGitH/Python-Challenges | 2 | 12787695 | """
[01/11/13] Challenge #116 [Hard] Maximum Random Walk
https://www.reddit.com/r/dailyprogrammer/comments/16dbyh/011113_challenge_116_hard_maximum_random_walk/
# [](#HardIcon) *(Hard)*: Maximum Random Walk
Consider the classic random walk: at each step, you have a 1/2 chance of taking a step to the left and a 1/2 ch... | 3.6875 | 4 |
common/sync.py | sefcom/dbling | 9 | 12787696 | # *-* coding: utf-8 *-*
"""Context manager for easily using a pymemcache mutex.
The `acquire_lock` context manager makes it easy to use :mod:`pymemcache` (which
uses memcached) to create a mutex for a certain portion of code. Of course,
this requires the :mod:`pymemcache` library to be installed, which in turn
require... | 2.984375 | 3 |
Dynamic_Programming/coin_1.py | Mayner0220/Programmers | 1 | 12787697 | # https://www.acmicpc.net/problem/2293
n, k = map(int, input().split(" "))
coin = [int(input()) for _ in range(n)]
dp = [0] * (k+1)
dp[0] = 1
for i in coin:
for j in range(i, k+1):
if j-i >= 0:
dp[j] += dp[j-i]
print(dp[k]) | 2.9375 | 3 |
fidelity.py | syedraza2/Variational_Quantum_Embedding | 1 | 12787698 | <reponame>syedraza2/Variational_Quantum_Embedding
"""
Fidelity classifier
===================
Implements the fidelity classifier.
``predict()`` returns the predicted label or continuous output for a new input
``accuracy()`` returns the accuracy on a test set
The 'exact' implementation computes overlap of ket vectors... | 2.578125 | 3 |
engine/src/hopeit/dataobjects/payload.py | pcanto-hopeit/hopeit.engine | 15 | 12787699 | <reponame>pcanto-hopeit/hopeit.engine
"""
Payload tools to serialize and deserialze event payloads and responses, including dataobjects
"""
import json
from typing import Type, Generic, Optional, Union
from dataclasses_jsonschema import ValidationError
from hopeit.dataobjects import EventPayloadType
_ATOMIC_TYPES =... | 1.929688 | 2 |
Sorting/Gnome-Sort.py | harshil2004/Data-Structures-and-Algorithms | 14 | 12787700 | # Python implementation of gnome sort
# This program is a sorting technique which is also called as stupid sort
# Contributed by <NAME>
# github link :https://github.com/amitsat27
# userid : amitsat27
# Gnome sort function which helps to sort the array
def gnomesort(array,size):
# initialising index to 0
index =... | 4.46875 | 4 |
changes/backends/jenkins/generic_builder.py | vault-the/changes | 443 | 12787701 | <reponame>vault-the/changes<gh_stars>100-1000
from __future__ import absolute_import
from flask import current_app
from changes.config import db
from changes.models.snapshot import SnapshotImage
from changes.models.command import FutureCommand
from changes.utils.http import build_internal_uri
from changes.buildsteps.... | 2.125 | 2 |
src/researchhub_case/models.py | ResearchHub/ResearchHub-Backend-Open | 18 | 12787702 | <filename>src/researchhub_case/models.py
# flake8: noqa
from .related_models.researchhub_case_abstract_model import (
AbstractResearchhubCase
)
from .related_models.author_claim_case_model import AuthorClaimCase
| 1.242188 | 1 |
emgineer/__init__.py | mechAneko12/emgineer | 0 | 12787703 | <filename>emgineer/__init__.py
from .emg_decomposition.main import EmgDecomposition
__version__ = '0.1.2'
| 0.96875 | 1 |
tests/settings.py | jarmovanlenthe/django-internationalflavor | 22 | 12787704 | <reponame>jarmovanlenthe/django-internationalflavor<gh_stars>10-100
# -*- coding: utf-8 -*-
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
}
}
INSTALLED_APPS = [
'internationalflavor',
]
import django
if django.VERSION[:2] < (1, 6):
TEST_RUNNER... | 1.515625 | 2 |
adjustments.py | TheWolfA2/cppstyle | 1 | 12787705 | <reponame>TheWolfA2/cppstyle<gh_stars>1-10
def adjust_rme_in_header(self):
# adjust missing RME error if RME is in a #included header file
for filename in self.missing_rme.iterkeys():
extension = filename.split('.')[-1]
if extension == 'cpp':
name = filename.split('.')[0]
... | 2.375 | 2 |
useless_ui/useless_ui.py | laurasiviero/UselessApp | 1 | 12787706 | '''
#*************************************************************************
Useless App:
#*************************************************************************
Description: - useless but hopefully beautiful;
- app that changes its color and themes;
... | 1.5625 | 2 |
examples/deeplearning/reinforcement/handson/chapter3-pyTorch/custommodule.py | sszffz/study | 0 | 12787707 | import torch
import torch.nn as nn
class OurModule(nn.Module):
def __init__(self, num_inputs, num_classes, dropout_prob=0.3):
super().__init__()
self.pipe = nn.Sequential(nn.Linear(num_inputs, 5),
nn.ReLU(),
nn.Linear(5, 20),
... | 3.203125 | 3 |
tf_unet/scripts/radio_util.py | abhineet123/river_ice_segmentation | 10 | 12787708 | <filename>tf_unet/scripts/radio_util.py<gh_stars>1-10
# tf_unet 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.
#
# tf_unet is distrib... | 2.125 | 2 |
src/graphPlot.py | KUTuaNithid/connect4Nithid | 41 | 12787709 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Jul 15 15:16:06 2018
@author: Arpit
"""
import numpy as np
import matplotlib.pyplot as plt
import threading
from settings import charts_folder
class GraphPlot:
lock = threading.Lock()
def __init__(self, name, xCnt=1, yCnt=1, labels=None):
... | 2.453125 | 2 |
test_memory_pytorch_gpu.py | AdidasSuperstar/detr | 0 | 12787710 | <filename>test_memory_pytorch_gpu.py
import argparse
import torch
import torch.nn as nn
import torch.nn.functional as F
parser = argparse.ArgumentParser(description='PyTorch Example')
parser.add_argument('--disable-cuda', action='store_true',
help='Disable CUDA')
args = parser.parse_args()
args.dev... | 2.65625 | 3 |
servicenowpy/servicenowpy/exceptions.py | henriquencmt/servicenowpy | 0 | 12787711 | <gh_stars>0
class StatusCodeError(Exception):
"""Exception used when the status code of a http response is not as expected."""
def __init__(self, message, detail, status):
self.message = message
self.detail = detail
self.status = status
def __str__(self):
return f"\n M... | 3 | 3 |
scanner_window.py | UnicycleDumpTruck/VetRFID | 0 | 12787712 | <gh_stars>0
#!/usr/bin/env python3
"""Subclassing pyglet Window to add behavior."""
from __future__ import annotations
from typing import List, Any
from datetime import datetime
from enum import Enum, auto
from loguru import logger
import pyglet # type: ignore
import files
import epc
import log
RET_SIDE = 200 # Leng... | 2.609375 | 3 |
week9/api/urls.py | yestemir/web | 0 | 12787713 | <reponame>yestemir/web<filename>week9/api/urls.py
from django.urls import path
from api.views import product_list, getproduct, category_list, getcategory, getproductsbycategory
urlpatterns = [
path('products/', product_list),
path('products/<int:product_id>/', getproduct),
path('categories/', category_list... | 1.945313 | 2 |
adopt/views.py | LogstonEducation/TFA-Project-Adopt-A-Pet | 4 | 12787714 | <reponame>LogstonEducation/TFA-Project-Adopt-A-Pet<gh_stars>1-10
from django.http import JsonResponse
from django.shortcuts import get_object_or_404
from django.shortcuts import render
from .models import Pet
from .forms import AdoptRequestForm
def index(request):
pets = Pet.objects.all()
context = {
... | 2.203125 | 2 |
autoscale_cloudroast/test_repo/autoscale/functional/launch_config/test_launch_config_personality.py | codebyravi/otter | 20 | 12787715 | """
Test for launch config's personality validation.
"""
import base64
from test_repo.autoscale.fixtures import AutoscaleFixture
class LaunchConfigPersonalityTest(AutoscaleFixture):
"""
Verify launch config.
"""
def setUp(self):
"""
Create a scaling group.
"""
super(... | 2.75 | 3 |
funcs.py | egehanyorulmaz/bookish-engine | 1 | 12787716 | <reponame>egehanyorulmaz/bookish-engine
from utils import *
from collections import defaultdict
def data_importer(order_number, tao_number, r_number, instance_number):
dat_filename = f'Dataslack_{order_number}orders_Tao{tao_number}R{r_number}_{instance_number}_without_setup.dat'
dat_filepath = f'project_data/... | 2.453125 | 2 |
src/main_cmt.py | Jiangtong-Li/ZHSIR | 8 | 12787717 | import os
import random
import numpy as np
from scipy.spatial.distance import cdist
import cv2
import time
import torch
import torch.distributed as dist
import torch.nn as nn
import torch.nn.functional as F
# import torch.multiprocessing as mp
from torch.utils.data import DataLoader
from torch.optim import Adam, SGD
... | 1.8125 | 2 |
processor/symptoms.py | ohteedee/COVID-19_diagnosing_app | 0 | 12787718 | import pandas as pd
from utils import new_RF_model
# since processing of the symptoms data has several related elements, I deceided to wrap it into a class
# this makes it easier for someone reading the code that all these function address on the synptoms data and has nothing to do with the image data
class ProcessS... | 3.015625 | 3 |
scripts/dec2020_compositional.py | yanzv/indra_world | 3 | 12787719 | import os
import sys
import glob
import tqdm
import pickle
import logging
from indra_world.corpus import Corpus
from indra_world.assembly.operations import *
from indra_world.sources.dart import process_reader_outputs
from indra.pipeline import AssemblyPipeline
logger = logging.getLogger('dec2020_compositional')
HERE ... | 2.125 | 2 |
cam/button/cam.py | davidegaspar/raspi | 1 | 12787720 | #!/usr/bin/python
import os
import time
import RPi.GPIO as GPIO
import subprocess
#import sys
import signal
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
buttonPin = 17
buzzPin = 22
GPIO.setup(buttonPin, GPIO.IN, pull_up_down = GPIO.PUD_DOWN)
GPIO.setup(buzzPin, GPIO.OUT)
GPIO.output(buzzPin, GPIO.LOW)
# Morse
d... | 2.671875 | 3 |
arguments.py | mjlbach/Object-Goal-Navigation | 106 | 12787721 | import argparse
import torch
def get_args():
parser = argparse.ArgumentParser(
description='Goal-Oriented-Semantic-Exploration')
# General Arguments
parser.add_argument('--seed', type=int, default=1,
help='random seed (default: 1)')
parser.add_argument('--auto_gpu_conf... | 2.671875 | 3 |
web/actions/forktools.py | bdeprez/machinaris | 0 | 12787722 | #
# Control of the Forktools configuration and services
#
from flask import Flask, jsonify, abort, request, flash, g
from common.models import alerts as a
from web import app, db, utils
from . import worker as wk
def load_config(farmer, blockchain):
return utils.send_get(farmer, "/configs/tools/"+ blockchain, d... | 1.921875 | 2 |
medios/diarios/infobae.py | miglesias91/dicenlosmedios | 1 | 12787723 | <filename>medios/diarios/infobae.py<gh_stars>1-10
import dateutil
import datetime
import yaml
import feedparser as fp
import newspaper as np
import re
from urllib.request import Request, urlopen
from bs4 import BeautifulSoup as bs
from medios.medio import Medio
from medios.diarios.noticia import Noticia
from medios.d... | 2.765625 | 3 |
nova/tests/functional/integrated_helpers.py | bopopescu/nova-token | 0 | 12787724 | begin_unit
comment|'# Copyright 2011 <NAME>'
nl|'\n'
comment|'# All Rights Reserved.'
nl|'\n'
comment|'#'
nl|'\n'
comment|'# Licensed under the Apache License, Version 2.0 (the "License"); you may'
nl|'\n'
comment|'# not use this file except in compliance with the License. You may obtain'
nl|'\n'
comment|'# a ... | 1.335938 | 1 |
traffic_analysis.py | marwahmanbir/GitHubAPI | 0 | 12787725 | <filename>traffic_analysis.py
from github import Github
import os
from pprint import pprint
from operator import itemgetter
token = os.getenv('GITHUB_TOKEN')
g = Github(token)
repo = g.get_repo("marwahmanbir/OpenEDU")
clones = repo.get_clones_traffic(per="week")
views = repo.get_views_traffic(per="week")
print(f"Repo... | 3.09375 | 3 |
covid_data_handler.py | JakeGT/covid_dashboard | 0 | 12787726 | '''
This module handles the covid API, covid data, key statistics calculations and
scheduling covid updates.
'''
import logging
import sched
import datetime
import time
from re import match
import requests
from uk_covid19 import Cov19API
import uk_covid19
covid_data = {}
national_covid_data = {}
sched... | 3.53125 | 4 |
main.py | LukaszLapaj/pi-hole-lists-backup | 0 | 12787727 | <reponame>LukaszLapaj/pi-hole-lists-backup<gh_stars>0
import json
import os
from urllib import request
from urllib.parse import urlparse
def main():
with open('adlist.json') as json_file:
adlist = json.load(json_file)
for item in adlist:
url_path = urlparse(item["address"]).path
... | 2.71875 | 3 |
mud/events/inspect.py | erwanaubry/alamud_IUT_Escape | 0 | 12787728 | # -*- coding: utf-8 -*-
# Copyright (C) 2014 <NAME>, IUT d'Orléans
#==============================================================================
from .event import Event2
class InspectEvent(Event2):
NAME = "look"
def get_event_templates(self):
return self.object.get_event_templates()
def perfo... | 2.609375 | 3 |
SensorTile/STM32CubeFunctionPack_SENSING1_V4.0.2/Utilities/AI_Ressources/TFlite/ASC/asc_keras_to_tflite_full_int8.py | MahendraSondagar/STMicroelectronics | 0 | 12787729 | #!/usr/bin/env python
# coding: utf-8
# This software component is licensed by ST under BSD 3-Clause license,
# the "License"; You may not use this file except in compliance with the
# License. You may obtain a copy of the License at:
# https://opensource.org/licenses/BSD-3-Clause
... | 2.171875 | 2 |
L1TriggerConfig/L1TConfigProducers/python/L1TMuonEndcapParamsOnline_cfi.py | pasmuss/cmssw | 0 | 12787730 | <reponame>pasmuss/cmssw<gh_stars>0
import FWCore.ParameterSet.Config as cms
#from L1Trigger.L1TMuonEndCap.fakeEmtfParams_cff import *
from CondCore.CondDB.CondDB_cfi import CondDB
CondDB.connect = cms.string('oracle://cms_orcon_prod/CMS_CONDITIONS')
l1emtfparProtodb = cms.ESSource("PoolDBESSource",
CondDB,
... | 1.390625 | 1 |
django_workflow_system/migrations/0005_auto_20210720_0834.py | eikonomega/django-workflow-system | 2 | 12787731 | # Generated by Django 3.1.8 on 2021-07-20 13:34
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
dependencies = [
('django_workflow_system', '0004_auto_20210701_0910'),
]
operations = [
migrations.CreateModel(
... | 1.828125 | 2 |
dtamg_py/extract.py | transparencia-mg/dtamg-py | 0 | 12787732 | <reponame>transparencia-mg/dtamg-py
import click
from dtamg_py.utils import extract
@click.command(name='extract')
@click.option('--resource', '-r', required=True,
help="Recurso a ser extraído")
def extract_cli(resource):
"""
Função responsável pela extração dos dados de tabela específica no banco My... | 2.046875 | 2 |
blog/models.py | Vardancer/django_blog | 0 | 12787733 | <reponame>Vardancer/django_blog
from django.contrib.auth.models import User
from django.db import models
from django.urls import reverse
# Create your models here.
class Article(models.Model):
author = models.ForeignKey(User, on_delete=models.SET(0))
title = models.CharField(max_length=100, help_text="Title"... | 2.375 | 2 |
src/pipeline/preprocessing/paths.py | guyfreund/data_drift_detection | 0 | 12787734 | <reponame>guyfreund/data_drift_detection
import os
# Encoding Mapping
BANK_MARKETING_LABEL_ENCODER_PATH_DEPLOYMENT = os.path.abspath(os.path.join(__file__, "..", "..", "preprocessing", "raw_files", "BanMarketingLabelEncoding.npy"))
GERMAN_CREDIT_LABEL_ENCODER_PATH_DEPLOYMENT = os.path.abspath(os.path.join(__file__, ".... | 2.015625 | 2 |
dag_gettsim/main.py | janosg/dag_gettsim | 3 | 12787735 | <gh_stars>1-10
import inspect
from functools import partial
from inspect import getfullargspec, getmembers
import networkx as nx
import pandas as pd
from dag_gettsim import aggregation, benefits, taxes
def tax_transfer(
baseline_date, data, functions=None, params=None, targets="all", return_dag=False
):
"""... | 2.828125 | 3 |
main.py | OverLoardPro/agency-survey | 0 | 12787736 | import os
import time
breakout=False
crimeseverity=False
crimesevereaction=False
# variables =
# text
# gender
# name
# age
# height
# drunk
print ("Welcome to the test, Citizen.")
time.sleep(1)
print("Today you are applying for a job at the Agency.")
time.sleep(1)
print("By participating in this test, you agree to... | 4.0625 | 4 |
AspectSelection.py | ChenliangLi205/HeterogeneousEmbedding | 1 | 12787737 | # -*- coding: utf-8 -*-
import networkx as nx
import itertools
def is_subset(node_types):
"""Judge if the given aspect is a subset of the Selected ones"""
global Selected_Aspects
nt_set = set(node_types)
for sa in Selected_Aspects:
if nt_set.issubset(sa):
return True
return Fal... | 3.046875 | 3 |
ambari-server/src/main/resources/stacks/HDP/3.0/services/SMARTSENSE/package/scripts/hst_service.py | niuchp/ambari-2.7.3 | 0 | 12787738 | '''
Copyright (c) 2011-2018, Hortonworks Inc. All rights reserved.
Except as expressly permitted in a written agreement between you
or your company and Hortonworks, Inc, any use, reproduction,
modification,
redistribution, sharing, lending or other exploitation
of all or any part of the contents of this file is strict... | 1.382813 | 1 |
job_executor/exceptions.py | seamless-io/seamless-web | 1 | 12787739 | <filename>job_executor/exceptions.py
class ExecutorBuildException(Exception):
PREFIX = "[SEAMLESS BUILD ERROR]"
def __init__(self, message, *args, **kwargs):
message = f"{self.PREFIX} {message}"
super().__init__(message, *args, **kwargs)
| 2.0625 | 2 |
test/test_importing.py | linyc74/qiime2_pipeline | 0 | 12787740 | <filename>test/test_importing.py
from .setup import TestCase
from qiime2_pipeline.importing import ImportFeatureTable, ImportFeatureSequence, ImportTaxonomy
from qiime2_pipeline.exporting import ExportFeatureTable, ExportFeatureSequence
class TestImportFeatureTable(TestCase):
def setUp(self):
self.set_up... | 2.296875 | 2 |
floret_qvec/scripts/export_comparable_vectors.py | adrianeboyd/fasttext-bloom-demo-projects | 0 | 12787741 | import spacy
import typer
from pathlib import Path
def main(
input_vectors: Path, input_model: Path, input_oracle: Path, output_vectors: Path
):
nlp = spacy.load(input_model)
vectors = {}
with open(input_vectors) as fileh:
for line in fileh.readlines():
parts = line.strip().split()... | 2.9375 | 3 |
tests/test_flows.py | danielward27/flowjax | 0 | 12787742 | from flowjax.flows import Flow, RealNVPFlow, NeuralSplineFlow
from flowjax.bijections.utils import Permute
import jax.numpy as jnp
from jax import random
import pytest
def test_Flow():
key = random.PRNGKey(0)
bijection = Permute(jnp.array([2, 1, 0]))
dim = 3
flow = Flow(bijection, dim)
x = flow.sa... | 1.976563 | 2 |
src/1 mac_changer/macchanger-1.py | raminjafary/ethical-hacking | 0 | 12787743 | #!/usr/bin/python
import subprocess
subprocess.call("ifconfig enp2s0 down",shell=True)
subprocess.call("ifconfig enp2s0 hw ether 00:11:22:33:44:55",shell=True)
subprocess.call("ifconfig enp2s0 up",shell=True) | 2.375 | 2 |
preprocessing/get_input_pdb.py | sysu-yanglab/GRASP | 4 | 12787744 | <gh_stars>1-10
#!/usr/bin/python
'''
Usege:
python3 get_input_ph.py --input_fasta='./raw_data/NMR_X-Ray/new75.fa'
--input_ss='./raw_data/NMR_X-Ray/pdball.SS'
--window_size=37
--dataset='pdb'
input: sequences with score
output: top5 and last5 fragments(encode) from each sequence
'''
import ... | 2.578125 | 3 |
djangoroku/djangoroku.py | maen08/djangoroku | 3 | 12787745 | #!/usr/bin/python3
import os
import sys
import subprocess
import logging
import time
from djangoroku.djangoroku.linux import DeployOnLinux
class DjangoHerokuDeploy():
#I: SELECTING OS
os_name = input('Which OS are you using?\n1.Linux\n2.Windows')
if os_name == '1':
DeployOnLinux()
# I:THE DJANG... | 2.578125 | 3 |
liveplotter.py | icns-distributed-cloud/CACHING-efficient-data-crammer | 33 | 12787746 | <reponame>icns-distributed-cloud/CACHING-efficient-data-crammer
# importing libraries
import time
import matplotlib
import numpy as np
import matplotlib.pyplot as plt
matplotlib.use('TkAgg')
plt.style.use('ggplot')
def live_plotter(x_vec, y1_data, line1, identifier='', pause_time=0.1):
if line1 == []:
... | 2.890625 | 3 |
benchmarks/cholesky.py | dbkinghorn/silly-olympiad | 0 | 12787747 |
import numpy as np
from .utils import Timer
def run(size='large', repeats=3 ):
sizes = {'huge': 28000, 'large': 15000, 'small': 6000, 'tiny': 2000, 'test': 2}
n = sizes[size]
A = np.array(np.random.rand(n,n))
A = A@A.T
num_runs = repeats
print('num_runs =', num_runs)
results = []
... | 3.25 | 3 |
swd/stlinkcom.py | gastonfeng/pyswd | 0 | 12787748 | """ST-Link/V2 USB communication"""
import logging as _logging
import usb.core as _usb
import pyswd.swd._log as _log
class StlinkComException(Exception):
"""Exception"""
class StlinkComNotFound(Exception):
"""Exception"""
class StlinkComV2Usb():
"""ST-Link/V2 USB communication class"""
ID_VENDOR =... | 2.421875 | 2 |
WebParser.py | Ted96/Di_Bot | 1 | 12787749 | from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from other import keys_and_strings
def convert_to_cap_greek( s : str ) -> str:
dict_accented_caps = { 'Ό' : 'Ο', 'Ά' : 'Α', 'Ί' : 'Ι', 'Έ' : 'Ε', 'Ύ' : 'Υ', 'Ή' : 'Η', 'Ώ' : 'Ω'}
res = s.upper()
for orig, new in dict_accented_caps.i... | 2.78125 | 3 |
apps/feedback/fields.py | uk-gov-mirror/ministryofjustice.manchester_traffic_offences_pleas | 3 | 12787750 | <filename>apps/feedback/fields.py
from django.utils.translation import ugettext_lazy as _
ERROR_MESSAGES = {
"USED_CALL_CENTRE_REQUIRED":
_("You must tell us if you used the call centre"),
"CALL_CENTRE_SATISFACTION_REQUIRED":
_("Select an option to tell us how satisfied you were with the call c... | 1.992188 | 2 |