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
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "django_backend_test.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
semorale/backend-test
django_backend_test/manage.py
Python
mit
262
################################################################## # Code for testing the variational Multi-Stage Generative Model. # ################################################################## # basic python import numpy as np import numpy.random as npr import cPickle # theano business import theano import th...
capybaralet/Sequential-Generation
TestImpGPSI_MNIST.py
Python
mit
18,331
# ============================================================================= # Author: Teerapat Jenrungrot - https://github.com/mjenrungrot/ # FileName: 12626.py # Description: UVa Online Judge - 12626 # ============================================================================= from collec...
mjenrungrot/competitive_programming
UVa Online Judge/v126/12626.py
Python
mit
604
# Licensed under a 3-clause BSD style license - see LICENSE.rst from .stretch import * from .interval import * from .transform import * from .ui import * from .mpl_style import *
piotroxp/scibibscan
scib/lib/python3.5/site-packages/astropy/visualization/__init__.py
Python
mit
180
# -*- coding: utf-8 -*- # # EnergiScore Web Documentation documentation build configuration file, created by # sphinx-quickstart on Mon Feb 9 11:19:34 2015. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # aut...
Melrok/energistream-py
docs/conf.py
Python
mit
8,708
# 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/v2020_11_01/aio/operations/_web_application_firewall_policies_operations.py
Python
mit
20,812
""" Project: flask-rest Author: Saj Arora Description: All of the rest methods... """ class SageMethod: GET = 'get' POST = 'post' DELETE = 'delete' PUT = 'put' ALL = [GET, POST, DELETE, PUT]
aroraenterprise/projecteos
backend/api/v1/fundamentals/sage_methods.py
Python
mit
212
# pylint: disable=unused-import, unused-variable, missing-docstring def _readline(): try: import readline except ImportError: print("Module readline not available.") else: import rlcompleter readline.parse_and_bind("tab: complete") import os histfile = os.path.join(os.environ["HOME"], 'p...
rwstauner/run_control
python/startup.py
Python
mit
665
# -*- coding: utf-8 -*- """ The initialization file for the Pywikibot framework. """ # # (C) Pywikipedia bot team, 2008 # # Distributed under the terms of the MIT license. # __version__ = '$Id$' import datetime import difflib import logging import math import re import sys import threading from Queue import Queue # ...
legoktm/pywikipedia-rewrite
pywikibot/__init__.py
Python
mit
15,844
import os from distutils.sysconfig import get_python_inc from distutils.core import Extension, setup try: from Cython.Build import cythonize except ImportError: print("Please install cython and try again.") raise SystemExit PACKAGES = [ 'pdsa', 'pdsa.cardinality', 'pdsa.frequency', 'pdsa....
gakhov/pdsa
setup.py
Python
mit
5,837
# coding: utf-8 example_traceback = """*** HARAKIRI ON WORKER 16 (pid: 2259, try: 1) *** *** uWSGI Python tracebacker output *** thread_id = Thread-2 filename = /home/project/.pythonz/pythons/CPython-2.6.8/lib/python2.6/threading.py lineno = 504 function = __bootstrap line = self.__bootstrap_inner() thread_id = Thread...
futurecolors/raven-harakiri
test_harakiri.py
Python
mit
10,635
# coding: utf-8 from __future__ import absolute_import, division, print_function, unicode_literals __metaclass__ = type import pandas as pd from pyoptflow import utils from pyoptflow.core import extract_motion_proesmans from pyoptflow.extrapolation import semilagrangian def read_rainrate(filename): return def ...
sataako/fmio-server
fmio/forecast.py
Python
mit
1,752
import random import zope.schema import zope.interface from zope.i18nmessageid import MessageFactory from zope.component import getUtility, getMultiAdapter from zope.browserpage.viewpagetemplatefile import ViewPageTemplateFile as Zope3PageTemplateFile from Products.Five.browser.pagetemplatefile import ViewPageTemplat...
a25kk/vfu
src/vfu.events/vfu/events/myform.py
Python
mit
3,814
from __future__ import absolute_import import logging import ckan.logic as logic import ckan.model as model import ckan.lib.dictization.model_dictize as model_dictize import ckan.lib.dictization as dictization from sqlalchemy import func, text, or_, and_ from datetime import datetime, timedelta from .utils import packa...
vrk-kpa/api-catalog
ckanext/ckanext-apicatalog_ui/ckanext/apicatalog_ui/admindashboard.py
Python
mit
15,229
# coding=utf-8 jchars = u'。々ゝヽゞヾーぁァあアぃィいイぅゥうウヴぇェえエぉォおオヵかカがガきキぎギくクぐグヶけケげゲこコごゴさサざザしシじジすスず' \ u'ズせセぜゼそソぞゾたタだダちチぢヂっッつツづヅてテでデとトどドなナにニぬヌねネのノはハばバぱパひヒびビぴピふフぶブぷプへ' \ u'ヘべベぺペほホぼボぽポまマみミむムめメもモゃャやヤゅュゆユょョよヨらラりリるルれレろロゎヮわワゐヰゑヱをヲんン一丁七万-' \ u'下不与丑且世丘丙両並中丸丹主久乏乗乙九乱乳乾亀了予争事二互五井亜亡交亥亨享-亭人仁今介仏仕他付仙代-以仮仰仲件任企伊伏-休' \ ...
jr-garcia/Engendro3D
e3d/gui/FontRendering/japanese_range.py
Python
mit
6,858
""" Wikipedia utils. @author: Faegheh Hasibi (faegheh.hasibi@idi.ntnu.no) """ from urllib import quote class WikipediaUtils(object): mongo = None @staticmethod def wiki_title_to_uri(title): """ Converts wiki page title to wiki_uri based on https://en.wikipedia.org/wiki/Wikip...
hasibi/TAGME-Reproducibility
nordlys/wikipedia/utils.py
Python
mit
966
# -*- coding: utf-8 -*- import os import os.path import re import sys import string from django.apps.registry import apps from django.core.management.base import BaseCommand, CommandError from python_translate.extractors import base as extractors from python_translate import operations from python_translate.translat...
adamziel/django_translate
django_translate/management/commands/tranzdump.py
Python
mit
8,550
XXXXXXXXX XXXXX XXXXXX XXXXXX XXXXX XXXXXXXXXXXXXXXX XXXXX XXXXXXXXXXXXX XXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXX XXXXXXX X XXXXXXXXXXX XXXXXXXXXXXXXXXXXXX XXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXX XXX...
dnaextrim/django_adminlte_x
adminlte/static/plugins/datatables/extensions/ColReorder/examples/fixedheader.html.py
Python
mit
17,099
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2018 jem@seethis.link # Licensed under the MIT license (http://opensource.org/licenses/MIT) from keyplus.utility import inverse_map AES_KEY_LEN = 16 EP_VENDOR_SIZE = 64 VENDOR_REPORT_LEN = 64 FLASH_WRITE_PACKET_LEN = EP_VENDOR_SIZE - 5 SETTINGS_RF_INFO_SIZE =...
ahtn/keyplus
host-software/keyplus/constants/settings.py
Python
mit
3,115
from django.conf.urls import url from django.contrib.auth import views as auth_views from app.views import IndexView, RegisterView, UserProfileView urlpatterns = [ url(r'^$', IndexView.as_view(), name='index'), url(r'^register/$', RegisterView.as_view(), name='register'), ...
BackwardSpy/leaderboard
app/urls.py
Python
mit
645
from feature_extraction.pre_processing.filter_precedent import precendent_directory_cleaner def run(command_list): precendent_directory_cleaner.run(command_list)
Cyberjusticelab/JusticeAI
src/ml_service/feature_extraction/pre_processing/pre_processing_driver.py
Python
mit
168
# # coding=utf-8 import cmd2_myplugin from cmd2 import ( cmd2, ) ###### # # define a class which uses our plugin and some convenience functions # ###### class MyApp(cmd2_myplugin.MyPluginMixin, cmd2.Cmd): """Simple subclass of cmd2.Cmd with our SayMixin plugin included.""" def __init__(self, *args, **...
python-cmd2/cmd2
plugins/template/tests/test_myplugin.py
Python
mit
1,894
'''Base module to handle the collection and the output of statistical data.''' import logging import time import multiprocessing as mp import queue from collections import Counter log = logging.getLogger(__name__) current_milli_time = lambda: int(round(time.time() * 1000)) def is_number(val): '''Function to ch...
vrde/logstats
logstats/base.py
Python
mit
3,761
from string import Template import re import os import sys import time import json import math import os import subprocess import csv def saveResults(resultsList, json_fname, csv_fname): print(resultsList) print(json.dumps(resultsList, indent=4, sort_keys=True)) with open(json_fname, 'w') as outfile: ...
ECP-CANDLE/Supervisor
workflows/async-search/python/utils.py
Python
mit
594
from pact_test.runners import pact_tests_runner def test_consumer_tests(mocker): mocker.spy(pact_tests_runner, 'run_consumer_tests') pact_tests_runner.verify(verify_consumers=True) assert pact_tests_runner.run_consumer_tests.call_count == 1 def test_provider_tests(mocker): mocker.spy(pact_tests_runn...
Kalimaha/pact-test
tests/runners/pact_tests_runner.py
Python
mit
767
from slackminion.bot import Bot from slackminion.webserver import Webserver class DummyBot(Bot): def __init__(self, *args, **kwargs): super(DummyBot, self).__init__(None, *args, **kwargs) setattr(self, 'start', lambda: None) setattr(self, 'send_message', lambda x, y, z, a: None) se...
arcticfoxnv/slackminion
slackminion/utils/test_helpers/bot.py
Python
mit
366
# helloworld.py # # familiar test program, demonstrating py2js conversion def helloworld(suffix): print "hello world"+suffix helloworld("!")
treeform/pystorm
examples/helloworld.py
Python
mit
147
#!/usr/bin/python import numpy as np import argparse parser = argparse.ArgumentParser() parser.add_argument('inset', choices=['test', 'val', 'train', 'all']) parser.add_argument('recog', choices=['clean', 'reverb', 'noisy', 'retrain', 'all']) phase_group = parser.add_mutually_exclusive_group(required = False) pha...
sthenc/nc_packer
tools/chime_scorer.py
Python
mit
13,171
"""pidaemon.py Usage: pidaemon.py [--brightness=<b>] [--sleep=<s>] [--interval=<s>] [--wait=<s>] pidaemon.py (-h | --help) pidaemon.py --version Options: -h --help Show this screen. --version Show version --brightness=<b> Default brightness level 1-255 [default: 2] --interval=<s> Def...
ollej/piapi
pidaemon.py
Python
mit
2,568
import uuid import factory.fuzzy from django.conf import settings from .. import models from utils.factories import FuzzyMoney class UserFactory(factory.DjangoModelFactory): class Meta: model = settings.AUTH_USER_MODEL username = factory.Sequence('terminator{0}'.format) email = factory.Sequence(...
uppsaladatavetare/foobar-api
src/foobar/tests/factories.py
Python
mit
1,604
from __future__ import print_function, unicode_literals import os import shutil import zipfile import datetime import tempfile import subprocess from copy import deepcopy import pytest import numpy as np from numpy.testing import assert_almost_equal from sklearn.dummy import DummyClassifier from destimator import De...
rainforestapp/destimator
destimator/tests/test.py
Python
mit
7,733
from core import db from auth import models from admin import models db.create_all()
zoowii/pia-cloud
cloudweb/app/db.py
Python
mit
85
""" WSGI config for admin_readonly_model 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.8/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault(...
mozillazg/django-simple-projects
projects/admin_readonly_model/admin_readonly_model/wsgi.py
Python
mit
417
from django import forms class ExampleForm(forms.Form): non_blank_field = forms.CharField(max_length=100, widget=forms.TextInput(attrs={ 'placeholder': "Must not be blank!", }), )
carlmjohnson/django-json-form
jsonform_example/forms.py
Python
mit
218
""" This package contains a number of utilities that are used inside of openmdao. It does not depend on any other openmdao package. """
DailyActie/Surrogate-Model
01-codes/OpenMDAO-Framework-dev/openmdao.util/src/openmdao/util/__init__.py
Python
mit
137
import json import requests # TODO: Complete methods. class AttributeType(): """Attribute Type Client.""" # Service Setup config = { 'schema': 'http', 'host': 'localhost', 'port': '9903', 'endpoint': 'api/v1/attribute_types' } @classmethod def base_url(cls): ...
Foris/darwined-core-python-clients
darwined_core_python_clients/central/attributes.py
Python
mit
4,104
# asyncio version # The MIT License (MIT) # # Copyright (c) 2016, 2017 Robert Hammelrath (basic driver) # 2016 Peter Hinch (asyncio extension) # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # ...
robert-hh/XPT2046-touch-pad-driver-for-PyBoard
touch.py
Python
mit
9,126
''' @author: Sergio Rojas @contact: rr.sergio@gmail.com -------------------------- Contenido bajo Atribución-NoComercial-CompartirIgual 3.0 Venezuela (CC BY-NC-SA 3.0 VE) http://creativecommons.org/licenses/by-nc-sa/3.0/ve/ Creado en abril 19, 2016 ''' print(3+5) print(2-6) print(2*7) print(6/2) print(1/3) print(1....
rojassergio/Aprendiendo-a-programar-en-Python-con-mi-computador
Programas_Capitulo_02/Cap02_pagina_25_comp_interactiva.py
Python
mit
746
# -*- coding: utf-8 -*- # code for console Encoding difference. Dont' mind on it import sys import imp imp.reload(sys) try: sys.setdefaultencoding('UTF8') except Exception as E: pass import testValue from popbill import ClosedownService, PopbillException closedownService = ClosedownService(testValue.LinkID,...
linkhub-sdk/popbill.closedown.example.py
getPartnerURL.py
Python
mit
1,149
"""stockretriever""" from setuptools import setup setup( name='portfolio-manager', version='1.0', description='a web app that keeps track of your investment portfolio', url='https://github.com/gurch101/portfolio-manager', author='Gurchet Rai', author_email='gurch101@gmail.com', license='MI...
gurch101/portfolio-manager
setup.py
Python
mit
973
# -*- coding: utf-8 -*- """ pygments.styles.colorful ~~~~~~~~~~~~~~~~~~~~~~~~ A colorful style, inspired by CodeRay. :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.style import Style from pygments.token import Keyword, ...
tmm1/pygments.rb
vendor/pygments-main/pygments/styles/colorful.py
Python
mit
2,778
from __future__ import print_function, unicode_literals from future.builtins import open import os import re import sys from contextlib import contextmanager from functools import wraps from getpass import getpass, getuser from glob import glob from importlib import import_module from posixpath import join from mezza...
okfnepal/election-nepal
fabfile.py
Python
mit
21,828
from __future__ import absolute_import, print_function import numpy as np import warnings from numpy.polynomial.hermite import hermvander from six.moves import xrange from .common import Baseline try: from cvxopt import matrix as cvx_matrix, solvers except ImportError: from scipy.optimize import linprog HAS_CVXO...
all-umass/superman
superman/baseline/mario.py
Python
mit
3,423
from contentbase.upgrader import upgrade_step @upgrade_step('evidenceScore', '1', '2') def evidenceScore_1_2(value, system): # https://github.com/ClinGen/clincoded/issues/1507 # Add affiliation property and update schema version return
ClinGen/clincoded
src/clincoded/upgrade/evidenceScore.py
Python
mit
250
from .. import models import datetime def typical_user(): username = 'alice' if not models.User.query.filter_by(username=username).first(): return models.User.register( username=username, password='qqq', confirmed=True, ) def typical_dataset(): pass
msarfati/dodecahedron
dodecahedron/tests/fixtures.py
Python
mit
318
import shopify import json from test.test_helper import TestCase class ApplicationCreditTest(TestCase): def test_get_application_credit(self): self.fake("application_credits/445365009", method="GET", body=self.load_fixture("application_credit"), code=200) application_credit = shopify.ApplicationCr...
Shopify/shopify_python_api
test/application_credit_test.py
Python
mit
1,374
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('jdpages', '0003_auto_20170725_2349'), ] operations = [ migrations.AlterField( model_name='visionspage', ...
jonge-democraten/website
website/jdpages/migrations/0004_auto_20170726_0019.py
Python
mit
441
"""Django app config for the analytics app.""" from django.apps import AppConfig class AnalyticsAppConfig(AppConfig): """Analytics app init code.""" name = 'readthedocs.analytics' verbose_name = 'Analytics'
rtfd/readthedocs.org
readthedocs/analytics/apps.py
Python
mit
224
#-*- coding: utf-8 -*- ''' Created on 23 mar 2014 @author: mariusz @author: tomasz ''' import unittest from selearea import get_ast, get_workareas class seleareaTest(unittest.TestCase): def get_fc_pages(self): urls = { "http://fc.put.poznan.pl", "http://fc.put.poznan.pl/re...
perfidia/selearea
tests/seleareaTest.py
Python
mit
2,350
# Exercise 43: Basic Object-Oriented Analysis and Design # Process to build something to evolve problems # 1. Write or draw about the problem. # 2. Extract key concepts from 1 and research them. # 3. Create a class hierarchy and object map for the concepts. # 4. Code the classes and a test to run them. # 5. Repeat and...
Valka7a/python-playground
python-the-hard-way/43-basic-object-oriented-analysis-and-design.py
Python
mit
13,790
import json import logging import socket from contextlib import closing from django.core.exceptions import ValidationError from django.db import connection from zeroconf import get_all_addresses from zeroconf import NonUniqueNameException from zeroconf import ServiceInfo from zeroconf import USE_IP_OF_OUTGOING_INTERFA...
mrpau/kolibri
kolibri/core/discovery/utils/network/search.py
Python
mit
6,523
from PIL import Image from math import ceil, floor def load_img(src): return Image.open(src) def create_master(width, height): return Image.new("RGBA", (width, height)) def closest_power_two(num): result = 2 while result < num: result = result * 2 return result def create_matrix(cols, ro...
zaibacu/DamnedQuest
sprite_creator.py
Python
mit
1,532
from django.conf import settings _TRACKING_USPS_URL = 'http://trkcnfrm1.smi.usps.com/PTSInternetWeb/InterLabelInquiry.do?origTrackNum=' TRACKING_USPS_URL = getattr(settings, 'OWNEY_USPS_TRACKING_URL', _TRACKING_USPS_URL) _USPS_API_URL = 'http://production.shippingapis.com/ShippingAPI.dll' USPS_API_URL = getattr(setti...
JohnSpeno/owney
owney/conf/settings.py
Python
mit
635
import _plotly_utils.basevalidators class YcalendarValidator(_plotly_utils.basevalidators.EnumeratedValidator): def __init__(self, plotly_name="ycalendar", parent_name="histogram", **kwargs): super(YcalendarValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name...
plotly/python-api
packages/python/plotly/plotly/validators/histogram/_ycalendar.py
Python
mit
1,058
# Uppgift 4 [str(i) for i in range(4)] # Uppgift 5 from math import sqrt # square root list(filter(lambda x: sqrt(x).is_integer(), range(1000, 1200))) # Uppgift 6 >>> def make_decrementor(n): ... return lambda x: n - x ... >>> f = make_decrementor(42) >>> f(0) 42 >>> f(1) 41 >>> f(-3)
simonlindblad/quizilito
build/funktionell-programmering.py
Python
mit
295
import string, copy def joinHeaders(first, second, joined, on): joined.headers = first.headers[:] mappedHeaders = {} for header in second.headers: if header == on: continue i = 0 newHeader = header while newHeader in first.headers: newHeader = '{0}_{1}'.format(newHeader, i) i += 1 if i > 0: ma...
dwilmer/rcpsp-testing-framework
dataset.py
Python
mit
3,291
#!/bin/python3 import sys fact = lambda n: 1 if n <= 1 else n * fact(n - 1) n = int(input().strip()) fct = fact(n) print(fct)
lilsweetcaligula/Online-Judges
hackerrank/algorithms/implementation/medium/extra_long_factorials/py/solution.py
Python
mit
134
################################################################################ # Copyright (C) 2012-2013 Leap Motion, Inc. All rights reserved. # # Leap Motion proprietary and confidential. Not for distribution. # # Use subject to the terms of the Leap Motion SDK Agreement available at ...
if1live/marika
server/sample.py
Python
mit
6,943
<<<<<<< HEAD from flask import Blueprint, render_template, request, url_for, jsonify from config import mongo import pandas as pd import json from bson import json_util import retrieve_model as rmodel from collections import Counter main = Blueprint('main', __name__, template_folder='templates') @main.route('/') de...
skrzym/monday-morning-quarterback
Application/Site/mmq/main/controllers.py
Python
mit
7,841
# -*- coding: utf-8 -*- # Generated by Django 1.9.7 on 2016-06-16 16:37 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('pushkin', '0024_authparam_secret'), ] operations = [ migrations.AlterField( ...
ilique/webpushkin
pushkin/migrations/0025_auto_20160616_1637.py
Python
mit
495
def read_logfile_by_line(logfile): """generator function that yields the log file content line by line""" with open(logfile, 'r') as f: for line in f: yield line yield None def parse_commands(log_content): """ parse cwl commands from the line-by-line generator of log file cont...
4dn-dcic/tibanna
awsf3/log.py
Python
mit
1,003
__version__ = '20.0.0'
ofek/pypinfo
pypinfo/__init__.py
Python
mit
23
# -*- coding: utf-8 -*- # Generated by Django 1.11.4 on 2017-09-04 17:41 from __future__ import unicode_literals from django.conf import settings import django.contrib.auth.models import django.contrib.auth.validators from django.db import migrations, models import django.db.models.deletion import django.util...
tiagoarasilva/django-boilerplate
project_name/accounts/migrations/0001_initial.py
Python
mit
5,076
""" This file is part of the TheLMA (THe Laboratory Management Application) project. See LICENSE.txt for licensing, CONTRIBUTORS.txt for contributor information. MoleculeType entity classes. """ from everest.entities.base import Entity from everest.entities.utils import slug_from_string __docformat__ = "reStructured...
helixyte/TheLMA
thelma/entities/moleculetype.py
Python
mit
2,617
# <pep8 compliant> from .xmodel import Model from .xanim import Anim from .sanim import SiegeAnim version = (0, 3, 0) # Version specifier for PyCoD
SE2Dev/PyCoD
__init__.py
Python
mit
158
from setuptools import setup import os import martapy def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup( name="martapy", version=martapy.__version__, author=martapy.__author__, author_email="git@edward.sh", description="Wrapper for MARTA realtime rail/b...
arcward/martapy
setup.py
Python
mit
599
from django import forms from .models import Question, Answer, Categories, Customuser from django.contrib import auth from django.contrib.auth.models import User from django.utils.translation import ugettext_lazy as _ class add_Question_Form(forms.ModelForm): # just a regular form question_text = forms.CharField(l...
aadithyamd/QandA
QA/forms.py
Python
mit
4,443
import django.conf class AppSettings(object): """ A holder for app-specific default settings that allows overriding via the project's settings. """ def __getattribute__(self, attr): if attr == attr.upper(): try: return getattr(django.conf.settings, attr) ...
schinckel/django-countries
django_countries/conf.py
Python
mit
2,772
from interfaces.labels_map import LabelsMap from helpers.python_ext import to_str class LTS: def __init__(self, init_states, model_by_signal:dict, tau_model:LabelsMap, state_name:str, input_signals, output_signal...
5nizza/party-elli
interfaces/LTS.py
Python
mit
2,142
# -*- coding: utf-8 -*- # # state_machine documentation build configuration file, created by # sphinx-quickstart on Thu Apr 3 08:46:47 2014. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file....
jtushman/state_machine
docs/conf.py
Python
mit
8,221
from django.contrib.auth import get_user_model from django.core.urlresolvers import reverse from django.shortcuts import get_object_or_404 from django.utils.translation import ugettext as _ from selvbetjening.sadmin2 import menu from selvbetjening.sadmin2.decorators import sadmin_prerequisites from selvbetjening.sadmi...
animekita/selvbetjening
selvbetjening/sadmin2/views/user.py
Python
mit
1,851
# -*- coding: utf-8 -*- # # BbQuick documentation build configuration file, created by # sphinx-quickstart on Fri Feb 10 20:55:10 2012. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All...
ianawilson/BbQuick
docs/conf.py
Python
mit
6,974
from statistics import mode def moda(muestras): frecuencias = {} for muestra in muestras: if muestra not in frecuencias.keys(): frecuencias[muestra] = 1 else: frecuencias[muestra] += 1 valores = [] frecuencia_maxima = max(frecuencias.values()) for clave in f...
israelem/aceptaelreto
codes/2017-10-09-modas.py
Python
mit
790
from __future__ import print_function, absolute_import import random import unittest from pysmoke import marshal from pysmoke.smoke import ffi, Type, TypedValue, pystring, smokec, not_implemented, charp, dbg from pysmoke import QtCore, QtGui qtcore = QtCore.__binding__ qtgui = QtGui.__binding__ class MarshalTestCa...
pankajp/pysmoke
pysmoke/tests/test_marshal.py
Python
mit
987
from flask_simple_alchemy import Relator from testers import db, app, FakeTable, OtherTable this_table = Relator(db) this_table.add('FakeTable') this_table.add('OtherTable', foreign_key='uuid') class ThirdTable(db.Model, this_table.HasOneToOneWith.FakeTable): __tablename__ = 'thirdtable' id = db.Column(db.Int...
elbow-jason/flask-simple-alchemy
tests/test_relator.py
Python
mit
3,028
import time import find_remove_find5 import sort_then_find3 import walk_through7 def time_find_two_smallest(find_func, lst): ...
JSBCCA/pythoncode
early_projects/perfcountertest.py
Python
mit
135
from sys import argv script, user_name = argv prompt = '> ' print "Hi %s, I'm the %s script." % (user_name, script) print "I'd like to ask you a few questions." print "Do you like me %s?" % user_name likes = raw_input(prompt) print "Where do you live %s?" % user_name lives = raw_input(prompt) print "What kind of co...
Skreex/LPTHW
ex14.py
Python
mit
529
""" Script for the paper """ import time import numpy as np import snr_of_images import urllib import zlib from io import BytesIO import cv2 import h5py import os import matplotlib.pyplot as plt import json import requests from requests.packages.urllib3.exceptions import InsecureRequestWarning #Following if it gives a...
dbock/bocklab_public
temca2data/SNR/snrscript.py
Python
mit
9,484
def ContinueCurse(): test_note_1 = (int(input("Type first Test Value: "))) test_note_2 = (int(input("Type Second Test Value: "))) tmp_note = (((test_note_1 + test_note_2)/2)*0.6) if ((3 - tmp_note)/0.4) <= 5: print "Keep Studying :D" else: print "Cancel course :/" print "=== P...
13lcp2000/pythonExercises
script3.py
Python
mit
414
from draftjs_exporter.constants import BLOCK_TYPES, INLINE_STYLES from draftjs_exporter.dom import DOM from draftjs_exporter.types import Element, Props def render_children(props: Props) -> Element: """ Renders the children of a component without any specific markup for the component itself. """ r...
springload/draftjs_exporter
draftjs_exporter/defaults.py
Python
mit
1,811
from devito.ir.iet import MapNodes, Section, TimedList, Transformer from devito.mpi.routines import (HaloUpdateCall, HaloWaitCall, MPICall, MPIList, HaloUpdateList, HaloWaitList, RemainderCall) from devito.passes.iet.engine import iet_pass from devito.passes.iet.orchestration import Bus...
opesci/devito
devito/passes/iet/instrument.py
Python
mit
2,261
# !/usr/bin/env python # -*- coding: UTF-8 -*- # Copyright (c) 2012-2015 Christian Schwarz # # 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 limitat...
T-002/pycast
pycast/common/decorators.py
Python
mit
2,987
""" Module where admin tools dashboard classes are defined. """ from django.template.defaultfilters import slugify try: from importlib import import_module except ImportError: # Django < 1.9 and Python < 2.7 from django.utils.importlib import import_module from django.utils.translation import ugettext_lazy...
miurahr/django-admin-tools
admin_tools/dashboard/dashboards.py
Python
mit
10,473
#!/usr/bin/env python import sys from httplib import HTTPConnection from urllib import urlencode from urlparse import urljoin from json import loads from reportlab.pdfgen import canvas OUTPUTFILE = 'certificate.pdf' def get_brooklyn_integer(): ''' Ask Brooklyn Integers for a single integer. Returns ...
dmangot/devops-certifyme
gendocert.py
Python
mit
2,175
# coding: utf-8 ''' Created on 2012-8-30 @author: shanfeng ''' import smtplib from email.mime.text import MIMEText import urllib import web class XWJemail: ''' classdocs ''' def __init__(self, params): ''' Constructor ''' pass @staticmethod def sendfindpass(user,hash): link = "%s/account/newpass?%s"...
waile23/todo
utils/xwjemail.py
Python
mit
2,175
''' TURKSAT 4A 1 39522U 14007A 15301.78105273 .00000128 00000-0 00000+0 0 9996 2 39522 0.0299 272.9737 0004735 326.3457 120.6614 1.00271335 6265 ''' import math import sys import astropy.units as u name = sys.stdin.readline().strip() line1 = sys.stdin.readline() line2 = sys.stdin.readline() ...
Camiloasc1/AstronomyUNAL
IntroductionToTheSpacialVoyage/SatelliteOrbit/CelestrackNORAD.py
Python
mit
770
from pprint import pprint from Conundrum.utils import sanitize def decrypt(msg: str, repeated_letter: str) -> str: """ Extract every letter after an occurrence of the repeated letter """ msg = sanitize(msg) result = [] remove_next = False for letter in msg: take_this = remove_nex...
physicalattraction/kerstpuzzel
src/Conundrum/repeated_letters.py
Python
mit
853
# 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/links/v2016_09_01/_management_link_client.py
Python
mit
4,330
"basic 2D vector geometry" from math import acos, sqrt, sin, cos, pi class Vec2D(object): " Simple 2D vector class for euclidean geometry " EPSILON = 0.0001 def __init__(self, x=0.0, y=0.0): self.pos_x = x self.pos_y = y def dot(self, other): "dot product" return sel...
31415us/linda-lidar-rangefinder-playground
linda/Vec2D.py
Python
mit
2,599
# -*- coding: utf-8 -*- try: # Python 2.7 from collections import OrderedDict except: # Python 2.6 from gluon.contrib.simplejson.ordered_dict import OrderedDict from gluon import current from gluon.storage import Storage from gluon.validators import IS_NOT_EMPTY, IS_EMPTY_OR, IS_IN_SET from s3 import...
code-for-india/sahana_shelter_worldbank
private/templates/EVASS/config.py
Python
mit
38,128
#Kunal Gautam #Codewars : @Kunalpod #Problem name: Dubstep #Problem level: 6 kyu def song_decoder(song): return " ".join(" ".join(song.split('WUB')).split())
Kunalpod/codewars
dubstep.py
Python
mit
163
# 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/aio/operations/_network_management_client_operations.py
Python
mit
7,052
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "drf_ember.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
riklaunim/django-examples
ember-drf-example/manage.py
Python
mit
252
# all the imports import sqlite3 from flask import Flask, request, session, g, redirect, url_for, \ abort, render_template, flash from queries import * from functools import wraps from contextlib import closing from wtforms import SelectField, PasswordField, validators from flask_wtf import Form from flask_wtf.file...
cdiener/rater
app.py
Python
mit
11,748
from django.contrib import admin from .models import File, Link from .forms import FileForm class FileAdmin(admin.ModelAdmin): list_display = ('id', 'md5', 'file', 'size') list_per_page = 100 list_display_links = ('md5',) form = FileForm class LinkAdmin(admin.ModelAdmin): list_display = ('id', ...
chaos-soft/chocola
files/admin.py
Python
mit
479
"""Class definitions for Speaker Adapted Triphone trainer""" from __future__ import annotations import multiprocessing as mp import os import re import shutil import subprocess import time from queue import Empty from typing import Dict, List, NamedTuple import tqdm from montreal_forced_aligner.acoustic_modeling.tri...
MontrealCorpusTools/Montreal-Forced-Aligner
montreal_forced_aligner/acoustic_modeling/sat.py
Python
mit
14,192
# !/usr/bin/env python __author__ = "Andrew Hankinson (andrew.hankinson@mail.mcgill.ca)" __version__ = "1.5" __date__ = "2011" __copyright__ = "Creative Commons Attribution" __license__ = """The MIT License Permission is hereby granted, free of charge, to any person obtaining a copy of...
WoLpH/pybagit
pybagit/multichecksum.py
Python
mit
4,828
# -*- coding: utf-8 -*- import sae.const DEBUG = False SITE_TITLE = u"博客标题" SITE_SUB_TITLE = u"博客副标题" SITE_KEYWORDS = u"博客关键字" SITE_DECRIPTION = u"博客描述" AUTHOR_NAME = u"博客作者" #显示在RSS订阅里面 #CONACT_MAIL = "xxx@gmail.com" #暂未用到 THEMES = ['octopress','admin'] LINK_BROLL = [ {'text': u"爱简单吧", 'url': "http://www....
ego008/ijd8
sae/setting.py
Python
mit
1,814
from os.path import dirname, join from pystacia import lena dest = join(dirname(__file__), '../_static/generated') image = lena(256) image.desaturate() image.write(join(dest, 'lena_desaturate.jpg')) image.close()
squeaky-pl/pystacia
doc/source/image/desaturate.py
Python
mit
216
import _plotly_utils.basevalidators class ColorbarValidator(_plotly_utils.basevalidators.CompoundValidator): def __init__(self, plotly_name="colorbar", parent_name="bar.marker", **kwargs): super(ColorbarValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, ...
plotly/plotly.py
packages/python/plotly/plotly/validators/bar/marker/_colorbar.py
Python
mit
12,732