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 |
|---|---|---|---|---|---|---|
lmctl/project/mutate/base.py | manojn97/lmctl | 3 | 13500 | import abc
class Mutator(abc.ABC):
def apply(self, original_content):
return original_content
| 3.125 | 3 |
src/django_otp/conf.py | jaap3/django-otp | 318 | 13501 | <filename>src/django_otp/conf.py
import django.conf
class Settings:
"""
This is a simple class to take the place of the global settings object. An
instance will contain all of our settings as attributes, with default values
if they are not specified by the configuration.
"""
defaults = {
... | 3.09375 | 3 |
Moderation/purge.py | DevFlock/Multis | 3 | 13502 | import asyncio
import discord
from discord.ext import commands
from discord.ext.commands.core import has_permissions
class cog(commands.Cog):
def __init__(self, client):
self.client = client
@commands.command(aliases=["clear"])
@has_permissions(ban_members=True)
async def purge(self, ctx, cou... | 2.4375 | 2 |
tensorboard/acceptance/__init__.py | DeepLearnI/atlas | 296 | 13503 | from .test_tensorboard_rest_api import TestTensorboardRestAPI
from .test_tensorboard_server import TestTensorboardServer
from .test_tensorboard_endpoints import TestTensorboardEndpoint | 0.992188 | 1 |
tests/store/test_fetch_purchases_to_ship.py | yuzi-ziyu/alphasea-agent | 1 | 13504 | from unittest import TestCase
from ..helpers import (
create_web3,
create_contract,
get_future_execution_start_at_timestamp,
proceed_time,
get_prediction_time_shift,
get_purchase_time_shift,
get_shipping_time_shift,
get_publication_time_shift,
get_tournament_id,
get_chain_id,
... | 2.15625 | 2 |
tests/test_add_option_backtrace.py | ponponon/loguru | 11,391 | 13505 | <reponame>ponponon/loguru<gh_stars>1000+
from loguru import logger
# See "test_catch_exceptions.py" for extended testing
def test_backtrace(writer):
logger.add(writer, format="{message}", backtrace=True)
try:
1 / 0
except Exception:
logger.exception("")
result_with = writer.read().str... | 2.515625 | 3 |
BasicPythonPrograms/PythonDestructor.py | Pushkar745/PythonProgramming | 0 | 13506 | <reponame>Pushkar745/PythonProgramming<gh_stars>0
class Employee:
#Initializaing
def __init__(self):
print('Employee created ')
#Deleting (Calling destructor)
def __del__(self):
print('Destructor called,Employee deleted')
obj=Employee()
del obj | 3.65625 | 4 |
envi/registers.py | ConfusedMoonbear/vivisect | 1 | 13507 | <reponame>ConfusedMoonbear/vivisect
"""
Similar to the memory subsystem, this is a unified way to
access information about objects which contain registers
"""
import envi.bits as e_bits
from envi.const import *
class InvalidRegisterName(Exception):
pass
class RegisterContext:
def __init__(self, regdef=(), m... | 2.6875 | 3 |
services/nris-api/backend/app/extensions.py | parc-jason/mds | 0 | 13508 | <reponame>parc-jason/mds
from flask_caching import Cache
from flask_jwt_oidc import JwtManager
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate, MigrateCommand
from flask import current_app
from elasticapm.contrib.flask import ElasticAPM
from .config import Config
from .helper import Api
apm... | 1.859375 | 2 |
tests/test_mqtt_async.py | mpi-sws-rse/antevents-python | 7 | 13509 | <gh_stars>1-10
# Copyright 2017 by MPI-SWS and Data-Ken Research.
# Licensed under the Apache 2.0 License.
"""Test async version of mqtt libraries. Depends on hbmqtt
(https://github.com/beerfactory/hbmqtt)
"""
import unittest
import sys
import asyncio
import string
from random import choice, seed
from antevents.base ... | 2.09375 | 2 |
edit/main.py | team-alpha-kr/Partner-pyWeb | 0 | 13510 | <filename>edit/main.py
# -*- coding: utf8 -*-
import os
from flask import Flask, request, render_template, request, redirect, url_for, jsonify
from flask_discord import DiscordOAuth2Session, requires_authorization
from discord import Webhook, RequestsWebhookAdapter
webhook = Webhook.partial(814742019489660939, "rvSBVHt... | 2.75 | 3 |
protocols/tpkt.py | dparnishchev/s7scan | 98 | 13511 | from scapy.fields import ByteField, ShortField
from scapy.packet import Packet
class TPKT(Packet):
name = "TPKT"
fields_desc = [ByteField("version", 3),
ByteField("reserved", 0),
ShortField("length", 0x0000)]
| 2.328125 | 2 |
pylbm_ui/widgets/message.py | pylbm/pylbm_ui | 3 | 13512 | <reponame>pylbm/pylbm_ui
import ipyvuetify as v
class Message(v.Container):
def __init__(self, message):
self.message = v.Alert(
children=[f'{message}...'],
class_='primary--text'
)
super().__init__(
children=[
v.Row(
... | 2.4375 | 2 |
args_parser.py | vmartinv/capital_gains_calculator | 0 | 13513 | import argparse
import datetime
def get_last_elapsed_tax_year() -> int:
now = datetime.datetime.now()
if now.date() >= datetime.date(now.year, 4, 6):
return now.year - 1
else:
return now.year - 2
def create_parser() -> argparse.ArgumentParser:
# Schwab transactions
# Montly GBP/U... | 3.125 | 3 |
src/pydts/examples_utils/datasets.py | tomer1812/pydts | 0 | 13514 | import pandas as pd
from pydts.config import *
DATASETS_DIR = os.path.join(os.path.dirname((os.path.dirname(__file__))), 'datasets')
def load_LOS_simulated_data():
os.path.join(os.path.dirname(__file__))
return pd.read_csv(os.path.join(DATASETS_DIR, 'LOS_simulated_data.csv')) | 2.515625 | 3 |
busker/migrations/0013_auto_20200906_1933.py | tinpan-io/django-busker | 2 | 13515 | <gh_stars>1-10
# Generated by Django 3.1.1 on 2020-09-06 19:33
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('busker', '0012_auto_20200905_2042'),
]
operations = [
migrations.AlterModelOptions(
... | 1.476563 | 1 |
livy/cli/submit.py | tzing/python-livy | 1 | 13516 | """Submit a batch task to livy server."""
import argparse
import datetime
import importlib
import json
import logging
import re
import typing
import livy
import livy.cli.config
import livy.cli.logging
logger = logging.getLogger(__name__)
class PreSubmitArguments(argparse.Namespace):
"""Typed :py:class:`~argpars... | 2.609375 | 3 |
setup.py | nickyfoto/premoji | 0 | 13517 | """Minimal setup file for learn project."""
import pathlib
from setuptools import setup, find_packages
# The directory containing this file
HERE = pathlib.Path(__file__).parent
# The text of the README file
README = (HERE / "README.md").read_text()
setup(
name = 'premoji',
version = '0.1.4',
descriptio... | 1.78125 | 2 |
02-current-time.py | KeithWilliamsGMIT/Emerging-Technologies-Python-Fundamentals | 0 | 13518 | <reponame>KeithWilliamsGMIT/Emerging-Technologies-Python-Fundamentals<filename>02-current-time.py
# Author: <NAME>
# Date: 21/09/2017
from time import strftime
# This line prints the current date and time to the console in the format 01-10-2017 13:15:30.
# strftime must be imported from the time package before being ... | 3.578125 | 4 |
git_management/clone.py | afsantaliestra/scripts | 0 | 13519 | <reponame>afsantaliestra/scripts<gh_stars>0
import os
filepath = 'list.txt'
with open(filepath) as fp:
while line := fp.readline():
line = line.strip()
os.system(f'git clone {line}')
| 2.3125 | 2 |
train.py | amansoni/sequential-decision-problem-algorithms | 0 | 13520 | <reponame>amansoni/sequential-decision-problem-algorithms
import argparse
import os
import sys
parser = argparse.ArgumentParser(description="Run commands")
parser.add_argument('-w', '--num-workers', default=1, type=int,
help="Number of workers")
parser.add_argument('-r', '--remotes', default=None,
... | 2.375 | 2 |
MoleculeACE/benchmark/evaluation/results.py | molML/MoleculeACE | 9 | 13521 | """
Class that holds the results: used for evaluating model performance on activity cliff compounds
<NAME>, Eindhoven University of Technology, March 2022
"""
import os
import numpy as np
from MoleculeACE.benchmark.utils.const import Algorithms
from .metrics import calc_rmse, calc_q2f3
class Results:
def __init... | 2.546875 | 3 |
checkout/orders/__init__.py | accelero-cloud/tutorials | 2 | 13522 | <reponame>accelero-cloud/tutorials
from checkout.orders.order_service import Order, AuthorisationRequest
| 1.078125 | 1 |
hiisi/__init__.py | ritvje/hiisi | 0 | 13523 | from .hiisi import HiisiHDF
from .odim import OdimPVOL, OdimCOMP
__version__ = "0.0.6"
| 1.054688 | 1 |
src/hangar/repository.py | jjmachan/hangar-py | 0 | 13524 | from pathlib import Path
import weakref
import warnings
from typing import Union, Optional, List
from .merger import select_merge_algorithm
from .constants import DIR_HANGAR
from .remotes import Remotes
from .context import Environments
from .diagnostics import ecosystem, integrity
from .records import heads, parsing,... | 2.3125 | 2 |
kronos/utils.py | jtaghiyar/kronos | 17 | 13525 | '''
Created on Apr 16, 2014
@author: jtaghiyar
'''
import os
import subprocess as sub
from plumber import Plumber
from job_manager import LocalJobManager
from workflow_manager import WorkFlow
from helpers import trim, make_dir, export_to_environ
class ComponentAbstract(object):
"""
component template.... | 2.28125 | 2 |
tests/base.py | the-dotify-project/dotify | 3 | 13526 | from pathlib import Path
from re import sub
from shutil import rmtree
from unittest import TestCase
from dotify import Dotify, models
class BaseNameResolverMixin(object):
@classmethod
def get_download_basename(cls, obj):
if isinstance(obj, models.Track):
return cls.get_download_basename_t... | 2.53125 | 3 |
odoo-13.0/venv/lib/python3.8/site-packages/stdnum/imo.py | VaibhavBhujade/Blockchain-ERP-interoperability | 0 | 13527 | <reponame>VaibhavBhujade/Blockchain-ERP-interoperability
# imo.py - functions for handling IMO numbers
# coding: utf-8
#
# Copyright (C) 2015 <NAME>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software ... | 2.4375 | 2 |
yodl/__init__.py | brunolange/yodl | 0 | 13528 | """yodl!
yodl provides a class decorator to build django models
from YAML configuration files
"""
from .decorators import yodl
from .io import yodlify
__author__ = "<NAME>"
__email__ = "<EMAIL>"
__license__ = "MIT"
__all__ = ["yodl", "yodlify"]
| 1.890625 | 2 |
main.py | g-w1/hermes | 0 | 13529 | """
Usage: hermes install [-dsvV] <pkg>...
hermes -h | --help
hermes --version
Options:
-d, --depends Require dependency installation
-h, --help Display usage and options
-s, --check-sigs Verify package GPG signatures
-v, --verify Verify package... | 2.453125 | 2 |
userbot/plugins/quotes.py | aksr-aashish/FIREXUSERBOT | 0 | 13530 | import random
import requests
from FIREX.utils import admin_cmd, edit_or_reply, sudo_cmd
from userbot.cmdhelp import CmdHelp
LOVESTR = [
"The best and most beautiful things in this world cannot be seen or even heard, but must be felt with the heart.",
"You know you're in love when you can't fall asleep becau... | 2.375 | 2 |
celestial/client/system/__init__.py | ams-tech/celestial | 0 | 13531 | from . import cmdline
| 1.09375 | 1 |
tests/test_joints.py | slaclab/pystand | 0 | 13532 | ############
# Standard #
############
import math
###############
# Third Party #
###############
import ophyd
import pytest
##########
# Module #
##########
from detrot import ConeJoint, AngledJoint, StandPoint, Point
from conftest import PseudoMotor
@pytest.fixture(scope='function')
def pseudo_cone():
angled... | 2.25 | 2 |
tests/test_utils.py | munirjojoverge/rl_AD_urban_baselines | 6 | 13533 | import numpy as np
from urban_AD_env.utils import rotated_rectangles_intersect
def test_rotated_rectangles_intersect():
assert rotated_rectangles_intersect(([12.86076812, 28.60182391], 5.0, 2.0, -0.4675779906495494),
([9.67753944, 28.90585412], 5.0, 2.0, -0.341701936447320... | 2.359375 | 2 |
learning_journal/tests.py | hcodydibble/pyramid-learning-journal | 0 | 13534 | """Functions that test server functions."""
import pytest
from pyramid.httpexceptions import HTTPBadRequest, HTTPNotFound
from datetime import datetime
from learning_journal.models import Entry
def test_list_view_returns_list_of_entries_in_dict(dummy_request):
"""Test for the list_view function."""
from learn... | 2.875 | 3 |
hvad/exceptions.py | Kunpors/dr.pors- | 1 | 13535 | <filename>hvad/exceptions.py
""" Hvad-specific exceptions
Part of hvad public API.
"""
__all__ = ('WrongManager', )
class WrongManager(Exception):
""" Raised when attempting to introspect translated fields from
shared models without going through hvad. The most likely cause
for this being acce... | 2.3125 | 2 |
examples/ERP/classify_P300_bi.py | gcattan/pyRiemann-qiskit | 7 | 13536 | <reponame>gcattan/pyRiemann-qiskit
"""
====================================================================
Classification of P300 datasets from MOABB
====================================================================
It demonstrates the QuantumClassifierWithDefaultRiemannianPipeline(). This
pipeline uses Riemannian... | 2.203125 | 2 |
copy-the-content-of-one-array-into-another-in-the-reverse-order.py | kRituraj/python-programming | 0 | 13537 | <filename>copy-the-content-of-one-array-into-another-in-the-reverse-order.py
from array import *
MyArray = [None] * 20
MyArray1 = [None] * 20
i = 0
while(i < 20):
MyArray[i] = i + 1
i = i + 1
j = 0
i = 19
while(j < 20):
MyArray1[j] = MyArray[i]
j = j + 1
i = i - 1
i = 0
while(i < 20):
prin... | 3.546875 | 4 |
Findclone/aiofindclone.py | vypivshiy/Findclone_api | 5 | 13538 | from aiohttp import ClientSession, FormData
from Findclone import __version__
from .models import Account, Profiles, Histories, get_builder
from .utils import random_string, paint_boxes
from .exceptions import a_error_handler, FindcloneError
from io import BufferedReader, BytesIO
class FindcloneAsync:
"""async f... | 2.328125 | 2 |
src/program/consumers.py | pwelzel/bornhack-website | 0 | 13539 | <filename>src/program/consumers.py<gh_stars>0
from channels.generic.websocket import JsonWebsocketConsumer
from camps.models import Camp
from .models import (
Event,
EventInstance,
Favorite,
EventLocation,
EventType,
EventTrack,
Speaker
)
class ScheduleConsumer(JsonWebsocketConsumer):
... | 2.15625 | 2 |
rrs/tools/rrs_maintainer_history.py | WindRiver-OpenSourceLabs/layerindex-web | 0 | 13540 | #!/usr/bin/env python3
# Standalone script which rebuilds the history of maintainership
#
# Copyright (C) 2015 Intel Corporation
# Author: <NAME> <<EMAIL>>
#
# Licensed under the MIT license, see COPYING.MIT for details
import sys
import os.path
import optparse
import logging
sys.path.insert(0, os.path.realpath(os.p... | 1.921875 | 2 |
snakemake/persistence.py | scholer/snakemake | 0 | 13541 | __author__ = "<NAME>"
__copyright__ = "Copyright 2015-2019, <NAME>"
__email__ = "<EMAIL>"
__license__ = "MIT"
import os
import shutil
import signal
import marshal
import pickle
import json
import time
from base64 import urlsafe_b64encode, b64encode
from functools import lru_cache, partial
from itertools import filterf... | 1.75 | 2 |
Pasture_Growth_Modelling/initialisation_support/dryland_ibasal.py | Komanawa-Solutions-Ltd/SLMACC-2020-CSRA | 0 | 13542 | """
Author: <NAME>
Created: 23/11/2020 11:06 AM
"""
import ksl_env
# add basgra nz functions
ksl_env.add_basgra_nz_path()
from supporting_functions.plotting import plot_multiple_results
from check_basgra_python.support_for_tests import establish_org_input, get_lincoln_broadfield, get_woodward_weather, _clean_harves... | 2.125 | 2 |
0x05/solve/ex1-0x05.py | tuannm-1876/sec-exercises | 0 | 13543 | <reponame>tuannm-1876/sec-exercises<gh_stars>0
import urllib
import urllib2
url = "http://ctfq.sweetduet.info:10080/~q6/"
def main():
for i in range(1, 100):
data = {
"id": "admin' AND (SELECT LENGTH(pass) FROM user WHERE id = 'admin') = {counter} --".format(counter=i),
"pass": "",... | 3.140625 | 3 |
gen_methods.py | mweeden2/desert_game | 0 | 13544 | # created by <NAME>
# 7/8/16
import classes as c
def printIntro():
print 'Welcome to the\n'
print '''__/\\\\\\\\\\\\\\\\\\\\\\\\_________________________________________________\
__________________________\n _\\/\\\\\\////////\\\\\\___________________________________\
______________________________________\... | 2.390625 | 2 |
entity_resolution/interfaces/IRecord.py | GeoJamesJones/ArcGIS-Senzing-Prototype | 0 | 13545 | from __future__ import annotations
from abc import ABCMeta, abstractmethod
from typing import Dict, Any, List
class IRecord(metaclass=ABCMeta):
@abstractmethod
def to_dict(self) -> Dict[Any, Any]:
...
@abstractmethod
def to_json(self) -> str:
...
@abstractmethod
def to_list... | 2.921875 | 3 |
mkt/stats/helpers.py | Joergen/zamboni | 0 | 13546 | <filename>mkt/stats/helpers.py
from django.utils.http import urlquote
from jingo import register
import jinja2
from access import acl
@register.function
@jinja2.contextfunction
def check_contrib_stats_perms(context, addon):
request = context['request']
if addon.has_author(request.amo_user) or acl.action_all... | 2.015625 | 2 |
code_examples/package_example/my_scripts/network/connect_telnet.py | natenka/natenka.github.io | 18 | 13547 | import telnetlib
import time
def send_command_telnetlib(ipaddress, username, password, enable_pass, command):
t = telnetlib.Telnet("192.168.100.1")
t.read_until(b"Username:")
t.write(username.encode("ascii") + b"\n")
t.read_until(b"Password:")
t.write(password.encode("ascii") + b"\n")
t.writ... | 2.765625 | 3 |
fullstack/migrations/0004_officeholder.py | TylerFisher/full-stack-react | 9 | 13548 | <reponame>TylerFisher/full-stack-react<gh_stars>1-10
# Generated by Django 2.1.5 on 2019-01-27 22:45
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
dependencies = [
('fullstack', '0003_auto_20190127_2223'),
]
operatio... | 1.851563 | 2 |
tools/evaluate_2D.py | ZJULiHongxin/two-hand-pose-est | 0 | 13549 | <reponame>ZJULiHongxin/two-hand-pose-est
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import platform
import numpy as np
import time
import os
import torch
import torch.backends.cudnn as cudnn
import _init_paths
from config import cfg
fro... | 1.773438 | 2 |
skyportal/model_util.py | jadalilleboe/skyportal | 1 | 13550 | from social_tornado.models import TornadoStorage
from skyportal.models import DBSession, ACL, Role, User, Token, Group
from skyportal.enum_types import LISTENER_CLASSES, sqla_enum_types
from baselayer.app.env import load_env
all_acl_ids = [
'Become user',
'Comment',
'Annotate',
'Manage users',
'Man... | 2.078125 | 2 |
pages/views.py | SmartDataWithR/CovidHelper | 0 | 13551 | <filename>pages/views.py
from django.views.generic import TemplateView
from ipware import get_client_ip
from django.shortcuts import render, redirect
from django.contrib import messages
from django.contrib.auth.forms import PasswordChangeForm
from django.contrib.auth import update_session_auth_hash
from django.conf imp... | 2.09375 | 2 |
image-classification/evaluate_classification.py | rush2406/vipriors-challenges-toolkit | 56 | 13552 | """
Use this script to evaluate your model. It stores metrics in the file
`scores.txt`.
Input:
predictions (str): filepath. Should be a file that matches the submission
format;
groundtruths (str): filepath. Should be an annotation file.
Usage:
evaluate_classification.py <groundtruths> <predictions> ... | 2.9375 | 3 |
src/118. Pascal's Triangle.py | rajshrivastava/LeetCode | 1 | 13553 | class Solution:
def generate(self, numRows: int) -> List[List[int]]:
result = [[1]]
for i in range(1, numRows):
temp = [1]
for j in range(1, i):
temp.append(result[-1][j-1] + result[-1][j])
temp.append(1)
result.append(temp... | 3.140625 | 3 |
__init__.py | j0rd1smit/obsidian-albert-plugin | 1 | 13554 | <gh_stars>1-10
# -*- coding: utf-8 -*-
"""A simple plugin that makes it possible to search your Obsidian vault.
This extension makes it possible to search your Obsidian vault. For more information please visit https://github.com/j0rd1smit/obsidian-albert-plugin.
Synopsis: ob <query>"""
from albert import *
import o... | 3.03125 | 3 |
py3Server/ClassMate/botResponses.py | GFBryson/myProjects | 1 | 13555 | <reponame>GFBryson/myProjects
class responder():
def resp_hello():
hello=[]
hello.append('Hey there "{usr}"! how\'s it going?')
hello.append('Hi "{usr}" :grinning:')
hello.append('Hello "{usr}", whats up?')
hello.append('Hey "{usr}" :wave:,\nHow are you doing?')
hello.append('Hi "{usr}"!\nI\'m StrugBot, an... | 3.03125 | 3 |
List_5/Task_1/instructions.py | Szpila123/Advanced_python_course | 0 | 13556 | import expressions
import abc
import copy
class Instruction(abc.ABC):
@abc.abstractmethod
def __init__(): ...
@abc.abstractmethod
def wykonaj(self, zmienne) -> dict[str, int]:
'''Evaluate the instruction'''
...
@abc.abstractmethod
def __str__(self): ...
class If(Instruction... | 3.40625 | 3 |
components/icdc-sheepdog/sheepdog/utils/parse.py | CBIIT/icdc-docker | 2 | 13557 | """
TODO
"""
from collections import Counter
import simplejson
import yaml
import flask
from sheepdog.errors import (
UserError,
)
def oph_raise_for_duplicates(object_pairs):
"""
Given an list of ordered pairs, contstruct a dict as with the normal JSON
``object_pairs_hook``, but raise an exception ... | 2.671875 | 3 |
frames/rocket/rocket_frames.py | rkinwork/dvmn_async-console-game | 0 | 13558 | <filename>frames/rocket/rocket_frames.py
from pathlib import Path
def get_rockets_frames():
"""Init rocket animation frames."""
frames_files = ['rocket_frame_1.txt', 'rocket_frame_2.txt']
frames = [(Path(__file__).resolve().parent / frame_file_name).read_text() for frame_file_name in frames_files]
re... | 2.453125 | 2 |
JuHPLC/views.py | FZJ-INM5/JuHPLC | 1 | 13559 | <filename>JuHPLC/views.py
from JuHPLC.Views.NewChromatogram import *
from JuHPLC.SerialCommunication.MicroControllerManager import MicroControllerManager
# Create your views here.
def index(request):
chromatograms = Chromatogram.objects.all().order_by("-Datetime")
for i in chromatograms:
i.data = Hpl... | 2.296875 | 2 |
sequana/datatools.py | vladsaveliev/sequana | 0 | 13560 | # -*- coding: utf-8 -*-
#
# This file is part of Sequana software
#
# Copyright (c) 2016 - Sequana Development Team
#
# File author(s):
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>,
# <<EMAIL>>
#
# Distributed under the terms of the 3-clause BSD license.
# The full license is in the LICENSE file, distr... | 2.59375 | 3 |
example/models.py | nim65s/django-jugemaj | 0 | 13561 | <filename>example/models.py
"""Django models for the example app."""
from django.db import models
from wikidata.client import Client # type: ignore
LANGS = ["fr", "en"] # ordered list of langages to check on wikidata
class WikiDataModel(models.Model):
"""A django model to represent something available on wik... | 3.109375 | 3 |
build_tests/python_opencv.py | AustinSchuh/971-Robot-Code | 39 | 13562 | #!/usr/bin/python3
import cv2
if __name__ == '__main__':
cv2.SIFT_create()
| 1.351563 | 1 |
tests/pytorch_pfn_extras_tests/training_tests/extensions_tests/test_print_report_notebook.py | yasuyuky/pytorch-pfn-extras | 243 | 13563 | import io
import pytest
import pytorch_pfn_extras as ppe
from pytorch_pfn_extras.training.extensions import _ipython_module_available
from pytorch_pfn_extras.training.extensions.log_report import _pandas_available
@pytest.mark.skipif(
not _ipython_module_available or not _pandas_available,
reason="print rep... | 2.203125 | 2 |
examples/python/00-list-devices.py | vishal-prgmr/tiscamera | 0 | 13564 | #!/usr/bin/env python3
# Copyright 2017 The Imaging Source Europe GmbH
#
# 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 a... | 2.40625 | 2 |
regression/sgd.py | sahitpj/MachineLearning | 2 | 13565 | from .linear_torch import TorchGradientDescentAutogradRegression
import torch, math, random
class stochasticGradientDescent(TorchGradientDescentAutogradRegression):
def __init__(self, X, Y, alpha, **kwargs):
super(stochasticGradientDescent, self).__init__(X, Y, alpha, **kwargs)
try:
h ... | 2.59375 | 3 |
pystratis/api/node/tests/test_node.py | TjadenFroyda/pyStratis | 8 | 13566 | import pytest
import ast
from pytest_mock import MockerFixture
from pystratis.api.node import Node
from pystratis.api.node.responsemodels import *
from pystratis.api import FullNodeState, FeatureInitializationState, LogRule
from pystratis.core.networks import StraxMain, CirrusMain
@pytest.mark.parametrize('network', ... | 1.945313 | 2 |
imapper/pose/confidence.py | amonszpart/iMapper | 18 | 13567 | import numpy as np
def get_conf_thresholded(conf, thresh_log_conf, dtype_np):
"""Normalizes a confidence score to (0..1).
Args:
conf (float):
Unnormalized confidence.
dtype_np (type):
Desired return type.
Returns:
confidence (np.float32):
Norma... | 2.65625 | 3 |
notes/lessons/lesson_1/dog_breed.py | jpenna/course-v3 | 0 | 13568 | from fastai.vision import *
from fastai.metrics import error_rate
# First model using pet images
###########################
####### Get dataset #######
###########################
# Batch size
bs = 64
# help(untar_data)
# print(URLs.PETS)
# URLs.PETS = https://s3.amazonaws.com/fast-ai-imageclas/oxford-iiit-pet
#... | 2.484375 | 2 |
Day 1/Demos/ili934xnew.py | thingslu/IoT-Bootcamp | 0 | 13569 | """
Copyright (c) 2017 <NAME>
https://github.com/jeffmer/micropython-ili9341
Jan 6, 2018
MIT License
https://github.com/jeffmer/micropython-ili9341/blob/master/LICENSE
"""
# This is an adapted version of the ILI934X driver as below.
# It works with multiple fonts and also works with the esp32 H/W SPI implementation
#... | 2.34375 | 2 |
code/workflow/run_hpc_het.py | vtphan/HeteroplasmyWorkflow | 1 | 13570 | import subprocess
import os
import sys
import datetime
import random
from configparser import ConfigParser
from datetime import datetime
import s03_heteroplasmy_likelihood, s04_sort_candidates, s05_select_sites, s06_location_conservation
import multiprocessing
def check_exist(cmd, thing):
try:
subprocess.c... | 2.25 | 2 |
airflow/providers/siasg/dw/transfers/relatorio_para_mongo.py | CarlosAdp/airflow-providers-siasg | 1 | 13571 | from datetime import datetime
from typing import Any, List
import json
import tempfile
from airflow.models.baseoperator import BaseOperator
from airflow.providers.mongo.hooks.mongo import MongoHook
import pandas
from airflow.providers.siasg.dw.hooks.dw import DWSIASGHook
class DWSIASGRelatorioParaMongoOperator(Base... | 2.28125 | 2 |
utils/extractor.py | nwoodward/twarc | 20 | 13572 | <reponame>nwoodward/twarc
#!/usr/bin/env python3
from datetime import datetime
import json
import os
import re
import argparse
import csv
import copy
import sys
import gzip
strptime = datetime.strptime
class attriObject:
"""Class object for attribute parser."""
def __init__(self, string):
self.value =... | 2.78125 | 3 |
scripts/bsvDeps.py | mhrtmnn/BSVTools | 7 | 13573 | #!/usr/bin/python3
import sys
import glob
import os
import re
def main():
directory = sys.argv[1]
builddir = sys.argv[2]
extra_module = ""
if(len(sys.argv) > 3):
extra_module = sys.argv[3]
projectModules = {}
for filename in glob.glob(os.path.join(directory, '*.bsv')):
m = re.m... | 2.78125 | 3 |
neuralmonkey/decoders/beam_search_decoder.py | kasnerz/neuralmonkey | 0 | 13574 | <reponame>kasnerz/neuralmonkey<filename>neuralmonkey/decoders/beam_search_decoder.py<gh_stars>0
"""Beam search decoder.
This module implements the beam search algorithm for autoregressive decoders.
As any autoregressive decoder, this decoder works dynamically, which means
it uses the ``tf.while_loop`` function condit... | 2.671875 | 3 |
setup.py | CBDRH/cdeid | 0 | 13575 | <gh_stars>0
from setuptools import setup, find_packages
with open('README.md', "r") as f:
readme = f.read()
with open('LICENSE') as f:
license_content = f.read()
setup(
name='cdeid',
version='0.1.2',
author='<NAME>',
author_email='<EMAIL>',
description='A Customized De-identification fram... | 1.40625 | 1 |
pylib/bbl_ingest.py | rafelafrance/sightings-database | 4 | 13576 | """Ingest USGS Bird Banding Laboratory data."""
from pathlib import Path
import pandas as pd
from . import db, util
DATASET_ID = 'bbl'
RAW_DIR = Path('data') / 'raw' / DATASET_ID
BANDING = RAW_DIR / 'Banding'
ENCOUNTERS = RAW_DIR / 'Encounters'
RECAPTURES = RAW_DIR / 'Recaptures'
SPECIES = RAW_DIR / 'species.html'
... | 2.75 | 3 |
pyhdtoolkit/utils/cmdline.py | fsoubelet/PyhDToolk | 5 | 13577 | <reponame>fsoubelet/PyhDToolk<filename>pyhdtoolkit/utils/cmdline.py
"""
Module utils.cmdline
--------------------
Created on 2019.11.06
:author: <NAME> (<EMAIL>)
Utility script to help run commands and access the commandline.
"""
import errno
import os
import signal
import subprocess
from typing import Mapping, Opt... | 2.03125 | 2 |
sketches/noll/noll.pyde | kantel/processingpy | 4 | 13578 | <reponame>kantel/processingpy
from random import randint
margin = 5
def setup():
size(400, 600)
this.surface.setTitle("Re-Enactment A. <NAME>")
noLoop()
def draw():
background(235, 215, 182)
strokeWeight(2)
x1 = randint(margin, width - margin)
y1 = randint(margin, height - margin)
... | 2.875 | 3 |
minimalist_cms/cms_content/migrations/0004_auto_20190719_1242.py | wullerot/django-minimalist-cms | 0 | 13579 | # Generated by Django 2.1.10 on 2019-07-19 12:42
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('contenttypes', '0002_remove_content_type_name'),
('cms_content', '0003_auto_20190719_1232'),
]
operations ... | 1.601563 | 2 |
original-paas/copy_to_container/www/spdpaas/src/celeryApp/celeryConfig.py | yishan1331/docker-practice | 0 | 13580 | # -*- coding: utf-8 -*-
"""
==============================================================================
created : 02/08/2021
Last update: 02/08/2021
Developer: <NAME>
Lite Version 1 @Yishan08032019
Filename: celeryconfig.py
Description: about celery configuration
=============================================... | 1.945313 | 2 |
toontown/coghq/LawbotHQExterior.py | journeyfan/toontown-journey | 1 | 13581 | from direct.directnotify import DirectNotifyGlobal
from direct.fsm import ClassicFSM, State
from direct.fsm import State
from pandac.PandaModules import *
from toontown.battle import BattlePlace
from toontown.building import Elevator
from toontown.coghq import CogHQExterior
from toontown.dna.DNAParser import loadDNAFil... | 2.0625 | 2 |
etsy_convos/convos/migrations/0005_convothread_last_message_at.py | jessehon/etsy-convos | 2 | 13582 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('convos', '0004_auto_20150511_0945'),
]
operations = [
migrations.AddField(
model_name='convothread',
... | 1.53125 | 2 |
pycoax/examples/40_eab.py | lowobservable/coax | 21 | 13583 | #!/usr/bin/env python
import sys
from itertools import chain
from common import open_example_serial_interface
from coax import read_feature_ids, parse_features, Feature, LoadAddressCounterHi, LoadAddressCounterLo, WriteData, EABWriteAlternate, EABLoadMask
def get_features(interface):
commands = read_feature_ids... | 2.421875 | 2 |
ApkInstall/Case/TV/DeviceConnect.py | LiuTianen/PackManage | 0 | 13584 | # coding=utf-8
from Base.DevicesList import devicesList as dl
from Base.Common import Common
class DevicesConnect:
def deviceConnect(self):
commands = []
data = dl().get_Tv_IP()
for IP in data:
cmd = "adb connect %s" %(IP)
commands.append(cmd)
Common().loop... | 2.453125 | 2 |
angr/storage/memory_mixins/hex_dumper_mixin.py | Kyle-Kyle/angr | 6,132 | 13585 | import string
from ...errors import SimValueError
from . import MemoryMixin
class HexDumperMixin(MemoryMixin):
def hex_dump(self, start, size, word_size=4, words_per_row=4, endianness="Iend_BE",
symbolic_char='?', unprintable_char='.', solve=False, extra_constraints=None,
inspe... | 2.953125 | 3 |
src/greplin/scales/formats.py | frenzymadness/scales | 273 | 13586 | # Copyright 2011 The scales Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | 2.359375 | 2 |
src/weight_graph.py | kavdi/data-structures | 0 | 13587 | """Implement a weighted graph."""
class Graph(object):
"""Structure for values in a weighted graph."""
def __init__(self):
"""Create a graph with no values."""
self.graph = {}
def nodes(self):
"""Get all nodes in the graph to display in list form."""
return list(self.grap... | 4.21875 | 4 |
sqlitedb/settings.py | BelovN/orm | 1 | 13588 | <filename>sqlitedb/settings.py<gh_stars>1-10
class BaseCommand:
def __init__(self, table_name):
self.table_name = table_name
self._can_add = True
@staticmethod
def _convert_values(values):
converted = [SQLType.convert(v) for v in values]
return converted
def check_int... | 2.515625 | 3 |
hon/commands/clean.py | swquinn/hon | 0 | 13589 | import click
from ..cli import with_context
@click.command('clean', short_help="Cleans a book' output directories")
@with_context
def clean_command(ctx=None):
pass
| 1.453125 | 1 |
Kerning/Steal Kerning Groups from Font.py | justanotherfoundry/Glyphs-Scripts | 283 | 13590 | #MenuTitle: Steal Kerning Groups from Font
"""Copy kerning groups from one font to another."""
from __future__ import print_function
import vanilla
class GroupsCopy(object):
"""GUI for copying kerning groups from one font to another"""
def __init__(self):
self.w = vanilla.FloatingWindow((400, 70), "Steal kerning ... | 2.9375 | 3 |
eggs/mercurial-2.2.3-py2.7-linux-x86_64-ucs4.egg/hgext/extdiff.py | bopopescu/phyG | 0 | 13591 | # extdiff.py - external diff program support for mercurial
#
# Copyright 2006 <NAME> <<EMAIL>>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
'''command to allow external programs to compare revisions
The extdiff Mercurial exten... | 2.1875 | 2 |
scripts/idapython/idapy_detect_exitats.py | felkal/fuzzware | 106 | 13592 | import idaapi
from idaapi import *
inifinite_loops = [
b"\x00\xbf\xfd\xe7", # loop: nop; b loop
b"\xfe\xe7", # loop: b loop
]
whitelist = [
"Reset_Handler",
"main"
]
def detect_noret_funcs():
exit_locs_name_pairs = []
for func_addr in Functions():
if get_func_flags(func_addr) & idaapi... | 2.390625 | 2 |
2020/src/day11.py | pantaryl/adventofcode | 2 | 13593 | <reponame>pantaryl/adventofcode
from collections import defaultdict
from helpers import memoize
from copy import deepcopy
with open("../input/day11.txt", 'r') as inputFile:
data = [x.rstrip() for x in inputFile.readlines()]
#data = [int(x) for x in data]
map = {}
yMax = len(data)
xMax = len(data[0])
for y in ... | 3.078125 | 3 |
jaqs/util/dtutil.py | WestXu/JAQS | 602 | 13594 | # encoding: utf-8
import datetime
import numpy as np
import pandas as pd
def get_next_period_day(current, period, n=1, extra_offset=0):
"""
Get the n'th day in next period from current day.
Parameters
----------
current : int
Current date in format "%Y%m%d".
period : str
Inter... | 3.34375 | 3 |
api/pub/sensor/ds18b20.py | rtaft/pi-sensor-dashboard | 0 | 13595 | import flask
from flask import request
import flask_restful as restful
from marshmallow import Schema, fields, validate
from api.helpers import success, created
from api.exceptions import NotFound
from sensors.ds18b20 import lookup
class DS18B20Query (restful.Resource):
def __init__(self, *args, **kwargs):
... | 2.390625 | 2 |
accenv/lib/python3.4/site-packages/IPython/html/notebook/handlers.py | adamshamsudeen/clubdin-dj | 0 | 13596 | <filename>accenv/lib/python3.4/site-packages/IPython/html/notebook/handlers.py
"""Tornado handlers for the live notebook view.
Authors:
* <NAME>
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2011 The IPython Development Team
#
# Distributed under the terms of t... | 1.585938 | 2 |
deepchem/models/tensorgraph/tests/test_layers_eager.py | avimanyu786/deepchem | 0 | 13597 | import deepchem as dc
import numpy as np
import tensorflow as tf
import deepchem.models.tensorgraph.layers as layers
from tensorflow.python.eager import context
from tensorflow.python.framework import test_util
class TestLayersEager(test_util.TensorFlowTestCase):
"""
Test that layers function in eager mode.
"""... | 2.6875 | 3 |
py/py_0049_prime_permutations.py | lcsm29/project-euler | 0 | 13598 | # Solution of;
# Project Euler Problem 49: Prime permutations
# https://projecteuler.net/problem=49
#
# The arithmetic sequence, 1487, 4817, 8147, in which each of the terms
# increases by 3330, is unusual in two ways: (i) each of the three terms are
# prime, and, (ii) each of the 4-digit numbers are permutations of... | 2.984375 | 3 |
rqmonitor/cli.py | trodery/rqmonitor | 0 | 13599 | <gh_stars>0
"""
This reference script has been taken from rq-dashboard with some modifications
"""
import importlib
import logging
import os
import sys
from urllib.parse import quote as urlquote, urlunparse
from redis.connection import (URL_QUERY_ARGUMENT_PARSERS,
UnixDomainSocketConnecti... | 2.046875 | 2 |