code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
#!/usr/bin/env python
"""
Created on Sun Dec 14 16:15:39 2014
Author: Oren Freifeld
Email: freifeld@csail.mit.edu
"""
import numpy as np
from of.utils import *
from scipy.sparse.linalg import expm
from numpy.linalg import det,inv
#from cy.expm import expm_3x3 as _expm_3x3
from cy.expm import expm_affine_3D_mult... | freifeld/cpabDiffeo | cpab/cpaNd/expm_affine_3D.py | Python | mit | 2,233 |
import logging, time, json, importlib
from igbtoolbox import evecommon, universe, pages, settings
from igbtoolbox.model import Pilot
from authn_simple import access
import tornado
tracking = None
try:
tracking = importlib.import_module('fleet.tracking')
except ImportError:
logging.debug('Tracking modules not f... | igbtoolbox/eveigb | server/igb/ping.py | Python | mit | 1,598 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'Widget_chooseSource.ui'
#
# Created by: PyQt5 UI code generator 5.9
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Info(object):
def setupUi(self, Info):
Info.setObj... | hillbilly3456avk/sonosControl | Widget_chooseSource.py | Python | mit | 6,854 |
from .models import ReceiptFile, RealThingSize, ExchangeInvolvement, MoneyBag, MoneyBagPiece, Exchange, PaymentMethod, Pledge
from what_apps.people.models import GenericParty
def exchange_with_other_party(party, member, receipt_image=None, date=None):
'''
Dehydration Function.
Takes the na... | SlashRoot/WHAT | what_apps/commerce/exchange_functions.py | Python | mit | 9,231 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin, GroupAdmin
from django.contrib.auth.models import User
from gerenciamento.models import *
from sorl.thumbnail.admin import AdminImageMixin
from autocomplete.widgets import *
from django.contr... | wendellpbarreto/mcc-django | gerenciamento/admin.py | Python | mit | 10,707 |
from __future__ import unicode_literals
from django.contrib.auth.models import User
from djblets.extensions.models import RegisteredExtension
from djblets.webapi.resources.registry import (ResourcesRegistry,
register_resource_for_model)
from oauth2_provider.models import ... | chipx86/reviewboard | reviewboard/webapi/resources/__init__.py | Python | mit | 5,153 |
import unittest
from meow_letters.score import Score
class TestScore(unittest.TestCase):
def setUp(self):
self.score = Score()
def test_add(self):
self.assertRaises(ValueError, self.score.add, -1)
self.assertEqual(self.score.add(15), 15)
self.assertEqual(self.score.add(0), 15... | ana-balica/meow_letters_py | meow_letters/tests/test_score.py | Python | mit | 600 |
# -*- coding: utf-8 -*-
import datetime
import urlparse
import dateutil.parser
from scrapy.linkextractors import LinkExtractor
from scrapy.spiders import CrawlSpider, Rule
from corpus_builder.items import TextEntry
from corpus_builder.templates.spider import NewspaperSpider
# Note: The spider only works for the "Pri... | bdcodefreak/corpus-builder | corpus_builder/spiders/newspaper/kalerkantho.py | Python | mit | 2,055 |
#Consistent Returns
__all__ = [ '' ]
def ok1(x):
if x:
return None
else:
return
def ok2(x):
if x:
return 4
else:
return "Hi"
def cr1(x):
if x:
return 4
def cr2(x):
if x:
return 4
else:
return
def ok3(x):
try:
return
... | github/codeql | python/ql/test/query-tests/Functions/return_values/functions_test.py | Python | mit | 3,207 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | Azure/azure-sdk-for-python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/models/_models_py3.py | Python | mit | 801,636 |
from django.apps import AppConfig
class AssessmentConfig(AppConfig):
name = 'Assessment'
| IEEEDTU/CMS | Assessment/apps.py | Python | mit | 95 |
import os
import praw
import json
import requests
from config import username, password, subreddit
# Why is this even a function
def wikilog(r, subreddit, wikipage, error):
r.edit_wiki_page(subreddit, wikipage, error, error)
if __name__ == "__main__":
print "Starting setup.py..."
print "Attempting to lo... | stock-character/Twitchy_the_bot | setup.py | Python | mit | 3,519 |
#!/usr/bin/env python
from __future__ import print_function, division
import sys, os
HOME = os.environ['HOME']
ROOT = os.getenv('EXOSYSPOP',os.path.join(HOME,'repositories','exosyspop'))
sys.path.append(ROOT)
sys.path.append(os.path.join(ROOT,'..'))
from exosyspop.populations import KeplerPowerLawBinaryPopulation
... | timothydmorton/exosyspop | scripts/run_abc.py | Python | mit | 1,978 |
import boto3
import LogsWatcher
import zip
import time
class CodeBuildHandler:
def __init__(self,projectName):
self.client = boto3.client('codebuild')
self.projectName = projectName
self.buildResult = None
self.buildId = None
self.sourceVersion = None
self.codeBucket... | RudolfVonKrugstein/codebuild-runner | CodeBuildHandler.py | Python | mit | 2,858 |
"""
Helper functions for scrapy project
dupCheck(): Delete duplicate entries.
Called after each reactor.run() in crimelog.py
"""
import sys
sys.path.insert(0, '/home/amirkurtovic/crimeline')
import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'crimeline.settings'
from storylist.models import Story
from scrapy.cont... | akurtovic/STL-Crimelog | crimelog/crimelog/helpers.py | Python | mit | 660 |
# vendcrawler
has_legs = False
| josetaas/vendcrawler | vendcrawler/__init__.py | Python | mit | 32 |
#!/usr/bin/python
# interpolate scalar gradient onto nedelec space
import petsc4py
import sys
petsc4py.init(sys.argv)
from petsc4py import PETSc
from dolfin import *
Print = PETSc.Sys.Print
# from MatrixOperations import *
import numpy as np
#import matplotlib.pylab as plt
import PETScIO as IO
import common
import ... | wathen/PhD | MHD/FEniCS/MHD/Stabilised/SaddlePointForm/Test/ParamTests/MHDkappa.py | Python | mit | 13,897 |
# -*- 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 field 'LocationSource.user'
db.add_column(u'location_locationsource', 'user',
... | coddingtonbear/django-location | location/migrations/0004_auto__add_field_locationsource_user.py | Python | mit | 7,053 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-09-09 13:19
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('comments', '0001_initial'),
]
operations = [
... | tyagow/AdvancingTheBlog | src/comments/migrations/0002_auto_20160909_1319.py | Python | mit | 674 |
from setuptools import setup
setup(
name='require.py',
version='2.0.1',
description="Path-based imports in Python, inspired by `require.js`",
url='https://github.com/pcattori/require.py',
author='Pedro Cattori',
author_email='pcattori@gmail.com',
license='MIT',
packages=['require'],
... | pcattori/require.py | setup.py | Python | mit | 706 |
#!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
AUTHOR = u'Amjith'
SITENAME = u'pgcli'
SITEURL = 'https://www.pgcli.com'
PATH = 'content'
TIMEZONE = 'America/Los_Angeles'
DEFAULT_LANG = u'en'
# Feed generation is usually not desired when developing
FEED_ALL_ATOM = 'feeds/all... | dbcli/pgcli.com | pelicanconf.py | Python | mit | 1,124 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Description: scrub tests
Copyright (c) 2013—2016 Andrea Peltrin
License: MIT (see LICENSE for details)
'''
import feedparser
from os import path
from ..markup import scrub_html
def run_tests():
# Figure out current dir
test_dir = path.dirname(path.abspa... | passiomatic/coldsweat | coldsweat/tests/scrub.py | Python | mit | 870 |
import sys
sys.path.append('../')
from Car import car
from . import FSA
from . import No_Rule_FSA
from . import Speed_First_FSA
from . import NS
import random
TYPE = ["normal", "badSight", "old", "drunk"]
delta = {
"normal": (0, 0, 1, 0),
"badSight": (-30, 0, 2, 0),
"old": (-30, 1,... | Anon-LeoH/MCM | Driver/__init__.py | Python | mit | 3,058 |
def filter_json(obj):
if type(obj) in (bool, float, int, str):
return obj
elif type(obj) == unicode:
return unicode(obj)
elif type(obj) == list:
obj = list(obj)
for i, v in enumerate(obj):
obj[i] = filter_json(v)
elif type(obj) == tuple:
obj = list(ob... | SgtFlame/pyzen-fabric | src/zen/fabric/json_util.py | Python | mit | 790 |
# -*- coding: UTF-8 -*-
from flask import request, jsonify
from sqlalchemy import and_
from flask.ext.login import login_required, current_user
from . import favor_ws
from genuine_ap.models import Favor, SPU
from genuine_ap.utils import do_commit
from genuine_ap.apis import wraps, retailer
@favor_ws.route('/favor/<in... | PuZheng/lejian-backend | lejian/favor/views.py | Python | mit | 1,604 |
'''
The purpose of this script is to take a csv file containing protein_binding data and create an h5 with a specified proportion
of examples to hold as a testing set.
by: Derek Jones
'''
import time
import os
import h5py
import pandas as pd
import numpy as np
import argparse
import numpy as np
from tqdm import tqdm
ra... | williamdjones/protein_binding | convert_csv_to_h5.py | Python | mit | 3,637 |
from blocks import *
from tags import *
from filemanager import *
from functools import partial
class Lang:
def __init__(self, I, O, block, offset = 0, tag = None, attributes = {}):
self.I = I #Input/read file
self.O = O #Output/write file
self.offset = False
self.tag = tag
self.attribute... | fourpoints/addup | old/langs.py | Python | mit | 12,804 |
from oldowan.mtconvert import seq2sites, sites2seq, str2sites
from string import translate
import pandas as pd
import numpy as np
import sys
sys.path.append('../../scripts')
from utils import *
## load metadata
metadata = pd.read_csv('metadata.csv', index_col=0)
region = range2region(metadata.ix[0,'SeqRange'])
with ... | ryanraaum/african-mtdna | popdata_sources/watson1997/process.py | Python | cc0-1.0 | 1,839 |
import svg_to_dxf as std
import sys
if __name__ == "__main__":
std.convert(svg_in=sys.stdin, dxf_out=sys.stdout, layer_to_style={}, debug_out=sys.stderr)
| randyp/svg-to-dxf | src/main.py | Python | cc0-1.0 | 160 |
import datetime
from django.contrib.auth import get_user_model
from django.utils.timezone import get_default_timezone
from django.contrib.comments.models import Comment
from django.contrib.contenttypes.models import ContentType
from django.contrib.sites.models import Site
from django.test import TestCase
from idea impo... | m3brown/idea-box | src/idea/tests/listview_tests.py | Python | cc0-1.0 | 15,319 |
"""
GVP Reconciliation service for OpenRefine 2.6-beta1.
Takes query data from URL request, coarsely searches for it against the Getty Vocab SPARQL endpoint, returns JSON of possible .
Adapted by Charlie Butcosk from http://code.google.com/p/google-refine/wiki/ReconciliationServiceApi, Mike Stephens' demo reconc... | ColbyMuseum/MuseumLOD | src/reconcile.py | Python | cc0-1.0 | 8,962 |
#!/usr/bin/python3
from instal.firstprinciples.TestEngine import InstalSingleShotTestRunner, InstalTestCase
class FactFileTerminates(InstalTestCase):
def test_iaf_kill_fluent(self):
runner = InstalSingleShotTestRunner(input_files=["facts/fact_kill.ial"], bridge_file=None,
... | cblop/tropic | instal-linux/instal/firstprinciples/facts/TestFactFileTerminates.py | Python | epl-1.0 | 3,546 |
if __name__ == '__main__':
import os
import sys
port = int(sys.argv[1])
root_dirname = os.path.dirname(os.path.dirname(__file__))
if root_dirname not in sys.path:
sys.path.append(root_dirname)
import pydevd
print('before pydevd.settrace')
pydevd.settrace(port=port)
... | Elizaveta239/PyDev.Debugger | tests_python/resources/_debugger_case_remote.py | Python | epl-1.0 | 387 |
from django.conf.urls import patterns, include, url
from hello.views import *
urlpatterns = patterns('',
url(r'^hello/$', BaseView.as_view()),
url(r'^hero/$', HeroView.as_view()),
url(r'^ideas/', 'hello.views.IdeasView'),
url(r'^action/$', doEmbed),
#url(r'^ideas/form/(\d*)', 'hello.views.idea_Form... | kariefury/pyDev-Django-GAE | hello/urls.py | Python | epl-1.0 | 327 |
import sys, pygame
import math
import mosquitto
from time import sleep
import requests
import json
'''
Little display of a mongodb database.
First fetching the content of the database
Then each time the database is modified displaying immediatly the changes
'''
def get_score(bd, table):
r = requests.get('http://loc... | twane/nfc_voting | server/affichage.py | Python | epl-1.0 | 1,844 |
import os, sys
lib_path = os.path.abspath("/home/slundquist/workspace/PetaVision/plab/")
sys.path.append(lib_path)
from plotRecon import plotRecon
from plotReconError import plotReconError
#For plotting
#import matplotlib.pyplot as plt
outputDir = "/nh/compneuro/Data/MLPLCA/LCA/heli_gt_test/"
skipFrames = 1 #Only pri... | dpaiton/OpenPV | projects/MLPLCA/python/heli_gt_test.py | Python | epl-1.0 | 703 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('patchwork', '0007_move_comment_content_to_patch_content'),
]
operations = [
migrations.AlterField(
model_name='comment',
name='content',
field=models.Tex... | getpatchwork/patchwork | patchwork/migrations/0008_add_email_mixin.py | Python | gpl-2.0 | 368 |
#!/usr/local/bin/python
## Copyright (C) 2005-2006 Graham I Cummins
## 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 2 of the License, or (at your option) any later version.
... | gic888/MIEN | tools/verifyBBT.py | Python | gpl-2.0 | 4,253 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright © 2017 Juuso Räsänen <info@trimap.fi>
"""
photofind Command-line tool for finding photos based on EXIF-information.
Usage: photofind [PATH] [PHOTO-OPTIONS] [FIND-OPTIONS]
Author: Juuso Räsänen 2013 (email: info@trimap.fi)
"""
import sys
import argparse
from... | Trimap/photofind | photofind.py | Python | gpl-2.0 | 4,619 |
from sqlobject.dbconnection import registerConnection
def builder():
import mssqlconnection
return mssqlconnection.MSSQLConnection
def isSupported(cls):
try:
import pymssql
except ImportError:
try:
import adodbapi
except ImportError:
return False
ret... | fregaham/DISP | sqlobject/mssql/__init__.py | Python | gpl-2.0 | 382 |
'''
Created on Oct 6, 2014
@author: sunnycomes
'''
import os
from tornado.options import options
def get_site_info():
params = {}
params["author"] = options.author
params["url"] = options.url
params["title"] = options.title
params["keywords"] = options.keywords
params["description"] = options.... | sunnycomes/IoVision | src/common/settings.py | Python | gpl-2.0 | 1,614 |
# -*- coding: utf-8 -*-
# Page model for Intel->Chargeback->Assignments.
from . import ChargebackView
from navmazing import NavigateToSibling, NavigateToAttribute
from widgetastic.widget import Text
from widgetastic_manageiq import Table
from widgetastic_manageiq.hacks import BootstrapSelectByLocator
from widgetastic_... | okolisny/integration_tests | cfme/intelligence/chargeback/assignments.py | Python | gpl-2.0 | 4,753 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('hrp', '0021_auto_20160928_1435'),
]
operations = [
migrations.AlterField(
model... | paleocore/paleocore | hrp/migrations/0022_auto_20170422_1146.py | Python | gpl-2.0 | 540 |
import rvlib as rl
import scipy.stats as st
import numpy as np
# Get random points to evaluate functions
np.random.seed(1234)
x = np.random.rand(10)
# Create normal distrtibution
N_rl = rl.Normal(0,1)
N_st = st.norm(0,1)
# Check normal cdfs/pdfs against each other
N_rl_cdf = N_rl.cdf(x)
N_st_cdf = N_st.cdf(x)
np.all... | QuantEcon/Distributions.py | rvlib/tests/basic_tests.py | Python | gpl-2.0 | 556 |
from stgit import argparse, utils
from stgit.argparse import opt
from stgit.commands.common import (
CmdException,
DirectoryHasRepository,
check_head_top_equal,
run_commit_msg_hook,
update_commit_data,
)
from stgit.config import config
from stgit.lib.git import CommitData, Person
from stgit.lib.tran... | emacsmirror/stgit | stgit/commands/new.py | Python | gpl-2.0 | 4,150 |
# Just pretend this is bash... of evil! Muhahahaha!
import subprocess, os, sys
sauronHome = "jsevil"
args = []
# Get special Ogres
def getSpecialOgres():
specialOgres = []
for specialOgre in sys.argv:
args.append(specialOgre)
specialOgreHome = "jsevil/%s" % (specialOgre)
if (os.path.isdir(specialOgreHome)):
... | grebnafets/jsevil | tools/python/integration/showSet.py | Python | gpl-2.0 | 1,487 |
# Recursively scan flac folders and get label/format from discogs
# based on FLAC 'Artist' and 'Album' meta tags and write info to a file
# named '<Label_name>.label' in album directory
import shutil
import os
from mutagen.id3 import ID3
from mutagen.flac import FLAC
import requests
import re
from bs4 import Beautifu... | n0x5/scripts | discogs_label.py | Python | gpl-2.0 | 2,995 |
import datetime
import expa_wrapper
from credentials_store import credentials
import logging
import sys
import re
import os
from expa_hubspot_converter import EXPAHubspotConverter
from hubspot_wrapper import HubspotWrapper
class StreamToLogger(object):
"""
Fake file-like stream object that redirects writes to ... | AIESECGermany/gis-hubspot-sync | sync.py | Python | gpl-2.0 | 4,104 |
from __future__ import division
from collections import Set, Hashable, Mapping, MutableMapping
from murasyp.functions import Function
class Vector(Function, Hashable):
"""Vectors map arguments to zero or a specified rational value
This class derives from :class:`~murasyp.functions.Function`, so its
method... | equaeghe/murasyp | murasyp/vectors.py | Python | gpl-2.0 | 7,085 |
# -*- coding: utf-8 -*-
# Copyright (C) 2011-2012 Sphere Systems, U.K.
# Copyright (C) 2008-2009 Warp Networks, S.L.
# Author: Andrew Bird
#
# 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; ei... | andrewbird/wader | test/test_dbus.py | Python | gpl-2.0 | 63,228 |
from django.conf.urls import patterns, include, url
from django.contrib import admin
urlpatterns = patterns('',
url(r'^admin/', include(admin.site.urls)),
url(r'^skills/', include('skills.urls', namespace='skills')),
) | cmdelatorre/roses | roses_project/urls.py | Python | gpl-2.0 | 227 |
from flask import Blueprint
download = Blueprint('download', __name__)
@download.route('/download')
def index():
return 'Welcome to the Download module!' | geobricks/Playground | playground/FlaskBlueprints/download.py | Python | gpl-2.0 | 159 |
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# ------------------------------------------------------... | crossroadchurch/paul | openlp/core/ui/projector/editform.py | Python | gpl-2.0 | 12,998 |
#!/usr/bin/env python3
import os, os.path
import sys, subprocess
configure_args = sys.argv[1:]
host_arch = 'i686-w64-mingw32'
if len(configure_args) > 0 and configure_args[0] == '--64':
configure_args = configure_args[1:]
host_arch = 'x86_64-w64-mingw32'
# the path to the MPD sources
mpd_path = os.path.abs... | Gentro/mpd | win32/build.py | Python | gpl-2.0 | 3,249 |
import conf
import random
import load
import sys
import cPickle as pickle
import numpy as np
pairNum = 1000
def buildLabelMatrix(labels):
size = len(labels)
mat = np.zeros((size, size))
cnt = 0
while 1:
p0, p1 = random.randint(0, size - 1), random.randint(0, size - 1)
if mat[p0, p1] !... | liuyang1/ssh | newcifar/Ml.py | Python | gpl-2.0 | 1,400 |
# -*- coding: utf-8 -*-
# Copyright(c) 2016-2020 Jonas Sjöberg <autonameow@jonasjberg.com>
# Source repository: https://github.com/jonasjberg/autonameow
#
# This file is part of autonameow.
#
# autonameow is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public L... | jonasjberg/autonameow | autonameow/util/disk/collector.py | Python | gpl-2.0 | 5,329 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""This script creates a demo plot for the nc2map user manual
Plot types are:
1. temperature field
2. temperature field with overlayed quiver plot
3. quiver plot
4. stream plot
"""
import nc2map
ncfile = '../../demo/demo-t2m-u-v.nc'
fmt = {
'clabel': '%(long_na... | Chilipp/nc2map | docs/user_manual/make_demo_plots.py | Python | gpl-2.0 | 1,822 |
#! /usr/bin/env python
#tooltip.py
import sys
from PyQt4 import QtGui
from PyQt4 import QtCore
class Tooltip(QtGui.QWidget):
def __init__(self, parent=None):
QtGui.QWidget.__init__(self,parent)
self.setGeometry(300,300,250,150)
self.setWindowTitle('Tooltip')
self.setToolTip('This is a <b>QWidget</b> widget')
... | Urinx/PyQt4.tutorial | examples/3.tooltip.py | Python | gpl-2.0 | 461 |
__author__ = "Mateus Dubiela Oliveiar < first . last @ gmail.com>"
from mrjob.job import MRJob
import re
class TwitterFollowersCountApp(MRJob):
def steps(self):
return [
self.mr(
mapper=self.map_followers,
reducer=self.reducer_sum),
self.mr(
mapper=self.map_group,
combiner=self.reducer_gre... | mateusduboli/map-reduce | twitter/twitter_most_followed.py | Python | gpl-2.0 | 758 |
# (C)2011 Red Hat, Inc., Lukas Czerner <lczerner@redhat.com>
#
# 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 2 of the License, or
# (at your option) any later version.
#
# This ... | dinhxuanvu/ssm | ssmlib/misc.py | Python | gpl-2.0 | 17,757 |
# Copyright © 2020, Joseph Berry, Rico Tabor (opendrop.dev@gmail.com)
# OpenDrop is released under the GNU GPL License. You are free to
# modify and distribute the code, but always under the same license
# (i.e. you cannot make commercial derivatives).
#
# If you use this software in your research, please cite the foll... | ricotabor/opendrop | opendrop/app/ift/image_processing/services/plugins/drop_region/__init__.py | Python | gpl-2.0 | 1,448 |
from routersploit.modules.creds.routers.dlink.telnet_default_creds import Exploit
def test_check_success(generic_target):
""" Test scenario - testing against Telnet server """
exploit = Exploit()
assert exploit.target == ""
assert exploit.port == 23
assert exploit.threads == 1
assert exploit... | dasseclab/dasseclab | clones/routersploit/tests/creds/routers/dlink/test_telnet_default_creds.py | Python | gpl-2.0 | 666 |
"""
TESTS is a dict with all you tests.
Keys for this will be categories' names.
Each test is dict with
"input" -- input data for user function
"answer" -- your right answer
"explanation" -- not necessary key, it's using for additional info in animation.
"""
TESTS = {
"Basics": [
{
... | Bryukh-Checkio-Tasks/checkio-task-even-counter | verification/tests.py | Python | gpl-2.0 | 1,154 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2015-12-16 01:31
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('endpoint', '0002_auto_20151210_1246'),
]
operations = [
migrations.CreateModel... | PGower/PNS | pns_web/endpoint/migrations/0003_fullname.py | Python | gpl-2.0 | 566 |
########################
# Jean-Philippe Groulx #
# Pierre-Emmanuel Viau #
# Yann David #
# #
# #
# Classe Map #
# Proprietaire: Yann #
########################
from Tkinter import *
from tkFont import *
from Map import *
from Constantes impo... | blen2r/TkTowerDefense | VueMap.py | Python | gpl-2.0 | 1,287 |
# This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | protatremy/buildbot | master/buildbot/test/unit/test_steps_worker.py | Python | gpl-2.0 | 17,372 |
# -*- coding: utf-8 -*-
"""
Created on Tue May 30 16:35:28 2017
@author: rstreet
"""
from django.core.management.base import BaseCommand
from django.contrib.auth.models import User
from events.models import Event
from scripts import fixes
class Command(BaseCommand):
args = ''
help = ''
def _fix_nf(self... | ytsapras/robonet_site | events/management/commands/fix_nf.py | Python | gpl-2.0 | 451 |
# Copyright (C) 2015 Linaro Limited
#
# Author: Senthil Kumaran S <senthil.kumaran@linaro.org>
#
# This file is part of LAVA Dispatcher.
#
# LAVA Dispatcher 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; eith... | Linaro/lava-dispatcher | lava_dispatcher/test/test_fastboot.py | Python | gpl-2.0 | 17,763 |
__author__ = 'mafanhe'
# -*- coding:utf-8 -*-
import urllib
import urllib2
import re
import os
class Spider:
def __init__(self):
self.siteURL = 'http://www.mmkds.com/rosi-'
self.user_agent = 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.6) Gecko/20091201 Firefox/3.5.6'
#初始化head... | mafanhe/python_rosi_spider | rosi.py | Python | gpl-2.0 | 2,322 |
# encoding: utf-8
# module PyKDE4.kio
# from /usr/lib/python2.7/dist-packages/PyKDE4/kio.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 KBookmarkManager(__PyQt4_QtCore.QObject):
# no doc
def auto... | ProfessorX/Config | .PyCharm30/system/python_stubs/-1247972723/PyKDE4/kio/KBookmarkManager.py | Python | gpl-2.0 | 2,907 |
# Copyright (c) 2010 Matej Laitl <matej@laitl.cz>
# Distributed under the terms of the GNU General Public License v2 or any
# later version of the license, at your option.
"""Tests for kalman"""
from copy import copy, deepcopy
import numpy as np
import pybayes as pb
from support import PbTestCase, stochastic
clas... | cdondrup/PyBayes | pybayes/tests/test_filters.py | Python | gpl-2.0 | 6,052 |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2016 CERN.
#
# Invenio 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 2 of the
# License, or (at your option) any later... | omelkonian/cds | cds/modules/deposit/links.py | Python | gpl-2.0 | 2,565 |
from collections import deque
if __name__ == '__main__' :
testCase = int(input())
for tc in range(testCase) :
K, N = map(int, input().split(' '))
a = 1983
q = deque()
result = 0
sum = 0
for i in range(N) :
if i > 0 :
a = (a*214013 + 25... | fisache/hackerrank | algospot/questack/ITES/main.py | Python | gpl-2.0 | 593 |
from pynmea import nmea
import serial, time, sys, threading, datetime, shutil
######Global Variables#####################################################
# you must declare the variables as 'global' in the fxn before using#
ser = 0
lat = 0
long = 0
pos_x = 0
pos_y = 0
alt = 0
i = 0 #x units for altitude mea... | lmyboy/RaspberryPi | gpsmap.py | Python | gpl-2.0 | 2,146 |
# -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsFieldModel
.. note:: 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 2 of the License, or
(at your option) any later version.
"""
__au... | telwertowski/QGIS | tests/src/python/test_qgsfieldmodel.py | Python | gpl-2.0 | 16,991 |
from django.conf.urls import patterns,url
from registration import views
urlpatterns=patterns('',
url(r'^$',views.index,name='index'),)
| kerbinagent/tabpy2 | registration/urls.py | Python | gpl-2.0 | 145 |
#!/usr/bin/env python
# **********************************************************************
#
# Copyright (c) 2003-2011 ZeroC, Inc. All rights reserved.
#
# This copy of Ice is licensed to you under the terms described in the
# ICE_LICENSE file included in this distribution.
#
# *************************************... | joshmoore/zeroc-ice | cpp/test/Ice/invoke/run.py | Python | gpl-2.0 | 1,149 |
# -*- coding: utf-8 -*-
# MouseTrap
#
# Copyright 2009 Flavio Percoco Premoli
#
# This file is part of mouseTrap.
#
# MouseTrap is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License v2 as published
# by the Free Software Foundation.
#
# mouseTrap is distributed ... | amberheilman/mousetrap | src/mousetrap/app/ui/settings_gui.py | Python | gpl-2.0 | 19,280 |
#!/usr/bin/python
# Investigate the computed force law as a function of radial separation
import sys
import math
import os
import random
import numpy as np
# So that the bumper code can set things up
proggyName = "rdep"
# Make datum more useful for parsing forcetest
class Datum:
# and a constructor to take the ... | kcroker/Gadget-2.0.7-ngravs | utilities/rdep.py | Python | gpl-2.0 | 5,138 |
import sys
import os
import time
from PyQt4.Qt import *
from PyQt4.QtCore import *
from PyQt4.QtGui import *
os.path.join(os.path.dirname(__file__), os.pardir, os.pardir)
from graphics_scene import GraphicsScene
from graphics_view import GraphicsView
p = os.path.abspath(os.path.join(os.path.dirname(__file__),
... | CospanDesign/nysa-gui | NysaGui/host/view/nysa_bus_view/fpga_bus_view.py | Python | gpl-2.0 | 1,714 |
'''
urlresolver XBMC Addon
Copyright (C) 2011 t0mm0
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 3 of the License, or
(at your option) any later version.
... | koditraquinas/koditraquinas.repository | script.module.urlresolver/lib/urlresolver/plugins/playedto.py | Python | gpl-2.0 | 1,647 |
import unittest
import os
from urllib2 import urlopen
import sys
sys.path.append(os.path.join('..', '..', 'standalone'))
import eval_server
import config
class TestEvalServer(unittest.TestCase):
def test_parse_query(self):
result = urlopen(config.DEFAULT_PORT)
if __name__ == '__main... | dwyde/poolside | tests/python/test_standalone.py | Python | gpl-2.0 | 347 |
import os
import sys
import fnmatch
# matches = []
# for root, dirnames, filenames in os.walk('src'):
# for filename in fnmatch.filter(filenames, '*.c'):
# matches.append(os.path.join(root, filename))
def get_simulation_configs(base_dir):
"""
Prints all the simulation configuration files found from th... | maxwelld90/searcher_simulations | scripts/old/get_simulation_list.py | Python | gpl-2.0 | 1,278 |
# -*- coding: utf-8 -*-
# Scrapy settings for anacapa project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# http://doc.scrapy.org/en/latest/topics/settings.html
# http://scrapy.readthedocs.org/en/latest... | buffer/anacapa | anacapa/settings.py | Python | gpl-2.0 | 2,996 |
t = input()
for i in xrange(t):
n = input()
l = map(int,raw_input().split())
count = 0
for j in xrange(n):
for k in xrange(j+1,n):
if 1<=l[j]<l[k] and 1<=l[k]<=l[n-1]:
if (l[j]^l[k])%2 != 0:
count += 1
print count
| triump0870/hackerearth | sherlock+and_xor.py | Python | gpl-2.0 | 233 |
#!/usr/bin/env python
import os
import sys
os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.settings'
os.environ['COLAB_PLUGINS'] = 'tests/plugins.d'
os.environ['COVERAGE_PROCESS_START'] = '.coveragerc'
import django
import coverage
from django.test.utils import get_runner
from django.conf import settings
def runte... | rafamanzo/colab | tests/run.py | Python | gpl-2.0 | 722 |
#
# Manage registers in a hardware design
#
# Copyright (C) 2008 Donald N. Allingham
#
# 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 2 of the License, or
# (at your option) any... | dallingham/regenerate | regenerate/ui/error_dialogs.py | Python | gpl-2.0 | 2,543 |
SCORE_THRESHOLD = 0.7
TAG_FILE_PATH = "tagfiles/"
CLASS_NUM = 22
CLASSES = [
"total",
"blding",
"grass",
"tree",
"cow",
"sheep",
"sky",
"plane",
"water",
"face",
"car",
"bicycle",
"flower",
"sign",
"b... | cmusatyalab/GigaSight | src/indexer/Indexer/pstf/compare_accuracy.py | Python | gpl-2.0 | 5,044 |
# -*- coding: utf-8 -*-
TFG1 = {'tipo': 'T2', 'titulo': 'Análisis Exploratorio de Datos Mediante Técnicas de Visualización Avanzada',
'n_alumnos': '1',
'descripcion': 'Vivimos en la era de la información y la transparencia. Nos rodea una inmensidad de datos que '
'dificilmente po... | gabriel-stan/gestion-tfg | apps/comisiones_evaluacion/tests/test_upload_file_tfgs/cases.py | Python | gpl-2.0 | 3,743 |
__author__ = "Martin Blais <blais@furius.ca>"
import unittest
from beancount.core import number
from beancount.core.number import D
from beancount.core.number import Decimal
from beancount.core.number import ZERO
class TestDecimalPrecision(unittest.TestCase):
def test_formatting(self):
# Verifying if w... | iocoop/beancount | src/python/beancount/core/number_test.py | Python | gpl-2.0 | 1,967 |
# test step.package.rpm.*
from twisted.trial import unittest
from buildbot.steps.package.rpm import RpmBuild, RpmLint, RpmSpec
class TestRpmBuild(unittest.TestCase):
"""
Tests the package.rpm.RpmBuild class.
"""
def test_creation(self):
"""
Test that instances are created with prope... | centrumholdings/buildbot | buildbot/broken_test/unit/test_package_rpm.py | Python | gpl-2.0 | 3,334 |
from distutils.core import setup
from distutils.extension import Extension
from Cython.Build import cythonize
exts = ('getpixel',)
#extensions = [Extension(e, ['%s.pyx' % e], extra_compile_args=['-O3']) for e in exts]
extensions = [Extension(e, ['%s.pyx' % e]) for e in exts]
setup(
ext_modules = cythonize(exten... | buzz/sniegabuda-raspi | voxelspace/setup.py | Python | gpl-2.0 | 330 |
from flask import Flask, render_template
app = Flask(__name__)
@app.route('/')
def home():
return "Hello World"
if __name__ == '__main__':
app.run(host='127.0.0.3', port=9098, debug=True)
| nrahul1992/flask_repo | app.py | Python | gpl-2.0 | 200 |
# -*- coding: utf-8 *-*
import fix
fix.getJavaFX()
from javafx.fxml import FXMLLoader as FxmlL
from java.io import File
class FXMLLoader(object):
def __init__(self, fxmlfile, prefix = ""):
print fxmlfile
fxml = FxmlL(File(fxmlfile).toURL())
fxml.setController(self)
self.body = fxm... | jeremi360/jythonfx | jythonfx/fxml.py | Python | gpl-2.0 | 1,331 |
# -*- coding: utf-8 -*-
#
# PartMgr GUI - Entity combo box
#
# Copyright 2014 Michael Buesch <m@bues.ch>
#
# 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 2 of the License, or
# (... | mbuesch/partmgr | partmgr/gui/entitycombobox.py | Python | gpl-2.0 | 1,768 |
import unittest
from ..engine.statistics import *
from ..engine.tetrimino import *
class TestStatisticsCore(unittest.TestCase):
def setUp(self):
self.statistics = StatisticsCore()
def test_note_tetrimino_spawn(self):
tetrimino = create_tetrimino(Tetrimino.Type.L, 0, 0)
self.statistic... | m1trix/Tetris-Wars | tetris_wars/tests/test_statistics.py | Python | gpl-2.0 | 1,866 |
from geo_bsd import set_output_handler
from geo_bsd import set_progress_handler
from geo_bsd import sis_simulation
from geo_bsd import calc_cdf
from PySide import QtCore, QtGui
class SISThread(QtCore.QThread):
propSignal = QtCore.Signal(object)
logMessage = QtCore.Signal(str)
progressMessage = QtCore.Signa... | Snegovikufa/HPGL-GUI | hpgl_run/sis_thread.py | Python | gpl-2.0 | 1,812 |
import os,builder
from catalyst_support import *
class generic_ppc(builder.generic):
"abstract base class for all 32-bit powerpc builders"
def __init__(self,myspec):
builder.generic.__init__(self,myspec)
self.settings["CHOST"]="powerpc-unknown-linux-gnu"
if self.settings["buildarch"]=="ppc64":
if not os.pa... | dol-sen/catalyst | arch/powerpc.py | Python | gpl-2.0 | 4,077 |
from .ScriptControl import api, scripts
| dpoulson/r2_control | Hardware/Scripts/__init__.py | Python | gpl-2.0 | 40 |
"""
Package resource configuration class.
Copyright 2010 Kelsey Hightower
Kelsey Hightower <kelsey.hightower@gmail.com>
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 2 of the Licens... | elsonrodriguez/madhatter | koan/redhat/configure_packages.py | Python | gpl-2.0 | 3,448 |