gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
import sys
sys.path.append('..')
import os
import json
from time import time
import numpy as np
from tqdm import tqdm
from matplotlib import pyplot as plt
from sklearn.externals import joblib
import theano
import theano.tensor as T
from theano.sandbox.cuda.dnn import dnn_conv, dnn_pool
from lib import activations
fr... | |
#!/usr/bin/python
logo = """
_________ .__ __ __
\_ ___ \_______|__|/ |__/ |_ ___________________
/ \ \/\_ __ \ \ __\ __\/ __ \_ __ \___ /
\ \____| | \/ || | | | \ ___/| | \// /
\______ /|__| |__||__| |__| \___ >__| /_____ |
... | |
from __future__ import division
import requests
import json
import pandas as pd
import numpy as np
from itertools import chain
from shapely.geometry import LineString, Point
"""
If you wish to retrieve route data directly into a DataFrame
df['travel_time_valhalla'], df['valhalla_route'] = zip(*
df.apply(route_va... | |
# coding=utf-8
# Copyright 2022 The Google Research 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | |
import re
import logging
from indra.resources import load_resource_json
logger = logging.getLogger(__name__)
identifiers_url = 'https://identifiers.org'
# These are just special cases of name spaces where the mapping from INDRA to
# identifiers.org is not a question of simplecapitalization.
identifiers_mappings = ... | |
# 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
# distributed under t... | |
# coding=utf-8
"""Text encoding UTF-8"""
class SystemVariables:
"""SystemVariables(String, String, String, String, Boolean, [String],
(String), [String], String)
Class for constructing required system variables for the bot.
SystemVariables.prefix_qualifier
String
Command qualifier.
... | |
# 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 u... | |
# 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/licenses/LICENSE-2.0
#
# Unless requ... | |
"""
Empirical likelihood inference on descriptive statistics
This module conducts hypothesis tests and constructs confidence
intervals for the mean, variance, skewness, kurtosis and correlation.
If matplotlib is installed, this module can also generate multivariate
confidence region plots as well as mean-variance con... | |
from collections import OrderedDict
from sfsimodels.exceptions import deprecation
import numpy as np
from sfsimodels.exceptions import ModelError, AnalysisError
from sfsimodels.functions import clean_float
from sfsimodels.models.abstract_models import PhysicalObject
from sfsimodels import checking_tools as ct
from sf... | |
# Village People, 2017
# This is the model we got our best results with.
#
# The model receives the current state, and predicts the policy, the value
# of the state and various other outputs for the auxiliary task.
#
# The model uses BatchNormalization in the first stages of training
import torch
import torch.nn as n... | |
import os
import sys
from six import print_
from ccmlib import common, repository
from ccmlib.common import ArgumentError
from ccmlib.node import Node, NodeError
from ccmlib.cluster import Cluster
from ccmlib.cmds.command import Cmd
from ccmlib.dse_cluster import DseCluster
from ccmlib.dse_node import DseNode
from cc... | |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | |
"""Helper functions for k-medoids algorithms."""
import numpy as np
from numba import jit
def _get_clusters(metric=None, method='memory'):
# if a method requires it, check if a metric is given
if method in ('hybrid', 'cpu') and not metric:
print("Error: with method `{:}` a metric is necessary.")
... | |
try: # Python 3
import http.client as httplib
from urllib.parse import parse_qsl
except ImportError: # Python 2
import httplib
from urlparse import parse_qsl
import textwrap
import json
import os
from .exceptions import QuickbooksException, SevereException, AuthorizationException
try:
from rauth... | |
__author__ = 'tylin'
__version__ = '1.0.1'
# Interface for accessing the Microsoft COCO dataset.
# Microsoft COCO is a large image dataset designed for object detection,
# segmentation, and caption generation. pycocotools is a Python API that
# assists in loading, parsing and visualizing the annotations in COCO.
# Ple... | |
# Python C++ Compiler Invocation Library
# Copyright 2014 Joshua Buckman
#
# 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... | |
"""Class to perform under-sampling based on one-sided selection method."""
# Authors: Guillaume Lemaitre <g.lemaitre58@gmail.com>
# Christos Aridas
# License: MIT
from __future__ import division
from collections import Counter
import numpy as np
from sklearn.neighbors import KNeighborsClassifier
from sklea... | |
# coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
clean_html,
parse_iso8601,
float_or_none,
int_or_none,
compat_str,
determine_ext,
)
class HitboxIE(InfoExtractor):
IE_NAME = 'hitbox'
_VALID_URL = r'https?://(?:w... | |
#!/usr/bin/python
from __future__ import (absolute_import, division, print_function, unicode_literals)
import argparse
import datetime
import time
import os
import re
from dateutil.parser import parse
from collections import defaultdict
from sqlalchemy import create_engine
import pandas as pd
from movie_collection_app... | |
""":mod:`news.mapping` --- Reporter mapping
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Provides a mapping classes that maps from schedule to reporter classes.
"""
import copy
from .models.abstract import AbstractSchedule
from .reporters.abstract import Reporter
from .reporters.url import URLReporter
from .reporters.... | |
# Copyright (c) 2013 Galah Group LLC
# Copyright (c) 2013 Other contributers as noted in the CONTRIBUTERS file
#
# This file is part of galah-interact-python.
#
# 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 ... | |
# Copyright (c) 2010 matt
# Copyright (c) 2010-2011 Paul Colomiets
# Copyright (c) 2011 Mounier Florian
# Copyright (c) 2012 Craig Barnes
# Copyright (c) 2012, 2014-2015 Tycho Andersen
# Copyright (c) 2013 Tao Sauvage
# Copyright (c) 2013 Julien Iguchi-Cartigny
# Copyright (c) 2014 ramnes
# Copyright (c) 2014 Sean Vig
... | |
# coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from tests import IntegrationTestCase
from tests.holodeck import Request
from twilio.base.exceptions import TwilioException
from twilio.http.response import Response
class PhoneNumberTestCase(Integ... | |
# 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 u... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2018 jem@seethis.link
# Licensed under the MIT license (http://opensource.org/licenses/MIT)
import ruamel.yaml as yaml
import time
import colorama
import intelhex
from pprint import pprint
from hexdump import hexdump as hexdump
import keyplus
from keyplus.co... | |
"""Single slice vgg with normalised scale.
"""
import functools
import lasagne as nn
import numpy as np
import theano
import theano.tensor as T
import data_loader
import deep_learning_layers
import dihedral
import dihedral_fast
import image_transform
import layers
import preprocess
import postprocess
import objective... | |
#!/usr/bin/env python3
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2015 Thomas Voegtlin
#
# 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 withou... | |
#!/usr/bin/env python3
# OpenPOWER Automated Test Project
#
# Contributors Listed Below - COPYRIGHT 2018
# [+] International Business Machines 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 Lic... | |
# coding: utf-8
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from tapi_server.models.base_model_ import Model
from tapi_server.models.tapi_common_admin_state_pac import TapiCommonAdminStatePac # noqa: F401,E501
from tapi_server.... | |
from __future__ import absolute_import, unicode_literals
from mock import patch
from oauthlib import signals
from oauthlib.oauth2.rfc6749.errors import *
from oauthlib.oauth2.rfc6749.parameters import *
from ...unittest import TestCase
@patch('time.time', new=lambda: 1000)
class ParameterTests(TestCase):
stat... | |
"""
pygments.lexers.dsls
~~~~~~~~~~~~~~~~~~~~
Lexers for various domain-specific languages.
:copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import ExtendedRegexLexer, RegexLexer, bygroups, words, \
i... | |
# Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
# Pgen imports
from . import grammar, token, tokenize
from typing import (
Any,
Dict,
IO,
Iterator,
List,
Optional,
Text,
Tuple,
Union,
Sequence,
NoReturn,
)... | |
import json
import datetime
import reversion
from django.db import models
from django.core.exceptions import ValidationError
from django.core import validators
from django.utils import timezone, encoding
from common.models import AbstractBase, Contact, SequenceMixin
from common.fields import SequenceField
from facili... | |
# This file is part of the ISIS IBEX application.
# Copyright (C) 2012-2016 Science & Technology Facilities Council.
# All rights reserved.
#
# This program is distributed in the hope that it will be useful.
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License... | |
# 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 ... | |
# coding: utf-8
"""
KubeVirt API
This is KubeVirt API an add-on for Kubernetes.
OpenAPI spec version: 1.0.0
Contact: kubevirt-dev@googlegroups.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class V1Persis... | |
# -*- coding: utf-8 -*-
from typing import Any, Dict, Generator, Mapping, Union
import mock
from django.utils.timezone import now as timezone_now
from zerver.lib.actions import (
get_client,
)
from zerver.lib.test_classes import (
ZulipTestCase,
)
from zerver.models import (
get_stream_recipient,
... | |
# Copyright 2014 Rackspace, Andrew Melton
#
# 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/python
# Creator: Daniel Wooten
# Version 1.0.
import os as os
import time as time
import logging as logging
import copy as cp
import re as re
import sys
import json
""" This is a collection of commonly used functions in programs created by
Daniel Wooten. They should be ( and are ) utilized in other pr... | |
"""
Dependency injection utilities
:copyright: (c) 2013-15 by Telefonica I+D.
:license: see LICENSE.txt for more details.
Python is a highly dynamic language with an "open class" implementation for user
types, thus the need for a full blown dependency injection framework is not
specially needed. For medium to large a... | |
# 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 law or agreed to in w... | |
"""
This bootstrap module contains code for ensuring that the astropy_helpers
package will be importable by the time the setup.py script runs. It also
includes some workarounds to ensure that a recent-enough version of setuptools
is being used for the installation.
This module should be the first thing imported in th... | |
from __future__ import division
import sys
from icarus.models.cache import insert_after_k_hits_cache
if sys.version_info[:2] >= (2, 7):
import unittest
else:
try:
import unittest2 as unittest
except ImportError:
raise ImportError("The unittest2 package is needed to run the tests.")
del sys
... | |
# Python test set -- part 6, built-in types
from test.test_support import *
print '6. Built-in types'
print '6.1 Truth value testing'
if None: raise TestFailed, 'None is true instead of false'
if 0: raise TestFailed, '0 is true instead of false'
if 0L: raise TestFailed, '0L is true instead of false'
if 0.0: raise Te... | |
import hashlib
import re
import os
from six import binary_type
from six.moves.urllib.parse import urljoin
from fnmatch import fnmatch
try:
from xml.etree import cElementTree as ElementTree
except ImportError:
from xml.etree import ElementTree
import html5lib
from . import XMLParser
from .item import Stub, Man... | |
#! /usr/local/bin/python
# NOTE: the above "/usr/local/bin/python" is NOT a mistake. It is
# intentionally NOT "/usr/bin/env python". On many systems
# (e.g. Solaris), /usr/local/bin is not in $PATH as passed to CGI
# scripts, and /usr/local/bin is the default directory where Python is
# installed, so /usr/bin/env w... | |
#
# Test script for the curses module
#
# This script doesn't actually display anything very coherent. but it
# does call every method and function.
#
# Functions not tested: {def,reset}_{shell,prog}_mode, getch(), getstr(),
# init_color()
# Only called, not tested: getmouse(), ungetmouse()
#
import sys, tempfile, os
... | |
#
# 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 n... | |
"""Functions to plot ICA specific data (besides topographies)."""
from __future__ import print_function
# Authors: Denis Engemann <denis.engemann@gmail.com>
# Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Teon Brooks <teon.brooks@gmail.com>
#
# License: Simplified BSD
from functools... | |
#
#------------------------------------------------------------------------------
# Copyright (c) 2013-2014, Christian Therien
#
# 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://ww... | |
# Copyright 2012 IBM Corp.
# Copyright 2013 Red Hat, 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 r... | |
from __future__ import absolute_import
import datetime
import decimal
import pytest
from django import VERSION
from django.core.management import call_command
from .django_app.models import Rabbit, models, Hole, Door, Customer, Simple, Client
from mixer.backend.django import Mixer
@pytest.fixture(autouse=True)
def... | |
#!/usr/bin/env python
# Convert line elements with overlapping endpoints into polylines in an
# SVG file.
import os
import sys
try:
from lxml import etree
except ImportError:
import xml.etree.ElementTree as etree
from collections import defaultdict
from optparse import OptionParser
SVG_NS = 'http://www.w... | |
# -*- coding: utf-8 -*-
"""
In-memory data structures to hold the IR. We use a flow-graph of Operations.
An operation is
"""
from __future__ import print_function, division, absolute_import
from itertools import chain
from collections import defaultdict
from pykit import error, types
from pykit.adt import LinkedList... | |
# 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 applicab... | |
import time
import unittest
from exonum_client import ExonumClient
from exonum_client.crypto import KeyPair
from exonum_launcher.action_result import ActionResult
from exonum_launcher.configuration import Configuration
from exonum_launcher.explorer import ExecutionFailError
from exonum_launcher.launcher import Launche... | |
###################################################################
# Numexpr - Fast numerical array expression evaluator for NumPy.
#
# License: MIT
# Author: See AUTHORS.txt
#
# See LICENSE.txt and LICENSES/*.txt for details about copyright and
# rights to use.
##########################################... | |
"""
Tests for the suite page server.
"""
from js_test_tool.tests.helpers import TempWorkspaceTestCase
import unittest
import mock
import re
import requests
import os
import pkg_resources
import json
from js_test_tool.suite import SuiteDescription, SuiteRenderer
from js_test_tool.suite_server import SuitePageServer, Su... | |
# Copyright 2017 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 python3
# Copyright 2015-2016 Samsung Electronics Co., 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 requir... | |
"""
mbed SDK
Copyright (c) 2011-2017 ARM 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 agreed to in wr... | |
# Copyright 2012 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 requ... | |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'DataBaseGUIdesign.ui'
#
# Created by: PyQt4 UI code generator 4.11.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _from... | |
# -*- coding: utf-8 -*-
from datetime import datetime
import datetime as time
from gluon import *
import numpy as np
import random
from rank import Cost
from rank import Rank
import util
NUM_BINS = 2001
AVRG = NUM_BINS / 2
STDEV = NUM_BINS / 8
def read_db_for_get_item(venue_id):
""" The function fills containers... | |
# Licensed to Elasticsearch under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this file except... | |
# Copyright (c) 2013 VMware, 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... | |
# -*- coding: utf-8 -*-
'''
Aggregation plug-in to copy all microscopy files for a gvien experiment to the user folder.
@author: Aaron Ponti
'''
from ch.systemsx.cisd.openbis.generic.shared.api.v1.dto import SearchCriteria
from ch.systemsx.cisd.openbis.generic.shared.api.v1.dto import SearchSubCriteria
from ch.system... | |
#!/usr/bin/env python
"""Message registry for apitools."""
import collections
import contextlib
import json
from protorpc import descriptor
from protorpc import messages
import six
from apitools.gen import extended_descriptor
from apitools.gen import util
TypeInfo = collections.namedtuple('TypeInfo', ('type_name', ... | |
#!/usr/bin/env python
# Copyright 2013 AlchemyAPI
#
# 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... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
DebuggerProxy class replaces the debugger on a GUI machine that
connects to a remote debugger.
@author: Nicu Tofan <nicu.tofan@gmail.com>
"""
import cPickle
import logging
logger = logging.getLogger(__name__)
import zmq
import time
from PyQt4 import QtCore
from lear... | |
"""
This module tracks the result of a count, and provides a base class to be
implemented and used by callers of for reporting or analysis
The exposed class, BaseResults, is an abstract base class.
Your implementation should inherit from BaseResults.
"""
import datetime
import json
import abc
import os
from .common ... | |
#!/usr/bin/env python
#===- lib/asan/scripts/asan_symbolize.py -----------------------------------===#
#
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
#
#===----------------------------------------... | |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import os.path as op
import sys
import logging
import string
from collections import defaultdict
from itertools import product, combinations
from jcvi.formats.blast import BlastLine
from jcvi.formats.fasta import Fasta
from jcvi.formats.bed import Bed
from jcvi.formats.b... | |
"""Utility functions, node construction macros, etc."""
# Author: Collin Winter
# Local imports
from .pgen2 import token
from .pytree import Leaf, Node
from .pygram import python_symbols as syms
from . import patcomp
###########################################################
### Common node-construction "macros"
##... | |
# 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... | |
"""
Maya-related functions, which are useful to both `api` and `core`, including `mayaInit` which ensures
that maya is initialized in standalone mode.
"""
from __future__ import with_statement
import os.path, sys, glob, inspect
import maya
import maya.OpenMaya as om
import maya.utils
from pymel.util import picklezip, ... | |
# Copyright 2013-2017 DataStax, 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 writi... | |
# -*- coding: utf-8 -*-
# Copyright 2022 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017 Red Hat
# Licensed under The MIT License (MIT)
# http://opensource.org/licenses/MIT
#
"""
Tests for pdc_client.PDCClient class.
"""
import json
import os
import time
import traceback
try:
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
except ImportErro... | |
"""
The MIT License (MIT)
Copyright (c) 2015-present Rapptz
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merg... | |
#!/usr/bin/env python
"""
_replicator_test_
Tests for the cloudant.replicator module
"""
import unittest
import mock
import requests
from cloudant.errors import CloudantException
from cloudant.replicator import ReplicatorDatabase
from cloudant.document import Document
class ReplicatorDatabaseTests(unittest.TestCase... | |
#!/usr/bin/env python2.7
import heapq
import re
import tempfile
import importer
def _try_as_float(s):
if not s or s[0] not in '0123456789.-':
# optimization
return s
try:
return float(s)
except ValueError:
return s
def _clean_start_spaces(_line):
while _line and (_l... | |
# Copyright (c) 2016 Novo Nordisk Foundation Center for Biosustainability, DTU.
# See LICENSE for details.
import unittest
try: # noqa: C901
import gurobipy
except ImportError as e:
class TestMissingDependency(unittest.TestCase):
@unittest.skip('Missing dependency - ' + str(e))
def test_fai... | |
# encoding: utf-8
"""
Base classes and other objects used by enumerations
"""
from __future__ import absolute_import, print_function
import sys
import textwrap
def alias(*aliases):
"""
Decorating a class with @alias('FOO', 'BAR', ..) allows the class to
be referenced by each of the names provided as ar... | |
import os
import io
import codecs
import sys
import sublime
import platform
import time
import sublime_plugin
import subprocess
from subprocess import Popen, PIPE, STDOUT
from os import path
import socket
import subprocess
import errno
from socket import error as socket_error
from .utils import *
out_panel = 'CS-Scri... | |
import os
import time
import cPickle
import datetime
import logging
import flask
import werkzeug
import optparse
import tornado.wsgi
import tornado.httpserver
import numpy as np
import pandas as pd
from PIL import Image as PILImage
import cStringIO as StringIO
import urllib
import caffe
import exifutil
REPO_DIRNAME = ... | |
import token, tokenize, json, re, string, nltk
import matplotlib.pyplot as plt
import numpy as np
from matplotlib import rcParams
from cStringIO import StringIO
'''
This is psanchez's answer to:
http://stackoverflow.com/questions/4033633/handling-lazy-json-in-python-expecting-property-name
'''
f... | |
#!/usr/bin/env python3
# Copyright (c) 2015-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test processing of unrequested blocks.
Setup: two nodes, node0+node1, not connected to each other. Nod... | |
# Copyright 2013 Nicira, 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 a... | |
##########################################################################
#
# Copyright (c) 2017, 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:
#
# * Redistrib... | |
"""Websocket API for Z-Wave JS."""
from __future__ import annotations
import dataclasses
from functools import partial, wraps
import json
from typing import Any, Callable
from aiohttp import hdrs, web, web_exceptions, web_request
import voluptuous as vol
from zwave_js_server import dump
from zwave_js_server.client im... | |
# -*- coding: utf-8 -*-
# Copyright 2012 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 require... | |
import os
import re
from Utils.release_notes_generator import (get_release_notes_dict,
generate_release_notes_summary,
get_pack_entities,
get_pack_version_from_path,
... | |
#!/usr/bin/env python
"""
Blast
Genome library
Classes to handle Blast analysis against a local database
"""
import logging
import os
import subprocess
import sys
if sys.version_info[0] < 3:
from StringIO import StringIO # Python 2
else:
from io import StringIO # Python 3
__author__ = "Marco Galardini"
####... | |
# Copyright 2021 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 collections import defaultdict
import fnmatch
import json
import logging
import os
import re
import subprocess
import sys
from presubmit_canned_checks ... | |
"""Utility file for utterance generator to work with CX resources."""
# Copyright 2022 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/LICE... | |
"""Internal utilties; not for external use
"""
import contextlib
import datetime
import functools
import itertools
import re
import warnings
from collections import Mapping, MutableMapping
import numpy as np
import pandas as pd
from . import ops
from .pycompat import iteritems, OrderedDict
def alias_warning(old_nam... | |
import unittest
from reactivex import operators as ops
from reactivex.testing import ReactiveTest, TestScheduler
on_next = ReactiveTest.on_next
on_completed = ReactiveTest.on_completed
on_error = ReactiveTest.on_error
subscribe = ReactiveTest.subscribe
subscribed = ReactiveTest.subscribed
disposed = ReactiveTest.disp... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.