text stringlengths 17 737k |
|---|
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.contrib.auth.models import AnonymousUser
from django.contrib.sites.models import Site
from django.core.urlresolvers import reverse, NoReverseMatch
from django.db import models
from django.template import Reque... |
import re
import math
import json
import datetime
from aiohttp import web
from cerberus import Validator
import virtool.utils
import virtool.user_permissions
class CustomEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, datetime.datetime):
return obj.replace(tzinfo=dateti... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
import weatherinfo
import config
import exitutils
from logsupport import ConsoleError, ConsoleInfo, ConsoleWarning
import isy
class GetTempsToISY(object):
def __init__(self):
pass
def SendTemps(self, alert):
"""
params: Station, (Fieldspec Var)+ where Fieldspec = C|F:fieldname Var = S|I|L:name)
"""
stat... |
import math
import numpy as np
import scipy as sp
##----------------------------------------------------------
## Generic constants
# Speed of light
clight = 3.e10 # cm/s
# Planck's h constant
hplanck = np.float64( 4.136e-18 ) # keV s
# Electron radius
r_e = 2.83e-13 # cm
# Mass of proton
m_p = np.float64( 1.673... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
# -*- coding: utf-8 -*-
# Licensed under the MIT license
# http://opensource.org/licenses/mit-license.php
# Copyright 2007,, Frank Scholz <coherence@beebits.net>
import time
from coherence.extern.simple_plugin import Plugin
from coherence import log
import coherence.extern.louie as louie
from coherence.upnp.core.... |
# Tai Sakuma <tai.sakuma@gmail.com>
import alphatwirl
##__________________________________________________________________||
class ReaderComposite(object):
"""A composite of event readers"
This class is a composite in the composite pattern.
Examples of event readers are instances of `Summarizer` and th... |
"""ColorHelper utilities."""
import sublime
import re
import decimal
from ColorHelper.lib import csscolors
from ColorHelper.lib.rgba import RGBA, round_int, clamp
FLOAT_TRIM_RE = re.compile(r'^(?P<keep>\d+)(?P<trash>\.0+|(?P<keep2>\.\d*[1-9])0+)$')
COLOR_PARTS = {
"percent": r"[+\-]?(?:(?:\d*\.\d+)|\d+)%",
"f... |
from django.test import TestCase, Client
from django.contrib.auth.models import User
from django.core.exceptions import PermissionDenied
from django.contrib.gis.geos import Point
from django.utils import timezone
from django.conf import settings
from rest_framework import serializers
from rest_framework.parsers impo... |
import logging
import math
from django.test import Client
from django.utils import timezone
from django.conf import settings
from rest_framework.parsers import JSONParser
from io import BytesIO
import json
from ambulance.models import Ambulance, \
AmbulanceStatus, AmbulanceCapability, AmbulanceUpdate
from emstra... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Automated tests for checking transformation algorithms (the models package).
"""
import logging
import unittest
import os
import t... |
from rest_framework import serializers
from .models import (
ETDRSGridAnnotation,
MeasurementAnnotation,
BooleanClassificationAnnotation,
PolygonAnnotationSet,
SinglePolygonAnnotation,
LandmarkAnnotationSet,
SingleLandmarkAnnotation,
)
from .validators import validate_grader_is_current_reti... |
#
# 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
# ... |
import logging
import urlparse
import urllib
from xml.etree.ElementTree import ElementTree
from xml.etree.ElementTree import fromstring
from django.test import TestCase
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
from mama_cas.models import ServiceTicket
from mama_cas.mode... |
import django_filters
from rest_framework import filters
from rest_framework.serializers import ValidationError
from core.models import AtmosphereUser, MaintenanceRecord
from core.query import only_current
from api.permissions import CanEditOrReadOnly
from api.v2.serializers.details import MaintenanceRecordSerialize... |
import numpy as np
import matplotlib.pyplot as plt
from .time_index import TimeIndex
from .utils import is_scalar
class InfiniteSequence:
def __init__(self, fun):
self.fun = fun
def __getitem__(self, n):
if n == int(n):
return self.fun(n)
else:
raise Exception... |
from dask.distributed import dask_client_from_ipclient
import numpy as np
from numpy.testing import assert_array_almost_equal
import dask.array as da
def test_dask_client_from_ipclient():
from IPython.parallel import Client
c = Client()
dask_client = dask_client_from_ipclient(c)
# data
a = np.ara... |
import pytest
from api.users.serializers import UserSerializer
from osf_tests.factories import (
UserFactory,
PreprintFactory
)
from tests.utils import make_drf_request_with_version
@pytest.fixture()
def user():
return UserFactory()
@pytest.fixture()
def user_with_preprint():
preprint = PreprintFact... |
import sys, os
import time
try:
from picamera.array import PiRGBArray
from picamera import PiCamera
except:
pass
import cv2
from cv2 import VideoCapture
import numpy as np
import logging
import settings
from image_lib import overlay_image, fadein, create_empty_image
from task_common import TaskFrameProc... |
#!/usr/bin/python -u
version = "20111201"
from fcntl import fcntl, F_SETFL
from os import O_NONBLOCK
from select import select
from struct import pack,unpack
import sys
import socket
# use this for a more standard logging mechanism
# import logging
def usage():
sys.stderr.write("\nusage: "+sys.argv[0]+" <option... |
from django.db import models
from django.db.models import Avg, Sum
from django.db.models.signals import post_save
from django.contrib.auth.models import User
from django.template.defaultfilters import slugify
from race.validators import is_map_file, is_demo_file
from lib.file_storage import OverwriteStorage
from pickle... |
from __future__ import unicode_literals
from django.core.urlresolvers import reverse
from mock import patch
from temba.airtime.models import AirtimeTransfer
from temba.flows.models import RuleSet
from temba.tests import TembaTest, MockResponse
class AirtimeEventTest(TembaTest):
def setUp(self):
super(Air... |
# Gitless - a version control system built on top of Git.
# Licensed under GNU GPL v2.
"""Gitless's commit dialog."""
import itertools
import os
import subprocess
from gitless.core import repo as repo_lib
from gitless.core import sync as sync_lib
from . import pprint
_COMMIT_FILE = '.GL_COMMIT_EDIT_MSG'
_MERGE_M... |
# -*- coding: utf-8 -*-
"""
gmncurses.ui.views.issues
~~~~~~~~~~~~~~~~~~~~~~~~~
"""
import urwid
from gmncurses.ui.widgets import generic, issues
from . import base
class ProjectIssuesSubView(base.SubView):
help_popup_title = "Issues Help Info"
help_popup_info = base.SubView.help_popup_info + (
( "... |
import json
from django.db import connection
from django.http import HttpResponse
from catmaid.control.authentication import *
from catmaid.models import Relation
import networkx as nx
from networkx.algorithms import weakly_connected_component_subgraphs
from collections import defaultdict
from itertools import chain, i... |
# -*- encoding: utf-8 -*-
"""
@version: 0.01
@author: Tony Qiu
@contact: tony.qiu@liulishuo.com
@file: fasttext_test.py
@time: 2018/01/15 午後1:17
"""
# import gensim
import os, sys
# from gensim.models.word2vec import LineSentence
from gensim.models.fasttext import FastText as FT_gensim
from gensim.models.wrappers.fas... |
'''
@author Luke Campbell <luke.s.campbell@gmail.com>
@file ion/services/dm/inventory/test/dataset_management_test.py
@description Unit and Integration test implementations for the data set management service class.
'''
from interface.services.dm.idataset_management_service import DatasetManagementServiceClient
from io... |
# coding=utf-8
import gevent
import zlib
import base64
import json
from ser_handle import SerHandle
from gevent import socket
from mongo_single import Mongo
from functions import md5
import time
import traceback
def request_handle(data, address):
request = json.loads(data)
handle = SerHandle(request, address... |
from hashlib import sha1
from random import random
from sets import Set
NOT_IMPL_MSG = '{0!r} needs to implement function {1!r}'
NO_DOCSTRING = '{0!r} needs a class docstring (comment).'
HTML_TMPL = """<div class="header" id="{key}">{name}</div>
<div class="description">{description}</div>
<div class="hidden" id="{ke... |
# -*- coding: utf-8-unix; mode: python -*-
"""Module to provide session with SQLite3.
This module provides class that manage http session.
Classes:
Session -- class to provide http session with SQLite3
"""
__author__ = 'IMAI Toshiyuki'
__version__ = '1.0'
import os
import datetime
import sys
import random
import... |
#!/usr/bin/env python3
import os
import re
import glob
import json
from datetime import datetime
from collections import OrderedDict as odict
from multiprocessing import cpu_count as cpu_count
from . import util
from .cmake import CMakeSysInfo, CMakeCache, getcachevars
from . import vsinfo
from . import flags as c4fl... |
import subprocess
import sys
import unittest
from test.util import ClangTest
def run(args):
if hasattr(subprocess, 'run'):
p = subprocess.run(args, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
output, stderr = p.stdout.decode(), p.stderr.decode()
return p, output... |
from nac import (calculate_mos, initialize)
from nac.workflows.workflow_coupling import generate_pyxaid_hamiltonians
from nose.plugins.attrib import attr
from os.path import join
from qmworks import (run, Settings)
from utilsTest import try_to_remove
import h5py
import numpy as np
import os
import shutil
# ==========... |
# 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, ... |
# -*- coding: utf-8 -*-
from contextlib import contextmanager
import sys
import pytest
from profiling.profiler import Profiler
from profiling.stats import FrozenStatistics, RecordingStatistics
@contextmanager
def profiling(profiler):
try:
profiler.start()
yield
finally:
profiler.stop... |
# run as ctest .
#
# or
#
# cd ../test ; env PYTHONPATH=../build python3 tests/realign.py ; cd ../build
# cd ../test ; env PYTHONPATH=../build pytest tests/realign.py ; cd ../build
import unittest
from pyvcflib import *
import json
class RealignTest(unittest.TestCase):
# Returns True or False.
def test... |
# This script downloads problem examples and runs them in a container.
# The initial development runs examples in a local directory until container execution can be implemented.
import json
import os
import sys
from sys import platform as _platform
import shutil
import datetime
import multiprocessing as mp
from multi... |
# -*- coding: utf-8 -*-
from timeside.core import Processor, implements, interfacedoc, FixedSizeInputAdapter
from timeside.api import *
import numpy
class Gain(Processor):
implements(IEffect)
@interfacedoc
def __init__(self, gain=1.0):
self.gain = gain
@staticmethod
@interfacedoc
de... |
import ugfx, time, badge, machine, uos, appglue, deepsleep, network, esp
# SHA2017 badge home screen
# Renze Nicolai 2017
# Reboot counter (Used for BPP)
def get_reboot_counter():
return esp.rtcmem_read(1023)
def set_reboot_counter(value):
esp.rtcmem_write(1023, value)
def increment_reboot_counter():
... |
from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
url(r'^admin2/', include('djadmin2.urls')),
# url(r'^example/', include('example.foo.urls')),
# Uncomment the admin/doc line below to enable admin documenta... |
from django.conf import settings
from django.core import validators
from django.core.exceptions import ValidationError
from django.utils import timezone
from django.utils.dateparse import parse_date, parse_datetime, parse_time
from django.utils.encoding import is_protected_type
from django.utils.translation import uget... |
import numpy as np
import os.path
from io import BytesIO
from numpy.testing import assert_equal, assert_array_equal
from nose.tools import raises
from sklearn.datasets import (load_svmlight_file, load_svmlight_files,
dump_svmlight_file)
currdir = os.path.dirname(os.path.abspath(__file__... |
# Copyright 2001-2005 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright notice and this permissio... |
#!/usr/bin/env python
# encoding: utf8
#
# Copyright © Burak Arslan <burak at arskom dot com dot tr>,
# Arskom Ltd. http://www.arskom.com.tr
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are ... |
# Test the Unicode versions of normal file functions
# open, os.open, os.stat. os.listdir, os.rename, os.remove, os.mkdir, os.chdir, os.rmdir
import sys, os, unittest
from unicodedata import normalize
from test import support
filenames = [
'1_abc',
'2_ascii',
'3_Gr\xfc\xdf-Gott',
'4_\u0393\u03b5\u03b9\... |
#!/usr/bin/env python
"""Evaluate word representations by word set expansion.
The task is to retrieve words from a (nearly) closed set given one or
more example words from the set. Retrieval is based on word vector
similarity (dot product of normalized vectors).
"""
import sys
import os
import re
import codecs
impor... |
#********************************************************************************
# *
# TnFOX scons library *
# ... |
from django.contrib.auth.decorators import login_required
from django.core.exceptions import ObjectDoesNotExist, PermissionDenied
from django.core.urlresolvers import reverse
from django.db.models import Count
from django.http import Http404, HttpResponseRedirect, HttpResponse, HttpResponseBadRequest
from django.shortc... |
import logging
from operator import attrgetter
import os
from django.conf import settings
from django.contrib.auth.decorators import login_required, permission_required
from django.core.exceptions import ObjectDoesNotExist, PermissionDenied
from django.core.urlresolvers import reverse
from django.db.models import Coun... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from StringIO import StringIO
from .. import core, funcs
import numpy as np
from ...tests.helper import pytest
import astropy.units as u
try:
import scipy
except ImportError:
HAS_SCIPY = False
else:
HAS_SCIPY = True
def setup_function(functi... |
import copy
import matplotlib.patches as mpatches
from matplotlib.text import Text
from matplotlib.path import Path
from matplotlib.lines import Line2D
from matplotlib.transforms import Affine2D, Bbox, IdentityTransform
from matplotlib.text import Annotation
import numpy as np
from math import cos, sin, pi, atan2
de... |
"""Tornado handlers for the Lab view."""
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
import glob
import json
import os
from tornado import web
from notebook.base.handlers import IPythonHandler, FileFindHandler
from jinja2 import FileSystemLoader
from notebook.u... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
=============
JWST TAP plus
=============
@author: Raul Gutierrez-Sanchez
@contact: raul.gutierrez@sciops.esa.int
European Space Astronomy Centre (ESAC)
European Space Agency (ESA)
Created on 24 oct. 2018
"""
import unittest
import os
import pytes... |
class SimpleNumber:
def __init__(self, num):
val = self.is_number(num)
self.x = val
def is_number(self, x):
try:
val = float(x)
except ValueError:
print("That's not a float number!")
return val
def add(self, y):
... |
import alltheitems.__main__ as ati
import bottle
import contextlib
import itertools
import json
import pathlib
import re
import xml.sax.saxutils
import alltheitems.item
import alltheitems.world
class FillLevel:
def __init__(self, stack_size, total_items, max_slots):
self.stack_size = stack_size
s... |
#!/usr/bin/env python2.5
#
# Copyright 2011 the Melange 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 applic... |
from flask import Flask, session, request, send_from_directory, jsonify, \
render_template, url_for, redirect
from helpers import make_json_response
from flask_oauth import OAuth
from simplekv.fs import FilesystemStore
from flaskext.kvsession import KVSessionExtension
from flaskext.coffee import coffee
from models ... |
#-*- coding:utf-8 -*-
from flask import Flask, request
from kakaoplus import KaKaoAgent
app = Flask(__name__)
KaKao = KaKaoAgent()
@app.route('/', methods=['GET','POST'])
def app_start():
return "App launched Success"
@app.route('/keyboard', methods=['GET'])
def keyboard_handler():
return KaKao.handle_key... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Jul 4 12:32:53 2017
@author: wroscoe
"""
import os
import time
import json
import datetime
import random
from PIL import Image
import numpy as np
class Tub():
"""
A datastore to store sensor data in a key, value format.
... |
# -*- coding: utf-8 -*-
from . import Page, URL, extract_text, build_user
from bs4.element import Tag
import re
class KeywordPage(Page):
def __init__(self, keyword_id, data):
self.keyword_id = keyword_id
super(KeywordPage, self).__init__('%s/keyword/%s' % (URL, keyword_id, ), data)
@property
... |
from vsvlandb import app, dbo
from vsvlandb.models import VLAN, Subnet, Site
from flask import redirect, request, render_template, url_for, flash
import re
# Root/Index
@app.route('/')
def index():
data = {
'vlans': VLAN.query.limit(10).all(),
'subnets': Subnet.query.limit(10).all(),
'sites': Site.query.limi... |
# Copyright (c) 2014 Jesse Meek <https://github.com/waigani>
# Copyright (c) 2016 Alvaro Leiva <https://github.com/alvarolm>
# This program is Free Software see LICENSE file for details.
"""
GoRename is a Go gorename plugin for Sublime Text 3.
It depends on the gorename tool being installed:
go get -u golang.org/x/too... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is part of Karesansui Core.
#
# Copyright (C) 2009-2012 HDE, Inc.
#
# 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 restric... |
import re
from .core import Parser, InlineState
from .util import (
escape,
escape_url,
unikey,
)
from .helpers import (
PREVENT_BACKSLASH,
PUNCTUATION,
HTML_TAGNAME,
HTML_ATTRIBUTES,
unescape_char,
parse_link,
parse_link_label,
parse_link_text,
)
PAREN_END_RE = re.compile(r... |
import json
import logging
import traceback
from google.appengine.api import taskqueue
from google.appengine.ext import ndb
from helpers.cache_clearer import CacheClearer
from helpers.firebase.firebase_pusher import FirebasePusher
from helpers.notification_helper import NotificationHelper
from helpers.manipulator_bas... |
#!/usr/bin/env python
#
# Copyright 2011 Hunter Freyer and Michael Kelly
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... |
"""
common/volatility.py
(c) 2015-2017 Marshall Farrier
license http://opensource.org/licenses/MIT
Calculate volatility
"""
from argparse import ArgumentParser
import math
import numpy as np
import pandas as pd
import pandas_datareader as web
class InsufficientData(Exception):
pass
def get(eqdata, window=1,... |
from __future__ import print_function
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
from datetime import datetime
import functools
import logging
import os
import time
import unittest
from freezegun import freeze_time
class FakeTimeIOLoop(object):
def __init__(self, fr... |
import jinja2
from wadl2html.nodes.base import BaseNode
from wadl2html.templates import templates
class MethodNode(BaseNode):
template = templates['method']
def to_html(self):
docs = self.find_first("wadl:doc")
# if the docs arent a <wadl:doc> try a plain <doc>
if docs is None:
... |
##########################################################################
#
# Copyright (c) 2007, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistribu... |
from pecan import request
from elixir import (
Entity, Field, Unicode, UnicodeText, Integer, Interval, Float, Enum,
DateTime, using_options, OneToMany, ManyToOne, OneToOne, entities
)
from draughtcraft.lib.calculations import Calculations
from draughtcraft.lib.units import (UnitConvert, InvalidUnitException,
... |
from flask import Blueprint, flash, redirect, render_template, request, session, \
url_for
from wtforms.fields.html5 import DecimalRangeField
from bson.objectid import ObjectId
from app import logger
from app.mod_budget.form import AddEntryForm, EditBudgetForm
from app.mod_budget.model import Category, CategoryBud... |
import importlib
import os
from fabric.api import local
from fabric.contrib.console import confirm
from fabric.operations import prompt
from fabric.state import output
from fabric.utils import fastprint
from {{project_name}}.settings.local import DATABASES as LOCAL_DB
BASE_DIR = os.path.dirname(__file__)
BASE_DIRENA... |
# -*- coding: utf-8 -*-
#
# Script to highlight low-level instructions in ARM code.
# Automatically comment coprocessor accesses (MRC*/MCR*) with documentation.
#
# Support up to ARMv7-A / ARMv8 processors.
#
# Author: Guillaume Delugré.
#
from idc import *
from idautils import *
global current_arch
SYSTEM_INSN = (
... |
# -*- coding: utf-8 -*-
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.model.document import Document
from frappe.utils.data import nowdate, getdate, cint, add... |
# -*- coding: utf-8 -*-
"""
Root class of node and edge trasnformers (to extract features)
Copyright Xerox(C) 2016 JL. Meunier
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 Foundatio... |
from fabric.api import abort, local, settings
from fabric.contrib.console import confirm
from fabric.context_managers import cd, quiet
from fabric.operations import prompt
import csv
import glob
import os
import re
import enchant
import enchant.checker
import enchant.tokenize
import socket
import conf
TILDE = os.path.... |
#!/usr/bin/env python
#
# Copyright (c) 2012 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... |
# -*- coding: utf-8 -*-
# Copyright (c) 2013-2016, Freja Nordsiek
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# 1. Redistributions of source code must retain the above copyright
# notice,... |
"""
Copyright (c) 2014 Ad Schellevis
part of OPNsense (https://www.opnsense.org/)
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain ... |
import pytest
import responses
from django.test.client import Client
from django.test import TestCase
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
from mc2.controllers.base.models import Controller
from mc2.controllers.base.tests.base import ControllerBaseTestCase
from mc2.co... |
from fabric.api import env, local, run, cd
code_dir = '/vagrant'
def vagrant():
env.user = 'vagrant'
env.hosts = ['127.0.0.1:2222']
result = local('vagrant ssh-config |grep IdentityFile', capture=True)
env.key_filename = result.split()[1]
def install_ruby(version="latest"):
if version is 'latest'... |
import itertools
from typing import Iterable, Tuple
import cv2
import numpy as np
from data import lazy
from data.image import component, component_database, utils
_MAX = 255
_WHITE = [_MAX, _MAX, _MAX]
_THRESHOLD = 5
_SIZES = []
pos = 16
for backwards in range(-1, -11, -1):
for _ in range(0, 8):
_SIZES.append... |
from fabric.api import env, local, run, cd
code_dir = '/vagrant'
default_interpreter = '2.1.7'
def vagrant():
env.user = 'vagrant'
env.hosts = ['127.0.0.1:2222']
result = local('vagrant ssh-config |grep IdentityFile', capture=True)
env.key_filename = result.split()[1]
def install_ruby(version="latest... |
from fabric.api import *
env.hosts = [
'shaperia@lynx.uberspace.de'
]
env.target_directory = './happyman'
def init():
run('git clone -q https://github.com/skyshaper/happyman.git ' + env.target_directory)
with cd(env.target_directory):
run('virtualenv python_virtualenv')
def deploy():
local('... |
#! /usr/bin/env python2
import rospy
from std_msgs.msg import String, Header
from sensor_msgs.msg import Image, CameraInfo
from geometry_msgs.msg import PointStamped, Point
from cv_bridge import CvBridge
import tf
from ieee2016_msgs.srv import CameraSet
import cv2
import numpy as np
import time
import thread
import y... |
#!/usr/bin/env python
import logging
import os.path
import textwrap
from argparse import ArgumentParser
from argparse import RawDescriptionHelpFormatter
import itertools
from random import randint
from time import sleep
from pprint import pprint
import traceback
import sys
import select
import csirtg_smrt.parser
from... |
# =============================================================================
# Copyright (c) 2016, Cisco Systems, Inc
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions ... |
from __future__ import print_function
from __future__ import unicode_literals
import binascii
import codecs
import math
import os
import sqlite3
import subprocess
import sys
from distutils.version import LooseVersion
import pybel
from _decorators import decorate, UnicodeDecorator
from _methods import AbstractMethod
... |
from __future__ import with_statement
import sys
from fabric.api import env
from fabric.api import run
from fabric.api import local
from fabric.api import sudo
from fabric.api import task
from fabric.api import abort
def check_support():
if run("egrep '^flags.*(vmx|svm)' /proc/cpuinfo > /dev/null").failed:
... |
# -*- coding: utf-8 -*-
from __future__ import division
from cea.utilities import helpers
__author__ = "Gabriel Happle"
__copyright__ = "Copyright 2016, Architecture and Building Systems - ETH Zurich"
__credits__ = ["Gabriel Happle"]
__license__ = "MIT"
__version__ = "0.1"
__maintainer__ = "Daren Thomas"
__email__ =... |
import datetime
import unittest
import requests_mock
import settings
from pycanvas import Canvas
from pycanvas.account import Account, AccountNotification, AccountReport
from pycanvas.role import Role
from pycanvas.course import Course
from pycanvas.exceptions import RequiredFieldMissing
from pycanvas.user import Use... |
# coding=utf-8
import requests
from lxml import html
from metacrawler.items import Item
class Crawler(object):
"""Crawler parse page use items as rules. May be nested."""
def __init__(self, url=None, items=None, crawlers=None, session=None):
"""Override initialization instance.
:param url... |
from .base_gan import BaseGAN
from hyperchamber import Config
from hypergan.discriminators import *
from hypergan.distributions import *
from hypergan.gan_component import ValidationException, GANComponent
from hypergan.generators import *
from hypergan.inputs import *
from hypergan.layer_shape import LayerShape
from h... |
from typing import List, Tuple, Optional
import pytest
import eagerpy as ep
import foolbox as fbn
import foolbox.attacks as fa
from foolbox.gradient_estimators import es_gradient_estimator
L2 = fbn.types.L2
Linf = fbn.types.Linf
FGSM_GE = es_gradient_estimator(
fa.FGSM, samples=100, sigma=0.03, bounds=(0, 1), c... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from fabric.api import *
from fabric.colors import green, red
import datetime
import yaml
import subprocess, shlex, atexit, time
import os.path
import re
settings = 0
current_config = 'unknown'
env.forward_agent = True
env.use_shell = False
class SSHTunnel:
def __init... |
from armstrong.dev.tasks import *
settings = {
'DEBUG': True,
'INSTALLED_APPS': (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'armstrong.core.arm_access',
'armstrong.cor... |
"""MGZ Summary."""
import asyncio
import hashlib
import logging
import os
import struct
import tempfile
import time
import zlib
import construct
import mgz
import mgz.body
from mgz import fast
from mgz.util import Version
from mgz.const import VALID_BUILDINGS
from mgz.summary.map import get_map_data
from mgz.summar... |
from __future__ import print_function
import numpy as np
from numpy.testing import (verbose, TestCase, run_module_suite, assert_,
assert_raises, assert_array_equal, assert_equal, assert_almost_equal,
assert_allclose, assert_array_almost_equal)
from numpy.testing.decorators import skipif
import math
from... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.