src stringlengths 721 1.04M |
|---|
import os
from PIL import Image
img_path = '/home/palm/deep/helen/train'
lab_path = '/home/palm/deep/helen/annotation'
filename = '/home/palm/deep/helen/trainnames.txt'
f = open(filename)
index = 1
for each in f:
each = each.strip()
img_file = os.path.join(img_path, each + '.jpg')
img = Image.open(img_fi... |
#!/usr/bin/python3
# encoding: utf-8
"""
@author: Eric Wong
@license: MIT Licence
@contact: ericwong@zju.edu.cn
@file: main.py
@time: 2016-06-09 18:40
"""
import sys
DEBUG = 0
if DEBUG:
handler = open("./input")
else:
handler = sys.stdin
cases = int(handler.readline())
MOD = 1000000007
... |
# -*- coding: utf-8 -*-
from flask import render_template, redirect, request, url_for, flash
from flask.ext.login import login_user, logout_user, login_required, current_user
from . import auth
from ..models import User
from .forms import RegisterForm, EditForm, ChangePasswdForm
from .. import db
@auth.route('/lo... |
# Copyright 2019 Google LLC
#
# 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, ... |
"""
Check that view authentication works properly.
"""
import datetime
import pytz
from django.urls import reverse
from mock import patch
from six import text_type
from six.moves import range
from lms.djangoapps.courseware.access import has_access
from lms.djangoapps.courseware.tests.factories import (
BetaTest... |
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function)
from mantid.api import (mtd)
from mantid.simpleapi import (CloneWorkspace)
import numpy.testing
from testhelpers import illhelpers, run_algorithm
import unittest
class DirectILLApplySelfShieldingTest(unittest.TestCase):
_B... |
'''
Created on Nov 10, 2008
@author: nickmilon
Defines some very simple classes and methods
'''
# keep this simple no imports allowed in this module
class Error(Exception):
pass
class DotDot(dict):
""" A dictionary with dot notation
example dd=DotDot()
dd.a=1
dd.a ==>> 1
"""
... |
# This file is part of Orthosie.
#
# Orthosie is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Orthosie is distrib... |
from constants import *
class PvListQueryBuilderBase:
"""
@param utbs:[Utb]
"""
def __init__(self,utbs):
self.utbs=utbs
self.cons=cons
def usesIstat(self):
b=False
for u in self.utbs:
b=b or u.usesIstat()
return b
def usesCap(self):
b=False
for u in self.utbs:
b=b or u.usesCap()
return... |
"""Interfacing to MongoDB
MongoDB is used as a data backend within the DAQ. For example, 'kodiaq', which
reads out the digitizers, will write data to MongoDB. This data from kodiaq can
either be triggered or untriggered. In the case of untriggered, an event builder
must be run on the data and will result in triggere... |
import re
import urllib.request
#import os
#import http.server
#import http.client
#from urllib.error import URLError, HTTPError
#import urllib.parse
KernelAddrs = []
def UrlOpen(url):
req = urllib.request.Request(url)
key = 'User-agent'
val = 'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:50.0) Gecko/20100... |
# Sebastian Raschka 2015
# mlxtend Machine Learning Library Extensions
import numpy as np
def iris_data():
"""Iris flower dataset.
Returns
--------
X, y : [n_samples, n_features], [n_class_labels]
X is the feature matrix with 150 flower samples as rows,
and the 3 feature columns sepal len... |
''' DowntimeCommand module
'''
import urllib2
from datetime import datetime, timedelta
from operator import itemgetter
from DIRAC import S_OK, S_ERROR
from DIRAC.Core.LCG.GOCDBClient import GOCDBClient
from DIRAC.Core.Utilities.Site... |
# -*- coding: utf-8 -*-
##
##
## This file is part of Indico.
## Copyright (C) 2002 - 2014 European Organization for Nuclear Research (CERN).
##
## Indico is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; eith... |
'''
cdrContext provides the validation and execution context for CDR Formula language expressions.
(c) Copyright 2013 Mark V Systems Limited, California US, All rights reserved.
'''
from collections import OrderedDict
from .cdrParser import astNode
from arelle.ModelFormulaObject import aspectModels, Aspect, aspectS... |
# (c) 2014, Chris Church <chris@ninemoreminutes.com>
# Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = """
author: Ansible Core Te... |
#!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
from pathlib import Path
AUTHOR = u'Python Group'
SITENAME = u'Python Group UEA'
SITEURL = ''
PATH = 'content'
STATIC_PATHS = ['extra', 'extra/robots.txt', 'pdfs', 'figures',
'extra/favicon.ico', 'extra/custom.css'... |
"""Tornado handlers for kernel specifications.
Preliminary documentation at https://github.com/ipython/ipython/wiki/IPEP-25%3A-Registry-of-installed-kernels#rest-api
"""
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
import glob
import json
import os
pjoin = os.p... |
import uncertainties
from uncertainties import ufloat
import math
import numpy
import numpy
import pylab
from scipy.optimize import curve_fit
import math
import scipy.stats
import uncertainties
from uncertainties import unumpy
import numpy as np
from scipy.signal import argrelextrema
def linear(x, b):
return b
#Pre... |
"""
Copyright (c) 2017, Jairus Martin.
Distributed under the terms of the MIT License.
The full license is in the file LICENSE, distributed with this software.
Created on Mar 17, 2018
@author: jrm
"""
from atom.api import (
Typed, ForwardTyped, Str, Float, Coerced, Bool, Enum, observe,
)
from enaml.core.declar... |
# Copyright (C) 2012 Red Hat, Inc.
#
# 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 version.
#
# This program is distribu... |
"""Added a table for duel stats
Revision ID: 3841cd597e
Revises: d5f1b8bd68
Create Date: 2015-12-02 00:12:07.548855
"""
# revision identifiers, used by Alembic.
revision = '3841cd597e'
down_revision = 'd5f1b8bd68'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def upgrade():... |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
# Copyright (c) 2011 Zadara Storage Inc.
# Copyright (c) 2011 OpenStack Foundation
#
# 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-... |
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import codecs
import os
import re
import csv
import os
#import census
from us import states
from collections import defaultdict
from pandas import *
from math import floor
from itertools import islice
from pylab import figure, show, savefig
from pyl... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2013 Kai Kratzer, Stuttgart, Germany; all rights
# reserved unless otherwise stated.
#
# 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; ... |
#! /usr/bin/python3
#
# This source code is part of icgc, an ICGC processing pipeline.
#
# Icgc is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later ... |
# -*- coding: utf-8 -*-
"""
Copyright 2015 Zalando SE
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 ... |
#
# Copyright 2012 Sonya Huang
#
# 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... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 NXEZ.COM.
# http://www.nxez.com
#
# Licensed under the GNU General Public 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.gnu.org/licen... |
import subprocess
import glob
import sys
sys.path.append('../')
import constants_and_names as cn
def s3_folder_download(source, dest):
cmd = ['aws', 's3', 'cp', source, dest, '--recursive']
subprocess.check_call(cmd)
def s3_file_download(source, dest):
cmd = ['aws', 's3', 'cp', source, dest]
subproces... |
#! /usr/bin/env python
from __future__ import print_function
import argparse
import cgi
from textwrap import dedent
from urllib import urlencode
import sys
from txcas.constants import (
VIEW_LOGIN,
VIEW_LOGIN_SUCCESS,
VIEW_LOGOUT,
VIEW_INVALID_SERVICE,
VIEW_ERROR_5XX,
VIEW_NOT_FOUND)
from tx... |
#!/usr/bin/env python
#
# Copyright 2012 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... |
# coding=utf-8
"""Model class for flood realtime."""
from builtins import object
from django.contrib.gis.db import models
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext_lazy as _
from realtime.models.mixins import BaseEventModel
from realtime.models.report import BaseEventR... |
from pathlib import Path
from subprocess import CompletedProcess
from unittest import mock, skipUnless
from django.db import connection
from django.db.backends.sqlite3.client import DatabaseClient
from django.test import SimpleTestCase
@skipUnless(connection.vendor == 'sqlite', 'SQLite tests.')
class SqliteDbshellCo... |
#!/usr/bin/env python
# Copyright 2014-2020 The PySCF Developers. 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
#
# U... |
# -*- coding: utf-8 -*-
"""Helper utilities and decorators."""
from datetime import timedelta as td
from datetime import tzinfo
from threading import Thread
import requests
from flask import Blueprint, current_app, flash, request
def get_fb_access_token():
"""Get an access token from facebook for graph API calls... |
import fuse
class fs45gStat(fuse.Stat):
def __init__(self):
self.st_mode = 0
self.st_ino = 0
self.st_dev = 0
self.st_nlink = 0
self.st_uid = 0
self.st_gid = 0
self.st_size = 0
self.st_atime = 0
self.st_mtime = 0
self.st_ctime = 0
class fs45gROStat(fs45gStat):
def __init__(self, clone, uid, gid):... |
#!/usr/bin/python
"""
Copyright 2013 matt.proud@gmail.com (Matt T. Proud)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicabl... |
# -*- coding: utf-8 -*-
from rest_framework import serializers
from . import models
class ReportAssignmentAcceptSerializer(serializers.Serializer):
reference_id = serializers.CharField()
comment = serializers.CharField(required=False)
created_at = serializers.DateTimeField()
def restore_object(self... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import re
import uuid
_INVISIBLE_CHARS = (
'\u200b',
'\u200c',
'\u200d',
'\ufeff',
)
_INVISIBLE_MAP = dict(zip(
'0123456789abcdef',
(''.join((i, j)) for i in _INVISIBLE_CHARS for j in _INVISIBLE_CHARS),
))
_INVISIBLE_REVERSE_MAP = ... |
'''
Some code is taken from django:
Copyright (c) Django Software Foundation and individual contributors.
All rights reserved.
'''
import os
import re
import itertools
__all__ = ['Filehandler']
def skipfile(name):
return name.startswith('.') or name.startswith('_')
def directory(dir):
bd, fname =... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author: caktux
# @Date: 2015-02-23 15:02:59
# @Last Modified by: caktux
# @Last Modified time: 2015-03-09 18:07:51
import factory
reload(factory)
from factory import *
import go_ethereum
reload(go_ethereum)
from go_ethereum import *
def brew_go_factory(branch='de... |
# -*- coding: utf-8 -*-
"""
chemdataextractor.scrape.csstranslator
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Extend cssselect to improve handling of pseudo-elements.
This is derived from csstranslator.py in the Scrapy project. The original file is available at:
https://github.com/scrapy/scrapy/blob/master/scrapy/selecto... |
from bolt.discord.models.base import Snowflake, Model, Field, ListField, Enum, Timestamp
from bolt.discord.models.user import User
from bolt.discord.permissions import Permission
class ChannelType(Enum):
GUILD_TEXT = 0
DM = 1
GUILD_VOICE = 2
GROUP_DM = 3
GUILD_CATEGORY = 4
class PermissionOverwr... |
# -*- coding: utf-8 -*-
__author__ = 'chinfeng'
from unittest import TestCase
import jbmongo
import random
class JBMongoTestCase(TestCase):
def setUp(self):
# 我们首先有一个数据库,这个数据库是关联上下文的关键,命名为 Context
self._dbc = jbmongo.DBContext()
def test_coll_definition(self):
dbc = self._dbc
... |
import unittest
import utils
from tree import TreeNode
# O(n) time. O(log(n)) space. In-order DFS.
class Solution:
def lowestCommonAncestor(self, root: 'TreeNode', p: 'TreeNode', q: 'TreeNode') -> 'TreeNode':
def dfs(curr):
if not curr:
return None, 0
ancestor, nu... |
# -*- coding: utf-8 -*-
# This file is part of Shoop.
#
# Copyright (c) 2012-2016, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
import json
import pytest
from shoop.testing.factories import (
create... |
from AppKit import NSColor, NSObject
from mojo.extensions import getExtensionDefault, setExtensionDefault, getExtensionDefaultColor, setExtensionDefaultColor
_baseDefaultKey = "com.typemytype.ramsaySt"
_fillColorDefaultKey = "%s.fillColor" % _baseDefaultKey
_strokeColorDefaultKey = "%s.strokeColor" %_baseDefaultKey
_s... |
#!/usr/bin/python
IN_ORDER = 'T, b, H, V, h, 3, o, g, P, W, F, L, u, A, f, G, r, m, 1, x, J, 7, w, e, 0, i, Q, Y, n, Z, 8, K, v, q, k, 9, y, 5, C, N, B, D, 2, 4, U, l, c, p, I, E, M, a, j, 6, S, R, O, X, s, d, z, t'
POST_ORDER = 'T, V, H, o, 3, h, P, g, b, F, f, A, u, m, r, 7, J, x, e, w, 1, Y, Q, i, 0, Z, n, G, L, K,... |
"""Multiprocessing ready entry points for sample analysis.
"""
from bcbio import heterogeneity, hla, structural, utils, chipseq, upload
from bcbio.bam import callable
from bcbio.srna import sample as srna
from bcbio.srna import group as seqcluster
from bcbio.chipseq import peaks
from bcbio.cwl import create as cwl_crea... |
template = {
'errorErrno': {
'variables': 'Condition="ret<0" Activity=sioxActivity',
'afterFirst': ''' int errsv = errno;''',
'after': '''
if ( %(Condition)s ){
siox_activity_report_error( %(Activity)s, translateErrnoToSIOX(errsv) );
... |
# -*- coding: utf-8 -*-
# Copyright(C) 2010-2011 Romain Bignon, Julien Hébert
#
# This file is part of weboob.
#
# weboob 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 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
import re
from spack import *
from spack.package_test import compare_output_file, compile_c_and_execute
class... |
import sys
from kivy.uix.label import Label
from kivy.properties import NumericProperty, ListProperty, ObjectProperty
from kivy.uix.popup import Popup
from .vvhelix import VVHelix
from kivy.graphics.vertex_instructions import (Line, Ellipse)
from kivy.graphics.context_instructions import Color
from math import sin, c... |
########################################################################
# File: ReplicateAndRegister.py
# Author: Krzysztof.Ciba@NOSPAMgmail.com
# Date: 2013/03/13 18:49:12
########################################################################
""" :mod: ReplicateAndRegister
==========================
.. mo... |
# coding=utf-8
# author@alingse
# 2015.10.09
import json
import unicodecsv as csv
import xlwt
class Dump(object):
def __init__(self, fin, fout, **kwargs):
self.fin = fin
self.fout = fout
self.initialize(**kwargs)
def initialize(self, **kwargs):
pass
def prepare(self):
... |
"""Support for monitoring a Smappee energy sensor."""
from datetime import timedelta
import logging
from homeassistant.const import ENERGY_KILO_WATT_HOUR, POWER_WATT
from homeassistant.helpers.entity import Entity
from . import DATA_SMAPPEE
_LOGGER = logging.getLogger(__name__)
SENSOR_PREFIX = "Smappee"
SENSOR_TYPE... |
#!/usr/bin/env -S python3 -u
import os
import pathlib
import sys
WATCHEXEC_VAR_COMMON = "WATCHEXEC_COMMON_PATH"
WATCHEXEC_VARS = [
"WATCHEXEC_CREATED_PATH",
"WATCHEXEC_REMOVED_PATH",
"WATCHEXEC_RENAMED_PATH",
"WATCHEXEC_WRITTEN_PATH",
"WATCHEXEC_META_CHANGED_PATH",
]
def die(message):
print... |
# -*- coding: utf-8 -*-
"""
* Purpose : allgemeine Hilfsfunktionen
* Creation Date : 23-11-2014
* Last Modified : Do 05 Mär 2015 13:03:04 CET
* Author : christian
* Coauthors : mattis, ingo, Kirill
* Sprintnumber : -
* Backlog entry : -
"""
import simplejson as json
import zipfile
import os
import mimetypes
i... |
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Kallisto(CMakePackage):
"""kallisto is a program for quantifying abundances of transcripts... |
# This file is part of Merlin.
# Merlin is the Copyright (C)2008,2009,2010 of Robin K. Hansen, Elliot Rosemarine, Andreas Jacobsen.
# Individual portions may be copyright by individual contributors, and
# are included in this collective work with permission of the copyright
# owners.
# This program is free software; ... |
"""
FOTLOperators
Copyright (C) 2014 Walid Benghabrit
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distribu... |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Helper for other scripts that need a PYTHONPATH entry for crostools.
Generally used by import statements of the form:
from chromite.lib.paygen i... |
#!/usr/bin/env python
# SPDX-License-Identifier: MIT
import auracle_test
class TestRegexSearch(auracle_test.TestCase):
def testFragmentTooShort(self):
r = self.Auracle(['search', 'f'])
self.assertNotEqual(0, r.process.returncode)
self.assertIn('insufficient for searching by regular expres... |
import sys
try:
from django.conf import settings
settings.configure(
DEBUG=True,
USE_TZ=True,
DATABASES={
"default": {
"ENGINE": "django.db.backends.sqlite3",
}
},
ROOT_URLCONF="dedal.urls",
INSTALLED_APPS=[
"d... |
import imdb
import json
import os
import logging
from logging.handlers import RotatingFileHandler
from urllib.parse import urlparse
from flask import (
Flask,
redirect,
make_response,
request,
send_from_directory,
render_template
)
import psycopg2.extras
url = urlparse(os.environ.get('IMDB_DB... |
r"""
Util functions (:mod: `qiita_db.meta_util`)
===========================================
..currentmodule:: qiita_db.meta_util
This module provides utility functions that use the ORM objects. ORM objects
CANNOT import from this file.
Methods
-------
..autosummary::
:toctree: generated/
get_accessible_fi... |
"""Provides factories for student models."""
from __future__ import absolute_import
from datetime import datetime
from uuid import uuid4
import factory
import six
from django.contrib.auth.models import AnonymousUser, Group, Permission
from django.contrib.contenttypes.models import ContentType
from factory.django imp... |
# -*- coding: utf-8 -*-
#!/usr/bin/python
#
# This is derived from a cadquery script for generating PDIP models in X3D format
#
# from https://bitbucket.org/hyOzd/freecad-macros
# author hyOzd
# This is a
# Dimensions are from Microchips Packaging Specification document:
# DS00000049BY. Body drawing is the same as QFP ... |
#!/usr/bin/env python2
# vim:fileencoding=utf-8
# License: GPLv3 Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>
from __future__ import (unicode_literals, division, absolute_import,
print_function)
import unittest, functools, os, importlib, zipfile
from calibre.utils.monotonic import mon... |
"""
WSGI config for gdg_pizza project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`... |
# Copyright (c) 2006, The Regents of the University of California, through
# Lawrence Berkeley National Laboratory (subject to receipt of any required
# approvals from the U.S. Dept. of Energy). All rights reserved.
# This software is distributed under the new BSD Open Source License.
# <http://www.opensource.... |
#!/usr/bin/env python
# PYTHON_ARGCOMPLETE_OK
"""Launches the MDT maps visualizer."""
import argparse
import os
import textwrap
from argcomplete.completers import FilesCompleter
from mdt import view_maps
from mdt.visualization.maps.base import SimpleDataInfo
from mdt.lib.shell_utils import BasicShellApplication
__auth... |
from __future__ import unicode_literals
import sys
import threading
import time
from unittest import skipIf, skipUnless
from django.db import (
DatabaseError, Error, IntegrityError, OperationalError, connection,
transaction,
)
from django.test import (
TransactionTestCase, skipIfDBFeature, ski... |
from selenium import webdriver
from fixture.session import SessionHelper
from fixture.group import GroupHelper
from fixture.users import UsersHelper
class Application:
def __init__(self, browser, base_url):
if browser == "firefox":
self.wd = webdriver.Firefox()
elif browser == "chrome... |
#
# Copyright (C) 2017 Rafał Michaluk
# Copyright (C) 2017 Dominik Murzynowski
#
# This software may be modified and distributed under the terms
# of the MIT license. See the LICENSE file for details.
#
import time
from pycnic.core import Handler
from pycnic.utils import requires_validation
from voluptuous import Sch... |
# Copyright 2018 Datawire. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... |
from __future__ import print_function
import os
from operator import itemgetter
from crm114 import Classifier
def index(req):
data_path = '%s%s%s' % (os.path.dirname(__file__), os.sep, 'data')
categories = ['good', 'bad']
print('Initializing classifier')
print('- Categories: %s' % ', '.join(categori... |
# This file is part of Cannen, a collaborative music player.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This ... |
"""
XEP-0009 XMPP Remote Procedure Calls
"""
from __future__ import with_statement
import base
import logging
from xml.etree import cElementTree as ET
import copy
import time
import base64
def py2xml(*args):
params = ET.Element("params")
for x in args:
param = ET.Element("param")
param.append(_py2... |
#
# ovirt-engine-setup -- ovirt engine setup
# Copyright (C) 2014-2015 Red Hat, 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
#
# Unl... |
"""
Record and replay mouse and keyboard actions in VirtualBox sessions
Usage:
python rondo.py [--r record_log_file] [--p replay_log_file] virtual_machine_name
"""
import time
import datetime
import logging
import argparse
import virtualbox
logging.basicConfig(level=logging.INFO)
f = None
last_reco... |
# MIT License, see LICENSE
# Copyright (c) 2018 Clusterone Inc.
# Author: Adrian Yi, adrian@clusterone.com
from __future__ import print_function
import json
import os
from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter
import tensorflow as tf
from clusterone import get_data_path, get_logs_path
from u... |
# Copyright (C) 2014-2015 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2014-2015 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2015 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2015 Anler Hernández <hello@anler.me>
# This program is free software: you can redistribute it and/or modify
# it under ... |
# (c) 2014, James Tanner <tanner.jc@gmail.com>
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed i... |
"""
Support for Vera devices.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/vera/
"""
import logging
from collections import defaultdict
from requests.exceptions import RequestException
from homeassistant import bootstrap
from homeassistant.const imp... |
# -*- coding: utf-8 -*-
#!/usr/bin/python
#
# This is derived from a cadquery script for generating PDIP models in X3D format
#
# from https://bitbucket.org/hyOzd/freecad-macros
# author hyOzd
# This is a
# Dimensions are from Microchips Packaging Specification document:
# DS00000049BY. Body drawing is the same as QFP ... |
##
# Copyright (c) 2014-2017 Apple Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... |
# -*- coding: utf-8 -*-
# Automatic provisioning of AWS VPC route.
import boto3
import botocore
import nixops.util
import nixops.resources
from nixops.resources.ec2_common import EC2CommonState
import nixops.ec2_utils
from nixops.diff import Diff, Handler
from nixops.state import StateDict
class VPCRouteDefinition(... |
from django.shortcuts import render_to_response, get_object_or_404
from django.template import RequestContext
from django.core.paginator import Paginator
from django.http import HttpResponse, HttpResponseRedirect
from urllib import unquote
from haystack.query import SearchQuerySet
from mail.models import *
from django.... |
# -*- coding: utf-8 -*-
# pylint: disable-msg= E1002, E1101
"""
Created on Wed Nov 21 09:04:17 2012
This file contains the definition of a set of very simple abstraction patterns
in order to perform rhythm interpretation on an ECG signal.
@author: T. Teijeiro
"""
import copy
import construe.knowledge.observables as ... |
import os, sys, argparse
import datetime as dt
import threading
from functools import wraps
def _caffeinate():
os.system('caffeinate')
def caffeinate(fn):
@wraps(fn)
def wrapper(*args, **kwargs):
if sys.platform == 'darwin':
thrd = threading.Thread(target = _caffeinate, args = ())
... |
"""
* Representation functions
*
* Copyright (C) 2016-2017
* Edgar Costa (edgarcosta@math.dartmouth.edu)
* Davide Lombardo (davide.lombardo@math.u-psud.fr)
* Jeroen Sijsling (jeroen.sijsling@uni-ulm.de)
*
* See LICENSE.txt for license details.
"""
from sage.all import... |
# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Denis Engemann <denis.engemann@gmail.com>
# Martin Luessi <mluessi@nmr.mgh.harvard.edu>
# Eric Larson <larson.eric.d@gmail.com>
# Jaakko Leppakangas <jaeilepp@student.jyu.fi>
#
# License: Simplified BSD
import... |
# This file is part of ArcJail.
#
# ArcJail is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# ArcJail is distributed in the hope that... |
# (c) Copyright 2013 Hewlett-Packard Development Company, L.P.
# All Rights Reserved.
#
# Copyright 2012 OpenStack Foundation
#
# 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/env python
# -- coding:utf-8 --
import os, re, sys, time, datetime
import urllib,urllib2,threading,requests
from bs4 import BeautifulSoup
downurls = []
threads=[]
f=open('log.txt', 'w+')
class downloader(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
self.info=[... |
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Copyright (c) 2017 The UltimateOnlineCash Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the importmulti RPC."""
from test_fram... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.