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 |
|---|---|---|---|---|---|---|
GT/GT_app/models.py | 10K-Linesofcode/Glowing-Tribble | 0 | 38200 | <filename>GT/GT_app/models.py
from __future__ import unicode_literals
from django.db import models
# Create your models here.
class Topic(models.Model):
top_name= models.CharField(max_length=264,unique=True)
def __str__(self):
return self.top_name
class Webpage(models.Model):
topic=models.Fore... | 2.296875 | 2 |
WaveBlocksND/IOManager.py | raoulbq/WaveBlocksND | 3 | 38201 | <filename>WaveBlocksND/IOManager.py
"""The WaveBlocks Project
This file contains code for serializing simulation data.
@author: <NAME>
@copyright: Copyright (C) 2010, 2011, 2012, 2016 <NAME>
@license: Modified BSD License
"""
import os
import types
import pickle
import json
import six
import h5py as hdf
import numpy... | 2.6875 | 3 |
models/evaluater.py | pfnet-research/step-wise-chemical-synthesis-prediction | 13 | 38202 | <filename>models/evaluater.py
import chainer
from chainer import functions, reporter
import cupy as cp
class FrameworEvaluater(chainer.Chain):
'''
evaluator for each separate part
'''
def __init__(self, g_stop, g_atom, g_pair, g_action):
self.g_stop = g_stop
self.g_atom = g_atom
... | 2.171875 | 2 |
Scripts/domain-db-all-domain-rates.py | colinwalshbrown/CWB_utils | 0 | 38203 | <filename>Scripts/domain-db-all-domain-rates.py<gh_stars>0
#!/usr/bin/env python
import sys
import sqlite3
import matplotlib.pyplot as plt
import numpy as np
def main(args):
if len(args) < 2:
print "usage: domain-db-all-domain-rates.py <db> <species>"
sys.exit(1)
conn = sqlite3.connect(a... | 2.75 | 3 |
spider/conf.py | schoeu/spid | 1 | 38204 | import utils
import os
import json
def getjsondata(path):
if not os.path.isabs(path):
path = os.path.join(os.path.dirname(os.path.realpath(__file__)), path)
f = open(path)
data = json.loads(f.read())
return data
def getconfig():
return getjsondata('./conf.json') | 2.625 | 3 |
rocketbear/orderings.py | wallarelvo/rocketbear | 1 | 38205 | <gh_stars>1-10
import graph
"""
This file contains multiple heuristics that can be used for static and
dynamic variable orderings
"""
class DynamicDomOverDeg(graph.ConstraintGraph):
"""
Dynamic ordering using the pruned domain over the degree
"""
def ordering(self, v):
"""
Returns t... | 3.328125 | 3 |
src/covid_health/transcoding/names/owid.py | ggbaro/covid-health-ita | 3 | 38206 | <filename>src/covid_health/transcoding/names/owid.py
col = {
"owid": {
"Notes": "notes",
"Entity": "entity",
"Date": "time",
"Source URL": "src",
"Source label": "src_lb",
"Cumulative total": "tot_n_tests",
"Daily change in cumulative total": "n_tests",
... | 1.65625 | 2 |
models/sentry.py | m1ojk/nicedoor | 0 | 38207 | import cv2
import time
import logging
class Sentry:
#__face_cascade = cv2.CascadeClassifier('haarcascades/haarcascade_frontalface_default.xml')
__face_cascade = cv2.CascadeClassifier('haarcascades/haarcascade_frontalface_alt.xml')
#__face_cascade = cv2.CascadeClassifier('haarcascades/haarcascade_upperbody.xml')
... | 2.625 | 3 |
train.py | ajitrajasekharan/huggingface_finetune_wrapper | 1 | 38208 | import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score, recall_score, precision_score, f1_score
import torch
from transformers import TrainingArguments, Trainer
from transformers import BertTokenizer, BertForSequenceClassification
from tran... | 2.421875 | 2 |
examples/caseless_example.py | kajuberdut/incase | 0 | 38209 | <filename>examples/caseless_example.py
from incase import Case, Caseless
# Instances of Caseless are strings
example = Caseless("example string")
print(isinstance(example, str))
# True
# By property
print(example.snake)
# example_string
# Or by subscript (string or Case)
print(example["camel"])
# exampleString
prin... | 3.59375 | 4 |
A/A 1030 In Search of an Easy Problem.py | zielman/Codeforces-solutions | 0 | 38210 | # https://codeforces.com/problemset/problem/1030/A
n = int(input())
o = list(map(int, input().split()))
print('HARD' if o.count(1) != 0 else 'EASY') | 3.234375 | 3 |
leetcode/039-Combination-Sum/CombinationSum_001.py | cc13ny/all-in | 1 | 38211 | <reponame>cc13ny/all-in<gh_stars>1-10
class Solution:
# @param {integer[]} candidates
# @param {integer} target
# @return {integer[][]}
def combinationSum(self, candidates, target):
candidates.sort()
return self.combsum(candidates, target)
def combsum(self, nums, target):
if... | 2.765625 | 3 |
diplomacy_research/models/gym/__init__.py | wwongkamjan/dipnet_press | 39 | 38212 | # ==============================================================================
# Copyright 2019 - <NAME>
#
# NOTICE: 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, ... | 1.523438 | 2 |
kik_unofficial/datatypes/xmpp/history.py | TriSerpent/kik-bot-api-unofficial | 120 | 38213 | from bs4 import BeautifulSoup
import time
from kik_unofficial.datatypes.xmpp.base_elements import XMPPElement, XMPPResponse
class Struct:
def __init__(self, **entries):
self.__dict__.update(entries)
class OutgoingAcknowledgement(XMPPElement):
"""
Represents an outgoing acknowledgement ... | 2.375 | 2 |
tests/test_flavor.py | cloudscale-ch/cloudscale-python-sdk | 2 | 38214 | import responses
from cloudscale import (
CLOUDSCALE_API_URL,
Cloudscale,
CloudscaleApiException,
CloudscaleException,
)
FLAVOR_RESP = {
"slug": "flex-2",
"name": "Flex-2",
"vcpu_count": 1,
"memory_gb": 2,
"zones": [{"slug": "rma1"}, {"slug": "lpg1"}],
}
@responses.activate
def te... | 2.265625 | 2 |
cogs/order.py | SilentSerenityy/JDBot | 0 | 38215 | <filename>cogs/order.py
import os, discord, time, async_cse, random, TenGiphPy
from discord.ext import commands
from difflib import SequenceMatcher
from discord.ext.commands.cooldowns import BucketType
tenor_client = TenGiphPy.Tenor(token=os.environ["tenor_key"])
giphy_client = TenGiphPy.Giphy(token=os.environ["giphy_... | 2.328125 | 2 |
gui_pyside6/ejemplo_cuatro/manejo_eventos.py | JuanDuran85/ejemplos_python | 0 | 38216 | # signals (eventos) y slots (metodos que procesan los eventos)
from PySide6.QtWidgets import QApplication, QMainWindow, QPushButton, QWidget, QVBoxLayout, QHBoxLayout, QLabel, QLineEdit, QMessageBox
from PySide6.QtCore import QSize
import sys
class VentanaPrincipal(QMainWindow):
def __init__(self):
super(... | 3.140625 | 3 |
util/format_files.py | tammam1998/PCDet | 0 | 38217 | <reponame>tammam1998/PCDet
from utils import *
from sys import argv
import os
DEFUALT_PATH = os.path.realpath(__file__).replace("/format_files.py", "")
def make_image_dir(to_path, filenames):
""" takes a list of filenames and makes a sample image for each to match kitti format"""
image_dir = os.path.join(to_p... | 3.015625 | 3 |
src/rc_icons.py | lmdu/dockey | 0 | 38218 | <gh_stars>0
# Resource object code (Python 3)
# Created by: object code
# Created by: The Resource Compiler for Qt version 6.3.0
# WARNING! All changes made in this file will be lost!
from PySide6 import QtCore
qt_resource_data = b"\
\x00\x00\x02\xd8\
<\
?xml version=\x221.\
0\x22 encoding=\x22utf\
-8\x22?>\x0d\x0a<!... | 1.359375 | 1 |
procyclist/config.py | Arham-Aalam/procyclist_performance | 11 | 38219 | <reponame>Arham-Aalam/procyclist_performance
import abc
import numpy as np
import tensorflow as tf
class Config(metaclass=abc.ABCMeta):
_attributes = [
'batch_size',
'dropout',
'input_dim',
'inputs',
'learning_rate',
'max_time',
'n_epochs',
'n_hidde... | 2.53125 | 3 |
main.py | madhavan-raja/universal-reddit-reader | 0 | 38220 | <reponame>madhavan-raja/universal-reddit-reader
from flask import Flask, render_template, request, url_for
import praw
import json
import random
import markdown2
creds = json.load(open("credentials.json"))
subs = [
'nosleep',
'ProRevenge',
'NuclearRevenge'
]
LIMIT = 100
app = Flask(__nam... | 2.9375 | 3 |
app.py | snoop2head/indigo | 1 | 38221 | from flask import Flask, request, jsonify
from db_user_interactions import user_respond
from pymongo import MongoClient
from datetime import date, datetime, timedelta
import re
#today's date
today_int = date.today()
print("test_app - Today's date:", today_int)
today_str = str(today_int)
#mongodb setup
client = MongoC... | 2.875 | 3 |
sc_qiskitFilter.py | stroblme/hqsp-stqft | 0 | 38222 | from qft import get_fft_from_counts, loadBackend, qft_framework
from fft import fft_framework
from frontend import frontend, signal, transform
from qiskit.circuit.library import QFT as qiskit_qft
# --- Standard imports
# Importing standard Qiskit libraries and configuring account
from qiskit import QuantumCircuit, e... | 1.984375 | 2 |
resources/Presentation.py | radovankavicky/conference_scheduler | 3 | 38223 | <filename>resources/Presentation.py
import json
import datetime as datetime
from typing import List, Set
# optional norlize talk types
types = {
'h_180': 'help desk',
'h': 'help desk', # 2015
'r_180': 'training',
't': 'training', # 2015
't_30': 'talk 30 Min',
't_45': 'talk 45 Min',
't_60':... | 2.546875 | 3 |
recursion/base_converter.py | Yasir323/Data-Structures-and-Algorithms-in-Python | 0 | 38224 | <reponame>Yasir323/Data-Structures-and-Algorithms-in-Python
def decimal2base(num, base):
convert_string = "0123456789ABCDEF"
if num < base:
return convert_string[num]
remainder = num % base
num = num // base
return decimal2base(num, base) + convert_string[remainder]
print(decimal2base(1453... | 3.796875 | 4 |
nova/db/sqlalchemy/migrate_repo/versions/115_make_user_quotas_key_and_value.py | dreamhost/nova | 1 | 38225 | <gh_stars>1-10
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 OpenStack LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses... | 2.03125 | 2 |
src/bin_print.py | wykys/MIKS-FSK | 0 | 38226 | # wykys 2019
def bin_print(byte_array: list, num_in_line: int = 8, space: str = ' | '):
def bin_to_str(byte_array: list) -> str:
return ''.join([
chr(c) if c > 32 and c < 127 else '.' for c in byte_array
])
tmp = ''
for i, byte in enumerate(byte_array):
tmp = ''.join([t... | 3.34375 | 3 |
mmrotate/models/detectors/oriented_rcnn.py | liuyanyi/mmrotate | 449 | 38227 | <gh_stars>100-1000
# Copyright (c) OpenMMLab. All rights reserved.
import torch
from ..builder import ROTATED_DETECTORS
from .two_stage import RotatedTwoStageDetector
@ROTATED_DETECTORS.register_module()
class OrientedRCNN(RotatedTwoStageDetector):
"""Implementation of `Oriented R-CNN for Object Detection.`__
... | 2.265625 | 2 |
beam.py | alexzhou007/VIF | 3 | 38228 | <filename>beam.py
import numpy as np
import cv2
import wall
SAME_LINE_THRESHOLD = 100
SAME_LEVEL_THRESHOLD = 8
SHORT_LINE_LENGTH = 10
BLEED_THRESHOLD = 10
def similar_line_already_found(line, found_lines):
for fline in found_lines:
x1, y1, x2, y2 = line
fx1, fy1, fx2, fy2 = fline
is_vertical_with_r... | 2.625 | 3 |
tests/test_modifiers.py | mbillingr/friendly-iter | 0 | 38229 | from unittest.mock import Mock
import pytest
from friendly_iter.iterator_modifiers import flatten, take, skip, step
def test_flatten():
result = flatten([range(4), [], [4, 5]])
assert list(result) == [0, 1, 2, 3, 4, 5]
def test_take_limits_number_of_resulting_items():
result = take(3, range(10))
a... | 2.75 | 3 |
mysite/documents/urls.py | JarvisDong/Project-CGD | 0 | 38230 | <gh_stars>0
# URLconf: map the index view in view.py to a URL
from django.conf.urls import url
from . import views
from django.views.generic import TemplateView
app_name = 'documents'
urlpatterns = [] | 1.554688 | 2 |
samples/CSP/sco2_analysis_python/examples/examples_main.py | ozsolarwind/SAM | 0 | 38231 | # -*- coding: utf-8 -*-
"""
Created on Fri Jun 9 10:56:12 2017
@author: tneises
"""
import json
import matplotlib.pyplot as plt
import numpy as np
import matplotlib.lines as mlines
import sys
import os
absFilePath = os.path.abspath(__file__)
fileDir = os.path.dirname(os.path.abspath(__file__))
parentDir = os.pat... | 2.171875 | 2 |
Application/StudentModule.py | nimitpatel26/Book-Fetch | 0 | 38232 | from random import randint
import datetime
import pymysql
import cgi
def getConnection():
return pymysql.connect(host='localhost',
user='root',
password='<PASSWORD>',
db='BookFetch')
def newStudent():
fName = input("First Name:... | 3.234375 | 3 |
app/main/forms.py | macymuhia/Blogspot | 0 | 38233 | from flask_wtf import FlaskForm
from wtforms import StringField, TextAreaField, SubmitField, SelectField
from wtforms.validators import Required
class BlogForm(FlaskForm):
blog_title = StringField("Blog title", validators=[Required()])
blog_description = StringField("Blog description", validators=[Required()... | 2.84375 | 3 |
backend/apps/role/migrations/0003_auto_20200329_1414.py | highproformas-friends/curaSWISS | 3 | 38234 | # Generated by Django 3.0.4 on 2020-03-29 14:14
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('role', '0002_auto_20200329_1412'),
]
operations = [
migrations.AlterField(
model_name='role',
name='name',
... | 1.476563 | 1 |
goslinks/db/models.py | RevolutionTech/goslinks | 1 | 38235 | from pynamodb.attributes import UnicodeAttribute
class UserModel:
class Meta:
table_name = "goslinks-users"
read_capacity_units = 1
write_capacity_units = 1
email = UnicodeAttribute(hash_key=True)
name = UnicodeAttribute()
photo = UnicodeAttribute()
@property
def orga... | 2.453125 | 2 |
scifiweb/urls.py | project-scifi/scifiweb | 1 | 38236 | <reponame>project-scifi/scifiweb
from django.conf.urls import include
from django.conf.urls import url
from django.shortcuts import redirect
from django.shortcuts import reverse
import scifiweb.about.urls
import scifiweb.news.urls
from scifiweb.home import home
from scifiweb.robots import robots_dot_txt
urlpatterns =... | 2.03125 | 2 |
heltour/tournament/tests/test_login.py | zbidwell/heltour | 41 | 38237 | <filename>heltour/tournament/tests/test_login.py
import datetime
import responses
from django.test import TestCase
from unittest.mock import patch
from heltour.tournament import oauth
from .testutils import *
class LoginTestCase(TestCase):
def setUp(self):
createCommonLeagueData()
def test_encode_dec... | 2.421875 | 2 |
tests/test_file_structure.py | ChrisWellsWood/carpyt | 0 | 38238 | """Tests for creating file structure."""
import os
from pathlib import Path
import tempfile
from unittest import TestCase
import carpyt
TEST_TEMPLATES = Path(os.path.abspath(__file__)).parent / 'test_templates'
class TestTemplateParsing(TestCase):
"""Tests that templates are parsed correctly."""
def test... | 3.1875 | 3 |
solutions/Array-02.py | mrocklin/dask-tutorial | 2 | 38239 | <reponame>mrocklin/dask-tutorial
import h5py
from glob import glob
import os
filenames = sorted(glob(os.path.join('data', 'weather-big', '*.hdf5')))
dsets = [h5py.File(filename)['/t2m'] for filename in filenames]
import dask.array as da
arrays = [da.from_array(dset, chunks=(500, 500)) for dset in dsets]
x = da.stack... | 2.4375 | 2 |
auto-test/pytest_main.py | asterfusion/Tapplet | 1 | 38240 | #!/usr/bin/env python3
import pytest
import argparse
import configparser
from tools.rest_tools import *
from tools.rest_helper import *
parser = argparse.ArgumentParser(description="Single test")
parser.add_argument( '-m', '--mod_name', help="exec only one directory under tapplet/")
parser.add_argument( '-f', '--t... | 2.140625 | 2 |
Flask/server/config.py | VincentParsons/DigSig | 0 | 38241 | from dotenv import load_dotenv
import os
load_dotenv()
class ApplicationConfig:
SECRET_KEY = "asdadsd"
SQLALCHEMY_TRACK_MODIFICATIONS = False
SQLALCHEMY_ECHO = True
SQLALCHEMY_DATABASE_URI = r"sqlite:///./db.sqlite"
SESSION_TYPE = "filesystem"
SESSION_PERMANENT = False
SESSION_USE_SIGNER... | 1.679688 | 2 |
covigator/precomputations/load_top_occurrences.py | TRON-Bioinformatics/covigator | 7 | 38242 | from typing import List
import pandas as pd
from logzero import logger
from sqlalchemy.orm import Session
from covigator import SYNONYMOUS_VARIANT, MISSENSE_VARIANT
from covigator.database.model import DataSource, PrecomputedSynonymousNonSynonymousCounts, RegionType, \
VARIANT_OBSERVATION_TABLE_NAME, SAMPLE_ENA_TA... | 2.328125 | 2 |
petrarch2/readBBN.py | Sayeedsalam/political-actor-recommender | 1 | 38243 | <gh_stars>1-10
__author__ = 'root'
import json
from cameoxml import cameoxml
from StringIO import StringIO
discard_words_set = set(['THE', 'A', 'AN', 'OF', 'IN', 'AT', 'OUT', '', ' '])
def read_actors_and_role(cameo_doc):
actor_dict = dict()
role_dict = dict()
for event in cameo_doc.events:
for... | 2.765625 | 3 |
utilis/evaluation.py | jianghan2013/NMR_clustering | 0 | 38244 | ### evaluation
import numpy as np
from sklearn.linear_model import LinearRegression
class Evaluate(object):
def __init__(self, model_names, X_train, y_preds, config,verbose=0):
self.distance_min = config['distance_min']
self.point_min = config['point_min'] #0.05, point_min = 50
self.model_n... | 2.578125 | 3 |
userManagment/userManager.py | uzairAK/serverom-panel | 0 | 38245 | #!/usr/local/CyberCP/bin/python
import os, sys
sys.path.append('/usr/local/CyberCP')
import django
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "CyberCP.settings")
django.setup()
import threading as multi
from plogical.acl import ACLManager
from plogical.CyberCPLogFileWriter import CyberCPLogFileWriter as logging
... | 2.015625 | 2 |
examples/python/corepy/userandom.py | airgiser/ucb | 1 | 38246 | <reponame>airgiser/ucb
#!/usr/bin/python
from random import Random
onelist = [1, 2, 3, 4, 5, 6, 7]
rd = Random()
for i in range(5):
print(rd.randint(0, 100))
print(rd.uniform(0, 100))
print(rd.random())
print(rd.choice(onelist))
print('-' * 30)
| 3.375 | 3 |
src/third_party/beaengine/tests/0f388c.py | CrackerCat/rp | 1 | 38247 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This progra... | 2.125 | 2 |
productdb/testing/unittests/products.py | tspycher/python-productdb | 0 | 38248 | from . import BasicTestCase
class ProductsTestCase(BasicTestCase):
def test_basic(self):
rv = self.client.get('/')
assert rv.status_code == 200
data = self.parseJsonResponse(rv)
assert '_links' in data
def test_get_all_products(self):
rv = self.client.get('/product')... | 2.671875 | 3 |
src/main.py | Quin-Darcy/Crawler | 0 | 38249 | <reponame>Quin-Darcy/Crawler
import crawler
import os
def main():
root = crawler.Crawler()
root.set_start()
root.burrow()
root.show()
os.system('killall firefox')
if __name__ == '__main__':
main()
| 1.75 | 2 |
modulo 2/Exercicios/Ex058.1 - Palpite.py | GabrielBrotas/Python | 0 | 38250 | <gh_stars>0
from random import randint
computador = randint(0, 10)
print('Sou seu computador... Acabei de pensar em um numero entre 0 e 10')
print('Tente adivinhar qual foi')
acertou = False
palpite = 0
while not acertou:
jogador = int(input('Digite um numero entre 0 e 10: '))
palpite += 1
if jogador == ... | 3.828125 | 4 |
jerk_agent_for_understanding/scripts/map-paths.py | tristansokol/Bobcats | 2 | 38251 | <reponame>tristansokol/Bobcats
#!/usr/bin/python
import sys
import retro
import numpy as np
from os import listdir
from os.path import isfile, join, isdir, dirname, realpath
from PIL import Image
# find level maps here: http://info.sonicretro.org/Sonic_the_Hedgehog_(16-bit)_level_maps
mp = Image.open(dirname(realpat... | 2.5625 | 3 |
src/TensorFlow/venv/Lab/Tutorials/Models/SaveRestore.py | KarateJB/Python.Practice | 1 | 38252 | <gh_stars>1-10
"""Save and Load model sample
See https://github.com/aymericdamien/TensorFlow-Examples/blob/master/examples/4_Utils/save_restore_model.py
"""
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
from tensorflow.examples.tutorials.mnist import input_data
import os
# Initialize rando... | 2.8125 | 3 |
complexity/utils.py | remiomosowon/complexity | 59 | 38253 | <gh_stars>10-100
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
complexity.utils
----------------
Helper functions used throughout Complexity.
"""
import errno
import os
import sys
PY3 = sys.version > '3'
if PY3:
pass
else:
import codecs
input = raw_input
def make_sure_path_exists(path):
"""
... | 3.828125 | 4 |
src/Brain/Functions/Analyzer.py | SidisLiveYT/Discord-AI | 0 | 38254 | from Resources.StorageGround import Greetings
print(Greetings);
def Analyzer_Text_Department(RawString):
#Taking List of Words to Analyze Indiviually
SplitSting = RawString.split()
#for word in SplitSting:
| 2.890625 | 3 |
prep_scripts/labels.py | Open-Speech-EkStep/common_scripts | 4 | 38255 | <gh_stars>1-10
# Usage: python labels.py --jobs 64 --tsv <path to train.tsv>train.tsv --output-dir <destination dir> --output-name test --txt-dir
import argparse
import os
import re
from tqdm import tqdm
from joblib import Parallel, delayed
# def get_cleaned_text(original_text):
# pattern = '[^ ँ-ःअ-ऋए-ऑओ-नप-रलव... | 2.421875 | 2 |
df.py | denizumutdereli/dialogflow_nlp_ai_powered_chat_bot | 1 | 38256 | <gh_stars>1-10
import os
import sys
import settings
#import google.cloud.dialogflow_v2 as dialogflow_v2
from google.cloud import dialogflow as dialogflow_v2
from google.protobuf import field_mask_pb2
from rich import print
import dffunc as dff #special!
def get_intent_id(display_name):
try:
intents_client = dialo... | 2.25 | 2 |
tests/test_configManager.py | Helene/ibm-spectrum-scale-bridge-for-grafana | 28 | 38257 | <gh_stars>10-100
from source.confParser import ConfigManager
from source.__version__ import __version__ as version
def test_case01():
cm = ConfigManager()
result = cm.readConfigFile('config.ini')
assert isinstance(result, dict)
def test_case02():
cm = ConfigManager()
result = cm.readConfigFile('... | 2.359375 | 2 |
languageModel.py | Zgjszjggjt/DeepLearning | 0 | 38258 | <filename>languageModel.py
#!/usr/bin/evn python
#-*- coding: utf-8 -*-
# ===================================
# Filename : languageModel.py
# Author : GT
# Create date : 17-09-20 18:33:43
# Description:
# ===================================
# Script starts from here
# this is for chinese characters
# import sys
# r... | 2.875 | 3 |
wordle.py | andytholmes/wordle_solver | 0 | 38259 | <gh_stars>0
from typing import List
import numpy as np
import wordfreq
class Word:
def __init__(self):
self.word = ''
self.frequency = 0
self.distinct_vowels = []
self.distinct_letters = []
def __repr__(self):
return f"Word({self.word},{self.get_score()})"
def set... | 3.171875 | 3 |
webapp/app/routes.py | vladan-stojnic/NI4OS-RSSC | 0 | 38260 | from flask import render_template, redirect, url_for, escape, request
from app import app
from app.forms import URLForm, FilesForm
from app.utils import perform_url_request, perform_upload_request
import requests
import base64
import json
@app.route('/url-api', methods=['POST'])
def url_api():
urls = request.form... | 2.390625 | 2 |
globus_automate_client/graphviz_rendering.py | globus/globus-automate-client | 2 | 38261 | <filename>globus_automate_client/graphviz_rendering.py
import json
from typing import Any, Dict, List, Mapping, Optional
from graphviz import Digraph
_SHAPE_TYPES = {
"Choice": {"shape": "diamond"},
"Action": {"shape": "box"},
"Succeed": {"shape": "box", "style": "rounded"},
}
_COLOR_PRECEDENCE = ["", "y... | 2.75 | 3 |
ahio/drivers/generic_tcp_io.py | acristoffers/Loki | 1 | 38262 | <gh_stars>1-10
# -*- coding: utf-8; -*-
#
# Copyright (c) 2016 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, ... | 2.34375 | 2 |
openstack/tests/unit/network/v2/test_firewall_v1_rule.py | morganseznec/openstacksdk | 0 | 38263 | <reponame>morganseznec/openstacksdk
# Copyright (c) 2019 <NAME> <<EMAIL>>
# 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/LICENS... | 2.03125 | 2 |
orbit.py | srujan71/CubeSat-Mission-Planner | 1 | 38264 | """
orbit.py
"Frankly, a very limited and highly specific implementation of an Orbit class.
If used for applications other than the original usecase, this class will
either need to be bypassed or heavily expanded upon."
@author: <NAME> (https://github.com/Hans-Bananendans/)
"""
from numpy import log
class O... | 3.453125 | 3 |
brownie/cli/console.py | banteg/brownie | 3 | 38265 | <filename>brownie/cli/console.py
#!/usr/bin/python3
from docopt import docopt
from brownie import network, project
from brownie.cli.utils.console import Console
from brownie._config import ARGV, CONFIG, update_argv_from_docopt
__doc__ = f"""Usage: brownie console [options]
Options:
--network <name> Use a ... | 2.734375 | 3 |
tensorflow_examples/lite/model_maker/core/compat.py | PawelFaron/examples | 1 | 38266 | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 2.09375 | 2 |
mainpages/views.py | HAXF13D/carwashagrigation | 0 | 38267 | <filename>mainpages/views.py<gh_stars>0
from django.shortcuts import render
from django.shortcuts import redirect
from django.http import HttpResponseRedirect
from .forms import RegisterForm, LoginForm
from django.urls import reverse
from .datebase_func import make_bd, check_car_wash, add_car_wash, time_by_id, update_t... | 2.15625 | 2 |
flytekit/common/types/helpers.py | slai/flytekit | 0 | 38268 | import importlib as _importlib
import six as _six
from flytekit.common.exceptions import scopes as _exception_scopes
from flytekit.common.exceptions import user as _user_exceptions
from flytekit.configuration import sdk as _sdk_config
from flytekit.models import literals as _literal_models
class _TypeEngineLoader(o... | 1.96875 | 2 |
commands/interractions/discord_binder.py | graatje/highscoresbot | 0 | 38269 | <gh_stars>0
import sqlite3
import discord
from commands.sendable import Sendable
class DiscordBinder(discord.ui.View):
def __init__(self, ppousername, discord_user_id):
super().__init__(timeout=6000)
self.discord_user_id = discord_user_id
self.ppousername = ppousername
@discord.ui.b... | 2.84375 | 3 |
gigfinder/gigs/tests.py | jayanwana/django-location-project | 0 | 38270 | from django.test import TestCase
# Create your tests here.
from gigs.models import Venue, Event
from gigs.views import LookupView
from factory.fuzzy import BaseFuzzyAttribute
from django.contrib.gis.geos import Point
from django.utils import timezone
from django.test import RequestFactory
from django.urls import revers... | 2.421875 | 2 |
OpenSources/GDAL_moreExamples/class08demos_ogr_gdal/class08_ogr_buffer.py | mehran66/python-geospatial-open-sources | 0 | 38271 | <filename>OpenSources/GDAL_moreExamples/class08demos_ogr_gdal/class08_ogr_buffer.py
'''*********************************************
author: <NAME>
Date: 12/11/2012
Updated: 03/14/2016 , <NAME>
Purpose: Simple Buffer example using OGR
*********************************************'''
from time import clock
star... | 2.90625 | 3 |
Leyva_Davis_op3.py | DavisLeyva/Examen-primer-unidad | 0 | 38272 | from tkinter import Frame,Label,Button,Checkbutton,Scale,StringVar,IntVar,Entry,Tk
import serial
import time
import threading
import pandas as pd
import mysql.connector
class MainFrame(Frame):
cad = str()
def __init__(self, master=None):
super().__init__(master, width=420, height=270)... | 2.796875 | 3 |
sumultiply.py | declanbarr/python-problems | 0 | 38273 | # <NAME> 19 Mar 2018
# Script that contains function sumultiply that takes two integer arguments and
# returns their product. Does this without the * or / operators
def sumultiply(x, y):
sumof = 0
for i in range(1, x+1):
sumof = sumof + y
return sumof
print(sumultiply(11, 13))
print(sumultiply(5,... | 3.921875 | 4 |
docs/code/distributions/multivariate/plot_multivariate_copulas.py | SURGroup/UncertaintyQuantification | 0 | 38274 | """
Multivariate from independent marginals and copula
==================================================
"""
#%% md
#
# - How to define α bivariate distribution from independent marginals and change its structure based on a copula supported by UQpy
# - How to plot the pdf of the distribution
# - How to modify the p... | 3.5 | 4 |
tests/bdd_test.py | krooken/dd | 0 | 38275 | import logging
from dd.bdd import BDD as _BDD
from dd.bdd import preimage
from dd import autoref
from dd import bdd as _bdd
import nose.tools as nt
import networkx as nx
import networkx.algorithms.isomorphism as iso
class BDD(_BDD):
"""Disables refcount check upon shutdown.
This script tests the low-level ma... | 2.3125 | 2 |
mikelint/analysers/analyser.py | mike-fam/mikelint | 2 | 38276 | """
Abstract analyser
"""
from functools import wraps
from inspect import getmembers, ismethod
from typing import Callable
from ..type_hints import AnalyserResults, AnalyserHelper
from ..utils import SyntaxTree, BaseViolation, ViolationResult
def register_check(error_format: str):
"""
Registers a new checker... | 3.265625 | 3 |
tests/test_eos_token_seq_length.py | v0lta/tfkaldi | 57 | 38277 | from __future__ import absolute_import, division, print_function
import numpy as np
import tensorflow as tf
from IPython.core.debugger import Tracer; debug_here = Tracer();
batch_size = 5
max_it = tf.constant(6)
char_mat_1 = [[0.0, 0.0, 0.0, 0.9, 0.0, 0.0],
[0.0, 0.0, 0.0, 0.9, 0.0, 0.0],
... | 2.1875 | 2 |
presentation/ham10kplots.py | iwan933/mlmi-federated-learning | 2 | 38278 | from typing import List, Tuple
import seaborn as sns
import matplotlib
matplotlib.use('TkAgg')
from matplotlib import pyplot as plt
import pandas as pd
import numpy as np
"""
Plots of tensorboard results with adjusted theming for presentation
"""
label_dict = {0: 'akiec', 1: 'bcc', 2: 'bkl', 3: 'df', 4: 'mel', 5: 'nv... | 2.5 | 2 |
mdn_base.py | Woodenonez/multimodal_motion_prediction | 1 | 38279 | """
A module for a mixture density network layer
(_Mixture Desity Networks_ by Bishop, 1994.)
"""
import sys
import torch
import torch.tensor as ts
import torch.nn as nn
import torch.optim as optim
from torch.distributions import Categorical
import math
# Draw distributions
import numpy as np
import matplotlib.pyplot ... | 2.90625 | 3 |
djautotask/tests/test_commands.py | KerkhoffTechnologies/django-autotask | 4 | 38280 | import io
from atws.wrapper import Wrapper
from django.core.management import call_command
from django.test import TestCase
from djautotask.tests import fixtures, mocks, fixture_utils
from djautotask import models
def sync_summary(class_name, created_count, updated_count=0):
return '{} Sync Summary - Created: {},... | 2.046875 | 2 |
src/utils/adbtool.py | wangzhi2689/data_analysis | 1 | 38281 | #!/usr/bin/evn python
# -*- coding:utf-8 -*-
# FileName adbtools.py
# Author: HeyNiu
# Created Time: 2016/9/19
"""
adb 工具类
"""
import os
import platform
import re
import time
#import utils.timetools
class AdbTools(object):
def __init__(self, device_id=''):
self.__system = platform.s... | 2.421875 | 2 |
apps/company/migrations/0018_alter_inspection_is_inspection_successful.py | samuVillegas/proyecto-fmc | 0 | 38282 | <gh_stars>0
# Generated by Django 4.0.1 on 2022-04-17 22:48
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('company', '0017_inspection_description'),
]
operations = [
migrations.AlterField(
model_name='inspection',
... | 1.40625 | 1 |
vyperlogix/misc/_getframeInfo.py | raychorn/chrome_gui | 1 | 38283 | # use sys._getframe() -- it returns a frame object, whose attribute
# f_code is a code object, whose attribute co_name is the name:
import sys
this_function_name = sys._getframe().f_code.co_name
# the frame and code objects also offer other useful information:
this_line_number = sys._getframe().f_lineno
this_filename ... | 2.734375 | 3 |
msl/loadlib/freeze_server32.py | MSLNZ/msl-loadlib | 51 | 38284 | <reponame>MSLNZ/msl-loadlib
"""
Creates a 32-bit server to use for
`inter-process communication <https://en.wikipedia.org/wiki/Inter-process_communication>`_.
This module must be run from a 32-bit Python interpreter with PyInstaller_ installed.
If you want to re-freeze the 32-bit server, for example, if you want a 32... | 2.75 | 3 |
sprite-animation-generator.py | eijiuema/sprite-animation-generator | 0 | 38285 | from collections import defaultdict
from PIL import Image
import operator
image = Image.open("images\\test.png")
pixel_map = image.load()
initial_coordinate = tuple(int(x.strip())
for x in input("Initial coordinates: ").split(','))
pixel_list = []
directions = [(1, 0), (0, -1), (1, -1), ... | 3.09375 | 3 |
src/figcli/svcs/aws_cfg.py | figtools/figgy-cli | 36 | 38286 | import logging
import os
from figcli.config.style.color import Color
from figcli.io.input import Input
from figcli.svcs.config_manager import ConfigManager
from figcli.config.aws import *
from figcli.config.constants import *
log = logging.getLogger(__name__)
class AWSConfig:
"""
Utility methods for interac... | 2.28125 | 2 |
eopf/product/store/netcdf.py | CSC-DPR/eopf-cpm | 0 | 38287 | import itertools as it
import os
import pathlib
from collections.abc import MutableMapping
from typing import TYPE_CHECKING, Any, Iterator, Optional, Union
import xarray as xr
from netCDF4 import Dataset, Group, Variable
from eopf.exceptions import StoreNotOpenError
from eopf.product.store import EOProductStore
from ... | 2.078125 | 2 |
static/src/srcjpy.py | JoshuaOndieki/oneforma-fashion-attribute | 0 | 38288 | <reponame>JoshuaOndieki/oneforma-fashion-attribute<gh_stars>0
import json
def restructure_category_data():
with open('categoryimages.json', 'r') as jfile:
new_data = json.load(jfile)
with open('category.json') as jfile:
data = json.load(jfile)
with open('category.json', 'w') as jfile:
... | 2.671875 | 3 |
floodlight/vll_pusher.py | netgroup/Dreamer-VLL-Pusher | 1 | 38289 | #!/usr/bin/python
##############################################################################################
# Copyright (C) 2014 <NAME> - (Consortium GARR and University of Rome "Tor Vergata")
# Copyright (C) 2014 <NAME>, <NAME> - (CNIT and University of Rome "Tor Vergata")
# www.garr.it - www.uniroma2.it/netgrou... | 1.945313 | 2 |
lib/external_lib/arvore.py | patrick7star/jogo_da_forca | 0 | 38290 | '''
Aqui o programa conterá uma função que permite
listar tanto diretórios, como arquivos na forma de
árvores, ou seja, seus ramos terão linhas, e também,
espaçamentos mostrando a profundidade de cada diretório
dado uma pasta raíz.
'''
#só pode ser importado:
__all__ = ['arvore']
# ********* bibliotecas ... | 3.109375 | 3 |
magneto/utils/__init__.py | MagnetoTesting/magneto | 24 | 38291 | from __future__ import absolute_import
from contextlib import contextmanager
from multiprocessing import TimeoutError
import signal
import datetime
import os
import subprocess
import time
import urllib
import zipfile
import shutil
import pytest
from .adb import ADB
from ..logger import Logger
def get_center(bounds)... | 2.296875 | 2 |
common/widgets.py | saulm/firedeptmanagement | 2 | 38292 | <reponame>saulm/firedeptmanagement<filename>common/widgets.py
from django import forms
from django.db import models
from django.conf import settings
class LocationPickerWidget(forms.TextInput):
class Media:
css = {
'all': (
settings.STATIC_URL + 'css/location_picker.css',
... | 2 | 2 |
2015/advent25.py | AwesomeGitHubRepos/adventofcode | 96 | 38293 | <reponame>AwesomeGitHubRepos/adventofcode<filename>2015/advent25.py
import re
from functools import reduce
def coord_to_count(row, col):
# calculate the ordinal of the given coordinates, counting from 1
return ((col + row - 2) * (col + row - 1) // 2) + col
def calculate_code(row, col):
count = coord_to_... | 3.421875 | 3 |
test/detect_os.py | ThunderSoft123/mbed-ls | 0 | 38294 | #!/usr/bin/env python
"""
mbed SDK
Copyright (c) 2011-2015 ARM Limited
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 ... | 2.21875 | 2 |
aiocloudflare/api/user/billing/subscriptions/subscriptions.py | Stewart86/aioCloudflare | 2 | 38295 | from aiocloudflare.commons.unused import Unused
from .apps.apps import Apps
from .zones.zones import Zones
class Subscriptions(Unused):
_endpoint1 = "user/billing/subscriptions"
_endpoint2 = None
_endpoint3 = None
@property
def apps(self) -> Apps:
return Apps(self._config, self._session)... | 1.867188 | 2 |
dlutils/timer.py | podgorskiy/dlutils | 5 | 38296 | <filename>dlutils/timer.py<gh_stars>1-10
# Copyright 2017-2019 <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://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | 2.765625 | 3 |
global_covid_tracker/plotting/__init__.py | kvanderveen/global_covid_tracker | 0 | 38297 | <gh_stars>0
from .plot_positive_test_rates import plot_positive_test_rates
from .plot_total_cases import plot_total_cases
from .plot_total_deaths import plot_total_deaths
from .plot_deaths_by_country import plot_deaths_by_country
from .plot_cases_by_country import plot_cases_by_country
from .plot_total_tests import plo... | 1.1875 | 1 |
iot_services_sdk/session.py | sap-archive/iot-services-sdk | 4 | 38298 | """ Author: <NAME> (steinroe) """
from .iot_service import IoTService
from .response import Response
class SessionService(IoTService):
def __init__(self,
instance,
user,
password):
"""Instantiate SessionService object
Arguments:
inst... | 3.125 | 3 |
tests/test_pieces.py | trslater/chess | 0 | 38299 | from chess.pieces import Pawn, Knight, Bishop, Rook, Queen, King
class TestPiece:
def test_sum(self):
groups = ((Pawn(), Knight(), Bishop()),
(Knight(), Bishop(), Queen()),
(Pawn(), Pawn(), Pawn(), Pawn()))
actual_sums = tuple(map(sum, groups))
expected... | 3.28125 | 3 |