text stringlengths 17 737k |
|---|
# BridgeDB by Nick Mathewson.
# Copyright (c) 2007-2009, The Tor Project, Inc.
# See LICENSE for licensing information
"""
This module sets up a bridgedb and starts the servers running.
"""
import os
import signal
import sys
import logging
import gettext
from twisted.internet import reactor
import bridgedb.Bridges ... |
from pyramid.view import view_config
from models import DBSession, Blackjack, Users
import random, json
random.seed(6);
shoe = []
@view_config(route_name='home', renderer='index.mak')
def shuffle(request):
#curUserName = "nick"
#curUserName = "jeid"
curUserName = "testAccount"
uAndB = getUserAndBl... |
import networkx as nx
from nose.tools import *
def test_richclub():
G = nx.Graph([(0,1),(0,2),(1,2),(1,3),(1,4),(4,5)])
rc = nx.richclub.rich_club_coefficient(G,normalized=False)
assert_equal(rc,{0: 12.0/30,1:8.0/12})
# test single value
rc0 = nx.richclub.rich_club_coefficient(G,normalized=Fa... |
# Copyright 2012, SIL International
# All rights reserved.
#
# 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 License, or
# (at your option) any lat... |
import sys
import operator
import numpy as np
from sklearn.base import BaseEstimator, RegressorMixin, clone
from sklearn.externals import six
from sklearn.metrics import r2_score, mean_absolute_error
class MetaRegressor(BaseEstimator, RegressorMixin):
""" A combined multi-class regressor
Parameters
------... |
import pytest
from django.db import IntegrityError
from ..models import Book, BookSpecimen
from .factories import BookFactory
pytestmark = pytest.mark.django_db
def test_deleting_book_sould_delete_specimen_too(specimen):
assert BookSpecimen.objects.count()
assert Book.objects.count()
specimen.book.dele... |
import os
import requests
from pyramid.view import view_config, view_defaults
from pyramid.settings import asbool
from pyramid.events import NewRequest
from mako.template import Template
from owslib.wms import WebMapService
from phoenix.twitcherclient import twitcher_service_factory
import logging
logger = logging.g... |
'''
Main modules for summarizer package.
Copyright, 2015.
Authors:
Luis Perez (luis.perez.live@gmail.com)
Kevin Eskici (keskici@college.harvar.edu)
'''
import os
import traceback
import nltk
import argparse
import sys
from . import grasshopper
from . import baselines
from . import textrank
tokenizer = nltk.data.loa... |
# Copyright (c) 2010-2012 OpenStack Foundation
#
# 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 agree... |
# Copyright (c) 2015 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
from UM.Mesh.MeshWriter import MeshWriter
from UM.Math.Vector import Vector
from UM.Scene.SceneNode import SceneNode
from UM.Scene.Iterator.BreadthFirstIterator import BreadthFirstIterator
from UM.Logger import Logger
fr... |
# 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, software
# distributed under the... |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# 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... |
# Copyright 2008-2012 Nokia Siemens Networks Oyj
#
# 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... |
# coding=utf-8
#
# ROSREPO
# Manage ROS workspaces with multiple Gitlab repositories
#
# Author: Timo Röhling
#
# Copyright 2016 Fraunhofer FKIE
#
# 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 a... |
# coding=utf-8
#
# ROSREPO
# Manage ROS workspaces with multiple Gitlab repositories
#
# Author: Timo Röhling
#
# Copyright 2016 Fraunhofer FKIE
#
# 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 a... |
#from interface.services.icontainer_agent import ContainerAgentClient
#from pyon.ion.endpoint import ProcessRPCClient
from pyon.public import Container, log, IonObject
from pyon.util.int_test import IonIntegrationTestCase
from interface.services.coi.iresource_registry_service import ResourceRegistryServiceClient
from ... |
"""Define TestFlow composed of test blocks or other test flows."""
# pylint: disable=protected-access
# pylint: disable=dangerous-default-value,unused-variable,too-many-arguments
from __future__ import absolute_import
from itertools import count
from rotest.core.block import TestBlock
from rotest.common.config import ... |
#!/usr/bin/env python
# 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
#
# Authors:
# - Mario Lassnig, mario.lassnig@cern.ch, 2017
# - Paul Nilsson, ... |
from __future__ import absolute_import
import os
from subprocess import Popen, PIPE
import simplejson
def sub_git_remote_url(git_dir):
args = ['config', '--get', "remote.origin.url"]
p = sub_git_cmd(git_dir, args)
gitout = p.stdout.read().strip()
return gitout
def sub_git_cmd(git_dir, args):
"""
... |
'''
System tests for `jenkinsapi.jenkins` module.
'''
import time
# To run unittests on python 2.6 please use unittest2 library
try:
import unittest2 as unittest
except ImportError:
import unittest
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
from jenkinsapi_tests.syste... |
"""Play menu."""
import wx, application, logging
from .base import BaseMenu
from functions.sound import queue, set_volume, get_previous, get_next
from config import config
logger = logging.getLogger(__name__)
class PlayMenu(BaseMenu):
"""The play menu."""
def __init__(self, parent):
self.name = '&Pla... |
# Generated by Django 2.2.7 on 2020-02-25 19:49
import json
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import kpi.fields.kpi_uid
import kpi.models.asset_file
import kpi.models.import_export_task
import private_storage.fields
import private_storage.storage.s3boto3
NULL_CHAR =... |
import smtplib
import os
import requests
from datetime import datetime
from dateutil.parser import parse
from overlord import celery
headers = {
'content-type': 'application/vnd.api+json',
'accept': 'application/*, text/*',
'authorization': 'Bearer ' + os.environ['TNYU_API_KEY']
}
class Event(object):
... |
import requests
import argparse
import json
import logging
import sys
import os
from tryagain import retries
from jinja2 import Environment, FileSystemLoader
class SpinnakerELB:
def __init__(self):
''
self.curdir = os.path.dirname(os.path.realpath(__file__))
self.templatedir = "{}/../../t... |
from abc import ABCMeta
class EnforceOverridesMeta(ABCMeta):
def __new__(mcls, name, bases, namespace, **kwargs):
# Ignore any methods defined on the metaclass when enforcing overrides.
for method in dir(mcls):
if not method.startswith("__") and method != "mro":
value =... |
import sys
import os
import distutils.util
import platform
import os.path
#
# import pygr & check to make sure it's imported from the right place
# (either the build directory or the source dir, if build_ext -i was
# used)
#
# get the current directory from __file__
testdir = os.path.dirname(__file__)
pygrdir = os.pa... |
"""Provides minor abstractions on top of ROOT to faciliate somewhat more
elegant plotting. As with anything that interfaces with ROOT, there are bound
to be... idiosyncrasies, though this module does its best to hide them. It
provides several functions for manipulating histograms or collections thereof:
- drawab... |
channels = {
"#huggle":
lambda x: x.get("X-Bugzilla-Product", None) == "Huggle",
"#pywikipediabot":
lambda x: x.get("X-Bugzilla-Product", None) == "Pywikibot",
"#wikimedia-corefeatures":
lambda x: (x.get("X-Bugzilla-Product", None) == "MediaWiki extensions") and \
(... |
#!/usr/bin/env python
"""
Uses the extended ContentHandler from xml_driver to extract the needed fields
from patent grant documents
"""
import cStringIO
from xml_driver import *
from xml_util import *
from xml.sax import xmlreader
class PatentGrant(object):
def __init__(self, filename, is_string=False):
... |
import pygame
import os
PATH = os.getcwd() + '/images/'
class GameDisplay(object):
def __init__(self):
pygame.init()
pygame.mouse.set_visible(1)
self.screen = pygame.display.set_mode((800, 600))
self.bust = pygame.image.load(PATH + 'bust.png')
self.bust.convert_alpha... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
import logging
import pytz
import uuid
from django.apps import apps
from django.conf import settings
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
from django.core.mail import send_mail
fro... |
import numpy as np
from scipy.integrate import ode
from .common import validate_tol, warn_extraneous
from .base import OdeSolver, DenseOutput
class LSODA(OdeSolver):
"""Lawrence Livermore solver for ODEs with automatic detection of nonstiff
and stiff problems
This solver switches automatically between th... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Takes *.mae structure files and generates *.com files for
conformational searches.
The *.mae files must contain several properties on the atoms and bonds. These
properties can be manually entered into the *.mae. They can also be
accessed using Schrödinger's structure m... |
fileName = "./detect_langue/corpus_entrainement/english-training.txt"
#{"a" = 0," ":0 }
def Create_empty_unigram(fileName):
file = open(
fileName, "r", encoding="utf8")
dictionairy = {}
for line in file:
for char in line:
dictionairy[char] = 0
return dictionairy
# return l... |
def file_is_allowed(file):
return file.endswith(".py") and "__Init__" not in file.title() and "Sample_City" not in file.title()
|
#!/usr/bin/env python
import json
import subprocess
import sys
import time
def wait_for_proxy():
stdout = sys.stdout
sys.stdout = sys.stderr
input("UI proxy expired. Please create a new proxy (see README) and press ENTER to continue.")
sys.stdout = stdout
STATUS_ATTEMPTS = 20
jobid = sys.argv[1]
... |
"""
plotly
======
A module that contains the plotly class, a liaison between the user
and ploty's servers.
1. get DEFAULT_PLOT_OPTIONS for options
2. update plot_options with .plotly/ dir
3. update plot_options with _plot_options
4. update plot_options with kwargs!
"""
from __future__ import absolute_import
impo... |
import csv
import numpy as np
from collections import Counter
import datetime
#import matplotlib.pyplot as plt; plt.rcdefaults()
import matplotlib.pyplot as plt
file = open('data/allDefunciones.csv', "r")
#fileDataName = open('data/allNacimientos.csv', "rb")
reader = csv.reader(file)
rownum = 0
allData = []
ALLDATA... |
# For practice, implement the following linked list operations as
# recursive functions. If the name of a function ends in "_tr", its
# implementation should be tail-recursive [1]. Tail recursion is
# important because it is how functional languages implement iteration.
# In such languages, tail recursion is more eff... |
from __future__ import print_function, division, absolute_import
import itertools
import uuid
from dask.base import tokenize
from dask.utils import funcname
from tornado import gen
from tornado.gen import Return
from tornado.locks import Event
from tornado.concurrent import Future
from tornado.ioloop import IOLoop
fr... |
#!/usr/bin/python
#
# Copyright (c) 2018 Yunge Zhu, <yungez@microsoft.com>
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... |
#!/usr/bin/env python
import os
import sys
class Error(Exception):
pass
class ParseError(Error):
def __init__(self, e, msg=None):
self.f, self.lineno, self.line = e.cur()
self.msg = msg
def __str__(self):
print ": " + self.msg
print
print self.f + " line " + str(self.lineno) + ":"
print ">>>" + self.l... |
'''create charts showing median and mean prices each month
INVOCATION
python chart-01.py [--data] [--test]
INPUT FILES
INPUT/samples-train-validate.csv
OUTPUT FILES
WORKING/chart-01/data.pickle
WORKING/chart-01/median-price.pdf
WORKING/chart-01/median-price.txt
WORKING/chart-01/median-price_2006_2007.txt
'''
... |
# 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, software
# distributed under the... |
# -*- coding: utf-8 -*-
"""
Pyroxene v.0.1
An event-driven proxy server.
license: 2-Clause BSD License.
The server listens for incoming connections on it's port, given in
a command-line argument, and spawns
"""
from __future__ import print_function, with_statement
import sys
import errno
import socket
import selec... |
#copyright ReportLab Inc. 2000
#see license.txt for license details
#history http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/reportlab/pdfgen/pdfimages.py?cvsroot=reportlab
#$Header: /tmp/reportlab/reportlab/pdfgen/pdfimages.py,v 1.21 2004/03/17 00:21:39 rgbecker Exp $
__version__=''' $Id: pdfimages.py,v 1.21 2004/03/17 ... |
from django.conf.urls import patterns, url
from docs.views import DocsRootView, serve_docs
urlpatterns = patterns('',
url(r'^$', DocsRootView.as_view(permanent=True), name='docs_root'),
url(r'^(?P<path>.*)$', serve_docs, name='docs_files'),
)
|
#!/usr/bin/python
# -*- coding: utf-8 -*-
## Binary Analysis Tool
## Copyright 2009-2013 Armijn Hemel for Tjaldur Software Governance Solutions
## Licensed under Apache 2.0, see LICENSE file for details
'''
Program to process a whole directory full of compressed source code archives
to create a knowledgebase. Needs a... |
# SPDX-License-Identifier: Apache-2.0
#
# Copyright (C) 2015, ARM Limited and contributors.
#
# 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
#
# ... |
"""MySensors notification service."""
from __future__ import annotations
from typing import Any, cast
from homeassistant.components.notify import ATTR_TARGET, BaseNotificationService
from homeassistant.const import Platform
from homeassistant.core import HomeAssistant
from homeassistant.helpers.typing import ConfigTy... |
from __future__ import absolute_import
from .base import BaseDataset
class NoObjectsException(Exception):
pass
class DatasetOptions(object):
def __init__(self, options=None):
self.model = getattr(options, 'model', None)
self.queryset = getattr(options, 'queryset', None)
class DatasetMetaclas... |
# coding: utf-8
import math
from datetime import timedelta
from django.utils import timezone
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from django.contrib.sites.models import Site
from django.core.cache import cache
from d... |
calib = {
'El-E': {
'robot': 'El-E',
'pos_factor': 0.9144 / (183897 - 1250),
'vel_factor': 0.9144 / (183897 - 1250) / 20,
'acc_factor': 0.9144 / (183897 - 1250),
'POS_MAX': 0.9,
'VEL_DEFAULT': 1.5,
'VEL_MAX': 4.0,
'ACC_DEFAULT':0.0002,
'ACC_MA... |
__author__ = 'Gareth Coles'
from system.events.base import BaseEvent
class GeneralEvent(BaseEvent):
"""
A general event, not tied to a protocol.
If an event subclasses this, chances are it's a protocol-agnostic event.
This can be thrown from anywhere - even from a protocol. You should avoid
throw... |
import json
try:
from urllib.parse import urlencode
except ImportError:
from urllib import urlencode
import uuid
from django.core.urlresolvers import reverse
from django.test import RequestFactory
from django.test import TestCase
from jwkest.jwk import KEYS
from jwkest.jws import JWS
from jwkest.jwt import JWT... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Af... |
# -*- coding: utf-8 -*-
"""
Created on Thu Jul 27 16:39:59 2017
@author: asadm2
"""
from __future__ import division, print_function, absolute_import
import astropy
from glob import glob
from astropy.io import fits
from astropy.io.fits import getdata
import warnings
from astropy.utils.exceptions import AstropyUserWarni... |
# Check files for incorrect newlines
import fnmatch, os
def check_file(fname):
for n, line in enumerate(open(fname, "rb")):
if "\r" in line:
print "%s@%d: CR found" % (fname, n)
return
def check_files(root, patterns):
for root, dirs, files in os.walk(root):
for f in fi... |
from django.shortcuts import render_to_response
from django.contrib.auth.models import *
from django.template.loader import get_template
from django.template import Context
from django.http import HttpResponse, Http404
from lingcod.common import mimetypes
from lingcod.common import utils
from lingcod.mpa.models import... |
from __future__ import absolute_import, division
from collections import OrderedDict, defaultdict
from datetime import datetime
import six
from dateutil.relativedelta import relativedelta
from dateutil.rrule import rrule, MONTHLY
from django.db.models.aggregates import Sum, Max
from django.utils.translation import ug... |
# -*- coding: utf-8 -*-
import logging
import os
import re
import types
log = logging.getLogger('rhizi')
class RZ_Config(object):
"""
rhizi-server configuration
TODO: config option documentation
listen_address
listen_port
log_level: upper/lower case log level as specified b... |
"""
Module contains tools for processing files into DataFrames or other objects
"""
from __future__ import print_function
from collections import defaultdict
import csv
import datetime
import re
import sys
from textwrap import fill
import warnings
import numpy as np
import pandas._libs.lib as lib
import pandas._lib... |
#!/usr/bin/env python
# Copyright (c) 2010 Kristinn B. Gylfason <fergus@citeulike.org>
# 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 ... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Af... |
#!/usr/bin/env python
from optparse import OptionParser
import json
from urlparse import urlparse
DEBUG = 3
INFO = 2
WARNING = 1
ERROR = 0
LEVELS = [DEBUG, INFO, WARNING, ERROR]
def get_scheme(url):
return urlparse(url).scheme
def dict_to_str(dic, indent=0):
keys = dic.keys()
length = max(map(lamb... |
"""A generic class to build line-oriented command interpreters.
Interpreters constructed with this class obey the following conventions:
1. End of file on input is processed as the command 'EOF'.
2. A command is parsed out of each line by collecting the prefix composed
of characters in the identchars member.
3. A ... |
#!/usr/bin/env python
# Copyright 2020 Google
#
# 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 agr... |
class Sound:
"""
Defines the properties of a game sound.
Sound resources are defined in .snd files.
"""
def __init__(self, name, soundFile = None, volume = 1.0, balance = 0.0, node = None, cutOff = None, rate = 1.0, subtitles = None):
self.name = name # the logical name of ... |
# -*- encoding: utf-8 -*-
import pendulum
try:
from urllib.parse import urljoin
except:
from urlparse import urljoin
from pyquery import PyQuery as pq
import jenkins
from . import template
from . import credentials
class LintException(Exception):
pass
class LintJobExistException(LintException):
... |
from datetime import date, datetime
from django.contrib.auth.decorators import permission_required
from django.utils.decorators import method_decorator
from django.views.generic import TemplateView
from django.views.generic import DetailView
from django.views.generic import CreateView
from django.views.generic import ... |
# 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... |
from icalendar import Calendar,Event
from datetime import datetime
import pytz
import unittest
import hashlib
rcal_config = {'days': 14}
class rCal(Calendar):
""" Container for the Calendar we will serve
"""
def __init__(self, name, description, events):
Calendar.__init__(self)
self.add('... |
#! /usr/local/bin/python
"""
See LICENSE file for copyright and license details.
"""
from datetime import datetime
from database.databaseaccess import DatabaseAccess
from modules.core_module import CoreModule
from modules.statement import Statement
from modules.constant import *
from modules.function import *... |
#! /usr/bin/env python
# pdb.py -- finally, a Python debugger!
# (See pdb.doc for documentation.)
import string
import sys
import linecache
import cmd
import bdb
import repr
import os
# Interaction prompt line will separate file and call info from code
# text using value of line_prefix string. A newline and arrow... |
# This file is part of Indico.
# Copyright (C) 2002 - 2018 European Organization for Nuclear Research (CERN).
#
# 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 3 of the
# License, or (a... |
#!/usr/bin/env python
from __future__ import print_function
import errno
import logging
import os
from Queue import Queue, Empty
from .utils import mkdir_p, get_rosdistro, update_folder, symlink_force
from .workspace import ws_file
logger = logging.getLogger(__name__)
installed_dir = os.path.join(ws_file, '.env', 'i... |
# Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
from collections import de... |
#! usr/bin/env python #
# -*- coding: utf-8 -*-
import datetime, calendar
POSIMONTHS = ('Moses', 'Homer', 'Aristotle', 'Archimedes', 'Caesar', 'Saint Paul', 'Charlemagne', 'Dante', 'Gutenberg', 'Shakespeare', 'Descartes', 'Frederick', 'Bichat', 'Complementary')
REGMONTHS = ('January', 'February', 'March', 'April', 'M... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# king_phisher/ics.py
#
# 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... |
import logging
from indra.preassembler.grounding_mapper.standardize \
import standardize_agent_name
logger = logging.getLogger(__name__)
# If the adeft disambiguator is installed, load adeft models to
# disambiguate acronyms and shortforms
try:
from adeft import available_shortforms as available_adeft_models
... |
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2015-2018 GEM Foundation
#
# OpenQuake 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 version 3 of the Licen... |
import album
import artist
import dispatch
import schedule
import threading
pre_sync = dispatch.Signal()
post_sync = dispatch.Signal()
class RainwaveChannel(object):
'''A :class:`RainwaveChannel` object represents one channel on the Rainwave
network.
.. note::
You should not instantiate an obje... |
"""Tests for distutils.command.config."""
import unittest
import os
import sys
from test.support import run_unittest
from distutils.command.config import dump_file, config
from distutils.tests import support
from distutils import log
class ConfigTestCase(support.LoggingSilencer,
support.TempdirMa... |
"""This module implements a client to the Gilda grounding web service,
and contains functions to help apply it during the course of INDRA assembly."""
import logging
import requests
from urllib.parse import urljoin
from indra.preassembler.grounding_mapper.standardize \
import standardize_agent_name
from indra.confi... |
from cases.factories import CaseFactory
from letters.factories import LetterFactory
from users.factories import UserFactory
from django.test import TestCase, RequestFactory
from cases.filters import StaffCaseFilter
from django.core.urlresolvers import reverse_lazy
from cases.models import Case
from django.test.utils im... |
from django.shortcuts import render, get_object_or_404
from django.views.decorators.csrf import csrf_exempt
from django.http import HttpResponseForbidden, JsonResponse, HttpResponseServerError
from django.http import HttpResponse
from .models import Hubs
def index(request):
hubs = Hubs.objects.all()
context ... |
# Copyright 2009-2014 by Luc Saffre.
# License: BSD, see LICENSE for more details.
""".. management_command:: initdb
Performs an initialization of the database, replacing all data by default
data (according to the specified fixtures).
This command REMOVES *all existing tables* from the database
(not only Django tabl... |
#!/usr/bin/env python
# coding: utf-8
try:
import http.client as http_client
except ImportError:
# Python 2
import httplib as http_client
#http_client.HTTPConnection.debuglevel = 1
#http_client.HTTPSConnection.debuglevel = 1
import sys, os
import urllib
import random, binascii
from urlparse import urlpa... |
"""
MMRadar.py
"""
from ggame import App, Color, LineStyle, Sprite, RectangleAsset, CircleAsset, EllipseAsset, LineAsset
from ggame import ImageAsset, PolygonAsset, Frame, Sound, SoundAsset, TextAsset
import time
import random
import math
weather = int(input("Any weather? (1 for custom, 0 for none)"))
if weather == 1... |
# -*- coding: UTF-8 -*-
# Copyright 2017-2018 Rumma & Ko Ltd
# License: BSD (see file COPYING for details)
"""
Import legacy data from TIM (second step).
Much legacy data is already in Lino (first imported by
:mod:`spzloader` and then manually reviewed and maintained), now we
parse the legacy database once more, add... |
import numpy as np
import nibabel as nib
import MRS.analysis as ana
import MRS.utils as ut
class GABA(object):
"""
Class for analysis of GABA MRS.
"""
def __init__(self, in_file, line_broadening=5, zerofill=100,
filt_method=None, min_ppm=-0.7, max_ppm=4.3):
"""
P... |
"""tests/test_decorators.py.
Tests the decorators that power hugs core functionality
Copyright (C) 2016 Timothy Edmund Crosley
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... |
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from master import master_config
from master import master_utils
from master import gatekeeper
from master.factory import chromium_factory
import master_sit... |
# Django settings for dierentheater project.
import os
PROJECT_PATH = os.path.abspath(os.path.split(__file__)[0])
PROJECT = os.path.split(PROJECT_PATH)[1]
import logging
from os.path import exists
if not exists(PROJECT_PATH + "/log/"):
os.mkdir(PROJECT_PATH + "/log/")
if not exists(PROJECT_PATH + "/dump/"):
... |
import socket
import struct
class Connection:
def __init__(self):
self.sent = bytearray()
self.received = bytearray()
def read(self, length):
result = self.received[:length]
self.received = self.received[length:]
return result
def write(self, data):
if isi... |
# -*- Mode: Python; py-indent-offset: 4 -*-
# coding=utf-8
# vim: tabstop=4 shiftwidth=4 expandtab
import unittest
import traceback
import ctypes
import warnings
import sys
try:
import cairo
has_cairo = True
from gi.repository import Regress as Everything
except ImportError:
has_cairo = False
#import... |
# Copyright 2012,2013 Colin Scott
# Copyright 2012,2013 James McCauley
#
# 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 ... |
# -*- coding: utf-8 -*-
# Django settings for zamboni project.
import os
import logging
import socket
import product_details
try:
# If we have build ids available, we'll grab them here and add them to our
# CACHE_PREFIX. This will let us not have to flush memcache during updates
# and it will let us pre... |
# -*- coding: utf-8 -*-
# Copyright (c) 2010-2013, GEM Foundation.
#
# OpenQuake 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 version 3 of the License, or
# (at your option) any later version... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import rospy
import geometry_msgs.msg
import tf
from geometry_msgs.msg import Quaternion
import math
from std_srvs.srv import Trigger
from fulanghua_srvs.srv import Pose
from time import sleep
from geometry_msgs.msg import Twist
from sensor_msgs.msg import LaserScan
line_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.