src stringlengths 721 1.04M |
|---|
#!/usr/bin/env python
#
# Copyright (c) 2015 Intel Corporation.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of works must retain the original copyright notice, this
# list of conditions and t... |
# uncompyle6 version 2.9.10
# Python bytecode 2.7 (62211)
# Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10)
# [GCC 6.2.0 20161005]
# Embedded file name: Mcl_Cmd_PasswordDump_Tasking.py
CMD_PW_TYPE_ALL = 0
CMD_PW_TYPE_PERMANENT = 1
CMD_PW_TYPE_CACHED = 2
CMD_PW_TYPE_DIGEST = 3
def TaskingMain(namespac... |
'''
Created on Aug 18, 2012
@author: mchrzanowski
'''
import itertools
import os.path
import time
def do_two_subsets_equal_each_other(numbers, value_to_equal):
'''
exact subset problem.
return true if we have a subset that equals value_to_equal.
http://www.cs.dartmouth.edu/~ac/Teach/CS10... |
"""
Low-dependency indexing utilities.
"""
import warnings
import numpy as np
from pandas._typing import Any, AnyArrayLike
from pandas.core.dtypes.common import (
is_array_like,
is_bool_dtype,
is_extension_array_dtype,
is_integer,
is_integer_dtype,
is_list_like,
)
from pandas.core.dtypes.gene... |
import numpy as np
from cs231n.layers import *
from cs231n.rnn_layers import *
class CaptioningRNN(object):
"""
A CaptioningRNN produces captions from image features using a recurrent
neural network.
The RNN receives input vectors of size D, has a vocab size of V, works on
sequences of length T, has an RN... |
__author__ = 'mouton'
from triggerExpressions import Evaluation
from unittest import TestCase
from math import pi, sqrt
from arithmeticExpressions import ALitteral, Func, UndefinedLitteral, SelfLitteral
from database import Variable
class TestAbs(TestCase):
@classmethod
def setUpClass(cls):
import g... |
# -*- coding: utf-8 -*-
"""Utility functions used across api code."""
import errno
import functools
import inspect
import logging
import os
import re
import subprocess
import time
import traceback
import warnings
from decorator import decorator
try:
from google.protobuf.descriptor import FieldDescriptor
#Map... |
import os
import logging
import datetime
import webapp2
from google.appengine.api import memcache
from google.appengine.ext import ndb
from google.appengine.ext.webapp import template
import tba_config
from base_controller import CacheableHandler
from consts.event_type import EventType
from consts.notification_type ... |
"""
Pyroman uses some standard chains, set in it's config.
These chains are used by the "allow()", "reject()" and "drop()" commandos
for nicer rule writing, and probably should do exactly that.
If you want maximal performance, you'll want to change these to ACCEPT and DROP
directly by calling 'Firewall.accept = "ACCEP... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2014 Midokura Europe SARL, All Rights Reserved.
# 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://w... |
from logisim.util import num_rotations
from logisim.errors import NoValueGivenError
from logisim.debug import narrate, suppress_narration
from logisim.location import Location
from logisim.component import Component
from logisim.pins import InputPin, OutputPin
class Subcircuit(Component):
def __init__(self, circu... |
"""
py2app/py2exe build script for Electrum Litecoin
Usage (Mac OS X):
python setup.py py2app
Usage (Windows):
python setup.py py2exe
"""
from setuptools import setup
import os
import re
import shutil
import sys
from lib.util import print_error
from lib.version import ELECTRUM_VERSION as version
name = ... |
# coding: utf8
from zeit.cms.workflow.interfaces import CAN_PUBLISH_ERROR
from zeit.cms.workflow.interfaces import CAN_PUBLISH_SUCCESS
import lxml.etree
import mock
import zeit.cms.checkout.helper
import zeit.cms.content.interfaces
import zeit.cms.content.reference
import zeit.cms.interfaces
import zeit.cms.workflow.in... |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Household'
db.create_table('people_household', (
('id', self.gf('django.db.mod... |
import os
import platform
from twisted.internet import defer
from .. import data, helper
from p2pool.util import pack
P2P_PREFIX = 'fac3b6da'.decode('hex') #pchmessagestart
P2P_PORT = 12024
ADDRESS_VERSION = 30 #pubkey_address
RPC_PORT = 14022
RPC_CHECK = defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
... |
#
# @BEGIN LICENSE
#
# Psi4: an open-source quantum chemistry software package
#
# Copyright (c) 2007-2017 The Psi4 Developers.
#
# The copyrights for code used from other parties are included in
# the corresponding files.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of ... |
import unittest
#from zope.testing import doctestunit
#from zope.component import testing
from Testing import ZopeTestCase as ztc
from Products.Five import fiveconfigure
from Products.PloneTestCase import PloneTestCase as ptc
from Products.PloneTestCase.layer import PloneSite
ptc.setupPloneSite()
import cs.linguaplo... |
################################################################################
### Copyright © 2012-2013 BlackDragonHunt
###
### This file is part of the Super Duper Script Editor.
###
### The Super Duper Script Editor is free software: you can redistribute it
### and/or modify it under the terms of the GNU Genera... |
# Author: Almero Gouws <14366037@sun.ac.za>
"""
This is a tutorial on how to create a Bayesian network, and perform
exact MAX-SUM inference on it.
"""
"""Import the required numerical modules"""
import numpy as np
from sprinkler_data import sprinkler_evidence, sprinkler_probs
"""Import the GrMPy modules"""
i... |
# Orca
#
# Copyright 2018-2019 Igalia, S.L.
#
# Author: Joanmarie Diggs <jdiggs@igalia.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at y... |
class Agent:
"""The generic interface for an agent.
Attributes:
auxillary_rewards: The list of enabled
auxillary rewards for this agent
"""
def train():
"""Trains the agent for a bit.
Args:
None
Returns:
None
... |
import re
import logging
import time
from autotest.client.shared import error
from virttest import virsh, utils_libvirtd
def run_virsh_setmem(test, params, env):
"""
Test command: virsh setmem.
1) Prepare vm environment.
2) Handle params
3) Prepare libvirtd status.
4) Run test command and wai... |
# coding=utf-8
"""Tests for reclassify implementation."""
import unittest
from collections import OrderedDict
from qgis.core import QgsVectorLayer, QgsFeatureRequest
from safe.gis.reclassify_gdal import reclassify_polygonize
from safe.test.utilities import test_data_path, get_qgis_app
QGIS_APP, CANVAS, IFACE, PARENT ... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.8 on 2016-07-28 23:11
from __future__ import unicode_literals
import django.contrib.auth.models
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0001_initial'),
... |
PORT_NUMBER = 2134
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
class handler(BaseHTTPRequestHandler):
path = '/index.html'
def do_GET(self):
curdir = "/home/jmeireles/Anime-Tv-shows-Scrapper/server/public/"
try:
# Check the file extension required and
... |
# -*- coding: utf-8 -*-
# This file is part of periscope3.
# Copyright (c) 2013 Roman Hudec <black3r@klikni.cz>
#
# This file contains parts of code from periscope.
# Copyright (c) 2008-2011 Patrick Dessalle <patrick@dessalle.be>
#
# periscope is free software; you can redistribute it and/or modify
# ... |
# F3AT - Flumotion Asynchronous Autonomous Agent Toolkit
# Copyright (C) 2010,2011 Flumotion Services, S.A.
# All rights reserved.
# 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... |
__author__ = 'tilmannbruckhaus'
import numpy
import sys
class HighlyDivisible:
# Highly divisible triangular number
# Problem 12
# The sequence of triangle numbers is generated by adding the natural numbers.
# So the 7th triangle number would be 1 + 2 + 3 + 4 + 5 + 6 + 7 = 28.
# The first ten te... |
#This file is part of Tryton. The COPYRIGHT file at the top level of
#this repository contains the full copyright notices and license terms.
from trytond.backend import fields
class Boolean(fields.Boolean):
@staticmethod
def sql_format(value):
return value
@staticmethod
def sql_type(field):... |
from collections import OrderedDict, defaultdict
def task_name(task):
"""
Compute the task name for an Eliot task.
If we can't find a ``message_type`` or an ``action_type`` field to use to
derive the name, then return ``None``.
"""
if task is None:
raise ValueError('Cannot compute the... |
# This is a maths problem not primarily a progamming one.
# As such the solution function call might look like this: This is probably the most compact/clever way to express it in Python.
def staffing(staff_units, patients):
HCA, nurse = 2*staff_units-patients/2, patients/2-staff_units
if HCA < 0 or nurse < 0 o... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, division
import itertools
import numpy as np
import pytest
from numcodecs.checksum32 import CRC32, Adler32
from numcodecs.tests.common import (check_encode_decode, check_config, check_repr,
check_back... |
""" Docker-based preparation for the main job stages """
import json
import tarfile
from collections import defaultdict
import docker
import docker.errors
import py.error # pylint:disable=import-error
import py.path # pylint:disable=import-error
from dockci.exceptions import (AlreadyBuiltError,
... |
# -*- coding: utf-8 -*-
"""
BaseRegion - rectangle screen area defines with top-left corner coordinates, width and height.
BaseRegion don't have any information in visual content on screen.
Content can be defined using .find() or .findAll() methods, implemented in the descendant class
"""
import cv2... |
from __future__ import unicode_literals
import unittest
from datetime import timedelta, datetime
from six.moves.cPickle import dumps, loads
from six import iteritems
from flask import Flask, send_file
from werkzeug.wrappers import Response
from werkzeug.datastructures import HeaderSet
from werkzeug.contrib.cache impor... |
#TFLOW Segment: Analyze FASTA File for Gene Recapture using BUSCO Benchmark Database
#
#Dan Stribling
#Florida State University
#Center for Genomics and Personalized Medicine
#Version 0.9, 04/20/2015
#Project URL: http://www.github.com/fsugenomics/tflow
import os.path
import sys
import subprocess
import shutil
BUSCO_... |
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2016-2017 Ryan Roden-Corrent (rcorre) <ryan@rcorre.net>
#
# This file is part of qutebrowser.
#
# qutebrowser 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... |
bl_info = {
"name": "BVH Cache Manager",
"category": "Render",
"description":"Easily delete cached BVH data!",
"location":"Properties Editor > Render > BVH Cache Manager",
"author":"Gregory Bolet",
"version":"001",
"warning":"Alpha Version"
}
import bpy
import os
import shutil
cacheDirec... |
from pprint import pprint
from django.shortcuts import render
from django.http import HttpResponse
from django.conf import settings
from stock.models import Hero, mastery, Rune
import json, requests, grequests
# Create your procedures here.
def searchSummonerStats(summoner_id):
context = {}
if type(summon... |
#!/usr/bin/env python
from __future__ import absolute_import, division, print_function, unicode_literals
import pytest
import os
import netCDF4 as nc
from gridded import Dataset
from .utilities import get_test_file_dir
test_dir = get_test_file_dir()
# Need to hook this up to existing test data infrastructure
# and... |
#!/usr/bin/env python
"""models.py
Udacity conference server-side Python App Engine data & ProtoRPC models
$Id: models.py,v 1.1 2014/05/24 22:01:10 wesc Exp $
created/forked from conferences.py by wesc on 2014 may 24
"""
__author__ = 'wesc+api@google.com (Wesley Chun)'
import httplib
import endpoints
from protor... |
# -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Conector para canal10
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
import os
from core impor... |
# Python
import datetime
import pytest
import string
import random
from io import StringIO
# Django
from django.core.management import call_command
from django.core.management.base import CommandError
# AWX
from awx.main.models import RefreshToken
from awx.main.models.oauth import OAuth2AccessToken
from awx.api.versi... |
# -*- coding: utf-8 -*-
import base64
import binascii
from hashlib import md5, sha256
import json
from django.db import models
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from django.conf import settings
CLIENT_TYPE_CHOICES = [
('confidential', 'Confidential'),
(... |
#
# A collection of shared functions for managing help flag mapping files.
#
# 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... |
# From: https://stackoverflow.com/a/39504463
# License: Creative Commons Attribution-Share Alike
# Copyright: Victor Moyseenko
import sys
import threading
import time
class Spinner:
running = False
busy = False
delay = 0.1
@staticmethod
def spinning_cursor():
while 1:
for cur... |
#!/usr/bin/env python
#coding:utf-8
# Purpose: table-row container
# Created: 02.02.2011
# Copyright (C) 2011, Manfred Moitzi
# License: MIT
from __future__ import unicode_literals, print_function, division
__author__ = "mozman <mozman@gmx.at>"
import copy
from .xmlns import CN, etree
from .nodestructuret... |
#!/usr/bin/env python
#Version 1.9
import sys
sys.path.append('/var/www/html/modules/libraries')
import time
import pprint
import telepot
import mysql.connector
import datetime
import iRulez_logging as logger
import paho.mqtt.client as mqtt
from telepot.namedtuple import InlineKeyboardMarkup, InlineKeyboardButton
from ... |
# This file contains various useful constants for py3status
GENERAL_DEFAULTS = {
"color_bad": "#FF0000",
"color_degraded": "#FFFF00",
"color_good": "#00FF00",
"color_separator": "#333333",
"colors": False,
"interval": 5,
"output_format": "i3bar",
}
MAX_NESTING_LEVELS = 4
TIME_FORMAT = "%Y... |
# -*- coding: utf-8 -*-
#
# smstatuslog_project documentation build configuration file, created by
# sphinx-quickstart on Sun Feb 17 11:46:20 2013.
#
# 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 f... |
suite = {
"mxversion" : "2.8.0",
"name" : "zippy",
"libraries" : {
"JLINE09" : {
"path" : "lib/jline-0.9.95-SNAPSHOT.jar",
"urls" : [
"http://mirrors.ibiblio.org/maven2/jline/jline/0.9.94/jline-0.9.94.jar",
],
"sha1" : "99a18e9a44834afdebc467294e1138364c207402",
},
"JYT... |
# flashcube.views
# Routes for the Flashcube web application
#
# Author: Benjamin Bengfort <benjamin@bengfort.com>
# Created: Sat Sep 07 16:03:07 2013 -0400
#
# Copyright (C) 2015 Bengfort.com
# For license information, see LICENSE.txt
#
# ID: views.py [] benjamin@bengfort.com $
"""
Views for the Flashcube webapp, ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import os
import sys
import string
sys.path.append('../src')
import seleshot
TEMPLATE = """===
API
===
"""
OUTPUT = os.path.join("_static", "api.txt")
# from http://legacy.python.org/dev/peps/pep-0257/
def trim(docstring):
if not docstring:
re... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import six
import struct
import functools
import numpy as np
try:
import ujson as json
json_dumps = json.dumps
except ImportError:
import json
json_dumps = functools.partial(json.dumps, separators=',:')
def flatten_dtype(dtype):
dty... |
#!/usr/bin/env python
#coding: utf-8
from contextlib import closing
from operator import itemgetter
from datetime import datetime
from argparse import ArgumentParser
from unicodecsv import DictWriter
from utils import read_cineca_file, csv_to_db
import sqlite3
import json
import re
FIELDS = ['Ateneo', 'Facoltà', 'Fas... |
# Frame of reference manager for scope.py
#
# We manage the following frame of reference here:
#
# - Camera pixels to camera lenslets
# - Camera lenslets to projector lenslets
# - Projector pixels to projector lenslets
# - Camera lenslets to x,y positions in micrometers in the native plane.
import numpy as np
from cali... |
import logging
import os
import subprocess
from baseaction import BaseAction
from fileprocess.processingthread import na
from fileprocess.configuration import config
try:
import musicdns
except ImportError:
musicdns = None
import fileprocess
log = logging.getLogger(__name__)
class PuidGenerator(BaseAction):
... |
# OCFS2Console - GUI frontend for OCFS2 management and debugging
# Copyright (C) 2002, 2005 Oracle. All rights reserved.
#
# 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 th... |
import json
import logging
from threading import RLock
import time
from api.caching.instance_codes import consumeCode, unconsumeCode
from api.caching.instance_lifetime import removeInstance, addInstance, setInstanceTemporalSourceLastTime
from api.caching.temporal_analytics import getTemporalInfluenceCollection, addTemp... |
# Copyright (C) 2017-2018 Joscha Reimer jor@informatik.uni-kiel.de
#
# 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 later versi... |
"""Sudoku.py
PADS-based command-line application for generating and solving Sudoku puzzles.
These puzzles are given as a 9x9 grid of cells, some of which are filled with
digits in the range 1-9. The task is to fill the remaining cells in such a
way that each row of the grid, each column of the grid, and each of nine ... |
# -*- coding: utf-8 -*-
# © 2016 Chafique DELLI @ Akretion
# Copyright (C) 2016-Today: GRAP (http://www.grap.coop)
# @author: Sylvain LE GAL (https://twitter.com/legalsylvain)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import models, api, fields
import odoo.addons.decimal_precision ... |
from base64 import b64encode
from optparse import make_option
import json
import urllib
import urllib2
import argparse
import time
import os
import subprocess
def make_request(url, params, auth=None, data=None, contentType=None):
"""
Prepares a request from a url, params, and optionally authentication.
"""... |
#!/usr/bin/env python
# -*- Python -*-
# -*- coding: utf-8 -*-
'''rtcshell
Copyright (C) 2009-2010
Geoffrey Biggs
RT-Synthesis Research Group
Intelligent Systems Research Institute,
National Institute of Advanced Industrial Science and Technology (AIST),
Japan
All rights reserved.
Licensed und... |
from abc import abstractmethod
from typing import List, Union, Generic, TypeVar
from . import xdr as stellar_xdr
from .exceptions import SignatureExistError
from .keypair import Keypair
from .network import Network
from .utils import hex_to_bytes, sha256
T = TypeVar("T")
class BaseTransactionEnvelope(Generic[T]):
... |
from django import forms
import logging
from website.tesserae_ng.models import SourceTextVolume
logger = logging.getLogger(__name__)
class SourceTextSubmitForm(forms.Form):
LANGUAGE_CHOICES = (
('latin', 'Latin'),
('greek', 'Greek'),
('english', 'English')
)
def _boundText(auto... |
# Adding Random things to a Tkinter window
# From my brain
# Typer: Ginny C Ghezzo
# What I learned:
# TODO: Need to figure out the localip return (ARG ARG)
from tkinter import *
import time
import urllib # opening and reading URLs
import urllib.request # why do I need this
import re # regular exp... |
"""
Date of Creation: 11th Dec 2014
Description: Classes and functions for IO of repeatmasker pairwise
alignments.
Copyright (C) 2010-2015
Philip J. Uren,
Authors: Philip J. Uren
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Gener... |
import idaapi
import librgb
from librgb.qt_shims import QtGui # important for PySide legacy IDA
from librgb.qt_shims import QtWidgets
try:
MAJOR, MINOR = map(int, idaapi.get_kernel_version().split("."))
except AttributeError:
MAJOR, MINOR = 6, 6
USING_IDA7API = MAJOR > 6
USING_PYQT5 = USING_IDA7API or (MAJOR ... |
##############################################################################
#
# Copyright (c) 2002 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SO... |
"""
Test job metadata
System tests for operations on stored job metadata
"""
from .hstestcase import HSTestCase
class JobsMetadataTest(HSTestCase):
def _assertMetadata(self, meta1, meta2):
def _clean(m):
return dict((k, v) for k, v in m.items() if k != 'updated_time')
meta1 = _clean... |
import logging
from pyzillow.pyzillow import ZillowWrapper, GetDeepSearchResults
from flask import Flask
from flask_ask import Ask, request, session, question, statement
zillow_data=ZillowWrapper('YOUR ZILLOW WEBSERVICES ID')
app = Flask(__name__)
ask = Ask(app, '/')
logging.getLogger('flask_ask').setLev... |
from __future__ import print_function
import json
import os
import subprocess
import sys
from leapp.utils.clicmd import command, command_opt, command_arg
from leapp.utils.repository import requires_repository, find_repository_basedir, get_repository_name, \
get_repository_id, add_repository_link, get_user_config_r... |
#!/usr/bin/env python
import sys
import os.path
test_dir = os.path.dirname (sys.argv[0])
sys.path.insert (0, os.path.join (test_dir, '../tools/'))
import specparser
spec_path = os.path.join (test_dir, 'input/all.xml')
def test_specparser ():
"""
>>> spec = specparser.parse (spec_path, 'org.freedesktop.Telepath... |
import cPickle
import os
from lib.htkmfc import HTKFeat_read
import numpy as np
__author__ = 'yossiadi'
# globals
rho = 360
# TODO also look at https://github.com/fchollet/keras/issues/68 for big datasets
def get_data(path):
"""
Reads the data as numpy d-array
:param path: the path to the data
:retu... |
# -*- coding: utf-8 -*-
#
# Reparse documentation build configuration file, created by
# sphinx-quickstart on Mon Aug 12 16:05:44 2013.
#
# 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.
#
# All... |
# Copyright 2012 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, sof... |
#!/usr/bin/env python
##################
#
# DEPENDENCIES
#
# Python 2.6+
# Python packages: sys, getopt, requests, time
# Splunk: 4.2+
#
##################
from __future__ import print_function
#
# CONFIGURATION
#
# Authentication information for your Splunk setup
_splunkUser = "user"
_splunkPass = "pass"
# host ... |
import shapelib, dbflib
import Blender
from Blender import *
import math
from math import sqrt
#
# The the shapefile module
#
# SHAPELIB Object Types
#----------------------------------------------
#define SHPT_NULL 0
#----------------------------------------------
#2D Shape Types (pre ArcView 3.x):... |
#!/opt/local/bin/python
#you might have to change the above to point to your local python
from __future__ import division
import httplib, json, time
#replace this with your API key
APIKEY = "API_KEY"
#pull from api
headers = {"TekSavvy-APIKey": APIKEY}
conn = httplib.HTTPSConnection("api.teksavvy.com")
conn.req... |
#!/usr/bin/env python3
import os
os.environ['TF_CPP_MIN_LOG_LEVEL']='2'
import numpy as np
np.set_printoptions(threshold=np.nan)
import tensorflow as tf
import time
def convolve_inner_layers(x, W, b):
y = tf.nn.conv2d(x, W, strides = [1,1,1,1], padding='SAME')
y = tf.nn.bias_add(y, b)
return tf.nn.tanh(y)
... |
# -*- coding: utf-8 -*-
"""
The MIT License (MIT)
Copyright (c) 2015-2017 Rapptz
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 u... |
#!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
# +------------------------------------------------------------------+
# | ____ _ _ __ __ _ __ |
# | / ___| |__ ___ ___| | __ | \/ | |/ / |
# | | | | '_ \ / _ \/ __| |/ /... |
# -*- 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
#... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2015 Riccardo Freixo
"""
Simple Ansible module to health check instances in an ELB
"""
DOCUMENTATION = '''
---
module: ec2_elb_healthcheck
version_added: "1.8"
short_description: Get instance Health Check state from ELBs
description:
- Gets instance Heal... |
import sys
import clutter
class HelloClutter:
def __init__ (self, message):
self.stage = clutter.Stage()
self.stage.set_color(clutter.color_from_string('DarkSlateGrey'))
self.stage.set_size(800, 600)
self.stage.set_title('My First Clutter Application')
self.stage.connect('ke... |
"""
PushBullet platform for notify component.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/notify.pushbullet/
"""
import logging
from homeassistant.components.notify import (
ATTR_TARGET, ATTR_TITLE, BaseNotificationService)
from homeassistant.con... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
Intro
======
Get varnas in a pratyahara:
.. code:: python
>>> from sanskrit_parser.base.maheshvara_sutra import MaheshvaraSutras
>>> MS = MaheshvaraSutras()
>>> jaS = SanskritImmutableString('jaS', encoding=SLP1)
>>> print(MS.getPratyahara(jaS))
j... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# MyDomus - Polling Service
# Copyright (c) 2016 Salvatore Cavallero (salvatoe.cavallero@gmail.com)
# https://github.com/scavallero/mydomus
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public ... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
# Sheepdog
# Copyright 2013, 2014 Adam Greig
#
# Released under the MIT license. See LICENSE file for details.
"""
Code for deploying code to servers and executing jobs on GridEngine.
"""
import os.path
import paramiko
class Deployer:
"""Connect to a remote SSH server, copy a file over, run qsub."""
def __i... |
import os
from collections import namedtuple
import click
from ..config import GlobalConfig
_, current_folder = os.path.split(os.getcwd())
UserInput = namedtuple('UserInput', ['name', 'version', 'author', 'description'])
class Init(object):
def __init__(self, filename=None):
self.config = GlobalConfi... |
#!/usr/bin/env python
from __future__ import division
__author__ = "Morgan Langille"
__copyright__ = "Copyright 2015, The PICRUSt Project"
__credits__ = ["Morgan Langille"]
__license__ = "GPL"
__version__ = "1.1.4"
__maintainer__ = "Morgan Langille"
__email__ = "morgan.g.i.langille@gmail.com"
__status__ = "Developmen... |
import collections
import pygame
import functools
from guicore.switcher import SwitchScreen
import config
import hubs.hubs
import logsupport
import screens.__screens as screens
import stores.paramstore as paramstore
import stores.valuestore as valuestore
from keyspecs import toucharea
from logsupport import ConsoleErr... |
#!/usr/bin/python
"""
This script generates a simple website showing examples and an about page.
The about page is generated from README.md and the examples are a concatenation
of a description markdown file and the examples.
The "julia sources examples" are taken verbatim from the julia source code:
https://github.... |
##############################################################################
#
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, faculties, institutes and professional schools.
# The core ... |
from collections import defaultdict
from PyQt5.QtCore import pyqtSignal, QModelIndex, Qt
from urh import settings
from urh.models.TableModel import TableModel
from urh.signalprocessing.ProtocolAnalyzer import ProtocolAnalyzer
from urh.ui.actions.DeleteBitsAndPauses import DeleteBitsAndPauses
class ProtocolTableMode... |
# -*- coding: utf8 -*-
# Version: 5.2
# Architecture: i386
# CompanyName: Microsoft Corporation
# FileDescription: Multi-User Win32 Driver
# FileVersion: 5.2.3790.5019 (srv03_sp2_gdr.120613-0334)
# InternalName: win32k.sys
# LegalCopyright: Microsoft Corporation. All rights reserved.
# OriginalFilename: win32k.sys
# P... |
from . import admm
from . import pock_chambolle as pc
from . import half_quadratic_splitting as hqs
from . import linearized_admm as ladmm
from proximal.utils.utils import Impl, graph_visualize
from proximal.utils.cuda_codegen import PyCudaAdapter
from proximal.lin_ops import Variable, CompGraph, est_CompGraph_norm, vs... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 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.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.