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 |
|---|---|---|---|---|---|---|
py/kubeflow/testing/auto_deploy/server.py | ChanYiLin/testing | 0 | 12763451 | <filename>py/kubeflow/testing/auto_deploy/server.py
"""A flask app for auto deploying Kubeflow.
TODO(jlewi): Rather than use the multiprocessing package it might
make sense just to run the server and reconciler in separate containers.
They are already communicating through the filesystem so using multi-processing
migh... | 2.453125 | 2 |
exp/12_fake_ppo.py | GuRongfei/BPG-DBS | 0 | 12763452 | <filename>exp/12_fake_ppo.py
import warnings
warnings.filterwarnings("ignore")
import os
os.environ["TF_CPP_MIN_LOG_LEVEL"] = "3"
import gym
import fake_oscillator
from stable_baselines.ppo2 import PPO2
from stable_baselines.common.policies import MlpPolicy
import numpy as np
env_id = "fake_oscillator-v0"
env = gym.... | 1.890625 | 2 |
MyTools/ODE/ode_simple_derivative.py | fovtran/PyGame_samples | 0 | 12763453 | import numpy as np
from scipy.integrate import odeint
from matplotlib import pyplot as plt
def calc_derivative(ypos, time):
return -2*ypos
time_vec = np.linspace(0, 4, 40)
yvec = odeint(calc_derivative, 1, time_vec)
plt.figure(figsize=(4, 3))
plt.plot(time_vec, yvec)
plt.xlabel('t: Time')
plt.ylabel('y: Position... | 3.234375 | 3 |
sphinxcontrib/needs/api/__init__.py | gregegg/sphinxcontrib-needs | 1 | 12763454 | from .configuration import get_need_types, add_need_type, add_extra_option, add_dynamic_function
from .need import add_need, make_hashed_id
| 1.257813 | 1 |
tavastiaevents/apps.py | dymesolutions/HameEvents | 0 | 12763455 | <reponame>dymesolutions/HameEvents
from django.apps import AppConfig
class TavastiaeventsConfig(AppConfig):
name = 'tavastiaevents'
| 1.054688 | 1 |
openaddr/ci/webdotmap.py | MiniCodeMonkey/machine | 101 | 12763456 | import apsw
import boto3
import os
import json
from flask import Blueprint, Response, abort, current_app, render_template, url_for
from . import setup_logger
from .webcommon import log_application_errors, flask_log_level
from .webhooks import get_memcache_client
dots = Blueprint('dots', __name__)
# https://stackove... | 2.203125 | 2 |
test/tests/stack_limits.py | aisk/pyston | 0 | 12763457 | # Make sure we can recurse at least 900 times on the three different types
# of stacks that we have:
def recurse(n):
print n
if n > 0:
return recurse(n - 1)
return n
print "Recursing on main thread..."
recurse(900)
print "Recursing in a generator..."
def gen():
yield recurse(900)
print list(g... | 3.625 | 4 |
plotskypath.py | agabrown/astrometric-sky-path | 3 | 12763458 | <filename>plotskypath.py
"""
Plot the astrometric path of stars on the sky. That is plot the coordinate direction including the proper
motion and parallax effect as a function of time.
Use the C-program skypath.c to draw astrometric paths of stars on the sky. Requires the SOFA library:
http://www.iausofa.org/ (ANSI-C ... | 3.625 | 4 |
day06.py | FailedCode/adventofcode-2017 | 3 | 12763459 | #!/usr/bin/python
tests = [
{'in': '0 2 7 0', 'out': 5},
]
with open('input/day06.txt', 'r') as file:
file_text = file.read()
inputs = map(lambda v: int(v), file_text.split())
print ""
print "part 1: count steps"
def redistribute_count(banks):
def highestValueIndex(items):
highest_index = 0
... | 3.78125 | 4 |
python/code_challenges/Merge_Sort/Merge_Sort.py | Noura-Alquran/data-structures-and-algorithms | 1 | 12763460 | <filename>python/code_challenges/Merge_Sort/Merge_Sort.py
def Merge_Sort(list):
n= len(list)
if n > 1 :
mid = int(n/2)
left =list[0:mid]
right = list[mid:n]
Merge_Sort(left)
Merge_Sort(right)
Merge (left, right, list)
return list
def Merge(left, right, list)... | 4.125 | 4 |
vel/modules/layers.py | tigerwlin/vel | 51 | 12763461 | """
Code (partially) based on:
https://github.com/fastai/fastai/blob/master/fastai/layers.py
"""
import torch
import torch.nn as nn
from vel.util.tensor_util import one_hot_encoding
class AdaptiveConcatPool2d(nn.Module):
""" Concat pooling - combined average pool and max pool """
def __init__(self, sz=None):... | 3.265625 | 3 |
courses/__init__.py | ubccapico/python-canvasapi-base | 4 | 12763462 | <gh_stars>1-10
from CanvasAPI.util import callhelper
from CanvasAPI.courses import settings, users
from CanvasAPI import instance
__all__ = ["get", "get_sections", "put", "delete", "settings", "users"]
def get(course_id, *args):
'''Gets a course'''
url_str = "courses/{}{}".format(course_id, callhelp... | 2.296875 | 2 |
stytra/bouter/extraction.py | mark-dawn/stytra | 0 | 12763463 | <filename>stytra/bouter/extraction.py
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
def find_bouts_timeseries(
time, tail_sum, vigour_duration=0.050, vigour_threshold=0.3, diagnostic_axis=None
):
"""
Parameters
----------
time :
tail_sum :
vigour... | 2.375 | 2 |
Code/sorting_recursive.py | caocmai/cs-2.1-trees-sorting | 0 | 12763464 | #!python
def merge(items1, items2):
"""Merge given lists of items, each assumed to already be in sorted order,
and return a new list containing all items in sorted order.
TODO: Running time: ??? Why and under what conditions?
TODO: Memory usage: ??? Why and under what conditions?"""
merge_list = ... | 4.375 | 4 |
ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/package/scripts/setup_atlas_sqoop.py | cas-packone/ambari-chs | 3 | 12763465 | <gh_stars>1-10
#!/usr/bin/env python
"""
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (... | 1.609375 | 2 |
open_peyote.py | huba/OpenPeyote | 2 | 12763466 | #!/usr/bin/env python3
"""
OpenPeyote. A program for designing patterns to be made with the
Peyote beading technique.
Author: <NAME> (<EMAIL>)
Date: 10.11.2014
"""
from PyQt5.QtCore import *
from PyQt5.QtGui import *
import json
from design_widget import *
from catalog_widget import *
from wizards_and_dialogs import ... | 2.71875 | 3 |
Secao 17 - Algoritmo apriori/mercado2.py | flaviofontes29/Machine-Learning-e-Data-Science-com-Python | 0 | 12763467 | <filename>Secao 17 - Algoritmo apriori/mercado2.py<gh_stars>0
import pandas as pd
dados = pd.read_csv('mercado2.csv', header = None)
transacoes = []
for i in range(0, 7501):
transacoes.append([str(dados.values[i,j]) for j in range(0, 20)])
from apyori import apriori
regras = apriori(transacoes, min_support = 0.00... | 2.96875 | 3 |
template/code/bazel/cc_opts.bzl | thill/cc-template | 1 | 12763468 | <gh_stars>1-10
def default_copts(ignored = []):
opts = [
"-std=c++20",
"-Wall",
"-Werror",
"-Wextra",
"-Wno-ignored-qualifiers",
"-Wvla",
]
ignored_map = {opt: opt for opt in ignored}
return [opt for opt in opts if ignored_map.get(opt) == None]
| 2.078125 | 2 |
app/models.py | francismuk/blog | 0 | 12763469 | <filename>app/models.py<gh_stars>0
from . import db
from werkzeug.security import generate_password_hash, check_password_hash
from flask_login import UserMixin
from . import login_manager
from sqlalchemy.sql import func
@login_manager.user_loader
def load_user(user_id):
'''
@login_manager.user_loader Passes ... | 2.78125 | 3 |
examples/e2e/conftest.py | anneschuth/pact-python | 0 | 12763470 |
from testcontainers.compose import DockerCompose
import pytest
def pytest_addoption(parser):
parser.addoption(
"--publish-pact", type=str, action="store",
help="Upload generated pact file to pact broker with version"
)
parser.addoption(
"--provider-url", type=str, action="store",... | 2.203125 | 2 |
akshay-kamath-individual-project/Code/01_DataManipulation.py | purvithakor/convolutional-neural-network-on-svhn | 0 | 12763471 | import warnings
warnings.filterwarnings('ignore')
import numpy as np
import scipy.io as sio
import seaborn as sns
import matplotlib.pyplot as plt
import wget
import os
from random import shuffle
import cv2
from PIL import Image
sns.set_style("white")
# ----------------------Downloading DATA-------------... | 2.734375 | 3 |
main.py | LJ-LiJiahe/camera_calibration | 0 | 12763472 | <reponame>LJ-LiJiahe/camera_calibration<gh_stars>0
import glob
import numpy as np
import cv2
import config as cfg
# Initialization of parameters
board_size_x = cfg.board_size_x
board_size_y = cfg.board_size_y
# termination criteria
criteria = (cv2.TERM_CRITERIA_EPS + cv2.TERM_CRITERIA_MAX_ITER, 30, 0.001)
# prepa... | 2.4375 | 2 |
authors/apps/articles/pagination.py | C3real-kill3r/binary-jungle-backend | 0 | 12763473 | from rest_framework.pagination import PageNumberPagination
from rest_framework.response import Response
class StandardResultsSetPagination(PageNumberPagination):
"""
A page number style that supports page numbers as
query params
`example usage`
http://localhost:8000/api/articles/?page=3
http:/... | 2.65625 | 3 |
setup.py | bodenr/onmcast | 0 | 12763474 | <reponame>bodenr/onmcast
from setuptools import setup, find_packages
setup(
name='onmcast',
version='0.1',
description='oslo-messaging notification multicast',
author='Boden',
author_email='<EMAIL>',
classifiers=[
'Development Status :: 1 - Beta',
'Programming Language :: Python... | 1.296875 | 1 |
UDP/UDP_SERVER.py | Craziertexas/GPS_TRACKER_PC | 0 | 12763475 | import socket
def init_server(server_ip,server_port):
global server,i
try:
server=socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
server_address=(server_ip,server_port)
server.bind(server_address)
i=0
print("Hello!! Im on {} at port {} :3".format(*server_address))
e... | 3.53125 | 4 |
4_selenium/selenium.py | strohne/autocol | 1 | 12763476 | <reponame>strohne/autocol
# Selenium package to remote control the browser
from selenium import webdriver
from selenium.webdriver.common.by import By
# Driver for Chrome browser
#from selenium.webdriver.chrome.service import Service
#from webdriver_manager.chrome import ChromeDriverManager
#chrome_service = Service(... | 3.390625 | 3 |
bitbucket-google-chat-notifications/router.py | Twb3/bitbucket-google-chat-notifications | 0 | 12763477 | from flask_restful import Resource
from flask import request
import events
from os import environ
import hmac
import hashlib
import logging
logger = logging.getLogger("bbgc")
def not_implemented(event_key):
logger.error("%s is not currently supported.", event_key)
return {"Error": event_key + " is not curre... | 2.359375 | 2 |
orcinus/gui/tooltip.py | geem-lab/orcinus | 7 | 12763478 | <gh_stars>1-10
#!/usr/bin/python3
"""Simple tooltip widget."""
from tkinter import TclError
from tkinter import Toplevel
from tkinter.ttk import Frame
from tkinter.ttk import Label
# http://www.voidspace.org.uk/python/weblog/arch_d7_2006_07_01.shtml
class Tooltip(Frame):
"""Simple tooltip."""
def __init__(... | 3.15625 | 3 |
pyMightLED/pwm_controller.py | iorodeo/pyMightLED | 0 | 12763479 | <reponame>iorodeo/pyMightLED<filename>pyMightLED/pwm_controller.py
"""
Copyright 2010 IO Rodeo 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
http://www.apache.org/licenses/LICENSE-2.0
... | 2.578125 | 3 |
ninjarmmpy/__init__.py | StuffbyYuki/ninjarmmpy | 2 | 12763480 | from ninjarmmpy.client import Client | 1.023438 | 1 |
metadeploy/api/migrations/0053_merge_20190213_1622.py | sfdc-qbranch/MetaDeploy | 33 | 12763481 | # Generated by Django 2.1.7 on 2019-02-13 16:22
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("api", "0052_merge_20190213_1447"),
("api", "0052_merge_20190213_1501"),
]
operations = []
| 1.304688 | 1 |
purchaseRequests/apps.py | MLavrentyev/TeamManager | 1 | 12763482 | from django.apps import AppConfig
class PurchaserequestsConfig(AppConfig):
name = 'purchaseRequests'
| 1.203125 | 1 |
motor.py | hazimgharib21/RaspberryPiLineFollowRobot | 0 | 12763483 | # -----------------------------------------------------------------------------
# This class is for HAT-MDD10
# https://www.cytron.io/p-hat-mdd10
# -----------------------------------------------------------------------------
import RPi.GPIO as GPIO
import time
class motor:
def __init__(self, motorDir1=26, motor... | 2.71875 | 3 |
src/probabilistic_models/proba_model_test.py | pfreifer/zxcvbn | 0 | 12763484 | <gh_stars>0
import pickle
import probabilistic_models.grammar_utils as gru
import probabilistic_models.random_set as rs
from probabilistic_models import grammars
from probabilistic_models.probabilistic_model import probabilistic_model_guesses
fl = {
"1": "aaaaa123bb,ccc**azerty".split(","),
"2": "123jaaj!,888... | 2.546875 | 3 |
notebooks-text-format/linreg_hierarchical_non_centered_numpyro.py | arpitvaghela/probml-notebooks | 166 | 12763485 | <reponame>arpitvaghela/probml-notebooks
# ---
# jupyter:
# jupytext:
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.11.3
# kernelspec:
# display_name: Python [default]
# language: python
# name: python3
# ---
# + [m... | 2.0625 | 2 |
server/app/endpoints/sessions.py | sublinus/pngme | 0 | 12763486 | <filename>server/app/endpoints/sessions.py
import hashlib
from fastapi import APIRouter, Request, Depends, WebSocket, WebSocketDisconnect
from pydantic import BaseModel, Field
from typing import List, Dict
from app.schemas import Client, Session, UserView, Join, Leave
router = APIRouter()
sessions : Dict[str, Sessi... | 2.296875 | 2 |
src/storage-preview/azext_storage_preview/vendored_sdks/azure_storagev2/fileshare/v2020_02_10/_shared/request_handlers.py | Mannan2812/azure-cli-extensions | 2,728 | 12763487 | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
from typi... | 2.265625 | 2 |
atomic/bin/util/generate_mission_times.py | usc-psychsim/atomic_domain_definitions | 0 | 12763488 | <reponame>usc-psychsim/atomic_domain_definitions
import argparse
import json
import logging
import os
import pandas as pd
from model_learning.util.io import create_clear_dir, get_files_with_extension, get_file_name_without_extension
__author__ = '<NAME>'
__email__ = '<EMAIL>'
__desc__ = 'Loads several CSV log files + ... | 2.578125 | 3 |
pycmap/baseGraph.py | mdashkezari/pycmap | 4 | 12763489 | <reponame>mdashkezari/pycmap
"""
Author: <NAME> <<EMAIL>>
Date: 2019-06-26
Function: Abstraction of base class for graphs.
"""
from abc import ABCMeta, abstractmethod
import os
from .common import inline, get_vizEngine, get_figure_dir
import numpy as np
import pandas as pd
import matplotlib as plt
i... | 2.875 | 3 |
score/develop/dev_score/block_access_sample_score.py | LoopNewtorkInc/Loopchain | 2 | 12763490 | <reponame>LoopNewtorkInc/Loopchain
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import json
import loopchain.configure as conf
from loopchain.blockchain import ScoreBase
class UserScore(ScoreBase):
""" peer service, score service 연동 샘플 스코어
마지막 블럭 해시를 구한 다음 전체 블럭을 조회해서 순회하는 샘플 코드
run this:... | 2.328125 | 2 |
app/api/v0_1/stack.py | andromia/solverstack-crud | 0 | 12763491 | <filename>app/api/v0_1/stack.py
from flask import request, jsonify, make_response
from flask_jwt_extended import jwt_required, get_jwt_identity
import logging
from . import bp, errors
from app import db
from app.models import Stack, StackChain
@bp.route("/stack", methods=["GET", "POST"])
@jwt_required
def stack():
... | 2.65625 | 3 |
magnetizer/item.py | magnusdahlgren/magnetizer | 1 | 12763492 | """A module to provides the class Item.
TODO: Better documentation
"""
import html
from re import sub
from re import search
from datetime import datetime
from markdown import markdown
from template import Template
from mutil import link_h1, downgrade_headings, wrap_it_in_a_link, strip_tags_from_html, \
first_imag... | 3.484375 | 3 |
flask-06-SQL_Alchemy/code/models/item.py | ysabel31/Apprendre-Python | 0 | 12763493 | <filename>flask-06-SQL_Alchemy/code/models/item.py
from db import db
class ItemModel(db.Model):
__tablename__ = 'items'
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(80))
price = db.Column(db.Float(precision=2))
store_id = db.Column(db.Integer, db.ForeignKey('stores.id')... | 3.28125 | 3 |
utils/warnings.py | Jakob-Unfried/msc-legacy | 1 | 12763494 | <filename>utils/warnings.py
import sys
def custom_warn(msg, category=UserWarning, filename='', lineno=-1, *args, **kwargs):
print(f'{category.__name__}: {msg}', file=sys.stderr, flush=True)
print(f' issued from: {filename}:{lineno}', file=sys.stderr, flush=True)
| 2.484375 | 2 |
KnnModel.py | gitmax681/hand-gesture-recognition | 3 | 12763495 | <gh_stars>1-10
"""
Note: do not tweak this code unless you know what you're doing.'
"""
from sklearn.model_selection import train_test_split
from sklearn.neighbors import KNeighborsClassifier
from pandas import read_csv
import numpy as np
import json
from init import main
with open('config.json', 'r') as f:
_d =... | 2.71875 | 3 |
ssod/datasets/pipelines/formatting.py | huimlight/SoftTeacher | 604 | 12763496 | import numpy as np
from mmdet.datasets import PIPELINES
from mmdet.datasets.pipelines.formating import Collect
from ssod.core import TrimapMasks
@PIPELINES.register_module()
class ExtraAttrs(object):
def __init__(self, **attrs):
self.attrs = attrs
def __call__(self, results):
for k, v in sel... | 2.234375 | 2 |
src/04_Programming_Hadoop_with_Spark/FilteredLowestRatedMovieDateFrame.py | MilovanTomasevic/The-Ultimate-Hands-On-Hadoop-Tame-your-Big-Data | 0 | 12763497 | <gh_stars>0
from pyspark.sql import SparkSession
from pyspark.sql import Row
from pyspark.sql import functions
def loadMovieNames():
movieNames = {}
with open('ml-100k/u.item') as f:
for line in f:
fields = line.split('|')
movieNames[int(fields[0])] = fields[1]
return movieNames
def parseInput(line):
fiel... | 3.46875 | 3 |
Challenges-2/movieReview.py | chandrakant100/Python-Project | 0 | 12763498 | <reponame>chandrakant100/Python-Project
# Challenge 4 : Create a function named movie_review() that has one parameter named rating.
# If rating is less than or equal to 5, return "Avoid at all costs!".
# If rating is between 5 and 9, return "This one was fun.".
# If rating is ... | 4.125 | 4 |
mango/tradehistory.py | roelantc/mango-explorer | 0 | 12763499 | # # ⚠ Warning
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
# LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
# NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIA... | 1.789063 | 2 |
Curso-em-video/115-exerciciospython/d052_num_primo.py | FabianoBill/Estudos-em-python | 1 | 12763500 | <reponame>FabianoBill/Estudos-em-python
# Exercício Python 52: Faça um programa que leia um número inteiro e diga se ele é ou não um número primo.
n = int(input("Digite um número inteiro: "))
co = 0
for c in range(1, n + 1):
if n % c == 0:
co += 1
if co == 2:
print(f"{n} é primo.")
else:
print(f"{n... | 3.75 | 4 |
D__cell_enrichments.py | garedaba/baby-brains | 2 | 12763501 | import numpy as np
import pandas as pd
import os
from collections import Counter
from scipy.stats import hypergeom
fdr_threshold = 0.05
def main():
os.makedirs('results/enrichment', exist_ok=True)
os.makedirs('results/GO', exist_ok=True)
# LOAD
# single cell gene data
all_gene_data = pd.read_cs... | 2.390625 | 2 |
World 1/First attempts/ex001 - First Try.py | MiguelChichorro/PythonExercises | 2 | 12763502 | colors = {"clean": "\033[m",
"red": "\033[31m",
"green": "\033[32m",
"yellow": "\033[33m",
"blue": "\033[34m",
"purple": "\033[35m",
"cian": "\033[36m"}
msg = "Hello World!!!"
print("{}{}".format(colors["cian"], msg))
| 2.828125 | 3 |
auto/auto.py | subtleseeker/Mask-RCNN | 1 | 12763503 | """
Mask R-CNN
------------------------------------------------------------
Usage: import the module (see Jupyter notebooks for examples), or run from
the command line as such:
# Train a new model starting from pre-trained COCO weights
python3 auto.py train --dataset=/path/to/auto/dataset --weights=coc... | 2.34375 | 2 |
Converter/TensorRT/Source/Build.py | EmilPi/PuzzleLib | 52 | 12763504 | <filename>Converter/TensorRT/Source/Build.py
import sys, os
import pybind11
from PuzzleLib.Compiler.Toolchain import guessToolchain, guessNVCCToolchain
from PuzzleLib.Compiler.BuildSystem import Rule, LinkRule, build
def buildDriver(debugmode=0):
cc, nvcc = prepareCompilers(debugmode=debugmode)
rules, linkrule = ... | 1.984375 | 2 |
ext/roles.py | kenunotdeveloper/leaks.ro-discord-bot | 0 | 12763505 | <reponame>kenunotdeveloper/leaks.ro-discord-bot<gh_stars>0
import discord
from discord.ext import commands
import os, datetime
import re
import asyncio
import aiohttp
import json
import feedparser
import time
class Roles:
def __init__(self, bot):
self.bot = bot
self.loop = bot.loop
self._leaks... | 2.359375 | 2 |
11-dnn-keras/mnist_ann.py | iproduct/coulse-ml | 1 | 12763506 | import datetime
from keras import layers
from keras import models
from keras.datasets import mnist
from keras.utils import to_categorical
import tensorflow as tf
import os
if __name__ == '__main__':
os.environ["XLA_FLAGS"] = '--xla_gpu_cuda_data_dir="D:/Program Files/CUDA/v11.2/development"'
physical_devices ... | 2.515625 | 3 |
proj04/proj04.py | NathanaelLeclercq/VSA-literate-waddlee | 0 | 12763507 | # Name: <NAME>
# Date: June 13
"""
proj04
Asks the user for a string and prints out whether or not the string is a palindrome.
"""\
mystring = raw_input("enter the word to see if it is a palindrome or not: ")
wordlist = [mystring]
#print wordlist
stringlist = []
for letter in mystring:
stringlist.append(let... | 4.1875 | 4 |
setup.py | MartinBorcin/jsonl-to-conll | 5 | 12763508 | <filename>setup.py
from setuptools import setup, find_packages
from codecs import open
from os import path
import re
here = path.abspath(path.dirname(__file__))
version = re.search(
'^__version__\s*=\s*"(.*)"',
open('jsonl_to_conll/__init__.py').read(),
re.M
).group(1)
with open(path.join(here, 'READ... | 1.78125 | 2 |
scale_down.py | roman-smirnov/mmn-11-digital-image-processing | 0 | 12763509 | import cv2
import numpy as np
from skimage.viewer import ImageViewer
def remove_rows(image, rows, cols):
newrows = int(rows / 2)
newimg = np.zeros((newrows, cols), np.uint8)
for r in range(1, newrows + 1):
newimg[r - 1:r, :] = image[r * 2 - 1:r * 2, :]
return newimg
img = cv2.imread('pirate.... | 3.140625 | 3 |
scrapy_bench/middlewares.py | whalebot-helmsman/scrapy-bench | 0 | 12763510 | import os
from scrapy import Request
class RandomPayloadMiddleware:
def __init__(self, size):
"""
Middleware adds a random payload to request's meta. Such behaviour
simulates requests with large size and helps understand performance
impact during usage of external storages (disk, ... | 2.875 | 3 |
audream_v0.9/main.py | Lavabar/audream | 0 | 12763511 | from tkinter import Tk, Label
from tkinter.filedialog import askopenfilename
import fileinput
import threading
import pyaudio
import wave
import mywindows as win
root = Tk()
root.withdraw()
win.showReg(root)
root.mainloop()
| 2.375 | 2 |
backend/src/error.py | rainflame/pith-api | 4 | 12763512 | import enum
class Errors(enum.Enum):
SERVER_ERR = -1
"""
Internal server error.
"""
BAD_REQUEST = -2
"""
Malformed JSON request.
"""
DNE_BOARD = -3
"""
Given board ID does not exist.
"""
DNE_DISC = -4
"""
Given discussion ID does not exist.
"""
DNE_UNIT = -5
"""
Given unit ID does not exist.
... | 2.953125 | 3 |
PokeBot/Cache/Cache.py | danrneal/PokeBot | 0 | 12763513 | import logging
from datetime import datetime
log = logging.getLogger('Cache')
class Cache(object):
def __init__(self):
self._mon_hist = {}
self._egg_hist = {}
self._raid_hist = {}
def monster_expiration(self, mon_id, expiration=None):
if expiration is not None:
s... | 3.078125 | 3 |
utilities/region.py | OCHA-DAP/hdx-scraper-covid-viz | 6 | 12763514 | <filename>utilities/region.py<gh_stars>1-10
import logging
import sys
from hdx.scraper import add_population
from hdx.scraper.readers import read_hdx
from hdx.utilities.dictandlist import dict_of_lists_add, dict_of_sets_add
from hdx.utilities.text import get_fraction_str, get_numeric_if_possible, number_format
logger... | 2.375 | 2 |
jolang/interpreter/stdlib/builtin_types/Array.py | jonatan1609/JoLang | 25 | 12763515 | from .object import Object
from .operator import Operator, Attribute
from .String import String
from .Integer import Integer
from .Null import Null
class Array(Object):
def __init__(self, items):
super().__init__()
self._obj = items
@Operator("Index", compatible=["Integer"])
def index(se... | 2.953125 | 3 |
bread/tests/urls.py | basxsoftwareassociation/bread | 13 | 12763516 | <reponame>basxsoftwareassociation/bread
from django.contrib import admin
from django.urls import include, path
urlpatterns = [
path("admin/", admin.site.urls),
path("bread/", include("bread.urls")),
]
| 1.59375 | 2 |
purequant/example/double_moving_average_strategy/double_moving_average_strategy.py | Silverbulelt/PureQuant | 3 | 12763517 | <gh_stars>1-10
from purequant.indicators import Indicators
from purequant.trade import OkexFutures
from purequant.position import Position
from purequant.market import Market
from purequant.utils.push import dingtalk
from purequant.storage import storage
from purequant.utils.time_tools import get_localtime
from purequa... | 2.09375 | 2 |
src/main/resources/scripts/plot.classification.py | pbloem/motive | 6 | 12763518 | # -*- coding: utf-8 -*-
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as p
import numpy as n
import pylab
import scipy.stats as stats
import networkx as nwx
import glob
import builtins
from matplotlib.pyplot import margins
import os.path
import json
from sklearn import svm, cross_validation, datas... | 2.46875 | 2 |
concur/integrations/glfw.py | potocpav/python-concur | 40 | 12763519 | <reponame>potocpav/python-concur
"""Main integration back-end."""
import glfw
import OpenGL.GL as gl
import time
import imgui
from imgui.integrations.glfw import GlfwRenderer
from concur.integrations.opengl import create_offscreen_fb, get_fb_data
__pdoc__ = dict(create_window=False, begin_maximized_window=False, ... | 2.171875 | 2 |
observations/r/davis.py | hajime9652/observations | 199 | 12763520 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import csv
import numpy as np
import os
import sys
from observations.util import maybe_download_and_extract
def davis(path):
"""Self-Reports of Height and Weight
The `Davis` data... | 3.234375 | 3 |
文本摘要/text_rank/data_loader.py | zhangdddong/beautifulNLP | 10 | 12763521 | <filename>文本摘要/text_rank/data_loader.py
#!/usr/bin/python3
# -*- coding: UTF-8 -*-
__author__ = 'zd'
import global_parameters as config
def get_sentences(text):
"""
将文档切割成句子
:param text: 需要断句的文档
:return: list [[index1, sentence1], [index2, sentence2], ..., [-1, sentenceN]]
"""
break_points = ... | 2.921875 | 3 |
deepclaw/utils/ForegroundDetector.py | 1079931505/ME336-Yellow-Team-SUSTech | 2 | 12763522 | # MIT License.
# Copyright (c) 2021 by BioicDL. All rights reserved.
# Created by LiuXb on 2021/1/5
# -*- coding:utf-8 -*-
"""
@Modified:
@Description:
"""
import time
import cv2
import numpy as np
class BackgroundDetector(object):
def __init__(self):
self.fgmask = None
self.fgbg = None
de... | 2.8125 | 3 |
projects/research/text-processors/text_finders/for_analyse/def_finder.py | zaqwes8811/smart-vocabulary-cards | 0 | 12763523 | #!/usr/bin/python
#-*- coding: utf-8 -*-
import str_finder as sf
import os
'''
file :
'''
defines = ['_2Ublock',
'_3Ublock',
'_3U_polovina_block',
'_Uniplex', # ;при активировании переключение Дупл/полудупл - внешней перемычкой. При деактивации режим Дупл/полудупл выбирается в _duplex
'_duplex', # ... | 1.960938 | 2 |
tests/test_algorithm.py | GabyRumc/evalutils | 17 | 12763524 | <reponame>GabyRumc/evalutils
import json
import os
import shutil
from pathlib import Path
from typing import Dict
import SimpleITK
import numpy as np
from pandas import DataFrame
from scipy.ndimage import center_of_mass, label
from evalutils import (
ClassificationAlgorithm,
DetectionAlgorithm,
Segmentati... | 2.875 | 3 |
ding/model/template/tests/test_vac.py | kxzxvbk/DI-engine | 1 | 12763525 | <reponame>kxzxvbk/DI-engine
import pytest
import numpy as np
import torch
from itertools import product
from ding.model import VAC
from ding.torch_utils import is_differentiable
from ding.model import ConvEncoder
B, C, H, W = 4, 3, 128, 128
obs_shape = [4, (8, ), (4, 64, 64)]
act_args = [[6, 'discrete'], [(3, ), 'co... | 2.015625 | 2 |
lib/bot.py | Javex/qllbot | 0 | 12763526 | import hashlib
import lib.event
import logging
import queue
import select
import socket
import ssl
import time
class BotError(Exception):
pass
class UnknownCertError(Exception):
"""Raised when a previously unknown certificate is encountered.
Only used with the known_hosts SSL authentication method.
... | 2.5625 | 3 |
development/environment.py | BenjaminHamon/DevelopmentToolkit | 1 | 12763527 | import json
import logging
import os
import sys
default_log_format = "[{levelname}][{name}] {message}"
file_log_format = "{asctime} [{levelname}][{name}] {message}"
date_format = "%Y-%m-%dT%H:%M:%S"
def configure_logging(log_level):
logging.root.setLevel(log_level)
logging.addLevelName(logging.DEBUG, "Debug")
l... | 2.4375 | 2 |
main.py | kamacizy/trading_bot | 0 | 12763528 | import robinhood
import reddit
import twitter
#prompt = input('What you want?')
def MAIN():
#reddit.CROSS_CHECK()
twitter.search()
MAIN() | 1.96875 | 2 |
avoviirstools/dashboard/callbacks/volcview_images.py | tparker-usgs/viirspassplotter | 0 | 12763529 | from dash.dependencies import Input, Output
from .. import dashboard
import pandas as pd
YELLOW_THREASHOLD = 0.9
RED_THREASHOLD = 0.5
@dashboard.app.callback(
Output("volcview-sectors", "figure"), [Input("volcview-sectors-update", "n_clicks")]
)
def gen_volcview_sectors(n_clicks):
pdnow = pd.to_datetime("no... | 2.578125 | 3 |
python_sets/difference/difference.py | antonarnaudov/python-ninjas-2021-01 | 0 | 12763530 | <filename>python_sets/difference/difference.py
def difference(a, b):
c = []
for el in a:
if el not in b:
c.append(el)
return c
ll = [1, 2, 3, 4, 5]
ll2 = [4, 5, 6, 7, 8]
# print(difference(ll, ll2))
# = CTRL + /
set1 = {1, 2, 3, 4, 5}
set2 = {4, 5, 6, 7, 8}
set_difference = set1.diff... | 3.734375 | 4 |
skdd/util.py | rlurye/skdd | 0 | 12763531 | import itertools
from collections import Counter
import math
from skdd.config import logger
# generate all rules for number of columns
def combinations(ncols):
l = list(range(0, ncols))
comb_list = []
for dilimeter in range(0, ncols):
sublist = list(l)
sublist.remove(dilimeter)
co... | 2.921875 | 3 |
flight/views.py | andela-Taiwo/Flight-Booking-Application | 0 | 12763532 | from django.shortcuts import render
from rest_framework import (
viewsets,
decorators
)
from rest_framework import exceptions
from flight.serializers import (
FlightSerializer,
BookFlightSerializer
)
from user.serializers import UserSerializer
from rest_framework import authentication, permissions
from ... | 2.21875 | 2 |
normalized_roi_length.py | ImageJ-scripts/ij-macros | 0 | 12763533 | <gh_stars>0
#@File[] (label="ROI folder", style="file") roi_files
#@File (label="Results folder", style="directory") csvPath
# Bootstrap to extend modules search path #
from sys import path
import os.path
from java.lang.System import getProperty
jython_scripts = os.path.join(getProperty('user.home'), 'Jython_scripts')
... | 2.375 | 2 |
test/pydata/test_datadict.py | NS2LPS/pyslave | 1 | 12763534 | from pydata import Data, h5todata
import numpy as np
import os
import h5py
def test_Data(tmpdir):
o = Data(x=np.ones(3), y=np.ones(3), a=5, b='hh')
assert o.b=='hh'
assert o['a']==5
o.append(np.ones(5),np.ones(5))
o.save(os.path.join(tmpdir, 'test.txt'))
o.save(os.path.join(tmpdir, 'test.h5'))
... | 2.515625 | 3 |
fh_fablib/__init__.py | nico1000/fh-fablib | 0 | 12763535 | from __future__ import unicode_literals
from functools import wraps
from os import chmod, mkdir, getuid
from os.path import dirname, exists, join
import socket
from subprocess import Popen, PIPE, call
import time
import pwd
from fabric.api import env, cd, run, local as run_local, task
from fabric.colors import cyan, ... | 1.765625 | 2 |
andes/config/tds.py | lacknc/Andes | 1 | 12763536 | from . import ConfigBase
from ..utils.cached import cached
class Tds(ConfigBase):
def __init__(self, **kwargs):
self.fixt = True
self.tstep = 1 / 30
self.method = 'trapezoidal'
self.method_alt = ['euler', 'trapezoidal', 'fwdeuler']
self.t0 = 0.0
self.tf = 20
... | 2.359375 | 2 |
tests_functional_small/test_ode_explicit_stepping.py | Pressio/pressio4py | 4 | 12763537 | <gh_stars>1-10
import numpy as np
from pressio4py import ode
class MySys:
def __init__(self):
pass
def createVelocity(self):
print("create")
return np.zeros(5)
def velocity(self, stateIn, time, R):
R[:] = 3.0
class MyDtSetter:
def __init__(self):
pass
def __call__(self, step, time):
... | 2.6875 | 3 |
constants.py | dimitrijoy/fact_check_explorer_api | 0 | 12763538 | CLAIMANT_START = 9
CLAIMANT_END = -1
TIME_LIMIT = 5 | 0.890625 | 1 |
rla1000_consts.py | reversinglabs/reversinglabs-a1000-1 | 0 | 12763539 | # --
# File: a1000_consts.py
#
# Copyright (c) ReversingLabs Inc 2016-2018
#
# This unpublished material is proprietary to ReversingLabs Inc.
# All rights reserved.
# Reproduction or distribution, in whole
# or in part, is forbidden except by express written permission
# of ReversingLabs Inc.
#
# --
A1000_JSON_BASE_UR... | 1.773438 | 2 |
daiquiri/core/management/commands/show_databases.py | agy-why/daiquiri | 14 | 12763540 | <reponame>agy-why/daiquiri<filename>daiquiri/core/management/commands/show_databases.py<gh_stars>10-100
import pprint
from django.conf import settings
from django.core.management.base import BaseCommand
class Command(BaseCommand):
def handle(self, *args, **options):
pprint.pprint(settings.DATABASES, ind... | 1.773438 | 2 |
sudoku.py | the-man-with-no-name/Sudoku | 0 | 12763541 | __author__ = "<NAME>"
__license__ = "MIT"
__email__ = "<EMAIL>"
"""
Todo:
[Organized HIGH to LOW priority...]
Organize in Functions better -
Remove Redundant Code & Optimize -
"""
# Modules required
import pygame
import time
import numpy
from typing import List
# Initialize global variables
pygame... | 2.953125 | 3 |
unsupervised_lensing/models/VAE_Nets.py | DeepLense-Unsupervised/unsupervised-lensing | 8 | 12763542 | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
class Encoder(nn.Module):
def __init__(self,no_channels=1):
super().__init__()
self.conv1 = nn.Conv2d(no_channels, 16, 7, stride=3, padding=1)
self.conv2 = nn.Conv2d(16, 32, 7, stride=3,... | 2.828125 | 3 |
test/test_fundmental.py | KunxiongWang/simonsc | 2 | 12763543 | <filename>test/test_fundmental.py
from simonsc.object.csmar_table import csmar_tables, csmar_class_dict
from simonsc import auth
from simonsc.utils import query
from simonsc.api import get_table_data
if __name__ == '__main__':
auth("quantresearch", "quantresearch")
for table in csmar_class_dict:
data... | 2.125 | 2 |
arduino_iot_rest/models/arduino_devicev2_cert.py | akash73/iot-client-py | 13 | 12763544 | # coding: utf-8
"""
Arduino IoT Cloud API
Provides a set of endpoints to manage Arduino IoT Cloud **Devices**, **Things**, **Properties** and **Timeseries**. This API can be called just with any HTTP Client, or using one of these clients: * [Javascript NPM package](https://www.npmjs.com/package/@arduino/ard... | 2.234375 | 2 |
mokapay/config/desktop.py | harpiya/mokapay | 0 | 12763545 | <reponame>harpiya/mokapay
# @Author: <NAME> <developer>
# @Date: 2019-01-21T13:42:26+03:00
# @Email: <EMAIL>
# @Project: Harpiya Kurumsal Yönetim Sistemi
# @Filename: desktop.py
# @Last modified by: developer
# @Last modified time: 2019-01-21T13:54:28+03:00
# @License: MIT License. See license.txt
# @Copyright: Ha... | 1.171875 | 1 |
tutorials/t4/DLL.py | YufeiCui/CSCA48 | 1 | 12763546 | # Provided by Dr. <NAME> & <NAME>. Edited by <NAME>
class DNode(object):
'''represents a node as a building block of a double linked list'''
def __init__(self, element, prev_node=None, next_node=None):
'''(Node, obj, Node, Node) -> NoneType
construct a Dnode as building block of a double link... | 4.21875 | 4 |
wthpython/spacial_nums/spacial_num.py | Nobodylesszb/python_study | 0 | 12763547 | <reponame>Nobodylesszb/python_study
a = 256
b = 256
print(a is b)
"""
output:True
"""
c = 257
d = 257
print(id(c),id(d)) | 2.859375 | 3 |
code/18SrRNA/pipeline_mapping/parse_seqs.py | DraceniY/Chapevo | 0 | 12763548 | import os , sys , glob, argparse , itertools
from Bio import SeqIO
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
import pandas as pd
import numpy as np
from Bio.SeqRecord import SeqRecord
from Bio.Alphabet import IUPAC
import subprocess
accession_table = pd.read_csv("../refseq_download.txt", sep='\t', ... | 2.390625 | 2 |
turtlebot3_visual_servoing/src/navigateObstacle.py | shriarul5273/MSCV-Multi-Sensor-Fusion-and-Tracking | 0 | 12763549 | <reponame>shriarul5273/MSCV-Multi-Sensor-Fusion-and-Tracking
#!/usr/bin/env python
#import
import rospy
import actionlib
from move_base_msgs.msg import MoveBaseAction,MoveBaseGoal
from geometry_msgs.msg import Pose,Quaternion
# initlize the global variables
global GoalPose,goal
GoalPose = Pose()
# intlize the move ba... | 2.1875 | 2 |
copycat/replacement.py | jalanb/co.py.cat | 27 | 12763550 | from .workspace_structure import WorkspaceStructure
class Replacement(WorkspaceStructure):
def __init__(self, object_from_initial, object_from_modified, relation):
WorkspaceStructure.__init__(self)
self.object_from_initial = object_from_initial
self.object_from_modified = object_from_modif... | 2.59375 | 3 |