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/python3 # -*- coding: utf-8 -*- """ Widget to display simulation data of a CSDF graph. author: Sander Giesselink """ import sys from PyQt5.QtWidgets import QWidget, QGraphicsItem, QPushButton, QVBoxLayout, QMenu, QAction, QInputDialog, QMessageBox from PyQt5.QtCore import QRectF, QRect, QPoin...
rinsewester/SchemaViz
node.py
Python
mit
17,791
from nltk.tokenize import word_tokenize from nltk.corpus import stopwords import sys import codecs import re #remove empty lines #tokenize and remove stopwords def preprocess(doc): """ Preprocess a document: tokenize words, lowercase, remove stopwords, non-alphabetic characters and empty lines""" sw = stopwor...
juliakreutzer/wtfrnn
preprocess.py
Python
mit
1,048
"""CS411Project URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.8/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Clas...
cs411sp15vmnjhtdw/MeetU
CS411Project/urls.py
Python
mit
837
from SceneGenerator import * import math import random def scale(vec, s): vec[0] *= s vec[1] *= s vec[2] *= s return vec s = 1 scene = generateScene('CarScene', camPosition=[1,5,20], camLookat=[0,0,0]) addParameters(scene, h=0.005, maxIter=50, maxIterVel=50, contactTolerance=0.01, gravity=[0,-2,0],...
janbender/PositionBasedDynamics
data/scenes/CarScene.py
Python
mit
4,517
# -*- coding: utf-8 -*- #HOMEWORK: HOMEWORK 2.1 #In this problem, you will be using a collection of student scores that is similar to what we used in the lessons. Please download grades.json from the Download Handout link and import it into your local mongo database as follows: #mongoimport -d students -c grades < gra...
baocongchen/M101P-MONGODB-FOR-PYTHON-DEVELOPERS
week2/Homework2.1.py
Python
mit
1,208
#!/usr/bin/env python # -*- coding: utf-8 -*- import time class CameraClass(object): ''' docstring for CameraClass ''' def __init__(self): super(CameraClass, self).__init__() def visible_target(self): ''' Returns true if target is visible ''' retur...
twistedretard/LaserSimulatedSecurityTurret
src/turret/camera.py
Python
mit
620
import time import os import warnings import matplotlib.pyplot as plt import battery try: from PySide.QtCore import * from PySide.QtGui import * except ModuleNotFoundError: # no PySide from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * # String formatting on print(t...
cheeseywhiz/cheeseywhiz
GUIs/Battery/graph.py
Python
mit
2,547
# Storage of the scope map # The purpose of this setup is that the OAuth scope of any app can be stored # in a single field. This way, we can easily add more scopes later. # We have a BigIntegerField to work with, which means 64 bits of storage. # This translates into 64 types of scope, each of which can be checked wit...
uclapi/uclapi
backend/uclapi/oauth/scoping.py
Python
mit
4,517
from os.path import join, dirname from glob import glob from fabric.api import env env.package_name = 'mddns' env.user = '' env.hosts = [ ] # Assets pipeline configuration (may not be needed if the project does not # make use of assets and/or static files for web development) env.assets_dir = join(env.package_name,...
GaretJax/mddns
fabfile.py
Python
mit
514
from croplands_api import api from croplands_api.models import User from croplands_api.views.api.processors import api_roles, remove_relations from croplands_api.exceptions import Unauthorized from croplands_api.auth import is_anonymous, current_user, verify_role def can_edit_the_user(data=None, **kwargs): """ ...
justinwp/croplands
croplands_api/views/api/users.py
Python
mit
2,237
SETTINGS_TMPL = '''import os from glueplate import Glue as _ settings = _( blog = _( title = '{blog_title}', base_url = '{base_url}', language = '{language}', ), dir = _( output = os.path.abspath(os.path.join('..', 'out')) ), GLUE_PLATE_PLUS_BEFORE_template_dirs = [o...
tsuyukimakoto/biisan
biisan/constants.py
Python
mit
1,015
import numpy import math def mkRamp(*args): ''' mkRamp(SIZE, DIRECTION, SLOPE, INTERCEPT, ORIGIN) Compute a matrix of dimension SIZE (a [Y X] 2-vector, or a scalar) containing samples of a ramp function, with given gradient DIRECTION (radians, CW from X-axis, default = 0), SLOPE (per pixel...
tochikuji/pyPyrTools
pyrtools/mkRamp.py
Python
mit
1,617
from django.db import models from django.utils import timezone # Create your models here. class Comment(models.Model): title = models.CharField(max_length=200) comment_text = models.TextField() rating = models.IntegerField() created_date = models.DateTimeField(default = timezone.now) published_dat...
marioluigiman/geekchicken
cafe/models.py
Python
mit
960
import asyncio import os import time import peru.cache from shared import assert_contents, create_dir, make_synchronous, PeruTest class CacheTest(PeruTest): @make_synchronous def setUp(self): self.cache = yield from peru.cache.Cache(create_dir()) self.content = { 'a': 'foo', ...
oconnor663/peru
tests/test_cache.py
Python
mit
18,779
import ssadata hist = {} for key in ssadata.boys: first_letter = key[0] value = ssadata.boys[key] if first_letter not in hist: hist[first_letter] = 0 hist[first_letter] = hist[first_letter] + value for key in ssadata.girls: first_letter = key[0] value = ssadata.girls[key] if first...
guyrt/teaching
2017/Com597I/babynames/week4_solution.py
Python
mit
438
import _plotly_utils.basevalidators class AlignsrcValidator(_plotly_utils.basevalidators.SrcValidator): def __init__( self, plotly_name="alignsrc", parent_name="histogram2dcontour.hoverlabel", **kwargs ): super(AlignsrcValidator, self).__init__( plotly_name=...
plotly/python-api
packages/python/plotly/plotly/validators/histogram2dcontour/hoverlabel/_alignsrc.py
Python
mit
501
""" Settings file for OpenSlides. For more information on this file, see https://github.com/OpenSlides/OpenSlides/blob/master/SETTINGS.rst """ import os import json from openslides.global_settings import * class MissingEnvironmentVariable(Exception): pass undefined = object() def get_env(name, default=undef...
FinnStutzenstein/OpenSlides
server/docker/settings.py
Python
mit
5,214
# -*- coding: utf-8 -*- """ Created on Tue Dec 8 17:10:51 2015 @author: kawatson Purpose: Download data from select SNOTEL sites for a given time period and save data to text files Required libraries: Climata (available via PyPI | "pip install climata") """ # Import Climata from climata.snotel import Regi...
LEAF-BoiseState/SPEED
Other/download_SNOTEL.py
Python
mit
805
#!/bin/python import sys,os,sqlite3,time,ntpath,psycopg2,grp,pwd from random import randint class color: PURPLE = '\033[95m' CYAN = '\033[96m' DARKCYAN = '\033[36m' BLUE = '\033[94m' GREEN = '\033[92m' YELLOW = '\033[93m' RED = '\033[91m' BOLD = '\033[1m' UNDERLINE = '\033[4m' END = '\033...
pglivebackup/pgchain
pgchain.py
Python
mit
26,324
import os import xmlrpc.client from subprocess import Popen, PIPE import shutil pypi = xmlrpc.client.ServerProxy('https://pypi.org') DIRECTORIES_TO_SEARCH_FORM = [ os.path.join('.'), os.path.join('pyforms-web'), os.path.join('pyforms-web', 'orquestra'), os.path.join('pyforms-gui'), os.path.join('...
UmSenhorQualquer/pyforms
utils/deploy-pypi.py
Python
mit
2,402
#!/usr/bin/env python3 base = open("test.txt", "r") tests = base.readlines() base.close() is_in = False is_out = False test_number = 0 for line in tests: if line == 'Input:\n': is_out = False is_in = True if test_number > 0: test_out.close() test_in =...
IamMoondance/Attempts
hw_01_04/convert_tests.py
Python
mit
672
# coding=utf-8 import glob import hashlib import io import os import zipfile from pathlib import Path from tempfile import TemporaryDirectory import nbconvert import nbformat from .model import Model def run(bytes_in): myzipfile = zipfile.ZipFile(bytes_in) with TemporaryDirectory() as temp_dir: """...
bdestombe/flopymetascript
flopymetascript/metafunctions.py
Python
mit
9,791
import os from django.db import models from django import forms class Location(models.Model): name = models.CharField(max_length=250) local_name = models.CharField(max_length=250) visited = models.BooleanField(default=False) coordinates = models.CharField(max_length=250) detail = models.TextField(...
Javid-Izadfar/TaOonja
taOonja/game/models.py
Python
mit
444
import csv import pickle from WeightFinder import WeightFinder import time from mpi4py import MPI import pickle from demos import cmd comm = MPI.COMM_WORLD rank = comm.Get_rank() finder = WeightFinder() def get_movie_grade(movie_id): try: f = open('../training_set/mv_'+str(movie_id).zfill(7)+'.txt','r') except: r...
CSC522-Data-mining-NCSU/reputation-hpc
calc_repu/getMovieGrade.py
Python
mit
1,211
#!/usr/bin/env python # coding=utf-8 # Definition for singly-linked list. # class ListNode(object): # def __init__(self, x): # self.val = x # self.next = None import random class Solution(object): def __init__(self, head): """ @param head The linked list's head. Note t...
xijunlee/leetcode
382.py
Python
mit
1,001
import importlib import os # ASG loss requires flashlight bindings files_to_skip = set() try: import flashlight.lib.sequence.criterion except ImportError: files_to_skip.add("ASG_loss.py") for file in sorted(os.listdir(os.path.dirname(__file__))): if file.endswith(".py") and not file.startswith("_") and f...
pytorch/fairseq
examples/speech_recognition/criterions/__init__.py
Python
mit
510
from fastapi import FastAPI app = FastAPI(swagger_ui_parameters={"syntaxHighlight": False}) @app.get("/users/{username}") async def read_user(username: str): return {"message": f"Hello {username}"}
tiangolo/fastapi
docs_src/extending_openapi/tutorial003.py
Python
mit
205
from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals import csv import os import tempfile from django.core.management import call_command from django.core.management.base import CommandError from django.test import TestCase from ..csv_utils import infer...
mrpau/kolibri
kolibri/core/auth/test/test_user_import.py
Python
mit
12,796
# -*- coding: utf-8 -*- # Generated by Django 1.9.1 on 2016-02-19 00:28 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('core', '0002_auto_20160218_2359'), ] operations = [...
Golker/wttd
eventex/core/migrations/0003_contact.py
Python
mit
822
import re from setuptools import find_packages, setup try: import pypandoc readme = pypandoc.convert('README.md', 'rst') history = pypandoc.convert('CHANGELOG.md', 'rst') except (ImportError, OSError): with open('README.md') as readme_file, \ open('CHANGELOG.md') as history_file: re...
danyul/flaskmogrify
setup.py
Python
mit
1,927
''' evaluate result ''' from keras.models import load_model from keras.utils import np_utils import numpy as np import os import sys # add path sys.path.append('../') sys.path.append('../tools') from tools import conf from tools import load_data from tools import prepare # input sentence dimensions step_length =...
danche354/Sequence-Labeling
ner/evaluate-senna-hash-pos-chunk-128-64.py
Python
mit
1,788
#!/usr/bin/env python3 print('Content-type: text/html') print() primes = [2, *range(3, 10001, 2)] for div in primes: idx = div + 1 while(idx < len(primes)): if (primes[idx] % div == 0): del primes[idx] idx += 1 print(primes)
JulianNicholls/Complete-Web-Course-2.0
13-Python/challenge2.py
Python
mit
249
"""Models for the ``cmsplugin_blog_authors`` app.""" from django.db import models from django.utils.translation import ugettext_lazy as _ class EntryAuthor(models.Model): """ Mapping class to map ``Entry`` objects to ``Person`` objects. """ entry = models.ForeignKey( 'cmsplugin_blog.Entry', ...
bitmazk/cmsplugin-blog-authors
cmsplugin_blog_authors/models.py
Python
mit
689
from myhdl import * from str_builder import StrBuilder import os import sys class GenWrapperFile(object): '''| | This class is used to generate a python wrapper of a verilog design |________''' def __init__(self): self.module_name = '' self.interface = [] # keeps the order of the d...
hnikolov/pihdf
pihdf/printers/ip_wrapper_gen.py
Python
mit
6,357
# -*- coding: utf-8 -*- import logging from flask import Flask, redirect, request, jsonify, render_template, session import requests import fbvoting.pagebuilders.buildhome import fbvoting.pagebuilders.buildoverview import fbvoting.pagebuilders.buildprofile import fbvoting.pagebuilders.buildfriends import fbvoting.pag...
corradomonti/fbvoting
fbvoting/__main__.py
Python
mit
5,860
#!/usr/bin/env python #-*- coding: utf-8 -*- import multiprocessing, time class Consumer(multiprocessing.Process): def __init__(self, task_queue, result_queue): multiprocessing.Process.__init__(self) self.task_queue = task_queue self.result_queue = result_queue def run(self): p...
relic7/prodimages
python/jbmodules/image_processing/marketplace/multiprocmagick.py
Python
mit
8,914
''' Oh, an attractive module description here. ''' import os import shutil import zipfile from gi.repository import Gtk from xml.dom import minidom from xml.etree import ElementTree as ET import re import distutils.archive_util EPUB_PATH = "/home/amit/git/epub-highlighter/epub/test.epub" # print(os.path.spli(EPUB_PATH...
LordAmit/epub-highlighter
epub_highlighter.py
Python
mit
7,285
import adaptive_binning_chisquared_2sam import os systematics_fraction = 0.01 dim_list = [1,2,3,4,5,6,7,8,9,10] adaptive_binning=True CPV = True PLOT = True if CPV: orig_name="chi2_gauss_0_95__0_95_CPV_not_redefined_syst_"+str(systematics_fraction).replace(".","_")+"_" orig_title="Gauss 0.95 0.95 syst{} adaptbi...
weissercn/learningml
learningml/GoF/chi2/gauss/miranda_adaptive_binning_systematics_Gaussian_same_projection_evaluation_of_optimised_classifiers.py
Python
mit
3,491
#!/usr/bin/env python from pymongo import MongoClient import json import sys # print message and die def msgDie(msg): print msg sys.exit(2) if len(sys.argv) != 4: msgDie("usage: unifi-minder.py config.json site-name minSNR") # load config cfgFile = sys.argv[1] siteName = sys.argv[2] minSNR = sys.argv[3] with ope...
jda/unifi-tools
gen-minrssi.py
Python
mit
828
from sys import argv from os.path import exists script, from_file, to_file = argv print "Copying from %s to %s..." % (from_file, to_file) # we could do these two on one line, how? # in_file = open(from_file) # indata = in_file.read() # like this! indata = open(from_file).read() print "The input file is %d bytes lo...
amolborcar/learnpythonthehardway
ex17.py
Python
mit
649
#!/usr/local/python2.7/bin/python # -*- coding:utf-8 -*- import os import hashlib def dir_walk(base_dir): for parent_dir, dirnames, filenames in os.walk(base_dir): for filename in filenames: yield os.path.join(parent_dir, filename) def file_md5(filename): hash_md5 = hashlib.md5() wi...
leonanu/scripts
file_md5.py
Python
mit
732
__all__ = ["md5", "size", "calculate", "scan"] from md5hash.md5hash import md5, size, calculate, scan
valsaven/md5hash
md5hash/__init__.py
Python
mit
103
"""Module containing `DetectionScoreFileWriter` class.""" import wave import numpy as np import vesper.util.signal_utils as signal_utils class DetectionScoreFileWriter: """ Writes a wave file containing detector audio input in one channel and detection scores in another. """ def...
HaroldMills/Vesper
vesper/util/detection_score_file_writer.py
Python
mit
3,438
class Solution(object): def lengthOfLastWord(self, s): """ :type s: str :rtype: int """ if len(s.split()) == 0: return 0 return len(s.split()[-1]) if __name__ == '__main__': s = " sdf" print Solution().lengthOfLastWord(s)
comicxmz001/LeetCode
Python/58_LengthofLastWord.py
Python
mit
291
from sys import maxint class BellmanFord( object ): def __init__( self ): ''' Constructor ''' def singleSourceShortestPath( self, weight, source ) : # auxiliary constants SIZE = len( weight ) EVE = -1; # to indicate no predecessor INFINITY = maxint # declare and initializ...
salman-bhai/DS-Algo-Handbook
Algorithms/Graph_Algorithms/Bellman_Ford/bellman_ford.py
Python
mit
1,400
import logging from django.shortcuts import render from django.http import JsonResponse from django.db.models import Count from homeinventory.inventory.models import Item, Category, Location, ItemLoan logger = logging.getLogger(__name__) def dashboard(request): # get loans item_loan = ItemLoan.objects \ ...
le4ndro/homeinventory
homeinventory/dashboard/views.py
Python
mit
1,435
# 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/subscriptions/v2016_06_01/aio/_subscription_client.py
Python
mit
4,453
import SimpleHTTPServer, SocketServer import urlparse, os PORT = 8002 class MyHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): def do_GET(self): # Parse query data to find out what was requested parsedParams = urlparse.urlparse(self.path) # See if the file requested exists if os.ac...
CloudFramework-io/js-cloudframework
test/simple_server.py
Python
mit
848
"""Mode which allows the player to select another mode to run.""" from mpf.core.utility_functions import Util from mpf.core.mode import Mode class Carousel(Mode): """Mode which allows the player to select another mode to run.""" __slots__ = ["_all_items", "_items", "_select_item_events", "_next_item_events...
missionpinball/mpf
mpf/modes/carousel/code/carousel.py
Python
mit
6,517
import datetime import gzip import io import json import time from django.db.models import Q from django.http import HttpResponse from django.http import HttpResponseBadRequest from django.http import HttpResponseNotFound from django.utils import timezone from django.views.decorators.csrf import csrf_exempt from djang...
learningequality/kolibri
kolibri/core/public/api.py
Python
mit
12,019
from urlparse import urlparse import logging import urllib3 import pyramid_airbrake log = logging.getLogger(__name__) def create_http_pool(settings): url = settings['notification_url'] maxsize = settings['threaded.threads'] # sort of a lie, potentially timeout = settings['timeout'] if settings['us...
epii/pyramid_airbrake
pyramid_airbrake/airbrake/submit.py
Python
mit
3,343
import numpy as np # (comments based on t_tide) # Coefficients of the formulas in the Explan. Suppl. _sc = np.array([270.434164, 13.1763965268, -0.0000850, 0.000000039]) _hc = np.array([279.696678, 0.9856473354, 0.00002267, 0.000000000]) _pc = np.array([334.329556, 0.1114040803, -0.0007739, -0.00000026]) _npc = np.ar...
wesleybowman/UTide
utide/astronomy.py
Python
mit
4,983
#! /usr/bin/env python """ Takes a single hit table file and generates a table (or tables) of pathway/gene family assignments for the query sequences (aka 'reads'). Assignments can be for gene families, gene classes, or pathways. Multiple pathway or classification levels can be given. If they are, an assignment will be...
jmeppley/py-metagenomics
assign_paths.py
Python
mit
10,699
# -*- coding: utf-8 import datetime from random import choice from zope.interface import implements from core.plugins.interface import IActionHandler, IFinalize, IPeriodic from core.plugins.manager import plugin_manager SPEAK_INTERVAL = 3 * 60 # only speak every 3 minutes. make it more valuable! RELOAD_INTERVAL = 1...
PhillipTaylor/ReactionBot
src/plugins/reaction.py
Python
mit
3,083
import numpy as np from lib.misc import manual_rate def main_classify(postback_list, transformer, classifier): ''' Make predictions on postback_list Input: postback_list from main_parse, transformer, classifier postback_list format: ['url_index', 'url', 'title', 'description', '...
jonathanlxy/miaozhen_hackathon
lib/main_classify.py
Python
mit
1,532
"""The tests for the device tracker component.""" # pylint: disable=protected-access import asyncio import json import logging import unittest from unittest.mock import call, patch from datetime import datetime, timedelta import os from homeassistant.core import callback from homeassistant.bootstrap import setup_compo...
florianholzapfel/home-assistant
tests/components/device_tracker/test_init.py
Python
mit
24,131
from django.db import models from django_comments.models import Comment # Create your models here. class CustomComment(Comment): pass
timonweb/djow
project_name/apps/custom_comments/models.py
Python
mit
138
from __main__ import settings import logging import datetime import os from pythonjsonlogger import jsonlogger # if we wanna log disnake stuff https://docs.disnake.dev/en/latest/logging.html?highlight=logger # we can also get the root logger, which will give us a ton of info for all the libraries we have if not os.pa...
mdiller/MangoByte
cogs/utils/logger.py
Python
mit
962
# 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/synapse/azure-mgmt-synapse/azure/mgmt/synapse/aio/operations/_keys_operations.py
Python
mit
13,131
# encoding: utf-8 """Tests for IPython.core.ultratb """ import io import logging import sys import os.path from textwrap import dedent import traceback import unittest from unittest import mock import IPython.core.ultratb as ultratb from IPython.core.ultratb import ColorTB, VerboseTB, find_recursion from IPython.tes...
sserrot/champion_relationships
venv/Lib/site-packages/IPython/core/tests/test_ultratb.py
Python
mit
13,550
#!/usr/bin/env python import collections import itertools import os import sys from functools import partial import six from pathos.multiprocessing import Pool import pandas as pd from PyAnalysisTools.AnalysisTools.RegionBuilder import RegionBuilder from PyAnalysisTools.base import get_default_argparser, default_ini...
morgenst/PyAnalysisTools
run_scripts/convert_root2numpy.py
Python
mit
4,105
from twisted.internet import protocol, task import struct from . import decoder, packetreader, packets class MapleProtocol(protocol.Protocol, object): PING_TIME = 30 processor = None def __init__(self): self.reader = packetreader.PacketReader() self.pingcall = task.LoopingCall(self.send_p...
martolini/pythonstory
pythonstory/common/protocol.py
Python
mit
2,331
# -*- coding: utf-8 -*- { '\n\nThank you!': '\n\nThank you!', '\n\nWe will wait and let you know when your payment is confirmed.': '\n\nWe will wait and let you know when your payment is confirmed.', '\n- %s from %s to %s': '\n- %s from %s to %s', '\nAmount: R$%.2f': '\nAmount: R$%.2f', "\nSomething happened and we cou...
juliarizza/web2courses
languages/ro.py
Python
mit
29,001
def _extend_class(): from tmp102._tmp102 import Tmp102 from tmp102._tmp102 import _set_bit_for_boolean, EXTENDED_MODE_BIT def _apply_extended_mode(self, config, mode_set): config[1] = _set_bit_for_boolean( config[1], EXTENDED_MODE_BIT, mode_set ) ...
khoulihan/micropython-tmp102
tmp102/extendedmode.py
Python
mit
765
from django.conf.urls import url from .views import scikit_chart, regression_line, k_nearest_neighborns urlpatterns = [ url(r'^$', scikit_chart, name='scikit_chart'), url(r'^regression_line/$', regression_line , name='regression_line'), url(r'^k_nearest_neighborns/$', k_nearest_neighborns , name='k_nearest_neighb...
JacekKarnasiewicz/HomePage
apps/scikit_chart/urls.py
Python
mit
329
# Copyright (c) 2012 Roberto Alsina y otros. # 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, pub...
servalproject/nikola
nikola/plugins/command_import_blogger.py
Python
mit
7,714
# -*- coding: utf-8 -*- import unittest from objectchecker import ObjectChecker # Config options = { 'messageTemplate': { 'invalid' : "Value of Field `{{fieldName}}` is not valid. Got `{{fieldValue}}`, but require {{checkerName}} = {{checkerOption}}", 'missing' : "Missing {{fieldName}}", ...
pastgift/object-checker-py
test/test.py
Python
mit
14,685
import _plotly_utils.basevalidators class MinorticklenValidator(_plotly_utils.basevalidators.NumberValidator): def __init__( self, plotly_name="minorticklen", parent_name="layout.slider", **kwargs ): super(MinorticklenValidator, self).__init__( plotly_name=plotly_name, ...
plotly/plotly.py
packages/python/plotly/plotly/validators/layout/slider/_minorticklen.py
Python
mit
474
import unittest from twitter_bot import messages class TestBaseMessageProvider(unittest.TestCase): def test_extract_hashtags_empty_mention(self): provider = messages.BaseMessageProvider() hashtags = provider._extract_hashtags({}) self.assertEqual([], hashtags) def test_extract_has...
jessamynsmith/twitterbot
tests/messages/test_base.py
Python
mit
989
""" Dingemans Wave Shoaling """ from proteus import Domain, Context from proteus.mprans import SpatialTools as st from proteus import WaveTools as wt from math import * import numpy as np opts=Context.Options([ # predefined test cases ("water_level", 0.86, "Height of free surface above seabed"), # tank ...
erdc-cm/air-water-vv
2d/waveTransformation/Dingemans_wave_shoaling/DingemansWaveShoaling.py
Python
mit
13,687
from tastypie.constants import ALL from tastypie.fields import ToOneField from tastypie.resources import ModelResource from backend.models import Portofolio, Member, Meeting, Organization import calendar from haystack.query import SearchQuerySet from django.core.paginator import Paginator, InvalidPage from tastypie.uti...
euhackathon/commission-today-api
backend/api/resources.py
Python
mit
2,974
from django.conf.urls.defaults import * from django.conf import settings import base # Uncomment the next two lines to enable the admin: from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', # Example: # (r'^quotes/', include('quotes.foo.urls')), # Uncomment the admin/doc line ...
finder/mako_base
urls.py
Python
mit
770
#File: default.py """ Provides a default style for bib4txt.py Produces a list of citations that to be included in a reStructuredText document. (In very simple documents, can also provide citation reference formatting by substituting in the document text for the citation references.) A style includes: - citation templ...
matthew-brett/bibstuff
bibstuff/bibstyles/default.py
Python
mit
4,900
def square_of_list(some_list, num): if len(some_list) < num: result = 0 if len(some_list) >= num: result = some_list[num]**num return result def gap(some_list): if any([type(x) == type('a') for x in some_list]): print('문자열이 있습니다') filtered_list = [ x for x in some_list...
saintdragon2/python-3-lecture-2015
homework_checker/civil_hw_personal_list/hw_civil_list_15030011.py
Python
mit
441
# !/usr/bin/env python # -*- coding: UTF-8 -*- from functools import wraps import bottle import datetime import json import os from error import DMPException from profile import ProfileHandler app = bottle.Bottle() def json_return(func): @wraps(func) def wrapper(*args, **kwargs): data = json.dumps(...
Saevon/DMP-Career-Share
server.py
Python
mit
3,413
"""Compute ESA driving functions for various systems. ESA is abbreviation for equivalent scattering approach. ESA driving functions for an edge-shaped SSD are provided below. Further ESA for different geometries might be added here. Note that mode-matching (such as NFC-HOA, SDM) are equivalent to ESA in their specif...
sfstoolbox/sfs-python
sfs/fd/esa.py
Python
mit
11,543
# coding=utf-8 r""" This code was generated by \ / _ _ _| _ _ | (_)\/(_)(_|\/| |(/_ v1.0.0 / / """ from twilio.base import deserialize from twilio.base import values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base...
twilio/twilio-python
twilio/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.py
Python
mit
16,185
''' As shown in this tutorial by Sentdex, www.youtube.com/watch?v=NwH0HvMI4EA And https://pymotw.com/3/queue/ ''' import threading from queue import Queue class execInParallel(): def run( self, nThreads, fx, args ): self.q = Queue() self.action = fx self.createJobs( args ) self.createThreads( nThr...
JetStarBlues/Nand-2-Tetris
PlayArea/parallel/_99__parallelHelpers.py
Python
mit
1,142
import os import argparse import cv2 from src.xml_parser import read_crowd_gaze_xml, read_landmark_coords from src.face_clipper import clip_matrix from src.face_aligner import align, align_eyes_only def save_image(im, dir_path, image_name): image_path = os.path.join(dir_path, image_name) image_matrix_bgr = c...
aeivazi/classroom-tracking
src/utils/align_faces.py
Python
mit
3,219
######################## ### ### IMPORTS ### ######################## ######################## ### BUILTIN ######################## from datetime import date import codecs import shutil import time import sys import re import os ######################## ### LOCAL ###################...
Royce/GammaJS
support/APIgen/generate.py
Python
mit
4,851
import logging, os, time from contextlib import contextmanager from selenium import webdriver from selenium.webdriver.common.desired_capabilities import DesiredCapabilities from selenium.webdriver.support.ui import Select logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) SELENIUM_SERVER =...
chosak/fdic-call-reports
bin/download_all_reports.py
Python
mit
3,207
# -*- coding: utf-8 -*- """ Sahana Eden Common Alerting Protocol (CAP) Model @copyright: 2009-2014 (c) Sahana Software Foundation @license: MIT Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to dea...
gnarula/eden_deployment
modules/s3db/cap.py
Python
mit
78,715
import os import subprocess import sys sys.path.append(os.path.dirname(os.path.abspath(__file__))+ '/enum') sys.path.append(os.path.dirname(os.path.abspath(__file__))+ '/workflow') from enum import Enum from workflow import Workflow class FileType(Enum): xcodeproj = 'xcode-project_Icon.icns' xcworkspace = '...
morishin/alfred-xcfind-workflow
xcfind.py
Python
mit
1,495
# This file is part of Indico. # Copyright (C) 2002 - 2020 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 flask_pluginengine import plugin_context from wtforms.fields...
mic4ael/indico
indico/modules/events/requests/base.py
Python
mit
7,379
from compiler.compiler import LambdaCompiler def main(): f = open('input.txt', 'r') compiler = LambdaCompiler(f) compiler.perform('output.py') if __name__ == "__main__": main()
felipewaku/compiladores-p2
lambda_compiler/__main__.py
Python
mit
195
from fenics import * import numpy as np import matplotlib.pyplot as plt from matplotlib import tri from math import pi,sinh,cosh from mshr import * # Create mesh and define function space box = Rectangle(Point(0, 0), Point(5,3)) mesh = generate_mesh(box, 400) # element of degree 1 V = FunctionSpace(mesh, 'P', 1) nearE...
ChesnakovKonstantin/Test-Example
Python projects/fenics/PythonApplicationFenics.py
Python
mit
2,939
import hashlib import xml.etree.ElementTree as ET import requests from requests_toolbelt import MultipartEncoder from client.model import Folder, File def post_request(url, expect_xml_response=True, **kwargs): response_xml = requests.post(url, **kwargs) if response_xml.status_code != 200: http_erro...
annikulin/sendspaceBox
client/sendspace.py
Python
mit
5,794
#Tutorial : http://www.idiotinside.com/2015/02/13/get-number-of-likes-of-a-facebook-page-using-graph-api-in-python/ import urllib2 import json def getPageData(page_id): api_endpoint = "https://graph.facebook.com" fb_graph_url = api_endpoint+"/"+page_id try: api_request = urllib2.Request(fb_graph_ur...
meigrafd/Sample-Code
facebook-like.py
Python
mit
823
# coding: utf-8 from datetime import datetime from decimal import Decimal from unittest import TestCase import httpretty from pyqiwi import QiwiError, Qiwi class QiwiErrorTestCase(TestCase): def test_error_code(self): error = QiwiError(143) self.assertEqual(error.code, 143) @httpretty.activate...
onrik/pyqiwi
tests/test_client.py
Python
mit
8,897
from layout import TopLevel, RoundRect, Widget, Layout, State, Rel, Constraint from string import repr from flash.display import Shape from game import Frame, Keys level = """ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX Xg....................................gX X.XX.XXXXX.XX.XXX.XXXX.XXX.XX.XXXXX.XX.X X.XX.XXXXX.XX.XXX.XX...
tailhook/pyzza
examples/pacman/main.py
Python
mit
5,622
# 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/models/_network_management_client_enums.py
Python
mit
27,671
default_app_config = 'apps.feedback.appconfig.FeedbackConfig'
dotKom/onlineweb4
apps/feedback/__init__.py
Python
mit
62
import threading import os import sublime from .show_error import show_error from .console_write import console_write from .unicode import unicode_from_os from .clear_directory import clear_directory, delete_directory, clean_old_files from .automatic_upgrader import AutomaticUpgrader from .package_manager import Pack...
koery/win-sublime
Data/Packages/Package Control/package_control/package_cleanup.py
Python
mit
15,806
# 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 ...
lmazuel/azure-sdk-for-python
azure-mgmt-consumption/azure/mgmt/consumption/models/marketplace.py
Python
mit
7,474
""" @TODO: ProcessLogger().attempts - update/interact based on __enter__/__exit__ @TODO: Review ProcessLoggerABC, and make ProcessLogger inherit from it @TODO: ProcessingAttempt: make uncaught exception in switch_on_exit() cause parent to close all other attempts. @TODO: Write ProcessLoggerABC in task_logger/. Th...
OaklandPeters/task_logger
task_logger/logger.py
Python
mit
27,065
# Copyright (c) 2009-2011,2013 Turbulenz Limited from os.path import getsize as path_getsize from zlib import compress as zlib_compress from simplejson import loads as json_loads __version__ = '1.0.0' def analyse_json(filename): """Utility to return the ratio of key size, punctuation size, and leaf value size.""...
turbulenz/turbulenz_tools
turbulenz_tools/utils/json_stats.py
Python
mit
2,025
# Django settings for project project. import os PROJECT_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir)) PROJECT_ROOT = os.path.abspath(os.path.join(PROJECT_PATH, os.pardir)) DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS ...
caktus/rapidsms-salt-multi-server
project/settings/base.py
Python
mit
5,677
import re from core.actionModule import actionModule from core.keystore import KeyStore as kb from core.mymsf import myMsf from core.utils import Utils class exploit_msf_jboss_maindeployer(actionModule): def __init__(self, config, display, lock): super(exploit_msf_jboss_maindeployer, self).__init__(confi...
MooseDojo/apt2
modules/action/exploit_msf_jboss_maindeployer.py
Python
mit
4,087
from .pyvatebin import app
yossarianirving/pyvatebin
pyvatebin/__init__.py
Python
mit
27
import re import struct import zlib from ...utils import snake_to_camel_case # https://github.com/telegramdesktop/tdesktop/blob/4bf66cb6e93f3965b40084771b595e93d0b11bcd/Telegram/SourceFiles/codegen/scheme/codegen_scheme.py#L57-L62 WHITELISTED_MISMATCHING_IDS = { # 0 represents any layer 0: {'channel', # Sinc...
expectocode/Telethon
telethon_generator/parsers/tlobject/tlobject.py
Python
mit
5,137