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 |
|---|---|---|---|---|---|---|
Sim_ATAV/vehicle_control/controller_commons/perception/object_creation/lidar_object.py | SahilDhull/autonomous | 3 | 53700 | <gh_stars>1-10
"""Defines LidarObject class.
----------------------------------------------------------------------------------------------------------
This file is part of Sim-ATAV project and licensed under MIT license.
Copyright (c) 2018 <NAME>, <NAME>, <NAME>, <NAME>, <NAME>.
For questions please contact:
<NAME> (e... | 2.546875 | 3 |
py-redis/redis.py | ganguera/py-redis | 0 | 53701 | import re
import time
import random
from redis_protocol.protocol import deserialize, serialize_string, serialize_error, serialize_integer, serialize_bulk_string, serialize_array
class RedisCommand(object):
def __init__(self, command, arguments, database_manager):
self.command = command.upper()
sel... | 2.578125 | 3 |
nomalib/devices.py | joeugenio/noma_simulation | 1 | 53702 | <filename>nomalib/devices.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Federal University of Campina Grande (UFCG)
# Author: <NAME>
# Date: 28/08/2017
# Last update: 30/01/2018
# Version: 1.0
# Python module for NOMA communications simulations
# The devices classes are declared here
# modules
import numpy as n... | 2.328125 | 2 |
skypy/galaxies/tests/test_schechter.py | itrharrison/skypy-itrharrison | 88 | 53703 | <reponame>itrharrison/skypy-itrharrison
import numpy as np
from astropy.cosmology import default_cosmology
def test_schechter_lf():
from pytest import raises
from skypy.galaxies import schechter_lf
from astropy import units
# redshift and magnitude distributions are tested separately
# only test... | 2.046875 | 2 |
products/management/commands/clear_products.py | kedmenec/commerce_api | 0 | 53704 | <reponame>kedmenec/commerce_api<filename>products/management/commands/clear_products.py
from django.core.management.base import BaseCommand
from products.models import Product
class Command(BaseCommand):
help = 'Clear all entries from the Product table'
def _delete_all_products(self):
Product.objects.... | 1.734375 | 2 |
robot_teleop_joy/nodes/robot_teleop_joy.py | open-robot/open-robot | 58 | 53705 | #!/usr/bin/env python
import thread
import rospy
from sensor_msgs.msg import Joy
from geometry_msgs.msg import Twist
from geometry_msgs.msg import PoseWithCovarianceStamped
twist = Twist()
pub = rospy.Publisher("cmd_vel", Twist, queue_size=10)
joystick_ready = False
lock_v = False
def initial_pose_reset():
pose... | 2.3125 | 2 |
lib/sys_LSF.py | galeadmn/aRNApipe | 15 | 53706 | <filename>lib/sys_LSF.py<gh_stars>10-100
# -*- coding: utf-8 -*-
import random
import os
import time
def get_bsub_arg(pars, L):
pars = pars.split("/")
bsub_suffix = list()
nproc = int(pars[0])
if pars[1] != "NA": # memory (Gb)
mem = str(int(pars[1]) * 1024)
bsub_suffix.append("-R rusag... | 2.421875 | 2 |
lecture_demos/13_Lecture_Demo.py | theCodingProfessor/intro_to_Python | 0 | 53707 | # Code Demo for 13 Lecture
# Working with Python Strings
# CIS 135 - Code Demo File
# Lecture example showing string contatenation
firstName = "Peter"
lastName = "Parker"
print("\nString Contcatenation in Pyton uses the + operator")
print(f'First Name = {firstName}')
print(f'Last Name = {lastName}')
print(... | 4.3125 | 4 |
examples/models.py | cat-x/fastapi-admin | 1 | 53708 | import datetime
from tortoise import Model, fields
from fastapi_admin.models import AbstractAdminLog, AbstractPermission, AbstractRole, AbstractUser
from .enums import ProductType, Status
class User(AbstractUser):
last_login = fields.DatetimeField(description="Last Login", default=datetime.datetime.now)
av... | 2.265625 | 2 |
tests/experiments/optimization/visualize_vertices.py | Anthony102899/Lego-ImageGenerator | 1 | 53709 | <reponame>Anthony102899/Lego-ImageGenerator
from matplotlib import pyplot as plt
import numpy as np
filename = "another_bridge_output.npz"
vertices = np.load(filename)["arr_0"]
for vertex_ind in (4, 5):
vertex = vertices[:, vertex_ind, :]
plt.plot(vertex[:, 0], vertex[:, 1], color="black")
plt.axis("equal... | 3.1875 | 3 |
dbtools/admin.py | snowminc/Groupformer | 1 | 53710 | <filename>dbtools/admin.py
from django.contrib import admin
# Register your models here.
from .models import *
class GroupFormerAdmin(admin.ModelAdmin):
search_fields = ['class_section']
class ProjectAdmin(admin.ModelAdmin):
search_fields = ['project_name']
class AttributeAdmin(admin.ModelAdmin):
pass
... | 1.992188 | 2 |
PyFlow/Packages/PyflowBase/UI/UIRerouteNode.py | dlario/PyFlow | 0 | 53711 | from Qt import QtCore
from Qt import QtGui
from Qt.QtWidgets import QGraphicsItem
from PyFlow.Core.Common import getConnectedPins
from PyFlow.UI import RESOURCES_DIR
from PyFlow.UI.Utils.Settings import *
from PyFlow.UI.Canvas.Painters import NodePainter
from PyFlow.UI.Canvas.UINodeBase import UINodeBase
class UIRer... | 2.296875 | 2 |
tests/test_words.py | pawamoy/mkdocs-spellcheck | 3 | 53712 | <filename>tests/test_words.py
"""Tests for the `cli` module."""
import pytest
from mkdocs_spellcheck.words import get_words
@pytest.mark.parametrize("tag", ["p", "em", "div", "article"])
def test_remove_tags(tag: str):
"""Assert tags are removed from HTML text.
Parameters:
tag: Some HTML tag (param... | 2.921875 | 3 |
smarts-imitation/scenarios/ngsim_us101/scenario.py | zbzhu99/NGSIM_Imitation | 3 | 53713 | from pathlib import Path
from smarts.sstudio import gen_scenario
from smarts.sstudio import types as t
traffic_histories = [
t.TrafficHistoryDataset(
name=f"us101_{hd}",
source_type="NGSIM",
input_path=f"../../xy-trajectories/us101/trajectories-{hd}.txt",
speed_limit_mps=28,
... | 2.078125 | 2 |
typeidea/file_from_pycharm.py | python-shell/cross_wall1 | 0 | 53714 | <gh_stars>0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2021/10/17 21:35
# @Author : jacson
# @FileName: file_from_pycharm.py
print("hello world!!!") | 1.273438 | 1 |
python/1094.py | josevictorp81/Uri-questions-solutions | 3 | 53715 | <reponame>josevictorp81/Uri-questions-solutions
def percentual(qtde, total):
return (100 * qtde) / total
n = int(input())
c = r = s = 0
for i in range(n):
val, tipo = input().split()
qtde = int(val)
if tipo == 'C':
c += qtde
if tipo == 'R':
r += qtde
if tipo == 'S':
... | 3.75 | 4 |
shortener/urls.py | warlock57/mybitly | 0 | 53716 | <reponame>warlock57/mybitly
from django.conf.urls import url
from .views import (
HomeView,
MyBitlyRedirectView,
)
urlpatterns = [
url(r'^$', HomeView.as_view(), name='home'),
url(r'^(?P<shortcode>[\w-]+)$', MyBitlyRedirectView.as_view(), name='short'),
]
| 1.875 | 2 |
control_latest.py | fcitil/UORG_CV_REAL | 0 | 53717 | #!/usr/bin/env python3
"""
Caveat when attempting to run the examples in non-gps environments:
`drone.offboard.stop()` will return a `COMMAND_DENIED` result because it
requires a mode switch to HOLD, something that is currently not supported in a
non-gps environment.
"""
import asyncio
from math import sqrt
from mav... | 2.625 | 3 |
pywatcher/command.py | denzow/pywatcher | 7 | 53718 | # coding: utf-8
import argparse
import time
from watchdog.observers import Observer
from pywatcher import PyWatcher
from logging import getLogger, Formatter, StreamHandler, DEBUG
logger = getLogger(__name__)
formatter = Formatter('%(asctime)s - %(levelname)s - %(message)s')
handler = StreamHandler()
handler.setLevel(... | 2.6875 | 3 |
augeo/settings/components/django-suit.py | plankter/augeo-cloud | 1 | 53719 | # See: http://django-suit.readthedocs.org/en/develop/
SUIT_CONFIG = {
# header
'ADMIN_NAME': 'Augeo',
# 'HEADER_DATE_FORMAT': 'l, j. F Y',
# 'HEADER_TIME_FORMAT': 'H:i',
} | 1.296875 | 1 |
packages/wakatime/wakatime/queue.py | AppVentus/AvTime-client | 1 | 53720 | # -*- coding: utf-8 -*-
"""
wakatime.queue
~~~~~~~~~~~~~~
Queue for offline time logging.
http://wakatime.com
:copyright: (c) 2014 <NAME>.
:license: BSD, see LICENSE for more details.
"""
import logging
import os
import traceback
from time import sleep
try:
import sqlite3
HAS_SQL = T... | 2.5 | 2 |
docs/tutorials/masking_audio_signals.py | ZhaoJY1/nussl | 259 | 53721 | # ---
# jupyter:
# jupytext:
# formats: ipynb,py:light
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.5.1
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
# Separation via Time-Fre... | 2.9375 | 3 |
tests/commands/test_run_commands.py | tableau/tabcmd | 3 | 53722 | <reponame>tableau/tabcmd
import argparse
import unittest
from unittest.mock import *
import tableauserverclient as TSC
from tabcmd.commands.auth import login_command, logout_command
from tabcmd.commands.datasources_and_workbooks import (
delete_command,
export_command,
get_url_command,
publish_command,... | 2.15625 | 2 |
lib/rehydrator.py | Christina3107/LNU_1DT305_ReHydrator | 0 | 53723 | <reponame>Christina3107/LNU_1DT305_ReHydrator
#Module containing functions for calculating various ReHydrator values
#Tankinfo
#diameter = 16,8cm
#radius = 8,4cm
#max waterlevel (= height) = 20cm
#max volume = 4433,42cm3
#sensorheight (from tank bottom)= 29,3cm
import time
from machine import Pin
from dht import DHT
im... | 3.140625 | 3 |
tests/test_coordinates.py | mberz/spharpy | 0 | 53724 | <filename>tests/test_coordinates.py<gh_stars>0
import numpy as np
import numpy.testing as npt
import pytest
import spharpy
from spharpy.samplings.coordinates import Coordinates, SamplingSphere
from spharpy.samplings import sph2cart, cart2sph, cart2latlon
def test_coordinates_init():
coords = Coordinates()
as... | 2.21875 | 2 |
gen_models/new_vrnn.py | yifan-you-37/rl_swiss | 56 | 53725 | <reponame>yifan-you-37/rl_swiss
import torch
import torch.nn as nn
from torch.autograd import Variable
import torch.nn.functional as F
from convgru import ConvGRUCell
from gen_models import make_conv_net, make_fc_net, make_upconv_net
import numpy as np
from numpy import pi
from numpy import log as np_log
log_2pi = np... | 2.03125 | 2 |
content/test/gpu/gpu_tests/info_collection_test.py | zipated/src | 2,151 | 53726 | <reponame>zipated/src
# Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from gpu_tests import gpu_integration_test
from gpu_tests.gpu_test_expectations import GpuTestExpectations
import sys
# There are no ... | 2.21875 | 2 |
glitch/Main.py | JasonKhew96/GlitchPy | 0 | 53727 | <reponame>JasonKhew96/GlitchPy
import logging
from operator import itemgetter
from random import randint
from time import sleep
from glitch.Config import is_config_new, is_session_key_exist, is_valid, get_username, get_password, get_session_key, \
get_upgrade
from glitch.api.Attack import Attack
from glitch.api.Ba... | 2.40625 | 2 |
main.py | CosmodiumCS/OnlyRAT | 21 | 53728 | #!/usr/bin/python
# python console for OnlyRAT
# created by : C0SM0
# imports
import os
import sys
import getpass
import random as r
from datetime import datetime
# banner for display
banner = """
_;,
... | 1.71875 | 2 |
Chatbot.py | stardust55/SoniFer | 0 | 53729 | <gh_stars>0
# import Chatbot module from chatterbot library
# import ChatterBotCorpusTrainer from chatterbot.trainers library
# import ListTrainer from chatterbot.trainers library
# importing json file
from chatterbot import ChatBot
from chatterbot.trainers import ChatterBotCorpusTrainer
from chatterbot.trainers ... | 3.046875 | 3 |
src/3. Sistemas de ecuaciones no lineales/sis_no_lineales.py | thonyblaz/Numerical-Methods | 1 | 53730 |
import Metodos.pf_multivariable
import Metodos.pf_desplazado
import Metodos.NewthonR_Mult
import Metodos.Newton_modificado
import math
def datos():
ecua = []
var = []
valor = []
Ecuaciones = int(input("Numero de ecuaciones:"))
print("Variables:")
for i in range(1, Ecuaciones+1):
vari... | 4.03125 | 4 |
review-sentiment/sentiment-backend/sentiment/config.py | aldeeb/xai-demonstrator | 8 | 53731 | from pydantic import BaseSettings
class Settings(BaseSettings):
service_name: str = "sentiment-service"
root_path: str = ""
path_prefix: str = ""
# Explanation configuration
default_explainer: str = "integrated_gradients"
default_target: int = 4
settings = Settings()
| 1.921875 | 2 |
dataset/random_tree.py | amosproj/amos-ss2020-metadata-hub | 9 | 53732 | <reponame>amosproj/amos-ss2020-metadata-hub<filename>dataset/random_tree.py<gh_stars>1-10
"""Create a random directory tree with given data.
This module creates a random directory tree structure and (randomly) copies
the input data inside this tree structure.
It is used for converting a flat directory into a hierarchi... | 3.046875 | 3 |
python_libraries/numpy_lib.py | peter88tom/python_rebooted | 0 | 53733 | <reponame>peter88tom/python_rebooted<gh_stars>0
"""
NumPy is a general-purpose-array-processing package.
It provide a high performance multidimensional array object,
"""
import numpy as np
# Creating array object
arr = np.array([[1, 2, 3],
[4, 2, 5]])
# Print type of array
print(f"Array is of type: {ty... | 3.0625 | 3 |
src/czml3/utils.py | idanmiara/czml3 | 0 | 53734 | <filename>src/czml3/utils.py<gh_stars>0
from .properties import Color
def get_color(color):
# Color.from_string, Color.from_int, ...
if isinstance(color, str) and 6 <= len(color) <= 10:
return Color.from_str(color)
elif isinstance(color, int):
return Color.from_hex(color)
elif isinstan... | 2.90625 | 3 |
src/etc/dl-snapshot.py | wesleywiser/cargo | 0 | 53735 | <gh_stars>0
import distutils.spawn
import hashlib
import os
import subprocess
import sys
import tarfile
import shutil
import contextlib
with open('src/snapshots.txt') as f:
lines = f.readlines()
date = lines[0]
linux32 = lines[1]
linux64 = lines[2]
mac32 = lines[3]
mac64 = lines[4]
win32 = lines[5]
win64 = lines[... | 2.03125 | 2 |
hypertransformer/tf/core/layerwise_defs.py | dumpmemory/google-research | 0 | 53736 | <reponame>dumpmemory/google-research<gh_stars>0
# coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# 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/lice... | 2.3125 | 2 |
pyaltmetric/__init__.py | CenterForOpenScience/PyAltmetric | 15 | 53737 | """
PyAltmetric
This is a python wrapper for the Altmetric API.
For more information on the Altmetric API visit http://api.altmetric.com/.
Some pieces of this library were inspired by or derived from the altmetric api
wrapper altmetric.py which is licensed under the MIT open source license.
If you display Altmetric ... | 2.5625 | 3 |
src/model/FeatureWeighting/SearchFieldWeightICMRecommender.py | riccardopoiani/recsys_2019 | 2 | 53738 | from course_lib.Base.BaseRecommender import BaseRecommender
import numpy as np
import scipy.sparse as sps
class SearchFieldWeightICMRecommender(BaseRecommender):
""" Search Field Weight ICM Recommender """
RECOMMENDER_NAME = "SearchFieldWeightICMRecommender"
def __init__(self, URM_train, ICM_train, reco... | 2.3125 | 2 |
backend/stock-data/main.py | koolgax99/stockinator | 10 | 53739 | import datetime
import json
import pandas as pd
import yfinance as yf
from yahoofinancials import YahooFinancials
from fastapi import FastAPI
app = FastAPI()
@app.get("/stock/{ticker}")
async def get_stock_data(ticker: str):
ticker_data = yf.Ticker(ticker).info
mktopen = ticker_data["open"]
mkthigh = ti... | 2.640625 | 3 |
tests.py | knutsenfiksdal/Oving_7 | 0 | 53740 | <filename>tests.py
import unittest
from tur import Tur, Posisjon
class TestTur(unittest.TestCase):
def test_slutt_tidspunkt(self):
tur1 = Tur('tur', 0, 15)
tur2 = Tur('tur', 4, 6)
self.assertGreater(tur1.sluttidspunkt, tur1.starttidspunkt)
self.assertEqual(15, tur1.sluttidspunkt)
... | 3.3125 | 3 |
tilse/util/sentence_segmentation.py | arianpasquali/tilse | 0 | 53741 | <filename>tilse/util/sentence_segmentation.py<gh_stars>0
import syntok.segmenter as segmenter
def sentence_segmenter(document):
sentences = []
for paragraph in segmenter.process(document):
for sentence in paragraph:
s_sentence = ""
for token in sentence:
# roughl... | 3.34375 | 3 |
main.py | Taha-Topaloglu/A-Night-in-a-Crime-Scene | 0 | 53742 | def convert(my_str):
my_list = list(my_str.split(' '))
return my_list
values = {}
times = {}
weights = {}
ids = []
f = open('crime_scene.txt')
my_lines = f.readlines()
stripped_lines = [line.strip() for line in my_lines]
f.close()
N = int(stripped_lines[1])
w = int(convert(stripped_lines[0])[0])... | 2.9375 | 3 |
ois_api_client/v3_0/dto/DetailedReason.py | peterkulik/ois_api_client | 7 | 53743 | <reponame>peterkulik/ois_api_client
from dataclasses import dataclass
@dataclass
class DetailedReason:
"""Detailed justification of exemption
:param case: Case notation with code
:param reason: Case notation with text
"""
case: str
reason: str
| 1.65625 | 2 |
neat/commands/command.py | codecat-pl/neat4python | 1 | 53744 | class Command:
def exec(self, ob):
met = getattr(self, "on"+type(ob).__name__)
return met(ob)
def onNode(self, a):
pass
def onConnection(self, a):
pass
def onGenome(self, a):
pass
| 2.171875 | 2 |
blog/migrations/0005_auto_20180328_0653.py | leventaysan/My-first-project | 0 | 53745 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2018-03-28 06:53
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blog', '0004_auto_20180314_1027'),
]
operations = [
migrations.AddField(
... | 1.445313 | 1 |
legacy/extractor/pyclowder/utils.py | mgjo5899/resume-categorizer | 9 | 53746 | """Clowder Utils
This module contains utilities that make it easier to work with clowder.
Amongst these utilities is a simple way to initialize the logging system
from either a file or the command line.
"""
import datetime
import json
import logging
import logging.config
import os
import time
import zipfile
import te... | 2.890625 | 3 |
dph/util.py | jinscoe123/dph | 2 | 53747 | <filename>dph/util.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
from functools import reduce
import operator
__all__ = [ 'product' ]
def product(*args):
return reduce(operator.mul, args)
| 2.203125 | 2 |
test/test7.py | DynamicCai/Dynamic-Explorer | 0 | 53748 | <reponame>DynamicCai/Dynamic-Explorer
import numpy as np
custom_data = np.genfromtxt("C:\\Users\\Administrator\\Desktop\\MouseWithoutBorders\\FittingDog\\FittingDog\\S_cell NaOH Urea 2.0.txt", delimiter="", skip_header=3)
print(custom_data) | 2.03125 | 2 |
digest_csvs.py | jlcanovas/sourcecred-tooling | 0 | 53749 | <gh_stars>0
#!/usr/bin/python
#
# This script generates a simple HTML page (via STDOUT) including tables for the data generated by join_csvs.py script.
# Each table will contain 3 x 2 colums, that is, 3 columns per CSV file (currently only 2 CSV files are supported).
#
# The resulting table is something like:
# name... | 3.390625 | 3 |
blog/migrations/0004_post_category.py | tahasama/T-Blogit | 0 | 53750 | <gh_stars>0
# Generated by Django 3.1.5 on 2021-01-20 14:06
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('blog', '0003_category'),
]
operations = [
migrations.AddField(
model_... | 1.742188 | 2 |
src/compas_slicer/parameters/defaults_interpolation_slicing.py | Spiritdude/compas_slicer | 14 | 53751 | <gh_stars>10-100
__all__ = ['interpolation_slicing_default_param']
def interpolation_slicing_default_param(key):
""" Returns the default parameters with the specified key. """
if key in default_parameters:
return default_parameters[key]
else:
raise ValueError('The parameter with key : ' + ... | 2.390625 | 2 |
server/apps/streamfilter/actions/types.py | iotile/iotile_cloud | 0 | 53752 |
FILTER_ACTION_ON_CHOICES = (
('entry', 'On Entry'),
('exit', 'On Exit'),
)
FILTER_ACTION_TYPE_CHOICES = (
('eml', 'Send Email Notification'),
('sms', 'Send SMS Notification'),
('slk', 'Send Slack Notification'),
('cus', 'Custom Action'),
('drv', 'Derive Stream Action'),
('rpt', 'Report... | 1.554688 | 2 |
pretrain/src/encoding.py | affjljoo3581/Samsung-AI-Challenge-for-Scientific-Discovery | 35 | 53753 | from typing import Dict, List, Optional, Union
import numpy as np
import torch
MOLECULAR_ATOMS = (
"H,He,Li,Be,B,C,N,O,F,Ne,Na,Mg,Al,Si,P,S,Cl,Ar,K,Ca,Sc,Ti,V,Cr,Mn,Fe,Co,Ni,Cu,Zn,"
"Ga,Ge,As,Se,Br,Kr,Rb,Sr,Y,Zr,Nb,Mo,Tc,Ru,Rh,Pd,Ag,Cd,In,Sn,Sb,Te,I,Xe,Cs,Ba,La,Ce,"
"Pr,Nd,Pm,Sm,Eu,Gd,Tb,Dy,Ho,Er,Tm,Yb,Lu... | 2.640625 | 3 |
docs/circuit.py | smishraIOV/ri-aggregation | 1,274 | 53754 | <reponame>smishraIOV/ri-aggregation
# Citcuit pseudocode
# Data structures
struct op:
# operation data
tx_type: # type of transaction, see the list: https://docs.google.com/spreadsheets/d/1ejK1MJfVehcwjgjVDFD3E2k1EZ7auqbG_y0DKidS9nA/edit#gid=0
chunk: # op chunk number (0..3)
... | 2.140625 | 2 |
mooring/test_setup.py | jawaidm/moorings | 0 | 53755 | from django.test import TestCase
from django.test import Client
from mixer.backend.django import mixer
from django.conf import settings
from importlib import import_module
import time
from .models import *
#from drf_extra_fields.geo_fields import PointField
from django.contrib.gis.geos import Point
from ledger.accounts... | 1.960938 | 2 |
templatetags/filters.py | riggedCoinflip/mydjango | 0 | 53756 | <gh_stars>0
from django import template
register = template.Library()
@register.filter
def to_percent(obj, significant_digits):
return f'{(obj * 100):.{significant_digits}f}'
| 1.9375 | 2 |
saspy/tests/test_sassession.py | RoyalTS/saspy | 2 | 53757 | <filename>saspy/tests/test_sassession.py
import unittest
import saspy
import os
from IPython.utils.tempdir import TemporaryDirectory
class TestSASsessionObject(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.sas = saspy.SASsession()
@classmethod
def tearDownClass(cls):
if cls... | 2.625 | 3 |
garuda/garudaclientbackend.py | kozo2/keggclient-gadget | 0 | 53758 | <gh_stars>0
#-*- coding:utf-8 -*-
##############################################
# GARUDA CLIENT SDK
# Reference: Garuda Base Protocol Version 1.1
# Last Updated: 07-Aug-2015
##############################################
import sys
import time
import json
import socket
import threading
# Configuration for Garuda Co... | 1.90625 | 2 |
dqn/data_structures/segment_tree.py | Reddy2/modular-dqn | 0 | 53759 | <gh_stars>0
import math
import operator
import numpy as np
class SegmentTree:
def __init__(self, capacity, operation, identity_element):
# Capacity is number of leaf nodes. There are 2*capacity - 1 elements in the entire tree
# Nodes in tree: 2^0 + 2^1 + 2^2 + ... 2^(n - 1) = 2^n - 1
# ... | 3.078125 | 3 |
bcs-ui/backend/container_service/clusters/permissions.py | laodiu/bk-bcs | 0 | 53760 | <reponame>laodiu/bk-bcs<filename>bcs-ui/backend/container_service/clusters/permissions.py
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2021 <NAME>, a Tencent company. All rights reserved.
Licen... | 1.6875 | 2 |
F0-06-ManageMaterials.py | dreierpawel/IronPythonRVT | 0 | 53761 | <reponame>dreierpawel/IronPythonRVT
# P.DREIER © github.com/dreierpawel
import clr
import sys
sys.path.append('C:\Program Files (x86)\IronPython 2.7\Lib')
import System
from System import Array
from System.Collections.Generic import *
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
cl... | 2.09375 | 2 |
ServiceMod.py | menikhilpandey/RepIgnite | 0 | 53762 | import easygui
# TODO: In next version use easygui.multenterbox instead of independent enterbox
class Service:
def __init__(self):
self.employerName = easygui.enterbox(msg="Enter Name of Employer", title="Service Visit Inputs")
self.employerAddr = easygui.enterbox(msg="Enter Address of Employer"... | 2.90625 | 3 |
groupbytime/groupbytime.py | daviskirk/groupbytime | 4 | 53763 | <reponame>daviskirk/groupbytime
#!/usr/bin/env python
"""groupbytime assists pandas grouping by providing an easier to grouping
DataFrames and Series by timedeltas and periods.
"""
import pandas as pd
try:
import matplotlib as mpl
except ImportError as e:
mpl = None
def since_last(index, freq='H', unit=No... | 3.140625 | 3 |
flow/utils/commons.py | jander99/flow | 36 | 53764 | <filename>flow/utils/commons.py
#!/usr/bin/python
#commons.py
import json
import os
import re
import subprocess
import sys
from enum import Enum
from pydispatch import dispatcher
from flow.logger import Logger
class Commons:
quiet = False
content_json = 'application/json'
build_config_file = 'buildConfig.json... | 2.140625 | 2 |
landmark-recognition-2019/distribute_predict.py | StudyExchange/Kaggle | 2 | 53765 | <gh_stars>1-10
import os
import json
import time
import redis
import platform
platform_name = platform.platform().lower()
is_win = 'windows' in platform_name
# tensorflow
import tensorflow as tf
if not is_win:
import keras.backend.tensorflow_backend as KTF
# Keras
import keras
from keras.utils import Sequence
fr... | 2 | 2 |
olympics/olympics.py | npandelakis/cs257 | 0 | 53766 | <gh_stars>0
'''
olympics.py
A command line interface for querying the olympics database.
Written by <NAME> for cs257
'''
import psycopg2
import argparse
from config import user, password, database
def connect_to_database():
try:
connection = psycopg2.connect(database = database, user = user, password = pa... | 3.234375 | 3 |
tests/test_util.py | gszabi15/ncoreparser | 10 | 53767 | import pytest
from ncoreparser.util import Size
class TestSize:
@pytest.mark.parametrize("size1, size2", [("1024 MiB", "1 GiB"),
("10 MiB", "10 MiB"),
("2048 KiB", "2 MiB")])
def test_equal(self, size1, size2):
... | 2.578125 | 3 |
bw_add_sshkeys.py | raph2i/bitwarden-ssh-agent | 0 | 53768 | #!/usr/bin/env python3
"""
Extracts SSH keys from Bitwarden vault
"""
import argparse
import json
import logging
import os
import subprocess
import pexpect
import time
from pkg_resources import parse_version
def memoize(func):
"""
Decorator function to cache the results of another function call
"""
... | 2.53125 | 3 |
folio/routes/article.py | syegulalp/folio | 26 | 53769 | from bottle import (
template,
route,
redirect,
request,
)
from models import (
Article,
ArticleLinks,
Wiki,
Author,
Tag,
Metadata,
)
from peewee import SQL
from .decorators import *
from .wiki import wiki_home
from .media import image_search
from utils import Message, Error,... | 2.5 | 2 |
healthgen/generation/models/__init__.py | simonbing/HealthGen | 0 | 53770 | <reponame>simonbing/HealthGen<filename>healthgen/generation/models/__init__.py
from healthgen.generation.models.vae import VAE
from healthgen.generation.models.multi_vae import MultiVAE
from healthgen.generation.models.healthgen import HealthGen
from healthgen.generation.models.srnn import SRNN
from healthgen.generatio... | 1.15625 | 1 |
setup.py | tbrekalo/mini | 3 | 53771 | <reponame>tbrekalo/mini
import sys
from skbuild import setup
setup(
name="minipy",
version="1.3.0",
author="<NAME>",
author_email="<EMAIL>",
description="Minimizer extraction utility library as described in minimap paper",
url="https://github.com/tbrekalo/mini",
license="BSD",
packages=... | 1.195313 | 1 |
pkmn_type_scrapper.py | Cesar-Miranda/Pkm_Scrapper_DataAnalysis | 0 | 53772 | import scrapy
from scrapy.crawler import CrawlerProcess
def pkm_spider():
class PkmSpider(scrapy.Spider):
name = 'pkms'
def start_requests(self):
yield scrapy.Request('https://bulbapedia.bulbagarden.net/wiki/Bulbasaur_(Pok%C3%A9mon)')
def parse(self, response):
ite... | 2.953125 | 3 |
cotidia/blog/migrations/0009_auto_20190602_1908.py | guillaumepiot/cotidia-blog | 0 | 53773 | <reponame>guillaumepiot/cotidia-blog
# Generated by Django 2.0.1 on 2019-06-02 19:08
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('blog', '0008_unique_uuid'),
]
operations = [
migrations.AlterModelOptions(
name='article',
... | 1.835938 | 2 |
presalytics/client/presalytics_ooxml_automation/models/chart_plot_type.py | presalytics/python-client | 4 | 53774 | # coding: utf-8
"""
OOXML Automation
This API helps users convert Excel and Powerpoint documents into rich, live dashboards and stories. # noqa: E501
The version of the OpenAPI document: 0.1.0-no-tags
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import si... | 2.28125 | 2 |
dsw2to3/connection/mongo.py | ds-wizard/dsw2to3 | 0 | 53775 | import datetime
import gridfs # type: ignore
import pymongo # type: ignore
import tenacity
from typing import Optional
from dsw2to3.config import MongoConfig
from dsw2to3.errors import ERROR_HANDLER
from dsw2to3.logger import LOGGER
DOCUMENT_FS_COLLECTION = 'documentFs'
ASSETS_FS_COLLECTION = 'templateAssetFs'
d... | 2.34375 | 2 |
update_corey_schafer.py | NathanKr/pandas-playground | 0 | 53776 | <gh_stars>0
import pandas as pd
people = {
"first": ["Nathan", 'Jane', 'John'],
"last": ["Krasney", 'Doe', 'Doe'],
"email": ["<EMAIL>", '<EMAIL>', '<EMAIL>']
}
def to_upper(item : str):
return item.upper()
df = pd.DataFrame(people)
print(f'df , type(df) : {type(df)}\n{df}')
# update columns name
... | 4.21875 | 4 |
src/HurriModel.py | Inforecast/metrics | 0 | 53777 | <gh_stars>0
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
from geopy.distance import great_circle as vc
import math as Math
from sklearn.preprocessing import MinMaxScaler
from sklearn.preprocessing import StandardScaler
from keras.models import Sequential
from keras.layers.core import Dense,... | 2.3125 | 2 |
example_echo_server.py | lxndrdagreat/udp-socket-server | 3 | 53778 | from server import ThreadedUDPServer
import threading
# Create the server instance and assign the binding address for it
server = ThreadedUDPServer(('localhost', 9999))
# Set up a few example event handlers
@server.on('connected')
def connected(msg, socket):
""" Both 'connected' and 'disconnected' are events
... | 3.484375 | 3 |
scripts/wasserstein_05.py | Julia820/ROK | 0 | 53779 | <reponame>Julia820/ROK
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue May 18 12:58:09 2021
@author: jakub
"""
from random import *
from tqdm import tqdm
import linecache
import csv
import IsoSpecPy
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("-K", help = 'Enter the ... | 2.40625 | 2 |
muapi/dbConnector.py | petrstehlik/muapi | 0 | 53780 | <filename>muapi/dbConnector.py
import os
import json
import logging
log = logging.getLogger(__name__)
class dbConnector(object):
"""
Database connector singleton class
:param provider = "mongodb",
:param server = "localhost",
:param port = 27017,
:param db = "liberouter",
:param users = "... | 3.171875 | 3 |
app/__init__.py | synqs/ArduinoMagnetometerLogger | 0 | 53781 | from flask import Flask
from flask_bootstrap import Bootstrap
from flask_socketio import SocketIO
from config import Config
import eventlet
eventlet.monkey_patch()
# where should I move this normally ?
async_mode = None
app = Flask(__name__)
bootstrap = Bootstrap(app)
socketio = SocketIO(app, async_mode='eventlet')
... | 1.773438 | 2 |
bioplotlib/collections.py | darcyabjones/bioplotlib | 0 | 53782 | <reponame>darcyabjones/bioplotlib
""" Extension of matplotlib collections.
Classes for the efficient drawing of large collections of objects that
share most properties, e.g., a large number of line segments or
polygons.
The classes are not meant to be as flexible as their single element
counterparts (e.g., you may no... | 2.40625 | 2 |
tests/functional/user/test_delete.py | DavidWalshe93/The_Phoenix_Project | 0 | 53783 | """
Author: <NAME>
Date: 15 May 2021
"""
import json
from copy import deepcopy
import pytest
from flask import Response
from tests.functional.utils import FlaskTestRig, login, token_auth_header_field
@FlaskTestRig.setup_app(n_users=3)
def test_delete_me_no_auth_401(client_factory, make_users, **kwargs):
... | 2.796875 | 3 |
sensors/kalman/util/measure_thrusters.py | cuauv/software | 70 | 53784 | <gh_stars>10-100
#!/usr/bin/env python2
'''
measure_thrusters.py attempts to determine the impulse response
of each thruster for system identification.
That is, suppose:
T(t) = thrust value at time t
R(t) = angular rate at time t
R(t) depends upon T(tao) for tao < t
If we assume that R is linear in T and time-invariant... | 2.859375 | 3 |
temps2.py | reasner/temps | 0 | 53785 | <reponame>reasner/temps
import os
import pandas as pd
import geopandas as gpd
import matplotlib.pyplot as plt
#SETUP
cd = os.path.join(os.path.expanduser("~"),r'Documents',r'projects',r'temps')
cd_dotdot = os.path.join(os.path.expanduser("~"),r'Documents',r'projects')
if not os.path.exists(os.path.join(cd,r'simple_map... | 2.15625 | 2 |
net/dataset/build.py | sdjsngs/Cross-Epoch-Learning-for-Weakly-Supervised-Anomaly-Detection-in-Surveillance-Videos | 3 | 53786 | """
model construction function
"""
import torch
import torch.nn as nn
from fvcore.common.registry import Registry
DATASET_REGISTRY=Registry("DATASET")
def build_dataset(dataset_name,mode,cfg,):
"""
:param cfg:
:param dataset_name: avenue
:param mode: train /test
:return:
"""
# print(... | 2.671875 | 3 |
bin/nslerp.py | brsr/antitile | 11 | 53787 | <reponame>brsr/antitile<filename>bin/nslerp.py
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Nslerp surfaces.
"""
import argparse
import numpy as np
from antitile import projection, flat, off
np.seterr(divide='ignore', invalid='ignore')
TRIANGLE = np.array([[0, 1],
[-np.sqrt(3)/2, -0.5],
... | 3.09375 | 3 |
src/attack/attack.py | rcgonzalez9061/m2v-adversarial-hindoird | 0 | 53788 | from __future__ import print_function
from scipy import sparse
import pandas as pd
import numpy as np
import argparse, os
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision import datasets, transforms
from torch.optim.lr_scheduler import StepLR
from torch.uti... | 2.21875 | 2 |
COT/commands/install_helpers.py | morneaup/cot | 81 | 53789 | <filename>COT/commands/install_helpers.py
#!/usr/bin/env python
#
# install_helpers.py - Implements "cot install-helpers" command
#
# February 2015, <NAME>
# Copyright (c) 2014-2017 the COT project developers.
# See the COPYRIGHT.txt file at the top-level directory of this distribution
# and at https://github.com/glenn... | 2.40625 | 2 |
models/train_regressor.py | sachindevangan/Capstone-Stock-Market-Prediction | 0 | 53790 | # importing libraries
import warnings
warnings.filterwarnings("ignore")
import sys
import pandas as pd
import numpy as np
from matplotlib import pyplot as plt
import xgboost as xgb
from catboost import CatBoostRegressor
import lightgbm as lgb
from sqlalchemy import create_engine
import pickle
from sklearn.metrics impor... | 2.734375 | 3 |
sudoku/solver.py | laazy/gamer-solver | 0 | 53791 | from typing import Tuple, List
puzzle = [
# || ||
[0, 0, 4, 0, 0, 7, 0, 6, 0],
[0, 0, 0, 1, 0, 0, 0, 0, 0],
[2, 0, 0, 0, 0, 0, 9, 3, 0],
# || ||
[0, 0, 0, 0, 0, 5, 0, 0, 2],
[0, 0, 0, 0, 0, 0, 0, 4, 0],
[0, 0, 0, 0, 3, 2, 5, 7, 0],
# || ||
[5,... | 3.78125 | 4 |
pip_services3_expressions-3.3.4/pip_services3_expressions/calculator/functions/DefaultFunctionCollection.py | pip-services3-python/pip-services3-expressions-python | 0 | 53792 | <filename>pip_services3_expressions-3.3.4/pip_services3_expressions/calculator/functions/DefaultFunctionCollection.py
# -*- coding: utf-8 -*-
import math
import random
from datetime import datetime
from typing import List
from pip_services3_expressions.calculator.ExpressionException import ExpressionException
from pi... | 2.046875 | 2 |
main.py | franciskoinno/stock_scanner | 0 | 53793 | <reponame>franciskoinno/stock_scanner<filename>main.py<gh_stars>0
from selenium import webdriver
# github change
# git change
chrome_driver_path = r"C:\Users\Francis\Desktop\chromedriver_win32\chromedriver.exe"
driver_long_lower_shadow = webdriver.Chrome(chrome_driver_path)
driver_hammer = webdriver.Chrome(chrome_driv... | 2.265625 | 2 |
geosolver/utils/run_utils.py | mhrmm/geosolver | 83 | 53794 | from geosolver.utils.prep import sentence_to_words_statements_values
__author__ = 'minjoon'
def test_prep():
paragraph = r"If \sqrt{x+5}=40.5, what is x+5?"
print(sentence_to_words_statements_values(paragraph))
if __name__ == "__main__":
test_prep()
| 2.359375 | 2 |
local_searchs/neighbor.py | vitor-veras/bag-problem | 0 | 53795 | <gh_stars>0
# -*- coding: utf-8 -*-
import random
import copy
from local_searchs.heuristic import Heuristic
class Neighbor(object):
def __init__(self, state):
self.state = state
self.bagState = state[0]
self.itemState = state[1]
def generateState(self):
#State = [[V_1, V_2, V_... | 2.703125 | 3 |
server/run.py | henri-hulski/morepath_cerebral_todomvc | 3 | 53796 | <filename>server/run.py
import morepath
import webob
from webob.static import DirectoryApp, FileApp
from .app import App
def run(): # pragma: no cover
morepath.autoscan()
index = FileApp("static/index.html")
static = DirectoryApp("static")
app = App()
@webob.dec.wsgify
def morepath_with_sta... | 2.265625 | 2 |
Machine Learning Models/Similarity Checker/similarity_checker.py | aaryan2134/proctorLy | 0 | 53797 | <gh_stars>0
import numpy as np
from gensim.models.keyedvectors import KeyedVectors
# use this command to download the file - !wget -P /root/input/ -c "https://s3.amazonaws.com/dl4j-distribution/GoogleNews-vectors-negative300.bin.gz"
saved_vectors = 'GoogleNews-vectors-negative300.bin.gz'
EMBEDDING_FILE = 'GoogleNews-v... | 3.09375 | 3 |
lab4/moose_csp.py | Calcifer777/mit-6034 | 0 | 53798 | <filename>lab4/moose_csp.py
#!/usr/bin/env python
"""
Implementation of the Moose/Obama/Biden/McCain/Palin problem
from Quiz 2 of 2008.
"""
import sys
from csp import CSP, Variable, BinaryConstraint, solve_csp_problem, \
basic_constraint_checker
def moose_csp_problem():
constraints = []
# We start with th... | 2.84375 | 3 |
backend/flask/apiks_flask_API.py | yasenn/apiks | 0 | 53799 | <filename>backend/flask/apiks_flask_API.py
#!/usr/bin/env python3
from settings import *
import json
from api import api
db = SQLAlchemy(app)
class Session_list(db.Model):
__tablename__ = 'Session_list' # creating a table name
id = db.Column(db.Integer, primary_key=True) # this is the primary key
clien... | 2.828125 | 3 |