text stringlengths 12 6.59M |
|---|
###############################################################################
# pyrpl - DSP servo controller for quantum optics with the RedPitaya
# Copyright (C) 2014-2016 Leonhard Neuhaus (neuhaus@spectro.jussieu.fr)
#
# This program is free software: you can redistribute it and/or modify
# it under t... |
import re
import unittest
from urlparse import urlsplit, urlunsplit
from django.http import QueryDict
from django.db import transaction
from django.core import mail
from django.core.management import call_command
from django.test import _doctest as doctest
from django.test.client import Client
normalize_long_ints = l... |
import argparse
import configparser
import glob
import logging
import os
import pathlib
import re
import shutil
import subprocess
import sys
import traceback
import zipfile
import hashlib
# A script to execute a main class of a Maven artifact
# which is available locally or from Maven Central.
#
# Works using the mave... |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
#... |
import time
import datetime
import stripe
import hashlib
import redis
import mongoengine as mongo
from django.db import models
from django.db import IntegrityError
from django.db.utils import DatabaseError
from django.db.models.signals import post_save
from django.db.models import Sum, Avg, Count
from django.conf impor... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
Furtive. Deal with it!
"""
import os
import hashlib
import sys
import sqlite3
class Furtive:
"""
Furtive: file integrity verification system.
"""
def __init__(self, dir, verbose=False):
self.dir = dir
self.verbose = verbose... |
import re
import sys
import codecs
expressionData = sys.argv[1]
clinicalAnnotations = sys.argv[2]
dataOutFile = sys.argv[3]
metedataOutFile = sys.argv[4]
drugData = sys.argv[5]
profilingData = sys.argv[6]
#write outFile, clinical on left expression on Right
DrugDataDict = {}
with open(drugData, 'r') as f :
firs... |
from abc import ABCMeta
from urllib import quote
from urllib2 import urlopen
from xml.etree import cElementTree as ET
from python_purify.exceptions import PurifyFormatException, PurifyException, \
PurifyExceptionTooLarge
try:
from simplejson import loads, dumps
except ImportError:
from json import loads, ... |
# calysto - general support utilities for Jupyter
#
# Copyright (c) Douglas S. Blank <doug.blank@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
... |
from django.core.exceptions import Http404, ObjectDoesNotExist
from django.core.template import Context, loader
from django.models.core import sites
from django.utils import httpwrappers
def shortcut(request, content_type_id, object_id):
from django.models.core import contenttypes
try:
content_type = c... |
# -*- coding: utf-8 -*-
import re
from django import forms
from django.contrib import auth
from django.utils.translation import ugettext as _
from apps.authentication.models import OnlineUser, Position
from apps.profiles.models import Privacy
class ProfileForm(forms.ModelForm):
class Meta(object):
mode... |
# -*- mode: python; coding: utf-8 -*-
# Copyright (c) 2018 Radio Astronomy Software Group
# Licensed under the 2-clause BSD License
"""
Class for reading and writing casa measurement sets.
Requires casacore.
"""
import numpy as np
import os
import warnings
from astropy.time import Time
from .uvdata import UVData
fro... |
from decimal import Decimal
from datetime import timedelta
from apps.projects.models import ProjectPlan, ProjectCampaign
from django.core.exceptions import ValidationError
from django.test import TestCase, RequestFactory
from django.contrib.contenttypes.models import ContentType
from django.utils import timezone
from r... |
# -*- mode: python; coding: utf-8 -*-
# Copyright (c) 2018 Radio Astronomy Software Group
# Licensed under the 2-clause BSD License
"""
Class for reading and writing casa measurement sets.
Requires casacore.
"""
import numpy as np
import os
import warnings
from astropy.time import Time
from .uvdata import UVData
fro... |
#
# repos.py : various utilities for interacting with the _repos module
#
######################################################################
#
# Copyright (c) 2000-2004 CollabNet. All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this d... |
""" License
MIT License
Copyright (c) 2017 OpenAdaptronik
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 rights
to use, copy, modify, merge,... |
from tempfile import NamedTemporaryFile
import warnings
import numpy as np
import numpy.testing as nptest
from neuroimaging.testing import *
from neuroimaging.core.image import image
from neuroimaging.utils.tests.data import repository
from neuroimaging.io.api import load_image, save_image
from neuroimaging.core.api... |
from typing import Optional
import requests
from lxml import etree
from xml.sax.saxutils import escape
# import defusedxml.ElementTree as etree
class Office365:
"""
Class to authenticate Office 365 Sharepoint
"""
def __init__(self, share_point_site, username, password):
# type: (str, str, ... |
import datetime
import json
from copy import deepcopy
__version__ = '0.0'
class Color(object):
"""
A color type. Internally stored as RGB, and does not support transparency.
"""
def __init__(self, rgb):
if not isinstance(rgb, tuple):
rgb = tuple(rgb)
self.rgb = rgb
d... |
"""
Some CoordinateMaps have input_coords that are 'array' coordinates, hence
the function of the CoordinateMap can be evaluated at these 'array' points.
This module tries to make these operations easier by defining a class
ArrayCoordMap that is essentially a CoordinateMap and a shape.
This class has two properties: ... |
from paramset_pyspecdata import myparams
from os import listdir,environ
#if paramset.myparams['figlist_type'] == 'figlistl':
if myparams['figlist_type'] == 'figlistl':
environ['ETS_TOOLKIT'] = 'qt4'
import matplotlib; matplotlib.use('Agg')
from pylab import *
import textwrap
import matplotlib.transforms as mtra... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Compares theorerical scattering curves generated from PDB structure files to
experimental x-ray and neutron scattering curves.
PDBs are converted into sphere models and the Debye equation used to compute
the theoretical curves. The original sphere models are surrounded... |
# -*- coding: utf-8 -*-
"""The initialization file for the Pywikibot framework."""
#
# (C) Pywikibot team, 2008-2018
#
# Distributed under the terms of the MIT license.
#
from __future__ import absolute_import, unicode_literals
__version__ = __release__ = '3.1.dev0'
__url__ = 'https://www.mediawiki.org/wiki/Manual:Pyw... |
"""
PyWinCFFI
=========
The root of the pywincffi package. See the ``README`` and documentation for
help and examples.
"""
__version__ = (0, 4, 0)
|
import functools
import os
import socket
import tempfile
import time
from six import BytesIO
import paramiko
from celery.utils.log import get_task_logger
logger = get_task_logger(__name__)
__all__ = ['SSHConnection']
SSHException = paramiko.SSHException
def connection_required(f):
"""
Connect to remote ho... |
#!/usr/bin/env python
from numpy import double, fromfile, loadtxt
class LoadMatrix:
def __init__(self):
pass
def load_numbers(self, filename):
return loadtxt(filename).T
def load_dna(self, filename):
fh=open(filename, 'r');
matrix=[]
for line in fh:
matrix.append(line[:-1])
return matrix
def... |
from __future__ import with_statement
import datetime
import random
import hashlib
import base64
from decimal import Decimal
from django.db import models
from django.contrib.sites.models import Site
from django.contrib.auth.models import User
from django_bitcoin.utils import *
from django_bitcoin.utils import bitcoi... |
# -*- coding: utf-8 -*-
from django.test import TestCase
from django.test.client import Client
from django.test.utils import override_settings
from django.contrib.auth.models import User
from django.conf import settings
from django.core.urlresolvers import reverse
from django.utils.translation import gettext as _
fro... |
#! /usr/bin/python3
import sys
import pdb
import os
import argparse
import xml_utils as u
import datetime
from collections import defaultdict
from argparse import RawTextHelpFormatter
# from ordereddefaultdict import OrderedDefaultdict
##------------------------------------------------------------
## can be called ... |
r"""
_
(_) _ __
| | /'_`\ /'__`\
| |( (_) )( ___/
_ | |`\___/'`\____)
( )_| |
`\___/'
joe generates .gitignore files from the command line for you
Usage:
joe (ls | list)
joe [NAME...]
joe (-h | --help)
joe --version
Options:
-h --help Show this screen.
--version Show ... |
# -*- coding: utf-8 -*-
from django.db import models
from django.contrib.auth.models import User
from django.db import connection
from place import Place
import answer
import current
import prior
class KnowledgeUpdater:
@staticmethod
def on_answer_save(a, knowledge_retriever=None, in_memory=False):
i... |
"""Binary-type primitives and containers.
Some parts of a complex data structure are described at a granularity that is
smaller than the atomic "byte" provided by an architecture. This module provides
binary primitives to assist with those types of definitions. Within this module
are 3 basic types. The atomic type tha... |
#
# Author : Manuel Bernal Llinares
# Project : trackhub-creator
# Timestamp : 07-09-2017 11:24
# ---
# © 2017 Manuel Bernal Llinares <mbdebian@gmail.com>
# All rights reserved.
#
"""
This pipeline creates a trackhub for a PRIDE project, based on the information provided via a JSON formatted file, as it
can be ... |
'''
Copyright (c) 2016 The Hyve B.V.
This code is licensed under the GNU Affero General Public License (AGPL),
version 3, or (at your option) any later version.
'''
import unittest
import logging
import sys
from import_data_validator.hugoEntrezMap import parse_ncbi_file
from import_data_validator import validateData
f... |
import re
import socket
import threading
import time
import types
import logging
import gmetric
from subprocess import call
# from xdrlib import Packer, Unpacker
log = logging.getLogger(__name__)
try:
from setproctitle import setproctitle
except ImportError:
setproctitle = None
from daemon import Daemon
__... |
#!/usr/bin/env python3
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'lib'))
from tensorflow.contrib import rnn as crnn
from tensorflow.python.ops import rnn
import glob
import math
import numpy as np
import queue
import socket
import subprocess
import tensorflow as tf
import thre... |
#!/usr/bin/env python
#
# testcase.py: Control of test case execution.
#
# Subversion is a tool for revision control.
# See http://subversion.tigris.org for more information.
#
# ====================================================================
# Copyright (c) 2000-2004 CollabNet. All rights reserved.
#
# This ... |
"""
Wps Request
-----------
"""
# Author: Jachym Cepicky
# http://les-ejk.cz
# jachym at les-ejk dot cz
# Lince:
#
# Web Processing Service implementation
# Copyright (C) 2006 Jachym Cepicky
#
# This program is free software; you can redistribute it and/or modify
# it under the terms o... |
"""
Filter out unwanted couples of variables and generate the final input file
Author : Diviyan Kalainathan
Date : 28/06/2016
"""
import numpy
import csv
import os
import threading
import time
import sys
inputfolder = 'output/'+sys.argv[1]+'/'
var_info = 'input/Variables_info.csv'
verbose = False
max_threads = int(sy... |
# -*- coding:utf-8 -*-
from django.shortcuts import render, get_object_or_404
from django.views.generic import View
from django.core.paginator import Paginator
from django.db.models import Q
from utils.mixins import CsrfExemptMixin
from tcase.models import Execute
from tresult.models import Summary
from utils.paginat... |
import os
import yaml
from fabric.api import prompt
from django_deployer.helpers import (
DEPLOY_YAML,
_create_deploy_yaml,
_validate_django_settings,
_validate_project_name,
_read_file,
_green,
_yellow,
_red,
)
from django_deployer.providers import PROVIDERS
def init(provider=None)... |
#!/usr/bin/env python
"""
@brief A class for testing if a point is inside a shape
@author pletzer@psu.edu
"""
import numpy
class Inside:
def __init__(self, shape):
"""
Constructor
@param shape instance of Shape
@param polys connectivty
"""
points, polys, count = ... |
#!/usr/bin/env python3
#
# Electron Cash - lightweight Bitcoin client
# Copyright (C) 2019 Axel Gembe <derago@gmail.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,... |
from __future__ import absolute_import
from decimal import Decimal
from django.core import mail
from corehq.apps.accounting.tests.test_invoicing import BaseInvoiceTestCase
from corehq.apps.accounting import utils, tasks
from corehq.apps.accounting.invoicing import DomainWireInvoiceFactory
from corehq.apps.accounting.m... |
"""
BezTools.py v 1.12 April 27 2106
Utilities for converting between T2 charstrings and the bez data format.
Used by AC and focus/CheckOutlines.
"""
__copyright__ = """Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved.
"""
import sys
import re
import time
import os
import FDKUtil... |
# Copyright (c) 2006-2012 Filip Wasilewski <http://en.ig.ma/>
# Copyright (c) 2012-2016 The PyWavelets Developers
# <https://github.com/PyWavelets/pywt>
# See COPYING for license details.
"""
The thresholding helper module implements the most popular signal thresholding
functions.
"""
from __f... |
#!/usr/bin/python3 -Es
# -*- coding: utf-8 -*-
##################################################################################
# Access information about binary and source packages in multiple
# (independent) apt-repositories utilizing libapt / python-apt/
# apt_pkg without the need to change the local system and it... |
# -*- coding: utf-8 -*-
############################################################################################
#
# Zoook e-sale for OpenERP, Open Source Management Solution
# Copyright (C) 2011 Zikzakmedia S.L. (<http://www.zikzakmedia.com>). All Rights Reserved
# $Id$
#
# This program is free softwa... |
#!/usr/bin/python
#
# Copyright 2014 Marta Rodriguez.
#
# 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... |
from django.test import TestCase
from corehq.apps.domain.models import Domain
from corehq.apps.userreports.models import ReportConfiguration
from corehq.apps.userreports.dbaccessors import get_report_configs_for_domain, \
get_all_report_configs, get_number_of_report_configs_by_data_source
class DBAccessorsTest(Te... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Adds a sequential number of users into a test database
with username: newusern and password newusern
Not for production usage
"""
import MySQLdb
hostname = # FILL IN
username = # FILL IN
password = # FILL IN
# Simple routine to run a query on a database and prin... |
import io
from aenum import Enum, auto
import matplotlib.dates as mdates
import pint
from matplotlib import pyplot
# Unit registry
ureg = pint.UnitRegistry()
class ConnectionType(Enum):
F_1_25 = auto()
F_2 = auto()
T2 = auto()
def __str__(self):
return self.name.replace('F_', '').replace('_', '.')
cl... |
# -*- coding:utf-8 -*-
import os
import uuid
from six.moves.urllib.parse import urljoin
from django.conf import settings
from django.utils.deconstruct import deconstructible
from django.core.files.storage import Storage
from qiniu import Auth, BucketManager, put_data
@deconstructible
class QiniuStorage(Storage):
... |
from collections import defaultdict, namedtuple
from copy import copy
from datetime import datetime
import json
import itertools
from couchdbkit.exceptions import ResourceConflict, ResourceNotFound
from casexml.apps.phone.exceptions import IncompatibleSyncLogType
from corehq.toggles import LEGACY_SYNC_SUPPORT
from core... |
from __future__ import print_function
import unittest
import sys, os, time
from ctypes import *
from czmq import *
# http://python3porting.com/problems.html#common-migration-problems
PY3 = sys.version_info > (3,)
if PY3:
# Python 3 does not have a "cmp" builtin.
def cmp(a, b):
return (a > b) - (a < b)... |
#
# Hiveconf configuration framework
#
# Copyright (C) 2003 Peter Astrand <peter@cendio.se>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation; version 2.1
# of the License.
#
# This lib... |
import copy
from arangodb.api import Collection
from arangodb.index.api import Index
from arangodb.index.general import BaseIndex
from arangodb.orm.fields import ModelField
from arangodb.query.advanced import Query, Traveser
from arangodb.query.simple import SimpleQuery, SimpleIndexQuery
class LazyQueryset(object):
... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
from aldryn_apphooks_config.fields import AppHookConfigField
from aldryn_apphooks_config.managers.parler import AppHookConfigTranslatableManager
from cms.models import CMSPlugin, PlaceholderField
from django.conf import se... |
import itertools
import logging
import struct
from abc import ABCMeta, abstractproperty
from abc import abstractmethod
from datetime import datetime
from itertools import groupby
from uuid import UUID
import csiphash
import six
from django.conf import settings
from django.db import connections, InternalError, transact... |
"""Data iterators for common data formats"""
from __future__ import absolute_import
from collections import OrderedDict, namedtuple
import sys
import ctypes
import logging
import threading
import numpy as np
from .base import _LIB
from .base import c_array, c_str, mx_uint, py_str
from .base import DataIterHandle, NDAr... |
"""
arcgis-sdk
~~~~~~~~~~
Python SDK for Arcgis API
:copyright: (c) 2017 mongkok
:license: MIT, see LICENSE for more details
"""
import requests
__version__ = '0.0.6'
ARCGIS_API_URL = 'https://www.arcgis.com/sharing/rest/'
class ArcgisAPI(object):
"""
Docs: https://resources.arcgis.com/en/help/arcgis-rest... |
# -*- encoding: utf-8 -*-
"""
@authors: Andrés Felipe Calderón andres.calderon@correlibre.org
Sebastián Ortiz V. neoecos@gmail.com
SIIM2 Server is the web server of SIIM2 Framework
Copyright (C) 2013 Infometrika Ltda.
This program is free software: you can redistribute it and/or modify
it under the ... |
# -*- coding: utf-8 -*-
from cms.models import PlaceholderField, CMSPlugin
from cmsplugin_filer_image.models import ThumbnailOption
from django.contrib.auth.models import User
from django.contrib.sites.models import Site
from django.core.urlresolvers import reverse
from django.db import models
from django.utils import ... |
import json
import pytz
import re
import requests
from corehq.apps.sms.models import SQLSMSBackend
from corehq.messaging.smsbackends.airtel_tcl.exceptions import AirtelTCLError, InvalidDestinationNumber
from corehq.messaging.smsbackends.airtel_tcl.forms import AirtelTCLBackendForm
from corehq.apps.sms.models import SMS... |
from typing import List, Optional, Tuple
import os
import shutil
import random
import time
import numpy as np
import cloudpickle
import torch
import torch.nn as nn
from torch.nn import functional as F
from torch.autograd import Variable
from torch.optim import Adam, lr_scheduler
from allennlp.modules.elmo import Elmo,... |
"""
Easily manage a complex pipeline with python.
============================================================================
AUTHOR: Michael D Dacre, mike.dacre@gmail.com
ORGANIZATION: Stanford University
LICENSE: MIT License, property of Stanford, use as you wish
VERSION: 1.0
CREATED... |
"""Stuff for serializing data."""
import abc
import collections
import copy
import weakref
import bitstring
from binobj import fields
from binobj import errors
class _NamedSentinel: # pylint: disable=too-few-public-methods
"""Hack class for creating sentinel values that show their name in repr."""
def __... |
# -*- encoding: utf-8 -*-
"""
@authors: Andrés Felipe Calderón andres.calderon@correlibre.org
Sebastián Ortiz V. neoecos@gmail.com
SIIM2 Server is the web server of SIIM2 Framework
Copyright (C) 2013 Infometrika Ltda.
This program is free software: you can redistribute it and/or modify
it under the ... |
import datetime
from functools import update_wrapper
from django.contrib import admin, messages
from django.contrib.admin.helpers import AdminErrorList, AdminForm
from django.contrib.auth import get_permission_codename
from django.contrib.auth.admin import csrf_protect_m
from django.core.exceptions import PermissionDe... |
import tensorflow as tf
tf.set_random_seed(777)
class GAN:
def __init(self, s, batch_size=64,
input_height=28, input_width=28, channel=1, z_num=128, sample_num=9, sample_size=16,
output_height=28, output_width=28, n_input=784, n_classes=10,
n_hidden_layer_1=128, n_h... |
import requests
import json
class LoginRequired(Exception):
def __str__(self):
return 'Please login first.'
class Client(object):
"""class to interact with qBittorrent WEB API"""
def __init__(self, url):
self.url = url
if not url.endswith('/'):
self.url = url + '/'
... |
# -*- coding: utf-8 -*-
"""
Generate the taxi flow in Chicago.
Created on Mon Jan 25 16:19:18 2016
@author: kok
"""
from Crime import Tract
from shapely.geometry import Point
import csv
import numpy as np
import os.path
here = os.path.dirname(os.path.abspath(__file__))
def getTaxiFlow(leaveOut = -1, normali... |
# -*- coding: utf-8 -*-
# Copyright 2017 IBM RESEARCH. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... |
import json
import re
import vim
import pep8
import pyflakes.api
from collections import namedtuple
sign_re = re.compile(r'id=(\d+)\s+name=pycheck')
Message = namedtuple('Message', ['line', 'col', 'message', 'type'])
class Pep8Report(pep8.BaseReport):
def __init__(self, options):
pep8.BaseReport.__init__... |
# This code is part of Qiskit.
#
# (C) Copyright IBM 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... |
# -*- coding:utf-8 -*-
"""
Verion: 1.0
Author: zhangjian
Site: http://iliangqunru.com
File: 1.py
Time: 2017/7/16 20:14
"""
import logging
import socket
import threading
import sys
level = logging.DEBUG
format = '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
datefmt = '%Y-%m-%d %H:%M'
logging.basicConfig(... |
"""Core logic of PyTOPKAPI.
The `run` function in this module contains the logic to run a TOPKAPI
simulation based on the parameters specified in an INI file.
"""
#General module importation
import os.path
from configparser import SafeConfigParser
import h5py
import numpy as np
import tables as h5
#Personnal modul... |
"""Application repository."""
import datetime
from dnstwister import db
import storage.interfaces
# Check the database we're using implements the interface.
storage.interfaces.instance_valid(db)
def register_domain(domain):
"""Register a new domain for reporting.
If the domain is already registered this i... |
"""Core logic of PyTOPKAPI.
The `run` function in this module contains the logic to run a TOPKAPI
simulation based on the parameters specified in an INI file.
"""
#General module importation
import os.path
import functools
import multiprocessing as mp
from configparser import SafeConfigParser
from concurrent.futures... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# flake8: noqa
__title__ = 'pytube'
__version__ = '6.1.11'
__author__ = 'Nick Ficano'
__license__ = 'MIT License'
__copyright__ = 'Copyright 2015 Nick Ficano'
from .api import YouTube
# Set default logging handler to avoid "No handler found" warnings.
import logging
try: ... |
#!/usr/bin/python
from __future__ import unicode_literals
import json
import re
import sys
import unicodedata
from datetime import datetime
from pytvmaze import endpoints
from pytvmaze.exceptions import *
try:
# Python 3 and later
from urllib.request import urlopen
from urllib.parse import quote as url_... |
# functions for one-dimensional and two-dimensional fine-mapping
# shotgun stochastic search
# 11 april 2017
import scipy
import numpy
import math
import itertools as it
import operator
import random
import collections
from scipy import optimize
import postgap.Globals
import cPickle as pickle
from postgap.DataModel ... |
# -*- mode: python; coding: utf-8 -*
# Copyright (c) 2019 Radio Astronomy Software Group
# Licensed under the 2-clause BSD License
from __future__ import print_function, division, absolute_import
import numpy as np
import os
import warnings
import copy
import six
from six.moves import map
from .uvbase import UVBase
f... |
'''
A module of utilities to work with IP addresses in a faster way
'''
import ipaddress
def exclude_address(
base_net: ipaddress._BaseNetwork,
exclude_net: ipaddress._BaseNetwork
):
'''
Function to exclude a subnetwork from another, returning a generator that yields
all values that correspond to the ba... |
from datetime import datetime, timedelta
from uuid import uuid4
from cqlengine import Model, ValidationError
from cqlengine import columns
from cqlengine.management import create_table, delete_table
from cqlengine.tests.base import BaseCassEngTestCase
class TestSetModel(Model):
partition = columns.UUID(primary... |
import sublime, sublime_plugin
import subprocess
import os
class gotestsCommand(sublime_plugin.TextCommand):
def run(self, edit):
settings = sublime.load_settings("GoTests.sublime-settings")
gopath = settings.get("GOPATH", "")
if os.environ.get("GOPATH") == None:
if gopath != "":
# Set $GOPATH in this sh... |
# -*- coding: utf-8 -*-
"""
pyvisa-py.tcpip
~~~~~~~~~~~~~~~
TCPIP Session implementation using Python Standard library.
:copyright: 2014 by PyVISA-py Authors, see AUTHORS for more details.
:license: MIT, see LICENSE for more details.
"""
import random
import socket
import select
import time
fro... |
"""
Backend for unit-tests, using the Python :mod:`Queue` module.
"""
from Queue import Queue
from carrot.backends.base import BaseMessage, BaseBackend
import time
import itertools
mqueue = Queue()
class Message(BaseMessage):
"""Message received from the backend.
See :class:`carrot.backends.base.BaseM... |
###########################################################
#
# Copyright (c) 2005-2008, Southpaw Technology
# All Rights Reserved
#
# PROPRIETARY INFORMATION. This software is proprietary to
# Southpaw Technology, and is not to be reproduced, transmitted,
# or disclosed in any way without written ... |
import datetime
import collections
from czech_holidays import Holidays
from dateutil.relativedelta import relativedelta
from pyvodb import tables
DAY = datetime.timedelta(days=1)
WEEK = DAY * 7
MONTH_NAMES = ('? January February March April May June July August September '
'October November December').split()
D... |
import pandas
from ..utils.utils import merge_dicts
from .legend import Legend
from .legend_list import LegendList
from .popup import Popup
from .popup_list import PopupList
from .source import Source
from .style import Style
from .widget import Widget
from .widget_list import WidgetList
from ..utils.utils import ext... |
###########################################################
#
# Copyright (c) 2005, Southpaw Technology
# All Rights Reserved
#
# PROPRIETARY INFORMATION. This software is proprietary to
# Southpaw Technology, and is not to be reproduced, transmitted,
# or disclosed in any way without written permi... |
# Copyright (c) 2016 Ivan Magazinnik
# Copyright (C) 2015 Intel Corporation
# Copyright (C) 2010 Mark Mc Mahon
# 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 ... |
# encoding: utf-8
from __future__ import print_function, unicode_literals
import re
from collections import namedtuple
class CqlSplitter(object):
"""
Makeshift CQL parser that can only split up multiple statements.
C* does not accept multiple DDL queries as a single string, as it can with
DML queri... |
#
# (C) Copyright 2003-2004 Jacek Konieczny <jajcus@jajcus.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License Version
# 2.1 as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be u... |
#!/usr/bin/env python
# encoding: utf-8
"""
zotero.py
Created by Stephan Hügel on 2011-02-28
Copyright Stephan Hügel, 2011
License: http://www.gnu.org/licenses/gpl-3.0.txt
"""
__version__ = '0.4'
import sys
import os
import urllib
import urllib2
import feedparser
import xml.etree.ElementTree as xml
import zotero_ap... |
"""Entry point script; implements CLI."""
import argparse
import msvcrt
import os
import pickle
import sys
from PyInquirer import prompt
import questions
from src.pytorch_impl import constants as pyt_constants
from src.pytorch_impl.src import classify as pyt_classify
from src.pytorch_impl.src import train as pyt_tra... |
# -*- coding: utf-8 -*-
# pylint: disable=R0904
"""
zotero.py
Created by Stephan Hügel on 2011-02-28
This file is part of Pyzotero.
The MIT License (MIT)
Copyright (c) 2015 Stephan Hügel
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files... |
import unittest
import json
import numpy as np
import great_expectations as ge
class TestDistributionalExpectations(unittest.TestCase):
def __init__(self, *args, **kwargs):
super(TestDistributionalExpectations, self).__init__(*args, **kwargs)
self.D = ge.read_csv('./tests/test_sets/distributional... |
# -*- coding: utf-8 -*-
# pylint: disable=R0904
"""
zotero.py
Created by Stephan Hügel on 2011-02-28
This file is part of Pyzotero.
The MIT License (MIT)
Copyright (c) 2015 Stephan Hügel
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.