text stringlengths 17 737k |
|---|
from Message import Message
import Levels
class Logger(object):
__slots__ = ['_fields', 'emitters', 'min_level', 'filter']
def __init__(self, fields = None, emitters = None,
min_level = Levels.DEBUG, filter = None):
self._fields = fields if fields is not None else {}
self.emit... |
from __future__ import print_function, division, absolute_import
import os
import cPickle
import requests
import webbrowser
from twython import Twython
from odin import utils
from miner import Miner
# ===========================================================================
# Main classes
# =====================... |
import argparse
import datetime
import json
import logging
import subprocess
import yaml
import re
import collections
import os
import requests
import urllib
import teuthology
from . import misc
from . import provision
from .config import config
from .config import set_config_attr
from .contextutil import safe_while
f... |
from twisted.internet.defer import Deferred
from twisted.internet.protocol import Factory, ClientFactory
from twisted.protocols.amp import AMP, Command, Integer, String, Boolean, AmpList, ListOf, IncompatibleVersions
from twisted.words.protocols import irc
from txircd.channel import IRCChannel
from txircd.utils import ... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... |
#! /usr/bin/python
# -*- coding: utf8 -*-
import tensorflow as tf
import time
from . import visualize
from . import utils
from . import files
from . import cost
from . import iterate
import numpy as np
from six.moves import xrange
import random
import warnings
# __all__ = [
# "Layer",
# "DenseLayer",
# ]
#... |
# -*- coding: utf-8 -*-
# This file is part of Teres.
#
# Copyright (C) 2016 Peter Kotvan
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at you... |
{
"targets": [
{
"target_name": "node_mmdb",
"include_dirs": [
"<!(node -e \"require('nan')\")",
"deps/config/<(OS)/<(target_arch)",
"deps/libmaxminddb",
"deps/libmaxminddb/src",
"deps/libmaxminddb/include"
],
"cflags": [
"-std=c++11",
... |
{
'targets': [
{
'target_name': 'jsaudio',
'sources': ['src/addon.cc', 'src/jsaudio.cc', 'src/helpers.cc', 'src/stream.cc'],
'include_dirs': [
'<!(node -e "require(\'nan\')")',
'<(module_root_dir)/vendor/'
],
"conditions": [
[
'OS=="win"', {
"conditions": [
... |
# -*- coding: utf-8 -*-
"""
Ensures code that represents a local node in the DHT network works as
expected
"""
from drogulus.dht.node import response_timeout, Lookup, Node
from drogulus.constants import (ERRORS, RPC_TIMEOUT, RESPONSE_TIMEOUT,
REPLICATE_INTERVAL)
from drogulus.dht.contact... |
#!/usr/bin/env python
###
# Copyright (c) 2002, Jeremiah Fincher
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# ... |
#!/usr/bin/env python
# coding: utf-8
"""Test suite for autopep8.
Unit tests go in "UnitTests". System tests go in "SystemTests".
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
import re
import sys
... |
import contextlib
import sys
import os
import unittest
from unittest import mock
import numpy as np
import PIL
from PIL import Image
from torch._utils_internal import get_file_path_2
import torchvision
from torchvision.datasets import utils
from common_utils import get_tmp_dir
from fakedata_generation import mnist_root... |
# This file is part of beets.
# Copyright 2013, 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 the rights to use, copy, ... |
#!/usr/bin/env python3
from passwd_change import passwd_change, shadow_change, mails_delete
from unittest import TestCase, TestLoader, TextTestRunner
import os
import subprocess
class PasswdChange_Test(TestCase):
def setUp(self):
"""
Preconditions
"""
subprocess.call(['mkdir', 't... |
#!/usr/bin/python
# vim:set fileencoding=utf-8
import unittest
from mock import Mock
import blivet
from blivet.errors import DeviceError
from blivet.devices import BTRFSSnapShotDevice
from blivet.devices import BTRFSSubVolumeDevice
from blivet.devices import BTRFSVolumeDevice
from blivet.devices import DiskDevice
... |
# Copyright (c) 2017, The MITRE Corporation. All rights reserved.
# See LICENSE.txt for complete terms.
# mixbox
from mixbox import fields
from mixbox import entities
from mixbox import typedlist
# cybox
from cybox.core import Observable, ObservableComposition
from cybox.common import Time
# internal
import stix
fro... |
import time, astropy
from PyQt4 import QtGui
from drive import Drive
class Status:
INIT = 0
SLEWING = 1
PARKED = 2
CALIBRATING = 3
READY = 4
class CoordinateSystem:
RADEC = 0
AZEL = 1
GAL = 3
class Mode:
LIVE = 0
SIM = 1
class SRT():
def __init__(self,mode):
d... |
from termcolor import colored
from .parser import Addic7edParser
from .file_crawler import FileCrawler
from .logger import init_logger
from .config import Config
def addic7ed():
try:
init_logger()
Config.load()
main()
except (EOFError, KeyboardInterrupt, SystemExit):
print(col... |
import string
class Protocol(object):
LOWALPHA = string.ascii_lowercase
UPALPHA = string.ascii_uppercase
ALPHA = LOWALPHA + UPALPHA
DIGIT = string.digits
ALPHANUM = ALPHA + DIGIT
MARK = '-' '_' '.' '!' '~' '*' '\'' '(' ')'
UNRESERVED = ALPHANUM + MARK
HEX = string.hexdigits
ESC... |
import climate
import collections
import datetime
import fnmatch
import functools
import gzip
import hashlib
import io
import itertools
import joblib
import numpy as np
import os
import pandas as pd
import pickle
import re
import scipy.interpolate
import scipy.signal
logging = climate.get_logger('source')
def pickle... |
from hashlib import sha256
from lib.lnaddr import shorten_amount, unshorten_amount, LnAddr, lnencode, lndecode, u5_to_bitarray, bitarray_to_u5
from decimal import Decimal
from binascii import unhexlify, hexlify
from lib.segwit_addr import bech32_encode, bech32_decode
import pprint
import unittest
RHASH=unhexlify('0001... |
from collections import defaultdict
import logging
import networkx
import simuvex
import claripy
from ..entry_wrapper import EntryWrapper, CallStack
from .cfg_base import CFGBase
from ..analysis import Analysis
from ..errors import AngrVFGError, AngrVFGRestartAnalysisNotice, AngrError
l = logging.getLogger(name="ang... |
#!/usr/bin/env python2
import os
import pickle
import caffe
caffe.set_mode_cpu()
caffe_root = os.path.normpath(os.path.dirname('%s/../../../../' % caffe.__file__))
import numpy as np
import util
def main():
extractor = FeatureExtractor()
cache_features(extractor, '../datasets/Wookie') # Train set
cach... |
# -*- coding: utf-8 -*-
# /***************************************************************************
# Irmt
# A QGIS plugin
# OpenQuake Integrated Risk Modelling Toolkit
# -------------------
# begin : 2013-10-24
# copyright ... |
# vim: shiftwidth=4 tabstop=4 expandtab
"""
The standard pyblosxom entry parser, uses preformatters that's located in
libs/preformatters/ .
To define a default parser add this line in your config.py
py['parser'] = xxxx
To use other preformatters than the default one you define, add the following
text in your entry te... |
import Definitionen
import Fertigkeiten
import Objekte
import lxml.etree as etree
import re
import binascii
import copy
import logging
import collections
from EventBus import EventBus
from Wolke import Wolke
from Hilfsmethoden import Hilfsmethoden, WaffeneigenschaftException
from PyQt5 import QtWidgets, QtCore
import o... |
import sys
import os
import itertools
import collections
import numpy as np
import tensorflow as tf
import time
from inspect import getsourcefile
current_path = os.path.dirname(os.path.abspath(getsourcefile(lambda:0)))
import_path = os.path.abspath(os.path.join(current_path, "../.."))
if import_path not in sys.path:
... |
from django.contrib.auth.models import User
from django.db import models
from django.db.models.signals import post_save
from django.dispatch import receiver
from proso.models.environment import CommonEnvironment, InMemoryEnvironment
from datetime import datetime
from contextlib import closing
from django.db import conn... |
import logging
logging.basicConfig()
log = logging.getLogger("PunchVPNd")
log.setLevel(logging.DEBUG)
import inspect
import uuid
from gevent import monkey; monkey.patch_all()
from gevent.event import Event
from beaker.middleware import SessionMiddleware
import bottle
from bottle import route, request, static_file, tem... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import re
import sys
import time
import json
import queue
import random
import logging
import sqlite3
import datetime
import threading
import functools
import subprocess
import collections
import requests
__version__ = '1.0'
# (昨日)
# 今日焦点: xx,yy,zz (12345,456... |
'''
desisim.quickcat
================
Code for quickly generating an output zcatalog given fiber assignment tiles,
a truth catalog, and optionally a previous zcatalog.
The current redshift errors and ZWARN completeness are based upon Redmonster
performance on the zdc1 training samples, documented by Govinda Dhungana ... |
'''
Preprocess raw DESI exposures
'''
import re
import numpy as np
import scipy.interpolate
from desispec.image import Image
from desispec import cosmics
from desispec.maskbits import ccdmask
from desispec.log import get_logger
log = get_logger()
def _parse_sec_keyword(value):
'''
parse keywords like BIASSE... |
"""
legacypipe.galex
================
Code to generate GALEX custom coadds / mosaics.
"""
import os
import numpy as np
import fitsio
from astrometry.util.util import Tan
from astrometry.util.fits import fits_table
from tractor.psf import PixelizedPSF
import logging
logger = logging.getLogger('legacypipe.galex')
de... |
import json
import types
from future.utils import with_metaclass
from . import consts as CONST
from .document import Document, Edge
from .theExceptions import ValidationError, SchemaViolation, CreationError, UpdateError, DeletionError, InvalidDocument, ExportError
from .query import SimpleQuery
from .index import Inde... |
import numpy as _np
import trackcpp as _trackcpp
import pyaccel.lattice as _lattice
import pyaccel.elements as _elements
import mathphys as _mp
from pyaccel.utils import interactive as _interactive
class AcceleratorException(Exception):
pass
@_interactive
class Accelerator(object):
__isfrozen = False # th... |
import logging
import time
import os
import string
import struct
import smtplib
from socket import gethostname
import numpy as np
from functools import wraps
from threading import Event, Thread
from Queue import Queue
from collections import namedtuple, Mapping
from contextlib import contextmanager
from operator import... |
from pycket.prims.linklet import W_Linklet, to_rpython_list, do_compile_linklet, W_LinkletInstance
from pycket.interpreter import check_one_val, Done
from pycket.values import W_Symbol, W_WrappedConsProper, w_null, W_Object, Values, w_false, W_Path
from pycket.values_string import W_String
from pycket.vector import W_V... |
def search_names(logins):
"""
Examples
--------
>>> search_names([['foo', 'foo@foo.com'], ['bar_', 'bar@bar.com']])
[['bar_', 'bar@bar.com']]
"""
assert isinstance(logins, list), 'Must be type list'
return list(filter((lambda x: x[0][-1] == '_'), logins))
if __name__ == '__main__':
... |
import inspect
from functools import wraps
from pydocstring.docstring import Docstring
from pydocstring.numpy_docstring import parse_numpy
from pydocstring.utils import extract_members
def kwarg_wrapper(wrapper):
"""Wraps the keyword arguments into the wrapper.
The wrapper behaves differently when used as a ... |
"""Provides a simple way of testing JSON RPC commands.
Intended usage:
$ ipython -i pyethapp/tests/setup_rpc_client.py
In [0]: call('web3_sha3', '0x')
Request:
{'id': 4,
'jsonrpc': '2.0',
'method': 'web3_sha3',
'params': ['0x']}
Reply:
{'id': 4,
'jsonrpc': '2.0',
'resu... |
from pyexperian.lib import dicttoxml
from pyexperian import constants, exceptions
import requests
import xmltodict
import urllib
from xml.dom.minidom import parseString
import re
import time
import logging
def enable_debug(filename='pyexperian.log'):
import datetime
print('Debug mode is on. Events are logged ... |
# -*- coding: utf-8 -*-
import sqlite3
import threading
from . import sitecfg
from . import esi_calls
class EsiNamesResolver:
def __init__(self, cfg: sitecfg.SiteConfig):
self.cfg = cfg
self.error_str = ''
self.ids_limit = 10
def resolve_characters_names(self, ids_list: list) -> list... |
# The main file for AsunaBot
from discord.ext import commands
from bs4 import BeautifulSoup
from random import randrange
import random
import requests
import logging
import discord
import bs4
import config
import re
import xml.etree.cElementTree as ET
from animethemes import findAnimeOpening, findAnimeEnding, random... |
#!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import warnings
from pyglet.layout.content import *
from pyglet.layout.properties import *
import re
__all__ = ['ContainingBlock', 'FrameBuilder', 'TextFrame',
'ReplacedElementDrawable', 'ReplacedElementFactory']
cla... |
# -*- coding: utf-8 -*-
"""
pygments.lexers.hdl
~~~~~~~~~~~~~~~~~~~
Lexers for hardware descriptor languages.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, bygroups, include, using, t... |
import discord
from discord.ext import commands, tasks
import asyncio
import datetime
import json
import logging
import sys
import traceback
import aiohttp
import dateutil.parser
import feedparser
import isodate
import clients
from utilities import checks
sys.path.insert(0, "..")
from units.time import duration_to... |
# -*- coding: utf-8 -*-
"""
pygments.lexers.web
~~~~~~~~~~~~~~~~~~~
Lexers for web-related languages and markup.
:copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
import copy
from pygments.lexer import RegexLexer, ExtendedReg... |
from HashListClass import *
from RulesReaderClass import *
import urllib2
import urllib
import base64
import json
import time
import subprocess
import re
class DocumentSummary:
def __init__(self,classification,host):
self.fileHash = HashList()
self.docFreqs = {}
self.nodeList = classification.split('/')
self... |
""" Provides functions for reading and writing ESRI shapefiles and returning a
guppy object. """
import os
from shapefile import Reader, Writer
import guppy
import traceback
# # Constants for shape types
# NULL = 0
# POINT = 1
# POLYLINE = 3
# POLYGON = 5
# MULTIPOINT = 8
# POINTZ = 11
# POLYLINEZ = 13
# POLYGONZ = 1... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.contrib import layers
from tensorflow.contrib.framework.python.ops import arg_scope
from tensorflow.contrib.layers.python.layers import layers as layers_lib
from tensorflow.contrib.layers.python... |
# Copyright (c) 2009-2010 Six Apart Ltd.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions an... |
# -*- coding: utf-8 -*-
"""
Created on Mon Oct 12 19:54:30 2015
@author: matsumi
"""
import load_mnist
import numpy as np
from sklearn.cross_validation import train_test_split
import matplotlib.pyplot as plt
import time
def softmax(s):
len(s.shape)
exp_s = np.exp(s)
if len(s.shape) == 1:
return ... |
# Copyright 2015 Nicta
#
# 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, softwa... |
# modmail_ticketmanager
# Python script developed on behalf on a need on /r/civcraft.
# Goal is to actively monitor the modmail queue on a particular subreddit
# and if a new modmail (or update) comes through, to push that into a
# Request Tracker (ticket manager) instance.
#
# Dependencies:
# Python
# PRAW - You... |
# -*- coding: utf-8 -*-
"""
EngineData parser.
PSD file embeds text formatting data in its own markup language referred
EngineData. The format looks like the following::
<<
/EngineDict
<<
/Editor
<<
/Text (˛ˇMake a change and save.)
>>
>>
/Font
<<
... |
"""
birthday.py
Author: Avery Wallis
Credit: None so far
Assignment:
Your program will ask the user the following questions, in this order:
1. Their name.
2. The name of the month they were born in (e.g. "September").
3. The year they were born in (e.g. "1962").
4. The day they were born on (e.g. "11").
If the user'... |
#
# Collective Knowledge (program)
#
# See CK LICENSE.txt for licensing details
# See CK Copyright.txt for copyright details
#
# Developer: Grigori Fursin, Grigori.Fursin@cTuning.org, http://cTuning.org/lab/people/gfursin
#
cfg={} # Will be updated by CK (meta description of this module)
work={} # Will be updated by ... |
# Create your views here.
from django.http import HttpResponse, Http404
from django.shortcuts import get_object_or_404, render_to_response
from django.contrib.contenttypes.models import ContentType
from models import get_shareables, share_object_with_groups
def get_shared_content_instance(ctid, pk, user):
"""
... |
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 28 15:18:19 2017
@author: Colin Drayton
"""
#!/usr/bin/env python
# encoding: utf-8
import tweepy #https://github.com/tweepy/tweepy
import twit_auths as twit_auth
from pymongo import MongoClient
#Twitter API credentials fron twit_auth
# auth = twit_auth.authentication1... |
import spacy
from typing import Union, List
from initialize import spacy_nlp
import pyinflect
from nltk.tokenize.treebank import TreebankWordDetokenizer
from spacy.symbols import aux, cc, nsubj, AUX, NOUN, PRON, PROPN, VERB
from spacy.tokens import Token, Span
from spacy.tokens.doc import Doc
from interfaces.SentenceO... |
#!/usr/bin/env python
#
# Example of usage pool with gevent
#
from gevent import monkey
monkey.patch_socket()
from gevent.pool import Pool
import urlfetch
pool = Pool(size=5)
urls = ('http://www.google.com', 'http://www.yahoo.com', 'http://www.blogger.com',
'http://www.python.org', 'http://sourceforge.net'... |
# Lint as: python3
# Copyright 2018 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 ... |
# -*- coding: utf-8 -*-
import fcntl
import json
import os
import signal
import socket
import select
import struct
import sys
import termios
import threading
import time
import subprocess
import atexit
import re
import candy_board_amt
import logging
import logging.handlers
# sys.argv[0] ... Serial Port
# sys.argv[1] ... |
"""deploy.py"""
HELPTEXT = """
----- Umpire -----
Umpire reads a properly formatted JSON deployment file to deploy files.
Examples can be found on GitHub: https://github.com/Signiant/umpire
Usage: umpire <deployment_file>
Options:
--clear-cache, -c: Clears the default Umpire cache of all packag... |
import numbers
import os
import numpy as np
import time
class usbtmc:
"""Simple implementation of a USBTMC device driver, in the style of visa.h"""
def __init__(self, device):
self.device = device
self.FILE = os.open(device, os.O_RDWR)
# TODO: Test that the file opened
... |
#!/usr/bin/env python
import os
import re
import json
import logging
import requests
import threading
from urlparse import urlparse
from optparse import OptionParser
from subprocess import Popen, PIPE
from collections import OrderedDict
from . import thread
path = os.path.abspath(__file__)
dir_path = os.path.dirnam... |
import json
import logging
from flask import Blueprint, request, current_app
from flask.ext.jsontools import jsonapi
from flask.ext.login import login_required
from dart.auth.required_roles import required_roles
from jsonpatch import JsonPatch
from flask_login import current_user
from dart.message.trigger_proxy impor... |
import cupy
from cupy import core
_gammaln_kernel = None
def _get_gammaln_kernel():
global _gammaln_kernel
if _gammaln_kernel is None:
_gammaln_kernel = core.ElementwiseKernel(
'T x', 'T y',
'y = lgammaf(x)',
'gammaln_kernel'
)
return _gammaln_kernel
... |
from classytags.core import Options
from classytags.arguments import Argument
from classytags.helpers import InclusionTag
from django import template
from django.template.loader import render_to_string
register = template.Library()
# class Javascript(InclusionTag):
# name = 'include_maps_js'
# template = 'geo... |
import numpy as np
import multiprocessing as mp
import csv
def search(f, resfile, box, cores, n, it,
tratio=0.75, rho0=0.75, p=0.75,
nrand=10000, vf=0.05):
"""
Minimize (maximize, if applied on 1/(f+1) or similar) given positive
expensive black-box function and write iterat... |
# Copyright (c) 2015 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
from UM.Qt.QtApplication import QtApplication
from UM.Scene.SceneNode import SceneNode
from UM.Scene.Camera import Camera
from UM.Scene.Platform import Platform
from UM.Math.Vector import Vector
from UM.Math.Quaternion impo... |
import logging
import functools
from datetime import date, timedelta
from django.conf import settings
from django.db import models
from django.dispatch.dispatcher import receiver
from django.template.defaultfilters import date as date_filter
from django.utils.text import slugify
from django.contrib.contenttypes.field... |
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Blaze(Package):
"""Blaze is an open-source, high-performance C++ math library for dense a... |
from django.conf import settings
if hasattr(settings, "I18N_URLS") and settings.I18N_URLS:
try:
module = __import__("userprofile.urls.%s" % (settings.LANGUAGE_CODE), \
{}, {}, "urlpatterns")
globals().update({ "urlpatterns": module.__dict__["urlpatterns"] })
except:
... |
from collections import defaultdict
from itertools import product, chain
from math import sqrt, log
def hashPair(pair) :
return tuple(sorted([tuple(sorted(pair[0].items())), tuple(sorted(pair[1].items()))]))
def predicateCoverage(pairs, predicates) :
coverage = defaultdict(list)
for pair in pairs :
... |
import datetime
from django.contrib.sites.managers import CurrentSiteManager
from lithium.conf import settings
class CurrentSitePostManager(CurrentSiteManager):
def all(self, allow_private=False):
queryset = self.get_query_set()
if allow_private:
return queryset.all()
e... |
from django.shortcuts import get_object_or_404
from django.db import transaction
from rest_framework import viewsets
from rest_framework.mixins import CreateModelMixin, ListModelMixin, RetrieveModelMixin
from .serializers import GameSerializer, PlayerSerializer, TargetSerializer
from .models import Game, Player, Target... |
from Transformers.transformer import Transformer
def make_and_sort_list(faction, transformers):
"""Receives the faction and a list of transformers to filter and sort into a list based on their allegiance."""
faction_key = faction_type(faction)
list_of_transformers_of_faction = list(filter(lambda x: x.alle... |
"""
This module contains functionality related to deep Boltzmann machines.
They are implemented generically in order to make it easy to support
convolution versions, etc.
Some of the code needed to actually use a DBM might not be in this
repository yet. Ian is gradually moving pieces of it over from his
private reposi... |
#!/usr/bin/env python
#
# This file is part of the clcache project.
#
# Copyright (c)
# 2010, 2011, 2012, 2013, 2016 froglogic GmbH <raabe@froglogic.com>
# 2016 Simon Warta (Kullo GmbH)
# 2016 Tim Blechmann
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modificatio... |
#!/usr/bin/env python
# Tai Sakuma <tai.sakuma@cern.ch>
from AlphaTwirl.ProgressBar import ProgressBar, ProgressReport, BProgressMonitor
from AlphaTwirl.Concurrently import CommunicationChannel
import time, random
import uuid
##__________________________________________________________________||
class Task(object):
... |
#!/usr/bin/python
from xmlproxy.proxybase import proxyError
from options import getOptions
import utils
import headerparse
from optparse import OptionParser
from tempfile import NamedTemporaryFile
import time
import re
import sys
import os
import types
import subprocess
try:
from lxml import etree
except Impor... |
#!/usr/bin/env python
"""Assorted utilities shared between parts of apitools."""
import collections
import contextlib
import json
import keyword
import logging
import os
import re
import urllib2
import urlparse
class Error(Exception):
"""Base error for apitools generation."""
class CommunicationError(Error):
... |
"""tests for the 'pip' command."""
import os
import sys
import unittest
from six.moves import reload_module
from stash.tests.stashtest import StashTestCase, requires_network, expected_failure_on_py3
class PipTests(StashTestCase):
"""tests for the 'pip' command."""
def setUp(self):
"""setup the tests... |
#!/usr/bin/env python3
# Copyright (c) 2020-2021 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""A limited-functionality wallet, which may replace a real wallet in tests"""
from copy import deepcopy
... |
import gi
import sys
import re
gi.require_version("Gtk", "3.0")
gi.require_version("Gst", "1.0")
gi.require_version("Tcam", "0.1")
gi.require_version("GdkX11", "3.0")
gi.require_version("GstVideo", "1.0")
from gi.repository import GdkX11, Gtk, Tcam, GstVideo, Gst, GdkPixbuf, GObject
class DeviceDialog(Gtk.Dialog):
... |
"""
Implementations of Restricted Boltzmann Machines and associated sampling
strategies.
"""
# Standard library imports
from itertools import izip
# Third-party imports
import numpy
N = numpy
np = numpy
import theano
from theano import tensor
T = tensor
from theano.tensor import nnet
# Local imports
from pylearn2.bas... |
from django.core.urlresolvers import reverse
from django.shortcuts import redirect, get_object_or_404
from django.contrib.auth import authenticate, login, logout, REDIRECT_FIELD_NAME
from django.contrib.auth.forms import PasswordChangeForm
from django.contrib.auth.decorators import login_required
from django.contrib.au... |
"""
spaceshooter.py
Author: will laycock
Credit: me
Assignment:
Write and submit a program that implements the spacewar game:
https://github.com/HHS-IntroProgramming/Spacewar
"""
from ggame import App, RectangleAsset, ImageAsset, Sprite, LineStyle, Color, Frame
from math import sin, cos
SCREEN_WIDTH = 640
SCREEN_HEIG... |
#!/usr/bin/env python
######################################################################################
# DATE: 2017/06/19
#
# MODULE: ttest_single_group.py
#
# VERSION: 1.0
#
# AUTHOR: Alexander Kirpich <akirpich@ufl.edu>
#
# DESCRIPTION: This tool runs t-test which can be either single, sample, or differences
#
... |
""" include the cam modules here"""
from . import cam_1
|
# coding=utf-8
"""
Implement a selection of EWS services.
Exchange is very picky about things like the order of XML elements in SOAP requests, so we need to generate XML
automatically instead of taking advantage of Python SOAP libraries and the WSDL file.
Exchange EWS references:
- 2007: http://msdn.microsoft.com... |
#!/usr/bin/env python
"""Updated version of VCF_from_FASTA.py that hopefully will simplify the
process of generating a VCF from Sanger reads aligned to a reference sequence.
Requires Biopython. Assumes the reference sequence is the first one in the
alignment. Takes one argument:
1) FASTA multiple sequence alignment... |
###############################################################################
# Copyright 2015-2019 University of Florida. All rights reserved.
# This file is part of UF CTS-IT's NACCulator project.
# Use of this source code is governed by the license found in the LICENSE file.
#######################################... |
#!/usr/bin/python
import re
import sys
import traceback
from SpanFinder import find_span
from cypari import *
# This class is just a wrapper for the structure storing polynomial/volume data.
# Having it avoids opaque references to the particular way data is stored that might change in the future.
class dataset:
... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# By: André Costa, Wikimedia Sverige
# License: MIT
# 2014
#
# Statistics cruncher for Wiki Loves Monuments in Sweden
# a reboot of the WLM stats-getter (WLM2011, 2011-09-30)
# designed to crunch the data from WLMStats.py
#
#
#Random notes
#Ladda json:
#Kan inte göra en init... |
# This Python module is part of the PyRate software package.
#
# Copyright 2020 Geoscience Australia
#
# 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/... |
"""
This module contains the class :class:`Ordering` and its descendants.
These classes handle how unique conditions at a particular experimental level are ordered and duplicated.
:class:`Ordering` instances should be passed directly to the :class:`~experimentator.design.Design` constructor;
there is no reason to other... |
# -*- encoding: utf-8 -*-
#
# Copyright © 2013 Intel Corp.
#
# Author: Lianhao Lu <lianhao.lu@intel.com>
# Author: Shane Wang <shane.wang@intel.com>
#
# 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 Licen... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.