src stringlengths 721 1.04M |
|---|
# encoding: utf-8
'''A Sphinx extension to automatically document CKAN's crazy plugins toolkit,
autodoc-style.
Sphinx's autodoc extension can document modules or classes, but although it
masquerades as a module CKAN's plugins toolkit is actually neither a module nor
a class, it's an object-instance of a class, and it... |
from decimal import Decimal as D
from django import forms
from django.utils.text import force_text
from django.utils.translation import ugettext_lazy as _
from core import models
class Fieldset:
def __init__(self, name, index):
self.name = name
self.index = index
self.fields = []
class... |
#!/usr/bin/env python
from splparser.parsetree import *
from splparser.exceptions import SPLSyntaxError
from splparser.rules.common.fieldrules import *
from splparser.rules.common.fieldlistrules import *
from splparser.rules.common.valuerules import *
from splparser.lexers.strcatlexer import precedence, tokens
star... |
import numpy as np
from nn.train.trainer import Trainer
class LayerData:
def __init__(self, layer):
self.z = np.zeros(layer.size)
self.a = np.zeros(layer.size)
self.neuron_error = np.zeros(layer.size)
self.grad_w = np.zeros(layer.w.shape)
self.grad_b = np.zeros(layer.b.sha... |
# Copyright 2015 UniMOOC. 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 agr... |
#!/usr/bin/env python3
import math
from mission.framework.task import Task
from mission.framework.combinators import Sequential, Concurrent, MasterConcurrent, Retry, Conditional, While, Either
from mission.framework.movement import Heading, RelativeToInitialHeading, VelocityX, VelocityY, Depth, RelativeToCurrentHeadi... |
# Connection to the database where we save orcid-claims (this database
# serves as a running log of claims and storage of author-related
# information). It is not consumed by others (ie. we 'push' results)
# SQLALCHEMY_URL = 'postgres://docker:docker@localhost:6432/docker'
SQLALCHEMY_URL = 'sqlite:///'
SQLALCHEMY_ECHO... |
"""
intervaltree: A mutable, self-balancing interval tree for Python 2 and 3.
Queries may be by point, by range overlap, or by range envelopment.
Test module: IntervalTree, Special methods
Copyright 2013-2018 Chaim Leib Halbert
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file... |
#!/usr/bin/env python
#=========================================================================
# This is OPEN SOURCE SOFTWARE governed by the Gnu General Public
# License (GPL) version 3, as described at www.opensource.org.
# Copyright (C)2017 William H. Majoros (martiandna@gmail.com).
#==============================... |
## This file is part of Invenio.
## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 CERN.
##
## Invenio 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, ... |
import SimpleITK as sitk
import numpy as np
import csv
import os
import json
from PIL import Image
import matplotlib.pyplot as plt
import SimpleITK as sitk
from cv2 import imread, imwrite
def load_itk_image(filename):
itkimage = sitk.ReadImage(filename)
numpyImage = sitk.GetArrayFromImage(itkimage)
numpyOrigin =... |
# Copyright 2013 Jose Blanca, Peio Ziarsolo, COMAV-Univ. Politecnica Valencia
# This file is part of seq_crumbs.
# vcf_crumbs 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, ... |
#
# This file is part of m.css.
#
# Copyright © 2017, 2018, 2019, 2020 Vladimír Vondruš <mosra@centrum.cz>
#
# 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, inc... |
# To maximize python3/python2 compatibility
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
from .StarFile import StarBlock,StarFile,StarList,StarDict
from io import StringIO
# An alternative specification for the Cif ... |
# Django settings for example project.
import os
PROJECT_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir))
DEBUG = True
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postg... |
# Unittests for tinydav lib.
# coding: utf-8
# Copyright (C) 2009 Manuel Hermann <manuel-hermann@gmx.net>
#
# This file is part of tinydav.
#
# tinydav 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, e... |
# Copyright 2012 the rootpy developers
# distributed under the terms of the GNU General Public License
from __future__ import absolute_import
import sys
import re
import fnmatch
import uuid
import ROOT
from .. import log; log = log[__name__]
from .. import asrootpy, QROOT
from ..extern.ordereddict import OrderedDict... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Google
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
... |
# -*- coding: utf-8 -*-
"""Core forms."""
from __future__ import unicode_literals
from django import forms
from django.contrib.auth import (
forms as auth_forms, get_user_model, password_validation
)
from django.db.models import Q
from django.utils.translation import ugettext as _, ugettext_lazy
from modoboa.co... |
"""
Django settings for test_django project.
Generated by 'django-admin startproject' using Django 1.10.
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 ... |
#!/usr/bin/python
# 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 program is distributed in the hope that it w... |
#!/bin/python
""" Code challenge https://www.codeeval.com/open_challenges/51/
Description:
Credits: Programming Challenges by Steven S. Skiena and Miguel A. Revilla
You will be given the x/y co-ordinates of several locations. You will be laying
out 1 cable between two of these locations. In order to minimise the cost... |
# -*- coding: utf-8 -*-
# Unit tests for cache framework
# Uses whatever cache backend is set in the test settings file.
from __future__ import unicode_literals
import os
import re
import copy
import shutil
import tempfile
import threading
import time
import unittest
import warnings
from django.conf import settings
... |
# Copyright (c) 2016 Universidade Federal Fluminense (UFF)
# Copyright (c) 2016 Polytechnic Institute of New York University.
# This file is part of noWorkflow.
# Please, consult the license terms in the LICENSE file.
"""IPython Module"""
from __future__ import (absolute_import, print_function,
... |
# -*- coding: utf-8 -*-
#
from django.views.generic import (
TemplateView, CreateView, UpdateView, DeleteView, DetailView
)
from django.views.generic.detail import SingleObjectMixin
from django.utils.translation import ugettext_lazy as _
from django.urls import reverse_lazy, reverse
from common.permissions import... |
import sys
import tempfile
import hotshot
import hotshot.stats
from cStringIO import StringIO
import cProfile
import pstats
def profile_this(fn):
def profiled_fn(*args, **kwargs):
filepath = "/tmp/%s.profile" % fn.__name__
prof = cProfile.Profile()
ret = prof.runcall(fn, *args, **kwargs)
... |
# Copyright (c) 2015 Mirantis, 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... |
# Dict of the form:
# { cls: [propname]}
# cls: class that has been written with the @sprop annotation
# propname: name of the property
class_sprops = {}
# Dict of the form:
# {cls: {name:(fn, inv_fn)}}
# cls: class that has been written with @cprop annotations
# name: class attribute name
# fn: function to turn... |
"""Gradient Boosted Regression Trees
This module contains methods for fitting gradient boosted regression trees for
both classification and regression.
The module structure is the following:
- The ``BaseGradientBoosting`` base class implements a common ``fit`` method
for all the estimators in the module. Regressio... |
# -*- coding: utf-8 -*-
"""
Copyright (C) 2013 BatOnBots-ML.
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 versi... |
import pyspeckit
import os
if not os.path.exists('n2hp_cube.fit'):
import astropy.utils.data as aud
from astropy.io import fits
f = aud.download_file('ftp://cdsarc.u-strasbg.fr/pub/cats/J/A%2BA/472/519/fits/opha_n2h.fit')
with fits.open(f) as ff:
ff[0].header['CUNIT3'] = 'm/s'
for kw in... |
import sys
sys.path.insert(1, "../../../")
import h2o, tests
def link_functions_tweedie_basic():
print "Read in prostate data."
hdf = h2o.upload_file(tests.locate("smalldata/prostate/prostate_complete.csv.zip"))
print "Testing for family: TWEEDIE"
print "Set variables for h2o."
y = "CAP... |
#!/usr/bin/env python3
'''
Base library for fact materialization
Copyright 2012-2020 Codinuum Software Lab <https://codinuum.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
... |
import os
import re
import subprocess
import unittest
import sys
import selenium_utilities
import selenium_constants
class PDiffTest(unittest.TestCase):
"""A perceptual diff test class, for running perceptual diffs on any
number of screenshots."""
def __init__(self, name, num_screenshots, screenshot_name, pd... |
# Copyright (c) 2011 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 ... |
#!/usr/bin/env python
"""models.py
Udacity conference server-side Python App Engine data & ProtoRPC models
$Id: models.py,v 1.1 2014/05/24 22:01:10 wesc Exp $
created/forked from conferences.py by wesc on 2014 may 24
"""
__author__ = 'wesc+api@google.com (Wesley Chun)'
import httplib
import endpoints
from protor... |
# -*- coding: utf-8 -*-
#
# pg_chameleon documentation build configuration file, created by
# sphinx-quickstart on Sun Oct 9 17:08:30 2016.
#
# 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.
... |
""" Retrieve C.elegans connectivity from Web and parse appropriately
"""
# see data/
# http://mit.edu/lrv/www/elegans/
from scipy.io import matlab
import os.path as op
import networkx as nx
import microcircuit.constants as const
from microcircuit.connectome import Connectome
mat = matlab.loadmat(op.join(op.dirname(o... |
# -*- coding: utf-8 -*-
import os
import json
import pickle
import codecs
from collections import Sequence
from functools import wraps
from dglib.utils import makesure_dirpathexists
FORMAT_JSON = 1
FORMAT_PICKLE = 2
FORMAT_TXT = 3
class FileCache(object):
def __init__(self):
self.enable... |
# -*- coding: utf-8 -*-
# Copyright 2020 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... |
# coding=utf-8
import os
import re
import subprocess
import unittest
import pytest
import six
from mock import patch
from parameterized import parameterized
from conans.client import tools
from conans.client.tools.scm import Git
from conans.errors import ConanException
from conans.test.utils.scm import create_local_g... |
class Frob(object):
def __init__(self, name):
self.name = name
self.before = None
self.after = None
def setBefore(self, before):
# example: a.setBefore(b) sets b before a
self.before = before
def setAfter(self, after):
# example: a.setAfter(b) sets b after a
... |
import logging
try:
from hashlib import sha1
except ImportError:
from sha import sha as sha1
import threading
import time
from random import random
from datetime import timedelta, datetime
import cherrypy
from cherrypy import request
from gearshift import config
from gearshift.util import load_class
from gearshift... |
from __future__ import print_function
import sys
import six
import argparse
from textwrap import dedent
from .cli import clone, fetch, list_, remove, upload, init
from . import __version__
def main():
description = dedent("""
osf is a command-line program to up and download
files from osf.io.
These ... |
# vi: ts=4 expandtab
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3, as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; w... |
"""
Support for deCONZ sensor.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/sensor.deconz/
"""
from homeassistant.components.deconz.const import (
ATTR_DARK, ATTR_ON, CONF_ALLOW_CLIP_SENSOR, DECONZ_REACHABLE,
DOMAIN as DECONZ_DOMAIN)
from home... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'interface/puzzlebox_jigsaw_interface_design-plugin_eeg.ui'
#
# Created: Sun May 10 18:28:33 2015
# by: pyside-uic 0.2.15 running on PySide 1.2.2
#
# WARNING! All changes made in this file will be lost!
from PySide import QtCore, QtGui
... |
'''
Created on May 29, 2013
@author: Devon
Defines a game sprite
'''
import pygame
from pyHopeEngine import engineCommon as ECOM
class GameSprite(pygame.sprite.Sprite):
'''Base game sprite image'''
def __init__(self, file):
pygame.sprite.Sprite.__init__(self)
file = ECOM.engin... |
##
# Copyright (c) 2010-2014 Apple 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 applicab... |
'''
PyDMET: a python implementation of density matrix embedding theory
Copyright (C) 2014, 2015 Sebastian Wouters
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 versio... |
#! /usr/bin/env python
import argparse
import csv
from pprint import pprint
import re
from time import time
import numpy as np
from sklearn.base import BaseEstimator
from sklearn.cross_validation import train_test_split
from sklearn.datasets.base import Bunch
from sklearn.feature_extraction.text import CountVectorize... |
"""
This script is used to create a training database based on GPDSSynth signatures.
Images are scaled to 192x96;
Paper-like backgrounds are added
"""
import argparse
import numpy as np
from scipy.misc import imread, imresize, imshow, imsave
from PIL import Image
import os
from skimage.transform import rotate
import t... |
"""
@summary: This module creates a zip file for a plugin that can be uploaded to
the QGIS repository.
@author: CJ Grady
@status: alpha
@version: 1.0
@license: gpl2
@copyright: Copyright (C) 2014, University of Kansas Center for Research
Lifemapper Project, lifemapper [at] ku [dot] edu,
... |
import os
import json
import redis
import shutil
import datetime
from ws4redis.redis_store import RedisMessage
from ws4redis.publisher import RedisPublisher
from pyvirtualdisplay import Display
from selenium import webdriver
from django.test import TestCase
from django.conf import settings
from sele... |
from L500analysis.data_io.get_cluster_data import GetClusterData
from L500analysis.utils.utils import aexp2redshift
from L500analysis.plotting.tools.figure_formatting import *
from L500analysis.plotting.profiles.tools.profiles_percentile \
import *
from L500analysis.plotting.profiles.tools.select_profiles \
imp... |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import base64
import logging
import psycopg2
import werkzeug.utils
import werkzeug.wrappers
from werkzeug.urls import url_encode
from odoo import api, http, registry, SUPERUSER_ID, _
from odoo.exceptions import AccessE... |
import asyncio
import itertools
import re
from gi.repository import Gtk, GObject
from pychess.compat import create_task
from pychess.Utils import wait_signal
from pychess.System import conf
from pychess.System.Log import log
from pychess.widgets import mainwindow
from pychess.Utils.Move import Move
from pychess.Uti... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import numpy as np # type: ignore
import onnx
from ..base import Base
from . import expect
class ConvTranspose(Base):
@staticmethod
def export(): # type: ()... |
"""
PostgreSQL database backend for Django.
Requires psycopg 2: https://www.psycopg.org/
"""
import asyncio
import threading
import warnings
from contextlib import contextmanager
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db import DatabaseError as WrappedDat... |
from nytimesarticle import articleAPI
import collections
import math
import datetime
import re
import pickle
# api keys
prasmuss = '7b4597b0dc6845688a8f90c00f3e60b6'
peter_gray_rasmussen = '67391c8a5c6c2d8926eb3d9c5d136c59:7:72273330'
proton = 'f8c34c7cda7848f997a9c273815d28a9'
api = articleAPI(proton)
def convert(d... |
# -*- coding: utf-8 -*-
import re
from django.contrib import messages
from django.contrib.admin.views.decorators import staff_member_required
from django.http import HttpResponseRedirect
from django.shortcuts import render
from django_countries import countries
from ..bibtex import parse
from ..models import Publica... |
# 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 ... |
import os
import pytest
from ai.backend.client.config import APIConfig, set_config
@pytest.fixture(autouse=True)
def defconfig():
endpoint = os.environ.get('BACKEND_TEST_ENDPOINT', 'http://127.0.0.1:8081')
access_key = os.environ.get('BACKEND_TEST_ADMIN_ACCESS_KEY',
'AKIAIOSF... |
__all__ = [
'Container',
'PodArgoSubset',
]
from collections import OrderedDict
from typing import Any, Dict, List, Mapping, Optional, Sequence, Union
from ...modelbase import ModelBase
class EnvVar(ModelBase):
_serialized_names = {
'value_from': 'valueFrom',
}
def __init__(self,
... |
#-*- coding:utf-8 -*-
import os
import json
ROOT_PATH = os.path.dirname(os.path.realpath(__file__))
SRC_PATH = ROOT_PATH + "/../../../../doc/最终文档及资源/images/world/erjiditu/erjiditu/Json/erjiditu_1.json"
OUT_LUA_PATH = ROOT_PATH + "/../Resources/script/minimap/minimap.lua"
f = open(SRC_PATH)
jsonstr = f.read()
f.clo... |
# Information on 2's complement: https://en.wikipedia.org/wiki/Two%27s_complement
def twos_complement(number: int) -> str:
"""
Take in a negative integer 'number'.
Return the two's complement representation of 'number'.
>>> twos_complement(0)
'0b0'
>>> twos_complement(-1)
'0b11'
>>> t... |
# -*- coding: utf8 -*-
"""
This file implements test cases for validation communication with REST endpoint on Cexio. This endpoint offer tick informations for given markets.
"""
__author__ = "Jan Seda"
__copyright__ = "Copyright (C) Jan Seda"
__credits__ = []
__license__ = ""
__version__ = "0.1"
__maintainer__ = "Jan... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2016 Lenovo
#
# 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 ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""A sketch-based semi-Markov learner with approximate duration estimation.
Testing module for predicure.
"""
# Copyright © 2017 Carson J. Q. Farmer <carson@set.gl>
# All rights reserved. BSD-2 Licensed.
from __future__ import print_function, division, absolute_import
... |
from piston.handler import BaseHandler, rc
from systems.models import System, SystemRack,SystemStatus,NetworkAdapter,KeyValue
from truth.models import Truth, KeyValue as TruthKeyValue
from dhcp.DHCP import DHCP as DHCPInterface
from dhcp.models import DHCP
from MacroExpansion import MacroExpansion
from KeyValueTree imp... |
from __future__ import division
import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import paraBEM
from paraBEM.liftingline import LiftingLine
from paraBEM.utils import check_path
# WingGeometry
spw = 2
numpos = 50
z_fac_1 = -0.3
z_fac_2 = -0.7
y = np.sin(np.linspace(0, np.pi/2... |
"""
Copyright (c) 2009, Alexey Smirnov
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 and the f... |
# from tflearn examples: https://github.com/tflearn/tflearn/blob/master/examples/images/vgg_network.py
""" Very Deep Convolutional Networks for Large-Scale Visual Recognition.
Applying VGG 11 and 16-layers convolutional network to MNIST and SVHN
Dataset classification task. 28x28x3 shape
References:
Very Deep Conv... |
from django.db import models
# User class for built-in authentication module
from django.contrib.auth.models import User
class UserProfile(models.Model):
user = models.ForeignKey(User, null=False)
username = models.CharField(max_length=200)
firstname = models.CharField(max_length=200)
lastname = models.CharField(... |
# -.- coding: utf-8 -.-
from __future__ import unicode_literals
from datetime import timedelta
from django.conf import settings
from django.core.exceptions import MultipleObjectsReturned
from django.db import models
from django.utils import timezone
import json
# Create your models here.
class SocialNetworkItemCache... |
################################################################################
### Copyright © 2012-2013 BlackDragonHunt
###
### This file is part of the Super Duper Script Editor.
###
### The Super Duper Script Editor is free software: you can redistribute it
### and/or modify it under the terms of the GNU Genera... |
# 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... |
# -* coding: utf-8 -*-
import VKAPI, dataMngt, time
vk = None
one_account = {'vk.com': True, 'ok.ru': True, 'disk.yandex.ru': True}
number_account = dataMngt.get_number_account()
def check_app_data(one_account, res_auth, site):
if res_auth == 'frozen':
print 'Account of "'+vk.user_data[site][1]+'" is froz... |
# -*- coding: utf-8 -*-
"""
requests.session
~~~~~~~~~~~~~~~~
This module provides a Session object to manage and persist settings across
requests (cookies, auth, proxies).
"""
import os
from collections import Mapping
from datetime import datetime
from .compat import cookielib, OrderedDict, urljoin, urlparse, buil... |
#!/usr/bin/env python
import os
import re
import sys
import warnings
from setuptools import setup
MAJOR = 0
MINOR = 0
MICRO = 0
ISRELEASED = False
VERSION = '%d.%d.%d' % (MAJOR, MINOR, MICRO)
QUALIFIER = ''
DISTNAME = 'storylines'
LICENSE = 'GNU General Public License v3.0'
AUTHOR = 'Joseph Hamman'
AUTHOR_EMAIL = '... |
# Copyright (c) 2016, NVIDIA CORPORATION. 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 a... |
# coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from tests import IntegrationTestCase
from tests.holodeck import Request
from twilio.base.exceptions import TwilioException
from twilio.http.response import Response
class WorkflowRealTimeStatistic... |
import sys
import random
import math
def time_it(fn):
def wrapped(*args):
import time
start = time.time()
fn(*args)
used = time.time() - start
print "%s used %s" % (str(fn), used)
return wrapped
@time_it
def assign_fm(conn, tbl_name, edge_table, k):
cur = conn.cursor()
# cur.execute("delete from %s" % t... |
# -*- 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 field 'Track.create_date'
db.add_column(u'admin_track', 'create_date',
self.g... |
#!/usr/bin/python
#
# Extract data from the Wikipedia Heineken Cup Pool Stages
# and create a tidy data set for use in R
#
# A lot of this code handles corner cases and deals with variants
# in the wikipedia pages, and it hasn't been refactored
#
import re
import sys
import unicodedata
from urllib2 import urlopen
from... |
# Copyright 2011 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 requ... |
# -*- coding: UTF-8 -*-
"""
between.client
~~~~~~~~~~~~~~
This module contains the client for Between.
"""
import json
import requests
import websocket
from uuid import uuid1
from datetime import datetime
from mimetypes import MimeTypes
from random import random, choice
from .utils import make_url
from .models impo... |
# -*- coding: utf-8 -*-
"""
This file contains the Qudi counter logic class.
Qudi 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.
Qudi is d... |
# nis2ldap - Smarter NIS to LDAP synchronization tool
# Copyright (C) 2015 Michal Fita
#
# 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) an... |
# -*- coding: utf-8 -*-
#
# diffoscope: in-depth comparison of files, archives, and directories
#
# Copyright © 2015 Jérémy Bobbio <lunar@debian.org>
#
# diffoscope 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 Foundati... |
from core.utils import *
commands = [
('/weather', ['location']),
('/forecast', ['location'])
]
description = 'Returns the current temperature and weather conditions for a specified location using WeatherUnderground API.'
shortcut = ['/w ', '/f ']
def get_icon(icon):
weather_emoji = {}
if i... |
# Copyright 2018 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... |
from django import forms
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Submit
from crispy_forms.layout import Layout, Div, Submit, HTML, Button, Row, Field
from crispy_forms.bootstrap import AppendedText, PrependedText, FormActions
class PremiseForm(forms.Form):
radio_buttons = form... |
from keras.layers.core import Layer
from keras.engine import InputSpec
from keras import backend as K
try:
from keras import initializations
except ImportError:
from keras import initializers as initializations
class Scale(Layer):
'''Learns a set of weights and biases used for scaling the input da... |
"""
Design of this model is influnced by Dublin Core Element Set Metadata.
"""
from django.db import models
from django.contrib.auth.models import User
from django.conf import settings
import tagging
from tagging.fields import TagField
from django.forms import ModelForm, BooleanField
# registered with tagging, de... |
# -*- coding: utf-8 -*-
import unittest
from openprocurement.tender.openeu.constants import TENDERING_DAYS
from openprocurement.tender.esco.tests.base import (
test_tender_data, test_lots, test_bids,
BaseESCOWebTest, BaseESCOEUContentWebTest,
)
from openprocurement.api.tests.base import snitch
from openprocure... |
import logging
import os
from smtplib import SMTPConnectError, SMTPServerDisconnected
from urllib.parse import parse_qsl, ParseResult, urlparse, urlsplit, urlunsplit
import requests
from django.conf import settings
from django.core.mail import EmailMultiAlternatives, get_connection
from django.http import QueryDict
fr... |
# -*- coding: utf-8 -*-
"""Define the add_url_schema template tag to allow cleaning up url in templates.
Copyright (C) 2021 Gitcoin Core
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either... |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 Eficent (<http://www.eficent.com/>)
# <contact@eficent.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero ... |
#
# 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
# distributed under... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.