repo_name stringlengths 5 104 | path stringlengths 4 248 | content stringlengths 102 99.9k |
|---|---|---|
audreyr/opencomparison | apiv1/tests/data.py | from grid.models import Grid
from django.contrib.auth.models import Group, User, Permission
from package.models import Category, PackageExample, Package
from grid.models import Element, Feature, GridPackage
from core.tests import datautil
def load():
category, created = Category.objects.get_or_create(
pk=... |
DrDos0016/z2 | museum_site/errors.py | from django.shortcuts import render
from .common import *
def raise_error(request, status):
try:
status = int(status)
except ValueError:
status = 404
if status == 400:
return bad_request_400(request)
elif status == 403:
return permission_denied_403(request)
elif sta... |
pseudonym117/Riot-Watcher | src/riotwatcher/_apis/legends_of_runeterra/MatchApi.py | from .. import BaseApi, NamedEndpoint
from .urls import MatchApiUrls
class MatchApi(NamedEndpoint):
"""
This class wraps the LoR-Match-V1 Api calls provided by the Riot API.
See https://developer.riotgames.com/apis#lor-match-v1 for more detailed
information
"""
def __init__(self, base_api: B... |
shivansh-pro/Sights | customTrainer.py | from clarifai_basic import ClarifaiCustomModel
import os
import urllib2, socket
# instantiate clarifai client
clarifai = ClarifaiCustomModel()
p=os.getcwd()
p=p.replace('\\','/')
#XXXXXXXXXXXXXXXXXXX CAR XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
POSITIVES = []
pos=p+"/images/cars.txt"
with open(pos) as f:
POSITIVES = [x.stri... |
pablodav/burp_server_reports | burp_reports/lib/txt.py | from datetime import datetime
from .humanize import humanize_file_size
from ..defaults.default_data_structure import default_client_backup_report
import os
class TxtReports:
"""
Formats a dict of clients and prints to stdout or exports to file
"""
def __init__(self, clients,
file=Non... |
joostrijneveld/eetvoudig | meals/migrations/0002_auto_20161006_1640.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('meals', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='wbw_list',
name='list_i... |
src053/PythonComputerScience | chap7/speeding.py | #program to determing speeding fine
def main():
#get the speed limit
speedLimit = eval(input("Please enter the speed limit: "))
#get the speed the person was traveling
mph = eval(input("Please enter how fast the vehicle was going: "))
#setfine to zero
fine = 0
if mph > speedLimit:
over = mph - speedLimit
... |
dilynfullerton/tr-A_dependence_plots | src/deprecated/nushellx_lpt/metafitter_abs.py | """nushellx_lpt/metafitter_abs.py
Function definitions for an abstract *.lpt metafitter
"""
from __future__ import print_function, division, unicode_literals
import numpy as np
from deprecated.int.metafitter_abs import single_particle_metafit_int
from constants import DPATH_SHELL_RESULTS, DPATH_PLOTS
from deprecated.... |
nevillegrech/stdl | src/STDL/Program.py | from __future__ import absolute_import
import sys, types
#sys.path=['Coders'] + sys.path
from BaseClasses import *
from InitParams import *
from Test import *
from Coders.ICoder import *
# The following 3 functions are taken from the python cookbook
def _get_mod(modulePath):
try:
aMod = sys.modu... |
ChironJ/colorfire | colorfire/app/colorfire.py | #!/usr/bin/env python
#-*- coding:utf-8 -*-
import sys, os
import random
import string
import json
from bottle import static_file, Bottle
from bottle import jinja2_template as template
from bottle import request, response, redirect
from bottle import TEMPLATE_PATH
from settings import log
#获取当前文件夹的父目录绝对路径
BASE_DIR = o... |
njpatel/avant-window-navigator | plugins/Rhythmbox/artdisplay-awn/AmazonCoverArtSearch.py | # -*- Mode: python; coding: utf-8; tab-width: 8; indent-tabs-mode: t; -*-
#
# Copyright (C) 2006 - Gareth Murphy, Martin Szulecki
#
# 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 versio... |
repotvsupertuga/tvsupertuga.repository | script.module.openscrapers/lib/openscrapers/sources_openscrapers/de/cine.py | # -*- coding: UTF-8 -*-
# ..#######.########.#######.##....#..######..######.########....###...########.#######.########..######.
# .##.....#.##.....#.##......###...#.##....#.##....#.##.....#...##.##..##.....#.##......##.....#.##....##
# .##.....#.##.....#.##......####..#.##......##......##.....#..##...##.##.....#.... |
msimacek/koschei | koschei/locks.py | # Copyright (C) 2018 Red Hat, Inc.
#
# 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... |
ProfessorX/Config | .PyCharm30/system/python_stubs/-1247972723/PyKDE4/kdeui/KXMLGUIFactory.py | # encoding: utf-8
# module PyKDE4.kdeui
# from /usr/lib/python2.7/dist-packages/PyKDE4/kdeui.so
# by generator 1.135
# no doc
# imports
import PyKDE4.kdecore as __PyKDE4_kdecore
import PyQt4.QtCore as __PyQt4_QtCore
import PyQt4.QtGui as __PyQt4_QtGui
import PyQt4.QtSvg as __PyQt4_QtSvg
class KXMLGUIFactory(__PyQt4_... |
thinkWhere/Roadnet | gui/rn_filter_street_record_ui.py | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'gui/rn_filter_street_record_ui.ui'
#
# Created: Fri Dec 4 12:22:46 2015
# by: PyQt4 UI code generator 4.10.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString... |
wgwoods/python-bugzilla | tests/test_api_authfiles.py | #
# Copyright Red Hat, Inc. 2012
#
# This work is licensed under the GNU GPLv2 or later.
# See the COPYING file in the top-level directory.
#
"""
Test miscellaneous API bits
"""
import os
import shutil
import tempfile
import pytest
import requests
import bugzilla
import tests
import tests.mockbackend
import tests.... |
dvklopfenstein/PrincetonAlgorithms | py/AlgsSedgewickWayne/WeightedQuickUnionUF.py | """Weighted Quick Union Algorithm takes steps to avoid tall trees."""
from AlgsSedgewickWayne.BaseComp import BaseComp
class WeightedQuickUnionUF(BaseComp):
""" UNION FIND: Weighted Quick-union [lazy approach] to avoid tall trees."""
def __init__(self, N): # $ = N
"""Initialize union-find data structure ... |
jdpepperman/houseSimulation | modules/House.py | import random
from Person import Person
class House(object):
def __init__(self):
self.rooms = []
self.actors = []
def __str__(self):
house_string = ""
for room in self.rooms:
house_string = house_string + str(room) + "\n\n"
return house_string[:-2]
def... |
braghiere/JULESv4.6_clump | examples/us-me2/output/plot_limiting_vertical_bl.py | # June 2015
# read and plot the co2 runs on jules
import os
import matplotlib.pyplot as plt
import numpy as np
import sys
from matplotlib.font_manager import FontProperties
from matplotlib.ticker import MultipleLocator
import matplotlib.patches as mpatches # for mask legend
from matplotlib.font_manager impo... |
hackultura/siscult-migration | models/mixins.py | # -*- coding: utf-8 -*-
from sqlalchemy import Column, Integer, String
from settings import DATABASE_NAMES
class EntesMixin(object):
__table_args__ = {'schema': DATABASE_NAMES.get('entes')}
class ProfileMixin(object):
__table_args__ = {'schema': DATABASE_NAMES.get('perfis')}
class AdminMixin(object):
... |
pgodel/rdiff-backup | rdiff_backup/rpath.py | # Copyright 2002, 2003, 2004 Ben Escoto
#
# This file is part of rdiff-backup.
#
# rdiff-backup is free software; you can redistribute it and/or modify
# 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 ver... |
wjlei1990/shakemovie_pyproc | src/source.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Source and Receiver classes of Instaseis.
:copyright:
Lion Krischer (krischer@geophysik.uni-muenchen.de), 2014
Martin van Driel (Martin@vanDriel.de), 2014
:license:
GNU Lesser General Public License, Version 3
(http://www.gnu.org/copyleft/lgpl.html)
"""... |
xmendez/wfuzz | src/wfuzz/ui/console/mvc.py | import sys
from collections import defaultdict
import threading
try:
from itertools import zip_longest
except ImportError:
from itertools import izip_longest as zip_longest
from wfuzz.fuzzobjects import FuzzWordType, FuzzType, FuzzPlugin
from .common import exec_banner, Term
from .getch import _Getch
from .o... |
rtucker/sycamore | Sycamore/macro/allusers.py | # -*- coding: utf-8 -*-
import time
import re
from cStringIO import StringIO
from Sycamore import wikiutil
from Sycamore import config
from Sycamore import wikidb
from Sycamore import user
from Sycamore.Page import Page
def execute(macro, args, formatter=None):
if not formatter:
formatter = macro.format... |
CSXM/laborbook | siteapp/models.py | from django.db import models
from django.contrib.auth.models import User
from django.template import loader, Context
# There can be basically infinite hierarchy of categories
class Category(models.Model):
""" A Category for Skills
"""
name = models.CharField(max_length=50)
description = models.CharFie... |
libvirt/libvirt-test-API | libvirttestapi/repos/checkpoint/checkpoint_get_xml.py | # Copyright (C) 2010-2012 Red Hat, Inc.
# This work is licensed under the GNU GPLv2 or later.
import libvirt
import re
from libvirt import libvirtError
from libvirttestapi.utils import utils
required_params = {'guestname', 'checkpoint_name'}
optional_params = {'flags': None}
def checkpoint_get_xml(params):
logg... |
TshepangRas/tshilo-dikotla | td_maternal/models/base_maternal_clinical_measurements.py | from django.core.validators import MinValueValidator, MaxValueValidator
from django.db import models
# from edc_base.audit_trail import AuditTrail
from ..managers import MaternalClinicalMeasurementsManager
from .maternal_crf_model import MaternalCrfModel
class BaseMaternalClinicalMeasurements(MaternalCrfModel):
... |
SpheMakh/Stimela | stimela/utils/__init__.py | import os
import sys
import json
import yaml
import time
import tempfile
import inspect
import warnings
import re
import math
import codecs
class StimelaCabRuntimeError(RuntimeError):
pass
class StimelaProcessRuntimeError(RuntimeError):
pass
CPUS = 1
from .xrun_poll import xrun
def assign(key, value):
... |
CharLLCH/jianchi_alimobileR | util/item.py | #!/usr/bin/python
#coding=utf-8
'''
**************************
* File Name :item.py
* Author:Charlley88
* Mail:charlley88@163.com
**************************
'''
'''
# 类似于user是一个用户所有数据的类,这是一条记录的类
灵活转变,方便存储db等
读一条是读,转化成类还可以方便定义一些操作函数!
'''
from datetime import datetime
class item:
__slots__ = ['user... |
daedric/cntouch_driver | .ycm_extra_conf.py | # This file is NOT licensed under the GPLv3, which is the license for the rest
# of YouCompleteMe.
#
# Here's the license text for this file:
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either... |
guzzijones/parseDI | parseDI.py | from slpp import SLPP
import re
class diObj(object):
def __init__(self,type,name,luaData):
self.objectType=type
self.objectName=name
self.objectKey=type+name
self.DictLuaData=luaData
self.DictTotal={}
self.setDict()
def setDict(self):
self.DictTotal["Name"]=self.objectName
self.DictTotal["Type"]=sel... |
morrillo/oerp_migrator | oerp_migrator.py | #!/usr/bin/python
# -*- coding: latin-1 -*-
import yaml
import xmlrpclib
import sys
import ConfigParser
import pdb
import logging
from datetime import date
from datetime import datetime
def get_model_id(oerp_destino,model=None):
""" Return model processed ID """
if model == None:
return_id = 0
else:
sock = oe... |
thomas-schmid-ubnt/avocado | avocado/utils/software_manager.py | # 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,
# bu... |
zencoders/pyircbot | pyircbot.py | #! /usr/bin/env python
# Copyright (c) 2013 sentenza
"""
A simple python-twisted IRC bot with greetings and karma functionalities
Usage:
$ python pyircbot.py --help
"""
import sys
import optparse
from config import ConfigManager
from bot_core.bot_factory import BotFactory
if __name__ == '__main__':
config_man... |
bskari/pi-rc | host_files.py | #!/bin/env python
"""Hosts files from the local directory using SSL."""
from __future__ import print_function
import signal
import socket
import ssl
import subprocess
import sys
import threading
killed = False
# pylint: disable=C0411
if sys.version_info.major < 3:
import SimpleHTTPServer
import SocketServer... |
thomec/tango | lists/models.py | # lists/models.py
from django.db import models
from django.conf import settings
from django.core.urlresolvers import reverse
class List(models.Model):
owner = models.ForeignKey(settings.AUTH_USER_MODEL, blank=True, null=True)
def get_absolute_url(self):
return reverse('view_list', args=[self.id])
... |
kvaps/vdsm | tests/volumeTests.py | # Copyright 2012 Red Hat, Inc.
#
# 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 ... |
nextgis-extra/tests | lib_gdal/gcore/hfa_read.py | #!/usr/bin/env python
###############################################################################
# $Id: hfa_read.py 32166 2015-12-13 19:29:52Z goatbar $
#
# Project: GDAL/OGR Test Suite
# Purpose: Test basic read support for all datatypes from a HFA file.
# Author: Frank Warmerdam <warmerdam@pobox.com>
#
#####... |
daringer/pyORM | tests/field_ex_test.py | import os, sys
import time
import unittest
import operator as ops
sys.path.append("..")
from baserecord import BaseRecord
from fields import StringField, IntegerField, DateTimeField, \
OneToManyRelation, FloatField, OptionField, ManyToOneRelation, \
ManyToManyRelation
from core import Database
fro... |
Lightning3105/Legend-Of-Aiopa-RPG | Updater.py | import urllib.request
import pickle
import sys
try:
import Variables as v
except:
class var():
def __init__(self):
self.screen = None
v = var()
import pygame as py
class textLabel(py.sprite.Sprite):
def __init__(self, text, pos, colour, font, size, variable = False, cen... |
jesopo/bitbot | src/IRCBuffer.py | import collections, dataclasses, datetime, re, typing, uuid
from src import IRCBot, IRCServer, utils
MAX_LINES = 2**10
@dataclasses.dataclass
class BufferLine(object):
sender: str
message: str
action: bool
tags: dict
from_self: bool
method: str
deleted: bool=False
notes: typing.Dict[... |
carolinux/QGIS | python/utils.py | # -*- coding: utf-8 -*-
"""
***************************************************************************
utils.py
---------------------
Date : November 2009
Copyright : (C) 2009 by Martin Dobias
Email : wonder dot sk at gmail dot com
************************... |
szecsi/Gears | GearsPy/Project/Components/Composition/Min.py | import Gears as gears
from .. import *
from ..Pif.Base import *
class Min(Base) :
def applyWithArgs(
self,
spass,
functionName,
*,
pif1 : 'First operand. (Pif.*)'
= Pif.Solid( color = 'white' ),
pif2 : 'Sec... |
jworr/scheduler | model/staff.py | import model
EmployeeColumns = ["name", "role_id", "is_active", "street_address", "city", "state", "zip", "phone"]
class StaffMember(object):
"""
Represents a staff member
"""
def __init__(self, name, roleId, isActive, street=None, city=None, state=None, zipCode=None, phone=None):
"""
Creates a new staff me... |
neozhangthe1/scraper | douban/photo/photo/misc/middlewares.py | #encoding: utf-8
from random import choice
from .helper import gen_bids
class CustomCookieMiddleware(object):
def __init__(self):
self.bids = gen_bids()
def process_request(self, request, spider):
request.headers["Cookie"] = 'bid="%s"' % choice(self.bids)
class CustomUserAgentMiddleware(obje... |
j5shi/Thruster | pylibs/sqlite3/test/regression.py | #-*- coding: iso-8859-1 -*-
# pysqlite2/test/regression.py: pysqlite regression tests
#
# Copyright (C) 2006-2007 Gerhard Häring <gh@ghaering.de>
#
# This file is part of pysqlite.
#
# This software is provided 'as-is', without any express or implied
# warranty. In no event will the authors be held liable for ... |
susingha/0x_tools | programs/pycharm/py_classptr.py | import random
class node:
def __init__(self, val):
self.val = val
self.random = random.randint(20, 50)
self.ptr = None
arr = []
arr.append(node(0))
arr.append(node(1))
arr.append(node(2))
arr.append(node(3))
arr.append(node(4))
# check the list
print "before modification"
for n in arr:
... |
Pikecillo/genna | external/4Suite-XML-1.0.2/Ft/Lib/Terminal.py | ########################################################################
# $Header: /var/local/cvsroot/4Suite/Ft/Lib/Terminal.py,v 1.6.4.1 2006/09/18 17:05:25 jkloth Exp $
"""
Provides some of the information from the terminfo database.
Copyright 2005 Fourthought, Inc. (USA).
Detailed license and copyright information... |
tulikavijay/vms | vms/shift/views.py | # standard library
from datetime import date
# third party
from braces.views import LoginRequiredMixin, AnonymousRequiredMixin
# Django
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.core.exceptions import ObjectDoesNotExist
from django.core.urlreso... |
ksterker/wastesedge | scripts/dialogues/sarin_start.py | import dialogue
import adonthell
# -- pygettext support
def _(message): return message
class sarin_start (dialogue.base):
text = [None,\
_("What insolence! $name, do you believe the depths of what they have done to our Lady? To accuse her of common theft, as if she was a human! And to lock her away in this tiny, d... |
PyQwt/PyQwt3D | Doc/sourceforge.py | #!/usr/bin/env python
import os
import re
import sys
def stamp(html):
"""Stamp a Python HTML documentation page with the SourceForge logo"""
def replace(m):
return ('<span class="release-info">%s '
'Hosted on <a href="http://sourceforge.net">'
'<img src="http://sourcef... |
stuart-knock/tvb-library | tvb/tests/library/simulator/history_test.py | # -*- coding: utf-8 -*-
#
#
# TheVirtualBrain-Scientific Package. This package holds all simulators, and
# analysers necessary to run brain-simulations. You can use it stand alone or
# in conjunction with TheVirtualBrain-Framework Package. See content of the
# documentation-folder for more details. See also http://www.... |
rustychris/freebird | software/freebird/datafile.py | """
Parse binary output files from freebird logger
"""
import os
import numpy as np
import re
from numpy.lib import recfunctions
import datetime
from matplotlib.dates import date2num
from contextlib import contextmanager
from collections import namedtuple
import array_append
import derived
import netCDF4
def freebird_... |
dNG-git/mp_core | src/dNG/data/upnp/search/common_mp_entry_segment.py | # -*- coding: utf-8 -*-
"""
MediaProvider
A device centric multimedia solution
----------------------------------------------------------------------------
(C) direct Netware Group - All rights reserved
https://www.direct-netware.de/redirect?mp;core
The following license agreement remains valid unless any additions o... |
alanrogers/ldpsiz | src/ini.py | ###
# @file ini.py
# @page ini
# @author Alan R. Rogers
# @brief Functions for objects of class Ini, which reads parameters
# from an initialization file
#
# @copyright Copyright (c) 2014, Alan R. Rogers
# <rogers@anthro.utah.edu>. This file is released under the Internet
# Systems Consortium License, which can be fo... |
Hexacker/Dexacker | Dexacker.py | #!/usr/bin/env python
#______________________________________#
#Dexacker is an open source tool developed by Abdelmadjd Cherfaoui
#Dexacker is designed for Educational Stuff to do a LEGAL DDOS Test and the developers is
# not responsible for ILLEGAL USES
#Contacting using:@Hexacker | fb.com/Hexacker
#http://www.hackerc... |
Nexolight/wtstamp | src/utils.py | from datetime import datetime
from src import yamlsettings as settings
from models.models import Workday
from calendar import monthrange
import time
from math import ceil,floor
class Utils:
WEEKDAYS=["monday","tuesday","wednesday","thursday", "friday", "saturday", "sunday"]
MONTHS=["january","february","m... |
tcstewar/spinnbot | plot_lr_1.py | import pylab
pylab.figure(figsize=(8,4))
pylab.axes((0.11, 0.13, 0.85, 0.8))
color=['k', 'b', 'g', 'r']
pylab.plot([0, 1, 2, 3, 4, 5, 6, 7],[0.45077721721559999, 0.40372168451659995, 0.38063819377489994, 0.36765218894180002, 0.36047701604800009, 0.34854098046839999, 0.33848337337579998, 0.32900642344309999], label='... |
azumimuo/family-xbmc-addon | plugin.video.bubbles/resources/lib/sources/russian/hoster/open/__init__.py | # -*- coding: utf-8 -*-
"""
Bubbles Addon
Copyright (C) 2016 Exodus
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 l... |
cnewcome/sos | sos/plugins/xen.py | # 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... |
tradej/pykickstart-old | tests/commands/url.py | #
# Martin Gracik <mgracik@redhat.com>
#
# Copyright 2009 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. This program is distributed in the hope that it
# will be use... |
fxb22/BioGUI | plugins/Tools/ETOOLSPlugins/ESummary.py | import os
import sys
from Bio import Entrez
import wx
from xml.dom import minidom
import re
class etPlugin():
def GetName(self):
'''
Method to return name of tool
'''
return "ESummary"
def GetBMP(self, dirH):
'''
Method to return identifying image
''... |
rchakra3/x9115rc3 | hw/code/8/optimizer/de2.py | from __future__ import division
import random
import math
from common import prerun_each_obj
from model.helpers.candidate import Candidate
from helpers.a12 import a12
""" This contains the optimizers """
def de(model, frontier_size=10, cop=0.4, ea=0.5, max_tries=100, threshold=0.01, era_size=10, era0=None, lives=5):
... |
charlesll/RamPy | rampy/tests/test_mlregressor.py | import unittest
import numpy as np
np.random.seed(42)
import scipy
from scipy.stats import norm
import rampy as rp
class TestML(unittest.TestCase):
def test_mlregressor(self):
x = np.arange(0,600,1.0)
nb_samples = 100 # number of samples in our dataset
# true partial spectra
S... |
Freso/listenbrainz-server | listenbrainz/listenstore/tests/test_redislistenstore.py | # coding=utf-8
import datetime
import logging
import time
import uuid
from dateutil.relativedelta import relativedelta
from redis.connection import Connection
import listenbrainz.db.user as db_user
from listenbrainz.db.testing import DatabaseTestCase
from listenbrainz import config
from listenbrainz.listen import Li... |
IZSVenezie/VetEpiGIS-Tool | plugin/poi_dialog.py | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'poi_dialog_base.ui'
#
# Created by: PyQt5 UI code generator 5.5.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Dialog(object):
def setupUi(self, Dialog):
Dialog.se... |
emundus/v6 | plugins/fabrik_visualization/fusionchart/libs/fusioncharts-suite-xt/integrations/django/samples/fusioncharts/samples/dynamic_chart_resize.py | from django.shortcuts import render
from django.http import HttpResponse
# Include the `fusioncharts.py` file which has required functions to embed the charts in html page
from ..fusioncharts import FusionCharts
# Loading Data from a Static JSON String
# It is a example to show a Column 2D chart where data is passed ... |
fablab-ka/OpenSCAD2D | src/openscad2d.py | # pylint: disable-msg=E0611
from __future__ import print_function
import sys
from PySide import QtCore, QtGui
from src.documentwatcher import DocumentWatcher
from src.geometrywidget import GeometryWidget
from src.cadfileparser import FcadParser
from src.printcapturecontext import PrintCaptureContext
from src.svggenera... |
adereis/avocado | avocado/utils/archive.py | # 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,
# bu... |
tivaliy/empire-of-code | find_sequence.py | __author__ = 'Vitalii K'
from itertools import groupby
SEQ_LENGTH = 4
def is_in_matrix(m):
len_list = [[len(list(group)) for key, group in groupby(j)] for j in m]
if any(map(lambda x: [i for i in x if i >= SEQ_LENGTH], len_list)):
return True
return False
def get_diagonals(m):
d = []
f... |
ProfessorX/Config | .PyCharm30/system/python_stubs/-1247972723/gio/_gio/FileMonitorEvent.py | # encoding: utf-8
# module gio._gio
# from /usr/lib/python2.7/dist-packages/gtk-2.0/gio/_gio.so
# by generator 1.135
# no doc
# imports
import gio as __gio
import glib as __glib
import gobject as __gobject
import gobject._gobject as __gobject__gobject
class FileMonitorEvent(__gobject.GEnum):
# no doc
def __i... |
miurahr/translate | translate/convert/test_po2prop.py | from io import BytesIO
from translate.convert import po2prop, test_convert
from translate.storage import po
class TestPO2Prop:
def po2prop(self, posource):
"""helper that converts po source to .properties source without requiring files"""
inputfile = BytesIO(posource.encode())
inputpo = p... |
jiayisuse/cs73 | wp-admin/data_delete.py | #!/usr/bin/env python
import nltk
import os
import sys
import include
title = sys.argv[1].lower()
html = sys.argv[2].lower()
cate_id = sys.argv[3]
def do_read_train(uni_dict, bi_dict, file):
lines = file.readlines()
for line in lines:
words = line.split()
bi_dict[words[0]] = int(words[2])
uni_dict[words[0].s... |
izrik/tudor | persistence/in_memory/layer.py |
from itertools import islice
from numbers import Number
import logging_util
from models.object_types import ObjectTypes
from persistence.in_memory.models.attachment import Attachment
from persistence.in_memory.models.note import Note
from persistence.in_memory.models.option import Option
from persistence.in_memory.mo... |
chbrandt/zyxw | eada/io/fits.py | """ Module to deal with FITS catalog read/access """
##@file fits_data
import sys;
import pyfits;
import string;
import numpy as np;
import re;
# ---
def sort_by_column(tbhdu,fieldname):
"""
Sort a FITS table HDU by "fieldname" column in increasing order.
Inputs:
- tbhdu: FITS table HDU
... |
LEWASatVT/leapi | leapi/models/user.py | from leapi import db, app
from flask.ext.security import UserMixin, RoleMixin
from passlib.apps import custom_app_context as pwd_context
from itsdangerous import (TimedJSONWebSignatureSerializer
as Serializer, BadSignature, SignatureExpired)
roles_users = db.Table('roles_users',
... |
jtconnor/mec2 | setup.py | """A setuptools based setup module.
See:
https://packaging.python.org/en/latest/distributing.html
https://github.com/pypa/sampleproject
"""
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
from os import path
here = path.absp... |
jestrada/uberlytics | uberlytics/web.py | import locale
locale.setlocale(locale.LC_ALL, '')
from flask import abort
from flask import Flask
from flask import g
from flask import request
from flask import render_template
from flask import session
from flask import url_for
from jinja2 import Markup
from uberlytics.lib import stats
from uberlytics.model import... |
gxx/auto_pull_request | auto_pull_request/plugins/pep8_info.py | # coding=utf-8
"""Auto pull request pep8 plugin"""
import subprocess
from git import Repo
from . import MASTER_BRANCH
from .base import AutoPullRequestPluginInterface, section_order
from ..nodes import NumberedList, DescriptionNode, CodeNode, NodeList, HeaderNode
class Pep8Plugin(AutoPullRequestPluginInterface):
... |
QuanticPotato/vcoq | plugin/coq.py | import xml.etree.ElementTree as XMLFactory
import subprocess
import os
import signal
import utils
from buffers import Text, Color
class CoqManager:
def __init__(self, WM):
# The coqtop process
self.coqtop = None
# The string return by 'coqtop --version'
self.coqtopVersion = ''
# The windows manager insta... |
kczapla/pylint | pylint/checkers/newstyle.py | # Copyright (c) 2006, 2008-2011, 2013-2014 LOGILAB S.A. (Paris, FRANCE) <contact@logilab.fr>
# Copyright (c) 2012-2014 Google, Inc.
# Copyright (c) 2013-2018 Claudiu Popa <pcmanticore@gmail.com>
# Copyright (c) 2014 Michal Nowikowski <godfryd@gmail.com>
# Copyright (c) 2014 Brett Cannon <brett@python.org>
# Copyright (... |
viswimmer1/PythonGenerator | data/python_files/33569220/common.py | import os
import os.path
import math
from decimal import Decimal
import numpy
import scipy
import scipy.stats
import uncertainties
from uncertainties import ufloat
from uncertainties.unumpy import nominal_values, std_devs
def heaviside(x):
if x > 0:
return x
else:
return 0
# default is round ... |
shirtsgroup/pygo | analysis/MBAR_foldingcurve.py | #!/usr/bin/python2.4
import sys
import numpy
import pymbar # for MBAR analysis
import timeseries # for timeseries analysis
import os
import os.path
import pdb # for debugging
import wham
from optparse import OptionParser
def parse_args():
parser=OptionParser()
#parser.add_option("-t", "--temprange", nargs=2,... |
rmcauley/rainwave | api_requests/admin/enable_perks.py | from libs import db
import api.web
from api.urls import handle_api_url
from api import fieldtypes
from api.exceptions import APIException
from libs import config
PRIVILEGED_GROUP_IDS = (18, 5, 4)
@handle_api_url("enable_perks_by_discord_ids")
class UserSearchByDiscordUserIdRequest(api.web.APIHandler):
auth_requir... |
marcrasi/webset | statistics/heat_map/process.py | #Our statistic is a 21-element array. Each element is the number of times
#the player has picked up a card from the corresponding position on the
#table.
import common_lib
def process_game(game):
statistic_map = {}
sg = common_lib.SetGame(game)
for action in sg.actionList:
if(action.action_type == 'pi... |
benosment/generators | generators-for-system-programmers/retuple.py | # retuple.py
#
# Read a sequence of log lines and parse them into a sequence of tuples
loglines = open("access-log")
import re
logpats = r'(\S+) (\S+) (\S+) \[(.*?)\] ' \
r'"(\S+) (\S+) (\S+)" (\S+) (\S+)'
logpat = re.compile(logpats)
groups = (logpat.match(line) for line in loglines)
tuples = (g... |
ilya-ilya/nikolayfs | fs.py | """
Main module that use fuse to provide filesystem
"""
import os
import sys
import llfuse
import errno
import auth
import requests
import json
import re
import datetime
import time
FILES = "https://www.googleapis.com/drive/v2/files/"
def countMode(meta):
"""
count file mode
"""
mode = 0
if meta["mimeType"].spl... |
blaiseli/p4-phylogenetics | share/Examples/L_mcmc/G_posteriorSamples/Protein_2parts/sPostSamps.py | read("d.nex")
read('sets.nex')
a = var.alignments[0]
a.setCharPartition('p1')
d = Data()
t = func.randomTree(taxNames=d.taxNames)
t.data = d
pNum=0
t.newComp(partNum=pNum, free=1, spec='wag')
t.newRMatrix(partNum=pNum, free=0, spec='wag')
t.setNGammaCat(partNum=pNum, nGammaCat=4)
t.newGdasrv(partNum=pNum, free=1, val=... |
bdcht/masr | masr/plugins/graph/main.py | # -*- coding: utf-8 -*-
# Copyright (C) 2010 Axel Tillequin (bdcht3@gmail.com)
# This code is part of Masr
# published under GPLv2 license
import gtk
from grandalf.graphs import Vertex,Edge,Graph
from grandalf.layouts import SugiyamaLayout
from grandalf.routing import *
from grandalf.utils import median_wh,Dot
f... |
heromod/migrid | mig/shared/init.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# --- BEGIN_HEADER ---
#
# init - shared helpers to init functionality backends
# Copyright (C) 2003-2014 The MiG Project lead by Brian Vinter
#
# This file is part of MiG.
#
# MiG is free software: you can redistribute it and/or modify
# it under the terms of the GNU Genera... |
rbarzic/arty-cm0-designstart | synt/yaml2mmi.py | import yaml
header="""
<?xml version="1.0" encoding="UTF-8"?>
<MemInfo Version="1" Minor="0">
<Processor Endianness="Little" InstPath="design/cortex">
<AddressSpace
Name="design_1_i_microblaze_0.design_1_i_microblaze_0_local_memory_dlmb_bram_if_cntlr" Begin="0" End="8191">
<BusBloc... |
lmiphay/gentoo-oam | oam/fact/checkconfig.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import print_function
import os
import click
from oam.facts import facts
from oam.checkconfig import CheckConfig
def fact(day=None):
"""Return a list configuration problems"""
return {
'check_config': [ x for x in CheckConfig().its() ]
}
... |
koditr/xbmc-tr-team-turkish-addons | plugin.video.hintfilmkeyfi/xbmctools.py | # -*- coding: iso8859-9 -*-
import urllib2,urllib,re,HTMLParser,cookielib
import sys,os,base64,time
import xbmc, xbmcgui, xbmcaddon, xbmcplugin
import urlresolver,json
__settings__ = xbmcaddon.Addon(id="plugin.video.hintfilmkeyfi")
#----------------------------------------------------------------------
xbmcPlayer = xb... |
linux-ha-japan/pm_ctl-1.0 | pm_ctl_start.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
# pm_ctl_start.py : Script of start pacemaker in target node
#
# Copyright (C) 2011 NIPPON TELEGRAPH AND TELEPHONE CORPORATION
#
# 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 ... |
dtysky/Led_Array | LED/PCB/Script/script6.py | import string
import struct
out=open('Led.scr','w');
w=202
h=726.8
for j in range(120):
wtf='add'+' '+'connect'+';'+'\n'+'pick'+' '+str(w)+' '+str(h)+';'+'\n'
out.write(wtf)
w=w-1.3
wtf='pick'+' '+str(w)+' '+str(h)+';'+'\n'
out.write(wtf)
wtf='add'+' '+'connect'+';'+'\n'+'pick'+' '+... |
jonasjberg/autonameow | autonameow/core/autonameow.py | #!/usr/bin/env python3
# -*- 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 t... |
dkriegner/xrayutilities | tests/test_materials.py | # This file is part of xrayutilities.
#
# xrayutilities 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... |
buret/pylmflib | pylmflib/morphosyntax/paradigm.py | #! /usr/bin/env python
"""! @package morphosyntax
"""
from utils.attr import check_attr_type, check_attr_range
from common.range import paradigmLabel_range
from config.mdf import pdl_paradigmLabel
class Paradigm():
"""! Paradigm is a class representing a morphological paradigm.
"""
def __init__(self):
... |
arnaudfr/echec | tests/test_players.py | # -*- coding: utf-8 -*-
from src.constant import *
import unittest
from src.game import Game
class TestPlayers(unittest.TestCase):
# Init a player
def test_initPlayer(self):
game = Game()
player = game.createPlayer()
self.assertEqual(player._id, 0)
# Get a valid player
def te... |
Grumbel/dirtool | experiments/udisks/udisks.py | #!/usr/bin/env python3
import dbus
import xml
import xml.dom.minidom
import xml.etree.ElementTree as ET
from dbus.mainloop.glib import DBusGMainLoop
from gi.repository import GLib
DBusGMainLoop(set_as_default=True)
bus = dbus.SystemBus()
ud_manager_obj = bus.get_object("org.freedesktop.UDisks2", "/org/freedesktop/... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.