text stringlengths 0 1.05M | meta dict |
|---|---|
# Borrowed under the terms of the MIT license
# https://github.com/MihaiBalint/Sanic-HTTPAuth/blob/master/LICENSE
"""
sanic_httpauth
==================
This module provides Basic and Digest HTTP authentication for Sanic routes.
:copyright: (C) 2020 by Svitlana Kost.
:copyright: (C) 2019 by Mihai Balint.
:copyright: (... | {
"repo_name": "menpo/landmarkerio-server",
"path": "landmarkerio/http_auth/sanic_httpauth.py",
"copies": "1",
"size": "11888",
"license": "bsd-3-clause",
"hash": -2663400386892913000,
"line_mean": 32.581920904,
"line_max": 88,
"alpha_frac": 0.5808378197,
"autogenerated": false,
"ratio": 4.2230905... |
# Borrows heavily from argparse tests.
# Doesn't use meta class to setup tests.
import sys
import unittest
from collections import OrderedDict
import commandify as cmdify
print(cmdify._main_commands)
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
class StdIOBuffer(StringIO):
... | {
"repo_name": "markmuetz/commandify",
"path": "tests/unit/unit_tests.py",
"copies": "1",
"size": "13560",
"license": "mit",
"hash": 1291316921264624000,
"line_mean": 28.8678414097,
"line_max": 84,
"alpha_frac": 0.5056784661,
"autogenerated": false,
"ratio": 3.8251057827926656,
"config_test": tr... |
"Borrow the code from GSoC2013 of Biopython"
"""Classes and methods for tree construction"""
import copy
import numpy as np
import math
import datetime
from ete2 import Tree
class Matrix(object):
"""A base class for distance matrix or scoring matrix that accepts
a list of names and a lower triangular matrix... | {
"repo_name": "ajing/clusterVis",
"path": "TreeConstruction.py",
"copies": "1",
"size": "16073",
"license": "apache-2.0",
"hash": -5406222887243675000,
"line_mean": 35.0381165919,
"line_max": 126,
"alpha_frac": 0.5274062092,
"autogenerated": false,
"ratio": 3.671311100959342,
"config_test": fal... |
"""Bosch Smart Home Controller base entity."""
from boschshcpy.device import SHCDevice
from homeassistant.helpers.device_registry import async_get as get_dev_reg
from homeassistant.helpers.entity import Entity
from .const import DOMAIN
async def async_remove_devices(hass, entity, entry_id):
"""Get item that is ... | {
"repo_name": "home-assistant/home-assistant",
"path": "homeassistant/components/bosch_shc/entity.py",
"copies": "2",
"size": "3017",
"license": "apache-2.0",
"hash": -1298994344120459800,
"line_mean": 31.7934782609,
"line_max": 88,
"alpha_frac": 0.611203182,
"autogenerated": false,
"ratio": 4.09... |
"""Bosonic quantum operators."""
from sympy.core.compatibility import u
from sympy import Mul, Integer, exp, sqrt, conjugate, DiracDelta, Symbol
from sympsi import Operator, Commutator
from sympsi import HilbertSpace, FockSpace, Ket, Bra, IdentityOperator
from sympy.functions.special.tensor_functions import KroneckerD... | {
"repo_name": "sympsi/sympsi",
"path": "sympsi/boson.py",
"copies": "1",
"size": "15257",
"license": "bsd-3-clause",
"hash": -952666591483396500,
"line_mean": 25.4895833333,
"line_max": 107,
"alpha_frac": 0.5666251557,
"autogenerated": false,
"ratio": 3.514627965906473,
"config_test": false,
... |
"""Bosonic quantum operators."""
from sympy.core.compatibility import u
from sympy import Mul, Integer, exp, sqrt, conjugate
from sympy.physics.quantum import Operator
from sympy.physics.quantum import HilbertSpace, FockSpace, Ket, Bra, IdentityOperator
from sympy.functions.special.tensor_functions import KroneckerDel... | {
"repo_name": "Titan-C/sympy",
"path": "sympy/physics/quantum/boson.py",
"copies": "6",
"size": "6132",
"license": "bsd-3-clause",
"hash": 8142169559252585000,
"line_mean": 23.0470588235,
"line_max": 107,
"alpha_frac": 0.5733855186,
"autogenerated": false,
"ratio": 3.540415704387991,
"config_te... |
"""Bosonic quantum operators."""
from sympy import Mul, Integer, exp, sqrt, conjugate
from sympy.physics.quantum import Operator
from sympy.physics.quantum import HilbertSpace, FockSpace, Ket, Bra, IdentityOperator
from sympy.functions.special.tensor_functions import KroneckerDelta
__all__ = [
'BosonOp',
'Bo... | {
"repo_name": "madan96/sympy",
"path": "sympy/physics/quantum/boson.py",
"copies": "22",
"size": "6093",
"license": "bsd-3-clause",
"hash": -9038182107399653000,
"line_mean": 22.9881889764,
"line_max": 107,
"alpha_frac": 0.5716395864,
"autogenerated": false,
"ratio": 3.5362739408009287,
"config... |
"""Bosonic quantum operators."""
from warnings import warn
from sympy.core.compatibility import u
from sympy import Add, Mul, Pow, Integer, exp, sqrt, conjugate
from sympy.physics.quantum import Operator, Commutator, AntiCommutator, Dagger
from sympy.physics.quantum import HilbertSpace, FockSpace, Ket, Bra, IdentityO... | {
"repo_name": "jamesblunt/sympy",
"path": "sympy/physics/quantum/boson.py",
"copies": "3",
"size": "6207",
"license": "bsd-3-clause",
"hash": -8332523352856267000,
"line_mean": 23.1517509728,
"line_max": 107,
"alpha_frac": 0.5758015144,
"autogenerated": false,
"ratio": 3.532726237905521,
"confi... |
# boss: 71 hp, 10 damage
# self: 50 hp, 500 mana
# Magic Missile: -53 mana, 4 damage
# Drain: -73 mana, 2 damage, +2 HP
# Effects:
# Shield: -113 mana, 6 turns, armor +7 (while active)
# Poison: -173 mana, 6 turns, 3 damage/turn
# Recharge: -229 mana, 5 turns, gives 101 mana
# (name, turns left)
import copy
import i... | {
"repo_name": "Mark-Simulacrum/advent-of-code-2015",
"path": "day22/solution.py",
"copies": "1",
"size": "1815",
"license": "mit",
"hash": 3109042364359094300,
"line_mean": 24.9285714286,
"line_max": 96,
"alpha_frac": 0.608815427,
"autogenerated": false,
"ratio": 2.6077586206896552,
"config_tes... |
# Bot accounts to handle permissions
# This allows customization to some degree of who can do what
# Much easier than just Discord permissions or botmaster lists
# Currently this just goes off of user id and permission level
# However in the future this will include a login/password system
import json
from discord.ext... | {
"repo_name": "Ispira/Ispyra",
"path": "accounts.py",
"copies": "1",
"size": "3479",
"license": "mit",
"hash": -2360928629512301000,
"line_mean": 33.4455445545,
"line_max": 86,
"alpha_frac": 0.6093705088,
"autogenerated": false,
"ratio": 4.092941176470588,
"config_test": false,
"has_no_keywor... |
"""botapi URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-bas... | {
"repo_name": "naelstrof/PugBot-Discord-Django",
"path": "botapi/urls.py",
"copies": "1",
"size": "1726",
"license": "mit",
"hash": 7684264019366144000,
"line_mean": 44.4210526316,
"line_max": 115,
"alpha_frac": 0.701622248,
"autogenerated": false,
"ratio": 3.508130081300813,
"config_test": fal... |
# botbook_gpio.py - gpio library.
# (c) BotBook.com - Karvinen, Karvinen, Valtokari
"""
Control GPIO trough kernel virtual file system /sys/, possibly without root.
Unlike RPi.GPIO, tGPIO doesn't use kmem. This script only needs permissions
to /sys/class/gpio/ to use GPIO, no root access required. These permi... | {
"repo_name": "wikkii/raspluonto",
"path": "old/sensor_testing/botbook_gpio.py",
"copies": "1",
"size": "4673",
"license": "mit",
"hash": -6842206576763249000,
"line_mean": 25.4882352941,
"line_max": 103,
"alpha_frac": 0.6496897068,
"autogenerated": false,
"ratio": 2.872157344806392,
"config_te... |
"""Botbot daemon mode!"""
import os
import sys
import errno
import inotify.adapters
from inotify.constants import *
from .checker import CheckerBase
from .report import DaemonReporter
from .config import CONFIG
_EVENT_MASK = IN_CREATE | IN_ATTRIB | IN_DELETE | IN_MOVED_FROM | IN_MOVED_TO
_RECHECK_MASK = IN_CREATE | ... | {
"repo_name": "jackstanek/BotBot",
"path": "botbot/daemon.py",
"copies": "1",
"size": "3097",
"license": "mit",
"hash": -4373807240987272700,
"line_mean": 29.6633663366,
"line_max": 85,
"alpha_frac": 0.5847594446,
"autogenerated": false,
"ratio": 3.9603580562659846,
"config_test": false,
"has... |
"""bot - Bot Module
This module defines the Bot Component which connects to an IRC
Network and reacts to IRC Events. The Bot Component consists
of the TCPClient and IRC Components.
"""
import re
from socket import gethostname
from traceback import format_exc
from circuits.net.events import connect
from circuits.ne... | {
"repo_name": "prologic/kdb",
"path": "kdb/bot.py",
"copies": "1",
"size": "6532",
"license": "mit",
"hash": 2896925125895986000,
"line_mean": 30.8634146341,
"line_max": 92,
"alpha_frac": 0.540263319,
"autogenerated": false,
"ratio": 4.216914138153648,
"config_test": true,
"has_no_keywords": ... |
# Bot code
import discord
import credentials
import commands
import datetime
client = discord.Client()
@client.event
async def on_message(message): # Indiv @events for every message command?
# Bot must not respond to itself
if message.author == client.user:
return... | {
"repo_name": "CharlieDeltaZA/charlie-test-bot",
"path": "bot.py",
"copies": "1",
"size": "2806",
"license": "mit",
"hash": 7563417672805344000,
"line_mean": 39.0857142857,
"line_max": 127,
"alpha_frac": 0.5830363507,
"autogenerated": false,
"ratio": 3.8281036834924964,
"config_test": false,
... |
# Bot code
# Python 3.4
import discord
import credentials
import commands
import datetime
import asyncio
import tmdbsimple as tmdb
client = discord.Client()
@client.event
@asyncio.coroutine
def on_message(message): # Indiv @events for every message command?
# Bot must not ... | {
"repo_name": "CharlieDeltaZA/charlie-test-bot",
"path": "3.4/bot.py",
"copies": "1",
"size": "3334",
"license": "mit",
"hash": -9159616192938263000,
"line_mean": 39.1686746988,
"line_max": 142,
"alpha_frac": 0.5917816437,
"autogenerated": false,
"ratio": 3.845444059976932,
"config_test": false... |
# Bot code
# Python 3.5
import discord
import credentials
import commands
import datetime
client = discord.Client()
@client.event
async def on_message(message): # Indiv @events for every message command?
# Bot must not respond to itself
if message.author == client.user:... | {
"repo_name": "CharlieDeltaZA/charlie-test-bot",
"path": "3.5/bot.py",
"copies": "1",
"size": "2819",
"license": "mit",
"hash": -3900291901293948000,
"line_mean": 38.7042253521,
"line_max": 127,
"alpha_frac": 0.5831855268,
"autogenerated": false,
"ratio": 3.814614343707713,
"config_test": false... |
"""Bot Codes
These are emitted by the parser to trigger certain actions; currently the
values do not have any meaning and should not be used for comparison. In
the future, these may hold formatting information (e.g. in a tuple.)
"""
OP_ERROR = "*ERROR"
OP_INVITE = "INVITE"
OP_JOIN = "JOIN"
OP_KICK = "KICK"
OP_LIST = ... | {
"repo_name": "jcsalterego/pynsour",
"path": "src/botcode.py",
"copies": "1",
"size": "2781",
"license": "bsd-2-clause",
"hash": -4184651755739877400,
"line_mean": 21.7950819672,
"line_max": 75,
"alpha_frac": 0.6939949658,
"autogenerated": false,
"ratio": 2.210651828298887,
"config_test": false... |
# bot config.
# yunbi user config
import time;
class RebotConfig():
# access key
access_key = "3fc30d76-816a9502-5cbb933f-fd3f8";
# secret key
secret_key = "c587548c-0c1bf226-a45d8913-1de46";
# mysql config
mysql_address = "localhost";
mysql_user = "randy";
mysql_password = ... | {
"repo_name": "WaitGodot/peatio-client-python",
"path": "RebotConfig.py",
"copies": "1",
"size": "1492",
"license": "cc0-1.0",
"hash": -5700358948539337000,
"line_mean": 34.3902439024,
"line_max": 381,
"alpha_frac": 0.5536193029,
"autogenerated": false,
"ratio": 2.683453237410072,
"config_test"... |
"""Botd and BotdFactory Definitions"""
from __future__ import absolute_import
from passlib.apps import custom_app_context
from twisted.internet import protocol, reactor
from twisted.python import log
from twisted.words.protocols import irc
from botd.commands import Commands as BotdCommands
class Botd(irc.IRCClient... | {
"repo_name": "dmtucker/botd",
"path": "botd/botd.py",
"copies": "1",
"size": "3388",
"license": "mit",
"hash": 1875149063032734700,
"line_mean": 30.9622641509,
"line_max": 90,
"alpha_frac": 0.5888429752,
"autogenerated": false,
"ratio": 3.760266370699223,
"config_test": false,
"has_no_keywor... |
"""BotdFactory CLI Interface"""
from __future__ import absolute_import
import argparse
import random
import string
import sys
from twisted.internet import reactor, ssl
from twisted.python import log
from botd import botd
def cli(parser=argparse.ArgumentParser()):
"""Parse CLI arguments and options."""
par... | {
"repo_name": "dmtucker/botd",
"path": "botd/__main__.py",
"copies": "1",
"size": "1707",
"license": "mit",
"hash": 5179798186842855000,
"line_mean": 24.1029411765,
"line_max": 79,
"alpha_frac": 0.5893380199,
"autogenerated": false,
"ratio": 3.924137931034483,
"config_test": false,
"has_no_ke... |
"""Botd IRC Interface"""
from __future__ import absolute_import
from functools import wraps
import inspect
import textwrap
from twisted.internet import reactor
def argv_length(minimum, maximum):
"""Create a decorator that checks for an appropriate number of args in the message."""
def decorator(func):
... | {
"repo_name": "dmtucker/botd",
"path": "botd/commands.py",
"copies": "1",
"size": "4145",
"license": "mit",
"hash": -5704653538534697000,
"line_mean": 28.6071428571,
"line_max": 99,
"alpha_frac": 0.5107358263,
"autogenerated": false,
"ratio": 4.381606765327696,
"config_test": false,
"has_no_k... |
"""Bot entrypoint"""
import logging
from argparse import ArgumentParser
from configparser import ConfigParser
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from botibal import __title__, __version__
from botibal.models import Base
from . import BotiBal, MiniBal, QuizziBal
def run():
... | {
"repo_name": "virtualtam/botibal",
"path": "botibal/client/run.py",
"copies": "1",
"size": "2591",
"license": "mit",
"hash": -5659241296610505000,
"line_mean": 24.4019607843,
"line_max": 63,
"alpha_frac": 0.545349286,
"autogenerated": false,
"ratio": 4.029548989113531,
"config_test": true,
"... |
### BotEvents.py contains various kinds of Event Handlers
### For the moment, only Timer and Message events are used
import time
import logging
from timeit import default_timer
class EventAlreadyExists(Exception):
def __init__(self, eventName):
self.name = eventName
def __str__(self):
return ... | {
"repo_name": "RenolY2/Renol-IRC",
"path": "BotEvents.py",
"copies": "2",
"size": "13371",
"license": "mit",
"hash": -1811838463399892700,
"line_mean": 42.2718446602,
"line_max": 161,
"alpha_frac": 0.4364669808,
"autogenerated": false,
"ratio": 5.1865787432117925,
"config_test": false,
"has_n... |
bot_footer = (
"{}"
"\n\n"
"---"
"\n\n"
"v{version} | This message was posted by a bot. "
"| [FAQ](https://www.reddit.com/r/TranscribersOfReddit/wiki/index) "
"| [Source](https://github.com/GrafeasGroup/tor) "
"| Questions? [Message the mods!](https://www.reddit.com/message/"
"compos... | {
"repo_name": "itsthejoker/TranscribersOfReddit",
"path": "tor/strings/responses.py",
"copies": "1",
"size": "5012",
"license": "mit",
"hash": -1971615360859048400,
"line_mean": 33.0952380952,
"line_max": 81,
"alpha_frac": 0.66839585,
"autogenerated": false,
"ratio": 3.057962172056132,
"config_... |
## Bot for adding Prop65 ID
from wikidataintegrator import wdi_core, wdi_login, wdi_helpers
from wikidataintegrator.ref_handlers import update_retrieved_if_new_multiple_refs
import pandas as pd
from pandas import read_csv
import requests
import time
from datetime import datetime
import copy
## Here are the object QI... | {
"repo_name": "SuLab/scheduled-bots",
"path": "scheduled_bots/CA_Prop_65/bot-prop65 statements.py",
"copies": "1",
"size": "6387",
"license": "mit",
"hash": 3642865809530488000,
"line_mean": 44.6214285714,
"line_max": 236,
"alpha_frac": 0.6611867857,
"autogenerated": false,
"ratio": 3.09597673291... |
#Both imports are for web crawling
import urllib
import HTMLParser
#Open in the user-created input file for reading
f = open('input.txt', 'r')
#Initialize the first set of lists
a = [] #This will hold the completed urls
classId = [] #This will hold the file input as separate entries
b = "https://courseboo... | {
"repo_name": "aerolyt/ScheduleMaker",
"path": "main_writer.py",
"copies": "1",
"size": "3950",
"license": "mit",
"hash": -8188348789026562000,
"line_mean": 34.2568807339,
"line_max": 139,
"alpha_frac": 0.664556962,
"autogenerated": false,
"ratio": 3.1932093775262733,
"config_test": false,
"h... |
"""Botibal: a silly XMPP bot"""
import codecs
import decimal
import math
import re
from botibal.client.minibal import MiniBal
class BotiBal(MiniBal):
"""A silly XMPP bot"""
# pylint: disable=too-many-public-methods
def rot13(self, _, args):
"""Applies rot13 on the passed string"""
self.... | {
"repo_name": "virtualtam/botibal",
"path": "botibal/client/botibal_.py",
"copies": "1",
"size": "2164",
"license": "mit",
"hash": -2362973921736197000,
"line_mean": 28.6438356164,
"line_max": 80,
"alpha_frac": 0.5272643253,
"autogenerated": false,
"ratio": 4.276679841897233,
"config_test": fal... |
# Bot IRC/Chat connection
HOST = "irc.chat.twitch.tv"
PORT = 6667
PASS = "oauth:pass_key" # Obtainable from https://twitchapps.com/tmi/
NICK = "bot_account_name"
CHANNEL = "channel_where_bot_will_live"
# Bot admin
ADMIN = "specify an admin for your bot"
# MySQL database connection
db_host = 'sql_host'
db_user = 'sql_... | {
"repo_name": "LouisBluhm/PyBot",
"path": "modules/example_config.py",
"copies": "2",
"size": "1156",
"license": "mit",
"hash": -735140999293158700,
"line_mean": 30.2702702703,
"line_max": 69,
"alpha_frac": 0.7275086505,
"autogenerated": false,
"ratio": 2.792270531400966,
"config_test": false,
... |
#import list
import asyncio
import discord
from discord.ext import commands
import importlib.machinery
import logging
import pickle
logging.basicConfig(level=logging.INFO) #for general information about what is going on
from cogs.chat import Messages
from cogs.music import VoiceEntry, VoiceState, Music
from cogs.i... | {
"repo_name": "ImTheTom/discordBot",
"path": "main.py",
"copies": "1",
"size": "5306",
"license": "mit",
"hash": 2686865157632638500,
"line_mean": 30.0292397661,
"line_max": 262,
"alpha_frac": 0.6270260083,
"autogenerated": false,
"ratio": 3.4454545454545453,
"config_test": false,
"has_no_key... |
@bot.message_handler(commands=['ban'])
def ban_user(message):
userlang = redisserver.get("settings:user:language:" + str(message.from_user.id))
if message.from_user.id in ADMINS_IDS:
if len(message.text.split()) < 2:
bot.reply_to(message, "Who should I ban?")
return
userid = message.text.split()... | {
"repo_name": "WebShark025/TheZigZagProject",
"path": "plugins/banhammer.py",
"copies": "1",
"size": "1278",
"license": "mit",
"hash": -3916567449073825300,
"line_mean": 44.6428571429,
"line_max": 93,
"alpha_frac": 0.6870109546,
"autogenerated": false,
"ratio": 3.1094890510948905,
"config_test"... |
@bot.message_handler(commands=['id', 'Id'])
def send_id(message):
userlang = redisserver.get("settings:user:language:" + str(message.from_user.id))
userid = message.from_user.id
banlist = redisserver.sismember('zigzag_banlist', '{}'.format(userid))
if banlist:
return
username = message.from_user.first_nam... | {
"repo_name": "WebShark025/TheZigZagProject",
"path": "plugins/id.py",
"copies": "1",
"size": "1154",
"license": "mit",
"hash": 987733753181583500,
"line_mean": 49.1739130435,
"line_max": 121,
"alpha_frac": 0.698440208,
"autogenerated": false,
"ratio": 3.127371273712737,
"config_test": false,
... |
"""Bot module who updates the database."""
from argparse import ArgumentParser
import sys
import time
import pywikibot
from pywikibot.pagegenerators import RandomPageGenerator
import pageviewapi.period
from pageviewapi.client import ZeroOrDataNotLoadedException
from logger import logger
from sicg2 import __version_... | {
"repo_name": "PierreSelim/sicg2",
"path": "sicg2/bot.py",
"copies": "1",
"size": "3188",
"license": "mit",
"hash": -4457927108117362000,
"line_mean": 30.88,
"line_max": 75,
"alpha_frac": 0.528544542,
"autogenerated": false,
"ratio": 4.1947368421052635,
"config_test": false,
"has_no_keywords"... |
#BotMonitor
import re
from scrapy.spider import BaseSpider
from scrapy import log
from nrc.database import NrcDatabase
from nrc.NrcBot import NrcBot
from nrc import settings
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
class BotMonitorReport():
def __init__(self):
... | {
"repo_name": "SkyTruth/scraper",
"path": "nrc/nrc/spiders/BotMonitor.py",
"copies": "1",
"size": "2889",
"license": "mit",
"hash": 5180056855403809000,
"line_mean": 33.4047619048,
"line_max": 107,
"alpha_frac": 0.554517134,
"autogenerated": false,
"ratio": 3.718146718146718,
"config_test": fal... |
BOT_NAME = 'HMA_Proxy_Spider'
BOT_VERSION = '1.0'
SPIDER_MODULES = ['HMA_Proxy_Spider.spiders']
NEWSPIDER_MODULE = 'HMA_Proxy_Spider.spiders'
USER_AGENT = '%s/%s' % (BOT_NAME, BOT_VERSION)
DOWNLOAD_DELAY = 2
PATH_DEBUG = True
PATH_DEBUG_URL_LENGTH = 97
ITEM_PIPELINES = ['HMA_Proxy_Spider.pipelines.HmaProxySpiderPi... | {
"repo_name": "bahtou/HMA-Proxy-Spider",
"path": "HMA_Proxy_Spider/settings.py",
"copies": "1",
"size": "1451",
"license": "mit",
"hash": 1513764481542226200,
"line_mean": 45.8064516129,
"line_max": 275,
"alpha_frac": 0.7718814611,
"autogenerated": false,
"ratio": 3.5738916256157633,
"config_te... |
BOT_NAME = "Klaus BOT"
BOT_VERSION = "2.0 Beta"
BOT_PREFIX = "^0[^1KGB^0] "
BOT_MESSAGES_COLOR_PREFIX = "^7"
BOT_MESSAGE_STOP = "KGB stops reading your logs..."
BOT_MESSAGE_START = "KGB started reading your logs!!"
# BOT MESSAGES
MESSAGE_VERSION = "This is ^1%s ^7version ^5%s" % (BOT_NAME, BOT_VERSION)
MESSAGE_PERMISS... | {
"repo_name": "kl4us/kgb",
"path": "kgb/settings.py",
"copies": "1",
"size": "11507",
"license": "mit",
"hash": 9048999282101308000,
"line_mean": 32.1613832853,
"line_max": 221,
"alpha_frac": 0.4975232467,
"autogenerated": false,
"ratio": 3.486969696969697,
"config_test": false,
"has_no_keywo... |
BOT_NAME = 'prawler'
LOG_LEVEL = 'DEBUG'
SPIDER_MODULES = ['prawler.spiders']
NEWSPIDER_MODULE = 'prawler.spiders'
# ITEM_PIPELINES = {'prawler.pipelines.ProductPipeline': 1}
IMAGES_MIN_WIDTH = 50
IMAGES_MAX_WIDTH = 50
IMAGES_STORE = '/home/josh/src/prawler-import/trakker-images'
IMAGES_EXPIRES = 90
IMAGES_THUMBS = ... | {
"repo_name": "jlamontagne/prawler",
"path": "prawler/settings.py",
"copies": "1",
"size": "1183",
"license": "mit",
"hash": -5985100996392764000,
"line_mean": 25.2888888889,
"line_max": 87,
"alpha_frac": 0.7455621302,
"autogenerated": false,
"ratio": 2.7447795823665895,
"config_test": false,
... |
BOT_NAME = 'resourcecrawler'
LOG_LEVEL = 'INFO'
SPIDER_MODULES = ['resourcecrawler.spiders']
NEWSPIDER_MODULE = 'resourcecrawler.spiders'
# some sane limits by default (override if needed)
CLOSESPIDER_PAGECOUNT = 1000
CLOSESPIDER_TIMEOUT = 3600
#RETRY_ENABLED = False
RETRY_ENABLED = True
COOKIES_ENABLED = False
ITE... | {
"repo_name": "Readz/LinkCrawler",
"path": "resourcecrawler/settings.py",
"copies": "1",
"size": "2510",
"license": "mit",
"hash": -5324836467057968000,
"line_mean": 53.5652173913,
"line_max": 195,
"alpha_frac": 0.677689243,
"autogenerated": false,
"ratio": 2.319778188539741,
"config_test": fal... |
BOT_NAME = 'techCrunch'
SPIDER_MODULES = ['techCrunch.spiders']
NEWSPIDER_MODULE = 'techCrunch.spiders'
# Crawl responsibly by identifying yourself (and your website) on the user-agent
USER_AGENT = 'techCrunch (version 1.2)'
DOWNLOAD_DELAY = 3
PATH_DEBUG = True
PATH_DEBUG_URL_LENGTH = 95
ITEM_PIPELINES = ['techCru... | {
"repo_name": "bahtou/TechCrunch-HomePage-Spider",
"path": "techCrunch/settings.py",
"copies": "1",
"size": "1479",
"license": "mit",
"hash": -6488638871785863000,
"line_mean": 46.7096774194,
"line_max": 275,
"alpha_frac": 0.7809330629,
"autogenerated": false,
"ratio": 3.633906633906634,
"confi... |
bot=None
import modules
import modules.eliza as eliza
import os,time
from BeautifulSoup import BeautifulSoup
from modules.chatterbotapi import ChatterBotFactory, ChatterBotType
factory = ChatterBotFactory()
bot1 = factory.create(ChatterBotType.PANDORABOTS, 'b0dafd24ee35a477')
#bot1session = bot1.create_session()
bots... | {
"repo_name": "siyei/python-whatsapp-bot",
"path": "modules/elizaloader.py",
"copies": "2",
"size": "2926",
"license": "mit",
"hash": -4962766361941358000,
"line_mean": 26.6037735849,
"line_max": 106,
"alpha_frac": 0.7474367738,
"autogenerated": false,
"ratio": 2.9887640449438204,
"config_test"... |
["boto==2.27.0"]
import errno
import datetime
import os
import subprocess
import tempfile
import time
from cStringIO import StringIO
# fix for boto
import platform
platform.system = lambda: "Linux"
platform.release = lambda: "'13.1.0'"
from boto.s3.connection import S3Connection
from boto.s3.key import Key
def cal... | {
"repo_name": "cheddarfinancial/quarry-platform",
"path": "jaunt/jobs/jauntcommon.py",
"copies": "1",
"size": "2972",
"license": "bsd-3-clause",
"hash": 6273134221344440000,
"line_mean": 25.5357142857,
"line_max": 100,
"alpha_frac": 0.6137281292,
"autogenerated": false,
"ratio": 3.743073047858942... |
# Boto 3
import boto3
regionList=[]
ec2regions = boto3.client('ec2').describe_regions(); #dict
for region in ec2regions['Regions']: #list
regionList.append(region['RegionName'])
def findNameTag(tags):
for tag in tags:
if tag['Key'] == 'Name':
name = tag['Value']
return name
def termin... | {
"repo_name": "honux77/practice",
"path": "aws/python/ec2_display.py",
"copies": "1",
"size": "1715",
"license": "mit",
"hash": -3625371977586450400,
"line_mean": 29.0877192982,
"line_max": 77,
"alpha_frac": 0.6239067055,
"autogenerated": false,
"ratio": 3.871331828442438,
"config_test": false,... |
"""Boto3 SES email backend class"""
from django.core.mail.backends.base import BaseEmailBackend
from django.conf import settings
import boto3
client = boto3.client('ses')
class SESEmailBackend(BaseEmailBackend):
def send_messages(self, email_messages):
"""
Sends the messages.
"""
... | {
"repo_name": "Tuss4/django-boto3-ses",
"path": "dj_b3ses/boto3ses.py",
"copies": "1",
"size": "1595",
"license": "mit",
"hash": 7071880498286178000,
"line_mean": 26.5,
"line_max": 61,
"alpha_frac": 0.4451410658,
"autogenerated": false,
"ratio": 5.015723270440252,
"config_test": false,
"has_n... |
"""Bot Operating System.
An event driven Operating System for Bots.
The BotOS class below is the only class you will have to manipulate
to control the bot.
- Actions (Commands issued to the bot):
Can be shoot, add_force, add_torque
- Events (Messages received from the simulation):
Are prefixed with "on_"
Get Start... | {
"repo_name": "gianksp/warbots",
"path": "samples/python/bot.py",
"copies": "1",
"size": "6336",
"license": "mit",
"hash": -2267193392018119700,
"line_mean": 29.7572815534,
"line_max": 150,
"alpha_frac": 0.6324179293,
"autogenerated": false,
"ratio": 3.7314487632508833,
"config_test": true,
"... |
# Boto script for invoking: http://docs.aws.amazon.com/cli/latest/reference/lambda/create-alias.html
import json
import sys
import boto3
import yaml
if len(sys.argv) != 5:
raise Exception("Invalid Usage")
environment = str(sys.argv[1])
version = str(sys.argv[2])
aliasName = str(sys.argv[3])
functionVersion = st... | {
"repo_name": "neil-power-hs/aws-lambda-sample",
"path": "scripts/createLambdaAlias.py",
"copies": "1",
"size": "1225",
"license": "apache-2.0",
"hash": -3142672170483130400,
"line_mean": 27.488372093,
"line_max": 100,
"alpha_frac": 0.6816326531,
"autogenerated": false,
"ratio": 3.470254957507082... |
# Boto script for invoking: http://docs.aws.amazon.com/cli/latest/reference/lambda/update-alias.html
import json
import sys
import boto3
import yaml
if len(sys.argv) != 5:
raise Exception("Invalid Usage")
environment = str(sys.argv[1])
version = str(sys.argv[2])
aliasName = str(sys.argv[3])
functionVersion = st... | {
"repo_name": "neil-power-hs/aws-lambda-sample",
"path": "scripts/updateLambdaAlias.py",
"copies": "1",
"size": "1225",
"license": "apache-2.0",
"hash": -1665179305810180600,
"line_mean": 27.488372093,
"line_max": 100,
"alpha_frac": 0.6816326531,
"autogenerated": false,
"ratio": 3.470254957507082... |
# Boto script for invoking: http://docs.aws.amazon.com/cli/latest/reference/lambda/update-function-code.html
import json
import sys
import boto3
import yaml
if len(sys.argv) != 4:
raise Exception("Invalid Usage")
environment = str(sys.argv[1])
version = str(sys.argv[2])
bucket = str(sys.argv[3])
stream = file(... | {
"repo_name": "neil-power-hs/aws-lambda-sample",
"path": "scripts/updateFunctionCode.py",
"copies": "1",
"size": "1083",
"license": "apache-2.0",
"hash": 6373277163035407000,
"line_mean": 26.7692307692,
"line_max": 108,
"alpha_frac": 0.6675900277,
"autogenerated": false,
"ratio": 3.34259259259259... |
# Boto should get credentials from ~/.aws/credentials or the environment
import asyncio
import aiobotocore
def get_items(start_num, num_items):
"""
Generate a sequence of dynamo items
:param start_num: Start index
:type start_num: int
:param num_items: Number of items
:type num_items: int
... | {
"repo_name": "aio-libs/aiobotocore",
"path": "examples/dynamodb_batch_write.py",
"copies": "1",
"size": "3409",
"license": "apache-2.0",
"hash": -6200302972516714000,
"line_mean": 30.2752293578,
"line_max": 84,
"alpha_frac": 0.5570548548,
"autogenerated": false,
"ratio": 4.37051282051282,
"con... |
# Boto should get credentials from ~/.aws/credentials or the environment
import uuid
import asyncio
import aiobotocore
async def go():
session = aiobotocore.get_session()
async with session.create_client('dynamodb', region_name='us-west-2') as client:
# Create random table name
table_name = f... | {
"repo_name": "aio-libs/aiobotocore",
"path": "examples/dynamodb_create_table.py",
"copies": "1",
"size": "1326",
"license": "apache-2.0",
"hash": 6970835514476937000,
"line_mean": 25.52,
"line_max": 84,
"alpha_frac": 0.5196078431,
"autogenerated": false,
"ratio": 4.494915254237288,
"config_tes... |
# Boto Uploader
# Landsat Util
# License: CC0 1.0 Universal
# The S3 uploader is a fork of pys3upload (https://github.com/leetreveil/pys3upload)
from __future__ import print_function, division, absolute_import
import os
import sys
import time
import threading
import contextlib
try:
import queue
except:
impo... | {
"repo_name": "developmentseed/landsat-util",
"path": "landsat/uploader.py",
"copies": "3",
"size": "6978",
"license": "cc0-1.0",
"hash": 8982551773284490000,
"line_mean": 25.3320754717,
"line_max": 103,
"alpha_frac": 0.571653769,
"autogenerated": false,
"ratio": 4.021902017291066,
"config_test... |
# Boto Uploader
# Landsat Util
# License: CC0 1.0 Universal
# The S3 uploader is a fork of pys3upload (https://github.com/leetreveil/pys3upload)
from __future__ import print_function, division
import os
import sys
import time
import threading
import contextlib
import Queue
from multiprocessing import pool
try:
i... | {
"repo_name": "RoboDonut/landsat-util",
"path": "landsat/uploader.py",
"copies": "6",
"size": "6854",
"license": "cc0-1.0",
"hash": 7659105805548225000,
"line_mean": 25.7734375,
"line_max": 103,
"alpha_frac": 0.5709074993,
"autogenerated": false,
"ratio": 4.022300469483568,
"config_test": false... |
"""bot.py - implements the FlowBot class, a boilerplate for other bots."""
from .channel_db import ChannelDb
from .server import Server
from .config import Config
import logging
import threading
import time
import json
try:
import Queue
except ImportError:
import queue as Queue
LOG = logging.getLogger(__name... | {
"repo_name": "SpiderOak/flowbot",
"path": "src/bot.py",
"copies": "1",
"size": "9017",
"license": "mpl-2.0",
"hash": -7051549532814136000,
"line_mean": 34.7817460317,
"line_max": 95,
"alpha_frac": 0.5809027393,
"autogenerated": false,
"ratio": 4.554040404040404,
"config_test": true,
"has_no_... |
# bot.py
# -*- coding: utf-8 -*-
# speechrecognition, pyaudio, brew install portaudio
import sys
import random
sys.path.append("./")
import requests
import datetime as dt
import dateutil.parser
import json
import traceback
import time
from nlg import NLG
from speech import Speech
from vision import Vision
from firebas... | {
"repo_name": "TheFrankemon/AISM-Try1",
"path": "bot.py",
"copies": "1",
"size": "8936",
"license": "mit",
"hash": -1283498922634181400,
"line_mean": 31.9962962963,
"line_max": 139,
"alpha_frac": 0.6724660456,
"autogenerated": false,
"ratio": 2.922900262467192,
"config_test": false,
"has_no_k... |
# bot.py
# -*- coding: utf-8 -*-
# speechrecognition, pyaudio, brew install portaudio
import sys
reload(sys)
sys.setdefaultencoding('utf8')
sys.path.append("./")
import subprocess
from subprocess import Popen, PIPE
import signal
import requests
import datetime
import dateutil.parser
import json
import traceback
import ... | {
"repo_name": "Destroyerrrocket/AI-Smart-Mirror",
"path": "bot.py",
"copies": "1",
"size": "14847",
"license": "mit",
"hash": -5944885025652280000,
"line_mean": 36.1954887218,
"line_max": 136,
"alpha_frac": 0.5501650832,
"autogenerated": false,
"ratio": 3.873923257635082,
"config_test": false,
... |
# bot.py
#
# Pubsub Client Bot - Listens to pubsub events for new blog entries.
#
import time
import datetime
import os
import cPickle as pickle
import sqlite3
from twisted.python import log
from twisted.internet import defer, task, reactor
from twisted.words.xish import domish, xpath
from wokkel.pubsub import PubSubC... | {
"repo_name": "twonds/thetofu.com",
"path": "blogear/bot.py",
"copies": "1",
"size": "7660",
"license": "mit",
"hash": 6820874023443703000,
"line_mean": 29.7630522088,
"line_max": 95,
"alpha_frac": 0.5590078329,
"autogenerated": false,
"ratio": 3.9812889812889813,
"config_test": false,
"has_n... |
# bot.py
# speechrecognition, pyaudio, brew install portaudio
import sys
sys.path.append("./")
import requests
import datetime
import dateutil.parser
import json
import traceback
from nlg import NLG
from speech import Speech
from knowledge import Knowledge
from vision import Vision
from config import Config
import fa... | {
"repo_name": "ymnoor21/AI-Smart-Mirror",
"path": "bot.py",
"copies": "1",
"size": "12496",
"license": "mit",
"hash": 5327009884503777000,
"line_mean": 38.5443037975,
"line_max": 136,
"alpha_frac": 0.5432138284,
"autogenerated": false,
"ratio": 4.0769983686786295,
"config_test": true,
"has_no... |
# bot.py
# A custom Twitch bot for Hex + MtG card searches
# Based on tutorial here: http://www.instructables.com/id/Twitchtv-Moderator-Bot/
# (The tutorial has several non-functioning bits)
# Uses regex expressions to parse twitch messages and to match card names
# You will need an OAUTH token through Twitch
... | {
"repo_name": "krusingon/krusbot",
"path": "bot.py",
"copies": "1",
"size": "7812",
"license": "unlicense",
"hash": 3826997852264024600,
"line_mean": 31.8268398268,
"line_max": 151,
"alpha_frac": 0.6095750128,
"autogenerated": false,
"ratio": 3.0057714505579067,
"config_test": false,
"has_no_... |
''' bot.py
Bot command processing facilities
Copyright 2008 Corey Tabaka
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
... | {
"repo_name": "eieio/pyy",
"path": "modules/bot.py",
"copies": "1",
"size": "6077",
"license": "apache-2.0",
"hash": -3172390975494851600,
"line_mean": 29.4870466321,
"line_max": 111,
"alpha_frac": 0.6494981076,
"autogenerated": false,
"ratio": 3.3911830357142856,
"config_test": false,
"has_n... |
# BotRubbix Python
'''
This is a framework for a Bot configured for Twitch
Using this will require some knowledge of Python since there are no commands
to begin with, once the username, channels and oauth has been filled out. The
program will just print out the chat of the channels it connects to.
You can send a mess... | {
"repo_name": "RubbixCube/Twitch-Chat-Bot-V2",
"path": "bot.py",
"copies": "1",
"size": "5132",
"license": "mit",
"hash": 859303328367712500,
"line_mean": 30.4846625767,
"line_max": 137,
"alpha_frac": 0.5588464536,
"autogenerated": false,
"ratio": 3.363040629095675,
"config_test": false,
"has... |
bots = {}
outputs = {}
bot_responsibility = (17, 61)
def init_bot(idx):
bots[idx] = {
'stack': [],
'high': None,
'high_output': None,
'low': None,
'low_output': None,
}
def output_outputs():
for k in sorted(outputs.keys()):
print(str(k) + ': ' + ', '.join... | {
"repo_name": "matslindh/codingchallenges",
"path": "adventofcode2016/10.py",
"copies": "1",
"size": "2482",
"license": "mit",
"hash": -3327846113146820000,
"line_mean": 23.3431372549,
"line_max": 87,
"alpha_frac": 0.5076551168,
"autogenerated": false,
"ratio": 3.252948885976409,
"config_test":... |
# Bot's token. Obtain yours from https://telegram.me/botfather
token = "<TOKEN>"
# Your telegram user id. Get it from @my_id_bot
my_id = '<your_id>'
# Database
# your MongoDB connection url
db_auth = 'mongodb://<user>:<password>@<my.mongodb.com>:<port>/<database>'
db_name = '<database_name>'
# Smart availability: yo... | {
"repo_name": "ezubirs/ezubirds",
"path": "config.py",
"copies": "1",
"size": "1133",
"license": "mit",
"hash": 5331871522686279000,
"line_mean": 31.3714285714,
"line_max": 93,
"alpha_frac": 0.6990291262,
"autogenerated": false,
"ratio": 3.21875,
"config_test": false,
"has_no_keywords": true,... |
"""Bottle_Builder URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Cl... | {
"repo_name": "andrewnyhus/Bottle-Builder",
"path": "Bottle_Builder/urls.py",
"copies": "1",
"size": "3600",
"license": "mit",
"hash": -8304167544478190000,
"line_mean": 65.6666666667,
"line_max": 184,
"alpha_frac": 0.7072222222,
"autogenerated": false,
"ratio": 3.2171581769436997,
"config_test... |
@bottle.get("/update/<db_name>/<doc_id>")
def update(db_name, doc_id):
b_path = os.path.join(bottle.data_store, db_name)
c = Connector(db_path)
new_data = request.get("row")
#data = c.format_data()
doc = c.data.update_one({"_id":doc_id}, {"$set":new_data})
if doc is not None:
return True... | {
"repo_name": "cortext/antonio",
"path": "angular_version/interact.py",
"copies": "1",
"size": "1375",
"license": "mit",
"hash": 1584471959564320500,
"line_mean": 28.8913043478,
"line_max": 71,
"alpha_frac": 0.5927272727,
"autogenerated": false,
"ratio": 2.846790890269151,
"config_test": false,... |
# Bottleneck is now slicing in two places: tau_chol, which fetches from 'A' and places into
# the Cholesky factor based on stochastics (not much to do about this); and tau_offdiag /
# changeable_tau, which doesn't yet slice efficiently with irregular strides. Hopefully
# the post to scipy gives some ideas.
# May want t... | {
"repo_name": "matthew-brett/pymc",
"path": "pymc/sandbox/NormalSubmodel.py",
"copies": "1",
"size": "29447",
"license": "mit",
"hash": -7724903115125523000,
"line_mean": 37.1437823834,
"line_max": 152,
"alpha_frac": 0.5433490678,
"autogenerated": false,
"ratio": 3.4733427695211136,
"config_tes... |
"""Bottleneck runner script for generating flow-density plots.
Run density experiment to generate capacity diagram for the
bottleneck experiment
"""
import multiprocessing
import numpy as np
import os
import ray
from examples.sumo.bottlenecks import bottleneck_example
@ray.remote
def run_bottleneck(flow_rate, num_... | {
"repo_name": "cathywu/flow",
"path": "examples/sumo/density_exp.py",
"copies": "1",
"size": "2761",
"license": "mit",
"hash": 7928579968130917000,
"line_mean": 29.0108695652,
"line_max": 73,
"alpha_frac": 0.6106483158,
"autogenerated": false,
"ratio": 3.888732394366197,
"config_test": false,
... |
""" Bottleneck Self Attention (Bottleneck Transformers)
Paper: `Bottleneck Transformers for Visual Recognition` - https://arxiv.org/abs/2101.11605
@misc{2101.11605,
Author = {Aravind Srinivas and Tsung-Yi Lin and Niki Parmar and Jonathon Shlens and Pieter Abbeel and Ashish Vaswani},
Title = {Bottleneck Transformers f... | {
"repo_name": "rwightman/pytorch-image-models",
"path": "timm/models/layers/bottleneck_attn.py",
"copies": "1",
"size": "4749",
"license": "apache-2.0",
"hash": 8254575134032450000,
"line_mean": 36.6904761905,
"line_max": 118,
"alpha_frac": 0.6321330806,
"autogenerated": false,
"ratio": 2.9170761... |
# bot to add mesh pharmacologic action mesh terms and their subclass hieracrchy to wikidata
import pandas as pd
pd.set_option("display.width", 200)
import time
import re
from tqdm import tqdm
from scheduled_bots.drugs.mesh_pa.dumper import get_mesh_tree, get_mesh_pa_counts, get_drug_pa
from wikidataintegrator import... | {
"repo_name": "SuLab/scheduled-bots",
"path": "scheduled_bots/drugs/mesh_pa/bot.py",
"copies": "1",
"size": "6048",
"license": "mit",
"hash": 2427354474133235000,
"line_mean": 40.4315068493,
"line_max": 120,
"alpha_frac": 0.6104497354,
"autogenerated": false,
"ratio": 2.9344978165938866,
"confi... |
BOTTOM = 0
TOP = 2
LEFT = 1
RIGHT = 3
def calc_total_area(rectangles):
rectangles = tuple(set(rectangles)) # eliminate duplicates
total_area = 0
for rectangle in rectangles:
total_area = total_area + (rectangle[TOP] - rectangle[BOTTOM]) * (rectangle[RIGHT] - rectangle[LEFT])
if len(rectan... | {
"repo_name": "denisrmp/dailyprogrammer",
"path": "158hard_IntersectingRectangles.py",
"copies": "1",
"size": "1512",
"license": "mit",
"hash": -4757477870254524000,
"line_mean": 36.8,
"line_max": 118,
"alpha_frac": 0.6369047619,
"autogenerated": false,
"ratio": 3.2238805970149254,
"config_test... |
BOTTOM = 0
TOP = 2
LEFT = 1
RIGHT = 3
def calc_total_area(rectangles):
rectangles = tuple(set(rectangles)) # eliminate duplicates
total_area = 0
for rectangle in rectangles:
total_area = total_area + (rectangle[TOP] - rectangle[BOTTOM]) * (rectangle[RIGHT] - rectangle[LEFT])
if len(rectangles... | {
"repo_name": "denisrmp/hacker-rank",
"path": "dailyprogrammer/hard158_IntersectingRectangles.py",
"copies": "1",
"size": "1510",
"license": "mit",
"hash": -5917616475040527000,
"line_mean": 31.8260869565,
"line_max": 118,
"alpha_frac": 0.6377483444,
"autogenerated": false,
"ratio": 3.24034334763... |
# Bottom up TLE
class Solution:
def minimumMoves(self, arr: List[int]) -> int:
n = len(arr)
dp = [[0] * n for _ in range(n)]
for i in range(n):
dp[i][i] = 1
for l in range(2, 1 + n):
for i in range(0, n - l + 1):
j = i + l - 1
... | {
"repo_name": "jiadaizhao/LeetCode",
"path": "1201-1300/1246-Palindrome Removal/1246-Palindrome Removal.py",
"copies": "1",
"size": "1249",
"license": "mit",
"hash": 3316571699732408000,
"line_mean": 30.225,
"line_max": 75,
"alpha_frac": 0.3650920737,
"autogenerated": false,
"ratio": 3.2610966057... |
# botUtil.py
import psycopg2, psycopg2.extensions, psycopg2.extras
import tweepy
import json
import time
import dateutil.parser
import sqlalchemy
import sys
sys.path.append("models/")
from ModelBase import SessionFactory
class topic(object):
def __init__(self,topic_json):
self.query = topic_json['que... | {
"repo_name": "groceryheist/UWBotThings",
"path": "code/botUtil.py",
"copies": "1",
"size": "12398",
"license": "mit",
"hash": 3984267594939561500,
"line_mean": 31.8859416446,
"line_max": 178,
"alpha_frac": 0.5814647524,
"autogenerated": false,
"ratio": 3.8889585947302385,
"config_test": false,... |
# botvs@7190d0470fa27a9a68d3f4a6e700197a
import numpy as np
import pandas as pa
import json
import time
import copy
import threading
import traceback
#Vstoplostpct 策略止损百分比 可设置参数
def main():
LastTradePrice=0 #上次成交价格
LastTradeTime=time.time()#上次成交时间
SellOut=False
Log(exchange.GetAccount())
while True... | {
"repo_name": "knifecaojia/CoinsPro",
"path": "Src/Botvs/永恒策略.py",
"copies": "1",
"size": "2004",
"license": "apache-2.0",
"hash": 406876322016473860,
"line_mean": 33.8148148148,
"line_max": 156,
"alpha_frac": 0.6074468085,
"autogenerated": false,
"ratio": 3.363148479427549,
"config_test": fals... |
# botvs@87afb0bb6ca4dada56ad5b1f51d1e60d
import numpy as np
import pandas as pa
import json
import time
import copy
import threading
import traceback
exchangesnamelist=[]
exchangespairlnamelist=[]#交易市场对儿
exchangesdf=pa.DataFrame()
exchangesdiffdf=pa.DataFrame()
tradetasklistdf=pa.DataFrame()
exchangesdfcolumnsname=["Na... | {
"repo_name": "knifecaojia/CoinsPro",
"path": "RefCodes/BotVs/暴力对冲.py",
"copies": "1",
"size": "58231",
"license": "apache-2.0",
"hash": -6478921433701563000,
"line_mean": 47.2991071429,
"line_max": 307,
"alpha_frac": 0.5936593031,
"autogenerated": false,
"ratio": 2.8999142275115255,
"config_te... |
# botvs@8dd9d76593f72d4cbb1f5fdc0cafd09e
def Test():
Log("template call")
def Cut(num,c): #浮点数截断 num是待截断浮点 c截断位数
if num%1==0:
return num
c=10**(-c)
d=(num//c)*c
return d
def GetStrFromList(arr): #将list 转变为以回车为分界的字符串
#Log(type(arr))
return "\n".join(arr)
#将pa.dataframe 转为支持lo... | {
"repo_name": "knifecaojia/CoinsPro",
"path": "RefCodes/BotVs/公共函数.py",
"copies": "1",
"size": "1048",
"license": "apache-2.0",
"hash": 1434798604914585000,
"line_mean": 27.96875,
"line_max": 67,
"alpha_frac": 0.5507559395,
"autogenerated": false,
"ratio": 2.4177545691906004,
"config_test": fal... |
# botvs@aeb919da31253101019d226ad2de751c
import numpy as np
import pandas as pa
import json
import time
import copy
import threading
import traceback
exchangesnamelist=[]
exchangespairlnamelist=[]#交易市场对儿
exchangesdf=pa.DataFrame()
exchangesdiffdf=pa.DataFrame()
tradetasklistdf=pa.DataFrame()
exchangesdfcolumnsname=["Na... | {
"repo_name": "knifecaojia/CoinsPro",
"path": "RefCodes/BotVs/对冲.py",
"copies": "1",
"size": "60199",
"license": "apache-2.0",
"hash": -5752850279570111000,
"line_mean": 53.646493756,
"line_max": 331,
"alpha_frac": 0.5978694605,
"autogenerated": false,
"ratio": 3.089166440401846,
"config_test":... |
"""botw-tracker user app views
Copyright (c) 2017, Evan Moritz.
botw-tracker is an open source software project released under the MIT License.
See the accompanying LICENSE file for terms.
"""
from django.contrib.auth.mixins import LoginRequiredMixin
from django.contrib.auth.models import User
from django.core.excep... | {
"repo_name": "emoritzx/botw-tracker",
"path": "src/user/views.py",
"copies": "1",
"size": "3018",
"license": "mit",
"hash": -4844654588902633000,
"line_mean": 36.2716049383,
"line_max": 89,
"alpha_frac": 0.6577203446,
"autogenerated": false,
"ratio": 3.8445859872611465,
"config_test": false,
... |
# boty/drivers/xmpp/bot.py
#
#
""" XMPP bot build on sleekxmpp. """
## boty imports
from jsb.imports import getsleek
sleekxmpp = getsleek()
## jsb imports
from jsb.lib.threads import start_new_thread
from jsb.utils.xmpp import stripped
from jsb.lib.botbase import BotBase
from jsb.drivers.xmpp.bot import SXMPPBot
... | {
"repo_name": "Petraea/jsonbot",
"path": "jsb/drivers/sleek/bot.py",
"copies": "1",
"size": "7847",
"license": "mit",
"hash": 3359912260535202300,
"line_mean": 39.6580310881,
"line_max": 128,
"alpha_frac": 0.58302536,
"autogenerated": false,
"ratio": 3.6651097617935546,
"config_test": false,
... |
# Boulderbot 1.5
# An IRC bot designed for Twitch.TV streams
#
# Please see the README for instructions on using Twitchy.
# It is released under the BSD license; the full license
# available in the LICENSE file.
# CONFIGURATION
Twitch_Username = 'Boulderbot' # Twitch.TV username for the bot, must be a registered use... | {
"repo_name": "patchesyar/boulderbot",
"path": "twitchy.py",
"copies": "1",
"size": "8902",
"license": "bsd-3-clause",
"hash": -8208840909130161000,
"line_mean": 43.51,
"line_max": 129,
"alpha_frac": 0.5875084251,
"autogenerated": false,
"ratio": 4.085360256998623,
"config_test": false,
"has_... |
""" Bounce a ball on the screen, using gravity. """
import arcade
# Set up the constants
SCREEN_WIDTH = 800
SCREEN_HEIGHT = 600
# Size of the circle.
CIRCLE_RADIUS = 20
# How strong the gravity is.
GRAVITY_CONSTANT = 0.3
# Percent of velocity maintained on a bounce.
BOUNCINESS = 0.9
def draw(dt):
""" Use thi... | {
"repo_name": "mwreuter/arcade",
"path": "doc/source/examples/bouncing_ball.py",
"copies": "1",
"size": "2216",
"license": "mit",
"hash": -2294927599763721200,
"line_mean": 28.9459459459,
"line_max": 79,
"alpha_frac": 0.6714801444,
"autogenerated": false,
"ratio": 3.3780487804878048,
"config_te... |
""" Bouncer for handling authentication on behalf of an API.
When an HTTP request is directed to an API, a proxy (e.g. nginx) redirects the
request to this service, which then returns either a 200 response
(authentication accepted) or a 401 response (authentication required). If a
200 response is received, the proxy t... | {
"repo_name": "praekelt/go-auth",
"path": "go_auth/bouncer.py",
"copies": "1",
"size": "5948",
"license": "bsd-3-clause",
"hash": -7575512356692049000,
"line_mean": 30.9784946237,
"line_max": 78,
"alpha_frac": 0.6331540013,
"autogenerated": false,
"ratio": 3.8977719528178243,
"config_test": tru... |
"""Bounces.
Information about bounces is available via the :py:class:`~postmarker.models.bounces.BounceManager`,
which is an attribute of ``postmark`` instance.
"""
from .base import MessageModel, ModelManager
class Bounce(MessageModel):
"""Bounce model."""
@property
def dump(self):
"""Gets SMTP... | {
"repo_name": "Stranger6667/postmarker",
"path": "src/postmarker/models/bounces.py",
"copies": "1",
"size": "3695",
"license": "mit",
"hash": 6544964818149536000,
"line_mean": 27.8671875,
"line_max": 114,
"alpha_frac": 0.5797023004,
"autogenerated": false,
"ratio": 3.977395048439182,
"config_te... |
""" Boundary Attack++
"""
import logging
import numpy as np
import tensorflow as tf
from warnings import warn
from cleverhans.attacks import Attack
from cleverhans.model import CallableModelWrapper, Model, wrapper_warning_logits
from cleverhans import utils, utils_tf
np_dtype = np.dtype("float32")
tf_dtype = tf.as_dty... | {
"repo_name": "cleverhans-lab/cleverhans",
"path": "cleverhans_v3.1.0/cleverhans/attacks/hop_skip_jump_attack.py",
"copies": "1",
"size": "20591",
"license": "mit",
"hash": 8850877879835862000,
"line_mean": 34.624567474,
"line_max": 101,
"alpha_frac": 0.5716089554,
"autogenerated": false,
"ratio"... |
"""Boundary conditions for receptor based boundary conditions
including unbinding and rebinding.
"""
from collections import defaultdict
import logging
import itertools as it
import time
import numpy as np
from geomm.grouping import group_pair
from geomm.superimpose import superimpose
from geomm.rmsd import calc_rm... | {
"repo_name": "ADicksonLab/wepy",
"path": "src/wepy/boundary_conditions/receptor.py",
"copies": "1",
"size": "25643",
"license": "mit",
"hash": 8459114981227537000,
"line_mean": 31.5418781726,
"line_max": 97,
"alpha_frac": 0.6189603401,
"autogenerated": false,
"ratio": 4.411319456390848,
"confi... |
"""Boundary objects for checking data values
You use a boundary object by passing a sequence of boundaries
in to a BasicProperty as the keyword argument "boundaries".
Boundaries must conform to the interface described by the
Boundary class, but do not necessarily need to be derived from
them. For instance, if you wou... | {
"repo_name": "correl/Transmission-XBMC",
"path": "resources/lib/basictypes/boundary.py",
"copies": "2",
"size": "10731",
"license": "mit",
"hash": -942905941242171600,
"line_mean": 34.4158415842,
"line_max": 115,
"alpha_frac": 0.7077625571,
"autogenerated": false,
"ratio": 3.735120083536373,
"... |
"""Boundary value problem solver."""
from __future__ import division, print_function, absolute_import
from warnings import warn
import numpy as np
from numpy.linalg import norm, pinv
from scipy.sparse import coo_matrix, csc_matrix
from scipy.sparse.linalg import splu
from scipy.optimize import OptimizeResult
EPS =... | {
"repo_name": "jamestwebber/scipy",
"path": "scipy/integrate/_bvp.py",
"copies": "1",
"size": "41159",
"license": "bsd-3-clause",
"hash": -5085091303024819000,
"line_mean": 34.451335056,
"line_max": 88,
"alpha_frac": 0.559853252,
"autogenerated": false,
"ratio": 3.3687182844982813,
"config_test... |
"""Boundary value problem solver."""
from __future__ import division, print_function, absolute_import
from warnings import warn
import numpy as np
from numpy.linalg import pinv
from scipy.optimize import OptimizeResult
from scipy.sparse import coo_matrix, csc_matrix
from scipy.sparse.linalg import splu
EPS = np.finf... | {
"repo_name": "DailyActie/Surrogate-Model",
"path": "01-codes/scipy-master/scipy/integrate/_bvp.py",
"copies": "1",
"size": "39982",
"license": "mit",
"hash": -6593788975832557000,
"line_mean": 34.3197879859,
"line_max": 79,
"alpha_frac": 0.5621029463,
"autogenerated": false,
"ratio": 3.360961667... |
"""Boundary value problem solver."""
from __future__ import division, print_function, absolute_import
from warnings import warn
import numpy as np
from numpy.linalg import pinv
from scipy.sparse import coo_matrix, csc_matrix
from scipy.sparse.linalg import splu
from scipy.optimize import OptimizeResult
EPS = np.fi... | {
"repo_name": "arokem/scipy",
"path": "scipy/integrate/_bvp.py",
"copies": "1",
"size": "41153",
"license": "bsd-3-clause",
"hash": -110710338677544600,
"line_mean": 34.4461670973,
"line_max": 88,
"alpha_frac": 0.5598376789,
"autogenerated": false,
"ratio": 3.3687786509495745,
"config_test": fa... |
"""Boundary value problem solver."""
from warnings import warn
import numpy as np
from numpy.linalg import pinv
from scipy.sparse import coo_matrix, csc_matrix
from scipy.sparse.linalg import splu
from scipy.optimize import OptimizeResult
EPS = np.finfo(float).eps
def estimate_fun_jac(fun, x, y, p, f0=None):
... | {
"repo_name": "aeklant/scipy",
"path": "scipy/integrate/_bvp.py",
"copies": "5",
"size": "41087",
"license": "bsd-3-clause",
"hash": 375273674330824600,
"line_mean": 34.4503882657,
"line_max": 88,
"alpha_frac": 0.5594957042,
"autogenerated": false,
"ratio": 3.3677868852459016,
"config_test": fa... |
# Boundary Visual Effects - Automatic script importer from a folder
# Version 1.0
# Compatibility: Nuke 6.3 and up (not tested on previous versions)
#
#
# If you like it and use it frequently, please consider a small donation to the author,
# via Paypal on the email mborgo[at]boundaryvfx.com
#=========================... | {
"repo_name": "magnoborgo/NukeAutoScriptImporter",
"path": "autoScriptImport.py",
"copies": "1",
"size": "4490",
"license": "bsd-3-clause",
"hash": 8142225233994826000,
"line_mean": 44.3636363636,
"line_max": 116,
"alpha_frac": 0.6510022272,
"autogenerated": false,
"ratio": 4.2559241706161135,
... |
"""Bounded cache with Least Recently Used (LRU) replacement policy."""
from collections import OrderedDict
class LRUCache:
"""Bounded cache with Least Recently Used (LRU) replacement policy.
Attrs:
capacity (int): Cache capacity
Examples:
>>> cache = LRUCache(2)
>>> 'a' not in ... | {
"repo_name": "bioinformed/vgraph",
"path": "vgraph/lru_cache.py",
"copies": "1",
"size": "2381",
"license": "apache-2.0",
"hash": -4203814331633371000,
"line_mean": 24.8804347826,
"line_max": 78,
"alpha_frac": 0.5396892062,
"autogenerated": false,
"ratio": 4.214159292035398,
"config_test": fal... |
''' BoundedRTDPClass.py: Contains the Bounded-RTPDP solver class. '''
# Python imports.
from collections import defaultdict
import copy
# Other imports.
from simple_rl.planning import Planner, ValueIteration
from simple_rl.mdp.MDPClass import MDP
from simple_rl.mdp.StateClass import State
from simple_rl.utils.additio... | {
"repo_name": "david-abel/simple_rl",
"path": "simple_rl/planning/BoundedRTDPClass.py",
"copies": "1",
"size": "6256",
"license": "apache-2.0",
"hash": -1960759860050516000,
"line_mean": 40.1578947368,
"line_max": 135,
"alpha_frac": 0.6154092072,
"autogenerated": false,
"ratio": 4.204301075268817... |
"""Bounded subspace of R^n."""
import numpy as np
from SafeRLBench import Space
from numpy.random import rand
class BoundedSpace(Space):
"""Bounded subspace of R^n.
Attributes
----------
lower : array-like
Lower bound
upper : array-like
Upper bound
Examples
--------
... | {
"repo_name": "befelix/Safe-RL-Benchmark",
"path": "SafeRLBench/spaces/bounded_space.py",
"copies": "1",
"size": "2811",
"license": "mit",
"hash": -2251388889453213000,
"line_mean": 30.9431818182,
"line_max": 79,
"alpha_frac": 0.56527926,
"autogenerated": false,
"ratio": 4.208083832335329,
"con... |
"""Bounded-variable least-squares algorithm."""
from __future__ import division, print_function, absolute_import
import numpy as np
from numpy.linalg import norm, lstsq
from scipy.optimize import OptimizeResult
from .common import print_header_linear, print_iteration_linear
def compute_kkt_optimality(g, on_bound):
... | {
"repo_name": "arokem/scipy",
"path": "scipy/optimize/_lsq/bvls.py",
"copies": "2",
"size": "4997",
"license": "bsd-3-clause",
"hash": 1797842028565077200,
"line_mean": 26.7611111111,
"line_max": 79,
"alpha_frac": 0.5377226336,
"autogenerated": false,
"ratio": 3.2875,
"config_test": false,
"h... |
"""Bounded-Variable Least-Squares algorithm."""
from __future__ import division, print_function, absolute_import
import numpy as np
from numpy.linalg import norm, lstsq
from scipy.optimize import OptimizeResult
from .common import print_header_linear, print_iteration_linear
def compute_kkt_optimality(g, on_bound):
... | {
"repo_name": "gfyoung/scipy",
"path": "scipy/optimize/_lsq/bvls.py",
"copies": "10",
"size": "4996",
"license": "bsd-3-clause",
"hash": 6968009183679535000,
"line_mean": 26.7555555556,
"line_max": 79,
"alpha_frac": 0.5378302642,
"autogenerated": false,
"ratio": 3.2825229960578186,
"config_test... |
"""Bounded-variable least-squares algorithm."""
import numpy as np
from numpy.linalg import norm, lstsq
from scipy.optimize import OptimizeResult
from .common import print_header_linear, print_iteration_linear
def compute_kkt_optimality(g, on_bound):
"""Compute the maximum violation of KKT conditions."""
g_k... | {
"repo_name": "person142/scipy",
"path": "scipy/optimize/_lsq/bvls.py",
"copies": "8",
"size": "4931",
"license": "bsd-3-clause",
"hash": 7542555249310777000,
"line_mean": 26.702247191,
"line_max": 79,
"alpha_frac": 0.5345771649,
"autogenerated": false,
"ratio": 3.278590425531915,
"config_test"... |
"""Bounded-Variable Least-Squares algorithm."""
import numpy as np
from numpy.linalg import norm, lstsq
from scipy.optimize import OptimizeResult
from .common import print_header_linear, print_iteration_linear
def compute_kkt_optimality(g, on_bound):
"""Compute the maximum violation of KKT conditions."""
g_k... | {
"repo_name": "ryfeus/lambda-packs",
"path": "Sklearn_scipy_numpy/source/scipy/optimize/_lsq/bvls.py",
"copies": "18",
"size": "4908",
"license": "mit",
"hash": 3308562633645913000,
"line_mean": 26.5730337079,
"line_max": 79,
"alpha_frac": 0.5342298289,
"autogenerated": false,
"ratio": 3.28074866... |
"""Bounded-variable least-squares algorithm."""
import numpy as np
from numpy.linalg import norm, lstsq
from scipy.optimize import OptimizeResult
from .common import print_header_linear, print_iteration_linear
def compute_kkt_optimality(g, on_bound):
"""Compute the maximum violation of KKT conditions."""
g_k... | {
"repo_name": "ilayn/scipy",
"path": "scipy/optimize/_lsq/bvls.py",
"copies": "13",
"size": "5195",
"license": "bsd-3-clause",
"hash": -3648882518229378600,
"line_mean": 27.3879781421,
"line_max": 79,
"alpha_frac": 0.5193455245,
"autogenerated": false,
"ratio": 3.3668178872326635,
"config_test"... |
"""Bounded-Variable Least-Squares algorithm."""
import numpy as np
from numpy.linalg import norm, lstsq
from scipy.optimize import OptimizeResult
from .common import print_header_linear, print_iteration_linear
def compute_kkt_optimality(g, on_bound):
g_kkt = g * on_bound
free_set = on_bound == 0
g_kkt[fr... | {
"repo_name": "zaxliu/scipy",
"path": "scipy/optimize/_lsq/bvls.py",
"copies": "3",
"size": "4849",
"license": "bsd-3-clause",
"hash": 2427346138948557300,
"line_mean": 26.395480226,
"line_max": 79,
"alpha_frac": 0.5322746958,
"autogenerated": false,
"ratio": 3.2675202156334233,
"config_test": ... |
bounds = {'Wind': (0, 30),
'Pressure': (975, 1015)}
type_styles = {'Pressure': dict(color='black'),
'Wind': dict(linestyle='-')}
variable_styles = {'pressure': dict(),
'wind_speed': dict(color='tab:orange', linewidth=2),
'wind_gust': dict(color='tab:oliv... | {
"repo_name": "julienchastang/unidata-python-workshop",
"path": "notebooks/Pythonic_Data_Analysis/solutions/final.py",
"copies": "1",
"size": "1128",
"license": "mit",
"hash": 6214340989572911000,
"line_mean": 32.1764705882,
"line_max": 93,
"alpha_frac": 0.5868794326,
"autogenerated": false,
"rat... |
"""Bound types and bounded parameter types."""
from collections import namedtuple
from itertools import chain
import numpy as np
from sklearn.utils import check_random_state
class _BoundMixin(object):
"""Methods for the bound objects."""
def check(self, value):
"""
Check a value falls withi... | {
"repo_name": "NICTA/revrand",
"path": "revrand/btypes.py",
"copies": "1",
"size": "10374",
"license": "apache-2.0",
"hash": -8246678379763005000,
"line_mean": 24.2408759124,
"line_max": 79,
"alpha_frac": 0.5396182765,
"autogenerated": false,
"ratio": 4.205107417916498,
"config_test": false,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.