gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
import pytest
from os import path
import os
import pandas as pd
from biom.table import Table
import numpy as np
from SCNIC.annotate_correls import get_modules_across_rs, get_correlation_dicts, percent_shared, add_correlation_dicts,\
do_annotate_correls, calc_popt, calc_residuals, get... | |
from __future__ import absolute_import
# Copyright (c) 2010-2015 openpyxl
import pytest
from .. import Strict
class TestDescriptor:
from ..base import Descriptor
class Dummy:
pass
def test_ctor(self):
d = self.Descriptor('key', size=1)
assert d.name == 'key'
assert d.si... | |
# Authors: Olaf Hauk <olaf.hauk@mrc-cbu.cam.ac.uk>
# Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
#
# License: BSD (3-clause)
from copy import deepcopy
import numpy as np
from scipy import linalg
from ..utils import logger, verbose
from ..io.constants import FIFF
from ..evoked import EvokedA... | |
# ----------------------------------------------------------------------------
# Copyright 2014 Nervana Systems 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.o... | |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | |
from __future__ import absolute_import
import anyjson
import warnings
from mock import Mock, patch
from celery import uuid
from celery.result import TaskSetResult
from celery.task import Task
from celery.canvas import Signature
from celery.tests.tasks.test_result import make_mock_group
from celery.tests.case import... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Decorator functions
Created by: Rui Carmo
"""
from bottle import request, response, route, abort
import time, binascii, hashlib, email.utils, functools, json, cProfile, collections
from datetime import datetime
import logging
from core import tb
# Allow importing eve... | |
import json
from datetime import datetime, timedelta
from decimal import Decimal
from django.conf import settings
from django.contrib.messages.storage.fallback import FallbackStorage
from django.core.exceptions import ObjectDoesNotExist
from django.core.urlresolvers import reverse
from django.test.client import Reques... | |
#!/usr/bin/env python
"""Check Nginx config on readthedocs.org."""
import sys
import requests
# Globals to keep count of test results
TESTS = 0
FAILS = 0
def served_by_nginx(url):
"""Return True if url returns 200 and is served by Nginx."""
r = requests.get(url, allow_redirects=False)
status = (r.stat... | |
from cloudify import ctx
from cloudify import utils
from cloudify.exceptions import NonRecoverableError
from StringIO import StringIO
import base64
import os
import platform
import re
import subprocess
import sys
import time
import threading
import platform
import json
def convert_env_value_to_string(envDict):
... | |
# ==================================================================================================
# Copyright 2011 Twitter, Inc.
# --------------------------------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use thi... | |
<<<<<<< HEAD
from __future__ import unicode_literals
from django.contrib import admin
from django.contrib.auth.models import User as AuthUser
from django.contrib.contenttypes.models import ContentType
from django.core import checks, management
from django.db import DEFAULT_DB_ALIAS, models
from django.db.models import... | |
import os
import os.path as op
from werkzeug import secure_filename
from werkzeug.datastructures import FileStorage
from wtforms import ValidationError, fields
from wtforms.widgets import HTMLString, html_params
try:
from wtforms.fields.core import _unset_value as unset_value
except ImportError:
from wtforms... | |
"""Support for Homekit covers."""
from aiohomekit.model.characteristics import CharacteristicsTypes
from homeassistant.components.cover import (
ATTR_POSITION,
ATTR_TILT_POSITION,
SUPPORT_CLOSE,
SUPPORT_CLOSE_TILT,
SUPPORT_OPEN,
SUPPORT_OPEN_TILT,
SUPPORT_SET_POSITION,
SUPPORT_SET_TILT_... | |
#!/usr/bin/env python
import os
import tempfile
def get_libcxx_paths():
utils_path = os.path.dirname(os.path.abspath(__file__))
script_name = os.path.basename(__file__)
assert os.path.exists(utils_path)
src_root = os.path.dirname(utils_path)
include_path = os.path.join(src_root, 'include')
assert os.path.... | |
"""Support for devices connected to UniFi POE."""
import logging
from typing import Any
from aiounifi.api import SOURCE_EVENT
from aiounifi.events import (
WIRED_CLIENT_BLOCKED,
WIRED_CLIENT_UNBLOCKED,
WIRELESS_CLIENT_BLOCKED,
WIRELESS_CLIENT_UNBLOCKED,
)
from homeassistant.components.switch import DO... | |
"""
Parent classes describing a layer, model or operator
"""
__docformat__ = 'restructedtext en'
__authors__ = ("Razvan Pascanu "
"KyungHyun Cho "
"Caglar Gulcehre ")
__contact__ = "Razvan Pascanu <r.pascanu@gmail>"
import numpy
import copy
import pickle as pkl
import logging
import the... | |
# -*- coding: utf-8 -*-
#
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from typing import Any, Callable, List, Optional, Sequence, TypeVar, Iterable, Set, Tuple, Text
from six import binary_type
import base64
import errno
import hashlib
import heapq
import itertools
import os
import sys
from ti... | |
import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
''' IMPORTS '''
import dateparser
import json
import traceback
import requests
from datetime import timedelta, datetime
# Disable insecure warnings
requests.packages.urllib3.disable_warnings()
''' CLIENT CLASS '''
... | |
from __future__ import with_statement
import os
import logging
from collections import defaultdict
try:
import json
except ImportError:
import simplejson as json
from django.conf import settings
from moca.mrs.models import Procedure, SavedProcedure, Client, Patient, BinaryResource
from moca.mrs import openm... | |
#!/usr/bin/env vpython
# Copyright 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import copy
import json
import os
import subprocess
import sys
import unittest
THIS_DIR = os.path.dirname(os.path.abspath(__file__))
... | |
from marshmallow import Schema
from marshmallow.fields import (
List,
Nested
)
import sqlalchemy.orm as orm
class SchemaFilter(object):
def __init__(self, schema, unlazify=False):
if isinstance(schema, type):
self.schema_inst = schema()
else:
self.schema_inst = sc... | |
import json
import random
import numpy as np
from .pipe import Pipe
class JsonLoader(Pipe):
def __iter__(self):
for l in self.input:
try:
yield json.loads(l)
except ValueError:
pass
return
def __len__(self):
return len(self.inp... | |
#!/usr/bin/env python
import json
import unittest
from sushi_bargain.itsu import ItsuApi
class TestItsu(unittest.TestCase):
def test_parse_time(self):
self.assertEqual(
20.0,
ItsuApi._time_string_to_float("10am - 8.30pm", 0.5)
)
self.assertEqual(
18.5,... | |
"""
Returners Directory
:func:`get_returner_options` is a general purpose function that returners may
use to fetch their configuration options.
"""
import logging
log = logging.getLogger(__name__)
def get_returner_options(virtualname=None, ret=None, attrs=None, **kwargs):
"""
Get the returner options from ... | |
"""Test the stacking classifier and regressor."""
# Authors: Guillaume Lemaitre <g.lemaitre58@gmail.com>
# License: BSD 3 clause
import pytest
import numpy as np
import scipy.sparse as sparse
from sklearn.base import BaseEstimator
from sklearn.base import ClassifierMixin
from sklearn.base import RegressorMixin
from ... | |
# openioc_11_to_10.py
#
# Copyright 2013 Mandiant Corporation.
# Licensed under the Apache 2.0 license. Developed for Mandiant by William
# Gibb.
#
# Mandiant licenses this file to you under the Apache License, Version
# 2.0 (the "License"); you may not use this file except in compliance with the
# License. You ma... | |
from pyscf.tdscf.common_slow import k_nocc
from pyscf.pbc.tdscf.krhf_slow import get_block_k_ix
import numpy
from numpy import testing
def retrieve_m(model, phase=1, **kwargs):
"""Retrieves TDSCF matrix."""
vind, hdiag = model.gen_vind(model._scf, **kwargs)
size = model.init_guess(model._scf, 1).shape[1]... | |
# encoding: utf-8
"""
Gherkin step implementations for table-related features.
"""
from __future__ import absolute_import
from behave import given, when, then
from pptx import Presentation
from pptx.dml.color import RGBColor
from pptx.enum.text import MSO_ANCHOR
from pptx.util import Inches
from helpers import sav... | |
import pyBigWig
import tempfile
import os
import sys
import hashlib
import numpy as np
class TestRemote():
fname = "http://raw.githubusercontent.com/dpryan79/pyBigWig/master/pyBigWigTest/test.bw"
def doOpen(self):
bw = pyBigWig.open(self.fname)
assert(bw is not None)
return bw
def... | |
"""
Finite difference weights
=========================
This module implements an algorithm for efficient generation of finite
difference weights for ordinary differentials of functions for
derivatives from 0 (interpolation) up to arbitrary order.
The core algorithm is provided in the finite difference weight generat... | |
# -*- coding:utf-8 -*-
"""
Utilities not related to neuronal network simulation.
"""
from numpy import linspace
from os import path, listdir
from importlib import import_module
import itertools
def path_to_modline(filepath):
"""Returns a string representation for module import of a file."""
# Import the set ... | |
"""
KDTree for PySAL: Python Spatial Analysis Library.
Adds support for Arc Distance to scipy.spatial.KDTree.
"""
import sys
import math
import scipy.spatial
import numpy
from scipy import inf
import sphere
__author__ = "Charles R Schmidt <schmidtc@gmail.com>"
DISTANCE_METRICS = ['Euclidean', 'Arc']
FLOAT_EPS = numpy... | |
"""
Unit tests for optimization routines from optimize.py
Authors:
Ed Schofield, Nov 2005
Andrew Straw, April 2008
To run it in its simplest form::
nosetests test_optimize.py
"""
from __future__ import division, print_function, absolute_import
import itertools
import numpy as np
from numpy.testing import (... | |
"""
Provide functionality to keep track of devices.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/device_tracker/
"""
import asyncio
from datetime import timedelta
import logging
from typing import Any, List, Sequence, Callable
import voluptuous as vo... | |
import datetime
import hashlib
import random
import re
from django.conf import settings
from django.contrib.auth.models import User
from django.db import models
from django.db import transaction
from django.template.loader import render_to_string
from django.utils.translation import ugettext_lazy as _
from django.core... | |
"""Support for Frontier Silicon Devices (Medion, Hama, Auna,...)."""
import logging
import voluptuous as vol
from homeassistant.components.media_player import MediaPlayerDevice, PLATFORM_SCHEMA
from homeassistant.components.media_player.const import (
MEDIA_TYPE_MUSIC,
SUPPORT_NEXT_TRACK,
SUPPORT_PAUSE,
... | |
import typing
import pygame
import src.event
# Type hints
Vector = typing.Union[typing.Tuple[int, int], typing.List[int]]
presets = []
class WidgetManager(pygame.sprite.OrderedUpdates):
def __init__(self, *widgets):
super(WidgetManager, self).__init__(widgets)
self.previous_keys = None
... | |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
"""
NumPy
=====
Provides
1. An array object of arbitrary homogeneous items
2. Fast mathematical operations over arrays
3. Linear Algebra, Fourier Transforms, Random Number Generation
How to use the documentation
----------------------------
Documentation is available in two forms: docstrings provided
with the c... | |
# coding: utf-8
""" Application of all sites QC mode
We apply the model built from data from all sites. This has to be
run by submission to the LSF queue on the cluster.
This script was generated from an ipython notebook of the same name
then modified into its current form
"""
import sys
import os
im... | |
# Copyright 2016 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... | |
# -*- coding: utf-8 -*-
import pytest
from datetime import datetime
from itertools import combinations
import operator
from pandas.compat import range, u, PY3
import numpy as np
from pandas import (isna, Series, Index, Float64Index,
Int64Index, RangeIndex)
import pandas.util.testing as tm
imp... | |
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Hoverlabel(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "bar"
_path_str = "bar.hoverlabel"
_valid_props = {
"align",
"alignsrc",
... | |
#!/usr/env/python
import numpy as np
import matplotlib.pyplot as plt
from scipy.ndimage import filters
from numba import jit
from joblib import Memory
memory = Memory('./output', verbose=0)
from ..datasets import synthetic as synth
from ..utils import arrays as ar
from ..utils.subseq import optimalAlignK
from ..viz... | |
# -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListTy... | |
"""
Parse to and from a Excel format for isotherms.
The _parser_version variable documents any changes to the format,
and is used to check for any deprecations.
"""
import ast
import pandas
import xlrd
import xlwt
from pygaps import logger
from pygaps.core.baseisotherm import BaseIsotherm
from pygaps.core.modeliso... | |
"""Provide an authentication layer for Home Assistant."""
import asyncio
from collections import OrderedDict
from datetime import timedelta
import logging
from typing import Any, Dict, List, Optional, Tuple, cast
import jwt
from homeassistant import data_entry_flow
from homeassistant.auth.const import ACCESS_TOKEN_EX... | |
#!/usr/bin/python
#
# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Unit tests for common_util module."""
import os
import shutil
import subprocess
import tempfile
import unittest
import mox
i... | |
# Copyright (c) 2013 Intel, Inc.
# Copyright (c) 2013 OpenStack Foundation
# 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/li... | |
# Copyright (c) 2015 Cloudbase Solutions SRL
# 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
#
# Unle... | |
# This file is part of pybootchartgui.
# pybootchartgui 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
# (at your option) any later version.
# pybootchartgui is dis... | |
############################################################################
##
## Copyright (C) 2006-2007 University of Utah. All rights reserved.
##
## This file is part of VisTrails.
##
## This file may be used under the terms of the GNU General Public
## License version 2.0 as published by the Free Software Foundat... | |
import contextlib
import json
import shutil
import socket
import tarfile
import tempfile
import threading
import pytest
import six
from six.moves import BaseHTTPServer
from six.moves import socketserver
import docker
from ..helpers import requires_api_version, requires_experimental
from .base import BaseAPIIntegrat... | |
#!/Users/bja/code/django-roa/env/bin/python
"""PILdriver, an image-processing calculator using PIL.
An instance of class PILDriver is essentially a software stack machine
(Polish-notation interpreter) for sequencing PIL image
transformations. The state of the instance is the interpreter stack.
The only method one wi... | |
"""
The core of PROOF's implementation. The class is the basic unit of the PROOF.
All aggregates, repositories and factories in PROOF are using this class as
their backbone.
This class maintains the connection pools and repositories for each database.
It provides all the necessary resources by delegating the calls to ... | |
## A script for finding every cox coefficient and pvalue for every OV lncRNA in the beta MiTranscriptome data set (normalized counts)
from rpy2 import robjects as ro
import numpy as np
import os
ro.r('library(survival)')
import re
##This call will only work if you are running python from the command line.
##If you ar... | |
#!/usr/bin/env python
import itertools
import pprint
import json as json
def nls2json(obj, level=0):
"""A formatter easing the human readability of niels.json."""
INDENT = 3
SPACE = " "
NEWLINE = "\n"
def pod_iter(subject):
"""Assumes subject is an iter of tuples or list."""
count... | |
#!/usr/bin/python -tt
# TODO:
# - JSON body for GET requests
"""Client for talking to a RESTful server. Maybe just even a regular web server."""
from collections import namedtuple
import Cookie
import base64
import dbg
import hashlib
import os
import re
import socket
import sys
import time
import urllib
import urlp... | |
# -*- coding: utf-8 -*-
#
# s3fields unit tests
#
# To run this script use:
# python web2py.py -S eden -M -R applications/eden/modules/unit_tests/s3/s3fields.py
#
import unittest
from gluon.languages import lazyT
from gluon.dal import Query
from s3.s3fields import *
# ==================================================... | |
# ----------------------------------------------------------------------------
# Copyright (c) 2016-2020, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... | |
#! /usr/bin/env python
import os
import re
import shutil
import subprocess
import urlparse
import messages as messages
import metadata as metadata
from exceptionclasses import CustomError, CritError, SyntaxError, LogicError
class SystemDirective(object):
def __new__(cls, raw, LOGFILE, last_dir, last_rev, toke... | |
import logging
from dateutil import parser
from django.http import JsonResponse
from django.db import transaction
from hs_core.views.utils import authorize, ACTION_TO_AUTHORIZE
from hs_core.hydroshare.utils import get_resource_by_shortkey, resource_modified
from .utils import add_or_remove_relation_metadata, RES_LAN... | |
'''
Python bindings for GLFW.
'''
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
__author__ = 'Florian Rhiem (florian.rhiem@gmail.com)'
__copyright__ = 'Copyright (c) 2013 Florian Rhiem'
__license__ = 'MIT'
__version__ = '1.0.1'
import ctypes
import os
i... | |
#!/usr/bin/env python
# Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Unittests to make sure we generate and update the expected-*.txt files
properly after running layout tests."""
import os
i... | |
from tests.base import BaseTestCase
from mod_auth.models import Role
from mod_regression.models import RegressionTest, Category, InputType, OutputType
from flask import g
class TestControllers(BaseTestCase):
def test_root(self):
response = self.app.test_client().get('/regression/')
self.assertEqua... | |
#!/usr/local/bin/python
# coding: utf-8
"""
Convert tables in MD files to RST prior to processing by Sphinx.
.. warning::
The script does not perform any tests on the conversion nor does it
rollback if it encounters an error. Always check the rendered output.
It is possible that some errors may occur that... | |
from tests import unittest
from datetime import datetime
import decimal
from botocore.compat import six
from botocore.model import ShapeResolver
from botocore.validate import ParamValidator
BOILER_PLATE_SHAPES = {
'StringType': {
'type': 'string'
}
}
class BaseTestValidate(unittest.TestCase):
d... | |
"""
Adds Skip and Timeout guards
Copyright (c) 2009 John Markus Bjoerndalen <jmb@cs.uit.no>,
Brian Vinter <vinter@nbi.dk>, Rune M. Friborg <rune.m.friborg@gmail.com>.
See LICENSE.txt for licensing details (MIT License).
"""
# Imports
import threading
import uuid
from pycsp.parallel.const import *
from pycsp.p... | |
# coding: utf-8
"""
Backend for mobile clients
"""
from init_app import init_app
from json_encoder import JSONEncoder
from flask import json, render_template, request, abort
from flask.ext.restful import Resource, Api, reqparse, fields, marshal, marshal_with
from flask.ext.restful.representations.json import settings ... | |
"""
Swaggy Jenkins
Jenkins API clients generated from Swagger / Open API specification # noqa: E501
The version of the OpenAPI document: 1.1.2-pre.0
Contact: blah@cliffano.com
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from swaggyjenkins.m... | |
from Tkinter import *
import ttk
import MySQLdb
import json
import socket
class MainView:
def __init__(self, master):
self.master = master
mainframe = ttk.Frame(self.master, padding="3 3 12 12")
mainframe.grid(column=0, row=0, sticky=(N, W, E, S))
mainframe.columnconfigure(0, weig... | |
"""Random collection of usefull functions"""
import os, sys
import errno
from math import log10
import numpy as np
from enrico.constants import met_ref,mjd_ref, jd_ref, DAY_IN_SECOND
typeirfs={1:"FRONT",2:"BACK",3:"",4:"PSF0",8:"PSF1",16:"PSF2",32:"PSF3",64:"EDISP0",
128:"EDISP1",256:"EDISP2",512:"EDISP3"}
de... | |
#!/usr/bin/python
#
# Copyright 2018-2021 Polyaxon, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | |
# Copyright 2016 Cloudbase Solutions Srl
# 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 r... | |
# test_cmake.py - Unit tests for swift_build_support.cmake -*- python -*-
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://swift.org/LICENSE.txt for... | |
"""FirewallPolicy, FirewallRule, FirewallService, FirewallZone,
and FirewallInterface classes
"""
import cloudpassage.sanity as sanity
from .http_helper import HttpHelper
from .halo_endpoint import HaloEndpoint
class FirewallPolicy(HaloEndpoint):
"""Initializing the FirewallPolicy class:
Args:
sessi... | |
#!/usr/bin/env python
# -*- python -*-
# Mark Charney
#BEGIN_LEGAL
#
#Copyright (c) 2019 Intel Corporation
#
# 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/l... | |
# 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 under the... | |
"""
Interval Arithmetic for plotting.
This module does not implement interval arithmetic accurately and
hence cannot be used for purposes other than plotting. If you want
to use interval arithmetic, use mpmath's interval arithmetic.
The module implements interval arithmetic using numpy and
python floating points. The ... | |
from StringIO import StringIO
import codecs
import itertools
import unittest
import mock
from cardboard import types
from cardboard.db import populate as p
class TestParser(unittest.TestCase):
def test_parse(self):
examples = [
[u"WUG", u"Instant", u"Foo", u"UG-R"],
[u"RG", u"Enc... | |
"""Manual plugin."""
import os
import logging
import pipes
import shutil
import signal
import socket
import subprocess
import sys
import tempfile
import time
import zope.component
import zope.interface
from acme import challenges
from letsencrypt import errors
from letsencrypt import interfaces
from letsencrypt.plug... | |
"""
the functions
get_record_csv
get_court_id
are intended to be the closest interface points with the front end.
each has comments on its function prior to its definition and a series of demonstrative example calls afterwards
get_records_csv will require some changes to work with a db - it has been written to... | |
from collections import namedtuple
from itertools import chain
import logging
from shapely.geometry import box, mapping
from traceback import format_exc
from uuid import uuid4
from mapchete._timer import Timer
from mapchete.config import get_process_func
from mapchete.errors import (
MapcheteNodataTile,
NoTask... | |
import pprint
import test.support
import unittest
import test.test_set
# list, tuple and dict subclasses that do or don't overwrite __repr__
class list2(list):
pass
class list3(list):
def __repr__(self):
return list.__repr__(self)
class tuple2(tuple):
pass
class tuple3(tuple):
def __repr__(s... | |
# Copyright 2017 The Forseti Security Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | |
"""
Module graph
============
A module containing Graph class.
We assume that every graph is simple, i.e.,
there is no loops or multi edges.
"""
from collections import deque
import math
class Graph(object):
def __init__(self, graph_dict={}):
"""
initializes a graph object
"""
self... | |
import numpy as np
import pytest
from pandas._libs import OutOfBoundsDatetime
import pandas as pd
from pandas.core.arrays import DatetimeArray, PeriodArray, TimedeltaArray
import pandas.util.testing as tm
# TODO: more freq variants
@pytest.fixture(params=["D", "B", "W", "M", "Q", "Y"])
def period_index(request):
... | |
"""
Copyright 2020 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distrib... | |
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os.path # for initializing constants
# Directories that we run presubmit checks on.
PRESUBMIT_PATH = os.path.normpath('chrome/common/extensions/... | |
#!/usr/bin/env python
import argparse
import glob
import os
import re
import shutil
import subprocess
import sys
import stat
from lib.config import BASE_URL, PLATFORM, get_target_arch, get_zip_name
from lib.util import scoped_cwd, rm_rf, get_electron_version, make_zip, \
execute, electron_gyp
E... | |
# Current code status:
#
# This was originally written by Philip Taylor for use at
# http://philip.html5.org/tests/canvas/suite/tests/
#
# It has been adapted for use with the Web Platform Test Suite suite at
# https://github.com/web-platform-tests/wpt/
#
# The original version had a number of now-removed features (mul... | |
#
# Copyright 2018 Microsoft Corporation
#
# 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 ... | |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'DataView.accessed'
db.add_column('avocado_dataview', 'accessed',
self.... | |
# -*- coding: utf-8 -*-
import os
import sys
import re
import tarfile
import pip
from setuptools import setup, Extension, find_packages
from distutils.ccompiler import new_compiler
from distutils.command.build_ext import build_ext
from distutils.errors import CCompilerError, DistutilsExecError, DistutilsPlatformError... | |
#!/usr/bin/env python
"""Configuration parameters for client builder and server packaging."""
import os
import time
from grr.lib import config_lib
from grr.lib import rdfvalue
from grr.lib import type_info
config_lib.DEFINE_option(
type_info.RDFValueType(
rdfclass=rdfvalue.RDFURN,
name="Config.aff... | |
import crosscat.tests.component_model_extensions.MultinomialComponentModel as mcmext
import random
import math
import numpy
import six
import unittest
def main():
unittest.main()
class TestMultinomialComponentModelExtensions_Constructors(unittest.TestCase):
def setUp(self):
self.N = 10
self.K... | |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'Course.estimated_effort'
db.alter_column('courses_course', 'estimated_effort', self.gf('d... | |
#!/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,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.