text stringlengths 12 6.59M |
|---|
from abusehelper.core import bot, events
from abusehelper.contrib.tailbot.tailbot import TailBot
import time
def convert_date(value):
try:
ts = time.strptime(value, "%d/%b/%Y:%H:%M:%S +0000")
ts = time.strftime("%Y-%m-%d %H:%M:%S UTC", ts)
except ValueError:
ts = value
return ts
... |
# MIT License
# Copyright (c) 2017 MassChallenge, Inc.
from datetime import datetime
from pytz import utc
import swapper
from django.conf import settings
from django.core.validators import RegexValidator
from django.db import models
from django.db.models import Q
from sorl.thumbnail import ImageField
from django.util... |
# MIT License
# Copyright (c) 2017 MassChallenge, Inc.
from datetime import datetime
from pytz import utc
import swapper
from django.conf import settings
from django.core.validators import RegexValidator
from django.db import models
from django.db.models import Q
from sorl.thumbnail import ImageField
from accelerato... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: sw=4:ts=4:expandtab
"""
mezmorize.utils
~~~~~~~~~~~~~~~
Provides mezmorize utility functions
"""
from __future__ import (
absolute_import, division, print_function, unicode_literals)
from os import getenv
from subprocess import call
from copy import... |
# -*- coding: utf-8 -*-
from __future__ import print_function
import argparse
import datetime
import hashlib
import logging
import os
import os.path
import shutil
import subprocess
import sys
import tempfile
from midas import RankEntry
from midas.compat import GzipFile
logger = logging.getLogger(__name__)
def run_... |
import random
import math
import sys
import fractions
coprimes = 0
cofactors = 0
max_random_number = 121
for i in range(sys.maxsize):
try:
x = random.randint(1, max_random_number)
y = random.randint(1, max_random_number)
gcd = fractions.gcd(x, y)
if gcd == 1:
coprime... |
"""
Thin wrapper around Python's (atrocious) logging module.
As a module, use `rave.log.get(__name__)` to get the logger for your module.
`rave.log.Logger` objects have the following API:
- inform(message, *args, **kwargs): log message on INFO level. Message will be formatted using str.format according to the argumen... |
# -*- coding: utf-8 -*-
"""
Created on Fri Nov 25 15:10:31 2016
"""
from FreeCAD import Base
import Part
import numpy as np
import itertools
import random
import time
import dill
import zipfile
from enum import Enum
from numpy.lib.scimath import sqrt
# ---
# Helper functions for outputs in Spectral Analysis
# ---
d... |
import atexit
import binascii
import functools
import hashlib
import operator
import os
import time
import numpy
import warnings
from numpy.linalg import LinAlgError
import cupy
from cupy import core
from cupy import cuda
from cupy.cuda import curand
from cupy.cuda import device
from cupy.random import _kernels
from ... |
#!/usr/bin/env python
# vim:expandtab shiftwidth=4 softtabstop=4 tabstop=8
from rblwatch import RBLSearch
import socket
try:
hostname = socket.gethostname()
for response in socket.getaddrinfo(hostname, None, 0, 1):
ip = response[4][0]
searcher = RBLSearch(ip)
listed = searcher.listed
... |
'''Exceedingly simple interface for programmatically generating reStructuredText
documents.'''
import sys
import textwrap
class ReStUtilException(Exception) : pass
class ReStBase(object) :
'''Base reStructuredText component containing text, should be subclassed with
*build_text* method overridden. Componen... |
import pandas as pd
import numpy as np
from pandas import Series,DataFrame
import csv
import matplotlib.pyplot as plt
from pylab import *
df = pd.read_csv('raycom-people.csv')
df[u'HireDate']= pd.to_datetime(df[u'HireDate'],format='%Y-%m-%d')
df1 = df.set_index('HireDate')
j=1
list = [len(df1[str(2006)]),];
for i in ... |
#
# Copyright (c) 2009-2010 rPath, Inc.
#
# This program is distributed under the terms of the Common Public License,
# version 1.0. A copy of this license should have been distributed with this
# source file in a file called LICENSE. If it is not present, the license
# is always available at http://www.rpath.com/perma... |
'''SSL with SNI-support for Python 2.
This needs the following packages installed:
* pyOpenSSL (tested with 0.13)
* ndg-httpsclient (tested with 0.3.2)
* pyasn1 (tested with 0.1.6)
To activate it call :func:`~urllib3.contrib.pyopenssl.inject_into_urllib3`.
This can be done in a ``sitecustomize`` module, or at any ot... |
import asyncio
import discord
import random
import math
from operator import itemgetter
from discord.ext import commands
from Cogs import ReadableTime
from Cogs import Nullify
from Cogs import DisplayName
# This is the Help module. It replaces the built-in help command
class Help:
# Init with the bot refe... |
import asyncio
import discord
import random
import math
import os
from datetime import datetime
from operator import itemgetter
from discord.ext import commands
from Cogs import ReadableTime
from Cogs import Nullify
from Cogs import DisplayName
from Cogs import Message
from Cogs import FuzzySearch
def ... |
"""
Django settings for tndata_backend 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/
"""
import os
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
AD... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from gevent import monkey
monkey.patch_all()
import json
import gc
import traceback
from datetime import datetime
from pandas import DataFrame
from sqlalchemy import create_engine
from sqlalchemy.sql import text
from sqlalchemy.orm import sessionmaker
from mining.utils ... |
# -*- coding: utf-8 -*-
# MinIO Python Library for Amazon S3 Compatible Cloud Storage, (C)
# 2020 MinIO, 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/lic... |
#!/usr/bin/env python3
from models import Location, Stop, POI, Address
from models import TimeAndPlace, Platform, RealtimeTime
from models import Trip, Ride, RideSegment, Coordinates, TicketList, TicketData
from models import Line, LineType, LineTypes, Way, WayType, WayEvent
from datetime import datetime, timedelta
imp... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Hive Netius System
# Copyright (c) 2008-2017 Hive Solutions Lda.
#
# This file is part of Hive Netius System.
#
# Hive Netius System is free software: you can redistribute it and/or modify
# it under the terms of the Apache License as published by the Apache
# Foun... |
from copy import deepcopy
def is_power_2(number):
return number > 0 and (number & (number - 1)) == 0
def true_or_assigned(val):
if val is None or val == '' or (isinstance(val, bool) and not val):
return 0
else:
return 1
class Component:
UNIVERSAL_PROPERTIES = {
... |
#
# Copyright (c) 2005-2006 rPath, Inc.
#
# All Rights Reserved
#
import database
import re
import time
from mint import jobs
from mint import mint_error
from conary import versions
from conary.deps import deps
class GroupTroveNameError(mint_error.MintError):
def __str__(self):
return "Bad name for Gro... |
# Natural Language Toolkit: Probability and Statistics
#
# Copyright (C) 2001 University of Pennsylvania
# Author: Edward Loper <edloper@gradient.cis.upenn.edu>
# Trevor Cohn <tacohn@cs.mu.oz.au> (additions)
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
#
# $Id$
"""
Classes for represe... |
# -*- coding: utf-8 -*-
###############################################################################
#
# ODOO (ex OpenERP)
# Open Source Management Solution
# Copyright (C) 2001-2015 Micronaet S.r.l. (<http://www.micronaet.it>)
# Developer: Nicola Riolini @thebrush (<https://it.linkedin.com/in/thebrush>)
# This pro... |
#!/usr/bin/env python
#
#
#
import datetime
import sys
import logging
import urllib
import libinjection
import tornado.httpserver
import tornado.ioloop
import tornado.web
import tornado.wsgi
import wsgiref.simple_server
def breakapart(s):
""" attempts to add spaces in a SQLi so it renders nicely on the webpage
... |
#!/usr/bin/env python
#
#
#
import sys
import logging
import urllib
import libinjection
import tornado.httpserver
import tornado.ioloop
import tornado.web
import tornado.wsgi
import wsgiref.simple_server
class PageHandler(tornado.web.RequestHandler):
def get(self, pagename):
if pagename == '':
... |
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from database import queries, entities
from datetime import datetime
date_last_email_was_sent = datetime.now()
has_email_been_sent = True
def send_email(sender_name, sender_email, sender_password, recipients):
me... |
from __future__ import annotations
from argparse import ArgumentError
import functools
from dataclasses import dataclass
from typing import Any, Callable, List, Optional, Type, Union
from expression import Case
from .types import Union as FsUnion, FSharpRef, Record
Constructor = Callable[..., Any]
EnumCase = List[... |
# -*- coding: utf-8 -*-
#
# 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 requir... |
# 20:15:05:11:32:44 - itead - radar
# 30:14:11:21:15:80 - HC-06 - redbot
import time
from bluetooth import *
import matplotlib.pyplot as plt
# Generate the master table
# masterTable = [[0 for x in range(10)] for x in range(10)]
all_results_x = list()
all_results_y = list()
WAIT_TIME = 10
RADAR_MAC = "20:15:05:11:32... |
# -*- coding: utf-8 -*-
import pandas as pd
import numpy as np
from sklearn.metrics import roc_auc_score
import xgboost as xgb
from hyperopt import hp, fmin, tpe, STATUS_OK, Trials
from sklearn.model_selection import StratifiedShuffleSplit, StratifiedKFold
from sklearn.pipeline import Pipeline
from sklearn.preprocessin... |
#!/usr/bin/python
# -*- coding: utf8 -*-
#Useful module for grabbing data from Amazon Redshift and manipulating it
# - Most functions either have a docstring or are fairly self explanatory
# - There's another module needed called login but that contains a password
# so isn't listed here.
# - All functions require a cu... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
'''
Usage: python TimeframeCalculations.py
Requirements: Numpy, Matplotlib
This script requires a sorted input file. You can sort WikiWho's output
deletionRevisions.csv using:
sort -t$'\t' -k3,3 -k1,1n deletionRevisions.csv -o userSortedDeletionRevisions.csv
The file is then... |
'''
Created on 2Sep.,2016
@author: Alex Ip
'''
import os
import sys
import errno
import logging
import re
import subprocess
import tempfile
from shutil import rmtree
import glob
from osgeo import gdal, gdalconst
import netCDF4
from geophys_utils import array_pieces
import numpy as np
from collections... |
# Authors: Alexandre Gramfort <gramfort@nmr.mgh.harvard.edu>
# Matti Hamalainen <msh@nmr.mgh.harvard.edu>
# Denis Engemann <d.engemann@fz-juelich.de>
#
# License: BSD (3-clause)
from ..externals.six import string_types
from copy import deepcopy
import numpy as np
import warnings
from .constants impo... |
#! /usr/bin/python
# Released as open source by NCC Group Plc - https://www.nccgroup.trust/uk/
# https://github.com/nccgroup/redsnarf
# Released under Apache V2 see LICENCE for more information
import os, argparse, signal, sys, re, binascii, subprocess, string, SimpleHTTPServer, multiprocessing, SocketServer
import so... |
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2018, 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... |
# Authors: Alexandre Gramfort <gramfort@nmr.mgh.harvard.edu>
# Matti Hamalainen <msh@nmr.mgh.harvard.edu>
#
# License: BSD (3-clause)
import numpy as np
from .constants import FIFF
from .open import fiff_open
from .tag import read_tag
from .tree import dir_tree_find
from .meas_info import read_meas_info, wri... |
#!/usr/bin/env python
"""
Removes all nonessential punctuation from a text.
Returns the text as a single string separated by spaces.
"""
from nltk.tokenize import RegexpTokenizer
class remove_punct:
def run(self, data):
tokenizer = RegexpTokenizer(r'((?<=[^\w\s])\w(?=[^\w\s])|(\W))+', gaps=True)
ret... |
"""
a script to migrate draft registration metadata on Prereg Challenge submissions. The structure of some schema items
has changed to include optional file uploads, and existing file upload values need to be updated.
"""
import sys
imort logging
from modularodm import Q
from modularodm.exceptions import NoResultsFound... |
# Authors: Denis A. Engemann <denis.engemann@gmail.com>
# simplified BSD-3 license
import numpy as np
def _unpack_matrix(fid, rows, cols, dtype, out_dtype):
""" Aux Function """
dtype = np.dtype(dtype)
string = fid.read(int(dtype.itemsize * rows * cols))
out = np.fromstring(string, dtype=d... |
#!/bin/python
import sys, struct
# TODO:
#
# - Implement LIRecord
# - Implement RIRecord
# Constants
RegSZ = 0x0001
ExpandSZ = 0x0002
RegBin = 0x0003
RegDWord = 0x0004
RegMultiSZ = 0x0007
RegQWord = 0x000B
RegNone = 0x0000
RegBigEndian = 0x0005
RegLink = 0x0006
RegResourceList = 0x0008
RegFullResourceDescriptor = 0x... |
import numpy as np
from shapely.geometry import Polygon
from sectionproperties.pre.geometry import Geometry
import sectionproperties.pre.pre as pre
def super_t_girder_section(
girder_type, girder_subtype=2, w=2100, t_w=None, t_f=75,
material: pre.Material = pre.DEFAULT_MATERIAL
) -> Geometry:
"""Construct... |
# -*- coding: utf-8 -*-
'''
(c) Copyright 2014 Telefonica, I+D. Printed in Spain (Europe). All Rights
Reserved.
The copyright to the software program(s) is property of Telefonica I+D.
The program(s) may be used and or copied only with the express written
consent of Telefonica I+D or in accordance with the terms and co... |
from __future__ import division
import numpy as np
from sklearn.multiclass import OneVsOneClassifier
from sklearn.multiclass import _fit_binary
from sklearn.externals.joblib import Parallel, delayed
from unbalanced_dataset import SMOTE
from unbalanced_dataset import SMOTEENN
def _fit_ovo_binary(estimator, X, y, i, ... |
# Orca
#
# Copyright 2005-2008 Sun Microsystems Inc.
# Copyright 2016 Igalia, S.L.
#
# 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; either
# version 2.1 of the License, or (at your optio... |
# Orca
#
# Copyright 2005-2008 Sun Microsystems Inc.
# Copyright 2011 Igalia, S.L.
#
# 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; either
# version 2.1 of the License, or (at your optio... |
"""
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed ... |
import numpy as nm
try:
import dask.array as da
except ImportError:
da = None
try:
import opt_einsum as oe
except ImportError:
oe = None
from pyparsing import (Word, Suppress, oneOf, OneOrMore, delimitedList,
Combine, alphas, Literal)
from sfepy.base.base import output, Stru... |
#!/usr/bin/env python2
'''Render volumetric render of a sclr.py output files.
Usage:
render3d.py [options] IN_FORMAT OUT_FORMAT LABEL_FORMAT <lownum> <highnum> [<step>]
render3d.py [options] (--plot-single | -s) INFILE [OUTFILE [LABEL] ]
Options:
--min=MIN -n MIN Set vmin in the volumetric plot to... |
import pylab as pb, numpy as np
def plot(parameterized, fignum=None, ax=None, colors=None, figsize=(12, 6)):
"""
Plot latent space X in 1D:
- if fig is given, create input_dim subplots in fig and plot in these
- if ax is given plot input_dim 1D latent space plots of X into each `axis`
... |
import numpy as nm
try:
import dask.array as da
except ImportError:
da = None
try:
import opt_einsum as oe
except ImportError:
oe = None
try:
from jax.config import config
config.update("jax_enable_x64", True)
import jax
import jax.numpy as jnp
except ImportError:
jnp = jax = N... |
# -*- coding: utf-8 -*-
"""
Definition Cache Manager
------------------------
Under the hood, PyBEL caches namespace and annotation files for quick recall on later use. The user doesn't need to
enable this option, but can specify a database location if they choose.
"""
from __future__ import unicode_literals
import ... |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from openerp import api
from openerp.osv import fields,osv
from openerp.tools.translate import _
WARNING_MESSAGE = [
('no-message','No Message'),
('warning','Warning'),
... |
import sys
sys.path.append('landsat-util/landsat')
from downloader import Downloader
from image import Process
import os
import boto
from boto.s3.key import Key
import zipfile
import requests
from sqs import (make_connection, get_queue, get_message, get_attributes,
delete_message_from_handle,)
from shu... |
"""FTPD Server handlers."""
import os
import base64
import logging
import logging.handlers
from pathlib import PurePosixPath
from pyftpdlib.handlers import FTPHandler
from teroftpd.asgi import channel_layer
from teroftpd.images import ImageHandler
from teroftpd import settings
LOG_FILENAME = '/logs/ftpd.log'
VISION_... |
# -*- coding: utf-8 -*-
# This file is part of the pyMOR project (http://www.pymor.org).
# Copyright Holders: Felix Albrecht, Rene Milk, Stephan Rave
# License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
from __future__ import absolute_import, division, print_function
from pymor.algorithms.tim... |
"""
Django settings for Green_Roof_MapPy project.
Generated by 'django-admin startproject' using Django 1.10.6.
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/
"""
... |
import datetime
import logging
import math
import random
import time
import uuid
from django.utils import simplejson as json
from google.appengine.api import memcache
from google.appengine.api import users
from google.appengine.ext import db
RADIUS_OF_EARTH_METERS = 6378100
TRIGGER_DISTANCE_METERS = 15
ZOMBIE_VISION_... |
# Copyright 2015-2016, 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 ... |
#!/usr/bin/env python
####################
import re
import string
#####################
from parsers.base import SiteParserBase
from util import fixFormatting, getSourceCode
#####################
class MangaFox(SiteParserBase):
re_getSeries = re.compile('a href="http://.*?mangafox.*?/manga/([^/]*)/[^"]*?" class... |
# Copyright (c) 2015-2018 by the parties listed in the AUTHORS file.
# All rights reserved. Use of this source code is governed by
# a BSD-style license that can be found in the LICENSE file.
import healpy as hp
import numpy as np
from .. import timing as timing
from ..map import DistRings, PySMSky, LibSharpSmooth, ... |
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patheffects as PathEffects
import seaborn as sns
from functools import wraps
from sklearn.decomposition import PCA
import matplotlib.animation as animation
def embedding2d(data, train_data=None, method=None):
'''2D embedding for visualization
... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2014 Alexander Shorin
# All rights reserved.
#
# This software is licensed as described in the file LICENSE, which
# you should have received as part of this distribution.
#
import asyncio
import unittest
import unittest.mock as mock
from collections import deque
import aioco... |
import aiohttp_jinja2
import jinja2
from .admin import Admin, index_handler
from .consts import TEMPLATES_ROOT, PROJ_ROOT, TEMPLATE_APP_KEY, APP_KEY
__all__ = ['Admin', 'setup']
__version__ = '0.0.1'
def gather_tempalte_folder(template_folder):
# gather template folders: default and provided
if not isinst... |
import socket
import time
import uuid
import netaddr
from oslo.config import cfg
from quantumclient.v2_0 import client
from akanda.rug.openstack.common import importutils
from akanda.rug.openstack.common import context
from akanda.rug.openstack.common.rpc import proxy
from akanda.rug.openstack.common import log as lo... |
# -*- coding: utf-8 -*-
"""Akvo RSR is covered by the GNU Affero General Public License.
See more details in the license.txt file located at the root folder of the
Akvo RSR module. For additional details on the GNU license please
see < http://www.gnu.org/licenses/agpl.html >.
"""
import re
from lxml import etree
fr... |
# -*- coding: utf-8 -*-
"""Akvo RSR is covered by the GNU Affero General Public License.
See more details in the license.txt file located at the root folder of the Akvo RSR module.
For additional details on the GNU license please see < http://www.gnu.org/licenses/agpl.html >.
"""
from __future__ import absolute_impor... |
# coding: utf-8
"""A tornado based IPython notebook server.
Authors:
* Brian Granger
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2013 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, ... |
from __future__ import unicode_literals
from django.core.urlresolvers import reverse
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.text import slugify
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import User
from... |
# -*- coding: utf-8 -*-
#
# Expyfun documentation build configuration file, created by
# sphinx-quickstart on Fri Jun 11 10:45:48 2010.
#
# 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.
#
# A... |
# -*- coding: utf-8 -*-
#
# Avalon Music Server documentation build configuration file, created by
# sphinx-quickstart on Tue May 22 21:54: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 f... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Kansha documentation build configuration file, created by
# sphinx-quickstart on Tue Feb 17 09:57:39 2015.
#
# 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
# aut... |
# -*- coding: utf-8 -*-
#
# Moulinette documentation build configuration file, created by
# sphinx-quickstart on Mon Jul 17 03:57:28 2017.
#
# 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.
#
... |
# -*- coding: utf-8 -*-
#
# Twiggy documentation build configuration file, created by
# sphinx-quickstart on Mon Sep 20 10:33:48 2010.
#
# 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.
#
# All ... |
# -*- coding: utf-8 -*-
#
# KM3Pipe documentation build configuration file, created by
# sphinx-quickstart on Sat Oct 4 19:16:43 2014.
#
# 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.
#
# A... |
# -*- coding: utf-8 -*-
#
# PyGravatar documentation build configuration file, created by
# sphinx-quickstart on Tue Sep 6 02:08:06 2011.
#
# 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.
#
# ... |
# -*- coding: utf-8 -*-
#
# PASTAS documentation build configuration file, created by
# sphinx-quickstart on Wed May 11 12:38:06 2016.
# Repository setup is according to:
# http://gisellezeno.com/tutorials/sphinx-for-python-documentation.html
#
# This file is execfile()d with the current directory set to its
# contain... |
# -*- coding: utf-8 -*-
#
# modred documentation build configuration file, created by
# sphinx-quickstart on Sat Mar 3 20:00:31 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.
#
# All ... |
# -*- coding: utf-8 -*-
#
# QuTiP documentation build configuration file, created by
# sphinx-quickstart on Tue Oct 25 14:08:15 2011.
#
# 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.
#
# All c... |
# -*- coding: utf-8 -*-
#
# hmm-learn documentation build configuration file, created by
# sphinx-quickstart on Fri Jan 8 09:13:42 2010.
#
# 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.
#
#... |
# -*- coding: utf-8 -*-
import os.path
import sys
# Ensure we can import "mongoc" and "taglist" extension modules.
sys.path.append(os.path.dirname(__file__))
extensions = [
'mongoc',
'taglist',
]
# General information about the project.
project = 'Libbson'
copyright = '2017, MongoDB, Inc'
author = 'MongoDB, ... |
"""Configuration file for Sphinx."""
import sys
import os
from subprocess import check_output
sys.path.insert(0, os.path.abspath('..'))
sys.path.insert(0, os.path.abspath('.'))
# Fake import to avoid actually loading CFFI and the PortAudio library
import fake__sounddevice
sys.modules['_sounddevice'] = sys.modules['fa... |
# -*- coding: utf-8 -*-
#
# XTraceback documentation build configuration file, created by
# sphinx-quickstart on Sat Jun 25 21:53:34 2011.
#
# 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.
#
# ... |
"""Testing for Spectral Biclustering methods"""
import numpy as np
from scipy.sparse import csr_matrix, issparse
from sklearn.grid_search import ParameterGrid
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_equal
from... |
# -*- coding: utf-8 -*-
# pylint: disable=C0103,W0622
'''
Sphinx documentation for Salt
'''
import functools
import sys
import os
import types
import time
from sphinx.directives import TocTree
# pylint: disable=R0903
class Mock(object):
'''
Mock out specified imports.
This allows autodoc to do its thing... |
import pytest
from cryptotik import Bittrex
from decimal import Decimal
private = pytest.mark.skipif(
not pytest.config.getoption("--apikey"),
reason="needs --apikey option to run."
)
def test_format_pair():
'''test string formating to match API expectations'''
assert Bittrex.format_pair("btc_ppc") ... |
"""
Testing for the gradient boosting module (sklearn.ensemble.gradient_boosting).
"""
import numpy as np
import warnings
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import as... |
# -*- coding: utf-8 -*-
# Copyright (C) 2010, 2011, 2012, 2013 Sebastian Wiesner <lunaryorn@gmail.com>
# 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; either version 2.1 of the License, ... |
#!/usr/bin/python
import urllib2, ConfigParser, json, logging, traceback, re, argparse
from datetime import timedelta, datetime, date
from string import Template
#from xml.dom.minidom import parse
import xml.etree.ElementTree as ET
from os import sys
from nat_lib import *
intRolloverLocalTime = 1000
logLevel = logg... |
import numpy as np
from sklearn.metrics.cluster import adjusted_rand_score
from sklearn.metrics.cluster import homogeneity_score
from sklearn.metrics.cluster import completeness_score
from sklearn.metrics.cluster import v_measure_score
from sklearn.metrics.cluster import homogeneity_completeness_v_measure
from sklearn... |
# -*- coding: utf-8 -*-
#
# analyzeSN documentation build configuration file, created by
# sphinx-quickstart on Sat Jun 27 01:02:35 2015.
#
# 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.
#
#... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# auspex documentation build configuration file, created by
# sphinx-quickstart on Thu Sep 15 21:16:14 2016.
#
# 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
# aut... |
# -*- coding: utf-8 -*-
#
# simplekit documentation build configuration file, created by
# sphinx-quickstart on Thu Nov 19 22:49:03 2015.
#
# 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.
#
#... |
# :coding: utf-8
# :copyright: Copyright (c) 2013 Martin Pengelly-Phillips
# :license: See LICENSE.txt.
'''Clique documentation build configuration file'''
import os
import re
import sys
# -- General ------------------------------------------------------------------
# Inject source onto path so that autodoc can fin... |
"""
.. See the NOTICE file distributed with this work for additional information
regarding copyright ownership.
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.... |
import math
import numarray as N
class GreatCircle:
"""
from Ed Williams' 'Aviation Formulary'
(http://williams.best.vwh.net/avform.htm)
Assumes earth is perfect sphere (not an ellipsoid).
"""
def __init__(self,lon1,lat1,lon2,lat2):
"""
Define a great circle by specifying:
... |
# Copyright (c) 2008-2016 Szczepan Faber, Serhiy Oplakanets, Herr Kaste
#
# 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... |
#!/usr/bin/env python
# Copyright (C) 2017, Julien Michel <julien.michel@cnes.fr>
# 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 ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.