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
UQ/UQtutorial.py
ISR3D/ISR3D
0
39100
import subprocess lib_list = ['numpy','ymmsl','sobol_seq','csv','seaborn','zenodo_get'] for lib_name in lib_list: try: import lib_name except ImportError: if lib_name == 'csv': print(lib_name,' Module not installed') subprocess.run(['pip','install','python-csv']) else: print(lib_name,' Module not inst...
2.375
2
launch/test/launch/test_logging.py
pal-robotics-forks/launch
0
39101
<reponame>pal-robotics-forks/launch<filename>launch/test/launch/test_logging.py # Copyright 2019 Open Source Robotics Foundation, Inc. # # 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 # # ...
2.171875
2
code/C10/pkg/mysql.py
DataScienceCoding/Python-Web-Crawler
2
39102
<reponame>DataScienceCoding/Python-Web-Crawler<gh_stars>1-10 import pymysql from conf.cfg import Conf class MysqlCli(): def __init__(self): conf = Conf() option = conf.section('mysql') try: self._db = pymysql.connect(host=option['host'], p...
2.75
3
matrixprofile/io/protobuf/protobuf_utils.py
MORE-EU/matrixprofile
262
39103
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals range = getattr(__builtins__, 'xrange', range) # end of py2 compatability boilerplate import numpy as np from matrixprofile import core from ma...
2.5625
3
projects/thesis/continuous/custom/evaluation/__init__.py
cpark90/rrrcnn
0
39104
<reponame>cpark90/rrrcnn from .classification_evaluation import ClassificationEvaluator
0.941406
1
swamp/wrappers/phenixcc.py
rigdenlab/SWAMP
2
39105
<gh_stars>1-10 import os import shutil from pyjob import cexec from swamp.wrappers.wrapper import Wrapper from swamp.parsers import PhenixParser class PhenixCC(Wrapper): """Wrapper around phenix.get_cc_mtz_pdb :param str workdir: working directory :param str mtzin: file name of the mtz with the phase inf...
2.140625
2
api/src/app/settings.py
mdcg/fastapi-processes-microservices
0
39106
from decouple import config MEDIA_PATH = config("MEDIA_PATH", "/home/mdcg/Documents/")
1.34375
1
HookMandrill2Mongo.py
krisfremen/hookmandrill2mongo
0
39107
#!/usr/bin/python # -*- coding: utf-8 -*- from flask import * from pymongo import MongoClient application = app = Flask(__name__) dbhost = "localhost" dbname = "webhooks" dbcoll = "mandrill" @app.route('/', methods=['GET', 'POST']) def hook(): try: mongo = MongoClient(host=dbhost) mandrillhookjso...
2.3125
2
dc_interactions/payloads.py
merlinfuchs/discord-interactions
1
39108
from enum import IntEnum __all__ = ( "InteractionType", "InteractionPayload", "CommandInteractionData", "CommandInteractionDataOption", ) class InteractionType(IntEnum): PING = 1 APPLICATION_COMMAND = 2 class ResolvedEntities: def __init__(self, data): self.users = data.get("us...
2.59375
3
prepoint/__init__.py
edose/prepoint
0
39109
<gh_stars>0 __author__ = "<NAME> :: New Mexico Mira Project, Albuquerque" # PyInstaller (__init__.py file should be in place as peer to .py file to run): # in Windows Command Prompt (E. Dose dev PC): # cd c:\Dev\prepoint\prepoint # C:\Programs\Miniconda\Scripts\pyinstaller app.spec
1.4375
1
module1-web-application-development-with-flask/web_app/app.py
brucebra000/DS-Unit-3-Sprint-3-Productization-and-Cloud
0
39110
from flask import Flask, jsonify, request, render_template from flask_sqlalchemy import SQLAlchemy from flask_migrate import Migrate app = Flask(__name__) app.config['CUSTOM_VAR'] = 5 app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///web_app.db' db = SQLAlchemy(app) migrate = Migrate(app, db) class User(db.Model)...
3
3
mode/examples/Topics/Simulate/Spring/Spring.pyde
katnino/processing.py
4
39111
""" Spring. Click, drag, and release the horizontal bar to start the spring. """ # Spring drawing constants for top bar springHeight = 32 # Height left = 0 # Left position right = 0 # Right position max = 200 # Maximum Y value min = 100 # Minimum Y value over = False # If mouse over move = False ...
3.921875
4
ldbcache.py
Exahilosys/ldbcache
0
39112
import pathing import collections import itertools import copy __all__ = ('Tree', 'Cache', 'Entry', 'EntryCache', 'RowCache', 'BulkRowCache', 'AlikeBulkRowCache') class Tree(dict): """ Simple **BTree** implementation. """ __slots__ = () def _make(self): """ Create ...
3.234375
3
logging_automation.py
aws-samples/aws-centeralized-logging-with-datadog
3
39113
<reponame>aws-samples/aws-centeralized-logging-with-datadog # Copyright 2008-2018 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at # http://aws.a...
1.914063
2
setup.py
merwok-forks/shortuuid
0
39114
<gh_stars>0 #!/usr/bin/env python import sys from setuptools import setup from shortuuid import __version__ assert sys.version >= "2.5", "Requires Python v2.5 or above." classifiers = [ "License :: OSI Approved :: BSD License", "Programming Language :: Python", "Programming Language :: Python :: 2.5", ...
1.476563
1
scripts/tweakstatus.py
willingc/pc-bot
5
39115
#!/usr/bin/env python """ Manually tweak a talk's status, leaving a note about why. """ import sys import argparse import pycon_bot.mongo from pycon_bot.models import TalkProposal, Note p = argparse.ArgumentParser() p.add_argument('talk_id', type=int) p.add_argument('new_status', choices=[c[0] for c in TalkProposal.S...
2.34375
2
src/javactl/setting/java_setting.py
mogproject/javactl
5
39116
from __future__ import division, print_function, absolute_import, unicode_literals import os from mog_commons.case_class import CaseClass from mog_commons.functional import omap, oget class JavaSetting(CaseClass): class Memory(CaseClass): def __init__(self, java_version, # just use ...
2.015625
2
test/test_solidsnake.py
mattcoding4days/MetalGear
1
39117
<filename>test/test_solidsnake.py """ Test code for the MetalGear package Test solidsnake.py """ import unittest from MetalGear.solidsnake import Snake class TestSolidSnake(unittest.TestCase): def test_solidsnake(self): solid_snake = Snake() assert solid_snake.__str__(), 'Return should not be empt...
2.703125
3
prebuilder/systems/cmake.py
prebuilder/prebuilder.py
4
39118
<gh_stars>1-10 __all__ = ("CMakeBS", "CMake") import typing import sys from pathlib import Path import re import shlex from pprint import pprint import os from collections import OrderedDict, defaultdict from .ninja import NinjaBS from ..core.Package import VersionedPackageRef, Package, PackageMetadata, PackageInstal...
1.796875
2
apache_manager/interactive.py
xolox/python-apache-manager
8
39119
# Monitor and control Apache web server workers from Python. # # Author: <NAME> <<EMAIL>> # Last Change: November 27, 2019 # URL: https://apache-manager.readthedocs.io """ A ``top`` like interactive viewer for Apache web server metrics. The :mod:`~apache_manager.interactive` module implements a ``top`` like interacti...
2.4375
2
src/translation.py
Wlodarski/DR-Altimeter
0
39120
<filename>src/translation.py #! python3 """ MIT License Copyright (c) 2020 <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 u...
2.640625
3
config/urls.py
stkrizh/otus-django-hasker
0
39121
from django.conf import settings from django.conf.urls.static import static from django.contrib import admin from django.urls import include, path from users.views import LogIn, LogOut, Settings, SignUp urlpatterns = [ path(f"{settings.ADMIN_URL}/", admin.site.urls), path("", include("questions.urls")), ...
1.914063
2
project_folder/project_code/feature_selection/infogain.py
Nvouk/Titanic_Survival_Classifier
0
39122
from numpy import * from math import log # x: features, y: classes def infogain(x, y): info_gains = zeros(x.shape[1]) # features of x # calculate entropy of the data *hy* # with regards to class y cl = unique(y) hy = 0 for i in range(len(cl)): c = cl[i] py = float(sum(y==c)...
3.234375
3
wiki_stocks/get_wiki_sp.py
SamMonk/data-bot
0
39123
<reponame>SamMonk/data-bot import bs4 as bs import json import requests def save_sp500_tickers(): resp = requests.get('http://en.wikipedia.org/wiki/List_of_S%26P_500_companies') soup = bs.BeautifulSoup(resp.text, 'lxml') table = soup.find('table', {'class': 'wikitable sortable'}) tickers = {"stocks":[]...
2.9375
3
day/day14part2.py
swemoney/adventofcode2020
1
39124
<reponame>swemoney/adventofcode2020 from functools import cached_property from puzzle import Puzzle # pylint: disable=import-error from itertools import product from enum import Enum import re BIT_LENGTH = 36 class Command(Enum): mask = "mask" mem = "mem" class Instruction: def __init__(self, command: st...
2.703125
3
pysaxon/__init__.py
ajelenak/pysaxon
31
39125
from .version import version as __version__ # Delay importing extension modules till after they are built... try: from .sxn import * from . import xdm # This SaxonProcessor object is used only to control creation and # destruction of the Saxon/C Java VM... _sp_init = SaxonProcessor(False, init=Tru...
1.257813
1
socialnews/news/users.py
agiliq/django-socialnews
30
39126
<filename>socialnews/news/users.py from django.http import HttpResponse, HttpResponseRedirect, HttpResponseForbidden from django.shortcuts import render_to_response from django.contrib.auth.decorators import login_required from helpers import * from django.core import serializers import bforms import exceptions...
2.171875
2
examples/SIRV_.py
JennyCCDD/epidemix
7
39127
<gh_stars>1-10 ######################################################################## ''' Author: <NAME> Email : <EMAIL> ''' ######################################################################## import numpy as np import pandas as pd import networkx as nx import matplotlib.pyplot as plt from tqdm import tqdm ...
2.34375
2
programs/views.py
MAPC/masshealth
0
39128
<gh_stars>0 from django.http import HttpResponse from django.utils import simplejson from django.template.defaultfilters import truncatewords from models import Program def all_geojson(request): """ Return a GeoJSON representation of all Programs with title, description and image-url properties. """ ...
2.25
2
tests/test_utils.py
Kirembu/qpanel
0
39129
import unittest from qpanel.utils import clean_str_to_div_id, underscore_to_camelcase, \ timedelta_from_field_dict from qpanel.convert import convert_time_when_param import time import datetime class UtilsTestClass(unittest.TestCase): def test_clean_str_to_div(self): div = 'ro/.d. i _@l_k/d_@' ...
2.859375
3
overtime/tests/algorithms/centrality/test_closeness.py
overtime3/overtime
9
39130
<reponame>overtime3/overtime<filename>overtime/tests/algorithms/centrality/test_closeness.py<gh_stars>1-10 import unittest from overtime.components.graphs import TemporalGraph from overtime.algorithms.centrality.closeness import * class ClosenessTest(unittest.TestCase): """ Tests for temporal closeness central...
2.90625
3
game/00-chess-engine/chess_subprocess.py
lix2k3/renpy-chess
1
39131
import sys import subprocess import_dir = sys.argv[1] sys.path.append(import_dir) # https://python-chess.readthedocs.io/en/v0.23.10/ import chess import chess.uci def main(): chess_engine = ChessEngine() while True: line = raw_input() # some split token corresponding to that in chess_di...
2.8125
3
python/data.py
DanGuo1223/mzClustering
0
39132
<gh_stars>0 import sys import numpy as np from sklearn.cluster import KMeans from sklearn import manifold from time import time from matplotlib import offsetbox import matplotlib.pyplot as plt import seaborn as sns #### plot embedding def plot_embedding(X, label, title=None): x_min, x_max = np.min(X, 0), np.max(X,...
2.34375
2
moe/optimal_learning/python/interfaces/domain_interface.py
misokg/Cornell-MOE
218
39133
# -*- coding: utf-8 -*- """Interface for a domain: in/out test, random point generation, and update limiting (for constrained optimization).""" from builtins import object from abc import ABCMeta, abstractmethod, abstractproperty from future.utils import with_metaclass class DomainInterface(with_metaclass(ABCMeta, ob...
2.765625
3
research/datasets/tests/test_datasets.py
joaopfonseca/research
1
39134
<gh_stars>1-10 from urllib.request import urlopen import multiprocessing.dummy as mp from multiprocessing import cpu_count import ssl from .._base import FETCH_URLS ssl._create_default_https_context = ssl._create_unverified_context def test_urls(): """Test whether URLS are working.""" urls = [ url ...
2.765625
3
jdcloud_sdk/services/vod/models/MediaClip.py
jdcloud-apigateway/jdcloud-sdk-python
14
39135
# coding=utf8 # Copyright 2018 JDCLOUD.COM # # 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 ...
1.734375
2
babylispregex.py
phoughton/baby_lisp
0
39136
import re # $ babyLisp(‘(add 1 2)’) # $ 3 # $ babyLisp(‘(multiply 4 (add 2 3))’) # $ 20 def add(a, b): return a+b def subtract(a, b): return a-b def multiply(a, b): return a*b def divide(a, b): return a/b def baby_lisp(lisp_string): brackets = re.sub(r"\)", "))", lisp_string) commands = ...
3.5625
4
python3/contains_duplicate_3.py
joshiaj7/CodingChallenges
1
39137
<reponame>joshiaj7/CodingChallenges """ Space : O(1) Time : O(n**2) """ class Solution: def containsNearbyAlmostDuplicate(self, nums: List[int], k: int, t: int) -> bool: if t == 0 and len(nums) == len(set(nums)): return False for i, cur_val in enumerate(nums): for j in ...
3.15625
3
LIBRAY_MANAGEMENT/f_passwd.py
ShriyasnhAgarwl/Hacktoberfest
0
39138
from tkinter import * from tkinter import ttk from tkinter import messagebox import sqlite3 from sqlite3 import Error #creating window class Fp(Tk): def __init__(self): super().__init__() self.iconbitmap(r'libico.ico') self.maxsize(480, 320) self.title("Forget Password...
3.515625
4
data_preprocessing/preprocessing_text.py
florianfricke/Bachelor_Thesis_Sentiment_Analyse
1
39139
<gh_stars>1-10 """ Created by <NAME>. """ from ekphrasis.classes.preprocessor import TextPreProcessor from ekphrasis.classes.tokenizer import SocialTokenizer from ekphrasis.dicts.emoticons import emoticons from textblob_de.lemmatizers import PatternParserLemmatizer from tqdm import tqdm from nltk.corpus import stopwor...
3.015625
3
scripts/make_agg_intervals.py
mitchute/Open-GHX
4
39140
<reponame>mitchute/Open-GHX def make_interval(depth, depth_integer_multiplier, num, step_num, start_val): all_groups_str = "[\n" for n in range(num): all_groups_str += "\t[" for d in range(depth): val = str(start_val * pow(depth_integer_multiplier, d)) if d == d...
3.078125
3
rsssql.py
su-sanzhou/rss-from-web
11
39141
import config from selectsql import SelectSql class RssSql(object): def __init__(self): self.database = config.get_database_config() self.select_sql = SelectSql(self.database) self.do_not_success = "do_not_success" self.do_success = "do_success" self.user = {} self.x...
2.703125
3
tests/test_widget.py
betatim/cornerstone_widget
24
39142
<reponame>betatim/cornerstone_widget<gh_stars>10-100 import numpy as np import pytest from ipywidgets.embed import embed_snippet from cornerstone_widget import CornerstoneWidget, CornerstoneToolbarWidget from cornerstone_widget.cs_widget import encode_numpy_b64 from cornerstone_widget.utils import _virtual_click_butt...
2.109375
2
RecoPPS/Local/python/ctppsDiamondLocalReconstruction_cff.py
ckamtsikis/cmssw
852
39143
<gh_stars>100-1000 import FWCore.ParameterSet.Config as cms # reco hit production from RecoPPS.Local.ctppsDiamondRecHits_cfi import ctppsDiamondRecHits # local track fitting from RecoPPS.Local.ctppsDiamondLocalTracks_cfi import ctppsDiamondLocalTracks ctppsDiamondLocalReconstructionTask = cms.Task( ctppsDiamondR...
1.09375
1
g3_metaconfig/__init__.py
BigGreenDelta/g3-metaconfig
0
39144
from .metaclass import G3ConfigMeta, Config, ArgParserConfig from .param import Param
1.234375
1
tests/run_all_tests.py
philbucher/communication-tests
0
39145
import unittest import os, sys import communication_tests if communication_tests.MPI.Rank() == 0: communication_tests.CompilerInfo() print() communication_tests.MPI.Barrier() is_slave_process = (("--tests-slave" in sys.argv[1:]) or (communication_tests.MPI.Rank() == 1)) if is_slave_process: from base_co...
2.125
2
bell.py
SWERecker/wf-auto
0
39146
<gh_stars>0 import os import sys import time import warnings from time import sleep import cv2 from image_similarity_measures.quality_metrics import fsim from wf_auto import * from wf_auto.util import Debug warnings.filterwarnings('ignore') ref_folder = os.path.join(os.path.abspath(os.path.dirname(__f...
1.984375
2
clustering_capitals.py
BL-Labs/poetryhunt
0
39147
<gh_stars>0 from newspaperaccess import NewspaperArchive from sklearn.feature_extraction import DictVectorizer from sklearn.cluster import KMeans import os import sqlite3 CL_CACHE_FOLDER = "/datastore/cluster_cache_dbs" class ClusterDB(object): def __init__(self, dbfile = "area_cache.db"): self._conn = sqlite...
2.78125
3
argentum-api/api/tests/utils/utils.py
devium/argentum
1
39148
import datetime def to_iso_format(time: datetime.datetime) -> str: return time.replace(tzinfo=datetime.timezone.utc).isoformat().replace('+00:00', 'Z')
2.984375
3
day16/solve-16a.py
ggchappell/AdventOfCode2020
0
39149
#!/usr/bin/env python3 # Advent of Code 2020 # <NAME> import sys # .stdin import re # .search # ====================================================================== # HELPER FUNCTIONS # ====================================================================== def does_rule_allow_num(rule, num): ...
3.96875
4
code/syn.py
ron-rivest/audit-lab
3
39150
<filename>code/syn.py # syn.py # <NAME> (with <NAME>) # August 3, 2017 # python3 """ Routines to generate a synthetic test election dataset for OpenAuditTool.py. Calls data generation routines in syn1.py for elections "of type 1", and calls routines in syn2.py for elections "of type 2". """ import numpy as np impo...
2.671875
3
src/imagenet/imagenet_train_darknet.py
wenxichen/tensorflow_yolo2
25
39151
<reponame>wenxichen/tensorflow_yolo2<gh_stars>10-100 """Train ILSVRC2017 Data using homemade scripts.""" import cv2 import os import math import tensorflow as tf from multiprocessing import Process, Queue import os import sys FILE_DIR = os.path.dirname(__file__) sys.path.append(FILE_DIR + '/../') import config as cf...
2.234375
2
pycalc/MAVProxy/modules/lib/ANUGA/redfearn.py
joakimzhang/python-electron
0
39152
""" This module adapted ANUGA https://anuga.anu.edu.au/ ------------ Implementation of Redfearn's formula to compute UTM projections from latitude and longitude Based in part on spreadsheet www.icsm.gov.au/gda/gdatm/redfearn.xls downloaded from INTERGOVERNMENTAL COMMITTEE ON SURVEYING & MAPPING (ICSM) http://www.ics...
3.25
3
scikit/sk_random_forest_pca.py
abondar24/deepLearnPython
1
39153
<reponame>abondar24/deepLearnPython<filename>scikit/sk_random_forest_pca.py<gh_stars>1-10 import pandas as pd import numpy as np import matplotlib.pyplot as plt from matplotlib.colors import ListedColormap from sklearn.cross_validation import train_test_split from sklearn.linear_model import LogisticRegression from sk...
2.53125
3
Merge_CROME_LCM_PHI.py
nismod/natural-capital-mapping
1
39154
# Starts from OS Mastermap base map and: # 1. Assigns CEH Landcover map (LCM) definition of either Arable or Improved grassland to agricultural land polygons # 2. Assigns Rural Payments Agency CROME Crop map data (input must be dissolved by land use code and joined to description # and simplified description (Arable, I...
2.046875
2
core/migrations/0002_auto_20220209_1251.py
mazdakdev/video-compressor
3
39155
# Generated by Django 3.2.3 on 2022-02-09 12:51 import django.core.validators from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('core', '0001_initial'), ] operations = [ migrations.AlterField( model_name='video', na...
1.726563
2
pdf417gen/compaction/optimizations.py
hgulino/pdf417-py
0
39156
<gh_stars>0 from itertools import chain, groupby from pdf417gen.compaction.numeric import compact_numbers from pdf417gen.compaction.text import compact_text from pdf417gen.util import iterate_prev_next def replace_short_numeric_chunks(chunks): """ The Numeric Compaction mode can pack almost 3 digits (2.93) in...
2.71875
3
setup_guide/translation.py
uktrade/invest
1
39157
<filename>setup_guide/translation.py<gh_stars>1-10 from .models import SetupGuidePage, SetupGuideLandingPage from modeltranslation.translator import TranslationOptions from modeltranslation.decorators import register @register(SetupGuidePage) class SetupGuidePageTranslation(TranslationOptions): fields = ( ...
1.664063
2
src/utils/grid_fuse.py
sisl/MultiAgentVariationalOcclusionInference
6
39158
# Code to transform the driver sensor OGMs to the ego vehicle's OGM frame of reference. import matplotlib.pyplot as plt import numpy as np import math import copy from utils.grid_utils import global_grid import time from scipy.spatial import cKDTree import pdb def mask_in_EgoGrid(global_grid_x, global_grid_y, ref_xy,...
2.21875
2
emailhub/management/commands/emailhub.py
h3/django-emailhub
0
39159
# -*- coding: utf-8 -*- from __future__ import unicode_literals import logging from django.core.management.base import BaseCommand from emailhub.utils.email import send_unsent_emails log = logging.getLogger('emailhub') class Command(BaseCommand): """ EmailHub management command """ help = 'EmailH...
2.125
2
geo2sql/converter.py
budbee/geo2sql
0
39160
<gh_stars>0 from __future__ import print_function import sys import json def convert(path): try: with open(path, 'r') as f: geojson = json.loads(f.read()) # Warning - Only looking at the exterior, hence skipping holes. coordinates = geojson['features'][0]['geometry']['c...
2.96875
3
augmenty/lang/ru/__init__.py
koaning/augmenty
0
39161
from .keyboard import create_ru
1.023438
1
swepc.python/swepc/test/lakeatrest.py
hertzsprung/seamless-wave-uq
0
39162
<gh_stars>0 import swepc class LakeAtRest: domain = [-50.0, 50.0] def __init__(self, mesh, solver, args): self.endTime = 100.0 self.ic = swepc.InitialConditions(mesh.elements, degree=1) bump = swepc.test.TwoBumps(args.topography_mean, args.topography_stddev, halfWidth=...
2.296875
2
osi_django_app/OSI/admin.py
godslayer201/open-source-list
2
39163
from django.contrib import admin from .models import soc, osc, univ_soc_woc admin.site.register(soc) admin.site.register(osc) admin.site.register(univ_soc_woc)
1.210938
1
Phase_1/O-27-DaYan.py
yapanliu/ashrae-ob-database
0
39164
''' This code will clean the OB datasets and combine all the cleaned data into one Dataset name: O-27-Da Yan semi-automate code, needs some hands work. LOL But God is so good to me. 1. 9 different buildings in this dataset, and each building has different rooms 3. each room has different window, door, ac, indoor, out...
3.203125
3
stacker/deploy.py
elliottgorrell/stacker
0
39165
<gh_stars>0 __author__ = "<NAME> && <NAME>" import base64 import json import re import sys import traceback from datetime import datetime import boto3 import botocore import yaml from cf_helper import secure_print from cf_helper.utils import DeployException, CloudFormationUtil, STSUtil class DeployExecutor(object):...
1.960938
2
Projects/consultants/urls.py
jjfleet/Capstone
2
39166
from django.urls import path from . views import ConsultantCreateView, UserConsultantPageView, ConsultantDetailView, ConsultantPageView, ConsultantDeleteView from . import views as consultant_views urlpatterns = [ path('', ConsultantPageView.as_view(), name='consultants-home'), path('<int:pk>/', ConsultantDet...
1.710938
2
api/qr/__init__.py
TailorDev/pauling
7
39167
from .svg import make_svg # noqa from .png import make_png # noqa
1.054688
1
euler/73.py
stauntonknight/algorithm
0
39168
<reponame>stauntonknight/algorithm import fractions num = 1 den = 1 count = 0 sum = 0 while den <= 12000: count = 0 min_num = int((den + 0.0) / 3 + 1) max_num = den/2 if den % 2 == 0: max_num -= 1 while min_num <= max_num: if fractions.gcd(min_num, den) == 1: count += ...
3.28125
3
attic/gui/core/indicator.py
awacha/cct
1
39169
from enum import Enum from typing import Optional import pkg_resources from gi.repository import Gtk from gi.repository import Pango cssprovider = Gtk.CssProvider() cssprovider.load_from_path(pkg_resources.resource_filename('cct', 'resource/css/indicatorcolors.css')) class IndicatorState(Enum): OK = 'ok' WA...
2.328125
2
ext/ANTsPyNet/antspynet/architectures/create_densenet_model.py
tsmonteiro/fmri_proc
2
39170
<gh_stars>1-10 import tensorflow as tf import tensorflow.keras.backend as K from tensorflow.keras.models import Model from tensorflow.keras.layers import (Input, Dropout, BatchNormalization, Activation, Dense, Concatenate, Conv2D, Conv2DTrans...
2.9375
3
scripts/demo.py
beizhengren/pytorch-deeplab-xception
0
39171
<gh_stars>0 # # demo.py # import argparse import os import numpy as np import logging import sys import os.path from PIL import Image from modeling.deeplab import * from dataloaders import custom_transforms as tr from PIL import Image from torchvision import transforms from dataloaders.utils import * from torchvis...
2.25
2
codeMania-python-matplotlib/tut8.py
JayramMardi/codeMania
0
39172
# chapter Matplotlib Plotting ''' The plot() function is used to draw points (markers) in a diagram. By default, the plot() function draws a line from point to point. The function takes parameters for specifying points in the diagram. Parameter 1 is an array containing the points on the x-axis. Paramet...
4.875
5
GoogleColab/InteligenciaAnalitica/Ex5/trainbase.py
AlexandroLuis/ComputerScience
2
39173
<reponame>AlexandroLuis/ComputerScience<gh_stars>1-10 dataset = pd.read_csv('Corona_NLP_train.csv',encoding='iso8859') dataset
1.851563
2
text/opencv_dnn_detect.py
kingemma/invoice
1,017
39174
<filename>text/opencv_dnn_detect.py from config import yoloCfg,yoloWeights,opencvFlag from config import AngleModelPb,AngleModelPbtxt from config import IMGSIZE from PIL import Image import numpy as np import cv2 if opencvFlag=='keras': ##转换为tf模型,以便GPU调用 import tensorflow as tf from tensorflow.python.platf...
2.8125
3
rhapsody/lib/RAudiostream.py
anarchiae/rhapsody5
0
39175
<gh_stars>0 import threading import vlc import alsaaudio import time import requests import lib.RMonitoring as rmonitoring class Audiostream(threading.Thread): monitoring = None audiostream_id = None audiostream_file = None audiostream_status = None audiostream_volume = None audio_player_i...
2.46875
2
src/pages/mainPage.py
mvoitko/Habrahabr-tests
0
39176
<filename>src/pages/mainPage.py """ Created on Oct 28, 2016 @author: mvoitko """ import re import time import locale from datetime import datetime from selenium import webdriver from selenium.common.exceptions import * from selenium.webdriver.common.keys import Keys from selenium.webdriver.support.ui import WebDriver...
2.734375
3
tools/_lib/utils.py
zhongxinghong/Botzone-Tank2
11
39177
# -*- coding: utf-8 -*- # @Author: Administrator # @Date: 2019-04-25 06:10:39 # @Last Modified by: Administrator # @Last Modified time: 2019-05-21 15:30:34 __all__ = [ "mkdir", "get_abspath", "read_file", "json_load", "json_dump", "b", "u", "Singleton", "CachedProperty", ...
2.765625
3
main.py
notafrancescodavid/Job-Shop-Scheduling-Problem---Hierarchical-Parallel-and-easy-to-use-Genetic-Algorithm
0
39178
#from tree_GA import TreeGA import os import time import json import pandas as pd import sys import matplotlib.pyplot as plt import matplotlib.patches as mpatches from treeGA import TreeGA def printChart(toFile=False,filename="",lang="en"): iteration = 0 jobsForMachines = [] jobsForMachinesWithJobId = []...
2.46875
2
mainsite/migrations/0001_initial.py
MuratovER/IMO
0
39179
<reponame>MuratovER/IMO # Generated by Django 4.0.3 on 2022-05-07 11:10 from django.conf import settings from django.db import migrations, models import django.db.models.deletion import django.utils.timezone class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable...
1.726563
2
api/routes.py
elainevoice/backend
3
39180
from fastapi import APIRouter, File, Header, HTTPException, UploadFile from fastapi.responses import FileResponse, HTMLResponse from pydantic.main import List from api import controller from api.config import application_name from api.models.TTS_model import TTSModel router = APIRouter() MAX_CHARACTERS = 550 class ...
2.796875
3
server.py
zhangtuxin/CMPUT404-WEB-SERVER
0
39181
# coding: utf-8 import SocketServer,os # Copyright 2013 <NAME>, <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...
2.921875
3
off_django/models.py
klorophyl/openfoodfacts-django
1
39182
<reponame>klorophyl/openfoodfacts-django #!/usr/bin/python # _*_ coding: utf_8 _*_ import datetime import logging import openfoodfacts from tqdm import tqdm from django.core.exceptions import FieldDoesNotExist from django.db import models, transaction from .models_extensions import ListField from .settings import D...
1.976563
2
day01/ex04/test.py
d-r-e/Machine-Learning-Bootcamp
0
39183
<reponame>d-r-e/Machine-Learning-Bootcamp #!/usr/bin/env python3 from eval import Evaluator def main(): words = ["Le", "Lorem", "Ipsum", "est", "simple"] coefs = [1, 2, 1, 4, 0.5] print(Evaluator.zip_evaluate(coefs, words)) print(Evaluator.enumerate_evaluate(coefs, words)) if __name__ == '__main__': ma...
3.5
4
tools/deploy/term_backend/nrf.py
giovannistanco/iot-trust-task-alloc
0
39184
import time import threading import sys import pynrfjprog.HighLevel import pynrfjprog.APIError DEFAULT_BLOCK_SIZE = 1024 SECONDS_PER_READ = 0.010 SECONDS_PER_WRITE = 0.010 class RTT: """ RTT communication class Based off: https://github.com/thomasstenersen/pyrtt-viewer/blob/master/pyrtt-vie...
2.5625
3
tests/test_elements.py
janosh/ml-matrics
11
39185
<filename>tests/test_elements.py<gh_stars>10-100 import pandas as pd import pytest from matplotlib.axes import Axes from plotly.graph_objects import Figure from ml_matrics import ( count_elements, hist_elemental_prevalence, ptable_heatmap, ptable_heatmap_plotly, ptable_heatmap_ratio, ) compositio...
2.4375
2
app/wrapper/utils.py
Sirius-social/TMTM
0
39186
<reponame>Sirius-social/TMTM import hashlib from django.conf import settings def get_auth_connection_key_seed() -> str: auth_key = "%s:auth" % str(settings.AGENT['entity']) seed_auth_key = hashlib.md5(auth_key.encode()).hexdigest() return seed_auth_key
1.820313
2
MUSim_make_figures.py
ericcfields/MUSim
0
39187
# -*- coding: utf-8 -*- """ Make figures for MUSim paper AUTHOR: <NAME> VERSION DATE: 26 June 2019 """ import os from os.path import join import numpy as np import pandas as pd from statsmodels.stats.proportion import proportion_confint import matplotlib.pyplot as plt def binom_ci_precision(proporti...
2.796875
3
train.py
zeochoy/RNASeq_CollaborativeFilter
16
39188
from __future__ import print_function from argparse import ArgumentParser from fastai.learner import * from fastai.column_data import * import numpy as np import pandas as pd def build_parser(): parser = ArgumentParser() parser.add_argument('--data', type=str, nargs=None, dest='in_path', help='input file pa...
2.5
2
pyning/tail_recursion/fibonacci_test.py
rkoyanagui/pyning
0
39189
<gh_stars>0 import unittest from pyning.tail_recursion.fibonacci import naive_fib from pyning.utils.testutils import BaseTest class FibonacciTailRecursionTest(BaseTest): def test_zero(self): self.check(f=naive_fib, xr=0, n=0) def test_one(self): self.check(f=naive_fib, xr=1, n=1) def t...
2.765625
3
test/json/des/__init__.py
vincent-musedev/libacvp
45
39190
<reponame>vincent-musedev/libacvp<filename>test/json/des/__init__.py from .des import main_des
0.929688
1
config/config_example1_singleton.py
orest-d/design-patterns-finance
0
39191
class Config: __instance = None @staticmethod def get_instance(): """ Static access method. """ if Config.__instance == None: Config() return Config.__instance def __init__(self): if Config.__instance != None: raise Exception("This class can't b...
3.390625
3
pyworkforce/shifts/tests/test_shifts.py
rodrigo-arenas/pyworkforce
10
39192
from pyworkforce.shifts import MinAbsDifference, MinRequiredResources import pytest def test_min_abs_difference_schedule(): required_resources = [ [9, 11, 17, 9, 7, 12, 5, 11, 8, 9, 18, 17, 8, 12, 16, 8, 7, 12, 11, 10, 13, 19, 16, 7], [13, 13, 12, 15, 18, 20, 13, 16, 17, 8, 13, 11, 6, 19, 11, 20, ...
2.421875
2
api.py
mr-mixas/Nested-Diff-RESTful
0
39193
<filename>api.py # -*- coding: utf-8 -*- # # Copyright 2021 <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.3125
2
accelbyte_py_sdk/api/eventlog/__init__.py
AccelByte/accelbyte-python-sdk
0
39194
<gh_stars>0 # Copyright (c) 2021 AccelByte Inc. All Rights Reserved. # This is licensed software from AccelByte Inc, for limitations # and restrictions contact your company contract manager. # # Code generated. DO NOT EDIT! # template file: justice_py_sdk_codegen/__main__.py """Auto-generated package that contains m...
1.335938
1
cisco_umbrella_enforcement/setup.py
xhennessy-r7/insightconnect-plugins
0
39195
# GENERATED BY KOMAND SDK - DO NOT EDIT from setuptools import setup, find_packages setup(name='cisco_umbrella_enforcement-rapid7-plugin', version='1.0.0', description='Cisco Umbrella Enforcement give technology partners the ability to send security events from their platform/service/appliance within a cu...
1.304688
1
auth0login/migrations/0001_initial.py
nkawa/vimeo-coursetool
0
39196
# Generated by Django 3.2.8 on 2021-10-10 14:32 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Ticket', fields=[ ('id', models.BigAutoFiel...
1.820313
2
s3_test_model.py
BillChan226/In-Field-Crop-Disease-Regnition-via-Domain-Adaptation
1
39197
# %% import matplotlib.pyplot as plt import numpy as np import sklearn import torch import torch.nn as nn import torch.optim as optim from torch.utils.data import DataLoader from model.inceptionv4 import inceptionv4 from model.mobilenetv2 import mobilenetv2 from model.resnet import resnet18 from model.shufflenetv2 imp...
2.203125
2
Control/AFGRoperations.py
RNolioSC/TrabalhoFormais
0
39198
class AFGR: @staticmethod def af_to_gr(dict_af): dict_swap = {} for keys in dict_af: dict_swap[keys] = [] for list in dict_af[keys]: dict_swap[keys].insert(len(dict_swap[keys]), list[0]) dict_swap[keys].insert(len(dict_swap[keys]), list[1]...
3.203125
3
menu.py
bkaganozkan/Difference
0
39199
<gh_stars>0 import sys from PyQt5.QtGui import QPainter, QColor, QSyntaxHighlighter, QTextCharFormat from PyQt5.QtWidgets import QMainWindow, QApplication, QPushButton, QToolTip, QWidget, QLabel from PyQt5.QtWidgets import QFileDialog, QTextEdit from highlighter import Highlighter # SubWindow...
2.5625
3