text stringlengths 17 737k |
|---|
from inspect import isclass
from typing import Any, Dict, List, Tuple
# TODO improve handling of non-string keys
def _assert_isinstance(value, _type):
"""Check if a value conforms to a type (recursively for collections and records)."""
if not isinstance(type(_type), type):
raise ValueError("_type m... |
"""
Object oriented wrapper around RPi.GPIO. A work in progress.
(zourtney, August 2013)
"""
import RPi.GPIO as GPIO
class Header(object):
"""Controls initializing and cleaning up GPIO header."""
def __init__(self):
GPIO.setmode(GPIO.BOARD)
def __del__(self):
GPIO.cleanup()
def __enter__(self):
... |
# Copyright (C) 2017 PyWaves Developers
#
# This file is part of PyWaves.
#
# It is subject to the license terms in the LICENSE file found in the top-level
# directory of this distribution.
#
# No part of python-bitcoinlib, including this file, may be copied, modified,
# propagated, or distributed except according to t... |
# -*- coding: utf-8 -*-
import pytest
import sys
import cPickle as pickle
from test_base_class import TestBaseClass
aerospike = pytest.importorskip("aerospike")
try:
from aerospike.exception import *
except:
print "Please install aerospike python client."
sys.exit(1)
from aerospike import predicates as p... |
# encoding=utf-8
from dperrors import DanmicholoParseError
from parser import *
from templateeditor import TemplateEditor
from maintext import MainText, condition_for_soup
|
# Copyright 2013 Hansel Dunlop
# All rights reserved
#
# Author: Hansel Dunlop - hansel@interpretthis.org
#
from datetime import datetime
import locale
from django.core.mail import EmailMultiAlternatives
from django.template import Context
from django.template.loader import get_template
from django.utils.timezone imp... |
import frappe
def set_default_role(doc, method):
'''Set customer, supplier, student based on email'''
if frappe.flags.setting_role or frappe.flags.in_migrate:
return
roles = frappe.get_roles(doc.name)
contact_name = frappe.get_value('Contact', dict(email_id=doc.email))
if contact_name:
contact = frappe.get_... |
import unittest
from psqlparse import parse
from psqlparse.exceptions import PSqlParseError
from psqlparse import nodes
class SelectQueriesTest(unittest.TestCase):
def test_select_all_no_where(self):
query = "SELECT * FROM my_table"
stmt = parse(query).pop()
self.assertIsInstance(stmt, n... |
""" Lots of functions for drawing and plotting visiony things """
# TODO: New naming scheme
# viz_<funcname> will clear everything. The current axes and fig: clf, cla. # Will add annotations
# interact_<funcname> will clear everything and start user interactions.
# show_<funcname> will always clear the current axes, b... |
import grumpy
from grumpy import BBTree, gexf_installed, baktree
import Polyhedron2D
from Polyhedron2D import Polyhedron2D
|
import pytest
import numpy as np
import os
import sys
import tempfile
import torch
import torchvision.utils as utils
import unittest
from io import BytesIO
import torchvision.transforms.functional as F
from PIL import Image, __version__ as PILLOW_VERSION, ImageColor
from _assert_utils import assert_equal
PILLOW_VERSI... |
bl_info = {
"name": "Sprytile Painter",
"author": "Jeiel Aranal",
"version": (0, 4, 32),
"blender": (2, 7, 7),
"description": "A utility for creating tile based low spec scenes with paint/map editor tools",
"location": "View3D > UI panel > Sprytile",
"wiki_url": "https://chemikhazi.github.io... |
# -*- coding: utf-8 -*-
# Django settings for sandbox project.
import os, sys
from django.core.urlresolvers import reverse_lazy, reverse
import environ
# set default values and casting
env = environ.Env(DEBUG=(bool, False),
CELERY_ALWAYS_EAGER=(bool, False),
)
# Django settings f... |
"""distutils
The main package for the Python Module Distribution Utilities. Normally
used from a setup script as
from distutils.core import setup
setup (...)
"""
# Distutils version
#
# Updated automatically by the Python release process.
#
#--start constants--
__version__ = "3.4.0a0"
#--end constants--
|
#!/usr/bin/env python
import sys
from twisted.internet.endpoints import TCP4ServerEndpoint
from twisted.internet import reactor
import editorFactory
def onErr(err):
print 'AVENGE MEEEEEEEEE!'
sys.exit(1)
if __name__ == "__main__":
server = editorFactory.EditorFactory()
endpoint = TCP4ServerEndpoint(reac... |
#!/usr/bin/env python3
# Run script for CrabBot
# A mess of config args and terminal polling code
#
# See -h or read the argparse setup for argument details
import argparse
import datetime
import logging
import os
import readline # Only for better terminal input support, eg. history. Does not work on Windows, but doe... |
from ui.stroke import Stroke
from threading import Lock
from PyQt4 import QtCore, QtGui
from dp.src.utils.log import Log
import copy
from dp.src.protocol.OperationEngine import OperationEngine
class PeerState(QtCore.QObject):
"""Stores all data concerning a peer's state
Contains:
- list of other peer... |
from django.db import models
TALK_STATUS_CHOICES = (
('S', 'Submitted'),
('A', 'Approved'),
('R', 'Rejected'),
('C', 'Confirmed'),
)
class Talk(models.Model):
speaker_name = models.CharField(max_length=1000)
speaker_email = models.CharField(max_length=1000)
title = models.CharField(max_l... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2009-2011 Umeå 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... |
import os
import sys
import json
import time
import logging
try:
from functools import reduce
except ImportError:
pass
try:
import urllib.request as urllib2
except ImportError:
import urllib2
log = logging.getLogger("travis.leader")
log.addHandler(logging.StreamHandler())
log.setLevel(logging.INFO)
... |
# -*- coding: utf-8 -*-
"""
treebeard.models
----------------
Django models.
:copyright: 2008-2010 by Gustavo Picon
:license: Apache License 2.0
"""
import operator
from django.db.models import Q
from django.db import models, transaction
from treebeard.exceptions import InvalidPosition, Missi... |
__version__ = (1, 5, 2, 'b1')
full_version = '.'.join(str(x) for x in __version__[0:3]) + \
''.join(__version__[3:])
release = full_version
short_version = '.'.join(str(x) for x in __version__[0:3])
|
# Copyright (c) 2017 Sony Corporation. 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 applicabl... |
import datetime
import importlib
import os
import sys
import click
import jinja2
import markdown
import yaml
from docutils.core import publish_parts
from utilkit import datetimeutil, fileutil
def include_type_exists(key):
"""
Check whether the include type (plugin) is valid/exists.
Needs a file of the fo... |
from babel.dates import format_date
from babel.numbers import format_currency
from django.contrib.sites.models import Site
from django.core.mail import EmailMultiAlternatives
from django.template.loader import get_template
from django.template import Context
from django.utils.translation import ugettext_lazy as _
from ... |
# -*- coding: utf-8 -*-
from django.db import models
from django.conf import settings
import os, datetime
from apps.people.models import Member
class Area(models.Model):
title = models.CharField(max_length=100)
content = models.TextField(null=True, blank=True)
class Meta:
verbose_name = "Area"
... |
import sys
import numpy as np
import pandas
BENPUF = False # set temporarily to True to generated benpuf.csv file
# BENPUF = False will generate puf.csv file without any benefits variables
def main():
"""
Contains all the logic of the puf_data/finalprep.py script.
"""
# (*) Read unprocessed input f... |
"""
desitarget.cuts
===============
Target Selection for DECALS catalogue data derived from `the wiki`_.
A collection of helpful (static) methods to check whether an object's
flux passes a given selection criterion (*e.g.* LRG, ELG or QSO).
.. _`the Gaia data model`: https://gea.esac.esa.int/archive/documentation/GD... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# pyAggr3g470r - A Web based news aggregator.
# Copyright (C) 2010-2014 Cédric Bonhomme - http://cedricbonhomme.org/
#
# For more information : https://bitbucket.org/cedricbonhomme/pyaggr3g470r/
#
# This program is free software: you can redistribute it and/or modify
# i... |
import sys
import numpy as np
import matplotlib.pyplot as plt
import _pybinding
from .utils import cpuinfo, progressbar
from .results import Sweep
__all__ = ['num_cores', 'sweep']
num_cores = cpuinfo.physical_core_count()
def _plain_sweep(variables, produce, report, num_threads=num_cores, queue_size=num_cores):
... |
import collections
import pyconll._parser
from pyconll.unit import Sentence
class Conll:
"""
The abstraction for a CoNLL-U file. A CoNLL-U file is more or less just a
collection of sentences in order. These sentences can be accessed by
sentence id or by numeric index. Note that sentences must be sepa... |
#!/usr/bin/env python
# vim: set sw=4 et:
import logging
import json
import time
import threading
import kombu
import socket
from brozzler.browser import BrowserPool, BrowsingException
import brozzler
import urlcanon
class AmqpBrowserController:
"""
Consumes amqp messages representing requests to browse urls,... |
"""
The :mod:`pyeda.boolalg.expr` module implements
Boolean functions represented as expressions.
Interface Functions:
* :func:`exprvar`
* :func:`expr`
* :func:`ast2expr`
* :func:`expr2dimacscnf`
* :func:`upoint2exprpoint`
* :func:`Not`
* :func:`Or`
* :func:`And`
* :func:`Nor`
* :func:`Nand`
* :func:`Xor`
* :func:`... |
VERSION = (0, 9, 2)
__version__ = ".".join([str(x) for x in VERSION])
|
import copy
import math
import operator
import sys
import typing as t
import warnings
from functools import partial
from functools import update_wrapper
from .wsgi import ClosingIterator
if t.TYPE_CHECKING:
from wsgiref.types import WSGIApplication
try:
from greenlet import getcurrent as _get_ident
except Im... |
from ..overrides import override
from ..importer import modules
from gi.repository import GObject
Accounts = modules['Accounts']._introspection_module
__all__ = []
def _get_string(self, key, default_value=None):
value = GObject.Value()
value.init(GObject.TYPE_STRING)
if self.get_value(key, value) != Acco... |
#!/usr/bin/env python
"""Command line utility for querying the Logitech Harmony."""
from __future__ import print_function
import argparse
import logging
import json
import sys
from pyharmony import auth
from pyharmony import client as harmony_client
import code
class EmbeddedConsole(code.InteractiveConsole):
def... |
__version_info__ = ('1', '11', '1')
__version__ = '.'.join(__version_info__)
from .wrappers import (ObjectProxy, CallableObjectProxy, FunctionWrapper,
BoundFunctionWrapper, WeakFunctionProxy, PartialCallableObjectProxy,
resolve_path, apply_patch, wrap_object, wrap_object_attribute,
function_wra... |
# Copyright 2013 Mike Wakerly <opensource@hoho.com>
#
# This file is part of the Pykeg package of the Kegbot project.
# For more information on Pykeg or Kegbot, see http://kegbot.org/
#
# Pykeg is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by... |
"""
This module provides a general "estimate" function and EstimationObj class for
pylogit's logit-type models.
"""
import sys
import time
import numpy as np
from scipy.optimize import minimize
import choice_calcs as cc
from choice_calcs import create_matrix_block_indices
from choice_tools import ensure_ridge_is_scala... |
# 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
# d... |
# Copyright 2009 10gen, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, soft... |
#!/usr/bin/env python3
import tempfile
from pyontutils.core import auth
__doc__ = f"""Use SciGraph to load an ontology from a loacal git repository.
Remote imports are replaced with local imports.
NIF -> http://ontology.neuinfo.org/NIF
Usage:
ontload graph [options] <repo> <remote_base>
ontload config [options... |
# This Python module is part of the PyRate software package.
#
# Copyright 2017 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/... |
__version__ = "0.8.4"
|
#!/usr/bin/env python
##############################################################
# universal core routines for processing SAR images with GAMMA
# John Truckenbrodt 2014-2019
##############################################################
"""
This module is intended as a set of generalized processing routines for mo... |
# Copyright 2014 Dan Kilman
#
# 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, softw... |
# -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.base.exchange import Exchange
import json
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import AuthenticationE... |
##
## Author(s):
## - Cedric GESTES <gestes@aldebaran-robotics.com>
##
## Copyright (C) 2009, 2010, 2011 Aldebaran Robotics
##
import os
import glob
import platform
import subprocess
import logging
import qitools.configstore
import qitools.qiworktree
import qibuild
from qibuild.project import Project
import q... |
#!/usr/bin/env python
"""
Test driver
Runs off plain text files, similar to how PHP's test harness works
"""
import os
import glob
from libinjection import *
from words import *
print version()
def print_token_string(tok):
"""
returns the value of token, handling opening and closing quote characters
"""
... |
from match_images import project_to_header,match_fits,register_fits
from fits_overlap import fits_overlap,header_overlap
from hcongrid import hcongrid,zoom_fits
|
#!/usr/bin/env python
#
# Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
# Copyright (c) 2013 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://... |
import numpy as np
from ..core import CatalogueManager
from ..core.utils import *
from ..core.controllers import DeviceEvent, Key
from ..components import InputComponent
from ..model import Actions
import threading
class InputManager(object):
""" Input Worker Class
This class will manage all the events sent b... |
# Copyright 2020 Google LLC, Derek Liu
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... |
#!/usr/bin/python
# Copyright (c) 2012 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import json
import os
import subprocess
import sys
import tempfile
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))... |
import datetime
import re
import time
import dateutil
from dateutil import parser
from funcy import contextmanager, decorator
from werkzeug.contrib.cache import SimpleCache
@contextmanager
def timeit():
t1 = time.time()
yield
print("Time Elapsed: %.2f" % (time.time() - t1))
@decorator
def simple_cache... |
# -*- coding: utf-8 -*-
"""
pyvisa-py.session
~~~~~~~~~~~~~~~~~
Base Session class.
:copyright: 2014 by PyVISA-py Authors, see AUTHORS for more details.
:license: MIT, see LICENSE for more details.
"""
from __future__ import division, unicode_literals, print_function, absolute_import
import abc... |
# -*- coding: utf-8 -*-
"""
pyvisa-sim.devices
~~~~~~~~~~~~~~~~~~
Classes to simulate devices.
:copyright: 2014 by PyVISA-sim Authors, see AUTHORS for more details.
:license: MIT, see LICENSE for more details.
"""
try:
import Queue as queue
except ImportError:
import queue
import stringp... |
import yaml
from .errors import ConfigError
class ConfigLoader(object):
config_root_class = None
def __init__(self, config_text, context={}, *args, **kwargs):
assert self.config_root_class is not None
self.config_text = config_text
self.config_dict = None
self.config_root = ... |
# -*- coding: utf-8 -*-
"""
Interface functions to Mediawiki's api.php
"""
#
# (C) Pywikipedia bot team, 2007
#
# Distributed under the terms of the MIT license.
#
__version__ = '$Id: $'
import urllib
import http
import simplejson as json
import warnings
class APIError(Exception):
"""The wiki site returned an e... |
# -*- coding: utf-8 -*-
"""
Interface functions to Mediawiki's api.php
"""
#
# (C) Pywikipedia bot team, 2007-08
#
# Distributed under the terms of the MIT license.
#
__version__ = '$Id$'
from UserDict import DictMixin
from datetime import datetime, timedelta
import simplejson as json
import logging
import re
import ... |
# -*- coding: utf-8 -*-
"""Storj command-line interface package."""
import os
import click
import ConfigParser
from storj.http import Client
APP_NAME = 'storj'
CFG_EMAIL = 'storj.email'
CFG_PASSWORD = 'storj.password'
def get_client():
"""Returns a pre-configured Storj HTTP client.
Returns:
(:py... |
# -*- coding: utf-8 -*-
""" IntelMQ parser for Netlab 360 data feeds. """
from intelmq.lib.bot import ParserBot
from intelmq.lib.harmonization import DateTime
class Netlab360ParserBot(ParserBot):
DGA_FEED = {'http://data.netlab.360.com/feeds/dga/dga.txt'}
MAGNITUDE_FEED = {'http://data.netlab.360.com/feeds/e... |
import numpy as np
def average_cell(traj):
axesl = [atoms.get_cell() for atoms in traj]
axes = np.mean(axesl, axis=0)
return axes
def average_frames(traj):
"""Average atomic positions from a segment of MD trajectory.
Assume atomic displacement between frames < L/2.
Args:
list: list of ASE Atoms
Ret... |
# -----------------------------------------------------------------------------
# Copyright (c) 2014--, The Qiita Development Team.
#
# Distributed under the terms of the BSD 3-clause License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... |
import re
import string
from .pathfeatures import PathFeature, PATH_PATTERN
from .util import ReadableException
class Constraint(PathFeature):
"""
A class representing constraints on a query
===========================================
All constraints inherit from this class, which
simply defines t... |
#
# The Qubes OS Project, https://www.qubes-os.org/
#
# Copyright (C) 2015 Joanna Rutkowska <joanna@invisiblethingslab.com>
# Copyright (C) 2013-2015 Marek Marczykowski-Górecki
# <marmarek@invisiblethingslab.com>
# Copyright (C) 2015 Wojtek Porczyk <woju@invisiblethingslab.com>
#
# This ... |
"""
quilt.QuiltingRoom
Main module to quilt a static site by stitching html page together
{: .lead}
1. set `source` to users directory containing the [appropriate files](#exampledir) (default output is `quilted_` + `source`)
2. read `config.json` and override [default configuration](#configuration)
3. load quilt file... |
#!/usr/bin/python3
import errno
import json
import os
import os.path
import re
import shlex
import shutil
import subprocess
import sys
import tempfile
if any(s == "--help" for s in sys.argv):
print("""Usage:
GenerateFlowTestCase.py specsToTest.csv projectPom.xml outdir [--force]
This generates test cases exercis... |
from __future__ import unicode_literals
from __future__ import division
import hashlib
import json
import logging
import math
import os.path
import re
from collections import defaultdict
from dirtyfields import DirtyFieldsMixin
from six.moves import reduce
from six.moves.urllib.parse import (urlencode, urlparse)
fro... |
import sys
import math
from PyQt4 import QtGui
from PyQt4.QtCore import Qt
import numpy as np
import sklearn.cross_validation as skl_cross_validation
from Orange.widgets import widget, gui
from Orange.widgets.settings import Setting
from Orange.data import Table
from Orange.data.sql.table import SqlTable
class OWD... |
from six import string_types
from six.moves import xrange
from py_stringmatching import utils
from py_stringmatching.tokenizer.definition_tokenizer import DefinitionTokenizer
class QgramTokenizer(DefinitionTokenizer):
"""Returns tokens that are sequences of q consecutive characters.
A qgram of an input ... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 XCG Consulting (www.xcg-consulting.fr)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... |
import os
import common
import unittest
import pyuv
BAD_FILE = 'test_file_bad'
TEST_FILE = 'test_file_1234'
TEST_FILE2 = 'test_file_1234_2'
TEST_LINK = 'test_file_1234_link'
TEST_DIR = 'test-dir'
BAD_DIR = 'test-dir-bad'
class FSTest(common.UVTestCase):
def setUp(self):
self.loop = pyuv.Loop.default_l... |
#!/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 applicable... |
# Copyright 2011 James McCauley
# Copyright 2008 (C) Nicira, Inc.
#
# 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) an... |
#!/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 applicable... |
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from waldo.go.models import Term
import waldo.go.load
import waldo.go.go
def test_is_cellular_component():
engine = create_engine('sqlite://')
metadata = waldo.go.models.Base.metadata
metadata.bind = engine
metadata.create_all... |
# Copyright (c) 2014 Yubico AB
# All rights reserved.
#
# This program 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.
#
# This program... |
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
############################################################################
#
# passgen.py
#
############################################################################
#
# Author: Videonauth <videonauth@googlemail.com>
# Date: 30.06.2016
# Purpose:
# Generate a rand... |
#vim:set et sts=4 sw=4:
#
# Zanata Python Client
#
# Copyright (c) 2011 Jian Ni <jni@redhat.com>
# Copyright (c) 2011 Red Hat, Inc.
#
# 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; eithe... |
import logging
from datetime import date
from google.appengine.api import memcache
from google.appengine.ext import db
from google.appengine.api.taskqueue import Task
from data_model import PhoneLog
def getKey(phone):
return 'paywall-user-%s' % phone
# memcache the new user to mark it as payed and valid
def validat... |
"""Provide the RateLimiter class."""
import logging
import time
log = logging.getLogger(__package__)
class RateLimiter(object):
"""Facilitates the rate limiting of requests to reddit.
Rate limits are controlled based on feedback from requests to reddit.
"""
def __init__(self):
"""Create an... |
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com>
# This program 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 F... |
#!/usr/bin/env python
from __future__ import print_function
import codecs
import nltk
from nltk.corpus import stopwords
import re
import string
import sys
_IS_PYTHON_3 = sys.version_info.major == 3
stop_words = stopwords.words('english')
# The low end of shared words to consider
LOWER_BOUND = .20
# The high end, ... |
from __future__ import absolute_import
import sys
from liaison.main import Liaison, get_node_status
from liaison.config import LiaisonConfig
if sys.version >= '3.3':
import unittest
import unittest.mock as mock
elif sys.version >= '3':
import unittest
import mock
else:
import unittest2 as unittest... |
from django.contrib import admin
from django.contrib.auth.models import Group
from django.contrib.auth.admin import GroupAdmin
from imagekit.admin import AdminThumbnail
from grappelli_modeltranslation.admin import (TranslationAdmin,
TranslationStackedInline)
from lakaxita... |
"""The inner workings of the command system."""
from inspect import signature
from functools import wraps
import re
from logging import getLogger
class CommandMeta(type):
"""Manage the backend of commands via a metaclass."""
def __new__(mcs, name, bases, attrs):
subcommands = {}
for value... |
# -*- coding: utf-8 -*-
"""zesty_metrics.views -- metrics reporting views
"""
import time
import json
from django.http import HttpResponse
from django.views.generic import View
from django.views.generic.edit import ProcessFormView, FormMixin
from django.forms import Form
from django.core.cache import cache
from django.... |
from abc import abstractmethod
import django
from django.conf.urls import patterns, url
from django.contrib.admin import ModelAdmin
from django.contrib.admin.helpers import InlineAdminFormSet
from django.contrib.contenttypes.generic import GenericInlineModelAdmin
from django.core.exceptions import ImproperlyConfigured
... |
# -*- coding: utf-8 -*-
from PyQt4 import QtCore, QtGui
from PyQt4.QtCore import Qt
import Orange.data
from Orange.classification import svm
from Orange.preprocess.preprocess import Preprocess
from Orange.widgets import widget, settings, gui
class OWSVMClassification(widget.OWWidget):
name = "SVM"
descript... |
import sys
import os
import numpy as np
'''
Easier searching for good RFI flagging values
'''
def if_empty_return_old(string, old_val):
if string == "":
return old_val
else:
return float(string)
try:
ms_name = sys.argv[1]
apply_flagging = True if sys.argv[2] == "True" else False
... |
"""
Django settings for sweettooth project.
Generated by 'django-admin startproject' using Django 1.8.15.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build ... |
# 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 nose.tools import *
from rsfmodel import rsf
import numpy as np
class TestDeiterichOneStateVar(object):
def setup(self):
self.model = rsf.Model()
self.model.mu0 = 0.6
self.model.a = 0.005
self.model.k = 1e-3
self.model.v = 1.
self.model.vref = 1.
state1... |
# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
# 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/LICEN... |
# -*- coding: utf-8 -*-
'''Chemical Engineering Design Library (ChEDL). Utilities for process modeling.
Copyright (C) 2017, 2018, 2019, 2020, 2021 Caleb Bell <Caleb.Andrew.Bell@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (t... |
# 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... |
"""
Code for deep Q-learning as described in:
Playing Atari with Deep Reinforcement Learning
NIPS Deep Learning Workshop 2013
and
Human-level control through deep reinforcement learning.
Nature, 518(7540):529-533, February 2015
Author of Lasagne port: Nissan Pow
Modifications: Nathan Sprague
"""
import lasagne
imp... |
"""Line-like geometrical entities.
Contains
========
LinearEntity
Line
Ray
Segment
"""
from __future__ import division, print_function
from sympy.core import Dummy, S, sympify
from sympy.core.exprtools import factor_terms
from sympy.core.relational import Eq
from sympy.functions.elementary.trigonometric import (_pi_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.