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
# -*- coding: utf-8 -*- # # programslice documentation build configuration file, created by # sphinx-quickstart on Fri Jul 27 16:01:51 2012. # # 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 # autogenerated file. # ...
romanofski/programslice
docs/conf.py
Python
gpl-3.0
8,125
""" Several pre-defined models that use the gradient nodes. """ import mdp import Oger import trainers # TODO: The Autoencoder has not been tested yet. class MLPNode(mdp.Node): """Defines a multilayer perceptron with a hidden layer of tanh units.r """ def __init__(self, input_dim, output_dim, hidden_dim...
npinto/Oger
Oger/gradient/models.py
Python
gpl-3.0
2,883
import logging import gym import numpy as np from chaos_theory.algorithm import DDPG from chaos_theory.run.run_algorithm import run_online_algorithm logging.basicConfig(level=logging.DEBUG) logging.getLogger().setLevel(logging.DEBUG) np.random.seed(1) if __name__ == "__main__": env_name = 'HalfCheetah-v1' e...
justinjfu/chaos_theory
scripts/run_ddpg.py
Python
gpl-3.0
526
import numpy as np def non_max_suppression_fast(boxes, probabilities=None, overlap_threshold=0.3): """ Algorithm to filter bounding box proposals by removing the ones with a too low confidence score and with too much overlap. Source: https://www.pyimagesearch.com/2015/02/16/faster-non-maximum-suppres...
robocomp/robocomp-robolab
components/detection/test/handGestureClient/src/non_maximum_suppression.py
Python
gpl-3.0
2,732
import rdflib from rdflib import Namespace from ontology import Ontology class DOC(Ontology, ): def __init__(self): Ontology.__init__(self, rdflib.term.URIRef(u'http://www.w3.org/2000/10/swap/pim/doc#')) prefix = 'doc' doc = DOC() ontology = doc
h4ck3rm1k3/gcc-ontology
lib/ontologies/org/w3/_2000/_10/swap/pim/doc.py
Python
gpl-3.0
265
''' Normality testing using the Shapiro-Wilks statistic ''' # Copyright (C) 2016 Todd Pataky import numpy as np from scipy import stats from .. t import regress as _main_regress from .. anova import anova1 as _main_anova1 from .. anova import anova1rm as _main_anova1rm from .. anova import anova2 as _main_anova2 f...
0todd0000/spm1d
spm1d/stats/normality/sw.py
Python
gpl-3.0
2,649
# Copyright (C) 2015 Equinor ASA, Norway. # # The file 'ecl_init_file.py' is part of ERT - Ensemble based Reservoir Tool. # # ERT 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 L...
OPM/ResInsight
ThirdParty/Ert/python/ecl/eclfile/ecl_init_file.py
Python
gpl-3.0
1,213
from __future__ import absolute_import from __future__ import division from __future__ import print_function __RCSID__ = "$Id$" import six import os from DIRAC import gLogger from DIRAC.Core.Security import Locations from DIRAC.Core.Utilities.ReturnValues import S_ERROR, S_OK from DIRAC.Core.Security.X509Chain impor...
ic-hep/DIRAC
src/DIRAC/Core/DISET/private/Transports/SSLTransport.py
Python
gpl-3.0
4,302
# Author: Philippe Katz <philippe.katz@gmail.com>, # Flavien Garcia <flavien.garcia@free.fr>, # Sylvain Takerkart <Sylvain.Takerkart@incm.cnrs-mrs.fr> # License: BSD Style. try: from neuroProcesses import * except: print 'Impossible to import neurProcesses' def print_fonc(string,context=None):...
SylvainTakerkart/vobi_one
lib/python2.5/site-packages/oidata/oisession_preprocesses.py
Python
gpl-3.0
15,602
# encoding: utf-8 import re from .common import InfoExtractor from ..utils import ( compat_urllib_parse, determine_ext, ) class DaumIE(InfoExtractor): _VALID_URL = r'https?://tvpot\.daum\.net/.*?clipid=(?P<id>\d+)' IE_NAME = u'daum.net' _TEST = { u'url': u'http://tvpot.daum.net/clip/Clip...
nilsonmorales/Puppyes-nightrc
usr/local/lib/python2.7/dist-packages/youtube_dl/extractor/daum.py
Python
gpl-3.0
2,601
from abc import ( ABCMeta, abstractmethod ) import os import string from galaxy.util import asbool from ..deps import docker_util import logging log = logging.getLogger(__name__) DEFAULT_CONTAINER_TYPE = "docker" class ContainerFinder(object): def __init__(self, app_info): self.app_info = app_...
mikel-egana-aranguren/SADI-Galaxy-Docker
galaxy-dist/lib/galaxy/tools/deps/containers.py
Python
gpl-3.0
10,514
# 4. Median of Two Sorted Arrays My Submissions QuestionEditorial Solution # Total Accepted: 94496 Total Submissions: 504037 Difficulty: Hard # There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)). # ...
shawncaojob/LC
PY/4_median_of_two_sorted_arrays.py
Python
gpl-3.0
3,984
class Solution: def compareVersion(self, version1, version2): """ :type version1: str :type version2: str :rtype: int """ v1_str, v2_str = version1.split('.'), version2.split('.') v1_len, v2_len = len(v1_str), len(v2_str) length = max(v1_len, v2_len) ...
YiqunPeng/Leetcode-pyq
solutions/165CompareVersionNumbers.py
Python
gpl-3.0
1,187
#!/usr/bin/env python # Public domain, 2013 Simone Basso <bassosimone@gmail.com>. """ Test for NeubotPollable """ import ctypes import os import sys sys.path.insert(0, "/usr/local/share/libneubot") from libneubot import Pollable from libneubot import Poller class EchoPollable(Pollable): def __init__(self, pol...
bassosimone/libneubot
test/pollable1.py
Python
gpl-3.0
892
from vsg.vhdlFile.classify import range_constraint def detect(iToken, lObjects): ''' integer_type_definition ::= range_constraint ''' return range_constraint.detect(iToken, lObjects)
jeremiah-c-leary/vhdl-style-guide
vsg/vhdlFile/classify/integer_type_definition.py
Python
gpl-3.0
211
# Copyright 2016 Casey Jaymes # This file is part of PySCAP. # # PySCAP 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. # # PySCAP is ...
cjaymes/pyscap
src/scap/model/ai_1_1/LocationsType.py
Python
gpl-3.0
1,280
"""The settings file used to run unit tests. An in-memory database is used to speedup the tests. A simple (unsafe) password hasher is used because the default password hasher is rather slow. Email messages are stored in a special attribute of the 'django.core.mail' module. """ from purse.settings.base import * DE...
orontee/porte-monnaie
site/purse/settings/tests.py
Python
gpl-3.0
1,478
# amazon plugin by ine (2020) from util import hook from utilities import request from bs4 import BeautifulSoup import re def parse(html): soup = BeautifulSoup(html, 'lxml') container = soup.find(attrs={'data-component-type': 's-search-results'}) if container is None: return [] results = cont...
FrozenPigs/Taigabot
plugins/amazon.py
Python
gpl-3.0
2,394
############################################################################ # # Copyright (C) 2016 The Qt Company Ltd. # Contact: https://www.qt.io/licensing/ # # This file is part of Qt Creator. # # Commercial License Usage # Licensees holding valid commercial Qt licenses may use this file in # accordance with the co...
sailfish-sdk/sailfish-qtcreator
tests/system/suite_tools/tst_codepasting/test.py
Python
gpl-3.0
11,988
# # Copyright © 2012 - 2021 Michal Čihař <michal@cihar.com> # # This file is part of Weblate <https://weblate.org/> # # 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 Lice...
phw/weblate
weblate/trans/autofixes/custom.py
Python
gpl-3.0
2,009
from FileBundleTestCase import FileBundleTestCase import unittest class BasicTests(unittest.TestCase, FileBundleTestCase): pass
gobstones/PyGobstones-Lang
tests/basictests/basictests_test.py
Python
gpl-3.0
132
""" Python Character Mapping Codec generated from 'ICELAND.TXT' with gencodec.py. Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. (c) Copyright 2000 Guido van Rossum. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode...
DarioGT/OMS-PluginXML
org.modelsphere.sms/lib/jython-2.2.1/Lib/encodings/mac_iceland.py
Python
gpl-3.0
6,560
"""?? This file is the engine that converts the xml to html """ import pdb import os from common import * import microdom #? <section name="Helper Functions"> def genTagDict(xml): """?? Converts a <ref>microdom</ref> tree into a dictionary of key: tag names, value: list of objects """ tags = {} for node in ...
gandrewstone/yadog
d2html.py
Python
gpl-3.0
3,641
## ## pyGBot - Versatile IRC Bot ## Copyright (C) 2008 Morgan Lokhorst-Blight, Alex Soborov ## ## 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, ...
pyGBot/pyGBot
pyGBot/Plugins/system/CommandSpec/Seen.py
Python
gpl-3.0
3,387
# -*- coding: utf-8 -*- from __future__ import unicode_literals import re import markdown from django.template.loader import render_to_string from wiki.plugins.images import models, settings IMAGE_RE = re.compile( r'.*(\[image\:(?P<id>[0-9]+)(\s+align\:(?P<align>right|left))?(\s+size\:(?P<size>default|small|medi...
cXhristian/django-wiki
src/wiki/plugins/images/markdown_extensions.py
Python
gpl-3.0
4,717
# -*- coding: utf-8 -*- # home made test import xc_base import geom import xc from model import predefined_spaces from solution import predefined_solutions from materials import typical_materials __author__= "Luis C. Pérez Tato (LCPT)" __copyright__= "Copyright 2014, LCPT" __license__= "GPL" __version__= "3.0" __emai...
lcpt/xc
verif/tests/database/test_database_14.py
Python
gpl-3.0
4,437
import socket import sys if (len(sys.argv) < 2): print("How to use portscan") print(sys.argv[0], "10.1.1.1") else: for Port in range(1, 65535): mysocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) if (mysocket.connect_ex((sys.argv[1], Port)) == 0): print("Por...
andremilke/utility
portscan.py
Python
gpl-3.0
344
from astropy.io import ascii from astropy.table import MaskedColumn, Table, Column import logging import math import numpy import os from .downloads.cutouts.downloader import ImageDownloader from . import util from .downloads.cutouts.source import SourceCutout from astropy.time import Time from .astrom import Observati...
OSSOS/MOP
src/ossos/core/ossos/match.py
Python
gpl-3.0
13,649
#!/usr/bin/python # -*- coding: UTF-8 -*- import unittest from stacosys.conf.config import Config, ConfigParameter EXPECTED_DB_SQLITE_FILE = "db.sqlite" EXPECTED_HTTP_PORT = 8080 EXPECTED_LANG = "fr" class ConfigTestCase(unittest.TestCase): def setUp(self): self.conf = Config() self.conf.put(C...
kianby/stacosys
tests/test_config.py
Python
gpl-3.0
1,437
#!/usr/bin/env python # -*- coding: utf-8 -*- ######################################################################### # File Name: treeExplore.py # Author: lpqiu # mail: qlp_1018@126.com # Created Time: 2014年09月13日 星期六 21时42分58秒 ######################################################################### from numpy imp...
Com-Mean/MLinAcition
chapter9/treeExplore.py
Python
gpl-3.0
1,329
# import os import numpy as np import matplotlib.pyplot as plt import random # cluster_dp_GPU = "./cluster_dp_GPU" # os.system(cluster_dp_GPU) input_file = raw_input("enter the input file name:") result_file = raw_input("enter the result file name:") location = [] # input_lable = [] for line in open("dataset/"+input_f...
GeKeShi/cluster-dp
cluster_image.py
Python
gpl-3.0
1,589
#!/usr/bin/env python from sys import argv, exit import shelve from subprocess import Popen, PIPE import os, signal, time from test_graph import plot # Database of known cases correct = {} correct[(0,0)] = ((), ()) correct[(0,1)] = ((), ()) correct[(0,2)] = ((), ...
stefano-maggiolo/boundary
test/test.py
Python
gpl-3.0
22,312
from django.contrib import admin from tracker.models import Author, Theme, Song admin.site.register(Author) admin.site.register(Theme) class SongAdmin(admin.ModelAdmin): fields = ['title', 'authors', 'themes', 'copyright'] admin.site.register(Song, SongAdmin)
BerkshireKnight/SongTracker
tracker/admin.py
Python
gpl-3.0
267
#!/usr/bin/python # gen_numerics_text.py: generate numeric_text.c import numerics print """/* quIRC - simple terminal-based IRC client Copyright (C) 2010-13 Edward Cree See quirc.c for license information numeric_text: names of IRC numeric replies */ /*** This file is generated by gen_numerics_text.py from mas...
ec429/quIRC
gen_numerics_text.py
Python
gpl-3.0
610
from Crypto.PublicKey import RSA from Crypto.Cipher import AES, PKCS1_OAEP file_in = open("encrypted_data.bin", "rb") private_key = RSA.import_key(open("private.pem").read()) enc_session_key, nonce, tag, ciphertext = [ file_in.read(x) for x in (private_key.size_in_bytes(), 16, 16, -1) ] # Decrypt the session key wi...
siwells/teaching_set09103
code/topic_11/decrypt.py
Python
gpl-3.0
616
from dataccess import psget
hoidn/LCLS
dataccess/tests/test_psget.py
Python
gpl-3.0
30
# -*- coding: utf-8 -*- import requests import json from provider import send URL = 'http://domains.yougetsignal.com/domains.php' KEY_REMOTE_ADDR = 'remoteAddress' KEY_RESERVE_KEY = 'key' KEY_RESERVE_UNDERLINE = '_' KEY_DOMAIN_ARRAY = 'domainArray' def retrieve(target, ip): retval = [] try: result = ...
soxfmr/ant
vendor/yougetsignal.py
Python
gpl-3.0
794
from django.contrib import admin from django.contrib.auth.admin import UserAdmin, GroupAdmin from django.contrib.auth.admin import Group as AuthGroup from .models import User class Group(AuthGroup): class Meta: proxy = True app_label = "accounts" verbose_name_plural = "Группы" verb...
escsun/radio-shop
accounts/admin.py
Python
gpl-3.0
722
# -*- coding: utf-8 -*- # # Copyright © 2012 - 2017 Michal Čihař <michal@cihar.com> # # This file is part of Weblate <https://weblate.org/> # # 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, eith...
lem9/weblate
weblate/accounts/forms.py
Python
gpl-3.0
20,803
# Copyright (C) 2015 Ross D Milligan # GNU GENERAL PUBLIC LICENSE Version 3 (full notice can be found at https://github.com/rdmilligan/SaltwashAR) from rockyrobotframes import * from sportyrobotframes import * from constants import * class Robot: def __init__(self): self.body_frame = None self.he...
rdmilligan/SaltwashAR
scripts/robot.py
Python
gpl-3.0
3,499
"""Utilities to help Computing Element Queues manipulation """ from __future__ import absolute_import from __future__ import division import six from DIRAC import S_OK, S_ERROR from DIRAC.Core.Utilities.List import fromChar from DIRAC.Core.Utilities.ClassAd.ClassAdLight import ClassAd from DIRAC.ConfigurationSystem.C...
fstagni/DIRAC
WorkloadManagementSystem/Utilities/QueueUtilities.py
Python
gpl-3.0
8,673
#!/usr/bin/env python """ A basic demo of pandas """ from pandas import DataFrame df = DataFrame(["a", "b", "c"], index=[("0", "1"), ("1", "2"), ("2", "3")]) print(df.get_values()) try: print(df.ix[("0", "1")]) except: print("yes, accessing .ix with tuple does not work") print(df.xs(("0", "1")))
veltzer/demos-python
src/examples/short/pandas/tuples_as_indices.py
Python
gpl-3.0
308
import numpy as np import numpy.random as rng class Oscillator: """ A point in phase space for an oscillator. """ def __init__(self, state, omega=1., tau=1., beta=1.): """ Constructor: takes initial yition and velocity as argument. Sets the time to zero """ self.state = state self.omega, self.tau, self...
eggplantbren/Oscillations
StateSpace/Python/Oscillator.py
Python
gpl-3.0
2,171
from sqlalchemy import Column, String, Integer, ForeignKey, SmallInteger, TIMESTAMP, BigInteger, ForeignKeyConstraint, \ Boolean, func, select, Float, distinct from sqlalchemy.dialects.postgresql import JSONB from sqlalchemy.ext.hybrid import hybrid_property from sqlalchemy.orm import backref from sqlalchemy.orm i...
ADEQUATeDQ/portalmonitor
odpw/core/model.py
Python
gpl-3.0
12,953
from tv import TV import xbmc, xbmcaddon import time, urllib, os, sys from urlparse import urlparse, parse_qs import vars # Add src/service in load paths my_addon = xbmcaddon.Addon(vars.__addon_id__) addon_dir = xbmc.translatePath(my_addon.getAddonInfo('path')).decode('utf-8') sys.path.append(os.path.join(addon_d...
ivankokan/xbmc.plugin.video.nba
src/service.py
Python
gpl-3.0
3,711
### BEGIN LICENSE # Copyright (C) 2011 Guillaume Hain <zedtux@zedroot.org> # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License version 3, as published # by the Free Software Foundation # # This program is distributed in the hope that it will be...
cemmanouilidis/naturalscrolling
naturalscrolling/indicator.py
Python
gpl-3.0
3,094
# -*- coding: UTF-8 -*- ## Copyright 2008-2011 Luc Saffre ## This file is part of the Lino project. ## Lino 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 op...
MaxTyutyunnikov/lino
obsolete/sales.old/fixtures/demo.py
Python
gpl-3.0
7,084
# Produces the list of links to XML feeds as extracted from input list of generic URLs. # This script expects to have the file path passed as the only input parameter import re import sys import urllib.request from urllib.parse import urljoin urls_file = sys.argv[1] with open(urls_file) as f: urls_lines...
martinrotter/rssguard
resources/scripts/scrapers/search-xml-feeds.py
Python
gpl-3.0
979
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Ansible by Red Hat, inc # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
dataxu/ansible
lib/ansible/modules/network/junos/junos_user.py
Python
gpl-3.0
11,343
# -*- coding: utf-8 -*- # # Copyright (C) 2015-2019 Bitergia # # 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 ...
valeriocos/perceval
perceval/backends/core/twitter.py
Python
gpl-3.0
14,309
#!/usr/bin/env python #------------------------------------------------------------------------------- # # Copyright (c) 2011-2012 by European Organization for Nuclear Research (CERN) # Author: Justin Salmon <jsalmon@cern.ch> # # This file is part of XrdTest. # # XrdTest is free software: you can redistribute it and/or...
xrootd/xrootd-test-framework
src/XrdTest/EmailNotifier.py
Python
gpl-3.0
7,244
# Create your views here. from django.contrib.syndication.views import Feed from q4wine.news.models import News from django.utils.feedgenerator import Atom1Feed import string class RssSiteNewsFeed(Feed): title = "News related to q4wine development stuff and its community life." link = "/rss/" description ...
brezerk/q4wine-web
rss/views.py
Python
gpl-3.0
1,075
# -*- coding: utf-8 -*- import curses from . import Widget import logging log = logging.getLogger('npyscreen2.widgets.textfield') class TextField(Widget): """ The TextField class will most likely serve as the general basis for most widgets that display text to the screen. The value attribute should alw...
SavinaRoja/npyscreen2
npyscreen2/widgets/textfield.py
Python
gpl-3.0
9,852
import web import uuid from jinja2 import Environment, FileSystemLoader import os files_directory = "db/data" THIS_DIR = os.path.dirname(os.path.abspath(__file__)) urls = ( '/', 'Index', '/upload', 'Upload' ) class Index: def GET(self): j2_env = Environment(loader=FileSystemLoader(THIS_DIR+"/...
tiagoft/sampleseeker
sampleseeker.py
Python
gpl-3.0
1,431
# 1222, Fri 18 Dec 2015 (NZDT) # # build-cpldns.py: makes pypy cpldns module # # Copyright (C) 2016 by Nevil Brownlee, U Auckland | WAND # # 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...
nevil-brownlee/pypy-libtrace
lib/pldns/build-cpldns.py
Python
gpl-3.0
3,848
# -*- coding:Latin-1 -*- from Tkinter import * from math import pi, sin, cos class Canon(object): """Petit canon graphique""" def __init__(self, boss, x, y): self.boss = boss # référence du canevas self.x1, self.y1 = x, y # axe de rotation du canon # dessiner la buse du ...
widowild/messcripts
exercice/python2/chap15/canon01.py
Python
gpl-3.0
1,632
import sys from colorama import Fore, Style from colorama import init from .plain_reporter import PlainReporter class ColorReporter(PlainReporter): def __init__(self, number_of_messages): super().__init__(number_of_messages) # Override this method def print_messages(self, level='all'): ...
shweta97/pyta
python_ta/reporters/color_reporter.py
Python
gpl-3.0
1,167
# Copyright (C) 2017-2019 Dmitry Marakasov <amdmi3@amdmi3.ru> # # This file is part of repology # # repology 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 optio...
repology/repology
repology/parsers/parsers/libregamewiki.py
Python
gpl-3.0
2,439
# Generated by Django 2.0.10 on 2019-03-12 17:51 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('erudit', '0110_auto_20181123_1558'), ] operations = [ migrations.AlterField( model_name='issue', name='is_published...
erudit/zenon
eruditorg/erudit/migrations/0111_auto_20190312_1251.py
Python
gpl-3.0
422
# -*- coding: utf-8 -*- import io from odoo import models from odoo.tools.pdf import OdooPdfFileReader, OdooPdfFileWriter class IrActionsReport(models.Model): _inherit = 'ir.actions.report' def _post_pdf(self, save_in_attachment, pdf_content=None, res_ids=None): # OVERRIDE to embed some EDI documen...
jeremiahyan/odoo
addons/account_edi/models/ir_actions_report.py
Python
gpl-3.0
1,420
import unittest from types import ModuleType def IsTestCase(test): if type(test) == type and issubclass(test, unittest.TestCase): return True return False def AddTests(suite, test): if isinstance(test, ModuleType): for entry in test.__dict__.values(): if IsTestCase(entry):...
aidanf/SimpleICM
tests/testutils.py
Python
gpl-3.0
674
#This file is part of vatnumber. The COPYRIGHT file at the top level of #this repository contains the full copyright notices and license terms. ''' Check the VAT number depending of the country based on formula from http://sima-pc.com/nif.php (dead link, was http://web.archive.org/web/20120118023804/http://sima-pc.com...
borni-dhifi/vatnumber
vatnumber/__init__.py
Python
gpl-3.0
8,864
#!/usr/bin/env python3 import unittest import os import subprocess import sys import re class TestFahrstrGen(unittest.TestCase): def run_fahrstr_gen(self, st3, args=[]): # return: (retcode, output) env = os.environ.copy() env["ZUSI3_DATAPATH"] = os.getcwd() cmd = [sys.executable, '../fahr...
zusitools/fahrstr_gen
test/test.py
Python
gpl-3.0
7,559
# -*- coding:utf-8 -*- # # Copyright 2008 David Grundberg, Håkan Fors Nilsson # # This file is part of Pytave. # # Pytave 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 # (...
johannesring/pytave
package/__init__.py
Python
gpl-3.0
917
#!/usr/bin/env python3 import os import requests import time import json def getWeatherAsWords(): # Settings for your API key and location details read from environment strings, e.g. exports etc appid = str(os.environ.get('apikey')) locid = str(os.environ.get('locationkey')) lat = str(os.environ.get(...
sjhawke/piface-cad
lib/writetheweather.py
Python
gpl-3.0
1,742
#Imports from __future__ import division from pybrain.datasets import SupervisedDataSet from pybrain.supervised.trainers import BackpropTrainer from pybrain.tools.shortcuts import buildNetwork from pybrain.utilities import percentError import numpy as np import pylab as pl import math as ma import csv #Leer las bases ...
etsiiull/medicalpybrain
Datasets y Scripts/Pybrain_Melanoma_for_test_Hidden.py
Python
gpl-3.0
3,861
# Outspline - A highly modular and extensible outliner. # Copyright (C) 2011-2014 Dario Giovannetti <dev@dariogiovannetti.net> # # This file is part of Outspline. # # Outspline is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Softw...
xguse/outspline
src/outspline/info/extensions/organism_alarms.py
Python
gpl-3.0
1,392
#!/usr/bin/env python # coding:utf-8 """ 设置基础环境 """ import os import shutil import re import traceback import sys import subprocess def exception_catch(func, *args, **kw): """异常处理""" def inner_func(*args, **kw): """处理""" try: return func(*args, **kw) except BaseExceptio...
unlessbamboo/grocery-shop
language/gcc/compile.py
Python
gpl-3.0
4,158
#Code generator for gauss kernel import Utils local_size = 64 def generatePreamble(f): print >>f, """ #pragma OPENCL EXTENSION cl_khr_fp64 : enable #ifndef M_SQRT2 #define M_SQRT2 1.41421356237309504880168872420969808 #endif typedef double T; """ def rangeEstimateFunction(f): print >>f, """ unsigned...
martinkiefer/join-kde
code/JoinSampleCodeGenerator.py
Python
gpl-3.0
10,901
# -*- coding: utf-8 -*- # Test from Ansys manual # Reference: Strength of Material, Part I, Elementary Theory & Problems, pg. 26, problem 10 __author__= "Luis C. Pérez Tato (LCPT)" __copyright__= "Copyright 2014, LCPT" __license__= "GPL" __version__= "3.0" __email__= "l.pereztato@gmail.com" E= 30e6 # Young modulus (...
lcpt/xc
verif/tests/solution/constraint_handler/lagrange_handler_test_01.py
Python
gpl-3.0
3,099
''' Reads scrambled Vigenere Cipher text from stdin and attempts to decrypt it. Written for Python 2.7. Copyright (C) 2014 leechy9 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 ...
leechy9/Vigilante
vigilante.py
Python
gpl-3.0
5,186
import sys from com.l2scoria.gameserver.model.quest import State from com.l2scoria.gameserver.model.quest import QuestState from com.l2scoria.gameserver.model.quest.jython import QuestJython as JQuest from com.l2scoria.gameserver.network.serverpackets import CreatureSay from com.l2scoria.util.random import Rnd qn = "3...
zenn1989/scoria-interlude
L2Jscoria-Game/data/scripts/quests/335_TheSongOfTheHunter/__init__.py
Python
gpl-3.0
28,333
# -*- coding: utf-8 -*- from __future__ import division ''' Base classes and function for structural steel.''' __author__= "Ana Ortega (AO_O) and Luis C. Pérez Tato (LCPT)" __copyright__= "Copyright 2015, AO_O and LCPT" __license__= "GPL" __version__= "3.0" __email__= " ana.Ortega.Ort@gmail.com, l.pereztato@gmail.com"...
lcpt/xc
python_modules/materials/steel_base.py
Python
gpl-3.0
838
# -*- coding: utf-8 -*- CooMax= 10 import xc_base import geom import xc import math from model.sets import sets_mng as sUtils __author__= "Luis C. Pérez Tato (LCPT)" __copyright__= "Copyright 2014, LCPT" __license__= "GPL" __version__= "3.0" __email__= "l.pereztato@gmail.com" feProblem= xc.FEProblem() preprocessor= ...
lcpt/xc
verif/tests/preprocessor/sets/sets_boolean_operations_01.py
Python
gpl-3.0
1,078
# -*- coding: utf-8 -*- """User request handler collection test.""" import json from .. import mocks from ..test_base_handler import TestBaseHandler from models import User from models import Institution from models import Address from models import Invite from handlers.user_request_collection_handler import UserReque...
eciis/web
backend/test/request_handlers_test/user_request_collection_handler_test.py
Python
gpl-3.0
4,935
#!/usr/bin/python # Copyright (C) 2010, 2012 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 lis...
cs-au-dk/Artemis
WebKit/Tools/Scripts/webkitpy/layout_tests/views/printing_unittest.py
Python
gpl-3.0
21,671
import json class JSON_RPCError(Exception): """ Base class for JSON-RPC errors. """ def to_json(self): return json.dumps({ 'code': self.code, 'message': self.__doc__, }) class ParseError(JSON_RPCError): """ Invalid JSON was received by the server. An error occurre...
AdvancedClimateSystems/Diode
diode/exceptions.py
Python
mpl-2.0
830
# # CDR-Stats License # http://www.cdr-stats.org # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. # # Copyright (C) 2011-2015 Star2Billing S.L. # # The Initial Develope...
Star2Billing/cdr-stats
cdr_stats/import_cdr/models.py
Python
mpl-2.0
2,641
import logging log = logging.getLogger(__name__) __all__ = ['Node'] class Node(object): ''' Node oject for acls ''' def __init__(self,perm,add): super(Node, self).__init__() self.attrs = {'type' : perm , 'cidr' : add} def todict(self): ''' Create a dict so it can be converted/serialized ''' re...
IndiciumSRL/wirecurly
wirecurly/configuration/node.py
Python
mpl-2.0
363
# This module contains functions used to manipulate the AstroData object import numpy as np from astrodata import Errors from astrodata.adutils import logutils def remove_single_length_dimension(adinput=None): """ If there is only one single length dimension in the pixel data, the remove_single_length_dim...
pyrrho314/recipesystem
trunk/gempy/adlibrary/manipulate_ad.py
Python
mpl-2.0
3,293
import datetime import json import mock import pytest from django.core.urlresolvers import reverse from django.conf import settings from django.utils import timezone from crashstats.crashstats.tests.test_views import BaseTestViews, Response from crashstats.crashstats.models import CrontabberState from crashstats.sup...
Tayamarn/socorro
webapp-django/crashstats/monitoring/tests/test_views.py
Python
mpl-2.0
6,622
niriSpecDict = { # Database for nprepare.cl # Date: 2004 July 6 # Author: Joe Jensen, Gemini Observatory # The long 6-pix and 4-pix centered slits are currently installed # # Array characteristics "readnoise" : 70, # electrons (1 read pair, 1 digital av...
pyrrho314/recipesystem
trunk/dontload-astrodata_Gemini/ADCONFIG_Gemini/lookups/NIRI/NIRISpecDict.py
Python
mpl-2.0
1,538
from werkzeug.exceptions import HTTPException, InternalServerError from .json import jsonify def register(app): """ Register error handlers on the given app :type app: flask.Flask """ @app.errorhandler(400) @app.errorhandler(401) @app.errorhandler(403) @app.errorhandler(404) @app...
kerel-fs/skylines
skylines/api/views/errors.py
Python
agpl-3.0
1,466
from flask_script import Command, Option from datetime import timedelta from itertools import chain from skylines.database import db from skylines.model import TrackingFix, User class Stats(Command): """ Analyse live tracks and output statistics """ option_list = ( Option('user', type=int, help='a ...
shadowoneau/skylines
skylines/commands/tracking/stats.py
Python
agpl-3.0
4,007
import os from ConfigParser import ConfigParser from lbryumserver import deserialize from lbryumserver.claims_storage import ClaimsStorage from lbryumserver.processor import Dispatcher from .fixtures import raw_tx_with_claim def _get_config_for_test_storage(tmpdir): config = ConfigParser() config.add_section...
lbryio/lbryum-server
benchmarks/test_claims.py
Python
agpl-3.0
1,512
# Copyright (c) 2001-2014, Canal TP and/or its affiliates. All rights reserved. # # This file is part of Navitia, # the software to build cool stuff with public transport. # # Hope you'll enjoy and contribute to this project, # powered by Canal TP (www.canaltp.fr). # Help us simplify mobility and open public tr...
lrocheWB/navitia
source/jormungandr/jormungandr/scenarios/tests/qualifier_tests.py
Python
agpl-3.0
13,540
# -*- coding: utf-8 -*- # Copyright© 2016 ICTSTUDIO <http://www.ictstudio.eu> # License: AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) from openerp import tools, models, fields, api import openerp.addons.decimal_precision as dp class AccountMoveLineReport(models.Model): _name = "account.move.line.report" ...
ICTSTUDIO/accounting-addons
account_move_line_report/report/account_move_line_report.py
Python
agpl-3.0
7,901
import ddt from group_project_v2.project_api.dtos import CompletionDetails from group_project_v2.stage import BaseGroupActivityStage from group_project_v2.stage.mixins import SimpleCompletionStageMixin from tests.unit.test_stages.base import BaseStageTest __author__ = 'e.kolpakov' @ddt.ddt class TestSimpleCompletio...
open-craft/xblock-group-project-v2
tests/unit/test_stages/test_mixins.py
Python
agpl-3.0
1,248
# -*- coding: utf-8 -*- # Akvo RSR is covered by the GNU Affero General Public License. # See more details in the license.txt file located at the root folder of the Akvo RSR module. # For additional details on the GNU license please see < http://www.gnu.org/licenses/agpl.html >. from lxml import etree def participa...
akvo/akvo-rsr
akvo/iati/exports/elements/participating_org.py
Python
agpl-3.0
1,717
# Copyright 2014 Davide Corio # Copyright 2015-2016 Lorenzo Battistini - Agile Business Group from . import wizard from . import models
OCA/l10n-italy
l10n_it_fatturapa_out/__init__.py
Python
agpl-3.0
137
from urllib.parse import urlsplit from funnel import app REDIS_URL = app.config.get('REDIS_URL', 'redis://redis:6379/0') # REDIS_URL is not taken by setup_default_arguments function of rq/scripts/__init__.py # so, parse that into pieces and give it r = urlsplit(REDIS_URL) REDIS_HOST = r.hostname REDIS_PORT = r.port...
hasgeek/funnel
rqinit.py
Python
agpl-3.0
362
from setuptools import setup, find_packages setup( name="comt", use_scm_version=True, url='http://www.co-ment.org', license='AGPL3', description="Web-based Text Annotation Application.", long_description=open('ABOUT.rst').read(), author='Abilian SAS', author_email='dev@abilian.com', ...
co-ment/comt
setup.py
Python
agpl-3.0
441
from builtins import str from builtins import object from django.db import models from django.db.utils import OperationalError, ProgrammingError from django.core import checks from django.conf import settings from django.contrib.contenttypes.fields import GenericForeignKey from django.contrib.contenttypes.models impor...
fiduswriter/fiduswriter
fiduswriter/document/models.py
Python
agpl-3.0
11,689
# Copyright Vertex.AI import ctypes import json class Context(object): def __init__(self, lib): self._as_parameter_ = lib.vai_alloc_ctx() if not self._as_parameter_: raise MemoryError('PlaidML operation context') self._free = lib.vai_free_ctx self._cancel = lib.vai_ca...
flaub/plaidml
plaidml/context.py
Python
agpl-3.0
865
# -*- coding: utf-8 -*- # © <YEAR(S)> ClearCorp # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). import account_move_line
ClearCorp/odoo-clearcorp
exchange_rate_calculated/models/__init__.py
Python
agpl-3.0
144
import rules @rules.predicate def is_phone_number_owner(person, phone_number): if phone_number: return person == phone_number.person else: return person.phone_numbers.exists()
zapcoop/vertex
vertex_api/contacts/rules/phonenumber.py
Python
agpl-3.0
202
# -*- coding: utf-8 -*- """ This is the common settings file, intended to set sane defaults. If you have a piece of configuration that's dependent on a set of feature flags being set, then create a function that returns the calculated value based on the value of FEATURES[...]. Modules that extend this one can change th...
dsajkl/123
lms/envs/common.py
Python
agpl-3.0
62,841
import wizard import account_invoice
funkring/fdoo
addons-funkring/subscription_invoice/__init__.py
Python
agpl-3.0
36
# -*- coding: utf-8 -*- ############################################################################## # # This file is part of medical_his, # an Odoo module. # # Copyright (c) 2015 ACSONE SA/NV (<http://acsone.eu>) # # medical_his is free software: # you can redistribute it and/or modify it under t...
ShaheenHossain/eagle-medical
medical_his/tests/test_medical_hospital_room.py
Python
agpl-3.0
2,081
# Copyright 2014 Pedro M. Baeza <pedro.baeza@tecnativa.com> # Copyright 2015 Antonio Espinosa <antonioea@antiun.com> # Copyright 2015 Jairo Llopis <jairo.llopis@tecnativa.com> # Copyright 2017 David Vidal <david.vidal@tecnativa.com> # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html { "name": "Partne...
syci/partner-contact
partner_contact_job_position/__manifest__.py
Python
agpl-3.0
823