src stringlengths 721 1.04M |
|---|
from django.conf.urls import url, patterns
from django.views.decorators.cache import cache_page
from .views import (
ContactView,
ContactDetailView,
CountyView,
CountyDetailView,
CountySlimDetailView,
ConstituencyView,
ConstituencyDetailView,
ConstituencySlimDetailView,
WardView,
... |
# Software License Agreement (BSD License)
#
# Copyright (c) 2009, Willow Garage, Inc.
# 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... |
# -*- coding: utf-8 -*-
# Description: generate audio clips for lines, words, and syllables
import argparse
import json
import os
from pprint import pprint
import re
import subprocess
import sys
# input
parser = argparse.ArgumentParser()
parser.add_argument('-in', dest="INPUT_FILE", default="still_i_rise.wav", help=... |
# -*- coding: utf-8 -*-
# Code for Life
#
# Copyright (C) 2016, Ocado Innovation Limited
#
# 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 version 3 of the
# License, or (at your o... |
#!/usr/bin/env python
import logging
import os
import shutil
import subprocess
import sys
import tempfile
import warnings
import django
from django import contrib
from django.utils._os import upath
from django.utils import six
CONTRIB_MODULE_PATH = 'django.contrib'
TEST_TEMPLATE_DIR = 'templates'
DJANGO_RUNTESTS_DI... |
import tensorflow as tf
import numpy as np
import time
from ISNNTF_DS import ConvolutionalLayer
from ISNNTF_DS import FullyConnectedLayer
from ISNNTF_DS import ISTFNN
from TFRConverter import VOC_TFRecords
def leaky_relu(x):
return tf.nn.leaky_relu(x, alpha=0.1)
def YOLO_layers(mbs):
keep_prob = tf.placehol... |
import sys
import random
import math
import copy
def writegraph(graph, filename):
f = open(filename, 'w')
for row in graph:
f.write(" ".join(map(str, row)))
f.write("\n")
def readfile(filename):
f = open(filename, 'r')
s = f.readlines()
info = map(int,s[0].split(' ')[1:])
graph = []
graph2 = []... |
# -*- coding: utf-8 -*-
def sim_normal(nums, mean = 600, sd = 30):
import numpy as np
import numpy.random as nr
for n in nums:
dist = nr.normal(loc = mean, scale = sd, size = n)
titl = 'Normal distribution with ' + str(n) + ' values'
print('Summary for ' + str(n) + ' samples')
... |
"""
Django settings for btcimg project.
Generated by 'django-admin startproject' using Django 1.8.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build paths i... |
#!/usr/bin/env python
# Copyright 2021 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.
# This is generated, do not edit. Update BuildConfigGenerator.groovy and
# 3ppFetch.template instead.
from __future__ import print_fun... |
#!/usr/bin/env python
"""
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");... |
# coding=utf-8
import datetime
import os
from django.conf import settings
from django.core import mail
from django.core.urlresolvers import reverse
from django.http import HttpRequest
from django.test import TestCase, RequestFactory
from django.test.utils import override_settings
from lxml.html import fromstring
from... |
#
# 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 n... |
# openstack_dashboard.local.dashboards.project_nci.instances.workflows.create_instance
#
# Copyright (c) 2015, NCI, Australian National University.
# 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 ... |
from django.shortcuts import render
from django.views.generic import TemplateView
from django.views.generic.edit import CreateView, UpdateView, DeleteView
from story.models import Story, Timeline
from gallery.models import Gallery
from party.models import PartyMember
from information.models import InformationDetail
fr... |
'''
nltk.download(['wordnet', 'stopwords', 'punkt']) if not already downloaded.
Should add to wordnet if you want more words to compare as reference to.
'''
from nltk import word_tokenize, pos_tag
from nltk.corpus import wordnet as wn
from nltk.corpus import stopwords
from fuzzywuzzy import fuzz, process
stop_words = s... |
import os
from pathlib import Path
from shiftmedia import utils, exceptions as x
from shiftmedia.paths import PathBuilder
from shiftmedia.resizer import Resizer
class Storage:
def __init__(self, backend, secret_key, local_temp):
"""
Init
:param backend:, shiftmedia.backend.Backend instance... |
<<<<<<< HEAD
<<<<<<< HEAD
"""Fixer for 'raise E, V, T'
raise -> raise
raise E -> raise E
raise E, V -> raise E(V)
raise E, V, T -> raise E(V).with_traceback(T)
raise E, None, T -> raise E.with_traceback(T)
raise (((E, E'), E''), E'''), V -> raise E(V)
raise "foo", V, T -> warns about st... |
# Generated by Django 2.0.2 on 2018-03-28 15:49
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('accession', '0006_action_name'),
]
operations = [
migrations.Cr... |
import inspect
import random
import re
import unittest
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
from . import import_submodule
class PygameTestLoader(unittest.TestLoader):
def __init__(self, randomize_tests=False, include_incomplete=False,
exclude=('... |
# -*- coding: utf-8 -*-
"""
***************************************************************************
SilentProgress.py
---------------------
Date : April 2013
Copyright : (C) 2013 by Victor Olaya
Email : volayaf at gmail dot com
*************************... |
#!/usr/bin/python
import sys,os,glob,urlparse,urllib,subprocess
def setcwd():
realpath = os.path.realpath(sys.argv[0])
dname = os.path.dirname(realpath)
os.chdir(dname)
# sets working directory based on path to index.py
setcwd()
# loads local python modules, relative to index.py
sys.path.append(os.path.... |
#!/usr/bin/env python2
# Copyright (c) 2015 The Bitcoin Core developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
from test_framework.mininode import *
from test_framework.test_framework import BitcoinTestFramework
fro... |
# -*- coding: utf-8 -*-
import time
from module.plugins.internal.misc import json
from module.plugins.internal.MultiAccount import MultiAccount
class MyfastfileCom(MultiAccount):
__name__ = "MyfastfileCom"
__type__ = "account"
__version__ = "0.10"
__status__ = "testing"
__config__ = [("mh_mode"... |
# -*- coding: utf-8 -*-
u"""
Copyright 2013-2014 Olivier Cortès <oc@1flow.io>.
This file is part of the 1flow project.
1flow is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of
the License... |
import contextlib
import io
import os
import pathlib
import time
import struct
import zipencrypt as zipfile
import unittest
from tempfile import TemporaryFile
from random import randint, random, getrandbits
from test.support import (TESTFN, findfile, unlink, rmtree, temp_dir, temp_cwd,
requ... |
""" This function provides functions to make various astronomical plots. """
import os
import io
import astropy
import datetime
import matplotlib
# matplotlib.use('Agg') # to stop server crashing without backend
import numpy as np
import astroplan
from astroplan.plots import plot_finder_image
import astropy.units as un... |
import numpy as np
import tensorflow as tf
from gym import utils
from gym.envs.mujoco import mujoco_env
class HalfCheetahEnv(mujoco_env.MujocoEnv, utils.EzPickle):
def __init__(self):
mujoco_env.MujocoEnv.__init__(self, 'half_cheetah.xml', 1)
utils.EzPickle.__init__(self)
def step(self, action... |
from cffi import FFI
import os, sys
ffi = FFI()
ffi.cdef('''
// zsock.h
typedef struct _zsock_t zsock_t;
// zmsg.h
typedef struct _zmsg_t zmsg_t;
int zmsg_addstr (zmsg_t* self, const char* string);
char* zmsg_popstr (zmsg_t* self);
// zyre.h
typedef struct _zyre_t zyre_t;
zyre_t* zyre_new (const char *name);
... |
#!/usr/bin/env python3
#
# Copyright (c) 2004-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same direct... |
"""Games, or Adversarial Search (Chapter 5)"""
from collections import namedtuple
import random
from utils import argmax
from canvas import Canvas
infinity = float('inf')
GameState = namedtuple('GameState', 'to_move, utility, board, moves')
# _________________________________________________________________________... |
# -*- coding: utf-8 -*-
"""
Copyright [2009-2019] EMBL-European Bioinformatics Institute
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
import time
import unittest
import ddt
from pageobject.account.Page_Account import Page_Account
from selenium import webdriver
from pageobject.Page_Login import Page_Login
from pageobject.account.Page_Account_HZ_ADD import Page_Account_HZ_ADD
from utils.config import Config
from utils.log1 import Log
imp... |
# -*- coding: utf-8 -*-
import math
try:
import unittest2 as unittest
except:
import unittest
from bssrdf_estimate.tools import Vector3D
class Vector3DTest(unittest.TestCase):
def test_instance(self):
v = Vector3D()
self.assertEqual(v.x, 0.0)
self.assertEqual(v.y, 0.0)
se... |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
import re
... |
#!/usr/bin/env python
# Sample script that collects tweets matching a string.
#
# This file is part of the Tweeples collection of scripts.
#
# Tweeples is free software: you can redistribute it and/or modify it
# under the terms of the BSD license. For the full terms of the license
# see the file `COPYING' in this dir... |
import pyBigWig
import tempfile
import os
import sys
import hashlib
import numpy as np
class TestRemote():
fname = "http://raw.githubusercontent.com/dpryan79/pyBigWig/master/pyBigWigTest/test.bw"
def doOpen(self):
bw = pyBigWig.open(self.fname)
assert(bw is not None)
return bw
def... |
###
# Copyright 2008-2011 Diamond Light Source Ltd.
# This file is part of Diffcalc.
#
# Diffcalc 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 late... |
# -*- coding: utf-8 -*-
from json import load
try:
from urllib.request import urlretrieve
except Exception as excp:
exit("Couldn't import the standard library. Are you running Python 3?")
API_URL = "https://api.linode.com/api/?api_key={0}&resultFormat=JSON"
API_BASE ="https://api.linode.com/?api_key={key}&ap... |
import itertools
import re
from typing import Any, Iterable, List, Match, Optional
METACATS = ['Cardset', 'Collection', 'Deck Building', 'Duel Scene', 'Leagues', 'Play Lobby', 'Trade']
CATEGORIES = ['Advantageous', 'Disadvantageous', 'Game Breaking', 'Avoidable Game Breaking', 'Graphical', 'Non-Functional ability']
BA... |
"""Joint variant calling with multiple samples: aka squaring off, or backfilling.
Handles the N+1 problem of variant calling by combining and recalling samples
previously calling individually (or in smaller batches). Recalls at all positions found
variable in any of the input samples within each batch. Takes a general... |
from genshi.builder import tag
from trac.core import Component, implements
from trac.ticket.api import ITicketActionController, TicketSystem
from trac.perm import IPermissionRequestor
revision = "$Rev: 6326 $"
url = "$URL: https://svn.edgewall.org/repos/trac/tags/trac-0.12.2/sample-plugins/workflow/StatusFixer.py $"
... |
import numpy as np
from numpy.testing import run_module_suite, assert_raises, assert_equal
from skimage import restoration, data, color, img_as_float
np.random.seed(1234)
lena = img_as_float(data.lena()[:128, :128])
lena_gray = color.rgb2gray(lena)
checkerboard_gray = img_as_float(data.checkerboard())
checkerboard... |
"""
Django settings for DjFacilito project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)... |
#
# 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... |
# -*- coding: utf-8 -*-
# ---------------------------------------------------------------------------
# Name: test_finance
# Purpose: Test driver for module finance
#
# Author: Michael Amrhein (mamrhein@users.sourceforge.net)
#
# Copyright: (c) 2017 Michael Amrhein
# License: This program is part ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# This file is part of fgpoliciestocsv.
#
# Copyright (C) 2014, 2020, Thomas Debize <tdebize at mail.com>
# All rights reserved.
#
# fgpoliciestocsv is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as pu... |
# Copyright 2013 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file acc... |
import pickle
from pymongo import MongoClient
import sentiment
from sentiment.predict import SentimentPredictor
import numpy as np
from nltk import Tree
from nltk.stem import SnowballStemmer
from bson.objectid import ObjectId
# db
client = MongoClient()
db = client.confessions
class Classifier:
def __init__(self)... |
# -*- coding: utf-8 -*-
"""
DARIAH Contribute - DARIAH-EU Contribute: edit your DARIAH contributions.
Copyright 2014 Data Archiving and Networked Services
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... |
# Copyright 2019 The Dreamer 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 applicabl... |
#
# Copyright (C) 2009-2016 Nexedi SA
#
# 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... |
import asyncio
import inspect
import warnings
from asgiref.sync import sync_to_async
class RemovedInDjango40Warning(DeprecationWarning):
pass
class RemovedInDjango41Warning(PendingDeprecationWarning):
pass
RemovedInNextVersionWarning = RemovedInDjango40Warning
class warn_about_renamed_method:
def _... |
import unittest
import numpy as np
from repstruct.features.descriptor import normalize_by_division, classify_euclidean, normalize, classify_cosine
class TestDescriptor(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def testNormalize(self):
v = [1, 1]
... |
# -*- coding: utf-8 -*-
from mock import Mock
from django.utils import unittest
from django.conf import settings
from transifex.resources.formats.registry import registry, _FormatsRegistry
from transifex.resources.formats.pofile import POHandler, POTHandler
from transifex.txcommon.tests.base import BaseTestCase
clas... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import fileinput
import re
import subprocess
import os
import sys
import shutil
from pprint import pprint
import datetime
print ("Welcome to preapre ppa package...")
dists = []
# https://wiki.ubuntu.com/Releases
dists.append({
"name": "Ubuntu 16.04.7 LTS (xenial)"... |
#!/usr/bin/env python
#
# Copyright (C) 2009-2010:
# Gabes Jean, naparuba@gmail.com
# Gerhard Lausser, Gerhard.Lausser@consol.de
#
# This file is part of Shinken.
#
# Shinken 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... |
"""
"""
# Prevent Python2 from getting confused about 'bson' and 'pymarshal.bson'
from __future__ import absolute_import
import datetime
import time
# Will raise an import error if the user hasn't installed 'bson'
import bson
from .json import JSON_TYPES
from .util.marshal import *
from .util.pm_assert import pm_ass... |
# -*- coding: utf-8 -*-
# Copyright (C) 2013- Yan Shoshitaishvili aka. zardus
# Ruoyu Wang aka. fish
# Audrey Dutcher aka. rhelmot
# Kevin Borgolte aka. cao
from __future__ import print_function
# idc is just within IDA, so make pylint stop complaining
impo... |
"""Spectral Embedding"""
# Author: Gael Varoquaux <gael.varoquaux@normalesup.org>
# Wei LI <kuantkid@gmail.com>
# License: BSD 3 clause
import warnings
import numpy as np
from scipy import sparse
from scipy.linalg import eigh
from scipy.sparse.linalg import lobpcg
from ..base import BaseEstimator
from ..ext... |
# Django settings for HomeControlWeb project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'home_control.db',
# The following settings are not used with sqlite3:
'USER': '',
'PASSWORD': '',
'HOST': ''... |
##############################################################################
#
# Copyright (C) Johannes Loehnert, 2013-2015
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Fou... |
class FieldUtils(object):
""" A utility class, which provides helper functions for managing fields of BaseModels. """
@staticmethod
def get_field_description(model_object, field_name):
result = model_object.fields_get([field_name])
field_description = result.get(field_name)
return f... |
#!/usr/bin/python3
#
# Command-line app to write data for MPK mapper app
# Note that we want Python 3, not 2!
# robcranfill@gmail.com
import sys
SR18voiceNames_ = [
"kick",
"snare_1",
"snare_2",
"highhat_1",
"highhat_2",
"highhat_3",
"tom_1",
"tom_2",
... |
#!/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 researchsubject
from .fhirdate import FHIRDate
class ResearchSubjectTests(unittest.TestCase):
def instantiate_from(self, ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.db import models
from django.utils.translation import ugettext_lazy as _
class Country(models.Model):
"""
International Organization for Standardization (ISO) 3166-1 Country list
* ``iso`` = ISO 3166-1 alpha-2
* ``name`` = Official country names used by... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2015 clowwindy
#
# 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 b... |
""".. Ignore pydocstyle D400.
=======================
Elastic Signal Handlers
=======================
"""
from django.db.models.signals import post_delete, post_save
from django.dispatch import receiver
from guardian.models import GroupObjectPermission, UserObjectPermission
from .builder import index_builder
def ... |
# Copyright 2018 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 writin... |
#!/usr/bin/env python
from snmp_helper import snmp_get_oid_v3,snmp_extract
from time import localtime, asctime
COMMUNITY_STRING = 'galileo'
SNMP_PORT = 161
SYS_NAME = '1.3.6.1.2.1.1.5.0'
SYS_UPTIME = '1.3.6.1.2.1.1.3.0'
RUN_LAST_CHANGED = '1.3.6.1.4.1.9.9.43.1.1.1.0'
SYS_TIME_SEC = 100
DEBUG = True
class NetworkDevi... |
"""
SALTS XBMC Addon
Copyright (C) 2014 tknorris
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 version.
T... |
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser Public License as published by
#... |
import Gears as gears
from .. import *
from .Base import *
class Clamp(Base) :
def applyWithArgs(
self,
spass,
functionName,
*,
minima : 'Horizontal and vertical minima [(um,um)].'
= ('field', 'field'),
maxima : 'Horiz... |
# -*- coding: utf-8 -*-
import re
class Renderer(object):
'''
the default renderer for parser
'''
_escape_pattern = re.compile(r'&(?!#?\w+;)')
_not_allowed_schemes = ['javascript:', 'vbscript:']
# HTML tags
_p = 'p'
_tr = 'tr'
def __init__(self, **kwargs):
self._escape = ... |
#!/usr/bin/env python
#-*- coding: utf-8 -*-
__author__ = 'mah'
__email__ = 'andrew.makhotin@gmail.com'
import os
import logging.handlers
import re
log = logging.getLogger('Logging for check_sound')
log.setLevel(logging.DEBUG)
formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(message)s')
handler = loggin... |
# -*- coding:utf-8 -*-
import socket
import struct
import pcap
import traceback
from aytool.common.print_table import PrettyTable
"""
┌──────────────────────────────────┬──────────────────────────────────┬──────────┐
│ Destination Mac │ Source Mac │Ether ... |
"""
File: vlq.py
Author: Stephen J. Zabel
Email: sjzabel@gmail.com
Github: https://github.com/sjzabel
Description: Utilities to handle Variable Length Quantity midi data
Heavily borrowed from python-midi's midi.util class and tested for
python >= 3.4
http://en.wikipedia.org/wiki/Variable-length_quantity
"""
def re... |
def obtem_valor_bd(valor):
if valor == None:
return 'null'
elif isinstance(valor, bool):
return 1 if valor else 0
elif isinstance(valor, int):
return valor
else:
return "'" + valor.replace("'", "''") + "'"
class ConfNavegacaoInserts:
def __init__(self, configuracoes... |
# -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2019 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <https://weblate.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, eith... |
"""Client class for connecting to the Logitech Harmony."""
from __future__ import print_function
import json
import logging
import time
import sleekxmpp
from sleekxmpp.xmlstream import ET
LOGGER = logging.getLogger(__name__)
class HarmonyClient(sleekxmpp.ClientXMPP):
"""An XMPP client for connecting to the Log... |
#!/home/dante/Projects/free-art/venv/bin/python3
#
# The Python Imaging Library
# $Id$
#
# this demo script creates four windows containing an image and a slider.
# drag the slider to modify the image.
#
try:
from tkinter import Tk, Toplevel, Frame, Label, Scale, HORIZONTAL
except ImportError:
from Tkinter imp... |
#!/usr/bin/env python
import datetime
import logging
import os
import re
from urllib.parse import urljoin, unquote
from utils import utils, inspector, admin
# https://www.treasury.gov/about/organizational-structure/ig/Pages/audit_reports_index.aspx
archive = 2005
# options:
# standard since/year options for a yea... |
import urllib
import urllib2
import httplib
import time
from forum.authentication.base import AuthenticationConsumer, InvalidAuthentication
from django.utils.translation import ugettext as _
from lib import oauth
class OAuthAbstractAuthConsumer(AuthenticationConsumer):
def __init__(self, consumer_key, consumer_... |
#!/usr/bin/python
#
# Copyright 2018-2021 Polyaxon, 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 ... |
"""
Module to handle 'source' related actions.
It contains functions to run maven clean and compile,
scan a whole tree for files and find '.pan' files and perl
files, where when there is a duplicate between '.pod' and
'.pl', the pod file has the preference.
"""
import os
from vsc.utils import fancylogger
from vsc.ut... |
# 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 required by applicable law or ag... |
# encoding: utf-8
#
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http:# mozilla.org/MPL/2.0/.
#
# Author: Kyle Lahnakoski (kyle@lahnakoski.com)
#
from __future__ import absolute_import
from _... |
import ibis
from ibis.expr import datatypes as dt
def test_whole_schema():
customers = ibis.table(
[
('cid', 'int64'),
('mktsegment', 'string'),
(
'address',
(
'struct<city: string, street: string, '
... |
#!/usr/bin/env python
# Copyright (c) 2010 SubDownloader Developers - See COPYING - GPLv3
from PyQt4 import QtCore, QtGui
from PyQt4.QtCore import Qt, SIGNAL, QObject, QCoreApplication, \
QSettings, QVariant, QSize, QEventLoop, QString, \
QBuffer, QIODevice, QModelInde... |
if __name__ == '__main__':
import sys
import os
pkg_dir = os.path.split(os.path.abspath(__file__))[0]
parent_dir, pkg_name = os.path.split(pkg_dir)
is_pygame_pkg = (pkg_name == 'tests' and
os.path.split(parent_dir)[1] == 'pygame')
if not is_pygame_pkg:
sys.path.inser... |
from theano.tensor.shared_randomstreams import RandomStreams
from theano import tensor as TT
import theano
import numpy
import neuron
import origin
def make_encoders(neurons, dimensions, srng, encoders=None):
"""Generates a set of encoders
:param int neurons: number of neurons
:param int dimensions: num... |
#!/usr/bin/env python
#
# 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 requir... |
# Python imports
import requests
# Local imports
import exceptions
from timeline import Timeline
from contacts import Contacts
class User(object):
"""
Represent an user for an application
Access Google Glass timeline using : user.timeline
Each user is defined by unique token : user.token
"""
... |
# -*- coding: utf-8 -*-
""" GAN Example
Use a generative adversarial network (GAN) to generate digit images from a
noise distribution.
References:
- Generative adversarial nets. I Goodfellow, J Pouget-Abadie, M Mirza,
B Xu, D Warde-Farley, S Ozair, Y. Bengio. Advances in neural information
processing system... |
"""
Test for raisin.recipe.transformation
"""
import os
import unittest
from pkg_resources import get_provider
from raisin.recipe.transformation import accessions
from raisin.recipe.transformation import annotations
from raisin.recipe.transformation import experiments
from raisin.recipe.transformation import files
fr... |
"""
The :mod:`dataset <surprise.dataset>` module defines the :class:`Dataset` class
and other subclasses which are used for managing datasets.
Users may use both *built-in* and user-defined datasets (see the
:ref:`getting_started` page for examples). Right now, three built-in datasets
are available:
* The `movielens-... |
"""
View for Courseware Index
"""
# pylint: disable=attribute-defined-outside-init
import logging
import urllib
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.auth.views import redirect_to_login
from django.urls import reverse
from django.http import Http404
from dja... |
#!/usr/bin/env python2.5
# Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Refactoring framework.
Used as a main program, this can refactor any number of files and/or
recursively descend down directories. Imported as a module, this
provides infrastructure to write... |
import webapp2
import webtest
import unittest2
import copy
import urllib
import logging
from google.appengine.ext import testbed
from google.appengine.ext import db
from webapp2_extras import json
from webapp2_extras.appengine.auth import models as users
import app
import settings
import handlers
import re
from core ... |
# ----------------------------------------------------------------------------
# Copyright (c) 2016-2018, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.