text stringlengths 12 6.59M |
|---|
#!/usr/bin/env python
# ***** BEGIN LICENSE BLOCK *****
# 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/.
# ***** END LICENSE BLOCK *****
"""desktop_unittest.py
The goal o... |
__version_info__ = (1, 4, 0, None)
# Dot-connect all but the last. Last is dash-connected if not None.
__version__ = '.'.join([str(i) for i in __version_info__[:-1]])
if __version_info__[-1] is not None:
__version__ += ('-%s' % (__version_info__[-1],))
# context processor to add version to the template environm... |
import argparse
import sqlalchemy
from sqlalchemy.ext.declarative import declarative_base
import json
from os import path
Base = declarative_base()
MAPPING_DIR = "mappings/"
MONUMENTS_ALL = "monuments_all"
def run(stmt):
return stmt.execute()
def get_monuments_in_country(countryname, languagename, all_monumen... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2003-2006 Edgewall Software
# Copyright (C) 2003-2005 Jonas Borgström <jonas@edgewall.com>
# Copyright (C) 2004-2005 Christopher Lenz <cmlenz@gmx.de>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part ... |
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file ex... |
# -*- Mode: Python -*-
# vi:si:et:sw=4:sts=4:ts=4
# Flumotion - a streaming media server
# Copyright (C) 2004,2005,2006,2007,2008,2009 Fluendo, S.L.
# Copyright (C) 2010,2011 Flumotion Services, S.A.
# All rights reserved.
#
# This file may be distributed and/or modified under the terms of
# the GNU Lesser General Pub... |
# -*- coding: utf-8 -*-
#
# Copyright (C)2005-2009 Edgewall Software
# 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 received as part of this distribution. The terms
# are also available at http://trac.e... |
''' Base Extractor class and associated functionality. '''
from abc import ABCMeta, abstractmethod
from six import with_metaclass
import pandas as pd
import numpy as np
from pliers.transformers import Transformer
from pliers.utils import isgenerator, flatten
from pandas.api.types import is_numeric_dtype
class Extrac... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2003-2009 Edgewall Software
# Copyright (C) 2003-2005 Daniel Lundin <daniel@edgewall.com>
# 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 p... |
# Django settings for recipe project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'db/reci... |
import os
import re
from PyQt4 import QtCore, QtGui
Qt = QtCore.Qt
from maya import cmds, mel
from sgfs.ui import product_select
import sgfs.ui.scene_name.widget as scene_name
from sgpublish.importer.generic import Importer
from sgpublish.importer.ui.dialog import ImportDialog
from sgpublish.importer.ui.workarea imp... |
from collections import OrderedDict
from wazimap.data.utils import LocationNotFound
from wazimap.geo import geo_data
from wazimap.data.tables import get_model_from_fields
from wazimap.data.utils import get_session, calculate_median, merge_dicts, get_stat_data, get_objects_by_geo, group_remainder
import logging
# ensur... |
''' Base Extractor class and associated functionality. '''
from abc import ABCMeta, abstractmethod
import json
import math
from scipy.interpolate import interp1d
import pandas as pd
import numpy as np
from pandas.api.types import is_numeric_dtype
from pliers.transformers import Transformer
from pliers.utils import i... |
from __future__ import absolute_import, unicode_literals
from django.db.models.signals import post_save
from django.dispatch import receiver
from tracpro.client import get_client
from tracpro.groups.models import Group
from .models import Contact, ContactField
@receiver(post_save, sender=Contact)
def set_data_field... |
# Copyright (c) 2014, Menno Smits
# Released subject to the New BSD License
# Please see http://en.wikipedia.org/wiki/BSD_licenses
from __future__ import unicode_literals
import imaplib
import select
import socket
import sys
import re
import warnings
from datetime import datetime
from operator import itemgetter
from... |
""" Base class for making API calls to the Janrain API. """
# pylint: disable=E0611
from janrain.capture.exceptions import InvalidApiCallError, ApiResponseError
from json import dumps as to_json
from contextlib import closing
from base64 import b64encode
from hashlib import sha1
import hmac
import time
import logging
... |
''' Base Extractor class and associated functionality. '''
from abc import ABCMeta, abstractmethod
from six import with_metaclass
import pandas as pd
import numpy as np
from pliers.transformers import Transformer
from pliers.utils import isgenerator
from pandas.api.types import is_numeric_dtype
class Extractor(with_... |
#!/usr/bin/env python3
import argparse
import yaml
import jinja2
import weasyprint
parser = argparse.ArgumentParser()
parser.add_argument('--data', help='path to data directory', required=True)
parser.add_argument('--number', help='Invoice number', type=int, required=True)
args = parser.parse_args()
data_directory =... |
'''
The code in this file documents how the graphlab SFrame intermediate objects
were created. It also loads them.
author: David Thaler
date: July 2015
'''
import graphlab as gl
import os
import avito2_io
from datetime import datetime
from random import random
GL_DATA = os.path.join(avito2_io.DATA, 'graphlab')
def... |
from imhotep.tools import Tool
from collections import defaultdict
import json
import os
import logging
log = logging.getLogger(__name__)
class Flake8Linter(Tool):
def get_configs(self):
return {'flake8', '.flake8'}
def invoke(self, dirname, filenames=set(), linter_configs=set()):
retval = de... |
'''
Extractors that operate primarily or exclusively on Text stimuli.
'''
import sys
from pliers.stimuli.text import TextStim, ComplexTextStim
from pliers.extractors.base import Extractor, ExtractorResult
from pliers.support.exceptions import PliersError
from pliers.support.decorators import requires_nltk_corpus
from ... |
# Copyright (c) 2015, 2016, 2017, 2018, Intel Corporation
#
# 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 con... |
"""
This module handles accessing, storing, and managing the graph reference.
"""
from __future__ import absolute_import
import hashlib
import json
import os
import re
from pkg_resources import resource_string
import requests
import six
from plotly import files, utils
GRAPH_REFERENCE_PATH = '/v2/plot-schema'
GRAPH... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
Derive Beta Series Maps
^^^^^^^^^^^^^^^^^^^^^^^
.. autofunction:: init_betaseries_wf
"""
from __future__ import print_function, division, absolute_import,... |
# Copyright (C) 2020 Freie Universität Berlin
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
import contextlib
class MockSpawn():
def __init__(self, ctrl, *args, **kwargs):
self.ctrl... |
import sys
import os
from numpy import *
from scipy.linalg import *
from scipy.sparse import *
from pyspark import SparkContext
import logging
if len(sys.argv) < 6:
print >> sys.stderr, \
"(shotgun) usage: shotgun <master> <inputFile_A> <inputFile_y> <outputFile> <lambda>"
exit(-1)
def parseVector(line):
vec =... |
#!/usr/bin/env python
#
# Copyright (c) 2015, 2016, 2017, Intel Corporation
#
# 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... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Hive Appier Framework
# Copyright (c) 2008-2015 Hive Solutions Lda.
#
# This file is part of Hive Appier Framework.
#
# Hive Appier Framework is free software: you can redistribute it and/or modify
# it under the terms of the Apache License as published by the Apach... |
"""
guiback.py -- code/ibeis/ibeis/gui
./resetdbs.sh
./dev.py --cmd --gui --db testdb1 (--setdb) <-set default
TODO:
1. create a function call to create a rectangle at a given set of points
2.. Make 45 degree rotation - need help
3. Change bounding box and update continuously to the original image the new ROIs
... |
__author__ = 'onur'
from celery import Celery
import direnaj_api.config.server_celeryconfig as celeryconfig
app_object = Celery()
app_object.config_from_object(celeryconfig)
@app_object.task
def deneme(x, seconds):
print "Sleeping for printing %s for %s seconds.." % (x, seconds)
import time
time.sleep(... |
# vim: fenc=utf-8:ft=python
# coding: UTF-8
from gettext import gettext as _
from dbus import UInt64
import time as mtime
config = None
gui = None
com = None
sushi = None
# TODO: config values like quit or part message should
# TODO:: be retrieved from maki and set to maki.
def setup(_config, _gui, _com):
global... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017 F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUM... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import socket
import socks
import time
import json
import threading
import string
import random
import requests
import random
import os
from core.alert import *
from core.targets import target_type
from core.targets import target_to_host
from core.load_modules import load_... |
__author__ = 'onur'
from celery import Celery
import direnaj_api.config.server_celeryconfig as celeryconfig
app_object = Celery()
app_object.config_from_object(celeryconfig)
@app_object.task
def deneme(x, seconds):
print "Sleeping for printing %s for %s seconds.." % (x, seconds)
import time
time.sleep(... |
#!/usr/bin/python
import collections
import re
import signal
import sys
import time
from requests.exceptions import ConnectionError
from kol.Session import Session
from kol.Error import Error
from kol.manager.ChatManager import ChatManager
from kol.request.GenericRequest import GenericRequest
from kol.request.GetMes... |
'''Optimize rateless codes for distributed computing
'''
import math
import logging
import numpy as np
import pandas as pd
import pyrateless
import stats
import complexity
import overhead
import tempfile
import subprocess
from os import path
def optimize_lt_parameters(num_inputs=None, target_overhead=None,
... |
#!/usr/bin/python
#
# Copyright (c) 2015, Arista Networks, 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,
# t... |
"""
Simfile parser for Python. This library currently only supports the .SM
format; .SSC support is planned for the future.
"""
import codecs
from cStringIO import StringIO
from decimal import Decimal
from fractions import Fraction, gcd
import os
__author__ = 'Grant Garcia'
__copyright__ = 'Copyright 2013, Grant Garci... |
import numpy as np
from sympy import *
import sys
from fractions import Fraction as f
np.set_printoptions(precision=3,suppress=True)
#def printm(a):
# """Prints the array as strings
# :a: numpy array
# :returns: prints the array
# """
# def p(x):
# return str(x)
# p = vectorize(p,otypes=[str]... |
#!/usr/bin/env python
import os, sys, json, requests, types, re
import requests_cache
from pyes import ES
from ckan import create_app
requests_cache.install_cache('ckan-import')
TEMPORAL_EXT_RE = re.compile(r'^(\d{4}-\d{2}-\d{2}T\d{2})(\d{2})(\d{2})$')
TEMPORAL_EXT_FIELDS = ['temporal-extent-begin', 'temporal-exte... |
#!/usr/bin/env python
# Copyright (c) 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Sets up launch-on-reboot behavior."""
import getpass
import os
import socket
import subprocess
import sys
import tempfile
C... |
class Dashboard(object):
"""Librato Dashboard Base class"""
def __init__(self, connection, name, id=None, instrument_dicts=None):
self.connection = connection
self.name = name
self.instrument_ids = []
self._instruments = None
for i in (instrument_dicts or []):
... |
import unittest
from xknx import KNXIPFrame,Address,DPT_Time,DPT_Binary,DPT_Array,DPT_Temperature,Telegram,TelegramType
class Test_KNXIP(unittest.TestCase):
def test_from_knx(self):
raw = ((0x06,0x10,0x05,0x30,0x00,0x12,0x29,0x00,0xbc,0xd0,0x12,0x02,0x01,0x51,0x02,0x00,0x40,0xf0))
knxipframe = ... |
from sqlalchemy import *
import testbase
import string
class Place(object):
'''represents a place'''
def __init__(self, name=None):
self.name = name
class Transition(object):
'''represents a transition'''
def __init__(self, name=None):
self.name = name
self.inputs = []
... |
# encoding: utf-8
import os, atexit, shutil
from smisk.util._bsddb import db, dbshelve
from smisk.util.cache import app_shared_key
from tempfile import gettempdir
_dicts = {}
def shared_dict(filename=None, homedir=None, name=None, mode=0600, dbenv=None,
type=db.DB_HASH, flags=db.DB_CREATE, persistent... |
# coding: utf-8
from datetime import datetime
try:
import simplejson as json
except ImportError:
import json
from celery.schedules import schedule, crontab
class RedBeatJSONDecoder(json.JSONDecoder):
def __init__(self, *args, **kargs):
super(RedBeatJSONDecoder, self).__init__(object_hook=self.d... |
"""
This is the Resource Expert Droid.
"""
__version__ = "1.3"
__author__ = "Mark Nottingham <mnot@mnot.net>"
__copyright__ = """\
Copyright (c) 2008-2016 Mark Nottingham
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), ... |
import sys, pygame, math, random
from BgColor import *
from Ball import *
from Player import *
from Predator import *
pygame.init()
clock = pygame.time.Clock()
screenModes = pygame.display.list_modes()
width = screenModes[0][0]
height = screenModes[0][1]
size = width, height
print size
r = 255
g = 255
b = 255
bgCo... |
"""General mapper operations with an emphasis on selecting/loading."""
import testenv; testenv.configure_for_tests()
from testlib import sa, testing
from testlib.sa import MetaData, Table, Column, Integer, String, ForeignKey
from testlib.sa.orm import mapper, relation, backref, create_session
from testlib.sa.orm impor... |
# Copyright 2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... |
"""Implements the echo-top-based storm-tracking algorithm.
This algorithm is discussed in Section 3c of Homeyer et al. (2017). The main
advantage of this algorithm (in my experience) over segmotion (Lakshmanan and
Smith 2010) is that it provides more intuitive and longer storm tracks. The
main disadvantage of the ec... |
#!/usr/bin/env python
"""
melt_somatic_vcf.py - Version 2
Melts / merges somatic vcf files coming from the pipeline.
Supported somatic callers: Freebayes, Mutect, Strelka and Varscan.
Input:
- vcf_file: merged somatic vcf file created by the pipeline.
- tumor_sample: tumor sample name, used to find somatic tum... |
"""
This module contains the spatial lookup types, and the get_geo_where_clause()
routine for PostGIS.
"""
import re
from decimal import Decimal
from django.db import connection
from django.conf import settings
from django.contrib.gis.measure import Distance
from django.contrib.gis.db.backend.util import SpatialOper... |
###
# Copyright (c) 2002-2005, Jeremiah Fincher
# Copyright (c) 2009, James Vega
# 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 copyri... |
# -*- coding: utf-8 -*-
"""
Contains code related to computing discount percentage
and discount applicability.
WARNING:
Keep in mind that the code in this file only applies to discounts controlled in the lms like the first purchase offer,
not other discounts like coupons or enterprise/program offers configured in ecom... |
#!/usr/bin/env python3
import argparse
import glob
import math
import os
import re
import sys
from collections import namedtuple
from pathlib import Path
from itertools import chain
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
# import numpy as np
import pandas as pd
from astropy import constants... |
############################################################################
#
# Copyright (C) 2014 tele <tele@rhizomatica.org>
#
# This file is part of RCCN
#
# RCCN is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero Public License as published by
# the Free Software Foundat... |
# -*- coding: utf-8 -*-
""" OneLogin_Saml2_Authn_Request class
Copyright (c) 2010-2021 OneLogin, Inc.
MIT License
AuthNRequest class of OneLogin's Python Toolkit.
"""
from onelogin.saml2.constants import OneLogin_Saml2_Constants
from onelogin.saml2.utils import OneLogin_Saml2_Utils
from onelogin.saml2.xml_template... |
# Licensed GNU LGPL v3 or later: http://www.gnu.org/licenses/lgpl.html
"""Rapicorn - experimental UI toolkit
More details at http://www.rapicorn.org/.
"""
# Import Aida helper module
from Aida1307 import loop as _Aida_loop
# Load generated C++ API
import __pyrapicorn as _cxxrapicorn
# Load generated Python API
impo... |
# -*- coding: utf-8 -*-
# Copyright 2016 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 ... |
import pandas as pd
import argparse
import os
if __name__=='__main__':
"""
Merge benchmark output for all scenarios, methods and settings
"""
parser = argparse.ArgumentParser(description='Collect all benchmarks')
parser.add_argument('-o', '--output', required=True, help='output file')
parser.... |
import json
from xml.sax.saxutils import quoteattr
from django import forms
from django.db import models
from django.views.generic.edit import FormMixin
from django_cradmin.viewhelpers import listbuilderview
from django_cradmin.viewhelpers import multiselect2
class ViewMixin(FormMixin):
"""
Multiselect2 vie... |
"""
Basic testing of the draw module. This just ensures the functions don't crash.
Testing plotting is hard. ;)
"""
import os
import numpy as np
from skimage import io, morphology
import matplotlib.pyplot as plt
from matplotlib.figure import Figure
import pytest
from skan import pre, draw, csr, _testdata
rundir = os.... |
from __future__ import absolute_import
import boto3
import botocore
import inspect
import os
import zipfile
from django.core.exceptions import ImproperlyConfigured
from django.core.management.base import BaseCommand
from django.utils.text import slugify
from zappa.zappa import Zappa
class ZappaCommand(BaseCommand):... |
from openpathsampling.engines.dynamics_engine import DynamicsEngine
from openpathsampling.engines.snapshot import BaseSnapshot
from openpathsampling.engines.toy import ToySnapshot
import numpy as np
import os
import logging
import psutil
import signal
import shlex
import time
import linecache
import sys # DEBUG
lo... |
try:
from builtins import object
except ImportError:
# python2
pass
import inspect
import itertools
import logging
from collections import OrderedDict
from collections import defaultdict
from collections import deque
from functools import partial
from six import string_types
logger = logging.getLogger(__na... |
# -*- coding: utf-8 -*-
""" OneLogin_Saml2_Authn_Request class
Copyright (c) 2014, OneLogin, Inc.
All rights reserved.
AuthNRequest class of OneLogin's Python Toolkit.
"""
from base64 import b64encode
from onelogin.saml2.constants import OneLogin_Saml2_Constants
from onelogin.saml2.utils import OneLogin_Saml2_Util... |
# Copyright 2013 Rackspace Australia
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... |
from splinter.browser import Browser
from time import sleep
from core.frespoutils import Struct
TIMEOUT=5
def paradinha():
sleep(0.4)
# sleep(2)
class AppDriver:
@classmethod
def build(cls):
driver = cls()
# driver.browser = Browser('chrome')
driver.browser = Browser()
... |
import string
import sys
import openpathsampling as paths
if sys.version_info > (3,):
maketrans = str.maketrans
else:
maketrans = string.maketrans
# can't import * here bc something is named Test*!
from openpathsampling.engines.openmm.tools import (
reduce_trajectory_box_vectors,
reduced_box_vectors,... |
# Copyright 2013 Rackspace Australia
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... |
# -*- coding: utf-8 -*-
# Copyright (c) 2010-2012, GEM Foundation.
#
# OpenQuake is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.... |
import numpy as np
def unique_rows(ar):
"""Remove repeated rows from a 2D array.
In particular, if given an array of coordinates of shape
(Npoints, Ndim), it will remove repeated points.
Parameters
----------
ar : 2D np.ndarray
The input array.
Returns
-------
ar_out : 2... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from collections import deque
import copy
import io
import logging
import typing
from enum import Enum
from typing import Generator, Dict, Text, Any, Optional, Iterator
... |
# -*- coding: utf-8 -*-
# Copyright (c) 2010-2012, GEM Foundation.
#
# OpenQuake is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.... |
#!/usr/bin/python
# raspi-sump, a sump pump monitoring system
# Al Audet
import time
import RPi.GPIO as GPIO
import decimal
def waterlevel():
trig_pin = 17 #gpio pin 17 connected to Trig on HC-SR04 sensor
echo_pin = 27 #gpio pin 27 connected to Echo on HC-SR04 sensor
GPIO.setwarnings(False)
... |
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2010-2019 GEM Foundation
#
# OpenQuake is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the Licen... |
#!/usr/bin/env python
import base64
import cookielib
import getpass
import mimetools
import os
import re
import sys
import urllib2
from optparse import OptionParser
from pkg_resources import parse_version
from urlparse import urljoin, urlparse
from rbtools import get_package_version, get_version_string
from rbtools.ap... |
"""
Graph utilities and algorithms
Graphs are represented with their adjacency matrices, preferably using
sparse matrices.
"""
# Authors: Aric Hagberg <hagberg@lanl.gov>
# Gael Varoquaux <gael.varoquaux@normalesup.org>
# Jake Vanderplas <vanderplas@astro.washington.edu>
# License: BSD
import numpy ... |
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2010-2019 GEM Foundation
#
# OpenQuake is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the Licen... |
#!/usr/bin/env python
import cookielib
import difflib
import getpass
import marshal
import mimetools
import ntpath
import os
import re
import socket
import stat
import subprocess
import sys
import tempfile
import urllib
import urllib2
from optparse import OptionParser
from tempfile import mkstemp
from urlparse import u... |
from .adapters.storage import StorageAdapter
from .adapters.logic import LogicAdapter, MultiLogicAdapter
from .adapters.input import InputAdapter
from .adapters.output import OutputAdapter
from .conversation import Statement, Response
from .utils.queues import ResponseQueue
from .utils.module_loading import import_modu... |
'''
Created on May 20, 2014
@author: rd
'''
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Nebula, 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
#
# ht... |
from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.contrib.auth import views as auth_views
from django.views.generic import RedirectView
from django.views.generic import TemplateView
from registration.backends.default.views import RegistrationView
from gnowsys_ndf.ndf.for... |
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2015-2020 GEM Foundation
#
# OpenQuake is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the Licen... |
#!/usr/bin/env python
#-*- coding: utf-8 -*-
#from __future__ import unicode_literals
import sys
import os
import time
import calendar
import datetime
import sqlite3
try:
import simplejson
except ImportError:
import json as simplejson
import pywikibot
from pywikibot.data import api
import robot
import index_he... |
'''
@author Luke Campbell
@file ion/services/dm/transformation/example/transform_example.py
@description an Example of a transform
'''
import threading
import time
from interface.objects import ProcessDefinition, StreamQuery
from pyon.ion.streamproc import StreamProcess
from pyon.ion.transform import TransformDataProce... |
"""
.. module:: skrf.tlineFunctions
===============================================
tlineFunctions (:mod:`skrf.tlineFunctions`)
===============================================
This module provides functions related to transmission line theory.
Impedance and Reflection Coefficient
-------------------------------------... |
"""Tests for TLS support."""
# -*- coding: utf-8 -*-
# vim: set fileencoding=utf-8 :
from __future__ import absolute_import, division, print_function
__metaclass__ = type
import functools
import json
import os
import ssl
import subprocess
import sys
import threading
import time
import traceback
import OpenSSL.SSL
im... |
''' -- imports from python libraries -- '''
# import os -- Keep such imports here
''' -- imports from installed packages -- '''
from django.contrib.auth.models import User
from django.template.defaultfilters import slugify
''' -- imports from application folders/files -- '''
from gnowsys_ndf.settings import GAPPS
fro... |
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2022, GEM Foundation
#
# OpenQuake is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License... |
from slcyUltrasonic import *
if __name__ == "__main__":
pins = {'trig':38,'echo':40} # replace 38 and 40 with your GPIO pins (BOARD setup)
SEN = UltrasonicSensor(pins,'mySensor',True) # set verbose=False to make it shut up
test = SEN.measure() # takes a single measurement
dat = SEN.multimeasure(inte... |
''' -- imports from installed packages -- '''
from django.contrib.auth.models import User
from django.template.defaultfilters import slugify
from django.shortcuts import render_to_response, render
from django.template import RequestContext
import mongokit
''' -- imports from application folders/files -- '''
from gnow... |
'''
Created on 19/12/2013
@author: Nacho
'''
class Indicator(object):
#Simulated Enum Values
INCREASE = "increase"
DECREASE = "decrease"
IRRELEVANT = "irrelevant "
#Possible topics
TOPIC_CLIMATE_CHANGE = "TOP1"
TOPIC_GEOGRPH_AND_SOCIO_ECONOMIC = "TOP2"
TOPIC_LAND_AND_GENDER = "TOP4"... |
#!/usr/bin/env python
# encoding: utf-8
"""
docker_connect.py
Created by Mat Appelman on 2013-04-18.
Copyright (c) 2013 __MyCompanyName__. All rights reserved.
"""
import sys
import os
import unittest
import sys
import sys
from subprocess import PIPE, STDOUT, Popen, CalledProcessError
from threading import Thread
i... |
''' -- imports from installed packages -- '''
from django.contrib.sites.models import Site
from django.contrib.auth.models import User
from django.contrib.auth.decorators import login_required
from django.template import RequestContext
from django.template.loader import render_to_string
from django.template.defaultfilt... |
# -*- coding: utf-8 -*-
"""Tests for go.apps.multi_surveys.vumi_app"""
import uuid
from twisted.internet.defer import inlineCallbacks, returnValue
from vumi.message import TransportUserMessage
from vumi.tests.utils import LogCatcher
from go.vumitools.tests.utils import AppWorkerTestCase
from go.apps.multi_surveys.... |
from ..field import Field
from ..exceptions import FieldValidationError, InvalidDictModelError
class Dict(Field):
def __init__(self, fields=None, *args, **kwargs):
self.fields = self._validate_fields(fields)
super().__init__(*args, **kwargs)
def _validate_fields(self, fields):
if fie... |
from django.template.defaultfilters import slugify
from django.utils.datastructures import SortedDict
import os
import traceback
import pickle
from limbo.classes import Singleton
import logging
__author__ = 'gdoermann'
logger = logging.getLogger(__file__)
class Properties(dict):
def __init__(self, filepath):
... |
import slice_miseq
import sam_handler
import os, sys
import subprocess
import Utility
import logging
import argparse
import pool_traceback
import re
import time
import traceback
LOGGER = logging.getLogger(__name__)
LOGGER.setLevel(logging.DEBUG)
console_handler = logging.StreamHandler(sys.stdout)
formatter = logging.F... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.