text stringlengths 17 737k |
|---|
# -*- coding: utf-8 -*-
from tests import msg
from uamobile import *
from uamobile.softbank import SoftBankUserAgent
from uamobile.factory.softbank import SoftBankUserAgentFactory
def test_detect_fast():
assert detect_fast('SoftBank/1.0/816SH/SHJ001 Browser/NetFront/3.4 Profile/MIDP-2.0 Configuration/CLDC-1.1') ==... |
import os
from unittest import TestCase
from subprocess import check_call
from shlex import split
from nose.tools import nottest
class TestStrandex(TestCase):
@classmethod
def setUpClass(self):
""" Downloading test data """
check_call('curl -s http://ftp.sra.ebi.ac.uk/vol1/fastq/ERR239/ERR23965... |
import sys
sys.path.append('../src')
import unittest
from sql_module.sql import *
class SQLTest(unittest.TestCase):
def setUp(self):
self.sql = SQL()
self.database = MySQLDatabase('mysql', **{'user': 'root', 'password': '7uy33HZ5', 'host': 'localhost'})
self.database.execute_sql("CREATE... |
import unittest
import pytest
import logging, os
from lxml.etree import DTD, RelaxNG, parse, DocumentInvalid
import sldr.UnicodeSets as usets
from unicodedata import normalize
@pytest.fixture(scope="session")
def validator(request):
# return RelaxNG(file=os.path.join(os.path.dirname(__file__), '..', 'doc', 'sil.rn... |
from fabric.api import *
env.path = '/var/praekelt/ummeli'
def qa():
env.hosts = ['ubuntu@cloud.praekeltfoundation.org']
def production():
env.hosts = ['ubuntu@app1.praekeltfoundation.org']
def push():
with cd(env.path):
run('git pull')
def static():
with cd(env.path):
run('ve/bin/p... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
Validation of the CSDF class usign unittests
author: Rinse Wester
"""
import unittest
from csdfgraph import CSDFGraph
class CSDFGraphTestCase(unittest.TestCase):
def setUp(self):
# create a chain graph with 4 nodes
self.cycle_cons_sdf_graph = CSD... |
# -*- coding: utf-8 -*-
"""Test textlib module."""
#
# (C) Pywikibot team, 2011-2020
#
# Distributed under the terms of the MIT license.
#
import codecs
import functools
import os
import re
from collections import OrderedDict
from contextlib import suppress
import pywikibot
import pywikibot.textlib as textlib
from p... |
import json
import requests
from girder.api.rest import RestException
from girder.api import access
from girder.constants import AccessType
from .. import avogadro
from .. import openbabel
from .. import chemspider
from .. import semantic
from .. import constants
from girder.plugins.molecules.models.molecule import Mo... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2005-2013 Edgewall Software
# Copyright (C) 2005-2006 Emmanuel Blot <emmanuel.blot@free.fr>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at ht... |
# -*- coding: utf-8 -*-
"""
sartoris.testsuite
~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2013 by Wikimedia Foundation.
:license: BSD, see LICENSE for more details.
"""
import unittest
from collections import namedtuple
from sartoris.sartoris import Sartoris, SartorisError, exit_codes
from sartoris impo... |
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2010-2011, GEM Foundation.
#
# OpenQuake is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License version 3
# only, as published by the Free Software Foundation.
#
# OpenQuak... |
from fabric.api import env, run, local, task, prefix, cd, sudo, settings
from fabric.context_managers import shell_env, prefix
from fabric.contrib.files import exists
from fabric.colors import red, green, blue
from bongo.settings.common import DJANGO_ROOT
from os.path import join, normpath
import fabtools
import reques... |
# Standard Library
import os
# Third Party
from fabric.api import (
cd,
env,
lcd,
local,
prompt,
run,
settings,
task,
warn_only,
)
env.run = local
env.cd = lcd
env.base_path = os.path.dirname(env.real_fabfile)
DOCKER_COMPOSE_RUN_OPT = "docker-compose run {opt} --rm {service} {cmd}... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Transistor-level Z80 CPU simulator.
#
# Originated from the Visual 6502 and Z80 Explorer projects.
#
# https://github.com/trebonian/visual6502
# commit badcf8e40be74398ec55593e172acb287ca73e3b of 31 Mar 2020
#
# https://github.com/gdevic/Z80Explorer
# commit c11574c1d80... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Transistor-level Z80 CPU simulator.
#
# Originated from the Visual 6502 and Z80 Explorer projects.
#
# https://github.com/trebonian/visual6502
# commit badcf8e40be74398ec55593e172acb287ca73e3b of 31 Mar 2020
#
# https://github.com/gdevic/Z80Explorer
# commit c11574c1d80... |
# -*- coding: utf-8 -*-
# django_th classes
from django_th.services.services import ServicesMgr
from django_th.models import UserService, ServicesActivated
# django classes
from django.conf import settings
from django.core.urlresolvers import reverse
from django.utils.log import getLogger
# pocket API
import pocket
f... |
# -*- coding: utf-8 -*-
# Copyright 2014 Jan-Philip Gehrcke. See LICENSE file for details.
import time
import logging
from itertools import chain
from collections import defaultdict
from collections import OrderedDict
log = logging.getLogger("timefilter")
class TimeFilterError(Exception):
pass
class TimeFilt... |
# Copyright (c) 2017 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
from UM.Workspace.WorkspaceReader import WorkspaceReader
from UM.Application import Application
from UM.Logger import Logger
from UM.i18n import i18nCatalog
from UM.Settings.ContainerStack import ContainerStack
from UM.Set... |
#!/usr/bin/env python
from __future__ import with_statement
import os, sys, re
# This script parses the output of `make TIMED=1` into a dictionary
# mapping names of compiled files to the number of minutes and seconds
# that they took to compile.
STRIP_REG = re.compile('^(coq/|contrib/|)(?:theories/|src/)?')
STRIP_RE... |
#!/usr/bin/env python
"""
This is a script to run the Full TSQR algorithm with direct computation
of the matrix Q.
usage:
python run_full_tsqr.py matrix_name [map_schedule] [output_name]
matrix_name is the name of the input file that is stored in the HDFS.
map_schedule is a string representation of a comma-sep... |
"""Texture code relying on Scikit-image library."""
from __future__ import absolute_import, division, print_function
from collections import OrderedDict
from itertools import product
import logging
import numpy as np
import scipy as sp
import skimage.feature
import skimage.filters
import skimage.measure
import dwi.t... |
import pydevtest_sessions as s
from nose.tools import with_setup
from nose.plugins.skip import SkipTest
from pydevtest_common import assertiCmd, assertiCmdFail
import commands
@with_setup(s.adminonly_up,s.adminonly_down)
def test_local_imv():
# local setup
movedfile = "moved_file.txt"
# assertions
asse... |
import requests, json
import pandas as pd
import time
import os
# import definition of datasets
from datasets import *
directory = os.getcwd()
# TODO you have to input URL of the EasyMinerCenter API endpoint and your API KEY (generated in EasyMinerCenter UI)
# you can modify the following lines, or create configurat... |
import cmor
import logging
import netCDF4
import numpy
import os
import cmor_target
import cmor_task
import cmor_utils
# Logger object
log = logging.getLogger(__name__)
extra_axes = {"basin": {"ncdim": "3basin",
"ncvals": ["global_ocean", "atlantic_arctic_ocean", "indian_pacific_ocean"]},
... |
"""Leetcode 701. Insert into a Binary Search Tree
Medium
URL: https://leetcode.com/problems/insert-into-a-binary-search-tree/
Given the root node of a binary search tree (BST) and a value to be inserted
into the tree, insert the value into the BST. Return the root node of the BST
after the insertion. It is guarante... |
# Copyright 2017 Google 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, ... |
# -*- coding: utf-8 -*-
# Copyright 2016 Onestein (<http://www.onestein.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import api, fields, models
class hr_holidays_status(models.Model):
_inherit = "hr.holidays.status"
@api.model
def get_hours(self, employee_id):
... |
import asyncio
import pytest
from functools import wraps
from hypothesis import given
from hypothesis.strategies import dictionaries
from ncplib import connect, start_server
from tests.conftest import names, params
# Helpers.
def wait_for(event_loop, coroutine):
return event_loop.run_until_complete(asyncio.wait_... |
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2015, Numenta, Inc. Unless you have purchased from
# Numenta, Inc. a separate commercial license for this software code, the
# following terms and conditions apply:
#
# This pro... |
# coding: utf-8
from pupa.scrape import Scraper
from utils import lxmlize, CanadianLegislator as Legislator
import re
from urlparse import urljoin
COUNCIL_PAGE = 'http://www.calgary.ca/General/Pages/Calgary-City-Council.aspx'
MAYOR_PAGE = 'http://calgarymayor.ca/forms_all.php'
class CalgaryPersonScraper(Scraper):
... |
# Copyright 2013 Google, Inc. All Rights Reserved.
#
# Google Author(s): Behdad Esfahbod
"""Python OpenType Layout Subsetter.
Later grown into full OpenType subsetter, supporting all standard tables.
"""
from __future__ import print_function, division
from fontTools.misc.py23 import *
from fontTools import ttLib
fro... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# Interpreter version: python 2.7
#
# Imports =====================================================================
import shutil
import os.path
import pytest
import xmltodict
import ltp.ltp as ltp
import ltp.info_composer as icp
# Variables =========================... |
from __future__ import division
from functools import wraps
import numpy as np
from matplotlib.patches import Circle, Rectangle
from matplotlib.lines import Line2D
from matplotlib.colors import LinearSegmentedColormap
from matplotlib.widgets import Widget, AxesWidget
import matplotlib.pyplot as plt
from yoink.trace ... |
from django import forms
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from seed_services_client.auth import AuthApiClient
from demands import HTTPServiceError
from bootstrap_datepicker.widgets import DatePicker
from django.contrib.postgres.forms import SimpleArrayField
clas... |
# Copyright 2014 ARM Limited
#
# Licensed under the Apache License, Version 2.0
# See LICENSE file for details.
# standard library modules, , ,
import os
import subprocess
import tempfile
import logging
import hgapi
# fsutils, , misc filesystem utils, internal
import fsutils
git_logger = logging.getLogger('git')
hg_... |
import time
from datetime import timedelta
from django.utils import timezone
from six.moves.urllib.parse import urlparse, parse_qs
from six import string_types
import attr
def transform_timeseries_data(timeseries, start, end=None):
"""Transforms a Go Metrics API metric result into a list of
values for a giv... |
# Copyright 2007-2016 Brian Masney <masneyb@onstation.org>
#
# 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 django.shortcuts import render, redirect, get_object_or_404
from django.views.decorators.csrf import csrf_exempt
from django.http import HttpResponse, HttpResponseNotAllowed, HttpResponseForbidden
from django.core.urlresolvers import reverse
from django.core.exceptions import PermissionDenied
from django.conf impo... |
# coding: utf-8
"""Backend management system classes
Used to communicate with providers without using CFME facilities
"""
from __future__ import absolute_import
import json
import requests
from requests.exceptions import Timeout
from .base import WrapanapiAPIBase
class LenovoSystem(WrapanapiAPIBase):
"""Client ... |
from functools import wraps
import logging
import json
from datetime import timedelta
from demands import HTTPServiceError
from django.shortcuts import render, redirect, resolve_url
from django.utils.decorators import available_attrs
from django.utils.six.moves.urllib.parse import urlparse
from django.contrib.auth imp... |
from django.core import mail
from django.test import TestCase, override_settings
from mock import patch, MagicMock
from herald.base import NotificationBase, EmailNotification, TwilioTextNotification
from herald.models import SentNotification
from .notifications import MyNotification
class BaseNotificationTests(TestC... |
from functools import wraps
import logging
import json
from datetime import timedelta
from demands import HTTPServiceError
from django.shortcuts import render, redirect, resolve_url
from django.utils.decorators import available_attrs
from django.utils.six.moves.urllib.parse import urlparse
from django.contrib.auth imp... |
from __future__ import absolute_import
import re
import time
import requests
import json
import auth
import sys
import traceback
import os.path
try:
from graphite_api.intervals import Interval, IntervalSet
from graphite_api.node import LeafNode, BranchNode
except ImportError:
from graphite.intervals impor... |
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible 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... |
import foauth.providers
class Wordpress(foauth.providers.OAuth2):
# General info about the provider
name = 'WordPress.com'
provider_url = 'https://www.wordpress.com/'
docs_url = 'http://developer.wordpress.com/docs/api/'
# URLs to interact with the API
authorize_url = 'https://public-api.word... |
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from builtins import * # NOQA
from future import standard_library
standard_library.install_aliases()
import os
import tempfile
import unittest
from chainerrl import repl... |
"""Handle copying data between sites.
This is one of the key tasks of 'cax' because it's responsible for moving
data between sites. At present, it just does scp.
"""
import datetime
import logging
import os
import time
import shutil
import scp
from paramiko import SSHClient, util
import pax
from cax import config
... |
from zohmg.config import Config, Environ
import os, re
class Process(object):
def go(self, mapper, input, for_dumbo):
table = Config().project_name()
resolver = 'fm.last.darling.HBaseIdentifierResolver'
outputformat = 'org.apache.hadoop.hbase.mapred.TableOutputFormat'
opts = [('jo... |
# -*- coding: utf-8 -*-
import logging
import zmq
import zhelpers
from collections import deque
import subprocess
import config
import zsync_network
import zsync_utils
from zsync_thread import FileTransciver
class ZsyncDaemon(zsync_network.Transceiver):
def __init__(self, port):
super(ZsyncDaemon, self).... |
#!/usr/bin/env python
#
# Copyright (c), 2018-2020, SISSA (International School for Advanced Studies).
# All rights reserved.
# This file is distributed under the terms of the MIT License.
# See the file 'LICENSE' in the root directory of the present
# distribution, or http://opensource.org/licenses/MIT.
#
# @author Da... |
#!/usr/bin/env python
"""Command-line Plans."""
import cookielib
import os
import sys
import tempfile
import subprocess
from clans.client import PlansConnection
import re
# ----------
# UI HELPERS
# ----------
def external_editor(text, **kwargs):
"""
Open some text for editing by the user.
Keyword argum... |
"""
Infrastructure code for testing Gabble by pretending to be a Jabber server.
"""
import base64
import os
import hashlib
import sys
import random
import re
import traceback
import ns
import constants as cs
import servicetest
from servicetest import (
assertEquals, assertLength, assertContains, wrap_channel,
... |
# NOT_RPYTHON
"""
A pure Python reimplementation of the _sre module from CPython 2.4
Copyright 2005 Nik Haldimann, licensed under the MIT license
This code is based on material licensed under CNRI's Python 1.6 license and
copyrighted by: Copyright (c) 1997-2001 by Secret Labs AB
"""
MAXREPEAT = 2147483648
MAXGROUPS =... |
'''
Created by:
Juan Sarria
March 15, 2016
'''
import pandas as pd, numpy as np, timeit
from geopy.distance import vincenty
project_root = '../'
def main():
#test values
lat = 49.28334
lon = -123.113
'''
prop_df = pd.read_csv(project_root + 'data/property_tax_06_15/latlong_property_tax_' + str(20... |
# cerbero - a multi-platform build system for Open Source software
# Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; eit... |
# cerbero - a multi-platform build system for Open Source software
# Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; eit... |
#!/usr/bin/env python
import random
import struct
import sys
import matplotlib.pyplot as plt
class Plot(object):
def __init__(self):
self.segments = []
self.cells = set()
def plot(self):
# Create axes
ax = plt.axes()
# Create polygon object for each particle track ... |
# cerbero - a multi-platform build system for Open Source software
# Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; eit... |
#!/usr/bin/python
"""
Ssh-key key handlers and associated routines
"""
import contextlib
import logging
import paramiko
import re
from datetime import datetime
from cStringIO import StringIO
from teuthology import contextutil
import teuthology.misc as misc
from ..orchestra import run
log = logging.getLogger(__name__)... |
from six import string_types
from numbers import Integral, Real
import h5py
import numpy as np
from scipy.special import wofz
from six import string_types
from . import WMP_VERSION
from .data import K_BOLTZMANN
import openmc.checkvalue as cv
from openmc.mixin import EqualityMixin
# Formalisms
FORM_MLBW = 2
FORM_RM... |
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2010-2011, GEM Foundation.
#
# OpenQuake is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License version 3
# only, as published by the Free Software Foundation.
#
# OpenQuak... |
# -*- coding: utf-8 -*-
##
## $Id$
##
## This file is part of CDS Invenio.
## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2013 CERN.
##
## CDS Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundati... |
"""
Copyright (c) 2008-2011, Anthony Garcia <lagg@lavabit.com>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTH... |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016-2017 Ircam
# Copyright (c) 2016-2017 Guillaume Pellerin
# Copyright (c) 2016-2017 Emilie Zawadzki
# This file is part of mezzanine-organization.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public L... |
'''
Created on Jan 3, 2014
@author: Tea Kolevska
@contact: tea.kolevska@zhaw.ch
@organization: ICCLab, Zurich University of Applied Sciences
'''
import ceilometer_api
import compute_api
import keystone_api
import textwrap
import sys
def main(argv):
print "Hello There. This is a simple test application making a... |
# encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from __future__ import absolute_import, unicode_literals
from textwrap import dedent
from pathvalidate import (
InvalidCharError,
InvalidReservedNameError,
NullNameError,
ValidReservedNameError,
)
from sqlitesc... |
from __future__ import division, print_function
from contextlib import contextmanager
import numpy as np
from OpenGL import GL as gl
from OpenGL import GLU as glu
from OpenGL import GLUT as glut
import pygame as pg
import rospy
from geometry_msgs.msg import PoseStamped
from sensor_msgs.msg import Image
from helpers... |
# Copyright (C) 2010 John Reese
# Licensed under the MIT license
class Transform:
"""
This class represents a single modification to the data set, designed
to be applied in descending order by line number. The operation determines
where the new data will be applied, and how.
"""
lineum = -1
oper = "noop"
dat... |
import gc, os, string, fpformat
import enthought.traits as traits
from neuroimaging.statistics import iterators, utils
from neuroimaging.image import utils as imutils
from neuroimaging.statistics.regression import OLSModel, ARModel
import neuroimaging.fmri as fmri
import neuroimaging.image.kernel_smooth as kernel_smoo... |
# coding: utf-8
import json
from mock import patch, Mock
from django.contrib.flatpages.models import FlatPage
from django.http import HttpResponse
from django.test import TestCase
from tinymce.views import render_to_image_list
class TestViews(TestCase):
@patch('tinymce.views.enchant')
def test_spell_check... |
import dbt.logger as logger # type: ignore # TODO eventually remove dependency on this logger
from dbt.events.history import EVENT_HISTORY
from dbt.events.types import CliEventABC, Event, ShowException
import dbt.flags as flags
import os
from typing import Generator, List
def env_secrets() -> List[str]:
return ... |
"""
Multiclass and multilabel classification strategies
===================================================
This module implements multiclass learning algorithms:
- one-vs-the-rest / one-vs-all
- one-vs-one
- error correcting output codes
The estimators provided in this module are meta-estimators: they re... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from xml.dom import minidom
import os, sys, stat, traceback
import json, xorg_query
import pprint
import threading
import event
from lib.resolution import Resolution
try:
# python 3.0
import html.entities as entities
except ImportError:
import htmlentitydefs ... |
"""
.. index:: misc
Module Orange.misc contains common functions and classes which are used in other modules.
.. index: SymMatrix
-----------------------
SymMatrix
-----------------------
:obj:`SymMatrix` implements symmetric matrices of size fixed at
construction time (and stored in :obj:`SymMatrix.dim`).
.. cla... |
# coding: utf-8
import datetime
import decimal
import json
import re
from .. import config
from .. import engines
from .. import fixtures
from .. import mock
from ..assertions import eq_
from ..assertions import is_
from ..config import requirements
from ..schema import Column
from ..schema import Table
from ... impo... |
import RPi.GPIO as IO
import time
IO.setwarnings(False)
IO.setmode(IO.BCM)
#Output ports
IO.setup(14, IO.OUT)#Conrol Motor1
IO.setup(18, IO.OUT)#Conrol Motor2
#Freq=50Hz
pwm_m1 = IO.PWM(14,50)
pwm_m2 = IO.PWM(18,50)
pwm_m1.start(2.5)#7.5% duty cycle
pwm_m1.start(12.5)#7.5% duty cycle
while 1:
pwm_m1.ChangeDutyCy... |
import json
from liberia.models import SitRep, Location, LocationSitRep
from django.core.management.base import BaseCommand
import time
from datetime import datetime
class Command(BaseCommand):
help = 'Export necessary json for charts from db'
def handle(self, *args, **options):
national = Location.ob... |
#!/usr/bin/python
# Copyright 2016-2019 Florian Mueller (contact@petrockblock.com)
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the r... |
import unittest
import sys
sys.path.append("..")
import speech2text
import make_them_say
class TestSpeech2Text(unittest.TestCase):
def setup(self):
self.assertEqual('setup'.upper(), 'SETUP') #example, delete this
class TestMakeThemSay(unittest.TestCase):
def setup(self):
self.assertEqual('s... |
#!/usr/bin/env python
## \file config.py
# \brief python package for config
# \author T. Lukaczyk, F. Palacios
# \version 5.0.0 "Raven"
#
# SU2 Original Developers: Dr. Francisco D. Palacios.
# Dr. Thomas D. Economon.
#
# SU2 Developers: Prof. Juan J. Alonso's group at Stanford University.... |
#!/usr/bin/env python
import numpy as np
import argparse
import os
import time
from SULI import which
from SULI.execute_command import execute_command
from SULI.work_within_directory import work_within_directory
from astropy.io import fits
if __name__ == "__main__":
parser = argparse.ArgumentParser('Submit tran... |
import django_tables2 as tables
from django.utils.translation import ugettext_lazy as _
from core.utils import AbsoluteURLColumn, NaturalDatetimeColumn, Column
from . import models
class SourceTable(tables.Table):
name = AbsoluteURLColumn(verbose_name=_('Name'))
publisher = AbsoluteURLColumn(
verbose... |
#
# Copyright (c) 2006, 2007 Canonical
#
# Written by Gustavo Niemeyer <gustavo@niemeyer.net>
#
# This file is part of Storm Object Relational Mapper.
#
# Storm 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 Found... |
try:
import unittest2 as unittest # Python 2.6
except:
import unittest
from pyshould import *
from pyshould import dsl
from pyshould import Expectation
class DslTestCase(unittest.TestCase):
""" Simple tests for the exposed DSL symbols """
def test_keywords(self):
keywords = (
'sh... |
#TFTA stands for TF-target agent whose task is to search for targets known to a TF and vice versa
import re
import os
import logging
import sqlite3
import numpy as np
from collections import defaultdict
logger = logging.getLogger('TFTA')
_resource_dir = os.path.dirname(os.path.realpath(__file__)) + '/../resources... |
2e6667fd-2d5c-11e5-a216-b88d120fff5e |
19519e70-2d5c-11e5-99a3-b88d120fff5e |
32fbf7a1-2d5c-11e5-bcd3-b88d120fff5e |
"""
Sources: Tess Snyder, https://docs.python.org/2/tutorial/datastructures.html
"""
from ggame import App, Color, LineStyle, Sprite, RectangleAsset, CircleAsset, EllipseAsset, PolygonAsset
import random
black = Color(0x000000, 1.0)
white = Color(0xffffff, 1.0)
clear = Color(0xffffff, 0.0)
red = Color(0xff0000, 1.0)
... |
# tobikuchi
# a pointy stick for fighting (spot) fires
# (c) 2017 dwt | terminus data science, LLC
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import re
import cl... |
#!/usr/bin/env python
"""A bot which will respond to various TOP GUN character name commands and
mentions and respond with a random line spoken by that character in the film.
"""
from copy import copy
from errbot.botplugin import BotPlugin
from errbot.jabberbot import botcmd
from topGun import TopGun
CHARACTERS =['... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2003-2014 Edgewall Software
# Copyright (C) 2003-2005 Jonas Borgström <jonas@edgewall.com>
# Copyright (C) 2005 Christopher Lenz <cmlenz@gmx.de>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have ... |
import numpy as np
from . import mixture
from scipy.special import digamma
# Author: Alexandre Passos (alexandre.tp@gmail.com)
#
# Based on mixture.py by:
# Ron Weiss <ronweiss@gmail.com>
# Fabian Pedregosa <fabian.pedregosa@inria.fr>
#
def norm(v):
"""The squared norm of vector v, as a scalar.... |
# encoding: utf8
from datetime import datetime
import csv
import os
import hashlib
import locale
import re
from passlib.hash import sha256_crypt
from sqlalchemy.orm import sessionmaker, scoped_session
from sqlalchemy import create_engine
from trombi import mappings
DATADIR = os.path.join(os.path.dirname(__file__), '... |
import os
from random import choice
class Person:
def __init__(self, name, restricted_list=None, giving_to=None):
self.name = name
self.restricted_list = restricted_list
self.giving_to = giving_to
def select(person, hat):
'''person should be a Person object. hat_list should be a lis... |
import os
import PythonQt
from PythonQt import QtCore, QtGui
from ddapp import callbacks
import ddapp.applogic as app
import ddapp.objectmodel as om
import ddapp.visualization as vis
import ddapp.vtkAll as vtk
from ddapp import botpy
from ddapp import jointcontrol
from ddapp import getDRCBaseDir
from ddapp import lcmUt... |
from ggame import App, Color, LineStyle, Sprite
from ggame import CircleAsset
red = Color(0xff0000, 1.0)
green = Color(0x00ff00, 1.0)
blue = Color(0x0000ff, 1.0)
black = Color(0x000000, 1.0)
thinline = LineStyle(1, black)
mycircle = CircleAsset(5, thinline, blue)
circleto = CircleAsset(5, thinline, red)
xcoordinates ... |
#!/usr/bin/env python
import subprocess, sys, os
import re
from multiprocessing import cpu_count
num_cpus=cpu_count()
def get_dependencies_by_otool(path):
if path.endswith('.app') and os.path.isdir(path):
path = os.path.join(path, 'Contents', 'MacOS', os.path.basename(path))
lines = check_string_outpu... |
# Tai Sakuma <sakuma@cern.ch>
import numpy as np
##__________________________________________________________________||
class EventAuxiliary(object):
# https://github.com/cms-sw/cmssw/blob/CMSSW_8_1_X/DataFormats/Provenance/interface/EventAuxiliary.h
def begin(self, event):
self.run = [ ]
self... |
#Jared Gruneiro
#Senior Design
#Tic Tac Toe Reinforcement Learning
#October 10, 2017
MARKERS = ['X', 'O']
from random import randint
import copy
import ast
from math import floor
import time
class Board(object):
def __init__(self):
self.state = []
self.newBoard()
#Clear Board
def newBoard(self):
self.sta... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.