text stringlengths 17 737k |
|---|
# Copyright 2011 James McCauley
#
# This file is part of POX.
#
# POX 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.
#
# POX is distri... |
import const
import base_player
from random import randint
class Player(base_player.BasePlayer):
class BoardRep:
# board representation thingy
class BoardRow:
def __init__(self, isShort, filler):
self._isShort = isShort
if isShort:
s... |
# Copyright 2011 James McCauley
#
# This file is part of POX.
#
# POX 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.
#
# POX is distri... |
# Copyright 2017 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... |
#builtin
from functools import partial
import time
#external
import unittest
from Qt import QtCore, QtWidgets
import six
#internal
from qconcurrency.testutils import mock
from qconcurrency.threading_ import *
from qconcurrency import QApplication
qapplication = QApplication(... |
from __future__ import print_function
from collections import Counter, defaultdict, deque
from functools import partial, wraps
from heapq import merge
from itertools import (
chain,
compress,
count,
cycle,
dropwhile,
groupby,
islice,
repeat,
starmap,
takewhile,
tee
)
from op... |
# -*- coding: utf-8 -*-
# Copyright (c) 2012-2016 CoNWeT Lab., Universidad Politécnica de Madrid
# This file is part of Wirecloud.
# Wirecloud 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 v... |
# queue.py: adapted from uasyncio V2
# Copyright (c) 2018-2020 Peter Hinch
# Released under the MIT License (MIT) - see LICENSE file
# Code is based on Paul Sokolovsky's work.
# This is a temporary solution until uasyncio V3 gets an efficient official version
import uasyncio as asyncio
# Exception raised by get_no... |
"""
Test outgoing call handling. This tests the happy scenario
when the remote party accepts the call.
"""
from gabbletest import exec_test, make_result_iq
from servicetest import make_channel_proxy, unwrap, tp_path_prefix
from twisted.words.xish import domish
import jingletest
import gabbletest
import dbus
import ti... |
#!/usr/bin/env python
##
## /svn-src/printer/src/cxi/utils.py
##
import sys
import socket
import re
from time import sleep
DEBUG = 0
XSTART = 10
YSTART = 10
SPACE = " "
EOL = "\n"
#####################################################################
class cxiAccess():
""" socket link up with a cxi printer """
... |
# 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... |
import datetime
import logging
from django.conf import settings
from memoized import memoized
from django.db import models
from django.contrib.postgres.fields import JSONField
from corehq.apps.domain.models import Domain
log = logging.getLogger(__name__)
class RegistrationRequest(models.Model):
tos_confirmed ... |
from numpy import ndarray, asarray, apply_over_axes, ufunc, prod
from bolt.base import BoltArray
class BoltArrayLocal(ndarray, BoltArray):
def __new__(cls, array):
obj = asarray(array).view(cls)
obj._mode = 'local'
return obj
def __array_finalize__(self, obj):
if obj is None:... |
import requests
def scrapes():
s = []
s.append(['title', 'xpath', "//title/text()"])
s.append(['description', 'xpath', "//meta[@name='description']/@content"])
s.append(['tweets', 'xpath', "//span[.='Tweets']/following-sibling::span/text()"])
s.append(['following', 'xpath', "//span[.='Following'... |
from collections import namedtuple
from decimal import Decimal
from django.conf import settings
from django.db import models
from corehq.apps.accounting import models as accounting
from corehq.apps.accounting.models import Currency
from corehq.apps.accounting.utils import EXCHANGE_RATE_DECIMAL_PLACES
from corehq.apps... |
from flask import (
Flask,
flash,
g,
session,
redirect,
render_template,
request,
)
from flask.ext.mongoengine import MongoEngine
import datetime
import os
import random
app = Flask(__name__)
app.config["MONGODB_SETTINGS"] = {'DB': 'furrypoll_2015'}
app.config["SECRET_KEY"] = os.urandom(1... |
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import calendar
import collections
import datetime
import glob
import logging
import math
import os
import re
import shutil
import subprocess
import sys
import time
from threading import Timer
import ccdproc
i... |
__version__ = "0.4.17"
|
# -*- coding: utf-8 -*-
# @Author: oesteban
# @Date: 2016-07-21 11:28:52
""" A robust ANTs T1-to-MNI registration workflow with fallback retry """
from __future__ import print_function, division, absolute_import, unicode_literals
from os import path as op
import shutil
import pkg_resources as pkgr
from nipype.inter... |
# -*- coding: utf-8 -*-
# Natural Language Toolkit: IBM Model Core
#
# Copyright (C) 2001-2015 NLTK Project
# Author: Tah Wei Hoon <hoon.tw@gmail.com>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
"""
Common methods and classes for all IBM models. See ``IBMModel1``,
``IBMModel2``, ``IBMModel3``,... |
from __future__ import absolute_import
import os
import argparse
import collections
from cv2 import calcOpticalFlowFarneback as sw_farneback_optical_flow
from butterflow.__init__ import __version__
from butterflow import avinfo, motion, ocl, settings
from butterflow.render import Renderer
from butterflow.sequence impo... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
""" MultiQC module to parse output from bcbio"""
from __future__ import print_function
from collections import OrderedDict
import logging
import os
import re
from collections import defaultdict
import yaml
from multiqc import config
from multiqc.modules.base_module impo... |
"""
Tools to prepare data for an FVCOM run.
A very gradual port of the most used functions from the MATLAB toolbox:
https://github.com/pwcazenave/fvcom-toolbox/tree/master/fvcom_prepro/
Author(s):
Mike Bedington (Plymouth Marine Laboratory)
Pierre Cazenave (Plymouth Marine Laboratory)
"""
import copy
import it... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import locale
from datetime import datetime, date, time
from itertools import chain
import re
from BeautifulSoup import Tag
from utils import fetch_html_content, count_words, make_soup_from_html_content
from article import ArticleData, tag_URL
# for datetime co... |
"""
Tools to prepare data for an FVCOM run.
A very gradual port of the most used functions from the MATLAB toolbox:
https://github.com/pwcazenave/fvcom-toolbox/tree/master/fvcom_prepro/
Author(s):
Mike Bedington (Plymouth Marine Laboratory)
Pierre Cazenave (Plymouth Marine Laboratory)
"""
import os
import scip... |
# -*- coding: utf-8 -*-
"""
Handy things for interactive sessions.
"""
from __future__ import print_function, division
try:
import sip
sip.setapi('QString', 2)
sip.setapi('QVariant', 2)
except:
pass
"""matplotlib niceness:
import mpltools.style
mpltools.style.use('ggplot')
and
plt.tight_layout()
"""
... |
"""
predict the estimated arrival time based on the
"""
# import module
import pandas as pd
import os
from datetime import datetime, timedelta
path = '../'
def calculate_arrival_time(stop_dist, prev_dist, next_dist, prev_timestamp, next_timestamp):
"""
Calculate the arrival time according to the given tup... |
#!/usr/bin/env python3
import psutil
import re
import subprocess
from qlmdm import cached_data
from qlmdm.client import get_logger
import qlmdm.json as json
log = get_logger('plugins/screenlock')
def find_xinit_users():
users = []
xinits = []
for p in psutil.process_iter():
if p.exe().endswith(... |
import logging
import toml
from docker import Client
from cachet import Cachet
def main(cli, cach, settings):
docker_map = settings['containers']
cs = cli.containers()
for container in cs:
cach_id = None
name = container['Names'][0][1:]
labels = container['Labels']
if name... |
import multiprocessing
import requests
import json
def request_synonyms(oid, iri):
j = requests.get('http://www.ebi.ac.uk/ols/api/ontologies/' + oid + '/terms?iri=' + iri).json()
return j["_embedded"]["terms"][0]["synonyms"] if "_embedded" in j else []
def search_others(query, doids):
j = requests.get('h... |
from django.conf import settings
from models import Account, AnonymousAccount
def account(request):
if request.user.is_authenticated():
try:
account = Account._default_manager.get(user=request.user)
except Account.DoesNotExist:
account = AnonymousAccount(request)
else:... |
#!/usr/bin/env python
#
# prop_tests.py: testing versioned properties
#
# Subversion is a tool for revision control.
# See http://subversion.tigris.org for more information.
#
# ====================================================================
# Copyright (c) 2000-2004 CollabNet. All rights reserved.
#
# T... |
#Setup Logging
import logging
log = logging.getLogger(__name__)
#Python Utility imports
import os
import json
import time
from datetime import datetime
from threading import Thread
#Local imports
from . import config
from pushbullet_alarm import Pushbullet_Alarm
from slack_alarm import Slack_Alarm
from twilio_alarm i... |
#!/usr/bin/env python
#
# prop_tests.py: testing versioned properties
#
# Subversion is a tool for revision control.
# See http://subversion.tigris.org for more information.
#
# ====================================================================
# Copyright (c) 2000-2001 CollabNet. All rights reserved.
#
# This s... |
#!/usr/bin/env python
from __future__ import division
#import os
#from os.path import join as pjoin
import json
import time
import numpy as np
#import pylab as plt
#import itertools
#import nibabel as nib
#from itertools import izip, chain
#import brainsearch.vizu as vizu
#import brainsearch.utils as brainutil
#fro... |
"""
The following RegEx pertains to the 7 main PLOS journals and the defunct PLOS Clinical Trials, as well as PLOS Currents.
"""
import re
corpusdir = 'allofplos_xml/'
corpusdir_regex = re.escape(corpusdir)
regex_match_prefix = r"^10\.1371/"
regex_body_match = (r"((journal\.p[a-zA-Z]{3}\.[\d]{7}$)"
... |
__version_info__ = {
'major': 0,
'minor': 2,
'micro': 0,
'releaselevel': 'final',
'serial': 1
}
def get_version():
vers = ["%(major)i.%(minor)i" % __version_info__, ]
if __version_info__['micro']:
vers.append(".%(micro)i" % __version_info__)
if __version_info__['releaselevel'] ... |
# coding: UTF-8
'''
Created on 2013-05-20
@author: tianwei
Desc: dict table
'''
import datetime
import uuid
from django.db import models
from django.conf import settings
from const.models import *
from const import *
from users.models import UserProfile
def get_sid():
return str(uuid.uuid4())
class Process... |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
A "DAV object" is anything we get from the caldav server or push into the
caldav server, notably principal, calendars and calendar events.
(This file has become huge and will be split up prior to the next
release. I think it makes sense moving the CalendarObjectReso... |
# -*- coding: utf-8 -*-
"""
Run scripts in a clean virtual environment.
Useful for testing, building, and deploying.
:author: Andrew B Godbehere
:date: 4/21/16
"""
import venv
import sys
import os
from urllib.parse import urlparse
from urllib.request import urlretrieve
from threading import Thread
from subprocess im... |
# -*- coding: utf-8 -*-
# Copyright 2011 Google Inc. All Rights Reserved.
# Copyright 2011, Nexenta Systems 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/... |
from __future__ import print_function, division
import os
import logging
import pkg_resources
import warnings
import math
warnings.filterwarnings('ignore', '.*duration.*')
#test if building documentation on readthedocs.org
on_rtd = False
try:
import numpy as np
from numba import jit
import numpy.random... |
"""
@file
@brief Publishing coverage
.. versionadded:: 1.3
"""
import os
import sys
from ..loghelper import SourceRepository, noLOG, run_cmd
if sys.version_info[0] == 2:
FileNotFoundError = Exception
from StringIO import StringIO
else:
from io import StringIO
def publish_coverage_on_codecov(path, token... |
#! /usr/bin/env python
import itertools
from multiprocessing import Pool
from string import ascii_lowercase
import whois
import util.opt_parser as parser
from util.toolkit import log, PermutationIterator, start_busy_indicator, stop_busy_indicator
if __name__ == '__main__':
# Begin the Busy indicator
bi = st... |
#! /usr/bin/env python
#################################################################################
# File Name : gen_embedding.py
# Created By : yang
# Creation Date : [2017-01-26 21:54]
# Last Modified : [2017-01-26 23:01]
# Description :... |
"""A collection of ORM sqlalchemy models for Caravel"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import functools
import json
import logging
import textwrap
from collections import namedtuple
from copy import de... |
"""A collection of ORM sqlalchemy models for Caravel"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import re
import functools
import json
import logging
import re
import textwrap
from collections import namedtuple... |
from __future__ import print_function
import sys
from coverage import coverage
def missing_lines(cov_file, cov_config, fname):
cov = coverage(data_file=cov_file, config_file=cov_config)
cov.load()
if cov.omit_match and cov.omit_match.match(fname):
sys.stderr.write('Omitted file.\n')
sys.exit(1)
missi... |
#!/usr/bin/env python
#########################################################################################
# Various modules for registration.
#
# ---------------------------------------------------------------------------------------
# Copyright (c) 2015 NeuroPoly, Polytechnique Montreal <www.neuro.polymtl.ca>
# ... |
# -*- coding: utf8 -*-
import json
from django.shortcuts import redirect
from inventory.models import (Item, Box, InventoryItem, Movement, Packet,
PacketItem, Request, RequestType)
from inventory.forms import (ReceiptForm, InventoryReportForm,
MovementsReportFo... |
# This file was created automatically by SWIG.
# Don't modify this file, modify the SWIG interface instead.
# This file is compatible with both classic and new-style classes.
import _cspace
def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
if (name == "this"):
if isinstance(value, class_t... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import logging
from django.core.urlresolvers import reverse
from django.test import TestCase
from django.test.client import Client
from django.contrib.auth.models import User, Group
from ..models import AccountUser, Role, Team
from . impor... |
import sys
sys.path.append('./dependencies')
from gehol.coursecalendar import CourseCalendar
from gehol.converters.csvwriter import to_csv
from gehol.converters.icalwriter import to_ical
from gehol import GeholProxy
host = '164.15.72.157:8080'
first_monday = '20/09/2010'
def get_calendar(course_mnemonic):
gehol... |
'''
Tests
@author: Christian Holler (:decoder)
@license:
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
@contact: choller@mozilla.com
'''
import json
import os
im... |
import numpy as np
from functools import reduce
from bird.models.cuberun import CubeRun
from bird.models.resnet import ResNetBuilder
from bird import utils
from bird import loader
from sklearn import metrics
import tqdm
nb_classes = 20
input_shape = (256, 512, 1)
batch_size=32
def evaluate(model, data_filepath):
... |
# coding=utf-8
# Copyright 2018 The Tensor2Tensor Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... |
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
"""
Evaluates the performance of the fixer thing.
"""
import csv
import tempfile
import math
import sys
from itertools import islice
from pathlib import Path
from tqdm import tqdm
from vocabulary import vocabulary
from mutate import Persistence as Mutations
from mutate... |
from collections import defaultdict
import os
def classify(instance, classes_instances, extractor=str.split, priors=None):
"""
Using `classes_instances` as supervised learning, classify `instance` into
one of the example classes. `extractor` is a function to convert instances
into a list of events/feat... |
"""
Created on Nov 1, 2012
@author: nigel
"""
import os
import re
import datetime
import calendar
import shutil
import logging
import urllib2
import urlparse
import sys
import json
import pprint
from lxml import etree
from dc24_ingester_platform.utils import *
from dc24_ingester_platform import IngesterError
from jc... |
import os
import accel_server
__all__ = ["accelerometer"]
|
"""
.. module:: frames
:synopsys: Define all the custom frames
.. moduleauthor:: Benjamin Audren <benjamin.audren@gmail.com>
"""
from __future__ import unicode_literals
import os
from collections import OrderedDict as od
import pypandoc as pa
import six # Used to replace the od iteritems from py2
import io
import... |
#!/usr/bin/python2.5
#
# Copyright 2008 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
from Bio import SeqIO
from Bio.Seq import Seq
from copy import copy
import itertools
from collections import Counter
import logging
import datetime
import math
def unique(seq):
seen = set()
seen_add = seen.add
return [ x for x in seq if x not in seen and not seen_add(x)]
class Variant(object):
def... |
import asyncio
import datetime
import functools
import hashlib
import io
import zipfile
from bson import objectid
from urllib import parse
from vj4 import app
from vj4 import constant
from vj4 import error
from vj4 import job
from vj4 import handler
from vj4.handler import base
from vj4.model import builtin
from vj4.m... |
import datetime
import os.path
import re
import lxml.html
from measurement.measures import Energy, Weight, Volume
import requests
from collections import OrderedDict
from myfitnesspal.base import MFPBase
from myfitnesspal.day import Day
from myfitnesspal.entry import Entry
from myfitnesspal.meal import Meal
class C... |
# 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... |
"""
Data structures for the Buffer.
It holds the text, cursor position, history, etc...
"""
from __future__ import unicode_literals
from .auto_suggest import AutoSuggest
from .clipboard import ClipboardData
from .completion import Completer, Completion, CompleteEvent
from .document import Document
from .enums import I... |
# -*- coding: utf-8 -*-
from django.core.exceptions import ObjectDoesNotExist
from requests import post, delete, get
from dbaas_credentials.models import CredentialType
from dbaas_dnsapi.utils import get_dns_name_domain, add_dns_record
from physical.models import Vip, Instance, Environment
from util import get_credenti... |
import socket
from contextlib import contextmanager
import os
import re
import configobj
import sys
import validate
from authappliance.lib.appliance import ApacheConfig
LDAP_PROXY_CONFIG_FILE = '/etc/privacyidea-ldap-proxy/proxy.ini'
CONFIG_SPEC = """
[privacyidea]
instance = string
certificate = string(default=''... |
from django.conf import settings
#import datetime
import logging
import sys
import traceback
from restclients.sws import SWS
from myuw_mobile.models import CourseColor
from myuw_mobile.dao.building import Building
from pws import Person as PersonDao
sws = SWS()
person = PersonDao()
class Quarter:
"""
This cl... |
# -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2016, Adrian Sampson.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation t... |
from collections import Iterable
import os
import numpy as np
import pandas as pd
import scipy
from sklearn.base import BaseEstimator, TransformerMixin
import warnings
from auto_ml import utils_models
from auto_ml.utils_models import get_name_from_model
keras_installed = False
try:
# Suppress some level of logs
... |
from django.contrib.auth.models import User
from apps.account.models import Profile, Group
from tastypie import fields
from tastypie.authorization import DjangoAuthorization, Authorization
from tastypie.resources import ModelResource, ALL, ALL_WITH_RELATIONS
from tastypie.exceptions import BadRequest
from django.db imp... |
# -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2016, Jakob Schnitzer.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation ... |
"""Converts tracks or albums to external directory
"""
import logging
import os
import threading
import shutil
from subprocess import Popen, PIPE
import imghdr
from beets.plugins import BeetsPlugin
from beets import ui, library, util, mediafile
from beets.util.functemplate import Template
log = logging.getLogger('be... |
import re
from .bible_re import testaments, book_re, scripture_re
class InvalidReferenceException(Exception):
"""
Invalid Reference Exception
"""
pass
def get_book(name):
"""
Get a book from its name or None if not found
"""
for books in testaments.values():
for book in books:... |
#!/usr/bin/env python
import psycopg2
from psycopg2 import pool
import os
from datetime import datetime
import threading
def read_some_lines(file_object, chunk_size=1024):
while True:
data = file_object.readlines(chunk_size)
if not data:
break
yield data
class threadedPopulate(threading.Thr... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compli... |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 Justin Santa Barbara
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance wi... |
"""Notebook export in Blogger-aware HTML.
This file contains `ConverterBloggerHTML`, a subclass of `ConverterHTML` that
provides output suitable for easy pasting into a blog hosted on the Blogger
platform. See the class docstring for more information.
"""
#--------------------------------------------------------------... |
# -*- coding: utf-8 -*-
__author__ = 'Esteban Castro Borsani'
import threading
from weak_ref import weak_ref
__all__ = ['Signal', ]
class Signal:
def __init__(self):
self.callbacks = []
self.r_lock = threading.RLock()
def connect(self, callback):
with self.r_lock:
callb... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2011 University of Southern California
#
# 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/... |
# Copyright 2013 Donald Stufft
#
# 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, so... |
import glob, os
import re
import pandas as pd
import numpy as np
import string as sg
import pylab as pb
import warnings
from matplotlib.colors import LogNorm, SymLogNorm
import datetime
import xarray
def niagara(dArray, indices = None,
delta = 0., cmap = "viridis",
putzeros = False, nolabel = F... |
# file ddisearch/ddi/models.py
#
# Copyright 2014 Emory University
#
# 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 app... |
"""
batch/batch.py
Class to setup and run batch simulations
Contributors: salvadordura@gmail.com
"""
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
from builtins import zip
from builtins import range
from builtins... |
import logging
from cubes.common import get_logger
from cubes.errors import *
from cubes.browser import *
from cubes.computation import *
from cubes.workspace import Workspace
from .mapper import MongoCollectionMapper
import collections
import copy
import pymongo
import bson
from datetime import datetime, timedelta
f... |
#
# Copyright (c) 2004 Specifix, Inc.
#
# This program is distributed under the terms of the Common Public License,
# version 1.0. A copy of this license should have been distributed with this
# source file in a file called LICENSE. If it is not present, the license
# is always available at http://www.opensource.org/li... |
"""Version info."""
from collections import namedtuple
import re
RE_VER = re.compile(
r'''(?x)
(?P<major>\d+)(?:\.(?P<minor>\d+))?(?:\.(?P<micro>\d+))?
(?:(?P<type>a|b|rc)(?P<pre>\d+))?
(?:\.post(?P<post>\d+))?
(?:\.dev(?P<dev>\d+))?
'''
)
REL_MAP = {
".dev": "",
".dev-alpha": "a",
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created on Fri Apr 29 13:44:51 2016
@author: sthomp
Command Line Script to run vetter on the K2 data.
Inputs
File of this info or the info itself
EpicId
Campaign
Period (days)
epoch (bkjd)
depth (ppm)
config File
"""
import dave.pipeline.clipboar... |
# -*- coding: utf-8 -*-
##
## This file is part of CDS Indico.
## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 CERN.
##
## CDS 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; either version 2 of t... |
## This file is part of Invenio.
## Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 CERN.
##
## Invenio 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 of the
## License, or (at your ... |
import unittest
from number_to_words import NumberToWords
class TestNumberToWords(unittest.TestCase):
def setUp(self):
self.n2w = NumberToWords()
def tearDown(self):
self.n2w = None
def test_zero_and_single_digits(self):
NUMBERS = {
0: 'zero', 1: 'one', 2: 'two', 3: '... |
import urllib.parse
from typing import Union, Optional, Dict, Any
from tornado.auth import OAuth2Mixin
from tornado.escape import json_decode
from tornado.httputil import HTTPHeaders
__all__ = [
'GithubOAuth2Mixin',
'OrcidOAuth2Mixin'
]
class GithubOAuth2Mixin(OAuth2Mixin):
_OAUTH_AUTHORIZE_URL = 'https... |
#A place for code to be called from C-code
# that implements more complicated stuff.
import re
import sys
from numpy.compat import asbytes, bytes
if (sys.byteorder == 'little'):
_nbo = asbytes('<')
else:
_nbo = asbytes('>')
def _makenames_list(adict):
from multiarray import dtype
allfields = []
... |
# -*- coding: utf-8 -*-
import json
from concurrent.futures import ProcessPoolExecutor
import io
import re
import time
import pytest
from itertools import chain
from os.path import join
from s3fs.core import S3FileSystem
from s3fs.utils import seek_delimiter, ignoring, tmpfile, SSEParams
import moto
from botocore.exce... |
#!/usr/bin/env python
"""
This script shall parse Salt XML files and convert them to a format more
suitable for graph visualization.
TODO: get parent element statistics!
:var XSI_TYPE_CLASSES: a dict that maps xsi:types (which most elements in a
SaltXML file have) to the Classes that represent those elements
"""
im... |
#!/usr/bin/env python3
# Copyright 2016 The Johns Hopkins University Applied Physics Laboratory
#
# 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-... |
# -*- coding: utf-8 -*-
'''
The client module is used to create a client connection to the publisher
The data structure needs to be:
{'enc': 'clear',
'load': {'fun': '<mod.callable>',
'arg':, ('arg1', 'arg2', ...),
'tgt': '<glob or id>',
'key': '<read in the key file>'... |
#coding=utf-8
import re
import json
import logging
import random
from channels import Group
from channels import Channel
from channels.sessions import channel_session
from .models import Room
from .models import Player
log = logging.getLogger(__name__)
noEnoughPeople = 'not enough people in the room'
gameHasStarte... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.