gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# Copyright 2019 The Cirq Developers
#
# 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 ... | |
# Copyright 2019 DeepMind Technologies Limited
#
# 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 agr... | |
# Copyright 2015 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.
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import json
import unittest
import webapp2
imp... | |
# Copyright (c) 2014 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 required by applicable law or agreed to in writ... | |
import pandas.testing as tm
import pytest
from numpy import testing
pytestmark = pytest.mark.geo
def test_load_geodata(con):
import geopandas
t = con.table('geo')
result = t.execute()
assert isinstance(result, geopandas.GeoDataFrame)
def test_empty_select(geotable):
expr = geotable[geotable.ge... | |
from __future__ import print_function
import warnings
import copy
import json
import os
import numpy as np
from . import backend as K
from .utils.io_utils import ask_to_proceed_with_overwrite
from .engine.training import Model
from .engine.topology import get_source_inputs, Node
from .optimizers import optimizer_from_... | |
import itertools
import logging
import simplejson
from . import helpers
from . import magicnumbers
from . import util
from . import filter
from .profile import Profile
from .session import Session
from .xpath import xpb
log = logging.getLogger(__name__)
#: A :class:`~okcupyd.filter.Filters` object that stores all ... | |
import sys
import engine
from standard_plugs import *
from spotify_plugs import *
#from track_manager import tlib
from frog import *
uteen_party ='spotify:user:spotify:playlist:3MlpudZs4HT3i0yGPVfmHC'
ucoffee_house ='spotify:user:spotify:playlist:4BKT5olNFqLB1FAa8OtC8k'
def runner(source, max_tracks = 100, props=[]):... | |
###############################################################################
##
## Copyright (C) 2011-2014, NYU-Poly.
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org
##
## This file is part of VisTrails.
##
## "Redistribution and use in source and binary for... | |
from django.conf import settings
from django.contrib.contenttypes import generic
from django.contrib.contenttypes.models import ContentType
from django.contrib.sites.models import Site
from django.core import urlresolvers
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.u... | |
import sys, string, os
import csv as csv
from math import *
import operator
import numpy as np
from sklearn.ensemble import RandomForestClassifier
from sklearn.ensemble import RandomForestRegressor
import re
# ignore stop words
stop_words = ["a", "able","about","across","after","all","almost","also","am","among","an",... | |
# Copyright (c) 2010-2011 OpenStack, 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | |
#!/usr/bin/env python
# coding=UTF-8
__author__ = "Pierre-Yves Langlois"
__copyright__ = "https://github.com/pylanglois/uwsa/blob/master/LICENCE"
__credits__ = ["Pierre-Yves Langlois"]
__license__ = "BSD"
__maintainer__ = "Pierre-Yves Langlois"
import mimetypes
import uuid
from uwsas.common import *
from uwsas.core ... | |
# Copyright 2014 Diamond Light Source Ltd.
#
# 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 t... | |
# Copyright 2015 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... | |
#!/usr/bin/env python
# Copyright 2014, Rackspace US, 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... | |
#
# 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, Version 2.0 (the
# "License"); you may not... | |
# Copyright 2012 IBM Corp.
#
# 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 t... | |
# Copyright (c) 2006-2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2010-2011, Eucalyptus Systems, Inc.
# Copyright (c) 2011, Nexenta Systems Inc.
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates.
# Copyright (c) 2010, Google, Inc.
# All rights reserved.
#
# Permission is hereby granted, free of charge, ... | |
from sympy import Lambda, Symbol, Function, WildFunction, Derivative, sqrt, \
log, exp, Rational, Real, sign, Basic, sin, cos, diff, I, re, im, \
oo, zoo, nan, E, expand, pi
from sympy.utilities.pytest import XFAIL
from sympy.abc import x, y
def test_log():
assert log(2) > 0
assert log(1).is_z... | |
# -*- coding: utf-8 -*-
"""
Created on 07-05-2015
@author: Diogo Silva
TODO:
"""
import numpy as np
import matplotlib.pyplot as plt
import os
def convertIndexToBin(clusts=None,n_clusts=None,N=None):
"""
Converts partition in list of arrays (one array per cluster) format to binary matrix.
"""
# clu... | |
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... | |
# No shebang line, this module is meant to be imported
#
# Copyright 2013 Oliver Palmer
#
# 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
#
# U... | |
from rpython.rlib import jit, longlong2float
from rpython.rlib.objectmodel import specialize
from rpython.rlib.rarithmetic import intmask
from rpython.rlib.unroll import unrolling_iterable
from rpython.rtyper.lltypesystem import rffi, lltype
NUM_DIGITS = 4
NUM_DIGITS_POW2 = 1 << NUM_DIGITS
class MapTransitionCache(... | |
# Copyright 2010 Jacob Kaplan-Moss
# Copyright 2011 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/lice... | |
import re
from decimal import Decimal
from django.conf import settings
from django.contrib.gis.db.backends.base import BaseSpatialOperations
from django.contrib.gis.db.backends.util import SpatialOperation, SpatialFunction
from django.contrib.gis.db.backends.postgis.adapter import PostGISAdapter
from django.contrib.gi... | |
import json
import re
from django.http import HttpResponse, HttpResponseNotFound
from django.shortcuts import redirect
from django.views.decorators.csrf import csrf_exempt
from readthedocs.core.utils import trigger_build
from readthedocs.builds.constants import LATEST
from readthedocs.projects import constants
from r... | |
from django.http import HttpResponse, HttpResponseServerError, HttpResponseBadRequest
from django.http import HttpResponseRedirect, Http404
from django.template import RequestContext
from django.core.exceptions import *
from rapidsms.webui.utils import render_to_response
from django.shortcuts import get_object_or_404
f... | |
# Copyright 2013 Rackspace
#
# 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 agree... | |
# Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Tests for snapshot export."""
from ggrc import models
from ggrc.utils import QueryCounter
from integration.ggrc import TestCase
from integration.ggrc.models import factories
class TestExportSnapshots(... | |
from __future__ import absolute_import
from functools import partial
from ..func import identity, noop, compose
from ..collections import OrderedDict
from ..multimethod import MultiMethod, defmethod, defboth_wrapper, around
from .common import worst_score, best_score, no_score
from ..atypes import (as_type, as_stri... | |
# -*- coding: utf-8 -*-
"""
werkzeug.wsgi
~~~~~~~~~~~~~
This module implements WSGI related helpers.
:copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import re
import os
import posixpath
import mimetypes
from itertools import... | |
# The MIT License (MIT)
#
# Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
#
# 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 ... | |
"""
Programmatic access to CIMIS data
The CIMIS API requires a key, which can be obtained for free. That key will be
read in from CIMIS_KEY in the environment, or can be passed into these functions
as the cimis_key keyword argument
cimis_fetch_to_xr(), documented below, is the main entry point
"""
from __future__ ... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Modified from https://github.com/cloderic/clang_format_check
import argparse
import glob
import os
import subprocess
import xml.etree.ElementTree as ET
import sys
import re
import io
from collections import namedtuple
Replacement = namedtuple("Replacement", "offset len... | |
"""Univariate features selection."""
# Authors: V. Michel, B. Thirion, G. Varoquaux, A. Gramfort, E. Duchesnay.
# L. Buitinck, A. Joly
# License: BSD 3 clause
import numpy as np
import warnings
from scipy import special, stats
from scipy.sparse import issparse
from ..base import BaseEstimator
from ..prepr... | |
import os
import tables
import h5py
import numpy
from numpy.testing import assert_equal, assert_raises
from six.moves import range, cPickle
from fuel.datasets.hdf5 import PytablesDataset, H5PYDataset
from fuel.streams import DataStream
from fuel.schemes import SequentialScheme
class TestPytablesDataset(object):
... | |
import ops.cmd, ops
import dsz.control
import datetime
import dsz.menu
from ops.pprint import pprint
import ops.menu
import util.ip
import os.path
def convertUTCtoEPOCH(msDate):
epoc = ((msDate - 116444736000000000L) / 10000000)
now = datetime.datetime.fromtimestamp(epoc)
return str(now)
def getmenubool(... | |
import os
import re
import sys
import time
import glob
import importlib
PROFILE_PATH = os.path.abspath(os.path.join(
os.path.dirname(os.path.abspath(__file__)), "profile"))
if not PROFILE_PATH in sys.path:
sys.path.insert(0, PROFILE_PATH)
from alize.log import Log
from alize.cmd import run
from alize.exceptio... | |
import time
import threading
import os,sys
from circularBuffer import circularBuffer
import socket
import DonkiOrchestraLib
import traceback
import numpy
THREAD_DELAY_SEC = 0.1
DATABUFFERSIZE = 100
DEBUG = True
class processThread(threading.Thread):
#-----------------------------------------------------------------... | |
# 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, ... | |
# 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 th... | |
from datetime import timedelta
import itertools
class Color(object):
""" Represents a color in the ASS format.
"""
def __init__(self, r, g, b, a=0):
""" Made up of red, green, blue and alpha components (in that order!).
"""
self.r = r
self.g = g
self.b = b
s... | |
# -*- coding: utf-8 -*-
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
from __future__ import division
import os
from ....interfaces import fsl as fsl # fsl
from ....interfaces import utility as util # utility
from ....pipeline import eng... | |
import logging
from django.conf import settings
from django.core.cache import cache
from django.db.models.query import EmptyQuerySet
from django.forms import Media
from django.template.loader import render_to_string
from django.utils.html import escape
from django.utils.safestring import mark_safe
from parler.utils.co... | |
# -*- coding: utf-8 -*-
# Copyright (C) 2004-2005 Tristan Seligmann and Jonathan Jacobs
# Copyright (C) 2012-2014 Bastian Kleineidam
# Copyright (C) 2015-2016 Tobias Gruetzmacher
from __future__ import absolute_import, division, print_function
from re import compile, escape, IGNORECASE, sub
from os.path import splite... | |
# mininode.py - PandaPay P2P network half-a-node
#
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# This python code was modified from ArtForz' public domain half-a-node, as
# found in the mini-node branch of http://github.... | |
import os
import pytest
from yacron import config
from yacron.config import ConfigError
def test_mergedicts():
assert dict(config.mergedicts({"a": 1}, {"b": 2})) == {"a": 1, "b": 2}
def test_mergedicts_nested():
assert dict(
config.mergedicts(
{"a": {"x": 1, "y": 2, "z": 3}}, {"a": {"y"... | |
import logging
from Crypto import Random
from Crypto.Random.random import getrandbits
from Crypto.PublicKey import RSA
from Crypto.Cipher import AES
import hashlib
import os
logging.basicConfig(level=logging.INFO)
"""
`Message` class for creating wrapper objects for REST messages.
Accepts a few required keyword pa... | |
#!/usr/bin/env python
# Copyright (c) 2013 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Use the raw transactions API to spend bitcoins received on particular addresses,
# and send any change back ... | |
import datetime
from .. import config
from .. import engines
from .. import fixtures
from ..assertions import eq_
from ..config import requirements
from ..schema import Column
from ..schema import Table
from ... import DateTime
from ... import func
from ... import Integer
from ... import select
from ... import sql
fro... | |
import sys
import gzip
import random
from collections import Counter
from sklearn.feature_extraction.text import TfidfVectorizer
import numpy as np
import theano
from nn import EmbeddingLayer
def say(s, stream=sys.stdout):
stream.write(s)
stream.flush()
def read_corpus(path):
empty_cnt = 0
raw_corpu... | |
"""pcap Next Generation file format"""
# Spec: https://pcapng.github.io/pcapng/
# pylint: disable=no-member
# pylint: disable=attribute-defined-outside-init
from __future__ import print_function
from __future__ import absolute_import
from struct import pack as struct_pack, unpack as struct_unpack
from time import tim... | |
"""
DTrove Models
=============
These objects persist infomation about the clusters, datastores and other
information to the Dtrove database. Creating instances of these are pretty
straight forward if you know anything about Django. When a user adds a
Cluster from the API or the web front end the underlining servers a... | |
# Copyright 2015 Cisco 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.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | |
# Copyright 2006-2016 by Peter Cock. All rights reserved.
# Revisions copyright 2015 by Ben Woodcroft. All rights reserved.
#
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
"""Bio.AlignIO support ... | |
#!/usr/bin/env python
#
# Test: InsertDescription of the test's purpose here with other details.
# This template contains a variety of functions to perform
# certain tasks, such as: send an ICMP echo request to a
# particular host or send a TCP header with the SYN flag set to
# a particular hos... | |
# Copyright (c) 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 required by applicable law or agreed to in writ... | |
# Copyright (c) 2013 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functionality ... | |
import pytest
import numpy as np
from urllib.error import HTTPError
from astropy.time import Time
from astropy import units as u
from astropy.constants import c
from astropy.coordinates.builtin_frames import GCRS
from astropy.coordinates.earth import EarthLocation
from astropy.coordinates.sky_coordinate import SkyCoo... | |
import numpy as np
from matplotlib.patches import Polygon, Rectangle, Ellipse
from matplotlib.transforms import IdentityTransform, blended_transform_factory
np.seterr(all='ignore')
from .exceptions import UndefinedROI
__all__ = ['Roi', 'RectangularROI', 'CircularROI', 'PolygonalROI',
'AbstractMplRoi', 'Mp... | |
"""
Ridge regression
"""
# Author: Mathieu Blondel <mathieu@mblondel.org>
# Reuben Fletcher-Costin <reuben.fletchercostin@gmail.com>
# Fabian Pedregosa <fabian@fseoane.net>
# License: BSD 3 clause
from abc import ABCMeta, abstractmethod
import warnings
import numpy as np
from scipy import linalg
fro... | |
from django.db.utils import DatabaseError
try:
import thread
except ImportError:
import dummy_thread as thread
from contextlib import contextmanager
from django.conf import settings
from django.db import DEFAULT_DB_ALIAS
from django.db.backends import util
from django.db.transaction import TransactionManageme... | |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import requests
from bs4 import BeautifulSoup
import re
from urlparse import urlparse
from urlparse import urljoin
from urlparse import urlunsplit
from urlparse import parse_qs
import os, sys
import timeit
import hashlib
import random
import base64
import argparse
fr... | |
from __future__ import print_function
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | |
# -*- coding: utf-8 -*-
import httplib as http
from flask import request
from modularodm.exceptions import ValidationError, ValidationValueError
from framework import forms, status
from framework.auth import cas
from framework.auth import User
from framework.auth.core import get_user, generate_verification_key
from ... | |
"""Test the module under sampler."""
# Authors: Guillaume Lemaitre <g.lemaitre58@gmail.com>
# Christos Aridas
# License: MIT
from collections import Counter
import numpy as np
import pytest
from sklearn.utils._testing import assert_allclose
from sklearn.utils._testing import assert_array_equal
from sklearn.... | |
from django.conf import settings
from django.template.loader import render_to_string
from django.core.urlresolvers import reverse
from postmark import PMMail
from raven.contrib.django.raven_compat.models import client
from emailcongress import utils
class NoReply(PMMail):
HTML_BODY_TEMPLATE_DIR = 'emails/html_... | |
import copy
import random
import time
DEBUG = False
inf = float("infinity")
def adjacency_list_generator():
#adjacency_list
adjacency_list = {}
ij_list = [(i, j) for i in range(width) for j in range(height)]
for (i, j) in ij_list:
link_list = []
#link_list = {}
for direction in... | |
# Copyright 2018 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... | |
# -*- coding: utf-8 -*-
from agri_med_backend.constants import *
import os
import random
import math
import uuid
import base64
import time
import ujson as json
import pytz
from calendar import timegm
import arrow
from subprocess import Popen, PIPE
import string
from agri_med_backend import cfg
class Error(Exceptio... | |
import logging
logger = logging.getLogger(__name__)
import datetime
import socket
from smtplib import SMTPException
from django.core.exceptions import ValidationError, ImproperlyConfigured
from django.core.urlresolvers import reverse
from django.conf import settings
from django.template.response import SimpleTempl... | |
# Copyright (C) 2012 Nippon Telegraph and Telephone 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 appli... | |
#
# Copyright 2014, Martin Owens <doctormo@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program... | |
# 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/licenses/LICENSE-2.0
#
# Unless ... | |
"""
This module provides convenient functions to transform sympy expressions to
lambda functions which can be used to calculate numerical values very fast.
"""
from __future__ import print_function, division
import inspect
import textwrap
from sympy.core.compatibility import exec_, is_sequence, iterable, string_type... | |
# 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 unde... | |
from __future__ import division,print_function
import sys,random,re
sys.dont_write_bytecode =True
def settings(**d): return o(
name="KEYSWEST v0.1",
what="A linear-time MOEA/D variant",
_logo="""
.-""-.
/ .--. \
/ / \ \
| | | |
| |.-""-.|
///`... | |
#!/usr/bin/python
import argparse
import datetime
import dateutil.parser
import httplib
import json
import sys
from tabulate import tabulate
arg_parser = argparse.ArgumentParser(description='Compare Atlas schedules.')
arg_parser.add_argument('-h1', dest='host1', default='atlas.metabroadcast.com', metavar='host1', hel... | |
# This reads in all the volumes of poetry where we have birthdates and then
# trains a ridge regression model to distinguish reviewed (class 1) from random
# class 0, using a leave-one-out strategy.
import numpy as np
import pandas as pd
import csv, os, random
from collections import Counter
from sklearn.linear_model... | |
from __future__ import print_function, unicode_literals
import argparse
import collections
import logging
import os
import sys
import glib
import gobject
from mopidy import config as config_lib
from mopidy.audio import Audio
from mopidy.core import Core
from mopidy.utils import deps, process, versioning
logger = lo... | |
import sys
import pytest
from _pytest._code.code import ExceptionChainRepr
from _pytest.pathlib import Path
from _pytest.reports import CollectReport
from _pytest.reports import TestReport
class TestReportSerialization:
def test_xdist_longrepr_to_str_issue_241(self, testdir):
"""
Regarding issue ... | |
#!/usr/bin/env python
#
# M. Cadiz (michael.cadiz AT gmail)
# Sat Apr 21 21:08:12 PDT 2012
#
# 0 1 2 3 4 5 6
# +----+----+----+----+----+----+----+
# 0| 0 | | | | | 5 | |
# +----+----+----+----+----+----+----+
# 1| | | | | | | |
# +----+----+----+----+---... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2013 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unl... | |
# coding: utf-8
"""
Copyright 2015 SmartBear Software
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... | |
import logging
from itertools import combinations
from timeit import default_timer as timer
import numpy as np
import scipy.spatial as spatial
from opensfm import dataset
from opensfm import geo
from opensfm import io
from opensfm import log
from opensfm import matching
from opensfm.context import parallel_map
logg... | |
#!/usr/bin/python
#
# Copyright (c) 2011 The Bitcoin developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
import time
import json
import pprint
import hashlib
import struct
import re
import base64
import httplib
import... | |
# 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 ... | |
import argparse
import os
import sys
from scm.plams import init, finish, KFReader, Settings, ADFJob, Atom, Molecule
def main():
"""
Main interface that reads the file and retrieve all useful geoms etc.
Then rewrite geometries in a usable formatter_class
Prep all NBO computations
Ru... | |
import sys
import unittest
from typing import Optional
try:
from tools.lib.template_parser import (
TemplateParserException,
is_django_block_tag,
tokenize,
validate,
)
except ImportError:
print('ERROR!!! You need to run this via tools/test-tools.')
sys.exit(1)
class Par... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07.
# 2019, SMART Health IT.
import os
import io
import unittest
import json
from . import bundle
from .fhirdate import FHIRDate
class BundleTests(unittest.TestCase):
def instantiate_from(self, filename):
... | |
# twitter/models.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
# See also WeVoteServer/import_export_twitter/models.py for the code that interfaces with twitter (or other) servers
from django.db import models
from import_export_twitter.functions import retrieve_twitter_user_info
from wevote_functio... | |
# 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
# d... | |
"""Utility functions for copying and archiving files and directory trees.
XXX The functions here don't copy the resource fork or other metadata on Mac.
"""
import os
import sys
import stat
from os.path import abspath
import fnmatch
import collections
import errno
import tarfile
try:
import bz2
_BZ2_SUPPORTE... | |
# Copyright 2020 The TensorFlow Authors
#
# 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 i... | |
from sympy import (meijerg, I, S, integrate, Integral, oo, gamma, cosh,
hyperexpand, exp, simplify, sqrt, pi, erf, erfc, sin, cos,
exp_polar, polygamma, hyper, log, expand_func)
from sympy.integrals.meijerint import (_rewrite_single, _rewrite1,
meijerint_indefinite, _inflat... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# @CreateTime: Jan 30, 2017 11:26 PM
# @Author: Aldo Sotolongo
# @Contact: aldenso@gmail.com
# @Last Modified By: Aldo Sotolongo
# @Last Modified Time: Jun 18, 2017 1:43 AM
# @Description: Create, Delete and list snapshots defined in csv file.
from __future__ import print_fun... | |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import BaseHTTPServe... | |
#!/usr/bin/python
"""Read segmentation overlap measures of individual pairwise registrations
from CSV files generated by mirtk evaluate-overlap and compute the average
overlap for each class.
"""
import re
import math
import sys
import csv
import numpy as np
import argparse
def abbreviate(measure):
"""Get abbre... | |
from django.shortcuts import render
import shutil
from .utils.lgUtils import *
from .utils.utils import *
import requests
from django.http import JsonResponse, HttpResponse
import json
from django.views.decorators.http import require_POST
from django.conf import settings
from django.views.decorators.csrf import csrf_ex... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.