gt
stringclasses
1 value
context
stringlengths
2.49k
119k
from mock import Mock, PropertyMock import pytest import numpy import theano class TestGetAllLayers: def test_stack(self): from lasagne.layers import InputLayer, DenseLayer, get_all_layers from itertools import permutations # l1 --> l2 --> l3 l1 = InputLayer((10, 20)) l2 = ...
from __future__ import division, print_function, unicode_literals # This code is so you can run the samples without installing the package import sys import os sys.path.insert(0, os.path.join(os.path.dirname(__file__), '../..')) import cocos from cocos.director import director import pyglet from pyglet import font,...
# -*- coding: utf-8 -*- """ For usage instructions, see: https://kolibri-dev.readthedocs.io/en/develop/references/i18n.html This set of functions interacts with the crowdin API as documented here: https://support.crowdin.com/api/api-integration-setup/ """ import argparse import io import json import logging im...
# coding: utf-8 """ Jinja template fully executable """ import os import sys import argparse import time from pprint import pprint from twBase import * # NOQA # make it work on headless server import matplotlib as mpl mpl.use('Agg') # must be sourced after matpotplib, otherwise headleass not working import utils f...
# -*- coding: utf-8 -*- import os, sys sys.path.insert(1, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from spectrocrunch.math import noisepropagation from spectrocrunch.simulation import calcnoise from spectrocrunch.materials import multilayer from spectrocrunch.geometries import flatarea from spect...
from ftpdata.models import Candidate, Committee from summary_data.models import Candidate_Overlay, District, Committee_Overlay from fec_alerts.models import newCommittee, f1filer from summary_data.utils.term_reference import get_election_year_from_term_class, get_term_class_from_election_year from summary_data.utils.pa...
# -*- encoding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals from h2o.utils.compatibility import * # NOQA from h2o.utils.compatibility import viewitems from h2o.utils.typechecks import assert_is_type from .model_base import ModelBase class H2OBinomialModel(ModelBase): ...
""" Support for Xiaomi Philips Lights (LED Ball & Ceil). For more details about this platform, please refer to the documentation https://home-assistant.io/components/light.xiaomi_philipslight/ """ import asyncio from functools import partial import logging import voluptuous as vol import homeassistant.helpers.config...
##for Raleigh & Grant ##who contributed more than they know ################################################################################ ############################## WHEEL OF FORTUNE ################################ ################################################################################ import random im...
""" Copyright (c) 2016 Jani Pellikka <jpellikk@users.noreply.github.com> A simple test framework for executing functional tests. The framework allows for running commands (executables under test) from Python test scripts and verifying the commands' console output and return code. The test framework includes file-base...
#!/usr/bin/env python import os import shutil import glob import time import sys import subprocess import string from optparse import OptionParser, make_option SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) PKG_NAME = os.path.basename(SCRIPT_DIR) PARAMETERS = None #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=...
__all__ = [ 'BaseConstructor', 'SafeConstructor', 'FullConstructor', 'UnsafeConstructor', 'Constructor', 'ConstructorError' ] from error import * from nodes import * import datetime import binascii, re, sys, types class ConstructorError(MarkedYAMLError): pass class BaseConstructor(obje...
""" MicroPython driver for SD cards using SPI bus. Requires an SPI bus and a CS pin. Provides readblocks and writeblocks methods so the device can be mounted as a filesystem. Example usage on pyboard: import pyb, sdcard, os sd = sdcard.SDCard(pyb.SPI(1), pyb.Pin.board.X5) pyb.mount(sd, '/sd2') os.li...
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Better tokenizing for coverage.py.""" import ast import keyword import re import token import tokenize from coverage import env from coverage.misc import contr...
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
""" -*- coding: utf-8 -*- https://github.com/jhazelwo/python-fileasobj (c) John Hazelwood, 2011-2016 """ import os from platform import node import time import re import sys sys.dont_write_bytecode = True __version__ = '2.0.0' class FileAsObj(object): """ Manage a file as an object- -For when you...
binary_ops = [ ('Eq', '=', '__eq__'), ('Ne', '!=', '__ne__'), ('Lt', '<', '__lt__'), ('Gt', '>', '__gt__'), ('Le', '<=', '__le__'), ('Ge', '>=', '__ge__'), ('And', 'and', '__and__'), ('Or', 'or', '__or__'), ('Add', '+', '__add__'), ('Sub', '-', '__sub__'), ('Mul', '*', '__m...
""" Testing of admin inline formsets. """ from __future__ import unicode_literals import random from django.db import models from django.contrib.contenttypes.fields import GenericForeignKey from django.contrib.contenttypes.models import ContentType from django.utils.encoding import python_2_unicode_compatible @pyth...
#!/usr/bin/env python ## WARNING: This file is generated #!/usr/bin/env python """Create a "virtual" Python installation """ virtualenv_version = "1.4.8" import sys import os import optparse import re import shutil import logging import distutils.sysconfig try: import subprocess except ImportError, e: if sys....
#!/usr/bin/env python # Author: # Li, Jiajia <jiajiax.li@intel.com> import sys import os import os.path import shutil import time import commands import traceback import glob import threading import time import logging import subprocess from optparse import OptionParser SCRIPT_PATH = os.path.realpath(__file_...
#!/usr/bin/env python """ S3 Stat ======= This python module uses the really nice `goaccess <http://goaccess.io/>`_ utility to provide you with an amazing Amazon log file analyser tool that is relatively easy to install, and is extremely easy to extend. GOACCESS version needed: 0.8.5 Installation ------------- :: ...
#!/usr/bin/env python3 # # title: Parse clusters and find the corresponding species # in the cluster # author: Peter Thorpe, Leighton Pritchard September 2016. # The James Hutton Insitute, Dundee, UK. # imports import os import argparse from Bio import SeqIO import matplotlib # this code added to prevent this error: # ...
#!/usr/bin/env python3 # 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...
''' update: 2014/09/03: softmax in the last layer customize: no softmax ''' import theano import theano.tensor as T import gzip import cPickle import numpy import time class HiddenLayer(object): def __init__(self, rng, input, n_in, n_out, W=None, b=None, activa...
# pylint: skip-file # flake8: noqa # pylint: disable=too-many-instance-attributes class OCLabel(OpenShiftCLI): ''' Class to wrap the oc command line tools ''' # pylint allows 5 # pylint: disable=too-many-arguments def __init__(self, name, namespace, ...
import os from ..spectra import SpectraData from .core import (CsvTable, DataObject, EcsvTable, FastCsvTable, FileObject, FitsTable, GoogleSheets, NumpyBinary) from .external_masterlist import EddQuery, HyperledaQuery __all__ = ["known_google_sheets", "Database", "SpectraData"] known_google_sheets...
from tcga_encoder.utils.helpers import * from tcga_encoder.data.data import * from tcga_encoder.definitions.tcga import * #from tcga_encoder.definitions.nn import * from tcga_encoder.definitions.locations import * from tcga_encoder.analyses.survival_functions import * from tcga_encoder.analyses.everything_functions imp...
# Copyright 2013 dotCloud 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 t...
"""Classes relating to BlockingStrategies, which define ways to carve up Images into Blocks. """ import bisect import itertools from numpy import expand_dims, zeros from numpy import dtype as dtypeFunc from thunder.rdds.imgblocks.blocks import BlockGroupingKey, Blocks, PaddedBlockGroupingKey, PaddedBlocks, \ Simpl...
# Copyright (C) 2001-2010 Python Software Foundation # Author: Barry Warsaw # Contact: email-sig@python.org """Classes to generate plain text from a message object tree.""" __all__ = ['Generator', 'DecodedGenerator', 'BytesGenerator'] import re import sys import time import random from copy import deepcopy from io ...
# Copyright 2019 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...
#!/usr/bin/env python # # Replication repair # Copyright (C) 2015 Larroque Stephen # # Licensed under the MIT License (MIT) # # 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 restricti...
# -*- coding: utf-8 -*- """ tests/test_shipping.py """ import unittest from datetime import date from decimal import Decimal import trytond.tests.test_tryton from trytond.tests.test_tryton import POOL, USER, with_transaction from trytond.transaction import Transaction from trytond.exceptions import UserError cl...
import unittest from datetime import datetime from unittest import mock from eveapimongo import ApiWrapper, MongoProvider from functions.transactionParser.transactionParser import TransactionParser class TestTransactionParser(unittest.TestCase): def setUp(self): self.sut = TransactionParser() def te...
# -*- coding: utf-8 -*- # <nbformat>3.0</nbformat> # <headingcell level=1> # Continual V3 Progress Report # <markdowncell> # This notebook is intended to keep track of continual results of the various V3 tropism analyses that we plan to publish. This includes (but is not limited too): differences in clinical parame...
import sys import traceback import datetime import unittest from tcmessages import TeamcityServiceMessages from tcunittest import strclass from tcunittest import TeamcityTestResult _ERROR_TEST_NAME = "ERROR" try: from nose.failure import Failure from nose.util import isclass # backwards compat from nose.config...
from collections import OrderedDict from brewery.utils import get_logger class Graph(object): """Data processing stream""" def __init__(self, nodes=None, connections=None): """Creates a node graph with connections. :Parameters: * `nodes` - dictionary with keys as node names and val...
# -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the #...
""" Tests Grip's public API, i.e. everything you can access from `import grip`. This doesn't send any requests to GitHub (see test_github.py for that), and this doesn't run a server (see test_cli.py for that). Instead, this creates fake objects with subclasses and tests the basic expected behavior of Grip. """ from _...
'''Read and write DNA sequences.''' import csv import os from Bio import SeqIO from Bio.Alphabet.IUPAC import ambiguous_dna from Bio.Seq import Seq from Bio.SeqRecord import SeqRecord from Bio.SeqFeature import SeqFeature, FeatureLocation, ExactPosition from Bio.SeqFeature import CompoundLocation import coral import co...
from ctypes import byref, c_char_p, c_double, c_int import sys from ._bindings import FLUID_INT_TYPE, FLUID_NUM_TYPE, FLUID_STR_TYPE, handle def coerce_to_int(s): """ Turn a string into an integer. """ try: return int(s) except ValueError: return int(s.lower() not in ("false", "no...
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
#!/usr/bin/env python3 # Copyright (c) 2015-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. from .mininode import * from .blockstore import BlockStore, TxStore from .util import p2p_port ''' This ...
# Copyright 2016 United States Government as represented by the Administrator # of the National Aeronautics and Space Administration. All Rights Reserved. # # Portion of this code is Copyright Geoscience Australia, Licensed under the # Apache License, Version 2.0 (the "License"); you may not use this file # except in c...
# Copyright 2011 Isaku Yamahata <yamahata@valinux co jp> # 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...
# 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...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ This code testing the segmenting images using GrabCut method. This code testing the segmenting images using GrabCut method. Author: Neil Han ! This sample code is a copy from https://github.com/Itseez/opencv/blob/master/samples/python2/grabcut.py @ 2013-11-29 The orig...
import uuid from django.contrib.contenttypes.fields import ( GenericForeignKey, GenericRelation, ) from django.contrib.contenttypes.models import ContentType from django.db import models from django.db.models.query import ModelIterable, QuerySet from django.utils.functional import cached_property class Author(mo...
# orm/descriptor_props.py # Copyright (C) 2005-2012 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Descriptor properties are more "auxiliary" properties that exist as configu...
#!python # This file was obtained from: # http://peak.telecommunity.com/dist/ez_setup.py # on 2011/1/21. """Bootstrap setuptools installation If you want to use setuptools in your package's setup.py, just include this file in the same directory with it, and add this to the top of your setup.py:: from ez_setup...
################################################################################ # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this...
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
# FILE: autoload/conque_term/conque_sole.py # AUTHOR: Nico Raffo <nicoraffo@gmail.com> # WEBSITE: http://conque.googlecode.com # MODIFIED: 2011-09-02 # VERSION: 2.3, for Vim 7.0 # LICENSE: # Conque - Vim terminal/console emulator # Copyright (C) 2009-2011 Nico Raffo # # MIT License # # Permission is hereby gran...
from __future__ import print_function from math import log from scipy.stats import norm as normal import numpy as np import regreg.api as rr class nonnegative_softmax_scaled(rr.smooth_atom): """ The nonnegative softmax objective .. math:: \mu \mapsto \sum_{i=1}^{m} \log \left(1 + ...
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
#!/usr/bin/env python # encoding: utf-8 """ decode.py Created by Thomas Mangin on 2009-09-06. Copyright (c) 2009-2015 Exa Networks. All rights reserved. """ # pylint: ignore=E131 # pylama:ignore=E131 # INET include is required as it perform some AFI/SAFI registration from exabgp.bgp.message.update.nlri import INET ...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
"""Themes for different message styles.""" from . import util from .batch import * POPUP_CSS = 'body { margin: 0.25em; }' def _help_link(code): if code: return ' <a href="https://doc.rust-lang.org/error-index.html#%s" class="rust-help-link">?</a>' % ( code,) else: return '' cl...
# -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the #...
#!/usr/bin/env python # # Copyright 2012 the V8 project authors. 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 # not...
""" Test cases for codeop.py Nick Mathewson """ import unittest from test.test_support import run_unittest, is_jython from codeop import compile_command, PyCF_DONT_IMPLY_DEDENT if is_jython: import sys import cStringIO def unify_callables(d): for n,v in d.items(): if callable(v)...
from typing import Dict, Optional, Tuple, Any from django.utils.translation import ugettext as _ from django.conf import settings from django.core.files import File from django.http import HttpRequest from jinja2 import Markup as mark_safe import unicodedata from zerver.lib.avatar_hash import user_avatar_path from ze...
from __future__ import unicode_literals, division, absolute_import from builtins import * # noqa pylint: disable=unused-import, redefined-builtin from datetime import datetime import logging from flexget import plugin, db_schema from flexget.config_schema import one_or_more from flexget.entry import Entry from flexg...
""" This module contains some graph utils that are used in the chemenv package. """ import itertools import operator import networkx as nx import numpy as np from monty.json import MSONable __author__ = "waroquiers" def get_delta(node1, node2, edge_data): """ Get the delta. :param node1: :param nod...
import numpy as np import networkx as nx from indra.explanation.pathfinding.pathfinding import bfs_search, \ shortest_simple_paths, bfs_search_multiple_nodes, open_dijkstra_search, \ simple_paths_with_constraints from indra.explanation.pathfinding.util import get_subgraph from indra.explanation.model_checker.m...
# # Copyright (c) 2015 nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/scancode-toolkit/ # The ScanCode software is licensed under the Apache License version 2.0. # Data generated with ScanCode require an acknowledgment. # ScanCode is a trademark of nexB Inc. # # You may not use...
#!/usr/bin/env python # Capstone Python bindings, by Nguyen Anh Quynnh <aquynh@gmail.com> from __future__ import print_function from capstone import * from capstone.x86 import * from xprint import to_hex, to_x, to_x_32 X86_CODE64 = b"\x55\x48\x8b\x05\xb8\x13\x00\x00\xe9\xea\xbe\xad\xde\xff\x25\x23\x01\x00\x00\xe8\xd...
import os.path as op import numpy as np from nose.tools import assert_true, assert_equal, assert_raises from numpy.testing import assert_allclose import warnings from mne import (read_dipole, read_forward_solution, convert_forward_solution, read_evokeds, read_cov, SourceEstimate, writ...
"""Cohort based copy number calling in gene regions using Seq2C. Seq2C calls across multiple samples without explicit background samples, using gene regions as segments. This requires coverage calculation in each sample and gene, followed by global calling across all samples. """ import os import shutil import subpro...
"""Tests for the cases controllers""" import requests import responses from flask import Blueprint, Flask, url_for from scout.server.blueprints.cases.controllers import ( case, case_report_content, coverage_report_contents, mt_coverage_stats, phenotypes_genes, ) from scout.server.extensions import ...
"""Assortment of handy functions.""" import inspect import numpy as np from six.moves import map, range, zip from functools import partial from itertools import tee from inspect import isgenerator class Bunch(dict): """ Container object for datasets. Dictionary-like object that exposes its keys as attr...
''' Make plots of supervised learning results. * 3D plot of the GridSearch results (2 plots) * BPT diagram with coloured labels for actual and predicted. (3 plots) * PCA projection of param space with labels (2 plots) ''' import numpy as np from astropy.io import fits from pandas import read_csv import matplotlib.py...
# Copyright 2016 ARM Limited # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 Isaku Yamahata # 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/...
#!/usr/bin/env python3 # Copyright (c) 2014-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Base class for RPC testing.""" import logging import optparse import os import sys import shutil impor...
import unittest from datetime import date import pandas as pd import numpy as np from dateutil import relativedelta from excel_helper import ExcelParameterLoader, ParameterRepository, growth_coefficients class ExcelParameterLoaderTestCase(unittest.TestCase): def test_parameter_getvalue_random(self): re...
import inspect import io import itertools import os import sys import typing as t from gettext import gettext as _ from ._compat import isatty from ._compat import strip_ansi from ._compat import WIN from .exceptions import Abort from .exceptions import UsageError from .globals import resolve_color_default from .types...
from collections import Mapping, KeysView, ItemsView, MutableSet from networkx import NetworkXError import convert from copy import deepcopy # Notes to help me remember what the ABC classes provide: # classname | abstract methods -> concrete methods # which means: # classname | required methods -> provided methods #...
__author__ = 'adam' import sys import os import errno import json import datetime import contextlib class NoStepsException(Exception): def __init__(self, value): self.value = value def __str__(self): repr(self.value) class TestBenchExecutor: _path_manifest = '' _dict_manifest = dic...
#!/usr/bin/env python import difflib import Levenshtein import pandas as pd import numpy as np import lexicons.lexiconUtils as sentimentUtils from collections import defaultdict from corenlp_utils import * liwc = sentimentUtils.LiwcDict() def is_negated(w, sen): """ sen is an annotated sentence object, word is...
#!/usr/bin/env python3 # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "Li...
# pylint: disable=W0611 ''' Window ====== Core class for creating the default Kivy window. Kivy supports only one window per application: please don't try to create more than one. ''' __all__ = ('Keyboard', 'WindowBase', 'Window') from os.path import join, exists from os import getcwd from kivy.core import core_sel...
#!/usr/bin/env python3 """ gftools lang Adds sample text for a given language using the specified UDHR translation. Usage: # Standard usage. Output lang metadata to a dir. Does not overwrite existing data. gftools lang-sample-text -l ./languages/en.textproto ./udhr_translations/en.xml """ from absl import app from...
# ---------------------------------------------------------------------- # # Misc constants # UA_MAXOP = 6 # ---------------------------------------------------------------------- # instruc_t related constants # # instruc_t.feature # CF_STOP = 0x00001 # Instruction doesn't pass execution to the next instruction CF...
""" sphinxcontrib.httpdomain ~~~~~~~~~~~~~~~~~~~~~~~~ The HTTP domain for documenting RESTful HTTP APIs. :copyright: Copyright 2011 by Hong Minhee :license: BSD, see LICENSE for details. """ import re from docutils import nodes from docutils.parsers.rst.roles import set_classes from pygments.l...
import os import time import fcntl import subprocess from pyroute2 import IPDB from pyroute2 import IPRoute from pyroute2 import NetNS from pyroute2 import NSPopen from pyroute2.common import uifname from pyroute2.netns.process.proxy import NSPopen as NSPopenDirect from pyroute2 import netns as netnsmod from uuid impor...
#!/usr/bin/env python # Copyright (c) 2014-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 director...
#!/usr/bin/env python # PyRadio: Curses based Internet Radio Player # http://www.coderholic.com/pyradio # Ben Dowling - 2009 - 2010 # Kirill Klenov - 2012 import curses import logging import os import random from .log import Log from . import player import locale locale.setlocale(locale.LC_ALL, "") logger = loggin...
import json import re from urllib.request import urlopen from urllib.error import HTTPError import psycopg2 from bs4 import BeautifulSoup from psycopg2 import IntegrityError from psycopg2.extras import Json class Scraper: def __init__(self, db, user, password, api_key, min_congress, max_congress, ...
""" Test the second level model. """ from __future__ import with_statement import os import numpy as np import pandas as pd import warnings import pytest from nibabel import (load, Nifti1Image, ) from nibabel.tmpdirs import InTemporaryDirectory from nilearn.image import con...
""" Created on Tue Jul 18 14:14:45 2017 @author: USER """ import logging from flask import request, jsonify from app import multiauth, errHandler, models, mysqlhandler from . import lottery from .. import mysql root_logger = logging.getLogger('root') runMySQL = mysqlhandler.MySQLHandler(mysql) get_lottery = mysqlh...
from __future__ import unicode_literals import json import re import time import warnings import hashlib from django import forms from django.conf import settings from django.contrib import messages from django.contrib.auth import login as django_login, get_backends from django.contrib.auth import logout as django_lo...
# Copyright (c) 2013 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. import os from gpu_test_expectations import GpuTestExpectations # See the GpuTestExpectations class for documentation. class WebGLConformanceExpectatio...
#!/usr/bin/env python import rospy import numpy as np # http://docs.scipy.org/doc/numpy/reference/routines.html from copy import copy import tf import os from flexbe_core import EventState, Logger from rosbag import Bag """ Created on 01/05/2015 @author: Moritz Schappler Sources: [1] Kroenig: Kraft-/Drehmomentsen...
import sys def read_board(board_filename): bd = [] for line in open(board_filename): bd.append(line.strip()) return bd def print_board(board): for i in range(0,len(board)): for j in range(0,len(board[i])): sys.stdout.write(board[i][j]) sys.stdout.write(' ') print # This function should take in a li...
# Copyright 2011 OpenStack Foundation # 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 requ...
import collections import math import numpy import pyaudio import struct import threading import time import traceback import doitlive from nanokontrol import Map as NKMap from grassroots import grassroots as gr import projection import lights import devices import ui_input from projection import * from lights impor...
#!/usr/bin/env python from cStringIO import StringIO import os import socket import subprocess import tempfile import sys import time import unittest from flashproxy import fac from flashproxy.reg import Transport, Endpoint from flashproxy.util import format_addr # Import the facilitator program as a module. import ...
#! /usr/bin/python import os import re import sys from collections import defaultdict CIGAR_OPERATIONS_ALL = ['M', 'I', 'D', 'N', 'S', 'H', 'P', '=', 'X']; CIGAR_OPERATIONS_BASIC = ['M', 'I', 'D', 'S', 'H']; CIGAR_OPERATIONS_EXTENDED = ['M', 'I', 'D', 'S', 'H', '=', 'X']; # Global table containing mutation counts mu...
import wx import os import sys import images try: dirName = os.path.dirname(os.path.abspath(__file__)) except: dirName = os.path.dirname(os.path.abspath(sys.argv[0])) sys.path.append(os.path.split(dirName)[0]) try: from agw import ribbon as RB except ImportError: # if it's not there locally, try the wx...