src stringlengths 721 1.04M |
|---|
import numpy as np
import os.path as op
from numpy.testing import assert_array_almost_equal, assert_raises
from nose.tools import assert_true
from mne import pick_types, Epochs, read_events
from mne.io import RawArray, read_raw_fif
from mne.utils import requires_version, slow_test, run_tests_if_main
from mne.time_freq... |
import unittest
from rx import empty, never, throw, operators as _
from rx.testing import TestScheduler, ReactiveTest
on_next = ReactiveTest.on_next
on_completed = ReactiveTest.on_completed
on_error = ReactiveTest.on_error
subscribe = ReactiveTest.subscribe
subscribed = ReactiveTest.subscribed
disposed = ReactiveTest... |
"""Benchmark for figureeight1.
Trains a fraction of vehicles in a ring road structure to regulate the flow of
vehicles through an intersection. In this example, every other vehicle in the
network is an autonomous vehicle.
- **Action Dimension**: (7, )
- **Observation Dimension**: (28, )
- **Horizon**: 1500 steps
"""
... |
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, String, Integer, BigInteger, Numeric, DateTime, ForeignKey
from sqlalchemy.orm import backref, relationship
from geoalchemy2 import Geometry
"""
Object-relational model of floats database.
See etl.py for extract/transform/load proce... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Focus2
# Copyright (C) 2012 Grid Dynamics Consulting Services, Inc
# All Rights Reserved
#
# This program 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; e... |
"""Base class for the various assembler wrappers."""
from os.path import basename, exists, getsize, join, splitext, abspath
import datetime
from subprocess import CalledProcessError
from .. import db_atram
from .. import log
from .. import bio
from .. import util
class BaseAssembler: # pylint: disable=too-many-publ... |
import fileinput
import os
import re
from datetime import datetime as dt
from logger import log
class Merge:
"""
Merge multiple log files.
"""
class Parsed:
"""
Parsed datetime and log line.
"""
def __init__(self, time=None, line=None):
self.time = time ... |
"""
Django settings for hackart project.
Generated by 'django-admin startproject' using Django 1.10.5.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
... |
# -*- coding: utf-8 -*-
import os
from urllib.parse import quote_plus, urlencode
from plexapi import media, utils, settings, library
from plexapi.base import Playable, PlexPartialObject
from plexapi.exceptions import BadRequest, NotFound
class Video(PlexPartialObject):
""" Base class for all video objects includ... |
#FLM: AT PatternMaker
###########################
#INSTRUCTIONS
# Create glyphs with patterns to apply to the font. Be sure the glyphs have the same
# sufix, point and consecutive 3 digit numbers starting from 001.
# Example: sufix.001, sufix.002, sufix.003, etc.
# Execute the script and enter the sufix for the gly... |
import sys, os
from setuptools import setup, Extension, find_packages
from Cython.Build import cythonize
from os import path
from io import open
import numpy
# read the contents of README.md
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, "README.md"), encoding="utf-8") as f:... |
from __future__ import generators
from expr import Step, Class, Property
from util.anysets import Set, ImmutableSet
empty_set = ImmutableSet()
class RuleDict(dict):
"""A mapping of resources to GraphPath expressions.
The expression for a given resource is the Union()
of all the expressions assigned to th... |
#!/usr/bin/env python3
#
# Write the FastDrum Serpent deck
# Ondrej Chvala, ochvala@utk.edu
# 2016-08-02
import drumdeck
import os
import argparse
# Serpent deck file name
filename = "ffrr.inp"
dirname = "./"
# Command line argument
parser = argparse.ArgumentParser(description='Writes Serpent2 input deck of the F... |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
#!/usr/bin/env python
import csv, sys
# First, some error handling on command line arguments:
def print_usage():
print("Usage: python generate_dwellings.py scenario_id")
print("where scenario_id = 1, 2, or 3")
sys.exit(1)
if (len(sys.argv)!=2):
print_usage();
scenario = 1
try:
scenario = int(sy... |
"""Central Task class.
Author: Yuhuang Hu
Email : duguyue100@gmail.com
"""
import json
class Task(object):
"""Describe a task object."""
def __init__(self, task_dict=None, task_json=None):
"""Initialize task.
Parameters
----------
task_dict : dict
The task dicti... |
"""
sentry.db.models
~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import logging
from django.db import models
from django.db.models import signals
from .fields.bounded import Boun... |
# -*- coding: utf-8 -*-
# Copyright (C) 2020 Philipp Wolfer
#
# 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 2 of the License, or
# (at your option) any later version.
"""DSDIF... |
#@+leo-ver=5-thin
#@+node:lee.20141224110313.61: * @file example2.py
#@@language python
#@@tabwidth -4
import cherrypy
import random
from std.asciisymbol import asciiImage
#@+others
#@+node:lee.20141223114246.41: ** class Application
class Application(object):
#@+others
#@+node:lee.20141223114246.42: *3* def i... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This experiment was created using PsychoPy3 Experiment Builder (v3.1.1),
on Thu May 9 17:56:54 2019
If you publish work using this script please cite the PsychoPy publications:
Peirce, JW (2007) PsychoPy - Psychophysics software in Python.
Journal of N... |
# coding=utf-8
# Copyright 2018 The Google AI Language Team 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 ... |
#!/usr/bin/env python
import logging
import math
import os
import monetdb.sql as db
from src.errors import SourceException, ImageStateError
from src.gsmconnectionmanager import GSMConnectionManager
from src.gsmlogger import get_gsm_logger
from src.sqllist import get_sql, get_svn_version, GLOBALS
from src.grouper impo... |
"""Copy number detection with CNVkit with specific support for targeted sequencing.
http://cnvkit.readthedocs.org
"""
import copy
import os
import shutil
import sys
import tempfile
import pybedtools
import numpy as np
import toolz as tz
from bcbio import install, utils
from bcbio.bam import ref
from bcbio.distribute... |
# -*- coding:utf-8 -*-
from aiojson.backends.python import Buffer, get_tokens
from .data import RAW_DATA, RAW_TOKENS
def test_get_tokens_all():
buf = Buffer(RAW_DATA)
parser = get_tokens(buf, more_data=False)
tokens = list(parser)
assert len(tokens) == len(RAW_TOKENS)
assert tokens == RAW_TOKENS
... |
"""This demo illustrates use of the MeshFunction class.
Original implementation: ../cpp/main.cpp by Ola Skavhaug."""
# Copyright (C) 2007 Kristian B. Oelgaard
#
# This file is part of DOLFIN.
#
# DOLFIN is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public Licen... |
from .base import NameMixin
def load_ext(name, bases):
return need_raw(
name,
bases,
lambda base: base.load(name)
)
def thumbnail_ext(name, width, height, bases):
return need_raw(
name,
bases,
lambda base: base.thumbnail(name, width, height)
)
def mt... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Board
"""
import getpass
import logging
import os
import signal
import sleekxmpp
import ssl
import sys
import threading
import time
from sleekxmpp import Message, Presence
from sleekxmpp.xmlstream import ElementBase
from sleekxmpp.xmlstream import register_stanza_p... |
import pytest
import numpy as np
import dit
import networkx as nx
def test_distribution_from_bayesnet_nonames():
# Smoke test without rv names.
x = nx.DiGraph()
d = dit.example_dists.Xor()
cdist, dists = d.condition_on([0, 1])
x.add_edge(0, 2)
x.add_edge(1, 2)
x.node[2]['dist'] = (cdist.... |
#!/usr/bin/python3
# @begin:license
#
# Copyright (c) 2015-2019, Benjamin Niemann <pink@odahoda.de>
#
# 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 2 of the License, or
# (at y... |
'''
Code for error analysis
Copyright (c) 2014, Helen Ramsden
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of cond... |
from __future__ import unicode_literals
import re
from django.utils.translation import ugettext_lazy as _
from django.utils import formats
from rapidsms.contrib.handlers.handlers.keyword import KeywordHandler
class AppointmentHandler(KeywordHandler):
"Base keyword handler for the APPT prefix."
prefix = '... |
__author__ = 'aarongary'
import unittest
from persistence import EnrichmentPersistence
class Dev_Uint_Tests(unittest.TestCase):
def test_persistence(self):
try:
my_json = {
'termClassification': [{
'status': 'unknown',
'geneSymbol... |
from functools import reduce
import operator
from django.db import models
from django.db.models import Q
from django.conf import settings
from django.utils import timezone
from django.urls import reverse
from django.utils.translation import gettext_lazy as _
from ckeditor.fields import RichTextField
from c... |
#!/usr/bin/env python
import rospy
import actionlib
from sensor_msgs.msg import LaserScan
from geometry_msgs.msg import Twist, Pose2D, PoseStamped
from nav_msgs.msg import Odometry
from math import pi
from slaw_actions.msg import *
from slaw_srvs.srv import *
import sys, select
import tf
odom = "/odom"
base_frame ... |
#
# 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 "License"); you may not us... |
import unittest, random, time
from PID.datasets import SerialValue, ListValue
from PID.controllers import Controller
class TestSerialValue(unittest.TestCase):
def test_sv(self):
sv = SerialValue()
self.main_testcase(sv)
def test_lv(self):
lv = ListValue()
self.main_testcase(lv)... |
import re
import PortInterface.ProvidedPort
import PortInterface.RequiredPort
import PortInterface.SenderReceiverInterface
import Datatype.ArrayDataType
import PortInterface.DataElement
import StkParser.StkPortCriteria
import Components.IComponent
import Parser.IPortCriteria
class StkJilDataCriteria(StkParser.StkPort... |
# -*- coding: utf-8 -*-
#
# This file is part of HEPData.
# Copyright (C) 2021 CERN.
#
# HEPData 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 2 of the
# License, or (at your option) any later... |
"""Synchronization primitives."""
__all__ = ['Lock', 'Event', 'Condition', 'Semaphore', 'BoundedSemaphore']
import collections
from ActualVim.lib.asyncio_inc import compat
from . import events
from . import futures
from .coroutines import coroutine
class _ContextManager:
"""Context manager.
This enables t... |
# -*- coding: utf-8 -*-
"""
frink.base
~~~~~~~~~~~~~
BaseModel class
"""
import datetime
from schematics.models import Model
from schematics.types.base import (
StringType, BooleanType, DateTimeType, IntType, UUIDType
)
from schematics.exceptions import ValidationError
# Frink
from .orm import Insta... |
# -*- coding: utf-8 -*-
__author__ = 'ElenaSidorova'
import re
from copy import deepcopy
from dict_settings import DictLoader
signs = [u'!', u'?', u',', u'.', u':', u')', u'(', u'«', u'»', u'“', u'”', u'-', u'–',u'`', u';', u'\\', u'/', u'@',
u'"', u' ', u'<', u'>', u'$']
prefix = {
re.compile(ur'^воз([пт... |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'EventsByPeriodPlugin.period_begin'
db.delete_column(u'cmsplugin_eventsbyperiodplugin', 'pe... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-12-30 09:19
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0007_mentor_organizer_volunteer'),
]
operations = [
migrations.Alter... |
#!/usr/bin/python
from atila import Atila
import shutil, os
app =Alita (__name__)
app.debug = True
app.use_reloader = True
app.securekey = "iodfjksdfkjsdhkfjsd0987987sdf"
app.realm = "Skitai API"
app.user = "app"
app.password = "1111"
app.authorization = "digest"
MULTIPART = """
<form action = "/" enctype="multipar... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# $Id: testboxscript.py $
"""
TestBox Script Wrapper.
This script aimes at respawning the Test Box Script when it terminates
abnormally or due to an UPGRADE request.
"""
__copyright__ = \
"""
Copyright (C) 2012-2015 Oracle Corporation
This file is part of VirtualBox Ope... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
calcmymarks.markcalc
~~~~~~~~~~~~~~~~~~~~
The mark calculator object
:copyright: (c) 2009-2010 by Aaron Toth.
:license: Apache 2.0, see LICENSE for more details.
"""
class MarkCalc(object):
"""A mark calculator"""
def __init__(self, curren... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.core import mail
from django.core.mail import send_mail
from django.db import models
from django.db.models import Q
from django.test i... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
m... |
import io
import os
import random
import shutil
import unittest
import numpy as np
from numpy.testing import assert_array_equal, assert_equal
from sdafile.exceptions import BadSDAFile
from sdafile.sda_file import SDAFile
from sdafile.testing import (
BAD_ATTRS, GOOD_ATTRS, MockRecordInserter, TEST_NUMERIC, TEST_C... |
"""
Options for managing Confab.
"""
from os import getcwd
from os.path import basename
from fabric.api import env, task
from fabric.utils import _AttributeDict
from difflib import unified_diff
from magic import Magic
from re import match
def _should_render(mime_type):
"""
Return whether a template file of ... |
# coding: utf-8
"""
Onshape REST API
The Onshape REST API consumed by all clients. # noqa: E501
The version of the OpenAPI document: 1.113
Contact: api-support@onshape.zendesk.com
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import re # noqa: F401
im... |
import os
import urllib
import httplib
import json
import hashlib
import logging
import time
import zipfile
import pythoncom
import ConfigParser
from win32com.client import Dispatch
class AutoUpdate:
def __init__(self, parent, upgradeHost):
self.parent = parent
# TODO: the config stuff is very mu... |
# -*- coding: utf-8 -*-
"""
Created on Wed May 27 20:06:01 2015
@author: Thomas
"""
# Python standard library imports
import csv
import os
def main():
sizes = []
for file in os.listdir("reformatted/"):
print file
size_total = []
size_2000 = []
size_2001 = []
... |
from core.himesis import Himesis
import cPickle as pickle
from uuid import UUID
class HState2ProcDef(Himesis):
def __init__(self):
"""
Creates the himesis graph representing the AToM3 model HState2ProcDef.
"""
# Flag this instance as compiled now
self.is_compiled = True
... |
from django.contrib.auth.views import redirect_to_login
from django.db.models.aggregates import Max
from django.http.response import HttpResponse, HttpResponseBadRequest, \
HttpResponseForbidden
from django.shortcuts import get_object_or_404, render, redirect
from django.template import RequestContext
from django.t... |
import time
from config.constants import *
from config import SQL
from cursesmenu import *
from cursesmenu.items import *
import curses
'''
---------------------------------------------------------
This script handles menu navigation
RETURNS: dictionary containing device name,
number of buttons, number of axis
-... |
import sys
from flask_script import Manager
from CompoundRanker import app
from CompoundRanker.DataManipulators.CIDGatherer import CIDGatherer
from CompoundRanker.DataManipulators.PubChemAssayCounter import PubChemAssayCounter
from CompoundRanker.DataManipulators.PubChemPathwayCounter import PubChemPathwayCounter
from ... |
from abc import abstractmethod
from django.db import models
from enums.public import StringEnum
from tracked_model.public import TrackedModel
from .lifecycle_management import ObjectStatusLifecycleManager, StatusLifecycle
class StatusModel(TrackedModel):
"""
This Model can be inherited by models which hav... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
main
~~~~
Endpoint of robo.
:copyright: (c) 2016 Shinya Ohyanagi, All rights reserved.
:license: BSD, see LICENSE for more details.
"""
import os
import sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import argpa... |
from django.conf import settings
from django.http import HttpResponseRedirect
from django.urls import reverse
from django.views.generic import FormView
from lily.users.models import UserInfo
class RegistrationMixin(FormView):
"""
Mixin that saves the current step in the session or redirects to the smart redi... |
###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Tavendo GmbH
#
# 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 with... |
# -*- coding: utf-8 -*-
# Copyright (C) 2016, Maximilian Köhl <mail@koehlma.de>
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License version 3 as published by
# the Free Software Foundation.
#
# This program is distributed in the hope th... |
# -*- 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 Apach... |
# -*- coding: utf-8 -*-
#
# Flask-Views documentation build configuration file, created by
# sphinx-quickstart on Wed Feb 1 20:28:05 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
#... |
# 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
###############################################################################################################
## [Title]: linuxprivchecker.py -- a Linux Privilege Escalation Check Script
## [Author]: Mike Czumak (T_v3rn1x) -- @SecuritySift
##-----------------------------------------------------... |
import socket
import sys
__author__ = 'sekely'
class SimpleServer(object):
def __init__(self, addr='localhost', port=50000, buf=1024):
self.buf = buf
self.server_address = (addr, port)
print('setting up server up on %s port %s' % self.server_address)
self._bind()
def _bind(sel... |
# 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 https://mozilla.org/MPL/2.0/.
from .sile import SileSiesta
from ..sile import add_sile, sile_fh_open
from sisl._internal import set_module
from sisl ... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#author Cleóbulo Bezerra < cleobulo.oliveira@gmail.com >
#file Defines a set of proceeds to verify the authenticity of the urls
from re import match, split, sub, search
from Queue import Queue
from urlparse import urljoin, urlparse
def init():
"""
Initializes t... |
######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... |
#-
# Copyright (c) 2011 Robert N. M. Watson
# All rights reserved.
#
# This software was developed by SRI International and the University of
# Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237
# ("CTSRD"), as part of the DARPA CRASH research programme.
#
# @BERI_LICENSE_HEADER_START@
#
# License... |
"""
Django settings for spring_batch_dashboard project.
Generated by 'django-admin startproject' using Django 1.10.5.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/... |
# fifteenwordsnippets.py
# A script that searches a HathiTrust corpus of 6,942 volumes (1700-1923), plus Hoyt & Richard's
# corpus of 808 vols (1923-1950), for words related to money. It takes seven words on either
# side of those words to create a snippet.
# In cases where the possibly-monetary word is ambiguous, e.... |
import codecs
from ..utils import now, MergeDict
from .forms import ClientAuthForm, PublicPasswordGrantForm
from .models import AccessToken
import binascii
class BaseBackend(object):
"""
Base backend used to authenticate clients as defined in :rfc:`1` against
our database.
"""
def authenticate(sel... |
from django.utils.translation import ugettext
from livesettings import values
from livesettings.exceptions import SettingNotSet
from livesettings.utils import is_string_like
import logging
import warnings
log = logging.getLogger('configuration')
_NOTSET = object()
class ConfigurationSettings(object):
_instance ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import getopt, sys
from telnetlib import Telnet
# default memcached server to check
memcachedServer = '127.0.0.1'
memcachedPort = '11211'
ITEMS = (
'bytes',
'cmd_get',
'cmd_set',
'curr_items',
'curr_connections',
'evictions',
'limit_maxbytes',... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
"""
import pygimli as pg
import pygimli.solver as solver
from pygimli.viewer import showMesh
from pygimli.mplviewer import drawMesh, drawStreams
from pygimli.meshtools import createMesh
import matplotlib.pyplot as plt
import numpy as np
from solverFVM import solveFi... |
""" Title: Read in CSV data of the route """
""" Description: Read in and store the CSV data into usable Python structures.
This will include the following info from the CSV:
Step Information
Approx. Kms from start: distance of step
Feature: name of landmark on step
Action/Remark: road info and traveling instructions
... |
#
# Network Ten CatchUp TV Video Addon
#
# Copyright (c) 2013 Adam Malcontenti-Wilson
#
# 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 limit... |
from __future__ import division, absolute_import
import os
import numpy as np
import numpy.testing as npt
from .. import load_surfer
MODULE_DIR = os.path.dirname(__file__)
TEST_DATA_DIR = os.path.join(MODULE_DIR, 'data')
def test_load_surfer():
"Check if load_surfer reads test data correctly"
fname = os.pat... |
# Copyright 2020 Makani Technologies LLC
#
# 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... |
import os
from ConfigParser import RawConfigParser
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
PROJECT_DIR = os.path.dirname(__file__)
CONF_DIR = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
here = lambda x: os.path.join(os.path.abspath(os.path.dirname(__file__)), x)
# you will need to copy... |
from __future__ import absolute_import, division, print_function, unicode_literals
from xarray import DataArray, Dataset
from mkgu import fetch
class DataPoint(object):
"""A DataPoint represents one value, usually a recording from one neuron or node,
in response to one presentation of a stimulus. """
d... |
# coding=utf-8
#
# Copyright 2013 Hewlett-Packard Development Company, L.P.
#
# 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
#
#... |
# pylint: disable=line-too-long
import datetime
import psycopg2
import pytz
CREATE_PROBE_TABLE_SQL = 'CREATE TABLE builtin_rawlocationprobeeventlog(id SERIAL PRIMARY KEY, user_id TEXT, guid TEXT, timestamp BIGINT, utc_logged TIMESTAMP, provider_status TEXT, log_event TEXT, satellites BIGINT);'
CREATE_PROBE_USER_ID_IN... |
# -*- coding: utf-8 -*-
from module.plugins.internal.MultiHook import MultiHook
class RehostTo(MultiHook):
__name__ = "RehostTo"
__type__ = "hook"
__version__ = "0.50"
__config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"),
("pl... |
import pytest
from evolvers import RungeKuttaEvolve, CGEvolve
class TestRungeKuttaEvolve(object):
def setup(self):
# Set of valid arguments.
self.args1 = [[1, 1, 1, 'rkf54'],
[0.5, 1e5, 0.01, 'rk2'],
[0.05, 2.21e5, 5e6, 'rk4'],
[0.1... |
import numpy as np
import re
import itertools
from collections import Counter
import cPickle as pickle
import os
def clean_str(string):
"""
Tokenization/string cleaning for all datasets except for SST.
"""
string = re.sub(r"[^A-Za-z0-9:(),!?\'\`]", " ", string)
string = re.sub(r" : ", ":", string)
... |
#-*- coding: utf8 -*
#
# Max E. Kuznecov ~syhpoon <syhpoon@syhpoon.name> 2008
#
# This file is part of XYZCommander.
# XYZCommander is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser Public License as published by
# the Free Software Foundation, either version 3 of the Licens... |
import os
from distutils.core import setup, Extension
from glob import glob
# Read the current version from ephem/__init__.py itself.
path = os.path.join(os.path.dirname(__file__), 'ephem', '__init__.py')
for line in open(path):
if line.startswith('__version__'):
__version__ = eval(line.split(None, 2)[2])... |
import os
from django.conf import settings
from django.utils import translation
from django.db import transaction
from django.core.files import File
from froide.celery import app as celery_app
from .models import FoiRequest, FoiAttachment
from .foi_mail import _process_mail, _fetch_mail
from .file_utils import conve... |
#!/bin/env python
import io
import json
import urllib.request, urllib.parse, urllib.error
import urllib.request, urllib.error, urllib.parse
import warnings
from datetime import datetime
from dateutil.relativedelta import relativedelta
import time
# eeDomus Python API. From http://doc.eedomus.com/en/index.php/API_eed... |
"""
Django settings for wisemessage project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
from __future__ import absolute_import
import os
BASE_DIR = os.path.di... |
# The Hazard Library
# Copyright (C) 2012 GEM Foundation
#
# 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 Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# Th... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Mirantis, 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... |
from django.db import models
import data.models
from jingju import managers
class JingjuStyle(object):
def get_style(self):
return "jingju"
def get_object_map(self, key):
return {
"performance": RecordingInstrumentalist,
"release": Release,
"artist": Artis... |
"""
Revision ID: 0151_refactor_letter_rates
Revises: 0150_another_letter_org
Create Date: 2017-12-05 10:24:41.232128
"""
import uuid
from datetime import datetime
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
revision = '0151_refactor_letter_rates'
down_revision = '0150_a... |
import re
from .base import AbstractNode
from .dict import DictNode
class WildcardDictNode(DictNode):
"""A dictionary node where nearly any key is valid
The only invalid keys are:
- an actual asterisk '*'
- a key that begins with '_'
"""
def _validate_value(self):
for key... |
# Copyright (c) 2010, Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack LLC.
# 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/... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.