code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
import re
import simplejson
from django.contrib.auth.models import User
from django.test import TestCase
from django.urls import reverse
from astrobin.models import Collection, Image
from astrobin_apps_images.models import KeyValueTag
class CollectionTest(TestCase):
def setUp(self):
self.user = User.obj... | astrobin/astrobin | astrobin/tests/test_collection.py | Python | agpl-3.0 | 11,674 |
import bson
import datetime
import logging
import os
import importlib
import types
from os.path import abspath, join, dirname, isfile, exists
from flask import (
Flask, abort, g, send_from_directory, json, Blueprint as BaseBlueprint,
make_response
)
from flask_caching import Cache
from flask_wtf.csrf import ... | opendatateam/udata | udata/app.py | Python | agpl-3.0 | 6,961 |
"""
Utility functions for setting "logged in" cookies used by subdomains.
"""
import json
import logging
import time
import six
from django.conf import settings
from django.contrib.auth.models import User
from django.dispatch import Signal
from django.urls import NoReverseMatch, reverse
from django.utils.http import... | edx-solutions/edx-platform | openedx/core/djangoapps/user_authn/cookies.py | Python | agpl-3.0 | 12,065 |
from GooDiffService import GooDiffService
class GooDiffProvider:
def __init__(self, name, services=None):
self.name = name
self.services = services or []
def debug(self):
print "Provider name:", self.name
for service in self.services:
service.debug()
| quuxlabs/goodiff-core | includes/GooDiffProvider.py | Python | agpl-3.0 | 307 |
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from frappe import _
from erpnext.education.utils import validate_duplicate_student
from ... | gsnbng/erpnext | erpnext/education/doctype/student_group/student_group.py | Python | agpl-3.0 | 5,632 |
###########################################################################
# (C) Vrije Universiteit, Amsterdam (the Netherlands) #
# #
# This file is part of AmCAT - The Amsterdam Content Analysis Toolkit #
# ... | amcat/amcat | amcat/models/coding/tests/codingruletoolkit.py | Python | agpl-3.0 | 7,493 |
#!/usr/bin/env python3
#$#HEADER-START
# vim:set expandtab ts=4 sw=4 ai ft=python:
#
# Reflex Configuration Event Engine
#
# Copyright (C) 2016 Brandon Gillespie
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as publ... | reflexsc/reflex | src/rfxcmd/__init__.py | Python | agpl-3.0 | 45,284 |
# Copyright (c) 2001-2014, Canal TP and/or its affiliates. All rights reserved.
#
# This file is part of Navitia,
# the software to build cool stuff with public transport.
#
# Hope you'll enjoy and contribute to this project,
# powered by Canal TP (www.canaltp.fr).
# Help us simplify mobility and open public tr... | ballouche/navitia | source/jormungandr/jormungandr/scenarios/destineo.py | Python | agpl-3.0 | 17,467 |
# -*- coding: utf-8 -*-
import ckanapi
import ckanapi.cli.progressbar as progressbar
import requests
import argparse
import hashlib
import tarfile
import time
import gzip
import shutil
import uuid
import re
import sys
import os
import io
import stat
import time
import urllib3
import cPickle as pickle
urllib3.disable_w... | eawag-rdm/resup | resup/resup.py | Python | agpl-3.0 | 25,324 |
"""
Django settings for pronomen project.
Generated by 'django-admin startproject' using Django 1.10.1.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
import o... | jh0ker/pronomen | site/pronomen/settings.py | Python | agpl-3.0 | 3,308 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
with open('requirements.txt') as f:
required = f.read().splitlines()
setup(
name = 'opensubmit-exec',
version = '0.7.32',
url = 'https://github.com/troeger/opensubmit',
license='AGPL',
author = 'Peter T... | troeger/opensubmit | executor/setup.py | Python | agpl-3.0 | 977 |
# Standard Library Imports
from datetime import datetime
# 3rd Party Imports
# Local Imports
from PokeAlarm import Unknown
from . import BaseEvent
from PokeAlarm.Utils import get_gmaps_link, get_applemaps_link, \
get_waze_link, get_dist_as_str, get_base_types, get_type_emoji
from PokeAlarm.Utilities.QuestUtils impo... | kvangent/PokeAlarm | PokeAlarm/Events/QuestEvent.py | Python | agpl-3.0 | 6,377 |
# -*- coding: utf-8 -*-
import copy
import colander
import sqlalchemy as sa
from pyramid.view import view_config, view_defaults
import markupsafe
import datetime
from sqlalchemy.exc import StatementError
from sqlalchemy.orm.exc import NoResultFound
import pysite.vmailmgr
from pysite.vmailmgr.models import AliasDd, Al... | dmdm/PySite | pysite/vmailmgr/views/alias.py | Python | agpl-3.0 | 7,411 |
# This file is part of FNPDjango, licensed under GNU Affero GPLv3 or later.
# Copyright © Fundacja Nowoczesna Polska. See README.md for more information.
#
from django.conf import settings
from django.test import TestCase
class UtilsSettingsTestCase(TestCase):
def test_lazy_ugettext_lazy(self):
self.asser... | fnp/fnpdjango | tests/tests/test_utils_settings.py | Python | agpl-3.0 | 398 |
# -*- coding: utf-8 -*-
# Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can r... | dayatz/taiga-back | taiga/events/middleware.py | Python | agpl-3.0 | 2,029 |
# Copyright 2012 - 2013 Zarafa B.V.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License, version 3,
# as published by the Free Software Foundation with the following additional
# term according to sec. 7:
#
# According to sec. 7 of the ... | zarafagroupware/zarafa-zsm | tests/tests_authorization.py | Python | agpl-3.0 | 11,327 |
# Copyright 2021 Ecosoft (http://ecosoft.co.th)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from datetime import datetime
from odoo.tests.common import TransactionCase
from odoo.tools import DEFAULT_SERVER_DATETIME_FORMAT
class TestPurchaseRequestException(TransactionCase):
def setUp(s... | OCA/purchase-workflow | purchase_request_exception/tests/test_purchase_request_exception.py | Python | agpl-3.0 | 4,327 |
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import fields, models
class StorageBackend(models.Model):
_inherit = "storage.backend"
synchronize_task_ids = fields.One2many(
"attachment.synchronize.task", "backend_id", string="Tasks"
)
import_task_count = fiel... | Vauxoo/server-tools | attachment_synchronize/models/storage_backend.py | Python | agpl-3.0 | 2,354 |
# stdlib, alphabetical
from __future__ import absolute_import
import datetime
import errno
import logging
import os
import re
import shutil
import stat
import subprocess
import tempfile
# Core Django, alphabetical
from django.core.exceptions import ValidationError
from django.db import models
from django.utils.transla... | artefactual/archivematica-storage-service | storage_service/locations/models/space.py | Python | agpl-3.0 | 35,298 |
# -*- coding: utf-8 -*-
#
# SPDX-License-Identifier: AGPL-3.0-or-later
#
# snippy - software development and maintenance notes manager.
# Copyright 2017-2020 Heikki J. Laaksonen <laaksonen.heikki.j@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU ... | heilaaks/snippy | snippy/server/rest/api_fields.py | Python | agpl-3.0 | 3,524 |
from django.contrib import admin
from models import Subscription
admin.site.register(Subscription)
| asm-products/pants-party | subscriptions/admin.py | Python | agpl-3.0 | 100 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import ckeditor_uploader.fields
import django.utils.timezone
from django.conf import settings
from django.db import migrations
from django.db import models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_depende... | liqd/a4-meinberlin | meinberlin/apps/newsletters/migrations/0001_initial.py | Python | agpl-3.0 | 1,979 |
INSTALLED_APPS= ["django_nose"]
TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
NOSE_ARGS = [
'--with-xunit',
'--xunit-file=jenkins/nosetests.xml',
]
| BirkbeckCTP/janeway | jenkins/janeway_settings.py | Python | agpl-3.0 | 160 |
# from django.contrib.gis.db import models as gismodels
# from django.contrib.postgres.fields import JSONField
# from django.db import models
# from django.utils.translation import ugettext as _
#
# from apps.landmatrix.models import Deal
# from apps.landmatrix.models.mixins import (
# OldContractMixin,
# OldDa... | sinnwerkstatt/landmatrix | apps/landmatrix/models/deal_submodels.py | Python | agpl-3.0 | 5,262 |
# © 2014-2015 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
# Copyright 2016 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
import logging
from odoo import api, fields, models
from odoo.exceptions import UserError
from odoo.tools.translate import _
from ..exceptions import... | OCA/connector-cmis | cmis/models/cmis_backend.py | Python | agpl-3.0 | 4,701 |
# This file is part of Archivematica.
#
# Copyright 2010-2013 Artefactual Systems Inc. <http://artefactual.com>
#
# Archivematica 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 ... | sevein/archivematica | src/dashboard/src/components/helpers.py | Python | agpl-3.0 | 13,812 |
# -*- coding: utf-8 -*-
# Copyright 2017 KMEE
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from __future__ import division, print_function, unicode_literals
from odoo import fields, models
class FinancialDocumentType(models.Model):
_name = b'financial.document.type'
_description = 'Financ... | thinkopensolutions/l10n-brazil | financial/models/financial_document_type.py | Python | agpl-3.0 | 599 |
# Copyright 2018 the Isard-vdi project authors:
# Alberto Larraz Dalmases
# Josep Maria Viñolas Auquer
# Daniel Criado Casas
# License: AGPLv3
class BalancerInterface(object):
def get_next(self, **kwargs):
raise NotImplementedError
| isard-vdi/isard | engine/engine/engine/services/balancers/balancer_interface.py | Python | agpl-3.0 | 262 |
###########################################################################
# (C) Vrije Universiteit, Amsterdam (the Netherlands) #
# #
# This file is part of AmCAT - The Amsterdam Content Analysis Toolkit #
# ... | amcat/amcat | api/rest/tests/test_renderer.py | Python | agpl-3.0 | 2,580 |
# -*- coding: utf8 -*-
# This file is part of PyBossa.
#
# Copyright (C) 2014 SF Isle of Man Limited
#
# PyBossa 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... | stefanhahmann/pybossa | test/test_jobs/test_import_tasks.py | Python | agpl-3.0 | 3,473 |
"""
4
2 belas
seratus 4 puluh 0
9 ribu seratus 2 puluh 1
2 puluh 1 ribu 3 puluh 0
9 ratus 5 ribu 0
8 puluh 2 juta 8 ratus 8 belas ribu seratus 8 puluh 8
3 ratus 1 juta 4 puluh 8 ribu 5 ratus 8 puluh 8
"""
def kata(n):
angka = range(11)
temp = ""
if n < 12:
temp += str(angka[n])
elif n < 20:
... | agusmakmun/Some-Examples-of-Simple-Python-Script | list/katakan.py | Python | agpl-3.0 | 984 |
from comics.aggregator.crawler import CrawlerBase, CrawlerImage
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = 'Reveland'
language = 'no'
url = 'http://reveland.nettserier.no/'
start_date = '2007-03-20'
end_date = '2013-04-17'
active = False
rights ... | datagutten/comics | comics/comics/reveland.py | Python | agpl-3.0 | 447 |
# -*- 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 funct... | mdhaman/superdesk-core | apps/archive/commands.py | Python | agpl-3.0 | 19,764 |
from django.conf.urls import url
from django.contrib.auth.decorators import login_required, user_passes_test
from django.conf import settings
from .views import (
PreSignupView, SignupView, LoginView, LogoutView, ForgotPasswordView, ChangePasswordView,
UserProfileView, UserProfileEditPersonalView, UserProfileE... | hirunatan/estelcon_web | user_profiles/urls.py | Python | agpl-3.0 | 1,731 |
"""
Internet archive S3 web connector.
Copyright 2008-2010 Internet Archive.
Parts of this are derived from:
Python WebDAV Server.
Copyright (C) 1999 Christian Scholz (ruebe@aachen.heimat.de)
This library is free software; you can redistribute it and/or
modify it under the terms of the GN... | internetarchive/ias3 | s3path.py | Python | lgpl-2.1 | 1,384 |
#!/usr/bin/python
import os
import commands
import termios
import sys
def enable_echo(fd, enabled):
(iflag, oflag, cflag, lflag, ispeed, ospeed, cc) = termios.tcgetattr (fd)
if enabled:
lflag |= termios.ECHO
else:
lflag &= ~termios.ECHO
new_attr = [iflag, oflag, cflag, lflag, ispeed, o... | ASPLes/turbulence | tools/tbc-ctl/tbc-setup-mod-radmin.py | Python | lgpl-2.1 | 4,910 |
# coding: utf-8
"""
cx_Freeze extension
Extends:
- the 'build' command with the 'exe-command' option to allow using a
different command from 'build_exe' to build executables from Python scripts.
- the 'install' command with the 'skip-sub-commands' option to allow not
running a set of sub commands, e.g.:
install... | ssdi-drive/nuxeo-drive | nx_cx_Freeze/__init__.py | Python | lgpl-2.1 | 6,744 |
##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | wscullin/spack | lib/spack/spack/cmd/__init__.py | Python | lgpl-2.1 | 9,961 |
import pytest
from gosa.common import Environment
from gosa.common.components import PluginRegistry, ObjectRegistry
import os
def pytest_unconfigure(config):
PluginRegistry.getInstance('HTTPService').srv.stop()
PluginRegistry.shutdown()
@pytest.fixture(scope="session", autouse=True)
def use_test_config():
... | gonicus/gosa | plugins/goto/conftest.py | Python | lgpl-2.1 | 496 |
##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgarren/spack | var/spack/repos/builtin/packages/r-gridextra/package.py | Python | lgpl-2.1 | 1,773 |
##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | EmreAtes/spack | lib/spack/spack/cmd/reindex.py | Python | lgpl-2.1 | 1,426 |
import inspect
from zope.interface import implements
from pyparsing import MatchFirst
from openpix import interfaces
from openpix import util
from openpix.util import oneOfCaseless
commandClasses = {}
subcCommandClasses = {}
def getModules(subpackage):
"""
Get all the modules in a given subpackage.
"... | oubiwann/openpix | openpix/command/base.py | Python | lgpl-2.1 | 5,056 |
# -*- coding: utf-8 -*-
#
# FabGIS documentation build configuration file, created by
# sphinx-quickstart on Sun Jun 2 22:29:26 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
# autogenerated file.
#
# All ... | timlinux/fabgis | docs/source/conf.py | Python | lgpl-2.1 | 10,614 |
#!/bin/env python
# -*- coding: utf-8 -*-
""" @package XBee Zigbee API Test Programme
Funtions include:
1) AT command;
2) Remote AT command
3) Send single TX request with response in const frequency
4) Send continuous TX requests with/without response in const frequency
5) Flow rate predict/measurement in Pps(Packet p... | matthewzhenggong/fiwt | XbeeZBS2Test/CommandWiFi.py | Python | lgpl-3.0 | 60,244 |
from __future__ import division
import math
import urlparse
import urllib
import tornado.web
class PersonModule(tornado.web.UIModule):
def render(self, entry):
return self.render_string("modules/person.html", entry=entry)
class TodoModule(tornado.web.UIModule):
def render(self, entry, updates=None, ... | xiangcai/todother | module/uimodules.py | Python | lgpl-3.0 | 2,454 |
#!/usr/bin/env python
##############################################################################
##
## This file is part of Sardana
##
## http://www.sardana-controls.org/
##
## Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
##
## Sardana is free software: you can redistribute it and/or modify
## it und... | sagiss/sardana | src/sardana/sardanamodulemanager.py | Python | lgpl-3.0 | 9,493 |
# coding=utf-8
from django.core.paginator import Paginator, InvalidPage, EmptyPage
from urllib import urlencode
try:
from urlparse import parse_qs
except ImportError:
from cgi import parse_qs
class SimplePaginator(object):
"""A simple wrapper around the Django paginator."""
def __init__(self, request... | dbrgn/django-simplepaginator | simple_paginator/__init__.py | Python | lgpl-3.0 | 4,672 |
#! /usr/bin/env python
from __future__ import print_function, division
from openturns import *
from otsvm import *
# instantiate a kernel=Gaussian with sigma = 2
kernel = NormalRBF(2)
x = Point(2, 2.0)
y = Point(2, 1.0)
print(" kernel ([2 2],[1 1]) = %.12g" % kernel(x, y))
print(" dkernel/dx_i([2 2],[1 1]) = ", repr... | openturns/otsvm | python/test/t_NormalRBF_std.py | Python | lgpl-3.0 | 701 |
from __future__ import print_function
import argparse
import logging
import imp
import os
import sys
from . import logger
from . import plugin
from . import nmea # noqa
from .api import BoatdHTTPServer, BoatdRequestHandler
from .behaviour import Behaviour
from .behaviour import BehaviourManager
from .boat import Boa... | Danyc0/boatd | boatd/__init__.py | Python | lgpl-3.0 | 3,800 |
"""
This file is part of the splonebox python client library.
The splonebox python client 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 any later version.
It i... | splone/splonebox-client | test/functional/test_complete_call.py | Python | lgpl-3.0 | 4,205 |
#! /use/bin/env python
# -*- coding: utf-8 -*-
'''/* generateSintagmaProblem_6WP.py
*
* Copyright (C) 2016 Gian Paolo Ciceri
*
* 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... | gpciceri/milagathos | SixWeeksPreparationForReadingCaesar/pgm/generateSintagmaProblem_6WP.py | Python | lgpl-3.0 | 3,153 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from PySide import QtCore
from PySide import QtGui
from PySide import QtWebKit
import sys
import re
import datetime
import os
import time
import subprocess
import threading
import atexit
import webbrowser
import functools
import operator
import Viewer
import Controller
cla... | josquindebaz/P2Qt | p2gui.py | Python | lgpl-3.0 | 106,057 |
# Let's import the teq module. Make sure the dynamic linker is setup to find libteq.so. Also
# make sure that python finds teq.so (the python module).
#
import teq
# Let's import the little python library that makes some things a little easier
from pyteq import *
# Create a teq object. This creates the jack client, ... | fps/teq | example.py | Python | lgpl-3.0 | 2,171 |
# -*- coding: utf-8 -*-
from . import saas_portal_tagging
from . import wizard
| thinkopensolutions/odoo-saas-tools | saas_portal_tagging/models/__init__.py | Python | lgpl-3.0 | 79 |
# GridCal
# Copyright (C) 2022 Santiago Peñate Vera
#
# This program 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 pr... | SanPen/GridCal | src/GridCal/Engine/Devices/load.py | Python | lgpl-3.0 | 9,713 |
# Copyright 2016 Casey Jaymes
# This file is part of Expatriate.
#
# Expatriate 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.... | cjaymes/expatriate | src/expatriate/xpath/NodeTest.py | Python | lgpl-3.0 | 877 |
# -*- coding: utf-8 -*-
# © 2017 Savoir-faire Linux
# License LGPL-3.0 or later (http://www.gnu.org/licenses/gpl).
from odoo import api, models
class IrRule(models.Model):
_inherit = 'ir.rule'
@api.model
def _compute_domain(self, model_name, mode="read"):
if getattr(self.env, '_bypass_access', ... | savoirfairelinux/secure-odoo | action_access_control_list/models/ir_rule.py | Python | lgpl-3.0 | 486 |
# -*- coding: utf-8 -*-
#-------------------------------------------------
#-- osm map importer
#--
#-- microelly 2016 v 0.4
#--
#-- GNU Lesser General Public License (LGPL)
#-------------------------------------------------
'''import data from openstreetmap'''
#http://api.openstreetmap.org/api/0.6/map?bbox=11.74182,... | microelly2/geodata | geodat/import_osm.py | Python | lgpl-3.0 | 23,641 |
# -*- coding: utf-8 -*-
# Newton's Method for finding the root of a scalar function
def newton(nf, x):
# Inputs
# nf - calculates f(x)/df(x) for given x
# x - initial guess
# Outputs
# x - solution (hopefully)
# Parameters
#itr = 1 # Iteration count
#mitr = 1000 # Max. iterations
... | coin-or/oBB | obb/newton.py | Python | lgpl-3.0 | 851 |
# Copyright 2012-2014, Damian Johnson and The Tor Project
# See LICENSE for licensing information
"""
Parsing for Tor extra-info descriptors. These are published by relays whenever
their server descriptor is published and have a similar format. However, unlike
server descriptors these don't contain information that To... | DigiThinkIT/stem | stem/descriptor/extrainfo_descriptor.py | Python | lgpl-3.0 | 35,907 |
# coding: utf-8
from schematics.types import StringType, IntType, FloatType, BooleanType
from il2fb.config.ds.compat import configparser
_NO_VALUE = object()
_TYPE_TO_GETTER_MAP = {
StringType: 'get',
IntType: 'getint',
FloatType: 'getfloat',
BooleanType: 'getboolean',
}
def _get_getter(class_type... | IL2HorusTeam/il2fb-ds-config | il2fb/config/ds/schemas/helpers.py | Python | lgpl-3.0 | 1,174 |
from distutils.core import setup
setup(
name='ShadowCraft-Engine',
url='http://github.com/dazer/ShadowCraft-Engine/',
version='0.1',
packages=['shadowcraft',
'shadowcraft.calcs', 'shadowcraft.calcs.rogue', 'shadowcraft.calcs.rogue.Aldriana',
'shadowcraft.calcs.darkmantle', 'shadowcraft.... | Pathal/ShadowCraft-Engine | setup_dm.py | Python | lgpl-3.0 | 473 |
from coinpy.model.scripts.opcodes import OP_2DIV, OP_2MUL, OP_AND, OP_CAT,\
OP_DIV, OP_INVERT, OP_LSHIFT, OP_LEFT, OP_MOD, OP_OR, OP_RIGHT, OP_RSHIFT,\
OP_SUBSTR, OP_XOR, OP_MUL
DISABLED_OPCODES=[OP_CAT, OP_SUBSTR, OP_LEFT, OP_RIGHT, OP_INVERT, OP_AND, OP_OR, OP_XOR, OP_2MUL, OP_2DIV, OP_MUL, OP_DIV, OP_MOD, ... | sirk390/coinpy | coinpy-lib/src/coinpy/lib/vm/opcode_impl/disabled.py | Python | lgpl-3.0 | 341 |
#!/usr/bin/env python
#
#
# Copyright 2009 Andrei <vish@gravitysoft.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, ... | barmalei/primus | lib/primus/test/testmysql.py | Python | lgpl-3.0 | 1,858 |
import asyncio
import aiohttp
class Snapshot:
filename = 'fk_test.ts'
async def update(self):
async with aiohttp.ClientSession() as session:
async with session.get('http://192.168.3.1:9094/frikanalen.ts') as resp:
with open(self.filename, 'wb') as fd:
wh... | Frikanalen/frikanalen | packages/utils/prom-check-video-stream/snapshot.py | Python | lgpl-3.0 | 674 |
#
# This file is part of CasADi.
#
# CasADi -- A symbolic framework for dynamic optimization.
# Copyright (C) 2010 by Joel Andersson, Moritz Diehl, K.U.Leuven. All rights reserved.
#
# CasADi is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Pub... | jgillis/casadi | test/python/mx.py | Python | lgpl-3.0 | 61,968 |
def pyfib(n):
a, b = 1, 1
for i in range(n):
a, b = a+b, a
return a
| jeffzhengye/pylearn | speed/cython/scipy2013-cython-tutorial-master/demo/fib/test.py | Python | unlicense | 88 |
#bagging to make it better
import pandas as pd
import numpy as np
from ggplot import *
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.linear_model import LogisticRegression
from sklearn.cross_validation import cross_val_score
from sklearn.metrics import auc_score
train = pd.read_csv('/Users/... | JessicaGarson/MovieSentiment | baggedmovies.py | Python | unlicense | 1,258 |
"""
# A Better Where
WHERE2 is a near-linear time top-down clustering alogithm.
WHERE2 updated an older where with new Python tricks.
## Standard Header Stuff
"""
from __future__ import division, print_function
from pdb import set_trace
import sys
import types
from demos import *
from libWhere import *
from nas... | ai-se/Tree-Learner | _imports/where2.py | Python | unlicense | 11,309 |
__author__ = 'Dominic Miglar <dominic.miglar@bitmovin.net>'
import unittest
import bitcodin
from bitcodin.test.bitcodin_test_case import BitcodinTestCase
from bitcodin.rest import RestClient
class GetStatisticsCurrentMonthTestCase(BitcodinTestCase):
def setUp(self):
super(GetStatisticsCurrentMonthTestCa... | bitmovin/bitcodin-python | bitcodin/test/statistics/testcase_get_statistics_current.py | Python | unlicense | 614 |
''' Data model and factory implementations that are backed by Amazon Web Service's DynamoDB2 NoSQL database '''
from boto.dynamodb2.table import Table
from time import strftime, strptime
from smcity.misc.errors import CreateError, ReadError
from smcity.misc.logger import Logger
from smcity.models.data import Data, Da... | ChaseSnapshot/smcity | smcity/models/aws/aws_data.py | Python | unlicense | 6,158 |
# uncompyle6 version 2.9.10
# Python bytecode 2.7 (62211)
# Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10)
# [GCC 6.2.0 20161005]
# Embedded file name: type_Result.py
from types import *
class AvailableResult:
def __init__(self):
self.__dict__['available'] = False
def __getattr__(s... | DarthMaulware/EquationGroupLeaks | Leak #5 - Lost In Translation/windows/Resources/FlAv/PyScripts/Lib/flav/flav/cmd/flavcontrol/type_Result.py | Python | unlicense | 4,626 |
# pdteco.py
# A public-domain Python implementation of the core commands of TECO.
# This code is released to the public domain.
# "Share and enjoy....." ;)
#
# *** To do...... ***
# NOTE - the built-in functions f.tell() and f.seek() should be very
# useful.
# From the Python docs -
# f.tell() ... | mooseman/pdteco | pdteco.py | Python | unlicense | 6,753 |
from sympy import symbols, diff, N, Matrix
import numpy as np
from task4 import get_euler_dt
X1, X2, X3 = symbols('X1 X2 X3')
def get_vorticity_tensor(eq1, eq2, eq3):
vkl = get_euler_dt(eq1, eq2, eq3)
wkl = 0.5*(vkl - np.transpose(vkl))
return N(Matrix(wkl), 2)
def get_vorticity_components(eq1, eq2, eq3)... | toomastahves/math-pg | pkmkt2_code/task6.py | Python | unlicense | 625 |
"""Custom urls.py for django-registration."""
from django.conf import settings
from django.conf.urls import include, url
from django.views.generic import TemplateView
from registration.backends.default.views import (
ActivationView,
RegistrationView,
)
from registration_email.forms import EmailRegistrationForm... | bitmazk/django-registration-email | registration_email/backends/default/urls.py | Python | unlicense | 1,615 |
import json
import urllib
import urllib.request
from http.cookiejar import CookieJar
import requests
import html
import re
import time
from pyspark.sql import SparkSession, Row
from pyspark.sql.types import StructType, StructField, IntegerType, StringType
def get_guide(url):
import requests
try:
res... | dlacy/spark_playground | libguides/0_harvest.py | Python | unlicense | 1,710 |
# -*- coding: utf-8 -*-
# Copyright 2016 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
#
# Un... | google/mirandum | alerts/ytsubs/migrations/0003_auto_20160418_0455.py | Python | apache-2.0 | 2,254 |
# coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# 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 applicab... | google-research/google-research | amortized_bo/simple_ising_model.py | Python | apache-2.0 | 6,429 |
N = int(input())
gemido = (N-1) * "Ho "
print("{0}Ho!".format(gemido)) | henrywm/URI | src/beginner/1759.py | Python | apache-2.0 | 73 |
# Copyright (c) 2013 OpenStack Foundation
# 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 ... | blueboxgroup/neutron | neutron/plugins/ml2/drivers/type_vxlan.py | Python | apache-2.0 | 7,094 |
from setuptools import setup, find_packages
setup(name='pocket',
version='0.0.0',
packages=find_packages(),
install_requires=['sneeze'],
entry_points={'nose.plugins.sneeze.plugins.add_models' : ['pocket_models = pocket.database:add_models'],
'nose.plugins.sneeze.plugins.add_... | psusloparov/sneeze | pocket/setup.py | Python | apache-2.0 | 492 |
# -*- coding: utf-8 -*-
#
# 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
#... | Fokko/incubator-airflow | airflow/gcp/example_dags/example_spanner.py | Python | apache-2.0 | 8,612 |
import tornado.ioloop
import tornado.web
import os
import json
import datetime
from blogpost import BlogpostHandler
from image import ImageHandler
from setting import SettingHandler
class DateTimeEncoder(json.JSONEncoder):
def default(self, o): # pylint: disable=E0202
if isinstance(o, datetime.datetime... | mudream4869/imaginary-city | admin/app.py | Python | apache-2.0 | 3,380 |
# Enterprise Java Beans
#
# Exercise a stateful session EJB from the Oracle WebLogic Server
# examples. Additionally this script demonstrates the use of the
# ScriptContext sleep(), getThreadId() and getRunNumber() methods.
#
# Before running this example you will need to add the EJB client and
# the WebLogic classes t... | NineWoranop/loadtesting-kpi | loadtesting/ThirdPartyTools/grinder-3.11/examples/ejb.py | Python | apache-2.0 | 1,893 |
import pytest
from news import newsconfig
class TestNewsConfig(object):
def test_news_config_with_path(self):
n = newsconfig.NewsConfig('./news.cfg.example')
assert n.configpath == './news.cfg.example'
def test_news_config_without_path(self, capsys):
try:
with pytest.rai... | bizarrechaos/newsapi-client | tests/test_newsconfig.py | Python | apache-2.0 | 630 |
"""
Manila configuration - file ``/etc/manila/manila.conf``
=======================================================
The Manila configuration file is a standard '.ini' file and this parser uses
the ``IniConfigFile`` class to read it.
Sample configuration::
[DEFAULT]
osapi_max_limit = 1000
osapi_share_base... | wcmitchell/insights-core | insights/parsers/manila_conf.py | Python | apache-2.0 | 1,598 |
from selenium.webdriver import Firefox
from selenium.webdriver.common.by import By
driver_class = Firefox
implicit_timeout = 30
wait_timeout = 30
default_search_type = By.ID
try:
from local_webium_settings import *
except ImportError:
pass
| drptbl/webium | webium/settings.py | Python | apache-2.0 | 251 |
# Copyright 2015 Google Inc. All Rights Reserved.
# Modifications copyright 2017 Jan Buys.
#
# 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
#... | janmbuys/DeepDeepParser | rnn/seq2seq_decoders.py | Python | apache-2.0 | 50,214 |
#!/usr/bin/env python
#
"""oocgcm.oceanfuncs.eos.teos10
Equation of state of sea water and related quantities.
This module uses the formulas from the
Thermodynamic Equation Of Seawater - 2010 (TEOS-10)
"""
| lesommer/oocgcm | oocgcm/oceanfuncs/eos/teos10.py | Python | apache-2.0 | 209 |
#
# Copyright (c) SAS Institute 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 w... | sassoftware/jobslave | jobslave_test/keytest.py | Python | apache-2.0 | 5,039 |
from enum import Enum
EXIT_CODES = [
"SUCCESS",
"BUILD_FAILURE",
"PARSING_FAILURE",
"COMMAND_LINE_ERROR",
"TESTS_FAILED",
"PARTIAL_ANALYSIS_FAILURE",
"NO_TESTS_FOUND",
"RUN_FAILURE",
"ANALYSIS_FAILURE",
"INTERRUPTED",
"LOCK_HEL... | antmicro/distant-bes | distantbes/enums.py | Python | apache-2.0 | 1,058 |
#encoding=utf-8
import sys
from numpy import *
from tools.MysqlBase import *
import jieba
from os import listdir,mkdir,path,makedirs
import hashlib
import base64
import pickle
import re
reload(sys)
sys.setdefaultencoding( "utf-8" )
db = MysqlBase('python')
list_of_all_the_lines = db.query('select * from blog wher... | maxis1314/pyutils | crawler/bayes_fenci.py | Python | apache-2.0 | 1,170 |
from django.core.urlresolvers import reverse
from bakery.views import BuildableDetailView, BuildableListView
from core.views import get_build_path
from .models import BirthCertificate
class ListView(BuildableListView):
def __init__(self, **kwargs):
super(ListView, self).__init__(**kwargs)
ListV... | ginabythebay/iddocs | bcs/views.py | Python | apache-2.0 | 827 |
import sys
try:
import setuptools
from setuptools import setup
except ImportError:
setuptools = None
from distutils.core import setup
version = '0.0.1'
kwargs = {}
if setuptools is not None:
kwargs['install_requires'] = ['tornado>=4.3']
if sys.version_info < (3, 4):
kwargs['install_... | bdarnell/tornado_http2 | setup.py | Python | apache-2.0 | 702 |
# Copyright 2012 OpenStack Foundation
#
# 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... | rodrigods/keystone | keystone/tests/test_backend.py | Python | apache-2.0 | 205,792 |
#!/usr/bin/python
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
import sys
import re
import os
import shutil
import commands
"""Copy Special exercise
"""
#... | NeejaYanglea/Python-google-course | copyspecial/copyspecial.py | Python | apache-2.0 | 2,207 |
#!/usr/bin/env python
#
# Copyright 2007 Google LLC
#
# 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... | GoogleCloudPlatform/appengine-python-standard | src/google/appengine/api/api_testutil.py | Python | apache-2.0 | 6,637 |
########
# Copyright (c) 2015 GigaSpaces Technologies Ltd. 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... | pathakvaidehi2391/WorkSpace | azurecloudify/resourcegroup.py | Python | apache-2.0 | 4,763 |
#pylint: disable=W0142,W0105
'''
Copyright 2014 eBay Software Foundation
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 applicabl... | eBay/cronus-agent | agent/agent/config/middleware.py | Python | apache-2.0 | 3,424 |
import datetime
import bcrypt
import rethinkdb as r
from sondra.api.expose import expose_method, expose_method_explicit
from sondra.auth.decorators import authorized_method, authorization_required, authentication_required, anonymous_method
from sondra.collection import Collection
from .documents import Credentials, R... | JeffHeard/sondra | sondra/auth/collections.py | Python | apache-2.0 | 11,035 |