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 |
|---|---|---|---|---|---|---|
scripts/lst-recopipe.py | thomasgas/cta-lstchain | 0 | 48800 | <gh_stars>0
"""Pipeline for reconstruction of Energy, disp and gamma/hadron
separation of events stored in a simtelarray file.
Result is a dataframe with dl2 data.
Already trained Random Forests are required.
Usage:
$> python lst-recopipe arg1 arg2 ...
"""
from lstchain.reco import dl0_to_dl1
from lstchain.reco imp... | 2.15625 | 2 |
TaoBao/taobao/taobaoSpyder.py | 452sunny/CommoditySearch | 0 | 48801 | <reponame>452sunny/CommoditySearch
# -*- encoding: utf-8 -*-
# @Author : LiChenguang
# @Data : 2019/11/19
# @Email : <EMAIL>
# @sys : elementary OS
# @WebSite : www.searcher.ltd
# @Last Modified time : 2019/11/22
import random
from time import sleep
from loguru import logger
from pyquery import PyQuery a... | 2.390625 | 2 |
gpy_dla_detection/set_parameters.py | jibanCat/gpy_dla_detection | 1 | 48802 | <reponame>jibanCat/gpy_dla_detection
"""
set_parameters.py : sets various parameters for the DLA detection
pipeline.
Note:
----
Physical constants are handled as class attrs
Pipeline parameters are handled as instance attrs
Lambda functions are handled as instance methods
"""
import numpy as np
class Parameters:
... | 2.484375 | 2 |
python/testData/refactoring/extractsuperclass/importMultiFile/dest_module.after.py | truthiswill/intellij-community | 2 | 48803 | import shared_module
from shared_module import module_function as my_function, ModuleClass
class NewParent(object):
def do_useful_stuff(self):
i = shared_module.MODULE_CONTANT
my_function()
ModuleClass() | 2.84375 | 3 |
poptox/leslie/leslie_output.py | quanted/poptox | 1 | 48804 | # -*- coding: utf-8 -*-
import os
os.environ['DJANGO_SETTINGS_MODULE']='settings'
from logistic import logisticdb
import webapp2 as webapp
from google.appengine.ext.webapp.util import run_wsgi_app
from google.appengine.ext.webapp import template
import numpy as np
import cgi
import cgitb
cgitb.enable()
def lesl... | 2.296875 | 2 |
poetcli/controllers/collectionController.py | jkerola/poetcli | 0 | 48805 | from cement import Controller, ex
from ..utils import databaseUtils, controllerUtils
class CollectionController(Controller):
class Meta:
label = 'collection controls'
@ex(
help='set currently active collection by id or name',
arguments=[
(
['-i', '--id'],
... | 2.40625 | 2 |
Python tripartite framework/Django/code/mysite/cookie/apps.py | Ljazz/studyspace | 0 | 48806 | from django.apps import AppConfig
class CookieConfig(AppConfig):
name = 'cookie'
| 1.1875 | 1 |
splendor_sim/src/coin/coin_reserve.py | markbrockettrobson/SplendorBots | 1 | 48807 | import copy
import typing
import splendor_sim.interfaces.coin.i_coin_reserve as i_coin_reserve
import splendor_sim.interfaces.coin.i_coin_type as i_coin_type
import splendor_sim.interfaces.coin.i_coin_type_manager as i_coin_type_manager
class CoinReserve(i_coin_reserve.ICoinReserve):
def __init__(
self,
... | 2.5625 | 3 |
newsdemo/apps/crawler/views.py | zeyap/news_viz | 1 | 48808 | from django.http import HttpResponse
from django.contrib.auth import authenticate
import json
| 1.164063 | 1 |
pyVHDLModel/VHDLModel.py | Xiretza/pyVHDLModel | 0 | 48809 | <gh_stars>0
# =============================================================================
# __ ___ _ ____ _ __ __ _ _
# _ __ _ \ \ / / | | | _ \| | | \/ | ___ __| | ___| |
# | '_ \| | | \ \ / /| |_| | | | | | | |\/| |/ _ \ / _` |/ _ \ |
# | |_) | |_| |\ V / | ... | 1.796875 | 2 |
tests/serializer/test_as_pickle.py | pablobd/dagger | 0 | 48810 | import pytest
from dagger.serializer.as_pickle import AsPickle
from dagger.serializer.errors import DeserializationError, SerializationError
from dagger.serializer.protocol import Serializer
def test__conforms_to_protocol():
assert isinstance(AsPickle(), Serializer)
def test_extension():
assert AsPickle().... | 2.328125 | 2 |
block_2/task_3.py | erdyneevzt/stepik_python | 0 | 48811 | <reponame>erdyneevzt/stepik_python<filename>block_2/task_3.py
i = 1
while i != 0:
i = int(input())
if i > 100:
break
elif i < 10:
continue
else:
print(i)
| 2.859375 | 3 |
dabble/nn.py | bibarz/bibarz.github.io | 0 | 48812 | <reponame>bibarz/bibarz.github.io<filename>dabble/nn.py
import collections
import math
import cv2
import scipy.weave
import numpy as np
import time
import os
import random
class Atan(object):
@classmethod
def fwd(cls, x):
return np.arctan(x)
@classmethod
def derivative(cls, x):
return 1... | 2.5 | 2 |
datasets/inference_dataset.py | davidetalon/encoder4editing | 0 | 48813 | from torch.utils.data import Dataset
from PIL import Image
from pathlib import Path
import pandas
import torch
# from utils import data_utils
class InferenceDataset(Dataset):
def __init__(self, root, opts, split, transform=None, preprocess=None):
self.root = root
attributes_path = Path(root) / "list_attr_celeba... | 2.75 | 3 |
tests/xpath_first_test.py | p/webracer | 0 | 48814 | <filename>tests/xpath_first_test.py
import unittest
import lxml.etree
import webracer.utils
class AbsolutizeUrlTest(webracer.WebTestCase):
def setUp(self):
xml = '<root><el><child><grandchild>text</grandchild></child></el></root>'
self.doc = lxml.etree.XML(xml)
def test_xpath_first_found(s... | 2.625 | 3 |
api/robot_abstract.py | alexisvincent/downy | 0 | 48815 | #!/usr/bin/python2.4
#
# Copyright 2009 Google Inc. All Rights Reserved.
"""Defines the generic robot classes.
This module provides the Robot class and RobotListener interface,
as well as some helper functions for web requests and responses.
"""
__author__ = '<EMAIL> (<NAME>)'
import events
import model
import ops
... | 2.796875 | 3 |
tabtomidi/__init__.py | JoshRosen/tabtomidi | 3 | 48816 | <gh_stars>1-10
from tabtomidi.drumtabs import Tab, TabParsingException, \
UnmappableNoteNamesException
| 1.171875 | 1 |
setup.py | adaros92/genreml | 5 | 48817 | import pathlib
from setuptools import setup, find_packages
# The directory containing this file
HERE = pathlib.Path(__file__).parent
# The text of the README file
README = (HERE / "README.md").read_text()
setup(
description='Data extraction and processing for genre prediction using ML',
long_description=REA... | 1.546875 | 2 |
api/tests/test_item.py | sam-myers/loadstone | 0 | 48818 | <reponame>sam-myers/loadstone
import pytest
@pytest.fixture
def thyrus():
from api.scrapers.item import scrape_item
return scrape_item('d19447e548d')
def test_scrape_item_by_id(thyrus):
assert thyrus.id == 'd19447e548d'
assert thyrus.name == '<NAME>'
assert thyrus.type == 'Two-handed Conjurer\'s... | 2.375 | 2 |
switch_model/generators/core/build.py | staadecker/switch | 4 | 48819 | # Copyright (c) 2015-2019 The Switch Authors. All rights reserved.
# Licensed under the Apache License, Version 2.0, which is in the LICENSE file.
"""
Defines generation projects build-outs.
INPUT FILE FORMAT
Import data describing project builds. The following files are
expected in the input directory.
g... | 1.984375 | 2 |
tryout/Networks.py | binhnguyen1984/Deep-Reinforcement-Learning-Algorithms-with-PyTorch | 0 | 48820 | <reponame>binhnguyen1984/Deep-Reinforcement-Learning-Algorithms-with-PyTorch
from Utils import uniform_params_initialization
import torch
import torch.nn as nn
from torch.nn.init import calculate_gain
class DNQNet(nn.Module):
"""Deep Q-learning network that learns the action-value function"""
def __init__(self... | 3.4375 | 3 |
Python/1170.py | alinemarchiori/URI_Exercises_Solved | 0 | 48821 | n = int(input())
for i in range(n):
dias = 0
valor = float(input())
while valor>1:
valor = valor/2
dias += 1
print(dias, "dias") | 3.734375 | 4 |
models/__init__.py | dpressel/ComerNet | 30 | 48822 | from models.attention import *
from models.rnn import *
from models.seq2seq import *
from models.loss import *
from models.beam import * | 1.007813 | 1 |
dnswitcher/utils.py | jinxingxing/SmartDns | 2 | 48823 | # coding: utf8
__author__ = 'JinXing'
import logging
logger = logging
| 1.226563 | 1 |
setup.py | tradr-project/doxygen_catkin | 5 | 48824 | <filename>setup.py
## ! DO NOT MANUALLY INVOKE THIS setup.py, USE CATKIN INSTEAD
from distutils.core import setup
from catkin_pkg.python_setup import generate_distutils_setup
# fetch values from package.xml
setup_args = generate_distutils_setup(
packages=['doxygen_catkin'],
package_dir={'':'bin'},
script... | 1.351563 | 1 |
Python/5 - kyu/5 kyu - Directions Reduction.py | danielbom/codewars | 0 | 48825 | # https://www.codewars.com/kata/directions-reduction/train/python
# My solution
import re
def dirReduc(arr):
card = {"NORTH": "N", "SOUTH": "S", "EAST": "E", "WEST": "W"}
arr = "".join(map(lambda elem: card[elem], arr))
while "NS" in arr or "SN" in arr or "EW" in arr or "WE" in arr:
arr = r... | 3.34375 | 3 |
src/mrack/providers/provider.py | pvoborni/mrack | 1 | 48826 | # Copyright 2020 Red Hat 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
#
# Unless required by applicable law or agreed to in writing,... | 2.0625 | 2 |
analysis/plothistcmp.py | yzxamos/BRAINS | 6 | 48827 | <gh_stars>1-10
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.ticker import MultipleLocator
d=np.loadtxt("../data/posterior_sample2d.txt", skiprows=1)
fig = plt.figure(figsize=(10, 10))
ax1 = fig.add_axes((0.1, 0.7, 0.2, 0.25))
ax1.plot(d[:, 4], d[:, 8]/np.log(10.0)+6.0, ls='none', marker='.', m... | 2.375 | 2 |
src/m1_run_this_on_laptop.py | mdhummel076/99-CapstoneProject-201920 | 0 | 48828 | """
Capstone Project. Code to run on a LAPTOP (NOT the robot).
Displays the Graphical User Interface (GUI) and communicates with the robot.
Authors: Your professors (for the framework)
and <NAME>.
Winter term, 2018-2019.
"""
import mqtt_remote_method_calls as com
import tkinter
from tkinter import ttk
i... | 3.296875 | 3 |
tests/unit/test_moderate_image.py | CheranMahalingam/Image_Content_Moderation | 0 | 48829 | <filename>tests/unit/test_moderate_image.py
"""Module testing methods in moderate_image.py"""
import boto3
from moto import mock_s3
import unittest
import os
from PIL import Image
from io import BytesIO
import sys
sys.path.insert(1, '../../lambdas/moderate_content/handler')
BUCKET_NAME = 'test_bucket'
OBJECT_KEY = "... | 2.421875 | 2 |
setup.py | garethtilley/referredby | 0 | 48830 | <filename>setup.py
# -*- coding: utf-8 -*-
#
# setup.py
# referredby
#
"""
Packaging for the referredby project.
"""
from setuptools import setup
VERSION = '0.1.3'
setup(
name='referredby',
description="Parsing referrer URLS for common search engines.",
url="http://github.com/larsyencken/referredby/",... | 1.296875 | 1 |
handlers/admins_tools_handl.py | bbt-t/Yuuko | 0 | 48831 | from aiogram.dispatcher import FSMContext
from aiogram.dispatcher.filters import Command
from aiogram.types import Message, CallbackQuery
from sqlalchemy.exc import NoResultFound
from loader import dp, logger_guru
from utils.database_manage.sql.sql_commands import DB_USERS
from utils.keyboards.admins_tools_kb import t... | 2.03125 | 2 |
root_gnn/src/models/global_learner.py | jacoblyons98/root_gnn | 1 | 48832 | <reponame>jacoblyons98/root_gnn<filename>root_gnn/src/models/global_learner.py
import tensorflow as tf
import sonnet as snt
from graph_nets import utils_tf
from graph_nets import modules
from graph_nets import blocks
from root_gnn.src.models.base import MLPGraphNetwork
from root_gnn.src.models.base import make_mlp_mo... | 2.046875 | 2 |
accounts/migrations/0004_auto_20200102_1952.py | venieri/cancan | 0 | 48833 | <filename>accounts/migrations/0004_auto_20200102_1952.py<gh_stars>0
# Generated by Django 3.0.1 on 2020-01-02 19:52
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('accounts', '0003_auto_20200102_1847'),
]
operations = [
migrations.RenameField(
... | 1.359375 | 1 |
plastiqpublicapi/models/client_secrets_response.py | jeffkynaston/sdk-spike-python-apimatic | 0 | 48834 | <gh_stars>0
# -*- coding: utf-8 -*-
"""
plastiqpublicapi
This file was automatically generated by APIMATIC v3.0 (
https://www.apimatic.io ).
"""
class ClientSecretsResponse(object):
"""Implementation of the 'Client Secrets Response' model.
TODO: type model description here.
Attribute... | 2.421875 | 2 |
inputSources.py | Paul-31415/soundplay | 0 | 48835 | import math
#matplotlib keyboard
noteKeys = "<KEY>'"
class keyboard:
def __init__(self,keystring="<KEY>"):
self.keys = keystring
self._keepinscope = None
self.keysDown = set()
def plot(self,ival=50):
import matplotlib.pyplot as plt
import matplotlib.animation as animati... | 3.3125 | 3 |
lixian_commands/readd.py | ntkrnl/xunlei-lixian | 1 | 48836 | <gh_stars>1-10
from lixian_commands.util import *
from lixian_cli_parser import *
from lixian_encoding import default_encoding
import lixian_help
import lixian_query
@command_line_parser(help=lixian_help.readd)
@with_parser(parse_login)
@with_parser(parse_logging)
@command_line_option('deleted')
@command_line_option(... | 2.328125 | 2 |
CalculationUI.py | atharvaagrawal/analysis-of-NSE | 4 | 48837 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'Calculation.ui'
#
# Created by: PyQt5 UI code generator 5.9.2
#
# WARNING! All changes made in this file will be lost!
from Calculation.CalculatingLast5Days import CalculatingLast5Days
from PyQt5 import QtCore, QtGui, QtWidgets
... | 1.960938 | 2 |
SplitChannels/nionswift_plugin/split_channels/__init__.py | Brow71189/swift_workshop_18 | 0 | 48838 | <filename>SplitChannels/nionswift_plugin/split_channels/__init__.py
from . import SplitChannels | 1.0625 | 1 |
cod2mapstats/utility.py | Lonsofore/CoD2MapStats | 2 | 48839 | import os
import sys
import inspect
from ruamel import yaml
def get_script_dir(follow_symlinks=True):
if getattr(sys, 'frozen', False): # py2exe, PyInstaller, cx_Freeze
path = os.path.abspath(sys.executable)
else:
path = inspect.getabsfile(get_script_dir)
if follow_symlinks:
... | 2.484375 | 2 |
cute.py | eight04/node_vm2 | 42 | 48840 | <gh_stars>10-100
#! python3
from xcute import cute, LiveReload
cute(
pkg_name = "node_vm2",
lint = [
'cd node_vm2/vm-server && npm test && cd ..',
'pylint {pkg_name}'
],
test = ['lint', 'python test.py', 'readme_build'],
bump_pre = 'test',
bump_post = ['dist', 'release', 'publish', 'install'],
dist_pre = ... | 1.710938 | 2 |
ap/apps/events/factories.py | shacker/ap | 1 | 48841 | import random
from typing import Any
import factory
import pytz
from django.utils.text import slugify
from ap.apps.events.models import EVENT_TYPE_CHOICES, Event, Organization, Route
from ap.apps.users.constants import COUNTRY_CHOICES
from ap.apps.users.models import User
from ap.apps.events.factory_data import RANDO... | 2.296875 | 2 |
app/metrics_utils.py | Henry7871/jrcms | 1 | 48842 | <filename>app/metrics_utils.py
from flask import request
import time
import sys
from prometheus_client import Counter, Histogram
REQUEST_COUNT = Counter(
'request_count', 'App Request Count',
['app_name', 'method', 'endpoint', 'http_status']
)
REQUEST_LATENCY = Histogram('request_latency_seconds', 'Request la... | 2.34375 | 2 |
clv/purchase_amount_model.py | caglanakpinar/clv_prediction | 1 | 48843 | <reponame>caglanakpinar/clv_prediction<filename>clv/purchase_amount_model.py
from pandas import DataFrame, concat
import os
from itertools import product
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '4'
import shutil
import glob
from tensorflow.keras.layers import Dense, LSTM, Input, BatchNormalization, Conv1D, MaxPooling1D, D... | 2.078125 | 2 |
ex17.py | mparikh15/python_exercises | 0 | 48844 | from sys import argv
from os.path import exists
script, from_file, to_file = argv # takes script, origin and export file as inputs
print "Copying from %s to %s" % (from_file, to_file) # Just saying what's going on
# we could do these two on one line, how?
indata = open(from_file).read() # Made it shorteer, b... | 3.484375 | 3 |
src/rqt_command_publisher/src/rqt_command_publisher/command_publisher.py | remvo/zstt-ros | 0 | 48845 | #!/usr/bin/env python
from __future__ import division
import math
import random
import time
import genpy
import rospy
import roslib
from qt_gui.plugin import Plugin
from python_qt_binding.QtCore import Slot, QSignalMapper, QTimer
from python_qt_binding.QtWidgets import QHeaderView, QTableWidgetItem
from rqt_command_... | 2.140625 | 2 |
standalone/rl_experiments/q-learning.py | mdivband/arcade_swarm | 0 | 48846 | import time
import os
import arcade
import argparse
import gym
from gym import spaces
import swarm_env
import numpy as np
import random
import sys
sys.path.insert(0, '..')
from objects import SwarmSimulator
# Running experiment 22 in standalone file.
def experiment_runner(SWARM_SIZE = 15, ARENA_WIDTH = 600, ARENA_HEI... | 2.375 | 2 |
plexdiscordbot/src/commands.py | bramnijssen/PlexDiscordBot | 1 | 48847 | from helpers import *
from discord.ext import commands
from discord.ext.commands import Cog, Bot, command, Context
import database as db
import discord
import asyncio
def setup(bot):
bot.add_cog(Commands(bot))
class Commands(Cog):
def __init__(self, bot: Bot):
self.bot = bot
# List spread acros... | 2.546875 | 3 |
XGBoost/XGBoost_v3/lib/sparse_vector_xrh.py | Xinrihui/Statistical-Learning-Method | 2 | 48848 | #!/usr/bin/python
# -*- coding: UTF-8 -*-
import numpy as np
class DMatrix:
def __init__(self, data_arr, missing={np.nan, 0}):
"""
:param data_arr: 样本特征 (不含标签)
:param missing: 缺失值的集合, 若特征值在此集合中, 则认为其为缺失值
"""
# N 样本总个数( 包含缺出现缺失值的样本 )
# m 特征的总数
self.N, sel... | 2.6875 | 3 |
InstagramAPIApplication/datasetcrawler.py | SocioRecSys/FashionRec_DataCollection | 2 | 48849 | #from app import app
import os
from flask import Flask,render_template,request, url_for, redirect,session
from constant import *
from storeDataToDB import InstagramDataStore
import json,ast
import requests
import urllib
import urllib2
global accessToken_gl
from pymongo import MongoClient
app = Flask(__name__)
client =... | 2.703125 | 3 |
ligamx.py | betoalien/Alberto-Cardenas-Data-Science-Examples | 0 | 48850 | from bs4 import BeautifulSoup
import requests
import pandas as pd
url = 'https://mexico.as.com/resultados/futbol/mexico_clausura/clasificacion/'
page = requests.get(url)
soup = BeautifulSoup(page.content, 'html.parser')
#Equipos
eq = soup.find_all('span', class_='nombre-equipo')
equipos = list()
count = 0
for i in e... | 2.9375 | 3 |
priorityq/storage/binheap.py | panyam/priorityq | 7 | 48851 | <filename>priorityq/storage/binheap.py
from base import Handle as BaseHandle
from base import Storage as BaseStorage
class Handle(BaseHandle):
def __init__(self, value, index):
super(Handle, self).__init__(value)
self.index = index
def __repr__(self): return str(self)
def __str__(self):
... | 3.40625 | 3 |
wikimetrics/controllers/metrics.py | wikimedia/analytics-wikimetrics | 6 | 48852 | import inspect
from flask import render_template, request, jsonify
from ..configurables import app
from .. import metrics
from ..metrics import metric_classes
def get_metrics(add_class=False):
records = []
for name, metric in metric_classes.iteritems():
if metric.show_in_ui:
new_record = {... | 2.734375 | 3 |
library(data.table).py | edward-jiang3649/data_project | 0 | 48853 |
# Which city has the most traffic? Which city has the least?
# What month is the most busiest in the year?
# Which airport route has the busiest one?
library(data.table)
library(tidyverse)
library(stringr)
library(plotly)
library(readr)
library(xml2)
# ---------------------------------------------------------------... | 2.390625 | 2 |
src/euler_python_package/euler_python/medium/p378.py | wilsonify/euler | 0 | 48854 | <filename>src/euler_python_package/euler_python/medium/p378.py
def problem378():
pass
| 1.023438 | 1 |
su4/path_util.py | njuwelkin/su4 | 0 | 48855 | <filename>su4/path_util.py
import os, sys
def addModulePath(file):
utils_path = os.path.dirname(os.path.abspath(file)) + "/../utils"
sys.path.append(utils_path)
| 2.15625 | 2 |
app/recipe/tests/test_ingredients_api.py | clicktravel-james/travel-perk-recipe-excercise | 0 | 48856 | <gh_stars>0
from django.test import TestCase
from django.urls import reverse
from rest_framework.test import APIClient
from rest_framework import status
from core.models import Ingredient
from recipe.serializers import IngredientSerializer
INGREDIENTS_URL = reverse("recipe:ingredient-list")
class PublicIngredient... | 2.71875 | 3 |
src/incognita/preprocessing/setup_district_boundaries.py | the-scouts/incognita | 2 | 48857 | <reponame>the-scouts/incognita
import time
import geopandas as gpd
import pandas as pd
from incognita.data.scout_census import load_census_data
from incognita.geographies import district_boundaries
from incognita.logger import logger
from incognita.utility import config
from incognita.utility import filter
from incog... | 2.4375 | 2 |
setup.py | drolando/pyramid_zipkin-example | 11 | 48858 | #!/usr/bin/python
# -*- coding: utf-8 -*-
from setuptools import setup
setup(
name='pyramid_zipkin-example',
version='0.1',
author='OpenZipkin',
author_email='<EMAIL>',
license='Apache 2.0',
url='https://github.com/openzipkin/pyramid_zipkin-example',
description='See how much time python se... | 1.015625 | 1 |
10. File Name/main.py | MahmudX/Algorithms | 0 | 48859 | <reponame>MahmudX/Algorithms
n = int(input())
s = str(input())
removal = 0
counter = 0
for x in s:
if x != 'x':
if counter >= 3:
removal += counter - 2
counter = 0
elif x == 'x':
counter += 1
if counter >= 3:
removal += counter - 2
print(removal)
| 3.515625 | 4 |
bloodbank_rl/tianshou_utils/policies.py | joefarrington/bloodbank_rl | 0 | 48860 | <filename>bloodbank_rl/tianshou_utils/policies.py
from tianshou.policy import A2CPolicy, PPOPolicy
from typing import Any, Dict, List, Optional, Type
from tianshou.data import Batch
# Normal key structure for output doesn't work with MLFlow logging nicely
# loss used as a key and also parent
class A2CPolicyforMLFlow... | 2.1875 | 2 |
extract_feats.py | anthng/Car-Parking-Occupancy-Detection | 0 | 48861 | import os
from glob import glob
import tensorflow as tf
from tensorflow.keras.applications.mobilenet_v2 import MobileNetV2, preprocess_input
from tensorflow.keras.preprocessing.image import img_to_array, load_img
from tensorflow.keras.models import Model, load_model
from tensorflow.keras.layers import Conv2D,... | 2.46875 | 2 |
examples/plot_result/mesh_2D_waypoints.py | Berk035/Gibson_Exercise | 1 | 48862 | import argparse
import matplotlib.pyplot as plt
import meshcut
import numpy as np
import pandas
import seaborn as sns
import pandas as pd
import sys, os
import math
#from scipy.stats import norm
SAVE_PATH = os.path.join(os.path.expanduser("~"),'PycharmProjects/Gibson_Exercise/examples/plot_result/')
WAY_PATH = os.path... | 2.046875 | 2 |
ufjc/isometric.py | sandialabs/ufjc | 0 | 48863 | """A module for the uFJC single-chain model in the isometric ensemble.
This module consist of the class ``uFJCIsometric`` which contains
methods for computing single-chain quantities
in the isometric (constant end-to-end vector) thermodynamic ensemble.
Example:
Import and instantiate the class:
... | 2.953125 | 3 |
mtp_common/auth/models.py | uk-gov-mirror/ministryofjustice.money-to-prisoners-common | 0 | 48864 | <reponame>uk-gov-mirror/ministryofjustice.money-to-prisoners-common
class MojUser:
"""
Authenticated user, similar to the Django one.
The built-in Django `AbstractBaseUser` sadly depends on a few tables and
cannot be used without a datbase so we had to create a custom one.
"""
def __init__(sel... | 2.484375 | 2 |
gcode_gen/debug.py | tulth/gcode_gen | 0 | 48865 | import inspect
import re
def debug_str(arg):
'''Return string of arg varible name and str(arg) value.'''
frame = inspect.currentframe().f_back
s = inspect.getframeinfo(frame).code_context[0]
r = re.search(r"\((.*)\)", s).group(1)
return str("{} = {}".format(r, arg))
def debug_print(arg):
'''... | 2.765625 | 3 |
Session 7 - Python/WagerWarCardGame/Development/WWWarConstants.py | dbowmans46/PracticalProgramming | 0 | 48866 | <filename>Session 7 - Python/WagerWarCardGame/Development/WWWarConstants.py
# -*- coding: utf-8 -*-
"""
LICENSE (MIT License):
Copyright 2018 <NAME>, <NAME>, and <NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), ... | 1.8125 | 2 |
server/run.py | dactechie/intershift_comms | 0 | 48867 | <reponame>dactechie/intershift_comms
# run.py
import os
from apis import create_app
# for >flask run
if __name__ == '__main__':
#print(os.path.abspath('./settings.py'))
app = create_app(config_file=os.path.abspath('./settings.py'))
app.run(debug=True) | 1.78125 | 2 |
sla_cli/src/cli/commands/download.py | DavidWalshe93/SL-CLI | 2 | 48868 | """
Author: <NAME>
Date: 10 April 2021
"""
import logging
import os
from typing import List
from dataclasses import dataclass, asdict
import click
from click import Context
from sla_cli.src.cli.context import COMMAND_CONTEXT_SETTINGS
from sla_cli.src.cli.utils import kwargs_to_dataclass, default_from_conte... | 1.992188 | 2 |
tests/unit-tests/test_pkg_configs_devmode.py | releng-tool/releng-tool | 7 | 48869 | <filename>tests/unit-tests/test_pkg_configs_devmode.py
# -*- coding: utf-8 -*-
# Copyright 2021 releng-tool
from releng_tool.opts import RelengEngineOptions
from releng_tool.packages.exceptions import RelengToolInvalidPackageKeyValue
from releng_tool.packages.manager import RelengPackageManager
from releng_tool.regist... | 2.40625 | 2 |
generateStampFiles.py | terrapin47/TinkeringWithEmbers | 2 | 48870 | import json
print("Generating stamp files")
stamps = [
"armor_plate",
"armor_trim",
"arrow_head",
"arrow_shaft",
"axe_head",
"binding",
"boots_core",
"bow_limb",
"bow_string",
"broad_axe_head",
"chest_core",
"cross_guard",
"emerald",
"excavator_head",
"fletching",
"hammer_head",
"han... | 3 | 3 |
reference/code/filtering/ukf/spt.py | koverman47/robosub | 0 | 48871 | <reponame>koverman47/robosub
#!/usr/bin/env python
import numpy as np
from scipy import linalg
class SPT():
def __init__(self):
self.chi = None
self.state_weights = None
self.cov_weights = None
def calc_sigma_pts(self, mu, cov, alpha, beta, lamb):
self.clear()
s... | 2.5 | 2 |
uninas/modules/mixed/weights.py | cogsys-tuebingen/uninas | 18 | 48872 | import torch
from uninas.modules.mixed.mixedop import AbstractDependentMixedOp
from uninas.methods.strategies.manager import StrategyManager
from uninas.register import Register
@Register.network_mixed_op()
class SplitWeightsMixedOp(AbstractDependentMixedOp):
"""
all op choices on one path in parallel,
th... | 2.375 | 2 |
PerlinNoise.py | nmmarzano/PerlinNoise.py | 0 | 48873 | <filename>PerlinNoise.py
import pygame
import os
import math
import numpy
from PIL import Image
from multiprocessing import Pool
SCREEN_WIDTH, SCREEN_HEIGHT = 256, 256
MAX_AMPLITUDE = 255 * 2/5
# --- INTERPOLATORS ---
# quickest but kinda harsh, not extremely bad though
def lerp(a, b, x):
return... | 2.609375 | 3 |
newpriority.py | NathanZabriskie/microfiction | 1 | 48874 | import helpers as h
import random
import heapq as hq
numChildren = 4
strikes = 3
maxSpecies = 10
class Species:
def __init__(self,s,node):
self.seed = s
self.isDead = False
self.heap = []
self.stale = 0
self.lowsc = node.score
self.bestsc = node.score
self.bestch = node
self.secondch = None
self.pu... | 2.71875 | 3 |
tools/nn/speaker_dataset.py | mikiec84/speaking_detection | 0 | 48875 | <reponame>mikiec84/speaking_detection
import os.path
import skimage.io
import tqdm
skimage.io.use_plugin('pil')
class Dataset:
def __init__(self, root, transform=None, include=None, exclude=[]):
self.transform = transform
self.images = {}
tq = tqdm.tqdm()
self.c = {0:0, 1: 0}
... | 2.28125 | 2 |
test_right_product.py | mirrkka/seleniumcourse | 0 | 48876 | <gh_stars>0
import pytest
import time
from selenium import webdriver
from driver_fixture import *
import re
import ast
#а) на главной странице и на странице товара совпадает текст названия товара
#б) на главной странице и на странице товара совпадают цены (обычная и акционная)
#в) обычная цена зачёркнутая и серая (мож... | 2.25 | 2 |
cat_train_bert.py | joellehanna97/wikipedia-nlp | 0 | 48877 | <gh_stars>0
from cat_bert_model import *
bert_path = "https://tfhub.dev/tensorflow/bert_en_uncased_L-12_H-768_A-12/1"
# data_path = '/home/ubuntu/topic_classification/data/movies_genres_en.csv'
# text_col = 'plot'
#data_path = '/home/ubuntu/topic_classification/data/wiki_data_labeled_4x2131.csv'
data_path = '/home/ubu... | 2.203125 | 2 |
apps/profiles.py | csgobeta/csgobetabot | 9 | 48878 | <reponame>csgobeta/csgobetabot
from steam import steamid
from telegraph import Telegraph
import re
import requests
from steam import steamid
from steam.steamid import SteamID
import requests
import config
from addons.plugins import url_checker
from addons import strings
def csgo_stats(data):
try:
steam6... | 2.59375 | 3 |
src/plot.py | arunchaganty/active-evaluation | 5 | 48879 | """
Plot various visualizations
"""
import sys
import json
from collections import Counter
import numpy as np
import scipy.stats as scstats
import matplotlib
matplotlib.use("agg")
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import matplotlib.patches as mp
from zipteedo.util import GzipFileType, load... | 2.0625 | 2 |
geotrek/outdoor/urls.py | IdrissaD/Geotrek-admin | 0 | 48880 | <reponame>IdrissaD/Geotrek-admin
from django.conf import settings
from geotrek.common.urls import PublishableEntityOptions
from geotrek.outdoor import models as outdoor_models
from geotrek.outdoor import views as outdoor_views # noqa Fix an import loop
from mapentity.registry import registry
app_name = 'outdoor'
url... | 1.585938 | 2 |
CreateAndUploadPlots.py | LiquidFun/Reddit-GeoGuessr-Tracking-Bot | 0 | 48881 | import plotly.plotly as py
import plotly.graph_objs as go
import plotly.offline as offline
import sys, os
from .CreateTableFromDatabase import getRankingsFromDatabase
# Using the plotly API creates a few plots
def createAndUploadPlots(table, plotName):
# Read plotly username and API key from file (to avoid acci... | 3.09375 | 3 |
src/old/utilisation_aware_load_balancer.py | ssupdoc/k8-simulation | 0 | 48882 | <reponame>ssupdoc/k8-simulation<gh_stars>0
from src.abstract_load_balancer import AbstractLoadBalancer, LoadBalancerQueue
class UtilisationAwareLoadBalancer(AbstractLoadBalancer):
def __init__(self, APISERVER, DEPLOYMENT):
self.apiServer = APISERVER
self.deployment = DEPLOYMENT
self.interna... | 2.3125 | 2 |
junction/conferences/migrations/0005_emailreviewernotificationsetting.py | K-7/junction | 0 | 48883 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('proposals', '0003_auto_20150113_1401'),
... | 1.703125 | 2 |
operantanalysis/operantanalysis.py | NautiyalLab/MatLab-Scripts | 0 | 48884 | #!/usr/bin/env python3
import statistics
import os
import glob
from tkinter import filedialog
from tkinter import * # noqa
import pandas as pd
from eventcodes import eventcodes_dictionary
from natsort import natsorted, ns
import matplotlib.pyplot as plt
import numpy as np
import datetime
__all__ = ["loop_over_days",... | 2.296875 | 2 |
tripleo_ansible/tests/plugins/filter/test_range_list.py | beagles/tripleo-ansible | 22 | 48885 | <filename>tripleo_ansible/tests/plugins/filter/test_range_list.py
# Copyright 2020 Red Hat, Inc.
# 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
#
# ht... | 2.203125 | 2 |
boot.py | brainelectronics/Micropython-ESP-WiFi-Manager | 4 | 48886 | #!/usr/bin/env python3
# -*- coding: UTF-8 -*-
"""
boot script, do initial stuff here, similar to the setup() function on Arduino
"""
import esp
import gc
import network
import time
# custom packages
from be_helpers.led_helper import Led
# set clock speed to 240MHz instead of default 160MHz
# machine.freq(24000000... | 2.59375 | 3 |
app/config/devices.py | rbagrov/xana | 1 | 48887 | #!/usr/bin/env python
# -*- coding: utf8 -*-
import os
from functools import reduce
from Log import log
__title__ = 'Structure runner'
__all__ = ['Structure']
__author__ = '<NAME> <<EMAIL>>'
class Structure(object):
@staticmethod
def get_directory_structure(confdir: str) -> dict:
"""
Create... | 2.8125 | 3 |
example/aqi_curve_onecity.py | solider245/OpenData | 1,179 | 48888 | <reponame>solider245/OpenData<filename>example/aqi_curve_onecity.py<gh_stars>1000+
# encoding: utf-8
from opendatatools import aqi
from pyecharts import Line
import pandas as pd
if __name__ == '__main__':
df_aqi = aqi.get_daily_aqi_onecity('北京市')
df_aqi.set_index('date', inplace=True)
df_aqi.sort_index(a... | 2.671875 | 3 |
models/bert_spc.py | ninadakolekar/ABSA-PyTorch | 1 | 48889 | <reponame>ninadakolekar/ABSA-PyTorch<filename>models/bert_spc.py<gh_stars>1-10
# -*- coding: utf-8 -*-
# file: BERT_SPC.py
# author: songyouwei <<EMAIL>>
# Copyright (C) 2019. All Rights Reserved.
import torch
import torch.nn as nn
from layers.squeeze_embedding import SqueezeEmbedding
class BERT_SPC(nn.Module):
d... | 2.40625 | 2 |
python/ray/experimental/workflow/tests/test_storage.py | tdml13/ray | 39 | 48890 | import ray
from ray.experimental.workflow import storage
from ray.experimental.workflow import workflow_storage
def some_func(x):
return x + 1
def some_func2(x):
return x - 1
def test_raw_storage():
ray.init()
workflow_id = test_workflow_storage.__name__
raw_storage = storage.get_global_storag... | 2.34375 | 2 |
main/coins/models.py | Hawk94/coin_tracker | 0 | 48891 | from django.db import models
from django.utils import timezone
class BaseCoin(models.Model):
date = models.DateField(default=timezone.now)
exchange = models.CharField(max_length=100, blank=True, default='')
price = models.DecimalField(max_digits=12, decimal_places=4, default=0)
high = models.DecimalFi... | 2.265625 | 2 |
examples/tutorial_python/1_extract_pose.py | shalalalatuzki/openpose | 0 | 48892 | import sys
import cv2
import os
dir_path = os.path.dirname(os.path.realpath(__file__))
sys.path.append('../../python')
from openpose import *
params = dict()
params["logging_level"] = 3
params["output_resolution"] = "-1x-1"
params["net_resolution"] = "-1x368"
params["model_pose"] = "COCO"
params["alpha_pose"] = 0.6
pa... | 2.46875 | 2 |
FindResourcePtr.py | Strackeror/GhidraScripts | 1 | 48893 | from __future__ import print_function
from ghidra.program.model.address import Address
import platform
import ghidra
if (platform.system() != "Java"):
from ghidra_builtins import *
monitor = ghidra.util.task.TaskMonitor.DUMMY
def getFuncInstructions(function):
instructions = []
instruction = getFirstIns... | 2.03125 | 2 |
文件处理/重命名图片扩展名(拖拽文件夹到这里).py | mcmyth/Windows-Script | 0 | 48894 | <gh_stars>0
import sys
import os
from PIL import Image
args = list(sys.argv)
if len(args) > 1:
path = args[1] + "\\"
else:
print("输入文件夹路径或拖拽到此处按回车继续")
path = input()
try:
files = os.listdir(path)
except Exception as e:
print(f"[ERROR] {e}")
for i in files:
try:
i = path + i
fp ... | 2.921875 | 3 |
tests/test_random_coordinates.py | mikebenfield/scikit-learn-supp | 0 | 48895 | import unittest
import numpy as np
import sklearn_supp.random_coordinates as random_coordinates
class TestRandomCoordinateForestClassifier(unittest.TestCase):
"""These are just some simple sanity checks to make sure we don't get
exceptions.
"""
def test_simple(self):
X = [[0], [1]]
... | 3.109375 | 3 |
src/fchecker/exceptions/__init__.py | IncognitoCoding/fchecker | 0 | 48896 | <filename>src/fchecker/exceptions/__init__.py
# Exceptions
from .exceptions import InputFailure, InvalidKeyError
from fexception import FFileNotFoundError
from fexception import FAttributeError, FTypeError
| 1.507813 | 2 |
forloops/07.py | mallimuondu/python-homworks | 0 | 48897 | <gh_stars>0
cars= {
"bugati":1000$,
"ferari":9000$
}
b = int(input("whow m any are you printing: "))
c = list()
for b in range(d):
f = cars[input ("write what you want to select: ")]
g = e.append(f)
print("total amount is " + str(total)) | 3.671875 | 4 |
Alignment_Model/sequence_model.py | TheresaSchmidt/ara | 1 | 48898 | # Author : <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 applicable law or agreed to in writing, software
# d... | 2.1875 | 2 |
sra_ftp_urls.py | yaris19/SRA_toolkit | 0 | 48899 | <gh_stars>0
import argparse
import sys
from os import chmod
import requests
parser = argparse.ArgumentParser(
description="Download fastQ files from SRA accessions")
parser.add_argument("-i", "--id", default="", dest="sra_id", type=str,
help="accession id of a SRA (e.g. SRR1778454)")
parser.ad... | 3.046875 | 3 |