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 |
|---|---|---|---|---|---|
import socket, struct
from datetime import datetime
class DDos():
def detectionOfDDos(self):
s = socket.socket(socket.PF_PACKET, socket.SOCK_RAW, 8)
dict = {}
file_txt = open("ddos_detection.txt",'a')
file_txt.writelines("**********")
t1= str(datetime.now())
file_txt.writelines(t1)
file_... | rudolfvavra/network | penetration/ddos_detection.py | Python | mit | 1,020 |
import time
import datetime
import urllib
import urlparse
import gevent
from gevent.event import Event
import requests
from socketio.engine import parser
from socketio.event_emitter import EventEmitter
import logging
from ws4py.client.geventclient import WebSocketClient
logger = logging.getLogger(__name__)
class Tra... | shuoli84/gevent_socketio2 | socketio_client/engine/transports.py | Python | mit | 10,537 |
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import Select
import time
#<class 'selenium.webdriver.firefox.webdriver.WebDriver'>
def ... | foali/testbot | testFirefox.py | Python | mit | 1,434 |
# 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.
# --------------------------------------------------------------------... | Azure/azure-sdk-for-python | sdk/storage/azure-storage-blob/tests/test_append_blob.py | Python | mit | 66,814 |
print "Hello World!"
print "Hellow Again!"
print "I like typing this."
print "This is fun."
print 'Yay printing!'
print "I'd much rather you 'not'."
print 'I "said" eat a BANANA!'
| jaredmanning/learning | lpthw/ex1.py | Python | mit | 180 |
# -*- coding: utf-8 -*-
import os
import random
from syncano_cli.config import ACCOUNT_CONFIG, ACCOUNT_CONFIG_PATH
from syncano_cli.main import cli
from tests.base import BaseCLITest
class AccountCommandsTest(BaseCLITest):
def test_register(self):
# remove file with connection data:
if os.path.i... | Syncano/syncano-cli | tests/test_account.py | Python | mit | 1,029 |
import sys
sys.path.insert(0, '/Users/majid/EntityResolution/')
from optparse import OptionParser
from pyspark import SparkContext, StorageLevel
from dictionaries import V
from geoname_extractor import processDoc
from ProbabilisticER import scoreCandidates, initializeRecordLinkage
import json
import codecs
"""
RUN AS:... | usc-isi-i2/dig-geonames | python/resolve_geonames-single-line.py | Python | mit | 14,237 |
from dash import Dash, Input, Output, State, dcc, html
import time
from multiprocessing import Value
from tests.integration.long_callback.utils import get_long_callback_manager
long_callback_manager = get_long_callback_manager()
handle = long_callback_manager.handle
app = Dash(__name__, long_callback_manager=long_c... | plotly/dash | tests/integration/long_callback/app6.py | Python | mit | 1,966 |
# -*- coding: utf-8 -*-
import pytest
from irc3.plugins import web
from aiohttp.test_utils import make_mocked_request
class Payload:
def __init__(self, data):
self.data = data
async def readany(self):
data = self.data
self.data = b''
return data
@pytest.mark.asyncio
async d... | gawel/irc3 | tests/test_web.py | Python | mit | 2,307 |
import json
from random import shuffle
from .tdigestcore import TDigestCore
class TDigest(object):
def __init__(self, delta=0.01, compression=20):
self.delta = float(delta)
self.compression = compression
self.tdc = TDigestCore(self.delta)
def add(self, x, w):
self.tdc.add(x,... | trademob/t-digest | tdigest/tdigest.py | Python | mit | 957 |
import win32serviceutil
import win32service
import win32event
import servicemanager
import socket
import logging
from logging import handlers
import threading
from xmediusmailrelayserver import server
from xmediusmailrelayserver.server import start_server
from os.path import dirname, join
from os import mkdir, stat
imp... | xmedius/xmedius-mailrelayserver | xmediusmailrelayserver/servicehelpers.py | Python | mit | 2,485 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-09-21 04:49
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('ecs', '0008_auto_20170921_1238'),
]
operations = [
migrations.RenameField(
... | hyperwd/hwcram | ecs/migrations/0009_auto_20170921_1249.py | Python | mit | 436 |
#!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2011 Thomas Voegtlin
#
# 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... | molecular/electrum | lib/util.py | Python | mit | 20,247 |
import sys, platform, importlib, types
import collections
__pyv = '%d%d'%sys.version_info[0:2]
if platform.architecture()[0] == '32bit':
c = importlib.import_module(".cenum_cp%s_x86"%__pyv, "cenum")
else:
c = importlib.import_module(".cenum_cp%s_x64"%__pyv, "cenum")
class cenum_metaclass... | zmic/cenum | cenum/__init__.py | Python | mit | 2,310 |
from os.path import abspath, join, dirname
PROJECT_ROOT = abspath(join(dirname(__file__), '../..'))
# logging settings
DEBUG_LOG_NAME = 'debug.log'
LOG_FILE_PATH = '{PROJECT_ROOT}/{DEBUG_LOG_NAME}'.format(**globals())
FILE_LOG_LEVEL = 'DEBUG'
CONSOLE_LOG_LEVEL = 'CRITICAL'
# Backup location
BACKUP_LOCATION = '/User... | idjaw/dot-manager | app/settings/settings.py | Python | mit | 824 |
from PyQt5.QtWidgets import QTabWidget
from PyQt5 import QtCore, QtGui, QtWidgets
class DevProjs(QTabWidget):
def __init__(self, parent=None):
super(DevProjs, self).__init__(parent)
self.setupUi(self)
def setupUi(self, QTabWidget):
QTabWidget.setObjectName("QTabWidget")
QTabW... | whuang001/cts | gui/DevProjs.py | Python | mit | 7,672 |
from django.contrib.admin import ModelAdmin
from .forms import ValidateForm
def attach_our_base_form(fn):
def get_form(self, *args, **kwargs):
form = fn(self, *args, **kwargs)
setattr(form, '__init__', attach_validate_init(form.__init__))
return form
setattr(get_form, 'our_get_form', ... | kiahosseini/django-form-validation | form_validation/__init__.py | Python | mit | 808 |
from __future__ import absolute_import
import unittest
import os
from got10k.trackers import IdentityTracker
from got10k.experiments import ExperimentGOT10k, ExperimentOTB, \
ExperimentVOT, ExperimentDTB70, ExperimentTColor128, \
ExperimentUAV123, ExperimentNfS
class TestExperiments(unittest.TestCase):
... | got-10k/toolkit | tests/test_experiments.py | Python | mit | 2,633 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Base test case class to bootstrap application testing.
Code downloaded from: http://github.com/rzajac/gaeteststarter
@author: Simon Ndunda: Modified to add support for deferred tasks
@author: Rafal Zajac rzajac<at>gmail<dot>com
@copyright: Copyright 2007-2013 Rafal Z... | echomobi/echo-sense | testing/base_test_case.py | Python | mit | 16,686 |
__author__ = 'oussama'
class Party(object):
code = ""
create_date = ""
citizenship = ""
photo = ""
alternative_identification = ""
sex = ""
insurance_company_type = ""
internal_user = ""
activation_date = ""
alternative_ids = []
full_name = ""
vat_number = ""
insura... | o5k/bootcamp-ihealth | bootcamp/ihealth/classes.py | Python | mit | 2,890 |
#!/usr/bin/env python
# encoding: utf-8
#
# Copyright (c) 2014 ritashugisha
# MIT License. <http://opensource.org/licenses/MIT>
"""
user
.. module:: user
:platform: Linux, MacOSX, Windows
:synopsis: Main module client.
:created: 09-17-2015 22:30:08
:modified: 09-17-2015 22:30:08
.. moduleauthor:: rita... | ritashugisha/pytinder | pytinder/client.py | Python | mit | 15,166 |
# -*- coding: utf-8 -*-
# TODO: Compile the extension the correct way.
# TODO: Get rid of the weird imports via renaming and then assignment.
# TODO: Have pure Python code as a fallback.
import pyximport
pyximport.install(language_level="3")
# noinspection PyUnresolvedReferences
from _categorization import Property a... | hosford42/pyramids | pyramids/categorization.py | Python | mit | 1,161 |
#The MIT License (MIT)
#
#Copyright (c) 2016 Xustyx
#
#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, p... | Xustyx/RouteSimulator | routeparser.py | Python | mit | 2,579 |
class ConfSyrupException(Exception):
pass
class InvalidOption(ConfSyrupException):
pass
class UnableToLoadSettings(ConfSyrupException):
pass
class ConflictingTypes(ConfSyrupException):
pass
class IOErrorWhileReading(ConfSyrupException):
pass
class CastError(ConfSyrupException):
pass
| stuntgoat/conf-syrup | conf_syrup/exceptions.py | Python | mit | 319 |
# This file is part of creddump.
#
# creddump 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.
#
# creddump is distributed in the hope t... | tholum/PiBunny | system.d/library/tools_installer/tools_to_install/responder/tools/MultiRelay/creddump/framework/win32/lsasecrets.py | Python | mit | 3,914 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-02-27 21:17
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('crm', '0021_event_event_web_site'),
]
operations = [
migrations.AlterField(... | asterix135/infonex_crm | crm/migrations/0022_auto_20170227_1617.py | Python | mit | 471 |
import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config:
SECRET_KEY = os.environ.get('SECRET_KEY') or 'hard to guess string'
SQLALCHEMY_COMMIT_ON_TEARDOWN = True
SQLALCHEMY_RECORD_QUERIES = True
@staticmethod
def init_app(app):
pass
class DevelopmentConfig(Config):
... | Frederick-S/quiz | config.py | Python | mit | 691 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
File name: setup.py
Author: Luis Roberto Pereira de Paula
Date created: 2015-11-20
Date last modified: 2015-11-20
"""
from setuptools import setup
setup(name='PySimprocSP',
version='0.2',
description='Get process details in the Simproc syst... | luisrpp/python-simproc-sp | setup.py | Python | mit | 695 |
#!/usr/bin/env python
from setuptools import setup, find_packages
setup (
name = "Tunnelling",
version = "1.1",
description="App and module for creating tunnels through SSH",
author="Mario Rivas",
author_email="h@cked.es",
url="http://github.com/gry/tunnelling",
packages=['tunnelling'],
... | gry/tunnelling | setup.py | Python | mit | 586 |
import datetime
from flask import abort, current_app, request
from dmapiclient.audit import AuditTypes
from .. import main
from ... import db
from ...models import AuditEvent, Outcome
from ...utils import (
get_json_from_request,
get_valid_page_or_1,
json_has_required_keys,
paginated_result_response,... | alphagov/digitalmarketplace-api | app/main/views/outcomes.py | Python | mit | 4,712 |
from datetime import datetime
from reph.timer import Timer
class ReportRecord(object):
@property
def session_id(self):
return self.store.session_id
def __init__(self, nodeid, store):
self.nodeid = nodeid
self.store = store
self.start_time = datetime.utcnow()
self.... | aleivag/pegparsing | pytest-reph/reph/record.py | Python | mit | 839 |
# -*- coding: utf-8 -*-
# This file is part of dashsegmenter project
# http://github.com/Teeed/dashsegmenter
#
# The MIT License (MIT)
#
# Copyright (c) 2014 Tadeusz Magura-Witkowski
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files... | Teeed/dashsegmenter | dashsegmenter/internal_settings.py | Python | mit | 2,052 |
from flask import make_response, jsonify
class ValueComposite(object):
message = None
def initialize(self, initial_message):
self.message = initial_message
def serialize_with(self, **entry):
self.message.update(entry)
def to_dict(self):
return dict(self.message)
def jso... | andreffs18/flask-template-project | project/utils/value_composite.py | Python | mit | 397 |
from django.conf.urls import url, include
from django.contrib import admin
from fredsneverland import views
from blog.feed import RSSFeed
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^$', views.home, name='home'),
url(r'^blogs/', include('blog.urls')),
url(r'^timelines/', include('timeline... | fredwulei/fredsneverland | fredsneverland/fredsneverland/urls.py | Python | mit | 604 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import json
from contrail_api_cli.command import Command, Option
from contrail_api_cli.exceptions import ResourceNotFound
from contrail_api_cli.resource import Resource
from ..utils import RouteTargetAction
class RouteTarget(Command):
virtual_netwo... | cloudwatt/contrail-api-cli-extra | contrail_api_cli_extra/provision/route_target.py | Python | mit | 3,737 |
import math
import pyck
L = [10.0, 10.0, 0.0]
r = 0.1
# Create a packer, see packers directory for options
cubic = pyck.Hcp2dPacker(L, r)
# Get the periodic extent of the pack
periodicExtent = cubic.GetPeriodicExtent()
# Create a structured pack
pack = pyck.StructuredPack(cubic)
# Create a cube whic... | brucedjones/pyck | examples/periodic.py | Python | mit | 1,112 |
import optproblems.cec2005
import numpy as np
import time
from POA import *
import os
if __name__ == "__main__":
dim = 30
repeats = 10
evaluations = 10000*dim
parties = 6
members = 5
candidates = 2
if not os.path.exists('results'):
os.makedirs('results')
if not os.path.exists(... | JJSrra/Research-SocioinspiredAlgorithms | POA/POAbenchmark30-5.py | Python | mit | 5,679 |
from flask import Flask, render_template, flash
from forms_test import CharCounter_form
from flask.ext.bootstrap import Bootstrap
from os import urandom
app = Flask(__name__)
app.secret_key = urandom(240)
bootstrap = Bootstrap(app)
@app.route('/', methods=['GET', 'POST'])
def index():
form = CharCounter_fo... | rafasysadm/IBM_Containers_flask | appdir/app.py | Python | mit | 697 |
import pygame
import sys
from pygame.locals import *
import random
from Globals import *
from GameArtist import *
from Tile import *
"""
the most important class of the project
it controls the whole game mechanics
"""
class GameManager:
"""
class constructor where game elements are declared
"""
def __init__(self):... | MorcoFreeCode/2014__2048-Game | full_project/source code/GameManager.py | Python | mit | 11,518 |
import os
import logging
import logging.config
import re
import datetime
import argparse
from bool_query import bool_query
from svn_cmds import svn_lock, svn_unlock, svn_commit, svn_update, file_rev_check
class Mod_Build_Defines(object):
"""Creates an object that modifies the build defines file"""
def __init... | marmstr93ng/AutoXilinxBuild | mod_build_defines.py | Python | mit | 8,428 |
'''Create a pairwise score between a single image and a series of images in a directory'''
import matplotlib
matplotlib.use('agg')
import numpy as np
import cv2
import argparse
import os
import sys
parser = argparse.ArgumentParser(description="Calculate a distance matrix between a single image and a folder of other i... | linsalrob/depth-profile-video-processing | pairwiseScoreDir.py | Python | mit | 1,773 |
"""
WoW-style MPQ-based environments
"""
import os
import re
import mpq
class BuildNotFound(Exception):
pass
class LocaleNotFound(Exception):
pass
class Base(object):
"""
A Base is a helper class that points to a base directory for an environment.
In its raw state (without a build), the base only has a raw pat... | jleclanche/pywow | environment/__init__.py | Python | cc0-1.0 | 12,001 |
import numpy as np
import matplotlib.pyplot as plt
import sys
def readData(filename):
infile = open("%s" %filename, 'r')
energies = []
for line in infile:
energies.append(float(line))
infile.close()
return np.asarray(energies)
def blocking(energies, nBlocks, blockSize):
... | CompPhysics/ThesisProjects | doc/MSc/msc_students/former/ChristianF/ThesisCodes/vmc-solver/AnalyseData/blocking.py | Python | cc0-1.0 | 1,908 |
"""
Module Docstring
We show how to use functions in python
"""
#
## Implement increment function inc(x)
#
def inc(x):
return x+1
#
## Implement function double(x) which returns 2*x
#
def double(x):
return 2*x
def main():
"""Testing functions"""
x = 1;
print( inc(x)*double(x))
if __name__=='_... | FSTATEU/tutorial | skeleton.py | Python | cc0-1.0 | 341 |
import os
path = os.path.dirname(os.path.realpath(__file__))
sbmlFilePath = os.path.join(path, 'MODEL1006230055.xml')
with open(sbmlFilePath,'r') as f:
sbmlString = f.read()
def module_exists(module_name):
try:
__import__(module_name)
except ImportError:
return False
else:
ret... | biomodels/MODEL1006230055 | MODEL1006230055/model.py | Python | cc0-1.0 | 427 |
import unittest
#from datetime import datetime
import conversion_tools
import emu_parser
import lpath_parser
class TestTiming(unittest.TestCase):
def setUp(self):
#self.start = datetime.now()
pass
def tearDown(self):
#self.end = datetime.now()
#self.runtime = sel... | incognybble/toSPARQL | tests_timing.py | Python | gpl-2.0 | 8,702 |
###############################################################################
# #
# Copyright 2019. Triad National Security, LLC. All rights reserved. #
# This program was produced under U.S. Government contract 89233218CNA000001 #
... | CSD-Public/stonix | src/stonix_resources/rules/SetDefaultUserUmask.py | Python | gpl-2.0 | 22,261 |
# Copyright (C) 2006-2011 Canonical Ltd
#
# 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 program is distribute... | stewartsmith/bzr | bzrlib/transport/http/response.py | Python | gpl-2.0 | 14,636 |
# devicetree.py
# Device management for anaconda's storage configuration module.
#
# Copyright (C) 2009-2015 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at you... | atodorov/blivet | blivet/devicetree.py | Python | gpl-2.0 | 35,892 |
releases = {
'0': 'Aftermath',
'1': 'Bewitched',
'2': 'Carefree',
'3': 'Deadbeef',
'4': 'Extravagant',
'5': 'Fumbler',
'6': 'Gonzalez',
'7': 'Hero',
'8': 'Interceptor',
'9': 'Jumper',
} | dopstar/ftransc-gui | ftransc_gui/constants.py | Python | gpl-2.0 | 225 |
# alignlib - a library for aligning protein sequences
#
# $Id: test_Alignment.py,v 1.3 2004/01/23 17:34:58 aheger Exp $
#
# Copyright (C) 2004 Andreas Heger
#
# 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 Softw... | AndreasHeger/alignlib | python/tests/test_MultAlignment.py | Python | gpl-2.0 | 9,238 |
from boxbranding import getImageVersion, getImageBuild, getImageDevBuild, getImageType, getImageDistro, getMachineBrand, getMachineName, getMachineBuild
from os import path
from gettext import dgettext
from enigma import eTimer, eDVBDB
import Components.Task
from Components.OnlineUpdateCheck import feedsstatuscheck, ... | oostende/openblachole | lib/python/Screens/SoftwareUpdate.py | Python | gpl-2.0 | 21,786 |
from psoNSpike import PSONSpike
from pso import QtApp
from PyQt4 import QtGui
from dnfpyUtils.models.modelBsRsdnf import ModelBsRsdnf
import numpy as np
class PSOCASAS(PSONSpike):
def getBounds(self):
"""return (lowerBounds,upperBounds"""
z = 10e-6
lowerBounds = np.array([z,z,z,z])
u... | bchappet/dnfpy | src/dnfpyUtils/optimisation/psoCASAS.py | Python | gpl-2.0 | 1,118 |
from . import Entity,DictEntity
from keys import names
from fields import *
from etcfiles.personality import Personality
from entities.cues import EffectStep
names.addseq("<setup>15<enter>2<enter>","fixturepatch","movinglightpatch")
names.addseq("<softkey8>","fixture","movinglight")
class Fixture():
def __i... | baryon5/pylights | pylights/entities/movinglights.py | Python | gpl-2.0 | 1,393 |
# This file is part of the sos project: https://github.com/sosreport/sos
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# version 2 of the GNU General Public License.
#
# See the LICENSE file in the source distribution ... | nijinashok/sos | sos/plugins/ntp.py | Python | gpl-2.0 | 1,442 |
#!/usr/bin/env python
#
# update_tests.py: testing update cases.
#
# Subversion is a tool for revision control.
# See http://subversion.tigris.org for more information.
#
# ====================================================================
# Copyright (c) 2000-2009 CollabNet. All rights reserved.
#
# This softwa... | bdmod/extreme-subversion | BinarySourcce/subversion-1.6.17/subversion/tests/cmdline/update_tests.py | Python | gpl-2.0 | 198,893 |
# -*- coding: utf-8 -*-
"""
Created on Tue Jun 23 06:36:02 2015
@author: chaojun
"""
import copy
import numpy as np
from agpy.mpfit import mpfit
from pyminer_setting import *
clear_env()
# Parameter setting
# ==========================
# JLA nuiance parameters
# ==========================
# p[0]:al... | shfengcj/pyminer | pyminer_fit_cos.py | Python | gpl-2.0 | 1,119 |
import cPickle
import logging
from django import forms
from django.forms import widgets
from sponge.utils import repo as repo_utils
from sponge.models import PackageSetPackage
from sponge.forms import LabelWidget
from pulp.client.api.repository import RepositoryAPI
logger = logging.getLogger(__name__)
class PackageS... | stpierre/sponge | Sponge/sponge/forms/package.py | Python | gpl-2.0 | 2,457 |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# Copyright (C) 2014 Red Hat, Inc.
# Authors: Marek Staňa, Jaroslav Škarvada <jskarvad@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; e... | olysonek/tuned | tuned-gui.py | Python | gpl-2.0 | 29,190 |
def main():
import sys
#Separate the nose params and the pydev params.
pydev_params = []
other_test_framework_params = []
found_other_test_framework_param = None
NOSE_PARAMS = '--nose-params'
PY_TEST_PARAMS = '--py-test-params'
for arg in sys.argv[1:]:
if not found_other_test... | AMOboxTV/AMOBox.LegoBuild | script.module.pydevd/lib/runfiles.py | Python | gpl-2.0 | 9,045 |
from __future__ import absolute_import, unicode_literals
import os
from celery import Celery
# set the default Django settings module for the 'celery' program.
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'demo.settings')
from django.conf import settings # noqa
app = Celery('demo')
# Using a string here means the... | luisza/async_notifications | demo/celery.py | Python | gpl-2.0 | 1,040 |
# -*- coding: utf-8 -*-
import fauxfactory
from cfme.automate.service_dialogs import ServiceDialog
from cfme.exceptions import OptionNotAvailable
from cfme.infrastructure.provider import InfraProvider
from cfme.services.catalogs.catalog_item import CatalogItem
from cfme.services.catalogs.catalog import Catalog
from cf... | jteehan/cfme_tests | cfme/rest/gen_data.py | Python | gpl-2.0 | 19,486 |
# #
# Copyright 2014-2020 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be),
# Flemish Research Foundation (... | pescobar/easybuild-framework | easybuild/tools/convert.py | Python | gpl-2.0 | 2,856 |
# -*- coding: UTF-8 -*-
#######################################################################
# ----------------------------------------------------------------------------
# "THE BEER-WARE LICENSE" (Revision 42):
# @Daddy_Blamo wrote this file. As long as you retain this notice you
# can do whatever you want wi... | RuiNascimento/krepo | script.module.lambdascrapers/lib/lambdascrapers/sources_ lambdascrapers/pl/boxfilm.py | Python | gpl-2.0 | 3,436 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('knowledge', '0003_atom_text'),
]
operations = [
migrations.AddField(
model_name='atom',
name='slug',... | MarcdeFalco/dagger | knowledge/migrations/0004_atom_slug.py | Python | gpl-2.0 | 450 |
# Adapted from https://github.com/jbweston/miniver
#
# LICENSE: CC0 1.0 Universal license.
# http://creativecommons.org/publicdomain/zero/1.0/
#
# This file is in the public domain.
# -------------------
# Theory of operation
# -------------------
#
# When in the context of a stgit git repository or a stgit git archiv... | emacsmirror/stgit | stgit/_version.py | Python | gpl-2.0 | 6,865 |
from pdcglobal import *
def leg(tot):
tot += 4
return tot / 5
def head(tot):
tot += 4
return tot / 5
def arm(tot):
tot += 4
v = tot / 5 - 1
return max(v, 1)
def chest(tot):
tot += 4
return tot / 5 + 2
def abdomen(tot):
tot += 4
return tot / 5 + 1
class HitZones(object):
... | cycladesnz/chambersAndCreatures | src/actor/hit_zones.py | Python | gpl-2.0 | 1,750 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# bancos.py
#
# Copyright 2010 Jesús Hómez <jesus@jesus-laptop>
#
# 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... | jehomez/pymeadmin | libro_ventas.py | Python | gpl-2.0 | 3,098 |
__author__ = "Martin Blais <blais@furius.ca>"
import unittest
from beancount.web import bottle_utils
class TestAttrMapper(unittest.TestCase):
def setUp(self):
dictionary = {'a': 'the_a',
'b': 'the_b',
'c': 'the_c'}
self.mapper = bottle_utils.AttrMappe... | iocoop/beancount | src/python/beancount/web/bottle_utils_test.py | Python | gpl-2.0 | 715 |
#!/usr/bin/python
#-*-coding:utf-8-*-
import urlparse
from scrapy.http import Request
from scrapy.http import HtmlResponse
from scrapy.utils.response import get_meta_refresh
from scrapy import signals
import csv
class errorHandler(object):
spider_errors = []
@classmethod
def from_crawler(cls, crawl... | Xuaps/refly_scraper | refly_scraper/errorcatcher.py | Python | gpl-2.0 | 834 |
from modeller import *
import os
import mdt
import mdt.features
env = Environ()
mlib = mdt.Library(env)
xray = mdt.features.XRayResolution(mlib, bins=[(0.51, 2.001, 'High res(2.0A)')])
restyp = mdt.features.ResidueType(mlib)
psi = mdt.features.PsiDihedral(mlib, bins=mdt.uniform_bins(72, -180, 5.0))
m = mdt.Table(mlib... | salilab/mdt | constr2005/psi/modlib.py | Python | gpl-2.0 | 1,899 |
usage=""" a module containing useful methods for nmode_l.py, meant to compare two sets of integration data """
import numpy as np
from pygsl import fft
import nmode_state as nms
####################################################################################################
#
# generate residuals
#
############... | reedessick/nmodelte | lib/liapunov.py | Python | gpl-2.0 | 8,183 |
from serial import Serial
ser = Serial('/dev/ttyAMA0', 9600, timeout=0)
print("connected to: " + ser.portstr)
while True:
# Read a line and convert it from b'xxx\r\n' to xxx
letter = ser.read().decode('utf-8')
if letter: # If it isn't a blank line
print(letter)
ser.close()
| IvayloTsankov/carty | tests/test_serial.py | Python | gpl-2.0 | 299 |
from django.contrib import admin
from edc_lab.lab_packing.admin import BasePackingListAdmin, BasePackingListItemAdmin
from ..forms import PackingListForm, PackingListItemForm
from ..models import PackingList, PackingListItem
class PackingListAdmin(BasePackingListAdmin):
form = PackingListForm
admin.site.regis... | botswana-harvard/tshilo-dikotla | td_lab/admin/packing_list_admin.py | Python | gpl-2.0 | 915 |
import attr
from widgetastic.widget import View
from widgetastic_patternfly import Button, Input
from wrapanapi.systems import GoogleCloudSystem
from cfme.base.credential import ServiceAccountCredential
from cfme.cloud.instance.gce import GCEInstance
from cfme.common.provider import DefaultEndpoint
from cfme.services... | anurag03/integration_tests | cfme/cloud/provider/gce.py | Python | gpl-2.0 | 2,769 |
# This file is part of the sos project: https://github.com/sosreport/sos
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# version 2 of the GNU General Public License.
#
# See the LICENSE file in the source distribution ... | nijinashok/sos | sos/plugins/iprconfig.py | Python | gpl-2.0 | 4,672 |
#!/usr/bin/env python
#coding:utf-8
"""
Power digit sum
2^15 = 32768 and the sum of its digits is 3+2+7+6+8=26.
What is the sum of the digits of the number 2^1000?
"""
def answer():
print sum([int(i) for i in list(str(2**1000))])
import time
tStart=time.time()
answer()
print 'run time=',time.time()-tStart
# 1... | Urinx/Project_Euler_Answers | 016.py | Python | gpl-2.0 | 323 |
#!/usr/bin/python
""" A script to do multi-process Blender VSE rendering
"""
import argparse
import os
import multiprocessing
import subprocess
import math
import glob
import logging
logging.basicConfig(level=logging.DEBUG)
log = logging.getLogger("pulverize")
import pdb
# We can get the number of CPUs in the syst... | sciactive/pulverize | pulverize.py | Python | gpl-2.0 | 5,124 |
class reduce_function:
def __init__(self):
self.numbers = list()
def __call__(self, key, value):
self.numbers.append(key) # update list
self.numbers.sort()# do sort
return self.numbers
| QubitPi/HadooPyTester | examples/sort/reduce_function.py | Python | gpl-2.0 | 195 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('lists', '0004_auto_20140709_1115'),
]
operations = [
migrations.AlterField(
model_name='item',
name=... | tdhris/DjangoTDDTutorial | superlist/lists/migrations/0005_auto_20140709_1128.py | Python | gpl-2.0 | 413 |
"""
online image processing
"""
from lib import base_app, build, http, image, config, thumbnail
from lib.misc import ctime, prod
from lib.base_app import init_app
import cherrypy
from cherrypy import TimeoutError
import os.path
import shutil
import subprocess
import glob
class app(base_app):
""" template demo app... | juan-cardelino/matlab_demos | ipol_demo-light-1025b85/app_available/26/app.py | Python | gpl-2.0 | 17,605 |
# -*- coding: utf-8 -*-
import os
import re
import urllib
import urlparse
import requests
import cookielib
import socket
from HTMLParser import HTMLParser
from fileUtils import fileExists, setFileContent, getFileContent
#------------------------------------------------------------------------------
socket.setdefaultt... | Raymondfs/plugin.video.SportsTV | lib/utils/webUtils.py | Python | gpl-2.0 | 5,905 |
# 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/needle_region/__init__.py | Python | gpl-2.0 | 1,450 |
""" Queries related to source packages
@contact: Debian FTPMaster <ftpmaster@debian.org>
@copyright: 2014 Mark Hymers <mhy@debian.org>
@copyright: 2014 Joerg Jaspert <joerg@debian.org>
@license: GNU General Public License version 2 or later
"""
from sqlalchemy import or_
import bottle
import json
from daklib.dbcon... | purism/pdak | dakweb/queries/source.py | Python | gpl-2.0 | 4,636 |
# Copyright (C) 2006 - Steve Frécinaux
# 2016-17 - Nick Boultbee
# 2021 - halfbrained@github
#
# 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 Li... | quodlibet/quodlibet | quodlibet/ext/songsmenu/console.py | Python | gpl-2.0 | 23,415 |
#! /usr/bin/env python
# setup.py
"""Distutils installation script for tovid.
To install, run:
sudo ./setup.py install
or:
su -c './setup.py install'
At this time, there is no 'uninstall' mechanism...
"""
def git_version():
"""Return the current release number, followed by the current commit sha1,
... | tovid-suite/tovid | setup.py | Python | gpl-2.0 | 9,846 |
#!/usr/bin/env python
import sys
import os
import re
import glob
import xmltodict
import json
import yaml
import copy
import logging
from argparse import ArgumentParser
from argparse import RawDescriptionHelpFormatter
from elasticsearch1 import Elasticsearch
from collections import OrderedDict
import datetime
import ... | ICGC-TCGA-PanCancer/pcawg-central-index | pcawg_metadata_parser/generate_s3_transfer_json.py | Python | gpl-2.0 | 32,864 |
# testStaticFileSet.py -- Portage Unit Testing Functionality
# Copyright 2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
import tempfile
from portage import os
from portage.tests import TestCase, test_cps
from portage.sets.files import StaticFileSet
class StaticFileSetTestCa... | fastinetserver/portage-idfetch | pym/portage/tests/sets/files/testStaticFileSet.py | Python | gpl-2.0 | 746 |
#!/usr/bin/python
import sys
import os
import time
import logging
logging.basicConfig(level=logging.DEBUG)
from WebStorageClient import BlockStorageClient as BlockStorageClient
from WebStorageClient import FileStorageClient as FileStorageClient
from WebStorageClient import FileIndexClient as FileIndexClient
if __name... | gunny26/webstorage | devel/wsdevel.py | Python | gpl-2.0 | 809 |
#!/usr/bin/env python3
# AnalyzeLibs.py
import progSpec
import os
import subprocess
import buildAndroid
import errno
import shutil
from progSpec import cdlog, cdErr
libPaths = []
##################################################
def runCMD(myCMD):
currentDirectory = currentWD = os.getcwd()
pipe = subproc... | BruceDLong/CodeDog | getAllLibsInfo.py | Python | gpl-2.0 | 1,087 |
# coding:utf-8
import re
import cookielib
import urllib
import urllib2
import optparse
from bs4 import BeautifulSoup as bs
import sys
import MySQLdb
cj = cookielib.CookieJar();
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
urllib2.install_opener(opener)
'''
获得搜索词的url编码
搜索方式为专利之星的默认搜索方式
'''
def keywo... | SPRINGJICHUN/patentDown | patent2Db.py | Python | gpl-2.0 | 6,040 |
# -*- coding: utf-8 -*-
"""
plugins/example.py - Example dummy plugin.
Copyright (C) 2009-2010 Petr Morávek
This file is part of Pyggs.
Pyggs 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 Foundatio... | xificurk/pyggs | plugins/example.py | Python | gpl-2.0 | 3,094 |
class LEDPointList:
def __init__(self, matrix):
self.matrix = matrix
self.matrix.obj_list += [self]
self.p_list = []
def draw(self):
for point in self.p_list:
point.draw()
def setRGBAll(self, r, g, b):
for point in self.p_list:
point.rgb = (r,g,b)
def setRGBAt(self, index, r, g, b):
self.p_lis... | jboullianne/LEDMatrix | LEDMatrix/LEDPointList.py | Python | gpl-2.0 | 664 |
__copyright__ = """
Copyright (C) 2007, Yann Dirson <ydirson@altern.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2 as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
bu... | miracle2k/stgit | stgit/commands/sink.py | Python | gpl-2.0 | 3,755 |
# -*- coding: utf-8 -*-
# MySQL Connector/Python - MySQL driver written in Python.
# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
# MySQL Connector/Python is licensed under the terms of the GPLv2
# <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most
# MySQL Connectors. Th... | adyliu/mysql-connector-python | python3/tests/test_conversion.py | Python | gpl-2.0 | 16,799 |
from django.db import models
from django.contrib.auth.models import User
class Attribute(models.Model):
name = models.CharField(max_length=20)
short_name = models.CharField(max_length=3)
description = models.CharField(max_length=120)
def __str__(self):
return self.name
class Ability(models.M... | roland04/d8universe | universes/models.py | Python | gpl-2.0 | 2,220 |
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2007 Donald N. Allingham
# Copyright (C) 2008 Gary Burton
# Copyright (C) 2009-2010 Nick Hall
# Copyright (C) 2010 Benny Malengier
# Copyright (C) 2011 Tim G L Lyons
#
# This program is free software; you can redistribute it and/... | prculley/gramps | gramps/plugins/lib/libpersonview.py | Python | gpl-2.0 | 16,845 |
from flask import Flask, request, redirect, url_for
import flask
from flask.ext.paginate import Pagination
import pandas as pd
import numpy as np
from collections import defaultdict
import pymongo
import re
DF = None
DF_SUBSET = None
PAGES = None
app = Flask(__name__)
app.config.from_object(__name__)
def get_positi... | jscottcronin/PinkSlipper | webapp/app.py | Python | gpl-2.0 | 4,047 |
from simphony.visualisation import aviz
from simphony.cuds.particles import Particles, Particle
from simphony.core.cuba import CUBA
positions = [(1.0, 1.0, 1.0),
(2.0, 2.0, 2.0),
(1.5, 1.8, 1.9),
(2.0, 1.0, 1.5)]
velocities = [(1.0, 1.0, 1.0),
(2.0, 2.0, 2.0),
... | simphony/simphony-aviz | examples/show_snapshot.py | Python | gpl-2.0 | 776 |
#!/usr/bin/python -t
# primary functions and glue for generating the repository metadata
#
# 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)... | saschpe/creatrepo | genpkgmetadata.py | Python | gpl-2.0 | 11,786 |