src stringlengths 721 1.04M |
|---|
from __future__ import with_statement
from logging.config import fileConfig
from sqlalchemy import engine_from_config
from sqlalchemy import pool
from alembic import context
import json
# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config
#... |
#!/usr/bin/env python
# CryptoAPI: Python Crypto API implementation
#
# Copyright (c) 2014 - Albert Puigsech Galicia (albert@puigsech.com)
#
# 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 w... |
# -*- coding:utf-8 -*-
import math
import web
def GetMinerTransactionResult(result) :
html = ''
html = html + '<div class="container">\n'
html = html + '<div class="row">\n'
html = html + '<div class="column column-10"><b>'+ _("MinerTransaction") +'</b></div>\n'
html = html + '<div class="column"><a href="/tx... |
#!/usr/bin/env python
#-*- encoding:utf-8 -*-
import json
from datetime import datetime
from bottle import route, mako_template as template, redirect, request, response, get, post
from bottle import static_file, view #为了不经过controller直接返回诸如html,css等静态文件引入
from model.documents import *
from setting import *
DATE_FORM... |
#!/usr/bin/env python3
import argparse
import importlib
import os
import re
import sqlite3
from datetime import datetime
from urllib.parse import urljoin
import requests
import yaml
def load_plugin_class(plugin_class_str):
"""
dynamically load a class from a string
"""
class_data = plugin_class_str.s... |
#!/usr/bin/env python
# Copyright (c) 2016, Diligent Droids
# 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
# ... |
import binascii
import string
e = 65537
N = 2117672903243982543718682316871526252711806457547609454030889520203949724574698058235821747613875519920176501328068871432817438393885435762043247829203062605160245553645158838861106558077244590404583160688904474995478819140425202290013963177624041695727533599660346969550... |
import sys, os
import unittest
sys.path.append('..\\skeleton\\')
from OmasCompiler import *
PATH_OMAS = "C:\\Users\\enrique.nieto\\Documents\\develops\\omas\\skeleton\\samples\\"
class OmasCompilerTest(unittest.TestCase):
# def test_it_should_be_able_to_construct(self):
# compiler = OmasCompiler(PATH_OMAS,'user.om... |
#This file is part of Tryton. The COPYRIGHT file at the top level of
#this repository contains the full copyright notices and license terms.
import datetime
from decimal import Decimal
try:
import hashlib
except ImportError:
hashlib = None
import sha
class Field(object):
@staticmethod
def sql_fo... |
# 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
#
# Unless required by applicable law or ag... |
#!/usr/bin/python
''' This reduction script is derived almost entirely from the reducer.py
script found here:
http://www.michael-noll.com/tutorials/writing-an-hadoop-mapreduce-program-in-python/
Thanks to Michael Noll for posting his Hadoop MapReduce with Python.
I make no claims to have created th... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import time
import os
import glob
from config import *
import data.calexp
import data.src
## @def attributs
# @brief attributs which we select in SDSS DB and src fits file
attributs = 'objid,run,camcol,field,ra,dec,u,g,r,i,z'
## Calexp treatment ##
def coordCalexp( fit... |
# -*- coding: utf-8 -*-
# Scrapy settings for TheHinduDailyNews project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# http://doc.scrapy.org/en/latest/topics/settings.html
# http://scrapy.readthedocs.org... |
#!/usr/bin/env python
"""Top level datastore objects.
This package contains the rdfvalue wrappers around the top level datastore
objects defined by objects.proto.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import functools
import hashlib
import ... |
# Copyright 2012 the rootpy developers
# distributed under the terms of the GNU General Public License
from __future__ import absolute_import
from math import log
import operator
import ROOT
from .canvas import _PadBase
from .hist import _Hist, Hist, HistStack
from .graph import _Graph1DBase, Graph
from ..context im... |
# -*- coding: utf-8 -*-
__author__ = 'bobby'
import json
import requests
class YDMHttp(object):
apiurl = 'http://api.yundama.com/api.php'
username = ''
password = ''
appid = ''
appkey = ''
def __init__(self, username, password, appid, appkey):
self.username = username
self.pa... |
################################################################################
# MIT License
#
# Copyright (c) 2017 Jean-Charles Fosse & Johann Bigler
#
# 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 t... |
#!/usr/bin/python
# Csound Test Suite
# By Steven Yi <stevenyi at gmail dot com>
import os
import sys
from testUI import TestApplication
from Tkinter import *
parserType = ""
showUIatClose = False
##csoundExecutable = r"C:/Users/new/csound-csound6-git/csound.exe "
csoundExecutable =""
class Test:
def __init__(... |
from . import config, files
from .consoles import Console, Command
from .platforms import builders
from .temp import create_temp_dir
def create_builder(shell, stdout):
return Builder(builders, Console(shell, stdout))
class Builder(object):
def __init__(self, builders, console):
self._console = conso... |
#!/usr/bin/env python3
#-*- coding: utf-8 -*-
# added a new temperature scale, two if statements need to add
def convert_to_celsius(t, source):
if source == "Kelvin":
return t - 273.15
elif source == "Celsius":
return t
elif source == "Fahrenheit":
return (t - 32) * 5 / 9
elif ... |
# ----------------------------------------------------------------------------
# Copyright 2015 Nervana Systems 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.o... |
from matplotlib.colors import LogNorm
import matplotlib.pyplot as plt; plt.ion();
import matplotlib
plt.figure()
plt.title(r'$\theta_{b}$ in each run')
plt.xlabel("Run number")
plt.ylabel(r'$\theta_{b}\ [\mu rad]$')
runs = [4372,5508,5693]
htc_eff = [67.5,67.5,62.6]
htc_eff_err = [0.3,0.2,0.4]
htc_tb = [49.3,59.3,63.7... |
# -*- coding: utf-8 -*-
# This is a Python module containing functions to parse and analyze ncf components
# This module is designed to run on the latest major versions of the most popular
# server OSes (Debian, Red Hat/CentOS, Ubuntu, SLES, ...)
# At the time of writing (November 2013) these are Debian 7, Red Hat/Cen... |
"""
NSW Rural Fire Service Feed platform.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/geo_location/nsw_rural_fire_service_feed/
"""
from datetime import timedelta
import logging
from typing import Optional
import voluptuous as vol
from homeassistant... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from django.conf import settings
import core.models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('core', '0002_auto_2016... |
# coding=utf-8
from __future__ import unicode_literals
import re
from setuptools import setup, Command, find_packages
class PyTest(Command):
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
import sys,subprocess
err... |
'''
whats_present.py
Given a list of file names provides information about which files are
present and which are absent from within a file listing. There's a good
number of tools out there that will do this as well but in my case I didn't
have access to those.
Usage:
whats_present.py [-h] -i FILEDIR -o FILEOUT -t F... |
# This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) 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 program is distributed in the hope that it will b... |
import networkx as nx
from cache import CachedDB
class CGraph:
"""A networkx.Graph-like interface where the data associated with graph nodes and edges are
stored in a persistent database. The graph is assumed undirected.
All node/edge data must be pickle-able.
One small difference between networkx and this is t... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# 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... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('instance', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='LogE... |
#!/usr/bin/env python
###################################################################################
#
# Copyright (c) 2010-2016 Motsai
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Softwa... |
import os
from setuptools import setup
def pkg_dir(path):
return os.path.join(os.path.dirname(__file__), path)
with open(pkg_dir('VERSION'), 'r') as f:
version = f.read().strip()
with open(pkg_dir('README.rst'), 'r') as f:
readme = f.read()
setup(
name='collectd-ntp',
version=version,
py... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2021 AVSystem <avsystem@avsystem.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/LICEN... |
import six
from nose.tools import assert_raises
from syn.base_utils import GroupDict, AttrDict, assert_type_equivalent, \
ReflexiveDict, SeqDict, getfunc, Precedes
from syn.type.a import AnyType, TypeType
from syn.base.b.meta import Attr, Attrs, Meta, Data
from syn.base.a.meta import mro
from syn.base.b.meta import... |
"""
to fix the file names for the data from cwb
201403111800f006_M15.txt -> WRF15.20140312.0000.txt
"""
#from armor import pattern
#import shutil
import os
import datetime, time
from armor import defaultParameters as dp
root = dp.defaultRootFolder
obsFolder = root + "data/march2014/QPESUMS/"
wrfsFolder1 = ... |
__author__ = 'Neil Butcher'
from Error import ExcellImportExportError
import xlwt, xlrd
from Rota_System.Roles import GlobalRoleList, role
from Rota_System.Worker import Worker
from Rota_System.StandardTimes import date_string, get_date
def name(an_object):
return an_object.name
class PopulationSavingObject(ob... |
# -*- test-case-name: contrib.performance.loadtest.test_sim -*-
##
# Copyright (c) 2011-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.apa... |
"""
This module contains integration tests which verify the behavior of the storage
module against supported cloud storage providers. The tests for the local
(directory-based) storage backend are re-used and run for each supported cloud
storage provider. To add tests for a new provider, create a new subclass of
CloudTe... |
"""
Slightly customized python-social-auth backend for SAML 2.0 support
"""
import logging
from copy import deepcopy
import requests
from django.contrib.sites.models import Site
from django.http import Http404
from django.utils.functional import cached_property
from django_countries import countries
from onelogin.sa... |
import time
from datetime import datetime
import random
import xmlrpclib
from xmlrpclib import ServerProxy
from twisted.web import xmlrpc
from basics import basics
import Database
import commands
import bz2
import base64
import types
import zipfile
import os.path
import shlex, subprocess
import locale
from loca... |
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
#
# 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... |
#!/usr/bin/python
# Copyright 2015 Huawei Devices USA 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 r... |
#!/usr/bin/python
# Usage: mitmdump -s "inject_shell.py payload.sh"
# (this script works best with --anticache)
from libmproxy.protocol.http import decoded
def start(context, argv):
if len(argv) != 2:
raise ValueError('Usage: -s "inject_shell.py payload.sh"')
context.payload = get_payload(argv[1])
... |
# ==============================================================================
# Copyright 2019 - Philip Paquette
#
# NOTICE: 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 rest... |
# Copyright 2011 Citrix Systems.
# 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 ... |
from __future__ import absolute_import
import pytest
import schematec.converters as converters
import schematec.exc as exc
def test_zero():
assert converters.integer(0) == 0
def test_positive_number():
assert converters.integer(1) == 1
def test_negative_number():
assert converters.integer(-1) == -1
... |
"""
Settings for this application. The most important is TRANSLATION_LANGUAGES
because it's probably project specific.
.. py:data:: TRANSLATION_LANGUAGES
List of language codes. It is used to generate the alternate_names property
of cities_light models. You want to keep it as small as possible.
By default... |
from __future__ import absolute_import
import datetime
import logging
from django.core.exceptions import MultipleObjectsReturned, ObjectDoesNotExist
from django.db import models
from django.utils.translation import ugettext_lazy as _
from oscar.apps.voucher.abstract_models import ( # pylint: disable=ungrouped-import... |
"""
CaseClass implementation for the case_class module
Copyright (c) 2016 Tom Wiesing -- licensed under MIT, see LICENSE
"""
import inspect
from . import exceptions, clsutils, signature
#
# Meta-classes for the case class
#
class CaseClassMeta(type):
""" Meta-Class for case classes. """
instance_keys = ... |
#!/usr/bin/env python2
# Copyright (c) 2014-2015 The Deuscoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""
Exercise the wallet backup code. Ported from walletbackup.sh.
Test case is:
4 nodes. 1 2 and 3 sen... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import re
import sys
from __main__ import cli
from ansible.module_utils.six import iteritems
from ansible.errors import AnsibleError
from ansible.parsing.yaml.objects import AnsibleMapping, AnsibleSequence, AnsibleUnicode
from ans... |
# -*- coding: utf-8 -*-
#
# cie-PN532 documentation build configuration file, created by
# sphinx-quickstart on Fri Oct 13 17:04:05 2017.
#
# 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.
#
#... |
#A script to check if any two wikipedia pages have any common wiki links
#TODO: Check on multiple levels, i.e. check if any of the linked wikis on the pages have a common wiki link
import requests
import wikipedia
from bs4 import BeautifulSoup
def get_list(page):
links_page=["/wiki/"+page.split("/")[4]]
dat... |
# -*- coding: utf-8 -*-
"""
S3 Microsoft Excel codec
@copyright: 2011-13 (c) Sahana Software Foundation
@license: MIT
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 with... |
TORCH_START_VALUE = 15
THING_START_VALUE = 20
INVISIBLE_START_VALUE = 21
FANTASTIC_START_VALUE = 3
class Story:
heros = ["Heidi", "Fantastic", "Tourch", "Thing", "Invisible"]
heidi = 0
fantastic = FANTASTIC_START_VALUE
torch = TORCH_START_VALUE
thing = THING_START_VALUE
invisible = INVISIBLE_... |
# -----------------------------------------------------------------------------
# ply: yacc.py
#
# Copyright (C) 2001-2015,
# David M. Beazley (Dabeaz LLC)
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
# -----------------------------------------------------------------------------
#
# This implements... |
# -*- coding: utf8 -*-
from __future__ import print_function
'''
Copyright 2009 Denis Derman <denis.spir@gmail.com> (former developer)
Copyright 2011-2012 Peter Potrowl <peter017@gmail.com> (current developer)
This file is part of Pijnu.
Pijnu is free software: you can redistribute it and/or modify it
under the term... |
# Copyright (C) 2012 - 2014 EMC Corporation.
# 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
#
# Unle... |
# -*- python -*-
# -*- coding: utf-8 -*-
#
# This file is part of the colormap software
#
# Copyright (c) 2011-20134
#
# File author(s): Thomas Cokelaer <cokelaer@gmail.com>
#
# Distributed under the GPLv3 License.
# See accompanying file LICENSE.txt or copy at
# http://www.gnu.org/licenses/gpl-3.0.html
#
# ... |
# 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
#
# Unless required by applicable law or ag... |
#!/usr/bin/python
import shtest, sys, common
from common import *
from math import *
def ceil_test(p, types=[]):
if is_array(p):
result = [ceil(a) for a in p]
else:
result = [ceil(p)]
return shtest.make_test(result, [p], types)
def insert_into(test):
test.add_test(ceil_test((3.0, 3.1,... |
# -*- coding: utf-8 -*-
from django.contrib import admin
from django import forms
from django.utils.translation import ugettext_lazy as _
from .models import (Poll, Choice, PollPost, PollBox,
PollBoxPolls, PollConfig)
from opps.core.admin import PublishableAdmin
from redactor.widgets import Reda... |
##########################################################################
#
# Copyright 2010 Dr D Studios Pty Limited (ACN 127 184 954) (Dr. D Studios),
# its affiliates and/or its licensors.
#
# Copyright (c) 2010-2015, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary ... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
import mptt.fields
import gm2m.fields
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('con... |
#
# wc.py: public Python interface for wc components
#
# Subversion is a tool for revision control.
# See http://subversion.apache.org for more information.
#
######################################################################
# Licensed to the Apache Software Foundation (ASF) under one
# or more contr... |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding unique constraint on 'MailSubscription', fields ['address']
db.c... |
import logging
import ldap
from rest_framework import (
exceptions,
permissions,
viewsets,
)
from rest_framework.response import Response
from . import models
from .conf import settings
logger = logging.getLogger(__name__)
class TranslateViewSet(viewsets.ViewSet):
permission_classes = (
per... |
from __future__ import absolute_import, print_function, unicode_literals
from django.contrib.auth import authenticate, get_user, login, logout
from django.contrib.auth.models import AnonymousUser
from rest_framework import filters, permissions, status, viewsets
from rest_framework.exceptions import ValidationError
fro... |
import typing
from dataclasses import dataclass
from ..core.smtlib import issymbolic, BitVec
from ctypes import *
import wasm
import struct
from ..core.state import Concretize
# Do I like this? No. Is it necessary to get mypy to pass without destroying the WASM type system? Yes.
# Look how much cleaner the version bel... |
from datetime import timedelta
from django.contrib.sites.models import RequestSite
from django.contrib.sites.models import Site
from django.core.mail import EmailMultiAlternatives
from django.core.mail import send_mail
from django.core.urlresolvers import reverse
from django.db import models
from django.template.loade... |
"""Drag-and-drop support for Tkinter.
This is very preliminary. I currently only support dnd *within* one
application, between different windows (or within the same window).
I an trying to make this as generic as possible -- not dependent on
the use of a particular widget or icon type, etc. I also hope that
this wi... |
# Big Data Smart Socket
# Copyright (C) 2016 Clemson University
#
# 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.
#
# Th... |
import tweepy
import time
import os
import sys
import json
import argparse
from datetime import datetime
FOLLOWING_DIR = 'following'
USER_DIR = 'twitter-users'
MAX_FRIENDS = 200
FRIENDS_OF_FRIENDS_LIMIT = 200
# Create the directories we need
if not os.path.exists(FOLLOWING_DIR):
os.makedirs(FOLLOWING_DIR)
if not... |
"""Document Structure Parser.
This module contains a minimal document structure parser. It is meant as a
temporary default and will be replaced by more sophisticated parsers and these
parsers will act more like the other tarsqi components.
The main goal of the parser is to add docelement tags to the tag repository on... |
# -*- coding: utf-8 -*-
# Snow cover area assessment tool using Python
#
# Created: Fri Apr 25 2014
# Authors: Antara / Prasun (@pkg_sd)
#
# Published under GPLv3
from PySide import QtCore, QtGui
import gdal
import numpy
import pylab as plt
import glob
class Ui_Dialog(object):
folder = ''
files = []
... |
'''
"Base-level" objects which represent Pages and Elements.
None of these are intended to be instantiated directly.
'''
import logging
import time
from utils.exceptions import Timeout
# This variable is for the WebDriver object. It must be set before any Page
# Objects can be instantiated. It will effectively be... |
import numpy as np
from ase import Atoms
from ase.data import atomic_numbers
from ase.lattice.spacegroup import Spacegroup
from ase.cluster.base import ClusterBase
from ase.cluster.cluster import Cluster
class ClusterFactory(ClusterBase):
directions = [[1, 0, 0],
[0, 1, 0],
[0,... |
import random, string, sys
GROWTH_RATE = 2 # we only place repo's in locations that support at least GROWTH_RATE times the size of the repo
CHIP_RATE = 0.9 # if a repo has no locations that support GROWTH_RATE * repo.local_size, we chip off a bit off the desired size to see if we can find a repo anyway
MAX_SERVERS = 1... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from functools import wraps
import time
import json
import pickle
import sha
import os
import re
import urllib
import sys
import traceback
import collections
import ssl
import random
import string
from websocket import create_connection, WebSocketConne... |
import struct
_fmt_u64 = ">Q"
_fmt_u32 = ">L"
_magic_shift = 4
_flags_mask = 0x0F
_default_magic = 0xd8007ff
_min_packet_len = 20
_l_mask = 0x08
_r_mask = 0x04
_s_mask = 0x02
_x_mask = 0x01
_cat_pos = (4, 12)
_psn_pos = (12, 16)
_pse_pos = (16, 20)
_magic_pos = (0, 4)
_udp_header_len = 8
_pcf_type_plus_payload = 0xFF... |
#!/usr/bin/env python3
#coding=utf8
"""
die-rolling simulator
Roll a single n-sided die. Number of sides can be specified on the
command line; default is 6.
"""
import argparse
import atexit # omg i'm so lazy
import sys
try:
if sys.version_info.major == 2:
import Tkinter as tk
elif sys.version_info.... |
from django.db import models
from edc_base.model.models import BaseUuidModel
from edc_base.model.validators import (
date_not_before_study_start, date_not_future)
from .maternal_eligibility import MaternalEligibility
CONSENT_VERSION = (
('1', 'Consent version 1'),
('3', 'Consent version 3'))
class TdCo... |
from typing import Deque, Union, Optional, List
from hwt.code import Concat
from hwt.hdl.types.bitsVal import BitsVal
from hwt.hdl.types.struct import HStruct
from hwt.hdl.types.structValBase import StructValBase
from hwt.hdl.value import HValue
from hwt.synthesizer.rtlLevel.constants import NOT_SPECIFIED
from hwtLib.... |
from goopytrans import translate as gtranslate
from apyrtium import translate as atranslate
import nltk.data
from django.utils.safestring import SafeUnicode
from wt_languages.models import TARGET_LANGUAGE, SOURCE_LANGUAGE, BOTH
from wt_languages.models import LanguageCompetancy
from wt_articles.models import SourceAr... |
# -*- coding: utf-8 -*-
# Define here the models for your spider middleware
#
# See documentation in:
# http://doc.scrapy.org/en/latest/topics/spider-middleware.html
from scrapy import signals
class BorutoscrapperSpiderMiddleware(object):
# Not all methods need to be defined. If a method is not defined,
# s... |
from functools import partial
from io import BytesIO
from itertools import product
from logging import info
from subprocess import check_output, Popen, PIPE
from typing import Any, Iterable, Tuple
from argparse import Namespace
import pandas as pd
from joblib import Parallel, delayed
from numpy import int32
from nats... |
#!/usr/bin/python
import pylab
import matplotlib
matplotlib.rcParams['pdf.fonttype'] = 42
matplotlib.rcParams['ps.fonttype'] = 42
import numpy
import csv
import os
import sys
# TIMESTAMPS = ["2017-03-30T06:35:54.726002", "2017-03-30T09:45:20.551204"]
TIMESTAMPS = ["2017-04-02T03:35:32.431002"]
# TIMESTAMP_LABELS = {... |
# Generated by Django 1.10.7 on 2017-11-23 15:53
from django.db import migrations
def move_relaydomain_to_transport(apps, schema_editor):
"""Transform relaydomains to transports."""
RelayDomain = apps.get_model("relaydomains", "RelayDomain")
RecipientAccess = apps.get_model("relaydomains", "RecipientAcces... |
#!/usr/bin/env python
#
# Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... |
#MenuTitle: Compare Glyph Heights
# -*- coding: utf-8 -*-
from __future__ import division, print_function, unicode_literals
__doc__="""
Lists all glyphs that differ from the second font in height beyond a given threshold.
"""
import vanilla
class CompareGlyphHeightsOfFrontmostFonts( object ):
def __init__( self ):
... |
from time import sleep
from django.conf import settings
from django.utils import timezone
from github3 import GitHub, login
import requests
from base_handler import BaseHandler
from package.utils import uniquer
class GitHubHandler(BaseHandler):
title = "Github"
url_regex = '(http|https|git)://github.com/'
... |
#!/usr/bin/python
# (C)opyright L.P.Klyne 2013
sw_topleft = 13
sw_topright = 7
sw_bottomleft = 12
sw_bottomright = 11
led_topleft = 22
led_topright = 18
led_bottomleft = 15
led_bottomright = 16
import logging
import os
import os.path
import time
import subprocess
import RPi.GPIO as GPIO
_log = logging.getLogger()
log... |
# -*- coding: utf-8 -*-
'''
Much Movies HD XBMC Addon
Copyright (C) 2014 lambda
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
(... |
import os
from django import forms
from django.utils.safestring import mark_safe
from django.contrib.staticfiles.storage import staticfiles_storage
from django.template.loader import render_to_string
from django.conf import settings
import bleach
from django_pyscss import DjangoScssCompiler
PAGEDOWN_EDITOR_TEMPLATE... |
import pytest
from astropy import units as u
from astropy.tests.helper import assert_quantity_allclose
from poliastro.bodies import Body, Earth, Jupiter, Sun
def test_body_has_k_given_in_constructor():
k = 3.98e5 * u.km ** 3 / u.s ** 2
earth = Body(None, k, "")
assert earth.k == k
def test_body_from_pa... |
import tensorflow as tf
import numpy as np
xy = np.loadtxt('xor.txt', unpack=True)
x_data = xy[0:-1]
y_data = xy[1]
X = tf.placeholder(tf.float32)
Y = tf.placeholder(tf.float32)
W = tf.Variable(tf.random_uniform([1, len(x_data)], -1.0, 1.0))
# Our hypothesis
h = tf.matmul(W, X)
hypothesis = tf.div(1., 1.+tf.exp(-h)... |
# _*_ coding: utf-8 _*_
#!/usr/bin/env/python
def jewel(crown):
''' Novice decorator function '''
def necklace(*args, **kwargs):
print("necklace is always below the crown {}".format(jewel.__name__))
return crown(*args, **kwargs)
return necklace
def funcLog(crowns):
''' Real wo... |
from time import sleep
import GSQuery
# Let's pick a server. We'll use TeamRectifier as they're usually populated.
gs = GSQuery.GSServer('31.186.250.42')
# Let's get the basic server details with the GameSpy query protocol.
# The query methods return dictionary types, so we can store them for later use
# in... |
from __future__ import absolute_import
from __future__ import print_function
import os.path
import argparse
import ConfigParser as configparser
import collections
import __builtin__
import six
from . import reporters
from .. import defs
#==============================================================================... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.