code stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 226 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k |
|---|---|---|---|---|---|
import simtk.unit as units
from intermol.decorators import accepts_compatible_units
from intermol.forces.abstract_bond_type import AbstractBondType
class HarmonicPotentialBondType(AbstractBondType):
__slots__ = ['length', 'k', 'order', 'c']
@accepts_compatible_units(None, None,
... | ctk3b/InterMol | intermol/forces/harmonic_potential_bond_type.py | Python | mit | 1,407 |
# pylint: disable-all
import unittest
from circleci.error import CircleCIException, BadKeyError, BadVerbError, InvalidFilterError
class TestCircleCIError(unittest.TestCase):
def setUp(self):
self.base = CircleCIException('fake')
self.key = BadKeyError('fake')
self.verb = BadVerbError('fa... | levlaz/circleci.py | tests/circle/test_error.py | Python | mit | 951 |
from .commutative import Commutative
class Product(Commutative):
def __init__(self, *args):
super(Product, self).__init__(*self.simplified(*args))
def simplified(self, *args):
"""
Returns a sequence containing expressions that make a simplified Product.
Used when ``Product`` is... | LordDarkula/polypy | polypy/product.py | Python | mit | 2,416 |
# coding: utf-8
from datetime import datetime
from flask import Flask
from flask import render_template
from views.todos import todos_view
app = Flask(__name__)
app.register_blueprint(todos_view, url_prefix='/todos')
@app.route('/')
def index():
return render_template('index.html')
@app.route('/time')
def t... | sdjcw/python-getting-started | app.py | Python | mit | 638 |
"""
:created: 2017-09
:author: Alex BROSSARD <abrossard@artfx.fr>
"""
from PySide2 import QtWidgets, QtCore
from pymel import core as pmc
from auri.auri_lib import AuriScriptView, AuriScriptController, AuriScriptModel, grpbox
from auri.scripts.Maya_Scripts import rig_lib
from auri.scripts.Maya_Scripts.rig_lib import ... | Sookhaal/auri_maya_rigging_scripts | general/center_of_gravity.py | Python | mit | 5,456 |
#import factorial
#import square
x = int(raw_input("What is 'x'?\n"))
y = int(raw_input("What is y?\n"))
# question0 = str(raw_input("Define a y value? (y/n)\n"))
# if (question0 == "y","Y","yes","Yes"):
# y = int(raw_input("What will 'y' be?\n"))
# elif (y == "n","N","no","No"):
# question2 = str(raw_input("I... | chrisortman/CIS-121 | k0459866/Lessons/ex12.py | Python | mit | 2,216 |
from pyparsing import *
TOP = Forward()
BOTTOM = Forward()
HAND = Forward()
GRAVEYARD = Forward()
LIBRARY = Forward()
BATTLEFIELD = Forward() | jrgdiz/cardwalker | grammar/constants/zones/decl.py | Python | mit | 143 |
import numpy as n, matplotlib.pyplot as p, scipy.special
import cosmolopy.perturbation as pb
import cosmolopy.density as cd
from scipy.integrate import quad,tplquad
import itertools
from scipy.interpolate import interp1d
from scipy.interpolate import RectBivariateSpline as RBS
import optparse, sys
from sigmas import si... | yunfanz/ReionBub | Choud14/FZH04.py | Python | mit | 5,526 |
# This file is part of Indico.
# Copyright (C) 2002 - 2021 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.
import uuid
from operator import attrgetter
from flask import flash, jsonify, redirect, request, session
... | ThiefMaster/indico | indico/modules/events/contributions/controllers/management.py | Python | mit | 34,546 |
try:
import json
except ImportError:
import simplejson as json
from . import TestCase
from server import ListHostsHandler
class TestListHostsHandler(TestCase):
def setUp(self):
"""
Create an instance each time for testing.
"""
self.instance = ListHostsHandler()
def ... | RHInception/talook | test/test_listhostshandler.py | Python | mit | 899 |
basedir = '/data/t3serv014/snarayan/deep/v_deepgen_4_akt_small/'
figsdir = '/home/snarayan/public_html/figs/deepgen/v4_akt/'
| sidnarayanan/BAdNet | train/gen/akt/paths.py | Python | mit | 125 |
#This bot was written by /u/GoldenSights for /u/FourMakesTwoUNLESS on behalf of /r/pkmntcgtrades. Uploaded to GitHub with permission.
import praw
import time
import datetime
import sqlite3
'''USER CONFIGURATION'''
APP_ID = ""
APP_SECRET = ""
APP_URI = ""
APP_REFRESH = ""
# https://www.reddit.com/comments/3cm1p8/how_t... | TacticalGoat/reddit | DelayBot/delaybot.py | Python | mit | 3,987 |
'''
Pulse characterization
Created Fri May 12 2017
@author: cpkmanchee
'''
import numpy as np
import os.path
import inspect
from beamtools.constants import h,c,pi
from beamtools.common import normalize, gaussian, sech2, alias_dict
from beamtools.import_data_file import import_data_file as _import
from beamtools.imp... | kikimaroca/beamtools | build/lib/beamtools/pulse.py | Python | mit | 9,048 |
#!/usr/bin/env python -tt -Wall
def prime_sieve(upper):
marked = [False] * (upper-2)
def next_prime():
for i,v in enumerate(marked):
if not v:
yield i+2
next_prime_gen = next_prime()
for p in next_prime_gen:
for n in xrange(2*p - 2, len(marked), p):
marked[n] = True
yield p
def main():
print(su... | cveazey/ProjectEuler | 10/e10.py | Python | mit | 380 |
# 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/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_shared_galleries_operations.py | Python | mit | 9,946 |
# -#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
# these are system modules
import numpy
import sys
# these are my local ones
from env import gidgetConfigVars
import tsvIO
# -#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
NA_VALUE = -999999
# -#-#-#-#-... | cancerregulome/gidget | commands/feature_matrix_construction/main/addGnabFeatures.py | Python | mit | 38,773 |
from PETScMatOps import *
| wathen/PhD | MHD/FEniCS/MyPackage/PackageName/PETScFunc/__init__.py | Python | mit | 26 |
from . import claim, util
from .attr_dict import AttrDict
class Statement(AttrDict):
@classmethod
def from_json(cls, statement_doc):
return normalize(statement_doc)
def normalize(statement_doc):
statement_doc = util.ensure_decoded_json(statement_doc)
references = {}
for item in stateme... | mediawiki-utilities/python-mwbase | mwbase/statement.py | Python | mit | 987 |
from sqlalchemy import Column, ForeignKey, Integer, String, Text, DateTime, Table
from sqlalchemy.orm import relationship, backref
from models import DecBase
from models.document import Document
from models.keyword import Keyword
from jsonschema import *
from json_schemas import *
from models.collection_version import ... | FreeJournal/freejournal | models/collection.py | Python | mit | 6,736 |
#-*-coding: utf-8-*-
from tornado import gen
from tornado.httpclient import AsyncHTTPClient, HTTPError, HTTPRequest
from tornado.options import options
from functools import wraps
from tornado import escape
import tornado.ioloop
import base64
import time
import datetime
import json
from math import exp
AsyncHTTPClien... | cloudaice/simple-data | github/libs/client.py | Python | mit | 3,814 |
#!/usr/bin/env python3
# vim:fileencoding=utf-8:ts=8:et:sw=4:sts=4:tw=79
"""
papatcher.py: simple python PA patcher
Copyright (c) 2014 Pyrus <pyrus@coffee-break.at>
See the file LICENSE for copying permission.
"""
from argparse import ArgumentParser
from concurrent import futures
from contextlib import contextmanage... | pa-pyrus/papatcher | papatcher.py | Python | mit | 17,605 |
"""
Module for testing the Blacklist model
"""
import unittest
from app.models.shopping import BlacklistToken, ShoppingList
try:
from .common_functions import BaseModelTestClass
except (ImportError, SystemError):
from common_functions import BaseModelTestClass
class BlacklistModelTest(BaseModelTestClass):
... | Tinitto/ShoppingListAPI | api/test/test_blacklist_model.py | Python | mit | 2,727 |
#---------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#---------------------------------------------------------------------... | BurtBiel/azure-cli | src/command_modules/azure-cli-network/azure/cli/command_modules/network/zone_file/exceptions.py | Python | mit | 1,506 |
from pypov.pov import Texture, Pigment, Intersection, Cylinder
from pypov.pov import Union, Difference, Object, Box, Sphere
from pypov.common import grey, white
from pypov.colors import Colors
from lib.base import five_by_ten_edge
from lib.textures import cross_hatch, cross_hatch_2, wall_texture_1
from lib.metadata im... | autowitch/pypov | scenes/geomorphs/lib/geomorphs/edge_5x10_003.py | Python | mit | 1,577 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import getpass
import requests
import ConfigParser
BASE_DIR = os.path.dirname(__file__)
class Auth:
"""GitHub API Auth"""
def __init__(self):
self.auth_url = 'https://api.github.com'
auth_conf = os.path.join(BASE_DIR, 'auth.co... | billryan/github-rss | github/gh.py | Python | mit | 5,484 |
"""
DotStar_Emulator
config.py in current working directory will be automatically read and loaded.
Author: Christopher Ross
License: MIT Something Rather
"""
from DotStar_Emulator.manage import manage
if __name__ == "__main__":
manage()
| chrisrossx/DotStar_Emulator | DotStar_Emulator/emulator/init/manage.py | Python | mit | 245 |
import datetime
class AuthenticationInfo:
def __init__(self, password, email):
self.Password = password
self.Email = email
class ProfileInfo:
def __init__(self, display_name):
self.DisplayName = display_name
class Token:
def __init__(self, id_token, valid_until):
self.Id =... | Com-Ericmas001/py-userbase | py_userbase/userbase_models.py | Python | mit | 2,746 |
"""
Django settings for MapaAsentamientosTecho project.
Generated by 'django-admin startproject' using Django 1.9.5.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
""... | Girolabs/MapaAsentamientosTecho | MapaAsentamientosTecho/settings.py | Python | mit | 3,830 |
import os
import codecs
try:
from setuptools import (setup, find_packages)
except ImportError:
from distutils.core import (setup, find_packages)
VERSION = (0, 2, 0)
__version__ = '.'.join(map(str, VERSION[:3])) + "".join(VERSION[3:])
__package_name__ = 'pelican-readtime'
__description__ = 'Plugin for Pelica... | JenkinsDev/pelican-readtime | setup.py | Python | mit | 2,230 |
from shutit_module import ShutItModule
class test16(ShutItModule):
def build(self, shutit):
shutit.login()
shutit.login(command='bash')
shutit.send('ls',note='We are listing files')
shutit.logout()
shutit.logout()
return True
def module():
return test16(
'shutit.test16.test16.test16', 210790650.00293... | ianmiell/shutit-test | test/docker_tests/16/test16.py | Python | mit | 395 |
#-- GAUDI jobOptions generated on Wed Jun 10 17:31:51 2015
#-- Contains event types :
#-- 11104041 - 117 files - 2010995 events - 432.61 GBytes
#-- Extra information about the data processing phases:
#-- Processing Pass Step-124834
#-- StepId : 124834
#-- StepName : Reco14a for MC
#-- ApplicationName : ... | Williams224/davinci-scripts | kstaretappipig/MC_12_MagDown_kstar_rho_kpipipi.py | Python | mit | 12,721 |
# muddersOnRails()
# Sara McAllister November 17, 2017
# Last updated: 11-17-2017
# delete all data from database and remove generated graphs (this is super sketch)
import os
import dbCalls
summary_file = 'app/assets/images/summary.png'
overall_file = 'app/assets/images/overall.png'
def main():
dbCalls.remove_... | nathanljustin/teamwork-analysis | teamworkApp/lib/delete_data.py | Python | mit | 520 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
def f(k, n):
pass
assert f(1, 2) == 2
assert f(2, 6) == 3
assert f(3, 14) == 14
| uxlsl/uxlsl.github.io | demo/code/2021-11-15/f.py | Python | mit | 135 |
import os
import time
from abc import abstractmethod, ABC
from typing import Dict, Tuple, List
from cereal import car
from common.kalman.simple_kalman import KF1D
from common.realtime import DT_CTRL
from selfdrive.car import gen_empty_fingerprint
from selfdrive.config import Conversions as CV
from selfdrive.controls.l... | commaai/openpilot | selfdrive/car/interfaces.py | Python | mit | 9,765 |
from _external import *
fontconfig = LibWithHeaderChecker('fontconfig', 'fontconfig/fontconfig.h', 'c')
| tuttleofx/sconsProject | autoconf/fontconfig.py | Python | mit | 105 |
#
# adapters/tensorflow/imagenet/__init__.py - a service adapter for the tensorflow ImageNet pre-trained graph
#
# Copyright (c) 2018 SingularityNET
#
# Distributed under the MIT software license, see LICENSE file.
#
import base64
import logging
import os
from pathlib import Path
from typing import List
import tensor... | singnet/singnet | agent/adapters/tensorflow/imagenet/__init__.py | Python | mit | 19,222 |
""" The aomi "seed" loop """
from __future__ import print_function
import os
import difflib
import logging
from shutil import rmtree
import tempfile
from termcolor import colored
import yaml
from future.utils import iteritems # pylint: disable=E0401
from aomi.helpers import dict_unicodeize
from aomi.filez import thaw
... | otakup0pe/aomi | aomi/seed_action.py | Python | mit | 7,172 |
import numpy
from wiki_scraper import (
parse_html_simple,
crawl_page)
import pickle
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.naive_bayes import MultinomialNB
import os.path
from parallel_webscrape import scrape_wikipedia
PATH = 'wikimodel/'
class WikiModel():
def __init_... | arider/wikimodel | wiki_model.py | Python | mit | 4,572 |
# -- coding: utf-8 --
# Copyright 2015 Tim Santor
#
# This file is part of proprietary software and use of this file
# is strictly prohibited without written consent.
#
# @author Tim Santor <tsantor@xstudios.agency>
"""Generates HTML for HTML5 banner ads."""
# ------------------------------------------------------... | tsantor/banner-ad-toolkit | adkit/generate_html.py | Python | mit | 5,427 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-09-08 19:14
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('invoice', '0007_profile_invoice_logo'),
]
operations = [
migrations.AddFiel... | pickleshb/PyInvoice | invoice/migrations/0008_auto_20170908_1914.py | Python | mit | 760 |
#!/usr/bin/env python
import socket, struct
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(("127.0.0.1", 9123))
try:
while True:
line = raw_input( ">" )
parts = line.split()
if parts[0] == "SET":
if parts[1] == "A":
value = int( parts[2] )
s.send( struct.pack( "<BBBBB", 0, valu... | mgronhol/tamandua-framework | scripts/emulator-cli.py | Python | mit | 798 |
# CS4243: Computer Vision and Pattern Recognition
# Zhou Bin
# 29th, Oct, 2014
import numpy as np
from Vertex import Vertex
class Polygon:
def __init__(self, newVertexList, newTexelList):
# Create list to store all vertex
self.Vertex = []
for i in newVertexList:
s... | WuPei/cv_reconstructor | Polygon.py | Python | mit | 486 |
import re
import json
import urlparse
from holster.enum import Enum
from unidecode import unidecode
from disco.types.base import cached_property
from disco.types.channel import ChannelType
from disco.util.sanitize import S
from disco.api.http import APIException
from rowboat.redis import rdb
from rowboat.util.stats i... | ThaTiemsz/jetski | rowboat/plugins/censor.py | Python | mit | 9,546 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-03-29 17:03
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('orders', '0001_initial'),
]
operations = [
... | loafbaker/django_ecommerce2 | orders/migrations/0002_useraddress.py | Python | mit | 1,035 |
import numpy
import six
from chainer.dataset import dataset_mixin
class SubDataset(dataset_mixin.DatasetMixin):
"""Subset of a base dataset.
SubDataset defines a subset of a given base dataset. The subset is defined
as an interval of indexes, optionally with a given permutation.
If ``order`` is gi... | kikusu/chainer | chainer/datasets/sub_dataset.py | Python | mit | 7,241 |
import json
import logging
import webapp2
from datetime import datetime
from google.appengine.ext import ndb
from controllers.api.api_base_controller import ApiBaseController
from database.event_query import EventListQuery
from helpers.award_helper import AwardHelper
from helpers.district_helper import DistrictHelp... | synth3tk/the-blue-alliance | controllers/api/api_event_controller.py | Python | mit | 6,883 |
from __future__ import unicode_literals
from django.utils.encoding import python_2_unicode_compatible
from django.conf import settings
from django.db import models
from django.core.urlresolvers import reverse
from django.db.models.signals import pre_save
from django.utils import timezone
from django.utils.text import... | neldom/qessera | careers/models.py | Python | mit | 2,634 |
import re
import os.path
import datetime
import base64
import aql
# ==============================================================================
info = aql.get_aql_info()
HEADER = """#!/usr/bin/env python
#
# THIS FILE WAS AUTO-GENERATED. DO NOT EDIT!
#
# Copyright (c) 2011-{year} of the {name} project, site: {ur... | aqualid/aqualid | make/aql_linker.py | Python | mit | 11,736 |
from birdseye.server import main
if __name__ == '__main__':
main()
| alexmojaki/birdseye | birdseye/__main__.py | Python | mit | 72 |
from ..GenericInstrument import GenericInstrument
from .helper import SignalGenerator, amplitudelimiter
class Wiltron360SS69(GenericInstrument, SignalGenerator):
"""Wiltron 360SS69 10e6, 40e9.
.. figure:: images/SignalGenerator/Wiltron360SS69.jpg
"""
def __init__(self, instrument):
"""."""
... | DavidLutton/EngineeringProject | labtoolkit/SignalGenerator/Wiltron360SS69.py | Python | mit | 1,322 |
default_app_config = 'journeys.apps.JourneyConfig'
| vishalsahu5/carpool | journeys/__init__.py | Python | mit | 51 |
import lassie
from .base import LassieBaseTestCase
class LassieOpenGraphTestCase(LassieBaseTestCase):
def test_open_graph_all_properties(self):
url = 'http://lassie.it/open_graph/all_properties.html'
data = lassie.fetch(url)
self.assertEqual(data['url'], url)
self.assertEqual(dat... | michaelhelmick/lassie | tests/test_open_graph.py | Python | mit | 2,426 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
with open('README.rst') as readme_file:
README = readme_file.read()
with open('HISTORY.rst') as history_file:
HISTORY = history_file.read()
REQUIREMENTS = [
'gitpython',
'requests',
'tqdm',
'requests_ca... | llazzaro/packyou | setup.py | Python | mit | 1,573 |
from django.db import models
from .bleachfield import BleachField
class BleachCharField(BleachField, models.CharField):
def pre_save(self, model_instance, add):
new_value = getattr(model_instance, self.attname)
clean_value = self.clean_text(new_value)
setattr(model_instance, self.attname... | BetterWorks/django-bleachfields | bleachfields/bleachchar.py | Python | mit | 409 |
import astropy.cosmology as co
aa=co.Planck15
import astropy.io.fits as fits
import matplotlib
import matplotlib
matplotlib.rcParams['agg.path.chunksize'] = 2000000
matplotlib.rcParams.update({'font.size': 12})
matplotlib.use('Agg')
import matplotlib.pyplot as p
import numpy as n
import os
import sys
# global cosmo ... | JohanComparat/pySU | spm/bin_SMF/smf_plot.py | Python | cc0-1.0 | 15,194 |
import html5lib
import traceback
def build_html_dom_from_str(html_str):
return html5lib.parse(html_str, 'dom')
def find_html_element_list_for_tag(element, tag, class_style = None):
elements = element.getElementsByTagName(tag)
if not class_style: return elements
result = []
for e in elements:
... | Bargetor/chestnut | bargetor/common/HTMLUtil.py | Python | gpl-2.0 | 1,310 |
# coding=utf-8
from __future__ import unicode_literals
"""
Name: MyArgparse
Author: Andy Liu
Email : andy.liu.ud@hotmail.com
Created: 3/26/2015
Copyright: All rights reserved.
Licence: This program is free software: you can redistribute it
and/or modify it under the te... | asiroliu/MyTools | MyArgparse.py | Python | gpl-2.0 | 2,738 |
import pytest
from cfme.containers.provider import ContainersProvider
from utils import testgen, version
from cfme.web_ui import toolbar as tb
from utils.appliance.implementations.ui import navigate_to
pytestmark = [
pytest.mark.uncollectif(
lambda: version.current_version() < "5.6"),
pytest.mark.use... | rananda/cfme_tests | cfme/tests/containers/test_reload_button_provider.py | Python | gpl-2.0 | 2,719 |
#!/usr/bin/env python
"""
================================================
ABElectronics IO Pi Tests | test get_bus_pullups function
Requires python smbus to be installed
For Python 2 install with: sudo apt-get install python-smbus
For Python 3 install with: sudo apt-get install python3-smbus
run with: python3 get_b... | abelectronicsuk/ABElectronics_Python_Libraries | IOPi/tests/get_bus_pullups.py | Python | gpl-2.0 | 1,397 |
# Copyright (c) 2007-2017 Joseph Hager.
#
# Copycat is free software; you can redistribute it and/or modify
# it under the terms of version 2 of the GNU General Public License,
# as published by the Free Software Foundation.
#
# Copycat is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; with... | ajhager/copycat | copycat/slipnet/sliplink.py | Python | gpl-2.0 | 1,760 |
from shutil import copy
from os import remove
import sys
from I_Data_Degradation_Block.Code.Degradation import main as blockI
from II_Cryptography_Block.Code.encrypt import main as blockII
from III_Shamirs_Block.Code.SecretSharing import main as blockIII
from IV_DHT_Block.Code.Parted_Keys_to_OWI_Input import main... | ioniATX/DHT_oblivion | Blocs/InputDataClient.py | Python | gpl-2.0 | 5,237 |
#! /usr/bin/env python
# -*- mode: python; indent-tabs-mode: nil; -*-
# vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
#
# Copyright (C) 2011 Patrick Crews
#
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Softwar... | vladistan/percona-pam-plugin | test/dbqp/percona_tests/percona_pam/pam_basic_test.py | Python | gpl-2.0 | 4,568 |
import sys
from fsgamesys.plugins.pluginmanager import PluginManager
"""
DOSBox-FS launcher script used for testing.
"""
def app_main():
executable = PluginManager.instance().find_executable("dosbox-fs")
process = executable.popen(sys.argv[1:])
process.wait()
| FrodeSolheim/fs-uae-launcher | launcher/apps/dosbox_fs.py | Python | gpl-2.0 | 276 |
"""waybacktrack.py
Use this to extract Way Back Machine's
url-archives of any given domain!
TODO: reiterate entire design!
"""
import time
import os
import urllib2
import random
from math import ceil
try:
from cStringIO import StringIO as BytesIO
except ImportError:
from io import BytesIO
from lxml import htm... | rodricios/crawl-to-the-future | crawlers/Way-Back/waybacktrack.py | Python | gpl-2.0 | 7,577 |
"""
vUSBf: A KVM/QEMU based USB-fuzzing framework.
Copyright (C) 2015 Sergej Schumilo, OpenSource Security Ralf Spenneberg
This file is part of vUSBf.
See the file LICENSE for copying permission.
"""
__author__ = 'Sergej Schumilo'
from scapy.all import *
#####################################
#######... | schumilo/vUSBf | usbscapy.py | Python | gpl-2.0 | 17,727 |
def f2():
def f3():
print("f3")
f3()
f2()
| pez2001/sVimPy | test_scripts/test_nested_function.py | Python | gpl-2.0 | 46 |
import pygame, sys, random, math
from pygame.locals import *
import organisms
import globalVars
class Graphics:
def __init__(self):
self.screen = pygame.display.set_mode((1080, 820))
pygame.display.set_caption('Ecosystem Simulator')
class GUI:
def __init__(self):
self.sliderX = 150
... | Liamc0950/EcosystemSimulator | utils.py | Python | gpl-2.0 | 5,066 |
#!/usr/bin/env python
import subprocess
short_name = 'Opt 3'
disp_name = 'Option 3 Submenu'
otype = 'Routine'
need = ['need 1: ', 'need 2: ', 'need 3: ']
answers = []
def run():
global answers
while True:
subprocess.call('clear')
i = 0
while i < len(need):
ans = input(need[i])
if validate(ans):
ans... | kbknapp/ConsoleMenu-py3x | examples/menu/opt3.py | Python | gpl-2.0 | 532 |
"""
Django settings for cbs project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import... | max1k/cbs | cbs/settings.py | Python | gpl-2.0 | 2,196 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Role',
fields=[
('id', models.AutoField(verbose... | 1905410/Misago | misago/acl/migrations/0001_initial.py | Python | gpl-2.0 | 760 |
# -*- coding: utf-8 -*-
from .TransmitFeatures import TransmitFeatures
from .GetFeatures import GetFeatures
| Hemisphere-Project/Telemir-DatabitMe | Telemir-EEG/TeleMir/analyses/__init__.py | Python | gpl-2.0 | 110 |
# -*- coding: utf-8 -*-
"""
Created on Mon Apr 21 10:34:18 2014
@author: eegroopm
"""
import os, sys
import pandas as pd
import numpy as np
class common:
def __init__(self):
self.path = os.path.expanduser('~')
#\u0305 is unicode overline character
#self._overline_strings = [u'1\u0305', u'2... | eegroopm/pyLATTICE | resources/common.py | Python | gpl-2.0 | 2,942 |
# -*- coding: utf-8 -*-
# Third Party Stuff
# Third Party Stuff
from rest_framework.pagination import PageNumberPagination as DrfPageNumberPagination
class PageNumberPagination(DrfPageNumberPagination):
# Client can control the page using this query parameter.
page_query_param = 'page'
# Client can cont... | aniketmaithani/kimani-adserver | Adserver/base/api/pagination.py | Python | gpl-2.0 | 640 |
# -*- coding: utf-8 -*-
"""
------
Urls
------
Arquivo de configuração das urls da aplicação blog
Autores:
* Alisson Barbosa Ferreira <alissonbf@hotmail.com>
Data:
============== ==================
Criação Atualização
============== ==================
29/11/2014 29/11/2014
============== =====... | alissonbf/blog-teste | blog/urls.py | Python | gpl-2.0 | 989 |
#!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
# +------------------------------------------------------------------+
# | ____ _ _ __ __ _ __ |
# | / ___| |__ ___ ___| | __ | \/ | |/ / |
# | | | | '_ \ / _ \/ __| |/ /... | oposs/check_mk_mirror | web/htdocs/guitester.py | Python | gpl-2.0 | 10,454 |
import sqlite3
import RPi.GPIO as GPIO
import os, sys, time
conn = sqlite3.connect( os.path.join( os.path.dirname(os.path.realpath(sys.argv[0])), 'db/timelapsecontroller.db'))
conn.row_factory = sqlite3.Row
sleep=2
def set_pid(pid=None):
c = conn.cursor()
try:
# Update the DB counter
c.execute("UPDATE ... | alanmcna/timelapsecontroller | focusandshoot.py | Python | gpl-2.0 | 2,409 |
import os
import re
import time
import xbmc
import xbmcvfs
import xbmcgui
import urllib2
import bjsonrpc
from bjsonrpc.handlers import BaseHandler
from quasar.addon import ADDON, ADDON_PATH
from quasar.logger import log
from quasar.config import JSONRPC_EXT_PORT, QUASARD_HOST
from quasar.osarch import PLATFORM
from qua... | felipenaselva/felipe.repository | plugin.video.quasar/resources/site-packages/quasar/rpc.py | Python | gpl-2.0 | 10,162 |
from jinja2 import Environment, FileSystemLoader
import yaml
from tornado.ioloop import IOLoop
from tornado.web import RequestHandler
from bokeh.application import Application
from bokeh.application.handlers import FunctionHandler
from bokeh.embed import server_document
from bokeh.layouts import column
from bokeh.mod... | Ziqi-Li/bknqgis | bokeh/examples/howto/server_embed/tornado_embed.py | Python | gpl-2.0 | 2,322 |
from setuptools import setup, find_packages
import os
version = '0.5'
setup(name='uwosh.emergency.master',
version=version,
description="",
long_description=open("README.txt").read() + "\n" +
open(os.path.join("docs", "HISTORY.txt")).read(),
# Get more strings from http:... | uwosh/uwosh.emergency.master | setup.py | Python | gpl-2.0 | 1,123 |
#!/usr/bin/env python
# *-* coding:utf-8 *-*
"""
Date :
Author : Vianney Gremmel loutre.a@gmail.com
"""
def memo(f):
class Memo(dict):
def __missing__(self, key):
r = self[key] = f(key)
return r
return Memo().__getitem__
@memo
def isprime(n):
for d in xrange(2, int(n**0.5)... | vianney-g/python-exercices | eulerproject/pb0027.py | Python | gpl-2.0 | 793 |
# -*- encoding: utf-8 -*-
import io
from bs4 import BeautifulSoup
from bs4 import SoupStrainer
import urllib2
import urlparse
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expecte... | hoaibang07/Webscrap | transcripture/sources/crawler_chuongthieu.py | Python | gpl-2.0 | 7,017 |
import unittest
import os
import logging
import re
import shutil
import datetime
import oeqa.utils.ftools as ftools
from oeqa.selftest.base import oeSelfTest
from oeqa.utils.commands import runCmd, bitbake, get_bb_var
from oeqa.utils.decorators import testcase
from oeqa.utils.network import get_free_port
class Bitbak... | schleichdi2/OPENNFR-6.1-CORE | opennfr-openembedded-core/meta/lib/oeqa/selftest/prservice.py | Python | gpl-2.0 | 5,821 |
from omf import feeder
import omf.solvers.gridlabd
feed = feeder.parse('GC-12.47-1.glm')
maxKey = feeder.getMaxKey(feed)
print(feed[1])
feed[maxKey + 1] = {
'object': 'node', 'name': 'test_solar_node', 'phases': 'ABCN',
'nominal_voltage': '7200'
}
feed[maxKey + 2] = {
'object': 'underground_line', 'name': 'test_s... | dpinney/omf | omf/scratch/MPUPV/solarAdd.py | Python | gpl-2.0 | 1,552 |
import re
from gourmet.plugin import ExporterPlugin
from gourmet.convert import seconds_to_timestring, float_to_frac
from . import gxml2_exporter
from gettext import gettext as _
GXML = _('Gourmet XML File')
class GourmetExportChecker:
def check_rec (self, rec, file):
self.txt = file.read()
self... | thinkle/gourmet | gourmet/plugins/import_export/gxml_plugin/gxml_exporter_plugin.py | Python | gpl-2.0 | 2,889 |
__author__= "barun"
__date__ = "$20 May, 2011 12:25:36 PM$"
from metrics import Metrics
from wireless_fields import *
DATA_PKTS = ('tcp', 'udp', 'ack',)
def is_control_pkt(pkt_type=''):
return pkt_type not in DATA_PKTS
class TraceAnalyzer(object):
'''
Trace Analyzer
'''
def __init__(self, fil... | barun-saha/ns2web | ns2trace/trace_analyzer_old.py | Python | gpl-2.0 | 5,513 |
## begin license ##
#
# "Meresco Solr" is a set of components and tools
# to integrate Solr into "Meresco."
#
# Copyright (C) 2011-2013 Seecr (Seek You Too B.V.) http://seecr.nl
# Copyright (C) 2012 SURF http://www.surf.nl
# Copyright (C) 2013 Stichting Kennisnet http://www.kennisnet.nl
#
# This file is part of "Meres... | seecr/meresco-solr | meresco/solr/__init__.py | Python | gpl-2.0 | 1,228 |
# ===========================================================================
# eXe
# Copyright 2004-2006, University of Auckland
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version... | kohnle-lernmodule/exeLearningPlus1_04 | exe/engine/scormdropdownidevice_tmp.py | Python | gpl-2.0 | 9,281 |
# -*- coding: utf-8 -*-
#
# Whitespace Evaluation SofTware documentation build configuration file, created by
# sphinx-quickstart on Wed Jul 9 13:12:12 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
# au... | kate-harrison/west | documentation/conf.py | Python | gpl-2.0 | 9,688 |
from property import *
# Neuron common parameters
iaf_neuronparams = {'E_L': -70.,
'V_th': -50.,
'V_reset': -67.,
'C_m': 2.,
't_ref': 2.,
'V_m': -60.,
'tau_syn_ex': 1.,
'tau_syn_i... | research-team/NEUCOGAR | NEST/cube/noradrenaline/scripts/parameters.py | Python | gpl-2.0 | 2,793 |
import sys
from timer import Timer
import os
import pandas as pd
import nipy
import numpy as np
import re
import argparse
def get_images_list(path, regexp, number_images=None):
im_list=[]
dir_list=os.listdir(path)
if regexp=="NO":
im_list=dir_list
return dir_list
reg=re.compile(regex... | roshchupkin/VBM | scripts/python/nii2np.py | Python | gpl-2.0 | 6,005 |
from setuptools import setup, find_packages, Extension
recoil_module = Extension('_recoil', sources=['recoil_interface.c', 'recoil.c'])
def readme():
with open('README.rst') as f:
return f.read()
setup(
name="pyrecoil",
version="0.3.1",
packages=find_packages(),
ext_modules=[recoil_module... | gasman/pyrecoil | setup.py | Python | gpl-2.0 | 1,164 |
from random import uniform as randfloat
class BankAccount:
'A simple class to store money.'
money = 0
owner = ""
def __init__(self, owner, money):
self.owner = owner
self.money = round(money, 2)
def getOwner(self):
return self.owner
def getMoney(self):
re... | timtim17/IntroToGameProg | Experiments/Bank.py | Python | gpl-2.0 | 1,989 |
import woo.core, woo.dem
from woo.dem import *
import woo.utils
from minieigen import *
from math import *
from woo import utils
m=woo.utils.defaultMaterial()
zeroSphere=woo.utils.sphere((0,0,0),.4) # sphere which is entirely inside the thing
for p in [woo.utils.sphere((0,0,0),1,mat=m),woo.utils.ellipsoid((0,0,0),semi... | sjl767/woo | examples/shapepack.py | Python | gpl-2.0 | 1,342 |
from roam.api import RoamEvents
from PyQt4.QtGui import QLineEdit, QPlainTextEdit
from PyQt4.QtCore import QEvent
from roam.editorwidgets.core import EditorWidget, registerwidgets
class TextWidget(EditorWidget):
widgettype = 'Text'
def __init__(self, *args):
super(TextWidget, self).__init__(*args)
... | HeatherHillers/RoamMac | src/roam/editorwidgets/textwidget.py | Python | gpl-2.0 | 1,572 |
from django.apps import apps as django_apps
from django.core.exceptions import ObjectDoesNotExist
from django.views.generic.base import ContextMixin
class SubjectOffstudyViewMixinError(Exception):
pass
class SubjectOffstudyViewMixin(ContextMixin):
"""Adds subject offstudy to the context.
Declare with ... | botswana-harvard/edc-offstudy | edc_offstudy/view_mixins.py | Python | gpl-2.0 | 2,362 |
from django.contrib.auth.models import User
from django.shortcuts import get_object_or_404
import django_filters
from rest_framework import viewsets
from rest_framework.response import Response
from api.serializers import UserSerializer, AddressSerializer, DestinationSerializer, GuestSerializer, MessageSerializer, Op... | wl-net/dataview | api/views.py | Python | gpl-2.0 | 6,096 |
from dnfpyUtils.stats.statistic import Statistic
import numpy as np
class Trajectory(Statistic):
"""
Abstract class for trajectory
"""
def __init__(self,name,dt=0.1,dim=0,**kwargs):
super().__init__(name=name,size=0,dim=dim,dt=dt,**kwargs)
self.trace = [] #save the trace
... | bchappet/dnfpy | src/dnfpyUtils/stats/trajectory.py | Python | gpl-2.0 | 1,105 |
# encoding: utf-8
# module PyKDE4.kio
# from /usr/lib/python3/dist-packages/PyKDE4/kio.cpython-34m-x86_64-linux-gnu.so
# by generator 1.135
# no doc
# imports
import PyKDE4.kdeui as __PyKDE4_kdeui
import PyQt4.QtCore as __PyQt4_QtCore
import PyQt4.QtGui as __PyQt4_QtGui
class KIconDialog(__PyKDE4_kdeui.KDialog):
... | ProfessorX/Config | .PyCharm30/system/python_stubs/-1247971765/PyKDE4/kio/KIconDialog.py | Python | gpl-2.0 | 1,319 |
#
# Copyright (C) 2001 Andrew T. Csillag <drew_csillag@geocities.com>
#
# You may distribute under the terms of either the GNU General
# Public License or the SkunkWeb License, as specified in the
# README file.
#
import os
import DT
import sys
import time
import marshal
import stat
def phf... | drewcsillag/skunkweb | pylibs/DT/dtrun.py | Python | gpl-2.0 | 911 |
#!/usr/bin/python
#
# Script to send email notifications when a change in Galera cluster membership
# occurs.
#
# Complies with http://www.codership.com/wiki/doku.php?id=notification_command
#
# Author: Gabe Guillen <gabeguillen@outlook.com>
# Version: 1.5
# Release: 3/5/2015
# Use at your own risk. No warranties expr... | gguillen/galeranotify | galeranotify.py | Python | gpl-2.0 | 5,427 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.