repo_name stringlengths 5 104 | path stringlengths 4 248 | content stringlengths 102 99.9k |
|---|---|---|
jonobrien/School_Backups | cs1-python/Labs/week 9/kebab_spot.py | """
Description: A module that represents "spots" on the skewer.
Author: Sean Strout
Author: James Heliotis
Author: Jon O'Brien
"""
import food
class NoneNode():
"""A class to represent no node"""
__slots__ = ()
"""A global constant for no node"""
NONE_NODE = NoneNode()
class KebabSpot(object):
"""... |
lcy2/otwPython | natas30/natas30.py | import requests
user_auth = ('natas30','wie9iexae0Daihohv8vuu3cei9wahf0e')
target = 'http://natas30.natas.labs.overthewire.org/index.pl'
payload = 'username=natas31&password=2&password=1\' OR 1=1&password=2'
payload2 = 'username=natas31&password=1'
payload3 = "username='natas31' OR '1'='1'&username=3&password='1'"... |
tuergeist/HackerRank | challenges/sock_merchant.py | # URL
# https://www.hackerrank.com/challenges/sock-merchant
import unittest
def main():
data = readFromStdin()
print(sock_pairs(data))
def readFromStdin():
_ = int(input().strip())
data = [int(c_temp) for c_temp in input().strip().split(' ')]
return data
def sock_pairs(data):
sdic = {}
pa... |
DIRACGrid/DIRAC | tests/Performance/MySQLJobMonitoring/test_scripts/query.py | """
Performance test created using multi-mechnize to analyze time
for query processing with MySQL.
"""
import random
import time
from DIRAC.WorkloadManagementSystem.DB.JobDB import JobDB
class Transaction(object):
def __init__(self):
self.JobDB = JobDB()
self.custom_timers = {}
def run(sel... |
andreymal/mini_fiction | mini_fiction/downloads/base.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
import zipfile
from flask import url_for, render_template
from mini_fiction.utils import misc
class BaseDownloadFormat(object):
extension = None
name = None
content_type = 'application/octet-stream'
debug_content_type = 'text/plain; charset=utf... |
rplevka/robottelo | pytest_plugins/markers.py | # Custom markers for robottelo tests
def pytest_configure(config):
"""Register custom markers to avoid warnings."""
markers = [
"deselect(reason=None): Mark test to be removed from collection.",
"skip_if_open(issue): Skip test based on issue status.",
"tier1: Tier 1 tests", # CRUD tes... |
octoalmawaukh/math-waffle | work in progress/## 60 list of probability distributions/imgsrc/pdf_cauchy.py | import numpy as np
import scipy.special as sps
import matplotlib.pyplot as plt
from pylab import rcParams
def make_beta(zer, gam):
return lambda x: 1.0 / (np.pi * gam * (1 + (x - zer / gam) ** 2))
def main():
rcParams['figure.figsize'] = 8, 6
# figure(num=None, facecolor='w', edgecolor='k')
ax = pl... |
Bone-Imaging-ToolKit/BItk | bitk/core/rescale.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# title : rescale.py
# description : Normalize data into a defined range/type
# copyright : (c) 2017 I3MTO laboratory. All Rights Reserved
# author(s) : Thomas Janvier
# creation : 01 December 2017
# modification : 17 December 2017
#
#... |
ocelot-collab/ocelot | demos/sr/coherent_rad.py | __author__ = 'Sergey Tomin'
import sys
import matplotlib
from ocelot.rad import *
from ocelot.gui import *
from ocelot import *
from ocelot.rad.radiation_py import *
from ocelot.rad.undulator_params import *
import copy
sigma_tau = 100e-6/2.36
tau_p_cor = 0.013/2.36
tau = np.array([-1, 0, 1])*sigma_tau
phi = tau/1.... |
jyejare/robottelo | tests/foreman/cli/test_docker.py | """Tests for the Docker feature.
:Requirement: Docker
:CaseAutomation: Automated
:CaseLevel: Component
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
from random import choice
from random import randint
import pytest
from fauxfactory import gen_string
from fauxfactory import gen_url
from wait_for ... |
exmachina-dev/WDY-firmware | tools/graph_spiral.py | """
ldr.py
Display analog data from Arduino using Python (matplotlib)
Author: Mahesh Venkitachalam
Website: electronut.in
"""
import argparse
import numpy as np
import math
import matplotlib.pyplot as plt
import matplotlib.animation as animation
_S_THK = 1.1
_D_DIA = 120
WDY_MAX_POSITION = 30000
WDY_STRAP_DEAD_OFFS... |
FabriceSalvaire/PyValentina | Patro/__init__.py | ####################################################################################################
#
# Patro - A Python library to make patterns for fashion design
# Copyright (C) 2017 Fabrice Salvaire
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero Gene... |
tbereau/espresso | samples/python/minimal-polymer.py |
#
# Copyright (C) 2013,2014,2015,2016 The ESPResSo project
#
# This file is part of ESPResSo.
#
# ESPResSo 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... |
sanacl/GrimoireELK | grimoire/elk/kitsune.py | #!/usr/bin/python3
# -*- coding: utf-8 -*-
#
#
# Copyright (C) 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... |
Pesa/forse | src/forse/weather_station/WeatherModel.py | ###########################################################################
#
# Copyright (c) 2010 Davide Pesavento <davidepesa@gmail.com>
#
# This file is part of FORSE.
#
# FORSE 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 ... |
MattNolanLab/ei-attractor | doc/conf.py | # -*- coding: utf-8 -*-
#
# Grid cell modeling and data analysis documentation build configuration file, created by
# sphinx-quickstart on Thu Oct 31 21:47:10 2013.
#
# 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
... |
ViennaRNA/forgi | test/forgi/threedee/model/coarse_grain_test.py | from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
from builtins import range
import warnings
import unittest
import sys
import itertools as it
import copy
import time
import math
import logging
import os.path
import os
import shutil
import contextlib
try:
... |
jithinbp/pslab-desktop-apps | psl_res/GUI/E_MISCELLANEOUS/B/templates/hackYourOwn.py | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'hackYourOwn.ui'
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _fromUtf8(s):
return s
try:
_encoding = QtGui.QApplication.UnicodeUTF8
def _translate(context, tex... |
gusibi/dynamodb-py | dynamodb/expression.py | # -*- coding: utf-8 -*-
'''
DynamoDB KeyConditionExpression and FilterExpression
http://boto3.readthedocs.io/en/stable/reference/customizations/dynamodb.html#ref-dynamodb-conditions
'''
from __future__ import print_function
from decimal import Decimal
from boto3.dynamodb.conditions import Key, Attr
from .errors impo... |
mbauskar/erpnext | erpnext/subscription/doctype/subscription/subscription.py | # -*- coding: utf-8 -*-
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
import calendar
from frappe import _
from frappe.desk.form import assign_to
from dateutil.relativedelta import relativedel... |
vincent-noel/libSigNetSim | libsignetsim/model/sbml/RuledVariable.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2014-2017 Vincent Noel (vincent.noel@butantan.gov.br)
#
# This file is part of libSigNetSim.
#
# libSigNetSim 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 Fou... |
discipl/NAML | app/ml_model_v1.py | #standard packages
import pandas as pd
import numpy as np
import matplotlib
matplotlib.use('Agg')
from matplotlib import pyplot as plt
matplotlib.use('Agg')
import sqlite3
import pickle
import re
from flask import json
from sklearn.pipeline import Pipeline
from sklearn.feature_extraction.text import TfidfVectorize... |
freieslabor/info-display | info_display/screens/announcer/models.py | from django.db import models
from django.contrib.auth.models import User
class Announcement(models.Model):
author = models.ForeignKey(
User,
related_name='+',
verbose_name='Reporter'
)
title = models.CharField(
verbose_name='Title',
max_length=256
)
create... |
jwhitlock/kuma | kuma/scrape/tests/test_source.py | # -*- coding: utf-8 -*-
"""Tests for the Source class."""
from __future__ import unicode_literals
import mock
import pytest
from kuma.scrape.sources import Source
from . import mock_requester, mock_storage
class FakeSource(Source):
"""A Fake source for testing shared Source functionality."""
PARAM_NAME = ... |
seprich/py-bson-rpc | bsonrpc/__init__.py | # -*- coding: utf-8 -*-
'''
Library for JSON RPC 2.0 and BSON RPC
'''
from bsonrpc.exceptions import BsonRpcError
from bsonrpc.framing import (
JSONFramingNetstring, JSONFramingNone, JSONFramingRFC7464)
from bsonrpc.interfaces import (
notification, request, rpc_notification, rpc_request, service_class)
from bs... |
ericawright/bedrock | tests/functional/firefox/new/test_download.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 pytest
from pages.firefox.new.download import DownloadPage
# ?v=a param added temporarily to evade a traffic co... |
willkg/socorro-collector | collector/app/for_application_defaults.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/.
"""This is an extension to configman for Socorro. It creates a ValueSource
object that is also a 'from_string_converter... |
cstipkovic/spidermonkey-research | testing/mozharness/mozharness/mozilla/testing/unittest.py | #!/usr/bin/env python
# ***** BEGIN LICENSE BLOCK *****
# 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/.
# ***** END LICENSE BLOCK *****
import os
import re
from mozhar... |
sr-murthy/firefox-ui-tests | firefox_ui_tests/remote/security/test_ssl_status_after_restart.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 marionette_driver import Wait
from firefox_ui_harness.decorators import skip_if_e10s, skip_under_xvfb
from firefox... |
Alidron/demo-nao | alidron-env/lib/python2.7/site-packages/netcall/base_client.py | # vim: fileencoding=utf-8 et ts=4 sts=4 sw=4 tw=0
"""
Base RPC client class
Authors:
* Brian Granger
* Alexander Glyzov
* Axel Voitier
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2012-2014. Brian Granger, Min Ragan-Kelley, Alexander Glyzov,
# Axel Voitier
#
#... |
ecreall/pontus | pontus/view.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 re
from collections import OrderedDict
from webob.multidict import MultiDict
from zope.interface import implementer
from pyramid.view import view_config
import ... |
saycel/saycel | rccn/rapi.py | ############################################################################
#
# Copyright (C) 2013 tele <tele@rhizomatica.org>
#
# REST API Interface to RCCN Modules
# This file is part of RCCN
#
# RCCN is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero Public License as pub... |
aweinstock314/aweinstock-ctf-writeups | cccamp_2019/prejudiced/bendersky_modsqrt.py | # https://eli.thegreenplace.net/2009/03/07/computing-modular-square-roots-in-python
def modular_sqrt(a, p):
""" Find a quadratic residue (mod p) of 'a'. p
must be an odd prime.
Solve the congruence of the form:
x^2 = a (mod p)
And returns x. Note that p - x is also a root.
... |
ecolitan/fatics | src/session.py | # Copyright (C) 2010 Wil Mahan <wmahan+fatics@gmail.com>
#
# This file is part of FatICS.
#
# FatICS 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 optio... |
kerel-fs/skylines | skylines/frontend/views/statistics.py | from flask import Blueprint, render_template, abort, request, jsonify
from sqlalchemy import func, distinct
from skylines.database import db
from skylines.lib.dbutil import get_requested_record
from skylines.lib.vary import vary
from skylines.model import User, Club, Flight, Airport
statistics_blueprint = Blueprint('... |
ecino/compassion-switzerland | partner_communication_switzerland/models/partner_communication.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2016 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Emanuel Cino <ecino@compassion.ch>
#
# The licence is in the file __manifest__.py... |
amcat/amcat-dashboard | dashboard/util/validators.py | from django.core.exceptions import ValidationError
from django.utils.deconstruct import deconstructible
def page_filters_validator(val):
if not isinstance(val, dict):
raise ValidationError
if not all(isinstance(v, list) for v in val.values()):
raise ValidationError
if not all(isinstance(v,... |
Widukind/dlstats | dlstats/tests/fetchers/test_insee.py | # -*- coding: utf-8 -*-
from copy import deepcopy
from datetime import datetime
import os
from pprint import pprint
from dlstats.fetchers.insee import INSEE as Fetcher
from dlstats import constants
import unittest
from unittest import mock
import httpretty
from dlstats.tests.fetchers.base import BaseFetcherTestCase... |
GISAElkartea/amv2 | antxetamedia/settings.py | import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'd2w#o#(!antcw5e%(#p5*pu(x=zhw60^byh$)ps+4#e8m#-fj!'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = TEMPLATE_DEBUG = True
ALLOWE... |
BT-astauder/account-financial-reporting | account_financial_report/report/journal_ledger.py | # Copyright 2017 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models, fields, api
DIGITS = (16, 2)
class ReportJournalLedger(models.TransientModel):
_name = 'report_journal_ledger'
date_from = fields.Date(
required=True
)
date_to = fields.Da... |
Saren-Arterius/textage2bms | tja2bms.py | #!/usr/bin/env python3
from tja_info import *
from sys import argv, stderr
if __name__ == '__main__':
info = None
parse_level = 3
try:
parse_level = TJAInfo.parse_course(argv[2])
except:
pass
for codec in ['utf-8', 'shift-jis', 'gbk']:
try:
with open(argv[1], e... |
cloudbase/maas | src/metadataserver/address.py | # Copyright 2012 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Figure out server address for the maas_url setting."""
from __future__ import (
absolute_import,
print_function,
unicode_literals,
)
str = None
__metaclass__ ... |
etesync/journal-manager | journal/apps.py | # Copyright © 2017 Tom Hacohen
#
# 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, version 3.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY;... |
SysTheron/adhocracy | src/adhocracy/lib/auth/user.py | from paste.deploy.converters import asbool
from pylons import tmpl_context as c, config
from adhocracy.lib.auth.authorization import has
from adhocracy.lib.auth.authorization import NOT_LOGGED_IN
def index(check):
check.perm('user.view')
def show(check, u):
check.perm('user.view')
check.other('user_dele... |
taigaio/taiga-back | taiga/importers/management/commands/import_from_trello.py | # -*- coding: utf-8 -*-
# Copyright (C) 2014-present Taiga Agile LLC
#
# 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 ver... |
GNOME/chronojump-server | email_error_log.py | import ConfigParser
import smtplib, email, email.encoders, email.mime.text, email.mime.base
import string
config = ConfigParser.ConfigParser()
config.read('/etc/chronojump.conf')
def user_comments_from_log(log):
user_comment_separator = "----------"
if log.startswith(user_comment_separator):
text = l... |
jmesteve/saas3 | openerp/addons/mail/mail_thread.py | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2009-today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... |
cpennington/edx-platform | common/lib/xmodule/xmodule/modulestore/tests/utils.py | """
Helper classes and methods for running modulestore tests without Django.
"""
import io
import os
from contextlib import contextmanager
from contextlib2 import ExitStack
from importlib import import_module
from shutil import rmtree
from tempfile import mkdtemp
from unittest import TestCase
from uuid import uuid4
... |
sils1297/coala | coalib/results/result_actions/ApplyPatchAction.py | import shutil
from os.path import isfile
from os import remove
from coalib.results.result_actions.ShowPatchAction import ShowPatchAction
from coalib.results.result_actions.ResultAction import ResultAction
class ApplyPatchAction(ResultAction):
SUCCESS_MESSAGE = "Patch applied successfully."
is_applicable = ... |
khchine5/lino-welfare | lino_welfare/modlib/debts/fields.py | # -*- coding: UTF-8 -*-
# Copyright 2012-2015 Luc Saffre
# This file is part of Lino Welfare.
#
# Lino Welfare 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 y... |
artefactual/archivematica-history | src/dashboard/src/main/urls.py | from django.conf.urls.defaults import *
from django.conf import settings
from django.views.generic.simple import direct_to_template, redirect_to
UUID_REGEX = '[\w]{8}(-[\w]{4}){3}-[\w]{12}'
urlpatterns = patterns('main.views',
# Index
(r'^$', 'home'),
# Forbidden
(r'forbidden/$', 'forbid... |
cloudspaces/eyeos-u1db | eyeos/extern/u1db/ProtocolTest.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'root'
import unittest
from mock import Mock
from Protocol import Protocol
import json
import os
from settings import settings
class ProtocolTest (unittest.TestCase):
def setUp(self):
self.protocol = Protocol(True)
def tearDown(self):
... |
codeback/openerp-cbk_product_web_visible | product.py | # -*- encoding: utf-8 -*-
##############################################################################
#
# res_partner
# Copyright (c) 2013 Codeback Software S.L. (http://codeback.es)
# @author: Miguel García <miguel@codeback.es>
# @author: Javier Fuentes <javier@codeback.es>
#
# This program is fr... |
eoneil1942/voltdb-4.7fix | lib/python/voltcli/voltdb.d/create.py | # This file is part of VoltDB.
# Copyright (C) 2008-2014 VoltDB Inc.
#
# This file contains original code and/or modifications of original code.
# Any modifications made by VoltDB Inc. are licensed under the following
# terms and conditions:
#
# Permission is hereby granted, free of charge, to any person obtaining
# a... |
markherringer/waywayd | settings.py | # -*- coding: utf-8 -*-
# Django settings for basic pinax project.
import os.path
import posixpath
import pinax
PINAX_ROOT = os.path.abspath(os.path.dirname(pinax.__file__))
PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__))
# tells Pinax to use the default theme
PINAX_THEME = "default"
DEBUG = False
TEMPLAT... |
UWCS/uwcs-website | uwcs_website/rest.py | from django_restapi.model_resource import Collection
from django_restapi.responder import XMLResponder
from django_restapi.resource import Resource
from django_restapi.authentication import *
from django.contrib.auth.models import User
from django.shortcuts import render_to_response,get_object_or_404
from uwcs_websit... |
OpenPymeMx/account-financial-tools | account_tax_analysis/__openerp__.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Author Vincent Renaville. Copyright 2013 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# publis... |
BirkbeckCTP/janeway | src/core/homepage_elements/about/forms.py | from django import forms
from utils import setting_handler
from core.homepage_elements.about import plugin_settings
class AboutForm(forms.Form):
title = forms.CharField(
help_text='The title of the about block eg. "About this Journal"',
)
description = forms.CharField(
widget=forms.Textar... |
edx/edx-enterprise | integrated_channels/cornerstone/migrations/0007_auto_20210708_1446.py | # Generated by Django 2.2.20 on 2021-07-08 14:46
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cornerstone', '0006_auto_20191001_0742'),
]
operations = [
migrations.AlterField(
model_name='cornerstoneenterprisecustomerconf... |
RosesTheN00b/BudgetButlerWeb | butler_offline/viewcore/request_handler.py | '''
Created on 04.12.2017
@author: sebastian
'''
from flask import render_template
from flask import redirect
from requests.exceptions import ConnectionError
from butler_offline.viewcore.state import persisted_state
from butler_offline.viewcore import request_handler
from butler_offline.viewcore import viewcore
from ... |
datagutten/comics | comics/accounts/forms.py | # Based on https://bitbucket.org/jokull/django-email-login/
from django.contrib.auth import authenticate
from django.contrib.auth import forms as auth_forms
from django.contrib.auth.models import User
from django import forms
from django.utils.translation import ugettext_lazy as _
attrs_dict = {'class': 'required'}
... |
acsone/server-tools | auth_totp/__openerp__.py | # -*- coding: utf-8 -*-
# Copyright 2016-2017 LasLabs Inc.
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
{
'name': 'MFA Support',
'summary': 'Allows users to enable MFA and add optional trusted devices',
'version': '8.0.1.0.0',
'category': 'Extra Tools',
'website': 'https://l... |
agarsev/grafeno | grafeno/transformers/extend.py | from collections import deque
from nltk.corpus import wordnet as wn
from grafeno.transformers.wordnet import Transformer as WNGet
from grafeno.transformers.__utils import Transformer as Utils
class Transformer (WNGet, Utils):
'''Adds to the graph all WordNet hypernyms of every possible concept node.
The hype... |
teltek/edx-platform | lms/djangoapps/grades/api/urls.py | """
Grades API URLs.
"""
from django.conf import settings
from django.conf.urls import include, url
from lms.djangoapps.grades.api import views
app_name = 'lms.djangoapps.grades'
urlpatterns = [
url(
r'^v0/course_grade/{course_id}/users/$'.format(
course_id=settings.COURSE_ID_PATTERN,
... |
cloudbase/maas | src/maasserver/tests/test_sequence.py | # Copyright 2012, 2013 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Test :class:`Sequence`."""
from __future__ import (
absolute_import,
print_function,
unicode_literals,
)
str = None
__metaclass__ = type
__all__ = []
i... |
HelloLily/hellolily | lily/messaging/email/migrations/0044_auto_20181106_1003.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-11-06 10:03
from __future__ import unicode_literals
import django.contrib.postgres.fields
import django.contrib.postgres.fields.jsonb
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import lily.messagi... |
snoack/cocktail-search | crawler/cocktails/spiders/drinksmixer.py | import re
from scrapy.spiders import CrawlSpider, Rule
from scrapy.linkextractors import LinkExtractor
from scrapy.selector import HtmlXPathSelector
from lxml.cssselect import CSSSelector
from cocktails.items import CocktailItem
from cocktails.utils import html_to_text
xp_title = CSSSelector('.recipe_title').path
x... |
pelikanchik/edx-platform | docs/en_us/data/source/conf.py | # -*- coding: utf-8 -*-
#
import sys, os
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
sys.path.append(os.path.abspath('../../../../'))
sys.path.append(os.path.abspath('../../../'))
from docs.shared.conf import *
sys.path.insert(0, os.path.abspath('.'))
master_doc = 'index'
# Add any paths that contain ... |
CompassionCH/l10n-switzerland | l10n_ch_pain_credit_transfer/tests/test_ch_sct.py | # -*- coding: utf-8 -*-
# © 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo.addons.account.tests.account_test_classes\
import AccountingTestCase
from odoo.tools import float_compare
import time
from lxml import etree
ch_iban... |
better-dem/portal | core/migrations/0011_auto_20161028_2250.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9.8 on 2016-10-28 22:50
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0010_auto_20161026_2148'),
]
operations = [
migrations.AddField(
... |
plamut/superdesk-core | superdesk/io/commands/update_ingest.py | # -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
import logg... |
rockfruit/bika.lims | bika/lims/browser/analysisrequest/published_results.py | # This file is part of Bika LIMS
#
# Copyright 2011-2016 by it's authors.
# Some rights reserved. See LICENSE.txt, AUTHORS.txt.
from AccessControl import getSecurityManager
from Products.CMFPlone.utils import safe_unicode
from bika.lims import bikaMessageFactory as _
from bika.lims.utils import t
from bika.lims.browse... |
tuxite/pharmaship | pharmaship/tests/inventory/test_parsers_rescue_bag.py | # -*- coding: utf-8; -*-
"""Test suite for `parsers.rescue_bag` subpackage."""
import json
from pathlib import Path
from django.test import TestCase
from django.core.management import call_command
from django.conf import settings
from django.db.models.fields.files import ImageFieldFile
from cerberus import Validator, ... |
osiloke/Flumotion-Transcoder | flumotion/transcoder/admin/datasource/datasource.py | # vi:si:et:sw=4:sts=4:ts=4
# Flumotion - a streaming media server
# Copyright (C) 2004,2005,2006,2007,2008,2009 Fluendo, S.L.
# Copyright (C) 2010,2011 Flumotion Services, S.A.
# All rights reserved.
#
# This file may be distributed and/or modified under the terms of
# the GNU Lesser General Public License version 2.1... |
jsafrane/openlmi-storage | doc/admin/conf.py | # -*- coding: utf-8 -*-
#
# OpenLMI Storage Provider documentation build configuration file, created by
# sphinx-quickstart on Mon Jun 4 10:22:18 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
# autogenera... |
ubccr/tacc_stats | pickler/torque_acct.py | #!/usr/bin/env python
import os
import codecs
class TorqueAcct(object):
""" Process accounting files from torque """
def __init__(self, acct_file, host_name_ext):
self.ncpus = 0
self.nodes = 0
self.fieldmapping = {
"account": ["account", str],
"queue":... |
FedoraScientific/salome-geom | src/GEOM_SWIG/PAL_MESH_035_geometry.py | # -*- coding: iso-8859-1 -*-
# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesse... |
simotek/tanko-bot | src/robotmain.py |
# RobotMain - Simon Lees simon@simotek.net
# Copyright (C) 2015 Simon Lees
#
# 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.1 of the License, or (at your option) any ... |
FluidityProject/multifluids | tools/tvtktools.py | from enthought.tvtk.api import tvtk
import math
import numpy
import scipy.linalg
# All returned arrays are cast into either numpy or numarray arrays
arr=numpy.array
class vtu:
"""Unstructured grid object to deal with VTK unstructured grids."""
def __init__(self, filename):
"""Creates a vtu object by reading t... |
FedoraScientific/salome-smesh | src/Tools/blocFissure/gmu/facesVolumesToriques.py | # -*- coding: utf-8 -*-
import logging
from geomsmesh import geompy
from extractionOrientee import extractionOrientee
from getSubshapeIds import getSubshapeIds
# -----------------------------------------------------------------------------
# --- TORE
# --- faces toriques et volumes du tore
def facesVolumesToriques(... |
nguy/pyparticleprobe | pyparticleprobe/dsd_calcs/zr.py | """
pyparticleprobe.dsd_calcs.zr
===============================
A grouping of functions for calculations of a Z-R relationship from a drop
size distribution.
Adapted by Nick Guy.
"""
# HISTORY::
# 28 Feb 2014 - Nick Guy. NRC, NOAA/NSSL (nick.guy@noaa.gov)
# Converted NCL functions below to Python ... |
visionegg/visionegg | VisionEgg/PyroApps/SphereGratingServer.py | #!/usr/bin/env python
"""Handle perspective-distorted sinusoidal gratings (server-side)"""
# Copyright (c) 2002-2003 Andrew Straw. Distributed under the terms
# of the GNU Lesser General Public License (LGPL).
import VisionEgg, string
import sys, os, math
import VisionEgg.Core
import VisionEgg.FlowControl
import Vi... |
CMD-at-ZIB/ZIBMolPy | tools/zgf_concatenate_stuff.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
What it does
============
This tool concatenates trr and edr files for unrestrained nodes as well as multistart nodes.
Please note: This functionality has also been integrated into zgf_mdrun. This tool is merely meant to provide this function for older node pools.
Ho... |
dlu-ch/dlb | src/dlb/ex/input.py | # SPDX-License-Identifier: LGPL-3.0-or-later
# dlb - a Pythonic build tool
# Copyright (C) 2020 Daniel Lutz <dlu-ch@users.noreply.github.com>
"""Input dependency classes for tools."""
import re
import dataclasses
from typing import Dict, Pattern, Union
from . import _depend
class RegularFile(_depend.NonDirectoryMix... |
gitaarik/adyengo | adyengo/migrations/0007_auto_20160527_2341.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-05-27 21:41
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('adyengo', '0006_auto_20160527_2051'),
]
operations = ... |
danielhrisca/asammdf | asammdf/gui/ui/fft_window.py | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'fft_window.ui'
#
# Created by: PyQt5 UI code generator 5.15.1
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 import... |
pjohansson/flowtools-rewrite | strata/dataformats/write.py | import strata.dataformats as formats
"""Module for outputting data."""
# Set module handles for ftype
default_module = formats.simple.main
modules = {
'default': default_module,
'simple': formats.simple.main,
'simple_plain': formats.simple.main
}
def write(path, data, *args, **kwargs)... |
laurentb/weboob | modules/radiofrance/test.py | # -*- coding: utf-8 -*-
# Copyright(C) 2011-2012 Romain Bignon, Laurent Bachelier
#
# 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, eithe... |
lixiangning888/whole_project | modules/signatures_orginal_20151110/browser_security.py | # Copyright (C) 2015 Kevin Ross, Optiv, Inc. (brad.spengler@optiv.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 3 of the License, or
# (at your option) any later version.... |
igemsoftware/SYSU-Software_2014 | tests/test_simulation.py | import json
from . import TestCase
class TestSimulationBase(TestCase):
def setUp(self):
self.simulations = {}
logic_type = ['repressilator', 'toggle_switch_1', 'toggle_switch_2',
'inverter', 'simple', 'and_gate', 'or_gate']
for logic_type in logic_type:
w... |
knipknap/SpiffWorkflow | tests/SpiffWorkflow/dmn/KwargsParameterTest.py | import unittest
from tests.SpiffWorkflow.dmn.DecisionRunner import DecisionRunner
class StringDecisionTestClass(unittest.TestCase):
"""
Doc: https://docs.camunda.org/manual/7.7/user-guide/dmn-engine/
"""
@classmethod
def setUpClass(cls):
cls.runner = DecisionRunner('kwargs_parameter.dmn'... |
lepovica/Lost-Nero | inventory.py | import pygame
from vec2d import vec2d
from random import choice
ITEM_TYPES = ['weapon', 'armor', 'flask']
WEAPONS_ID = ['sword', 'axe', 'staff', 'bow']
ARMORS_ID = [
'chest', 'shoulders', 'shield', 'gloves', 'boots', 'pants', 'mantle',
'helmet', 'skirt']
FLASKS_ID = ['healt', 'armor']
SWORD_IMG = list()
AXE... |
SanPen/GridCal | src/research/ptdf_ts.py |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn import neighbors
from GridCal.Engine import PowerFlowOptions, FileOpen, SolverType, ReactivePowerControlMode, \
TapsControlMode, BranchImpedanceMode, TimeSeries, PtdfTimeSeries, CDF, LatinHypercubeSampling
def knn_interp(X, Y, p... |
pyfa-org/eos | tests/integration/effect_mode/full_compliance/test_overload.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... |
hbiyik/tribler | src/tribler-core/tribler_core/modules/metadata_store/orm_bindings/metadata_node.py | import threading
from asyncio import get_event_loop
from pony import orm
from pony.orm import db_session, desc, raw_sql, select
from tribler_core.modules.metadata_store.orm_bindings.channel_node import LEGACY_ENTRY, TODELETE
from tribler_core.modules.metadata_store.orm_bindings.torrent_metadata import NULL_KEY_SUBST
... |
laurentb/weboob | weboob/exceptions.py | # -*- coding: utf-8 -*-
# Copyright(C) 2014 Romain Bignon
#
# This file is part of weboob.
#
# weboob 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 opti... |
danceos/dosek | app/bcc1/task1/verify_a.py | from generator.analysis.verifier_tools import *
def after_SystemStateFlow(analysis):
# Find all three systemcall handlers
(Handler11, Handler12, Handler13, Idle, StartOS) = \
get_functions(analysis.system_graph, ["Handler11", "Handler12", "Handler13", "Idle", "StartOS"])
t = RunningTaskToolbox(an... |
Ultimaker/Uranium | tests/TestVersion.py | # Copyright (c) 2018 Ultimaker B.V.
# Uranium is released under the terms of the LGPLv3 or higher.
from UM.Version import Version
from unittest import TestCase
import pytest
major_versions = [Version("1"), Version(b"1"), Version(1), Version([1]), Version(["1"]), Version("1."), Version("MOD-1"), Version("1B"), Version... |
dbarbier/privot | python/test/t_distributed_python_wrapper.py | #! /usr/bin/env python
# -*- coding: utf8 -*-
import openturns as ot
import sys
import shutil
import os
import argparse
import threading
import tempfile
# multicore example:
# ./t_distributed_python_wrapper.py --sample-size 10 --test local
#
# multihost example (need working ssh server):
# ./t_distributed_python_wra... |
IfcOpenShell/IfcOpenShell | src/blenderbim/blenderbim/bim/module/cobie/prop.py | # BlenderBIM Add-on - OpenBIM Blender Add-on
# Copyright (C) 2020, 2021 Dion Moult <dion@thinkmoult.com>
#
# This file is part of BlenderBIM Add-on.
#
# BlenderBIM Add-on 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 Fo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.