text stringlengths 12 6.59M |
|---|
# Evaluate the best pick for the given role and team
import os
import sys
import numpy as np
from PyQt5.QtWidgets import *
from collections import OrderedDict
import Modes
import Networks
sys._excepthook = sys.excepthook
class UnrecognizedMode(Exception):
pass
def my_exception_hook(exctype, value, traceback)... |
# -*- coding: utf-8 -*-
'''
General management functions for salt, tools like seeing what hosts are up
and what hosts are down
'''
# Import python libs
from __future__ import print_function
import os
import operator
import re
import subprocess
import tempfile
import time
import urllib
# Import salt libs
import salt.k... |
#!/usr/bin/env python
# Copyright 2014 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.
"""A git command for managing a local cache of git repositories."""
from __future__ import print_function
import errno
import logging
... |
import difflib
'''
Network Management
==================
The network module is used to create and manage network settings,
interfaces can be set as either managed or ignored. By default
all interfaces are ignored unless specified.
.. code-block:: yaml
eth0:
network:
- managed
- enabled: True
- type: ... |
"""
Management of APT/DNF/YUM/Zypper package repos
==============================================
States for managing software package repositories on Linux distros. Supported
package managers are APT, DNF, YUM and Zypper. Here is some example SLS:
.. code-block:: yaml
base:
pkgrepo.managed:
- huma... |
# -*- coding: utf-8 -*-
'''
Management of APT/YUM package repos
===================================
Package repositories for APT-based and YUM-based distros can be managed with
these states. Here is some example SLS:
.. code-block:: yaml
base:
pkgrepo.managed:
- humanname: CentOS-$releasever - Base... |
# -*- coding: utf-8 -*-
'''
Management of APT/YUM package repos
===================================
Package repositories for APT-based and YUM-based distros can be managed with
these states. Here is some example SLS:
.. code-block:: yaml
base:
pkgrepo.managed:
- humanname: CentOS-$releasever - Base... |
import os
import base64
from flask import Flask , request, render_template
import nbconvert.nbconvert as nbconvert
import requests
from nbformat import current as nbformat
from flask import Flask, redirect, abort
import re
import github as gh
from gist import render_content
app = Flask(__name__)
github = gh.Github()
... |
# -*- coding: utf-8 -*-
'''
Management of APT/YUM package repos
===================================
Package repositories for APT-based and YUM-based distros can be managed with
these states. Here is some example SLS:
.. code-block:: yaml
base:
pkgrepo.managed:
- humanname: CentOS-$releasever - Base... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
from subprocess import Popen, PIPE
output = Popen(['git','status'], stdout=PIPE).communicate()[0]
lines = output.splitlines()
import re
behead_re = re.compile(r"^# Your branch is (ahead of|behind) '(.*)' by (\d+) commit")
diverge_re = re.compile(r"^# and have (\d+) and (... |
# -*- coding: utf-8 -*-
'''
Management of SELinux rules
===========================
If SELinux is available for the running system, the mode can be managed and
booleans can be set.
.. code-block:: yaml
enforcing:
selinux.mode
samba_create_home_dirs:
selinux.boolean:
- value: True
... |
# -*- coding: utf-8 -*-
'''
Starting or restarting of services and daemons
==============================================
Services are defined as system daemons typically started with system init or
rc scripts. Services can be defined as running or dead.
.. note::
The current status of a service is determined by... |
import math
from numbskull.inference import FACTORS
from scipy import sparse
from snorkel.learning.gen_learning import GenerativeModel, DEP_EXCLUSIVE, DEP_REINFORCING, DEP_FIXING, DEP_SIMILAR
import unittest
class TestGenLearning(unittest.TestCase):
@classmethod
def setUpClass(cls):
pass
@classm... |
"""
Azure (ARM) Utilities
.. versionadded:: 2019.2.0
:maintainer: <devops@eitr.tech>
:maturity: new
:depends:
* `azure <https://pypi.python.org/pypi/azure>`_ >= 2.0.0rc6
* `azure-common <https://pypi.python.org/pypi/azure-common>`_ >= 1.1.4
* `azure-mgmt <https://pypi.python.org/pypi/azure-mgmt>`_ >= 0.30... |
from testmodule import *
import sys
import asyncio
class TestAsync(TestRunner):
def __init__(self):
super().__init__()
async def testasync(self,connector,table):
import pysharkbite
tableOperations = connector.tableOps(table)
if not tableOperations.exists(False):
print ("Creating table" + tabl... |
# -*- coding: utf-8 -*-
# pylint: disable=invalid-name,missing-docstring,broad-except
# Copyright 2017 IBM RESEARCH. 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
#
# ... |
#!/usr/bin/python3
import logging
logging.basicConfig(level=logging.DEBUG)
from binascii import a2b_hex, b2a_hex
import bitcoin.txn
import bitcoin.varlen
import jsonrpc
import jsonrpcserver
import merkletree
from struct import pack
import sys
from time import time
from util import RejectedShare
pool = jsonrpc.Servic... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import json
import time
import blinker
from gevent import socket
from . import protocol as nsq
from . import errors
from .decorators import cached_property, deprecated
from .httpclient import HTTPClient, USERAGENT
from .message import Message
from .sta... |
"""Decorators for sandman2 convenience functions."""
import functools
import hashlib
from flask import jsonify, request, make_response
from sandman2.exception import BadRequestException
def etag(func):
"""Return a decorator that generates proper ETag values for a response.
:param func: view function
"""... |
# -*- coding: utf-8 -*-
#
# satextrato/__init__.py
#
# Copyright 2015 Base4 Sistemas Ltda ME
#
# 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... |
try:
from django.conf.urls.defaults import patterns, url
except ImportError: # Django >= 1.6
from django.conf.urls import patterns, url
urlpatterns = patterns(
'goog.views',
url('^__goog__/(?P<path>.*)$', 'serve_closure',
name='goog_serve_closure'),
# FIXME(andi): That's a bit ugly to cove... |
# Sublime modelines - https://github.com/SublimeText/Modelines
# sublime: translate_tabs_to_spaces false; rulers [100,120]
from . import about
from . import kv
from subprocess import Popen, PIPE
import copy
import datetime
import json
import os
import re
import string
import sublime
import subprocess
import sys
import... |
# Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: jernej@reciprocitylabs.com
# Maintained By: jernej@reciprocitylabs.com
"""Module containing decorators"""
import time
from functools import wraps
... |
# -*- coding: utf-8 -*-
# The MIT License (MIT)
# Copyright (c) 2014 Baxter S. Eaves Jr,
# Copyright (c) 2015-2016 MIT Probabilistic Computing Project
# Lead Developer: Feras Saad <fsaad@mit.edu>
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documen... |
# -*- coding: utf-8 -*-
# Copyright 2011 Tomo Krajina
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... |
# -*- coding: utf-8 -*-
# Copyright 2011 Tomo Krajina
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... |
# -*- coding: utf-8 -*-
# Copyright 2011 Tomo Krajina
#
# 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 ... |
# encoding: utf-8
from __future__ import unicode_literals
from unittest import TestCase
from inspect import isclass
from webob import Request, Response
from webob.exc import HTTPNotModified
from web.core.application import Application
class TestApplicationParts(TestCase):
def setUp(self):
self.app = Application... |
#!/usr/bin/python
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
#... |
from os.path import dirname, basename, relpath
import gscommon as gs
import gslint
import gspatch
import margo
import mg9
import re
import sublime
import sublime_plugin
DOMAIN = 'GsPalette'
last_import_path = {}
class Loc(object):
def __init__(self, fn, row, col=0):
self.fn = fn
self.row = row
self.col = col
... |
#! /usr/bin/env python
"""
This is a Python version of Propublica's TableFu Ruby library.
TableFu parses, sorts and formats table-like streams, like CSVs,
and outputs tables in HTML. It's meant as a utility to make
getting tabular on the web easier.
"""
import csv
import urllib2
from table_fu.formatting import forma... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: sw=4:ts=4:expandtab
"""
tabutils
~~~~~~~~
Provides methods for reading and processing data from tabular formatted files
Attributes:
CURRENCIES [tuple(unicode)]: Currency symbols to remove from decimal
strings.
ENCODING (str): Default file encoding.... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: sw=4:ts=4:expandtab
"""
tabutils
~~~~~~~~
Provides methods for reading and processing data from tabular formatted files
Attributes:
CURRENCIES [tuple(unicode)]: Currency symbols to remove from decimal
strings.
ENCODING (str): Default file encoding.... |
# -*- coding: utf-8 -*-
from bs4 import BeautifulSoup
import requests
import logging
import re
__all__ = ['tts_langs']
URL_BASE = 'http://translate.google.com'
JS_FILE = 'desktop_module_main.js'
# Logger
log = logging.getLogger(__name__)
log.addHandler(logging.NullHandler())
def tts_langs():
"""Languages Googl... |
# coding: UTF-8
'''
Created on 2013-04-06
@author: tianwei
Desc: Celery Tasks
'''
import os
import sys
import uuid
import time
import datetime
from celery.decorators import task
from django.shortcuts import get_object_or_404
from django.shortcuts import render
from django.shortcuts import render_to_response
from dj... |
#! /usr/bin/env python3
import base64
import os
import shutil
import sqlite3
import json
import urllib.request
from .icons import icon_string
from tkinter import *
from tkinter import filedialog, messagebox, ttk
from tkinter import TclError
from slib.helpers import InterfaceHelper
from data.filegroups import typeGroup... |
import random
#!START local
from program import *
#!END local
def newComment(prog, x, y):
# TODO make sure it's unique
name = ''.join([random.choice('abcdefghijklmnopqrstuvwxyz') for i in range(12)])
c = Comment("Hello, world")
c._pos = (x, y)
prog.objects[name] = c
def newCount(prog, x, y):
... |
"""
tailbone
Appengine abstract restful backend
"""
import cgi
import datetime
import functools
import json
import logging
import os
import random
import re
import string
import sys
import time
import urllib
import webapp2
import yaml
from google.appengine import api
from google.appengine.api import channel
from goo... |
# talkatv - Commenting backend for static pages
# Copyright (C) 2012 talkatv contributors, see AUTHORS
#
# 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... |
# Copyright 2017-2019 TensorHub, 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 writ... |
# -*- coding: utf-8 -*-
"""
tarbell.configure
~~~~~~~~~~~~~~~~~
This module provides the Tarbell configure command.
"""
import os
import sys
import yaml
import shutil
from subprocess import call
from datetime import datetime
from clint.textui import colored, puts
from .settings import Settings
from .oauth import g... |
# -*- coding: utf-8 -*-
"""
tarbell.configure
~~~~~~~~~~~~~~~~~
This module provides the Tarbell configure command.
"""
import os
import sys
import yaml
import shutil
from subprocess import call
from datetime import datetime
from clint.textui import colored, puts
from .settings import Settings
from .oauth import g... |
'''
This file is part of targetcli.
Copyright (c) 2011-2013 by Datera, 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 applica... |
"""
Container for functions that work with HDF5 genotype/phenotype datasets.
(Usually useful for analysing human data.)
"""
import h5py
import scipy as sp
import sys
import linear_models as lm
import analyze_gwas_results as agr
import time
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
def c... |
d0fa7611-2ead-11e5-80a1-7831c1d44c14 |
b8a7e6b5-2ead-11e5-ad10-7831c1d44c14 |
da4d93d7-2ead-11e5-94d3-7831c1d44c14 |
c3ff534c-2ead-11e5-ad4c-7831c1d44c14 |
d640998a-2ead-11e5-b8b4-7831c1d44c14 |
from __future__ import print_function
"""
:copyright: 2010 by Ronny Pfannschmidt
:license: MIT
"""
# Genscript Metadata
import re
import os
import sys
import shlex
import subprocess
import datetime
import pkg_resources
def trace_debug(*k):
print(*k)
sys.stdout.flush()
def trace(*k):
pass
def do_ex(... |
"""
:copyright: 2010 by Ronny Pfannschmidt
:license: MIT
"""
# Genscript Metadata
import re
import os
import sys
import shlex
import subprocess
def trace_debug(*k):
sys.stdout.write(' '.join(map(str,k)))
sys.stdout.write('\n')
sys.stdout.flush()
def trace(*k):
pass
def do_ex(cmd, cwd='.'):
tr... |
import os
import sys
import subprocess
def getoutput(cmd, cwd='.'):
p = subprocess.Popen(cmd,
shell=True,
stdout=subprocess.PIPE,
cwd=cwd,
)
out, _ = p.communicate()
return out.decode() # will kill us sometime... |
import boto3
import json
import re
ml_bucket = 'aml-an-intro'
batch_data_location = 'batch-prediction-upload/adultincomebatch1.csv'
schema_data_location = 'batch-prediction-upload/adultincomebatchschema.json'
s3 = boto3.resource('s3')
with open('adulttotest.csv', 'r') as data:
s3.Bucket(ml_bucket).put_object(Key=... |
from commandlib import run, CommandError
import hitchpython
from hitchstory import StoryCollection, StorySchema, BaseEngine, HitchStoryException
from hitchstory import validate, expected_exception
from hitchrun import expected
from commandlib import Command
from strictyaml import Str, Map, Int, Optional, load
from path... |
# -*- coding: utf-8 -*-
#
# -----------------------------------------------------------------------------------
# Copyright (c) Microsoft Open Technologies (Shanghai) Co. Ltd. All rights reserved.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this softw... |
# -*- coding: utf-8 -*-
# <nbformat>3.0</nbformat>
# <codecell>
'''
Utility functions for handling MIDI data in an easy to read/manipulate format
'''
# <codecell>
import midi
import numpy as np
try:
import fluidsynth
_HAS_FLUIDSYNTH = True
except ImportError:
_HAS_FLUIDSYNTH = False
import os
import ite... |
import docker
import pytest
from webcomix.docker import DockerManager, CONTAINER_NAME
@pytest.fixture
def cleanup_container(test):
yield None
client = docker.from_env()
for container in client.containers().list():
if container.attrs["Config"]["Image"] == CONTAINER_NAME:
container.kill(... |
# -*- coding: utf-8 -*-
from collections import OrderedDict
from termcolor import cprint
# Colorized output:
def print_info(x):
cprint(x, 'blue')
def print_infob(x):
cprint(x, 'blue', attrs=['bold'])
def print_ok(x):
cprint(x, 'green', attrs=['bold'])
def print_secc(x):
cprint(' ==> ' + x, 'blue... |
import discord
from discord.ext import commands
from .utils.dataIO import dataIO
from .utils.dataIO import fileIO
from .utils import checks
from operator import itemgetter
from random import randint
import time
import os
import ast
import csv
import requests
import re
class Hook:
def __init__(self, bot):
... |
import os
from django.conf.urls import patterns, include, url
from django.conf.urls.static import static
from django.conf import settings
from django.contrib import admin
from django.contrib.auth.decorators import login_required
from wagtail.wagtailadmin import urls as wagtailadmin_urls
from wagtail.wagtaildocs impor... |
# Copyright 2010-2011 Dusty Phillips
# This file is part of Prickle.
# Prickle 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 version.... |
import numpy as np
from functools import partial
import hoomd._hoomd as _hoomd
def _make_three_vec(vec, func, sc, name="vector"):
try:
l_vec = len(vec)
except TypeError:
try:
v = sc(vec)
except (ValueError, TypeError):
raise ValueError("Expected value of type {}... |
import ConfigParser
from prettytable import PrettyTable
from espnscraper import EspnScraper
from tablemapper import StandingsTableMapper
config = ConfigParser.RawConfigParser()
config.read('config.ini')
scraper = EspnScraper(config)
std_table = StandingsTableMapper(config, hide=True)
hidden = True
html = scraper.st... |
# This file is part of beets.
# Copyright 2013, Adrian Sampson.
#
# 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, ... |
""" This module contains the logic for specifying and validating the top-level
DC/OS configuration from user arguments
The data structure called 'entry' is what defines which validation checks
should be run, how arguments should be calculated, which arguments should have
set defaults, which arguments should be user sp... |
{
"targets": [
{
"target_name": "silk-alog",
"sources": [
"bindings.cpp",
],
"include_dirs": [
"<!(node -e \"require('nan')\")",
],
"conditions": [
[
"OS == 'android'", {
"libraries" : [
"<!(echo $Android_mk__LIBRARIES... |
import sys
import requests
import time
import json
import os
import const
import argparse
from clint.textui import prompt
from lib import err, info
def getVideoId(url):
if "hotstar.com/" in url:
video_id = url.split("/")[-1]
if len(video_id) == 10 and int(video_id):
return video_id
... |
# -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2016, Adrian Sampson.
#
# 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 t... |
# -*- coding: utf-8 -*-
import copy
import datetime
import gnupg
import math
import os
import re
import shutil
import StringIO
import uuid
from reportlab.platypus import Paragraph
from PyPDF2 import PdfFileWriter, PdfFileReader
from reportlab.lib import colors
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_RI... |
import hrmcalcs
import numpy as np
def hrmprint(peakvalues, instantHR, averageHR, tachy, brady):
"""
This function is used to write the output from our cardiac heart rate monitor to a text file. The function inputs
have been returned from the hrmcalcs.py file and a new text file with the output from... |
from cStringIO import StringIO
import zlib
import struct
KEY_FRAME = 1
INTER_FRAME = 2
DISPOSABLE_INTER_FRAME = 3
SORENSON_H263_CODEC = 2
SCREEN_VIDEO_CODEC = 3
LATIN, JAPANESE, KOREAN, SIMPLIFIED_CHINESE, TRADITIONAL_CHINESE = range(1, 6)
VIDEOFRAME = 61
class SwfException(Exception):
'''Th... |
#!/usr/bin/env python
import os
import sys
import json
import random
base = os.path.dirname(__file__)
sys.stdout.write('''<!doctype html>
<html>
<head>
<title>Studiebeskeder</title>
<style type="text/css">
body {
overflow: hidden;
margin: 0;
font-family: 'URW Palladio L';
}
.nyhed {
width: 930px;
... |
#!/usr/bin/env python
# Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All c... |
from django.test import TestCase
from django.test import Client
from noveltorpedo.models import *
from django.utils import timezone
from django.core.management import call_command
client = Client()
class SearchTests(TestCase):
def test_that_the_front_page_loads_properly(self):
response = client.get('/')... |
# -*- coding: utf-8 -*-
"""
(C) 2014-2019 Roman Sirokov and contributors
Licensed under BSD license
http://github.com/r0x0r/pywebview/
"""
import os
import sys
import logging
from threading import Event
import ctypes
from ctypes import windll
from uuid import uuid4
from platform import machine
import time
from webvi... |
import numpy as np
import pandas as pd
import re
import os
import copy
from . import records
from . import _headers
from . import downloads
# Class for WFDB annotations
class Annotation(object):
"""
The class representing WFDB annotations.
Annotation objects can be created using the constructor, or by re... |
# Django settings for whereami project.
import os
DEBUG = bool(os.getenv("DJANGO_DEBUG", False))
TEMPLATE_DEBUG = DEBUG
ADMINS = (
('Kristian Glass', 'whereami@moorhensolutions.co.uk'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'mys... |
from chalice import Chalice, Response
import boto3
import pickle
app = Chalice(app_name='tasks-handler')
app.debug=True
@app.route('/', methods=['POST','GET'])
def index():
return {'hello': 'world'}
@app.route('/process/message', methods=['POST'])
def process_message():
# Extract command from body
comman... |
# -*- encoding: utf-8 -*-
from django import forms
from nexmo import NexmoMessage
from django.core.mail import EmailMessage
from django.core.mail import EmailMultiAlternatives
#from django.forms import CharField,Form,PasswordInput
from django.views.decorators.csrf import csrf_exempt
from django.template import Request... |
"""Testing methods that need Handle server write access"""
import unittest
import logging
import requests
import json
import sys
sys.path.append("../..")
import b2handle.clientcredentials
from b2handle.handleclient import EUDATHandleClient
from b2handle.handleexceptions import HandleSyntaxError
from b2handle.handleexc... |
# -*- coding: utf-8 -*-
"""
This file holds user profile information. (The base User model is part of
Django; profiles extend that with locally useful information.)
TWLight has three user types:
* editors
* coordinators
* site administrators.
_Editors_ are Wikipedia editors who are applying for TWL resource acce... |
"""Common settings and globals."""
VERSION = '0.4.2'
import dj_database_url
from os.path import abspath, basename, dirname, join, normpath
from sys import path
from os import environ
# Normally you should not import ANYTHING from Django directly
# into your settings, but ImproperlyConfigured is an exception.
from d... |
import datetime
from django.db.models import permalink
from django.template.defaultfilters import slugify
from mongoengine import *
from mongoengine.django.auth import User
MEMBER_ROLE = 'member'
ADMIN_ROLE = 'admin'
MENTOR_ROLE = 'mentor'
STATUS_OK = 'ok'
STATUS_SUSPENDED = 'suspended'
STATUS_CLOSED = 'closed'
de... |
import os
import unittest
import tempfile
from stratuslab.ConfigHolder import ConfigHolder
from stratuslab.installator.PolicyValidator import PolicyValidator
class PolicyValidatorTest(unittest.TestCase):
SHARE_DIR = '../../share'
TEMPLATE_DIR = os.path.join(SHARE_DIR, 'template')
def testConfigurationCr... |
from __future__ import absolute_import
from __future__ import unicode_literals
import copy
import ast
from datetime import date, datetime, timedelta
from decimal import Decimal
from simpleeval import SimpleEval, DEFAULT_OPERATORS, InvalidExpression, DEFAULT_FUNCTIONS, FeatureNotAvailable
import six
import operator
fro... |
import numpy as np
class KNearestNeighbor(object):
"""A k-NN classifier with L2 distance."""
def __init__(self):
pass
def train(self, X, y):
"""
Train the classifier. For k-nearest neighbors this is just
memorizing the training data.
Inputs:
- X: A numpy... |
########
# Copyright (c) 2014 GigaSpaces Technologies 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... |
import copy
import os
import time
from jinja2 import Environment, FileSystemLoader
from os.path import join, dirname
import pytest
from cosmo_tester.framework.test_hosts import Hosts
from cosmo_tester.framework import util
from .cfy_cluster_manager_shared import REMOTE_CLUSTER_CONFIG_PATH
CONFIG_DIR = join(dirname(_... |
from copy import deepcopy
import numpy as _np
import matplotlib.pylab as plt
from matplotlib.colors import LogNorm
from atmPy.tools import plt_tools, math_functions, array_tools
from atmPy.tools import pandas_tools as _panda_tools
from atmPy.general import timeseries as _timeseries
from atmPy.general import vertical_... |
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... |
"""Module for generating Pixel Painter resource."""
from PIL import Image, ImageDraw, ImageFont
from utils.retrieve_query_parameter import retrieve_query_parameter
from math import ceil
from yattag import Doc
import string
def resource(request, resource):
"""Create a image for Pixel Painter resource.
Args:
... |
# -*- coding: utf-8 -*-
"""
Allows utilizing telegram webhooks.
See https://core.telegram.org/bots/webhooks for details
about webhooks.
"""
import asyncio
import logging
from ipaddress import ip_network
import voluptuous as vol
from homeassistant.const import (
EVENT_HOMEASSISTANT_STOP, HTTP_BAD_REQUEST, HTTP_... |
# -*- coding: utf-8 -*-
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softw... |
"""
********
Overview
********
**Static Model** provides a simple framework for modeling objects that
might otherwise be modeled using persistence technologies such as
the Django ORM, but that do not belong in the database.
******
Models
******
A model is defined using a class definition to create a sub-class
of Sta... |
# Exceptions
from .base_scraper import NoSuchItem, InvalidData
# Classes
from .base_scraper import ResultSet, Itemslist, AllowedValue, Dimension
from .base_scraper import Item, Collection, Dataset
from .base_scraper import BaseScraper
# Contants
from .base_scraper import ROOT, TYPE_DATASET, TYPE_COLLECTION
|
# Exceptions
from .base_scraper import NoSuchItem, InvalidData
# Classes
from .base_scraper import Result, ResultSet, Itemslist, Dimension, DimensionValue
from .base_scraper import Item, Collection, Dataset
from .base_scraper import BaseScraper
from .datatypes import Datatype, NoSuchDatatype
# Contants
from .base_scr... |
"""Import timetable data "fresh from the cow"
"""
import os
import requests
import zipfile
from time import sleep
from datetime import timedelta
from requests_html import HTMLSession
from django.conf import settings
from django.core.management.base import BaseCommand
from django.db import transaction
from django.utils... |
import datetime
import os
import logging
import re
import six
#from six.moves import cPickle
import numpy as np
import xarray as xr
import pandas as pd
from pandas.compat import StringIO
import requests
log=logging.getLogger('cdec')
from ... import utils
from .common import periods
try:
import seawater
except ... |
from __future__ import division
from __future__ import print_function
# still tracking down the last few calls missing the np. prefix,
# leftover from 'from numpy import *'
import numpy as np
import glob,types
import copy
from numpy.random import random
from numpy import ma
from numpy.linalg import norm
import tem... |
import csv
import os
import shutil
import sys
import datetime
from optparse import make_option
from django.core.management.base import BaseCommand
from django.core.management.base import CommandError
from django.utils.translation import ugettext as _
from django.db.utils import IntegrityError
from mezzanine.conf impor... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.