content string |
|---|
##########################################################################
# Ganga Project. http://cern.ch/ganga
#
# $Id: GPIexport.py,v 1.1 2008-07-17 16:41:00 moscicki Exp $
##########################################################################
""" Utility for exporting symbols to GPI.
"""
# all public GPI na... |
#!/usr/bin/python2
# -*- coding: latin-1 -*-
"""
pubmed.py
PubMed handling functions.
This module gets publication data from a PubMed identifier, relying heavily on the doi.py module.
This module is a simple parser for the NCBI ID converter API:
http://www.ncbi.nlm.nih.gov/pmc/tools/id-converter-api/
using their web ... |
from setuptools import setup, find_packages
import sys
import os
import glob
import configparser
import re
conf = []
templates = []
long_description = '''EasyEngine is the commandline tool to manage your
Websites based on WordPress and Nginx with easy to use
commands'''
fo... |
"""
Yammer OAuth2 support
"""
import logging
from urllib import urlencode
from urlparse import parse_qs
from django.utils import simplejson
from django.utils.datastructures import MergeDict
from social_auth.backends import BaseOAuth2, OAuthBackend, USERNAME
from social_auth.backends.exceptions import AuthCanceled
fro... |
import _plotly_utils.basevalidators
class FontValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(
self, plotly_name="font", parent_name="barpolar.marker.colorbar.title", **kwargs
):
super(FontValidator, self).__init__(
plotly_name=plotly_name,
paren... |
from odoo import api, fields, models
class ResCompany(models.Model):
_inherit = 'res.company'
payment_acquirer_onboarding_state = fields.Selection([('not_done', "Not done"), ('just_done', "Just done"), ('done', "Done")], string="State of the onboarding payment acquirer step", default='not_done')
# YTI FI... |
"""Tests for sgf_properties.py."""
import unittest
from textwrap import dedent
from betago.gosgf import sgf_properties
class SgfPropertiesTestCase(unittest.TestCase):
def test_interpret_simpletext(self):
def interpret(s, encoding):
context = sgf_properties._Context(19, encoding)
... |
import pytest
import numpy as np
import pandas.util.testing as tm
from pandas.core.indexes.api import Index, MultiIndex
from pandas.compat import lzip
@pytest.fixture(params=[tm.makeUnicodeIndex(100),
tm.makeStringIndex(100),
tm.makeDateIndex(100),
... |
#!/usr/bin/env python
# vim:ts=4:sw=4:et:
try:
from setuptools import setup, Extension
except:
from distutils.core import setup, Extension
setup(
name = 'pywatchman',
version = '1.4.1',
description = 'Watchman client for python',
author = 'Wez Furlong, Siddharth Agarwal',
author_email = '<... |
from tkinter import *
from math import *
import random
import constantes
import pac
#### ATTRIBUTS
direction = constantes.DROITE
caseX = 8
caseY = 9
x = caseX*constantes.tailleTile
y = caseY*constantes.tailleTile
caseXAvant = caseX #servent a voir si la matrice doit changer
caseYAvant = caseY
typeDeCaseAvant = 0 ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Command-line wrapper for the tracetool machinery.
"""
__author__ = "Lluís Vilanova <<EMAIL>>"
__copyright__ = "Copyright 2012-2014, Lluís Vilanova <<EMAIL>>"
__license__ = "GPL version 2 or (at your option) any later version"
__maintainer__ = "Stefan Hajnoczi... |
from __future__ import print_function
import os
import sys
from os.path import dirname, abspath
import subprocess
from scripts.lib.zulip_tools import run, ENDC, WARNING
from scripts.lib.hash_reqs import expand_reqs
ZULIP_PATH = dirname(dirname(dirname(abspath(__file__))))
VENV_CACHE_PATH = "/srv/zulip-venv-cache"
if... |
""" A model of an Infrastructure Cluster in CFME
"""
import attr
from navmazing import NavigateToSibling, NavigateToAttribute
from widgetastic.widget import View
from widgetastic_patternfly import Button, Dropdown
from cfme.base.login import BaseLoggedInPage
from cfme.common import WidgetasticTaggable
from cfme.confi... |
#!/usr/bin/env python
import matplotlib.pyplot as plt
import numpy as np
import math
# Import stuff for working with dates
from datetime import datetime
from matplotlib.dates import date2num
# git checkout `git rev-list -n 1 --before="$my_date" master`
# cloc.pl src/*/*.C include/*/*.h
data = [
# 2003 - All data fro... |
from biicode.server.test.store.mongo_test import TestWithMongo
from biicode.test.remote.testing_mongo_store import TestingMongoStore
from biicode.server.user.oauth import OAuthService, generate_state_string
from biicode.server.model.user import User
class MockOAuthManager(object):
def __init__(self, provider, br... |
"""
tests.test_logger
~~~~~~~~~~~~~~~~~~
Tests logger component.
"""
from collections import namedtuple
import logging
import unittest
from homeassistant.components import logger
RECORD = namedtuple('record', ('name', 'levelno'))
class TestUpdater(unittest.TestCase):
""" Test logger component. """
def set... |
import os.path as op
from ...utils import verbose
from ...fixes import partial
from ..utils import (has_dataset, _data_path, _get_version, _version_doc,
_data_path_doc)
has_brainstorm_data = partial(has_dataset, name='brainstorm')
_description = u"""
URL: http://neuroimage.usc.edu/brainstorm/Dat... |
import cStringIO
import mock
from sarlacc.tests.asterisk.agi import test
class TestCase(test.TestCase):
@mock.patch('sys.stdin', cStringIO.StringIO("200 result=-2"))
def test_execute_failure(self):
with mock.patch(
'sys.stdout', new_callable=cStringIO.StringIO) as mock_stdout:
... |
"""Test utilities."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import functools
import io
import itertools
import threading
from absl import app
from tensorflow.python.compat import v2_compat
from tensorflow.python.distribute import collective_all_... |
import datetime
import json
import logging
import sys
from lib.bucket import BUCKET_ID, COMMITTED
from lib.pageframe import PFNCounts
from lib.policy import PolicySet
from lib.subcommand import SubCommand
LOGGER = logging.getLogger('dmprof')
class PolicyCommands(SubCommand):
def __init__(self, command):
supe... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""auditing for hiicart, relies on sentry (probably)"""
import inspect
import logging
from django.views.debug import ExceptionReporter
try:
from sentry.client.models import get_client
except ImportError:
print "You must be using django-sentry to use hiicart audit... |
"""
A simple command-line interface for Mininet.
The Mininet CLI provides a simple control console which
makes it easy to talk to nodes. For example, the command
mininet> h27 ifconfig
runs 'ifconfig' on host h27.
Having a single console rather than, for example, an xterm for each
node is particularly convenient for... |
import asyncio
import os
import signal
import threading
import traceback
import sys
import cloudbot
#if cloudbot.dev_mode.get("pympler", False):
try:
import pympler
import pympler.muppy
import pympler.summary
import pympler.tracker
except ImportError:
pympler = None
try:
import objgraph
except... |
import logging
import ckan.plugins.toolkit as toolkit
from ckan.logic.converters import convert_user_name_or_id_to_id
import ckan.lib.navl.dictization_functions
from ckanext.project.logic.schema import project_package_association_delete_schema, project_admin_remove_schema
from ckanext.project.model import projectPac... |
from os import path
from setuptools import setup, find_packages
#this should hopefully allow us to have a more pypi friendly, always up to date readme
readMeDir = path.abspath(path.dirname(__file__))
with open(path.join(readMeDir, 'README.md'), encoding='utf-8') as readFile:
long_desc = readFile.read()
VERSION ... |
from __future__ import absolute_import
import tempfile
import shutil
from shapely.geometry import Point
from geopandas import GeoDataFrame, read_file
from geopandas.tools import sjoin
from .util import unittest, download_nybb
class TestSpatialJoin(unittest.TestCase):
def setUp(self):
nybb_filename = down... |
"""
This is a simple script to list all the songs in your database.
"""
import HaloRadio
import HaloRadio.Song as Song
import HaloRadio.SongListMaker as SongListMaker
sl=SongListMaker.SongListMaker()
sl.GetAll()
for id in sl.list:
s=Song.Song(id)
print "%d | %s" % ( s.id, s.GetDisplayName() )
print "%d records li... |
"""Sensor platform for Advantage Air integration."""
import voluptuous as vol
from homeassistant.components.sensor import SensorEntity
from homeassistant.const import PERCENTAGE
from homeassistant.helpers import config_validation as cv, entity_platform
from .const import ADVANTAGE_AIR_STATE_OPEN, DOMAIN as ADVANTAGE_... |
# coding=utf-8
"""
InaSAFE Disaster risk assessment tool developed by AusAid -
**Import Dialog.**
Contact : <EMAIL>
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2... |
#encoding:utf-8
import paramiko
import getpass
def ssh_excute(host,username,password,cmd=[],port=22):
_rt_list = []
#创建连接对象
ssh = paramiko.SSHClient()
#设置客户端登陆验证方式
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
#设置连接服务器信息
ssh.connect(host, 22, username,password)
for _cmd in... |
import os
import matplotlib.pyplot as plt
import tables
from matplotlib.colors import LogNorm
SEED_NUMBERS = '231360773_763934896'
DATA_PATH = '/Users/arne/Datastore/CORSIKA'
DATA_FILE = os.path.join(DATA_PATH, SEED_NUMBERS, 'corsika.h5')
QUERY_DETECTABLE = ('((particle_id == 2) | (particle_id == 3) | '
... |
__author__ = 'Maximilian Bisani'
__version__ = '$LastChangedRevision: 1667 $'
__date__ = '$LastChangedDate: 2007-06-02 16:32:35 +0200 (Sat, 02 Jun 2007) $'
__copyright__ = 'Copyright (c) 2004-2005 RWTH Aachen University'
__license__ = """
This program is free software; you can redistribute it and/or modify... |
import math
import numpy as np
def calc_overlap_nmi(num_vertices, result_comm_list, ground_truth_comm_list):
return OverlapNMI(num_vertices, result_comm_list, ground_truth_comm_list).calculate_overlap_nmi()
class OverlapNMI:
@staticmethod
def entropy(num):
return -num * math.log(2, num)
def... |
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_resource
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_response
from nssrc.com.citrix.netscaler.nitro.service.options import options
from nssrc.com.citrix.netscaler.nitro.exception.nitro_exception import nitro_... |
import logging
import zlib
import unicodedata
import sys
from index_record import IndexRecord
class RecordStore(object):
MAX_BUFFER = 1000
punctuation_trans_table = dict.fromkeys(
(i for i in range(sys.maxunicode) if unicodedata.category(chr(i)).startswith('P')), ' ')
def __init__(self, db):
... |
from __future__ import print_function
import sys
try:
import numpy as np
except ImportError:
# We don't have numpy -- bail
sys.exit(0)
import itk
if len(sys.argv) < 2:
print('Usage: ' + sys.argv[0] + ' <inputImage>')
sys.exit(1)
inputImageFileName = sys.argv[1]
image = itk.imread(inputImageFileNa... |
"""Base class for Telegram InputMedia Objects."""
from telegram import TelegramObject, InputFile, PhotoSize, Animation, Video, Audio, Document
class InputMedia(TelegramObject):
"""Base class for Telegram InputMedia Objects.
See :class:`telegram.InputMediaAnimation`, :class:`telegram.InputMediaAudio`,
:c... |
#!/usr/bin/env python
#import argparse
#from glob import glob
#-s /mnt/lfs2/hend6746/devils/samples.txt
#-r /mnt/lfs2/hend6746/devils/fastqFiles_160916/00-RawData
#-b /mnt/lfs2/hend6746/devils/reference/sarHar1.fa
from os.path import join as jp
from os.path import abspath
import os
import sys
import argparse
import c... |
"""Tests for open_spiel.python.algorithms.get_all_states."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from absl.testing import absltest
from open_spiel.python.algorithms import value_iteration
import pyspiel
class ValueIterationTest(absltest.TestC... |
"""
tasker.py
DESCRIPTION:
A task handler to deal with the distributed job
system used by daQuery.
Do not directly use this file.
TO USE:
DO NOT USE THIS DIRECTLY.
CREDITS:
- Logan Davis <<EMAIL>>
Init date: 3/13/17 | Version: Python 3.6 | DevOS: MacOS 10.11 & <add here>
"""
import json
import a... |
import gutil
import misc
import pdf
import pml
import screenplay
import util
import wx
def genDialogueChart(mainFrame, sp):
# TODO: would be nice if this behaved like the other reports, i.e. the
# junk below would be inside the class, not outside. this would allow
# testcases to be written. only complicat... |
import base64
import json
from typing import ( # pylint: disable=unused-import
cast,
Tuple,
)
from datetime import datetime
import calendar
from msrest.serialization import TZ_UTC
from azure.core.credentials import AccessToken
def _convert_datetime_to_utc_int(expires_on):
"""
Converts DateTime in loca... |
"""
Django settings for eisenstein project.
Generated by 'django-admin startproject' using Django 1.8.2.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build p... |
from keras import backend as K
from overrides import overrides
from ..masked_layer import MaskedLayer
class ExpandFromBatch(MaskedLayer):
"""
Reshapes a collapsed tensor, taking the batch size and separating it into ``num_to_expand``
dimensions, following the shape of a second input tensor. This is mean... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###########################################################################
# ESPResSo++ #
# Test script for Tabulated potentials (LJ, FENE, Cosine) #
# ... |
import argparse
import logging
import sys
import traceback
from socket import getfqdn
from socket import gethostbyname
from socket import gethostname
from paasta_tools import mesos_maintenance
from paasta_tools import utils
from paasta_tools.marathon_tools import get_expected_instance_count_for_namespace
from paasta_t... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Update encrypted deploy password in Travis config file
"""
from __future__ import print_function
import base64
import json
import os
from getpass import getpass
import yaml
from cryptography.hazmat.primitives.serialization import load_pem_public_key
from cryptography.h... |
"""
Fuctions for automatically finding and retrieving recent ClinVar VCF file.
Notes:
- 'build' is explicitly required by these functions to avoid potential
accidental build mismatches during processing.
- The most recent file is stored with a filename constructed by concatenating
the genome build with the Cli... |
import requests
from mock import Mock, patch
import six
from righteous import config
from righteous.config import Settings
import righteous
unittest = None
if six.PY3:
import unittest
unittest = unittest
else:
import unittest2
unittest = unittest2
class RighteousTestCase(unittest.TestCase):
def ... |
from calvin.actor.actor import Actor, ActionResult, manage, condition, guard
from calvin.runtime.north.calvin_token import EOSToken, ExceptionToken
class ExceptionHandler(Actor):
"""
Scan tokens for Exceptions.
Any non-exception or EOS is simply passed on. Exceptions other than EOS are replaced
with... |
import urllib
import urllib2,json
import xbmcvfs
import requests,time
import os,xbmc,xbmcaddon,xbmcgui,re
addon = xbmcaddon.Addon('plugin.video.live.magellan')
profile = xbmc.translatePath(addon.getAddonInfo('profile').decode('utf-8'))
cacheDir = os.path.join(profile, 'cachedir')
clean_cache=os.path.join(cacheDir,'clea... |
import sys
sys.path.append('/home/jwalker/dynamics/python/atmos-tools')
sys.path.append('/home/jwalker/dynamics/python/atmos-read')
import numpy as np
import xarray as xray
import pandas as pd
import matplotlib.pyplot as plt
import atmos as atm
import merra
import indices
import utils
# -----------------------------... |
import os
import platform
import shlex
import signal
import subprocess
import psutil
from ARKDaemon.ServerRcon import ServerRcon
class ArkServer(object):
def __init__(self, config, safe=False):
self.config = config
self.pid_file = os.path.join('ark.pid')
self.platform = platform.system()... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import logging
import lib.jobs as jobs
import lib.utils as utils
from django.utils.translation import ugettext as _
logger = logging.getLogger('uprilogger')
def reconfigure_wlan(ssid, password):
try:
jobs.job_message(_("Das Silent WLAN wir... |
import warnings
from cloudify_rest_client.responses import ListResponse
class NodeInstance(dict):
"""
Cloudify node instance.
"""
@property
def id(self):
"""
:return: The identifier of the node instance.
"""
return self.get('id')
@property
def node_id(sel... |
from testtools.matchers import Equals, DirExists, Not
import snapcraft.internal.errors
from . import LifecycleCommandsBaseTestCase
class BuildCommandTestCase(LifecycleCommandsBaseTestCase):
def test_build_invalid_part(self):
self.make_snapcraft_yaml("build")
raised = self.assertRaises(
... |
#
# On Unix we run a server process which keeps track of unlinked
# semaphores. The server ignores SIGINT and SIGTERM and reads from a
# pipe. Every other process of the program has a copy of the writable
# end of the pipe, so we get EOF when all other processes have exited.
# Then the server process unlinks any ... |
import unittest
import sys
import inspect
from robot.running.handlers import _PythonHandler, _JavaHandler, DynamicHandler
from robot import utils
from robot.utils.asserts import *
from robot.running.testlibraries import TestLibrary, LibraryScope
from robot.running.dynamicmethods import (
GetKeywordArguments, GetKe... |
# Third-Party
from algoliasearch_django import AlgoliaIndex
class AwardIndex(AlgoliaIndex):
fields = [
'name',
'get_kind_display',
'get_level_display',
'get_season_display',
'get_age_display',
'get_gender_display',
'get_district_display',
'get_divisi... |
__source__ = 'https://leetcode.com/problems/lonely-pixel-ii/'
# Time: O( m * n)
# Space: O()
#
# Description: Leetcode # 533. Lonely Pixel II
#
# Given a picture consisting of black and white pixels, and a positive integer N,
# find the number of black pixels located at some specific row R and column C
# that align wi... |
#!/usr/bin/env python
from __future__ import print_function
import os
import os.path
import shutil
import subprocess
import xattr
import util
# Notes:
# * Due to internal buffer sizing, "large" should be at least 4096 bytes for
# uncompressed archives and archives with individual file compression, and
# and at ... |
import os
import shutil
import cv2
import numpy as np
from constants import DATA_DIR
from cv_helpers import show, ls
PW_SYMBOL_SOURCE_DIR = DATA_DIR + "/labelled_photos/1"
BUTTON_SIMON_SOURCE_DIR = DATA_DIR + "/labelled_photos/9"
PASSWORD_DIR = DATA_DIR + "/labelled_photos/password"
SYMBOLS_DIR = DATA_DIR + "/labell... |
import random
import numpy
import matplotlib.pyplot as plt
from matplotlib.pyplot import pcolor, show, contour
num_bees = 1000
soldier_portion = 0.1
two_d_plot = []
r = 0.00025
max_hit = 100
class Soldier_bee:
at = 2
ammo = 1
victim = 0
panic = False
def __init__ (self):
self.warmonger... |
from apps.processing.ala.models import SamplingFeature, Observation
from django.contrib.gis.geos import GEOSGeometry
from apps.common.models import Process
from psycopg2.extras import DateTimeTZRange
from datetime import timedelta, datetime
from apps.common.models import Property, Topic, TimeSlots
from rest_framework.t... |
"""Encapsulates running tests defined in tests.py.
Running this script requires passing --config-path with a path to a config file
of the following structure:
[data_files]
passwords_path=<path to a file with passwords>
[binaries]
chrome-path=<chrome binary path>
chromedriver-path=<chrome driver path>
[run... |
#!/usr/bin/env python
"""Interface to the MultiMarkdown parser."""
import os.path
import platform
import ctypes
import ctypes.util
from .download import SHLIB_EXT
from .defaults import DEFAULT_LIBRARY_DIR
_MMD_LIB = None
_LIB_LOCATION = None
def load_mmd():
"""Loads libMultiMarkdown for usage"""
global _MMD... |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
pass
def backwards(self, orm):
pass
models = {
u'auth.g... |
#!/usr/bin/python
BLIZZARD2008="/data/users/rkarhila/blizzard_results/blizzard_wavs_and_scores_2008_release_version_1"
EVALUATION="/data/users/rkarhila/speech_synthesis_objective_evaluation/"
import csv,re,os
for lng in ["english"]:
with open(BLIZZARD2008+'/'+lng+'_results_for_distribution.csv', 'rb') as csvf... |
# vim: sw=4 ts=4 sts expandtab smarttab
# HXN step-scan configuration
import hxntools.scans
import bluesky.plans as bp
import bluesky.utils as bu
import ophyd
import functools
from bluesky import (plans, Msg)
from bluesky import plan_patterns
def _pre_scan(dets, total_points, count_time):
yield Msg('hxn_next_sca... |
from django.db import models
from django.conf import settings
from django.contrib.auth.models import User, Group
from lingcod.features.managers import ShareableGeoManager
from lingcod.features.models import Feature, FeatureForm
from lingcod.common.utils import get_logger
from django.core.urlresolvers import reverse
fro... |
"""Example Airflow DAG that performs an export from BQ tables listed in
config file to GCS, copies GCS objects across locations (e.g., from US to
EU) then imports from GCS to BQ. The DAG imports the gcs_to_gcs operator
from plugins and dynamically builds the tasks based on the list of tables.
Lastly, the DAG defines a ... |
#!/usr/bin/env python
""" Read the inferred tree parameters from Connor's json files, and generate a bunch of trees to later sample from. """
import sys
import os
import re
import random
import json
import numpy
import math
from cStringIO import StringIO
import tempfile
from subprocess import check_call
from Bio impor... |
# -*- coding: utf-8 -*-
"""
All character set and unicode related tests.
"""
from jedi import Script
from jedi._compatibility import utf8, unicode
def test_unicode_script():
""" normally no unicode objects are being used. (<=2.7) """
s = unicode("import datetime; datetime.timedelta")
completions = Script(s... |
import sys, os, inspect
from PyQt5.QtWidgets import QMessageBox, QWidget, QComboBox
from PyQt5 import uic
from PyQt5.QtCore import QDate
from new_bonus import NewBonus
directory = os.path.realpath(os.path.abspath(os.path.split(inspect.getfile(inspect.currentframe()))[0]))
sys.path.append(directory + "/lib")
from bbdd... |
import numpy
import moose
import pylab
runtime = 10
chemdt = 0.05
tgtCaInitConc = 50e-6
def makeReacs():
# Parameters
volume = 1e-15
CaInitConc = 60e-6
NA = 6.022e23
tauI = 1
tauG = 0.1
model = moose.Neutral( '/cells' )
compartment = moose.CubeMesh( '/cells/compartment' )
compartm... |
# coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
determine_ext,
float_or_none,
HEADRequest,
int_or_none,
orderedSet,
remove_end,
strip_jsonp,
unescapeHTML,
unified_strdate,
... |
from gettext import gettext as _
from PyQt5 import sip
from PyQt5.Qt import (
QSize, QAbstractListModel, Qt, QSortFilterProxyModel, QListView,
QVBoxLayout, QLineEdit, QFormLayout, QCheckBox, QPlainTextEdit,
QLabel, QWidget, QListWidget, QSplitter, QListWidgetItem, pyqtSignal,
QPushButton
)
from ..mess... |
from linshareapi.core import ResourceBuilder
from linshareapi.cache import Cache as CCache
from linshareapi.cache import Invalid as IInvalid
from linshareapi.user.core import GenericClass
from linshareapi.user.core import Time as CTime
from linshareapi.user.core import CM
# pylint: disable=C0111
# Missing docstring
# ... |
from vbench.api import Benchmark
from datetime import datetime
import os
modules = ['model', 'flux_analysis']
by_module = {}
benchmarks = []
for modname in modules:
ref = __import__(modname)
by_module[modname] = [v for v in ref.__dict__.values()
if isinstance(v, Benchmark)]
ben... |
from __future__ import absolute_import
import datetime
import hashlib
import itertools
import logging
import redis
from .base import BaseBackend
from ..tracker import ActivityTracker
log = logging.getLogger(__name__)
__all__ = ['RedisBackend']
class RedisBackend(BaseBackend):
"""Redis backend for activity tr... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Test creating a device with the library editor
"""
def test(library_editor, helpers):
"""
Create new device
"""
le = library_editor
# Open "New Library Element" wizard
le.action('libraryEditorActionNewElement').trigger(blocking=False)
# ... |
from spack import *
class RA4core(RPackage):
"""Automated Affymetrix Array Analysis Core Package."""
homepage = "https://www.bioconductor.org"
url = "https://www.bioconductor.org/packages/release/bioc/src/contrib/a4Core_1.24.0.tar.gz"
version('1.24.0', 'd7f79c350ae0a6175f2ecc9a337ca61f')
d... |
# wendym2m.py: M2M with wendy, a 1D N-body code
import copy
import numpy
import wendy
import hom2m
########################## SELF-GRAVITATING DISK TOOLS ########################
def sample_sech2(sigma,totmass,n=1):
# compute zh based on sigma and totmass
zh= sigma**2./totmass # twopiG = 1. in our units
x=... |
########################################################################
# File: AdlerTestCase.py
########################################################################
""" :mod: AdlerTestCase
=======================
.. module: AdlerTestCase
:synopsis: test case for DIRAC.Core.Utilities.Adler module
... |
from PyQt5.QtWidgets import QWidget, QVBoxLayout, \
QListWidget, QListWidgetItem, QMenu
from PyQt5.QtGui import QIcon, QPixmap, \
QPainter, QColor
from PyQt5.QtCore import Qt
import matplotlib.colors as col
from scgv.utils.color_map import ColorMap
class LegendWidget(QWidget):
IMAGE_SIZE = 15
def ... |
# -*- coding: utf-8 -*-
"""
***************************************************************************
retile.py
---------------------
Date : January 2016
Copyright : (C) 2016 by Médéric Ribreux
Email : mederic dot ribreux at medspx dot fr
****************... |
import os
import sys
import gtk
from zenmapCore.Paths import Path
class Image:
"""
"""
def __init__(self, path=None):
"""
"""
self.__path = path
self.__cache = dict()
def set_path(self, path):
"""
"""
self.__path = path
def get_pixbuf(se... |
"""
=========================================================
Using FunctionTransformer to select columns
=========================================================
Shows how to use a function transformer in a pipeline. If you know your
dataset's first principle component is irrelevant for a classification task,
you ca... |
import logging
from math import pi
import tables
import numpy as np
from sapphire.kascade import StoreKascadeData, KascadeCoincidences
from sapphire.analysis import process_events
from sapphire import clusters
from sapphire.analysis.direction_reconstruction import KascadeDirectionReconstruction
class Master(object)... |
#
# Streaming Word Count Example
# Original Source: https://spark.apache.org/docs/1.6.0/streaming-programming-guide.html
#
# To run this example:
# Terminal 1: nc -lk 9999
# Terminal 2: ./bin/spark-submit /Users/dennylee/Documents/workspace/Spark/streaming/streaming_word_count.py localhost 9999
# Note, type wo... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
nai/cv.py
~~~~~~~~~
Cross-validate the accuracy of node attribute inference in a graph.
"""
import sys
import numpy as np
import pandas as pd
import networkx as nx
import matplotlib.pyplot as plt
from csv import QUOTE_ALL
from random import sample
from co... |
import os
import time
import signal
import logging
import network
from kvmcommand import KVMCommand, KVM
from kvmmonitor import KVMMonitor
from lowleveltools import checkedSystemCall
_RunPath = '/var/run/veerezo'
_logger = logging.getLogger('vserver')
_TerminationTimeout = 15.0
def startVServer(id, ramMiB, disks, n... |
#####################################
# #
# Arena Boss Code #
# By: Mateo Aguirre #
# and Calvin Adams #
# #
#####################################
#Starts up the game
import pygame
from pygame.locals ... |
import os
import yaml
import codecs
import datetime
import subprocess
from venc2.datastore.configuration import get_blog_configuration
from venc2.datastore.entry import yield_entries_content
from venc2.prompt import notify
from venc2.prompt import die
from venc2.l10n import messages
import venc2.datastore.entry as En... |
from PyQt5.QtCore import QRectF, QSizeF, QPointF, Qt
from PyQt5.QtGui import QPainter, QPen
from PyQt5.QtWidgets import QGraphicsLineItem
from urh import constants
class LabeledArrow(QGraphicsLineItem):
def __init__(self, x1, y1, x2, y2, label):
super().__init__(x1, y1, x2, y2)
self.ItemIsMovable... |
from __future__ import absolute_import
import datetime
from dateutil import parser as du_parser, tz as du_tz
import optparse
import os
import subprocess
import sys
import tempfile
from xml.dom.minidom import *
from StringIO import StringIO
from credentials.src.trustgcf.abac_credential import ABACCredential, ABACEleme... |
"""
Contains possible interactions with the Apollo Canned Comments Module
"""
from apollo.client import Client
class CannedCommentsClient(Client):
CLIENT_BASE = '/cannedComment/'
def add_comment(self, comment, metadata=""):
"""
Add a canned comment
:type comment: str
:param c... |
from core import perf_benchmark
from core import platforms
import page_sets
from telemetry import story
from telemetry import benchmark
from telemetry.timeline import chrome_trace_category_filter
from telemetry.web_perf import timeline_based_measurement
@benchmark.Info(emails=['<EMAIL>','<EMAIL>'],
... |
# -*- coding: utf-8 -*-
from app.api.helpers.data_layers import MOVE_TYPE_DROPPED, MOVE_TYPE_GRABBED
from tests.unittests.utils.base_test_case import BaseTestCase, request_context
from tests.unittests.utils.payload.user import UserPayload
class TestUsersDetails(BaseTestCase):
"""Test Users details"""
@reque... |
#!/usr/bin/env python
__author__ = 'wonderg'
import requests
import re
import pexpect
import sys
import os
import subprocess
from datetime import datetime
#FTP connection preferences
ftp_ip = '192.168.9.13'
ftp_login = 'ftpuser'
ftp_password = 'ftpuserpass'
ftp_public_folder = '/pub/qtech_rev1_cfg_bkp/'
#For new r... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.