text stringlengths 12 6.59M |
|---|
# Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
This module implements general data operations.
"""
from __future__ import print_function # start to adapt to Python 3
import numpy as np
from scipy.interpolate import interp1d
from numpy.lib.recfunctions import append_fields
import warnings
class MissingLabel(Exce... |
from __future__ import print_function
"""
============================
Hydraulic - thermal network
============================
"""
from __future__ import division
import time
import numpy as np
import pandas as pd
from cea.technologies.substation import substation_main
import cea.technologies.substation_matrix as su... |
import os
import math
import copy
import numpy
from PIL import Image, ImageDraw
from constants import COLORS, CONNECTIONS, DATAPATH, ARYL, XGROUPS, MASSES
from mol_name import parse_name
from utils import get_full_rotation_matrix, get_angles
def from_data(filename):
'''Reads basic data files.'''
atomtypes =... |
import numpy as np
import scipy.stats
from math import sqrt, log
from . import lib
def compute_perrakis_estimate(marginal_sample, lnlikefunc, lnpriorfunc,
lnlikeargs=(), lnpriorargs=(),
densityestimation='histogram', **kwargs):
"""
Computes the Perra... |
import unittest
import new
from should_dsl import should, should_not
from fluidity.machine import StateMachine, event, state
from fluidity.machine import InvalidTransition, InvalidConfiguration
class FluidityStateMachine(unittest.TestCase):
def it_defines_states(self):
class MyMachine(StateMachine):
... |
"""Demonstrates a simple simulation of schooling/swarming behavior.
This simulates a school of fish that exhibit three bottom-up behaviors:
- A fish wants to move towards the center of its neighbors. This encourages them to
get cozy.
- A fish wants to move away from any fish that's encroaching on its personal space.
... |
# ***************************************************************************
# * Copyright (c) 2015 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
# coding: utf-8
from flask import current_app
from flask.ext.wtf import TextField, PasswordField, BooleanField
from flask.ext.wtf import TextAreaField
from flask.ext.wtf.html5 import EmailField, URLField
from flask.ext.wtf import DataRequired, Email, Length, Regexp
from flask.ext.wtf import Optional, URL
from flask.ex... |
#!usr/bin/python
# -*- coding: utf-8 -*-
import os
import logging
import subprocess
import json
import dateutil.parser as dp
# External dependencies that must be pip install'ed separately
try:
import docker
except ImportError:
docker = None
logger = logging.getLogger('crawlutils')
def exec_dockerps():
... |
"""
Django settings for opencraft project.
To configure your instance, use local_settings.py
See local_settings.sample
"""
import logging
import os
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
ALLOWED_HOSTS = []
# A... |
#!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4 encoding=utf-8
from StringIO import StringIO
import base64
from datetime import datetime, timedelta, time
import re
import json
from couchdbkit import ResourceNotFound
from django.core.urlresolvers import reverse
from django.db import transaction
from django.http impor... |
# Copyright 2012 OpenStack LLC.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... |
#!/usr/bin/env python
#
# clcache.py - a compiler cache for Microsoft Visual Studio
#
# Copyright (c) 2010, froglogic GmbH <raabe@froglogic.com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# ... |
#!/usr/bin/env python
# encoding: utf-8
# The MIT License (MIT)
# Copyright (c) 2016 CNRS
# 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 ... |
'''
Creates directory structure for run, and fetches galaxies.
Arguments:
- galaxies : a single column csv file, containing the dustpedia galaxies that will be processed. Defaults to './galaxy_list.csv'. The directory in which this file is placed will act as the base directory for the run.
- caaprdir : the directory w... |
from __future__ import print_function
"""
============================
Hydraulic - thermal network
============================
"""
from __future__ import division
import time
import numpy as np
import pandas as pd
import cea.technologies.substation_matrix as substation
import math
from cea.utilities import epwreader... |
import itertools
import os
from collections import defaultdict
import dbt.utils
import dbt.include
import dbt.tracking
from dbt.utils import get_materialization, NodeType, is_type
from dbt.linker import Linker
import dbt.compat
import dbt.context.runtime
import dbt.contracts.project
import dbt.exceptions
import dbt.... |
# -*- coding: utf-8 -*-
# vim: sw=4:ts=4:expandtab
"""
swutils
~~~~~~~
Provides methods for interacting with ScraperWiki boxes
Examples:
Schedule a job::
job = lambda x: 'hello %s' % x
exception_handler = ExceptionHandler('reubano@gmail.com').handler
run_or_schedule(job, True, exception_... |
# -*- coding: utf-8 -*-
import logging
from django import template
from django.conf import settings
from django.utils import timezone
from django.utils.safestring import mark_safe
from django.template.defaultfilters import linebreaksbr
from django.core.cache import cache
from django.contrib.sites.models import Site
f... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
#!/usr/bin/env python
from __future__ import absolute_import
from __future__ import unicode_literals
import base64
import io
from datetime import datetime, timedelta, time
import re
import json
from django.urls import reverse
from django.db import transaction
from django.http import HttpResponse, HttpResponseRedirect, ... |
##########################################################################
#
# Copyright (c) 2007-2009, Image Engine Design 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:
#
# * Redis... |
import numpy as np
import logging
from scipy.spatial.distance import mahalanobis, cdist
import nibabel as nib
import dipy.data as dpd
import dipy.tracking.streamline as dts
import dipy.tracking.streamlinespeed as dps
from dipy.segment.bundles import RecoBundles
from dipy.align.streamlinear import whole_brain_slr
imp... |
# Note that this script is geard towards identifying businesses in terms of the US/UK
from collections import OrderedDict
import re
class cleanco():
def __init__(self, business_name):
self.business_name = business_name
# Business Types
type_dict = {}
type_dict['Professional Limited Liability Company'] = ["p... |
import numpy as np
from copy import copy
from copy import deepcopy
from itertools import zip_longest
import traceback
from pycqed.utilities.general import temporary_value
from pycqed.measurement.quantum_experiment import QuantumExperiment
from pycqed.measurement.waveform_control.circuit_builder import CircuitBuilder
fr... |
from __future__ import unicode_literals
from sqlalchemy import or_, and_, desc
from sqlalchemy.orm import aliased, joinedload
from clld.web.util.htmllib import HTML
from clld.db.meta import DBSession
from clld.db.util import get_distinct_values, icontains
from clld.db.models.common import Language, LanguageSource, Sou... |
# -*- coding: utf-8 -*-
from PyQt4 import QtCore, QtGui
from PyQt4.QtCore import Qt
import Orange.data
from Orange.classification import svm
from Orange.widgets import widget, settings, gui
class OWSVMClassification(widget.OWWidget):
name = "SVM Classification"
description = "Support Vector Machine Classi... |
# -*- coding: UTF-8 -*-
from functools import total_ordering, reduce
import html
import json
import os.path
import re
import sublime
import SublimeHaskell.internals.unicode_opers as UnicodeOpers
@total_ordering
class Position(object):
def __init__(self, line, column):
self.line = line
self.colum... |
"""
Abstract models for atmosphere.
NOTE: These models should NEVER be created directly.
See the respective sub-classes for complete implementation details.
"""
import uuid
from uuid import uuid4
from django.db import models
from django.db.models import Q
from django.utils import timezone
from core.exceptions i... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
""" pgp.py
this is where the armorable PGP block objects live
"""
import binascii
import collections
import contextlib
import functools
import itertools
import operator
import os
import re
import warnings
import six
from datetime import datetime
from cryptography.exceptions import InvalidSignature
from cryptography... |
from __future__ import absolute_import
from __future__ import unicode_literals
from contextlib import contextmanager
import threading
from django.conf import settings
from django.db import connections
from corehq.sql_db.connections import (
AAA_DB_ENGINE_ID,
ICDS_UCR_ENGINE_ID,
ICDS_UCR_CITUS_ENGINE_ID,
... |
from distutils.version import LooseVersion
import numpy as np
import scipy.ndimage as ndim
from scipy.spatial.distance import mahalanobis, cdist
import nibabel as nib
import dipy
import dipy.data as dpd
import dipy.tracking.utils as dtu
import dipy.tracking.streamline as dts
import dipy.tracking.streamlinespeed as d... |
#!/usr/bin/python3
from abc import ABCMeta, abstractmethod
import logging
import json
import socket
import requests
class AbstractChecker(metaclass=ABCMeta):
"""Base class for custom checker scripts
Individual checkers should import `BaseChecker` which does the
right thing in terms of backend depending ... |
#!/usr/bin/env python
"""
Cleanup for Singularity container
Scan the images in the singularity CVMFS. If an image directory has not been "linked" to for 2 days,
remove the image directory.
Maintains state in a file in the root singularity directory named .missing_links.json
"""
import glob
import os
import json
im... |
import numpy as np
from pycqed.measurement import awg_sweep_functions as awg_swf
from pycqed.measurement import detector_functions as det
from pycqed.analysis import measurement_analysis as ma
import qcodes as qc
from pycqed.measurement.pulse_sequences import multi_qubit_tek_seq_elts as mqs
import pycqed.measurement.pu... |
from cStringIO import StringIO
from pyrsss.gmd.conductivity import parse_conductivity
"""
USGS ground conductivity models are available at
ftp://hazards.cr.usgs.gov/Rigler/Conductivity_Latest/
"""
"""
Adirondack Mountains - central core.
"""
AK_1A = """\
* Lines starting with * are just comments.
* Text after the ... |
import numpy as np
import uncertainties.unumpy as unp
from uncertainties import ufloat
import math
from scipy.optimize import curve_fit
import matplotlib.pyplot as plt
from pint import UnitRegistry
u = UnitRegistry()
Q_ = u.Quantity
#umrechnung einheiten mit var.to('unit')
# Einheiten für pint:dimensionless, meter, s... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2012 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you ca... |
synthottolid="691846"
studytreelist=[
## Birds
"2577_5980", # Galliformes. Wang et al. 2013. PLoS ONE
"1966_4019", # Maluridae. Lee et al. 2011. Syst. Biol.
"2600_6022", # Paridae. Johansson et al. 2013. MPE
"2599_6021", # Alaudidae (larks). Alstrom et a... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import subprocess
import re
from itertools import groupby
import pymongo
import unicodedata
def is_hebrew(string):
'A hacky way to check if our string is in Hebrew - check the 1rst char'
if not string: # Support empty strings
return Fals... |
import os
import tempfile
import itertools
import uuid
from wsgiref.util import FileWrapper
import zipfile
from soil import DownloadBase, FileDownload
from django.conf import settings
from django.http import StreamingHttpResponse
from django.views.generic import View
from django_transfer import TransferHttpResponse, ... |
import os
import cPickle
from django.core.management.base import BaseCommand
from django.core.files import File
import numpy
from sklearn import svm
from sklearn.model_selection import GridSearchCV
from sklearn.metrics import mean_absolute_error
import sklearn
from data.models import DataPoint, Predictor
from project... |
# -*- encoding: utf-8 -*-
#
# Copyright © 2014-2015 eNovance
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
"""
Service Provider model for atmosphere.
"""
from django.db import models
from django.db.models import Q
from django.db.models.signals import post_save
from django.utils import timezone
from django.core.exceptions import ValidationError
from rtwo.provider import EucaProvider, OSProvider
import uuid
from uuid impor... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you can red... |
__author__ = 'sharvey'
import multiprocessing
import mysql.connector
import sys
import time
import traceback
from corpus import Corpus
class MySQLCorpus(Corpus):
cnx = None
def __init__(self, cpu_count=None):
super(MySQLCorpus, self).__init__(cpu_count)
def __del__(self):
if self.cnx i... |
#!/usr/bin/env python -w
import itertools, re
def print_docs(docs_, outfp):
'''print out docs, skipping the hashes for leading/trailing blanks'''
blank = re.compile('^\s*$')
def blanks(lst):
return itertools.takewhile(lambda x: blank.match(x), lst)
def drop_blanks(lst):
return itertool... |
import cgi
import logging
import re
import types
#from openerp.tools.safe_eval import safe_eval as eval
import xml # FIXME use lxml
import xml.dom.minidom
import traceback
from openerp.osv import osv, orm
_logger = logging.getLogger(__name__)
BUILTINS = {
'False': False,
'None': None,
'True': True,
... |
#!/usr/bin/env Python
# -*- coding: utf-8 -*-
'''
=====================================================================================
Copyright (c) 2016-2018 Université de Lorraine & Luleå tekniska universitet
Author: Luca Di Stasio <luca.distasio@gmail.com>
<luca.distasio@ingpec.eu>
This pr... |
import importlib
import json
import urllib2
from datetime import datetime
from xml.etree import ElementTree
from django.core.management.base import BaseCommand, CommandError
from bixi.models import City, Station, Update
def timestampToDateTime(timestamp):
try:
ts = int(timestamp)
except TypeError, V... |
import pandas as pd
import numpy as np
from scipy.stats.stats import _ttest_finish as get_pval
from itertools import combinations, chain, product
from collections import defaultdict, OrderedDict
import quantipy as qp
import pandas as pd
import numpy as np
from operator import add, sub, mul, div
from quantipy.core.view ... |
# -*- coding: utf-8 -*-
from django.test import TestCase
from django.test.utils import override_settings
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.utils import timezone as datetime
from django.core import mail
from courriers.forms import SubscriptionForm, Unsu... |
#
# Copyright (C) 2007-2013 by Johan De Taeye, frePPLe bvba
#
# This library 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 os
import sys
import logging
import argparse
from typing import Iterable, TextIO
from collections import defaultdict
import dinopy
import networkx
from phasm.io import gfa
from phasm.io.sequences import FastaSource
from phasm.typing import ReadMapping, LocalAlignment, AlignmentsT
from phasm.assembly_graph impo... |
from fontTools.varLib.mutator import instantiateVariableFont
import os
import sys
if sys.version_info.major == 3:
unicode = str
comp_order = [
'attribs',
'names',
'glyphs',
'metrics',
'marks',
'mkmk',
'kerns'
]
column_mapping = {
('attribs', 'modified'): ['table', 'attrib', 'value... |
import sys
from OpenGL.GL import GL_LESS, GL_TRUE, GL_DEPTH_TEST, GL_STENCIL_TEST
from OpenGL.GL import GL_COLOR_ARRAY, GL_VERTEX_ARRAY, GL_TRIANGLES
from OpenGL.GL import GL_COLOR_BUFFER_BIT, GL_DEPTH_BUFFER_BIT
from OpenGL.GL import GL_UNSIGNED_SHORT, GL_FLOAT, GL_MODELVIEW
from OpenGL.GL import GL_CULL_FACE, GL_FRO... |
def fibonacci_funct():
first_num, second_num = 0, 1
sum_of_even_numbers = 0
print (first_num)
while second_num <= 4000000:
if (second_num % 2) == 0:
sum_of_even_numbers += second_num
first_num, second_num = second_num, first_num + second_num
print ("The sum of all even ... |
import random
import urllib
import time
from openid.constants import default_dh_modulus, default_dh_gen
from openid.errors import ProtocolError
from openid.util import (DiffieHellman, long2a, to_b64, utc_now,
parsekv, w3c2datetime, datetime2timestamp,
from_b64, a2long... |
import pandas as pd
import numpy as np
from scipy.stats.stats import _ttest_finish as get_pval
from itertools import combinations
from collections import defaultdict
import quantipy as qp
import pandas as pd
import numpy as np
from operator import add, sub
from quantipy.core.view import View
from quantipy.core.cache i... |
#
# Copyright (C) 2014 by Johan De Taeye, frePPLe bvba
#
# This library 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.
#
# This... |
#==============================================================================
# Major TODO
#==============================================================================
# Add support for gdspy.CellArray
# Auto-generate PHIDL geometry documentation
# Allow caching of bbox
#=========================================... |
# Copyright (C) 2002 Python Software Foundation
"""Email address parsing code.
Lifted directly from rfc822.py. This should eventually be rewritten.
"""
import time
from types import TupleType
try:
True, False
except NameError:
True = 1
False = 0
SPACE = ' '
EMPTYSTRING = ''
COMMASPACE = ', '
# Parse ... |
import sys
import copy
import tqdm
import numpy
import numpy.lib.recfunctions
from scipy import stats, special
from galpy.util import bovy_plot, bovy_coords
import matplotlib
from matplotlib import cm, pyplot
import warnings
warnings.filterwarnings('ignore','.*All-NaN.*',) #turn-off All-NaN warnings
warnings.filterwarn... |
import numpy as np
from openpnm.topotools import trim
from openpnm.utils import logging
from openpnm.io import GenericIO, Pandas
from openpnm.network import GenericNetwork
from pathlib import Path
from pandas import DataFrame
logger = logging.getLogger(__name__)
class Statoil(GenericIO):
r"""
The StatOil form... |
# -*- encoding: utf-8 -*-
'''
Text Input
==========
.. versionadded:: 1.0.4
.. image:: images/textinput-mono.jpg
.. image:: images/textinput-multi.jpg
The :class:`TextInput` widget provides a box of editable plain text.
Unicode, multiline, cursor navigation, selection and clipboard features
are supported.
.. note:... |
import asyncio
import discord
from challonge import ChallongeException
from commands.core import cmds, aliases, required_args, optional_args, helpers
from discord_impl.permissions import Permissions
from discord_impl.channel_type import ChannelType
from challonge_impl.accounts import get as get_account
from database.... |
# This generates Gentoo Linux ebuilds for ROS packages.
import sys
import yaml
try:
import requests
def get_http(url):
return requests.get(url).text
except:
from urllib.request import urlopen
def get_http(url):
response = urlopen(url)
return response.read()
base_url = "https:/... |
# -*- coding: utf-8 -*-
"""
Created on Mon Jan 16 16:18:40 2017
@author: amcc
"""
import numpy as np
polygon1 = np.array([[1,2],[3,6],[1,5]])*20
polygon2 = np.array([[1,1],[3,8],[3,5]])*20 + 80
polygon3 = np.array([[2,1],[3,9],[7,5]])*15 + 80
my_polygons = [polygon1, polygon2]
my_polygons2 = [polygon1, polygon2, pol... |
import optparse
import os
import codecs
import collections
import numpy as np
from gensim.models import Word2Vec
from pandas import read_json
def get_e2v_embedding(embeddings_file):
model = Word2Vec.load_word2vec_format(embeddings_file, binary=True)
return model
def get_e2v_embedding_vector(embedding_model,ID):
... |
#
# Copyright (C) 2017 Red Hat, Inc.
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Versi... |
# Copyright 2013 Google, Inc. All Rights Reserved.
#
# Google Author(s): Behdad Esfahbod
from __future__ import print_function, division, absolute_import
from fontTools.misc.py23 import *
from fontTools import ttLib
from fontTools.ttLib.tables import otTables
from fontTools.misc import psCharStrings
import sys
import ... |
import sys
import copy
import tqdm
import numpy
from scipy import stats, special
from galpy.util import bovy_plot, bovy_coords
import matplotlib
from matplotlib import cm, pyplot
import warnings
warnings.filterwarnings('ignore','.*All-NaN.*',) #turn-off All-NaN warnings
warnings.filterwarnings('ignore','.*invalid value... |
# -*- coding: utf-8 -*-
"""
Created on Mon Jan 16 16:18:40 2017
@author: amcc
"""
import numpy as np
polygon1 = np.array([[1,2],[3,6],[1,5]])*20
polygon2 = np.array([[1,1],[3,8],[3,5]])*20 + 80
polygon3 = np.array([[2,1],[3,9],[7,5]])*15 + 80
my_polygons = [polygon1, polygon2]
my_polygons2 = [polygon1, polygon2, pol... |
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
from __future__ import (
absolute_import, division, print_function, unicode_literals)
import mock
from django.contrib.auth.models import User
from django.test import TestCase
from django_dynamic_fixture import get
from textclassifier.validators import ClassifierValidator
from readthedocs.projects.exceptions impor... |
# Copyright (C) 2015 Atsushi Togo
# All rights reserved.
#
# This file is part of phonopy.
#
# 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
# notic... |
# Copyright 2001-2010 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright notice and this permissio... |
# -*- coding: utf-8 -*-
import json
import mock
from django.test import TestCase
from django.urls import reverse
from readthedocs.builds.constants import BRANCH, STABLE, TAG, LATEST
from readthedocs.builds.models import (
RegexAutomationRule,
Version,
VersionAutomationRule,
)
from readthedocs.projects.mo... |
# Copyright 2001-2005 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright notice and this permissio... |
# Copyright 2001-2005 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright notice and this permissio... |
import _minpack
from common_routines import *
from scipy_base import atleast_1d, dot, take
error = _minpack.error
__all__ = ['fsolve', 'leastsq', 'newton', 'fixed_point']
def fsolve(func,x0,args=(),fprime=None,full_output=0,col_deriv=0,xtol=1.49012e-8,maxfev=0,band=None,epsfcn=0.0,factor=100,diag=None):
"""Find ... |
## Automatically adapted for scipy Oct 07, 2005 by convertcode.py
import _minpack
from common_routines import *
from scipy.base import atleast_1d, dot, take, triu
error = _minpack.error
__all__ = ['fsolve', 'leastsq', 'newton', 'fixed_point','bisection']
def fsolve(func,x0,args=(),fprime=None,full_output=0,col_deri... |
# -*- coding: utf-8 -*-
"""glifLib.py -- Generic module for reading and writing the .glif format.
More info about the .glif format (GLyphInterchangeFormat) can be found here:
http://unifiedfontobject.org
The main class in this module is GlyphSet. It manages a set of .glif files
in a folder. It offers two ways to re... |
"""plistlib.py -- a tool to generate and parse MacOSX .plist files.
The PropertList (.plist) file format is a simple XML pickle supporting
basic object types, like dictionaries, lists, numbers and strings.
Usually the top level object is a dictionary.
To write out a plist file, use the writePlist(rootObject, pathOrFi... |
#
# The ndarray object from _testbuffer.c is a complete implementation of
# a PEP-3118 buffer provider. It is independent from NumPy's ndarray
# and the tests don't require NumPy.
#
# If NumPy is present, some tests check both ndarray implementations
# against each other.
#
# Most ndarray tests also check that memoryvi... |
# -*- coding: utf-8 -*-
"""Kwik creator."""
#------------------------------------------------------------------------------
# Imports
#------------------------------------------------------------------------------
import os
import os.path as op
import itertools
import types
import numpy as np
from h5py import Datas... |
"""Test script for poplib module."""
# Modified by Giampaolo Rodola' to give poplib.POP3 and poplib.POP3_SSL
# a real test suite
import poplib
import asyncore
import asynchat
import socket
import os
import time
import errno
from unittest import TestCase
from test import test_support
from test.test_support import HOS... |
# -*- coding: utf-8 -*-
"""Kwik creator."""
#------------------------------------------------------------------------------
# Imports
#------------------------------------------------------------------------------
import os.path as op
import numpy as np
from h5py import Dataset
from ..h5 import open_h5
from ...uti... |
'''
Test cases for pyclbr.py
Nick Mathewson
'''
from test.test_support import run_unittest
import unittest, sys
from types import ClassType, FunctionType, MethodType
import pyclbr
from unittest import TestCase
# This next line triggers an error on old versions of pyclbr.
from commands import getstatus
# Here w... |
import sys
import pandas as pd
from phylodist.constants import (
TAXONOMY_HIERARCHY
)
def computeAll(phylodistDataFrame):
"""Create a histogram of occurences at taxonomy levels
Args:
phylodistData (pandas dataframe):
tabular data from phylodist
Returns:
dictionary of da... |
'''
Test cases for pyclbr.py
Nick Mathewson
'''
from test.test_support import run_unittest
import sys
from types import ClassType, FunctionType, MethodType, BuiltinFunctionType
import pyclbr
from unittest import TestCase
StaticMethodType = type(staticmethod(lambda: None))
ClassMethodType = type(classmethod(lambd... |
#!/usr/bin/env python3
import unittest
from test import support
from unittest.case import _ExpectedFailure
import errno
import io
import socket
import select
import tempfile
import _testcapi
import time
import traceback
import queue
import sys
import os
import array
import platform
import contextlib
from weakref impo... |
import argparse
import json
import logging
import logging.config
import socket
import ssl
import sys
import threading
from functools import reduce
from hashlib import sha1
from importlib import import_module
from time import sleep, time
import cerberus
import paho.mqtt.client as mqtt
import yaml
from pi_mqtt_gpio imp... |
from test.test_support import TestFailed, verbose, verify
import test.test_support
import struct
import array
import unittest
import warnings
import sys
ISBIGENDIAN = sys.byteorder == "big"
del sys
verify((struct.pack('=i', 1)[0] == chr(0)) == ISBIGENDIAN,
"bigendian determination appears wrong")
try:
impo... |
""" Test functions for basic module
"""
import unittest
import scipy.limits as limits
from scipy.scipy_test import assert_array_equal, assert_equal
from scipy.scipy_test import assert_almost_equal, assert_array_almost_equal
from scipy import *
##################################################
### Test for rand
cl... |
import os
import shutil
import subprocess
from warnings import warn
import h5py
import numpy as np
import pandas as pd
from scipy import linalg
from astropy.io import fits
from astropy.table import Table
from astropy.wcs import WCS
from astropy import units as u
from astropy.coordinates import SkyCoord, match_coordi... |
import urllib
import urllib2
import httplib
import base64
import gzip
from StringIO import StringIO
from urlparse import urlparse
from utils import json_to_py, get_faker
__version_info__ = ('2', '1', '0')
__version__ = '.'.join(__version_info__)
class CreateSendError(Exception):
"""Represents a CreateSend API error... |
# dialects.py
# -*- coding: utf-8 -*-
#
# Copyright © Stephen Day
#
# This module is part of Creoleparser and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
#
import warnings
import string
from elements import *
def create_dialect(dialect_base, **kw_args):
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.