gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# -*- coding: utf-8 -*-
"""
Modbus Utilities
-----------------
A collection of utilities for packing data, unpacking
data computing checksums, and decode checksums.
"""
from collections import Callable
import struct
# region Helpers
def default(value):
"""
Given a python object, return the default value
... | |
# -*- coding: utf-8 -*-
"""
click.parser
~~~~~~~~~~~~
This module started out as largely a copy paste from the stdlib's
optparse module with the features removed that we do not need from
optparse because we implement them in Click on a higher level (for
instance type handling, help formatting and a lot more).
The pla... | |
#!/usr/bin/env python
"""
CSV Utility Module
"""
import csv
import re
__version__ = '0.0.0'
#=============================================================================
class reader( csv.reader ):
"""
Implements similar functionality as the built-in CSV reader module, but
maps data to be contained... | |
import numpy as np
import pytest
import pandas as pd
from pandas import Index, MultiIndex, Series
import pandas._testing as tm
@pytest.mark.parametrize("case", [0.5, "xxx"])
@pytest.mark.parametrize(
"method", ["intersection", "union", "difference", "symmetric_difference"]
)
def test_set_ops_error_cases(idx, cas... | |
""" command line options, ini-file and conftest.py processing. """
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import copy
import inspect
import os
import shlex
import sys
import types
import warnings
from distutils.version import LooseVe... | |
# Copyright (c) 2006-2007, 2009-2014 LOGILAB S.A. (Paris, FRANCE) <contact@logilab.fr>
# Copyright (c) 2013-2016 Claudiu Popa <pcmanticore@gmail.com>
# Copyright (c) 2014 Google, Inc.
# Copyright (c) 2015 Florian Bruhin <me@the-compiler.org>
# Copyright (c) 2015-2016 Cara Vinson <ceridwenv@gmail.com>
# Licensed under ... | |
#!/usr/bin/env python
# http://gerrit-documentation.googlecode.com/svn/Documentation/2.2.2/cmd-
# query.html
import pkg_resources
import subprocess
from datetime import datetime
import simplejson as json
import time
import tempfile
import textwrap
import pydoc
import os
VALID_SCORES = ['-2', '-1', '-0', '0', '+0', ... | |
# Copyright 2017,2018 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 agr... | |
# Standard library imports
import argparse
import importlib
import json
import os
import sys
import textwrap
import time
from shutil import rmtree
# TODO:
# catch and log exceptions in examples files that fail to open
DIRECTORIES = {
'plotting-file' : '../../examples/plotting/file',
'plotting-noteboo... | |
"""
The feed is an assembly of items of different content types.
For ease of querying, each different content type is housed in the FeedItem
model, which also houses metadata indicating the conditions under which it
should be included. So a feed is actually just a listing of FeedItem instances
that match the user's reg... | |
# 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... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import dateutil.parser
import posixpath
from tornado.web import HTTPError
from IPython.html.services.notebooks.nbmanager import NotebookManager
from IPython.nbformat import current
from IPython.utils.traitlets import Dict, TraitError, Unicode
from IPython.utils.tz impor... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 Nicira Networks, 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.apach... | |
#!/usr/bin/env python
#
# Copyright (c) 2016, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# ... | |
import pyblish.api
class IntegrateAvalonAsset(pyblish.api.InstancePlugin):
"""Write to files and metadata
This plug-in exposes your data to others by encapsulating it
into a new version.
"""
label = "Asset"
order = pyblish.api.IntegratorOrder
families = [
"mindbender.model",
... | |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
from __future__ import with_statement
import glob
import os
import hmac
import hashlib
import shutil
import socket
import subprocess
import struct
from twisted.internet import defer
from twisted.internet.interfaces i... | |
# 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... | |
# Copyright 2019 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... | |
"""
====================================================================================
"""
from rdflib import (
BNode,
Literal,
Namespace,
RDF,
URIRef,
Variable,
)
from rdflib.store import Store
from rdflib.graph import QuotedGraph, Graph
from rdflib.namespace import NamespaceManager
from... | |
#!/usr/bin/env python
# Copyright (c) 2006,2007,2008 Mitch Garnaat http://garnaat.org/
#
# 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 th... | |
# Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | |
# django imports
from django.contrib.auth.models import Group
from django.contrib.auth.models import User
from django.contrib.contenttypes.models import ContentType
from django.core.urlresolvers import reverse
from django.http import Http404
from django.test import TestCase
from django.test.client import Client
# perm... | |
#!/usr/bin/env python
#
# Appcelerator Titanium Module Packager
#
#
import os, subprocess, sys, glob, string
import zipfile
from datetime import date
cwd = os.path.abspath(os.path.dirname(sys._getframe(0).f_code.co_filename))
os.chdir(cwd)
required_module_keys = ['name','version','moduleid','description','copyright','... | |
# Copyright 2011 Denali Systems, 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 requ... | |
# ===============================================================================
# Copyright 2013 Jake Ross
#
# 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/licens... | |
"""
homeassistant.components.mqtt
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MQTT component, using paho-mqtt. This component needs a MQTT broker like
Mosquitto or Mosca. The Eclipse Foundation is running a public MQTT server
at iot.eclipse.org. If you prefer to use that one, keep in mind to adjust
the topic/client ID and that your ... | |
import inspect
import types
import unittest
from test.support import import_module
asyncio = import_module("asyncio")
class AwaitException(Exception):
pass
@types.coroutine
def awaitable(*, throw=False):
if throw:
yield ('throw',)
else:
yield ('result',)
def run_until_complete(coro):
... | |
#!/usr/bin/env python
__author__ = 'waroquiers'
import unittest
import os
import json
import shutil
from pymatgen.analysis.chemenv.coordination_environments.coordination_geometry_finder import LocalGeometryFinder
from pymatgen.analysis.chemenv.coordination_environments.structure_environments import StructureEnvironm... | |
# Reads an array and turns it into simple features for machine learning
#
# To make this work you will probably need to install the
# following packages:
# pip install Pillow
# pip install tesserocr
# pip install python-dateutil
# pip install visual-logging
import cv2
import glob
import sys
import nump... | |
#!/usr/bin/env python3
# Copyright 2010-2021 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 ... | |
from __future__ import unicode_literals
import json
import six
import re
from moto.core.responses import BaseResponse
from moto.core.utils import camelcase_to_underscores
from .models import dynamodb_backend2, dynamo_json_dump
GET_SESSION_TOKEN_RESULT = """
<GetSessionTokenResponse xmlns="https://sts.amazonaws.com/d... | |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from builtins import str
from past.builtins import basestring
from collections import defaultdict
from datetime import datetime
from itertools import product
import getpa... | |
#!/usr/bin/env python
import json
import time
import requests
import sys
import traceback
import re
import types
from abc import abstractmethod
from bottle import request, response
from ..smcontext import SmContext, ServiceManagerException
from ..smport import PortProvider
RUN_ON_PORT = 8085
RUN_ON_HOST = "localhos... | |
from customSearchEngine import CustomSearchEngine
from cryptoConverter import CryptoConverter
from stockInfo import StockInfo
import dataContainers
import globalSettings
import datetime
import random
import logging
_logger = logging.getLogger()
#This class is mainly a way to keep the code clean
#So any functions req... | |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2011 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://babel.edgewall.org/wiki/License.
#
# This software consists... | |
"""
Ops for downsampling images.
Planned:
Pool, DownsampleAvg, DownsampleSoftmax.
"""
from __future__ import absolute_import, print_function, division
# This file should move along with conv.py
import warnings
import numpy
from six import integer_types
from six.moves import xrange
import six.moves.builtins as builtin... | |
# ===============================================================================
# Copyright 2013 Jake Ross
#
# 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... | |
#import functools
import ssl
import sys
import re
import json
import pytz
from itertools import chain
from django.shortcuts import render, redirect
from django.http import Http404
from django.views.generic import ListView
from django.db.models import Q
from django.views.decorators.csrf import csrf_protect, csrf_exempt
... | |
#!/usr/bin/env python
#
# Copyright 2007 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 applicable law o... | |
# pylint: skip-file
# flake8: noqa
class RouterException(Exception):
''' Router exception'''
pass
class RouterConfig(OpenShiftCLIConfig):
''' RouterConfig is a DTO for the router. '''
def __init__(self, rname, namespace, kubeconfig, router_options):
super(RouterConfig, self).__init__(rname,... | |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
import frappe.model.meta
from frappe.model.dynamic_links import get_dynamic_link_map
import frappe.defaults
from frappe.utils.file_manager import remove_all
from fr... | |
# -*- coding: utf-8 -*-
from keras.engine import Layer, InputSpec
from keras import initializers, regularizers
from keras import backend as K
from keras.utils.generic_utils import get_custom_objects
import numpy as np
class BatchRenormalization(Layer):
"""Batch renormalization layer (Sergey Ioffe, 2017). Source ... | |
#
# pymatgen documentation build configuration file, created by
# sphinx-quickstart on Tue Nov 15 00:13:52 2011.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values h... | |
"""
sentry.models.groupassignee
~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import logging
import six
from collections import defaultdict
from django.conf import settings... | |
# 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... | |
from django.db.models.fields import Field
from django.db.models.sql.expressions import SQLEvaluator
from django.utils.translation import ugettext_lazy as _
from django.contrib.gis import forms
from django.contrib.gis.db.models.proxy import GeometryProxy
from django.contrib.gis.geometry.backend import Geometry, Geometry... | |
'''
Methods which sonify annotations for "evaluation by ear".
All functions return a raw signal at the specified sampling rate.
'''
import numpy as np
from numpy.lib.stride_tricks import as_strided
from scipy.interpolate import interp1d
from . import util
from . import chord
def clicks(times, fs, click=None, length... | |
""" Non-negative matrix factorization
"""
# Author: Vlad Niculae
# Lars Buitinck <L.J.Buitinck@uva.nl>
# Author: Chih-Jen Lin, National Taiwan University (original projected gradient
# NMF implementation)
# Author: Anthony Di Franco (original Python and NumPy port)
# License: BSD 3 clause
from __future__ ... | |
"""
raven.contrib.django.models
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Acts as an implicit hook for Django installs.
:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from __future__ import unicode_literals
from h... | |
"""Test suite for abdi_processrepo."""
from __future__ import absolute_import
import contextlib
import types
import unittest
import phlcon_differential
import phlmail_mocksender
import phlsys_pluginmanager
import abdmail_mailer
import abdt_arcydreporter
import abdt_branchmock
import abdt_conduitmock
import abdt_exc... | |
from __future__ import unicode_literals
from collections import OrderedDict
import keyword
import re
from django.core.management.base import BaseCommand, CommandError
from django.db import connections, DEFAULT_DB_ALIAS
class Command(BaseCommand):
help = "Introspects the database tables in the given database and... | |
import keras
from keras.models import Model
from keras.models import Sequential
from keras.layers import Flatten
from keras.layers import Dense
from keras.layers import Input
from keras.layers import Conv2D
from keras.layers import Conv2DTranspose
from keras.layers import Cropping2D
from keras.layers import MaxPooling... | |
# Copyright 2018 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... | |
"""
Pure Python GeoIP API. The API is based off of U{MaxMind's C-based Python API<http://www.maxmind.com/app/python>},
but the code itself is based on the U{pure PHP5 API<http://pear.php.net/package/Net_GeoIP/>}
by Jim Winstead and Hans Lellelid.
It is mostly a drop-in replacement, except the
C{new} and C{open} method... | |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
import unittest
import os
from pymatgen.io.qchem.sets import *
from pymatgen.util.testing import PymatgenTest
from pymatgen.io.qchem.inputs import QCInput
__author__ = "Samuel Blau, Brandon Wood, Shyam Dwara... | |
# ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributi... | |
#
# 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 us... | |
# -*- coding: utf-8 -*-
"""
flaskbb.forum.models
~~~~~~~~~~~~~~~~~~~~
It provides the models for the forum
:copyright: (c) 2014 by the FlaskBB Team.
:license: BSD, see LICENSE for more details.
"""
from datetime import datetime, timedelta
from flask import url_for, abort
from sqlalchemy.orm impor... | |
import json
import re
import warnings
import time
from random import randint
from ..utils import gen_user_breadcrumb
from ..compatpatch import ClientCompatPatch
class MediaEndpointsMixin(object):
"""For endpoints in ``/media/``."""
def media_info(self, media_id):
"""
Get media info
... | |
"""Extract reference documentation from the NumPy source tree.
"""
# copied from numpydoc/docscrape.py
import inspect
import textwrap
import re
import pydoc
from warnings import warn
from collections import namedtuple
from collections.abc import Callable, Mapping
import copy
import sys
def strip_blank_lines(l): # n... | |
#
# 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... | |
"""SMA Solar Webconnect interface."""
from __future__ import annotations
import logging
from typing import Any
import pysma
import voluptuous as vol
from homeassistant.components.sensor import (
PLATFORM_SCHEMA,
STATE_CLASS_MEASUREMENT,
STATE_CLASS_TOTAL_INCREASING,
SensorEntity,
)
from homeassistant... | |
# 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... | |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import pandas as pd
import os.path
import os
import json
import utils
import numpy as np
import pprint
from model import Model, Schuetze, Satz, Event
import uuid
import plots
import gzip
class JSONModel(Model):
"""
A JSON based model. Stores everything in a JSO... | |
import io
import os
import threading
import unittest
import urllib.robotparser
from test import support
from http.server import BaseHTTPRequestHandler, HTTPServer
class BaseRobotTest:
robots_txt = ''
agent = 'test_robotparser'
good = []
bad = []
site_maps = None
def setUp(self):
lines... | |
# -*- coding: utf-8 -*-
"""Maximum flow algorithms test suite.
"""
from nose.tools import *
import networkx as nx
from networkx.algorithms.flow import build_flow_dict, build_residual_network
from networkx.algorithms.flow import (edmonds_karp, ford_fulkerson,
preflow_push, shortest_augmenting_path)
flow_funcs = [e... | |
import sys, os, re, urllib, urllib3, httplib, time, json, hmac, hashlib, base64
from decimal import Decimal
from common.functions import console_log
from exchange.exchange_abstract import ExchangeAbstract, Order
class MtGox1(ExchangeAbstract):
"""
See:
https://en.bitcoin.it/wiki/MtGox/API
"""
_la... | |
"""
Forcefield.py
This module takes a pdblist as input and replaces the occupancy and
tempfactor fields with charge and radius fields, with values as defined
by a particular forcefield. The forcefield structure is modeled off of
the structures.py file, where each forcefield is considered a chain o... | |
# pylint: disable=bad-indentation,line-too-long,missing-function-docstring
"""
When near_policy_dataset = True, the behavior and target policy is trained in an
environment with noise_level = 0, and run_id = 1.
Otherwise, the target policy is trained in an environment with the same
noise_level as that to be evaluated.
"... | |
import sys
import urllib
import cookielib
import re
import requests
from bs4 import BeautifulSoup
# This is a debug parameter, turn it 1 for printing some debug messages
isDebug = 0
# Function to take the torrent search keyword as input from user
# parameters: None
# returns: Name of the torrent in URL encoded form... | |
# mssql.py
"""Support for the Microsoft SQL Server database.
Connecting
----------
See the individual driver sections below for details on connecting.
Auto Increment Behavior
-----------------------
``IDENTITY`` columns are supported by using SQLAlchemy
``schema.Sequence()`` objects. In other words::
from sql... | |
import faulthandler
import importlib
import io
import os
import sys
import time
import traceback
import unittest
from test import support
from test.libregrtest.refleak import dash_R, clear_caches
from test.libregrtest.save_env import saved_test_environment
# Test result constants.
PASSED = 1
FAILED = 0
ENV_CHANGED = ... | |
from datetime import date, timedelta
import mock
from suds import WebFault
from ssl import SSLError
from unittest2 import TestCase
from authorize.apis.recurring import PROD_URL, RecurringAPI, TEST_URL
from authorize.data import CreditCard
from authorize.exceptions import AuthorizeConnectionError, \
AuthorizeInval... | |
"""
Photon scattering in quantum optical systems
This module includes a collection of functions for numerically computing photon
scattering in driven arbitrary systems coupled to some configuration of output
waveguides. The implementation of these functions closely follows the
mathematical treatment given in K.A. Fisc... | |
#Copyright (c) 2017 Vantiv eCommerce
#
#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, merge, publish, distri... | |
"""Project
"""
from common import *
from mergedict import merge_recurse_inplace
from storage import ShelveStorage as Storage
import clang.cindex
import compdb
import logging
import math
import multiprocessing as mp
import os
import parser
import pprint
import re
import sys
import time
import util
def parse_one(src, ... | |
# -*- coding: utf-8 -*-
"""Fake data generator.
To use:
1. Install fake-factory.
pip install fake-factory
2. Create your OSF user account
3. Run the script, passing in your username (email).
::
python -m scripts.create_fakes --user fred@cos.io
This will create 3 fake public projects, each with 3 fake con... | |
"creatures.py - Pyro creatures"
from util import *
import items
import dungeons
import astar
class Bite(items.MeleeAttackType):
name = "bite"
verbs = lang.verbs_bite # no damage, hit, crit
verbs_sp = lang.verbs_bite_2p
damage = "1d4"
class Claw(items.MeleeAttackType):
name = "claw"
ve... | |
# 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... | |
import os
import os.path
import sys
import functools
import time
import imp
import code
import platform
import threading
import collections
import weakref
import gevent
import gevent.pool
import gevent.socket
import gevent.threadpool
import gevent.greenlet
import faststat
from support import context
from support im... | |
#
# 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... | |
#!/usr/bin/env python
"""The in memory database methods for path handling."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from future.builtins import filter
from future.utils import iteritems
from future.utils import iterkeys
from typing import Dict
f... | |
import mock
from curling.lib import HttpClientError
from nose.tools import eq_, ok_
from pyquery import PyQuery as pq
from test_utils import RequestFactory
import amo
import amo.tests
from mkt.constants.payments import (PAYMENT_METHOD_ALL, PAYMENT_METHOD_CARD,
PAYMENT_METHOD_OPERATOR)
f... | |
# coding:utf-8
# from django.test import TestCase
from mocker import (
MockerTestCase,
# ANY,
# KWARGS,
)
class AutomataTests(MockerTestCase):
def _makeOne(self, *args, **kwargs):
from export import markupfile
return markupfile.Automata(*args, **kwargs)
def test_instantiation(self... | |
from physicsTable import *
from operator import itemgetter
import sys
import geometry
import numpy as np
# Constants for ease
L = 101
R = -101
T = 103
B = -103
# Wall class for various operations
class Wall(object):
def __init__(self, p1, p2):
self.l = p1[0]
self.t = p1[1]
self.r = p2[0]
... | |
# Copyright 2014 eBay Software 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 ... | |
import io
from pathlib import Path
from typing import List, Dict, Any, Union, Generator
import urllib.request as request
import urllib.parse as urlparse
import zlib
from os.path import splitext
import pickle
import fnmatch
"""
Copyright 2017 David B. Bracewell
Licensed under the Apache License, Version 2.0 (the... | |
#!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | |
#
# 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 us... | |
# 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 required by applicable law or ... | |
# -*- coding: utf-8 -*-
"""
Coop_cms settings : central place for coop_cms settings
the settings should be accessed from here and not directly from django.conf.settings
"""
import os.path
import sys
from six import string_types
from django.conf import settings as django_settings
from django.conf.urls.i18n import i18n... | |
import unittest
from mako.lexer import Lexer
from mako import exceptions, util
from util import flatten_result, result_lines
from mako.template import Template
import re
from test import TemplateTest, template_base, skip_if, eq_, assert_raises_message
# create fake parsetree classes which are constructed
# exactly as... | |
# -*- coding: utf-8 -*-
from __future__ import print_function
import sys
import numpy
import tables
from tables import (
Col, StringCol, Atom, StringAtom, Int16Atom, Int32Atom,
FloatAtom, Float64Atom,
)
from tables.tests import common
from tables.tests.common import unittest, test_filename
from tables.tests.... | |
from typing import Dict, List, Iterator, Optional, Tuple
import os.path
from pathlib import Path
import re
import fnmatch
import itertools
import json
import attr
from click import BadParameter
from requests import Session, RequestException
from retrying import retry
from elm_doc import elm_platform
ModuleName = st... | |
import urllib
import urlparse
from gevent.queue import Empty
from geventwebsocket import WebSocketError
class BaseTransport(object):
"""Base class for all transports. Mostly wraps handler class functions."""
def __init__(self, handler, config, **kwargs):
"""Base transport class.
:param conf... | |
import functools
import tensorflow as tf
from .doc_utils import add_name_arg_doc
from .type_utils import is_tensor_object
__all__ = [
'get_static_shape', 'get_batch_size', 'get_rank', 'get_shape',
'get_dimension_size', 'get_dimensions_size', 'resolve_negative_axis',
'concat_shapes', 'is_shape_equal',
]
... | |
from decimal import Decimal
from django.contrib.gis.db.models.fields import BaseSpatialField, GeometryField
from django.contrib.gis.db.models.sql import AreaField, DistanceField
from django.contrib.gis.geos import GEOSGeometry
from django.core.exceptions import FieldError
from django.db.models import (
BooleanFiel... | |
# Test the runpy module
import unittest
import os
import os.path
import sys
import tempfile
from test.support import verbose, run_unittest, forget
from runpy import _run_code, _run_module_code, run_module
# Note: This module can't safely test _run_module_as_main as it
# runs its tests in the current process, which wou... | |
# Copyright 2013 Hewlett-Packard Development Company, L.P.
#
# Author: Endre Karlson <endre.karlson@managedit.ie>
#
# 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.or... | |
"""
A context object for caching a function's return value each time it
is called with the same input arguments.
"""
# Author: Gael Varoquaux <gael dot varoquaux at normalesup dot org>
# Copyright (c) 2009 Gael Varoquaux
# License: BSD Style, 3 clauses.
from __future__ import with_statement
import os
import shutil
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.