src stringlengths 721 1.04M |
|---|
# -*- coding:utf-8 -*-
## src/common/contacts.py
##
## Copyright (C) 2006 Dimitur Kirov <dkirov AT gmail.com>
## Travis Shirk <travis AT pobox.com>
## Nikos Kouremenos <kourem AT gmail.com>
## Copyright (C) 2006-2014 Yann Leboulanger <asterix AT lagaule.org>
## ... |
# -*- Coding: UTF-8 -*-
import os
from captcha.image import ImageCaptcha
import numpy as np
from PIL import Image
import tensorflow as tf
import random
# import time
NUMBER = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
ALPHABET_LOWER = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l',\
'm', 'n', 'o... |
###
# Copyright (c) 2006, Jeremy Kelley
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions... |
#!/usr/bin/env python
import logging
l = logging.getLogger("angr.storage.memory")
import claripy
from ..state_plugins.plugin import SimStatePlugin
from ..engines.vex.ccall import _get_flags
stn_map = { 'st%d' % n: n for n in xrange(8) }
tag_map = { 'tag%d' % n: n for n in xrange(8) }
class AddressWrapper(object):
... |
#!/usr/bin/env python
#
# Copyright 2015 Google 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 o... |
# -*- coding: utf-8 -*-
'''This module contains recurrent network structures.'''
import collections
import numpy as np
import re
import sys
import theano.tensor as TT
import theano
import pdb
from . import feedforward
def batches(samples, labels=None, steps=100, batch_size=64, rng=None):
'''Return a callable t... |
#!/usr/bin/env python3
"""
Show full list of files.
"""
import argparse
import glob
import os
import signal
import sys
from typing import Iterator, List, Union
import file_mod
class Options:
"""
Options class
"""
def __init__(self) -> None:
self._args: argparse.Namespace = None
self... |
# Copyright (c) 2011-2015 Rackspace US, 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... |
import os
import time
from datetime import datetime
from django.utils.translation import ugettext_lazy as _
from . import uwsgi
def get_uwsgi_stats():
uwsgi_stats = {}
workers = uwsgi.workers()
total_load = time.time() - uwsgi.started_on
for w in workers:
w['running_time'] = w['running_time'] ... |
#
# Copyright (c) 2015 Fluke Networks.
# All rights reserved.
# No part of this source code may be copied, used, or modified
# without the express written consent of Fluke Networks.
#
# aci2xml.py: Convert the policy manager related section in a *.aci
# file to xml. For example, these lines:
# [\Polic... |
from hpp.corbaserver.rbprm.rbprmbuilder import Builder
from hpp.corbaserver.rbprm.rbprmfullbody import FullBody
from hpp.gepetto import Viewer
import time
from hpp.corbaserver import ProblemSolver
from hpp.corbaserver.rbprm.rbprmstate import State,StateHelper
import time
rLegId = 'talos_rleg_rom'
rLeg = 'leg_right_1_... |
from django.conf import settings
from django.contrib.auth import get_user_model, authenticate, login, password_validation
from django.contrib.auth.forms import PasswordResetForm
from django.contrib.sites.shortcuts import get_current_site
from django.core.mail import EmailMultiAlternatives
from django.core.exceptions im... |
# Copyright 2018 The trfl 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 applicable law... |
import os
import re
SECRET_KEY = "DUMMY_SECRET_KEY"
PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__))
INTERNAL_IPS = []
TEMPLATES = [
{
"BACKEND": "django.template.backends.django.DjangoTemplates",
"DIRS": [
os.path.join(PROJECT_ROOT, "test_templates"),
],
"AP... |
# Convert a list of hex values into decimal values
# Update from labview_parse_1
# - now includes the option to keep only the first n columns of the original data file,
# where n is the second user input
# Arguments:
# 1 - unparsed input file name
# 2 - number of columns to keep from the original data file
impor... |
"""Export an image."""
# :license: MIT, see LICENSE for more details.
import click
import SoftLayer
from SoftLayer.CLI import environment
from SoftLayer.CLI import exceptions
from SoftLayer.CLI import helpers
@click.command()
@click.argument('identifier')
@click.argument('uri')
@click.option('--ibm-api-key',
... |
# GNU Enterprise Common Library - Generic DBSIG2 database driver - Connection
#
# Copyright 2000-2007 Free Software Foundation
#
# This file is part of GNU Enterprise.
#
# GNU Enterprise is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public
# License as published by the ... |
# Copyright (c) 2014 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... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-08-31 16:25
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('conten... |
# -*- Mode: Python; py-indent-offset: 4 -*-
# vim: tabstop=4 shiftwidth=4 expandtab
#
# Copyright (C) 2011-2012 Johan Dahlin <johan@gnome.org>
#
# 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 Founda... |
"""
Family Study Password - The Biblical Game
Copyright (C) 2013 Spencer Caesare
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 ver... |
#
# primary.py - Primary verilog syntax tree types
#
# Verilib - A Verilog HDL development framework
# Copyright (c) 2014, Patrick Dear, All rights reserved.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free ... |
from datetime import datetime
import re
import numpy as np
import pytest
import pandas as pd
from pandas import Index, Series, _testing as tm
def test_contains():
values = np.array(
["foo", np.nan, "fooommm__foo", "mmm_", "foommm[_]+bar"], dtype=np.object_
)
values = Series(values)
pat = "mm... |
import numpy as np
import unittest
import os
from openmdao.api import Problem, Group
from openmdao.utils.assert_utils import assert_near_equal
from pycycle.mp_cycle import Cycle
from pycycle.thermo.cea.species_data import janaf
from pycycle.elements.turbine import Turbine
from pycycle.elements.combustor import Combus... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
class AboutTuples(Koan):
def test_creating_a_tuple(self):
count_of_three = (1, 2, 5)
self.assertEqual(5, count_of_three[2])
def test_tuples_are_immutable_so_item_assignment_is_not_possible(self):
count_of_three =... |
from __future__ import division, absolute_import, print_function
import sys
import warnings
import functools
import numpy as np
from numpy.core.multiarray_tests import array_indexing
from itertools import product
from numpy.testing import *
try:
cdll = np.ctypeslib.load_library('multiarray', np.core.multiarray.... |
"""Nearest Neighbor Classification"""
# Authors: Jake Vanderplas <vanderplas@astro.washington.edu>
# Fabian Pedregosa <fabian.pedregosa@inria.fr>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Sparseness support by Lars Buitinck
# Multi-output support by Arnaud Joly <a.joly@ul... |
# Copyright 2012-2017, Damian Johnson and The Tor Project
# See LICENSE for licensing information
"""
Checks for stem dependencies. We require python 2.6 or greater (including the
3.x series), but note we'll be bumping our requirements to python 2.7 in stem
2.0. Other requirements for complete functionality are...
* ... |
import gen
import network as ann
import numpy as np
import util
def eval(neural_net, data, labels):
classes, alphas = neural_net.scan(data, gen.get_default_total_code())
data3ch = util.cvtColorGrey2RGB(data)
red = np.array([1.0, 0.0, 0.0], dtype=np.float32)
for b in xrange(alphas.shape[0]):
f... |
# -*- coding: utf-8 -*-
# Copyright (c) 2014 CoNWeT Lab., Universidad Politécnica de Madrid
# This file is part of CKAN Private Dataset Extension.
# CKAN Private Dataset Extension is free software: you can redistribute it and/or
# modify it under the terms of the GNU Affero General Public License as published by
# t... |
from nutils import *
from nutils.testing import *
import numpy, copy, sys, pickle, subprocess, base64, itertools, os
class TopologyAssertions:
def assertConnectivity(self, domain, geom):
boundary = domain.boundary
interfaces = domain.interfaces
bmask = numpy.zeros(len(boundary), dtype=int)
imask = n... |
# -*- 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
#... |
# Takes a .txt semi-edited version of an exam and creates questions from it
# Inputs:
# A .txt version of the exam (requires some pre-possessing)
# A .txt version of the answers (question # question answer, 1 per line)
# A path of the folder of images that go with the question, named as subject_year_month_question#... |
#!/usr/bin/env python
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file ... |
#
# Copyright 2012 Cisco Systems, Inc.
#
# Author: Soren Hansen <sorhanse@cisco.com>
#
# 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... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
def forwards_func(apps, schema_editor):
State = apps.get_model("ivrs", "State")
User = apps.get_model("users", "User")
states = State.objects.all()
for state in states:
# Trimming the starting 0.... |
# -*- coding: utf-8 -*-
# gaussian-nmf
import math
import numpy as np
# import scipy.sparse as sp
from sys import float_info
import logging
class NMF(object):
# ランダム疎行列
# def convert_sparse_matrix(self, data):
# s1, s2 = data.shape
# if s1 == 3:
# data = data.T
# vals = data[:,... |
import unittest
import unittest.mock
import distutils.errors
from g1.devtools import buildtools
class BuildtoolsTest(unittest.TestCase):
@unittest.mock.patch(buildtools.__name__ + '.distutils.file_util')
def test_make_copy_files(self, mock_file_util):
mock_cmd = unittest.mock.Mock()
mock_cm... |
"""
Class for importing data from a sequencing run into GenLIMS and the
Research DB as new objects.
"""
import logging
import os
import re
from .. import parsing
from .. import database
from .. import annotation
logger = logging.getLogger(__name__)
class FlowcellRunImporter(object):
"""
Collects FlowcellRu... |
# -*- test-case-name: axiom.test.test_upgrading.SchemaUpgradeTest.testUpgradeWithMissingVersion -*-
from axiom.item import Item
from axiom.attributes import text, integer, reference, inmemory
from axiom.upgrade import registerUpgrader, registerAttributeCopyingUpgrader
class ActivateHelper:
activated = 0
def... |
#!/usr/bin/python
import serial
from Queue import Queue, Empty
import time
import threading
from dotstar import Adafruit_DotStar
BAUDRATE = 115200
DEVICE = '/dev/ttyACM0'
DATAPIN = 20
CLOCKPIN = 21
NUMPIXELS = 59
BLUE = 0x0000FF
GREEN = 0xFF0000
RED = 0x00FF00
OFF = 0x000000
ELEVATOR_DOWN = b'd'
ELEVATOR... |
# Author: Nick Raptis <airscorp@gmail.com>
"""
Module for listing commands and help.
"""
from basemodule import BaseModule, BaseCommandContext
from alternatives import _
class HelpContext(BaseCommandContext):
def cmd_list(self, argument):
"""List commands"""
arg = argument.lower()
index ... |
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
from spack import *
class Neuron(Package):
"""NEURON is a simulation environment for single and networks o... |
"""MIT Professional course catalog ETL"""
import logging
import re
from datetime import datetime
from decimal import Decimal
from urllib.parse import urljoin
import requests
from bs4 import BeautifulSoup as bs
from django.conf import settings
from course_catalog.constants import OfferedBy, PlatformType, mitpe_edx_map... |
from __future__ import absolute_import
from pylint.__pkginfo__ import numversion as PYLINT_VERSION
if PYLINT_VERSION >= (1, 5):
from pylint.config import OptionsManagerMixIn
from pylint.utils import _splitstrip
else:
from logilab.common.configuration import OptionsManagerMixIn
from pylint.lint import PyLin... |
import logging
from metrology.instruments import (
Counter,
Gauge,
Histogram,
Meter,
Timer,
UtilizationTimer
)
from metrology.reporter.base import Reporter
class LoggerReporter(Reporter):
"""
A logging reporter that write metrics to a logger ::
reporter = LoggerReporter(level=l... |
# Copyright 2017 Capital One Services, LLC
# Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
from .common import BaseTest
class AlarmTest(BaseTest):
def test_delete(self):
alarm_name = "c7n-test-alarm-delete"
factory = self.replay_flight_data("test_alarm_delete")
... |
# Copyright (c) 2014-2015 Cedric Bellegarde <cedric.bellegarde@adishatz.org>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later vers... |
from __future__ import with_statement
from alembic import context
from sqlalchemy import engine_from_config, pool
from provenance import models
# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config
# add your model's MetaData object here
# for ... |
"""Represent different ways to work with row and column in views."""
class ZeroIndexedRowCol():
"""A cursor position as 0-indexed row and column."""
def __init__(self, row, col):
"""Initialize from row and column as seen in file (start with 1)."""
self._row = row
self._col = col
... |
#!/usr/bin/env python
# Copyright (c) 2010 Matt Harrison
'''
This code will create sql statements to partition a table based an
integer column. Note that it does not run anything, it only generates
sql.
See http://www.postgresql.org/docs/current/interactive/ddl-partitioning.html
for details
Remember to
run:
CREATE L... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
# Copyright 2015 The TensorFlow 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 applica... |
"""
Uses OFX to fetch a 3 month window of transactions from Fidelity.
Other possibibilities:
* Download and parse statement PDFs.
Last 10 years are available, 1 month at a time.
* Download CSVs from Portfolio > Activity & Orders > History > Download.
Last 5 years are available, 3 months at a time.
"""
from io im... |
# -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import
import unittest
import re
from ava.util import resource_path, time_uuid
from ava.util import webutils
class UtilTest(unittest.TestCase):
def test_resource_path(self):
rv = resource_path("path1")
print(rv)
... |
from operator import itemgetter
from pprint import pprint
from django.db import IntegrityError
from django.shortcuts import render, redirect
from django.urls import reverse
from django.views import View
from geral.functions import has_permission
import systextil.models
import lotes.forms as forms
import lotes.model... |
from nodeconductor.core import NodeConductorExtension
class OracleExtension(NodeConductorExtension):
class Settings:
ORACLE_TICKET_TEMPLATES = {
'provision': {
'summary': "Request for a new Oracle instance",
'details': """
Oracle DB purchase... |
import hashlib
import pytest
from django.contrib.auth.models import User
from django.core import mail
from factories import SecretaryFactory, AdministratorFactory
from users.models import Employee
from users.models import Administrator
from users.models import Secretary
from django.core.exceptions import ObjectDoesNo... |
import functions
from array import *
try:
from collections import OrderedDict
except ImportError:
# Python 2.6
from lib.collections26 import OrderedDict
__docformat__ = 'reStructuredText en'
class gramian:
registered = True # Value to define db operator
def __init__(self):
self.init =... |
from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
from django.forms import ModelForm
from .models import Profile
from django.utils.translation import ugettext_lazy as _
class SignUpForm(UserCreationForm):
first_name = forms.CharField(max_len... |
#! /usr/bin/env python2
"""
mbed SDK
Copyright (c) 2011-2013 ARM Limited
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... |
#!/usr/bin/env python
#----------------------------------------------------------------------
# paraviewBathyWSE.py : Visualize bathy and wse simultaneously in
# Paraview.
#----------------------------------------------------------------------
# Copyright(C) 2016 Jason Fleming
#
# This file is part of the ADCIRC Surge... |
# Copyright 2014 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.
from measurements import timeline_controller
from metrics import timeline
from telemetry.page import page_measurement
class ThreadTimes(page_measurement.Page... |
#!/usr/bin/env python
#-------------------------------------------------------------------------------
# FILE: gensms_modem.py
# PURPOSE: genmon.py support program to allow SMS (txt messages)
# to be sent when the generator status changes. This program uses
# an expansion card to send SMS messages via cellular.
# A... |
# -*- coding: utf-8 -*-
from decimal import Decimal
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('order', '0001_initial'),
('offer', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import re
from mikoto.htmlrenderer import RE_USER_MENTION
from mikoto.markdown import render_markdown
from mikoto.checklist import get_checkbox_count
from mikoto.libs.consts import (SOURCE_FILE, NOT_GENERATED,
IGNORE_FILE_E... |
"Implement Idle Shell history mechanism with History class"
from idlelib.configHandler import idleConf
class History:
''' Implement Idle Shell history mechanism.
store - Store source statement (called from PyShell.resetoutput).
fetch - Fetch stored statement matching prefix already entered.
... |
import socket, traceback
host = ''
port = 51423
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s.bind((host, port))
s.listen(1)
print "done"
while 1:
#when connect error happen, skip the error
print '==========='
try:
ClientSock, Clie... |
__author__ = 'j'
import Config as config
import SpecsSpider
class GraphicsCardSpider(SpecsSpider.SpecsSpider):
name = "GPUcrawl" #name to craw, gets used to get the start_urls[]
label = "GRAPHICSCARD" #Name of the Label that needs to be added to the Crawled Node
pathName = "GPUpath" #... |
from . import consolekit as ck
from . import config
# classes
class Shakyo:
CURSOR_WIDTH = 1
def __init__(self, console, example_lines):
self._console = console
self._geometry = _Geometry(console)
self._input_line = ck.Line()
self._example_lines = _FoldedLines(example_lines,
... |
# coding: utf-8
"""
Talon.One API
The Talon.One API is used to manage applications and campaigns, as well as to integrate with your application. The operations in the _Integration API_ section are used to integrate with our platform, while the other operations are used to manage applications and campaigns. #... |
# These are versions of the functions in django.utils.translation.trans_real
# that don't actually do anything. This is purely for performance, so that
# settings.USE_I18N = False can use this module rather than trans_real.py.
from django.conf import settings
from django.utils.encoding import force_text
def ngettext... |
# This source code is licensed under the Apache license found in the
# LICENSE file in the root directory of this project.
import logging
from flask_restplus import Api
from server import settings
from bson import json_util
import json
log = logging.getLogger(__name__)
api = Api(version='1.0',
title='Test... |
# to run
# python resolver_test.py
import unittest
try:
from .resolver import *
except ImportError:
from resolver import *
class ResolverTest(unittest.TestCase):
def test_is_spec_returns_true(self):
file = '/spec/foo/something_spec.rb'
r = Resolver().is_spec(file)
self.assertEqual(r, True)
def test_is_sp... |
"""Added ends and resolved columns to SkirmishAction
Revision ID: 4638ed8c54d9
Revises: 41fe909190d3
Create Date: 2013-11-12 00:33:13.881217
"""
# revision identifiers, used by Alembic.
revision = '4638ed8c54d9'
down_revision = '41fe909190d3'
from alembic import op
import sqlalchemy as sa
def upgrade(engine_name)... |
#!/bin/env/python
# -*- coding: utf-8 -*-
# Copyright 2010 Dirk Holtwick, holtwick.it
#
# 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
#
# U... |
"""
gepify.providers.playlists
~~~~~~~~~~~~~~~~~~~~~~~~~~
Provides information about downloaded playlists
as well as functionality to download playlists.
"""
from werkzeug.contrib.cache import RedisCache
from gepify.celery import celery_app
from . import songs, PLAYLISTS_DIRECTORY
from .songs import S... |
"""
______________________________________________________________________________
File: cvxEDA.py
Last revised: 07 Nov 2015 r69
______________________________________________________________________________
Copyright (C) 2014-2015 Luca Citi, Alberto Greco
This ... |
from importlib import import_module
from toposort import toposort_flatten
import os.path
from django.conf import settings
from django.utils.html import escape
from django.contrib.staticfiles.templatetags.staticfiles import static
from django.core.exceptions import ImproperlyConfigured
from django.template.loader impo... |
# Copyright 2016 Google 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, ... |
import collections
import contextlib
import functools
import inspect
from typing import Generator, List, Optional
from .utils import optional_args_func
class Handler:
"""
Unbound handler.
See also BoundHandler.
"""
def __init__(self, func, hook):
if isinstance(func, classmethod):
... |
babel = None
try:
import babel
except ImportError:
pass
import six
from sqlalchemy import types
from sqlalchemy_utils import ImproperlyConfigured
from sqlalchemy_utils.primitives import Currency
from .scalar_coercible import ScalarCoercible
class CurrencyType(types.TypeDecorator, ScalarCoercible):
"""
... |
"""
Tests for the geometry module
"""
import geometry
EPSILON = 0.001
EPSILON_L = 0.0000001
EPSILON_H = 0.1
def test_half_central_angle():
expected = 0.0016830423969495
actual = geometry.half_central_angle(0.76029552909832, 0.0252164472196439, 0.76220881138424, 0.0213910869250003)
assert abs(expecte... |
from __future__ import division
from __future__ import absolute_import
from django.views.generic import DetailView, TemplateView
from django.core.urlresolvers import reverse
from django.utils import timezone
from django.db.models import Sum, F, FloatField
from django.shortcuts import redirect
from django.contrib.auth ... |
#!/usr/bin/python
# 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... |
# -*- coding: utf-8 -*-
from django.conf import settings
from sys import version_info
from yats.api import *
def update_permissions_after_migration(app,**kwargs):
"""
Update app permission just after every migration.
This is based on app django_extensions update_permissions management command.
"""
... |
#!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible 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.
#
# Ansible is distribut... |
##############################################################################
#
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# T... |
#!/usr/bin/env python
# coding:utf-8
# vi:tabstop=4:shiftwidth=4:expandtab:sts=4
import theano
import lasagne
from join import join_layer as JoinLayer
from ..utils.curry import curry
floatX = theano.config.floatX
def ordered_errors(errors, m=None, prefix='', deterministic=False):
res = []
for t in errors:
... |
#!/usr/bin/env python
"""
sentry-gitlab
=============
An extension for Sentry which integrates with GitLab. Specifically, it allows
you to easily create issues from events within Sentry.
:copyright: (c) 2015 Pancentric Ltd, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from setuptools... |
"""
# Majic
# Copyright (C) 2014 CEH
#
# 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, or
# (at your option) any later version.
#
# This pr... |
# Copyright 2010-2013 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Unit tests for BuildFarmJobBehaviorBase."""
__metaclass__ = type
from datetime import datetime
import os
import shutil
import tempfile
from twisted.internet import defer... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07.
# 2019, SMART Health IT.
import os
import io
import unittest
import json
from . import chargeitemdefinition
from .fhirdate import FHIRDate
class ChargeItemDefinitionTests(unittest.TestCase):
def instantiate_f... |
from flask import Blueprint, current_app, session
from geonature.utils.utilssqlalchemy import json_resp
from geonature.utils.env import get_id_module
# import des fonctions utiles depuis le sous-module d'authentification
from geonature.core.gn_permissions import decorators as permissions
from geonature.core.gn_permis... |
"""Utilities for Go API."""
from txjsonrpc.jsonrpc import BaseSubhandler
from txjsonrpc.jsonrpclib import Fault
class GoApiError(Fault):
"""Raise this to report an error from within an action handler."""
def __init__(self, msg, fault_code=400):
super(GoApiError, self).__init__(fault_code, msg)
cla... |
from django.test import TestCase
from django.utils import timezone
from .models import Month, Withdrawal, Deposit, DepositType, WithdrawalType
from django.core.urlresolvers import reverse
from django.core.exceptions import ObjectDoesNotExist
from . import import_data
from expenses.lib import rabo
from tempfile import N... |
#!/usr/bin/env python
###############################################################################
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License... |
# 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 u... |
# -*- coding: utf-8 -*-
# Asymmetric Base Framework - A collection of utilities for django frameworks
# Copyright (C) 2013 Asymmetric Ventures Inc.
#
# 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 S... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'ui/mainWindow.ui'
#
# Created: Sat Nov 29 18:47:56 2014
# by: PyQt4 UI code generator 4.10.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.