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 |
|---|---|---|---|---|---|---|
orchestrator/domain/base.py | workfloworchestrator/orchestrator-core | 15 | 12792051 | <filename>orchestrator/domain/base.py
# Copyright 2019-2020 SURF.
# 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 applic... | 1.679688 | 2 |
texturizer/emoticons.py | john-hawkins/Text_Feature_Generator | 3 | 12792052 | # -*- coding: utf-8 -*-
import pandas as pd
import numpy as np
import codecs
import re
from .process import load_word_list
from .process import load_word_pattern
from .process import remove_urls_and_tags
from .process import remove_escapes_and_non_printable
smiles = load_word_list("emoticons-smile.dat")
laughs = loa... | 2.890625 | 3 |
accounts/migrations/0002_auto_20200724_0209.py | LuizFelipeGondim/AUline | 0 | 12792053 | <filename>accounts/migrations/0002_auto_20200724_0209.py<gh_stars>0
# Generated by Django 3.0.8 on 2020-07-24 02:09
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accounts', '0001_initial'),
]
operations = [
migrations.AlterField(
... | 1.289063 | 1 |
src/models.py | VasudhaJha/URLShortner | 0 | 12792054 | from pydantic import BaseModel
class URL(BaseModel):
long_url: str
class ShortURL(BaseModel):
short_url: str
| 2.234375 | 2 |
HackMarathon5/HackMarathon5_Closed_Part.py | FaboBence/HackMarathon_MechaHU_5 | 0 | 12792055 | <gh_stars>0
from copy import deepcopy
# Closed part
def create_path(word, dictionary):
lista = [word]
puffer=[dictionary[word]]
while True:
if len(dictionary[lista[-1]])>0 and dictionary[lista[-1]][0] not in lista:
lista.append(dictionary[lista[-1]][0])
else:
break
return lista
def attacher(words_in_a_l... | 3.328125 | 3 |
pbk/util/descriptors.py | dnwobu/pbk | 1 | 12792056 | <filename>pbk/util/descriptors.py
import abc
class DescriptorClass(abc.ABC):
def __init__(self, prop_name):
self.prop_name = prop_name
@abc.abstractmethod
def __set__(self, instance, value):
"""
Set needs to be defined in subclasses for this to work as a real discriptor
:... | 3.40625 | 3 |
model/npz2pc.py | tarun738/i3DMM | 33 | 12792057 | <gh_stars>10-100
import numpy as np
npzfile = np.load("./data/SdfSamples/dataset/heads/xxxxx_exx.npz")
posSamples = npzfile['pos']
negSamples = npzfile['neg']
points = np.append(posSamples,negSamples,axis=0)
if 'pospoi' in npzfile:
pospoiSamples = npzfile['pospoi']
points = np.append(points,pospoiSamples,axi... | 2.109375 | 2 |
imageledger/management/commands/indexer.py | creativecommons/open-ledger | 46 | 12792058 | from collections import namedtuple
import itertools
import logging
import os
import time
from multiprocessing.dummy import Pool
import multiprocessing
import uuid
from elasticsearch import helpers
import elasticsearch
from elasticsearch_dsl import Index
from django.conf import settings
from django.core.management.base... | 2.0625 | 2 |
src/pulse3D/constants.py | CuriBio/sdk_refactor | 0 | 12792059 | # -*- coding: utf-8 -*-
"""Constants for the Mantarray File Manager."""
from typing import Dict
import uuid
from immutabledict import immutabledict
from labware_domain_models import LabwareDefinition
try:
from importlib import metadata
except ImportError: # pragma: no cover
import importlib_metadata as metad... | 1.960938 | 2 |
HS110Influx.py | GiantMolecularCloud/HS110Influx | 0 | 12792060 | <filename>HS110Influx.py
####################################################################################################
# log FritzBox to InfluxDB
####################################################################################################
"""
FritzBox to InfluxDB
author: <NAME> (GiantMolecularCloud)
T... | 2.5625 | 3 |
international/middleware.py | project-cece/django-international-sites | 3 | 12792061 | <reponame>project-cece/django-international-sites<filename>international/middleware.py<gh_stars>1-10
from django.utils.deprecation import MiddlewareMixin
from django.utils import translation
from django.conf import settings
from .models import CountrySite
class InternationalSiteMiddleware(MiddlewareMixin):
"""
... | 2.125 | 2 |
exoskeleton/__init__.py | RuedigerVoigt/exoskeleton | 22 | 12792062 | <reponame>RuedigerVoigt/exoskeleton
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"Exoskeleton Crawler Framwork for Python"
from exoskeleton.__main__ import Exoskeleton
from exoskeleton import _version
NAME = "exoskeleton"
__version__ = _version.__version__
__author__ = "<NAME>"
| 0.972656 | 1 |
numbamisc/utils/__init__.py | MSeifert04/numbamisc | 4 | 12792063 | <filename>numbamisc/utils/__init__.py
from ._generatefilters import *
| 1.078125 | 1 |
setup.py | cm107/logger | 0 | 12792064 | <gh_stars>0
from setuptools import setup, find_packages
import logger as pkg
packages = find_packages(
where='.',
include=['logger*']
)
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name='pyclay_logger',
version=pkg.__version__,
description='logger library',
... | 1.5 | 2 |
app/examplereplacer.py | aravindvnair99/Natural-Language-Processing-Project | 0 | 12792065 | <reponame>aravindvnair99/Natural-Language-Processing-Project
from nltk.corpus import wordnet
from nltk.tokenize import word_tokenize
class AntonymReplacer(object):
def replace(self, word):
ant = list()
for syn in wordnet.synsets(word):
for lemma in syn.lemmas():
if lemm... | 3.578125 | 4 |
tests/test_api.py | jchen0506/bse-staging | 0 | 12792066 | from flask import current_app
import pytest
import json
from base64 import b64encode
import basis_set_exchange as bse
headers = {'Content-Type': 'application/json'}
def get_ref_formats():
return [(format) for format in bse.get_reference_formats()]
@pytest.mark.usefixtures("app", "client", autouse=True) # to... | 2.265625 | 2 |
Flask_app2/app/app.py | npayneau/gesture-detection | 1 | 12792067 | from flask import Flask, render_template, Response, request
from video import Video
import requests
app = Flask(__name__)
vid=Video(0)
geste = ""
data = ""
def gen():
global geste
while True:
frame, geste = vid.get_frame()
r=requests.post('http://localhost:8090/getAPI',data={'geste':geste,'pos... | 2.78125 | 3 |
phi/sensors/misc/dae_ip32in.py | alttch/eva-phi | 1 | 12792068 | __author__ = "Altertech Group, https://www.altertech.com/"
__copyright__ = "Copyright (C) 2012-2018 Altertech Group"
__license__ = "Apache License 2.0"
__version__ = "2.0.0"
__description__ = "Denkovi smartDEN IP-32IN"
__api__ = 4
__required__ = ['value', 'events']
__mods_required__ = []
__lpi_default__ = 'sensor'
__e... | 1.65625 | 2 |
app/main/forms.py | martamatos/kinetics_db | 0 | 12792069 | <filename>app/main/forms.py
import re
from flask_wtf import FlaskForm
from wtforms import FloatField, IntegerField, SelectField, StringField, SubmitField, TextAreaField
from wtforms.ext.sqlalchemy.fields import QuerySelectField, QuerySelectMultipleField
from wtforms.validators import ValidationError, DataRequired, Len... | 2.421875 | 2 |
pysrc/labstreaminglayer_ros/Converter/TransformStamped.py | guthom/labstreaminglayer_ros | 0 | 12792070 | <gh_stars>0
from Transform import Transform
from labstreaminglayer_ros.msg import LSLTransformStamped as message
from geometry_msgs.msg import TransformStamped as stdmessage
class TransformStamped(Transform):
def __init__(self):
super(Transform, self).__init__(
commonType="TransformStamped",
... | 2.140625 | 2 |
main.py | arvinzhang815/jd-assistant | 2 | 12792071 | <reponame>arvinzhang815/jd-assistant<filename>main.py<gh_stars>1-10
#!/usr/bin/env python
# -*- coding:utf-8 -*-
from jd_assistant import Assistant
if __name__ == '__main__':
asst = Assistant()
asst.login_by_QRcode() # 扫码登陆
asst.clear_cart() # 清空购物车
asst.add_item_to_cart(sku_id='1626336666') # 添加到购物... | 2.109375 | 2 |
api/dataloader.py | clutso/sampleAPI | 0 | 12792072 | from datahandler import ConnData
import pandas
import os
#influx
import influxdb_client
from influxdb_client.client.write_api import SYNCHRONOUS
class DataLoader(ConnData):
def init(self, fileName):
data = pandas.read_csv(fileName)
write_api = self.influx_client.write_api(write_options=SYNCHRON... | 2.546875 | 3 |
02. Defining Classes - Exercise/guild_system_07/project/guild.py | elenaborisova/Python-OOP | 1 | 12792073 | <gh_stars>1-10
from guild_system_07.project.player import Player
class Guild:
def __init__(self, name: str):
self.name = name
self.players: list = []
def assign_player(self, player: Player):
if player in self.players:
return f"Player {player.name} is already in the guild."... | 3.359375 | 3 |
test/test_get_transaction_details_by_transaction_id_response_item_blockchain_specific.py | xan187/Crypto_APIs_2.0_SDK_Python | 0 | 12792074 | <gh_stars>0
"""
CryptoAPIs
Crypto APIs 2.0 is a complex and innovative infrastructure layer that radically simplifies the development of any Blockchain and Crypto related applications. Organized around REST, Crypto APIs 2.0 can assist both novice Bitcoin/Ethereum enthusiasts and crypto experts with the develop... | 1.585938 | 2 |
src/a_tuin/metadata/field_group.py | gordon-elliott/glod | 0 | 12792075 | <gh_stars>0
__copyright__ = 'Copyright(c) <NAME> 2017'
"""
"""
import logging
from collections import OrderedDict
from operator import getitem, setitem
from a_tuin.metadata.exceptions import FieldAssignmentError, field_errors_check, DATA_LOAD_ERRORS
from a_tuin.metadata.field_transformations import copy_field
LOG... | 2.078125 | 2 |
cwt_vs_STFT.py | mn270/Human-Activity-Recognize-HARdataset- | 0 | 12792076 | """
Show differences between WT and STFT
"""
from scipy import signal
import matplotlib.pyplot as plt
import numpy as np
import pywt
waveletname = 'morl'
scales = range(1,200)
t = np.linspace(-1, 1, 200, endpoint=False)
sig = np.cos(2 * np.pi * 7 * t) + signal.gausspulse(t - 0.4, fc=2)
t = np.linspace(-1, 1, 50, en... | 2.59375 | 3 |
linear_algebra/exercise1.py | coherent17/physics_calculation | 1 | 12792077 | import math
import numpy as np
#1-a
def function1():
value=0
for i in range(1,1000+1):
value+=i
return value
#1-b
def function2(m):
value=0
for i in range(1,m+1):
value+=i
return value
#2
def function3():
value=0
for i in range(1,100+1):
value+=math.sqrt(i*... | 3.59375 | 4 |
test/add_test_contact_new.py | Yevhen-Code/Python_Sample | 0 | 12792078 | <gh_stars>0
# -*- coding: utf-8 -*-
from model.contact import Contact
def test_add_contact(app):
app.session.login(username="admin", password="<PASSWORD>")
app.contact.create_contact(
Contact(name="Yevhen", lastname="Hurtovyi", company="Sidley", address="Chicago", mobile="7733311608",
... | 2.203125 | 2 |
packages/bazel/src/utils/webpack.bzl | jeffbcross/nx | 0 | 12792079 | <filename>packages/bazel/src/utils/webpack.bzl
def _collect_es5_sources_impl(target, ctx):
result = set()
if hasattr(ctx.rule.attr, "srcs"):
for dep in ctx.rule.attr.srcs:
if hasattr(dep, "es5_sources"):
result += dep.es5_sources
if hasattr(target, "typescript"):
result += target.typescript.... | 1.78125 | 2 |
simplemotionpiano.py | arpruss/motionpiano | 1 | 12792080 | <reponame>arpruss/motionpiano<filename>simplemotionpiano.py
import time, cv2
import numpy as np
import rtmidi
NOTES = [ 60, 62, 64, 65, 67, 69, 71, 72, 74 ] # , 76, 77, 79 ]
NOTE_VELOCITY = 127
WINDOW_NAME = "MotionPiano"
KEY_HEIGHT = 0.25
RECOGNIZER_WIDTH = 500
KERNEL_SIZE = 0.042
RESET_TIME = 5
SAVE_CHE... | 2.390625 | 2 |
notebooks/griffin_lim.py | bigpo/TensorFlowTTS_chinese | 0 | 12792081 | <filename>notebooks/griffin_lim.py
# %%
import glob
import tempfile
import time
import librosa.display
import yaml
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
from tensorflow_tts.utils import TFGriffinLim, griffin_lim_lb
# %config InlineBackend.figure_format = 'svg'
# %% [markdown]
# ... | 2.265625 | 2 |
templatedir/nice/objective.py | Kooper95/Shape-optimiser | 0 | 12792082 | <filename>templatedir/nice/objective.py
import sys
#if len(sys.argv) == 1:
# print(200000)
#else:
Powerout = (float(sys.argv[1]) - 298.15) * 3.14159265 * 0.1 * 0.1 * 0.22 / 0.005
#p = 611.21 * 2.718281828 ** ((18.678 - (float(sys.argv[1])-273.15)/234.5)*((float(sys.argv[1])-273.15)/(float(sys.argv[1])-16.01)))
#Po... | 2.46875 | 2 |
qtplotlib/barplot.py | jeremiedecock/qtplotlib-python | 0 | 12792083 | from PyQt5.QtWidgets import QWidget
from PyQt5.QtGui import QPainter, QBrush, QPen, QColor
from PyQt5.QtCore import Qt
import math
class QBarPlot(QWidget):
def __init__(self):
super().__init__()
self.horizontal_margin = 10
self.vertical_margin = 10
self.data = None
self.... | 3.125 | 3 |
gui.py | hardpenguin/ReplaySorceryGUI | 4 | 12792084 | #!/usr/bin/python3
import sys
import os
import signal
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from replay_sorcery import ReplaySorcery
signal.signal(signal.SIGINT, signal.SIG_DFL)
app = QApplication([])
dir_name = os.path.dirname(sys.argv[0])
full_path = os.path.... | 2.265625 | 2 |
Hessian/PGGAN_hess_spectrum.py | Animadversio/Visual_Neuro_InSilico_Exp | 2 | 12792085 | import torch
import numpy as np
from time import time
from os.path import join
import lpips
from Hessian.GAN_hessian_compute import hessian_compute
#%%
ImDist = lpips.LPIPS(net='squeeze').cuda()
use_gpu = True if torch.cuda.is_available() else False
model = torch.hub.load('facebookresearch/pytorch_GAN_zoo:hub',
... | 2.265625 | 2 |
infinisdk/infinibox/tenant.py | Infinidat/infinisdk | 5 | 12792086 | from ..core import Field, SystemObject, MillisecondsDatetimeType
from ..core.api.special_values import Autogenerate
from ..core.translators_and_types import MunchType
class Tenant(SystemObject):
FIELDS = [
Field("id", type=int, is_identity=True, is_filterable=True, is_sortable=True),
Field("short_... | 2.078125 | 2 |
docs/examples/use_cases/tensorflow/efficientdet/dataset/create_tfrecord_indexes.py | cyyever/DALI | 3,967 | 12792087 | <gh_stars>1000+
# Copyright 2021 <NAME>. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 2.125 | 2 |
cn2an/transform_test.py | guoqchen1001/cn2an | 1 | 12792088 | <gh_stars>1-10
import unittest
from .transform import Transform
class TransformTest(unittest.TestCase):
def setUp(self) -> None:
self.strict_data_dict = {
"小王捡了100块钱": "小王捡了一百块钱",
"用户增长最快的3个城市": "用户增长最快的三个城市",
"小王的生日是2001年3月4日": "小王的生日是二零零一年三月四日",
"小王的生日是20... | 2.859375 | 3 |
foodgram/urls.py | dronsovest/foodgram-project | 0 | 12792089 | from django.contrib import admin
from django.urls import include, path
from django.conf.urls.static import static
from django.conf import settings
from django.conf.urls import handler404, handler500
from . import views
handler404 = "foodgram.views.page_not_found"
handler500 = "foodgram.views.server_error"
urlpatt... | 1.953125 | 2 |
src/panels/Panel.py | severus21/PycLi | 0 | 12792090 | from tkinter import *
import sys
class Panel(Frame):
def __init__(self, master, *args, **kw):
super().__init__(master, *args, **kw)
def hide(self):
self.grid_forget()
def show(self):
self.grid()
# http://tkinter.unpythonic.net/wiki/VerticalScrolledFrame
#https:/... | 3.21875 | 3 |
src/thirdparty/harfbuzz/src/check-symbols.py | devbrain/neutrino | 0 | 12792091 | #!/usr/bin/env python3
import sys, os, shutil, subprocess, re, difflib
os.environ['LC_ALL'] = 'C' # otherwise 'nm' prints in wrong order
builddir = os.getenv('builddir', os.path.dirname(__file__))
libs = os.getenv('libs', '.libs')
IGNORED_SYMBOLS = '|'.join(['_fini', '_init', '_fdata', '_ftext', '_fbss',
... | 2 | 2 |
pcommon/gdb/pprint/utils.py | mmalyutin/libpcomn | 6 | 12792092 | <filename>pcommon/gdb/pprint/utils.py
###############################################################################
# A printer object must provide the following fileld:
#
# - printer_name: A subprinter name used by gdb (required).
# - template_name: A string or a list of strings.
###################################... | 2.5625 | 3 |
pretix_regex_validation/__init__.py | pretix-unofficial/pretix-regex-validation | 1 | 12792093 | <reponame>pretix-unofficial/pretix-regex-validation<filename>pretix_regex_validation/__init__.py
from django.utils.translation import gettext_lazy
try:
from pretix.base.plugins import PluginConfig
except ImportError:
raise RuntimeError("Please use pretix 2.7 or above to run this plugin!")
__version__ = "1.0.1... | 2.046875 | 2 |
python3-json.py | evmarh/python3-json | 0 | 12792094 | <gh_stars>0
#!/usr/bin/env python3
import datetime
import time
import json
import requests
epoch = round(time.time())
date = time.ctime()
payload = {'query': 'bucket_usage_size{bucket="airtindibucket",instance="at001-s3.managed-dr.com:443",job="minio-job"}', 'time': '%s' % epoch}
# Prometheus URL
response = request... | 2.21875 | 2 |
chr/utils.py | MrHuff/general_ds_pipeline | 0 | 12792095 | import torch
from torch.utils.data import Dataset
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import collections
from chr import coverage
import pdb
class RegressionDataset(Dataset):
def __init__(self, X_data, y_data):
self.X_data = torch.from_numpy(X_data).float()
sel... | 2.578125 | 3 |
Cuadro_Magico/code/bin/processSingleFile.py | sigmadg/sigmadg.github.io | 0 | 12792096 | <reponame>sigmadg/sigmadg.github.io<filename>Cuadro_Magico/code/bin/processSingleFile.py<gh_stars>0
#!/Usr/bin/env python
"""
Create a daemon process that listens to send messages and reads a DICOM file,
extracts the header information and creates a Study/Series symbolic link structure.
"""
import sys, os, time, atexi... | 2.4375 | 2 |
WikiParser/NEDParser.py | imyoungmin/NED | 1 | 12792097 | <reponame>imyoungmin/NED
import importlib
import bz2
import os
import time
import re
from multiprocessing import Pool
from pymongo import MongoClient
import pymongo
from urllib.parse import unquote
import html
import sys
from . import Parser as P
importlib.reload( P )
class NEDParser( P.Parser ):
"""
Parsing Wikipe... | 2.625 | 3 |
profile_app_mod/apps.py | kurniantoska/medicalwebapp_project | 1 | 12792098 | <filename>profile_app_mod/apps.py
from django.apps import AppConfig
class ProfileAppModConfig(AppConfig):
name = 'profile_app_mod'
| 1.359375 | 1 |
Assignment2/Matlab - Group 9/datasets/split.py | Tchinmai7/CSE535 | 0 | 12792099 | import os
if not os.path.exists("data"):
os.mkdir("data")
if not os.path.exists("data/about"):
os.mkdir("data/about")
if not os.path.exists("data/father"):
os.mkdir("data/father")
for filename in os.listdir("raw_data"):
full_filename = f"raw_data/{filename}"
if "About" in filename:
dest_file... | 3.03125 | 3 |
shipment/admin.py | Medinaaz/Vodafone-Payment | 0 | 12792100 | from django.contrib import admin
from shipment.models import Shipment
# Register your models here.
@admin.register(Shipment)
class ShipmentAdmin(admin.ModelAdmin):
list_display = ("name", "surname", "email", "phone","city","district","neighborhood","others") | 1.859375 | 2 |
test/linkloading.py | fbernhart/xhtml2pdf | 0 | 12792101 | # -*- coding: utf-8 -*-
# Copyright 2010 <NAME>, h<EMAIL>
#
# 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... | 1.960938 | 2 |
libs/models.py | eaplab/RaSeedGAN | 1 | 12792102 | <filename>libs/models.py
# -*- coding: utf-8 -*-
"""
Created on Sat Apr 10 11:38:43 2021
@author: guemesturb
"""
import numpy as np
import tensorflow as tf
import tensorflow.keras as keras
import tensorflow.keras.layers as layers
def SubpixelConv2D(input_shape, scale=4):
"""
Custom layer to shuffle abd ... | 2.578125 | 3 |
backend/twilio_account.py | jeff-vincent/Slingshot | 2 | 12792103 | import asyncio
import subprocess
from quart import session
from async_http import AsyncHTTP
from config import twilio_available_sms_numbers_base_uri
from config import twilio_purchase_sms_number_base_uri
from config import twilio_create_subaccount_base_uri
from config import twilio_assign_new_number_base_uri
from confi... | 2.65625 | 3 |
Competitive Programming/Heap/Building Heap from Array.py | shreejitverma/GeeksforGeeks | 2 | 12792104 | '''https://www.geeksforgeeks.org/building-heap-from-array/
Given an array of N elements. The task is to build a Binary Heap from the given array.
The heap can be either Max Heap or Min Heap.
Example:
Input: arr[] = {4, 10, 3, 5, 1}
Output: Corresponding Max-Heap:
10
/ \
5 3
/ \
4 1
Inp... | 3.71875 | 4 |
google/easy/roman_to_integer.py | salman-kgp/leetcode | 0 | 12792105 | <reponame>salman-kgp/leetcode<filename>google/easy/roman_to_integer.py
class Solution(object):
def romanToInt(self, s):
"""
:type s: str
:rtype: int
"""
roman_to_int_map = {"I":1,"V":5,"X":10,"L":50,"C":100,"D":500,"M":1000}
current_ptr = 0
result = 0
... | 3.4375 | 3 |
visualize_classifer/visualize_model.py | a-n-rose/language-classifier | 3 | 12792106 | import keras
from keras.models import model_from_json
from keras.utils import plot_model
import pandas as pd
import numpy as np
from ann_visualizer.visualize import ann_viz
import glob
import os
#batch visualize:
for model in glob.glob('./models/*.json'):
#load json model:
classifier_name = os.path.split... | 3.015625 | 3 |
python/setup.py | gitter-badger/rikai | 0 | 12792107 | import pathlib
import re
from setuptools import find_packages, setup
about = {}
with open(pathlib.Path("rikai") / "__version__.py", "r") as fh:
exec(fh.read(), about)
with open(
pathlib.Path(__file__).absolute().parent.parent / "README.md",
"r",
) as fh:
long_description = fh.read()
# extras
test = [... | 1.554688 | 2 |
visualization/panda/filtermanager.py | takuya-ki/wrs | 23 | 12792108 | <reponame>takuya-ki/wrs<filename>visualization/panda/filtermanager.py
from direct.filter import FilterManager as pfm
from panda3d.core import Texture, CardMaker, NodePath, AuxBitplaneAttrib, LightRampAttrib, Camera, OrthographicLens, \
GraphicsOutput, WindowProperties, FrameBufferProperties, GraphicsPipe
class Fi... | 2.109375 | 2 |
tests/testprettify.py | davidseibert/docxperiments | 1 | 12792109 | <gh_stars>1-10
# coding: utf-8
import context, testutils, unittest
from docxperiments import prettify
class PrettifyTest(unittest.TestCase):
def test_prettify_makes_xml_pretty(self):
xml_file_path = 'testdata/ugly.xml'
pretty_xml_str = prettify.prettify_xml(xml_file_path)
with open('testd... | 2.84375 | 3 |
apps/users/adminx.py | Airren/mxonline-python | 6 | 12792110 | <reponame>Airren/mxonline-python<filename>apps/users/adminx.py
# _*_ encoding:utf-8 _*_
__author__ = 'wuqy'
__date__ = '2021/7/7 11:09'
import xadmin
from xadmin import views
from .models import EmailVerifyRecord,Banner
class BaseSetting(object):
enable_themes = True
use_bootswatch = True
class GlobalSetti... | 1.671875 | 2 |
tests/unit/test_song.py | DakaraProject/dakara-feeder | 0 | 12792111 | from datetime import timedelta
from unittest import TestCase
from unittest.mock import patch
from path import Path
from dakara_feeder.directory import SongPaths
from dakara_feeder.metadata import FFProbeMetadataParser, MediaParseError
from dakara_feeder.song import BaseSong
from dakara_feeder.subtitle.parsing import ... | 2.59375 | 3 |
train.py | 226wyj/You-Draw-I-Guess | 0 | 12792112 | <gh_stars>0
# -*- coding: utf-8 -*
import torch as t
from torch.autograd import Variable
from tqdm import tqdm
class Trainer():
def __init__(self, net, criterion, optimizer,
scheduler, train_loader, test_loader, model_path, args):
self.net = net
self.criterion = crite... | 2.453125 | 2 |
ics_demo/dao/__init__.py | lielongxingkong/ics-demo | 0 | 12792113 | <filename>ics_demo/dao/__init__.py
from db import init_db
from interfaces.demo import rabbit as rabbit_dao
from interfaces.demo import carrot as carrot_dao
from interfaces.demo import carrot as corps_dao
from interfaces import host as host_dao
from interfaces import blockdevice as block_dao
from interfaces.vsan import ... | 1.523438 | 2 |
utils/cache/meeting.py | ttppren-github/MeetingSample-Backend | 7 | 12792114 | <reponame>ttppren-github/MeetingSample-Backend
from meeting_sample.settings import REDIS_PREFIX
from utils.cache.connection import client
MEETING_KEY = f'{REDIS_PREFIX}:meeting:'
def open_meeting(meeting_id: int, ex: int):
key = MEETING_KEY + str(meeting_id)
value = {
'sharing_user': 0,
}
cl... | 2.328125 | 2 |
user/plot.py | yashbidasaria/CS537-p2 | 0 | 12792115 | <filename>user/plot.py
#!/usr/bin/python
import argparse
import matplotlib.pyplot as plt
# Specify cmdline args
parser = argparse.ArgumentParser()
default = 'You should really put in a title and label axes!'
parser.add_argument('-i', '--input', nargs='+', help='Input File(s)')
parser.add_argument('-o', '--outp... | 3.015625 | 3 |
hangman.py | juank27/Hangman_python | 0 | 12792116 | <gh_stars>0
print("hola a todos")
for i in range(0,100):
print("Hola")
print("Hola otra vez") | 3.21875 | 3 |
Aula14/app.py | refatorando/curso_python_iniciantes | 3 | 12792117 | <filename>Aula14/app.py
from carro import Carro
fusca = Carro("Volks","Fusca","Azul","Gasolina")
fusca.ligar()
# fusca.ligar()
# fusca.acelerar()
# fusca.acelerar()
# fusca.acelerar()
# fusca.acelerar()
# fusca.acelerar()
# fusca.acelerar()
# fusca.acelerar()
# fusca.acelerar()
# fusca.frear()
# fusca.frear()
# fusca.... | 2.046875 | 2 |
evaluation/iccv19/transfer.py | kumasento/gconv-prune | 8 | 12792118 | """ Training from scratch with different conditions. """
import os
import sys
import argparse
import copy
import time
import shutil
import json
import logging
logging.getLogger().setLevel(logging.DEBUG)
import numpy as np
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backe... | 2.234375 | 2 |
AutomatedParking/AutomatedParking/models.py | COMP-SCI-72/Automated-Parking-System | 0 | 12792119 | from django.db import models
class User(models.Model):
pass
class Car(models.Model):
pass
class Parking(models.Model):
pass
| 1.632813 | 2 |
datam/__init__.py | bengranett/datam | 0 | 12792120 | <reponame>bengranett/datam
import subprocess, os
__version__ = ''
try:
# if we are running in a git repo, look up the hash
__version__ = subprocess.Popen(
('git','--git-dir',os.path.dirname(__file__),'describe','--always'),
stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()[0]
... | 2.203125 | 2 |
Hackerrank/World Cup 2016/World Cup/Problem F/gen.py | VastoLorde95/Competitive-Programming | 170 | 12792121 | from math import *
from fractions import *
from random import *
n = 1000000000
q = 200000
print n, q
for _ in xrange(q):
t = randrange(1,4)
l,r,c = randrange(1,n+1), randrange(1,n+1), 1000000000
if t < 3:
print t,l,r,c
else:
print t,l,r
#print 3, 1, 1000000000
| 3.03125 | 3 |
metric_learn/jde.py | saviorabelo/metric-learn | 0 | 12792122 | """
Using jDE for evolving a triangular Mahalanobis matrix
based on Fukui 2013: Evolutionary Distance Metric Learning Approach
to Semi-supervised Clustering with Neighbor Relations
There are some notable differences between the paper and this implementation,
please refer to
https://github.com/svecon/thesis-distance-me... | 2.671875 | 3 |
app.py | gibbsie/cdk-graviton2-alb-aga-route53 | 2 | 12792123 | #!/usr/bin/env python3
from aws_cdk import core
import os
from ec2_ialb_aga_custom_r53.network_stack import NetworkingStack
from ec2_ialb_aga_custom_r53.aga_stack import AgaStack
from ec2_ialb_aga_custom_r53.alb_stack import ALBStack
from ec2_ialb_aga_custom_r53.certs_stack import CertsStack
from ec2_ialb_aga_custom_... | 1.90625 | 2 |
core/views.py | HortenciaArliane/speakerfight | 369 | 12792124 |
from django.contrib.auth.models import User
from django.utils.translation import ugettext as _
from django.http import Http404, HttpResponseRedirect
from django.contrib import messages
from django.shortcuts import get_object_or_404
from django.utils import translation
from vanilla import TemplateView, DetailView, Upd... | 1.945313 | 2 |
positive no in range.py | KrutikaSoor/print-all-positive-no.in-range | 0 | 12792125 | list1=[12,-7,5,64,-14]
list2=[12,14,-95,3]
for i in list1:
if i>0:
print(i)
for j in list2:
if j>0:
print(j)
| 3.75 | 4 |
make_mozilla/postgis/base.py | Mozilla-GitHub-Standards/54c69db06ef83bda60e995a6c34ecfd168ca028994e40ce817295415bb409f0c | 4 | 12792126 | <reponame>Mozilla-GitHub-Standards/54c69db06ef83bda60e995a6c34ecfd168ca028994e40ce817295415bb409f0c<filename>make_mozilla/postgis/base.py<gh_stars>1-10
from django.db.backends.postgresql_psycopg2.base import *
from django.db.backends.postgresql_psycopg2.base import DatabaseWrapper as Psycopg2DatabaseWrapper
from django... | 2.03125 | 2 |
bot.py | davidchooo/dst-bot | 0 | 12792127 | import os
from discord.ext import commands
from dotenv import load_dotenv
import json
import shutil
from datetime import datetime
load_dotenv()
TOKEN = os.getenv('DISCORD_TOKEN')
DST_DIR = os.getenv('DST_DIR')
BACKUP_DIR = os.getenv('BACKUP_DIR')
bot = commands.Bot(command_prefix='!')
@bot.event
async def on_ready... | 2.34375 | 2 |
bokeh/models/tests/test_renderers.py | gully/bokeh | 4 | 12792128 | <reponame>gully/bokeh
from __future__ import absolute_import
from bokeh.models import Circle, MultiLine, ColumnDataSource
from bokeh.models.renderers import GlyphRenderer, GraphRenderer
def test_graphrenderer_init_props():
renderer = GraphRenderer()
assert renderer.x_range_name == "default"
assert rendere... | 2.1875 | 2 |
project_euler/121.py | huangshenno1/project_euler | 0 | 12792129 | <reponame>huangshenno1/project_euler
def add(p, b, r, x):
if (b, r) in p: p[(b, r)] += x
else: p[(b, r)] = x
n = 15
dp = []
dp.append({(0,0): 1.0})
for rnd in xrange(1, n+1):
p = {}
for ((b, r), v) in dp[rnd-1].items():
add(p, b+1, r, v/(rnd+1))
add(p, b, r+1, v*rnd/(rnd+1))
dp.append(p)
s = 0
for ((b, r), v... | 2.65625 | 3 |
fireup/algos/ppo/actorcritic.py | arnaudvl/firedup | 1 | 12792130 | import torch
import torch.nn as nn
from gym.spaces import Box, Discrete
from .agents import MLP, CNN, WorldModel
from .policies import CategoricalPolicyMLP, GaussianPolicyMLP
from .policies import CategoricalPolicyCNN, GaussianPolicyCNN, GaussianPolicyWM
class ActorCriticWM(nn.Module):
def __init__(self,
... | 2.34375 | 2 |
ml_models/classify_images/infer.py | siruku6/ml_sample | 0 | 12792131 | from typing import List, Tuple
import numpy as np
from PIL import Image
import pytorch_lightning as pl
import torch
from torchvision.models import resnet18
from torchvision import transforms
from ml_models.model_initializer import ModelInitializer
class PredPostureNet(pl.LightningModule):
def __init__(self):
... | 2.4375 | 2 |
ok_cart/api/utils.py | LowerDeez/ok-cart | 3 | 12792132 | from typing import Dict, TYPE_CHECKING, Type
from django.apps import apps
from django.utils.translation import ugettext_lazy as _
from ..settings import settings
if TYPE_CHECKING:
from django.db.models import Model
__all__ = (
'cart_element_representation_serializer',
'get_base_api_view'
)
def cart_el... | 2.015625 | 2 |
tools/pre_parser/lua_bind/lua_bind.py | maoxiezhao/Cjing3D-Test | 0 | 12792133 | <reponame>maoxiezhao/Cjing3D-Test
import json
import sys
import os
import traceback
import glob
import subprocess
import code_gen_utils.code_gen_utils as cgu
filter_path = "filter.json"
class ArgsInfo:
input_files = []
output_dir = ""
input_dir = ""
class MetaInfo:
input_head_files = []
class_ba... | 2.171875 | 2 |
src/old_code/RandomForestDriver.py | amirjankar/graph-analysis | 1 | 12792134 | <filename>src/old_code/RandomForestDriver.py<gh_stars>1-10
import pandas as pd, numpy, math, random, DecisionTree
from collections import Counter
"""
@author: anmirjan
"""
class RandomForest:
"""
Creates random forest from a decision tree
Trains model based on given dataset
"""
def __init__(self,... | 3.28125 | 3 |
COMP-2080/Week-9/matrixMult.py | kbrezinski/Candidacy-Prep | 0 | 12792135 | <gh_stars>0
import numpy as np
A = np.random.randint(10, size=[4, 4])
B = np.random.randint(10, size=[4, 4])
def matMul(A: np.ndarray, B: np.ndarray):
shape = A.shape[0]
mid = shape // 2
C = np.empty([shape, shape])
matMulAux(0, mid)
matMulAux(mid + 1, shape)
def matMulAux(lo: int, hi: int):
... | 2.671875 | 3 |
OpenAttack/data/test.py | e-tornike/OpenAttack | 444 | 12792136 | NAME = "test"
DOWNLOAD = "/TAADToolbox/test.pkl"
| 1.054688 | 1 |
sktime/transformations/panel/tests/test_PCATransformer.py | biologioholic/sktime | 1 | 12792137 | # -*- coding: utf-8 -*-
"""Tests for PCATransformer."""
import numpy as np
import pytest
from sktime.transformations.panel.pca import PCATransformer
from sktime.utils._testing.panel import _make_nested_from_array
@pytest.mark.parametrize("bad_components", ["str", 1.2, -1.2, -1, 11])
def test_bad_input_args(bad_compo... | 2.515625 | 3 |
src/apps/books/views.py | k0t3n/stepic_drf_tests | 1 | 12792138 | <gh_stars>1-10
from rest_framework.permissions import IsAuthenticated
from rest_framework.viewsets import ModelViewSet
from src.apps.books.models import Book
from src.apps.books.serializers import BookSerializer
class BookViewSet(ModelViewSet):
queryset = Book.objects.all()
serializer_class = BookSerializer
... | 1.734375 | 2 |
samples/actions/main.py | DiamondsBattle/panda3d-openvr | 0 | 12792139 | from direct.showbase.ShowBase import ShowBase
from panda3d.core import ExecutionEnvironment
from p3dopenvr.p3dopenvr import P3DOpenVR
import openvr
import os
class MinimalOpenVR(P3DOpenVR):
def __init__(self):
P3DOpenVR.__init__(self)
self.left_hand = None
self.right_hand = None
def ... | 2.21875 | 2 |
seqp/integration/fairseq/dictionary.py | noe/seqp | 1 | 12792140 | <filename>seqp/integration/fairseq/dictionary.py
# Copyright (c) 2019-present, <NAME>
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree.
try:
from fairseq.data import Dictionary
except ImportError:
assert False, "Fair... | 2.25 | 2 |
tests/functional/test_adcm_upgrade.py | arenadata/adcm | 16 | 12792141 | # 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
# distributed under t... | 1.617188 | 2 |
application.py | NisseOscar/Spotify-RampUp-2020 | 0 | 12792142 | import numpy as np
from flask import Flask, render_template, redirect, url_for, jsonify, make_response, request
from Frontend import application
# Imports application details from a private file
from details import client_id, client_secret
import requests
from Backend.RequestError import RequestError
from Backend.Sptfy... | 2.75 | 3 |
timberr/core/migrations/0006_auto_20200116_1824.py | luckyadogun/timberinvoice | 1 | 12792143 | <filename>timberr/core/migrations/0006_auto_20200116_1824.py
# Generated by Django 2.1.15 on 2020-01-16 17:24
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0005_auto_20200116_1747'),
]
operations = [
migrations.AlterField(
... | 1.328125 | 1 |
tests/test_context_manager.py | timgates42/tasktiger | 1,143 | 12792144 | <reponame>timgates42/tasktiger
"""Child context manager tests."""
import redis
from tasktiger import Worker
from .tasks import exception_task, simple_task
from .test_base import BaseTestCase
from .config import TEST_DB, REDIS_HOST
class ContextManagerTester(object):
"""
Dummy context manager class.
Use... | 2.390625 | 2 |
docs/examples/save_geotiff.py | carderne/descarteslabs-python | 167 | 12792145 | """
==================================================
Save image to GeoTIFF
==================================================
This example demonstrates how to save an image
to your local machine in GeoTiff format.
"""
import descarteslabs as dl
# Create an aoi feature to clip imagery to
box = {
"type": "Polygo... | 2.921875 | 3 |
setup.py | MedleyLabs/DeepAutonomic | 0 | 12792146 | <reponame>MedleyLabs/DeepAutonomic
from setuptools import setup
with open('README.md', 'r') as f:
long_description = f.read()
with open('LICENSE', 'r') as f:
license_text = f.read()
setup(
name='DeepSomatics',
version='0.0.1',
description='An experimental, chatbot-driven therapist for somatic exp... | 1.195313 | 1 |
c2wl_rocket/__main__.py | KerstenBreuer/C2WL-Rocket | 0 | 12792147 | from __future__ import absolute_import
import os
import argparse
import cwltool.main
import cwltool.argparser
import cwltool.utils
from .exec_profile import ExecProfileBase, LocalToolExec
from cwltool.executors import MultithreadedJobExecutor, SingleJobExecutor
from . import worker
from .tool_handling import make_cust... | 2.09375 | 2 |
models/feature.py | Thesharing/lfesm | 6 | 12792148 | <reponame>Thesharing/lfesm
# -*- coding: utf-8 -*-
import re
subject_pat = {
'lender_replace': re.compile(r'原告(?!:)'),
'borrower_replace': re.compile(r'被告(?!:)'),
'legal_represent_replace': re.compile(r'法定代表人(?!:)'),
'lender': re.compile(r'原告:(.+?)[。|,]'),
'borrower': re.compile(r'被告:(.+?)[。|,]'),... | 2.28125 | 2 |
haplotype/dataset.py | zxChouSean/crispr_bedict_reproduce | 5 | 12792149 | import numpy as np
import torch
from torch import nn
from torch.utils.data import Dataset
from tqdm import tqdm
class SeqMaskGenerator(object):
def __init__(self, seqconfig):
self.seqconfig = seqconfig
def create_enc_mask(self, enc_inp):
#enc_inp = [N, inp_seq_len]
# N is total numb... | 2.421875 | 2 |
mmdet/models/anchor_heads/ttfwh_head.py | mrsempress/mmdetection | 0 | 12792150 | <reponame>mrsempress/mmdetection
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import normal_init, kaiming_init, constant_init
import math
import numpy as np
from mmdet.ops import ModulatedDeformConvPack, soft_nms
from mmdet.core import multi_apply, force_fp32
from mmdet.models.losse... | 1.804688 | 2 |