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
""" Django settings for django_app project. Generated by 'django-admin startproject' using Django 1.11.2. For more information on this file, see https://docs.djangoproject.com/en/1.11/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.11/ref/settings/ """ import...
sonic182/libsasscompiler
test_djangoapp/django_app/settings.py
Python
mit
4,154
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' python label.py [imgdir] Usage: d -> delete current label n -> next picture q -> exit ''' import os, sys import cv2 import numpy as np import math import copy import xml.etree.ElementTree as ET x1,y1, x2, y2 = 0,0,0,0 state = 0 # ellipse parameter x0, y0 = 0, 0 angl...
DuinoDu/label_ellipse
label.py
Python
mit
6,224
""" Example Sheepdog script with numpy. We'll import and make global numpy inside our Sheepdog function, and then any other function can also use it. """ import sheepdog def f(a, b): import numpy as np global np return g(a, b) def g(a, b): return np.mean(np.array((a, b))) args = [(1, 1), (1, 2), (2...
adamgreig/sheepdog
examples/numpy_example.py
Python
mit
531
from flask import jsonify from flask_sqlalchemy import SQLAlchemy from sqlalchemy import Table, Column, Integer, ForeignKey from src.webservice.base import Base from src.webservice._action import Action db = SQLAlchemy() Base.query = db.session.query_property() class Input(Base): __tablename__ = 'tbl_InputPin' ...
deklungel/iRulez
src/webservice/_inputPin.py
Python
mit
1,909
# flake8: NOQA from cupyx.scipy.fft._fft import ( fft, ifft, fft2, ifft2, fftn, ifftn, rfft, irfft, rfft2, irfft2, rfftn, irfftn, hfft, ihfft, hfft2, ihfft2, hfftn, ihfftn ) from cupyx.scipy.fft._fft import ( __ua_domain__, __ua_convert__, __ua_function__) from cupyx.scipy.fft._fft import _scipy_150, _s...
cupy/cupy
cupyx/scipy/fft/__init__.py
Python
mit
591
# encoding: utf-8 # Copyright 2011 Tree.io Limited # This file is part of Treeio. # License www.tree.io/license # encoding: utf-8 import datetime from south.db import db from south.v2 import DataMigration from django.db import models from treeio.finance.models import Currency from treeio.sales.models import SaleOrder,...
rogeriofalcone/treeio
sales/migrations/0003_treeiocurrency.py
Python
mit
30,418
import os from .views import blueprint @blueprint.app_context_processor def inject_permissions(): show_labsys = not os.environ.get('SHOW_LABSYS') == 'False' return dict(show_labsys=show_labsys)
gems-uff/labsys
labsys/main/__init__.py
Python
mit
206
# -*- coding: utf-8 -*- from helper.resource import YuzukiResource
Perlmint/Yuzuki
resource/util.py
Python
mit
66
from telegram.ext import BaseFilter from pathlib import Path import model class IsInDatabase(BaseFilter): def __init__(self, storage): self.storage = storage def filter(self, message): return (message.voice is not None and self.storage.has_meme_with_file_id(message.voice.file...
MelomanCool/telegram-audiomemes
custom_filters.py
Python
mit
653
#!/usr/bin/env python # -*- coding: utf-8 -*- import pandas as pd import numpy as np from erlport.erlterms import Atom, List from erlport.erlang import set_encoder, set_decoder def setup_dtype(): set_encoder(dtype_encoder) set_decoder(dtype_decoder) return Atom(b'ok') def dtype_encoder(value): if isi...
zgbjgg/jun
priv/jun_enc_dec.py
Python
mit
1,427
import sublime, sublime_plugin, os class CopyFilenameCommand(sublime_plugin.TextCommand): def run(self, edit): if len(self.view.file_name()) > 0: filename = os.path.split(self.view.file_name())[1] sublime.set_clipboard(filename) sublime.status_message("Copied file name: ...
nwjlyons/copy-file-name
copy_filename.py
Python
mit
435
from django.shortcuts import render from services.genomics_test_generator.fhir_genomics_test_gene import * from django.views.decorators.csrf import csrf_exempt from django.http import HttpResponse, HttpResponseRedirect from django.template import RequestContext, loader import json from home.task_runner import perform_t...
ideaworld/FHIR_Tester
FHIR_Tester_backend/home/views.py
Python
mit
7,138
from rank.models import Player from utils.api import get_watcher import time import json def search(my_id): if True: match = get_watcher().get_match_list(my_id,'na') match_id_list = [i['matchId'] for i in match['matches'] if i['queue'] == 'TEAM_BUILDER_DRAFT_RANKED_5x5'][:9] match_details = ...
soileater/noobest
rank/training.py
Python
mit
4,006
#input # Stand at the pole with the plaque START # go 420 feet by azimuth 13 # go 160 feet by azimuth 330 # go 140 feet by azimuth 358 # go 200 feet by azimuth 316 # go 500 feet by azimuth 17 # go 80 feet by azimuth 58 # go 20 feet by azimuth 3 # go 400 feet by azimuth 75 # go 360 feet by azimuth 31 # go 120 feet by az...
Xzya/CodeAbbeySolutions
AzimuthAtTreasureIsland.py
Python
mit
1,101
##################################################################### # # hummingloop_algorithm.py # # Copyright (c) 2015, Nick Benson # Modifications by benchan # # Released under the MIT License (http://opensource.org/licenses/MIT) # ##################################################################### import random...
mnjy/critters
CrittersProto/generator/hummingloop_algorithm.py
Python
mit
3,992
from distutils.core import setup, Extension setup(name = '_intcode', version = '0.1', ext_modules = [Extension('_intcode', sources = ['_intcode.c'])])
msullivan/advent-of-code
2019/setup.py
Python
mit
164
from enum import Enum, unique import related @unique class DayType(Enum): NORMAL = "Normal" HOLIDAY = "Holiday" @related.immutable class DayData(object): date = related.DateField() logged_on = related.TimeField("%H:%M") open_at = related.TimeField() closed_on = related.TimeField() custom...
genomoncology/related
tests/ex06_json/models.py
Python
mit
765
# Generated by Django 2.0 on 2020-06-16 06:52 import apps.reader.models import datetime from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('rss_feeds', '0001_initial'), ...
samuelclay/NewsBlur
apps/reader/migrations/0001_initial.py
Python
mit
3,058
#!/usr/bin/env python2 # Copyright (c) 2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Test mulitple rpc user config option rpcauth # from test_framework.test_framework import BitcoinTestFrame...
kzcashteam/kzcash
qa/rpc-tests/multi_rpc.py
Python
mit
4,593
config = { # Interval between speedtests 'INTERVAL': 5, # Interval Units can be: seconds, minutes, hours, days, ... 'INTERVAL_UNIT': 'minutes', # Output file 'SAVE_FILE': 'results.csv', }
franksh/scheduled-speedtest
config.py
Python
mit
212
#!/usr/bin/env python3 # -*- coding: ascii -*- '''r Run JavaScript code from Python. PyExecJS is a porting of ExecJS from Ruby. PyExecJS automatically picks the best runtime available to evaluate your JavaScript program, then returns the result to you as a Python object. A short example: >>> import execjs >>> execjs...
albertaleksieiev/zpy
execjs/__init__.py
Python
mit
1,441
from __future__ import print_function import os import re import random import gc import subprocess from glob import glob from collections import OrderedDict from moviepy.editor import VideoFileClip, concatenate import audiogrep from .vtt import parse_auto_sub from .timecode import Timecode from . import searcher u...
antiboredom/videogrep
videogrep/videogrep.py
Python
mit
18,643
# # zurllib.py # # This is (hopefully) a drop-in for urllib which will request gzip/deflate # compression and then decompress the output if a compressed response is # received while maintaining the API. # # by Robert Stone 2/22/2003 # extended by Matt Chisholm # from BitTorrent.platform import user_agent import urllib...
rays/ipodderx-core
BitTorrent/zurllib.py
Python
mit
4,720
from datetime import datetime from collections import namedtuple BASE_URL = 'http://conworkshop.com/' class User(namedtuple('User', 'uid name gender bio country karma')): @property def link(self): '''Return a URL in a string to the user's profile page on CWS.''' return ''.join([BASE_URL, 'view...
xylophonw/cwspy
cwspy/data.py
Python
mit
1,465
try: import torch from torch.utils import data as t_data from transformers import AutoTokenizer, AutoModelForSeq2SeqLM except ImportError: # No installation required if not using this function pass from nlpaug.model.lang_models import LanguageModels class MtTransformers(LanguageModels): def _...
makcedward/nlpaug
nlpaug/model/lang_models/machine_translation_transformers.py
Python
mit
3,112
from office365.runtime.client_object_collection import ClientObjectCollection from office365.runtime.client_query import ServiceOperationQuery from office365.runtime.resource_path_service_operation import ResourcePathServiceOperation from office365.sharepoint.attachmentfile import AttachmentFile from office365.sharepoi...
vgrem/SharePointOnline-REST-Python-Client
office365/sharepoint/attachmentfile_collection.py
Python
mit
1,876
#-*- coding: utf-8 -*- # alert # # Copyright (C) 20012-2014 coclib # Authors: Tran Huu Cuong <tranhuucuong91@gmail.com> # URL: http://tranhuucuong91.wordpress.com/ # License: BSD from .send_alert import send_alert
tranhuucuong91/coclib
coclib/alert/__init__.py
Python
mit
220
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('usuario', '0003_auto_20140909_1051'), ] operations = [ migrations.AddField( model_name='usuario', na...
ongame-entretenimento/cadastro
usuario/migrations/0004_usuario_hash.py
Python
mit
446
__author__ = 'Alexander Black' import socket import select import sys def prompt(): sys.stdout.write("> ") sys.stdout.flush() class Client(object): def __init__(self): self.host = sys.argv[1] self.port = int(sys.argv[2]) self.sock = None self.connect_to_server() def ...
alexwhb/simple-python-chat-server
client.py
Python
mit
1,667
from functools import wraps import json from django.http import JsonResponse, HttpResponseNotAllowed from django.utils.decorators import available_attrs def methods(method_list): def decorator(func): @wraps(func, assigned=available_attrs(func)) def inner(request, *args, **kw): if requ...
baby5/Django-httpbin
httpbin/bin/helpers.py
Python
mit
1,339
"""Diagnostics support for the Mazda integration.""" from __future__ import annotations from typing import Any from homeassistant.components.diagnostics.util import async_redact_data from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_EMAIL, CONF_PASSWORD from homeassistant.core ...
rohitranjan1991/home-assistant
homeassistant/components/mazda/diagnostics.py
Python
mit
1,836
# Copyright (c) 2012 Dominic van Berkel # See LICENSE for details. from plugs import plugbase from util import Event class AuthPlug(plugbase.Plug): """Auth plug. Handles auth stuffs.""" name = 'Auth' # manual_auths is a dict of source:target that are created after !auth requests so they can be # re...
barometz/shirk
plugs/Auth/auth.py
Python
mit
3,986
""" examples: # Tour awards # available parameters stats/models.py/class Player # streak 100 or more def fighter_ace(player): return player.streak_max >= 100 # total air kills 20 or more def example_2(player): if player.ak_total >= 20: return True # 20 air kills and 200 ground kills def example_3...
Flyingfox646/flyingfox
src/custom/rewards.py
Python
mit
1,025
from flask import Flask, request from flask_bootstrap import Bootstrap from flask.ext.sqlalchemy import SQLAlchemy from flask.ext.login import LoginManager, current_user from flask_pagedown import PageDown from os import path from flask_gravatar import Gravatar from config import config from flask_babel import Babel b...
GregoryShen/Flaskk
app/__init__.py
Python
mit
1,305
# encoding=utf8 """ Module containing functions and methods related to sequences in number theory such as the Fibonacci sequence, the 3n + 1 problem, and more. """ import numpy as np from mathpy.numtheory.integers import iseven from decimal import Decimal, localcontext def catalan(n, prec=1000):...
aschleg/mathpy
mathpy/numtheory/sequences.py
Python
mit
8,092
from plasmaBot.plugin import PBPlugin, PBPluginMeta, Response, PBPluginConfig import discord import asyncio from SQLiteHelper import SQLiteHelper as sq from plasmaBot import exceptions import logging log = logging.getLogger('discord') # Database Default Classes class dbt_moderation_settings(object): def __init...
PlasmaRobotics2403/PlasmaBot
plasmaBot/plugins/moderation.py
Python
mit
32,260
# SPDX-License-Identifier: MIT # Copyright (C) 2004-2008 Tristan Seligmann and Jonathan Jacobs # Copyright (C) 2012-2014 Bastian Kleineidam # Copyright (C) 2015-2021 Tobias Gruetzmacher # Copyright (C) 2019-2020 Daniel Ring import os from ..scraper import _ParserScraper from ..helpers import bounceStarter XPATH_LINK ...
webcomics/dosage
dosagelib/plugins/comicfury.py
Python
mit
56,565
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import unicode_literals import io import re from os.path import join, dirname from setuptools import setup, find_packages RE_MD_CODE_BLOCK = re.compile(r'```(?P<language>\w+)?\n(?P<lines>.*?)```', re.S) RE_SELF_LINK = re.compile(r'\[(.*?)\]\[\]') RE_LINK_...
opendatateam/docker-udata
samples/theme/my-theme/setup.py
Python
mit
3,719
from django.db import models from .base import MessageAbstractModel class SMS(MessageAbstractModel): cmid = models.TextField() class Meta: verbose_name = 'SMS' verbose_name_plural = verbose_name def send_message(self, async=True): from communications.tasks.sms import SendSMSTas...
dobestan/fastblog
fastblog/communications/models/sms.py
Python
mit
442
from dartsense.webapp import app from flask import render_template, jsonify, g @app.route('/test/') @app.route('/test') def test_index(): return "test page works"
basbloemsaat/dartsense
lib/dartsense/webapp/views/test.py
Python
mit
167
# ------------------------------------------------------------------------------- # Name: module1 # Purpose: # # Author: Stefan # # Created: 11.07.2017 # Copyright: (c) Stefan 2017 # Licence: <your licence> # ------------------------------------------------------------------------...
stcioc/localdocindex
python/scrape_ps3.py
Python
mit
7,074
# -*- coding: utf-8 -*- # # cryptools documentation build configuration file, created by # sphinx-quickstart on Wed Mar 27 03:23:33 2013. # # 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. # # A...
axtl/cryptools
doc/conf.py
Python
mit
8,120
from django import forms from dashboard.models import CountryDemographic, FacilityAccess, SectorPerformance, PriorityAreaStatus, Technology from dashboard.models import Country, PriorityArea, SectorCategory, TenderProcedurePerformance, TenderProcedureProperty class CountryStatusForm(forms.ModelForm): class Meta: ...
eyassug/au-water-sanitation-template
dashboard/forms.py
Python
mit
3,400
import urllib import urllib2 import json GCM_URL = 'https://android.googleapis.com/gcm/send' class GCMException(Exception): pass class GCMMalformedJsonException(GCMException): pass class GCMConnectionException(GCMException): pass class GCMAuthenticationException(GCMException): pass class GCMTooManyRegIdsException(GC...
uniite/pyirc
gcm/gcm.py
Python
mit
4,198
from technobot import api from technobot import utils from threading import Timer from functools import wraps import re import copy import logging logging.basicConfig(level = logging.DEBUG) class TechnoBot: def __init__(self, token, exit_button=None, ignore_old=False, timeout=3): self.token = ...
apy2017/Anaconda
technobot/__init__.py
Python
mit
6,849
from greenlet import greenlet import os from sandbox import Sandbox, SandboxConfig from redux.internal.exceptions import RobotDeathException import traceback # this is just for testing LOADER_CODE_TEST = """ import time while True: try: print 'running... %s' % str(rc) time.sleep(1) print 'd...
trun/redux
redux/internal/scheduler.py
Python
mit
5,911
import pdb import itertools as it def scinot(string): """Takes a string in MCNP scientific notation (without 'E' character), and returns a string of standard scientific notation.""" """If there is no '+' or '-' character in string, returns it as it is.""" """If the argument is not string, returns the argument""" i...
haupt235/waldo
modules.py
Python
mit
2,660
#!/usr/bin/env python3 """ Calculate minor reads coverage. Minor-read ratio (MRR), which was defined as the ratio of reads for the less covered allele (reference or variant allele) over the total number of reads covering the position at which the variant was called. (Only applied to hetero sites.) ...
wavefancy/BIDMC-PYTHON
Exome/MinorReadsCoverage/MinorReadsCoverage.py
Python
mit
3,687
#! /usr/bin/env python # -*- coding: utf-8 -*- """ Internal library class which holds all the bound functions """ # TODO : Comments,docstring, tests,code.. import ctypes as C from ctypes.util import find_library import os import sys from warnings import warn from .utils import * from .varnam_defs import * class Inte...
sebinthomas/pyvarnam
pyvarnam/library.py
Python
mit
3,238
from __future__ import with_statement import distribute_setup distribute_setup.use_setuptools() import os # disables creation of .DS_Store files inside tarballs on Mac OS X os.environ['COPY_EXTENDED_ATTRIBUTES_DISABLE'] = 'true' os.environ['COPYFILE_DISABLE'] = 'true' def autosetup(): from setuptools import se...
CharityAdmin/CharityAdmin
setup.py
Python
mit
774
""" Module for email related functionality. """ from flask_mail import Message import api mail = None from api.common import check, validate, safe_fail from api.common import WebException, InternalException from voluptuous import Required, Length, Schema from datetime import datetime password_reset_request_schema ...
cganas/picoCTF-web
api/email.py
Python
mit
6,072
# Step 1: Make all the "turtle" commands available to us. import turtle # Step 2: create a new turtle, we'll call him simon simon = turtle.Turtle() # Lets draw a square! for loop in range(4): simon.forward(200) simon.left(90)
SimonDevon/simple-python-shapes
square1.py
Python
mit
236
import pandas as pd import urllib.request import json from datanator_query_python.config import config from datanator_query_python.util import mongo_util class ParseMetaboliteConcentration(mongo_util.MongoUtil): def __init__(self, MongoDB=None, db=None, ...
KarrLab/kinetic_datanator
datanator/parse_metabolite_concentration.py
Python
mit
2,388
import qctests.EN_stability_check import util.testingProfile import numpy import util.main as main ##### EN_stability_check ---------------------------------------------- class TestClass(): parameters = { "table": 'unit' } def setUp(self): # this qc test will go looking for the profile ...
s-good/AutoQC
tests/EN_stability_check_validation.py
Python
mit
2,925
# coding: utf-8 from __future__ import unicode_literals import pytest from django import template from forme import styles def test_indexing(): style = styles.Style() style['forme'] = 'Foo' style['forme', 'test'] = 'Bar' assert style['forme', styles.Default] == style['forme'] assert style['forme'...
tricoder42/django-forme
tests/test_styles.py
Python
mit
787
""" A brief demonstration of using the prover within Forseti """ from __future__ import print_function from forseti.prover import Prover # pylint: disable=duplicate-code prover = Prover() prover.add_formula("or(iff(G,H),iff(not(G),H))") prover.add_goal("or(iff(not(G),not(H)),not(iff(G,H)))") print(prover.run_prover()...
MasterOdin/forseti
main.py
Python
mit
702
""" Fantasy sports pages """ from . import team __all__ = ['team']
jbrudvik/yahooscraper
yahooscraper/fantasy/__init__.py
Python
mit
69
#!/usr/bin/python3 # -*- coding: utf-8 -*- ''' #title : summarize.py #description : summarize for each IP listed, all of the ports being used, # and where possible to do a port range (don't want to # list out thousands of individual port numbers) #author : #date ...
theDevilsVoice/milton
summarize.py
Python
mit
3,315
""" This class is used to speed up general, day-to-day programming needs. It contains a variety of very commonly used functions - anything from retrieving a custom list of dates to retrieving Dictionaries of Backpage cities' coordinates. """ from copy import deepcopy import csv from datetime import datetime, timede...
usc-isi-i2/etk
etk/data_extractors/htiExtractors/utils.py
Python
mit
18,615
from dill import dill from kombu.serialization import pickle_loads, pickle_protocol, registry from kombu.utils.encoding import str_to_bytes def register_dill(): def encode(obj, dumper=dill.dumps): return dumper(obj, protocol=pickle_protocol) def decode(s): return pickle_loads(str_to_bytes(s),...
mathiasose/celery_dill_serializer
celery_dill_serializer/__init__.py
Python
mit
525
# -*- coding: utf-8 -*- # Generated by Django 1.9 on 2016-01-26 02:11 from __future__ import unicode_literals import datetime from django.db import migrations, models from django.utils.timezone import utc class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ ...
GzkV/bookstore_project
store/migrations/0001_initial.py
Python
mit
839
#!/usr/bin/env python import sys from django.conf import settings import django if not settings.configured: import os os.environ['DJANGO_SETTINGS_MODULE'] = 'testing_settings' from distutils.version import StrictVersion if not StrictVersion(django.get_version()) < StrictVersion("1.8"): django...
lfalvarez/django-candidator
runtests.py
Python
mit
638
# -*- 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): # Adding model 'Reblog' db.create_table('punns_reblog', ( ('id', self.gf('django.db.models.field...
carquois/blobon
blobon/punns/migrations/0021_auto__add_reblog.py
Python
mit
6,910
import os from setuptools import setup setup( name = 'logipy', version = '1.3.1', author = 'Tom Lambert', author_email = 'devtechsupport@logitech.com', description = ('A simple python wrapper for Logitech G\'s LED and Arx SDKs.'), long_description = open('README.rst').read(), keywords = ['l...
Logitech/logiPy
setup.py
Python
mit
716
from circularbuffer import CircularBuffer from pytest import raises def test_index(): buf = CircularBuffer(32) buf.write(b'asdf\r\njkl;\r\n1234\r\n') assert buf.index(b'\r\n') == 4 assert buf.index(b'\r\n', 5) == 10 with raises(ValueError): buf.index(b'x') buf.clear() buf.write(b'a...
dozymoe/PyCircularBuffer
tests/test_index.py
Python
mit
527
class DataframeMock(object): def __init__(self): pass def dtypes(self): return ['field1, field2'] def saveAsParquetFile(self, tablepath): if(tablepath not in ['swift://containerFiles.SparkTest/file/file_ORDERS.parquet', 'swift://containerFeatures.SparkTest/feat.parquet']): ...
CSC-IT-Center-for-Science/spark-analysis
sparkles/modules/tests/dataframe_mock.py
Python
mit
389
# -*- coding: utf-8 -*- """ Created on Wed May 10 11:15:22 2017 @author: lracuna """ from vision.camera import Camera from vision.plane import Plane from vision.screen import Screen import numpy as np import matplotlib.pyplot as plt from mayavi import mlab import cv2 #%% Create a camera cam = Camera() #Set camera ...
raultron/ivs_sim
python/old_experiments/screen_calibration_3cam_views.py
Python
mit
3,386
#!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = 'eternnoir' def Convert(originFilePath,desFilePath): return True
eternnoir/pyfficeConverter
pyfficeConverter/Converter.py
Python
mit
137
from django.contrib import admin from .models import * from django.forms import CheckboxSelectMultiple class RubrosPrincipalesInlines(admin.TabularInline): model = RubrosPrincipales extra = 1 max_num = 3 class ActividadEmpresarialInlines(admin.TabularInline): model = ActividadEmpresarial formfield...
CARocha/simasinnovacion
empresas/admin.py
Python
mit
4,030
# This file is part of Indico. # Copyright (C) 2002 - 2019 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from __future__ import unicode_literals from collections import namedtuple from io import BytesIO from op...
OmeGak/indico
indico/modules/users/controllers.py
Python
mit
29,032
import datetime def prep_data(data): # type: (dict) -> dict """Takes a dict intended to be converted to JSON for use with Google Charts and transforms date and datetime into date string representations as described here: https://developers.google.com/chart/interactive/docs/datesandtimes TODO: I...
wikkiewikkie/flask-googlecharts
flask_googlecharts/utils.py
Python
mit
1,703
""" Django settings for frontpage_backend project. Generated by 'django-admin startproject' using Django 1.10.3. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ ...
CyriusG/frontpage_backend
frontpage_backend/settings.template.py
Python
mit
4,611
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('quizzes', '0004_auto_20150811_1354'), ] operations = [ migrations.AlterModelOptions( name='choice', ...
ikedumancas/ikequizgen
quizzes/migrations/0005_auto_20150813_0645.py
Python
mit
1,156
#!/usr/bin/env python from wsgiref.simple_server import make_server import sys import json import traceback import datetime from multiprocessing import Process from getopt import getopt, GetoptError from jsonrpcbase import JSONRPCService, InvalidParamsError, KeywordError,\ JSONRPCError, InvalidRequestError from jso...
MrCreosote/kb_read_library_to_file
lib/kb_read_library_to_file/kb_read_library_to_fileServer.py
Python
mit
23,263
import json import os import datetime import time import hashlib from datetime import datetime import requests import pymongo from .logging import setup_logging from .db import connect_to_db def file_mtime(path): return datetime.fromtimestamp(os.stat(path).st_mtime) def md5_hex(data): if hasattr(data, 'e...
irvind/logster
logster/scanner.py
Python
mit
2,138
from ansible.playbook import PlayBook def GraphBook(PlayBook): pass
Alphadelta14/python-ansible-graph
ansible/graph/__init__.py
Python
mit
75
from flask import Flask from flask_stache import render_view, render_template from example.admin import create_blueprint class Home(object): def msg(self): return "Home" def msg2(self): return "Partial Content" class About(object): def msg(self): return "About" def create_ap...
mattupstate/flask-stache
example/__init__.py
Python
mit
806
import traceback import requests import time import imghdr from os.path import exists, isfile, join, isdir from os import makedirs, listdir, walk from flask import Blueprint, request, send_from_directory, render_template filestore = Blueprint('callback', __name__) @filestore.route('/clone', methods=["POST"]) def clo...
gradiuscypher/internet_illithid
mirror_shield/endpoints/filestore.py
Python
mit
2,550
"""Tests for the simple rate limiting classes of the ``unshorten`` app.""" from mock import Mock from django.conf import settings from django.test import TestCase from mixer.backend.django import mixer from ..backend import RateLimit from ..models import APICallDayHistory class SimpleRateLimitTestCase(TestCase): ...
bitmazk/django-unshorten
unshorten/tests/rate_limit_tests.py
Python
mit
1,841
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("conferences", "0008_auto_20150601_1436"), ] operations = [ migrations.AddField( model_name="conferenceproposalre...
pythonindia/junction
junction/conferences/migrations/0009_conferenceproposalreviewer_nick.py
Python
mit
534
import pytest from mitmproxy.addons import intercept from mitmproxy import exceptions from mitmproxy.test import taddons from mitmproxy.test import tflow @pytest.mark.asyncio async def test_simple(): r = intercept.Intercept() with taddons.context(r) as tctx: assert not r.filt tctx.configure(r...
mitmproxy/mitmproxy
test/mitmproxy/addons/test_intercept.py
Python
mit
1,632
# -*- coding: utf-8 -*- stopwords = """ | A French stop word list. Comments begin with vertical bar. Each stop | word is at the start of a line. au | a + le aux | a + les avec | with ce | this ces | these dans | with de | of des ...
michelp/xodb
xodb/snowball/french/__init__.py
Python
mit
2,426
# -*- coding: utf-8 -*- from bustime.models import * from django.core.cache import cache import logging import zmq from bustime.detector import * def analyze_events(city, events, debug=False): # import yappi; yappi.start() context = zmq.Context() sock = context.socket(zmq.PUB) sock.connect(ZSUB) R...
norn/bustime
bustime/update_lib.py
Python
mit
13,164
import _plotly_utils.basevalidators class NticksValidator(_plotly_utils.basevalidators.IntegerValidator): def __init__( self, plotly_name="nticks", parent_name="layout.ternary.caxis", **kwargs ): super(NticksValidator, self).__init__( plotly_name=plotly_name, parent_nam...
plotly/python-api
packages/python/plotly/plotly/validators/layout/ternary/caxis/_nticks.py
Python
mit
505
# I was just curious how well I could approximate the rl5 starting values # with an interpolative scheme from quadracheer.rl5 import * import numpy as np import matplotlib.pyplot as plt fnc = lambda ay, by: mu_5_4(ay, by, k1(ay, by), k2(ay, by)) ay = np.linspace(-2, 2, 100) by = np.linspace(-2.0, 2.0, 100) Ay, By = ...
tbenthompson/quadracheer
interpolate_rl5.py
Python
mit
496
# -*- coding: utf-8 -*- # Generated by Django 1.10.4 on 2017-02-26 03:49 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='PriceT...
priestc/MultiExplorer
multiexplorer/pricetick/migrations/0001_initial.py
Python
mit
872
#!/usr/bin/python import re import csv import os import json def read_csv(fn): results = {} with open(fn, 'rb') as csvfile: rows = csv.reader(csvfile, delimiter=',') for row in rows: m = re.search('Total Transactions', row[1]) if len(row) == 7 and m: tem...
franklingu/Cassandra-benchmarking
benchmarking/sum_up.py
Python
mit
1,889
import os import logging from PyQt5.QtCore import Qt, pyqtSignal from PyQt5.QtGui import QCursor from PyQt5.QtWidgets import \ QWidget, QSplitter, QTreeWidget, QTreeWidgetItem, QMenu, \ QTableWidgetItem from sheetwidget import SheetWidget from commonwidgets import * class SourcesWidget(QSplitter): updateReque...
takumak/tuna
src/sourceswidget.py
Python
mit
4,761
#Equals and hash class Eq(object): def __init__(self, data): self.data = data def __eq__(self, other): return self.data == other.data class Ne(object): def __init__(self, data): self.data = data def __ne__(self, other): return self.data != other.data class Hash(obj...
github/codeql
python/ql/test/3/query-tests/Classes/equals-hash/equals_hash.py
Python
mit
1,147
""" Support for the implementation from Goodfellow, Ian, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. "Generative adversarial nets." In Advances in Neural Information Processing Systems, pp. 2672-2680. 2014. TODO: There seems to be something wro...
ragavvenkatesan/Convolutional-Neural-Networks
yann/special/gan.py
Python
mit
41,157
"""Development settings for facet project.""" from django.conf import settings from django.test.runner import DiscoverRunner from django.core.mail.utils import DNS_NAME from .base import * ############################################################################## # Core Django stuff SECRET_KEY = "abc...
ProjectFacet/facet
project/project/settings/development.py
Python
mit
2,242
#!/usr/bin/env python2.7 import os, sys from Bio import SeqIO import argparse from fast5tools.fxclass import * ################################################# ## Argument Parser ################################################# parser = argparse.ArgumentParser(description = """ Given path(s) to fasta/fastq file(s)...
JohnUrban/fast5tools
bin/filterFast5DerivedFastx.py
Python
mit
11,145
# SPDX-License-Identifier: MIT # Copyright (C) 2019-2020 Tobias Gruetzmacher # Copyright (C) 2019-2020 Daniel Ring from .common import _ParserScraper class NamirDeiter(_ParserScraper): imageSearch = '//img[contains(@src, "comics/")]' prevSearch = ('//a[@rel="prev"]', '//a[./img[contains(@src...
webcomics/dosage
dosagelib/plugins/namirdeiter.py
Python
mit
2,179
import glob import importlib import settings import os import sys def import_all(name, object_name): modules = glob.glob(os.path.join(settings.BASE_DIR, name) + "/*.py") all_objects = [] for module in modules: module_name = os.path.basename(module)[:-3] if module_name == "__init__": ...
ovkulkarni/hangoutsbot
utils/imports.py
Python
mit
522
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: model.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflect...
transcranial/keras-js
python/model_pb2.py
Python
mit
6,998
# Copyright 2017 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
Sorsly/subtle
google-cloud-sdk/lib/googlecloudsdk/command_lib/deployment_manager/type_providers.py
Python
mit
6,219
""" Support for getting data from websites with scraping. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.scrape/ """ import logging import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.component...
betrisey/home-assistant
homeassistant/components/sensor/scrape.py
Python
mit
3,388
# coding: utf-8 # © simpleApps, 2014 — 2016. __authors__ = ("Al Korgun <alkorgun@gmail.com>", "John Smith <mrdoctorwho@gmail.com>") __version__ = "2.3" __license__ = "MIT" """ Implements a single-threaded longpoll client """ import select import socket import json import httplib import threading import time import v...
mrDoctorWho/vk4xmpp
library/longpoll.py
Python
mit
10,264
from allauth.socialaccount.providers.facebook.views import FacebookOAuth2Adapter from allauth.socialaccount.providers.shopify.views import ShopifyOAuth2Adapter from rest_auth.registration.views import SocialLoginView class FacebookLogin(SocialLoginView): adapter_class = FacebookOAuth2Adapter class ShopifyLogin...
dvl/imagefy-web
imagefy/core/views.py
Python
mit
380
import datetime import logging import celery from django.conf import settings from django.db import transaction from django.db.utils import IntegrityError from django.utils import timezone from .models import ( PushNotification, Device, get_filtered_devices_queryset ) from .exceptions import ( PushIn...
rakanalh/django-pushy
pushy/tasks.py
Python
mit
4,276