content
string
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Blockstack ~~~~~ copyright: (c) 2014-2015 by Halfmoon Labs, Inc. copyright: (c) 2016 by Blockstack.org This file is part of Blockstack Blockstack is free software: you can redistribute it and/or modify it under the terms of the GNU General...
#!/usr/bin/python #Import stuff import json import RPi.GPIO as GPIO import time from pySpacebrew.spacebrew import Spacebrew #str2bool def str2bool(v): return v.lower() in ("yes", "true", "t", "1") #gogo print "Booting up robot" print "Configuring GPIO Pins" GPIO.setmode(GPIO.BCM) GPIO.setup(17, GPIO.OUT) GPIO.setup(18...
from gettext import gettext as _ from gnomemusic import log from gnomemusic.albumartcache import ArtSize from gnomemusic.views.emptyview import EmptyView class InitialStateView(EmptyView): def __repr__(self): return '<InitialStateView>' @log def __init__(self, window, player): super()._...
import sys import csv import re # python csvfilter.py filename -cat= filename = sys.argv[1] args = sys.argv[2:] catfilter = descfilter = datefilter = None for arg in args: if arg.startswith("-cat="): catfilter = arg[5:] elif arg.startswith("-desc="): descfilter = arg[6:] elif arg.startswith...
""" config --- Load and save settings ================================= """ from enki.core.core import core import enki.core.json_wrapper from PyQt4.QtGui import QApplication, QFont, QFontDatabase class Config(): """Settings storage. This class stores core settings. Plugins are also allowed to store its se...
import struct from scapy.compat import Iterable, Optional, Union, List, Tuple, Dict, Any, \ Type from scapy.utils import EDecimal from scapy.packet import Packet from scapy.sessions import DefaultSession from scapy.contrib.isotp.isotp_packet import ISOTP, N_PCI_CF, N_PCI_SF, \ N_PCI_FF, N_PCI_FC import scapy.m...
#!/usr/bin/env python # -*- coding: utf-8 -*- """Launch Pharmaship GUI from package entry-point.""" import os import django import gi import threading from pathlib import Path gi.require_version("Gtk", "3.0") from gi.repository import Gtk, GLib, Gio from pharmaship.app import settings GRESOURCE_PATH = settings.PHA...
# coding: utf8 from __future__ import unicode_literals from ...symbols import POS, PUNCT, SYM, ADJ, CCONJ, NUM, DET, ADV, ADP, X, VERB from ...symbols import NOUN, PROPN, PART, INTJ, SPACE, PRON TAG_MAP = { ".": {POS: PUNCT, "PunctType": "peri"}, ",": {POS: PUNCT, "PunctType": "comm"}, "-LR...
from __future__ import absolute_import, division, print_function, unicode_literals import os from pex.interpreter import PythonInterpreter from pex.pex_builder import PEXBuilder from pex.pex_info import PexInfo from pants.backend.python.interpreter_cache import PythonInterpreterCache from pants.backend.python.subsys...
# -*- coding: utf-8 -*- import unittest from pymongo import MongoClient from tavi.documents import Document from tavi import fields class DocumentFindTest(unittest.TestCase): class Sample(Document): first_name = fields.StringField("first_name", required=True) last_name = fields.StringField("last_n...
#!/usr/bin/env python # -*- coding: utf-8 -*- from mrjob.job import MRJob import tempfile from collections import defaultdict from normalize_fn import normalize from semantic import get_group from body_parts import is_bodypart from skip_term import skip_term from skip_categories import skip_categories import os # Set...
"""Backwards compatibility functional test Test various backwards compatibility scenarios. Download the previous node binaries: contrib/devtools/previous_release.sh -b v0.19.0.1 v0.18.1 v0.17.1 Due to RPC changes introduced in various versions the below tests won't work for older versions without some patches or wor...
import time import os import pandas as pd import seaborn as sns import matplotlib.pyplot as plt import numpy as np from sklearn import decomposition from sklearn import preprocessing from sklearn import cluster from sklearn import linear_model from sklearn import cross_validation from sklearn.metrics import mean_absolu...
""" Test lldb data formatter subsystem. """ from __future__ import print_function import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil class DataFormatterSynthValueTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) def set...
"""Cloud datastore entity classes.""" from google.cloud import ndb # pylint: disable=too-few-public-methods class Project(ndb.Model): """Represents an integrated OSS-Fuzz project.""" name = ndb.StringProperty() schedule = ndb.StringProperty() project_yaml_contents = ndb.TextProperty() dockerfile_contents = ...
import copy from oslo_utils.fixture import uuidsentinel as uuids import webob from nova.api.openstack.compute import networks as networks_v21 from nova import exception from nova.network import neutron from nova import test from nova.tests.unit.api.openstack import fakes # NOTE(stephenfin): obviously these aren't c...
import nose.tools import pandas as pd import numpy as np import unittest from mia.analysis import * from ..test_utils import get_file_path class AnalysisTests(unittest.TestCase): @classmethod def setupClass(cls): csv_file = get_file_path("blob_detection.csv") cls._features = pd.DataFrame.fro...
import sys import os progname = os.path.basename(sys.argv[0]) def usage(): print("Usage: %s SOURCEURL WCPATH [r]REVNUM[,] [...]" % progname) print("Try '%s --help' for more information" % progname) def help(): val = """This script is meant to ease the pain of merging and reviewing revision(s) on a release bran...
import pytest from mollie.api.error import EmbedNotFound from mollie.api.objects.order import Order from mollie.api.objects.payment import Payment from mollie.api.objects.refund import Refund from mollie.api.objects.shipment import Shipment from .utils import assert_list_object ORDER_ID = "ord_kEn1PlbGa" def test_...
from msrest.serialization import Model class NextHopResult(Model): """The information about next hop from the specified VM. :param next_hop_type: Next hop type. Possible values include: 'Internet', 'VirtualAppliance', 'VirtualNetworkGateway', 'VnetLocal', 'HyperNetGateway', 'None' :type next_ho...
from py_db import db import argparse from decimal import Decimal # Goes through the list of offensive players and grabs their defensive data db = db('NSBL') def process(year): print "processed_WAR_hitters", year calculate_war(year) # for year in range(2006,2021): # calculate_war(year) def c...
import os from flask import Flask, render_template, request, session, url_for, jsonify from app import app, host, port, user, passwd, db from app.helpers.database import con_db import pymysql from NEVERRESETHEAD import beatspl2tracks, beats2echonest, EN_id2summary, DiGraph, get_cached import csv import scipy from scipy...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import httpretty import json import sure from mock import Mock from pyeqs import QuerySet, Filter from pyeqs.dsl import Term, Sort, ScriptScore from tests.helpers import heterogeneous, homogeneous def test_copy_queryset(): """ Copy Queryset obj...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.contrib.auth.models import django.utils.timezone import django.core.validators import re class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.Cre...
# -*- coding: utf-8 -*- import os import sys import json import logging # from logging import handlers from optparse import OptionParser # add bike too sys.path sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..')) import bike # remove it. WHY? sys.path.pop(0) class JsonFormatter(logging.Formatter): ...
import bpy from bpy.props import * from collections import defaultdict from ... sockets.info import toIdName from ... base_types.node import AnimationNode dataByIdentifier = defaultdict(None) dataDirectionItems = { ("IMPORT", "Import", "Receive the data from somewhere else", "IMPORT", 0), ("EXPORT", "Export",...
import sys line_num = 0 OPENER = '[{<' CLOSER = ']}>' INDENT = ' ' SKIP_FIELDS = 4 def dump_karaf_log(args): path = args.path if path == '-': _dump_pretty_print(sys.stdin) return with open(path, 'r') as log_file: _dump_pretty_print(log_file) def _has_nested_structs(msg): t...
import unittest import autoconfig import parser_test_case import pygccxml from pygccxml.utils import * from pygccxml.parser import * from pygccxml.declarations import * class tester_t( parser_test_case.parser_test_case_t ): COMPILATION_MODE = COMPILATION_MODE.ALL_AT_ONCE def __init__(self, *args ):...
#------------------------------------------------------------------------------ # Get the dominant prints for an image in the catalog. # GET /v1/catalog/{catalog_name}/dominant_prints/{id}/{image_id} #------------------------------------------------------------------------------ import os import json import requests f...
import re from google.appengine.ext import ndb from webapp2_extras import sessions class Session(ndb.Model): username = ndb.StringProperty() session = ndb.StringProperty() @classmethod def Update(cls, username, session): key = ndb.Key('Session', session) if not key.get(): entity = cls() e...
from argparse import ArgumentParser from .compat import SafeConfigParser import inspect import os import sys from . import command, util, package_dir, compat class Config(object): """Represent an Alembic configuration. Within an ``env.py`` script, this is available via the :attr:`.EnvironmentContext.conf...
#!/usr/bin/env python ''' Esse modulo plota o grafico orcamento x vertices positivos para todas as buscas menos as fakeheu e dyheu ''' import matplotlib.pyplot as plt import numpy as np import sys def main(file_bfs, file_dfs, file_heu1, file_heu2, file_heu3, file_mods, exit_file, bar): budget, time, bfs_positive...
''' Created on Jun 3, 2015 @author: Daniil Sorokin<<EMAIL>> ''' import codecs, math, argparse, os from vector_representation import StemmedCorpus, filter_base_terms, save_as_libsvm if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('input_folder_train', type=str, help = "Corpu...
from app.controllers import utils from httplib2 import Http from urllib import urlencode import json from app import app github = app.config.get('SOCIAL_KEYS')['github'] client_id = github['client_id'] client_secret = github['client_secret'] authorize_url = github['authorize_url'] access_toke...
#!/usr/bin/env python import os,sys home_dir = os.getenv("DRC_BASE") #print home_dir sys.path.append(home_dir + "/software/build/lib/python2.7/site-packages") sys.path.append(home_dir + "/software/build/lib/python2.7/dist-packages") import lcm import select import drc from time import sleep, time from datetime import...
''' Make histogram of surface brightness along the filaments. ''' from astropy.io.fits import getdata, getheader from astropy import convolution from astropy.table import Table from scipy.ndimage import distance_transform_edt import os import sys import numpy as np import matplotlib.pyplot as p from pandas import Data...
import argparse import base64 import httplib2 from googleapiclient import discovery from oauth2client.client import GoogleCredentials import WikiParser with open("../priv/apiKey.txt") as f: api = f.read() print api apiVersion = "v1" DISCOVERY_URL='https://{api}.googleapis.com/$discovery/rest?version={apiVers...
import unittest from draftjs_exporter.dom import DOM from draftjs_exporter.types import Element, Props def hr(props: Props) -> Element: return DOM.create_element("hr") def link(props: Props) -> Element: attributes = {} for key in props: attr = key if key != "url" else "href" attributes[...
import jautils from unidecode import unidecode import os.path import re import logging def read_dictionary(file_name): """ Reads dictionary file. Args: file_name: file name. format: kanji + '\t' + yomigana Return: {kanj: yomigana, ...} """ dictionary = {} ...
import numpy import matplotlib.pyplot as plt import matplotlib from copy import deepcopy import random ############################# Attribution des orientations aux sets ############################################################## ipath = "inp_grain.inp" # chemin du fichier "fix-ger.inp" inp=open(ipath,"r") c...
"""Clean Task.""" import subprocess from .core import Task from .options import GeneralDirsOpt from .options import OtherDirsOpt class CleanTask(GeneralDirsOpt, OtherDirsOpt, Task): """Clean out directories as needed.""" config_name = 'clean' def _remove(self, path): """Remove a path.""" ...
""" Hooks for customizing login with social providers https://django-allauth.readthedocs.io/en/latest/advanced.html """ from allauth.account.signals import user_logged_in from allauth.socialaccount.adapter import DefaultSocialAccountAdapter from django.dispatch import receiver from common.helpers.error_handlers import ...
""" WSGI config for are_there_spiders 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_APPL...
import struct import sys import zlib PNG_MAGIC = bytearray.fromhex("89 50 4E 47 0D 0A 1A 0A") class PNGImage: def __init__(self): self.name = "" self.chunks = [] self.width = 0 self.height = 0 self.bitdepth = 0 self.colortype = 0 self.compression = 0 self.filtering = 0 self.interlacing = 0 def re...
import random lane_num = 2 lane = [[], []] max_car_num = 100 road_len = 100 h = 6 p_b = 0.94 p_0 = 0 p_d = 0.1 v_max = 20 gap = 7 p_car = 1 p_crash = 0 time_period = 100 class Car: car_cnt = 0 def __init__(self, v = 1, lane = 1): self.c_id = Car.car_cnt self.v = 10 self.lane = la...
import os import posixpath from tornado import web, gen from mimetypes import types_map from pkg_resources import resource_string from concurrent.futures import ThreadPoolExecutor class StaticHandler(web.RequestHandler): """ Returns static files to :data:`bfly.Webserver._webapp` Arguments ---------- _...
#------------------------------------------------------------------------------- # elftools example: elf_low_high_api.py # # A simple example that shows some usage of the low-level API pyelftools # provides versus the high-level API while inspecting an ELF file's symbol # table. # # Eli Bendersky (<EMAIL>) # This code ...
import os import unittest from lava_dispatcher.device import NewDevice from lava_dispatcher.parser import JobParser from lava_dispatcher.action import JobError from lava_dispatcher.test.test_basic import Factory, StdoutTestCase from lava_dispatcher.actions.deploy import DeployAction from lava_dispatcher.test.utils impo...
"""Test for the cooperator strategy.""" import axelrod from test_player import TestPlayer class TestCooperator(TestPlayer): name = "Cooperator" player = axelrod.Cooperator stochastic = False def test_strategy(self): """Test that always cooperates.""" P1 = axelrod.Cooperator() ...
def install(job): service = job.service prefab = job.service.executor.prefab name = "caddy_%s" % service.name proxies_dir = prefab.core.replace('$JSCFGDIR/caddy/%s/proxies' % name) prefab.core.dir_ensure(proxies_dir) for proxy_info in service.producers.get('caddy_proxy', []): dst = ' '...
import glob import os import re def process(text, start=None): # Full Definition # ((.*) =\s+([\s\S]*?)\s*;\n) # Group1 is the full rule definition # Group2 is only the name of the rule # Group3 is the definition of the rule # Definitions within this definition # (?<!')\b\w+\b(?!') # ...
# -*- coding: latin1 -*- ################################################################################################ # # import snap, datetime, sys, time, json, os, os.path, shutil, time, random, math import numpy as np from math import* import plotly import plotly.plotly as py import plotly.graph_objs as go ...
import numpy as np from numpy.testing import assert_array_equal import pytest from numcodecs.delta import Delta from numcodecs.tests.common import (check_encode_decode, check_config, check_repr, check_backwards_compatibility) # mix of dtypes: integer, float # mix of shapes: 1D, 2...
from pywps.Process import WPSProcess from flyingpigeon.indices import indices, indices_description, calc_indice_single from flyingpigeon.subset import countries, countries_longname from flyingpigeon.utils import GROUPING import logging class SingleIndicesProcess(WPSProcess): """This process calculates a climate ...
from unittest import SkipTest # noqa from decimal import Decimal from biohub.biobrick.models import Biobrick from ._base import BiobrickTest class Test(BiobrickTest): def setUp(self): self.brick = Biobrick.objects.get(part_name='BBa_E1010') def brick_url(self, brick=None): if brick is Non...
#!/usr/bin/env python """ Helpers for testing - helpers for testing pypeman itself - helpers for testing pypeman projects """ from unittest import TestCase import asyncio from pypeman import nodes from pypeman import channels # TODO implement settings override # TODO implement MessageStoreMock class PypeTestCas...
import logging import os import statvfs import libvirt from virtinst import StoragePool, StorageVolume from virtinst import util def _check_if_pool_source(conn, path): """ If passed path is a host disk device like /dev/sda, want to let the user use it """ if not conn.check_support(conn.SUPPORT_C...
#!/usr/bin/python import time import datetime import sys from pymlab import config #### Script Arguments ############################################### if len(sys.argv) != 2: sys.stderr.write("Invalid number of arguments.\n") sys.stderr.write("Usage: %s PORT ADDRESS\n" % (sys.argv[0], )) sys.exit(1) po...
import wx from gamera import core, config from gamera.gui import gamera_display, gui_util, gamera_icons, compat_wx import glob, string, os.path class FileList(wx.GenericDirCtrl): def __init__(self, parent, ID, image_display): wx.GenericDirCtrl.__init__( self, parent, ID, filter="All files ...
from petsc4py import PETSc import unittest import numpy as N def mkmat(n, mtype, opts): A = PETSc.Mat().create(PETSc.COMM_SELF) A.setSizes([n,n]) A.setType(mtype) A.setUp() for o in opts: A.setOption(o, True) return A def mksys_diag(n, mtype, opts): A = mkmat(n, mtype, opts) x...
#!/usr/bin/python import numpy BLACK = 2 WHITE = 1 EMPTY = 0 class ReversiBoard: def __init__(self): self.board = numpy.zeros((8, 8)) def set_default_board(self): self.board[3][3] = WHITE self.board[4][4] = WHITE self.board[3][4] = BLACK self.board[4][3] = BLACK ...
# -*- coding: utf-8 -*- import sys import re import logging logger = logging.getLogger(__name__) """ headlines ~~~~~~~~~~~~~~~~~ Main module; where the action is. """ def articles_to_lower_case(title_str): lowercase_words = {u'A':u'a', u'An':u'an', u'And':u'and', u'As':u'as', u'At':u'at', ...
import re from django import forms from django.db.models import get_model, Q from django.utils.translation import ugettext_lazy as _ Product = get_model('catalogue', 'Product') Range = get_model('offer', 'Range') class RangeForm(forms.ModelForm): class Meta: model = Range exclude = ('included_p...
""" Manage Pandas DataFrame """ def split_df(df, N): """ Split Dataframe making each sub dataframe having only N rows """ __len = int(df.shape[0]) if __len < N: L = [df] else: L= [] for i in range(0, __len, N): if i + N < __len: ...
__author__ = 'Irwan Fathurrahman <<EMAIL>>' __date__ = '10/05/17' from campaign_manager.models.version import Version class JsonModel(Version): """ Model that use json. """ json_path = '' def parse_json_file(self): return NotImplemented def get_attributes(self): """ Get attr...
import os import pathlib import tempfile from google.oauth2 import service_account base_path = pathlib.Path.cwd() # Set USE_TZ to True to work around bug in django-storages USE_TZ = True SECRET_KEY = "nonsense" CACHES = { "default": { "BACKEND": "django.core.cache.backends.locmem.LocMemCache", "...
""" 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 use this ...
""" Volume driver for Windows Server 2012 This driver requires ISCSI target role installed """ import os from oslo.config import cfg from cinder.image import image_utils from cinder.openstack.common import fileutils from cinder.openstack.common import log as logging from cinder.volume import driver from cinder.vol...
# -*- coding: utf-8 -*- from dp_tornado.engine.controller import Controller class GetUserAgentController(Controller): def get(self): user_agents = [ (False, 10, 7, 0, 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.75.14 (KHTML, like Gecko) Version/7.0.3 Safari/7046A194A', '_...
import unittest from ..totalenergyresults import TotalEnergyResults from ... import TimeFrame class TestEnergyResults(unittest.TestCase): def test_append(self): er = TotalEnergyResults() tf = TimeFrame('2012-01-01','2012-01-02') er.append(tf, {'apparent':40, 'reactive':30, 'active':20}) ...
"""Models for the ``linklist`` app.""" from django.db import models from django.utils.translation import ugettext_lazy as _ from filer.fields.image import FilerImageField class LinkCategory(models.Model): """ Category for a link. """ name = models.CharField( max_length=256, verbose_n...
import os import sys import copy import logging from checker import * from .ofp import register_ofp_creators from .ofp import OfpBase from .ofp_port_stats import SCE_PORT_STATS from .ofp_port_stats import OfpPortStatsCreator # YAML: # port_stats_reply: # flags: 0 # body: # - port_stats: # port_no: 0 #...
# -*- coding: utf-8 -*- import socket, time, select, logging from SocketCommunication import read, write class RemoteBeast(object): """ Remote Beast class. """ def __init__(self, socket, server): self.socket = socket self.server = server self.log = logging.getLogger('beast-aren...
# Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution: # @param {TreeNode} p # @param {TreeNode} q # @return {boolean} def isSameTree(self, p, q): if not q and not p: retur...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from unittest import TestCase import logging import uuid import warnings import sys from nose.tools import eq_, raises from requests.packages.urllib3.exceptions import InsecurePlatformWarning import requests import ...
class DictWrapper(object): def __init__(self, d): if isinstance(d, list): # if the first level element is a list setattr(self, "._length", len(d)) for index, item in enumerate(d): setattr(self, "[%s]" % index, DictWrapper(item)) else: for key, val...
import os import re from os.path import dirname as parent APPROOT = parent(parent(parent((os.path.realpath(__file__))))) # Basic configuration settings DEBUG = True HOST = '0.0.0.0' PORT = 8152 SECRET_KEY = 'a secret key --- MUST set this to something unique and strong' FORCE_SSL = False # DANGEROUS: Allow arbitrary P...
""" Created on Sun Apr 12 20:20:48 2015 @author: Ziang """ import time import numpy as np from math import exp, sqrt, pi from numpy.random import normal, choice from scipy import linalg from matplotlib import pyplot as plt from GPSVI.util.inverse import cho_inverse from GPSVI.util.kernel import compute_kernel from GPS...
import re, shutil from vsa.infra import logger from xml.dom.minidom import parse, parseString from vsa.infra.processcall import process_call #from processcall import * #on both: drbdadm create-md resource #on both: drbdadm up resource #on source: drbdadm -- --overwrite-data-of-peer primary resource drbd_resource_file...
import pygame from pygame.locals import * from common import * from Point import Point from Vector2 import Vector2 from Cell import Cell from Text import Text from Field import Field # TODO: <Mouse> class. FPS = 60 SCREEN_WIDTH = 800 SCREEN_HEIGHT = 600 CELL_WIDTH = 20 CELL_HEIGHT = CELL_WIDTH CELL_AMOUNT_X = SCREEN_...
"""Test various command line arguments and configuration file parameters.""" import os from test_framework.test_framework import BitcoinTestFramework class ConfArgsTest(BitcoinTestFramework): def set_test_params(self): self.setup_clean_chain = True self.num_nodes = 1 def test_config_file_pa...
# -*- coding: utf-8 -*- # Scrapy settings for postnext project # # For simplicity, this file contains only settings considered important or # commonly used. You can find more settings consulting the documentation: # # http://doc.scrapy.org/en/latest/topics/settings.html # http://scrapy.readthedocs.org/en/lates...
""" PHPLY -------------------- PHP implemented in Python """ from setuptools import setup, find_packages setup(name="phply", version="dev", packages=find_packages(), namespace_packages=['phply'], include_package_data=True, author='Ramen', author_email='', description='PHP in P...
""" Service implementation for SVOX Pico TTS """ from .base import Service from .common import Trait __all__ = ['Pico2Wave'] class Pico2Wave(Service): """ Provides a Service-compliant implementation for SVOX Pico TTS. """ __slots__ = [ '_binary', # path to the pico2wave binary ...
''' Created on Mar 7, 2014 @author: curly ''' import datetime import keywords import matrices import normalize import count import sentiment from copy import deepcopy import numpy as np from sklearn.covariance import GraphLassoCV from sklearn import manifold, cluster from matplotlib.collections im...
from msrest.serialization import Model class ApplicationGatewayWebApplicationFirewallConfiguration(Model): """Application gateway web application firewall configuration. :param enabled: Whether the web application firewall is enabled or not. :type enabled: bool :param firewall_mode: Web application f...
import json from django.utils.encoding import force_text from germanium.tools import assert_true, assert_not_equal from germanium.test_cases.client import ClientTestCase from germanium.decorators import login from germanium.crawler import Crawler, LinkExtractor from germanium.crawler import HTMLLinkExtractor as Origi...
import csv import requests from multiprocessing import Process, Queue, Value, Lock, current_process import queue from datetime import datetime, timedelta import signal import logging import time import pandas as pd import datetime import json from bs4 import BeautifulSoup NUM_JOBS = 32 def _time_to_str(time): ret...
from __future__ import (absolute_import, division, print_function, unicode_literals) import os import numpy as np import scipy.linalg if os.environ.get("USE_FAST_FAKELU", "0") == "1": print("Using C++ extension for FakeLU") from fakelu import fast_FakeLU as FakeLU else: from fakelu...
import logging from rpclib.application import Application from rpclib.decorator import srpc from rpclib.interface.wsdl import Wsdl11 from rpclib.protocol.xml import XmlObject from rpclib.protocol.http import HttpRpc from rpclib.service import ServiceBase from rpclib.model.complex import Iterable from rpclib.model.prim...
"""Provide a bipartite graph which implements OneSum algorithm. The bipartite graph implemented in this module uses normalized summations for updated anomalous scores. """ from __future__ import absolute_import from ria import bipartite class Reviewer(bipartite.Reviewer): """Reviewer which uses normalized summat...
import mock from tornado import ( httpclient, testing, web, ) class Base(testing.AsyncHTTPTestCase): def get_app(self): class Nothing(web.RequestHandler): def nothing(self): pass delete = get = head = options = post = put = nothing return web.Appl...
import os from wlauto import AndroidUxPerfWorkload, Parameter from wlauto.exceptions import ValidationError class GoogleSlides(AndroidUxPerfWorkload): name = 'googleslides' package = 'com.google.android.apps.docs.editors.slides' activity = '' view = [package + '/com.google.android.apps.docs.quickof...
import os from werckercli.tests import ( DataSetTestCase, TempHomeSettingsCase, ) from werckercli.paths import ( find_git_root, get_global_wercker_path, WERCKER_FOLDER_NAME, WERCKER_CREDENTIALS_FILE, get_global_wercker_filename, check_or_create_path ) class GitFindRepoTests(DataSetTe...
#!/usr/bin/env python ## This is call back script which will be executed after created the grib2 files. ## ## Hycom Model Input requires analysis of 06, 09, 12, 15, 18, 21-hours from ## yesterday and 00 & 03-hours from today date. All 3-hourly forecasts from ## today date. ## ## While creating tar ball, all files m...
from pylab import * from custom_legends import colorLegend from objhist import * __all__ = ['plotHLAFreq'] ic50Ticks=array([10, 25, 50, 100, 250, 500, 1000, 2500, 5000, 10e3], dtype=int) def plotHLAFreq(hlaDf,twoDigit=True,groupColumn=None,stackColumn=None,loci='AB',cutoff=0.05,annotateCount=True): """Bar plot ...
# -*- coding: utf-8 -*- """ Lightning fast binary callbacks using F90 for array expressions """ import os import sysconfig from collections import defaultdict import sympy from sympy.core.compatibility import iterable import numpy as np from pycompilation import import_module_from_file, FileNotFoundError from pycomp...
from typing import List from django.conf import settings from base.models import Lexicon from lib.domain import Questions from lib.wdb_interface.exceptions import WDBError from lib.wdb_interface.word_searches import SearchDescription from rpc.wordsearcher.searcher_pb2_twirp import ( QuestionSearcherClient, TwirpE...
from __future__ import print_function from six import string_types import logging logger = logging.getLogger(__name__) error = logger.error warn = logger.warn info = logger.info debug = logger.debug from copy import copy, deepcopy import math from partycrasher.crash import Crash, Stacktrace, Stackframe from partycr...
import sys import glob import os import gammalib import ctools from cscripts import modutils # ================== # # comsrcdetect class # # ================== # class comsrcdetect(ctools.cscript): """ Perform SRCLIX model fitting of COMPTEL observations """ # Constructor def __init__(self, *argv)...