index int64 | repo_name string | branch_name string | path string | content string | import_graph string |
|---|---|---|---|---|---|
88,018 | eightup/bosscat | refs/heads/master | /bosscat/settings.py | import os
import json
import boto3
from botocore.client import Config
from botocore.exceptions import ClientError
from bosscat import utils
def _get_secrets(secrets_bucket_name, app_id, delta, tag):
s3 = boto3.resource('s3', config=Config(signature_version='s3v4'))
# load common secrets
common_secrets_f... | {"/bosscat/sns.py": ["/bosscat/utils.py"], "/bosscat/elasticbeanstalk.py": ["/bosscat/s3.py", "/bosscat/utils.py"], "/bosscat/s3.py": ["/bosscat/utils.py"], "/bosscat/sqs.py": ["/bosscat/utils.py"]} |
88,019 | eightup/bosscat | refs/heads/master | /bosscat/rds.py | import boto3
def create_instance_from_snapshot(
region,
db_instance_identifier,
db_snapshot_identifier,
db_instance_class
):
rds = boto3.client('rds', region)
response = rds.restore_db_instance_from_db_snapshot(
DBInstanceIdentifier = db_instance_identifier,
... | {"/bosscat/sns.py": ["/bosscat/utils.py"], "/bosscat/elasticbeanstalk.py": ["/bosscat/s3.py", "/bosscat/utils.py"], "/bosscat/s3.py": ["/bosscat/utils.py"], "/bosscat/sqs.py": ["/bosscat/utils.py"]} |
88,020 | eightup/bosscat | refs/heads/master | /bosscat/upanddown.py | from copy import deepcopy
from datetime import datetime
from threading import Thread
from time import time, sleep
import boto3
from bosscat import elasticbeanstalk, iam, rds, s3, sns, sqs, utils
def configure(config):
def config_obj(obj):
if obj.get('dead_letter_queue'):
config_obj(obj.get('... | {"/bosscat/sns.py": ["/bosscat/utils.py"], "/bosscat/elasticbeanstalk.py": ["/bosscat/s3.py", "/bosscat/utils.py"], "/bosscat/s3.py": ["/bosscat/utils.py"], "/bosscat/sqs.py": ["/bosscat/utils.py"]} |
88,021 | eightup/bosscat | refs/heads/master | /bosscat/utils.py | from time import sleep
import boto3
from botocore.exceptions import ClientError
client_error_code = lambda ex: ex.response['Error']['Code']
def try_client(lambda_func, max_attempts=10, sleep_time=1.0, ignore=[]):
for attempt in range(1, max_attempts + 1):
try:
lambda_func()
retu... | {"/bosscat/sns.py": ["/bosscat/utils.py"], "/bosscat/elasticbeanstalk.py": ["/bosscat/s3.py", "/bosscat/utils.py"], "/bosscat/s3.py": ["/bosscat/utils.py"], "/bosscat/sqs.py": ["/bosscat/utils.py"]} |
88,022 | eightup/bosscat | refs/heads/master | /bosscat/async.py | import codecs
from hashlib import sha1
from importlib import import_module
import pickle
from uuid import uuid4
import boto3
from bosscat import settings
class SignatureMismatch(Exception):
pass
class NotAsyncReceiver(Exception):
pass
SECRET_BYTES = settings.BOSSCAT_SECRET.encode('utf-8')
encode64 = c... | {"/bosscat/sns.py": ["/bosscat/utils.py"], "/bosscat/elasticbeanstalk.py": ["/bosscat/s3.py", "/bosscat/utils.py"], "/bosscat/s3.py": ["/bosscat/utils.py"], "/bosscat/sqs.py": ["/bosscat/utils.py"]} |
88,023 | eightup/bosscat | refs/heads/master | /bosscat/sns.py | import boto3
from botocore.exceptions import ClientError
from bosscat.utils import (
client_error_code,
get_account_id,
get_topic_arn,
try_client
)
NOT_FOUND = 'NotFound'
def ensure_topic(topic_name, region):
client = boto3.client('sns', region)
response = client.create_topic(Name=topic... | {"/bosscat/sns.py": ["/bosscat/utils.py"], "/bosscat/elasticbeanstalk.py": ["/bosscat/s3.py", "/bosscat/utils.py"], "/bosscat/s3.py": ["/bosscat/utils.py"], "/bosscat/sqs.py": ["/bosscat/utils.py"]} |
88,024 | eightup/bosscat | refs/heads/master | /bosscat/elasticbeanstalk.py | import os
import subprocess
import boto3
from botocore.exceptions import ClientError
from bosscat.s3 import upload_local_file_to_bucket
from bosscat.utils import client_error_code, getenv, try_client
INVALID_PARAMETER_VALUE = 'InvalidParameterValue'
webhead_tier_dict = {
'Name': 'WebServer',
'Type': 'Stan... | {"/bosscat/sns.py": ["/bosscat/utils.py"], "/bosscat/elasticbeanstalk.py": ["/bosscat/s3.py", "/bosscat/utils.py"], "/bosscat/s3.py": ["/bosscat/utils.py"], "/bosscat/sqs.py": ["/bosscat/utils.py"]} |
88,025 | eightup/bosscat | refs/heads/master | /bosscat/s3.py | import boto3
from botocore.exceptions import ClientError
from bosscat.utils import client_error_code, get_bucket_arn, try_client
NO_SUCH_BUCKET = 'NoSuchBucket'
BUCKET_ALREADY_EXISTS = 'BucketAlreadyExists'
BUCKET_ALREADY_OWNED_BY_YOU = 'BucketAlreadyOwnedByYou'
DEFAULT_CORS_DICT = {
'CORSRules': [
{
... | {"/bosscat/sns.py": ["/bosscat/utils.py"], "/bosscat/elasticbeanstalk.py": ["/bosscat/s3.py", "/bosscat/utils.py"], "/bosscat/s3.py": ["/bosscat/utils.py"], "/bosscat/sqs.py": ["/bosscat/utils.py"]} |
88,026 | eightup/bosscat | refs/heads/master | /bosscat/sqs.py | import json
import boto3
from botocore.exceptions import ClientError
from bosscat.utils import client_error_code, get_queue_arn, try_client
NON_EXISTENT_QUEUE = 'AWS.SimpleQueueService.NonExistentQueue'
QUEUE_DELETED_RECENTLY = 'AWS.SimpleQueueService.QueueDeletedRecently'
def ensure_queue(queue_name, region, que... | {"/bosscat/sns.py": ["/bosscat/utils.py"], "/bosscat/elasticbeanstalk.py": ["/bosscat/s3.py", "/bosscat/utils.py"], "/bosscat/s3.py": ["/bosscat/utils.py"], "/bosscat/sqs.py": ["/bosscat/utils.py"]} |
88,027 | eightup/bosscat | refs/heads/master | /bosscat/iam.py | from copy import deepcopy
import json
import boto3
from botocore.exceptions import ClientError
from bosscat import utils
ENTITY_ALREADY_EXISTS = 'EntityAlreadyExists'
MALFORMED_POLICY = 'MalformedPolicy'
NO_SUCH_ENTITY = 'NoSuchEntity'
BASE_INLINE_POLICY_DOCUMENT = {
"Version": "2012-10-17",
"Statement": ... | {"/bosscat/sns.py": ["/bosscat/utils.py"], "/bosscat/elasticbeanstalk.py": ["/bosscat/s3.py", "/bosscat/utils.py"], "/bosscat/s3.py": ["/bosscat/utils.py"], "/bosscat/sqs.py": ["/bosscat/utils.py"]} |
88,028 | eightup/bosscat | refs/heads/master | /setup.py | import os
from setuptools import setup, find_packages
setup(
name='bosscat',
version=0.0,
author='Code Hat Labs, LLC',
author_email='dev@codehatlabs.com',
url='https://github.com/eightup/bosscat',
description='Automated Python deployments to AWS Cloud',
packages=find_packages(),
long_d... | {"/bosscat/sns.py": ["/bosscat/utils.py"], "/bosscat/elasticbeanstalk.py": ["/bosscat/s3.py", "/bosscat/utils.py"], "/bosscat/s3.py": ["/bosscat/utils.py"], "/bosscat/sqs.py": ["/bosscat/utils.py"]} |
88,038 | leporo/yammy | refs/heads/master | /tests/test_buffer.py | import unittest
from yammy.translator import YammyInputBuffer
class TestYammyInputBuffer(unittest.TestCase):
def test_iteration(self):
for l in YammyInputBuffer(['test']):
self.assertEqual(l, 'test')
| {"/tests/test_buffer.py": ["/yammy/translator.py"], "/yammy/cmdline.py": ["/yammy/__init__.py"], "/yammy/jinja2_loaders.py": ["/yammy/translator.py"], "/yammy/__init__.py": ["/yammy/translator.py"], "/tests/test_translator.py": ["/yammy/translator.py"], "/yammy/jingo_loaders.py": ["/yammy/jinja2_loaders.py"], "/yammy/d... |
88,039 | leporo/yammy | refs/heads/master | /yammy/translator.py | import weakref
from string import ascii_letters, digits, ascii_lowercase
UNARY_HTML_TAGS = set('area,base,basefont,br,col,frame,hr,'
'img,input,isindex,link,meta,param,embed'\
.split(','))
SCRIPT_HTML_TAGS = ('script', 'style')
# Replace tab characters with 4 space charact... | {"/tests/test_buffer.py": ["/yammy/translator.py"], "/yammy/cmdline.py": ["/yammy/__init__.py"], "/yammy/jinja2_loaders.py": ["/yammy/translator.py"], "/yammy/__init__.py": ["/yammy/translator.py"], "/tests/test_translator.py": ["/yammy/translator.py"], "/yammy/jingo_loaders.py": ["/yammy/jinja2_loaders.py"], "/yammy/d... |
88,040 | leporo/yammy | refs/heads/master | /tests/__init__.py | from test_translator import TestYammyTranslator
from test_buffer import TestYammyInputBuffer
| {"/tests/test_buffer.py": ["/yammy/translator.py"], "/yammy/cmdline.py": ["/yammy/__init__.py"], "/yammy/jinja2_loaders.py": ["/yammy/translator.py"], "/yammy/__init__.py": ["/yammy/translator.py"], "/tests/test_translator.py": ["/yammy/translator.py"], "/yammy/jingo_loaders.py": ["/yammy/jinja2_loaders.py"], "/yammy/d... |
88,041 | leporo/yammy | refs/heads/master | /yammy/cmdline.py | #!/usr/bin/env python
import sys
from os import path, walk, makedirs
from argparse import ArgumentParser
from yammy import yammy_to_html, VERSION
class Yammy2Html(object):
def parse_arguments(self):
parser = ArgumentParser(description='Yammy template preprocessor '
... | {"/tests/test_buffer.py": ["/yammy/translator.py"], "/yammy/cmdline.py": ["/yammy/__init__.py"], "/yammy/jinja2_loaders.py": ["/yammy/translator.py"], "/yammy/__init__.py": ["/yammy/translator.py"], "/tests/test_translator.py": ["/yammy/translator.py"], "/yammy/jingo_loaders.py": ["/yammy/jinja2_loaders.py"], "/yammy/d... |
88,042 | leporo/yammy | refs/heads/master | /yammy/jinja2_loaders.py | from jinja2.loaders import FileSystemLoader, PackageLoader
from yammy.translator import yammy_to_html_string
class YammyLoaderMixin(object):
DEBUG = False
def get_html_source(self, get_source, environment, template):
contents, filename, uptodate = get_source(environment, template)
if filenam... | {"/tests/test_buffer.py": ["/yammy/translator.py"], "/yammy/cmdline.py": ["/yammy/__init__.py"], "/yammy/jinja2_loaders.py": ["/yammy/translator.py"], "/yammy/__init__.py": ["/yammy/translator.py"], "/tests/test_translator.py": ["/yammy/translator.py"], "/yammy/jingo_loaders.py": ["/yammy/jinja2_loaders.py"], "/yammy/d... |
88,043 | leporo/yammy | refs/heads/master | /setup.py | #!/usr/bin/env python
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
VERSION = '0.5.4'
setup(name='yammy',
version=VERSION,
description="Yammy: A better way to create a Django/Jinja template",
long_description="Yammy is not a template engine. "
... | {"/tests/test_buffer.py": ["/yammy/translator.py"], "/yammy/cmdline.py": ["/yammy/__init__.py"], "/yammy/jinja2_loaders.py": ["/yammy/translator.py"], "/yammy/__init__.py": ["/yammy/translator.py"], "/tests/test_translator.py": ["/yammy/translator.py"], "/yammy/jingo_loaders.py": ["/yammy/jinja2_loaders.py"], "/yammy/d... |
88,044 | leporo/yammy | refs/heads/master | /yammy/__init__.py | from yammy.translator import yammy_to_html_string, yammy_to_html
VERSION = '0.5'
| {"/tests/test_buffer.py": ["/yammy/translator.py"], "/yammy/cmdline.py": ["/yammy/__init__.py"], "/yammy/jinja2_loaders.py": ["/yammy/translator.py"], "/yammy/__init__.py": ["/yammy/translator.py"], "/tests/test_translator.py": ["/yammy/translator.py"], "/yammy/jingo_loaders.py": ["/yammy/jinja2_loaders.py"], "/yammy/d... |
88,045 | leporo/yammy | refs/heads/master | /tests/test_translator.py | import os
import unittest
from yammy.translator import YammyInputBuffer, \
yammy_to_html_string, yammy_to_html
class TestYammyTranslator(unittest.TestCase):
def _check(self, yammy, html):
translated_html = yammy_to_html_string(yammy)
self.assertEqual(html, translated... | {"/tests/test_buffer.py": ["/yammy/translator.py"], "/yammy/cmdline.py": ["/yammy/__init__.py"], "/yammy/jinja2_loaders.py": ["/yammy/translator.py"], "/yammy/__init__.py": ["/yammy/translator.py"], "/tests/test_translator.py": ["/yammy/translator.py"], "/yammy/jingo_loaders.py": ["/yammy/jinja2_loaders.py"], "/yammy/d... |
88,046 | leporo/yammy | refs/heads/master | /yammy/jingo_loaders.py | import jinja2
from yammy.jinja2_loaders import YammyPackageLoader, YammyFileSystemLoader
jinja2.FileSystemLoader = YammyFileSystemLoader
jinja2.PackageLoader = YammyPackageLoader
from jingo import Loader
| {"/tests/test_buffer.py": ["/yammy/translator.py"], "/yammy/cmdline.py": ["/yammy/__init__.py"], "/yammy/jinja2_loaders.py": ["/yammy/translator.py"], "/yammy/__init__.py": ["/yammy/translator.py"], "/tests/test_translator.py": ["/yammy/translator.py"], "/yammy/jingo_loaders.py": ["/yammy/jinja2_loaders.py"], "/yammy/d... |
88,047 | leporo/yammy | refs/heads/master | /yammy/django_loaders.py | from django.template.loaders.filesystem import Loader as FileSystemLoader
from django.template.loaders.app_directories import Loader as PackageLoader
from django.conf import settings
from yammy.translator import yammy_to_html_string
class YammyLoaderMixin(object):
def get_html_source(self, get_source, template_... | {"/tests/test_buffer.py": ["/yammy/translator.py"], "/yammy/cmdline.py": ["/yammy/__init__.py"], "/yammy/jinja2_loaders.py": ["/yammy/translator.py"], "/yammy/__init__.py": ["/yammy/translator.py"], "/tests/test_translator.py": ["/yammy/translator.py"], "/yammy/jingo_loaders.py": ["/yammy/jinja2_loaders.py"], "/yammy/d... |
88,049 | sean-francis113/Chronicler_DiscordBot | refs/heads/master | /setup.py | # -*- coding: utf-8 -*-
from distutils.core import setup
packages = \
['lib']
package_data = \
{'': ['*']}
install_requires = \
['asyncio==3.4.3',
'discord.py==1.2.5',
'flask',
'pymysql==0.7.2',
'python-dotenv',
'requests==2.21.0']
setup_kwargs = {
'name': 'lib',
'version': '0.0.0',
'description': ... | {"/lib/keywords.py": ["/lib/db.py", "/lib/reaction.py"], "/lib/db.py": ["/lib/error.py", "/lib/log.py"], "/lib/warning.py": ["/lib/db.py", "/lib/reaction.py"], "/lib/error.py": ["/lib/message.py"], "/lib/h.py": ["/lib/message.py"], "/lib/message.py": ["/lib/settings.py"], "/lib/ignore.py": ["/lib/db.py", "/lib/reaction... |
88,050 | sean-francis113/Chronicler_DiscordBot | refs/heads/master | /lib/keywords.py | import lib.db
import lib.reaction
import commandList as cmd
async def addKeyword(client, message):
"""
Function That Adds a Keyword and Replacement for the Keyword Into the Database
Parameters:
-----------
client (discord.Client)
The Chronicler Client
message (discord.Message)
The Message... | {"/lib/keywords.py": ["/lib/db.py", "/lib/reaction.py"], "/lib/db.py": ["/lib/error.py", "/lib/log.py"], "/lib/warning.py": ["/lib/db.py", "/lib/reaction.py"], "/lib/error.py": ["/lib/message.py"], "/lib/h.py": ["/lib/message.py"], "/lib/message.py": ["/lib/settings.py"], "/lib/ignore.py": ["/lib/db.py", "/lib/reaction... |
88,051 | sean-francis113/Chronicler_DiscordBot | refs/heads/master | /lib/db.py | #Import Statements
import os
import pymysql.cursors
import pymysql.err
import lib.error
import lib.log
import datetime
from inspect import signature
def connectToDatabase():
"""
Function That Connects to the Database
"""
#Connect to Database With Environment Values
conn = pymysql.connect(
hos... | {"/lib/keywords.py": ["/lib/db.py", "/lib/reaction.py"], "/lib/db.py": ["/lib/error.py", "/lib/log.py"], "/lib/warning.py": ["/lib/db.py", "/lib/reaction.py"], "/lib/error.py": ["/lib/message.py"], "/lib/h.py": ["/lib/message.py"], "/lib/message.py": ["/lib/settings.py"], "/lib/ignore.py": ["/lib/db.py", "/lib/reaction... |
88,052 | sean-francis113/Chronicler_DiscordBot | refs/heads/master | /lib/warning.py | import lib.db
import lib.reaction
import commandList as cmd
async def setWarnings(client, message):
"""
Functions That Resets the Warning List in the Database
Parameters:
-----------
client (discord.Client)
The Chronicler Client
message (discord.Message)
The Message That Held the Comman... | {"/lib/keywords.py": ["/lib/db.py", "/lib/reaction.py"], "/lib/db.py": ["/lib/error.py", "/lib/log.py"], "/lib/warning.py": ["/lib/db.py", "/lib/reaction.py"], "/lib/error.py": ["/lib/message.py"], "/lib/h.py": ["/lib/message.py"], "/lib/message.py": ["/lib/settings.py"], "/lib/ignore.py": ["/lib/db.py", "/lib/reaction... |
88,053 | sean-francis113/Chronicler_DiscordBot | refs/heads/master | /lib/error.py | #Import Statements
import asyncio
import lib.message
async def postErrorAsync(client, channel, error):
await lib.message.send(client, channel, error, time=20.0)
def postError(client, channel, error):
"""
Posts a Provided Error to the User
Parameters:
-----------
client (discord.Client)
The Ch... | {"/lib/keywords.py": ["/lib/db.py", "/lib/reaction.py"], "/lib/db.py": ["/lib/error.py", "/lib/log.py"], "/lib/warning.py": ["/lib/db.py", "/lib/reaction.py"], "/lib/error.py": ["/lib/message.py"], "/lib/h.py": ["/lib/message.py"], "/lib/message.py": ["/lib/settings.py"], "/lib/ignore.py": ["/lib/db.py", "/lib/reaction... |
88,054 | sean-francis113/Chronicler_DiscordBot | refs/heads/master | /lib/progress.py | import asyncio
async def createProgressMessage(client, channel, progressStr):
finalStr = "```" + progressStr + "```"
pMessage = await client.send_message(channel, finalStr)
return pMessage
async def updateProgressMessage(client, pMessage, progressStr):
if (pMessage.author != client.user):
await client.s... | {"/lib/keywords.py": ["/lib/db.py", "/lib/reaction.py"], "/lib/db.py": ["/lib/error.py", "/lib/log.py"], "/lib/warning.py": ["/lib/db.py", "/lib/reaction.py"], "/lib/error.py": ["/lib/message.py"], "/lib/h.py": ["/lib/message.py"], "/lib/message.py": ["/lib/settings.py"], "/lib/ignore.py": ["/lib/db.py", "/lib/reaction... |
88,055 | sean-francis113/Chronicler_DiscordBot | refs/heads/master | /lib/h.py | #Import Statements
import commandList as cmd
import lib.message
async def showHelp(client, message):
"""
Function That Posts the Help Messages to the Player
Parameters:
-----------
client (discord.Client)
The Chronicler Client
message (discord.Message)
The Message That Had the Command
""... | {"/lib/keywords.py": ["/lib/db.py", "/lib/reaction.py"], "/lib/db.py": ["/lib/error.py", "/lib/log.py"], "/lib/warning.py": ["/lib/db.py", "/lib/reaction.py"], "/lib/error.py": ["/lib/message.py"], "/lib/h.py": ["/lib/message.py"], "/lib/message.py": ["/lib/settings.py"], "/lib/ignore.py": ["/lib/db.py", "/lib/reaction... |
88,056 | sean-francis113/Chronicler_DiscordBot | refs/heads/master | /lib/message.py | import asyncio
import lib.settings
async def send(client, channel, messageStr, ignoreStyle=False, feedback=False, delete=True, time=5.0):
"""
Send a Message to the Specified Channel, Formatted Specificially for The Chronicler's Messages
Parameters:
-----------
channel (discord.TextChannel)
The Chann... | {"/lib/keywords.py": ["/lib/db.py", "/lib/reaction.py"], "/lib/db.py": ["/lib/error.py", "/lib/log.py"], "/lib/warning.py": ["/lib/db.py", "/lib/reaction.py"], "/lib/error.py": ["/lib/message.py"], "/lib/h.py": ["/lib/message.py"], "/lib/message.py": ["/lib/settings.py"], "/lib/ignore.py": ["/lib/db.py", "/lib/reaction... |
88,057 | sean-francis113/Chronicler_DiscordBot | refs/heads/master | /lib/ignore.py | import lib.db
import lib.reaction
import commandList as cmd
import lib.message
async def sendIgnoreReaction(client, message):
"""
Function That Sends a Reaction When the User Specifies a Message to be Ignored
Parameters:
-----------
client (discord.Client)
The Chroniler Client
message (discord.... | {"/lib/keywords.py": ["/lib/db.py", "/lib/reaction.py"], "/lib/db.py": ["/lib/error.py", "/lib/log.py"], "/lib/warning.py": ["/lib/db.py", "/lib/reaction.py"], "/lib/error.py": ["/lib/message.py"], "/lib/h.py": ["/lib/message.py"], "/lib/message.py": ["/lib/settings.py"], "/lib/ignore.py": ["/lib/db.py", "/lib/reaction... |
88,058 | sean-francis113/Chronicler_DiscordBot | refs/heads/master | /lib/story.py | import lib.db
import lib.reaction
import lib.keywords
import lib.symbol
async def closeStory(client, message):
"""
Functions That Closes the Story in the Database
Parameters:
-----------
client (discord.Client)
The Chronicler Client
message (discord.Message)
The Message That Held the Comma... | {"/lib/keywords.py": ["/lib/db.py", "/lib/reaction.py"], "/lib/db.py": ["/lib/error.py", "/lib/log.py"], "/lib/warning.py": ["/lib/db.py", "/lib/reaction.py"], "/lib/error.py": ["/lib/message.py"], "/lib/h.py": ["/lib/message.py"], "/lib/message.py": ["/lib/settings.py"], "/lib/ignore.py": ["/lib/db.py", "/lib/reaction... |
88,059 | sean-francis113/Chronicler_DiscordBot | refs/heads/master | /lib/channel.py | #Import Statements
import lib.db
import commandList as cmd
def updateChannel(client, before, after):
"""
Function That Updates the Information Within the Database Based on Changes to the Channel.
Parameters:
-----------
client (discord.Client): The Chronicler Client
before (discord.abc.GuildChannel):... | {"/lib/keywords.py": ["/lib/db.py", "/lib/reaction.py"], "/lib/db.py": ["/lib/error.py", "/lib/log.py"], "/lib/warning.py": ["/lib/db.py", "/lib/reaction.py"], "/lib/error.py": ["/lib/message.py"], "/lib/h.py": ["/lib/message.py"], "/lib/message.py": ["/lib/settings.py"], "/lib/ignore.py": ["/lib/db.py", "/lib/reaction... |
88,060 | sean-francis113/Chronicler_DiscordBot | refs/heads/master | /lib/settings.py | import lib.db
import lib.message
def checkSettings(client, channel):
conn = lib.db.connectToDatabase()
rowCount, result, exists = lib.db.queryDatabase("SELECT * FROM chronicler_settings WHERE channel_id={id}".format(id=str(channel.id)), client, channel, connection=conn, getResult=True, tablename="chronicler_setti... | {"/lib/keywords.py": ["/lib/db.py", "/lib/reaction.py"], "/lib/db.py": ["/lib/error.py", "/lib/log.py"], "/lib/warning.py": ["/lib/db.py", "/lib/reaction.py"], "/lib/error.py": ["/lib/message.py"], "/lib/h.py": ["/lib/message.py"], "/lib/message.py": ["/lib/settings.py"], "/lib/ignore.py": ["/lib/db.py", "/lib/reaction... |
88,061 | sean-francis113/Chronicler_DiscordBot | refs/heads/master | /lib/log.py | import datetime
import lib.db
def logEvent(client, channel, message=None, eType="General", string="", connection=None, close=True):
"""
CURRENTLY UNUSED!
Parameters:
-----------
"""
eventCreator = ""
eventTime = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
eventStr = ""
if message != Non... | {"/lib/keywords.py": ["/lib/db.py", "/lib/reaction.py"], "/lib/db.py": ["/lib/error.py", "/lib/log.py"], "/lib/warning.py": ["/lib/db.py", "/lib/reaction.py"], "/lib/error.py": ["/lib/message.py"], "/lib/h.py": ["/lib/message.py"], "/lib/message.py": ["/lib/settings.py"], "/lib/ignore.py": ["/lib/db.py", "/lib/reaction... |
88,062 | sean-francis113/Chronicler_DiscordBot | refs/heads/master | /lib/privacy.py | import lib.db
import lib.reaction
import commandList as cmd
async def setPrivacy(client, message):
"""
Set the Privacy of the Channel in the Database
Parameters:
-----------
client (discord.Client)
The Chronicler Client
message (discord.Message)
The Message That Held the Command
"""
... | {"/lib/keywords.py": ["/lib/db.py", "/lib/reaction.py"], "/lib/db.py": ["/lib/error.py", "/lib/log.py"], "/lib/warning.py": ["/lib/db.py", "/lib/reaction.py"], "/lib/error.py": ["/lib/message.py"], "/lib/h.py": ["/lib/message.py"], "/lib/message.py": ["/lib/settings.py"], "/lib/ignore.py": ["/lib/db.py", "/lib/reaction... |
88,063 | sean-francis113/Chronicler_DiscordBot | refs/heads/master | /lib/record.py | import lib.keywords
import lib.symbol
import lib.db
import lib.reaction
import lib.log
async def postToDatabase(client, message):
"""
Function That Posts the Provided Message Into the Database
Parameters:
-----------
client (discord.Client)
The Chronicler Client
message (discord.Message)
... | {"/lib/keywords.py": ["/lib/db.py", "/lib/reaction.py"], "/lib/db.py": ["/lib/error.py", "/lib/log.py"], "/lib/warning.py": ["/lib/db.py", "/lib/reaction.py"], "/lib/error.py": ["/lib/message.py"], "/lib/h.py": ["/lib/message.py"], "/lib/message.py": ["/lib/settings.py"], "/lib/ignore.py": ["/lib/db.py", "/lib/reaction... |
88,064 | sean-francis113/Chronicler_DiscordBot | refs/heads/master | /lib/link.py | import lib.db
import lib.reaction
import lib.error
import os
async def getChronicle(client, message):
"""
Function That Generates and Returns a Link to the Story on the Website
Parameters:
-----------
client (discord.Client)
The Chronicler Client
message (discord.Message)
The Message That... | {"/lib/keywords.py": ["/lib/db.py", "/lib/reaction.py"], "/lib/db.py": ["/lib/error.py", "/lib/log.py"], "/lib/warning.py": ["/lib/db.py", "/lib/reaction.py"], "/lib/error.py": ["/lib/message.py"], "/lib/h.py": ["/lib/message.py"], "/lib/message.py": ["/lib/settings.py"], "/lib/ignore.py": ["/lib/db.py", "/lib/reaction... |
88,065 | sean-francis113/Chronicler_DiscordBot | refs/heads/master | /lib/reaction.py | import asyncio
import lib.settings
async def reactThumbsUp(client, message):
"""
Function That Reacts to the Provided Message With a Thumbs Up
Parameters:
-----------
client (discord.Client)
The Chronicler Client
message (discord.Message)
The Message to React To
"""
#settings = lib... | {"/lib/keywords.py": ["/lib/db.py", "/lib/reaction.py"], "/lib/db.py": ["/lib/error.py", "/lib/log.py"], "/lib/warning.py": ["/lib/db.py", "/lib/reaction.py"], "/lib/error.py": ["/lib/message.py"], "/lib/h.py": ["/lib/message.py"], "/lib/message.py": ["/lib/settings.py"], "/lib/ignore.py": ["/lib/db.py", "/lib/reaction... |
88,066 | sean-francis113/Chronicler_DiscordBot | refs/heads/master | /lib/attachment.py | #Import Statements
import lib.db
import lib.reaction
def postAttachments(client, message):
if(message.attachments == None and len(message.attachments) == 0):
return
for attach in message.attachments:
lib.db.queryDatabase(
"INSERT INTO {id}_contents (message_id, is_pinned, entry_type, char_count, w... | {"/lib/keywords.py": ["/lib/db.py", "/lib/reaction.py"], "/lib/db.py": ["/lib/error.py", "/lib/log.py"], "/lib/warning.py": ["/lib/db.py", "/lib/reaction.py"], "/lib/error.py": ["/lib/message.py"], "/lib/h.py": ["/lib/message.py"], "/lib/message.py": ["/lib/settings.py"], "/lib/ignore.py": ["/lib/db.py", "/lib/reaction... |
88,067 | sean-francis113/Chronicler_DiscordBot | refs/heads/master | /lib/w.py | import lib.message
async def showWelcome(client, message):
"""
Functions That Posts The Welcome Message to the Channel
Parameters:
-----------
client (discord.Client)
The Chronicler Client
message (discord.Message)
The Message That Held the Command
"""
welcomeString = []
welcom... | {"/lib/keywords.py": ["/lib/db.py", "/lib/reaction.py"], "/lib/db.py": ["/lib/error.py", "/lib/log.py"], "/lib/warning.py": ["/lib/db.py", "/lib/reaction.py"], "/lib/error.py": ["/lib/message.py"], "/lib/h.py": ["/lib/message.py"], "/lib/message.py": ["/lib/settings.py"], "/lib/ignore.py": ["/lib/db.py", "/lib/reaction... |
88,068 | sean-francis113/Chronicler_DiscordBot | refs/heads/master | /lib/symbol.py | import lib.reaction
import commandList as cmd
async def addSymbol(client, message):
"""
Functions That Adds a Symbol in the Database
Parameters:
-----------
client (discord.Client)
The Chronicler Client
message (discord.Message)
The Message That Held the Command
"""
value = message... | {"/lib/keywords.py": ["/lib/db.py", "/lib/reaction.py"], "/lib/db.py": ["/lib/error.py", "/lib/log.py"], "/lib/warning.py": ["/lib/db.py", "/lib/reaction.py"], "/lib/error.py": ["/lib/message.py"], "/lib/h.py": ["/lib/message.py"], "/lib/message.py": ["/lib/settings.py"], "/lib/ignore.py": ["/lib/db.py", "/lib/reaction... |
88,069 | sean-francis113/Chronicler_DiscordBot | refs/heads/master | /lib/stats.py | import lib.db
import lib.reaction
async def displayChannelStats(client, message):
"""
Functions That Posts Various Channel Stats to the User
Parameters:
-----------
client (discord.Client)
The Chronicler Client
message (discord.Message)
The Message That Held the Command
"""
rowCoun... | {"/lib/keywords.py": ["/lib/db.py", "/lib/reaction.py"], "/lib/db.py": ["/lib/error.py", "/lib/log.py"], "/lib/warning.py": ["/lib/db.py", "/lib/reaction.py"], "/lib/error.py": ["/lib/message.py"], "/lib/h.py": ["/lib/message.py"], "/lib/message.py": ["/lib/settings.py"], "/lib/ignore.py": ["/lib/db.py", "/lib/reaction... |
88,070 | sean-francis113/Chronicler_DiscordBot | refs/heads/master | /lib/blacklist.py | #Import Statements
import lib.db
import lib.reaction
import commandList as cmd
async def blacklistChronicle(client, message):
"""
Function That Blacklists the Chronicle/Channel, Preventing Any Interaction Between it and The Chronicler again.
Parameters:
-----------
message (discord.Message)
The Mes... | {"/lib/keywords.py": ["/lib/db.py", "/lib/reaction.py"], "/lib/db.py": ["/lib/error.py", "/lib/log.py"], "/lib/warning.py": ["/lib/db.py", "/lib/reaction.py"], "/lib/error.py": ["/lib/message.py"], "/lib/h.py": ["/lib/message.py"], "/lib/message.py": ["/lib/settings.py"], "/lib/ignore.py": ["/lib/db.py", "/lib/reaction... |
88,071 | sean-francis113/Chronicler_DiscordBot | refs/heads/master | /lib/create.py | #Import Statements
import discord
import datetime
import lib.db
import lib.h
import lib.w
import lib.record
import lib.reaction
import commandList as cmd
async def createChroniclerChannel(client, message, createNew=True):
"""
Function That Creates a New Channel Both in the Discord Server and the Database, Using D... | {"/lib/keywords.py": ["/lib/db.py", "/lib/reaction.py"], "/lib/db.py": ["/lib/error.py", "/lib/log.py"], "/lib/warning.py": ["/lib/db.py", "/lib/reaction.py"], "/lib/error.py": ["/lib/message.py"], "/lib/h.py": ["/lib/message.py"], "/lib/message.py": ["/lib/settings.py"], "/lib/ignore.py": ["/lib/db.py", "/lib/reaction... |
88,072 | sean-francis113/Chronicler_DiscordBot | refs/heads/master | /lib/validation.py | import lib.db
def validateUser(client, message):
"""
Functions That Checks the Database to Make Sure the User That Posted the Message is Valid
Parameters:
-----------
client (discord.Client)
The Chronicler Client
message (discord.Message)
The Message With the User to Validate
"""
i... | {"/lib/keywords.py": ["/lib/db.py", "/lib/reaction.py"], "/lib/db.py": ["/lib/error.py", "/lib/log.py"], "/lib/warning.py": ["/lib/db.py", "/lib/reaction.py"], "/lib/error.py": ["/lib/message.py"], "/lib/h.py": ["/lib/message.py"], "/lib/message.py": ["/lib/settings.py"], "/lib/ignore.py": ["/lib/db.py", "/lib/reaction... |
88,073 | sean-francis113/Chronicler_DiscordBot | refs/heads/master | /main.py | #Import Statements
import discord
import os
import lib.keep_alive
import lib.blacklist
import lib.channel
import lib.create
import lib.db
import lib.h
import lib.ignore
import lib.keywords
import lib.link
import lib.privacy
import lib.message
import lib.record
import lib.settings
import lib.stats
import lib.story
impor... | {"/lib/keywords.py": ["/lib/db.py", "/lib/reaction.py"], "/lib/db.py": ["/lib/error.py", "/lib/log.py"], "/lib/warning.py": ["/lib/db.py", "/lib/reaction.py"], "/lib/error.py": ["/lib/message.py"], "/lib/h.py": ["/lib/message.py"], "/lib/message.py": ["/lib/settings.py"], "/lib/ignore.py": ["/lib/db.py", "/lib/reaction... |
88,074 | sonicfigo/spiderman | refs/heads/master | /core/__init__.py | #coding=utf-8
import sys
reload(sys)
#解决str(unicode文本)异常问题
#http://blog.csdn.net/sky_qing/article/details/9251735
sys.setdefaultencoding('utf8') | {"/core/spiders/cb_realtime.py": ["/core/items.py"]} |
88,075 | sonicfigo/spiderman | refs/heads/master | /core/items.py | #coding=utf-8
from scrapy.item import Item, Field
#sample 页面:http://www.cnbeta.com/articles/336025.htm
class RealTimeMainItem(Item):
Sid = Field() # 336025
Title = Field() # 美为阿富汗购5亿美元军机 变废品每磅6美分卖出(抓取原始值为unicode编码,需要转码)
Href = Field()
class RealTimeDetailItem(Item):
Sid = Field() # 336025
Titl... | {"/core/spiders/cb_realtime.py": ["/core/items.py"]} |
88,076 | sonicfigo/spiderman | refs/heads/master | /core/settings.py | #coding=utf-8
# Scrapy settings for sss project
#
# For simplicity, this file contains only the most important settings by
# default. All the other settings are documented here:
#
# http://doc.scrapy.org/topics/settings.html
#
#Scrapy 设置
BOT_NAME = 'spider_man'
#LOG_FILE = "./sss/files/log_global.txt"
SPIDER_MO... | {"/core/spiders/cb_realtime.py": ["/core/items.py"]} |
88,077 | sonicfigo/spiderman | refs/heads/master | /core/spiders/s3_spider.py | #coding=utf-8
'''
*** BaseSpider for S3 spiders ***
Tips for inherit spiders:
Have a consistent exception handling for 'parse',
but others like 'make_requests_from_url' should not.
'''
from scrapy.http import Request, FormRequest
from scrapy.exceptions import CloseSpider
from scrapy.spider import Spider
from ... | {"/core/spiders/cb_realtime.py": ["/core/items.py"]} |
88,078 | sonicfigo/spiderman | refs/heads/master | /core/spiders/cb_realtime.py | #coding=utf-8
'''
抓取 CnBeta '实时更新'栏目的12个li.
Dom sample:
<li data-sid="336087">
<div class="title">
<a href="/articles/336087.htm" target="_blank">爱沙尼亚:欧盟五千亿欧元数字市场的模型</a>
</div>
</li>
'''
from datetime import datetime as dt_cls
from scrapy.selector import Selector
from scrapy.http import Request, FormR... | {"/core/spiders/cb_realtime.py": ["/core/items.py"]} |
88,079 | sonicfigo/spiderman | refs/heads/master | /infrastructure/s3_util.py | #coding=utf-8
import traceback
from threading import currentThread
import datetime as dtPkg
from datetime import datetime as dtCls
import json
import os
from pytz import timezone
import pytz
import shutil
import s3_global as s3glb
def pickup_numbers(text):
'''从任意文本中,抽取数字列表'''
return [int(s) for s in text.sp... | {"/core/spiders/cb_realtime.py": ["/core/items.py"]} |
88,080 | sonicfigo/spiderman | refs/heads/master | /infrastructure/s3_global.py | #coding=utf-8
import os
S3LOG_CONFIG = r"./s3files/s3log.config"
FILE_PATH_SBV = r"./crawl_data/%s.csv"
FILE_PATH_VESSEL = r"./crawl_data/%s.xml"
FILE_PATH_Port = r"./crawl_data/%s_port.csv"
#是否scrapyd托管中
_managed_by_scrapyd = None
def managed_by_scrapyd():
global _managed_by_scrapyd
if _managed... | {"/core/spiders/cb_realtime.py": ["/core/items.py"]} |
88,082 | jordanbarkin/socket-chat | refs/heads/main | /server.py | #!/usr/bin/env python3
import socket
import threading
import argparse
from userstate import *
from messages import *
HOST = 'localhost'
PORT = 12345
# dictionary mapping usernames:UserStates for all users in the system
# users are added when accounts are created and removed upon account deletion
# note that the serv... | {"/server.py": ["/userstate.py", "/messages.py"], "/messages_unit_tests.py": ["/messages.py"], "/client.py": ["/messages.py", "/integration_tests.py", "/messages_unit_tests.py"]} |
88,083 | jordanbarkin/socket-chat | refs/heads/main | /messages.py | from __future__ import annotations
from abc import ABC
import struct
PROTOCOL_VERSION_NUMBER = 1
# Diagnostic Message IDs
PING_MESSAGE_ID = 0
PONG_MESSAGE_ID = 9
# Client Message IDs
HERE_MESSAGE_ID = 1
CREATE_ACCOUNT_MESSAGE_ID = 2
AWAY_MESSAGE_ID = 3
SEND... | {"/server.py": ["/userstate.py", "/messages.py"], "/messages_unit_tests.py": ["/messages.py"], "/client.py": ["/messages.py", "/integration_tests.py", "/messages_unit_tests.py"]} |
88,084 | jordanbarkin/socket-chat | refs/heads/main | /userstate.py | #!/usr/bin/env python3
import queue
class UserState:
'''This class encapsulates all server-side information about a particular user.
@attribute self.here: bool
True if the user is currently "here," as in has sent a "here" message, and
has an open connection to the server.
@at... | {"/server.py": ["/userstate.py", "/messages.py"], "/messages_unit_tests.py": ["/messages.py"], "/client.py": ["/messages.py", "/integration_tests.py", "/messages_unit_tests.py"]} |
88,085 | jordanbarkin/socket-chat | refs/heads/main | /messages_unit_tests.py | from messages import *
# We create one of each type of message and make sure that its serialization
# deserializes to an identical representation
def run_test(test_object):
success = (deserialize_message(test_object.serialize()) == test_object)
if success:
print("Test succeeded: " + str(type(test_obje... | {"/server.py": ["/userstate.py", "/messages.py"], "/messages_unit_tests.py": ["/messages.py"], "/client.py": ["/messages.py", "/integration_tests.py", "/messages_unit_tests.py"]} |
88,086 | jordanbarkin/socket-chat | refs/heads/main | /integration_tests.py | #!/usr/bin/env python3
'''
helper functions for integration testing. these functions simulate keyboard input
to check each of the required actions specified in wire_protocol.md
'''
import os
# useful constants
MAGIC_WORD = "FOOBAR"
uname1 = "lavanya"
uname2 = "luke"
# global variables to keep track of the... | {"/server.py": ["/userstate.py", "/messages.py"], "/messages_unit_tests.py": ["/messages.py"], "/client.py": ["/messages.py", "/integration_tests.py", "/messages_unit_tests.py"]} |
88,087 | jordanbarkin/socket-chat | refs/heads/main | /client.py | import socket
import threading
import messages
import select
import queue
import time
import sys
import argparse
from integration_tests import *
import messages_unit_tests
# Configuration
HOST = "localhost"
PORT = 12345
TESTING = False
# Global client state
message_queue = queue.Queue()
is_connected = False
logged_in... | {"/server.py": ["/userstate.py", "/messages.py"], "/messages_unit_tests.py": ["/messages.py"], "/client.py": ["/messages.py", "/integration_tests.py", "/messages_unit_tests.py"]} |
88,116 | devopssquadron/microservices-web-app | refs/heads/master | /tests.py | from flask import Flask, url_for
from app import app
with app.test_request_context():
print(url_for('index'))
| {"/tests.py": ["/app/__init__.py"]} |
88,117 | devopssquadron/microservices-web-app | refs/heads/master | /app/__init__.py | from flask import Flask, render_template, request
app = Flask(__name__)
app.config.from_pyfile('config.py')
from app import views
| {"/tests.py": ["/app/__init__.py"]} |
88,118 | devopssquadron/microservices-web-app | refs/heads/master | /app/config.py | import os
SQLALCHEMY_DATABASE_URI = 'mysql://username:password@localhost/database'
SQLALCHEMY_TRACK_MODIFICATIONS = True
secret_key = os.urandom(24)
DEBUG = True
| {"/tests.py": ["/app/__init__.py"]} |
88,191 | oondeo/odatoo | refs/heads/master | /odatoo/document.py | import xml.dom.minidom as xmldom
from xml.etree.ElementTree import Element, SubElement, tostring
from record import Record
class Document(object):
def __init__(self, update='1'):
self.document = Element('openerp')
self.data = SubElement(self.document, 'data', {'noupdate': update})
def reco... | {"/tests/test_document.py": ["/odatoo/document.py", "/odatoo/record.py"], "/tests/test_record.py": ["/odatoo/record.py", "/odatoo/field.py", "/odatoo/errors.py"], "/tests/test_field.py": ["/odatoo/field.py", "/odatoo/errors.py"]} |
88,192 | oondeo/odatoo | refs/heads/master | /odatoo/__init__.py | __all__ = ['field', 'record', 'document']
| {"/tests/test_document.py": ["/odatoo/document.py", "/odatoo/record.py"], "/tests/test_record.py": ["/odatoo/record.py", "/odatoo/field.py", "/odatoo/errors.py"], "/tests/test_field.py": ["/odatoo/field.py", "/odatoo/errors.py"]} |
88,193 | oondeo/odatoo | refs/heads/master | /tests/test_document.py | import os
from xml.etree.ElementTree import ElementTree
from unittest import TestCase
from odatoo.document import Document
from odatoo.record import Record
class TestDocument(TestCase):
def setUp(self):
self.document = Document()
def tearDown(self):
try:
os.remove("test.xml")
... | {"/tests/test_document.py": ["/odatoo/document.py", "/odatoo/record.py"], "/tests/test_record.py": ["/odatoo/record.py", "/odatoo/field.py", "/odatoo/errors.py"], "/tests/test_field.py": ["/odatoo/field.py", "/odatoo/errors.py"]} |
88,194 | oondeo/odatoo | refs/heads/master | /odatoo/record.py | from xml.etree.ElementTree import SubElement
from field import Field
from errors import RecordValidationError
class Record(object):
def __init__(self, data, **kwargs):
self._validate(**kwargs)
self._element = SubElement(data, 'record', **kwargs)
@staticmethod
def _has_model(**kwargs):
... | {"/tests/test_document.py": ["/odatoo/document.py", "/odatoo/record.py"], "/tests/test_record.py": ["/odatoo/record.py", "/odatoo/field.py", "/odatoo/errors.py"], "/tests/test_field.py": ["/odatoo/field.py", "/odatoo/errors.py"]} |
88,195 | oondeo/odatoo | refs/heads/master | /tests/test_record.py | from unittest import TestCase
from xml.etree.ElementTree import Element
from mock import patch
from odatoo.record import Record
from odatoo.field import Field
from odatoo.errors import RecordValidationError
class TestRecord(TestCase):
def setUp(self):
self.data = Element('test_data')
@patch('odato... | {"/tests/test_document.py": ["/odatoo/document.py", "/odatoo/record.py"], "/tests/test_record.py": ["/odatoo/record.py", "/odatoo/field.py", "/odatoo/errors.py"], "/tests/test_field.py": ["/odatoo/field.py", "/odatoo/errors.py"]} |
88,196 | oondeo/odatoo | refs/heads/master | /tests/test_field.py | from unittest import TestCase
from xml.etree.ElementTree import Element
from mock import patch
from odatoo.field import Field
from odatoo.errors import FieldValidationError
class TestField(TestCase):
def setUp(self):
self.record = Element('test_record')
@patch('odatoo.field.Field._validate')
d... | {"/tests/test_document.py": ["/odatoo/document.py", "/odatoo/record.py"], "/tests/test_record.py": ["/odatoo/record.py", "/odatoo/field.py", "/odatoo/errors.py"], "/tests/test_field.py": ["/odatoo/field.py", "/odatoo/errors.py"]} |
88,197 | oondeo/odatoo | refs/heads/master | /tests/__init__.py | __all__ = ['test_field', 'test_record', 'test_document']
| {"/tests/test_document.py": ["/odatoo/document.py", "/odatoo/record.py"], "/tests/test_record.py": ["/odatoo/record.py", "/odatoo/field.py", "/odatoo/errors.py"], "/tests/test_field.py": ["/odatoo/field.py", "/odatoo/errors.py"]} |
88,198 | oondeo/odatoo | refs/heads/master | /odatoo/errors.py | class ValidationError(Exception):
pass
class RecordValidationError(ValidationError):
pass
class FieldValidationError(ValidationError):
pass
| {"/tests/test_document.py": ["/odatoo/document.py", "/odatoo/record.py"], "/tests/test_record.py": ["/odatoo/record.py", "/odatoo/field.py", "/odatoo/errors.py"], "/tests/test_field.py": ["/odatoo/field.py", "/odatoo/errors.py"]} |
88,199 | oondeo/odatoo | refs/heads/master | /odatoo/field.py | from xml.etree.ElementTree import SubElement
from errors import FieldValidationError
class Field(object):
def __init__(self, record, **kwargs):
self._validate(**kwargs)
if 'value' in kwargs:
value = str(kwargs['value'])
del kwargs['value']
else:
value... | {"/tests/test_document.py": ["/odatoo/document.py", "/odatoo/record.py"], "/tests/test_record.py": ["/odatoo/record.py", "/odatoo/field.py", "/odatoo/errors.py"], "/tests/test_field.py": ["/odatoo/field.py", "/odatoo/errors.py"]} |
88,200 | oxygensu/BitMap | refs/heads/master | /main.py | import tkinter as tk
import os
import A429Label
window = tk.Tk()
window.title("Bit Map Test")
window.geometry("500x500")
btn = []
bits32 = A429Label.Union()
def draw():
for i in range(32):
b = tk.Button(window, text="Bit" + str(i+1) + ":0", command=lambda i=i: clickButton(i))
b.grid(row... | {"/main.py": ["/A429Label.py"]} |
88,201 | oxygensu/BitMap | refs/heads/master | /temp.py | from tkinter import *
BoardValue = ["-","-","-","-","-","-","-","-","-"]
window = Tk()
window.title("Noughts And Crosses")
window.geometry("10x200")
v = StringVar()
Label(window, textvariable=v,pady=10).pack()
v.set("Noughts And Crosses")
btn=[]
class BoardButton():
def __init__(self,row_frame,b... | {"/main.py": ["/A429Label.py"]} |
88,202 | oxygensu/BitMap | refs/heads/master | /A429Label.py | import ctypes
c_uint32 = ctypes.c_uint32
class A429_label(ctypes.LittleEndianStructure):
_fields_ = [
("bit1", c_uint32, 1),
("bit2", c_uint32, 1),
("bit3", c_uint32, 1),
("bit4", c_uint32, 1),
("bit5", c_uint32, 1),
("bit6", c_uint32, 1),
("bit7... | {"/main.py": ["/A429Label.py"]} |
88,268 | mecirt/cloudly | refs/heads/master | /userprofile/views.py | # -*- coding: utf-8 -*-
import os
import time
import logging
import unicodedata
import string, pickle
from random import choice
from django.shortcuts import render_to_response
from django.http import HttpResponseRedirect
from django.template import RequestContext
from django.utils.translation import ugettext_lazy as... | {"/cloudly/templatetags/cloud_extras.py": ["/cloud_software/models.py"], "/cloud_storage/forms.py": ["/cloud_storage/models.py"], "/support/models.py": ["/invoices/models.py"]} |
88,269 | mecirt/cloudly | refs/heads/master | /private_storage/views.py | # -*- coding: utf-8 -*-
import os
import time
import pickle
import logging
import datetime
from django.shortcuts import render_to_response
from django.http import HttpResponseRedirect
from django.template import RequestContext
from django.http import HttpResponseForbidden
from django.http import HttpResponse, HttpRe... | {"/cloudly/templatetags/cloud_extras.py": ["/cloud_software/models.py"], "/cloud_storage/forms.py": ["/cloud_storage/models.py"], "/support/models.py": ["/invoices/models.py"]} |
88,270 | mecirt/cloudly | refs/heads/master | /private_servers/views.py | # -*- coding: utf-8 -*-
import os
import time
import pickle
import logging
import datetime
import socket
from django.shortcuts import render_to_response
from django.http import HttpResponseRedirect
from django.template import RequestContext
from django.http import HttpResponseForbidden
from django.http import HttpRe... | {"/cloudly/templatetags/cloud_extras.py": ["/cloud_software/models.py"], "/cloud_storage/forms.py": ["/cloud_storage/models.py"], "/support/models.py": ["/invoices/models.py"]} |
88,271 | mecirt/cloudly | refs/heads/master | /devel/views.py | # -*- coding: utf-8 -*-
import os
import time
import pickle
import logging
import datetime
from pprint import pprint
from django.shortcuts import render_to_response
from django.http import HttpResponseRedirect
from django.template import RequestContext
from django.http import HttpResponseForbidden
from django.http ... | {"/cloudly/templatetags/cloud_extras.py": ["/cloud_software/models.py"], "/cloud_storage/forms.py": ["/cloud_storage/models.py"], "/support/models.py": ["/invoices/models.py"]} |
88,272 | mecirt/cloudly | refs/heads/master | /cloudly/templatetags/cloud_extras.py | import time
import datetime
from django import template
register = template.Library()
from django.contrib.auth.models import User
from userprofile.models import Profile as userprofile
import pymongo
from pymongo import MongoClient
from pymongo import ASCENDING, DESCENDING
client = MongoClient('localhost', 27017)
mo... | {"/cloudly/templatetags/cloud_extras.py": ["/cloud_software/models.py"], "/cloud_storage/forms.py": ["/cloud_storage/models.py"], "/support/models.py": ["/invoices/models.py"]} |
88,273 | mecirt/cloudly | refs/heads/master | /cloudly/urls.py | from django.conf.urls import patterns, include, url
from django.conf import settings
urlpatterns = patterns('',
# common views
url(r'^$', 'dashboard.views.home', name='home'),
url(r'^welcome/$', 'dashboard.views.welcome', name='welcome'),
url(r'^help/$', 'dashboard.views.help', name='help'),
# decommissioned url... | {"/cloudly/templatetags/cloud_extras.py": ["/cloud_software/models.py"], "/cloud_storage/forms.py": ["/cloud_storage/models.py"], "/support/models.py": ["/invoices/models.py"]} |
88,274 | mecirt/cloudly | refs/heads/master | /cloud_storage/forms.py | from django import forms
from cloud_storage.models import Files
class UploadFileForm(forms.ModelForm):
class Meta:
model = Files
| {"/cloudly/templatetags/cloud_extras.py": ["/cloud_software/models.py"], "/cloud_storage/forms.py": ["/cloud_storage/models.py"], "/support/models.py": ["/invoices/models.py"]} |
88,275 | mecirt/cloudly | refs/heads/master | /cloud_storage/models.py | from django.db import models
from django.contrib.auth.models import User
from django.conf import settings
class Files(models.Model):
file = models.FileField(upload_to='%Y/%m/%d/%H:%M:%S')
class Uploaded_Files(models.Model):
user = models.ForeignKey(User)
file = models.ForeignKey(Files)
name = models.CharFiel... | {"/cloudly/templatetags/cloud_extras.py": ["/cloud_software/models.py"], "/cloud_storage/forms.py": ["/cloud_storage/models.py"], "/support/models.py": ["/invoices/models.py"]} |
88,276 | mecirt/cloudly | refs/heads/master | /api.py | #!flask/bin/python
import os
import sys
import datetime
from flask import Flask, jsonify, abort
from flask import render_template, request, url_for
app = Flask(__name__)
import pymongo
from pymongo import MongoClient
from pymongo import ASCENDING, DESCENDING
client = MongoClient('localhost', 27017)
mongo = client.... | {"/cloudly/templatetags/cloud_extras.py": ["/cloud_software/models.py"], "/cloud_storage/forms.py": ["/cloud_storage/models.py"], "/support/models.py": ["/invoices/models.py"]} |
88,277 | mecirt/cloudly | refs/heads/master | /private_photos/views.py | # -*- coding: utf-8 -*-
import os
import time
import pickle
import logging
import datetime
from pprint import pprint
from django.shortcuts import render_to_response
from django.http import HttpResponseRedirect
from django.template import RequestContext
from django.http import HttpResponseForbidden
from django.http ... | {"/cloudly/templatetags/cloud_extras.py": ["/cloud_software/models.py"], "/cloud_storage/forms.py": ["/cloud_storage/models.py"], "/support/models.py": ["/invoices/models.py"]} |
88,278 | mecirt/cloudly | refs/heads/master | /dashboard/views.py | # -*- coding: utf-8 -*-
import os
import time
import pickle
import logging
import datetime
from pprint import pprint
from django.shortcuts import render_to_response
from django.http import HttpResponseRedirect
from django.template import RequestContext
from django.http import HttpResponseForbidden
from django.http ... | {"/cloudly/templatetags/cloud_extras.py": ["/cloud_software/models.py"], "/cloud_storage/forms.py": ["/cloud_storage/models.py"], "/support/models.py": ["/invoices/models.py"]} |
88,279 | mecirt/cloudly | refs/heads/master | /cloud_photos/views.py | # -*- coding: utf-8 -*-
import os
import time
import pickle
import logging
import datetime
from pprint import pprint
from django.shortcuts import render_to_response
from django.http import HttpResponseRedirect
from django.template import RequestContext
from django.http import HttpResponseForbidden
from django.http ... | {"/cloudly/templatetags/cloud_extras.py": ["/cloud_software/models.py"], "/cloud_storage/forms.py": ["/cloud_storage/models.py"], "/support/models.py": ["/invoices/models.py"]} |
88,280 | mecirt/cloudly | refs/heads/master | /admin/views.py | # -*- coding: utf-8 -*-
import os
import time
import pickle
import logging
import datetime
from django.shortcuts import render_to_response
from django.http import HttpResponseRedirect
from django.template import RequestContext
from django.http import HttpResponseForbidden
from django.http import HttpResponse, HttpRe... | {"/cloudly/templatetags/cloud_extras.py": ["/cloud_software/models.py"], "/cloud_storage/forms.py": ["/cloud_storage/models.py"], "/support/models.py": ["/invoices/models.py"]} |
88,281 | mecirt/cloudly | refs/heads/master | /logs/views.py | # -*- coding: utf-8 -*-
import os
import time
import pickle
import logging
import datetime
from django.shortcuts import render_to_response
from django.http import HttpResponseRedirect
from django.template import RequestContext
from django.http import HttpResponseForbidden
from django.http import HttpResponse, HttpRe... | {"/cloudly/templatetags/cloud_extras.py": ["/cloud_software/models.py"], "/cloud_storage/forms.py": ["/cloud_storage/models.py"], "/support/models.py": ["/invoices/models.py"]} |
88,282 | mecirt/cloudly | refs/heads/master | /cloud_software/views.py | # -*- coding: utf-8 -*-
import os
import time
import pickle
import logging
import datetime
from django.shortcuts import render_to_response
from django.http import HttpResponseRedirect
from django.template import RequestContext
from django.http import HttpResponseForbidden
from django.http import HttpResponse, HttpRe... | {"/cloudly/templatetags/cloud_extras.py": ["/cloud_software/models.py"], "/cloud_storage/forms.py": ["/cloud_storage/models.py"], "/support/models.py": ["/invoices/models.py"]} |
88,283 | mecirt/cloudly | refs/heads/master | /support/models.py | import base64
from django.db import models
from django.contrib.auth.models import User
from django.conf import settings
try:
import cPickle as pickle
except:
import pickle
from invoices.models import Invoice
class SerializedDataField(models.TextField):
__metaclass__ = models.SubfieldBase
def to_python(self, v... | {"/cloudly/templatetags/cloud_extras.py": ["/cloud_software/models.py"], "/cloud_storage/forms.py": ["/cloud_storage/models.py"], "/support/models.py": ["/invoices/models.py"]} |
88,284 | mecirt/cloudly | refs/heads/master | /cloud_storage/views.py | # -*- coding: utf-8 -*-
import os
import time
import pickle
import logging
import datetime
from pprint import pprint
from django.shortcuts import render_to_response
from django.http import HttpResponseRedirect
from django.template import RequestContext
from django.http import HttpResponseForbidden
from django.http ... | {"/cloudly/templatetags/cloud_extras.py": ["/cloud_software/models.py"], "/cloud_storage/forms.py": ["/cloud_storage/models.py"], "/support/models.py": ["/invoices/models.py"]} |
88,285 | mecirt/cloudly | refs/heads/master | /invoices/models.py | from django.db import models
from django.contrib.auth.models import User
from django.conf import settings
class Invoice(models.Model):
user = models.ForeignKey(User)
product = models.CharField(max_length=100,default='', verbose_name="products")
items = models.CharField(max_length=300,default='', verbose_name="ite... | {"/cloudly/templatetags/cloud_extras.py": ["/cloud_software/models.py"], "/cloud_storage/forms.py": ["/cloud_storage/models.py"], "/support/models.py": ["/invoices/models.py"]} |
88,286 | mecirt/cloudly | refs/heads/master | /invoices/views.py | # -*- coding: utf-8 -*-
import os
import time
import pickle
import logging
import datetime
from django.shortcuts import render_to_response
from django.http import HttpResponseRedirect
from django.template import RequestContext
from django.http import HttpResponseForbidden
from django.http import HttpResponse, HttpRe... | {"/cloudly/templatetags/cloud_extras.py": ["/cloud_software/models.py"], "/cloud_storage/forms.py": ["/cloud_storage/models.py"], "/support/models.py": ["/invoices/models.py"]} |
88,287 | mecirt/cloudly | refs/heads/master | /agent.py | # -*- coding: utf-8
#!/usr/bin/env python
import os
import sys
import re
import time
import datetime
import platform
import base64, pickle
import json
import urllib2
import requests
import subprocess
AGENT_VERSION = "0.1"
SECRET = "588-R2G9-13809"
API_SERVER = "127.0.0.1:5000"
HWADDR = subprocess.Popen(["ifconfig"... | {"/cloudly/templatetags/cloud_extras.py": ["/cloud_software/models.py"], "/cloud_storage/forms.py": ["/cloud_storage/models.py"], "/support/models.py": ["/invoices/models.py"]} |
88,288 | mecirt/cloudly | refs/heads/master | /cloud_software/models.py | from django.db import models
from django.contrib.auth.models import User
import base64
try:
import cPickle as pickle
except:
import pickle
class SerializedDataField(models.TextField):
__metaclass__ = models.SubfieldBase
def to_python(self, value):
if value is None: return
if not isinstance(value, basestri... | {"/cloudly/templatetags/cloud_extras.py": ["/cloud_software/models.py"], "/cloud_storage/forms.py": ["/cloud_storage/models.py"], "/support/models.py": ["/invoices/models.py"]} |
88,289 | mecirt/cloudly | refs/heads/master | /support/views.py | # -*- coding: utf-8 -*-
import os
import time
import pickle
import logging
import datetime
from django.shortcuts import render_to_response
from django.http import HttpResponseRedirect
from django.template import RequestContext
from django.http import HttpResponseForbidden
from django.http import HttpResponse, HttpRe... | {"/cloudly/templatetags/cloud_extras.py": ["/cloud_software/models.py"], "/cloud_storage/forms.py": ["/cloud_storage/models.py"], "/support/models.py": ["/invoices/models.py"]} |
88,290 | mecirt/cloudly | refs/heads/master | /amazon/ec2_funcs.py | # -*- coding: utf-8 -*-
import os
import time
import pickle
import logging
import datetime
logger = logging.getLogger(__name__)
import boto.ec2
import boto.ec2.cloudwatch
########################################################
## TODO expand these funcs with the Region parameter!!!!
##############################... | {"/cloudly/templatetags/cloud_extras.py": ["/cloud_software/models.py"], "/cloud_storage/forms.py": ["/cloud_storage/models.py"], "/support/models.py": ["/invoices/models.py"]} |
88,291 | mecirt/cloudly | refs/heads/master | /cloud_storage/short_url_generator.py | DEFAULT_ALPHABET = 'mn6j2c4rv8bpygw95z7hsdaetxuk3fq'
DEFAULT_BLOCK_SIZE = 24
MIN_LENGTH = 5
class UrlEncoder(object):
def __init__(self, alphabet=DEFAULT_ALPHABET, block_size=DEFAULT_BLOCK_SIZE):
self.alphabet = alphabet
self.block_size = block_size
self.mask = (1 << block_size) - 1
self.mapping = range(blo... | {"/cloudly/templatetags/cloud_extras.py": ["/cloud_software/models.py"], "/cloud_storage/forms.py": ["/cloud_storage/models.py"], "/support/models.py": ["/invoices/models.py"]} |
88,307 | CarterKekoa/RegressionAndKnnClassifier | refs/heads/master | /mysklearn/myclassifiers.py | import mysklearn.myutils as myutils
class MySimpleLinearRegressor:
"""Represents a simple linear regressor.
Attributes:
slope(float): m in the equation y = mx + b
intercept(float): b in the equation y = mx + b
Notes:
Loosely based on sklearn's LinearRegression: https://scikit-lear... | {"/mysklearn/myclassifiers.py": ["/mysklearn/myutils.py"], "/test_myclassifiers.py": ["/mysklearn/myclassifiers.py"]} |
88,308 | CarterKekoa/RegressionAndKnnClassifier | refs/heads/master | /jupyter_utils.py | import random
from tabulate import tabulate
def get_rand_rows(table, num_rows):
"""This function will randomize the rows
"""
rand_rows = []
for i in range(num_rows):
rand_rows.append(table.data[random.randint(0,len(table.data))-1])
return rand_rows
def get_rating(mpg):
if mpg < 14:
... | {"/mysklearn/myclassifiers.py": ["/mysklearn/myutils.py"], "/test_myclassifiers.py": ["/mysklearn/myclassifiers.py"]} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.