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 |
|---|---|---|---|---|---|
__script__.title = 'HMM Tube Export'
__script__.version = '1.0'
from gumpy.nexus.fitting import Fitting, GAUSSIAN_FITTING
from math import exp, fabs
__FOLDER_PATH__ = 'V:/shared/KKB Logbook/Temp Plot Data Repository'
if not os.path.exists(__FOLDER_PATH__):
os.makedirs(__FOLDER_PATH__)
combine_t... | Gumtree/Kookaburra_scripts | Internal/PlotKKB-Tube.py | Python | epl-1.0 | 14,158 |
#!/bin/env python
try:
# For Python 3.0 and later
from urllib.request import urlopen, Request, HTTPError
except ImportError:
# Fallback to Python 2
from urllib2 import urlopen, Request, HTTPError
import sys
import os
if len(sys.argv) < 4:
print ("Usage:")
print ("\t %s input_rawData transf... | dapaas/grafterizer-backend | jarfter/scripts/testPrograms/uploadDataAndTransform.py | Python | epl-1.0 | 1,482 |
""" ----------------------------------------------------------------
# Force-Directed Edge Bundling
#
# Performance-optimised script version
# ------------------------------------------------------------------
"""
##Edge bundling=group
##input_layer=vector
##cluster_field=field input_layer
##use_clustering_result=boo... | dts-ait/qgis-edge-bundling | bundle_edges.py | Python | gpl-2.0 | 14,732 |
from txtobjs.schema.TextObjectSchema import TextObjectSchema
from txtobjs.schema.SimpleTextField import SimpleTextField
from txtobjs.schema.SubObjectDict import SubObjectDict
from txtobjs.schema.ValueListField import ValueListField
class ServiceSchema(TextObjectSchema):
text_class = 'Service'
name... | shearern/python-text-objects | src/txtobjs_test/servers_use_case/ServiceSchema.py | Python | gpl-2.0 | 519 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# || ____ _ __
# +------+ / __ )(_) /_______________ _____ ___
# | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \
# +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/
# || || /_____/_/\__/\___/_/ \__,_/ /___/\___/
#
# Copyright (C) 20... | phantomnat/my-cf-client-python | lib/cfclient/ui/tabs/AITab.py | Python | gpl-2.0 | 12,600 |
# Copyright (C) 2014 Dustin Spicuzza
#
# 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, or (at your option)
# any later version.
#
# This program is distributed in the hope that... | eri-trabiccolo/exaile | plugins/playlistanalyzer/__init__.py | Python | gpl-2.0 | 6,185 |
#!/usr/bin/env python
#coding: utf8
"""
Restore the saved list of documents that were being read
"""
from __future__ import print_function, absolute_import, division
import sys, os
import logging
import subprocess
DefaultExecutable = 'smallpotato'
DefaultBook = 'book.opn'
DefaultMaxPly = 20
class EngineConnector(ob... | alito/smallpotato | tools/makebookfrompgn.py | Python | gpl-2.0 | 3,770 |
import logging
from ..openscap import OSCAPScanner
log = logging.getLogger(__package__)
def init(app):
app.hooks.connect("pre-arg-parse", add_argparse)
app.hooks.connect("post-arg-parse", post_argparse)
def add_argparse(app, parser, subparsers):
s = subparsers.add_parser("openscap", help="Security man... | oVirt/imgbased | src/imgbased/plugins/openscap.py | Python | gpl-2.0 | 1,850 |
from long_format import LongFormatReader | Damangir/Registry-Management | src/stream_reader/__init__.py | Python | gpl-2.0 | 40 |
#!/usr/bin/python
import os, sys
import math, gmpy
if len (sys.argv) not in [2, 3, 4]:
print 'Usage: merge_logs <logs_dir> [<route_quality(True/False)>] [<bandwidth_color(True/False)>]'
sys.exit (0)
dir = sys.argv[1]
if len (sys.argv) >= 3:
route_quality = sys.argv[2]
else :
route_quality = 'False'
if len (... | AliZafar120/NetworkStimulatorSPl3 | rapidnet/plot/merge_logs.py | Python | gpl-2.0 | 12,893 |
from lab import *
from pylab import *
from uncertainties import *
from uncertainties import unumpy
from statistics import *
from scipy.constants import *
import getpass
users={"candi": "C:\\Users\\candi\\Documents\\GitHub\\Lab3.2\\",
"silvanamorreale":"C:\\Users\\silvanamorreale\\Documents\\GitHub\\Lab3.2\\" ,
"Studen... | AleCandido/Lab3.2 | 4_Ottica1/cadmio.py | Python | gpl-2.0 | 2,784 |
#!/usr/bin/python
import time
import RPi.GPIO as GPIO
# remember to change the GPIO values below to match your sensors
# GPIO output = the pin that's connected to "Trig" on the sensor
# GPIO input = the pin that's connected to "Echo" on the sensor
def reading(sensor):
# Disable any warning message such as GPIO pins... | LinuCC/sturo | src/lib/usonic.py | Python | gpl-2.0 | 3,134 |
class Solution:
def maxArea(self, height):
"""
:type height: List[int]
:rtype: int
"""
l, r = 0, len(height) - 1
s = 0
while l < r:
s = max(s, self.get_s(l, r, height))
if height[l] < height[r]:
l += 1
else:
... | lmmsoft/LeetCode | LeetCode-Algorithm/0011. Container With Most Water/Solution.py | Python | gpl-2.0 | 611 |
# -*- encoding: utf8 -*-
#
# The Qubes OS Project, http://www.qubes-os.org
#
# Copyright (C) 2017 Marek Marczykowski-Górecki
# <marmarek@invisiblethingslab.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License a... | kalkin/qubes-core-admin | qubes/api/internal.py | Python | gpl-2.0 | 5,136 |
from struct import pack
from google.protobuf.message import DecodeError
from twisted.internet.protocol import Protocol
from twisted.python import log
from relayserver.utility import get_hex_dump
class BaseProtocol(Protocol):
def write_message(self, message):
data = message.SerializeToString()
mess... | dsoprea/RelayServer | relayserver/base_protocol.py | Python | gpl-2.0 | 1,199 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2009 UNINETT AS
#
# This file is part of Network Administration Visualized (NAV).
#
# NAV 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... | sigmunau/nav | python/nav/mibs/etherlike_mib.py | Python | gpl-2.0 | 1,422 |
"""
Module for the Colorado Alliance of Research Libraries Metadata 2013
Presentation
Copyright (C) 2013 Jeremy Nelson
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... | jermnelson/metadata-day-2013 | web.py | Python | gpl-2.0 | 3,972 |
from lumberjack.client.file_descriptor import FileDescriptorEndpoint
from lumberjack.client.message_receiver import MessageReceiverFactory
from lumberjack.client.message_forwarder import RetryingMessageForwarder
from lumberjack.client.protocol import LumberjackProtocolFactory
from lumberjack.util.object_pipe import Obj... | tuck182/syslog-ng-mod-lumberjack-py | src/lumberjack/client/process.py | Python | gpl-2.0 | 3,727 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2013 Zuza Software Foundation
#
# This file is part of Pootle.
#
# Pootle 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 Lic... | ttreeagency/PootleTypo3Org | pootle/apps/staticpages/managers.py | Python | gpl-2.0 | 1,705 |
# -*- coding: utf-8 -*-
import hashlib
import json
import locale
import re
import trac.wiki.formatter
from trac.mimeview.api import Context
from time import strftime, localtime
from code_comments import db
from trac.util import Markup
from trac.web.href import Href
from trac.test import Mock, MockPerm
def md5_hexdi... | Automattic/trac-code-comments-plugin | code_comments/comment.py | Python | gpl-2.0 | 6,221 |
from __future__ import unicode_literals
import datetime
from django.db.models import Q
from django.test import TestCase
from haystack import connections
from haystack.inputs import AutoQuery
from haystack.query import SearchQuerySet
from ..models import Document
from ..search_indexes import DocumentIndex
from ..tes... | jorgecarleitao/xapian-haystack | tests/xapian_tests/tests/test_interface.py | Python | gpl-2.0 | 8,542 |
# setup.py
from distutils.core import setup
import py2exe
includes = [
"encodings",
"encodings.*",
"lxml._elementpath"
]
options = {
"py2exe": {
"compressed": 1,
"optimize": 2,
"includes": includes,
}
}
target = { "script" : "trelby.py",
"icon_resources": [(1, "... | anilgulecha/trelby | setup.py | Python | gpl-2.0 | 415 |
#!/usr/bin/env python
#coding:utf-8
# Author: --<qingfengkuyu>
# Purpose: MongoDB的使用
# Created: 2014/4/14
#32位的版本最多只能存储2.5GB的数据(NoSQLFan:最大文件尺寸为2G,生产环境推荐64位)
import pymongo
import datetime
import random
#创建连接
conn = pymongo.MongoClient('localhost',27017)
#连接数据库
db = conn.study
#db = conn['study']
#打印所有聚集名称,连接聚集... | valley3405/testMongo01 | test02.py | Python | gpl-2.0 | 2,298 |
from django.template import RequestContext
from django.shortcuts import render
#Source: http://lincolnloop.com/blog/2008/may/10/getting-requestcontext-your-templates/
def render_to(template_name, title = ""):
def renderer(func):
def wrapper(request, *args, **kw):
output = func(request, *args, ... | Bartzi/LabShare | labshare/decorators.py | Python | gpl-2.0 | 486 |
# pylint: disable=missing-docstring,unused-variable
import asyncio
async def nested():
return 42
async def main():
nested()
print(await nested()) # This is okay
def not_async():
print(await nested()) # [await-outside-async]
async def func(i):
return i**2
async def okay_function():
var = ... | PyCQA/pylint | tests/functional/a/await_outside_async.py | Python | gpl-2.0 | 579 |
# -*- coding: utf-8 -*-
#############################################################
# This file was automatically generated on 2022-01-18. #
# #
# Python Bindings Version 2.1.29 #
# ... | Tinkerforge/brickv | src/brickv/bindings/bricklet_voltage.py | Python | gpl-2.0 | 12,075 |
#!/usr/bin/env python
import time
import smbus
BUS = smbus.SMBus(1)
def write_word(addr, data):
global BLEN
temp = data
if BLEN == 1:
temp |= 0x08
else:
temp &= 0xF7
BUS.write_byte(addr ,temp)
def send_command(comm):
# Send bit7-4 firstly
buf = comm & 0xF0
buf |= 0x04 # RS = 0, RW = 0, EN ... | sunfounder/SunFounder_Dragit | Dragit/Dragit/libs/modules/i2c_lcd.py | Python | gpl-2.0 | 2,054 |
movies = ["The Holy Grail", 1975, "Terry Jones & Terry Gilliam", 91,
["Graham Chapman", ["Michael Palin", "John Cleese",
"Terry Gilliam", "Eric Idle", "Terry Jones"]]]
def print_lol(a_list):
for each_item in a_list:
if isinstance(each_item, list):
prin... | simontakite/sysadmin | pythonscripts/headfirst/hfpy_code/01-MeetPython-Everyone-Loves-Lists/page30.py | Python | gpl-2.0 | 399 |
# -*- coding: utf-8 -*-
"""
TeleMir developpement version with fake acquisition device
lancer dans un terminal :
python examples/test_osc_receive.py
"""
from pyacq import StreamHandler, FakeMultiSignals
from pyacq.gui import Oscilloscope, Oscilloscope_f, TimeFreq, TimeFreq2
from TeleMir.gui import Topoplot, Kurtosis... | Hemisphere-Project/Telemir-DatabitMe | Telemir-EEG/TeleMir_171013/Fake_TeleMir_CB.py | Python | gpl-2.0 | 6,881 |
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os
#root of project: ...../src
BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.8/howto/deplo... | kinglyduck/hackerspace | src/hackerspace_online/settings/production.py | Python | gpl-2.0 | 1,941 |
# PMR WebServices
# Copyright (C) 2016 Manhoi Hur, Belyaeva, Irina
# This file is part of PMR WebServices API.
#
# PMR API 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
... | Arabidopsis-Information-Portal/PMR_API | services/experiments_api/experiments_service.py | Python | gpl-2.0 | 4,048 |
#!/usr/bin/python
import sys
import os
import pprint
import copy
class BINDRipper:
def __init__(self):
self.cfgTokens = []
self.cfgStr = ""
self.curToken = 0
self.saveToken = 0
self.config = {}
return None
def consume(self):
_item = self.cfgTokens[self.curToken]
self.curToken+=1
... | jwbernin/dns-sanity-checker | bindripper.py | Python | gpl-2.0 | 8,378 |
#
# -*- coding: utf-8 -*-
#
# Copyright 2011 Voldemar Khramtsov <harestomper@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 o... | itmages/itmages-service | itmagesd/common.py | Python | gpl-2.0 | 2,588 |
"""distutils.util
Miscellaneous utility functions -- anything that doesn't fit into
one of the other *util.py modules.
"""
__revision__ = "$Id$"
import sys, os, string, re
from distutils.errors import DistutilsPlatformError
from distutils.dep_util import newer
from distutils.spawn import spawn
from distu... | 2uller/LotF | App/Lib/distutils/util.py | Python | gpl-2.0 | 19,215 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
from django.shortcuts import render, HttpResponseRedirect
from django.core.urlresolvers import reverse
from django.contrib.auth.decorators import login_required
from appconf.models import AuthInfo
from appconf.forms import AuthInfoForm
from accounts.permission import perm... | guohongze/adminset | appconf/authinfo.py | Python | gpl-2.0 | 2,899 |
class Immutable:
"""Base class for immutable objects.
Immutable objects cannot be modified once created. Any modification methods will
return a new object, leaving the original object as it was.
The reason for this is that we want to be able to represent git objects, which are
immutable, and want ... | emacsmirror/stgit | stgit/lib/git/base.py | Python | gpl-2.0 | 852 |
from flask import Flask, render_template
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext.login import LoginManager
from flask.ext.migrate import Migrate, MigrateCommand
from flask.ext.script import Manager
from flask.ext.bootstrap import Bootstrap
app = Flask(__name__)
app.config.from_object('config')
db =... | SteveMcGrath/Concord | registration/app.py | Python | gpl-2.0 | 1,312 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
import re
import os
from setuptools import find_packages
name = 'firecares-harvester'
package = 'harvester'
description = 'FireCARES Harvester'
url = 'https://github.com/FireCARES/harvester'
author = 'Prominent Edge'
author_email = 'contact@pr... | FireCARES/harvester | setup.py | Python | gpl-2.0 | 2,346 |
from __future__ import with_statement
from __future__ import absolute_import
import socket, select
import struct
import threading
import logging
from collections import deque as Deque
from errno import EINPROGRESS, EWOULDBLOCK
from . import rpc_pack
from .rpc_const import *
from .rpc_type import *
from . import secu... | olsonse/python-vxi11 | rpc/rpc.py | Python | gpl-2.0 | 36,998 |
import weakref
import wx
from AutoFitTextCtrl import AutoFitTextCtrl
from ...data import XmlNode
from ..commands.ModifyXmlAction import ModifyXmlDataAction
from ..commands.ModifyXmlAction import ModifyXmlAttributeAction
class ItemUpdater(object):
def __init__(self, propertiesPane, *args, **kwargs):
self.... | nsmoooose/csp | csp/tools/layout2/scripts/ui/controls/XmlPropertiesPaneItem.py | Python | gpl-2.0 | 11,459 |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding SortedM2M table for field groups on 'Person'
db.create_table(u'... | Venturi/cms | env/lib/python2.7/site-packages/aldryn_people/south_migrations/0021_auto_person_groups.py | Python | gpl-2.0 | 15,722 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "weibome.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| qingtech/weibome | manage.py | Python | gpl-2.0 | 250 |
"""
A collection of data pre-processing algorithms
"""
import numpy as np
from scipy.optimize import minimize
from nilm.evaluation import mean_squared_error
def solve_constant_energy(aggregated, device_activations):
"""
Invert the indicator matrix, solving for the constant energy of each
device. We ret... | CMPUT-466-551-ML-Project/NILM-Project | nilm/preprocess.py | Python | gpl-2.0 | 4,748 |
# -*- coding: utf-8 -*-
# $Id: wuihlpgraph.py $
"""
Test Manager Web-UI - Graph Helpers.
"""
__copyright__ = \
"""
Copyright (C) 2012-2015 Oracle Corporation
This file is part of VirtualBox Open Source Edition (OSE), as
available from http://www.virtualbox.org. This file is free software;
you can redistribute it and... | miguelinux/vbox | src/VBox/ValidationKit/testmanager/webui/wuihlpgraph.py | Python | gpl-2.0 | 4,309 |
from django import forms
from .models import doctor
class ContactForm(forms.Form):
message = forms.CharField()
class SignUpForm(forms.ModelForm):
class Meta:
model = doctor
fields = ['full_name', 'email']
class areaForm(forms.Form):
messag = forms.CharField(required=False)
| quit9to5/Next | patient_management/doctor/forms.py | Python | gpl-2.0 | 308 |
from flask import Flask
app = Flask(__name__)
from app import views
| lolosk/microblog | app/__init__.py | Python | gpl-2.0 | 71 |
# pylint: disable=missing-docstring,redefined-outer-name,no-self-use,protected-access
import copy
import os
from collections import OrderedDict
import pytest
from dump2polarion.exceptions import Dump2PolarionException, NothingToDoException
from dump2polarion.exporters.requirements_exporter import RequirementExport
f... | mkoura/dump2polarion | tests/test_requirement_exporter.py | Python | gpl-2.0 | 2,552 |
#!/usr/bin/env python
import sys
import re
from feed_maker_util import IO
def main():
link = ""
title = ""
for line in IO.read_stdin_as_line_list():
m = re.search(r'<strong><a href="(?P<url>http://sports.khan.co.kr/comics/cartoon_view.html\?comics=b2c&sec_id=\d+)">(?P<title>[^<]+)</a></st... | terzeron/FeedMakerApplications | _sportskhan/_sportskhanwebtoon/capture_item_link_title.py | Python | gpl-2.0 | 572 |
import numpy as np
import matplotlib.pyplot as pl
class BasicHMC(object):
def __init__(self, model=None, verbose=True):
"""A basic HMC sampling object.
:params model:
An object with the following methods:
* lnprob(theta)
* lnprob_grad(theta)
* (opt... | bd-j/hmc | hmc.py | Python | gpl-2.0 | 15,392 |
# -*- coding: utf-8 -*-
import fauxfactory
import pytest
from cfme import test_requirements
from cfme.base.credential import Credential
from cfme.configure.access_control import User
from cfme.login import login, login_admin
from cfme.rest.gen_data import groups as _groups
from cfme.rest.gen_data import roles as _role... | rlbabyuk/integration_tests | cfme/tests/configure/test_rest_access_control.py | Python | gpl-2.0 | 16,442 |
import math
import random
import os
import platform
class vote:
def __init__(self,myManager,callback):
self.peopleVoting = [] #people allowed to vote
self.choices = [] #list of voteOptions available to vote for
self.onFinish = callback #a function taking a list of choices
self.hasSpoofing = False
self.voter... | fdavies93/irc-mafia | bot/irc_bot.py | Python | gpl-2.0 | 8,251 |
"""
#####################################
## create_time_characteristics.py
#####################################
- Open a CSV file of 30min daily load profiles using TKinter file dialog box (for example "load_file.csv")
- Read CSV file and build list of loads
- Loop through list of loads and create time characte... | susantoj/powerfactory_python | examples/create_time_characteristics.py | Python | gpl-2.0 | 2,293 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'aen'
import pygame
import sys
from pygame.locals import USEREVENT, QUIT, MOUSEBUTTONDOWN
def pomodoro():
pygame.mixer.pre_init(frequency=44100, size=-16, channels=1, buffer=512)
pygame.init()
# set up the window
font = pygame.font.Font('fr... | aendinalt/pymodoro | pomodoro.py | Python | gpl-2.0 | 4,117 |
#! /usr/bin/python
from com.goffersoft.utils.utils import readonly
""" This Module Contains header types specific to raw
messaging protocol
"""
class _RawMsgHdrType(type):
"""Raw Message Header Names"""
CONTENT = readonly('Content')
CONTENT_TYPE = readonly('Content-Type')
FROM = readonly('From')... | goffersoft/common-utils-python | experimental/com/goffersoft/raw/rawhdr.py | Python | gpl-2.0 | 543 |
# -*- coding: utf-8 -*-
import os
import getpass
import json
from qgis.PyQt.QtCore import QSettings
from qgis.PyQt.QtSql import QSqlDatabase, QSqlQuery
from qgis.PyQt.QtWidgets import QMessageBox
from qgis.core import *
import qgis.core
class PostNAS_AccessControl:
def __init__(self, username = None):
if(... | Kreis-Unna/PostNAS_Search | PostNAS_AccessControl.py | Python | gpl-2.0 | 12,848 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import image_cropping.fields
class Migration(migrations.Migration):
dependencies = [
('crop', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='profile... | danithaca/berrypicking | django/advanced/crop/migrations/0002_auto_20150123_1831.py | Python | gpl-2.0 | 628 |
from django.db import models
#from Cliente.models import Cliente_Direccion
# Create your models here.
class Tipo_sede(models.Model):
nombre = models.CharField(max_length=50, unique=True)
def __unicode__(self):
return self.nombre
class Meta:
verbose_name = "Tipo de sede"
verbose_n... | jrmendozat/mtvm | Sede/models.py | Python | gpl-2.0 | 1,385 |
#!/usr/bin/env python
#coding:utf-8
"""
1000-digit Fibonacci number
The Fibonacci sequence is defined by the recurrence relation:
Fn = Fn−1 + Fn−2, where F1 = 1 and F2 = 1.
Hence the first 12 terms will be:
F1 = 1
F2 = 1
F3 = 2
F4 = 3
F5 = 5
F6 = 8
F7 = 13
F8 = 21
F9 = 34
F10 = 55
F11 = 89
F12 = 144
The 12th term... | Urinx/Project_Euler_Answers | 025.py | Python | gpl-2.0 | 735 |
#!/usr/bin/python
# -*- encoding: utf-8 -*-
###############################################################################
# Module Writen to OpenERP, Open Source Management Solution
# Copyright (C) OpenERP Venezuela (<http://www.vauxoo.com>).
# All Rights Reserved
############# Credits ######################... | 3dfxsoftware/cbss-addons | partner_products/__openerp__.py | Python | gpl-2.0 | 1,863 |
from django.conf.urls import patterns, include, url
from cover.views import CoverView
urlpatterns = patterns('cover.views',
url(r'^$', CoverView.as_view(), name='cover'),
)
| denever/discipline_terra | cover/urls.py | Python | gpl-2.0 | 198 |
# -*- coding: utf-8 -*-
#Canto-curses - ncurses RSS reader
# Copyright (C) 2016 Jack Miller <jack@codezen.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.
from canto_ne... | themoken/canto-curses | canto_curses/reader.py | Python | gpl-2.0 | 9,002 |
from PyQt4.QtGui import QPushButton
from Ui.Colors import COLOR_WIDGET_12, COLOR_FONT_8, COLOR_OUTLINE_7
class ButtonPositive(QPushButton):
def __init__(self, strText=""):
QPushButton.__init__(self)
self.__InitUi(strText)
def __InitUi(self, strText):
self.setText(strText)
... | gebenedeit/sccpy | sccpy/Ui/Controls/Buttons/ButtonPositive.py | Python | gpl-2.0 | 921 |
"""
WSGI config for influencetx project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATIO... | open-austin/influence-texas | src/config/wsgi.py | Python | gpl-2.0 | 1,920 |
#!/usr/bin/env python
from unittest import TestCase
from before_after import before, after, before_after
from before_after.tests import test_functions
class TestBeforeAfter(TestCase):
def setUp(self):
test_functions.reset_test_list()
super(TestBeforeAfter, self).setUp()
def test_before(self... | c-oreills/before_after | before_after/tests/test_before_after.py | Python | gpl-2.0 | 2,890 |
from flask import Blueprint, request, current_app as app
from twoxy.blueprints.base import TemplateView
from twoxy.database.models import Blacklisted
from twoxy.database import db_ctx as db
from twoxy.util import ratelimit, random_twitter_auth, is_tweet_allowed
import json
import datetime
import twitter
blueprint = ... | ableiten/twoxy | twoxy/blueprints/main.py | Python | gpl-2.0 | 3,469 |
#! /usr/bin/env python3
""" Cruft checker and hole filler for overrides
@contact: Debian FTPMaster <ftpmaster@debian.org>
@copyright: 2000, 2001, 2002, 2004, 2006 James Troup <james@nocrew.org>
@opyright: 2005 Jeroen van Wolffelaar <jeroen@wolffelaar.nl>
@copyright: 2011 Joerg Jaspert <joerg@debian.org>
@license: ... | Debian/dak | dak/check_overrides.py | Python | gpl-2.0 | 19,666 |
#!/usr/bin/env python2
# Copyright (C) 2010 neelance <mail@richard-musiol.de>
# Copyright (C) 2014 tarakbumba <tarakbumba at tarakbumba dot 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,... | tarakbumba/awn-mate-applets | applets/mintmenu/mintMenuAwn.py | Python | gpl-2.0 | 4,505 |
#! /usr/bin/python
answerx = 0
answery=0
def palindrom(num):
palin=''
tmp = str(num)
y=0
for x in reversed(range(len(tmp))):
palin=palin+str(tmp[x])
y=y+1
return int(palin)
for x in range(100,999):
for y in range(100,999):
if (x * y) == palindrom(x*y):
... | jasimmonsv/CodingExercises | EulerProject/python/problem4.py | Python | gpl-2.0 | 510 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('campaigns', '0002_auto_20141022_1840'),
]
operations = [
migrations.AlterField(
model_name='campaignform',
... | Monithon/Monithon-2.0 | campaigns/migrations/0003_auto_20141130_0858.py | Python | gpl-2.0 | 1,412 |
import logging, os, re
from autotest.client.shared import error
from autotest.client import utils
from autotest.client.virt import virt_utils, virt_test_utils
from autotest.client.virt import virt_env_process
@error.context_aware
def run_trans_hugepage_swapping(test, params, env):
"""
KVM khugepage user side ... | nacc/autotest | client/virt/tests/trans_hugepage_swapping.py | Python | gpl-2.0 | 4,326 |
# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding: utf-8 -*-
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
#
# MDAnalysis --- http://www.mdanalysis.org
# Copyright (c) 2006-2016 The MDAnalysis Development Team and contributors
# (see the file AUTHORS for the full list of names)
#
# Released under t... | alejob/mdanalysis | package/MDAnalysis/topology/tpr/setting.py | Python | gpl-2.0 | 8,002 |
# main.py: Provides the server client infra for gaming
# python2 server.py <port> <max_clients>
# YES YOU CAN ONLY USE PYTHON "2" and NOT "3".
import os, sys, socket, signal, game, json, humanSocket
if (os.path.realpath('../utils') not in sys.path):
sys.path.insert(0, os.path.realpath('../utils'))
from log import *
... | MrMasterBaiter/entropy-ai | entropy server/server/server.py | Python | gpl-2.0 | 3,332 |
# 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 distributed in the hope that it will be useful,
# but... | Debian/dak | daklib/conftest.py | Python | gpl-2.0 | 1,325 |
import boto3
import numpy as np
import time
import json
import os
import pandas as pd
name = 'Flavio C.'
root_dir = '/document/'
file_name = 'augmented-data.png'
# Get all files in directory
meine_id_kartes = os.listdir(root_dir)
# get the results
client = boto3.client(
service_name='textract',
region_name='... | fclesio/learning-space | Python/textract_extraction.py | Python | gpl-2.0 | 1,358 |
# -*- coding: utf-8 -*-
"""
/***************************************************************************
DsgTools
A QGIS plugin
Brazilian Army Cartographic Production Tools
-------------------
begin : 2019-04-26
git sha ... | lcoandrade/DsgTools | core/DSGToolsProcessingAlgs/Algs/LayerManagementAlgs/assignFilterToLayersAlgorithm.py | Python | gpl-2.0 | 7,059 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from BaseReality import BaseReality
import re
class BaseRules(BaseReality):
def _get_rule_precond(self,i):
try:
return re.match("^(.*)\s?->.*$",self._get_data(i)).groups()[0]
except TypeError as te:
print "Error con el parametro a la expresion regular de extra... | overxfl0w/Inference-Engine | BaseRules.py | Python | gpl-2.0 | 876 |
# -*- coding: utf-8 -*-
import logging
import os
import re
import uuid
from django.conf import settings
from django.contrib.auth.hashers import check_password
import pexpect
from ..users.models import User
logger = logging.getLogger(__name__)
class KerberosAuthenticationBackend(object):
"""Authenticate using... | jacobajit/ion | intranet/apps/auth/backends.py | Python | gpl-2.0 | 6,021 |
# Copyright 2001 by Tarjei Mikkelsen. All rights reserved.
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
"""BioPython Pathway module.
Bio.Pathway is a lightweight class library designed to suppor... | Ambuj-UF/ConCat-1.0 | src/Utils/Bio/Pathway/__init__.py | Python | gpl-2.0 | 10,961 |
# Based on PliExtraInfo
# Recoded for Black Pole by meo.
# Recodded for EGAMI
from enigma import iServiceInformation
from Components.Converter.Converter import Converter
from Components.Element import cached
from Poll import Poll
class EGExtraInfo(Poll, Converter, object):
def __init__(self, type):
Converter.__in... | popazerty/beyonwiz-4.1 | lib/python/Components/Converter/EGExtraInfo.py | Python | gpl-2.0 | 10,356 |
# 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/grub2.py | Python | gpl-2.0 | 2,119 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011 TUBITAK/BILGEM
# Renan Çakırerk <renan at pardus.org.tr>
#
# 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 ... | bit2pixel/quickformat | src/code/quickformat.py | Python | gpl-2.0 | 14,607 |
import urllib, urllib2
import json
from django.contrib.gis.db import models
from django.contrib.gis import geos
class Country(models.Model):
name = models.CharField(max_length=30, unique=True)
short_name = models.CharField(max_length=10, unique=True)
objects = models.GeoManager()
def __unicode____(... | nocarryr/django-ingress-agent-info | ingress_agent_info/locations/models.py | Python | gpl-2.0 | 5,462 |
#!/usr/bin/env python
"""
.. module:: camerastation.py
:platform: Unix, Windows
:synopsis: Ulyxes - an open source project to drive total stations and
publish observation results. GPL v2.0 license Copyright (C)
2010- Zoltan Siki <siki.zoltan@epito.bme.hu>
.. moduleauthor:: Bence Turak <bence.turak... | zsiki/ulyxes | pyapi/camerastation.py | Python | gpl-2.0 | 5,445 |
L = [lambda x: x ** 2, # Inline function definition
lambda x: x ** 3,
lambda x: x ** 4] # A list of 3 callable functions
for f in L:
print(f(2)) # Prints 4, 8, 16
print(L[0](3)) # Prints 9
def f1(x): return x ** 2
def ... | simontakite/sysadmin | pythonscripts/learningPython/lambdas1.py | Python | gpl-2.0 | 587 |
arkeia_request_stage_1 = "\x00\x4d\x00\x03\x00\x01\x03\xe8"
| zeroq/amun | vuln_modules/vuln-arkeia/arkeia_shellcodes.py | Python | gpl-2.0 | 60 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'zappyk'
import sys, subprocess
from gi.repository import Gtk, Gio
from gi.repository import GLib
###############################################################################
class MyWindow(Gtk.Window):
def __init__(self):
Gtk.Window.__init__... | zappyk-github/zappyk-python | src/src_zappyk/developing/test-gui-Gtk.py | Python | gpl-2.0 | 4,640 |
# 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... | anish/buildbot | master/buildbot/test/unit/test_revlinks.py | Python | gpl-2.0 | 5,555 |
from tools.load import LoadMatrix
from numpy import random
lm=LoadMatrix()
N = 100
random.seed(17)
ground_truth = abs(random.randn(N))
predicted = abs(random.randn(N))
parameter_list = [[ground_truth,predicted]]
def evaluation_meansquaredlogerror_modular(ground_truth, predicted):
from shogun.Features import Regres... | ratschlab/ASP | examples/undocumented/python_modular/evaluation_meansquaredlogerror_modular.py | Python | gpl-2.0 | 727 |
# Copyright 2007 Zachary Pincus
# This file is part of CellTool.
#
# CellTool 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.
from scipy import ndimage
import numpy
def warp_images(from_points, ... | zpincus/celltool | celltool/numerics/image_warp.py | Python | gpl-2.0 | 5,013 |
# encoding: utf-8
# module gtk.gdk
# from /usr/lib/python2.7/dist-packages/gtk-2.0/gtk/_gtk.so
# by generator 1.135
# no doc
# imports
from exceptions import Warning
import gio as __gio
import gobject as __gobject
import gobject._gobject as __gobject__gobject
import pango as __pango
import pangocairo as __pangocairo
... | ProfessorX/Config | .PyCharm30/system/python_stubs/-1247972723/gtk/gdk/WindowType.py | Python | gpl-2.0 | 832 |
"""
Module containing classes with common behaviour for consoles of both VMs and Instances of all types.
"""
import base64
import re
import tempfile
import time
from PIL import Image
from PIL import ImageFilter
from pytesseract import image_to_string
from selenium.webdriver.common.keys import Keys
from wait_for import... | izapolsk/integration_tests | cfme/common/vm_console.py | Python | gpl-2.0 | 11,716 |
#!/usr/bin/env python
#
# This is be used to verify that all the dependant libraries of a Mac OS X executable
# are present and that they are backwards compatible with at least 10.5.
# Run with an executable as parameter
# Will return 0 if the executable an all libraries are OK
# Returns != 0 and prints some textura... | battlesnake/OpenSCAD | scripts/macosx-sanity-check.py | Python | gpl-2.0 | 4,696 |
#!/bin/python2
"""
#####################################
# iSpike-like joint conversion #
#####################################
"""
class sensNetIn():
#TODO: explain XD
'''
This object gets as input
and returns as output:
'''
from sys import exit
def __init__(self,
... | nico202/pyNeMo | libs/pySpike.py | Python | gpl-2.0 | 5,430 |
import bpy
from bpy.props import *
from add_mesh_LowPolyFactory.materials import *
from add_mesh_LowPolyFactory.populate import *
def get_prefs(context):
return context.user_preferences.addons[__package__].preferences
class LPF_Panel(bpy.types.Panel):
bl_label = "LowPoly Factory"
bl_space_type = "PROPER... | luboslenco/lowpolyfactory | editor.py | Python | gpl-2.0 | 6,413 |
from django.conf.urls import patterns, url
from eatnit.apps.food import views
urlpatterns = patterns('',
url(r'^$', views.index, name='eatnit_index'),
# url(r'^meals/$', views.meal_index, name='meal_index'),
# url(r'^meals/(?P<meal_id>\d+)/$', views.meal_detail, name='meal_detail'),
# url(r'^restauran... | flinz/eatnit | eatnit/apps/food/urls.py | Python | gpl-2.0 | 482 |
"""
Virtualization test utility functions.
:copyright: 2008-2009 Red Hat Inc.
"""
import time
import string
import random
import socket
import os
import stat
import signal
import re
import logging
import commands
import fcntl
import sys
import inspect
import tarfile
import shutil
import getpass
import ctypes
from aut... | chuanchang/tp-libvirt | virttest/utils_misc.py | Python | gpl-2.0 | 81,782 |
from principal.models import Fase
from principal.models import Item
from principal.models import VersionItem
from principal.models import AtributoItem
from principal.models import TipoItem
from principal.models import Relacion
from principal.models import ArchivoForm, Archivo
from principal.models import HistorialItem
... | SantiagoValdez/hpm | src/hpm/app_item/views.py | Python | gpl-2.0 | 37,100 |
{
'name': "Legacy Partner integration",
'version': "1.1",
'author': "José A. Ramírez",
'category': "Tools",
'depends': ['base'],
'data': ['legacy_partner.xml'],
'demo': [],
'installable': True,
} | jarcodallo/custom_modules | legacy_clients/__openerp__.py | Python | gpl-2.0 | 229 |
#!/usr/bin/env python3
# coding: utf-8
romaji = []
hiragana = []
katakana = []
def num_permuts(N):
"""Permutation of 0 -- 46
"""
from random import shuffle as shf
from random import seed
seed()
a = [i for i in range(N)]
shf(a)
return a[:]
def main(ts):
import time
# ---------... | noinil/memory | kana_table_test.py | Python | gpl-2.0 | 3,595 |
from __future__ import division
import os
import time
import re
import logging
import glob
import threading
import shutil
import sys
import copy
import multiprocessing
try:
from urllib.request import ProxyHandler, build_opener, install_opener
except ImportError:
from urllib2 import ProxyHandler, build_opener, i... | xutian/avocado-vt | virttest/env_process.py | Python | gpl-2.0 | 84,275 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.