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 |
|---|---|---|---|---|---|---|
xv_leak_tools/network/linux/network_services.py | UAEKondaya1/expressvpn_leak_testing | 219 | 52100 | <reponame>UAEKondaya1/expressvpn_leak_testing
import ctypes
import netifaces
import NetworkManager # pylint: disable=import-error
from xv_leak_tools.exception import XVEx
from xv_leak_tools.log import L
from xv_leak_tools.process import check_subprocess
class _NetworkObject:
def __init__(self, conn):
sel... | 2.265625 | 2 |
nodenet/python/nodenet/utilities/commons.py | NOOXY-research/NodeNet | 2 | 52101 | # nodenet/utilities/commons.py
# Description:
# "commons.py" provide commons utilities that can be use widely.
# Copyright 2018 NOOXY. All Rights Reserved.
from nodenet.imports.commons import *
import numpy as np2
# np2 for cupy compabable
def cut_dataset_by_ratio_ramdom(datasets, cut_ratio = 0.1):
dimension = le... | 2.1875 | 2 |
conf.py | davidbau/getting-started | 22 | 52102 | """
Configuration file for the Sphinx documentation builder.
This file only contains a selection of the most common options. For a full
list see the documentation:
http://www.sphinx-doc.org/en/master/config
"""
# pylint: disable=import-error, invalid-name, redefined-builtin
import datetime as dt
import sphinx_rtd_th... | 1.523438 | 2 |
tests/errors/semantic/non_blocking/PYCCEL_RESTRICTION_LIST_COMPREHENSION_LIMITS.py | dina-fouad/pyccel | 206 | 52103 | # pylint: disable=missing-function-docstring, missing-module-docstring/
a = [i*j for i in range(1,3) for j in range(1,4) for k in range(i,j)]
n = 5
a = [i*j for i in range(1,n) for j in range(1,4) for k in range(i,j)]
| 2.4375 | 2 |
scripts/generate_example.py | binary-is/alcoholnow | 4 | 52104 | <reponame>binary-is/alcoholnow<gh_stars>1-10
#!/usr/bin/env python3
# Generates a FILENAME, named after today (i.e. "2021-01-05.json" with the
# prettified JSON output of the remote store data.
#
# Should be run from the project root.
import os
import requests
import json
from datetime import datetime
DEST_DIR = 'exam... | 2.484375 | 2 |
calendar/tests/base_test.py | threefoldtech/jumpscalex_3bot_packages_archived | 0 | 52105 | <filename>calendar/tests/base_test.py
from unittest import TestCase
from loguru import logger
from uuid import uuid4
from testconfig import config
import requests, subprocess
class BaseTest(TestCase):
LOGGER = logger
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
@staticm... | 2.390625 | 2 |
src/rnn/text_classification_train.py | jorgemf/kaggle_redefining_cancer_treatment | 20 | 52106 | import tensorflow as tf
import csv
import time
from datetime import timedelta
import sys
import numpy as np
from tensorflow.python.training import training_util
from tensorflow.contrib import slim
from tensorflow.python.ops import variables as tf_variables
from ..configuration import *
from .. import trainer, evaluator... | 2.5625 | 3 |
WikidPad.py | dszmaj/wikidpad | 16 | 52107 | <filename>WikidPad.py
import WikidPadStarter
if __name__ == "__main__":
WikidPadStarter.main()
| 1 | 1 |
cosmos/retrieval/retrieval/scripts/build_elastic_index.py | ilmcconnell/Cosmos | 30 | 52108 | import click
from retrieval.elastic_retriever import ElasticRetriever
import os
@click.command()
@click.option('--sections-parquet', type=str, help='', default='')
@click.option('--documents-parquet', type=str, help='', default='')
@click.option('--tables-parquet', type=str, help='', default='')
@click.option('--figur... | 2.25 | 2 |
pycon/schedule/tests/factories.py | azkarmoulana/pycon | 154 | 52109 | <reponame>azkarmoulana/pycon
import factory
import factory.django
from pycon.schedule.models import Session, SessionRole
from symposion.schedule.tests.factories import DayFactory
class SessionFactory(factory.django.DjangoModelFactory):
class Meta:
model = Session
day = factory.SubFactory(DayFactory)... | 1.96875 | 2 |
pyslam/residuals/pose_to_pose_orientation_residual.py | utiasSTARS/pyslam | 70 | 52110 | <reponame>utiasSTARS/pyslam
import numpy as np
class PoseToPoseOrientationResidual:
"""Binary pose-to-pose residual given relative rotation mesurement in SO3."""
def __init__(self, C_2_1_obs, stiffness):
self.C_2_1_obs = C_2_1_obs
self.stiffness = stiffness
self.obstype = type(C_2_1_o... | 2.453125 | 2 |
pypy/interpreter/test/test_raise.py | woodrow/pyoac | 1 | 52111 | import py.test
class AppTestRaise:
def test_arg_as_string(self):
def f():
raise "test"
import warnings
warnings.simplefilter('error', DeprecationWarning)
try:
raises(DeprecationWarning, f)
finally:
warnings.simplefilter('default', Depreca... | 3.109375 | 3 |
Lesson2Number1b_versionpysnmpparamkio.py | blaforest/pynet | 0 | 52112 | #!/usr/bin/env python
import pysnmp
import paramiko
print '\n\nVersion of pysnmp installed:'
print '\n\t', pysnmp.__version__
print '\n\nVersion of paramiko installed:'
print '\n\t', paramiko.__version__
print "\n\n"
| 1.445313 | 1 |
test.py | Tushar-N/attributes-as-operators | 62 | 52113 | import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
import numpy as np
import tqdm
from data import dataset as dset
import torchvision.models as tmodels
import tqdm
from models import models
import os
import itertools
import glob
from utils import utils
import torch.backend... | 2 | 2 |
KDAT/src/modules/uiConnect.py | GavinGL/workspace | 0 | 52114 | <reponame>GavinGL/workspace
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'gui\Connectui.ui'
#
# Created by: PyQt4 UI code generator 4.11.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
... | 1.71875 | 2 |
1. Python/2. Flow of Control/15.print_natural_number.py | theparitoshkumar/Data-Structures-Algorithms-using-python | 1 | 52115 | <reponame>theparitoshkumar/Data-Structures-Algorithms-using-python
"""
Syntax of while Loop
while test_condition:
body of while
"""
#Print first 5 natural numbers using while loop
count = 1
while count <= 5:
print(count)
count += 1
| 4 | 4 |
emplacer.py | permamodel/ILAMB-tools | 0 | 52116 | #!/usr/bin/env python
"""Puts MsTMIP output files in a standardized location for ILAMB.
Examples
--------
Copy all the `ra` files from *transfer* to the appropriate MsTMIP
directories in *MODELS/original* with:
$ python emplacer.py
"""
import os
import shutil
import glob
import string
ILAMB_dir = '/nas/data/ILAMB... | 2.46875 | 2 |
resources/endpoints.py | aliie62/paranuara_planet | 0 | 52117 | # -*- coding: utf-8 -*-
from flask_restful import Api
from resources.person import PersonResource
from resources.company import CompanyResource
#Define app end points
def get_endpoints(app):
api = Api(app)
api.add_resource(PersonResource,'/people','/people/<string:username>')
api.add_resource(CompanyResou... | 2.46875 | 2 |
python/python_examples/matrixDecomposition/decompositionUtilities.py | rrjudd/jvsip | 10 | 52118 | # Notes
# This module not really designed for general purpose use. I wrote this as a study mechanism for
# decomposition algorithms. The codes are not well tested and may be naive.
#
# lapack working notes at http://www.netlib.org/lapack/lawns/
import pyJvsip as pv
def eye(t,n):
"""
Usage: I=eye(t,n)
cre... | 2.828125 | 3 |
tripleo_common_tempest_plugin/services/mistral_client.py | d0ugal/tripleo-common-tempest-plugin | 1 | 52119 | # Copyright 2016 NEC Corporation. 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 applicable law or ... | 1.851563 | 2 |
inspect_data_set.py | maxfrei750/ParticleMixtureAnalysis | 0 | 52120 | <gh_stars>0
import fire
from paddle.custom_types import AnyPath
from paddle.inspection import inspect_dataset
def inspect_catalyst_dataset(subset: str, data_root: AnyPath = "data/complete"):
inspect_dataset(
subset=subset,
data_root=data_root,
do_display_box=False,
do_display_labe... | 2.15625 | 2 |
my_agent_cannonfodder.py | Jy4ng/coderone2020 | 0 | 52121 | <gh_stars>0
'''
ALl this bot does is steal pickups and cling to the opponent.
It is not a very good bot.
'''
import time
import random
import timeit
class agent:
def __init__(self):
pass
# player_state contains: id, ammo, hp, location, reward, power
# game_state contains: tick_n... | 3.28125 | 3 |
src/serverside/signals.py | woernerm/django-serverside | 0 | 52122 | """
This module defines functions that are called on a django signal such as post_migrate.
"""
from serverside import utils
def create_permissions_and_grant_privileges(*args, **kwargs):
"""
Creates database permissions to assign to a user.
Creates django permissions that reflect what a corresponding dat... | 2.484375 | 2 |
speakerbot/speaker_db_plugins/speakerbot_reports.py | akatrevorjay/speakerbot | 2 | 52123 |
def get_lucky_numbers(self):
return self.execute("select lucky_number, count(lucky_number) as occurences, sum(case when outcome < 1 then 1 else 0 end) as negative_outcomes, sum(case when outcome > 1 then 1 else 0 end) as successful_outcomes from wager_history where lucky_number <> 0 group by lucky_number")
def ... | 3.0625 | 3 |
beforeThePackage/cor.py | AkiraDemenech/Postimpressionism | 2 | 52124 | """"""
from scipy import misc
import time
img = 'IMG-20200828-WA0022.'
output0 = img+'..png'
output1 = img+'...png'
img+='jpg'
input0 = misc.imread(img)
input1 = misc.imread(img)
l = input0.shape[0]
c = input1.shape[1]
print('\n %d x %d [%d] \n' %(l, c, (l*c)))
start = time.time()
for x in range(l):
#print(x,end=... | 2.65625 | 3 |
Section 4/2/Bernoulli/Bernoulli.py | marcosherreroa/Aplicaciones-de-los-algoritmos-bandidos | 0 | 52125 |
'''
Bandidos estocásticos: introducción, algoritmos y experimentos
TFG Informática
Sección 4.2
Figura 1
Autor: <NAME>
'''
import random
import sympy.stats as stats
import matplotlib.pyplot as plt
def randomPolicy(n,machines):
chosen = n*[-1]
totalrwd = 0
for i in range(n):
chosen[i] = rando... | 3.359375 | 3 |
cms/models.py | opendream/asip | 0 | 52126 | import re
from datetime import date
import tagging
from ckeditor.fields import RichTextField
from django.core import validators
from django.core.urlresolvers import reverse
from django.db import models
from django.template.defaultfilters import truncatechars
from django.utils import timezone
from django.conf import set... | 1.679688 | 2 |
backend/app/main/controller/contoller.py | miguel-kjh/NameSearcher-WebService | 3 | 52127 | from ..util.NameSearchDto import NameSearchDto
from ..util.envNames import VERSION, UPLOAD_FOLDER, path
from ..service.LogService import updateDelete, saveLog, getByPublicId
from ..service.languageBuilder import LanguageBuilder
from ..service.CreateDocumentHan... | 2.4375 | 2 |
tests/device_registration.py | bmort/tango_scaling_tests | 0 | 52128 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Test Tango device server for use with scaling tests."""
import argparse
import time
import tango
def delete_server():
"""."""
db = tango.Database()
server = 'TestDeviceServer/1'
server_list = list(db.get_server_list(server))
if server in server_... | 2.515625 | 3 |
ighsim.py | antibodyome/igh-simulation | 1 | 52129 | <reponame>antibodyome/igh-simulation
# This checks for:
# CDR3 defined by a regex
# no stops,
# the TVSS motif at the end
# the conserved J motif
import sys
import csv
import re
import numpy
from collections import Counter
from Bio import Seq,SeqIO
from progress.bar import Bar
## Set parameters
# Number of reads
num... | 2.203125 | 2 |
code/Aslak/misc_tools.py | cmip6moap/project01 | 2 | 52130 | # -*- coding: utf-8 -*-
"""
Created on Fri Aug 27 15:16:34 2021
@author: ag
"""
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.patches import Ellipse
import matplotlib.transforms as transforms
import re
def confidence_ellipse(x, y, n_std=1.0, weights=None, ax=None, facecolor='none', **kwargs):
... | 3.359375 | 3 |
File for Lab 7/lab7ex3.py | lifeplay2019/ECOR1051-project | 0 | 52131 | <filename>File for Lab 7/lab7ex3.py
import math
def factorial(n: int) -> int:
""" Return n! for postive values of n.
>>> factorial(1)
1
>>> factorial(2)
2
>>> factorial(3)
6
>>> factorial(4)
24
"""
fact = 1
for i in range(2, n+1):
fact=fact*n... | 4.15625 | 4 |
services/web/project/forms.py | vovoka/booklib_2020 | 2 | 52132 | import re
from flask import request
from flask_wtf import FlaskForm
from flask_wtf.file import FileAllowed, FileField
from wtforms import (HiddenField, IntegerField, SelectField, StringField,
SubmitField, TextAreaField)
from wtforms.validators import (DataRequired, Length, NumberRange, Optional,
... | 2.8125 | 3 |
sql practice/database_practice.py | shamiulshifat/Database_projects_SQL | 0 | 52133 | import sqlite3
connection=sqlite3.connect('customer.db')
cur=connection.cursor()
#create a table
cur.execute(""" CREATE TABLE customers (
first_name text,
last_name text,
email text
)
""")
#commit our command
connection.commit()
#close our connection
connection.close() | 3.734375 | 4 |
jstokens.py | zhongweiy/jsinterpreter | 4 | 52134 | # JavaScript: Numbers & Strings
#
# handling Numbers, Identifiers and Strings in a simpler version.
#
# a JavaScript IDENTIFIER must start with an upper- or
# lower-case character. It can then contain any number of upper- or
# lower-case characters or underscores. Its token.value is the textual
# string of the identifi... | 3.671875 | 4 |
accelerator/__init__.py | michuschenk/accelerator | 0 | 52135 | <gh_stars>0
import logging
import matplotlib.pyplot as plt
from .beam import Beam
from .lattice import Lattice
from .transfer_matrix import TransferMatrix
logger = logging.getLogger(__name__)
logger.addHandler(logging.StreamHandler())
logger.setLevel(logging.DEBUG)
plt.rcParams["figure.facecolor"] = "white"
| 1.929688 | 2 |
users/models.py | shacker/tangelo | 0 | 52136 | from django.contrib.auth.models import AbstractUser
from django.urls import reverse
from django.db import models
class User(AbstractUser):
# First Name and Last Name do not cover all name patterns
name = models.CharField(verbose_name='Name of User', blank=True, max_length=255)
class Meta:
app_la... | 2.578125 | 3 |
docs_parser/docs_parser.py | robert2398/docs_parser | 0 | 52137 | <filename>docs_parser/docs_parser.py
from flask import Flask, Response, jsonify
app = Flask(__name__)
from sklearn.ensemble import RandomForestClassifier
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.externals import joblib
import pickle
#from utils import Preprocessing
class Pre... | 2.78125 | 3 |
hardhat/recipes/check.py | stangelandcl/hardhat | 0 | 52138 | <filename>hardhat/recipes/check.py
import os
import shutil
from .base import GnuRecipe
class CheckRecipe(GnuRecipe):
def __init__(self, *args, **kwargs):
super(CheckRecipe, self).__init__(*args, **kwargs)
self.sha256 = 'f5f50766aa6f8fe5a2df752666ca01a9' \
'50add45079aa06416b8... | 2.296875 | 2 |
source/gameengine/PyDoc/API_intro.py | wycivil08/blendocv | 30 | 52139 | # This is not a real module, it's simply an introductory text.
"""
The Blender Game Engine Python API Reference
============================================
See U{release notes<http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.49/Game_Engine>} for updates, changes and new functionality in the Game Engine Pyt... | 1.960938 | 2 |
api/website_info/apps.py | gpiechnik2/senter | 2 | 52140 | <gh_stars>1-10
from django.apps import AppConfig
class WebsiteInfoConfig(AppConfig):
name = 'website_info'
| 1.289063 | 1 |
cows/pylons/genshi_util.py | cedadev/cows | 2 | 52141 | # BSD Licence
# Copyright (c) 2009, Science & Technology Facilities Council (STFC)
# All rights reserved.
#
# See the LICENSE file in the source distribution of this software for
# the full license text.
"""
Utilities for use with genshi
@author: <NAME>
"""
from genshi import *
class RenameElementFilter(object):
... | 2.484375 | 2 |
backend/django_app/core/api/views/__init__.py | bekurmann/BA_polity | 0 | 52142 | from .politican import PoliticanViewSet
# from .party import
from .parlament import ParlamentViewSet
from .commission import CommissionViewSet
from .fraction import FractionViewSet
from .affair import (AffairAllViewSet, AffairViewSet, AffairDebateViewSet, AffairFileViewSet )
from .session import SessionViewSet
from .m... | 1.210938 | 1 |
npreadtext/tests/generate_big_mixed.py | seberg/npreadtext | 1 | 52143 |
import sys
import numpy as np
rng = np.random.default_rng()
# dt = np.dtype('i,i,i,i,i,i,i,i,i,i,U16,U16,U16,U16,f,f,f,f,f,f,f,f')
nrows = 2000000
filename = 'data/bigmixed.csv'
print("Generating {}".format(filename))
with open(filename, 'w') as f:
for k in range(nrows):
values1 = rng.integers(1, 1000... | 2.46875 | 2 |
cgi-bin/w3-query-res.py | TanyaAdams1/WST | 0 | 52144 | #!/usr/bin/env python
import re
import fcntl
print "Content-type: text/html\n\n"
try:
f = open("../homework/w3/query/w3-query.dat")
fcntl.flock(f, fcntl.DN_ACCESS)
template = "".join(open("../homework/w3/src/table.html").readlines()).split("<!-- insert point-->")
data = ""
lines = f.readlines()
... | 2.703125 | 3 |
publishtimer/elasticsearch_util.py | paragguruji/publishtimer | 0 | 52145 | <gh_stars>0
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 29 14:44:23 2016
@author: <NAME>, <EMAIL>
"""
import os
import datetime
from elasticsearch_dsl.connections import connections
from elasticsearch_dsl import DocType, Date, String
from elasticsearch.connection.http_urllib3 import ConnectionTimeout
CLIENT =... | 2.8125 | 3 |
orange3/Orange/regression/base_regression.py | rgschmitz1/BioDepot-workflow-builder | 54 | 52146 | <reponame>rgschmitz1/BioDepot-workflow-builder
from Orange.base import Learner, Model, SklLearner, SklModel
__all__ = [
"LearnerRegression",
"ModelRegression",
"SklModelRegression",
"SklLearnerRegression",
]
class LearnerRegression(Learner):
learner_adequacy_err_msg = "Continuous class variable e... | 2.328125 | 2 |
code/morphodita-research/embeddings/bert_conllu_embeddings.py | flower-go/DiplomaThesis | 0 | 52147 | #!/usr/bin/env python3
import argparse
import re
import sys
import zipfile
import numpy as np
import bert_wrapper
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("input_conllu", type=str, help="Input CoNLL-U file")
parser.add_argument("output_npz", type=str, help="Output... | 2.515625 | 3 |
week1/ex8.py | zettrider/py_ans_course | 0 | 52148 | #!/usr/bin/env python
from ciscoconfparse import CiscoConfParse
cisco_cfg = CiscoConfParse("cisco_ipsec.txt")
cry_map = cisco_cfg.find_objects(r"^crypto map CRYPTO")
for cr in cry_map:
print cr.text
for child in cr.children:
print child.text
| 2.421875 | 2 |
day_22/second.py | Mizux/adventofcode | 1 | 52149 | <filename>day_22/second.py
#!/usr/bin/env python3.10
from collections import defaultdict
import re
FILE = 'test.txt' # sol: 39769202357779
FILE='input.txt' # sol: 1160303042684776
pattern = re.compile('(on|off) x=([-]?\d+)..([-]?\d+),y=([-]?\d+)..([-]?\d+),z=([-]?\d+)..([-]?\d+)')
def parse_input(file):
rules =... | 3.125 | 3 |
Python/253.py | JWang169/LintCodeJava | 1 | 52150 | # Apr 21
class Solution(object):
def minMeetingRooms(self, intervals):
"""
:type intervals: List[List[int]]
:rtype: int
"""
result = 0
heap = []
count = 0
for start, end in intervals:
heapq.heappush(heap, [start, 1])
... | 3.21875 | 3 |
callbackQuery/main.py | flifloo/teleexit | 1 | 52151 | <gh_stars>1-10
from telegram import Update
from telegram.ext import CallbackContext, CallbackQueryHandler
from callbackQuery.create import create
from callbackQuery.data import data
from callbackQuery.edit import edit
from callbackQuery.new import new
from callbackQuery.reason import reason
from commands.start import ... | 2.28125 | 2 |
myweb/urls.py | npjakiah/blog | 0 | 52152 | from django.conf.urls import url
from django.contrib import admin
from blog.views import *
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^$', home),
url(r'^about/', about),
url(r'^kontak/', kontak),
url(r'^blog/', blog),
]
| 1.632813 | 2 |
dcaeapplib/setup.py | onap/dcaegen2-utils | 2 | 52153 | <filename>dcaeapplib/setup.py
# org.onap.dcae
# ============LICENSE_START====================================================
# Copyright (c) 2018-2019 AT&T Intellectual Property. All rights reserved.
# =============================================================================
# Licensed under the Apache License, Ve... | 1.53125 | 2 |
Object Oriented Programming/creating_our_own_objects.py | elipopovadev/Tournament-Tracker | 0 | 52154 | class PlayerCharacter:
def __init__(self, name, age):
self.name = name
self.age = age
def run(self):
print("run")
return "done"
player1 = PlayerCharacter("Cindy", 50)
player2 = PlayerCharacter("Tom", 20)
print(player1.name)
print(player1.age)
print(player2.name)
print(... | 3.359375 | 3 |
junior/expand_words/reverse.py | waldis-jr-dev/proghub.ru | 0 | 52155 | def Reverse(a):
return ' '.join(map(str, a.split()[::-1])) if not a.isspace() else a
if __name__ == '__main__':
print(Reverse(" "))
| 3.75 | 4 |
app/models/common.py | BasementCat/globalhack7 | 0 | 52156 | <reponame>BasementCat/globalhack7
import re
import sqlalchemy_utils as sau
from werkzeug.security import generate_password_hash, check_password_hash
from flask_login import UserMixin
from flask_babel import lazy_gettext
from app.main import login_manager
from app.lib.storage import upload_file, file_url
import arrow
... | 2.015625 | 2 |
captcha_recog/config.py | VrunArya/Hacktoberfest2021 | 1 | 52157 | <reponame>VrunArya/Hacktoberfest2021
DATA_DIR = "data/captcha_images_v2"
BATCH_SIZE = 8
IMAGE_WIDTH = 300
IMAGE_HEIGHT = 75
NUM_WORKERS = 8
EPOCHS = 200
DEVICE = "cuda"
| 1.007813 | 1 |
fun.py | jeettilva/python | 0 | 52158 | <gh_stars>0
def add(a=12,b=16):
print (a+b)
add()
| 2.78125 | 3 |
profile_collection/startup/csx1/devices/stats_plugin.py | NSLS-II-CSX/xf23id1_profiles | 0 | 52159 | <reponame>NSLS-II-CSX/xf23id1_profiles<filename>profile_collection/startup/csx1/devices/stats_plugin.py
from ophyd import Device, Component as Cpt
from ophyd.areadetector.base import (ADBase, ADComponent as ADCpt, ad_group,
EpicsSignalWithRBV as SignalWithRBV)
from ophyd.areadetecto... | 1.796875 | 2 |
src/draw.py | wcy940418/pytb | 1 | 52160 | <reponame>wcy940418/pytb<filename>src/draw.py
import tensorflow as tf
import constants as c
from constants import layer_boxes, classes
import numpy as np
import sys
import os
import cv2
import colorsys
import boxproc
def draw_rect(image, rectangle, color, thickness=1):
left_top = (int(rectangle[0] * image.shape[1]),... | 2.453125 | 2 |
stepik/programming_on_python/3_4_3_community_solve.py | anklav24/Python-Education | 0 | 52161 | <gh_stars>0
with open('dataset_3363_3.txt') as inf, open('MostPopularWord.txt','w') as ouf:
maxc = 0
s = inf.read().lower().strip().split()
s.sort()
for word in s:
counter = s.count(word)
if counter > maxc:
maxc = counter
result_word = word
ouf.write(result_wo... | 3.078125 | 3 |
codeforces/api/json_objects/judge_protocol.py | ericbrandwein/CodeforcesAPI | 26 | 52162 | """
This module contains classes for representing JudgeProtocol object
For further information visit http://codeforces.com/api/help/objects#Hack
"""
from . import BaseJsonObject
__all__ = ['JudgeProtocol']
class JudgeProtocol(BaseJsonObject):
"""
This class represents JudgeProtocol object
For further... | 2.765625 | 3 |
setup.py | ollyfg/B.AwsCdkParallel | 9 | 52163 | <gh_stars>1-10
from setuptools import setup, find_packages
with open('README.md') as readme_file:
README = readme_file.read()
with open('HISTORY.md') as history_file:
HISTORY = history_file.read()
with open('VERSION') as file:
VERSION = file.read()
VERSION = ''.join(VERSION.split())
setup(
name=... | 1.515625 | 2 |
src/sage/graphs/generators/__init__.py | bopopescu/sage | 5 | 52164 | <gh_stars>1-10
# This file is not empty !
| 0.980469 | 1 |
output/figuresAndTables/abundanceEvolution.py | AndresYague/Snuppat | 0 | 52165 | import sys, math, numpy, struct
import matplotlib.pyplot as plt
class readBinaryModels(object):
'''Class for reading binary models'''
def __init__(self, fil):
'''Initialize'''
super(readBinaryModels, self).__init__()
self.fread = open(fil, "rb")
self.head = None
self.m... | 2.796875 | 3 |
rpi_vidlooper/vidlooper.py | alubbock/rpi-vidlooper | 9 | 52166 | <gh_stars>1-10
#!/usr/bin/python
# Raspberry Pi GPIO-controlled video looper
# Copyright (c) 2019 <NAME>
# License MIT
import RPi.GPIO as GPIO
import os
import sys
from subprocess import Popen, PIPE, call
import time
from threading import Lock
import signal
import argparse
class _GpioParser(argparse.Action):
""... | 2.796875 | 3 |
src/semantic_parsing_with_constrained_lm/configs/calflow_emnlp_camera_ready.py | microsoft/semantic_parsing_with_constrained_lm | 17 | 52167 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
"""This config file is for running experiments for the EMNLP camera ready.
It will generate the following experiments (depending on the value of eval_split and model):
- 200 dev examples
- GPT-3 Constrained Canonical, P = 20
- GPT-3 Constraine... | 1.59375 | 2 |
App/gui/chat.py | Wizard-collab/wizard | 0 | 52168 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'C:\Users\conta\Documents\script\Wizard\App\gui\ui_files\chat.ui'
#
# Created by: PyQt5 UI code generator 5.13.0
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Form(object):
... | 2.03125 | 2 |
manuscript_preparation/correct_vs_original/compare.py | bigghost2054/KIDS | 1 | 52169 | <gh_stars>1-10
import pandas as pd
import sys
# load correct data without inconsistencies
pd_correct = pd.read_csv(
'./hypotheses_confidence_correct.txt',
sep='\t',
names=['Subject', 'Predicate', 'Object', 'Label', 'Probability'])
pd_correct = pd_correct.sort_values(by=['Probability'], ascending=False)
# load pre... | 2.71875 | 3 |
horizon/horizon/dashboards/syspanel/instances/views.py | citrix-openstack/horizon | 2 | 52170 | <reponame>citrix-openstack/horizon
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2011 Nebula, Inc.
#
# Licensed under the Apache License, Version 2... | 1.789063 | 2 |
2020-11/201612226.py | Jeanca64091/CoronavirusML | 0 | 52171 | from sklearn.linear_model import LinearRegression
from sklearn.preprocessing import PolynomialFeatures
from sklearn.metrics import mean_squared_error, r2_score
from sklearn.pipeline import make_pipeline
import matplotlib.pyplot as plt
import numpy as np
import random
#=================================================... | 1.875 | 2 |
python-data-analysis/series/demo1.py | meteor1993/python-learning | 83 | 52172 | <filename>python-data-analysis/series/demo1.py
import numpy as np
import pandas as pd
s = pd.Series(np.random.rand(5), index=['a', 'b', 'c', 'd', 'e'])
print(s)
print(s.index)
s1 = pd.Series(np.random.randn(5))
print(s1)
d = {'b': 1, 'a': 0, 'c': 2}
s2 = pd.Series(d)
print(s2)
s3 = pd.Series(d, index=... | 3.078125 | 3 |
src/githubnavigator/__main__.py | rmk135/github-navigator-application | 5 | 52173 | <filename>src/githubnavigator/__main__.py<gh_stars>1-10
"""Application main module."""
from .application import Application
def main() -> None:
"""Run application."""
application = Application()
application.config.from_yaml('config/config.yml')
application.run()
if __name__ == '__main__':
main(... | 1.570313 | 2 |
common/utils_3dhp.py | paTRICK-swk/P-STMO | 8 | 52174 | <reponame>paTRICK-swk/P-STMO<filename>common/utils_3dhp.py
def mpii_get_sequence_info(subject_id, sequence):
switcher = {
"1 1": [6416,25],
"1 2": [12430,50],
"2 1": [6502,25],
"2 2": [6081,25],
"3 1": [12488,50],
"3 2": [12283,50],
"4 1": [6171,25],
... | 2.109375 | 2 |
frontend_react_crash_course/api-service/api/routers/plots.py | TangJiahui/AC215-Advanced_Practical_Data_Science | 0 | 52175 | import pandas as pd
from fastapi import APIRouter
# Define Router
router = APIRouter()
data_url = "https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv"
data = None
@router.get("/get_data")
async def get_data():
global data
if data is None:
data = pd.read_csv(data_url)... | 2.875 | 3 |
init5/src/users/migrations/0005_user_banned.py | iYoQ/init5 | 0 | 52176 | # Generated by Django 4.0.1 on 2022-01-16 16:36
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0004_user_rating'),
]
operations = [
migrations.AddField(
model_name='user',
name='banned',
fie... | 1.539063 | 2 |
src/loading.py | XPerianer/TestingBackend | 0 | 52177 | <filename>src/loading.py
#
# The MIT License (MIT)
#
# Copyright (c) 2020-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 r... | 1.992188 | 2 |
exercises/other-refactor-techniques/recipes.py | RogueNPC/ACS-4931-Testing-and-Architecture | 0 | 52178 | <filename>exercises/other-refactor-techniques/recipes.py
# by <NAME>
# Extract Class
class FoodInfo:
def __init__(self, name, prep_time, is_veggie, food_type, cuisine, ingredients, recipe):
self.name = name
self.prep_time = prep_time
self.is_veggie = is_veggie
self.food_type = ... | 2.90625 | 3 |
blender/arm/logicnode/animation/LN_get_tilesheet_state.py | onelsonic/armory | 2,583 | 52179 | <gh_stars>1000+
from arm.logicnode.arm_nodes import *
class GetTilesheetStateNode(ArmLogicTreeNode):
"""Returns the information about the current tilesheet of the given object."""
bl_idname = 'LNGetTilesheetStateNode'
bl_label = 'Get Tilesheet State'
arm_version = 1
arm_section = 'tilesheet'
d... | 2.4375 | 2 |
tests/st/probability/distribution/test_poisson.py | GuoSuiming/mindspore | 3,200 | 52180 | # Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 2.15625 | 2 |
capstone/capdb/migrations/0101_auto_20200423_1714.py | rachelaus/capstone | 134 | 52181 | <reponame>rachelaus/capstone<gh_stars>100-1000
# Generated by Django 2.2.11 on 2020-04-23 17:14
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('capdb', '0100_auto_20200410_1755'),
]
operations = [
migrat... | 1.601563 | 2 |
src/cwr/urls.py | kaizer88/moltrandashboad | 0 | 52182 | from django.urls import path
from .views import *
urlpatterns = [
# path('towns', towns, name='towns'),
# path('add_town', edit_town, name='add_town'),
# path('edit_town/<pk>', edit_town, name='edit_town'),
# path('properties', properties, name='properties'),
# path('tenants', tenants, name='tenan... | 1.757813 | 2 |
karte.py | goodmanjonathan/kattis-problems | 0 | 52183 | <filename>karte.py
import sys
def replicate(n, x):
ret = []
for _ in range(n):
ret.append(x)
return ret
line = input()
cards = replicate(53, False)
for i in range(0, len(line), 3):
card_num = int(line[i+1:i+3])
offset = 0
if line[i] == 'P':
pass
elif line[i] == 'K':
... | 3.1875 | 3 |
index.py | I2rys/AnonLeaker | 7 | 52184 | #Dependencies
from googlesearch import search
import sys
#Variables
args = sys.argv
#Main
if len(args) == 1:
print("python index.py <keyword> <amount> <output>")
sys.exit()
if len(args) == 2:
print("Invalid amount.")
sys.exit()
if len(args) == 3:
print("Invalid output.")
sys.exit()
... | 3.375 | 3 |
96_RotaryEncoderExample/rotary_encoder_Final.py | ah3243/blindTransportAid | 0 | 52185 | from RPi import GPIO
from time import sleep
# clk = 17
# dt = 18
sw = 24
clk = 12
dt = 25
GPIO.setmode(GPIO.BCM)
GPIO.setup(clk, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
GPIO.setup(dt, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
GPIO.setup(sw, GPIO.IN, pull_up_down=GPIO.PUD_UP)
counter = 0
clkLastState = GPIO.input(clk)
try:... | 3.125 | 3 |
k1lib/callbacks/shorts.py | 157239n/k1lib | 1 | 52186 | <reponame>157239n/k1lib<gh_stars>1-10
# AUTOGENERATED FILE! PLEASE DON'T EDIT
from .callbacks import Callback, Callbacks, Cbs
import k1lib, os, torch
__all__ = ["Autosave", "DontTrainValid", "InspectLoss", "ModifyLoss", "Cpu", "Cuda",
"DType", "InspectBatch", "ModifyBatch", "InspectOutput", "ModifyOutput",
... | 2.328125 | 2 |
evaluation.py | psp-codes/reduced-decoy-ensemble | 2 | 52187 | <reponame>psp-codes/reduced-decoy-ensemble<gh_stars>1-10
# Developed by: <NAME>
# Calculates and plots lRMSD distance results
# Plots visualization of the ensembles
from modules import io
import configparser as cp
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
# Read configuration file
co... | 1.671875 | 2 |
setup.py | elegantandrogyne/rpi2caster-driver | 0 | 52188 | <reponame>elegantandrogyne/rpi2caster-driver
"""rpi2casterd setup: this software SHOULD be installed on a Raspberry Pi."""
from setuptools import setup
__version__ = '2.5.12'
__author__ = '<NAME>'
__author_email__ = '<EMAIL>'
__github_url__ = 'http://github.com/keriszafir/rpi2casterd'
__dependencies__ = ['gpiozero >= ... | 1.757813 | 2 |
mean_hr_bpm.py | oliviagwynn1/bme590hrm | 0 | 52189 | <filename>mean_hr_bpm.py
def mean_beats(threshold=0.7, voltage_array=None, time_array=None):
"""returns avg_beats
This function calculates the average heart rate.
The function requires the peakutils package to determine the indexes
of every peak in the voltage array. The second line in the function
... | 3.5625 | 4 |
calendar_util/migrations/0001_initial.py | christiankuhl/todolist | 0 | 52190 | <reponame>christiankuhl/todolist<filename>calendar_util/migrations/0001_initial.py
# Generated by Django 2.0.2 on 2018-02-26 22:35
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
depe... | 1.703125 | 2 |
test_filtering.py | oslaksam/Python-CLI-Image-editor | 0 | 52191 | from numpy.testing import assert_equal
from pytest import fixture
from filtering.filtering import *
@fixture
def image():
return read_image('tests/lenna.png')
@fixture
def image_gaussian_blur():
return read_image('tests/lenna_gaussian_blur.png')
@fixture
def image_gray(image):
return np.average(image... | 2.109375 | 2 |
src/fresnel/f_ratio.py | JonNRb/physics506 | 0 | 52192 | <gh_stars>0
txt = None
with open('f_data.txt') as f:
txt = f.read()
lines = [i for i in txt.split('\n') if i]
data = [[int(i.strip()) for i in j.split('\t')] for j in lines]
import math
d2r = lambda ang: ang * math.pi / 180
ratio = lambda ang_2, ang_1: math.sin(d2r(ang_1)) / math.sin(d2r(ang_2))
for point in da... | 2.9375 | 3 |
Dragon/python/dragon/vm/tensorflow/ops/var_scope.py | awesome-archive/Dragon | 0 | 52193 | # ------------------------------------------------------------
# Copyright (c) 2017-present, SeetaTech, Co.,Ltd.
#
# Licensed under the BSD 2-Clause License.
# You should have received a copy of the BSD 2-Clause License
# along with the software. If not, See,
#
# <https://opensource.org/licenses/BSD-2-Clause>
#
# ... | 2.484375 | 2 |
setup.py | carted/processing-text-data | 14 | 52194 | <reponame>carted/processing-text-data<gh_stars>10-100
# Copyright (c) Carted.
# All rights reserved.
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
import setuptools
NAME = "processing_text_data"
VERSION = "0.1.0"
REQUIRED_PACKAGES = [
"a... | 1.210938 | 1 |
mutation/Mutation_equal.py | UCLA-SEAL/QDiff | 0 | 52195 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 7/20/20 8:07 PM
# @Author : anonymous
# @File : Mutation_equal.py
#TODO:integrate transformation rules
import re
import random
import mutation.gateCirq_EqualT as MC
import mutation.gateQiskit_EqualT as MQ
import mutation.gatePyQuil_EqualT as MP
def figur... | 2.734375 | 3 |
healthyForce/RunTestSet.py | HypnosPy/HypnosPy | 4 | 52196 | <reponame>HypnosPy/HypnosPy
# -*- coding: utf-8 -*-
# ---
# jupyter:
# jupytext:
# formats: py:light,ipynb
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.7.1
# kernelspec:
# display_name: Python 3
# language: python
... | 2.265625 | 2 |
server_util/resource_manager.py | igushev/fase_lib | 7 | 52197 | import functools
import os
from fase_lib.base_util import singleton_util
TEMPLATE_SYMBOL = '@'
PIXEL_DENSITY_STEP = 0.25
PIXEL_DENSITY_MIN = 0
PIXEL_DENSITY_MAX = 10
@singleton_util.Singleton()
class ResourceManager():
def __init__(self, resource_dir):
self.resource_dir = resource_dir
def GetResourceDir(s... | 2.515625 | 3 |
test/test_chunk.py | jaustin3/resumable.py | 6 | 52198 | <gh_stars>1-10
from mock import Mock, call
import pytest
from resumable.util import Config
from resumable.file import FileChunk
from resumable.chunk import ResumableError, resolve_chunk
TEST_TARGET = 'http://example.com/upload'
TEST_PATH = '/path/to/file.txt'
TEST_CHUNK_SIZE = 100
TEST_FILE_SIZE = 123
MOCK_CHUNK_DAT... | 2.4375 | 2 |
lib/config.py | qvant/stackexchange_bot | 0 | 52199 | <filename>lib/config.py
import codecs
import datetime
import json
from .security import is_password_encrypted, encrypt_password, decrypt_password
from .log import get_logger
from .stats import set_startup
LOG_CONFIG = "config"
CONFIG_PARAM_LOG_LEVEL = "LOG_LEVEL"
CONFIG_PARAM_DB_PORT = "DB_PORT"
CONFIG_PARAM_DB_NAME ... | 2.15625 | 2 |