code stringlengths 3 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int64 3 1.05M |
|---|---|---|---|---|---|
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# ------------------------------------------------------... | marmyshev/item_title | openlp/core/ui/firsttimeform.py | Python | gpl-2.0 | 22,736 |
# Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | elibixby/gcloud-python | gcloud/datastore/query.py | Python | apache-2.0 | 18,277 |
# Copyright 2009 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Browser view for IHasTranslationImports."""
__metaclass__ = type
__all__ = [
'HasTranslationImportsView',
]
import datetime
import pytz
import simplejson
from z3c.pt... | abramhindle/UnnaturalCodeFork | python/testdata/launchpad/lib/lp/translations/browser/hastranslationimports.py | Python | agpl-3.0 | 16,068 |
import os
import re
import sys
import imp
import glob
import types
import unittest
import traceback
import warnings
__all__ = ['set_package_path', 'set_local_path', 'restore_path',
'IgnoreException', 'NumpyTestCase', 'NumpyTest',
'ScipyTestCase', 'ScipyTest', # for backward compatibility
... | santisiri/popego | envs/ALPHA-POPEGO/lib/python2.5/site-packages/numpy-1.0.4-py2.5-linux-x86_64.egg/numpy/testing/numpytest.py | Python | bsd-3-clause | 25,317 |
#!/usr/bin/env python
# Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# A local web server with a copy of functionality of
# http://prerender-test.appspot.com with a DISABLED check whether Prerendering
# i... | danakj/chromium | chrome/browser/prerender/tools/prerender_test_server/prerender_test_server.py | Python | bsd-3-clause | 1,896 |
#!/usr/bin/env python
#
# =========================================================================
# This file is part of six.sicd-python
# =========================================================================
#
# (C) Copyright 2004 - 2015, MDA Information Systems LLC
#
# six.sicd-python is free software; you can... | ngageoint/six-library | six/modules/python/six.sicd/tests/test_six_sicd.py | Python | lgpl-3.0 | 5,272 |
from core.models import (
AtmosphereUser, AccountProvider, Group, Identity, Provider, Quota
)
from core.query import only_current, contains_credential
from api.v2.serializers.details.credential import CredentialSerializer
from service.driver import get_esh_driver, get_account_driver
from rtwo.exceptions import Keys... | CCI-MOC/GUI-Backend | api/v2/serializers/post/account.py | Python | apache-2.0 | 11,411 |
"""Sensor for the Open Sky Network."""
from datetime import timedelta
import logging
import requests
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import (
ATTR_ATTRIBUTION,
ATTR_LATITUDE,
ATTR_LONGITUDE,
CONF_LATITUDE,
CONF_LONGITUDE... | leppa/home-assistant | homeassistant/components/opensky/sensor.py | Python | apache-2.0 | 5,638 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2018 Compassion CH (http://www.compassion.ch)
# @author: Nicolas Badoux <[email protected]>
#
# The licence is in the file __manifest__.py
#
##############################################... | ecino/compassion-switzerland | muskathlon/models/sport_discipline.py | Python | agpl-3.0 | 980 |
###############################################################################
##
## Copyright (C) 2014 Greg Fausak
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
##
## http:... | lgfausak/sqlauth | sqlauth/twisted/userdb.py | Python | apache-2.0 | 2,972 |
# The MIT License (MIT)
#
# Copyright (c) 2016 Philippe Proulx <eepp.ca>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to us... | eepp/vlttng | vlttng/activate_template.py | Python | mit | 6,899 |
"""
Utilities for the RESTful API
"""
from functools import wraps
import json
import os
import binascii
from flask import request, make_response, session
from werkzeug.exceptions import BadRequest
def json_view(func):
@wraps(func)
def wrapper(*a, **kw):
# todo: catch exceptions and rewrap + make sur... | rshk/jobcontrol | jobcontrol/utils/web.py | Python | apache-2.0 | 1,153 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
"""
from __future__ import unicode_literals, print_function, absolute_import
from django.db import models
from pgaudit.mixins import AuditMixin
class SimpleTable(models.Model, AuditMixin):
name = models.CharField(max_length=16)
| StefanKjartansson/django-postgres-audit | tests/someapp/models.py | Python | bsd-3-clause | 287 |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
"Write your forwards methods here."
if orm.Language.objects.count() == 0:
from django.core.management ... | btat/Booktype | lib/booki/editor/migrations/0009_load_initial_languages.py | Python | agpl-3.0 | 15,241 |
from utils import gen_hashcode
import re
def system_audit(logcat, headers):
parts = logcat.split('\n\n')
process = "system_audit"
content = "\n".join(parts[1:])
types = re.findall(r"type=(\d+)", content)
types = filter(lambda x: x != "2000", sorted(list(set(types))))
if len(types) > 0:
... | dropbox-dashbpard/error-detect-of-log | ed/system_audit.py | Python | mit | 513 |
import signal, sys, os
sys.path.append(os.getcwd()+'/../../../thirdparty/pymongo/pymongo')
import pymongo
def signal_handler(signum,frame):
return
class DBConn:
conn = None
def connect(self):
print os.getcwd()
signal.signal(signal.SIGALRM, signal_handler)
signal.alarm(3)
try:
self.conn = pymongo.Mong... | SRCH2/srch2-ngn | test/wrapper/system_tests/adapter_mongo/MongoDBConn.py | Python | bsd-3-clause | 474 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import codecs
import copy
import datetime
import hashlib
import json
import logging
import os
import alerts
import rule_types
from util import EAException
from util import elastalert_logger
from util import ts_to_dt
from util import dt_to_ts
# Used to map names of alert... | leonzhan/elasticwatcher | elasticwatcher/config.py | Python | apache-2.0 | 7,303 |
import platform
import sys
import django
from django.conf import settings
from django.contrib.staticfiles.management.commands import runserver
from django.contrib.staticfiles.handlers import StaticFilesHandler
from django.core.management.color import supports_color
from django.db import connection
from django.http im... | fusionbox/mezzanine | mezzanine/core/management/commands/runserver.py | Python | bsd-2-clause | 5,837 |
# Copyright 2014 Eucalyptus Systems, Inc.
#
# Redistribution and use of this software in source and binary forms,
# with or without modification, are permitted provided that the following
# conditions are met:
#
# Redistributions of source code must retain the above copyright notice,
# this list of conditions and t... | Juniper/euca2ools | euca2ools/commands/cloudformation/__init__.py | Python | bsd-2-clause | 3,574 |
import settings, os, sys
import logging
import traceback
import hashlib
import csv
from StringIO import StringIO
import util as xutils
from django.http import Http404
from django.shortcuts import get_object_or_404
from django.http import HttpResponse, HttpResponseRedirect
from django.template import RequestContext
from... | icomms/wqmanager | apps/xformmanager/views.py | Python | bsd-3-clause | 35,592 |
# Copyright 2013 Gary Baumgartner
# Distributed under the terms of the GNU General Public License.
#
# This file is part of Assignment 1, CSC148, Fall 2013.
#
# This 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 Foundat... | Connor-Y/csc148-assignment1 | SolvingController.py | Python | gpl-3.0 | 6,586 |
import getpass
import string
import unicodedata
from math import sqrt
default_currency = "\u20AC"
def get_universal_printable_name(item, errstring="???"):
"""
Gets name of user or food in printable form.
:param item: User or Item object
:param errstring: string to return if name could not be resolve... | peto2006/sortiment-frontent | sortimentGUI/data_manipulation.py | Python | mit | 4,182 |
"""The class which handles all actions (from user input) in the game. It is here that actions should be checked for validity and the relevant calls made based on this - no other class should have to check if an action is valid."""
import random
import lib.Pathfinding
import Tile
import logging
import Item
import getpa... | kkelk/roguelike-computing | Game/ActionHandler.py | Python | mit | 10,605 |
"""
integration tests for xmodule
Contains:
1. BaseTestXmodule class provides course and users
for testing Xmodules with mongo store.
"""
from django.test.utils import override_settings
from django.core.urlresolvers import reverse
from django.test.client import Client
from edxmako.shortcuts import render_to... | mjg2203/edx-platform-seas | lms/djangoapps/courseware/tests/__init__.py | Python | agpl-3.0 | 4,734 |
class ProteinParameters:
def __init__(self, sequence):
self.sequence = sequence
self.sequence_length = len(sequence)
self.M = 0
self.Z = 0
def __str__(self):
return ' Sequence length: ' + str(self.sequence_length) + '\n' + \
' M: {0:.3f}\n'.format(self.M... | zedrian/shkoma | shkoma/protein_parameters.py | Python | mit | 637 |
# -*- coding: utf-8 -*-
# Copyright 2014, 2015 OpenMarket Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | illicitonion/synapse | synapse/api/auth.py | Python | apache-2.0 | 22,127 |
#!/usr/bin/env python
# -*- coding: latin-1 -*-
import datetime
import email.utils
import errno
import gzip
import io
import json
import locale
import os
import platform
import re
import socket
import sys
import traceback
import zlib
try:
import urllib.request as compat_urllib_request
except ImportError: # Python... | lebabouin/CouchPotatoServer-develop | couchpotato/core/providers/trailer/vftrailers/youtube_dl/utils.py | Python | gpl-3.0 | 27,737 |
# -*- coding: utf-8 -*-
from distutils.core import setup
setup(name = "python-est",
version = "0.1",
description = u"Python EST Sanal POS Arabirimi",
author = u"Özgür Vatansever",
license = open("LICENSE").read(),
long_description = open("README").read(),
author_email = "ozgurvt@gma... | tectronics/python-est | setup.py | Python | gpl-2.0 | 477 |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright 2021 The NiPreps Developers <[email protected]>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may... | poldracklab/mriqc | mriqc/interfaces/transitional.py | Python | bsd-3-clause | 2,889 |
#!/usr/bin/env python
# coding: utf-8
# Solvers: The Inverse Problem
# ============================
#
#
# Setup
# -----------------------------
# Let's first make sure we have the latest version of PHOEBE 2.3 installed (uncomment this line if running in an online notebook session such as colab).
# In[1]:
#!pip i... | phoebe-project/phoebe2-docs | 2.3/tutorials/solver.py | Python | gpl-3.0 | 10,394 |
from django.test import TestCase
from eventex.core.managers import PeriodManager
from eventex.core.models import Talk, Course
class TalkModelTest(TestCase):
def setUp(self):
self.talk = Talk.objects.create(
title='Título da Palestra',
start='10:00',
description='Descriç... | paulopinda/eventex | eventex/core/tests/test_model_talk.py | Python | gpl-2.0 | 2,910 |
#!/usr/bin/env python
"""Command line arguments parser.
(C) 2016-2019 1024jp
"""
import argparse
import io
import logging
import os
import sys
try:
from . import __version__ as version
except ImportError:
version = 'n/a'
class Parser(argparse.ArgumentParser):
description = 'Translate coordinates in a ... | 1024jp/LensCalibrator | modules/argsparser.py | Python | mit | 5,879 |
#!/usr/bin/env python
"""
Easy Install
------------
A tool for doing automatic download/extract/build of distutils-based Python
packages. For detailed documentation, see the accompanying EasyInstall.txt
file, or visit the `EasyInstall home page`__.
__ https://pythonhosted.org/setuptools/easy_install.html
"""
from... | znoland3/zachdemo | venvdir/lib/python3.4/site-packages/setuptools/command/easy_install.py | Python | mit | 86,035 |
#!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""List all the test cases for a google test.
See more info at http://code.google.com/p/googletest/.
"""
import optparse
import s... | keishi/chromium | tools/isolate/list_test_cases.py | Python | bsd-3-clause | 1,642 |
from common import UniqueUsername, UniqueEmail, UniqueInstanceKey
from common import UniqueOtherEmail
from common import StaticPageKey
from common import ContainsChar, ContainsEMailPlaceholders, UsersCSV
from common import ValidDelegateable, ValidProposal, MaybeMilestone
from common import ValidInstanceGroup, ValidRevi... | SysTheron/adhocracy | src/adhocracy/forms/__init__.py | Python | agpl-3.0 | 843 |
# -*- coding: utf-8; Mode: python; tab-width: 4; indent-tabs-mode:nil; -*-
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
#
# Copyright (C) 2013-2016 Sébastien Buchoux <[email protected]>
#
# This file is part of FATSLiM.
#
# FATSLiM is free software: you can redistribute it and/or modify
# ... | FATSLiM/fatslim | fatslimlib/test/test_03_apl.py | Python | gpl-3.0 | 12,484 |
import subprocess
from importlib import import_module
import os
import dolfin
import nanopores
from nanopores.tools.utilities import Log
#FIXME: deprecated because of license conflict -> import from dolfin
#from nanopores.meshconvert import convert2xml
MESHDIR = "/tmp/nanopores"
def geofile2geo(code, meta, name=None, ... | mitschabaude/nanopores | nanopores/geo2xml.py | Python | mit | 6,483 |
# Copyright 2013 IBM Corp.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | sebrandon1/tempest | tempest/api/identity/admin/v3/test_groups.py | Python | apache-2.0 | 6,593 |
# Two layer LSTM
from keras.models import Sequential
from keras.layers import Dense, Activation
from keras.layers import LSTM
from keras.layers import Dropout
from keras.optimizers import RMSprop
def get_model(maxlen, len_chars):
model = Sequential()
model.add(LSTM(256, input_shape=(maxlen, len_chars), return... | DipLernin/Text_Generation | code/models/lstm_two.py | Python | mit | 641 |
#!/usr/bin/python
#coding: utf-8 -*-
# (c) 2013, Benno Joy <[email protected]>
#
# This module 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 ... | gimoh/ansible-modules-core | cloud/openstack/quantum_floating_ip.py | Python | gpl-3.0 | 10,210 |
"""
WSGI config for project project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTING... | flipjack/misrutas | config/wsgi.py | Python | mit | 387 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('approval_polls', '0015_email_opt_in'),
]
operations = [
migrations.RemoveField(
model_name='vote',
n... | rupalkhilari/approval_frame | approval_polls/migrations/0016_update_email_opt_in.py | Python | gpl-3.0 | 805 |
from setuptools import setup
setup(
name='catalog',
packages=['catalog'],
include_package_data=True,
install_requires=[
'flask',
'sqlalchemy'
],
)
| diogosilverio/udacity-fswd-game-catalog | setup.py | Python | gpl-3.0 | 184 |
# -*- coding: utf-8 -*-
from selenium import webdriver
from django.core.urlresolvers import reverse
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from django.utils.translation import activate
from datetime import date
from django.utils import formats
class HomeNewVisitorTest(StaticLiveSer... | michitson/my-repo | functional_tests/test_all_users.py | Python | mit | 2,432 |
from Paths import Paths
from datasets.LupusDataset import LupusDataset, PerPatienceTargets
import numpy
from datasets.LupusFilter import TemporalSpanFilter
from selfea.datasets.CustomDataset import CustomDataset
from selfea.rankers.ReliefF import ReliefF
def convert_X(X, mask):
# output = numpy.zeros(shape=(X.sha... | GiulioGx/RNNs | sources/lupus_relief.py | Python | lgpl-3.0 | 2,176 |
from __future__ import absolute_import
import weakref
from warnings import warn
from fontTools.misc import bezierTools
from fontTools.misc import arrayTools
from defcon.objects.base import BaseObject
from defcon.tools import bezierMath
from defcon.tools.representations import contourBoundsRepresentationFactory,\
co... | moyogo/defcon | Lib/defcon/objects/contour.py | Python | mit | 30,042 |
"""
Example loading all specs from JSON template
"""
from flask import Flask, jsonify
from flasgger import Swagger
app = Flask(__name__)
app.config['SWAGGER'] = {
'title': 'Colors API',
'uiversion': 2
}
swag = Swagger(app, template_file='colors_template.json')
@app.route('/colors/<palette>/')
def colors(pal... | pcu4dros/pandora-core | workspace/lib/python3.5/site-packages/examples/colors_template_json.py | Python | mit | 874 |
#######################################################################
# #
# Copyright 2015 Max Planck Institute #
# for Dynamics and Self-Organization #
# ... | chichilalescu/bfps | tests/test_filters.py | Python | gpl-3.0 | 7,175 |
# Copyright 2020 The StackStorm Authors.
# Copyright 2019 Extreme Networks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | nzlosh/st2 | st2common/st2common/cmd/purge_executions.py | Python | apache-2.0 | 3,025 |
# Copyright (c) 2014, the GREAT3 executive committee (http://www.great3challenge.info/?q=contacts)
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are permitted
# provided that the following conditions are met:
#
# 1. Redistributions of source code must retain... | lsst-dm/great3-public | metrics/calculate_QG10_var_shear_normalization.py | Python | bsd-3-clause | 5,017 |
# -*- coding: utf-8 -*-
#
# Discourse Segmenter documentation build configuration file, created by
# sphinx-quickstart on Wed Dec 23 10:41:30 2015.
#
# 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... | peldszus/DiscourseSegmenter | docs/conf.py | Python | mit | 9,967 |
# Copyright 2021 Tecnativa - Víctor Martínez
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
from openupgradelib import openupgrade
@openupgrade.migrate()
def migrate(env, version):
if version >= "14.0.1.0.0":
openupgrade.logged_query(
env.cr,
"""
UP... | OCA/hr | hr_employee_calendar_planning/migrations/14.0.1.2.0/post-migration.py | Python | agpl-3.0 | 429 |
import h5py
import sys
from numpy import array
print sys.argv
filename=sys.argv[1]
geofile=sys.argv[2]
tile=sys.argv[3]
start=filename.find('_t')
time1=filename[start+2:start+6]
f=h5py.File(filename,'r')
g=h5py.File(geofile,'r')
data_array = f['/All_Data/VIIRS-I5-SDR_All/BrightnessTemperature'][()]
lat_array = g['/Al... | bucricket/projectMASviirs | source/grid_I5/read_i5_sdr.py | Python | bsd-3-clause | 1,435 |
import pyaudio
import numpy
from base import mfcc
from base import logfbank
CHUNK = 512
FORMAT = pyaudio.paInt16
CHANNELS = 1
RATE = 1200#44100
p = pyaudio.PyAudio()
stream = p.open(format = FORMAT,
channels = CHANNELS,
rate = RATE,
input = True,
frames_... | AswinKakarot/HERS | src/MFCC.py | Python | gpl-3.0 | 633 |
#!/usr/bin/python
from Adafruit_PWM_Servo_Driver import PWM
from Adafruit_ADS1x15 import ADS1x15
import time, os, sys
import Adafruit_DHT
# HOW MANY CYCLES TO BE PERFORMED BEFORE SHOWING THE HIGH AND LOW SEQUENCE
# SET TO 0 FOR OFF
intervalHighLow = 60
# HOW LONG TO REST BETWEEN CYCLES - ZERO IS FINE
intervalSleep = ... | Jelby-John/HatalogicoWeatherStation | main.py | Python | mit | 5,387 |
from django.conf.urls import url
from dojo.note_type import views
urlpatterns = [
url(r'^note_type$',
views.note_type, name='note_type'),
url(r'^note/type/(?P<ntid>\d+)/edit$',
views.edit_note_type, name='edit_note_type'),
url(r'^note/type/(?P<ntid>\d+)/disable$',
views.disable_not... | rackerlabs/django-DefectDojo | dojo/note_type/urls.py | Python | bsd-3-clause | 540 |
# -*- coding: utf-8 -*-
#
# test_siegert_neuron.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the Lic... | hesam-setareh/nest-simulator | pynest/nest/tests/test_siegert_neuron.py | Python | gpl-2.0 | 4,811 |
# -*- 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... | jss-emr/openerp-7-src | openerp/addons/account/report/account_aged_partner_balance.py | Python | agpl-3.0 | 19,227 |
# - coding: utf-8 -
# Copyright (C) 2007-2009, 2012, 2014 Toms Bauģis <toms.baugis at gmail.com>
# Copyright (C) 2007 Patryk Zawadzki <patrys at pld-linux.org>
# This file is part of Project Hamster.
# Project Hamster is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Pub... | sanjayankur31/hamster | src/hamster/storage/db.py | Python | gpl-3.0 | 40,684 |
# -*- coding: utf-8 -*-
import re
from urllib import unquote
from random import randrange
from module.plugins.Hoster import Hoster
from module.common.json_layer import json_loads
from module.utils import parseFileSize
class OverLoadMe(Hoster):
__name__ = "OverLoadMe"
__version__ = "0.01"
__type__ = "hos... | estaban/pyload | module/plugins/hoster/OverLoadMe.py | Python | gpl-3.0 | 2,790 |
# -*- coding: utf-8 -*-
from django.core.mail import mail_managers
from django.template.loader import render_to_string
import os
import requests
from freeze import settings, parser
def scan( site_url = settings.FREEZE_SITE_URL, base_url = settings.FREEZE_BASE_URL, relative_urls = settings.FREEZE_RELATIVE_URLS, loc... | fabiocaccamo/django-freeze | freeze/scanner.py | Python | mit | 5,566 |
"""
Author: Jordan Maxwell
Written: 10/12/2017
BSD 3-Clause License
Copyright (c) 2017, Nxt Studios
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 abo... | NxtStudios/PyFab | tests/__init__.py | Python | bsd-3-clause | 1,562 |
from __future__ import with_statement
import contextlib
import itertools
import mock
import os
import pkg_resources
import ssl
import sys
import tempfile
import threading
import time
import traceback
import unittest
import urllib
try:
import json
except ImportError:
import simplejson as json
from wsgiref.sim... | jooddang/Boxpedia | web/dropbox-python-sdk-1.6/tests/test_rest.py | Python | mit | 11,057 |
import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 32 , FREQ = 'D', seed = 0, trendtype = "MovingMedian", cycle_length = 5, transform = "Integration", sigma = 0.0, exog_count = 20, ar_order = 12); | antoinecarme/pyaf | tests/artificial/transf_Integration/trend_MovingMedian/cycle_5/ar_12/test_artificial_32_Integration_MovingMedian_5_12_20.py | Python | bsd-3-clause | 269 |
"""Support for ZHA button."""
from __future__ import annotations
import abc
import functools
import logging
from typing import Any
from homeassistant.components.button import ButtonDeviceClass, ButtonEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import ENTITY_CATEGORY_DIAGNOSTIC... | mezz64/home-assistant | homeassistant/components/zha/button.py | Python | apache-2.0 | 3,163 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from PyQt4 import QtCore, QtGui
def get_std_icon(name):
if not name.startswith('SP_'):
name = 'SP_' + name
standardIconName = getattr(QtGui.QStyle, name, None)
if standardIconName is not None:
return QtGui.QWidget().style().standardIcon( standa... | diegomvh/pyqt | examples/stdicons.py | Python | mit | 1,670 |
import datetime
from lxml import etree
import math
import pytz
import re
import time
from dateutil import parser
from lxml import etree
from dateutil import parser
from datetime import datetime, timedelta
from dateutil.relativedelta import relativedelta
import openerp
from openerp import SUPERUSER_ID
from openerp impor... | trabacus-softapps/docker-kingswood | additional_addons/kingswood/wizard/kw_mail_compose.py | Python | agpl-3.0 | 2,064 |
# -*- coding: utf-8 -*-
# pythonconsole.py -- Console widget
#
# Copyright (C) 2006 - Steve Frécinaux
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# a... | nacho/gedit | plugins/pythonconsole/pythonconsole/console.py | Python | gpl-2.0 | 12,337 |
from __future__ import print_function
import os
filename = "/usr/lib/enigma2/python/Plugins/Extensions/MediaPortal/plugin.pyo"
os.rename(filename, filename + ".org")
source=open(filename + ".org", "r")
dest=open(filename, "w")
for line, str in enumerate(source):
oldstr = str[:]
str = str.replace('dm7080N', 'dn7080... | atvcaptain/enigma2 | pyo_patcher.py | Python | gpl-2.0 | 650 |
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup
import versioneer
import os
def main():
this_directory = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(this_directory, 'README.rst'), 'r') as f:
long_description = f.read()
cmdclass = versioneer.... | alubbock/pysb | setup.py | Python | bsd-2-clause | 2,077 |
# Copyright 2015 Cloudera Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | wesm/ibis | ibis/sql/tests/test_sqlalchemy.py | Python | apache-2.0 | 18,386 |
# coding: utf-8
__author__="albert"
__date__ ="$10.8.2011 13:37:40$"
import re
import basicParser
import os.path
import inspect
orderOfMtr = (
'Materials',
'Storativity',
'Geometry',
'Sorption',
'SorptionFraction',
'DualPorosity',
'Reactions'
)
fileHead = '''$MaterialFormat
1.0 0 8
$EndMaterialFormat
'''... | jirivrany/riskflow123d-post | flowIni/material.py | Python | gpl-2.0 | 5,377 |
# pma.py -o TestIntSuccessComposeFSM TestIntSuccess WebModel
# 6 states, 5 transitions, 1 accepting states, 0 unsafe states, 1 finished and 0 deadend states
# actions here are just labels, but must be symbols with __name__ attribute
def ReadInt(): pass
def Logout(): pass
def Initialize(): pass
def Login(): pass
def ... | jon-jacky/PyModel | samples/WebApplication/fsmpy/TestIntSuccessComposeFSM.py | Python | bsd-3-clause | 1,625 |
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | PaddlePaddle/cloud | doc/edl/experiment/python/main.py | Python | apache-2.0 | 5,810 |
from resources import *
from cc_delegate import ComboBoxDelegate, DateDelegate, PhoneDelegate, PersonIdDelegate
class ApprovalDlg(QDialog):
def __init__(self,parent=None, db="", curuser={}):
super(ApprovalDlg,self).__init__(parent)
if db == "":
self.db = globaldb()
else:
... | iefan/kfmental | frmApproval.py | Python | apache-2.0 | 24,422 |
from hypothesis import given
from ppb_vector import Vector
from utils import floats, vectors
@given(x=floats(), y=floats())
def test_class_member_access(x: float, y: float):
v = Vector(x, y)
assert v.x == x
assert v.y == y
@given(v=vectors())
def test_index_access(v: Vector):
assert v[0] == v.x
... | ppb/ppb-vector | tests/test_member_access.py | Python | artistic-2.0 | 444 |
# coding: utf-8
import flask
from flask import url_for
from .base import BaseTestCase
from . import utils
class TOCTestCase(BaseTestCase):
# TOC
def test_the_title_of_the_article_list_when_language_pt(self):
"""
Teste para verificar se a interface do TOC esta retornando o título no
... | scieloorg/opac | opac/tests/test_interface_TOC.py | Python | bsd-2-clause | 11,514 |
import numpy as np
from milk.measures.nfoldcrossvalidation import nfoldcrossvalidation, foldgenerator
# Regression test in 2011-01-31
def test_getfoldgenerator():
labels = np.array([
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7... | pombredanne/milk | milk/tests/test_nfoldcrossvalidation_regression.py | Python | mit | 10,055 |
#!/usr/bin/python
# -*- encoding: utf-8 -*-
###########################################################################
# Module Writen to OpenERP, Open Source Management Solution
# Copyright (C) OpenERP Venezuela (<http://openerp.com.ve>).
# All Rights Reserved
# Credits#######################################... | 3dfxsoftware/cbss-addons | price_structure/model/product_pricelist.py | Python | gpl-2.0 | 5,242 |
# generated from catkin/cmake/template/pkg.context.pc.in
CATKIN_PACKAGE_PREFIX = ""
PROJECT_PKG_CONFIG_INCLUDE_DIRS = "".split(';') if "" != "" else []
PROJECT_CATKIN_DEPENDS = "".replace(';', ' ')
PKG_CONFIG_LIBRARIES_WITH_PREFIX = "".split(';') if "" != "" else []
PROJECT_NAME = "irobot"
PROJECT_SPACE_DIR = "/home/jo... | joemelt101/BIR_Labs | build/irobot/catkin_generated/pkg.develspace.context.pc.py | Python | apache-2.0 | 372 |
# missile.py
from __future__ import division
import copy
import itertools
import pygame
import pygame.display
import pygame.draw
from .entity import Entity
class Missile(Entity):
def __init__(self, id, pos, vel, orientation, max_thrust,
seek_algorithm=0):
super(Missile, self).__init__(... | BlckKnght/Void-Patrol-Clone | src/vp/missile.py | Python | mit | 6,052 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "openlc.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| Astrogel/test | openlc/manage.py | Python | mit | 249 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2021-07-31 14:57
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('mural', '0010_auto_20210731_1451'),
]
operations = [
migrations.AddIndex(
... | amadeusproject/amadeuslms | mural/migrations/0011_auto_20210731_1457.py | Python | gpl-2.0 | 481 |
import os
import chardet
import peewee
from mcbench import settings
from mcbench.models import Model
class Benchmark(Model):
author = peewee.CharField()
author_url = peewee.CharField()
date_submitted = peewee.DateField()
date_updated = peewee.DateField()
name = peewee.CharField(unique=True)
... | isbadawi/mcbench | mcbench/models/benchmark.py | Python | mit | 1,962 |
import numpy as np
from mayavi import mlab
import mayavi.tools
from tvtk.api import tvtk
def scale(fig, ratio, reset=False):
"""
Scales a Mayavi figure and resets the camera.
Parameters
----------
"""
for actor in fig.scene.renderer.actors:
if reset:
actor.scale = np.ones(3... | joferkington/scipy2015-3d_printing | utils.py | Python | mit | 3,167 |
# Copyright (c) 2019 Intel Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | mahak/neutron | neutron/tests/unit/extensions/test_network_segment_range.py | Python | apache-2.0 | 16,521 |
# -*- coding:utf-8 -*-
try:
import threading
except ImportError:
import dummy_threading as threading
from django.utils import six
class SingletonMetaclass(type):
def __new__(mcls, name, bases, namespace):
namespace.setdefault('__lock__', threading.RLock())
namespace.setdefault('__instan... | samuelmaudo/yepes | yepes/types/singleton.py | Python | bsd-3-clause | 825 |
import copy
import errno
import mock
import os
from . import TEST_CONF_DIR
from django.conf import settings
try:
from django.urls import reverse
except ImportError: # Django < 1.10
from django.core.urlresolvers import reverse
from django.http import HttpResponse
from .base import TestCase
from django.test.ut... | obfuscurity/graphite-web | webapp/tests/test_dashboard.py | Python | apache-2.0 | 22,814 |
# This file is part of Ansible
# Copyright (c) 2019 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.plugins.action import Ac... | privateip/ansible | test/integration/targets/shell/action_plugins/test_shell.py | Python | gpl-3.0 | 605 |
import sys
from resources.lib import addon
if __name__ == "__main__":
addon.run(sys.argv)
| XBMC-Addons/plugin.library.node.editor | plugin.py | Python | gpl-2.0 | 96 |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
"""Implementation of the pigeonhole principle formulas
"""
from cnfformula.cnf import CNF,binary_mapping,unary_mapping
from cnfformula.cmdline import BipartiteGraphHelper
from cnfformula.graphs import bipartite_sets
import cnfformula.cmdline
import cnfformula.families
fro... | marcvinyals/cnfgen | cnfformula/families/pigeonhole.py | Python | gpl-3.0 | 8,969 |
class UniqueCollision(Exception):
"""
An attempt to create two pages with the same unique metadata
"""
def __init__(self, existing):
self.existing = existing
class SlugCollision(UniqueCollision):
"""
An attempt to create two pages of the same slug in one locale
"""
class Documen... | a2sheppy/kuma | kuma/wiki/exceptions.py | Python | mpl-2.0 | 988 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Page'
db.create_table('pages_page', (
('id', self.gf('django.db.models.fields.Au... | JamesJGarner/cms | src/cms/apps/pages/migrations/0001_initial.py | Python | bsd-3-clause | 5,701 |
import os
basedir = os.path.abspath(os.path.dirname(__file__))
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir, 'webapp.db')
SQLALCHEMY_MIGRATE_REPO = os.path.join(basedir, 'db_repository') | BrambleLLC/H4H_2015 | Server/src/webapp/config.py | Python | mit | 205 |
Len = len(ValuesIn[0])
for v in ValuesIn[1:]:
if Len != len(v):
Msg.Error(3, "Not all vectors are of equal length")
if Len == 0:
Msg.Error(3, "Empty vector")
if "Start" in Analyse:
if "Stop" in Analyse:
Start = float(Analyse["Start"])
Stop = float(Analyse["Stop"])
Step... | gilbertf/saps | analyse/Index.py | Python | gpl-3.0 | 600 |
"""
Copyright 2014-2015 darkf
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
dis... | darkf/darkfo | exportImages.py | Python | apache-2.0 | 2,638 |
# Copyright (C) 2015 The Pennsylvania State University and the University of Wisconsin
# Systems and Internet Infrastructure Security Laboratory
#
# Author: Damien Octeau
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obta... | siis/primo | primo/linking/util.py | Python | apache-2.0 | 1,180 |
__license__ = 'GPL v3'
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
import os
from collections import namedtuple
from calibre.customize import Plugin
from calibre.constants import iswindows
class DevicePlugin(Plugin):
"""
Defines the interface that should be implemented by backends that
... | insomnia-lab/calibre | src/calibre/devices/interface.py | Python | gpl-3.0 | 31,160 |
#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2017, Anaconda, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#---------------------------------------------------... | Karel-van-de-Plassche/bokeh | bokeh/client/util.py | Python | bsd-3-clause | 3,304 |
'''
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this ... | sekikn/ambari | ambari-server/src/test/python/TestStackAdvisor.py | Python | apache-2.0 | 21,095 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.