text stringlengths 12 6.59M |
|---|
from rest_framework.response import Response
from rest_framework.views import APIView
from rest_framework.permissions import IsAdminUser
from rest_framework.exceptions import APIException
from wristband.common.viewsets import ReadOnlyViewSet
from wristband.providers.exceptions import DeployException
from wristband.pro... |
# This file is part of LiSE, a framework for life simulation games.
# Copyright (c) 2013-2014 Zachary Spector, zacharyspector@gmail.com
"""Object relational mapper that serves Characters."""
from random import Random
from types import FunctionType
from collections import MutableMapping, Callable
from sqlite3 import co... |
import os
import stat
import logging
import argparse
from contextlib import closing
PERMISSIONS_MSG = '''
Your token file {token_file} is not properly secured. Please secure your
token file by ensuring that it is not readable or writeable by anyone
other than the owner of the file.
On OS X: <os_x_instructions>
On L... |
from flask import Flask, send_file
import os
app = Flask(__name__)
app.config['SEND_FILE_MAX_AGE_DEFAULT'] = 1
@app.route("/<int:osuid>")
def serveAvatar(osuid):
# Check if avatar exists
if os.path.isfile("avatars/%d.png" % osuid):
avatarid = osuid
else:
avatarid = 0
# Serve actual avatar or default one
retu... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
Tests for the Pyzotero module
Copyright Stephan Hügel, 2011
This file is part of Pyzotero.
Pyzotero 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 vers... |
#!/usr/bin/env python
# encode_spp 0.0.1
# Generated by dx-app-wizard.
#
# Basic execution pattern: Your app will run on a single machine from
# beginning to end.
#
# See https://wiki.dnanexus.com/Developer-Portal for documentation and
# tutorials on how to modify this file.
#
# DNAnexus Python Bindings (dxpy) document... |
import urlparse
import urllib
def encodeURL(url):
# if not '://' in url:
# url = 'http://' + url
parsed = urlparse.urlparse(url)
scheme = parsed.scheme
netloc = parsed.netloc.encode('idna')
path = urllib.quote_plus(parsed.path.encode('utf-8'), '%/')
params = parsed.params #urllib.qu... |
from oled.device import ssd1306
from oled.render import canvas
from PIL import Image, ImageFont, ImageDraw, ImageOps
import time
import datetime
import subprocess
import json
import os
device = ssd1306(port=1, address=0x3c)
ttf = '/usr/share/fonts/truetype/freefont/FreeSerifBold.ttf'
bigFont = ImageFont.truetype(ttf... |
# This file is part of LiSE, a framework for life simulation games.
# Copyright (c) 2013 Zachary Spector, zacharyspector@gmail.com
from array import array
import struct
from collections import (
MutableMapping,
OrderedDict)
from math import sqrt, hypot, atan, pi, sin, cos
from operator import itemgetter
from r... |
import threading
import os
import socket
import cPickle as pickle
import time
import atexit
import Queue as queue
from concurrent.futures import _base
import qb
from . import utils
# Test for maya.
try:
from maya import cmds as maya_cmds, mel as maya_mel
IN_MAYA = True
except ImportError:
IN_MAYA = Fal... |
#!/usr/bin/env python
import sqlite3
import os
import sys
import numpy as np
from collections import defaultdict
from gemini_constants import *
import GeminiQuery
class Subject(object):
"""
Describe a single subject in the the samples table.
"""
def __init__(self, row):
self._set_fields_fro... |
from __future__ import print_function
import json, re, os
class fmt:
"""
Formating strings
"""
PURPLE = '\033[95m'
CYAN = '\033[96m'
DARKCYAN = '\033[36m'
BLUE = '\033[94m'
GREEN = '\033[92m'
YELLOW = '\033[93m'
RED = '\033[91m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
... |
import os
import sys
import dj_database_url
from django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS
DEBUG = bool(os.environ.get('DJANGO_DEBUG', ''))
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': dj_database_url.config(de... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os.path
import numpy as np
from numpy.testing import assert_allclose, assert_equal
from abel.tools.vmi import angular_integration
from abel.tools.center import center_image
from abel.benchmark import ... |
"""Simple class to read IFF chunks.
An IFF chunk (used in formats such as AIFF, TIFF, RMFF (RealMedia File
Format)) has the following structure:
+----------------+
| ID (4 bytes) |
+----------------+
| size (4 bytes) |
+----------------+
| data |
| ... |
+----------------+
The ID is a 4-byte s... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright (c) 2010 Citrix Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you m... |
#coding=utf-8
import jinja2
import json
from time import time
from flask import request,jsonify,render_template,make_response,session,url_for
from app import app
from utils import radius_challenge
from utils import create_validate_code
@app.route('/api/v1/<string:ssid>', methods=['POST'])
def radius1x_api(ssid):
ssi... |
from .update_repo import update_repo
from .sync_to_s3 import sync_to_s3
__all__ = [
update_repo.__name__,
sync_to_s3.__name__,
]
|
# -*- coding: utf-8 -*-
from __future__ import division
from __future__ import absolute_import
import numpy as np
import abel
import scipy.constants as const
import scipy.interpolate
# This file includes functions that have a known analytical Abel transform.
# They are used in unit testing and for comparing different ... |
# -*- coding: Latin-1 -*-
"""Heap queue algorithm (a.k.a. priority queue).
Heaps are arrays for which a[k] <= a[2*k+1] and a[k] <= a[2*k+2] for
all k, counting elements from 0. For the sake of comparison,
non-existing elements are considered to be infinite. The interesting
property of a heap is that a[0] is always ... |
# -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2018.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any... |
from django.shortcuts import render, redirect
from django.http import HttpResponseRedirect
from django.contrib import messages
import hashlib
from app.models import *
from app.forms import SignupForm
from app.forms import AuthForm
from app.forms import PictureUploadForm
from app.forms import PostForm
# Rest Framewor... |
# special module for Q-networks, Q(s, a) -> q
from slm_lab.agent.net.base import Net
from slm_lab.agent.net.conv import ConvNet
from slm_lab.agent.net.mlp import MLPNet
from slm_lab.agent.net import net_util
from slm_lab.lib import util
import pydash as ps
import torch
import torch.nn as nn
class QMLPNet(MLPNet):
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Radim Rehurek <me@radimrehurek.com>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Deep learning via word2vec's "skip-gram and CBOW models", using either
hierarchical softmax or negative sampling [1]_ [2]_.
The train... |
# coding: utf-8
# maposmatic, the web front-end of the MapOSMatic city map generation system
# Copyright (C) 2010 David Decotigny
# Copyright (C) 2010 Frédéric Lehobey
# Copyright (C) 2010 Pierre Mauduit
# Copyright (C) 2010 David Mentré
# Copyright (C) 2010 Maxime Petazzoni
# Copyright (C) 2010 Thomas Petazzoni... |
# -*- coding: utf-8 -*-
"""
Created on Tue Nov 03 09:46:30 2015
LineGroup at its core is simply a list of lines and the operations we can perform
on them. It keeps track of various characteristics of the lines as they are entered
so they do not need to be calculated when called.
@author: lvanhulle
"""
import Point as... |
# -*- coding: utf-8 -*-
from flask import render_template, flash, redirect, url_for, g, request, session
from flask.ext.login import login_user, logout_user, current_user, login_required
from app import app, db, lm
from .forms import LoginForm, AddUserForm, AddMovieForm, MarkMovieForm, SearchMovieForm, SelectMovieForm... |
#!/usr/bin/env python
#
# The MIT License (MIT)
#
# Copyright (c) 2014 Thibault Deutsch <thibault.deutsch@gmail.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 without restriction, inc... |
"""Qopen: Seperation of intrinsic and scattering Q by envelope inversion"""
from qopen.core import run
__version__ = '2.1'
|
from geopy.compat import urlencode, quote
from geopy.geocoders.base import DEFAULT_SENTINEL, Geocoder
from geopy.location import Location
from geopy.util import logger
__all__ = ("TomTom", )
class TomTom(Geocoder):
"""TomTom geocoder.
Documentation at:
https://developer.tomtom.com/online-search/onli... |
"""
Django settings for cosmopolitan project.
Generated by 'django-admin startproject' using Django 1.8.5.
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... |
from django.shortcuts import render
from django.http import HttpResponse
from django.template import RequestContext, loader
from sqlalchemy import create_engine, insert
from sqlalchemy.orm import relationship, sessionmaker, backref
from app.database import database
import json
# Create your views here.
def index(r... |
from app import app
from flask import render_template, jsonify, request, redirect, url_for
from mpd import MPDClient
from lib import Song, Database
import random
from urllib.parse import quote, unquote
music_root = '/home/alec/Music/'
def echo_tags(c,uri):
songs = ''
for ff in c.lsinfo(uri):
try:
songs += '<tr... |
# -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
import flask... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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/... |
from flask import Flask, render_template, session, redirect, url_for, flash
from app import app, forms, models
@app.route('/', methods=['GET', 'POST'])
def index():
login_form = forms.LoginForm()
if login_form.validate_on_submit():
user = models.User.query.filter_by(username = login_form.username.data)... |
# SPDX-FileCopyrightText: 2017 Dan Halbert for Adafruit Industries
#
# SPDX-License-Identifier: MIT
"""
`adafruit_hid.keyboard.Keyboard`
====================================================
* Author(s): Scott Shawcroft, Dan Halbert
"""
import time
from micropython import const
from .keycode import Keycode
from . i... |
import os
import pathlib
import warnings
from distutils.version import LooseVersion
import numpy as np
from .. import coding, conventions
from ..core import indexing
from ..core.pycompat import integer_types
from ..core.utils import FrozenDict, HiddenKeyDict, close_on_error
from ..core.variable import Variable
from .... |
#__BEGIN_LICENSE__
# Copyright (c) 2015, United States Government, as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All rights reserved.
#
# The xGDS platform is licensed under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance ... |
from operator import itemgetter
from flask import (
render_template,
request,
redirect,
jsonify,
url_for,
session,
g
)
from flask_oauthlib.client import OAuthException
from flask.ext.login import (
login_user,
logout_user,
login_required,
current_user,
)
from sqlalchemy import desc
from app i... |
import os
import pynag.Utils
from pynag.Utils import PynagError
from adagios import settings
import subprocess
def run_pnp(pnp_command, **kwargs):
""" Run a specific pnp command
Arguments:
pnp_command -- examples: image graph json xml export
host -- filter results for a specific host
... |
''' pydevd - a debugging daemon
This is the daemon you launch for python remote debugging.
Protocol:
each command has a format:
id\tsequence-num\ttext
id: protocol command number
sequence-num: each request has a sequence number. Sequence numbers
originating at the debugger are odd, sequence numbers ori... |
import copy
import itertools
import numbers
import warnings
from collections import defaultdict
from datetime import timedelta
from typing import (
Any,
Dict,
Hashable,
List,
Mapping,
Optional,
Sequence,
Tuple,
TypeVar,
Union,
)
import numpy as np
import pandas as pd
import xar... |
from django.db import models
from django.conf import settings
from django.contrib.auth.models import User
from django.db.models.signals import post_save
if "notification" in settings.INSTALLED_APPS:
from notification import models as notification
else:
notification = None
class Occupation(models.Model):
na... |
# The MIT License (MIT)
#
# Copyright (c) 2013 CFEngine AS
#
# 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, including without limitation the rights
# to use, copy, modif... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
#!/usr/bin/env python
# encoding: utf-8
"""
这个文件中记录了所有的全局静态配置变量。现在只有named.conf所属路径和nameddb目录存储路径。
可以使用环境变量来设置配置,环境变量定义如下:
bind启动时的chroot目录,如果没有使用chroot设置为/
XBAYDNS_CHROOT_PATH
bind的配置文件路径
XBAYDNS_BIND_CONF
bind的启动脚本
XBAYDNS_BIND_START
bind的停止脚本
XBAYDNS_BIND_STOP
bind的重启脚本
XBAYDNS_BIND_RESTART
运行bind的用户
XBAYDNS_BIND_USE... |
# -*- coding: utf-8 -*-
from openerp import api, models
class Partner(models.Model):
_name = "res.partner"
_inherit = ['res.partner']
@api.model
def get_static_mention_suggestions(self):
""" Extend the mail's static mention suggestions by adding the employees. """
suggestions = super(... |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
#
# author: David Medina
from .base import Handler
import github3.models as models
from github3.converters import Rawlizer
from github3.exceptions import UserIsAnonymous
class User(Handler):
""" User handler with public access """
prefix = 'users'
def __r... |
"""
Versioning for the application, especially for the UI.
"""
import re
svn_revision = "$Revision: 534 $"
svn_rev_re = re.compile("\$Revision: (\d*) \$")
rev_num = int(svn_rev_re.match(svn_revision).group(1))
REV_TEMPLATE = "2010.1 (r%s)"
# Modify this:
# foo schnasel // version bumping
def get_version():
"... |
import tensorflow.python.platform
import tensorflow as tf
from PIL import Image
import numpy as np
from os.path import join
import csv
KNOWN_HEIGHT = 812
KNOWN_WIDTH = 812
class DataInput():
def __init__(self):
pass
def read_from_txt(self):
#self.data = [[[]] for x in range(5)]
img_pa... |
# coding=utf-8
from __future__ import absolute_import
import os
import logging
from pprint import pformat
import sqlalchemy as sa
from flask import current_app
from flask.ext.script import Manager, prompt_pass
from abilian.core.logging import patch_logger
from abilian.core.extensions import db
from abilian.core.mode... |
#!/usr/bin/env python
# shared_access_donor.py
#
# Copyright (C) 2008-2016 Veselin Penev, http://bitdust.io
#
# This file (shared_access_donor.py) is part of BitDust Software.
#
# BitDust is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as pub... |
#!/usr/bin/env python
from copy import deepcopy
from decimal import Decimal, InvalidOperation
from functools import wraps
from flask import make_response
from math import ceil
from datetime import datetime
from pytz import timezone
SENATE_INITIAL_BOP = {
'dem': {
'has': 32,
'needs': 18,
'p... |
import datetime
from django.db import models
from django.utils.translation import ugettext_lazy as _
from grid.models import Grid
from package.models import BaseModel, Package
class RotatorManager(models.Manager):
def get_current(self):
now = datetime.datetime.now()
return self.get_query_se... |
import warnings
from django.db import models, connection, transaction, IntegrityError, DatabaseError
from django.contrib.auth.models import User
from django.forms import ModelForm
from django.core.validators import RegexValidator
from cms.models import CMSPlugin
from xml.etree import ElementTree
from math import pi,co... |
#################################################
### File generated by ./manage.py extract_db. ###
#################################################
from tower import ugettext as _
_("""Learn the Basics: get started""", "DB: topics.Topic.title")
_("""Learn the Basics: get started""", "DB: topics.Topic.description")
_... |
import contextlib
import re
import urllib
from django.http import HttpResponseRedirect, HttpResponsePermanentRedirect
from django.http import HttpResponseForbidden
from django.middleware import common
from django.utils.encoding import iri_to_uri, smart_str, smart_unicode
import jingo
import MySQLdb as mysql
import to... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2011 OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GN... |
"""A module for extracting and manipulating information from Boolean equations.
"""
import itertools
from tt.utils import print_err, without_spaces, matching_indices
from tt.schema_provider import (schema, schema_search_ordered_list, SYM_NOT,
SYM_XOR)
__all__ = ['EvaluationRe... |
# Import the socket module
import socket
# Import command line arguments
from sys import argv
class TTTClient:
"""TTTClient deals with networking and communication with the TTTServer."""
def __init__(self):
"""Initializes the client and create a client socket."""
# Create a TCP/IP socket
self.client_socket = ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import os
import mechanize
from lxml import html
def get_grades(username, password):
br = mechanize.Browser()
br.open("https://www.tucan.tu-darmstadt.de")
br.select_form(nr=0)
br.form["usrname"] = username
br.form... |
from ggame import App
myapp = App()
myapp.run()
from ggame import App, Color, LineStyle, Sprite
from ggame import RectangleAsset, CircleAsset, EllipseAsset, PolygonAsset
# Three primary colors with no transparency (alpha = 1.0)
red = Color(0xff0000, 1.0)
green = Color(0x00ff00, 1.0)
blue = Color(0x0000ff, 1.0)
black =... |
from ggame import App
myapp = App()
myapp.run()
from ggame import App, Color, LineStyle, Sprite
from ggame import RectangleAsset, CircleAsset, EllipseAsset, PolygonAsset
red = Color(0xff0000, 1.0)
green = Color(0x00ff00, 1.0)
blue = Color(0x0000ff, 1.0)
black = Color(0x000000, 1.0)
thinline = LineStyle(1,black)
El... |
# Tweepy
# Copyright 2009-2021 Joshua Roesslein
# See LICENSE for details.
import imghdr
import mimetypes
import os
from tweepy.binder import bind_api, pagination
from tweepy.error import TweepError
from tweepy.parsers import ModelParser, Parser, RawParser
from tweepy.utils import list_to_csv
IMAGE_TYPES = ['gif', '... |
"""
basic support for running library as script
"""
import errno
import os
import time
import os.path as op
import shutil
import signal
import sys
import logging
import fnmatch
from httplib import HTTPSConnection
from urllib import urlencode
from socket import gethostname
from subprocess import PIPE, call
from optpar... |
# Tweepy
# Copyright 2009-2010 Joshua Roesslein
# See LICENSE for details.
from __future__ import print_function
import os
import mimetypes
import six
if six.PY2:
from urllib import urlencode
elif six.PY3:
from urllib.parse import urlencode
from tweepy.binder import bind_api
from tweepy.error import TweepE... |
# coding: utf-8
from tornado.web import HTTPError
from apps import BaseRequestHandler
from apps.models import User, Loud
from utils.decorator import authenticated, admin, owner
from utils.mkthings import QDict
class LoudHandler(BaseRequestHandler):
@authenticated
def get(self, lid):
if lid:
... |
#!/usr/bin/env python2
#
# Copyright (c) 2013, theZacAttacks
#
#
# A simple little twitter client written using the python-twitter
# module and tcl for a GUI.
#
# Version Changelog
#------------------------------------------------------------------------------
# 0.1 original tcl gui code written
#
# 0.... |
#! /usr/bin/python
import json
import urllib2
from datetime import date, timedelta
#sixohsix/twitter
from twitter import *
#Set Twitter Info
token='REPLACE_ME'
token_key='REPLACE_ME'
con_secret='REPLACE_ME'
con_secret_key='REPLACE_ME'
t = Twitter(
auth=OAuth(token, token_key, con_secret, con_secret_key))
# Get nu... |
# Copyright (C) 2014 Yubico AB
#
# 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.
#
# This program is ... |
from uber.common import *
class HTTPRedirect(cherrypy.HTTPRedirect):
"""
CherryPy uses exceptions to indicate things like HTTP 303 redirects. This
subclasses the standard CherryPy exception to add string formatting and
automatic quoting. So instead of saying
raise HTTPRedirect('foo?message={... |
# -*- coding: utf-8 -*-
#
#
# Copyright 2013 Camptocamp SA
#
# 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 option) any late... |
#!/usr/bin/env python
# encoding: utf-8
# The MIT License (MIT)
# Copyright (c) 2019-2020 CNRS
# 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, including without limita... |
# -*- coding: utf-8 -*-
"""'dimensional_synthesis' module contains
dimensional synthesis functional interfaces.
"""
from __future__ import annotations
__author__ = "Yuan Chang"
__copyright__ = "Copyright (C) 2016-2019"
__license__ = "AGPL"
__email__ = "pyslvs@gmail.com"
from typing import (
cast,
TYPE_CHECK... |
#########
# Copyright (c) 2019 Cloudify Platform Ltd. All rights reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... |
#
# Copyright 2018 Analytics Zoo Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... |
#
# Copyright 2019 The FATE 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 appli... |
# Author: Leland McInnes <leland.mcinnes@gmail.com>
#
# License: BSD 3 clause
from __future__ import print_function
import locale
from warnings import warn
import time
from scipy.optimize import curve_fit
from sklearn.base import BaseEstimator
from sklearn.utils import check_random_state, check_array
from sklearn.met... |
# Author: Leland McInnes <leland.mcinnes@gmail.com>
#
# License: BSD 3 clause
from __future__ import print_function
import locale
from warnings import warn
import time
from scipy.optimize import curve_fit
from sklearn.base import BaseEstimator
from sklearn.utils import check_random_state, check_array
from sklearn.uti... |
__author__ = 'nickdg'
import numpy as np
import os
from psychopy import event, core
import ratcave
from ratcave.devices import Optitrack
import ratcave.graphics as gg
import cv2
from ratcave.devices import propixx_utils
np.set_printoptions(precision=3, suppress=True)
import time
import progressbar as pb
import copy... |
# Author: Leland McInnes <leland.mcinnes@gmail.com>
#
# License: BSD 3 clause
from __future__ import print_function
import locale
from warnings import warn
import time
from scipy.optimize import curve_fit
from sklearn.base import BaseEstimator
from sklearn.utils import check_random_state, check_array
from sklearn.uti... |
#! /usr/bin/python
'''
Spark Bot for Room Finder Application
This Bot will use a provided Spark Account (identified by the Developer Token)
and create a new room to use for interacting with the Roomfinder application. Users can
check current available rooms.
This is the an example Service for a ... |
#
# Author : Manuel Bernal Llinares
# Project : ml-playground
# Timestamp : 13-09-2017 19:28
# ---
# © 2017 Manuel Bernal Llinares <mbdebian@gmail.com>
# All rights reserved.
#
"""
This is a script for quick and dirty tests on machine learning concepts
(Working with code from Chapter 2 in the book)
"""
import... |
from scipy.optimize import curve_fit
from sklearn.base import BaseEstimator
from collections import deque, namedtuple
from warnings import warn
import numpy as np
import scipy.sparse
import numba
import umap.distances as dist
INT32_MIN = np.iinfo(np.int32).min + 1
INT32_MAX = np.iinfo(np.int32).max - 1
@numba.njit(... |
#! /usr/bin/python
'''
Spark Bot for Room Finder Application
This Bot will use a provided Spark Account (identified by the Developer Token)
and create a new room to use for interacting with the Roomfinder application. Users can
check current available rooms.
This is the an example Service for a ... |
# -*- coding: utf-8 -*-
"""
pybitcoin
~~~~~
:copyright: (c) 2014 by Halfmoon Labs
:license: MIT, see LICENSE for more details.
"""
import json
import traceback
import unittest
from test import test_support
from pybitcoin.publickey import BitcoinPublicKey
from pybitcoin.privatekey import BitcoinPrivat... |
#!/usr/bin/env python3
# -*- coding: utf8 -*-
import requests
import argparse
import pprint
import json
import sys
import re
import hmac
import time
from datetime import datetime
import os
import base64
HEADERS = { 'Accept': 'application/json' }
BASE_URL = 'https://bugzilla.mozilla.org/rest/'
HMAC_KEY_ATTACHMENT_ID =... |
# -*- coding: utf-8 -*-
#
#
# Authors: Guewen Baconnier
# Copyright 2015 Camptocamp SA
#
# 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
# Licens... |
#!/usr/bin/env python
#####################################################################
# Software License Agreement (BSD License)
#
# Copyright (c) 2011, Willow Garage, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that th... |
#!/usr/bin/env python
#####################################################################
# Software License Agreement (BSD License)
#
# Copyright (c) 2011, Willow Garage, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that th... |
"""Component analysis benchmarks.
Copyright (c) 2019 Red Hat Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This progra... |
import communication
import time
import helpers
import communication.parser as parser
class DiscoverDronesRoutine(object):
def __init__(self, active_drone_ids):
self.active_drone_ids = active_drone_ids
def recieve_response(self, data):
drone_id = helpers.to_int(data['source_addr'])
if drone_id not in self.ac... |
# Copyright 2012 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... |
import sys
import shutil
import os
import logging
import pickle
import subprocess
import re
import time
import json
import ConfigParser
from bottle import Bottle, run, urljoin, HTTPResponse, request
AGENT_CONFIG_SERVER = None
GATEWAY_IP = None
GATEWAY_PORT = None
BASE_PATH = None
# agent pi... |
# 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... |
"""Example code to demonstrate how to manipulate DSP network to have two
different effects on seperately filtered, different audio paths from a single
sound.
"""
import curses
import sys
import time
import pyfmodex
from pyfmodex.enums import (CHANNELCONTROL_DSP_INDEX, DSP_MULTIBAND_EQ,
DSP... |
# -*- coding: utf-8 -*-
"""Database: run queries with batches of rows per exchange."""
import json
import logging
import traceback
from abc import (
ABCMeta,
abstractmethod,
)
from functools import partial
import six
from sqlalchemy import (
create_engine,
text,
)
from sqlalchemy.exc import SQLAlch... |
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.ticker import MaxNLocator
import threeML.plugins.SpectrumLike
import threeML.plugins.PhotometryLike
import threeML.plugins.HistLike
from threeML.utils.binner import Rebinner
from threeML.utils.stats_tools import Significance
from threeML.io.plotting.cm... |
# -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.