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 |
|---|---|---|---|---|---|
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from google.appengine.ext import ndb
from gaegraph.model import Node
#from gaeforms.ndb import property
class Chamado(Node):
empresa = ndb.StringProperty(required=True)
start_date = ndb.StringProperty()
id_ordem = ndb.Integer... | cbeloni/pychronesapp | backend/apps/chamado_app/chamado_model.py | Python | mit | 1,060 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# clamm documentation build configuration file, created by
# sphinx-quickstart on Thu Mar 2 20:47:20 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# auto... | p5a0u9l/clamm | doc/conf.py | Python | mit | 4,816 |
import cPickle
def save_model(filename, model):
output = open(filename, 'wb')
cPickle.dump(model, output)
output.close()
def load_model(filename):
pkl_file = open(filename, 'rb')
res = cPickle.load(pkl_file)
pkl_file.close()
return res
| idf/FaceReader | facerec_py/facerec/serialization.py | Python | mit | 268 |
"""
@author: Geir Sporsheim
@license: see LICENCE for details
"""
from twisted.internet import defer
from twisted.conch.ssh.userauth import SSHUserAuthClient
class AutomaticUserAuthClient(SSHUserAuthClient):
"""User Auth Client that automatically authenticate using stored credentials.
"""
def __init__(se... | sporsh/carnifex | carnifex/ssh/userauth.py | Python | mit | 1,372 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-06-15 16:30
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('isisdata', '0019_auto_20160427_1520'),
]
operations = [
migrations.AddField(... | upconsulting/IsisCB | isiscb/isisdata/migrations/0020_auto_20160615_1630.py | Python | mit | 15,648 |
from main import *
class Human(object):
pass
class Man(Human):
pass
class Woman(Human):
pass
def God():
adam, eve = Man(), Woman()
return [adam, eve]
paradise = God()
test.assert_equals(True, isinstance(paradise[0], Man), "First object are a man") | bionikspoon/Codewars-Challenges | python/8kyu/basic_subclasses/solution.py | Python | mit | 277 |
"""
The following class names are paired with the methods listed
at the top of the api module. If you add a method to the api
module you must also add a corresponding Response class below.
"""
import requests
HTTP_SUCCESS = 200
SHIPWIRE_GET_ALL_LIMIT = 200
class ShipwireResponse(object):
def __init__(self, resp... | soylentme/shipwire-python | shipwire/responses.py | Python | mit | 2,748 |
import os
import sys
from copy import copy
from watchdog.events import RegexMatchingEventHandler
if sys.platform == "darwin":
from watchdog.observers.polling import PollingObserver as Observer
else:
from watchdog.observers import Observer
from microproxy.log import ProxyLogger
logger = ProxyLogger.get_logger(... | mike820324/microProxy | microproxy/interceptor/plugin_manager.py | Python | mit | 3,707 |
"""Basic Model Interface (BMI) for the Diffusion model."""
import numpy as np
from basic_modeling_interface import Bmi
from .diffusion import Diffusion
class BmiDiffusion(Bmi):
"""BMI for the Diffusion model."""
_name = 'Diffusion model'
_input_var_names = ('plate_surface__temperature',)
_output_va... | csdms/bmi-live-2017 | .totally-hidden-directory/bmi_diffusion.py | Python | mit | 7,347 |
#! /usr/bin/env python3
#
# SCANIT - Control A spectrometer and collect data
#
# LICENSE:
# This work is licensed under the Creative Commons Zero License
# Creative Commons CC0.
# To view a copy of this license, visit
# http://directory.fsf.org/wiki/License:CC0
# or send a letter to:
# Creative Commons, PO Box 1866, M... | jluscher/SCANIT | scanit_v033.py | Python | cc0-1.0 | 86,949 |
"""
Multinet utility functions to communicate with the master and the worker machines
"""
import requests
import sys
import multiprocessing
import json
import time
import logging
import argparse
logging.getLogger().setLevel(logging.DEBUG)
def parse_arguments():
"""Reads the arguments passed from command line.
... | intracom-telecom-sdn/multinet | util/multinet_requests.py | Python | epl-1.0 | 8,130 |
# Logic for listing and running tests.
#
# * @author Ben Gardner October 2009
# * @author Guy Maurel October 2015
# * @author Matthew Woehlke June 2018
#
import argparse
import os
import subprocess
import sys
from .ansicolor import printc
from .config import config, all_tests, FAIL_ATTRS, PASS_AT... | nivekkagicom/uncrustify | tests/test_uncrustify/utilities.py | Python | gpl-2.0 | 7,537 |
# replace all key events in
# js files and htmls
# to our standard key input event
# more details see in DOC dir
# Key 事件进行全局替换, 统一处理。 | lifeinoppo/littlefishlet-scode | SRC/Server/Components/input/python/keyInput.py | Python | gpl-2.0 | 175 |
# -*- coding: utf-8 -*-
"""
Test accounts module
"""
import os
from decimal import Decimal
from mock import patch
from django.core.urlresolvers import reverse
from django.http import HttpResponseForbidden
from django.test import TestCase
from .factories import UserFactory, UserWithAvatarFactory, AdminFactory
from .mo... | KlubJagiellonski/Politikon | accounts/tests.py | Python | gpl-2.0 | 18,113 |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# by Mafarricos
# email: MafaStudios@gmail.com
# Thanks to enen92 and fightnight
# 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... | Mafarricos/Mafarricos-xbmc-addons | plugin.video.videosinfantis/main.py | Python | gpl-2.0 | 4,836 |
# -*- coding: utf-8 -*-
##############################################################################
#
# it.artmin
# Martin Apitz, May 2014
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free S... | artmin/weippert-addons | account_cash_discount/__openerp__.py | Python | gpl-2.0 | 1,514 |
import os, sys
import myfun
import numpy as np
import matplotlib as mpl
mpl.use('ps')
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from scipy import interpolate
import lagrangian_stats
import scipy.fftpack
## READ archive (too many points... somehow)
# args: name, dayi, dayf, days
#label ... | jungla/ICOM-fluidity-toolbox | 2D/U/plot_Div_spec.py | Python | gpl-2.0 | 3,442 |
#!/usr/bin/env python
# vi:ai:et:ts=4 sw=4
#
# -*- coding: utf8 -*-
#
# PyMmr My Music Renamer
# Copyright (C) 2007-2010 mathgl67@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 Foundatio... | mathgl67/pymmr | mmr/plugins/research/freedb.py | Python | gpl-2.0 | 2,675 |
visit_schedule_fields = ('visit_schedule_name', 'schedule_name', 'visit_code')
visit_schedule_fieldset_tuple = (
'Visit Schedule', {
'classes': ('collapse',),
'fields': visit_schedule_fields})
visit_schedule_only_fields = ('visit_schedule_name', 'schedule_name')
visit_schedule_only_fieldset_tuple... | botswana-harvard/edc-visit-schedule | edc_visit_schedule/fieldsets.py | Python | gpl-2.0 | 430 |
# -*- coding: utf-8 -*-
"""
Created on Wed Jan 28 14:33:24 2015
@author: dominic
"""
#import matplotlib.pylab as pylab
import numpy as np
import tracts_ped as ped
import os
import tracts
import sys
import time
import numpy as np
# MigrantProps = [0.2, 0.05] # Proportion of pedigree that will be new migrants
# MigProp... | DomNelson/tracts | scripts/tracts_sim.py | Python | gpl-2.0 | 6,478 |
##
# Copyright 2009-2016 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://vscentrum.be/nl/en),
# Flemish Research Foundation ... | wpoely86/easybuild-easyblocks | easybuild/easyblocks/generic/pythonpackage.py | Python | gpl-2.0 | 21,887 |
#!/usr/bin/python
import re, fnmatch, os, sys, array
ver_string_head="MSVC00"
ver_string_lib="IL"
ver_string_build_number="000000"
def check_input():
if not os.path.exists(sys.argv[1]):
print 'ERROR!! \"%s\" file not existed!!' % sys.argv[1]
sys.exit(-1)
def main():
print('Append ve... | czc0713/Mst786 | append_UBOOT_version.py | Python | gpl-2.0 | 2,966 |
# -*- coding:utf-8 -*-
from functools import wraps
from flask import abort
from flask import request
def kwargs_required(*required_args):
def decorate(func):
@wraps(func)
def wrapper(*args, **kwargs):
for arg in required_args:
if arg not in kwargs:
... | pycook/cmdb | cmdb-api/api/lib/decorator.py | Python | gpl-2.0 | 838 |
#!/usr/bin/python
import sys
import pynvc
def setThreshold(destination, threshold):
pynvc.sendWithRetryAndCheckedReceiveAPPMSG(
destination=destination,
command=2,
allowedReplies=[12],
payload=[threshold])
if __name__ == "__main__":
... | wukong-m2m/NanoKong | tools/inteldemo201202/setThreshold.py | Python | gpl-2.0 | 542 |
#
# Copyright (C) 2012-2014 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 your option) any later version.
# This program is distributed in the hope that it wi... | itoed/anaconda | pyanaconda/ui/gui/xkl_wrapper.py | Python | gpl-2.0 | 14,761 |
import moe
from moe.easy_interface.experiment import Experiment
from moe.easy_interface.simple_endpoint import gp_next_points, gp_hyper_opt
import pymbar
import seaborn as sns
import scipy.interpolate
import pymc
import sklearn.gaussian_process
import os
import pandas as pd
import glob
keys = ["q0", "sigma0"]
data = p... | kyleabeauchamp/DBayes | dbayes/analysis/test_moe.py | Python | gpl-2.0 | 1,864 |
#!/usr/bin/env python
import sys
import os
import glob
import json
import re
from argparse import ArgumentParser
from argparse import RawDescriptionHelpFormatter
def init_report_dir(metadata_dir, report_name):
report_dir = metadata_dir + '/reports/' + report_name
if not os.path.exists(report_dir):
os... | ICGC-TCGA-PanCancer/pancancer-sandbox | pcawg_metadata_parser/pc_report-summary_counts.py | Python | gpl-2.0 | 5,377 |
import unicodedata
from django.core.files.storage import FileSystemStorage
class ASCIIFileSystemStorage(FileSystemStorage):
"""
Convert unicode characters in name to ASCII characters.
"""
def get_valid_name(self, name):
name = unicodedata.normalize('NFKD', name).encode('ascii', 'ignore')
... | agendaTCC/AgendaTCC | tccweb/utils/storage.py | Python | gpl-2.0 | 415 |
# This file is part of the Frescobaldi project, http://www.frescobaldi.org/
#
# Copyright (c) 2008 - 2014 by Wilbert Berendsen
#
# 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
... | shimpe/frescobaldi | frescobaldi_app/debuginfo.py | Python | gpl-2.0 | 2,835 |
class Solution:
# @param s, a string
# @return a boolean
def isPalindrome(self, s):
s = [x.lower() for x in s if x.isalpha() or x.isdigit()]
size = len(s)
for i in xrange(size):
if s[i] != s[size-1-i]:
return False
return True
if __name__ == "__ma... | kiddingmu/leetcode | 43_valid_palindrome/valid_palindrome.py | Python | gpl-2.0 | 509 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('home', '0001_initial'),
]
operat... | birkholz/homeboard | chores/migrations/0001_initial.py | Python | gpl-2.0 | 1,978 |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2014, 2015 CERN.
#
# Invenio is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any... | jmartinm/invenio-records | invenio_records/config.py | Python | gpl-2.0 | 1,717 |
# Copyright (C) 2008-2009 Open Society Institute
# Thomas Moroz: tmoroz@sorosny.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. You may not use, modify or distribu... | boothead/karl | karl/content/models/tests/test_forum.py | Python | gpl-2.0 | 4,533 |
#!/usr/bin/env python2.7
from flask import Flask, make_response, render_template, request
import simplejson
app = Flask(__name__)
G = {
"cmds": [],
"outputs": {}
}
@app.route("/")
def index():
return render_template("index.html")
@app.route("/emit", methods=["POST"])
def emit():
G["cmds"].append(re... | PeerXu/reflector | server/app.py | Python | gpl-2.0 | 982 |
# -*- coding: utf-8 -*-
#
# plugins/XBMCEventReceiver/__init__.py
#
# This file is a plugin for EventGhost.
# Copyright © 2005-2016 EventGhost Project <http://www.eventghost.net/>
#
# EventGhost is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published b... | WoLpH/EventGhost | plugins/XBMCEventReceiver/__init__.py | Python | gpl-2.0 | 8,990 |
#!/usr/bin/env python
"""xplot.py:
This program uses matplotlib to plot xplot like data.
Last modified: Thu Jul 23, 2015 04:54PM
"""
__author__ = "Dilawar Singh"
__copyright__ = "Copyright 2013, NCBS Bangalore"
__credits__ = ["NCBS Bangalore", "Bhalla Lab"]
__license__ ... | BhallaLab/benchmarks | moose_nrn_equivalence_testing/comparision_with_simple_HH_model/xplot.py | Python | gpl-2.0 | 2,472 |
__author__ = 'superben'
#Zone, SensorName, SensorLocation, SensorType, SensorState, Header, Pin, GPIO, Direction
Sensors={}
print("Opening file sensors.txt")
f=open('sensors.txt','r')
firstTime=True
for line in f:
#print(line)
lineSplit=line.split(',')
#print("Split: " + str(lineSplit))
... | bbqbailey/geeksHome | geeksHomeApp/load_Sensors.py | Python | gpl-2.0 | 728 |
#!/usr/bin/python
# gly19.py -- protein glycosylator
# 2016.10.05 -- first version -- John Saeger
# gly19 -- 2017.5.27
# This version complains about incomplete sidechains. You must fix them up.
# I use pymol's mutate wizard to mutate a residue to itself.
# This version has a slightly more sophisticated solvent exp... | aequorea/gly | versions/gly19.py | Python | gpl-2.0 | 8,326 |
#!/usr/bin/python
# -*- coding: utf8 -*-
"""
Copyright (C) 2012 Xycl
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This pr... | Xycl/plugin.image.mypicsdb | resources/lib/googlemaps.py | Python | gpl-2.0 | 6,409 |
import pytest
class TestPylint:
@pytest.mark.complete("pylint --v", require_longopt=True)
def test_1(self, completion):
assert completion
@pytest.mark.complete("pylint --confidence=HIGH,")
def test_2(self, completion):
assert completion
@pytest.mark.complete("pylint --help-msg=",... | scop/bash-completion | test/t/test_pylint.py | Python | gpl-2.0 | 786 |
from .... import base
from pulp.devel import mock_plugins
from pulp.plugins.conduits.dependency import DependencyResolutionConduit
from pulp.plugins.config import PluginCallConfiguration
from pulp.plugins.types import database, model
from pulp.server.db.model.criteria import UnitAssociationCriteria
from pulp.server.db.... | credativ/pulp | server/test/unit/server/managers/repo/test_dependency.py | Python | gpl-2.0 | 4,601 |
#
# Copyright (C) 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 your option) any later version.
# This program is distributed in the hope that it will be... | vritant/subscription-manager | src/initial-setup/com_redhat_subscription_manager/ks/rhsm_ks.py | Python | gpl-2.0 | 1,679 |
#!/usr/bin/python
import unittest
import os
import shutil
import logging
import sys
from avocado.utils import process
# simple magic for using scripts within a source tree
basedir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
if os.path.isdir(os.path.join(basedir, 'virttest')):
sys.path.append(b... | vipmike007/avocado-vt | selftests/unit/test_libvirt_xml.py | Python | gpl-2.0 | 46,682 |
from modules.py532lib.NFC import NFC as NFC
print ('Write UID')
#write .UID in current dir
UID_FILE = ".UID"
def write_uid(uid):
f = open(UID_FILE,'w')
print("Write UID : %s"%str(uid))
uid = f.write(str(uid))
f.close
NFC.stop()
def stop(uid):
NFC.stop()
NFC.add_event_detect(N... | belese/luciphone | Luciphone/writeuid.py | Python | gpl-2.0 | 431 |
#!/usr/bin/env python
# encoding: utf-8
#
# pmatic - Python API for Homematic. Easy to use.
# Copyright (C) 2016 Lars Michelsen <lm@larsmichelsen.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 Found... | LaMi-/pmatic | pmatic/api.py | Python | gpl-2.0 | 31,401 |
'''
Created on Feb 6, 2011
Decrypts student exam submission file.
author: (c)2011-2015 Peter Sander
'''
import os.path
import subprocess
def decrypt(paths, decryption_key):
'''
Decrypts submitted file.
'''
result = False
student = os.path.basename(paths['student'])
exam_file = paths['studen... | sanderator/lab-o-matic | src/lab_o_matic/decryptor.py | Python | gpl-2.0 | 731 |
##
# Copyright 2013-2019 Ghent University
#
# This file is triple-licensed under GPLv2 (see below), MIT, and
# BSD three-clause licenses.
#
# 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... | gppezzi/easybuild-framework | easybuild/toolchains/cgmvapich2.py | Python | gpl-2.0 | 1,589 |
import nengo
from nengo.dists import Uniform
import nstbot
import numpy as np
import joystick_node
import udp
import time
use_bot = False
if use_bot:
bot = nstbot.EV3Bot()
#bot.connect(nstbot.connection.Socket('192.168.1.160'))
bot.connect(nstbot.connection.Socket('10.162.177.187'))
time.sleep(1)
... | tcstewar/ev3_demo | udp_base.py | Python | gpl-2.0 | 3,050 |
#!/usr/bin/env python
# Copyright (C) 2014 Hogeschool van Amsterdam
# 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.
#... | sijmenvos/Uforia-browser | nodejs/build_index/uf_func/uf_admin.py | Python | gpl-2.0 | 1,899 |
# -*- coding: utf-8 -*-
from django import forms
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Submit, Layout, Div, Field, HTML
from crispy_forms.bootstrap import InlineRadios
class TextValidatorForm(forms.Form):
content = forms.CharField(widget=forms.Textarea, required=False)
fi... | open-contracting/validator | django/website/validator/forms.py | Python | gpl-2.0 | 1,886 |
###############################################################################
# Name: pike.py #
# Purpose: Define highlighting/syntax for Pike programming language #
# Author: Cody Precord <cprecord@editra.org> #
... | robmcmullen/peppy | editra.in/syntax/pike.py | Python | gpl-2.0 | 3,246 |
from django.core.urlresolvers import reverse
from rest_framework import status
from rest_framework.test import force_authenticate
from rest_framework.test import APITestCase
from rest_framework.test import APIRequestFactory
from beer_api.models import *
class TestGlassTypePost(APITestCase):
def test_auth_f... | aglassman/beer | django_beer/django_beer/tests.py | Python | gpl-2.0 | 1,261 |
##############################################
# File Name: module3.py
# Version: 1.0
# Team No.: 26
# Team Name:
# Date: 28 Oct 15
##############################################
import RPi.GPIO as GPIO
import time
import sys, tty, termios
print '\nHi, I am PiBot, your very own learning robot..\n'
GPIO.setmode(GPIO.... | konini-school/pibot26 | module3.py | Python | gpl-2.0 | 541 |
from . import app
from flask import render_template
@app.route('/')
def index():
return render_template('index.html') | Arcana/emoticharms.trade | app/views.py | Python | gpl-2.0 | 123 |
# coding: utf-8
from .base import *
DEBUG = True
TEMPLATE_DEBUG = DEBUG
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'openid-staging',
}
}
STATIC_ROOT = join(SITE_ROOT, '../webfiles-staging/static/')
| hacklabr/mapasculturais-openid | iddacultura/settings/staging.py | Python | gpl-2.0 | 270 |
from linked_list import LinkedList
class Stack(object):
def __init__(self, iterable=None):
self._list = LinkedList(iterable)
def push(self, val):
self._list.insert(val)
def pop(self):
return self._list.pop()
| HeyIamJames/Data_Structures | stack.py | Python | gpl-2.0 | 248 |
#!/usr/bin/env python
from setuptools import setup
setup(name='pgv',
version='0.0.2',
description="PostgreSQL schema versioning tool",
long_description=open("README.rst").read(),
author='Kirill Goldshtein',
author_email='goldshtein.kirill@gmail.com',
packages=['pgv', 'pgv.utils', '... | go1dshtein/pgv | setup.py | Python | gpl-2.0 | 968 |
# Terrain Data [ Tools ]
# -> PencilCurves [ ToolList ]
# -> Tool Data [ Radius, Distribution(Uniform(Min/Max), Gaussian(Mean, Falloff)), Scale(Min/max), Rotation(Min/Max), Offset, TypeData ]
# -> Type Data [ Density, (Scale, Rotation, Offset)Absolute, ObjectData ]
# -> Object Data [... | TomMinor/mesh-surface-spawner | FreeformAttributes.py | Python | gpl-2.0 | 15,123 |
#!/usr/bin/env python
# -*- coding: utf8 -*-
"""
SUNRISET.C - computes Sun rise/set times, start/end of twilight, and
the length of the day at any date and latitude
Written as DAYLEN.C, 1989-08-16
Modified to SUNRISET.C, 1992-12-01
(c) Paul Schlyter, 1989, 1992
Released to the public domain by Paul Sch... | bwduncan/Suncalendar | Sun.py | Python | gpl-2.0 | 19,058 |
from urlparse import urljoin
from os.path import dirname, basename
from xml.etree import ElementTree
from mimetypes import guess_type
from StringIO import StringIO
import requests
def update_print(apibase, password, print_id, progress):
"""
"""
params = {'id': print_id}
data = dict(progress=progress,... | stamen/fieldpapers | decoder/apiutils.py | Python | gpl-2.0 | 6,689 |
import sublime, sublime_plugin, sys, re, operator
## This class self-tests! Kind of. Run the CheckRef command over this file.
## It will then check itself. There are deliberate errors that it should find.
## See the comments next to the pandoc refs in python comments below.
footnote_insert = re.compile(r'(\[\^([a-zA-... | scotartt/PandocReferencr | PandocReferencr.py | Python | gpl-2.0 | 7,483 |
from django.db import models
from django.conf import settings
class BudgetItemManager(models.Manager):
def each_denormalized(self, additional_constraints=None, additional_arguments=None):
sql = \
"select " \
"fc.area, fc.policy, fc.function, fc.programme, " \
"e... | malon/presupuesto | budget_app/models/budget_item.py | Python | gpl-2.0 | 5,467 |
import logging
from django.contrib import messages
from django.contrib.auth import authenticate
from django.core.urlresolvers import reverse
from django.http.response import Http404, HttpResponseRedirect
from django.shortcuts import render, redirect, render_to_response
# Create your views here.
from django.template.co... | Crowdcomputer/CroCoAPI | ui/views.py | Python | gpl-2.0 | 3,534 |
# -*- encoding: utf-8 -*-
#
# Copyright 2013-2021 University of Oslo, Norway
#
# This file is part of Cerebrum.
#
# Cerebrum 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
... | unioslo/cerebrum | Cerebrum/modules/virthome/base.py | Python | gpl-2.0 | 29,202 |
# Django
from django.conf.urls import patterns, url
# local Django
from organization.views import OrganizationCreateView, OrganizationDeleteView, OrganizationListView, OrganizationUpdateView
urlpatterns = patterns(
'',
url(r'^create/$', OrganizationCreateView.as_view(), name='create'),
url(r'^delete/(?P<o... | kamsuri/vms | vms/organization/urls.py | Python | gpl-2.0 | 585 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2007 Johann Prieur <johann.prieur@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) an... | Kjir/papyon | papyon/service/description/RSI/GetMetadata.py | Python | gpl-2.0 | 1,488 |
func int suma(int a, int b)
return a+b
endfunc
func int absdif(int a, int b)
if(a>b)
return a-b
else
return b-a
endif
endfunc
int i, a, b,B[200], aux, A[100]
int z=suma(2*5+a,aux*A[0])-absdif(10000, 500)
int w=10, C[a/b**aux]
double x=0, y, z, pi=3.141592
a=0
b=1
A[0]=10
A[a+b]=pi**x
for(i=0,i<10,i+=1)
... | TachoMex/Compiladores-14b | Parser/compilador/programa.py | Python | gpl-2.0 | 888 |
# coding=utf-8
"""archive.py - Archive handling (extract/create) for Comix."""
from __future__ import absolute_import
import cStringIO
import os
import re
import sys
import tarfile
import threading
import zipfile
import gtk
try:
from py7zlib import Archive7z
except ImportError:
Archive7z = None # ignore it.... | Joacchim/Comix | src/archive.py | Python | gpl-2.0 | 20,550 |
#!/usr/bin/python
# Copyright (c) 2005--2010 Red Hat, Inc.
#
#
#
# $Id$
raise Exception("""
This test is no more valid; see the bug
https://bugzilla.redhat.com/show_bug.cgi?id=423351
""")
import os
import unittest
from spacewalk.server import rhnSQL
DB = 'rhnuser/rhnuser@webdev'
class ExecutemanyTest(unittest.Te... | colloquium/spacewalk | backend/server/test/unit-test/rhnSQL/test_executemany.py | Python | gpl-2.0 | 1,833 |
#!/usr/bin/python
# -- Content-Encoding: UTF-8 --
"""
Compass demo package
:author: Thomas Calmant
:copyright: Copyright 2013, isandlaTech
:license: GPLv2
:version: 0.1
:status: Alpha
"""
# Module version
__version_info__ = (0, 1, 0)
__version__ = ".".join(map(str, __version_info__))
# Documentation strings format
_... | tcalmant/demo-ipopo-qt | android/compass/__init__.py | Python | gpl-2.0 | 439 |
# -*- coding: utf-8 -*-
#
# Rule
#
# Blueprint for rule administration.
#
# Created by dp on 2014-12-25.
# ================================================================================ #
from flask.blueprints import Blueprint
from flask.globals import g
from wtforms.fields.core import SelectField
from wtforms.fields... | dpetter/Eowyne | src/core/administration/rules.py | Python | gpl-2.0 | 4,258 |
#!/usr/bin/python3
# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
from typing import Dict, Union, TypeVar, Iterable, Callable, Tuple,\
Optional
from math import log, ceil
import gdb
import crash
from crash.util import find_member_variant
from crash.util.symbols import Types, Symvals... | jeffmahoney/crash-python | crash/types/page.py | Python | gpl-2.0 | 10,946 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#----------------------------------------------------------------------------------------------------------------------*
#
# Options for all compilers
#
#----------------------------------------------------------------------------------------------------------------------*... | TrampolineRTOS/trampoline | goil/build/libpm/python-makefiles/default_build_options.py | Python | gpl-2.0 | 3,374 |
import requests
URL = "http://phpnote.chal.ctf.westerns.tokyo/"
def trigger(c, idx):
import string
sess = requests.Session()
# init session
sess.post(URL + '/?action=login', data={'realname': 'new_session'})
# manipulate session
p = '''<script>f=function(n){eval('X5O!P%@AP[4\\\\PZX54(P^)7CC)7... | Qwaz/solved-hacking-problem | TWCTF/2019/php_note/solver.py | Python | gpl-2.0 | 982 |
#!/usr/bin/python
'''
nctu_cs_wired_topo.gy
'''
from mininet.cluster.net import MininetCluster
from mininet.cluster.placer import DFSPlacer
from mininet.log import setLogLevel
from mininet.cluster.cli import ClusterCLI as CLI
from mininet.node import Controller, RemoteController
from mininet.topo import Topo
from iter... | pichuang/OpenNet | mininet-patch/examples/cluster/nctu_ec_wired_topo.py | Python | gpl-2.0 | 3,067 |
from django.core.management.base import BaseCommand, CommandError
from django.core.management import call_command
from django.core import serializers
from django.db.models.loading import get_model
from dashboard import models
import re, os, sys
class Command(BaseCommand):
args = 'system_model [system_id]'
help = 'Ex... | AWegnerGitHub/IRVING | irving/dashboard/management/commands/exportirvingdata.py | Python | gpl-2.0 | 2,221 |
import numpy as np
import warnings
def mean_time(t, min_threshold=0, max_threshold=1253):
"""
Take a switch probability result array from the PreAmp timer, and
compute mean switching time using the specified thresholds. Timing
data is assumed to be a numpy array.
"""
t = t[np.logical_and(t... | McDermott-Group/LabRAD | LabRAD/Measurements/General/data_processing.py | Python | gpl-2.0 | 2,679 |
# Copyright (c) 2004-2007 Bartek Wilczynski and Norbert Dojer; All Rights Reserved.
#
# This software is distributable under the terms of the GNU
# General Public License (GPL) v2, the text of which can be found at
# http://www.gnu.org/copyleft/gpl-2.0.txt. Installing, importing or otherwise
# using this module constit... | sysbio-vo/bnfinder | BNfinder/BDE.py | Python | gpl-2.0 | 3,700 |
from django import template
from django.urls.base import reverse
from urllib.parse import urljoin, parse_qsl, urlencode, unquote
register = template.Library()
class Number:
def __init__(self, number=None, url=None, current=None):
self.number = number
self.url = url
self.active = 'active'... | botswana-harvard/edc-dashboard | edc_dashboard/templatetags/edc_dashboard_extras.py | Python | gpl-2.0 | 3,196 |
from model_test_setup import ModelTestSetup
test_args = ['MOM_solo', 'MOM_SIS', 'EBM', 'CM2M', 'ESM2M', 'ICCM',
'ACCESS-CM', 'ACCESS-OM']
class TestBuild(ModelTestSetup):
"""
Build all model types.
"""
def __init__(self):
super(TestBuild, self).__init__()
def check_build(se... | ars599/mom5 | test/test_build.py | Python | gpl-2.0 | 483 |
#!/usr/bin/python2.7
from nassl._nassl import SSL
from SslClient import SslClient
class DebugSslClient(SslClient):
"""
An SSL client with additional debug methods that no one should ever use (insecure renegotiation, etc.).
"""
def get_secure_renegotiation_support(self):
return self._ssl.get_... | ZenSecurity/nassl | src/DebugSslClient.py | Python | gpl-2.0 | 3,283 |
import pytest
from cfme.cloud.provider.azure import AzureProvider
from cfme.cloud.provider.ec2 import EC2Provider
from cfme.cloud.provider.openstack import OpenStackProvider
from cfme.networks.provider import NetworkProviderCollection
from cfme.utils import testgen
from cfme.utils.appliance.implementations.ui import na... | okolisny/integration_tests | cfme/tests/networks/test_sdn_crud.py | Python | gpl-2.0 | 1,613 |
import unittest
from PyGravity import PyGravity, round_sig, Particle, Physics, Data_IO
from math import sqrt
import numpy as np
import sys
'''
Unit Tests for PyGravity. These Unit tests will run tests against the
installed PyGravity module and not against the source files in this
package. So if you modify source, you... | russloewe/PyGravity | tests/test.py | Python | gpl-2.0 | 17,139 |
"""
CommentGenerator.py
Author: Zefu Lu (zefulu2)
Description: This Module generates comments and add it to the database
Creation: 2014-11-4
"""
#===============================================================================
# import references
#=======================================================================... | kaihuang201/opinion | appopinion/CommentGenerator.py | Python | gpl-2.0 | 1,938 |
from kkross.exceptions import ModuleError, LoaderError
from kkross.module import Module
from glob import glob
from yaml import safe_load
import os
def module_loader(module_dirs):
'''Loads module YAML from ...'''
module_paths = []
for module_dir in module_dirs:
module_paths.extend(glob(os.path.jo... | Doctor-love/kkross | playground/kkross/modules/module_loader.py | Python | gpl-2.0 | 919 |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# 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 distrib... | 50thomatoes50/blender.io_mqo | io_scene_mqo/__init__.py | Python | gpl-2.0 | 8,539 |
import json
import numpy as np
import pytest
from pylato.electronic import Electronic, num_swaps_to_sort
from pylato.exceptions import UnimplementedMethodError
from pylato.init_job import InitJob
from pylato.main import execute_job
from tests.conftest import load_json_file
@pytest.mark.parametrize(
("array", "e... | mec07/PyLATO | tests/pylato/test_electronic.py | Python | gpl-2.0 | 17,499 |
#! /usr/bin/env python
# encoding: utf-8
import sys
if sys.hexversion < 0x020400f0: from sets import Set as set
import TaskGen,Task,Utils
from Logs import debug
import ccroot
from TaskGen import feature,before,extension,after
g_cxx_flag_vars=['CXXDEPS','FRAMEWORK','FRAMEWORKPATH','STATICLIB','LIB','LIBPATH','LINKFLAGS'... | diedthreetimes/VCrash | pybindgen-0.15.0.795/.waf-1.5.9-0c853694b62ef4240caa9158a9f2573d/wafadmin/Tools/cxx.py | Python | gpl-2.0 | 2,783 |
# -*- coding: utf-8 -*-
#
# Project of Information-Theoretic Modeling documentation build configuration file, created by
# sphinx-quickstart on Fri Dec 12 14:45:52 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present i... | assamite/itm_project | docs/source/conf.py | Python | gpl-2.0 | 8,919 |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: t -*-
# vi: set ft=python sts=4 ts=4 sw=4 noet :
# This file is part of Fail2Ban.
#
# Fail2Ban 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;... | yarikoptic/fail2ban | fail2ban/server/filtersystemd.py | Python | gpl-2.0 | 8,738 |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2.
# Infinitepush Bundle Store
"""store for infinitepush bundles"""
import hashlib
import os
import subprocess
from tempfile import NamedTemporaryFile
fr... | facebookexperimental/eden | eden/hg-server/edenscm/hgext/infinitepush/bundlestore.py | Python | gpl-2.0 | 6,167 |
# Copyright 2004-2013 Joe Wreschnig, Michael Urman, Niklas Janlert,
# Steven Robertson, Nick Boultbee
#
# 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 th... | ptitjes/quodlibet | quodlibet/formats/_id3.py | Python | gpl-2.0 | 17,996 |
# This file is part of OtfBot.
#
# OtfBot 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.
#
# OtfBot is distributed in the hope that it... | Farthen/OTFBot | otfbot/plugins/ircClient/karma.py | Python | gpl-2.0 | 7,588 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2010-2016 Red Hat, Inc.
#
# Authors:
# Thomas Woerner <twoerner@redhat.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the Li... | hos7ein/firewalld | src/firewall/server/firewalld.py | Python | gpl-2.0 | 109,845 |
# -*- coding: utf-8 -*-
#
# Copyright © 2014-2017 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 your option) any later
# version. This program is distributed... | pombredanne/anitya | anitya/tests/base.py | Python | gpl-2.0 | 6,973 |
#!/usr/bin/env python
#
# Copyright (c) 2009 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | 24OI/CodeStack | cpplint.py | Python | gpl-2.0 | 241,962 |
#
# Medal of Honor Parser for BigBrotherBot(B3) (www.bigbrotherbot.net)
# Copyright (C) 2010 James 'Bakes' Baker (bakes@bigbrotherbot.net)
#
# 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; eithe... | AusTac/parma | b3/parsers/moh.py | Python | gpl-2.0 | 24,337 |
'''
Copyright (C) 2016 Quinn D Granfor <spootdev@gmail.com>
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... | MediaKraken/mkarchive | network_base_string_weblog.py | Python | gpl-2.0 | 4,025 |
# -*- coding: utf-8 -*-
# __init__.py
#
# Copyright (C) 2007 - Guillaume Desmottes
#
# 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.
#... | paulbellamy/Rhythmbox-iPod-Plugin | plugins/jamendo/jamendo/__init__.py | Python | gpl-2.0 | 4,882 |
#QLinearGradient myGradient;
#QPen myPen;
#QPolygonF myPolygon;
#QPainterPath myPath;
#myPath.addPolygon(myPolygon);
#QPainter painter(this);
#painter.setBrush(myGradient);
#painter.setPen(myPen);
#painter.drawPath(myPath);
import math
from PyQt5 import QtCore, QtGui, QtWidgets
class ArrowItem(QtWidgets.... | chiamingyen/PythonCAD_py3 | Interface/Entity/arrowitem.py | Python | gpl-2.0 | 1,388 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.