code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
"""
Local settings
- Run in Debug mode
- Use console backend for emails
- Add Django Debug Toolbar
"""
import socket
import os
from .common import * # noqa
# DEBUG
# ------------------------------------------------------------------------------
DEBUG = env.bool('DJANGO_DEBUG', default=True)
TEMPLATES[0]['OPTIONS']... | pyshopml/jobs-backend | config/settings/local.py | Python | mit | 1,866 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'Carrier.key'
db.alter_column(u'carriers_carrier', 'key', self.gf('django.db.models.fields... | nyaruka/sigtrac | sigtrac/carriers/migrations/0004_auto__chg_field_carrier_key__chg_field_carrier_slug.py | Python | mit | 5,232 |
from flask import Flask, request, session, g, redirect, url_for, \
abort, render_template, flash
import serial
app = Flask(__name__)
app.config.from_object(__name__)
ser = serial.Serial('/dev/ttyACM1', 9600)
@app.route('/')
def index_page():
return render_template('index.html', title='Pick To Part')
@app.rou... | lohhenzo/SerialPTP | server.py | Python | mit | 1,066 |
from flask_wtf import FlaskForm
from wtforms import StringField, TextAreaField, SelectField
from wtforms.validators import DataRequired
class ContactLoginForm(FlaskForm):
name = StringField(label='name_', validators=[DataRequired()])
email = StringField('email_', validators=[DataRequired()])
message = Te... | i2nes/app-engine-blog | app/main/forms.py | Python | mit | 344 |
import tornado.ioloop
import tornado.web
from json import loads, JSONEncoder, JSONDecoder
import json
import MySQLdb
import pickle
import jsonpickle
class StateHandler(tornado.web.RequestHandler):
def all_states(self):
state_list = {}
state_list['status_code'] = 200
state_list['status_text'] = "Success"
sta... | Mitali-Sodhi/CodeLingo | Dataset/python/literacy.py | Python | mit | 17,705 |
from functools import reduce
import asyncio_mongo
from asyncio_mongo import _pymongo
from asyncio_mongo import exceptions
from asyncio_mongo import filter as qf
from wdim.orm import sort
from wdim.orm import query
from wdim.orm import exceptions
from wdim.orm.database.base import DatabaseLayer
from wdim.orm.database.... | chrisseto/Still | wdim/orm/database/mongo.py | Python | mit | 3,132 |
class Solution(object):
def firstMissingPositive(self, nums):
n, i = len(nums), 0
while i < n:
if nums[i] != i + 1 and 1 <= nums[i] <= n and nums[i] != nums[nums[i] - 1]:
tmp = nums[i] - 1
nums[i], nums[tmp] = nums[tmp], nums[i]
else:
... | luosch/leetcode | python/First Missing Positive.py | Python | mit | 444 |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | Azure/azure-sdk-for-python | sdk/storage/azure-storage-file-share/tests/perfstress_tests/T1_legacy_tests/download_to_file.py | Python | mit | 1,496 |
import os
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(here, 'README.rst')).read()
CHANGES = open(os.path.join(here, 'CHANGES.rst')).read()
setup(
name='socketIO-client',
version='0.5.6',
description='A socket.io client library'... | drewhutchison/socketIO-client | setup.py | Python | mit | 969 |
"""Miscellaneous buffer objects.
@author: Stephan Wenger
@date: 2012-02-29
"""
import glitter.raw as _gl
from glitter.arrays.basebuffer import BaseBuffer
class AtomicCounterBuffer(BaseBuffer):
_binding = "atomic_counter_buffer_binding"
_target = _gl.GL_ATOMIC_COUNTER_BUFFER
class CopyReadBuffer(BaseBuffer):... | swenger/glitter | glitter/arrays/misc.py | Python | mit | 1,485 |
import cherrypy
import logging
from . import utils
logger = logging.getLogger(__name__)
class Page:
def __init__(self, rsyncs, config):
self._rsyncs = rsyncs
self._config = config
@utils.json_exposed
def list(self, *args):
if len(args) == 0:
return [key for key, _ in... | arthurdarcet/harmopy | harmopy/webui/browser.py | Python | mit | 558 |
import sys
import requests
import xml.etree.ElementTree as ET
import constantcontact as cc
import google
from credentials import app_key, user_key, corp_id, report_id, email
from credentials import general_list_id, members_list_id
from time import sleep
# Agile API parameters.
base_url = 'https://prod3.agileticketing.... | deadlyraptor/reels | deprecated/member.py | Python | mit | 2,980 |
# -*- coding: utf-8 -*-
import time
import types
import os
import sys
import locale
import platform
import inspect
reload(sys)
sys.setdefaultencoding('utf-8') #IGNORE:E1101
locale.setlocale(locale.LC_ALL, "")
def gen_file(fname, data):
'''
Éú³ÉÎļþ
@param module_name: Ä£°åÃû³Æ
@param data: Êý¾Ý£¬ÒÔli... | winecat/game_server | path.py | Python | mit | 1,815 |
from builtins import range, zip
import numpy as np
import scipy.ndimage as nd
import peri
from peri import initializers
from peri.util import Tile
import peri.opt.optimize as opt
from peri.logger import log
CLOG = log.getChild('addsub')
def feature_guess(st, rad, invert='guess', minmass=None, use_tp=False,
... | peri-source/peri | peri/opt/addsubtract.py | Python | mit | 37,737 |
#!/usr/bin/env python
# This code was adapted from code written by John Montgomery
# in his inspiring 2007 post on Monkey Patching
# http://www.psychicorigami.com/2007/09/20/monkey-patching-pythons-smtp-lib-for-unit-testing/
# monkey-patch smtplib so we don't send actual emails
import smtplib
inbox=[]
class Messag... | nbryans/notipymail | testutil.py | Python | mit | 1,167 |
# -*- coding: utf-8 -*-
import random
import uuid
from unittest import TestCase
from faker import Faker
from rwslib.builders.admindata import Location
from rwslib.builders.constants import QueryStatusType
from rwslib.builders.clinicaldata import ClinicalData, FormData, ItemData, ItemGroupData, MdsolQuery, StudyEvent... | mdsol/rwslib | rwslib/tests/test_builders_mdsol_modm.py | Python | mit | 24,293 |
import _plotly_utils.basevalidators
class TickmodeValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="tickmode", parent_name="parcoords.line.colorbar", **kwargs
):
super(TickmodeValidator, self).__init__(
plotly_name=plotly_name,
... | plotly/python-api | packages/python/plotly/plotly/validators/parcoords/line/colorbar/_tickmode.py | Python | mit | 612 |
import asyncio
from urllib.error import URLError
from urllib.request import urlopen
__version__ = "1.0.0"
VERSION = __version__.split('.')
def printed(obj):
if hasattr(obj, 'first_name'):
return "{} {}".format(obj.first_name, obj.last_name)
elif hasattr(obj, 'title'):
return obj.title
ret... | RedXBeard/pygram | pygram/__init__.py | Python | mit | 688 |
import webcam
import unittest
import json
class WebcamTestCase(unittest.TestCase):
def setUp(self):
webcam.app.config['TESTING'] = True
self.app = webcam.app.test_client()
def test_hello_world(self):
rv = self.app.get('/')
assert 'Video Streaming Demonstration' in rv.data
... | MADSFEUP/Webcam | webcam_test.py | Python | mit | 903 |
#make print in python 2, 3 compatible
from __future__ import print_function
import numpy as np
import pyedda as edda
from scipy import misc
#JointHistogram
print("Testing code for JointHistogram with an image example...")
print("This testing code requires the scipy package!")
im = misc.imread("../sample_data/test_i... | subhashis/edda | pyEdda/test_joint_histogram.py | Python | mit | 3,115 |
"""
http://community.topcoder.com/stat?c=problem_statement&pm=4540
Single Round Match 147 Round 1 - Division I, Level Three
"""
class Flags:
def numStripes(self, numFlags, forbidden):
numFlags = int(numFlags)
numColors = len(forbidden)
check = [[True] * numColors for _ in range(numColors)... | warmsea/tc-srm | srm147/Flags.py | Python | mit | 1,165 |
import os
from pyven.logging.logger import Logger
import pyven.constants
from pyven.exceptions.parser_exception import ParserException
from pyven.checkers.checker import Checker
from pyven.plugins.manager import PluginsManager
from pyven.parser.constants_parser import ConstantsParser
from pyven.parser.directory_rep... | mgaborit/pyven | source/pyven/parser/pym_parser.py | Python | mit | 6,599 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-04-26 17:53
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('samples', '0008_patientregister_observed_symptoms'),
]
... | gcrsaldanha/fiocruz | samples/migrations/0009_auto_20170426_1453.py | Python | mit | 2,022 |
import datetime
from django.template import loader
from django.shortcuts import render
from django_slack_oauth.models import SlackOAuthRequest
from texaslan.events.models import Event
# Create your views here.
def home_feed(request):
now = datetime.datetime.now()
now = now.replace(hour=0, minute=0, second=... | TexasLAN/texaslan.org | texaslan/home/views.py | Python | mit | 1,281 |
"""
Tests that exercise the LLDB backend directly by loading an inferior and then
poking at it with the LLDBAdaptor class.
Tests:
LLDBAdaptor
"""
import tempfile
import sys
import json
import time
import logging
import subprocess
import threading
from mock import Mock
from nose.tools import *
import voltron
from vo... | snare/voltron | tests/lldb_api_tests.py | Python | mit | 4,820 |
from django.db import models
# Create your models here.
class Uploader(models.Model):
auto_increment_id = models.AutoField(primary_key=True)
original_filename = models.CharField(max_length=1024)
secret = models.BooleanField(default=False)
secret_key = models.CharField(max_length=1024, null=True)
... | paihu/moebox | models.py | Python | mit | 1,173 |
import tensorflow as tf
import numpy as np
import utility
class Memory:
def __init__(self, words_num=256, word_size=64, read_heads=4, batch_size=1):
"""
constructs a memory matrix with read heads and a write head as described
in the DNC paper
http://www.nature.com/nature/journal/va... | nazoking/DNC-tensorflow | dnc/memory.py | Python | mit | 14,097 |
"""
@file
@breif shortcuts to win_installer
"""
from .pywin32_helper import import_pywin32, fix_pywin32_installation
from .win_exception import WinInstallException
from .win_extract import extract_msi, extract_exe
from .win_setup_r import r_run_script
from .win_setup_main import win_python_setup
from .win_innosetup_he... | sdpython/pymyinstall | src/pymyinstall/win_installer/__init__.py | Python | mit | 555 |
from django.conf.urls import url
from .views import (login_view, register_view, logout_view, confirm_email)
urlpatterns = [
url(r'^confirm_email/(?P<token>[\w.-]+)/$', confirm_email, name='confirm_email'),
url(r'^register/$', register_view, name='register'),
url(r'^login/$', login_view, name='login'),
url(r... | aminhp93/learning_python | src/accounts/urls.py | Python | mit | 363 |
r"""
This is a port of zend-config to Python
Some idioms of PHP are still employed, but where possible I have Pythonized it
IGNORE:
Author: Asher Wolfstein Copyright 2017
Blog: http://wunk.me/
E-Mail: asherwunk@gmail.com
Twitter: https://twitter.com/asherwolfstein Send Me Some Love!
Package Homepa... | asherwunk/objconfig | objconfig/config.py | Python | mit | 12,671 |
class Node:
def __init__(self, val):
self.val = val
self.left = None
self.right = None
# longest path from root to leaf should be the height
def height_of_tree(tree):
if not tree:
return 0
height_left = height_of_tree(tree.left)
height_right = height_of_tree(tree.right)
... | sayak1711/coding_solutions | coding-practice/Tree/height_of_binary_tree.py | Python | mit | 772 |
"""
homeassistant.components.tellstick_sensor
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Shows sensor values from tellstick sensors.
Possible config keys:
id of the sensor: Name the sensor with ID
135=Outside
only_named: Only show the named sensors
only_named=1
temperature_scale: The scale of the temperature value
temperatur... | andythigpen/home-assistant | homeassistant/components/tellstick_sensor.py | Python | mit | 4,338 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.apps import AppConfig
class HomepageConfig(AppConfig):
name = 'homepage'
| geomin/djangovpshosting | djangovpshosting/djangovpshosting/apps/homepage/apps.py | Python | mit | 156 |
"""
Provides supplementary functionality to simplify the coordination of tools'
user interfaces with separate state objects.
"""
class CallbackNotifier(object):
"""
Base class for an object that supports a number of events, allowing
callbacks to be registered with those events. Callbacks are executed when
... | awforsythe/melgui | state.py | Python | mit | 2,537 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | Azure/azure-sdk-for-python | sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2017_07_01/operations/_certificates_operations.py | Python | mit | 28,694 |
from pprint import pprint
from eveapimongo import MongoProvider
from pymongo.errors import BulkWriteError
print('Loading function')
def lambda_handler(event, context):
message = event['Records'][0]['Sns']['Message']
print("SNS Message: " + message)
if message == "pos-parsing-done":
PosDayJourna... | bahrmichael/eve-pos-taxer | functions/posDayJournalBuilder/posDayJournalBuilder.py | Python | mit | 2,769 |
import pickle, trivia
from config import *
import matplotlib.pyplot as pyplot
values=pickle.load(open( REPORT_FILE_FOLDER_NAME+PICKLE_FILENAME, "rb" ))
def plot_the_region(energy_value_range, dic_key):
pyplot.figure()
# plot_b=figure_b.add_subplot(111)
pyplot.ylabel('G(-3 eta|0)')
pyplot.xlabel('-3 eta... | dborzov/fredholm | fredholm/deamon.py | Python | mit | 4,655 |
from __future__ import unicode_literals
from .system import SystemCompleter
| lmregus/Portfolio | python/design_patterns/env/lib/python3.7/site-packages/prompt_toolkit/contrib/completers/__init__.py | Python | mit | 77 |
from django.apps import AppConfig
from django.db.models.signals import m2m_changed
def trainingrequest_m2m_changed(sender, **kwargs):
"""Signal receiver for TrainingRequest m2m_changed signal.
The purpose of this receiver is to react on `TrainingRequest.domains` and
`TrainingRequest.previous_involvement`... | pbanaszkiewicz/amy | amy/workshops/apps.py | Python | mit | 1,807 |
"""
The Plaid API
The Plaid REST API. Please see https://plaid.com/docs/api for more details. # noqa: E501
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from plaid.model_utils import ( # noqa: F401
ApiTypeError,
ModelComposed,
ModelNormal... | plaid/plaid-python | plaid/model/removed_transaction.py | Python | mit | 6,490 |
import string
class names_scores():
def __init__(self):
alphabet = string.ascii_lowercase
self.alpha_dict = dict()
for index, value in enumerate(alphabet, 1):
self.alpha_dict[value] = index
def read_file(self):
with open('../data/p022_names.txt', 'r') as f:... | higee/project_euler | 21-30/22.py | Python | mit | 942 |
__author__ = 'diana'
import logging
from dataset_manager.models import Video, Dataset
from django.db import models
from django_enumfield import enum
from jsonfield.fields import JSONField
from django.conf import settings
from emotion_annotator.enums import EmotionType
from arousal_modeler.utils import list_normalizati... | dumoulinj/ers | ers_backend/emotion_annotator/models.py | Python | mit | 2,727 |
import random
import time
from .MafiaPlayer import MafiaPlayer
from .MafiaAction import MafiaAction
from .MafiaRole import MafiaRole
from .Roles.rolelist import Roles
from .Items.itemlist import Items
from .MafiaSetup import MafiaSetup
from .Communication import CommunicationActions as CA
class MafiaBot:
DAWN = ... | LLCoolDave/MafiaBot | MafiaBot/MafiaBot.py | Python | mit | 30,070 |
# -*- coding: utf-8 -*-
import serial
import sys
from bottle import response,route,run
import os
try:
files = os.listdir('/dev')
for file in files:
if "tty.usbmodem" in file:
ser = serial.Serial('/dev/'+file,9600)
print file
except OSError as (errno,strerror):
if errno == 2... | usopyon/bottle_serial | bottle_serial.py | Python | mit | 966 |
import PolyLibScan.Tools.polymer2lmp as poly
import PolyLibScan.Tools.lmp_helpers as helpers
from PolyLibScan.Tools.environment import Environment
import numpy as np
import pathlib2 as pl
import mock
import unittest as ut
local_path = pl.Path(__file__).absolute().parent
class TestLmpObject(ut.TestCase):
def __i... | luminescence/PolyLibScan | Tools/test/test_lmpObj.py | Python | mit | 3,729 |
from discord.ext import commands
from bank import Bank
import discord
import sqlite3
import secrets
def is_admin(ctx):
roles = ctx.message.author.roles
for role in secrets.ADMIN_ROLES:
if role in roles:
return True
return False
class Colors:
def __init__(self, yeebot):
... | jaspric/YeeBot | cogs/colors.py | Python | mit | 6,007 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import logging
import datetime
import psycopg2
import psycopg2.extras
__author__ = u'Stephan Müller'
__copyright__ = u'2017, Stephan Müller'
__license__ = u'MIT'
logger = logging.getLogger(__name__)
_data_types = {
bytes: "bytea",
float: "real",
int: "b... | smueller18/solar-thermal-climate-system | consumer/postgres/postgres.py | Python | mit | 3,986 |
# 结合range()和len()函数以遍历一个序列的索引
a = ['Mary', 'had', 'a', 'little', 'lamb']
for i in range(len(a)):
print (i ,a[i]) | darkless456/Python | 序列索引.py | Python | mit | 144 |
#!/usr/bin/env python
import argparse
from isochrones.cluster import StarClusterModel, simulate_cluster
from isochrones import get_ichrone
from isochrones.priors import FehPrior, FlatLogPrior
try:
from mpi4py import MPI
comm = MPI.COMM_WORLD
rank = comm.Get_rank()
except ImportError:
rank = 0
parse... | timothydmorton/isochrones | scripts/test-clusterfit.py | Python | mit | 2,230 |
from distutils.core import setup
setup(name='txtraits',
author='Andrew Straw',
url='http://github.com/astraw/txtraits',
version='0.0.1',
py_modules=['txtraits'],
license='MIT',
)
| astraw/txtraits | setup.py | Python | mit | 216 |
import os
import pytest
import yaml
from eniric import DEFAULT_CONFIG_FILE, config
from eniric._config import Config
base_dir = os.path.dirname(__file__)
test_filename = os.path.join(base_dir, "data", "test_config.yaml")
class TestConfig:
@pytest.fixture
def test_config(self):
"""Config file for te... | jason-neal/eniric | tests/test_config.py | Python | mit | 7,113 |
# flake8: noqa
from pygls.lsp.types.language_features.code_action import *
from pygls.lsp.types.language_features.code_lens import *
from pygls.lsp.types.language_features.color_presentation import *
from pygls.lsp.types.language_features.completion import *
from pygls.lsp.types.language_features.declaration import *
f... | glenngillen/dotfiles | .vscode/extensions/ms-python.python-2021.5.842923320/pythonFiles/lib/jedilsp/pygls/lsp/types/language_features/__init__.py | Python | mit | 1,372 |
from .base import *
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'docs',
'USER': 'postgres', # Not used with sqlite3.
'PASSWORD': '',
'HOST': '10.177.73.97',
'PORT': '',
}
}
DEBUG = False
TEMPLATE_DE... | alex/readthedocs.org | readthedocs/settings/postgres.py | Python | mit | 691 |
class WiiStringTableBuilder(object):
def __init__(self):
self.nextOffset = 0
self.data = ''
self.lookup = {}
def add(self, string):
if string in self.lookup:
return self.lookup[string]
offset = self.nextOffset
self.lookup[string] = offset
self.data = "%s%s\0" % (self.data, string.encode('Shift-... | Treeki/NewerSMBW | Koopatlas/src/wii/common.py | Python | mit | 521 |
# -*- coding: utf-8 -*-
def get_arn(obj, value):
return "arn:aws:iam::123456789012:{obj}/{value}".format(
obj=obj,
value=value
)
def get_value_from_arn(arn):
return arn.split('/')[1]
| smarlowucf/mockboto3 | mockboto3/iam/utils.py | Python | mit | 215 |
__author__ = 'fahadadeel'
import jpype
import os.path
from WorkingWithDocumentConversion import PdfToSvg
asposeapispath = os.path.join(os.path.abspath("../../../"), "lib")
print "You need to put your Aspose.Words for Java APIs .jars in this folder:\n"+asposeapispath
jpype.startJVM(jpype.getDefaultJVMPath(),... | aspose-pdf/Aspose.Pdf-for-Java | Plugins/Aspose_Pdf_Java_for_Python/test/WorkingWithDocumentConversion/PdfToSvg/PdfToSvg.py | Python | mit | 412 |
import re
class StandardiserNoOutputException(Exception):
pass
def format_for_region(urn):
format = URN_FORMATTERS.get(urn[:2], URN_FORMATTERS["*"])
return format(standardise_urn(urn))
def standardise_postcode(postcode):
return re.sub(r"[\W_]+", "", postcode).upper()
def standardise_name(first_n... | ministryofjustice/manchester_traffic_offences_pleas | apps/plea/standardisers.py | Python | mit | 1,886 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('dashboard', '0003_page'),
]
operations = [
migrations.CreateModel(
name='SiteSetting',
fields=[
... | Ma233/beijingteach | dashboard/migrations/0004_sitesetting.py | Python | mit | 730 |
# -*- coding: utf-8 -*-
from django.db import models
class DemirBankPayment(models.Model):
account = models.CharField(max_length=255)
added = models.BooleanField(default=False)
processed_payment = models.BooleanField(default=False)
created_on = models.DateTimeField(auto_now_add=True, editable=False)
... | CyberLight/django-demirbank | demirbank/models.py | Python | mit | 2,124 |
"""A collection of classes for MusicBrainz.
To get started quickly, have a look at L{webservice.Query} and the examples
there. The source distribution also contains example code you might find
interesting.
This package contains the following modules:
1. L{model}: The MusicBrainz domain model, containing classes lik... | JustinTulloss/harmonize.fm | libs.py/musicbrainz2/__init__.py | Python | mit | 826 |
REGISTER_TEMP = 0
REGISTER_CONFIG = 1
EXTENDED_MODE_BIT = 0x10
def _set_bit(b, mask):
return b | mask
def _clear_bit(b, mask):
return b & ~mask
def _set_bit_for_boolean(b, mask, val):
if val:
return _set_bit(b, mask)
else:
return _clear_bit(b, mask)
class Tmp102(object):
def ... | khoulihan/micropython-tmp102 | tmp102/_tmp102.py | Python | mit | 3,432 |
"""
WSGI config for pantry project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTI... | tomp/food_pantry | pantry/wsgi.py | Python | mit | 390 |
CELERY_RESULT_BACKEND = "mongodb"
CELERY_MONGODB_BACKEND_SETTINGS = {
"host": "127.0.0.1",
"port": 27017,
"database": "celery",
"taskmeta_collection": "celery_taskmeta",
}
| Blaskyy/DevOps | port_scan/celery/celeryconfig.py | Python | mit | 212 |
"""attic URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/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-based... | SkySchermer/uweclang | django/src/attic/urls.py | Python | mit | 1,456 |
# -*- coding: utf-8 -*-
"""The app module, containing the app factory function."""
from flask import Flask
from application.settings import ProdConfig
from application.extensions import (
db,
migrate,
api_scaffold,
auth,
)
from application import (
misc_blueprint,
pages_blueprint,
kv_bluepr... | opyate/gnashboard | application/app.py | Python | mit | 1,052 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2015 John Dewey
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# t... | retr0h/aletheia | aletheia/models/interface.py | Python | mit | 1,404 |
#!/usr/bin/env python
import rospy
from std_msgs.msg import String, Float32
import time
import subprocess
def voltage_monitor():
rospy.init_node('voltage_monitor')
info_pub = rospy.Publisher('bus_comm', String, queue_size=1)
voltage_pub = rospy.Publisher('voltage', Float32, queue_size=1)
while True:... | DrClick/ARCRacing | ros_system_ws/src/vector79/scripts/voltage_monitor.py | Python | mit | 854 |
# -*- coding: utf-8 -*-
"""
Pontus
~~~~~~
:copyright: (c) 2014 by Vesa Uimonen.
:license: MIT, see LICENSE for more details.
"""
from .amazon_s3_file_validator import AmazonS3FileValidator # noqa
from .amazon_s3_signed_request import AmazonS3SignedRequest # noqa
__version__ = '4.0.0'
| fastmonkeys/pontus | pontus/__init__.py | Python | mit | 306 |
from autoencoder import *
from trainer import *
from algorithms import *
from deepautoencoder import *
| hunse/deepnet | deepnet/autoencoder/__init__.py | Python | mit | 103 |
from mio import runtime
from mio.utils import method
from mio.object import Object
class List(Object):
def __init__(self, value=[]):
super(List, self).__init__(value=value)
self.create_methods()
self.parent = runtime.find("Object")
def __hash__(self):
return None
def __... | prologic/mio | mio/types/list.py | Python | mit | 2,493 |
# -*- coding: utf-8 -*-
import sys
import os
if sys.version_info[0] == 2:
from urllib import urlretrieve
else:
from urllib.request import urlretrieve
DATA_DIR = os.path.join(os.path.expanduser('~'), 'datawarehouse')
if not os.path.isdir(DATA_DIR):
os.mkdir(DATA_DIR)
def get_data_dir():
return DATA_DI... | victor-estrade/datawarehouse | datawarehouse/download.py | Python | mit | 814 |
# -*- coding: utf-8 -*-
# Copyright (c) 2010-2017 Tuukka Turto
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy,... | tuturto/pyherc | src/pyherc/data/__init__.py | Python | mit | 2,927 |
'''
Match and split the re-weighted HI MSs
The 14B frequency range includes 2000 channels. That same range in the 17B
data is 2006 channels. So we first regrid and split the data over the same
velocity range. The original channels are -206 and
change m/s. Regrid to something common like -210 m/s.
UPDATE: The issue wit... | e-koch/VLA_Lband | 17B-162/HI/imaging/match_and_split.py | Python | mit | 13,849 |
from random import randrange
from django.utils.text import slugify
from random_words import RandomNicknames
from ..recipe import BaseRecipe
from ..models import Badge
from .models import BadgifyUser as User
class UserFixturesMixin(object):
"""
User fixtures mixin.
"""
def create_users(self):
... | ulule/django-badgify | badgify/tests/mixins.py | Python | mit | 2,251 |
from .base import Base
class Source(Base):
def __init__(self, nvim):
super(Source, self).__init__(nvim)
self.nvim = nvim
self.name = 'langserver'
self.mark = '[LSP]'
def on_event(self, context, filename=''):
pass
def gather_candidates(self, context):
use... | tjdevries/nvim-langserver-shim | rplugin/python3/deoplete/langserver.py | Python | mit | 544 |
import os
import unittest
from git_browse import github, godocs, typedefs
class TestGodocsHost(unittest.TestCase):
def setUp(self) -> None:
self.obj = godocs.GodocsHost(
typedefs.GitConfig('', 'master'),
'github.com',
'asdf/qwer',
)
self.obj.host_class ... | albertyw/git-browse | git_browse/tests/test_godocs.py | Python | mit | 2,069 |
import ply.lex as lex
import cpplex
from lexicon import Lexicon
class Format():
__operator = (
'PLUS', 'MINUS', 'TIMES', 'DIVIDE', 'MOD',
'OR', 'AND', 'NOT', 'XOR', 'LSHIFT', 'RSHIFT',
'LOR', 'LAND', 'LNOT',
'LT', 'LE', 'GT', 'GE', 'EQ', 'NE',
'EQUALS', '... | StarAndRabbit/cppfmt | cfmter/fmt.py | Python | mit | 3,321 |
"""Django settings for tests."""
import os
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
# Quick-start development settings - unsuitable for production
SECRET_KEY = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'
INTERNAL_IPS = ['127.0.0.1']
LOGGING_CONFIG = None # avoids spurious output in tests
# Applicati... | Dunstark/open_airline_manager | open_airline_manager/test_settings.py | Python | mit | 2,870 |
from django.db import models
from smokeyfeet.minishop.exceptions import StockOutError
from .cart import CartItem
class ProductQuerySet(models.QuerySet):
def in_stock(self):
return self.filter(num_in_stock__gt=0)
class Product(models.Model):
class Meta:
ordering = ["name"]
objects = Pr... | smokeyfeet/smokeyfeet-registration | src/smokeyfeet/minishop/models/product.py | Python | mit | 1,647 |
import nltk
import numpy as np
import pickle
from process_twt import *
class NBClassifier(object):
"""
A Naive Bayes Classifier for sentiment analysis
Attributes:
feature_list: A list containing informative words
stop_words: A list containing stop words
is_trained: An indicator of... | qingshuimonk/bhtsa | bhtsa/NBClassifier.py | Python | mit | 3,273 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 29 01:48:17 2017
@author: Aretas
"""
# Product library MD results to xslx
import re
import argparse
import os
import xlsxwriter
import collections
import csv
parser = argparse.ArgumentParser()
parser.add_argument('-f2', '--file2',
help='choose... | aretas2/High-throughput-molecular-docking | excel-py/xcl2.py | Python | mit | 7,185 |
"""
Multi-edit - Gedit plugin
Copyright (C) 2009 Jonathan Walsh
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any la... | icebreaker/dotfiles | gnome/gnome2/gedit/plugins.symlink/multi_edit/me_window.py | Python | mit | 32,639 |
#-*- coding: utf-8 -*-
# these tests are pretty bad, mostly to make sure no exceptions are thrown
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
import time
from riotwatcher import RiotWatcher, KOREA
import key
key = key.getAPIKey()
# if summoner doesnt have ranked teams, teams tests will fail
# if summoner... | dkim010/lolminer | tests.py | Python | mit | 3,536 |
from setuptools import setup, find_packages
long_description = """
DemonHunter is a framework to create a Honeypot network very simple and easy.
"""
requirements = [
"httptools==0.0.11",
"aiohttp==2.3.10",
"bcrypt==3.1.4",
"flask==0.12.2",
"flask-login==0.4.1",
"flask-sqlalchemy==2.3.2",
... | RevengeComing/DemonHunter | setup.py | Python | mit | 1,368 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
""" Sample script of recurrent neural network language model for generating text
This code is ported from following implementation.
https://github.com/longjie/chainer-char-rnn/blob/master/sample.py
"""
import time
import math
import sys
import argparse
import cPic... | SonyCSL/CSLAIER | examples/prediction/predict.py | Python | mit | 3,809 |
"""empty message
Revision ID: 289d26dc0608
Revises: 493da0c4802d
Create Date: 2015-03-21 16:13:04.071148
"""
# revision identifiers, used by Alembic.
revision = '289d26dc0608'
down_revision = '493da0c4802d'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - ... | timbueno/longboxed | migrations/versions/289d26dc0608_.py | Python | mit | 1,609 |
class BackendEngine(object):
def write_request(self, request):
raise NotImplemented
def read_request(self, request):
raise NotImplemented
| briancline/torque-satellite | satellite/backend/base.py | Python | mit | 163 |
import unittest
import os
import sys
if sys.version_info >= (3, 0):
def execfile(filepath):
with open(filepath) as f:
code = compile(f.read(), filepath, 'exec')
exec(code)
class TestHighcharts(unittest.TestCase):
"""Very simple test cases that run through examples and checks fo... | kyper-data/python-highcharts | tests/test_highcharts.py | Python | mit | 2,972 |
from PyQt4.QtGui import *
import sys
from ui import Ui_ChatWindow
from Server import *
from Client import *
from PyChatGUI import *
import sys_rc
class PyChatClient(QMainWindow, Ui_ChatWindow):
sendSignal = pyqtSignal(str)
def __init__(self, parent=None):
QMainWindow.__init__(self, parent)
... | xran-deex/PyChat | PyChatClient.py | Python | mit | 3,398 |
# -*- coding: iso-8859-1 -*-
# MARDS\doc.py
#
# DOCUMENTATION GENERATION
#
from rolne import rolne
from MARDS import st
# the breakdown_rolne contains instructions on how to "break down" the files used in the final docs.
#
def generate_rst_files(schema_rolne, breakdown_rolne, dest_dir, language="en"):
docs = {}
... | MakerReduxCorp/MARDS | MARDS/doc.py | Python | mit | 8,271 |
"""
The count-and-say sequence is the sequence of integers beginning as follows:
1, 11, 21, 1211, 111221, ...
1 is read off as "one 1" or 11.
11 is read off as "two 1s" or 21.
21 is read off as "one 2, then one 1" or 1211.
Given an integer n, generate the nth sequence.
Note: The sequence of integers will be repre... | ufjfeng/leetcode-jf-soln | python/038_count_and_say.py | Python | mit | 1,192 |
import json,urllib2,csv,time,smtplib,string,os
os.chdir('/home/ian/Documents')
# Buy and sell urls
sell_url = "https://coinbase.com/api/v1/sells"
buy_url = "https://coinbase.com/api/v1/buys"
sell_price_url = "https://coinbase.com/api/v1/prices/sell"
buy_price_url = "https://coinbase.com/api/v1/prices/buy"
headers = {... | ianrust/coinbase_autotrader | automated_bittrader.py | Python | mit | 4,459 |
import mimetypes
import os
from ..._misc import utils
from ... import _tl
class File:
"""
Convenience class over media like photos or documents, which
supports accessing the attributes in a more convenient way.
If any of the attributes are not present in the current media,
the properties will be... | LonamiWebs/Telethon | telethon/types/_custom/file.py | Python | mit | 3,625 |
#!/usr/bin/env python
#
# setup.py
#
"""
An extension providing a SASS CSS renderer for Growler web applications
"""
from setuptools import setup
from importlib.machinery import SourceFileLoader as Importer
metadata = Importer("metadata", "growler_sass/__meta__.py").load_module()
NAME = 'growler-sass'
REQUIRES = [
... | pyGrowler/growler-sass | setup.py | Python | mit | 1,361 |
"""
WSGI config for fp project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/
"""
from __future__ import unicode_literals
import os
from django.core.wsgi import get_wsgi_application
... | j7nn7k/www.flashpacker.io | fp/fp/wsgi.py | Python | mit | 421 |
# -*- coding: utf-8 -*-
import sys
sys.path.append('/notebooks')
import wave
import re
import struct
import glob
import params as par
from scipy import fromstring, int16
import numpy as np
import os.path
from keras.models import Sequential, load_model
from keras.layers import Dense, LSTM, Dropout
from keras.callbacks ... | niisan-tokyo/music_generator | src/conv1d/autoencode_test.py | Python | mit | 1,442 |
import clr
import System
from sys import argv
from optparse import OptionParser
clr.AddReference("System.Core")
from System import *
from System.Net import *
clr.ImportExtensions(Linq)
parser = OptionParser()
parser.add_option("-u", "--url", type="string", dest="url", help="URL to check")
parser.add_option("-t", "-... | Investars/IpyUtils | httprequest.py | Python | mit | 999 |
# This file is part of the Indico plugins.
# Copyright (C) 2002 - 2021 CERN
#
# The Indico plugins are free software; you can redistribute
# them and/or modify them under the terms of the MIT License;
# see the LICENSE file for more details.
from datetime import timedelta
from werkzeug.datastructures import Immutable... | ThiefMaster/indico-plugins | livesync/indico_livesync/util.py | Python | mit | 3,562 |
def application(environ, start_response):
start_response('200 OK', [('Content-Type', 'text/plain')])
return [b"hello python app!\n"] | thibaudbe/Vagrant-passenger-starter | src/python/passenger_wsgi.py | Python | mit | 134 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-09-14 20:44
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('NYRP', '0011_auto_20170914_1643'),
]
operations = [
migrations.AlterField(
... | WalterSchaertl/NYRP | NYRP/migrations/0012_auto_20170914_1644.py | Python | mit | 459 |