code stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 226 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k |
|---|---|---|---|---|---|
# elected_office/urls.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from django.conf.urls import url
from . import views_admin
urlpatterns = [
# views_admin
url(r'^$', views_admin.elected_office_list_view, name='elected_office_list', ),
url(r'^delete/$', views_admin.elected_office_dele... | jainanisha90/WeVoteServer | elected_office/urls.py | Python | mit | 1,030 |
"""
Django settings for web project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import... | kantale/MutationInfo | web/web/settings.py | Python | mit | 2,056 |
from __future__ import division
from libtbx.path import walk_source_tree
from libtbx.str_utils import show_string
from libtbx.utils import Sorry
from libtbx.option_parser import option_parser
from fnmatch import fnmatch
import re
import sys, os
def read_lines_if_possible(file_path):
try: f = open(file_path, "r")
e... | hickerson/bbn | fable/fable_sources/libtbx/command_line/find_files.py | Python | mit | 3,114 |
"""
Fiber-based fixed point location in the Lorenz system
f(v)[0] = s*(v[1]-v[0])
f(v)[1] = r*v[0] - v[1] - v[0]*v[2]
f(v)[2] = v[0]*v[1] - b*v[2]
Reference:
http://www.emba.uvm.edu/~jxyang/teaching/Math266notes13.pdf
https://en.wikipedia.org/wiki/Lorenz_system
"""
import numpy as np
import matplotlib.pyp... | garrettkatz/directional-fibers | dfibers/examples/lorenz.py | Python | mit | 3,181 |
# 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/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/_feature_client.py | Python | mit | 4,057 |
__author__ = 'McDaemon'
from models import Weather
from rest_framework import serializers
class WeatherSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Weather
fields = ('datum', 'stadt', 'anbieter', 'anbieter', 'wetter', 'tagestemperatur', 'einheit', 'kondition'... | Benxxen/pythonwetter | pythonwetter/serializers.py | Python | mit | 385 |
# -*- coding: utf-8 -*-
#-------------------------------------------------------------------------------
## Description
"""
Core program to exchange datas.
"""
#-------------------------------------------------------------------------------
import sys
sys.dont_write_bytecode = True
import os
import re
import hou
fr... | takavfx/Bento | python2.7libs/Bento/CacheManager/core.py | Python | mit | 5,069 |
# coding=utf-8
# ==============================================================================
"""Entrenamiento del modelo"""
# ==============================================================================
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function... | NicolasPresta/ReconoBook | reconobook_train.py | Python | mit | 5,180 |
def apple():
print "I AM APPLES!"
# this is just a variable
tangerine = "Living reflection of a dream."
| Valka7a/python-playground | python-the-hard-way/mystuff.py | Python | mit | 106 |
from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'blog.views.home', name='home'),
# url(r'^blog/', include('blog.foo.urls')),
# Uncomment th... | dstruthers/blog.darrenstruthers.net | urls.py | Python | mit | 544 |
from n5a import make_type
from n5a.generate import generate
from .test_definitions import get_pos3d_definition
def test_generate_string():
s = generate(get_pos3d_definition())
assert 'struct Pos3D' in s
def test_generate_file():
s = generate(get_pos3d_definition())
with open('test/test_cpp/generated/... | sschaetz/n5a | test/test_generate.py | Python | mit | 361 |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# Created on 2017-09-08 10:20:46
# Project: zqplant
from pymongo import MongoClient
import os
import sys
import urllib
reload(sys)
sys.setdefaultencoding('utf8')
class ZQplantImageCrawler(object):
def __init__(self):
self.image_path = '/Users/anmy/Downloa... | colddew/mix-python | crawler/ZQplantImageCrawler.py | Python | mit | 2,848 |
"""The tests for the Entity component helper."""
# pylint: disable=protected-access,too-many-public-methods
from collections import OrderedDict
import logging
import unittest
from unittest.mock import patch, Mock
import homeassistant.core as ha
import homeassistant.loader as loader
from homeassistant.helpers.entity im... | devdelay/home-assistant | tests/helpers/test_entity_component.py | Python | mit | 10,909 |
# Copyright (c) 2017 The sqlalchemy-bigquery Authors
#
# 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, modify, mer... | googleapis/python-bigquery-sqlalchemy | sqlalchemy_bigquery/base.py | Python | mit | 38,084 |
##########################################################################
#
# Copyright 2008-2009 VMware, Inc.
# All Rights Reserved.
#
# 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 withou... | xranby/apitrace | d3d8trace.py | Python | mit | 1,976 |
#!/usr/bin/env python
import googlehelper as gh
import json
import os
# DEFAULT_COURSE_ID = '7155852796' # Computer Programming A1
# DEFAULT_COURSE_ID = '7621825175' # Robotics
DEFAULT_COURSE_ID = '7557587733' # Computer Programming A4
if __name__ == '__main__':
# course = gh.get_course(DEFAULT_COURSE_ID)
... | HarrisonAlpine/google-classroom-tools | list_students.py | Python | mit | 1,063 |
# Copyright 2004 Roman Yakovenko.
# Distributed under the Boost Software License, Version 1.0. (See
# accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
import os
import types
import pprint
import warnings
from Synopsis import AST
from pygccxml import utils
from pygccxml.declarations ... | jgresula/jagpdf | code/tools/external/python/pygccxml/parser/synopsis_scanner.py | Python | mit | 1,649 |
import unittest
from pytextgame.geometry import Direction, Position, Rectangle
class TestGeometry(unittest.TestCase):
def setUp(self):
self.pos1 = Position(5, 0)
self.pos2 = Position(10, 0)
self.pos3 = Position(9, 3)
self.dir1 = Direction(1, 1)
self.dir2 = Direction(5, 0)... | theJollySin/pytextgame | test/geometry_test.py | Python | mit | 2,020 |
#!/usr/bin/env python
from __future__ import division, print_function, absolute_import
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
import numpy as np
config = Configuration('pywt', parent_package, top_path)
config.add_data_dir('tests')
... | Dapid/pywt | pywt/setup.py | Python | mit | 811 |
import os
import shutil
import unittest
from PySide.QtCore import QSettings
from ibl_stuff.libs import base as libs
LIBRARY = libs.get_library()
ENV_LIBRARY = os.environ.get("IBL_LIBRARY")
class SimpleTests(unittest.TestCase):
def test_clear_cache(self):
self.assertTrue(libs.clear_cache())
def t... | csaez/ibl_stuff | ibl_stuff/tests/test_libs.py | Python | mit | 2,944 |
def find_words(letters):
""" find_words from scrabble transformation to
recursive """
results = set()
for a in letters:
if a in WORDS: results.add(a)
if a not in PREFIXES: continue
for b in removed(letters, a):
w = a + b
if w in WORDS: results.add(w)
if w not in PREFIXES: continue
for c in remov... | feredean/cs313 | notes/test_recursivity-nope.py | Python | mit | 976 |
"""
In this module are placed functions related to preprocessing of data.
"""
from padasip.preprocess.standardize import standardize
from padasip.preprocess.standardize_back import standardize_back
from padasip.preprocess.input_from_history import input_from_history
from padasip.preprocess.pca import PCA, PCA_component... | matousc89/padasip | padasip/preprocess/__init__.py | Python | mit | 380 |
"""
Color beams pattern
"""
from .pattern import Pattern
import colorsys
import time
class ColorBeams(Pattern):
@staticmethod
def getHue(hue):
hsv = colorsys.hsv_to_rgb(hue, 1, 1)
return int(hsv[0] * 255), int(hsv[1] * 255), int(hsv[2] * 255)
@staticmethod
def highlight(strip, i, h... | Chris-Johnston/Internet-Xmas-Tree | lights/patterns/colorbeams.py | Python | mit | 1,268 |
from .hash_calculator import HashCalculator
from .dependency_resolver import resolve_dependencies, DependencyMissingException
| frictionlessdata/datapackage-pipelines | datapackage_pipelines/specs/hashers/__init__.py | Python | mit | 126 |
import lpd
import extra
import random
import os
import numpy as np
import matplotlib.pyplot as plt
import csv
"""
Main function of test python module
"""
def main():
random.seed(os.urandom(967)) # initialize random generator
t = np.linspace(0.0, 24.0, 96.0) # define the time axis of a day, here we use 96 value... | GiorgosMethe/Load-Profile-Decomposition | test.py | Python | mit | 2,560 |
# 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/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/aio/operations/_virtual_network_gateways_operations.py | Python | mit | 110,053 |
import unittest
from flip_bit_to_win import flip_bit
class TestFlipBit(unittest.TestCase):
def test_flip_bit(self):
self.assertEquals(flip_bit(0b1011100101), 4)
self.assertEquals(flip_bit(1775), 8)
if __name__ == '__main__':
unittest.main()
| heitorschueroff/ctci | ch5/5.03_Flip_Bit_To_Win/test_flip_bit_to_win.py | Python | mit | 269 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-06-08 20:56
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('quran', '0009_word_utextmin'),
('quranfal', '0002_auto... | doganmeh/quranfal | quranfal/migrations/0003_auto_20160608_2056.py | Python | mit | 1,430 |
# -*- coding: utf-8 -*-
"""A simple Python library for performing language identification
using an easy-to-understand n-gram based algorithm."""
from __future__ import division
from __future__ import print_function
import nltk
import json
import scipy
import regex
import unicodedata
from collections import Counter
f... | dmort27/pylid | pylid/__init__.py | Python | mit | 5,726 |
""" Simple Python class to access the Tesla JSON API
https://github.com/gglockner/teslajson
The Tesla JSON API is described at:
https://tesla-api.timdorr.com
Example:
import teslajson
c = teslajson.Connection('youremail', 'yourpassword')
v = c.vehicles[0]
v.wake_up()
v.data_request('charge_state')
v.command('charge_... | gglockner/teslajson | teslajson/teslajson.py | Python | mit | 7,625 |
from django.conf.urls import patterns, include, url
from inbound.views import *
urlpatterns = patterns('',
url(r'capture/lead/', AddVisitorToCRM.as_view()),
url(r'capture/session/', LogSession.as_view()),
url(r'capture/alignment/', LogAlignment.as_vi... | Digitalminion/api-django-inbound | inbound/urls.py | Python | mit | 351 |
# Copyright 2020 John Hanley.
#
# 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, modify, merge, publish, distribut... | jhanley634/testing-tools | problem/weblog/prefix/ip_addr.py | Python | mit | 5,425 |
from random import randint
from world import english_utils, rules
from evennia import TICKER_HANDLER as tickerhandler
from evennia.server.sessionhandler import SESSIONS
def attack(caller, target):
"Returns a random one-handed sword attack message."
d3 = randint(1,3)
if d3 == 1:
message... | whitehorse-io/encarnia | Encarnia/world/npc_rules.py | Python | mit | 3,566 |
# coding=utf-8
from __future__ import absolute_import
from .helper import utils
from .helper.routes import Routes
from totalvoice.cliente.api.totalvoice import Totalvoice
import json, requests
class Conta(Totalvoice):
def __init__(self, cliente):
super(Conta, self).__init__(cliente)
def criar_conta(... | totalvoice/totalvoice-python | totalvoice/cliente/api/conta.py | Python | mit | 6,794 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Parsing accident CSV files for Great Britain data and putting them into DB
"""
import csv
import sys
import db_api.accident
from parsing.common import get_timestamp, translate_field, to_float, to_int, map_from_dictionary, mph_to_kmph
from parsing.gb_common import get_acc_... | lopiola/integracja_wypadki | scripts/gb_accident_parser.py | Python | mit | 7,122 |
#!/usr/bin/env python
from setuptools import setup, find_packages
tests_requires = [
'ddt>=1.0.0'
]
dev_requires = [
'Sphinx==1.2.2',
]
install_requires = [
'pbr!=2.1.0',
'Babel!=2.4.0,>=2.3.4',
'cmd2<0.9.0', # TODO: Drop restriction after Waldur is migrated to Python 3.
'iptools>=0.6.1',
... | opennode/nodeconductor-openstack | setup.py | Python | mit | 1,602 |
"""Tests for input validation functions"""
import warnings
from itertools import product
from tempfile import NamedTemporaryFile
import numpy as np
import scipy.sparse as sp
from nose.tools import assert_raises, assert_true, assert_false, assert_equal
from numpy.testing import assert_array_equal
from sklearn.datasets... | DailyActie/Surrogate-Model | 01-codes/scikit-learn-master/sklearn/utils/tests/test_validation.py | Python | mit | 18,596 |
import argparse
import numpy as np
import pickle
import time
import jsbeautifier
from pygments.lexers.javascript import JavascriptLexer
from pygments.token import Token
from utils import build_labeled_model, temp
typoes = {Token.Literal.String.Regex: 'r', Token.Keyword: 'k', Token.Literal.String: 's',
Toke... | AuthEceSoftEng/rnn2source | src/sample-labeled.py | Python | mit | 5,387 |
import logging
import asyncio
from sanic.config import BASE_LOGO
try:
import uvloop # noqa
ROW = 0
except BaseException:
ROW = 1
def test_logo_base(app, caplog):
server = app.create_server(debug=True, return_asyncio_server=True)
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
... | lixxu/sanic | tests/test_logo.py | Python | mit | 2,246 |
# coding: utf-8
# # L1 - Градиентый спуск и линейные модели
# In[1]:
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from scipy.optimize import minimize
import math
get_ipython().magic('matplotlib notebook')
matplotlib.rcParams['figure.figsize'] = '12,8'
... | mryab/askme | labs/L1 - Gradient descent and linear models.py | Python | mit | 32,558 |
#The pipeline may not work correctly if there is both read and write access to the same memory 'xs0'
from polyphony import testbench
from polyphony import pipelined
def pipeline_hazard01(xs0, xs1, xs2):
for i in pipelined(range(len(xs0) - 1)):
xs1[i] = xs0[i]
xs0[i + 1] = xs2[i]
@testbench
def t... | ktok07b6/polyphony | tests/warning/pipeline_hazard01.py | Python | mit | 595 |
#!/usr/bin/env python
from setuptools import setup, find_packages
import subprocess
import os
__doc__ = """
App for Django to allow using datetime objects over integer fields.
"""
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
STAGE = 'alpha'
version = (0, 1, 1, STAGE)
de... | simpleenergy/epochdatetimefield | setup.py | Python | mit | 1,135 |
"""n-body simulator to derive TDV+TTV diagrams of planet-moon configurations.
Credit for part of the source is given to
https://github.com/akuchling/50-examples/blob/master/gravity.rst
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
"""
import numpy
import math
import matplotlib.pylab as plt... | hippke/TTV-TDV-exomoons | create_figures/system_22.py | Python | mit | 7,952 |
import unittest
from transip.client import MODE_RO, MODE_RW
from transip.service.objects import MailBox, MailForward, WebHost
from transip.service.webhosting import WebhostingService
try:
from unittest.mock import Mock, patch
except ImportError:
from mock import patch, Mock
class TestWebhostingService(unitt... | benkonrath/transip-api | tests/service_tests/test_webhosting.py | Python | mit | 4,475 |
#from gpiozero import MotionSensor
#import subprocess
from PIL import Image
from PIL import ImageDraw
from PIL import ImageFont
import time
import datetime
import syslog
import requests
import json
import Adafruit_GPIO.SPI as SPI
import Adafruit_SSD1306
URL = "http://localhost:8888/properties"
STOP... | atirage/aGreenHouse | clients/piOLED.py | Python | mit | 4,728 |
# 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/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/operations/_network_interfaces_operations.py | Python | mit | 64,353 |
from .base import * # flake8: noqa
DEBUG = env.bool('DJANGO_DEBUG', default=False)
TEMPLATES[0]['OPTIONS']['debug'] = DEBUG
SECRET_KEY = env('DJANGO_SECRET_KEY')
# Compress static files offline
# http://django-compressor.readthedocs.org/en/latest/settings/#django.conf.settings.COMPRESS_OFFLINE
COMPRESS_OFFLINE =... | Parbhat/wagtail-cookiecutter-foundation | {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/settings/production.py | Python | mit | 4,977 |
import os, sys, re
import shutil
import optparse
import shutil
import pandas
import numpy
import subprocess
import fnmatch
from joblib import Parallel, delayed
import multiprocessing
from Bio import SeqIO
import glob
#####################################
#This is the script to produce SSL file outputs for skyline spec... | wohllab/milkyway_proteomics | galaxy_milkyway_files/tools/wohl-proteomics/ssl_converter/ssl_converter.py | Python | mit | 43,684 |
"""Locks on Zigbee Home Automation networks."""
import functools
import voluptuous as vol
from zigpy.zcl.foundation import Status
from homeassistant.components.lock import STATE_LOCKED, STATE_UNLOCKED, LockEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import Platform
from homeas... | rohitranjan1991/home-assistant | homeassistant/components/zha/lock.py | Python | mit | 6,641 |
from django.apps import AppConfig
class DocenteConfig(AppConfig):
name = 'docente'
| Bleno/sisgestor-django | docente/apps.py | Python | mit | 89 |
#!/usr/bin/python3
from pwn import *
import misc.coloredstatus as cs
from time import sleep
import os
def execute(session, configs, params):
try:
shell = session.shell("/bin/bash")
shell.sendline("uname -a")
output = str(shell.recvrepeat(0.2), "UTF-8")
print(output)
sh... | Optixal/sshpwn | payloads/general/uname.py | Python | mit | 378 |
import os
import re
import logging
import exifread
import shutil
import platform
from datetime import datetime
from shutil import copy2
from easylife import get_logger
from easylife.photo_organizer import PHOTO_EXTENSIONS, VIDEO_EXTENSIONS, METADATA_EXTENSIONS, PATTERN, \
DEFAULT_COPY_DIR, FILE_DATE_FORMAT, LOG_FI... | JaniszM/easylife | easylife/photo_organizer/run_photo_organizer.py | Python | mit | 6,785 |
# -*- coding: utf-8 -*-
"""
Landlab component for overland flow using the kinematic-wave approximation.
Created on Fri May 27 14:26:13 2016
@author: gtucker
"""
from landlab import Component
import numpy as np
class KinwaveOverlandFlowModel(Component):
"""
Calculate water flow over topography.
Lan... | laijingtao/landlab | landlab/components/overland_flow/generate_overland_flow_kinwave.py | Python | mit | 7,019 |
import random
import uuid
from math import gcd
import numpy as np
from ._population import Population
from pychemia import Composition, Structure, pcm_log
from pychemia.analysis import StructureAnalysis, StructureChanger, StructureMatch
from pychemia.analysis.splitting import SplitMatch
from pychemia.utils.mathematics ... | MaterialsDiscovery/PyChemia | pychemia/population/relaxstructures.py | Python | mit | 19,699 |
# -*- encoding: utf-8 -*-
from shapely.wkt import loads as wkt_loads
import dsl
from . import FixtureTest
class DisusedRailwayStations(FixtureTest):
def test_old_south_ferry(self):
# Old South Ferry (1) (disused=yes)
self.generate_fixtures(dsl.way(2086974744, wkt_loads('POINT (-74.01325716895789 ... | mapzen/vector-datasource | integration-test/368-disused-railway-stations.py | Python | mit | 1,153 |
import json
from requests import Request, Session
class Requester:
@staticmethod
def verifyconnection(url="http://google.com"):
return Requester.request(url, method='GET', decode=False)
@staticmethod
def request(url, method=None, data=None, decode=True):
if not url.startswith('http://... | Bioto/Huuey-python | huuey/requester.py | Python | mit | 809 |
import itertools
from .base import MessageHandler
from .. import settings
class ReactionHandler(MessageHandler):
TRIGGER_ANCHOR = ''
TRIGGER_PREFIX = ''
TRIGGERS = sorted(
settings.EMOJI_REACTIONS.keys() + settings.MESSAGE_REACTIONS.keys())
HELP = 'add emoji and message reactions'
def handle_message... | nkouevda/slack-rtm-bot | slack_rtm_bot/handlers/reaction.py | Python | mit | 976 |
from network import *
import pygame, random, Serialize
from Logic import Logic
from Ship import Ship
from ServerSideController import ServerSideController
def respawn_func(ship):
ship.location = (320, 240)
ship.rect.center = ship.location
ship.velocity = (0, 0)
ship.direction = 0
def random_respaw... | rayman42003/INF123-VVPilot | Server.py | Python | mit | 8,498 |
#!/usr/bin/python
import urllib2
import tempfile
import json
# pprint to print json data on screen
from pprint import pprint
# fetching Google data
url = "http://finance.google.com/finance/info?q=rpower"
response = urllib2.urlopen(url)
#storing google data in temp file
temp_html = tempfile.NamedTemporaryFile(mode='... | krthkj/learningPython | GoogleJson.py | Python | mit | 1,529 |
import pyaudio
import struct
from threading import Thread, Condition
import time
from logging import thread
import socket
CHUNK = 2**12
FORMAT = pyaudio.paInt16
CHANNELS = 2
RATE = 44100
class AudioReader(Thread):
def __init__(self, raw = False, remote = False, host = 'localhost', port = 9999):
Thread._... | nanoscopy/afm-calibrator | nanoscopy/audio.py | Python | mit | 2,692 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (C) 2007-2018, Raffaele Salmaso <raffaele@salmaso.org>
# Copyright (c) 2012 Omoto Kenji
# Copyright (c) 2011 Sam Stephenson
# Copyright (c) 2011 Josh Peek
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and a... | rsalmaso/django-babeljs | babeljs/execjs/__init__.py | Python | mit | 8,122 |
"""
Django settings for sw_tts project.
Generated by 'django-admin startproject' using Django 1.9.8.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
import os
# ... | g10k/sw_tts | sw_tts/settings.py | Python | mit | 5,058 |
import os
from copy import deepcopy
from shapely.geometry import LineString
import mappyfile
import sys, os
sys.path.append(os.path.abspath("./docs/examples"))
from helper import create_image
def dilation(mapfile):
line = LineString([(0, 0), (1, 1), (0, 2), (2, 2), (3, 1), (1, 0)])
ll = mappyfile.find(mapfil... | geographika/mappyfile | docs/examples/geometry/geometry.py | Python | mit | 1,786 |
import sys
(N, D) = [int(x) for x in input().split()]
nums = [int(x) for x in input().split()]
for i in range(0,D):
temp = nums[0]
nums.pop(0)
nums.append(temp)
print(' '.join(str(n) for n in nums)) | ArchieR7/HackerRank | Data Structures/Arrays/Left Rotation.py | Python | mit | 204 |
from builtins import object
from PyAnalysisTools.base import _logger
from PyAnalysisTools.base.YAMLHandle import YAMLLoader
from PyAnalysisTools.AnalysisTools.FakeEstimator import MuonFakeEstimator # noqa: F401
from PyAnalysisTools.AnalysisTools.RegionBuilder import RegionBuilder # noqa: F401
from PyAnalysisTools.Ana... | morgenst/PyAnalysisTools | PyAnalysisTools/base/Modules.py | Python | mit | 2,275 |
from mock import MagicMock
import mock
from django.test import override_settings
from tests.utilities.utils import SafeTestCase
from tests.utilities.ldap import get_ldap_user_defaults
from accounts.models import (
User,
AccountRequest,
Intent
)
from projects.models import Project
from projects.receivers im... | ResearchComputing/RCAMP | rcamp/tests/test_projects_receivers.py | Python | mit | 4,732 |
import time
from datetime import datetime
class pyTemperature(object):
def __init__(self, date = datetime.now(), temp=None,pressure=None,humidity=None):
self.date = date
self.temperature = temp
self.pressure = pressure
self.humidity = humidity
def printTemperature(self):
... | mattcongy/piprobe | imports/pyTemperature.py | Python | mit | 507 |
from time import time
timeShow = time()
print(timeShow)
print(type(range(0,5)))
# for item in range(0,5):
# print(item)
for index,item in enumerate(range(0,5)):
print(index)
print(item)
| SELO77/seloPython | 3.X/ex/timeEx.py | Python | mit | 198 |
# encoding: utf-8
"""Interactive execution beautifiers.
Most definitely not intended for multiplexed (multithreaded) use.
"""
# Inspiration from: /lib/gentoo/functions.sh /lib64/rc/sh/functions.sh
import sys
from contextlib import contextmanager
TTY = sys.stdout.is_tty()
QUIET = False
DEBUG = False # Display ex... | marrow/web.command | web/command/output.py | Python | mit | 1,224 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2009-2015 Ben Kurtovic <ben.kurtovic@gmail.com>
#
# 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 ... | earwig/earwigbot | earwigbot/tasks/__init__.py | Python | mit | 5,993 |
#!/usr/bin/env python
# encoding: utf-8
"""Control access to columns using an authorizer function.
"""
#end_pymotw_header
import sqlite3
db_filename = 'todo.db'
con = sqlite3.connect(db_filename) # Warning: This file is created in the current directory
con.execute("DROP TABLE IF EXISTS todo")
con.execute("CREATE T... | janusnic/21v-pyqt | unit_06/func5.py | Python | mit | 2,384 |
from django.urls import path, re_path
from .views import (
user_overview,
api_overview,
dq_overview,
dq_overview_session,
dqr_listing,
)
from utils.common import states
# Only allow valid state abbreviations
state_abbrs = [s.abbr.lower() for s in states]
state_abbr_pattern = r"({})".format("|".join... | openstates/openstates.org | dashboards/urls.py | Python | mit | 685 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-06-25 10:17
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('explorer', '0004_district_shapefile_link'),
]
operations = [
migrations.Alt... | asterix135/whoshouldivotefor | explorer/migrations/0005_auto_20170625_0617.py | Python | mit | 474 |
# 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/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_load_balancer_network_interfaces_operations.py | Python | mit | 5,718 |
from nose.tools import *
from unittest import TestCase
import os
from shutil import rmtree
from tempfile import mkdtemp
from fnmatch import fnmatch
from files.file_matcher_glob import FileMatcherGlob
class FileMatcherGlobTests(TestCase):
def setUp(self):
self.directory = mkdtemp('-caboose-file-matcher-gl... | markdrago/caboose | src/test/files/file_matcher_glob_tests.py | Python | mit | 1,146 |
from django.shortcuts import get_object_or_404, Http404, redirect
from django.urls import reverse
from django.views.generic import DetailView, UpdateView
from django.http import HttpResponse
from django.contrib.auth.mixins import LoginRequiredMixin
from django.utils.http import urlencode
from froide.helper.utils impor... | fin/froide | froide/letter/views.py | Python | mit | 5,626 |
class Solution:
def toLowerCase(self, str: str) -> str:
rs = ""
# 32
section = ord("a") - ord("A")
for s in str:
if ord(s) >= ord("A") and ord(s) <= ord("Z"):
rs = rs + chr(ord(s) + section)
else:
rs = rs + s
return r... | yleo77/leetcode | To_Lower_Case/answer.py | Python | mit | 372 |
import pymel.core as pm
import pulse.nodes
import pulse.utilnodes
from pulse.buildItems import BuildAction, BuildActionError
class TwistJointsAction(BuildAction):
def validate(self):
if not self.twistJoint:
raise BuildActionError('twistJoint must be set')
if not self.alignJoint:
... | bohdon/maya-pulse | src/pulse/scripts/pulse/actions/joints/twist_joints_pulseaction.py | Python | mit | 3,957 |
#Copyright (C) 2013 by Ngan Nguyen
#
#Released under the MIT license, see LICENSE.txt
'''
1/ split the clones by number of samples that share them
2/ randomly select n clones for each number of samples
3/ print summary results: numsam2clonecount
Input: the clone2sample2size directory
minimum number of samples
... | ngannguyen/aimseqtk | src/overlap/overlap_numsam.py | Python | mit | 6,583 |
class Event:
def __init__(self, bot, data):
self.bot = bot
self.data = data
def post_message(self, text):
channel = self.data['channel']
return self.bot.post_message(text, channel)
def add_reaction(self, emoji):
channel = self.data['channel']
timestamp = sel... | rokurosatp/slackbotpry | slackbotpry/event.py | Python | mit | 578 |
# -*- coding: utf-8 -*-
from cms.app_base import CMSApp
from cms.apphook_pool import apphook_pool
from django.utils.translation import ugettext_lazy as _
class NewsletterApp(CMSApp):
name = _("Newsletter App") # give your app a name, this is required
urls = ["cmskit.newsletter.urls"] # link your app to url co... | ozgurgunes/django-cmskit | cmskit/newsletter/cms_app.py | Python | mit | 397 |
# from i2clibraries import i2c_hmc58831
from socket import socket
from socket import AF_INET
from socket import SOCK_STREAM
from socket import error as socket_error
from time import sleep
from time import time
from struct import pack
from datetime import datetime
from threading import Thread
import config
import ParKin... | sialm/par_king | client/ParKingClient.py | Python | mit | 11,117 |
# -*- coding: utf-8 -*-
import os
import platform
import subprocess
import unittest
import pytest
import six
from conans.client import tools
from conans.client.conf import get_default_settings_yml
from conans.client.tools.files import which
from conans.client.tools.win import vswhere
from conans.errors import ConanE... | conan-io/conan | conans/test/functional/util/tools_test.py | Python | mit | 5,578 |
import time
import logging
from cnavbot import settings
logger = logging.getLogger()
class Driver(object):
def __init__(self, *args, **kwargs):
self.driver = kwargs.pop('driver', settings.BOT_DRIVER)
class Motors(Driver):
def __init__(self, speed=None, *args, **kwargs):
super(Motors, se... | konradko/cnav-bot | cnavbot/services/pi2go.py | Python | mit | 4,857 |
#!/usr/bin/python
import serial
import time
import random
import sys
s = None
num_leds = 93
play_time = 0
def flush_input():
s.flushInput()
def wait_for_ack():
while s.inWaiting() <= 0:
pass ... | jhogsett/linkit | python/pinwheel.py | Python | mit | 6,131 |
"""
WSGI config for smart_menu 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_S... | chros/SmartMenu | smart_menu/wsgi.py | Python | mit | 398 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "webandgis.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| ingenieroariel/webandgis | manage.py | Python | mit | 252 |
from __future__ import absolute_import
import weakref
import threading
import asyncore
import socket
from walky.objects import *
from walky.port import *
from walky.engine import *
class Client(object):
engine = None
settings = None
connection = None
port = None
engine_class = Engine
object... | amimoto/walky | walky/client/common.py | Python | mit | 1,360 |
from google_address import helpers
import requests
class GoogleAddressApi():
url = 'https://maps.googleapis.com/maps/api/geocode/json?address={address}'
key = None
def __init__(self):
# Set key
self.key = helpers.get_settings().get("API_KEY", None)
# Set language
self.language = helpers.get_set... | leonardoarroyo/django-google-address | google_address/api.py | Python | mit | 692 |
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'jumodjango',
'USER': 'jumo',
'PASSWORD': '',
'HOST': 'localhost',
'PORT': '',
},
}
PROXY_SERVER = ""
BROKER_HOST = ""
BROKER_PORT = 5672
BROKER_USER = ""
BROKER_PASSWORD = ""
BROKER_VHOST =... | jumoconnect/openjumo | server/configs/devinstance/local_settings.py | Python | mit | 786 |
from hamcrest.core.assert_that import assert_that
from hamcrest.core.core.isequal import equal_to
from src.business.TemplateManager import TemplateManager
from src.data.template.TemplateReaderFactory import TemplateReaderFactory
__author__ = 'DWI'
import unittest
class TemplateManagerTest(unittest.TestCase):
... | DanielWieczorek/FancyReadmeBuilder | test/business/TemplateManagerTest.py | Python | mit | 727 |
#!/usr/bin/python
# -* coding: UTF-8 -*-
#import iso8602
#import iso-8601
import pprint
import cgi
import cgitb
import json
from slackclient import SlackClient
import datetime
import pytz
import re
import os
#### ToDo ####
# Assume wallClockTime is not None scenario time is not negative, go to the next day
# Convert a... | osbjmg/evt | bin/evt.py | Python | mit | 14,898 |
#importing randint
from random import randint
#creating an empty list
board = []
#filling up the list by O and creating a two dimensionall array
for x in range(5):
board.append(["O"] * 5)
#printing function which also includes a spaces to show clear grid
def print_board(board):
for row in board:
prin... | axeMaltesse/Python-related | Learning-Python/Battleship.py | Python | mit | 1,406 |
from dart.model.base import BaseModel, dictable
@dictable
class ApiKey(BaseModel):
def __init__(self, id, user_id, api_key, api_secret):
"""
:type user_id: str
:type api_key: str
:type api_secret: str
"""
self.id = id
self.user_id = user_id
self.api_k... | RetailMeNotSandbox/dart | src/python/dart/model/api_key.py | Python | mit | 370 |
from rest_framework import serializers
from .models import Todo
class TodoSerializer(serializers.ModelSerializer):
class Meta:
model = Todo
fields = '__all__'
| tomchuk/meetup | meetup/todo/serializers.py | Python | mit | 182 |
# 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 ... | AutorestCI/azure-sdk-for-python | azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/api_error.py | Python | mit | 1,621 |
from django.db import models
class Note(models.Model):
title = models.CharField(max_length=100)
text = models.TextField()
created = models.DateTimeField(auto_now_add=True)
| tokibito/django-edamame | example/note/models.py | Python | mit | 186 |
import tkinter as tk
TITLE_FONT = ("Black chancery", "18", "bold")
TEXT_FONT = ("Black chancery", "15")
BUTTON_FONT = ("Black chancery", "13")
class convo_controller(tk.Frame):
def __init__(self, parent, root, *args, **kwargs):
tk.Frame.__init__(self, master=parent, *args, **kwargs)
self.root = r... | markemus/economy | gui/convo_screen.py | Python | mit | 4,826 |
#!/usr/bin/env python2.7
__author__ = ['[Brandon Amos](http://bamos.github.io)']
__date__ = '2014.04.19'
"""
This script (music-organizer.py) organizes my music collection for
iTunes and [mpv](http://mpv.io) using tag information.
The directory structure is `<artist>/<track>`, where `<artist>` and `<track>`
are lower... | bamos/python-scripts | python2.7/music-organizer.py | Python | mit | 7,790 |
#!/usr/bin/env python
import os
COV = None
if os.environ.get('FLASK_COVERAGE'):
import coverage
COV = coverage.coverage(branch=True, include='app/*')
COV.start()
if os.path.exists('.env'):
print('Importing environment from .env...')
for line in open('.env'):
var = line.strip().split('=')
... | iamgroot42/braindump | manage.py | Python | mit | 2,291 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.