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 |
|---|---|---|---|---|---|---|
sa/profiles/Alcatel/AOS/get_inventory.py | prorevizor/noc | 84 | 16900 | <filename>sa/profiles/Alcatel/AOS/get_inventory.py
# ----------------------------------------------------------------------
# Alcatel.AOS.get_inventory
# ----------------------------------------------------------------------
# Copyright (C) 2007-2014 The NOC Project
# See LICENSE for details
# -------------------------... | 2.15625 | 2 |
db_conn.py | achhetr/Library-book-store-app | 0 | 16901 | import sqlite3
class Database:
# create book always if not exists
def __init__(self,db):
self.conn = sqlite3.connect(db)
self.cur = self.conn.execute("CREATE TABLE IF NOT EXISTS book (id INTEGER PRIMARY KEY, " +
"title TEXT, author TEXT, year INTEGER, isbn INTEGER)"... | 4 | 4 |
edge-tool/cbor_converter.py | hckim-kornic/mbed-edge-kornic | 0 | 16902 | #!/usr/bin/env python
# ----------------------------------------------------------------------------
# Copyright 2018 ARM Ltd.
#
# SPDX-License-Identifier: Apache-2.0
#
# 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 ... | 1.632813 | 2 |
turbinia/processors/archive_test.py | sa3eed3ed/turbinia | 559 | 16903 | <filename>turbinia/processors/archive_test.py
# -*- coding: utf-8 -*-
# Copyright 2019 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICE... | 2.375 | 2 |
blog.py | BenTimor/SerializationConceptSystem | 1 | 16904 | <reponame>BenTimor/SerializationConceptSystem<gh_stars>1-10
from utils import database
class Config:
config = None
def __init__(self, users, posts, comments):
self.users = users
self.posts = posts
self.comments = comments
Config.config = self
@staticmethod
def update()... | 2.796875 | 3 |
src/svr/tests/__init__.py | yottaawesome/fsnd-project-2 | 3 | 16905 | from .test_db import TestDal
| 1.023438 | 1 |
Owner/models.py | 2000090063/Vehicle_Rental_System-SDP-2- | 3 | 16906 | from django.db import models
# Create your models here.
class Owner(models.Model):
Owner_id = models.AutoField
Owner_firstname = models.CharField(max_length=60)
Owner_lastname = models.CharField(max_length=60)
Owner_address = models.CharField(max_length=600)
Owner_email = models.CharField(max_lengt... | 2.328125 | 2 |
tectosaur/fmm/builder.py | jlmaurer/tectosaur | 17 | 16907 | import numpy as np
import tectosaur.util.gpu as gpu
from tectosaur.fmm.c2e import build_c2e
import logging
logger = logging.getLogger(__name__)
def make_tree(m, cfg, max_pts_per_cell):
tri_pts = m[0][m[1]]
centers = np.mean(tri_pts, axis = 1)
pt_dist = tri_pts - centers[:,np.newaxis,:]
Rs = np.max(np... | 2.078125 | 2 |
fabio/test/codecs/test_mpaimage.py | picca/fabio | 0 | 16908 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Project: Fable Input Output
# https://github.com/silx-kit/fabio
#
# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
#
# Principal author: <NAME> (<EMAIL>)
#
# This program is free software: you can redistribute it an... | 2.3125 | 2 |
currencySpider.py | cloud322/helloScrap | 0 | 16909 | # -*- coding: utf-8 -*-
import scrapy
import codecs
import sys
#리눅스상에서 utf-8 로 파일에 내용을 기록하려면 시스템 기본 인코딩으 ㄹutf-8 로 설정해야함
reload(sys)
sys.setdefaultencoding('utf8')
# scrapy 에서 spider 는 crawling/scrapping을 담당하는 핵심부분
#crawling/scrapping 절차에 대한 정의를 하는 부분
class CurrSpider(scrapy.Spider):
name = 'currSpider'
start_... | 2.828125 | 3 |
tests/test_sanity_check/test_similar_columns.py | thibaultbl/feature_engine | 1 | 16910 | <reponame>thibaultbl/feature_engine<gh_stars>1-10
import numpy as np
import pandas as pd
from feature_engine.sanity_check import SimilarColumns
def test_similar_columns_when_more_columns_in_train_than_test(
df_vartypes, df_na
):
# When columns are the same
train = df_na.copy()
test = df_vartypes.cop... | 2.828125 | 3 |
examples/sem_seg_dense/train.py | megaelius/deep_gcns_torch | 0 | 16911 |
import __init__
import os
#os.environ['LD_LIBRARY_PATH'] += ':/usr/local/cuda-11.1/bin64:/usr/local/cuda-11.2/bin64'
import numpy as np
import torch
import torch.multiprocessing as mp
import torch_geometric.datasets as GeoData
from torch_geometric.loader import DenseDataLoader
import torch_geometric.transforms as T... | 1.9375 | 2 |
sources/tkinter/prog03.py | kantel/pythoncuriosa | 0 | 16912 | import tkinter as tk
from tkinter import ttk
win = tk.Tk()
win.title("Python GUI")
win.resizable(False, False)
win.configure(background = "grey94")
a_label = ttk.Label(win, text = "Gib Deinen Namen ein:")
a_label.grid(column = 0, row = 0)
a_label.grid_configure(padx = 8, pady = 8)
def clickMe():
action.configure... | 3.765625 | 4 |
openarticlegauge/slavedriver.py | CottageLabs/OpenArticleGauge | 1 | 16913 | <reponame>CottageLabs/OpenArticleGauge<filename>openarticlegauge/slavedriver.py
"""
Initialise the Celery instance to be used by the application
This is largely just boiler plate, and we could probably look at coming back to it and cleaning it
up a bit in the future.
"""
from __future__ import absolute_import
from c... | 1.6875 | 2 |
cbf_ros/scripts/cbf_controller_sy.py | k1majd/CBF_TB_RRT | 2 | 16914 | #! /usr/bin/env python
# call roscore
# $ roscore
#
# If start in manual
# $ rosrun cbf_ros cbf_controller.py
import rospy
import sys
import argparse
import re
import numpy as np
from scipy.integrate import odeint
from sympy import symbols, Matrix, sin, cos, lambdify, exp, sqrt, log
import matplotlib.pyplot as plt
im... | 2.125 | 2 |
src/gui/ui_paste_dialog.py | tonypdmtr/sxtool | 3 | 16915 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'src/gui/ui_paste_dialog.ui'
#
# Created by: PyQt5 UI code generator 5.11.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_PasteDialog(object):
def setupUi(self, PasteDialog)... | 2.0625 | 2 |
app/pathfinding/finder/__init__.py | TheronHa/Spaghetti | 208 | 16916 | __all__ = ['a_star', 'best_first', 'bi_a_star', 'breadth_first', 'dijkstra',
'finder', 'ida_star']
| 1.328125 | 1 |
dependencies/src/4Suite-XML-1.0.2/test/Xml/Xslt/Borrowed/uo_20000929.py | aleasims/Peach | 0 | 16917 | <reponame>aleasims/Peach
#Uche's test from Sun's SVG slide publisher
import os
from Xml.Xslt import test_harness
#From Sun's toolkit
sheet_1_uri = "Xml/Xslt/Borrowed/svgslides.xsl"
sheet_2_uri = "Xml/Xslt/Borrowed/svgslides_custom.xsl"
sheet_3_uri = "Xml/Xslt/Borrowed/slidescript.xsl"
source_1_uri = "Xml/Xslt/Borrowed... | 2.296875 | 2 |
src/2/2338.py | youngdaLee/Baekjoon | 11 | 16918 | """
2338. 긴자리 계산
작성자: xCrypt0r
언어: Python 3
사용 메모리: 29,380 KB
소요 시간: 72 ms
해결 날짜: 2020년 9월 13일
"""
def main():
A, B = int(input()), int(input())
print(A + B, A - B, A * B, sep='\n')
if __name__ == '__main__':
main()
| 3.390625 | 3 |
tests/ut/python/nn/test_activation.py | PowerOlive/mindspore | 3,200 | 16919 | <filename>tests/ut/python/nn/test_activation.py
# Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
... | 2.03125 | 2 |
sdk/python/tests/integration/feature_repos/universal/data_source_creator.py | marsishandsome/feast | 1 | 16920 | from abc import ABC, abstractmethod
from typing import Dict
import pandas as pd
from feast.data_source import DataSource
from feast.repo_config import FeastConfigBaseModel
class DataSourceCreator(ABC):
@abstractmethod
def create_data_source(
self,
destination: str,
df: pd.DataFrame,
... | 2.65625 | 3 |
tests/interpreter/expression/var_assignment_interpreter_test.py | OtavioHenrique/yalul | 1 | 16921 | from yalul.interpreters.environment import Environment
from yalul.interpreters.expressions.var_assignment_interpreter import VarAssignmentInterpreter
from yalul.interpreters.interpreter_errors import InterpreterErrors
class TestVarAssignmentInterpreter:
"""Test var assignment expression interpreter"""
def te... | 3.1875 | 3 |
backend/externals/events.py | crosspower/naruko | 17 | 16922 | import boto3
from django.conf import settings
from backend.models import CloudWatchEvent
import json
class Events:
def __init__(self):
self.client = boto3.client('events', region_name=settings.NARUKO_REGION)
def list_rules(self):
response = []
for rules in self._list_rul... | 1.828125 | 2 |
1501-1600/1560-Most Visited Sector in a Circular Track/1560-Most Visited Sector in a Circular Track.py | jiadaizhao/LeetCode | 49 | 16923 | <gh_stars>10-100
class Solution:
def mostVisited(self, n: int, rounds: List[int]) -> List[int]:
start, end = rounds[0], rounds[-1]
if end >= start:
return list(range(start, end + 1))
else:
return list(range(1, end + 1)) + list(range(start, n + 1))
| 2.96875 | 3 |
eg/deparse/example.py | KennethBlaney/rivescript-python | 0 | 16924 | #!/usr/bin/env python
# Manipulate sys.path to be able to import converscript from this local git
# repository.
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), "..", ".."))
from converscript import RiveScript
import json
bot = RiveScript()
bot.load_file("example.rive")
dep = bot.deparse... | 1.976563 | 2 |
figuras/PycharmKayStatisticalReport/example_8_11.py | bor9/estudiando_el_kay | 0 | 16925 | <filename>figuras/PycharmKayStatisticalReport/example_8_11.py
import matplotlib.pyplot as plt
import numpy as np
from scipy import signal, linalg
from matplotlib import rc
from matplotlib import rcParams
__author__ = 'ernesto'
# if use latex or mathtext
rc('text', usetex=True)
rcParams['text.latex.preamble'] = [r"\u... | 2.453125 | 2 |
src/robotide/ui/treenodehandlers.py | crylearner/RIDE3X | 1 | 16926 | <gh_stars>1-10
# Copyright 2008-2015 Nokia Solutions and Networks
#
# 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 r... | 1.359375 | 1 |
config.py | rajatomar788/pyblog | 0 | 16927 | <filename>config.py
import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config(object):
SECRET_KEY = os.environ.get('SECRET_KEY') or 'rajatomar788'
if os.environ.get('DATABASE_URL') is None:
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir, 'app.db')
elif os.environ.ge... | 2.078125 | 2 |
ceefax/fonts/size7extracondensed/__init__.py | mscroggs/CEEFAX | 1 | 16928 | from .default import size7extracondensedfont
| 1.117188 | 1 |
bom/helpers.py | gxyp/indabom | 0 | 16929 | <reponame>gxyp/indabom<gh_stars>0
from bom.octopart_parts_match import match_part
from bom.models import Part, PartClass, Seller, SellerPart, Subpart, \
Manufacturer, Organization, PartFile
def create_a_fake_organization(user, free=False):
org = Organization(
name="Atlas",
subscription='F' if ... | 2.25 | 2 |
keycodes/key/codes/win.py | jonchun/ptoys-mapper | 0 | 16930 | <filename>keycodes/key/codes/win.py<gh_stars>0
# Source:
# https://github.com/tpn/winsdk-10/blob/46c66795f49679eb4783377968ce25f6c778285a/Include/10.0.10240.0/um/WinUser.h
# # convert all C-style comments to python multi-line string comment
# find: (^/\*[\s\S\r]+?\*/)
# replace: """\n$1\n"""
# # convert all keycode #d... | 2.09375 | 2 |
application/flicket_errors/__init__.py | abbas0001/flicket | 0 | 16931 | <reponame>abbas0001/flicket
#! python3
# -*- coding: utf-8 -*-
#
from flask import Blueprint
bp_errors = Blueprint('flicket-errors', __name__)
| 1.460938 | 1 |
SmartBuild/modules/migrations/0003_module_shortcut.py | ampamo/smart-build | 0 | 16932 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('modules', '0002_module_floor'),
]
operations = [
migrations.AddField(
model_name='module',
name='sho... | 1.34375 | 1 |
app/common.py | yxonic/dl-boilerplate | 1 | 16933 | import abc
import argparse
import logging
import pathlib
from collections import namedtuple
from operator import itemgetter
import toml
class NotConfiguredError(Exception):
pass
class ParseError(Exception):
pass
class Model(abc.ABC):
"""Interface for model that can save/load parameters.
Each mod... | 3.34375 | 3 |
training/train_pos_dep.py | ex00/spacy-ru | 0 | 16934 | <reponame>ex00/spacy-ru
from __future__ import unicode_literals, print_function
import sys
from pathlib import Path
import spacy
from spacy.lang.ru import Russian
from spacy.pipeline import Tagger, DependencyParser
from spacy.util import fix_random_seed, set_lang_class
from models.dep import MyDEP
from models.loadve... | 2.265625 | 2 |
tests/test_peephole_optimizations.py | capuanob/angr | 0 | 16935 | <filename>tests/test_peephole_optimizations.py
# pylint:disable=missing-class-docstring,no-self-use
import os
import unittest
import archinfo
import ailment
import angr
from angr.analyses.decompiler.peephole_optimizations import ConstantDereferences
test_location = os.path.join(os.path.dirname(os.path.realpath(__file... | 2.28125 | 2 |
PySpace/mysql/mysql_insertdata.py | dralee/LearningRepository | 0 | 16936 | <filename>PySpace/mysql/mysql_insertdata.py
#!/usr/bin/python3
# 文件名:mysql_createtable.py
import pymysql
# 打开数据库连接
db = pymysql.connect('localhost','root','1234','fdtest')
# 使用cursor()方法创建一个游标对象cursor
cursor = db.cursor()
# SQL插入语句
sql = """INSERT INTO EMPLOYEE(
FIRST_NAME,LAST_NAME,AGE,SEX,INCOME)
VALUES('Mac2... | 3.703125 | 4 |
appleseed_python.py | AllegorithmicSAS/sat-scons | 25 | 16937 | import os
import subprocess
import threading
mutex = threading.Lock()
def render_appleseed(target_file, base_color_tex, normal_tex, roughness_tex, metallic_tex, resolution, appleseed_path):
mutex.acquire()
try:
# Read the template file from disk.
with open("scene_template.appleseed", "r") as... | 2.484375 | 2 |
conjureup/ui/views/credentials.py | iMichka/conjure-up | 1 | 16938 | from ubuntui.utils import Padding
from ubuntui.widgets.hr import HR
from conjureup.app_config import app
from conjureup.ui.views.base import BaseView, SchemaFormView
from conjureup.ui.widgets.selectors import MenuSelectButtonList
class NewCredentialView(SchemaFormView):
title = "New Credential Creation"
def... | 2.484375 | 2 |
sleekxmpp/plugins/__init__.py | aristanetworks/SleekXMPP | 0 | 16939 | <gh_stars>0
"""
SleekXMPP: The Sleek XMPP Library
Copyright (C) 2010 <NAME>
This file is part of SleekXMPP.
See the file LICENSE for copying permission.
"""
__all__ = ['xep_0004', 'xep_0012', 'xep_0030', 'xep_0033', 'xep_0045',
'xep_0050', 'xep_0085', 'xep_0092', 'xep_0199', 'gmail_notify',
... | 0.96875 | 1 |
main.py | pwillworth/dfkreport | 11 | 16940 | #!/usr/bin/env python3
import transactions
import taxmap
import db
import settings
import datetime
import argparse
import uuid
import pickle
import jsonpickle
import logging
import logging.handlers
import traceback
def main():
handler = logging.handlers.RotatingFileHandler('../main.log', maxBytes=33554432, backup... | 2.03125 | 2 |
src/tarski/fstrips/contingent/__init__.py | phoeft670/tarski | 29 | 16941 | from .problem import ContingentProblem as Problem
from .. action import Action
from .sensor import Sensor
from . import errors
| 1.171875 | 1 |
p40-49/p48.py | kbrose/project_euler | 1 | 16942 | sum = 0
for i in xrange(1,1001):
sum = sum + i**i
print sum % 10000000000
| 2.40625 | 2 |
property_proteome/length/run.py | rrazban/proteomevis_scripts | 1 | 16943 | #!/usr/bin/python
help_msg = 'get uniprot length of entire proteome'
import os, sys
CWD = os.getcwd()
UTLTS_DIR = CWD[:CWD.index('proteomevis_scripts')]+'/proteomevis_scripts/utlts'
sys.path.append(UTLTS_DIR)
from parse_user_input import help_message
from read_in_file import read_in
from parse_data import organism
... | 2.609375 | 3 |
machine_learning/torch_time_series_forecasting/src/data/dataset.py | iimuz/til | 4 | 16944 | """データセットをダウンロードするためのスクリプトです."""
# default packages
import logging
import pathlib
import traceback
import urllib.request as request
# third party
import pandas as pd
import tqdm as tqdm_std
# my packages
import src.data.directory as directory
# logger
logger = logging.getLogger(__name__)
class TqdmUpTo(tqdm_std.tq... | 2.640625 | 3 |
app.py | aracnid/i-xero | 0 | 16945 | <gh_stars>0
"""Primary application.
"""
import json
import logging
import logging.config
import os
import sys
from flask import url_for, render_template, redirect, request
from i_xero import Xero2
from i_xero.i_flask import FlaskInterface
from utils import jsonify, serialize_model
# initialize logging
# The SlackBot... | 2.21875 | 2 |
ui/Ui_main.py | realm520/aimless | 0 | 16946 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'F:\work\code\pyqt5\ui\main.ui'
#
# Created by: PyQt5 UI code generator 5.9
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
... | 1.773438 | 2 |
leetcode/345.reverse-vowels-of-a-string.py | geemaple/algorithm | 177 | 16947 | class Solution(object):
def reverseVowels(self, s):
"""
:type s: str
:rtype: str
"""
vowels = set("aeiouAEIOU")
s = list(s)
i = 0
j = len(s) - 1
while i < j:
while i < j and s[i] not in vowels:
i +=... | 3.203125 | 3 |
examples/02_pybind/01_basic/example.py | BlockResearchGroup/WS_interoperability | 1 | 16948 | <reponame>BlockResearchGroup/WS_interoperability<filename>examples/02_pybind/01_basic/example.py
# example.py
import basic
result = basic.add(1, 5)
print(result)
| 1.84375 | 2 |
cocotbext/spi/devices/TI/DRV8304.py | eoshea/cocotbext-spi | 2 | 16949 | <reponame>eoshea/cocotbext-spi<filename>cocotbext/spi/devices/TI/DRV8304.py
import cocotb
from cocotb.triggers import FallingEdge, RisingEdge, First, Timer, Event
from ... import SpiSlaveBase, SpiConfig, SpiFrameError, SpiFrameTimeout
class DRV8304(SpiSlaveBase):
def __init__(self, signals):
self._config... | 2.234375 | 2 |
manage.py | Kenneth-joseph/Blogs | 0 | 16950 | <filename>manage.py
from app import create_app,db
from flask_script import Manager,Server
from app.models import User,Comment,Blog
from flask_migrate import Migrate, MigrateCommand
#manage.shell
# Creating app instance
app = create_app('production')
migrate = Migrate(app,db)
manager = Manager(app)
manager.add_comm... | 2.296875 | 2 |
src/apps/core/migrations/0005_auto_20180417_1219.py | zhiyuli/HydroLearn | 0 | 16951 | <reponame>zhiyuli/HydroLearn<filename>src/apps/core/migrations/0005_auto_20180417_1219.py
# -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2018-04-17 17:19
from __future__ import unicode_literals
from django.db import migrations
import django_extensions.db.fields
class Migration(migrations.Migration):
de... | 1.75 | 2 |
syncgateway/__init__.py | ecordell/syncgateway-admin-client | 0 | 16952 | __author__ = '<NAME>'
__copyright__ = 'Copyright 2012-2015 Localmed, Inc.'
__version__ = "0.1.6"
__version_info__ = tuple(__version__.split('.'))
__short_version__ = __version__
| 1.171875 | 1 |
members/views.py | leonrenkema/makerspaceleiden-crm | 5 | 16953 | <filename>members/views.py
from django.shortcuts import render, redirect
from django.contrib.auth.forms import PasswordResetForm
from django.core.mail import EmailMessage
from django.template import loader
from django.http import HttpResponse
from django.contrib.auth.decorators import login_required
from django.conf ... | 2.0625 | 2 |
test_scripts/ns_instance/duan/service/vfc/nfvo/lcm/lcm/ns/views/deprecated/create_ns_view.py | lremember/VFC | 1 | 16954 | # Copyright 2018 ZTE Corporation.
#
# 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 ... | 1.53125 | 2 |
parse_training_input.py | alexpotter1/vulndetect-ml | 1 | 16955 | #!/usr/bin/env python3
import javalang
def isPrimitive(obj):
return not hasattr(obj, '__dict__')
def extract_bad_function_from_text(src):
return extract_function_from_text(src, criterion='bad')
def extract_function_from_text(src, criterion='bad'):
def recursive_find_deepest_child_position(node_body, ... | 2.96875 | 3 |
src/mist/api/rules/models/main.py | SpiralUp/mist.api | 6 | 16956 | <gh_stars>1-10
import uuid
import mongoengine as me
from mist.api import config
from mist.api.exceptions import BadRequestError
from mist.api.users.models import Organization
from mist.api.selectors.models import SelectorClassMixin
from mist.api.rules.base import NoDataRuleController
from mist.api.rules.base import... | 1.625 | 2 |
setup.py | andrewwhitehead/django-oidc-rp | 20 | 16957 | <reponame>andrewwhitehead/django-oidc-rp<gh_stars>10-100
# -*- coding: utf-8 -*-
import codecs
from os.path import abspath
from os.path import dirname
from os.path import join
from setuptools import find_packages
from setuptools import setup
import oidc_rp
def read_relative_file(filename):
""" Returns contents ... | 1.898438 | 2 |
nndet/evaluator/detection/__init__.py | joeranbosma/nnDetection | 242 | 16958 | <reponame>joeranbosma/nnDetection<gh_stars>100-1000
from nndet.evaluator.detection.froc import FROCMetric
from nndet.evaluator.detection.coco import COCOMetric
from nndet.evaluator.detection.hist import PredictionHistogram
| 1.179688 | 1 |
tests/test_update.py | sosie-js/ankisync2 | 39 | 16959 | # from ankisync2.apkg import Apkg, db
# Has to be done through normal database methods
# def test_update():
# apkg = Apkg("example1.apkg")
# for n in db.Notes.filter(db.Notes.data["field1"] == "data1"):
# n.data["field3"] = "data2"
# n.save()
# apkg.close()
| 2.46875 | 2 |
lib/place_model.py | ihaeyong/drama-graph | 3 | 16960 | import torch
import torch.nn as nn
from torchvision.datasets.vision import VisionDataset
from PIL import Image
import os, sys, math
import os.path
import torch
import json
import torch.utils.model_zoo as model_zoo
from Yolo_v2_pytorch.src.utils import *
from Yolo_v2_pytorch.src.yolo_net import Yolo
from Yolo_v2_pytorc... | 1.921875 | 2 |
ch01/challenge.py | laszlokiraly/LearningAlgorithms | 0 | 16961 | """
Challenge Exercises for Chapter 1.
"""
import random
import timeit
from algs.table import DataTable, ExerciseNum, caption
from algs.counting import RecordedItem
def partition(A, lo, hi, idx):
"""
Partition using A[idx] as value. Note lo and hi are INCLUSIVE on both
ends and idx must be valid index. C... | 3.671875 | 4 |
exaslct_src/lib/data/dependency_collector/dependency_image_info_collector.py | mace84/script-languages | 0 | 16962 | from typing import Dict
from exaslct_src.lib.data.image_info import ImageInfo
from exaslct_src.lib.data.dependency_collector.dependency_collector import DependencyInfoCollector
class DependencyImageInfoCollector(DependencyInfoCollector[ImageInfo]):
def is_info(self, input):
return isinstance(input, Dict... | 2.5625 | 3 |
tensorflow_transform/test_case_test.py | LaudateCorpus1/transform | 970 | 16963 | <gh_stars>100-1000
# Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | 2.15625 | 2 |
metageta/icons.py | ssutee/metageta | 0 | 16964 | # -*- coding: utf-8 -*-
# Copyright (c) 2013 Australian Government, Department of the Environment
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without... | 1.367188 | 1 |
chmp/src/chmp/torch_utils/_test_bayes.py | chmp/misc-exp | 6 | 16965 | import torch
import pytest
# NOTE: also registers the KL divergence
from chmp.torch_utils import NormalModule, WeightsHS, fixed
def test_kl_divergence__gamma__log_normal():
p = torch.distributions.LogNormal(torch.zeros(2), torch.ones(2))
q = torch.distributions.Gamma(torch.ones(2), torch.ones(2))
torch.... | 2.203125 | 2 |
test/hummingbot/core/utils/test_fixed_rate_source.py | BGTCapital/hummingbot | 3,027 | 16966 | <filename>test/hummingbot/core/utils/test_fixed_rate_source.py
from decimal import Decimal
from unittest import TestCase
from hummingbot.core.utils.fixed_rate_source import FixedRateSource
class FixedRateSourceTests(TestCase):
def test_look_for_unconfigured_pair_rate(self):
rate_source = FixedRateSource... | 2.796875 | 3 |
src/graphnet/models/detector/icecube.py | kaareendrup/gnn-reco | 0 | 16967 | import torch
from torch_geometric.data import Data
from graphnet.components.pool import group_pulses_to_dom, group_pulses_to_pmt, sum_pool_and_distribute
from graphnet.data.constants import FEATURES
from graphnet.models.detector.detector import Detector
class IceCube86(Detector):
"""`Detector` class for IceCube-... | 2.21875 | 2 |
tests/routes_parsing/test1.py | hellojoechip/bambleweeny | 22 | 16968 | <filename>tests/routes_parsing/test1.py
import re
t1 = 'Data !@[value1] and also !@[system:uptime] testing.'
print("Content: " + t1)
if re.search('!@\[[_a-zA-Z0-9:]*\]', t1):
print("YES")
else:
print("NO")
o = re.sub('!@\[[_a-zA-Z0-9:]*\]', '_B9yPrsE_\\g<0>_B9yPrsE_', t1)
o2 = o.split("_B9yPrsE_")
for i in... | 2.90625 | 3 |
internal/notes/builtin-SAVE/packages/suite-sparse/package.py | HPCToolkit/hpctest | 1 | 16969 | ##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by <NAME>, <EMAIL>, All rights reserved.
# LLNL-CODE-647188
#
# For det... | 1.640625 | 2 |
tick/array/serialize.py | andro2157/tick | 0 | 16970 | <reponame>andro2157/tick<filename>tick/array/serialize.py
# License: BSD 3 clause
import os
import numpy as np
import scipy
from tick.array.build.array import (
tick_float_array_to_file,
tick_float_array2d_to_file,
tick_float_sparse2d_to_file,
tick_double_array_to_file,
tick_double_array2d_to_fil... | 2.734375 | 3 |
__init__.py | bbockelm/glideinWMS | 0 | 16971 | __all__=["factory","frontend","lib","tools","creation","install","unittests"]
| 1.023438 | 1 |
views/menuVisualizacaoGeral.py | iOsnaaente/Tracker-solar-Supervisorio | 2 | 16972 | import dearpygui.dearpygui as dpg
import datetime as dt
import math
from registry import *
SUN_DATA.update_date()
# FUNCTIONS
def get_semi_circle_points( center, radius, angle_i, angle_f, segments = 360, closed = False ):
points_close = [[ center[0], center[1]-radius ] , center, [ c... | 2.59375 | 3 |
python/jwt.py | angelbarranco/passes-rest-samples | 95 | 16973 | <gh_stars>10-100
"""
Copyright 2019 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable la... | 2 | 2 |
janus.py | caxmd/januus | 83 | 16974 | <filename>janus.py
# Includes some code derived from the cpython project.
# Source: https://github.com/python/cpython/blob/master/Lib/zipfile.py
# Excuse the mess.
import argparse
from hashlib import sha1
import os
import struct
from zipfile import _EndRecData, ZipFile
from zlib import adler32
_ECD_SIGNATURE = 0
_EC... | 2.140625 | 2 |
constants.py | phy1um/tmtc-discord-bot | 0 | 16975 |
ANNOUNCEMENT_ROLE = "941805571915513857"
GUILD_ID = "878926572235665418"
| 0.953125 | 1 |
test/gst-msdk/transcode/mpeg2.py | haribommi/vaapi-fits | 0 | 16976 | ##
### Copyright (C) 2018-2019 Intel Corporation
###
### SPDX-License-Identifier: BSD-3-Clause
###
from ....lib import *
from ..util import *
from .transcoder import TranscoderTest
spec = load_test_spec("mpeg2", "transcode")
class to_avc(TranscoderTest):
@slash.requires(*have_gst_element("msdkh264enc"))
@slash.re... | 2.0625 | 2 |
rusel/base/context.py | ruslan-ok/ruslan | 0 | 16977 | import os, time, mimetypes, glob
from django.utils.translation import gettext_lazy as _
from django.urls import reverse
from task.const import *
from task.models import Task, detect_group
from rusel.base.config import Config
from rusel.base.forms import CreateGroupForm
from rusel.context import get_base_context
from ru... | 1.90625 | 2 |
deepdiy/plugins/system/debugger/debugger.py | IEWbgfnYDwHRoRRSKtkdyMDUzgdwuBYgDKtDJWd/diy | 57 | 16978 | <filename>deepdiy/plugins/system/debugger/debugger.py
import os,rootpath
rootpath.append(pattern='main.py') # add the directory of main.py to PATH
import glob
from kivy.app import App
from kivy.lang import Builder
from kivy.properties import ObjectProperty,DictProperty,ListProperty
from kivy.uix.boxlayout import BoxLay... | 2.046875 | 2 |
supervised_learning/classification/perceptron/perceptron.py | Ambitious-idiot/python-machine-learning | 3 | 16979 | <gh_stars>1-10
import numpy as np
class Perceptron:
def __init__(self, weight, bias=0):
self.weight = weight
self.bias = bias
def __repr__(self):
return 'Perceptron(weight=%r, bias=%r)' % (self.weight, self.bias)
def __get_predictions(self, data):
return np.dot(data, self... | 2.828125 | 3 |
pygama/dsp/_processors/trap_filter.py | sweigart/pygama | 1 | 16980 | <filename>pygama/dsp/_processors/trap_filter.py
import numpy as np
from numba import guvectorize
@guvectorize(["void(float32[:], int32, int32, float32[:])",
"void(float64[:], int32, int32, float64[:])",
"void(int32[:], int32, int32, int32[:])",
"void(int64[:], int32, int32, i... | 2.515625 | 3 |
other.py | nunenuh/idcard_datagen | 1 | 16981 |
def is_true(a,b,c,d,e,f,g):
if a>10:
print(10) | 2.859375 | 3 |
pilferer/engine.py | Sebastian-dm/pilferer | 0 | 16982 | <reponame>Sebastian-dm/pilferer<filename>pilferer/engine.py
import tcod
from input_handlers import handle_keys
from game_states import GameStates
from render_functions import clear_all, render_all, RenderOrder
from map_objects.game_map import GameMap
from fov_functions import initialize_fov, recompute_fov
from entit... | 2.3125 | 2 |
galaxy/api/v2/urls.py | SamyCoenen/galaxy | 0 | 16983 | <reponame>SamyCoenen/galaxy
# (c) 2012-2019, Ansible by Red Hat
#
# This file is part of Ansible Galaxy
#
# Ansible Galaxy is free software: you can redistribute it and/or modify
# it under the terms of the Apache License as published by
# the Apache Software Foundation, either version 2 of the License, or
# (at your o... | 1.632813 | 2 |
mindhome_alpha/erpnext/stock/doctype/stock_settings/test_stock_settings.py | Mindhome/field_service | 1 | 16984 | # -*- coding: utf-8 -*-
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
class TestStockSettings(unittest.TestCase):
def setUp(self):
frappe.db.set_value("Stock Settings", None, "clean_description_html", 0)
... | 2.125 | 2 |
pybloxy/classes/http.py | R0bl0x10501050/roblox.py | 0 | 16985 | <filename>pybloxy/classes/http.py<gh_stars>0
import logging
import requests
class Http:
def sendRequest(url):
payload = requests.get(str(url))
statusCode = payload.status_code
content = payload.content
if statusCode != 200:
return logging.error(f"[Pybloxy - GET] Something went wrong! Error Code: {statusCo... | 2.734375 | 3 |
resources/nuice_simulations/src/layers_sim/layers_sim_node.py | SpyGuyIan/NUice | 1 | 16986 | #!/usr/bin/env python
import rospy
from std_msgs.msg import Float64
import random
possibleLayers = [140, 50, 80, 200, 100]
cur_position = 0.0
def position_callback(msg):
global cur_position
cur_position = msg.data
#Build the layers simulation, then publish material strengths. Lasts 100 seconds.
def runLayers... | 2.5625 | 3 |
imagescraper/imagescraper/spiders/image_crawl_spider.py | karthikn2789/Scrapy-Projects | 2 | 16987 | import scrapy
import re
from scrapy.linkextractors import LinkExtractor
from scrapy.spiders import CrawlSpider, Rule
from ..items import ImagescraperItem
class ImageCrawlSpiderSpider(CrawlSpider):
name = "image_crawl_spider"
allowed_domains = ["books.toscrape.com"]
def start_requests(self):
url =... | 2.921875 | 3 |
scripts/pos_eval.py | ProKil/sparse-text-prototype | 19 | 16988 | import os
import argparse
import subprocess
import random
import edlib
from typing import List
from collections import Counter
import stanza
class ExtractMetric(object):
"""used for precision recall"""
def __init__(self, nume=0, denom_p=0, denom_r=0, precision=0, recall=0, f1=0):
super(ExtractMetric, ... | 2.578125 | 3 |
tests/rules/test_git_stash_pop.py | RogueScholar/thefuck-termux | 0 | 16989 | <reponame>RogueScholar/thefuck-termux
import pytest
from thefuck.rules.git_stash_pop import get_new_command
from thefuck.rules.git_stash_pop import match
from thefuck.types import Command
@pytest.fixture
def output():
return """error: Your local changes to the following files would be overwritten by merge:"""
... | 2.1875 | 2 |
src/arima_model.py | SaharCarmel/ARIMA | 0 | 16990 | """ The ARIMA model. """
import torch
import numpy as np
class ARIMA(torch.nn.Module):
"""ARIMA [summary]
"""
def __init__(self,
p: int = 0,
d: int = 0,
q: int = 0) -> None:
"""__init__ General ARIMA model constructor.
Args:
... | 3.578125 | 4 |
problems/slidingwindow/Solution1100.py | akalu/cs-problems-python | 0 | 16991 | """
Sliding window
Given a string S, return the number of substrings of length K with no
repeated characters.
Example 1:
Input: S = "havefunonleetcode", K = 5 Output: 6 Explanation: There are 6
substrings they are : 'havef','avefu','vefun','efuno','etcod','tcode'.
cou... | 3.953125 | 4 |
the_file_propagator/__init__.py | joeflack4/the-file-propagator | 0 | 16992 | """The File Propagator"""
| 1.007813 | 1 |
src/wa_kat/templates/static/js/Lib/site-packages/components/keyword_handler.py | WebArchivCZ/WA-KAT | 3 | 16993 | <gh_stars>1-10
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# Interpreter version: brython (http://brython.info) (like python3)
#
# Imports =====================================================================
from os.path import join
from browser import window
from browser import document
# virtual filesystem / ... | 3.03125 | 3 |
scripts/rnn/gru/__init__.py | bfeng/CryptoGRU | 1 | 16994 | from .grucell import MyGRUCell
from .gru import MyGRU | 1.078125 | 1 |
ZZZ_OtherDemo/00-dyld-832.7.3/testing/kernel-cache-tests/kext-missing-weak-bind/test.py | 1079278593/TreasureChest | 0 | 16995 | <reponame>1079278593/TreasureChest
#!/usr/bin/python2.7
import os
import KernelCollection
# Check that weak binds can be missing, so long as we check for the magic symbol
def check(kernel_cache):
kernel_cache.buildKernelCollection("arm64", "/kext-missing-weak-bind/main.kc", "/kext-missing-weak-bind/main.kernel",... | 2.234375 | 2 |
datahub/search/investment/models.py | alixedi/data-hub-api-cd-poc | 0 | 16996 | <reponame>alixedi/data-hub-api-cd-poc
from elasticsearch_dsl import Boolean, Date, Double, Integer, Keyword, Long, Object, Text
from datahub.search import dict_utils
from datahub.search import fields
from datahub.search.models import BaseESModel
DOC_TYPE = 'investment_project'
def _related_investment_project_field... | 2.34375 | 2 |
robust_sleep_net/models/modulo_net/features_encoder/fully_connected.py | Dreem-Organization/RobustSleepNet | 16 | 16997 | <reponame>Dreem-Organization/RobustSleepNet
from collections import OrderedDict
import torch
from torch import nn
class FullyConnected(nn.Module):
def __init__(self, features, layers=None, dropout=0.0):
super(FullyConnected, self).__init__()
print("Layers:", layers)
input_channels = 0
... | 2.546875 | 3 |
data/rawdata_dataset.py | weiyw16/pytorch-CycleGAN-and-pix2pix | 0 | 16998 | #import
import os
#import torch
#import torch.nn as nn
import torch.utils.data as Data
#import torchvision
import matplotlib.pyplot as plt
import h5py
#from torch.autograd import Variable
import numpy as np
import torch
class rawdataDataset(Data.Dataset):
def __init__(self):
super(rawdataDataset, self)... | 2.21875 | 2 |
pythons/pythons/pythons_app/urls.py | BoyanPeychinov/python_web_framework | 0 | 16999 | from django.urls import path
from . import views
from .views import IndexView
urlpatterns = [
# path('', views.index, name="index"),
path('', IndexView.as_view(), name="index"),
# path('create/', views.create, name="create"),
path('create/', views.PythonCreateView.as_view(), name="create"),
] | 1.914063 | 2 |