repo_name
stringlengths
5
104
path
stringlengths
4
248
content
stringlengths
102
99.9k
andrewbates09/FERGUS
fergus/__init__.py
''' Library for doing fun things with computers. ''' __author__ = 'Andrew M Bates' __version__ = '0.001' import io, os, sys # the core imports go here # this should go in in the mods dir try: '''IF RASPBERRY PI & HAS A GPIO BOARD''' import RPi.GPIO as RPi except ImportError: pass
nsubiron/SublimeSuricate
lib/thirdparty/duckduckgo2html.py
#!/usr/bin/env python3 """Retrieve results from the DuckDuckGo zero-click API in simple HTML format.""" import json as jsonlib import logging import re import urllib.request, urllib.error, urllib.parse __version__ = (1, 0, 0) def results2html(results, results_priority=None, max_number_of_results=None, ...
arrabito/DIRAC
tests/Integration/Monitoring/Test_MonitoringSystem.py
""" It is used to test client->db-> service. It requires the Monitoring service to be running and installed (so discoverable in the .cfg), and this monitoring service should be connecting to an ElasticSeach instance """ # pylint: disable=invalid-name,wrong-import-position import unittest import tempfile import t...
dynaryu/inasafe
safe/storage/test/test_raster.py
# coding=utf-8 """**Tests for safe raster layer class** contains tests for QGIS specific methods. See test_io.py also """ __author__ = 'Dmitry Kolesov <kolesov.dm@gmail.com>' __revision__ = '$Format:%H$' __date__ = '28/12/2013' __license__ = "GPL" __copyright__ = 'Copyright 2012, Australia Indonesia Facility f...
jelly/calibre
src/calibre/ebooks/metadata/sources/base.py
#!/usr/bin/env python2 # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2011, Kovid Goyal <kovid@kovidgoyal.net>' __docformat__ = 'restructuredtext en' import re, th...
djo938/GPSPythonSharingWithPyro
clientTest.py
#!/usr/bin/python from pysharegps import sharedGpsClient import logging if __name__ == "__main__": logging.basicConfig(format='%(asctime)s %(message)s',level=logging.DEBUG) client = sharedGpsClient() if client.isInit(): position = client.getSharedObject().getPosition() print "latitude...
LyzardKing/ubuntu-make
umake/frameworks/dart.py
# -*- coding: utf-8 -*- # Copyright (C) 2014 Canonical # # Authors: # Didier Roche # # 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; version 3. # # This program is distributed in the hope that ...
vmonteco/YAPT
test_files/uu_cases_regular.py
# -*- coding: utf-8 -*- from tools.factories import generator_factory import ctypes basic_cases = [ [b'%U\n', ctypes.c_long(0)], [b'% U\n', ctypes.c_long(0)], [b'%+U\n', ctypes.c_long(0)], [b'%-U\n', ctypes.c_long(0)], [b'%0U\n', ctypes.c_long(0)], [b'%#U\n', ctypes.c_long(0)], [b'%10U\n',...
mmcauliffe/linguistic-helper-functions
linghelper/phonetics/vowels/mahalanobis.py
import numpy as np ### 1: IH ### 2: EH ### 3: AE ### 4: AO ### 6: AH ### 7: UH ### ### 11: iyC beat ### 12: iyF be ### 21: eyC bait ### 22: eyF bay ### 41: ayV buy ### 47: ayO bite ### 61: oy boy ### 42: aw bough ### 62: owC boat ### 63: owF bow ### 72: uwC boot ### 73: uwF too ### 82: iw suit ### 43: ah father ### 53...
ravrahn/HangoutsBot
hangupsbot/plugins/__init__.py
import os import sys import logging import inspect from inspect import getmembers, isfunction from commands import command import handlers logger = logging.getLogger(__name__) class tracker: def __init__(self): self.bot = None self.list = [] self.reset() def set_bot(self, bot): ...
tkupek/tkupek-elearning
tkupek_elearning/elearning/migrations/0011_setting_logo.py
# -*- coding: utf-8 -*- # Generated by Django 1.9.1 on 2016-02-09 20:48 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('elearning', '0010_auto_20160209_2042'), ] operations = [ migrations.AddField...
MikeRixWolfe/projecteuler
e003.py
def is_prime(n): for j in xrange(3, long(n**.5)+1, 2): if n%j == 0 or n%2 == 0: return False return True def lpf(n): for i in xrange(3, long(n**.5)+1, 2): if n%i == 0: if is_prime(i): s = i return s if __name__ == "__main__": from time impo...
EarToEarOak/RTLSDR-Scanner
rtlsdr_scanner/devices.py
# # rtlsdr_scan # # http://eartoearoak.com/software/rtlsdr-scanner # # Copyright 2012 -2015 Al Brown # # A frequency scanning GUI for the OsmoSDR rtl-sdr library at # http://sdr.osmocom.org/trac/wiki/rtl-sdr # # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Gener...
edio/randrctl
randrctl/xrandr.py
import os from functools import reduce, lru_cache import logging import re import subprocess from randrctl import DISPLAY, XAUTHORITY from randrctl.exception import XrandrException, ParseException from randrctl.model import Profile, Viewport, XrandrConnection, Display logger = logging.getLogger(__name__) class Xra...
dymkowsk/mantid
scripts/Diffraction/isis_powder/hrpd_routines/hrpd_advanced_config.py
from __future__ import (absolute_import, division, print_function) from isis_powder.hrpd_routines.hrpd_enums import HRPD_TOF_WINDOWS absorption_correction_params = { "cylinder_sample_height": 2.0, "cylinder_sample_radius": 0.3, "cylinder_position": [0., 0., 0.], "chemical_formula": "V" } # Default cr...
jhole89/convet-image-classifier
test/test_dataset.py
from main.dataset import DataSet import numpy as np def test_dataset(load_image_data, image_size): images, labels, ids, cls, _ = load_image_data dataset = DataSet(images, labels, ids, cls) assert sorted(list(dataset.cls)) == sorted(['cat', 'dog'] * 10) assert dataset.cls.shape == (20,) assert ...
dpdani/tBB
tBB/settings.py
#!/usr/bin/python3 # # tBB 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. # # tBB is distributed in the hope that it will be useful, #...
itucsdb1509/itucsdb1509
clubs.py
import datetime import os import json import re import psycopg2 as dbapi2 from flask import Flask from flask import redirect from flask import request from flask import render_template from flask.helpers import url_for from store import Store from fixture import * from sponsors import * from curlers import * from cl...
Kagenoshin/plugin.video.afltv
resources/lib/index.py
# # AFLTV XBMC Plugin # Copyright (C) 2013 Kagenoshin # # AFLTV 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. # # ...
cbitstech/Purple-Robot-Django
migrations/0037_auto__add_field_purplerobotdevice_first_reading_timestamp.py
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'PurpleRobotDevice.first_reading_timestamp' db.add_column(...
Sunhick/design-patterns
Creational/AbstractFactory/GeometryFactory/GeometryFactory.py
#!/usr/bin/python import Colors import Shapes from abc import ABCMeta, abstractmethod class AbstractFactory(object): __metaclass__ = ABCMeta @abstractmethod def get_color(self, color): pass @abstractmethod def get_shape(self, shape): pass class ShapeFactory(AbstractFactory): ...
tkolhar/robottelo
tests/foreman/ui/test_architecture.py
# -*- encoding: utf-8 -*- """Test class for Architecture UI""" from fauxfactory import gen_string from nailgun import entities from robottelo.datafactory import generate_strings_list, invalid_values_list from robottelo.decorators import run_only_on, tier1 from robottelo.test import UITestCase from robottelo.ui.factory ...
skorokithakis/nxt-python
nxt/server.py
# nxt.server module -- LEGO Mindstorms NXT socket interface module # Copyright (C) 2009 Marcus Wanner # # 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 ...
timm-tem/RPi_mediaserver
piface/output7off.py
# THIS IS THE PYTHON CODE FOR PiFACE OUTPUT OFF # # Copyright (C) 2014 Tim Massey # # 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 you...
hroncok/freeipa
ipapython/ipa_log_manager.py
# Authors: John Dennis <jdennis@redhat.com> # # Copyright (C) 2011 Red Hat # see file 'COPYING' for use and warranty information # # 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...
ARTFL-Project/PhiloLogic4
extras/utilities/tei_cleanup.py
import sys import regex as re from BeautifulSoup import BeautifulStoneSoup as bss # REQUIRES BeautifulSoup3. BS4 breaks on Python recursion errors when it gets badly damaged texts. def cleanup(infile, outfile): # main routine. takes a file handle for input and output; called at the bottom of the file. text...
northern-bites/nao-man
noggin/players/pData.py
import os from . import SoccerFSA from . import DataStates class SoccerPlayer(SoccerFSA.SoccerFSA): def __init__(self, brain): SoccerFSA.SoccerFSA.__init__(self,brain) self.addStates(DataStates) self.setName('pData') self.postDistance = 50 self.lastDistance = 0 # Sp...
lcpt/xc
verif/tests/elements/crd_transf/test_element_axis_03.py
# -*- coding: utf-8 -*- __author__= "Luis C. Pérez Tato (LCPT) and Ana Ortega (AOO)" __copyright__= "Copyright 2015, LCPT and AOO" __license__= "GPL" __version__= "3.0" __email__= "l.pereztato@gmail.com" import xc_base import geom import xc from solution import predefined_solutions from model import predefined_spaces...
KWierso/treeherder
tests/log_parser/test_performance_parser.py
import json from treeherder.log_parser.parsers import (EmptyPerformanceData, PerformanceParser) def test_performance_log_parsing_malformed_perfherder_data(): """ If we have malformed perfherder data lines, we should just ignore them and still be able to parse th...
Tayamarn/socorro
socorro/signature/__main__.py
# 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/. from __future__ import print_function import argparse import csv import logging import logging.config import os import ...
mozilla/pto
pto/apps/dates/views.py
# 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/. import sys import traceback from StringIO import StringIO import re import datetime from urllib import urlencode from co...
lepistone/manifold
nginx.py
from flask import render_template class NginxConfigRenderer(): def __init__(self, manifold): self.manifold = manifold self.app = manifold.app def render(self, minions): with self.app.app_context(): return render_template('nginx/nginx.conf', ...
ecreall/lagendacommun
lac/views/admin_process/manage_keywords.py
# Copyright (c) 2014 by Ecreall under licence AGPL terms # available on http://www.gnu.org/licenses/agpl.html # licence: AGPL # author: Amen Souissi import colander from pyramid.view import view_config from dace.processinstance.core import DEFAULTMAPPING_ACTIONS_VIEWS from pontus.default_behavior import Cancel from ...
avanzosc/avanzosc6.1
avanzosc_tree_grid_ext/__openerp__.py
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2008-2013 AvanzOSC S.L. All Rights Reserved # Date: 01/07/2013 # # This program is free software: you can redistribute it and/or modif...
ecino/compassion-switzerland
sponsorship_switzerland/models/correspondence.py
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2019 Compassion CH (http://www.compassion.ch) # Releasing children from poverty in Jesus' name # @author: Samy Bucher <samy.bucher@outlook.com> # # The licence is in the file __manifest__...
Parisson/TimeSide
timeside/server/management/commands/timeside-create-admin-user.py
from optparse import make_option from django.conf import settings from django.core.management.base import BaseCommand, CommandError from django.contrib.auth.models import User from rest_framework.authtoken.models import Token class Command(BaseCommand): help = """Create a default admin user if it doesn't exist. ...
Trust-Code/trust-addons
trust_sale/models/__init__.py
# -*- encoding: utf-8 -*- ############################################################################### # # # Copyright (C) 2015 Trustcode - www.trustcode.com.br # # ...
eLBati/website
website_event_register_free_with_sale/models/website.py
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (c) 2015 Serv. Tecnol. Avanzados (http://www.serviciosbaeza.com) # Pedro M. Baeza <pedro.baeza@serviciosbaeza.com> # # This program is free software: you can redistribute it a...
gcobos/rft
app/primitives/__init__.py
# Generated file. Do not edit __author__="drone" from Abs import Abs from And import And from Average import Average from Ceil import Ceil from Cube import Cube from Divide import Divide from Double import Double from Equal import Equal from Even import Even from Floor import Floor from Greaterorequal import Greateror...
stvstnfrd/edx-platform
openedx/core/djangoapps/theming/helpers.py
""" Helpers for accessing comprehensive theming related variables. This file is imported at startup. Imports of models or things which import models will break startup on Django 1.9+. If you need models here, please import them inside the function which uses them. """ import os import re from logging import getLogge...
UWCS/uwcs-website
uwcs_website/choob/views.py
from django.shortcuts import render_to_response from django.http import HttpResponseRedirect from django.core.paginator import Paginator from uwcs_website.choob.models import * def quotes_page(request): quoters = map(lambda q:q[0],QuoteObject.objects.all().values_list('quoter').distinct()) quoted = map(lambda...
uclouvain/osis_louvain
base/migrations/0208_create_role_executive.py
# -*- coding: utf-8 -*- # Generated by Django 1.11.2 on 2017-11-22 07:11 from __future__ import unicode_literals from django.core.management.sql import emit_post_migrate_signal from django.db import migrations def add_executive_group(apps, schema_editor): # create group db_alias = schema_editor.connection.al...
gopalkoduri/vichakshana-public
vichakshana/SASD.py
from __future__ import division from os.path import expanduser, exists from os import chdir, mkdir import pickle import numpy as np from scipy import sparse import networkx as nx home = expanduser('~') chdir(home+'/workspace/vichakshana/vichakshana/') #CELERY from mycelery import app class SASD(): def __init__...
brousch/opencraft
instance/tasks.py
# -*- coding: utf-8 -*- # # OpenCraft -- tools to aid developing and hosting free software projects # Copyright (C) 2015 OpenCraft <xavier@opencraft.com> # # 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 Soft...
kislyuk/cartographer
postproc_db.py
#!/usr/bin/env python3 import os, sys, logging, urllib, time, string, json, argparse, collections, datetime, re, bz2, math from concurrent.futures import ThreadPoolExecutor, wait import lz4 pool = ThreadPoolExecutor(max_workers=16) logging.basicConfig(level=logging.DEBUG) sys.path.append(os.path.join(os.path.dirnam...
YunoHost/moulinette
test/src/authenticators/dummy.py
# -*- coding: utf-8 -*- import logging from moulinette.utils.text import random_ascii from moulinette.core import MoulinetteError, MoulinetteAuthenticationError from moulinette.authentication import BaseAuthenticator logger = logging.getLogger("moulinette.authenticator.yoloswag") # Dummy authenticator implementation...
ESOedX/edx-platform
openedx/core/djangoapps/credit/models.py
# -*- coding: utf-8 -*- """ Models for Credit Eligibility for courses. Credit courses allow students to receive university credit for successful completion of a course on EdX """ from __future__ import absolute_import import datetime import logging from collections import defaultdict import pytz import six from con...
silviacanessa/oq-hazardlib
openquake/hazardlib/mfd/evenly_discretized.py
# The Hazard Library # Copyright (C) 2012-2014, GEM Foundation # # 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 Foundation, either version 3 of the # License, or (at your option) any later version. ...
procangroup/edx-platform
common/djangoapps/student/apps.py
""" Configuration for the ``student`` Django application. """ from __future__ import absolute_import from django.apps import AppConfig from django.contrib.auth.signals import user_logged_in class StudentConfig(AppConfig): """ Default configuration for the ``student`` application. """ name = 'student'...
jss-emr/openerp-7-src
openerp/addons/mail/wizard/mail_compose_message.py
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2010-Today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
EduPepperPDTesting/pepper2013-testing
lms/djangoapps/certificates/views.py
from django.contrib.auth.decorators import login_required import logging from certificates.models import GeneratedCertificate from certificates.models import CertificateStatuses as status from django.views.decorators.csrf import csrf_exempt from django.http import HttpResponse import json #@begin:View certificate page...
helfertool/helfertool
src/badges/migrations/0004_auto_20160306_1424.py
# -*- coding: utf-8 -*- # Generated by Django 1.9.4 on 2016-03-06 13:24 from __future__ import unicode_literals import django.core.validators from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('badges', '0003_badgedesign_bg_color'), ] operations = ...
mpw1337/RocketMap
pogom/search.py
#!/usr/bin/python # -*- coding: utf-8 -*- ''' Search Architecture: - Have a list of accounts - Create an "overseer" thread - Search Overseer: - Tracks incoming new location values - Tracks "paused state" - During pause or new location will clears current search queue - Starts search_worker threads - Se...
yourcelf/btb
scanblog/scanblog/default_settings.py
# -*- coding: utf-8 -*- import os.path from btb.log_filter import skip_unreadable_post BASE_DIR = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) TEST_RUNNER = 'btb.test_runner.BtbTestRunner' # # Locale # TIME_ZONE = 'US/Eastern' LANGUAGE_CODE = 'en-us' SITE_ID = 1 USE_I18N = True USE_L10N = True # # Fil...
schedulix/schedulix
src/examples/SimpleAccess3.py
import sdms server = { 'HOST' : 'localhost', 'PORT' : '2506', 'USER' : 'SYSTEM', 'PASSWORD' : 'VerySecret' } conn = sdms.SDMSConnectionOpenV2(server, server['USER'], server['PASSWORD'], "Simple Access Example") try: if 'ERROR' in conn: print(str(conn)) exit(1) except: pass stmt = "LIST SESSIONS;" re...
Aurorastation/BOREALISbot2
cogs/dm_eval.py
import os import aiohttp import random import string import asyncio import shutil import re from threading import Thread from io import BytesIO from zipfile import ZipFile from discord.ext import commands from core import BotError DEFAULT_MAJOR = "512" DEFAULT_MINOR = "1416" class WindowsProcessThread(Thread): ...
MuckRock/muckrock
muckrock/accounts/migrations/0021_auto_20161228_1233.py
# -*- coding: utf-8 -*- # Generated by Django 1.9.9 on 2016-12-28 12:33 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('accounts', '0020_profile_preferred_proxy'), ] operations = [ migrations.AddField( model_name='statistic...
timtadh/gitolite-manager
gitolite_manager/views/user.py
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' gitolite-manager Author: Tim Henderson Contact: tim.tadh@gmail.com, tadh@case.edu Copyright: 2013 All Rights Reserved, see LICENSE ''' import urllib, re import cgi from logging import getLogger log = getLogger('gm:view:user') from pyramid.view import view_config fro...
ksrajkumar/openerp-6.1
openerp/addons/itara_customer_commission/__openerp__.py
# -*- 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...
chrisndodge/edx-platform
common/lib/xmodule/xmodule/capa_base.py
"""Implements basics of Capa, including class CapaModule.""" import cgi import copy import datetime import hashlib import json import logging import os import traceback import struct import sys import re # We don't want to force a dependency on datadog, so make the import conditional try: import dogstats_wrapper a...
PabloCastellano/libreborme
borme/management/commands/importborme.py
from django.core.management.base import BaseCommand from django.utils import timezone import logging import time from borme.models import Config from borme.parser.importer import import_borme_download # from borme.parser.postgres import psql_update_documents import borme.parser.importer from libreborme.utils import ...
fnp/wolnelektury
src/infopages/migrations/0001_initial.py
# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. # from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( ...
jbassen/edx-platform
lms/djangoapps/courseware/tabs.py
""" This module is essentially a broker to xmodule/tabs.py -- it was originally introduced to perform some LMS-specific tab display gymnastics for the Entrance Exams feature """ from django.conf import settings from django.utils.translation import ugettext as _, ugettext_noop from courseware.access import has_access f...
Micronaet/micronaet-script
DropboxWebsite/dropbox.py
############################################################################### # # Copyright (C) 2001-2014 Micronaet SRL (<http://www.micronaet.it>). # # 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 ...
HelloLily/hellolily
lily/cases/migrations/0019_auto_20170418_1243.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('cases', '0018_auto_20170418_1220'), ] operations = [ migrations.AlterField( model_name='case', name=...
cedricbonhomme/services
freshermeat/web/views/api/v1/language.py
#! /usr/bin/env python # -*- coding: utf-8 -*- # Freshermeat - An open source software directory and release tracker. # Copyright (C) 2017-2020 Cédric Bonhomme - https://www.cedricbonhomme.org # # For more information: https://sr.ht/~cedric/freshermeat # # This program is free software: you can redistribute it and/or ...
JARR-aggregator/JARR
newspipe/commands.py
#! /usr/bin/env python # -*- coding: utf-8 -*- import logging import os from dateutil.relativedelta import relativedelta from datetime import datetime, date import click from werkzeug.security import generate_password_hash import newspipe.models from newspipe.bootstrap import application, db from newspipe.controller...
pku9104038/edx-platform
common/lib/capa/capa/capa_problem.py
# # File: capa/capa_problem.py # # Nomenclature: # # A capa Problem is a collection of text and capa Response questions. # Each Response may have one or more Input entry fields. # The capa problem may include a solution. # """ Main module which shows problems (of "capa" type). This is used by capa_module. """ from ...
c2corg/v6_api
c2corg_api/tests/views/test_topo_map.py
import json from c2corg_api.models.route import Route from c2corg_api.models.topo_map import ArchiveTopoMap, TopoMap, MAP_TYPE from c2corg_api.models.topo_map_association import TopoMapAssociation from c2corg_api.models.waypoint import Waypoint from c2corg_api.tests.search import reset_search_index from c2corg_api.mod...
umitproject/site-status
status_cron/urls.py
#!/usr/bin/env python # -*- coding: utf-8 -*- ## ## Author: Adriano Monteiro Marques <adriano@umitproject.org> ## ## Copyright (C) 2011 S2S Network Consultoria e Tecnologia da Informacao LTDA ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU Affero General Publi...
JuezUN/INGInious
inginious/frontend/plugins/problem_bank/pages/api/filter_tasks_api.py
import web from inginious.frontend.plugins.utils.admin_api import AdminApi from inginious.frontend.plugins.utils import get_mandatory_parameter class FilterTasksApi(AdminApi): def API_POST(self): parameters = web.input() task_query = get_mandatory_parameter(parameters, "task_query") lim...
renalreg/radar
radar/models/patient_addresses.py
#! -*- coding: utf-8 -*- from collections import OrderedDict from sqlalchemy import Column, Date, ForeignKey, Index, String from sqlalchemy import Integer from sqlalchemy.orm import relationship from radar.database import db from radar.models.common import MetaModelMixin, patient_id_column, patient_relationship, uuid...
cedricbonhomme/c-dric-on-mange-o-midi
refuge/__init__.py
#! /usr/bin/env python # -*- coding: utf-8 -*- import os import json from flask import Flask app = Flask(__name__) app.config.from_object(__name__) # Loads the restaurants RESTAURANTS = {} with open('./refuge/var/restaurants.json', 'r') as f: RESTAURANTS = json.load(f) AREAS = { "Kirchberg": [49.638...
r0k3/arctic
tests/unit/date/test_util.py
import pytest import pytz from datetime import datetime as dt from arctic.date import datetime_to_ms, ms_to_datetime, mktz, to_pandas_closed_closed, DateRange, OPEN_OPEN, CLOSED_CLOSED from arctic.date._mktz import DEFAULT_TIME_ZONE_NAME from arctic.date._util import to_dt @pytest.mark.parametrize('pdt', [ ...
mfittere/SixDeskDB
sixdeskdb/davsturns.py
# da vs turns module import numpy as np from scipy import optimize import matplotlib.pyplot as pl import glob, sys, os, time from deskdb import SixDeskDB,tune_dir,mk_dir import matplotlib # ------------- basic functions ----------- def get_divisors(n): """finds the divisors of an integer number""" large_divisors = ...
lu-zero/aravis
tests/python/arv-enum-test.py
#!/usr/bin/env python # Aravis - Digital camera library # # Copyright (c) 2011-2012 Emmanuel Pacaud # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2 of the License, o...
jhaase1/zapdos
problems/Schottky_emission/transient/no_ballast/parametric/base/OldUnAveragedSystemData.py
#### import the simple module from the paraview from paraview.simple import * import glob, re, os, numpy, csv def CreatePointSelection(ids): source = IDSelectionSource() source.FieldType = "POINT" sids = [] for i in ids: sids.append(0) #proc-id sids.append(i) #cell-id source.IDs = sids ...
gares/coq
doc/tools/coqrst/coqdomain.py
########################################################################## ## # The Coq Proof Assistant / The Coq Development Team ## ## v # Copyright INRIA, CNRS and contributors ## ## <O___,, # (see version control and CREDITS file for authors & dates) ## ## \VV/ #########...
djpine/linfit
setup.py
#!/usr/bin/python3 # -*- coding: utf-8 -*- # Copyright © 2014 Martin Ueding <dev@martin-ueding.de> # Licensed under The Lesser GNU Public License Version 2 (or later) from setuptools import setup, find_packages setup( author="David Pine", description="Least squares linear fit for numpy library of Python", ...
ewheeler/rapidsms-core
lib/rapidsms/tests/harness.py
#!/usr/bin/env python # vim: ai ts=4 sts=4 et sw=4 import os from rapidsms.router import Router from rapidsms.backends.backend import Backend from rapidsms.app import App # a really dumb Logger stand-in class MockLogger (list): def __init__(self): # enable logging during tests with an # environment variable,...
dabear/torrentstatus
torrentstatus/plugins/builtin.torrent.onstart.settorrentlabels.py
from torrentstatus.plugin import iTorrentAction from torrentstatus.utorrent.connection import Connection from contextlib import contextmanager from torrentstatus.bearlang import BearLang from torrentstatus.settings import config, labels_config from torrentstatus.utils import intTryParse @contextmanager def utorrent...
csengstock/tcpserv
tcpserv.py
# tcpserv # # Copyright (c) 2015 Christian Sengstock, All rights reserved. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 3.0 of the License, or (at your option) any l...
ahmad88me/PyGithub
github/Project.py
############################ Copyrights and license ############################ # # # Copyright 2018 bbi-yggy <yossarian@blackbirdinteractive.com> # # ...
goinnn/django-model-history
example/news/tests.py
# -*- coding: utf-8 -*- # Copyright (c) 2015 by Pablo Martín <goinnn@gmail.com> # # This software is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) a...
hantsaniala/KrC
chat_client.py
# chat_client.py import sys, socket, select def chat_client(): if(len(sys.argv) < 3) : print 'Usage : python chat_client.py hostname port' sys.exit() host = sys.argv[1] port = int(sys.argv[2]) s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.settimeout(2) # connect to...
laurentb/weboob
modules/lameteoagricole/module.py
# -*- coding: utf-8 -*- # Copyright(C) 2017 Vincent A # # This file is part of a weboob module. # # This weboob module 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 Licen...
ina-foss/ID-Fits
lib/datasets/landmarks_file.py
# ID-Fits # Copyright (c) 2015 Institut National de l'Audiovisuel, INA, All rights reserved. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 3.0 of the License, or (at...
34383c/pyNeuroML
pyneuroml/lems/__init__.py
import os.path from pyneuroml.lems.LEMSSimulation import LEMSSimulation import shutil import os from pyneuroml.pynml import read_neuroml2_file, get_next_hex_color, print_comment_v, print_comment import random def generate_lems_file_for_neuroml(sim_id, neuroml_file, ...
krathjen/studiolibrary
src/studiolibrary/librarywindow.py
# Copyright 2020 by Kurt Rathjen. All Rights Reserved. # # This library is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. This ...
cgre-aachen/gempy
examples/tutorials/ch5_probabilistic_modeling_DEP/ch5_1.py
""" 5.1 - Probabilistic Modeling: Error Propagation ================================================ In this example we will show how easy we can propagate uncertainty from GemPy parameters to final structural models. """ # %% import sys, os sys.path.append("../../gempy") os.environ["THEANO_FLAGS"] = "mode=FAST_RUN,...
saullocastro/pyNastran
pyNastran/bdf/cards/elements/beam.py
# pylint: disable=R0904,R0902,E1101,E1103,C0111,C0302,C0103,W0101 from six import string_types import numpy as np from numpy.linalg import norm from pyNastran.utils import integer_types from pyNastran.bdf.cards.elements.bars import CBAR, LineElement from pyNastran.bdf.bdf_interface.assign_type import ( int...
JHUISI/charm
charm/schemes/pksig/pksig_ps03.py
""" Identity Based Signature | From: "David Pointcheval and Olivier Sanders. Short Randomizable Signatures" | Published in: 2015 | Available from: https://eprint.iacr.org/2015/525.pdf * type: signature (identity-based) * setting: bilinear groups (asymmetric) :Authors: Lovesh Harchandani :Date: ...
erickeller/edi
tests/lib/test_playbookrunner.py
# -*- coding: utf-8 -*- # Copyright (C) 2016 Matthias Luescher # # Authors: # Matthias Luescher # # This file is part of edi. # # edi is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of...
joerabelo/geraldo
geraldo/graphics.py
from reportlab.lib.colors import black from reportlab.lib.units import cm from base import BAND_WIDTH, BAND_HEIGHT, Element class Graphic(Element): """Base graphic class""" visible = True stroke = True stroke_color = black stroke_width = 1 fill = False fill_color = black def __init_...
AlessandroZ/LaZagne
Linux/lazagne/softwares/wifi/wifi.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import os from lazagne.config.module_info import ModuleInfo try: from ConfigParser import RawConfigParser # Python 2.7 except ImportError: from configparser import RawConfigParser # Python 3 from collections import OrderedDict class Wifi(ModuleInfo): d...
Patola/Cura
plugins/UM3NetworkPrinting/src/Cloud/Models/CloudClusterPrinterStatus.py
# Copyright (c) 2018 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. from typing import List, Union, Dict, Optional, Any from cura.PrinterOutput.PrinterOutputController import PrinterOutputController from cura.PrinterOutput.Models.PrinterOutputModel import PrinterOutputModel from .CloudClust...
pyfa-org/eos
tests/mod_builder/modinfo/affectee_filter/test_affectee_dom_grp.py
# ============================================================================== # Copyright (C) 2011 Diego Duclos # Copyright (C) 2011-2018 Anton Vorobyov # # This file is part of Eos. # # Eos is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as publi...
lablup/sorna-manager
src/ai/backend/gateway/types.py
from __future__ import annotations from typing import ( Any, Awaitable, Callable, Iterable, AsyncIterator, Tuple, Mapping, ) from aiohttp import web import aiohttp_cors WebRequestHandler = Callable[ [web.Request], Awaitable[web.StreamResponse] ] WebMiddleware = Callable[ [web.Request...
bmya/odoo-support
adhoc_modules_server/octohub/exceptions.py
# Copyright (c) 2013 Alon Swartz <alon@turnkeylinux.org> # # This file is part of OctoHub. # # OctoHub is free software; you can redistribute it and/or modify it under the # terms of the GNU General Public License as published by the Free Software # Foundation; either version 3 of the License, or (at your option) any l...
SIM-TU-Darmstadt/mbslib
dependencies/mbstestlib/src/testsetXML2intermediateConverter.py
#!/usr/bin/python #=============================================================================== # # conversion script to create a mbstestlib readable file containing test specifications # out of an testset file in XML format # #=============================================================================== # Input c...