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 |
|---|---|---|---|---|---|---|
backend/backend/views.py | mmlado/animal_pairing | 2 | 51200 | <reponame>mmlado/animal_pairing
from .models import Animal
from rest_framework import viewsets
from .serializers import AnimalSerializer
class AnimalView(viewsets.ModelViewSet):
queryset = Animal.objects.all()
serializer_class = AnimalSerializer | 1.929688 | 2 |
tarea4/tarea4-09.py | jmencisom/nb-mn | 2 | 51201 | <reponame>jmencisom/nb-mn<gh_stars>1-10
for i in range(0,3):
f = open("dato.txt")
f.seek(17+(i*77),0)
x1= int(f.read(2))
f.seek(20+(i*77),0)
y1= int(f.read(2))
f.seek(35+(i*77),0)
a= int(f.read(2))
f.seek(38+(i*77),0)
b= int(f.read(2))
f.seek(60+(i*77),0)
x2= int(f.read(... | 2.984375 | 3 |
Problem Solving using Python Lab/11.sumOfN.py | narayan954/niet_codetantra | 2 | 51202 | a=int(input('Enter number of terms '))
f=1
s=0
for i in range(1,a+1):
f=f*i
s+=f
print('Sum of series =',s)
| 3.890625 | 4 |
module/tests/non_convex_test.py | asenzz/cuosqp | 25 | 51203 | <filename>module/tests/non_convex_test.py
# Test cuosqp python module
import cuosqp as osqp
from cuosqp._osqp import constant
import numpy as np
from scipy import sparse
# Unit Test
import unittest
import numpy.testing as nptest
class non_convex_tests(unittest.TestCase):
def setUp(self):
# Simple QP pr... | 2.484375 | 2 |
cogs/autoupdate_ko.py | PLM912/Keter | 0 | 51204 | <gh_stars>0
import discord
from discord.ext import commands
from evs import default
from evs import permissions, default, http, dataIO
import requests
import os
class Autoupdate_ko(commands.Cog):
def __init__(self, bot):
self.bot = bot
self.config = default.get("config.json")
# Commands
@... | 2.25 | 2 |
great_expectations/cli/batch_kwargs.py | svenhofstede/great_expectations | 1 | 51205 | <reponame>svenhofstede/great_expectations
import logging
import os
import sys
import uuid
import click
from great_expectations import exceptions as ge_exceptions
from great_expectations.cli import toolkit
from great_expectations.cli.pretty_printing import cli_message
from great_expectations.core import ExpectationSui... | 2.109375 | 2 |
moai/monads/human/pose/__init__.py | ai-in-motion/moai | 10 | 51206 | from moai.monads.human.pose.openpose import (
Split as OpenposeSplit,
JointMap as OpenposeJointMap
)
__all__ = [
'OpenposeSplit',
'OpenposeJointMap',
] | 1.0625 | 1 |
test_scripts/reg1.py | talih0/dps-for-iot | 57 | 51207 | <gh_stars>10-100
#!/usr/bin/python
from common import *
import atexit
import time
atexit.register(cleanup)
# Start the registry service
reg1 = reg()
# Start some subscribers
# Delay the starts so that we ensure a fully connected graph.
sub1 = reg_subs('-p {} -c 1 a/b/c'.format(reg1.port))
sub2 = reg_subs('-p {} -c... | 2.328125 | 2 |
wlanpi_core/services/diagnostics_service.py | WLAN-Pi/wlanpi-core | 1 | 51208 | from shutil import which
from typing import Optional
from wlanpi_core.models.validation_error import ValidationError
from .helpers import get_phy80211_interfaces, run_cli_async
async def executable_exists(name: str) -> bool:
"""
Check whether `name` is on PATH and marked as executable.
"""
return wh... | 2.421875 | 2 |
code/speakkey_v01.py | whoisguardsite/test | 19 | 51209 | #! /usr/bin/python3.5
# Copyright 2015 <NAME> - CC0 1.0 Universal
import sys
# Octal / Emoji / Syllable Mapping
# `0 | 🌞 | ohm`
# `1 | 🌵 | ma`
# `2 | 🌲 | ni`
# `3 | 🌼 | pad`
# `4 | 🐅 | me`
# `5 | 🕊 | hum`
# `6 | 🐉 | free`
# `7 | 🌅 | dom`
# Input octal UTF-8 string (e.g. '012345670123456701234567') and recei... | 3.265625 | 3 |
home/bin/k3b-rm.py | ssokolow/profile | 9 | 51210 | <reponame>ssokolow/profile
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
# pylint: disable=invalid-name
"""A simple tool for deleting the files listed in a K3b project after it has
been written to a disc. (Useful in concert with gaff-k3b)
--snip--
@note: This currently explicitly uses C{posixpath} rather than C{os.p... | 1.984375 | 2 |
4_Backwoods_Forest/177-White_Rabbit/white_rabbit.py | katitek/Code-Combat | 0 | 51211 | # You need Elemental codex 1+ to cast "Haste"
hero.cast("haste", hero)
hero.moveXY(14, 30)
hero.moveXY(20, 30)
hero.moveXY(28, 15)
hero.moveXY(69, 15)
hero.moveXY(72, 58)
| 1.0625 | 1 |
run.py | marciks/flask-basic-skeleton | 0 | 51212 | <gh_stars>0
# WSGI Server for Development
# Use this during development vs. apache. Can view via [url]:8001
# Run using virtualenv. 'env/bin/python run.py'
from app import app
app.run(host='127.0.0.1', port=5000, debug=True)
| 1.882813 | 2 |
utils/ProcessorsScheduler.py | Leo-xxx/NeuronBlocks | 1,257 | 51213 | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT license.
import multiprocessing
from multiprocessing import cpu_count
import math
class ProcessorsScheduler(object):
process_num = cpu_count()
def __init__(self, cpu_num_workers=None):
if cpu_num_workers != None and ... | 3.203125 | 3 |
py_code/sudoku.py | xiangnan-fan/proj01 | 0 | 51214 | #!/bin/python3
# encoding: utf-8
import sys
import numpy as np
from time import time
'''
x
[0, 2] => idx start 0, end 3
[3, 5] => idx start 3, end 6
[6, 8] => idx start 6, end 9
((0 + (r_idx // 3 * 3)): (3 + (r_idx // 3 * 3)), (0 + (c_idx // 3 * 3)): (3 + (c_idx // 3 * 3)))
np.random.randint(1, 10)
'''
sys.setrecu... | 2.859375 | 3 |
inventar/mm_user_backend.py | ktt-ol/ktt-inventory-system | 2 | 51215 | <gh_stars>1-10
# -*- coding: utf-8 -*-
# Copyright (c) 2015 <NAME> <<EMAIL>>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVI... | 2.1875 | 2 |
pendulum_bringup/launch/pendulum_bringup.launch.py | GaloisInc/pirate-ros | 0 | 51216 | # Copyright 2019 <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, softw... | 1.96875 | 2 |
lib/galaxy_test/selenium/test_history_dataset_state.py | itisAliRH/galaxy | 0 | 51217 | <reponame>itisAliRH/galaxy<filename>lib/galaxy_test/selenium/test_history_dataset_state.py
from galaxy.model.unittest_utils.store_fixtures import (
deferred_hda_model_store_dict,
one_hda_model_store_dict,
TEST_SOURCE_URI,
)
from .framework import (
selenium_test,
SeleniumTestCase,
UsesHistoryIte... | 2.0625 | 2 |
backend/spider_backend.py | sunhailin-Leo/business_data_spider | 4 | 51218 | <reponame>sunhailin-Leo/business_data_spider
# -*- coding: UTF-8 -*-
"""
Created on 2017年11月10日
@author: Leo
"""
# 第三方库
from flask import Flask, Blueprint
from flask_restful import Api
# 项目内部库
from backend.resources.spider import SpiderList
from backend.resources.spider import SpiderSearch
# 项目版本的URL前缀
version_prefi... | 2.265625 | 2 |
committees/migrations/0009_auto_20200122_1722.py | jonting/volmun | 0 | 51219 | # Generated by Django 2.1.15 on 2020-01-22 22:22
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('committees', '0008_auto_20200114_1807'),
]
operations = [
migrations.AlterField(
... | 1.390625 | 1 |
scripts/field/autogen_goAdventure.py | hsienjan/SideQuest-Server | 0 | 51220 | <reponame>hsienjan/SideQuest-Server
# ParentID: 0
# ObjectID: 0
# Character field ID when accessed: 0
| 0.9375 | 1 |
src/fermilib/ops/_interaction_rdm_test.py | babbush/HistoricalFermiLib | 1 | 51221 | # 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
# distribu... | 1.9375 | 2 |
open_issues.py | cmr/license-crusade | 3 | 51222 | <reponame>cmr/license-crusade
#!/usr/bin/env python3
import github3
from urllib.parse import urlparse
import sys
import os
import time
gh = github3.login(token=os.getenv("GH_API_TOKEN"))
tpl = open("issue-template.txt").read()
repos = set(open("repos.txt"))
processed = set(open("processed.txt")).union(set(open("error... | 2.28125 | 2 |
cdpy/cdp/media.py | MichaelBrunn3r/cdpy | 1 | 51223 | from __future__ import annotations
import dataclasses
class PlayerId(str):
"""Players will get an ID that is unique within the agent context."""
def __repr__(self):
return f"PlayerId({super().__repr__()})"
class Timestamp(float):
""""""
def __repr__(self):
return f"Timestamp({supe... | 2.5625 | 3 |
stp_zmq/authenticator.py | andkononykhin/plenum | 148 | 51224 | import sys
import asyncio
import zmq
import zmq.asyncio
from zmq.auth import Authenticator
from zmq.auth.thread import _inherit_docstrings, ThreadAuthenticator, \
AuthenticationThread
# Copying code from zqm classes since no way to inject these dependencies
class MultiZapAuthenticator(Authenticator):
"""
... | 2.515625 | 3 |
core/templatetags/core/tags.py | zachtib/MTGRollCall | 0 | 51225 | <reponame>zachtib/MTGRollCall
import re
from django import template
from django.urls import reverse, NoReverseMatch
from django.utils.safestring import mark_safe
register = template.Library()
@register.simple_tag(takes_context=True)
def nav(context, url, text):
try:
url = reverse(url)
except NoRever... | 2.25 | 2 |
makehuman-master/makehuman/shared/proxy.py | Phantori/Radiian-Arts-BioSource | 1 | 51226 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
**Project Name:** MakeHuman
**Product Home Page:** http://www.makehumancommunity.org/
**Github Code Home Page:** https://github.com/makehumancommunity/
**Authors:** <NAME>, <NAME>
**Copyright(c):** MakeHuman Team 2001-2019
**Licensing:** ... | 2.265625 | 2 |
pysph/tools/tests/test_mesh_tools.py | nauaneed/pysph | 293 | 51227 | import numpy as np
import unittest
import pytest
from pysph.base.particle_array import ParticleArray
import pysph.tools.mesh_tools as G
from pysph.base.utils import get_particle_array
# Data of a unit length cube
def cube_data():
points = np.array([[0., 0., 0.],
[0., 1., 0.],
... | 2.1875 | 2 |
src/event.py | deepakkarki/pub-sub | 0 | 51228 | # event.py>
from enum import Enum
# Constants for accessing data fields out of the Control Events'
# data dictionaries
CHORD_RING = "ring"
PREDECESSOR = "predecessor"
SEGMENT = "segment"
class EventType(Enum):
PAUSE_OPER = 1
RESUME_OPER = 2
RESTART_BROKER = 3
RING_UPDATE = 4
UPDATE_TOPICS = 5
... | 2.875 | 3 |
BuildingDepot-v3.2.8/buildingdepot/CentralService/app/rest_api/dataservices/dataservice.py | Entromorgan/GIoTTo | 0 | 51229 | """
CentralService.rest_api.dataservice
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module handles the interactions with the dataservice models. Takes care
of all the CRUD operations on dataservices. Each dataservice will have a list
of buildings and admins that belong to it.
@copyright: (c) 2016 SynergyLabs
@license: UCSD Lic... | 2.4375 | 2 |
polling_stations/apps/addressbase/models.py | dantagg/UK-Polling-Stations | 0 | 51230 | from django.contrib.gis.db import models
from django.db import connection
from uk_geo_utils.models import (
AbstractAddress,
AbstractAddressManager,
AbstractOnsudManager,
)
class AddressManager(AbstractAddressManager):
def postcodes_for_district(self, district):
qs = self.filter(location__with... | 2.359375 | 2 |
virtual_env/libs/mysql-connector/unittests.py | bopopescu/fantastico | 2 | 51231 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# MySQL Connector/Python - MySQL driver written in Python.
# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
# MySQL Connector/Python is licensed under the terms of the GPLv2
# <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most
... | 1.632813 | 2 |
Assignments/Sprint1/BinaryToAscii.py | mark-morelos/CS_Notes | 1 | 51232 | """
Given a binary string (ASCII encoded), write a function that returns the equivalent decoded text.
Every eight bits in the binary string represents one character on the ASCII table.
Examples:
csBinaryToASCII("011011000110000101101101011000100110010001100001") -> "lambda"
01101100 -> 108 -> "l"
01100001 -> 97 -> "... | 4.15625 | 4 |
fradomus/site/seloger.py | kakwa/fradomus | 2 | 51233 | <filename>fradomus/site/seloger.py
import requests
import datetime
import json
import time
import uuid
import jwt
from fradomus.site import BaseAds
# Some constants used to build the base local JWT token
AUD_CONST = "SeLoger-Mobile-6.0"
APP_CONST = "63ee714d-a62a-4a27-9fbe-40b7a2c318e4"
ISS_CONST = "SeLoger-mobile"
J... | 2.390625 | 2 |
challenge-64/test_solver.py | mauricioklein/algorithm-exercises | 3 | 51234 | import unittest
from solver import look_and_say
class TestSolver(unittest.TestCase):
def test_look_and_say(self):
self.assertEqual(look_and_say(1), "1")
self.assertEqual(look_and_say(2), "11")
self.assertEqual(look_and_say(3), "21")
self.assertEqual(look_and_say(4), "1211")
self.assertEqual(look_... | 2.9375 | 3 |
Webapp/bot_retrieve.py | lordbeerus0505/voting-system-blockchain | 0 | 51235 | <filename>Webapp/bot_retrieve.py
import requests
import json
class Bot:
def retrieve(self,question):
apidata={"question": question}
url="https://codefundoqna.azurewebsites.net/qnamaker/knowledgebases/c4b368e1-6b7e-4d23-8136-a4df3d6ce7fc/generateAnswer"
headers={'Authorization': 'EndpointKey... | 3.21875 | 3 |
base/admin.py | sakthicse/agricultural_innovations | 0 | 51236 | <filename>base/admin.py
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django.contrib import admin
from .models import Projects,SiteInfo
# Register your models here.
class ProjectsAdmin(admin.ModelAdmin):
list_display = ['name']
class SiteInfoAdmin(admin.ModelAdmin):
lis... | 2.015625 | 2 |
bitirmetezi/venv/Lib/site-packages/plot/tk/listTK/upgrade_index.py | busraltun/IMPLEMENTATIONOFEYECONTROLLEDVIRTUALKEYBOARD | 1 | 51237 | """
upgrade a low dimensional index to a higher one
"""
from typing import List
def upgrade_index(index, new_dim):
# type: (List, int) -> List
"""Upgrade a low dimensional index to a higher one
Args:
index (List): a list of integers
new_dim (int): the new dimension
Returns:
a... | 3.703125 | 4 |
CNN-for-Stock-Market-Prediction-PyTorch/source/data_preprocess.py | mikimaus78/ml_monorepo | 51 | 51238 | <filename>CNN-for-Stock-Market-Prediction-PyTorch/source/data_preprocess.py
# Freddy @<NAME>
# Nov. 19, 2017
# reference: http://pytorch.org/tutorials/beginner/data_loading_tutorial.html
from __future__ import print_function, division
import os
from tqdm import *
import torch
import pandas as pd
from skimage import i... | 3.234375 | 3 |
app/admin/authentic.py | BeyondLam/Flask_Blog_Python3 | 2 | 51239 | from . import admin
from app import db
from flask import request, jsonify, current_app, session
from app.models import Admin, AdminLoginLog
from app.utils.tool import admin_login_required
# 登录
@admin.route("/login", methods=["POST"])
def login():
"""用户的登录"""
# 获取参数
req_dict = request.get_json()
userna... | 2.53125 | 3 |
molecule/default/tests/test_role.py | gantsign/ansible_role_lazygit | 2 | 51240 | <filename>molecule/default/tests/test_role.py
def test_lazygit(host):
assert host.run('lazygit -v').rc == 0
| 1.28125 | 1 |
src/post/views.py | viniciussslima/b2bit-mini-twitter | 0 | 51241 | from rest_framework import generics
from rest_framework.response import Response
from .serializers import CreatePostSerializer, ListPostSerializer
from .models import Post
class PostView(generics.GenericAPIView):
def post(self, request):
data = {**request.data, **{"user": request.user.id}}
seri... | 2.265625 | 2 |
bot/cogs/cogs.py | phantom0174/HSQCC_bot | 4 | 51242 | from discord.ext import commands
import os
import sys
import asyncio
from ..core.cog_config import CogExtension
from typing import Tuple
# function for cogs management
def find_cog(bot, target_cog: str, mode: str) -> Tuple[bool, str]:
def load_ext(full_path: str):
if mode == 'load':
bot.load_e... | 2.25 | 2 |
dev/sandbox/dg_sim/fk_demag.py | davidcortesortuno/finmag | 10 | 51243 | """
A copy from the existing FK code.
This is not a real/pure DG method, I mean, the demagnetisation fields including the magnetic
potential are not totally computed by DG methods, such as IP method or
the mixed form using BDM and DG space. The idea is actually even we use DG space
to represent the effective field an... | 2.375 | 2 |
main.py | Javifdz12/ejercicios_agregacion_composicion | 0 | 51244 | <gh_stars>0
from clases.inmortal import Yin,Yang
from clases.alternativa_herencia_multiple import Pared,Ventana,ParedCortina,interfaz_cristal2,Casa
if __name__ == '__main__':
yin=Yin()
yang=Yang()
yin.yang=yang
print(yang)
print(yang is yin.yang)
pared_norte = Pared("NORTE")
pared_oeste =... | 2.484375 | 2 |
rotationtest.py | migouche/pygamemig-dev | 0 | 51245 | <gh_stars>0
from pygamemig import *
window = Window(800, 1000)
pac = Object("pacman.png", Vector2(200, 100))
pac.transform.setPos(Vector2(400, 400))
txt = Text("freesansbold.ttf", 30, Colors.black, Colours.white)
txt.Text("wtf")
txt.rectTransform.setPos(Vector2(100, 100))
window.setBG(Color.fromHex("#ff0000"))
Rea... | 2.578125 | 3 |
remote/dns/nsmap.py | black-security/cyber-security-framework | 31 | 51246 | <gh_stars>10-100
import dns.resolver, dns.message, argparse, sys
from core.modules.base import Program
from core.modules.console import print
class NSMap(dns.resolver.Resolver, Program):
"""Map DNS Records."""
def __init__(self):
super().__init__()
self.parser.add_argument("query", type=str, h... | 2.890625 | 3 |
src/data/batchloader.py | jiahui890/chexpert-aml | 0 | 51247 | <reponame>jiahui890/chexpert-aml<gh_stars>0
import pandas as pd
import numpy as np
class BatchLoader:
def __init__(self, dataset, batch_size, return_labels=None, without_image=False, return_X_y=True):
self.dataset = dataset
self.batch_size = batch_size
self.return_labels = return_labels
... | 2.484375 | 2 |
Commands.py | xuanbachtran02/SportsNerd | 1 | 51248 | from discord.ext import commands
from library.MessageContent import MessageContent
from library.Utils import getTeamInfo
from library.InputParser import InputParser
from library.SendList import SendList
class Commands(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.Cog.listener()
... | 2.6875 | 3 |
test_sms_for_pi.py | viable-hartman/sim-module | 61 | 51249 | #!/usr/bin/python3
import logging
from test_shared import initializeLogs, initializeUartPort, baseOperations
from lib.sim900.smshandler import SimGsmSmsHandler, SimSmsPduCompiler
def printScaPlusPdu(pdu, logger):
# printing SCA+PDU just for debug
d = pdu.compile()
if d is None:
return False
... | 2.765625 | 3 |
zpgc_2016b/include/alaudio.py | mpatacchiola/naogui | 2 | 51250 | <gh_stars>1-10
# -*- encoding: UTF-8 -*-
import sys
import time
sys.path.insert(1, "../include/pynaoqi-python2.7-2.1.3.3-linux64") #import this module for the nao.py module
from naoqi import ALProxy
if (len(sys.argv) < 2):
print "Usage: 'python audioplayer_play.py IP [PORT]'"
sys.exit(1)
IP = sys.argv[1]
PO... | 2.671875 | 3 |
pyfc/tempcontainers.py | vrga/pyFanController | 0 | 51251 | from typing import Dict
from .common import mean, ValueBuffer
from datetime import datetime, timezone, timedelta
class TemperatureGroup:
def __init__(self, name, time_read_sec=1):
self.name = name
self.data: Dict[str, ValueBuffer] = {}
self.last_update = datetime.now(tz=timezone.utc) - t... | 3.078125 | 3 |
Plot_final.py | david0811/atms597_proj3 | 0 | 51252 | import xarray as xr
import pandas as pd
import cartopy
import cartopy.crs as ccrs
import matplotlib as mpl
import matplotlib.pyplot as plt
from matplotlib.cm import get_cmap
import numpy as np
from cartopy.mpl.gridliner import LONGITUDE_FORMATTER, LATITUDE_FORMATTER
import shapely.geometry as sgeom
import cartopy.featu... | 2.46875 | 2 |
neural_aide/threesetsmetric/posregion.py | AlexandreSev/neural_aide | 0 | 51253 | #!/usr/bin/python
# coding: utf-8
import numpy as np
from .facet import Facet
class PosRegion():
"""
Implement the convex polytope
"""
def __init__(self, pos_samples):
"""
Params:
pos_samples (np.array): dim+1 positive samples to create the
(dim)-polytope... | 3.1875 | 3 |
tests/test_ISR.py | engeir/isr-spectrum | 1 | 51254 | <filename>tests/test_ISR.py
"""This script implements tests for
functions used throughout the program.
Run from directory `program` with command
python -m unittest test.test_ISR -b
"""
import multiprocessing as mp
mp.set_start_method("fork")
import unittest # pylint: disable=C0413
import numpy as np # pylint: di... | 2.765625 | 3 |
terrascript/data/external.py | amlodzianowski/python-terrascript | 0 | 51255 | # terrascript/data/external.py
import terrascript
class external(terrascript.Data):
pass
__all__ = [
"external",
]
| 1.117188 | 1 |
jt_jess/job.py | jthub/jt-jess | 1 | 51256 | import uuid
import json
import etcd3
import re
import networkx as nx
from .queue import get_queues
from .executor import get_executors
from .jt_services import get_owner_id_by_name
from .jt_services import get_job_execution_plan
from .config import ETCD_HOST
from .config import ETCD_PORT
from .config import JESS_ETCD... | 1.570313 | 2 |
app/revisioner/models.py | metamapper-io/metamapper | 3 | 51257 | # -*- coding: utf-8 -*-
import contextlib
import sys
import time
from django.db import models
from django.utils import timezone
from app.authentication.models import Workspace
from app.definitions.models import Datastore
from utils.mixins.models import UUIDModel
class Run(UUIDModel):
"""Represents scan and ref... | 2.140625 | 2 |
app/model/rental.py | almamallo/ejemplo-sphinx | 0 | 51258 | """
Rental
======
"""
class Rental:
"""
Representa el alquier de un barco de un cliente.
:param client: El cliente, arrendatario del alquiler.
:param boat: El barco del client para el que se realiza el alquiler.
:param start_date: Fecha de inicio del alquiler.
:param end_date: Fecha de fin d... | 3.59375 | 4 |
tccli/services/cme/cme_client.py | zyh911/tencentcloud-cli | 0 | 51259 | # -*- coding: utf-8 -*-
import os
import json
import tccli.options_define as OptionsDefine
import tccli.format_output as FormatOutput
from tccli.nice_command import NiceCommand
import tccli.error_msg as ErrorMsg
import tccli.help_template as HelpTemplate
from tccli import __version__
from tccli.utils import Utils
from ... | 1.882813 | 2 |
vsm/extensions/corpusbuilders/__init__.py | inpho/vsm | 31 | 51260 | """
[Documentation about the corpusbuilders extension]
"""
from __future__ import absolute_import
from .corpusbuilders import *
| 0.902344 | 1 |
taesko/web-server/setup.py | taesko/training-projects | 0 | 51261 | <gh_stars>0
from setuptools import setup, find_packages
setup(
name='ws',
entry_points={
'console_scripts': [
'pyws = ws.server:main'
]
},
packages=find_packages(exclude=('conf.d',)),
tests_require=['openpyxl']
) | 1.15625 | 1 |
src/metemcyber/core/bc/catalog.py | soum-kazuaki/metemcyber | 11 | 51262 | #
# Copyright 2021, NTT Communications Corp.
#
# 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... | 2.078125 | 2 |
scripts/python/ipmi_power_pxe.py | rbrud/power-up | 0 | 51263 | #!/usr/bin/env python
# Copyright 2017 IBM Corp.
#
# 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 require... | 2.1875 | 2 |
config/settings/local.py | agnihotri7/demo-api | 0 | 51264 | import os
from config.settings.dev import *
DEBUG = True
ENABLE_API_ROOT = True
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'tmp/db/sqlite3_db',
}
}
REST_FRAMEWORK = {
'DEFAULT_RENDERER_CLASSES': (
'rest_framework.renderers.JSONRenderer'... | 1.523438 | 2 |
addons/silex_blender/commands/save.py | ArtFXDev/silex_blender | 0 | 51265 | import logging
from silex_client.action.command_base import CommandBase
from silex_client.action.action_query import ActionQuery
class Save(CommandBase):
"""
Save current scene with context as path
"""
parameters = {
"file_path": {"label": "filename", "type": str},
}
@CommandBase.co... | 2.203125 | 2 |
tests/musicxml/types/complextypes/test_clef.py | alexgorji/music_score | 2 | 51266 | from unittest import TestCase
from musicscore.musicxml.types.complextypes.attributes import Clef
from musicscore.musicxml.types.complextypes.clef import Sign
class Test(TestCase):
def setUp(self) -> None:
self.clef = Clef()
self.clef.add_child(Sign('F'))
def test_1(self):
clef = self... | 3.046875 | 3 |
utils/mixins.py | TheKiddos/StaRat | 1 | 51267 | <filename>utils/mixins.py<gh_stars>1-10
from rest_framework.permissions import AllowAny
class PublicListRetrieveViewSetMixin:
"""Allow anyone to use list and retrieve actions, return default permissions and auth otherwise"""
allowed_actions = ['list', 'retrieve']
def get_permissions(self):
if sel... | 2.171875 | 2 |
main.py | idantony/centernet-visdrone | 17 | 51268 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import time
import torch
import numpy as np
from torch.cuda.amp import autocast, GradScaler
from src.opts import opt
from src.dataset import Dataset
from src.losses import CtdetLoss
from... | 2.046875 | 2 |
lib/mfitzer.py | kriade/python-rvn-api | 0 | 51269 | import fitz
import logging
from pathlib import Path
from typing import List, Dict
from .rvnstu import Rvnstu
from .ftoolbox import Ftoolbox
from .merger import Merger
logger = logging.getLogger(__name__)
class Mfitzer:
"""Class object who add function to fitz module
"""
def __init__(self, directory_path... | 2.625 | 3 |
de/de_models/scvi_classic.py | jimmayxu/scVI | 0 | 51270 | from scvi.models import VAE, MeanVarianceVAE
from scvi.inference import UnsupervisedTrainer
from .de_model import DEModel
import numpy as np
class ScVIClassic(DEModel):
def __init__(self, dataset, reconstruction_loss, n_latent, full_cov=False,
do_mean_variance=False, name=''):
super().__... | 2.140625 | 2 |
Lib/test/test_mailcap.py | sireliah/polish-python | 1 | 51271 | zaimportuj mailcap
zaimportuj os
zaimportuj shutil
zaimportuj test.support
zaimportuj unittest
# Location of mailcap file
MAILCAPFILE = test.support.findfile("mailcap.txt")
# Dict to act jako mock mailcap entry dla this test
# The keys oraz values should match the contents of MAILCAPFILE
MAILCAPDICT = {
'applicat... | 2.21875 | 2 |
app1.py | Lomesh2000/connect-flask-to-mongodb | 0 | 51272 | from flask import Flask,render_template,request,redirect
from pymongo import MongoClient
app=Flask(__name__)
client=MongoClient('mongodb://127.0.0.1:27017')
db=client['names']
collection=db.record
@app.route('/',methods=['GET','POST'])
def index():
if request.method=='POST':
firstname=request.form[... | 2.84375 | 3 |
gen_label_suncg.py | AngelaZhouETH/singleshot6Dpose | 0 | 51273 | <gh_stars>0
import os
import json
import pymesh
import numpy as np
from MeshPly import MeshPly
from utils import *
import sys
sys.path.append('../sixd_toolkit/pysixd')
import transform
import shutil
width = 640.0
height = 480.0
modelId = 67
meshname = "../Data_raw/object/" + str(modelId)+"/"+str(modelId)+".ply"
scen... | 2.171875 | 2 |
opencv_project_python-master/opencv_project_python-master/04.img_processing/bitwise_masking.py | dongrami0425/Python_OpenCV-Study | 0 | 51274 | <gh_stars>0
import numpy as np, cv2
import matplotlib.pylab as plt
#--① 이미지 읽기
img = cv2.imread('../img/girl.jpg')
#--② 마스크 만들기
mask = np.zeros_like(img)
cv2.circle(mask, (150,140), 100, (255,255,255), -1)
#cv2.circle(대상이미지, (원점x, 원점y), 반지름, (색상), 채우기)
#--③ 마스킹
masked = cv2.bitwise_and(img, mask)
#--④ 결과 출력
cv2.ims... | 2.671875 | 3 |
models/supersample_model.py | Arjun-Arora/GettingStartedWithRTXRayTracing | 0 | 51275 | import torch
import torch.nn as nn
import torch.nn.functional as F
class sub_pixel(nn.Module):
def __init__(self, scale, act=False):
super(sub_pixel, self).__init__()
modules = []
modules.append(nn.PixelShuffle(scale))
self.body = nn.Sequential(*modules)
def forward(self, x):
... | 2.640625 | 3 |
bilibili_meter/web_server/routes/api_up.py | Gravitykey/bilibili_meter | 5 | 51276 | <filename>bilibili_meter/web_server/routes/api_up.py
from flask import Blueprint, jsonify,request,abort
import time
import logging
from ..model import WebUser, WatchedUser, WatchedVideo, Task, TaskStatus,\
ItemOnline, ItemVideoStat, ItemUpStat, ItemRegionActivity,\
TaskFailed,TotalWatche... | 1.984375 | 2 |
mode/examples/Topics/AdvancedData/LoadSaveTable/Bubble.py | timgates42/processing.py | 1,224 | 51277 | <filename>mode/examples/Topics/AdvancedData/LoadSaveTable/Bubble.py<gh_stars>1000+
# A Bubble class
class Bubble(object):
# Create the Bubble
def __init__(self, x, y, diameter, name):
self.x = x
self.y = y
self.diameter = diameter
self.name = name
self.over... | 3.703125 | 4 |
CpE520_HW5.py | Crobisaur/KMeans_MNIST | 0 | 51278 | <filename>CpE520_HW5.py
print(__doc__)
from time import time
import numpy as np
import matplotlib.pyplot as plt
import h5py
from sklearn import metrics
from sklearn.cluster import KMeans
from sklearn.datasets import load_digits
from sklearn import decomposition
from sklearn.preprocessing import scale
from skimage.tra... | 2.375 | 2 |
common/test_the_agent.py | yangzhao-666/Potential-based-Reward-Shaping-in-Sokoban | 5 | 51279 | import gym
import gym_sokoban
import torch
import numpy as np
import random
import time
from utilities.channelConverter import hwc2chw
from experts.utils import get_distance
from external_actions import get_astar_action
import warnings
warnings.simplefilter("ignore", UserWarning)
def test_the_agent(agent, data_path... | 2.28125 | 2 |
class-excercises/pipeline.py | lolotobg/FakeNewsChallenge | 1 | 51280 | import copy
from csv import DictReader
from sklearn.model_selection import KFold
from sklearn.pipeline import Pipeline
from sklearn.preprocessing.data import MinMaxScaler
from sklearn.svm import SVC
from features import SentenceLength, BagOfTfIDF, WordOverlap
from features import POS, NER
from features import ToMatri... | 2.625 | 3 |
src/tests/authentication/testAuthentication.py | c3loc/squirrel | 1 | 51281 | <reponame>c3loc/squirrel
from django.contrib.auth import views as auth_views
from django.contrib.auth.forms import PasswordChangeForm, PasswordResetForm
from django.contrib.auth.models import User
from django.core import mail
from django.test import TestCase
from django.urls import resolve, reverse
class PasswordRese... | 2.40625 | 2 |
cowbird/constants.py | Ouranosinc/cowbird | 1 | 51282 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Constant settings for Cowbird application.
Constants defined with format ``COWBIRD_[VARIABLE_NAME]`` can be matched with corresponding
settings formatted as ``cowbird.[variable_name]`` in the ``cowbird.ini`` configuration file.
.. note::
Since the ``cowbird.ini`` ... | 2.15625 | 2 |
questions/question#24baseTrie.py | seunghk1206/1-Manhattan-FullStack-Development | 1 | 51283 | <gh_stars>1-10
class Trie():
def __init__(self):
self.val = 0
self.next = dict()
def __repr__(self):
return f'{self.val} {self.next}'
def makeTrie(words):
trie, r_trie = dict(), dict()
for word in words:
l = len(word)
trie[l], r_trie[l] = trie.get(l, dict(... | 3.1875 | 3 |
tests/test_data/hierarchical_optimizer_test_data.py | Algomorph/LevelSetFusion-Python | 8 | 51284 | <gh_stars>1-10
# ================================================================
# Created by <NAME> on 12/14/18.
# Copyright (c) 2018 <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... | 1.71875 | 2 |
unchi/main.py | yuto51942/unchi-maker | 1 | 51285 | <reponame>yuto51942/unchi-maker
"""
@author <NAME>
@version 1.0.1
Copyright (c) 2020 <NAME>
"""
import time
import pyperclip
from .analysis import Analysis
from .exception import TextNotStringError
def get_clipboard() -> str:
"""
Get to clipboard.
Returns:
str: get string from clipboard.
"""
retur... | 2.765625 | 3 |
tests/graphite_test.py | datastax-labs/hunter | 17 | 51286 | <filename>tests/graphite_test.py<gh_stars>10-100
from hunter.graphite import compress_target_paths
def test_compress_target_paths():
paths = [
"foo.bar.p50",
"foo.bar.p75",
"foo.bar.p99",
"foo.foo.baz.p50",
"foo.foo.baz.p75",
"foo.foo.baz.throughput",
"somet... | 2.28125 | 2 |
gridded/tests/test_ugrid/test_find_nodes.py | groutr/gridded | 49 | 51287 | <reponame>groutr/gridded
#!/usr/bin/env python
"""
Testing of code to find nodes.
Currently only nearest neighbor.
"""
from __future__ import (absolute_import, division, print_function)
import numpy as np
from .utilities import twenty_one_triangles
def test_locate_node(twenty_one_triangles):
"""Test finding... | 2.8125 | 3 |
typeddfs/_mixins/_pretty_print_mixin.py | dmyersturnbull/typed-dfs | 5 | 51288 | """
Mixin that just overrides _repr_html.
"""
class _PrettyPrintMixin:
"""
A DataFrame with an overridden ``_repr_html_`` and some simple additional methods.
"""
def _repr_html_(self) -> str:
"""
Renders HTML for display() in Jupyter notebooks.
Jupyter automatically uses this ... | 3.203125 | 3 |
client/src/FifoFile.py | tommccallum/smartbot | 1 | 51289 | import logging
import os
class FifoFile:
"""
Fifo object that handles directory and file creation
"""
instance_counter = 1
"""Makes any fifo name unique"""
def __init__(self, fifo_path=None, filename_prefix = "smartbot"):
self.fifo_filename = "{}_{}.{}".format(filename_prefix, str(Fi... | 3.375 | 3 |
emission/tests/analysisTests/result_precompute/TestPrecomputeResults.py | Andrew-Tan/e-mission-server | 0 | 51290 | # Standard imports
import unittest
import json
import logging
from datetime import datetime, timedelta
# Our imports
from emission.core.get_database import get_db, get_mode_db, get_section_db
from emission.analysis.result.precompute import precompute_results
from emission.core.wrapper.user import User
from emission.co... | 2.1875 | 2 |
src/abaqus/Amplitude/DecayAmplitude.py | Haiiliin/PyAbaqus | 7 | 51291 | <filename>src/abaqus/Amplitude/DecayAmplitude.py
from abaqusConstants import *
from .Amplitude import Amplitude
class DecayAmplitude(Amplitude):
"""The DecayAmplitude object defines an amplitude curve using an exponential decay.
The DecayAmplitude object is derived from the Amplitude object.
Notes
-... | 2.8125 | 3 |
section5/test_Prices.py | skbansal5642/UnitTestingAndTestDrivenDevelopmentInPythonMaster | 0 | 51292 | <filename>section5/test_Prices.py
from pytest import raises
from Prices import Prices
from unittest.mock import MagicMock
import json
import pytest
def test_atLeastOneItem(monkeypatch):
mock_json_load = MagicMock(return_value = json.loads('{"a": 1, "b": 2, "d": 4}'))
monkeypatch.setattr("json.load", mock_json... | 2.515625 | 3 |
legacy_gerok/tools.py | marcelb98/pycroft | 0 | 51293 | # coding=utf-8
# Copyright (c) 2015 The Pycroft Authors. See the AUTHORS file.
# This file is part of the Pycroft project and licensed under the terms of
# the Apache License, Version 2.0. See the LICENSE file for details.
import logging as std_logging
log = std_logging.getLogger('import')
import collections
import tim... | 2.109375 | 2 |
recheck.py | eicc27/AutoHCloud | 0 | 51294 | <reponame>eicc27/AutoHCloud
"""
Post-processing of the results.
"""
import os
import shutil
from PIL import Image, ImageFont, ImageDraw
from strformat import StrFormat
def recheck(path: str, total: list[list[str]]):
StrFormat.info("Checking the results...")
t = len(total)
ref = list(range(t)... | 2.53125 | 3 |
interview_questions/Amazon/pairs_pos_neg_values.py | rpg711/Interview-Prep | 0 | 51295 | '''https://practice.geeksforgeeks.org/problems/pairs-with-positive-negative-values/0'''
from collections import defaultdict
import heapq
import re
def pos_neg_pairs(A):
count = defaultdict(lambda: [0,0])
for i, n in enumerate(A):
if n < 0:
count[abs(n)][0] += 1
else:
c... | 3.890625 | 4 |
run.py | msk-5s/hclust-uniform | 0 | 51296 | <gh_stars>0
# SPDX-License-Identifier: MIT
"""
This script runs phase identification using a single set of parameters.
Note that the results in this script may differ a bit from the results gotten from using
`run_suite.py`. This is because the random number generator is only `invoked` once in this script
where as it ... | 2.375 | 2 |
spark_auto_mapper_fhir/value_sets/resource_type.py | imranq2/SparkAutoMapper.FHIR | 1 | 51297 | from __future__ import annotations
from spark_auto_mapper_fhir.fhir_types.uri import FhirUri
from spark_auto_mapper_fhir.value_sets.generic_type import GenericTypeCode
from spark_auto_mapper.type_definitions.defined_types import AutoMapperTextInputType
# This file is auto-generated by generate_classes so do not edi... | 2.0625 | 2 |
lab05/programm3.2-iris.py | Mushroomator/DataMiningLabs | 0 | 51298 | <reponame>Mushroomator/DataMiningLabs
# Vorlesung Data Mining
# Kapitel 3: Beispiel zu Iris-Bewertung mit oneR
# <NAME>
import numpy as np
import pandas as pd
import sklearn as scn
from sklearn.datasets import load_iris
from sklearn.model_selection import train_test_split
# Datensatz zu Iris laden
dataset = load_iris(... | 3.015625 | 3 |
testproject/test.py | nilakshdas/jobby | 0 | 51299 | from __future__ import print_function
import time
from jobby import JobbyJob
with JobbyJob(dict()) as job:
print(time.time())
| 2.4375 | 2 |