code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
##
## This file is part of the sigrok-meter project.
##
## Copyright (C) 2014 Jens Steinhauser <jens.steinhauser@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... | swegener/sigrok-meter | datamodel.py | Python | gpl-3.0 | 8,443 |
import core
from pydoc import help
def test_save_file():
print(core.save_file("http://uva.onlinejudge.org/images/banners/cp3_small.png"))
print(core.save_file("http://uva.onlinejudge.org/images/banners/cp3_small.png",altname="tester.png"))
def test_all_links():
for link in core.all_links("http://www.farsne... | RRostami/Spiderpy | spiderpy/test.py | Python | gpl-3.0 | 385 |
import logging
import os
from jinja2 import Environment, FileSystemLoader
from bottle import TEMPLATE_PATH
def make_templates_path(root):
return root + os.sep + 'templates'
system_templates_path = make_templates_path(os.path.dirname(__file__))
template_path = [system_templates_path]
TEMPLATE_PATH.insert(0, syst... | moses-rolston/err | errbot/templating.py | Python | gpl-3.0 | 1,524 |
# -*- coding: utf-8 -*-
import psycopg2
from psycopg2.extensions import register_adapter, adapt, AsIs
from psycopg2.extras import CompositeCaster, register_composite
import re
from typing import Any, ClassVar, Dict
from django import forms
from django.contrib.postgres.fields import ArrayField
from django.contrib.post... | tomka/CATMAID | django/applications/catmaid/fields.py | Python | gpl-3.0 | 15,358 |
#!/usr/bin/python
from multiprocessing import Pool
import time
import os
import sys
import argparse
from homolog4 import *
from collections import defaultdict
# Copyright(C) 2014 David Ream
# Released under Biopython license. http://www.biopython.org/DIST/LICENSE
# Do not remove this comment
# This exists to make t... | reamdc1/gene_block_evolution_old | loci_filtering.py | Python | gpl-3.0 | 8,117 |
import argiope as ag
import numpy as np
import pandas as pd
from matplotlib.tri import Triangulation
mesh = ag.mesh.read_msh("demo.msh")
conn = mesh.split("simplices").unstack()
coords = mesh.nodes.coords.copy()
node_map = pd.Series(data = np.arange(len(coords)), index = coords.index)
conn = node_map.loc[conn.values.... | lcharleux/argiope | argiope/tests/mesh/triangulation.py | Python | gpl-3.0 | 1,193 |
# -*- coding: utf-8 -*-
import os
import pkg_resources
from liam2.simulation import Simulation
def test_liam2_demo_files():
liam2_demo_directory = os.path.join(
pkg_resources.get_distribution('liam2').location,
'..',
'tests',
'examples'
)
excluded_files = [
... | AlexisEidelman/Til | til/tests/test_liam2.py | Python | gpl-3.0 | 1,074 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2018-09-15 15:45
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('gestioneide', '0049_auto_20180516_2118'),
]
operations = [
migrations.AddFie... | Etxea/gestioneide | gestioneide/migrations/0050_auto_20180915_1745.py | Python | gpl-3.0 | 721 |
# coding=utf-8
# Copyright 2006-2009 Scott Horowitz <stonecrest@gmail.com>
# Copyright 2009-2014 Jonathan Ballet <jon@multani.info>
#
# This file is part of Sonata.
#
# Sonata 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 Softwa... | deprint/sonata | sonata/about.py | Python | gpl-3.0 | 9,748 |
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible 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) an... | dochang/ansible | lib/ansible/constants.py | Python | gpl-3.0 | 20,345 |
# -*- coding: utf-8 -*-
"""
Internal command codes used in FICS block mode
(see "help block_codes" and "help iv_block").
Used mostly by internal library functions.
BLOCK_ variables are message boundary markers.
BLKCMD_ variables are command codes.
"""
BLOCK_START = chr(21) # \U
BLOCK_SEPARATOR = chr(22) #... | btrent/knave | pychess/ic/block_codes.py | Python | gpl-3.0 | 4,351 |
""" The FileCatalogClient is a class representing the client of the DIRAC File Catalog
"""
import os
from DIRAC import S_OK, S_ERROR
from DIRAC.Core.DISET.TransferClient import TransferClient
from DIRAC.Core.Security.ProxyInfo import getVOfromProxyGroup
from DIRAC.ConfigurationSystem.Client.Helpers.Registry import g... | arrabito/DIRAC | Resources/Catalog/FileCatalogClient.py | Python | gpl-3.0 | 24,012 |
# -*- 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):
pass
def backwards(self, orm):
pass
models = {
}
... | thejeshgn/quest | quest/migrations/0001_initial.py | Python | gpl-3.0 | 349 |
"""Tests for reading and writing problems and solutions."""
import tempfile
import unittest
from glpk import LPX
class WriteTests(unittest.TestCase):
"""A simple suite of tests for this problem.
max (x+y) subject to
0.5*x + y <= 1
0 <= x <= 1
0 <= y <= 1
This should have optimal solution x... | bradfordboyle/pyglpk | tests/readwrite_test.py | Python | gpl-3.0 | 7,050 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Part of the PsychoPy library
# Copyright (C) 2009 Jonathan Peirce
# Distributed under the terms of the GNU General Public License (GPL).
from __future__ import absolute_import, print_function
# from future import standard_library
# standard_library.install_aliases()
fr... | hoechenberger/psychopy | psychopy/app/coder/coder.py | Python | gpl-3.0 | 120,634 |
from dataclasses import replace
from lbmpy_walberla import generate_alternating_lbm_sweep, generate_boundary, generate_alternating_lbm_boundary
from pystencils_walberla import CodeGeneration, generate_sweep, generate_info_header
from pystencils import Target, CreateKernelConfig
from lbmpy import LBMConfig, LBMOptimis... | lssfau/walberla | tests/lbm/codegen/InplaceStreamingCodegen.py | Python | gpl-3.0 | 4,302 |
#!/usr/bin/python
"""
Starter code for the validation mini-project.
The first step toward building your POI identifier!
Start by loading/formatting the data
After that, it's not our code anymore--it's yours!
"""
import pickle
import sys
sys.path.append("../tools/")
from feature_format import featur... | yavuzovski/playground | machine learning/Udacity/ud120-projects/validation/validate_poi.py | Python | gpl-3.0 | 1,149 |
#!/usr/bin/python
from tldextract.tldextract import LOG
from NPSpyder import NPSpyder
from NPSpyderBR import NPSpyderBR
import logging
import re
import gc
logging.basicConfig(level=logging.CRITICAL)
total = 0
# Brazil
#--------------------------
# Build Estadao: Working, last revision on 02/10/2020
try:
estadaoR... | brvnl/master | crawler/RetrieveArticles.BR.py | Python | gpl-3.0 | 8,484 |
################################################################################
# copyright 2010 Lucas Baudin <xapantu@gmail.com> #
# #
# This file is part of Ultimate Smash Friends. ... | tshirtman/ultimate-smash-friends | usf/screens/network_game_conf_screen.py | Python | gpl-3.0 | 6,713 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
from PyQt5 import QtWidgets
from python_package.mainwindowex import MainWindowEx
from python_package.ui.parkmanager_rc import *
rootdir = os.getcwd()
cfgfile = os.path.join(rootdir, "settings.cfg")
if __name__ == "__main__":
# verify if cfgfile ex... | Chip000/ParkManager | ParkManager/main.py | Python | gpl-3.0 | 683 |
import sys, os, csv, pprint, math
from collections import OrderedDict
import numpy as np
import random
import shutil
import math
import matplotlib
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import scipy.stats
import itertools
from matplotlib.colors import ListedColormap, NoNorm
from matplo... | roshantha9/AbstractManycoreSim | src/analyse_results/AnalyseResults_ExecutionCosts.py | Python | gpl-3.0 | 14,740 |
from functions import global_functions
def debug_step_here():
"""
Creates a Breakpoint when executed in debug-mode
:return:
"""
if global_functions.get_config_key("debug"):
try:
input("Press any key to continue")
except SyntaxError:
pass
def print_out_var... | Fahrenholz/maat-analyzer | functions/debugging_functions.py | Python | gpl-3.0 | 537 |
# Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source
# & Institut Laue - Langevin
# SPDX - License - Identifier: GPL - 3.0 +
from __future__ import (absolute_import, divi... | mganeva/mantid | Framework/PythonInterface/test/python/plugins/algorithms/FitGaussianTest.py | Python | gpl-3.0 | 2,677 |
import os
import sys
import locale
import warnings
import configparser
from pathlib import Path
from textwrap import dedent
from flask import Flask
LOCALE = ('fr_FR', 'UTF-8')
STATIC_DIR = Path(__file__).absolute().parent / 'static'
UPLOAD_DIR = STATIC_DIR / 'upload'
try:
locale.setlocale(locale.LC_ALL, LOCALE... | PnMercantour/autorisations_circulation | auth_circu/conf.py | Python | gpl-3.0 | 3,368 |
#!/usr/bin/python
"""
mediatum - a multimedia content repository
Copyright (C) 2007 Arne Seifert <seiferta@in.tum.de>
Copyright (C) 2007 Matthias Kramm <kramm@in.tum.de>
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 ... | mediatum/mediatum | core/athana.py | Python | gpl-3.0 | 85,188 |
'''
Task Coach - Your friendly task manager
Copyright (C) 2004-2013 Task Coach developers <developers@taskcoach.org>
Task Coach 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
... | TaskEvolution/Task-Coach-Evolution | taskcoach/taskcoachlib/widgets/__init__.py | Python | gpl-3.0 | 1,717 |
# -*- coding: utf-8 -*-
#
# Rackspace Developer Documentation documentation build configuration file,
# created by sphinx-quickstart on Thu Mar 6 14:14:55 2014.
#
# 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
#... | RobinJoe/Docs | doc/conf.py | Python | gpl-3.0 | 8,757 |
# ptext module: place this in your import directory.
# ptext.draw(text, pos=None, **options)
# Please see README.md for explanation of options.
# https://github.com/cosmologicon/pygame-text
from __future__ import division
from math import ceil, sin, cos, radians, exp
import pygame
DEFAULT_FONT_SIZE = 2... | gentooza/Freedom-Fighters-of-Might-Magic | src/gamelib/gummworld2/pygametext.py | Python | gpl-3.0 | 21,402 |
import csv
import os
from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import reverse_lazy
from django.utils.decorators import method_decorator
from django.db import models
from converter.exceptions import UploadException
from .models import SystemSource, Reference, Referenc... | valentine20xx/portal | converter/utils.py | Python | gpl-3.0 | 2,852 |
# -*- coding: utf-8 -*-
from resources.lib.handler.jdownloaderHandler import cJDownloaderHandler
from resources.lib.download import cDownload
from resources.lib.handler.hosterHandler import cHosterHandler
from resources.lib.gui.gui import cGui
from resources.lib.gui.guiElement import cGuiElement
from resources.lib.hand... | mmllnr/plugin.video.xstream | resources/lib/gui/hoster.py | Python | gpl-3.0 | 8,657 |
"""
Copyright 2011-2014-2012 Kyle Lancaster
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 program is distributed in the... | EdFarrell/MilkMachine | src/MilkMachine/simplekml/styleselector.py | Python | gpl-3.0 | 6,912 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Script to search vcf files for mutations within specific coordinates
# Input:
# -A vcf file
#
# Output:
# -A Roary-like file with mutations sorted in rows, strains as columns and presence/absence in cells
# -Columns: Chromosome, Position, variant (eg C->T), type (eg mis... | AdmiralenOla/Scoary | scoary/vcf2scoary.py | Python | gpl-3.0 | 8,390 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-04-03 23:48
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('users', '0003_auto_20160403... | nborkowska/kpir2 | kpir2/users/migrations/0004_auto_20160403_2348.py | Python | gpl-3.0 | 581 |
# coding=utf-8
from __future__ import print_function
from __future__ import unicode_literals
from tornado.websocket import WebSocketHandler
clients = []
backlogged_msgs = []
def push_to_web_socket(msg):
if len(clients):
for client in clients:
client.write_message(msg)
else:
# No... | fernandog/Medusa | medusa/ws/MedusaWebSocketHandler.py | Python | gpl-3.0 | 1,018 |
import unittest
from models.words import Word
class SaddamTest(unittest.TestCase):
def test_get_word(self):
word_class = Word()
word = word_class.generar_palabra()
self.assertEqual('MORIN', word) | dimh/saddam | test/words_test.py | Python | gpl-3.0 | 224 |
#!/usr/bin/env python3
"""Lalikan
=======
Backup scheduler for Disk ARchive (DAR)
Copyright (c) 2010-2019 Dr. Martin Zuther (http://www.mzuther.de/)
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 Sof... | mzuther/lalikan | src/Lalikan.py | Python | gpl-3.0 | 7,043 |
import numpy as np
###############################################################################
## Surface Area
## ---------------------------------
## Planar polygon
###############################################################################
# Theorem of Green
#------------------------------------------------... | matt77hias/Clipping | src/surfacearea.py | Python | gpl-3.0 | 2,427 |
from os import path
import matplotlib.pyplot as plt
from samri.plotting.aggregate import registration_qc
from samri.typesetting import inline_anova
this_path = path.dirname(path.realpath(__file__))
data_dir = path.join(this_path,"../../example_data/")
df_path = path.join(data_dir,"f_reg_quality.csv")
plt.style.use(p... | damaggu/SAMRI | samri/examples/2017-09_aic-pom.py | Python | gpl-3.0 | 774 |
# ../gungame/plugins/included/gg_reload/info.py
"""Contains plugin information."""
# =============================================================================
# >> IMPORTS
# =============================================================================
# GunGame
from gungame.core.plugins.info import GunGamePluginI... | GunGame-Dev-Team/GunGame-SP | addons/source-python/plugins/gungame/plugins/included/gg_reload/info.py | Python | gpl-3.0 | 538 |
import logging
log = logging.getLogger(__name__)
class UI:
def status(self, message: str) -> None:
log.info(message)
def warning(self, message: str) -> None:
log.warn(message)
def error(self, message: str) -> None:
log.error(message)
| kedder/ofxstatement | src/ofxstatement/ui.py | Python | gpl-3.0 | 275 |
from __future__ import (
absolute_import,
division,
print_function,
unicode_literals,
)
import os
import socket
import subprocess
import sys
import core
from core import logger, version_check, APP_FILENAME, SYS_ARGV
if os.name == 'nt':
from win32event import CreateMutex
from win32api import C... | clinton-hall/nzbToMedia | core/utils/processes.py | Python | gpl-3.0 | 3,534 |
# -*- coding: utf-8 -*-
from __future__ import division
from odoo import api, fields, models
class A(models.Model):
_name = 'test_testing_utilities.a'
_description = 'Testing Utilities A'
f1 = fields.Char(required=True)
f2 = fields.Integer(default=42)
f3 = fields.Integer()
f4 = fields.Integer(... | t3dev/odoo | odoo/addons/test_testing_utilities/models.py | Python | gpl-3.0 | 6,753 |
import numpy as np
from scipy.signal import fftconvolve
from . import Tools
from .Filter import Filter
class Filter_Rect_LogSpaced(Filter) :
"""
This class defines a function of time expanded using log-spaced rectangular basis functions.
A filter f(t) is defined in the form f(t) = sum_j b_j*rect_j(t),
... | awakenting/gif_fitting | fitgif/Filter_Rect_LogSpaced.py | Python | gpl-3.0 | 7,817 |
"""
Fitting example: simultaneous fit of two datasets
"""
import numpy as np
import matplotlib
from matplotlib import pyplot as plt
import bornagain as ba
from bornagain import deg, angstrom, nm
def get_sample(params):
"""
Returns a sample with uncorrelated cylinders and pyramids.
"""
radius_a = para... | gpospelov/BornAgain | Examples/fit52_Advanced/multiple_datasets.py | Python | gpl-3.0 | 6,791 |
#!/usr/bin/env python
"""
crate_anon/crateweb/config/urls.py
===============================================================================
Copyright (C) 2015-2021 Rudolf Cardinal (rudolf@pobox.com).
This file is part of CRATE.
CRATE is free software: you can redistribute it and/or modify
it under... | RudolfCardinal/crate | crate_anon/crateweb/config/urls.py | Python | gpl-3.0 | 18,507 |
#!/usr/bin/python3 -u
# vim: set tabstop=4 shiftwidth=4 softtabstop=4 expandtab textwidth=80 smarttab
#
# stdin -> IRC echo bot, with optional file input support.
#
# Written by Kate Turner <kate.turner@gmail.com>, source is in the public
# domain.
# Modified by Ryan Lane <rlane@wikimedia.org> for watching and taking i... | miraheze/puppet | modules/monitoring/files/bot/ircecho.py | Python | gpl-3.0 | 9,009 |
'''
Created on 20/10/2014
@author: fer
'''
if __name__ == '__main__':
print('hola')
x=32 #entero
print x
# variable mensaje
mensaje = "hola mundo"
print mensaje
#booleano
my_bool=True
print my_bool
#exponentes
calculo = 10**2
print calculo
print ("La va... | arkadoel/AprendiendoPython | PrimerosPasos/dos.py | Python | gpl-3.0 | 579 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Minimal web interface to cve-search to display the last entries
# and view a specific CVE.
#
# Software is free software released under the "Modified BSD license"
#
# Copyright (c) 2017 Pieter-Jan Moreels - pieterjan.moreels@gmail.com
# imports
import json
import os... | deontp/misc | zenoic_api/cve-search-master/web/advanced_api.py | Python | gpl-3.0 | 7,190 |
# Source: http://blog.miguelgrinberg.com/post/designing-a-restful-api-with-python-and-flask
from flask import Flask, jsonify, abort, make_response
app = Flask(__name__)
tasks = [
{
'id': 1,
'title': u'Buy groceries',
'description': u'Milk, Cheese, Pizza, Fruit, Tylenol',
'done': ... | ardinusawan/Sistem_Terdistribusi | Web-Service/RESTful/referensi/restful-hudan/tasks-2.py | Python | gpl-3.0 | 881 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
@author: Mindaugas Greibus
trancriber mg1.4
'''
import sys, re
import collections
class TranscriberRegexp:
# http://cmusphinx.sourceforge.net/wiki/tutorialam
# Do not use case-sensitive variants like “e” and “E”. Instead, all your phones must be different even in c... | mondhs/heroku_test | transcriber_re_mg14.py | Python | gpl-3.0 | 7,933 |
# -*- coding: utf-8 -*-
import settings
import random
import vk_api
from BotException import BotException
class Interface:
vk = None
vk_service = None
dynamic_settings = dict()
def __init__(self, vk, vk_service, dynamic_settings):
self.vk = vk
self.dynamic_settings = dynamic_settings
... | sergak01/Vk_bot | interface/search.py | Python | gpl-3.0 | 4,870 |
import numpy as np
import h5py
f = h5py.File('hdf5/data_streaming.h5', 'w')
ADSL_2008 = f.create_group("ADSL_Montsouris_2008_07_01")
# retreve: ADSL_2008 = f['ADSL_Montsouris_2008_07_01']
gvb_adsl_2008 = np.load('python_flows/flows_marked_GVB_juill_2008_ADSL_cut_BGP_AS.npy')
ADSL_2008.create_dataset('GVB', data=gvb_... | LouisPlisso/analysis_tools | old_create_hdf5_data_non_interacif.py | Python | gpl-3.0 | 2,240 |
# Prints exactly what the script is about to do
print "How many keys are there for the swedish alphabet?"
# Prints the amount of the top row
print "The top row has 11 letter keys"
# Assigns a value to top
top = 11.0
# Prints the amount of the middle row
print "The middle row has 11 letter keys"
# Assigns a value to... | seravok/LPTHW | StudyDrillMath.py | Python | gpl-3.0 | 590 |
import os
import stat
from mimetypes import guess_type
from rest_framework import serializers
from hav.utils.imaginary import generate_thumbnail_url, generate_srcset_urls
from hav.utils.exif import get_exif_data
import logging
logger = logging.getLogger(__name__)
def is_hidden(fn):
return fn.startswith(".")
c... | whav/hav | src/hav/apps/sources/filesystem/api/serializers.py | Python | gpl-3.0 | 4,892 |
from PyQt4 import QtGui, QtCore
class MyWindow(QtGui.QDialog): # any super class is okay
def __init__(self, parent=None):
super(MyWindow, self).__init__(parent)
self.button = QtGui.QPushButton('Press')
layout = QtGui.QHBoxLayout()
layout.addWidget(self.button)
self.setLay... | vleo/vleo-notebook | testPyQT/testNewWindow.py | Python | gpl-3.0 | 695 |
info=[]
for line in open('./info_mappable_50.txt').read().rstrip().split('\n'):
a=line.split('\t')
info.append(a[0])
line_out=''
line_out2=''
seq=''
index=0
for line in open('./seqList_mappable_50.fa'):
if line[0]=='>':
if seq:
replace=seq[7:-7]
if replace!=ref:
... | wzhang1984/Noncoding-tumor-mutation-paper | motif_analysis/ref2alt.py | Python | gpl-3.0 | 1,057 |
# -*- coding: utf-8 -*-
#
# This file is part of the VecNet OpenMalaria Portal.
# For copyright and licensing information about this package, see the
# NOTICE.txt and LICENSE.txt files in its top-level directory; they are
# available at https://github.com/vecnet/om
#
# This Source Code Form is subject to the terms of t... | vecnet/om | website/apps/ts_om/tests/utils/test_scenario_name_with_next_number.py | Python | mpl-2.0 | 1,719 |
from setuptools import setup, find_packages
import os
VERSION = "0.8.1"
CLASSIFIERS = [
'Environment :: Console',
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)',
'Operating System :: OS Independent'... | xrmx/pylokit | setup.py | Python | mpl-2.0 | 1,072 |
"""
WSGI config for medlem project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/
"""
import os
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'medlem.settings') # NOQA
# from django... | mozilla/medlem | medlem/wsgi.py | Python | mpl-2.0 | 1,039 |
from django.test import TestCase, Client
from django.shortcuts import get_object_or_404
from metronus_app.model.company import Company
from metronus_app.model.employee import Employee
from metronus_app.model.administrator import Administrator
from django.contrib.auth.models import User
from metronus_app.model.employeeL... | Metronus/metronus | Metronus-Project/metronus_app/test/testEmployee.py | Python | mpl-2.0 | 38,963 |
# Test script. Tests GUI scroll movement commands.
# Created by Toni Sagrista
from gaia.cu9.ari.gaiaorbit.script import EventScriptingInterface
gs = EventScriptingInterface.instance()
gs.disableInput()
gs.cameraStop()
gs.setGuiScrollPosition(20.0)
gs.sleep(1)
gs.setGuiScrollPosition(40.0)
gs.sleep(1)
gs.setGuiScro... | vga101/gaiasky | assets/scripts/tests/scroll-test.py | Python | mpl-2.0 | 452 |
"""
API implemented using Google Cloud Endpoints on :class:`.Anno` model
.. http:get:: /anno/1.0/anno/(id)
``anno.anno.get`` - Get the details for a specific anno
:param int id: id of the anno
:returns: details of the anno :class:`.AnnoResponseMessage`
.. http:get:: /anno/1.0/anno
``anno.anno.lis... | usersource/anno | anno_gec_server/api/anno_api.py | Python | mpl-2.0 | 18,371 |
import unittest
from leetcode.s2_add_two_numbers import Solution, ListNode
class TestAddTwoNumbers(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.solution = Solution().addTwoNumbers
def test_default_case(self):
l1 = ListNode(2)
l1.next = ListNode(4)
l1.next.next... | yeukhon/algorithm | leetcode/tests/test_2_add_two_numbers.py | Python | mpl-2.0 | 1,220 |
import shutil
from django.http import HttpResponseServerError
from django.shortcuts import render
from run.models import Run
from run.tasks import run_afl, PY_AFL_FUZZ_CMD
def trigger_run(request):
if not shutil.which(PY_AFL_FUZZ_CMD):
return HttpResponseServerError()
run = Run.objects.create()
... | frewsxcv/lop.farm | app/run/views.py | Python | mpl-2.0 | 592 |
{
'repo_type' : 'git',
'url' : 'https://github.com/DeadSix27/python_mingw_libs.git',
'needs_configure' : False,
'needs_make_install' : False,
'build_options' : 'PREFIX={target_prefix} GENDEF={mingw_binpath}/gendef DLLTOOL={mingw_binpath}/{cross_prefix_bare}dlltool',
'_info' : { 'version' : '3.8.2', 'fancy_name' :... | DeadSix27/python_cross_compile_script | packages/dependencies/python3_libs.py | Python | mpl-2.0 | 349 |
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2018, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | neuroidss/nupic.research | tests/regions/location_region_test.py | Python | agpl-3.0 | 11,848 |
"""
gw2copilot/utils.py
The latest version of this package is available at:
<https://github.com/jantman/gw2copilot>
################################################################################
Copyright 2016 Jason Antman <jason@jasonantman.com> <http://www.jasonantman.com>
This file is part of gw2copilot.
... | jantman/gw2copilot | gw2copilot/utils.py | Python | agpl-3.0 | 5,105 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution Addon
# Copyright (C) 2009-2013 IRSID (<http://irsid.ru>),
# Paul Korotkov (korotkov.paul@gmail.com).
#
# This program is free software: you can redistribute it... | prospwro/odoo | addons/irsid_edu/models/module_work.py | Python | agpl-3.0 | 13,057 |
#!/usr/bin/env python2.7
import click
from common import KGC_PORT
from server import KgcRpcServer
import privipk
from privipk.keys import LongTermSecretKey
@click.group()
def cli():
"""
Use this tool to spawn a KGC server and/or to generate
a private key for a KGC server.
"""
pass
@cli.command(... | PriviPK/privipk-sync-engine | kgc/kgc-service.py | Python | agpl-3.0 | 1,469 |
# -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from copy import deepcopy
from django.utils.translation import ugettext as _
from opentreemap.util import json_from_request
from treemap.models import Species
from treema... | maurizi/otm-core | opentreemap/manage_treemap/views/fields.py | Python | agpl-3.0 | 8,599 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP - Account balance reporting engine
# Copyright (C) 2009 Pexego Sistemas Informáticos. All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# it... | jmesteve/saas3 | openerp/addons_extra/account_balance_reporting/account_balance_reporting_report.py | Python | agpl-3.0 | 22,002 |
from datetime import timedelta
from django.http import JsonResponse
from django.utils import timezone
from django.views.decorators.csrf import csrf_exempt
from django.views.decorators.http import require_POST, require_http_methods
from agir.events.models import JitsiMeeting
@csrf_exempt
@require_POST
def jitsi_reser... | lafranceinsoumise/api-django | agir/events/views/jitsi_views.py | Python | agpl-3.0 | 1,950 |
#!/usr/bin/env python
'''
**Purpose**
Module contains functions to manage the database table XFERO_COTS_Pattern
**Unit Test Module:** test_crud_XFERO_COTS_Pattern.py
**Process Flow**
.. figure:: ../process_flow/manage_cots_patterns.png
:align: center
Process Flow: Manage COTS Pattern
*External dependenci... | tickbox-smc-ltd/xfero | src/xfero/db/manage_cots_pattern.py | Python | agpl-3.0 | 15,606 |
from django.contrib import admin
from django.contrib.auth.models import User
from .models import RuleType, QuestionDataType, VirtualOptionType, Survey, TranslationSurvey, Chart, ResultsIntake, ResultsMonthly
class ResultsIntake_Admin(admin.ModelAdmin):
list_display = ('id','user', 'timestamp')
search_fields = ... | chispita/epiwork | apps/pollster/admin.py | Python | agpl-3.0 | 774 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2014 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you ca... | colinligertwood/odoo | openerp/tools/misc.py | Python | agpl-3.0 | 42,603 |
from __future__ import with_statement
from poser.api import create_page
from poser.apphook_pool import apphook_pool
from poser.test_utils.testcases import SettingsOverrideTestCase
from poser.test_utils.util.context_managers import SettingsOverride
from poser.views import _handle_no_page, details
from django.conf import... | elishowk/django-poser | poser/tests/views.py | Python | agpl-3.0 | 3,972 |
#!/usr/bin/env python
# Copyright (C) 2006-2017 Music Technology Group - Universitat Pompeu Fabra
#
# This file is part of Essentia
#
# Essentia 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
# Software Foundation (FSF), e... | MTG/essentia | test/src/unittests/highlevel/test_coversongsimilarity.py | Python | agpl-3.0 | 3,115 |
import copy
from ereuse_devicehub.resources.device.schema import Device
from ereuse_devicehub.resources.device.settings import DeviceSubSettings
class Mobile(Device):
imei = {
'type': 'string',
'unique': True
}
meid = {
'type': 'string',
'unique': True
}
type = {
... | eReuse/DeviceHub | ereuse_devicehub/resources/device/mobile/settings.py | Python | agpl-3.0 | 722 |
import pytest
from dateutil.parser import parse
from adhocracy4.dashboard import components
from adhocracy4.test.helpers import redirect_target
from meinberlin.apps.extprojects.phases import ExternalPhase
from meinberlin.test.helpers import assert_dashboard_form_component_response
from meinberlin.test.helpers import s... | liqd/a4-meinberlin | tests/extprojects/dashboard_components/test_views_extproject_basic.py | Python | agpl-3.0 | 3,909 |
# coding=UTF-8
from django.shortcuts import redirect
from bellum.common.alliance import isAllied
from bellum.common.session.login import must_be_logged
from bellum.common.session import getAccount, getRace
from bellum.common.session.mother import getCurrentMother
from djangomako.shortcuts import render_to_response, ren... | piotrmaslanka/bellum | space/views/planetview.py | Python | agpl-3.0 | 4,242 |
import warnings
from django.conf import settings
from django.utils.translation import gettext as _
from rest_framework import serializers
from rest_framework.utils import model_meta
from .models import Comment
class CommentSerializer(serializers.ModelSerializer):
"""Attention: This class is deprecated, use
... | liqd/adhocracy4 | adhocracy4/comments/serializers.py | Python | agpl-3.0 | 7,379 |
# Copyright 2016-2020 Sodexis
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
def post_init_hook(cr, registry):
""" Add street3 to address format """
query = """
UPDATE res_country
SET address_format = replace(
address_format,
E'%(street2)s\n',
E'%(stree... | OCA/partner-contact | partner_address_street3/hooks.py | Python | agpl-3.0 | 919 |
from odoo import fields, models
class SaleOrderLine(models.Model):
_inherit = 'sale.order.line'
bom_id = fields.Many2one(
comodel_name='mrp.bom',
readonly=True
)
| pledra/odoo-product-configurator | product_configurator_sale_mrp/models/sale.py | Python | agpl-3.0 | 193 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-02-11 04:02
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('web', '0023_auto_20170211_0325'),
]
operations = [
migrations.AddField(
... | leesdolphin/rentme | rentme/web/migrations/0024_auto_20170211_0402.py | Python | agpl-3.0 | 620 |
from mitxmako.shortcuts import render_to_response
from django.http import HttpResponse
from .models import poll_store
from datetime import datetime
from django.utils import timezone
import json
import urllib2
from math import floor
def poll_form_view(request, poll_type=None):
if poll_type:
return render_t... | EduPepperPDTesting/pepper2013-testing | lms/djangoapps/polls/views.py | Python | agpl-3.0 | 3,557 |
# -*- coding: utf-8 -*-
# Copyright(C) 2013 Bezleputh
#
# This file is part of weboob.
#
# weboob 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 Software Foundation, either version 3 of the License, or
# (at your option) ... | yannrouillard/weboob | modules/regionsjob/job.py | Python | agpl-3.0 | 1,035 |
##############################################################################
#
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, faculties, institutes and professional schools.
# The core ... | uclouvain/OSIS-Louvain | learning_unit/views/learning_unit_class/tutor_repartition.py | Python | agpl-3.0 | 6,168 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
################################################################################
#
# qooxdoo - the new era of web development
#
# http://qooxdoo.org
#
# Copyright:
# 2006-2010 1&1 Internet AG, Germany, http://www.1und1.de
#
# License:
# LGPL: http://www.gnu.org/li... | Seldaiendil/meyeOS | devtools/qooxdoo-1.5-sdk/tool/pylib/ecmascript/frontend/Scanner.py | Python | agpl-3.0 | 8,958 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-09-20 15:04
from __future__ import unicode_literals
from django.db import migrations
from django.db import models
class Migration(migrations.Migration):
dependencies = [
('meinberlin_plans', '0017_rename_cost_field'),
]
operations = ... | liqd/a4-meinberlin | meinberlin/apps/plans/migrations/0018_point_label_required.py | Python | agpl-3.0 | 621 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('wiki', '0001_initial'),
('userstories', '0009_remove_userstory_is_archived'),
('issues', '0005_auto_20150623_1923'),
... | coopsource/taiga-back | taiga/searches/migrations/0001_initial.py | Python | agpl-3.0 | 1,689 |
# Copyright (C) 2006-2021 Music Technology Group - Universitat Pompeu Fabra
#
# This file is part of Essentia
#
# Essentia 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
# Software Foundation (FSF), either version 3 of the ... | MTG/essentia | src/python/essentia/algorithms.py | Python | agpl-3.0 | 5,502 |
from rest_framework import routers
from . import views
router = routers.SimpleRouter()
router.register(r'roles', views.RoleViewSet)
router.register(r'subjects', views.SubjectList, basename="Subjects")
router.register(r'erratacontent', views.ErrataContentViewSet, basename="ErrataContent")
router.register(r'subjectcateg... | openstax/openstax-cms | snippets/urls.py | Python | agpl-3.0 | 410 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | songmonit/CTTMSONLINE | addons/account/report/account_aged_partner_balance.py | Python | agpl-3.0 | 21,185 |
#Copyright ReportLab Europe Ltd. 2000-2016
#see license.txt for license details
#history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/graphics/widgets/grids.py
__version__='3.3.0'
from reportlab.lib import colors
from reportlab.lib.validators import isNumber, isColorOrNone, isB... | EduPepperPDTesting/pepper2013-testing | lms/djangoapps/reportlab/graphics/widgets/grids.py | Python | agpl-3.0 | 18,133 |
##############################################################################
# For copyright and license notices, see __manifest__.py file in module root
# directory
##############################################################################
from odoo import models, fields
class LegalOfferer(models.Model):
... | ingadhoc/odoo-legal | legal/models/legal_offerer.py | Python | agpl-3.0 | 370 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import uuid
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Webhook',
fields=[
('id', models.Au... | mitodl/ccxcon | webhooks/migrations/0001_initial.py | Python | agpl-3.0 | 624 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Telegram bot to play UNO in group chats
# Copyright (c) 2016 Jannes Höke <uno@jhoeke.de>
#
# 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 Software Foundatio... | SYHGroup/mau_mau_bot | utils.py | Python | agpl-3.0 | 3,582 |
from twisted.internet.defer import inlineCallbacks, returnValue
from juju.control.utils import get_environment
def configure_subparser(subparsers):
"""Configure destroy-environment subcommand"""
sub_parser = subparsers.add_parser(
"destroy-environment", help=command.__doc__)
sub_parser.add_argume... | mcclurmc/juju | juju/control/destroy_environment.py | Python | agpl-3.0 | 1,199 |
# Generated by Django 2.1.5 on 2019-01-14 14:14
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [("donations", "0006_document_deleted")]
operations = [
migrations.AlterField(
model_name="spendingrequest",
... | lafranceinsoumise/api-django | agir/donations/migrations/0007_auto_20190114_1514.py | Python | agpl-3.0 | 681 |
import announcements, users, corporate, api, volunteer, teams, innovation
def configure_routes(app):
app.add_url_rule('/', 'landing', view_func=users.views.landing, methods=['GET'])
# Signing Up/Registration
app.add_url_rule('/register', 'sign-up', view_func=users.views.sign_up, methods=['GET', 'POST'])
... | rohitdatta/pepper | pepper/routes.py | Python | agpl-3.0 | 7,316 |