text
stringlengths
12
6.59M
""" BenchBuild's skeleton for experiments. An benchbuild.experiment defines a series of phases that constitute a benchbuild compatible experiment. This is the default implementation of an experiment. Clients can derive from class class::benchbuild.experiment.Experiment and override the methods relvant to their experi...
""" Extension base-classes for compile-time and run-time experiments. """ import logging from abc import ABCMeta, abstractmethod from collections import Iterable import parse from plumbum import local from benchbuild.utils.run import (track_execution, handle_stdin, ...
################ # New Analysis # ################ # Goal is to eliminate noise not related to the Hemodynamic response by using # 1) fourier (cosine/sine curves) to capture cyclic response and # 2) a basic drift function to capture linear time drift ############# # Questions # ############# # Questions brought ab...
# Copyright (c) 2013, Red Hat, Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and the...
import logging from binascii import a2b_hex, b2a_hex from pylons import request, response, session, tmpl_context as c from pylons.controllers.util import abort, redirect_to from pylons.decorators import jsonify from communityalmanac.lib.base import BaseController, render from communityalmanac.lib import helpers as h ...
#!/usr/bin/env python # Copyright 2021 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 ...
from conference_scheduler import parameters import numpy as np def test_tag_array(events): tag_array = parameters.tag_array(events) assert np.array_equal(tag_array, np.array([[1, 0], [1, 1], [0, 1]])) def test_session_array(sessions): session_array = parameters.session_array(sessions) assert np.arra...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2017 Lenovo # # 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...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2016, 2017 Lenovo # # 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 requir...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2016, 2017 Lenovo # # 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 requir...
#!/usr/bin/python3 # # Copyright (C) 2017 Dell, Inc. # # SPDX-License-Identifier: LGPL-2.1+ # from base64 import b64decode import io import os import subprocess import sys import shutil import tempfile import zipfile TAG = b'#\x00' def parse_args(): import argparse parser = argparse.ArgumentParser(description=...
#!/usr/bin/python import sys import trac.env from trac.ticket.default_workflow import load_workflow_config_snippet def main(): """Rewrite the ticket-workflow section of the config; and change all 'assigned' tickets to 'accepted'. """ if len(sys.argv) != 2: print "Usage: %s path_to_trac_environ...
import logging from couchdbkit.exceptions import ResourceNotFound from corehq.apps.domain.models import Domain from corehq.apps.reports.analytics.couchaccessors import get_ledger_values_for_case_as_of from corehq.apps.reports.analytics.esaccessors import get_wrapped_ledger_values from dimagi.utils.couch.database impor...
from __future__ import print_function from __future__ import absolute_import from __future__ import unicode_literals import datetime import mock from django.test import SimpleTestCase from corehq.apps.export.models import FormExportInstance, TableConfiguration, ExportColumn, ScalarItem, PathNode from corehq.apps.repor...
from django.test import SimpleTestCase from corehq.apps.userreports.exceptions import BadSpecError from corehq.apps.userreports.filters import ANDFilter, ORFilter, NOTFilter from corehq.apps.userreports.filters.factory import FilterFactory class PropertyMatchFilterTest(SimpleTestCase): def get_filter(self): ...
from __future__ import absolute_import from __future__ import unicode_literals import logging import re from collections import namedtuple from couchdbkit.exceptions import BulkSaveError from django.conf import settings from lxml import etree from redis.exceptions import RedisError from casexml.apps.case.exceptions i...
import pytest import unittest from unittest import mock import responses from cumulusci.core.exceptions import TaskOptionsError, BulkDataException from cumulusci.tasks.bulkdata import DeleteData from cumulusci.tasks.bulkdata.step import ( DataOperationStatus, DataOperationResult, DataOperationJobResult, ...
from __future__ import absolute_import from __future__ import unicode_literals from datetime import datetime from django.db.models.aggregates import Sum from django.utils.translation import ugettext as _ from corehq.util.quickcache import quickcache from custom.icds_reports.messages import wasting_help_text, stunting...
from __future__ import absolute_import import json import mock from datetime import datetime from django.core.serializers.json import DjangoJSONEncoder from django.test.testcases import TestCase from custom.icds_reports.sqldata import ChildrenExport, PregnantWomenExport, ExportableMixin, DemographicsExport, \ S...
from enthought.traits.api import Code, Button, Int, on_trait_change, Any, HasTraits,List, Str, Enum, Instance, Bool from enthought.traits.ui.api import (View, Item, Group, HGroup, CodeEditor, spring, Handler, EnumEditor) from cviewer.plugins.cff2.cnetwork import CNetwork class Ma...
# # ICRAR - International Centre for Radio Astronomy Research # (c) UWA - The University of Western Australia, 2016 # Copyright by UWA (in the framework of the ICRAR) # All rights reserved # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser G...
# -*- coding: utf-8 -*- ''' Création : 30 juin 2015 @author: Eric Lapouyade ''' __version__ = '0.0.4' __all__ = ['Dict', 'AddDict', 'NoAttrDict', 'NoAttr'] from noattr import NoAttr import re import copy import pprint pp = pprint.PrettyPrinter(indent=4) import types def isgenerator(arg): return isinstance(arg,...
import discord from discord.ext import commands from sys import argv class Assistance: """ Commands that will mostly be used in #help-and-questions. """ def __init__(self, bot): self.bot = bot self.systems = systems = ("3ds", "wiiu", "wii u") print('Addon "{}" loaded'.format(sel...
{ 'name': 'Web', 'category': 'Hidden', 'description': """ OpenERP Web core module. ======================== This module provides the core of the OpenERP Web Client. """, 'depends': [], 'auto_install': True, 'post_load': 'wsgi_postload', 'js' : [ "static/lib/datejs/gl...
# -*- coding: utf-8 -*- #---------------------------------------------------------- # OpenERP Web HTTP layer #---------------------------------------------------------- import ast import contextlib import functools import logging import os import pprint import sys import threading import time import traceback import ur...
import csv from datetime import datetime import re from StringIO import StringIO import formencode from pylons import tmpl_context as c from pylons.i18n import _ from webhelpers.html import literal from adhocracy.lib.auth.authorization import has FORBIDDEN_NAMES = ["www", "static", "mail", "edit", "create", "settin...
import re import json from schema import Schema, And, SchemaError, Optional from . Service import Service, validate_phone class PaymentService(Service): BANK = { 'FCMB_NG': 234001, 'Zenith_NG': 234002, 'Access_NG': 234003, 'GTBank_NG': 234004, 'Ecobank_NG': 234005, ...
#!/usr/bin/env python import re import os import argparse from itertools import izip import numpy as np from astropy.table import Table, Column from astropy.time import Time import tables import matplotlib import matplotlib.pyplot as plt from matplotlib.patches import Rectangle import mpld3 data_root = '.' h5_fil...
# -*- coding: utf-8 -*- # # Copyright (C) 2014 Alexander Shorin # All rights reserved. # # This software is licensed as described in the file LICENSE, which # you should have received as part of this distribution. # import asyncio import contextlib import functools import os import unittest import unittest.mock as moc...
from pathlib import Path class MergeDict(dict): def __init__(self, iterable=None, **kwargs): if iterable: result = {} result.update(iterable) result.update(kwargs) kwargs = result super().__init__() for k, v in kwargs.items(): if ...
#!/usr/bin/env python # -*- coding: utf-8 -*- #from zope.interface import Interface from PIL import ImageGrab import win32api,win32con,win32gui,win32process import autopy import ctypes,ctypes.wintypes import pygame import os,sys import time #def getNetFlow(appname=None) # Get current network flow class RECT(...
__version__ = '2.1.2'
import sys import datetime import pymongo from alerta.common import log as logging from alerta.common import config from alerta.common.alert import AlertDocument from alerta.common.heartbeat import HeartbeatDocument from alerta.common import severity_code, status_code LOG = logging.getLogger(__name__) CONF = config....
import json import asyncio from alexis import Command from alexis.base.utils import is_float chaucha_api = 'https://api.orionx.io/graphql' chaucha_json = [{ "operationName": "marketCurrentStats", "query": "query marketCurrentStats($marketCode: ID!) { market(code: $marketCode) { lastTrade { price } } }", ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # pylint: disable=global-statement # Copyright (c) 2015-2018: # Frederic Mohier, frederic.mohier@alignak.net # """ Alignak - Web User Interface """ # Package name __pkg_name__ = u"alignak_webui" # Checks types for PyPI keywords # Used for: # - PyPI keywords # - dir...
import math from django.shortcuts import render from django.views import generic from allauthdemo.auth.models import DemoUser from allauthdemo.demo.models import Problem from fileupload.models import Submission from allauthdemo.demo.models import ContestParticipation class ProblemView(generic.ListView): model = Pr...
# -*- coding: utf-8 -*- import re from django.utils import timezone from django.db.models import Q, Count from django import forms from django.contrib import messages from django.core.urlresolvers import reverse from django.utils.encoding import force_str from itertools import islice from urllib import urlencode from ...
from rest_framework import serializers from drf_extra_fields.geo_fields import PointField as PointFieldSerializer from django.contrib.auth.models import User from django.core.exceptions import PermissionDenied import django.db.models as models from .models import Profile, Hospital, Ambulance, \ AmbulancePermissio...
#!/usr/bin/env python # vim: set sw=2 ts=2 softtabstop=2 expandtab: """ This script generates a "quantile" style plot inspired by the quantile plots used SV-COMP. """ import argparse import logging import os import pprint import sys import yaml from br_util import FinalResultType, classifyResult, validateMappingFile fr...
''' This file is part of Arakoon, a distributed key-value store. Copyright (C) 2010 Incubaid BVBA Licensees holding a valid Incubaid license may use this file in accordance with Incubaid's Arakoon commercial license agreement. For more information on how to enter into this agreement, please contact Incubaid (contact d...
from collections import defaultdict import logging import itertools import networkx import pyvex import simuvex import claripy from archinfo import ArchARM from simuvex import SimEngineProcedure from ..entry_wrapper import BlockID, EntryDesc from ..analysis import register_analysis from ..errors import AngrCFGError,...
import numpy as np class Metrics: def __init__(self, config): self.iou_threshold = config['network']['predict']['iou_threshold'] self.prob_threshold = config['network']['predict']['prob_threshold'] self.image_size = config['image_info']['image_size'] self.grid_size = config['labe...
# -*- coding: utf-8 -*- import bpy from anima.env.base import EnvironmentBase class Blender(EnvironmentBase): """The Blender environment wrapper """ name = "Blender%s.%s" % (bpy.app.version[0:2]) representations = ['Base'] has_publishers = True extensions = ['.blend'] project_structu...
"""Author: Konrad Zemek Copyright (C) 2015 ACK CYFRONET AGH This software is released under the MIT license cited in 'LICENSE.txt' Brings up a set of oneprovider worker nodes. They can create separate clusters. """ import copy import json import os from . import common, docker, riak, couchbase, dns as dns_mod PROV...
""" Experiment to use the JSON formatted data provided by the AN for the doslegs python dossier_from_opendata.py <dosleg_url> """ import sys import json import zipfile import io import re from lawfactory_utils.urls import download, enable_requests_cache, clean_url, parse_national_assembly_url def same_stage_step...
""" Experiment to use the JSON formatted data provided by the AN for the doslegs python dossier_from_opendata.py <dosleg_url> """ import sys import json import zipfile import io from lawfactory_utils.urls import download, enable_requests_cache, clean_url import lawfactory_utils.urls from anpy.dossier import get_l...
''' @author: Dallas Fraser @date: 2016-04-12 @organization: MLSB API @summary: Holds a class LeagueList that helps imports a League (list of games) ''' # imports from sqlalchemy import func from api.model import Sponsor, Game, League from api import DB from api.errors import InvalidField, LeagueDoesNotExist, TeamDoesNo...
# oxAuth is available under the MIT License (2008). See http://opensource.org/licenses/MIT for full text. # Copyright (c) 2018, Gluu # # Author: Yuriy Movchan # from javax.ws.rs.core import Response from org.jboss.resteasy.client import ClientResponseFailure from org.jboss.resteasy.client.exception import ResteasyClie...
# -*- coding: utf-8 -*- # Copyright (c) 2013, Camptocamp SA # All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright notice, this # l...
from c2corg_common.attributes import default_langs from c2corg_api.models.document import DocumentLocale from c2corg_api.models.user_profile import UserProfile from c2corg_api.views.document import DocumentRest from functools import partial from pyramid.httpexceptions import HTTPInternalServerError from cornice.resou...
# -*- coding: utf-8 -*- from cacheops.conf import redis_client, handle_connection_failure from cacheops.utils import get_model_name, non_proxy __all__ = ('invalidate_obj', 'invalidate_model', 'invalidate_all') def serialize_scheme(scheme): return ','.join(scheme) def deserialize_scheme(scheme): return tupl...
# coding=utf-8 import gc import json import random import re import socket import threading import time import traceback import urllib.parse from datetime import datetime from logging import getLogger, captureWarnings, Formatter, DEBUG, INFO, CRITICAL from logging.handlers import RotatingFileHandler import tweepy from...
from base64 import b64encode from optparse import make_option import json import urllib import urllib2 import argparse import time import os import subprocess def install_dependencies(): print "If the server stalls on installing GEMS, run <source /usr/local/rvm/scripts/rvm; gem install dep-selector-libgecode -v '1...
from base64 import b64encode from optparse import make_option import json import urllib import urllib2 import argparse import time import os import subprocess import shutil def install_dependencies(): print "If the server stalls on installing GEMS, run <source /usr/local/rvm/scripts/rvm; gem install dep-selector-l...
# Lint as: python3 # Copyright 2019 DeepMind Technologies Limited. 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 # # ...
# -*- coding: utf-8 -*- """ apps.books.views ~~~~~~~~~~~~~~ views for books :copyright: (c) 2012 by arruda. """ import datetime from django.shortcuts import redirect, get_object_or_404 from django.contrib.auth.decorators import login_required from annoying.decorators import render_to from util...
# NOT_RPYTHON """ A pure Python reimplementation of the _sre module from CPython 2.4 Copyright 2005 Nik Haldimann, licensed under the MIT license This code is based on material licensed under CNRI's Python 1.6 license and copyrighted by: Copyright (c) 1997-2001 by Secret Labs AB """ MAXREPEAT = 2147483648 MAXGROUPS =...
import os import csv #Aaron hall, fastest way to find a string inside a string #Take in text and award points def points4words (text, bonus): bonusinstuff = [text.count(word) for word in bonus] points = len(text) message = "Your text is worth {} points!" print(message.format(int(points))) bonuspoin...
# Perfect Tic Tac Toe AI, it will never lose. # Created and programmed by Jordan Oberstein. import random X = "X" # define both letters O = "O" # define both letters empty = " " # define an empty space S = [" ", " ", " ", " ", " ", " ", " ", " ", " "] # array of 9 spaces turn = 0 # turn counter def Instructions(): ...
"""Config flow to configure the Synology DSM integration.""" from __future__ import annotations import logging from typing import Any from urllib.parse import urlparse from synology_dsm import SynologyDSM from synology_dsm.exceptions import ( SynologyDSMException, SynologyDSMLogin2SAFailedException, Synol...
# Copyright 2012 the rootpy developers # distributed under the terms of the GNU General Public License """ This module contains base classes defining core funcionality """ from __future__ import absolute_import from functools import wraps import warnings import sys import ROOT from .. import asrootpy from ..decorato...
import argparse import logging import time from cax.config import mongo_password from cax.tasks import checksum, clear, data_mover, process def single(): raise RuntimeError("cax-single has been removed: use cax --once instead") def main(): parser = argparse.ArgumentParser(description="Copying All kinds of ...
import random from snake import * # Barva glave in repa COLOR_HEAD = '#00FFF2' COLOR_TAIL = '#99FF00' class BlueKrait(Snake): def __init__(self, field, x, y, dx, dy): # Poklicemo konstruktor nadrazreda Snake.__init__(self, field = field, color_head = COLOR_HEAD, ...
""" This module contains base classes defining core funcionality """ import ROOT from .style import Color, LineStyle, FillStyle, MarkerStyle from .canvas import Canvas from .. import rootpy_globals as _globals def dim(hist): if hasattr(hist, "__dim__"): return hist.__dim__() return hist.__class__.DI...
#!/usr/bin/env python3 #-*- coding: utf-8 -*- # TopoPy GUI # # A Python-based topographic drawings software. # This software is released under the Apache 2.0 License. # # Author: Johan Barthelemy # Date: December 2015 # Version: 7 # TODO: if only 2 data point (x and y), then just draw a line, it is a part of a buildi...
# -*- coding: utf-8 -*- #BEGIN_HEADER from __future__ import print_function from __future__ import division import os import sys import shutil import hashlib import subprocess import requests requests.packages.urllib3.disable_warnings() import re import traceback import uuid from datetime import datetime from pprint i...
# Copyright 2014-2016 Open Source Robotics Foundation, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
# (C) Datadog, Inc. 2019-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) from contextlib import contextmanager import pytest from six import PY3 from .env import environment_run from .structures import EnvVars, LazyFunction, TempDir from .subprocess import run_command from .u...
#!usr/bin/python3.3 '''Getting the module''' import os import sys import re import subprocess from os import listdir from os.path import isfile, join check = 0 fileLst = [] dictLink = {} while(check != 1): directory = input("Enter the full (absolute) path of the directory: ") if os.path.isdir(directory): ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2016 Open Permissions Platform Coalition # 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 -*- #BEGIN_HEADER from __future__ import print_function from __future__ import division import os import sys import shutil import hashlib import subprocess import requests requests.packages.urllib3.disable_warnings() import re import traceback import uuid from datetime import datetime from pprint i...
# # Copyright 2017 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
#!/usr/bin/env python2.7 #from __future__ import unicode_literals import sys import wx from lxml import html as hlxml from lxml import etree import certifi import urllib3 import pyOpenSSL import urllib3.contrib.pyopenssl urllib3.contrib.pyopenssl.inject_into_urllib3() import statvfs import os from multiprocessing im...
from Tkinter import Tk, W, E, FLAT, RIGHT, END from ttk import Frame, Button, Label, Style, Entry import Tkinter #################### Calculator class #################### class Calculator(Frame): def __init__(self, parent): # Calling the constructor method of the inherited class. Frame.__init...
# -*- coding: utf-8 -*- #BEGIN_HEADER from __future__ import division from __future__ import print_function import copy import math import os import re import sys import uuid import random from datetime import datetime from pprint import pformat,pprint import ete3 import matplotlib.pyplot as pyplot # use this instea...
#!/usr/bin/env python # encoding: utf-8 import argparse import os.path from zstacklib import * from datetime import datetime def add_true_in_command(cmd): return "%s || true" % cmd # create log logger_dir = "/var/log/zstack/" create_log(logger_dir) banner("Starting to deploy zstack sharedblock agent") start_time...
# Copyright 2018 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
# # Copyright 2014, NICTA # # This software may be distributed and modified according to the terms of # the BSD 2-Clause license. Note that NO WARRANTY is provided. # See "LICENSE_BSD2.txt" for details. # # @TAG(NICTA_BSD) # ''' The jinja2 template code runs in a very restricted environment during rendering. For examp...
# -*- coding: utf-8 -*- #BEGIN_HEADER from __future__ import print_function from __future__ import division import os import sys import shutil import hashlib import subprocess import requests requests.packages.urllib3.disable_warnings() import re import traceback import uuid from datetime import datetime from pprint i...
from sqlalchemy import orm from sqlalchemy.ext.declarative import declarative_base, DeclarativeMeta from query import * from cantools import util def choice_validator(choices): def cval(s, k, v): if v not in choices: util.error("can't set %s! %s not in %s"%(k, v, choices)) return v ...
# # init_lib.py # # functions for initialization # from aws_lib import SpinupError import base64 from boto import vpc, ec2 from os import environ from pprint import pprint import re from yaml_lib import yaml_attr def read_user_data( fn ): """ Given a filename, returns the file's contents in a string. ...
import json class profile: def __init__(self, name, allowed_profiles, metadata): self.name = name self.type = "container" self.allowed_profiles = allowed_profiles self.metadata = metadata def main(): profiles = [] metadata1 = {"cdmi_latency": "300", "cdmi_geographic_placeme...
""" Copyright 2016 Poznan Supercomputing and Networking Center 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 """ import json import configparser import...
import copy from warnings import filterwarnings from carto.kuvizs import KuvizManager from ..data.clients.auth_api_client import AuthAPIClient from ..exceptions import PublishError from ..utils.logger import log filterwarnings('ignore', category=FutureWarning, module='carto') DEFAULT_PUBLIC = 'default_public' cla...
import uuid from functools import partial from collections import defaultdict import pandas as pd from .event import listens_for from .population import uses_columns class TableView: """A callable that looks up columns in the merged lookup table for simulant in an index Parameters ---------- index :...
''' Functions to measure observables of a given galaxy sample. The main observables are: SFMS, SFM, SMHMR ''' import util as UT import numpy as np # --- local --- from sham_hack import SMFClass def f_sat(logm, z): ''' satellite fraction (Figure 3 b) parameterized as f_sat = B0(logm) + B1(...
import os, csv, time, shutil, math from distutils.command.config import config from collections import deque from ch import logger class DeltaHedge(): _log = None _config = None _session = None _instruments = None _interestRate = None _fileName = None _filePath = None _bckFilePath = Non...
import sys, os, re import iso8601 import datetime # Load the on-time parquet file on_time_dataframe = spark.read.parquet('data/on_time_performance.parquet') on_time_dataframe.registerTempTable("on_time_performance") # Select a few features of interest simple_on_time_features = sqlContext.sql(""" SELECT FlightNum, ...
#!/usr/bin/env python #Copyright (C) 2013 by Ngan Nguyen (nknguyen@soe.ucsc.edu) # #Released under the MIT license, see LICENSE.txtimport unittest #Wed Apr 10 15:30:53 PDT 2013 # #Generates necessary files to make assembly hub #Input: 1/ Output directory (e.g ~nknguyen/public_html/ecoli/hub/testhubs) # 2/ hal f...
from __future__ import print_function import contextlib import sys import threading class GlobalConfig(object): """The plain object that represents the global configuration of Chainer.""" def show(self, file=sys.stdout): """show(file=sys.stdout) Prints the global config entries. Th...
import collections import heapq import traceback import weakref import numpy import six import chainer from chainer import _backprop_utils from chainer.backends import cuda from chainer import backend from chainer import configuration from chainer import function_hook from chainer.graph_optimizations.static_graph_uti...
import discord import datetime import time import json import codecs from urllib.parse import urlparse from psycopg2.extras import Json from jshbot import data, utilities, configurations, plugins, logger from jshbot.exceptions import ConfiguredBotException, BotException, ErrorTypes from jshbot.commands import ( C...
#!/usr/bin/env python import pytifylib import menu import argparse import sys import curses class App: def __init__(self): self.pytify = pytifylib.get_pytify_class_by_platform()() self.run() def menu(self, list): self.list = list curses.wrapper(self.menu_items) def menu...
#! /usr/bin/env python """The main application logic for PyTips.""" from __future__ import print_function from __future__ import unicode_literals from __future__ import absolute_import import json import random from flask import Flask import requests app = Flask(__name__) QUERY = "#python+tip" PER_PAGE = 100 SEARCH...
""" A simple plugin to record waken people and return order of waking. """ import logging from . import TimerBot from datetime import datetime, date from dateutil.parser import parse as parse_date from threading import Lock from redis_variable import RedisVariable logger = logging.getLogger(__name__) class ZaoBot(Ti...
from __future__ import unicode_literals import os from os.path import dirname import shutil import sys import tempfile import unittest try: from unittest.mock import MagicMock except: from mock import MagicMock from green import loader class TestToProtoTestList(unittest.TestCase): def test_moduleImp...
#!/usr/bin/env python3 import argparse import csv import os import re import time import malaffinity import praw import requests wait_between_requests = 2 retry_after_failed_request = 5 search_comment_body = False regex = "myanimelist\.net/(?:profile|animelist)/([a-z0-9_-]+)" regex = re.compile(regex, re.I) # S...
""" Splitting fields into tiles """ import os import glob import numpy as np import astropy.wcs as pywcs from collections import OrderedDict import yaml from .. import utils def make_all_fields(): """ Define tile layout """ layout = """# field ra dec dx dy abell370 39.9750000 -1.5752778 ...
import asyncio from enum import Enum, unique from logging import getLogger from typing import Optional, Union import aiormq from .message import Message from .types import TimeoutType log = getLogger(__name__) @unique class ExchangeType(Enum): FANOUT = "fanout" DIRECT = "direct" TOPIC = "topic" HEA...
""" Drizzled mosaics in tiles and subregions Here the sky is tesselated in 4 degree patches with sizes that are increased slightly to be integer multiples of 512 0.1" pixels Individual subtiles are 256 x 0.1" = 25.6" """ import os from tqdm import tqdm import numpy as np from . import db def define_tile_grid(a=4....