gt
stringclasses
1 value
context
stringlengths
2.49k
119k
"""Generic socket server classes. This module tries to capture the various aspects of defining a server: For socket-based servers: - address family: - AF_INET{,6}: IP (Internet Protocol) sockets (default) - AF_UNIX: Unix domain sockets - others, e.g. AF_DECNET are conceivable (see <socket.h> ...
# All fields except for BlobField written by Jonas Haag <jonas@lophus.org> from django.db import models from django.core.exceptions import ValidationError from django.utils.importlib import import_module __all__ = ('RawField', 'ListField', 'DictField', 'SetField', 'BlobField', 'EmbeddedModelField') class ...
#!/usr/bin/env python ''' gpsys.py -- print system properties Usage: gpsys.py [-p] [-t] -p : print system properties in Python pickled format -t : print system properties in Text (default). ''' import os, platform, sys, getopt, pickle from datetime import datetime opt = {} opt['-p'] = False GPHOME=os.get...
""" The Plaid API The Plaid REST API. Please see https://plaid.com/docs/api for more details. # noqa: E501 Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 from plaid.model_utils import ( # noqa: F401 ApiTypeError, ModelComposed, ModelNormal...
#!/usr/bin/env python # -*- coding: utf8 -*- # pylint: disable=W0212 from collections import OrderedDict try: from cdecimal import Decimal except ImportError: # pragma: no cover from decimal import Decimal import sys from babel.numbers import format_decimal import six from agate.aggregations import Min, ...
""" Web Colors Copyright (c) 2008-2016, James Bennett <@ubernostrum> All rights reserved. https://github.com/ubernostrum/webcolors Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must ...
# orm/interfaces.py # Copyright (C) 2005-2011 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ Contains various base classes used throughout the ORM. Defines the now depreca...
# coding: utf-8 # # Copyright 2014 The Oppia 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 requi...
""" The MNIST dataset. """ __authors__ = "Ian Goodfellow" __copyright__ = "Copyright 2010-2012, Universite de Montreal" __credits__ = ["Ian Goodfellow"] __license__ = "3-clause BSD" __maintainer__ = "LISA Lab" __email__ = "pylearn-dev@googlegroups" import numpy as N np = N from theano.compat.six.moves import xrange fr...
# Copyright (C) 2011 Google 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: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
import numpy as np from numba import cuda, int32, int64, float32, float64 from numba.cuda.testing import unittest, CUDATestCase, skip_on_cudasim from numba.core import config def useful_syncwarp(ary): i = cuda.grid(1) if i == 0: ary[0] = 42 cuda.syncwarp(0xffffffff) ary[i] = ary[0] def use_s...
# 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...
# Tests for the targz module. import gzip import logging import os import pytest import random import sys import tarfile import zlib # Code under test: import targzstream V2 = sys.version_info.major == 2 logging.basicConfig(level=logging.DEBUG) def test_disallow_compression(tmpdir): """The resulting tarfile c...
import numpy as np from theano.tensor import as_tensor_variable from ContinuousTimeMarkovModel.distributions import * from pymc3 import Model, sample, Metropolis, Dirichlet, Potential, Binomial, Beta, Slice, NUTS import theano.tensor as TT from ContinuousTimeMarkovModel.samplers.forwardS import * from ContinuousTimeMar...
#!/usr/bin/env python """Translate Wikipedia edit history XML files to JSON. This script assumes that the Wikipedia edit history XML files are ordered as follows: <mediawiki> ... <page> <title></title> <ns></ns> <id></id> <redirect title="" /> <!-- ...
# Copyright 2020-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 agreed to in writ...
# Copyright (c) 2006-2007 The Regents of The University of Michigan # Copyright (c) 2009 Advanced Micro Devices, 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: redistributions of source co...
"""Abstract tensor product.""" from __future__ import print_function, division from sympy import Expr, Add, Mul, Matrix, Pow, sympify from sympy.core.compatibility import u from sympy.core.trace import Tr from sympy.printing.pretty.stringpict import prettyForm from sympy.physics.quantum.qexpr import QuantumError fro...
#!/usr/bin/env python # encoding: UTF-8 import asyncio from collections import deque from collections import namedtuple import concurrent.futures import datetime import functools import logging import operator import re import textwrap import uuid import xml.etree.ElementTree as ET import xml.sax.saxutils import aioh...
# -*- coding: utf-8 -*- import os, sys; sys.path.insert(0, os.path.join("..", "..")) import unittest from pattern import graph #--------------------------------------------------------------------------------------------------- class TestUtilityFunctions(unittest.TestCase): def setUp(self): pass ...
from jsonrpc import ServiceProxy import sys import string # ===== BEGIN USER SETTINGS ===== # if you do not set these you will be prompted for a password for every command rpcuser = "" rpcpass = "" # ====== END USER SETTINGS ====== if rpcpass == "": access = ServiceProxy("http://127.0.0.1:9332") else: access = Ser...
# Licensed under the MIT License - https://opensource.org/licenses/MIT from sklearn import neighbors, tree, svm from sklearn.linear_model import SGDClassifier, LogisticRegression from sklearn.utils import shuffle from sklearn.base import BaseEstimator from sklearn.utils.validation import check_X_y, check_array, check_...
#!/usr/bin/env python3 # Copyright (c) 2020 The Bitcoin Unlimited developers """ Tests the electrum call 'blockchain.transaction.get' """ import asyncio from test_framework.util import assert_equal, p2p_port from test_framework.electrumutil import ElectrumTestFramework, ElectrumConnection from test_framework.nodemessag...
""" Variational Auto-Encoder. Copyright (C) 2017, Lucas Ondel 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, m...
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'HelpPage' db.create_table( 'sentry_helppage', ( ('id', self.gf('s...
### # Copyright (c) 2002-2005, Jeremiah Fincher # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, # this list of co...
#!/usr/bin/env python # coding: utf-8 import nose from pandas import Series, DataFrame from pandas.compat import lmap import pandas.util.testing as tm from pandas.util.testing import slow import numpy as np from numpy import random from numpy.random import randn import pandas.tools.plotting as plotting from pandas....
#!/usr/bin/python # Copyright (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCUMENTATION = ''' --- module:...
from construct3.lib import singleton import sys from construct3.lib.binutil import BitStreamReader, BitStreamWriter from construct3.lib.containers import Container from construct3.lib.config import Config try: from io import BytesIO except ImportError: from cStringIO import StringIO as BytesIO import six from ...
# 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...
""" Least Angle Regression algorithm. See the documentation on the Generalized Linear Model for a complete discussion. """ from __future__ import print_function # Author: Fabian Pedregosa <fabian.pedregosa@inria.fr> # Alexandre Gramfort <alexandre.gramfort@inria.fr> # Gael Varoquaux # # License: BSD 3 ...
import warnings import numpy as np from pandas import ( Categorical, DataFrame, Series, ) from .pandas_vb_common import tm class Dtypes: params = ["str", "string", "arrow_string"] param_names = ["dtype"] def setup(self, dtype): from pandas.core.arrays.string_arrow import ArrowStrin...
from __future__ import division,print_function import math, os, json, sys, re import _pickle as pickle from glob import glob import numpy as np from matplotlib import pyplot as plt from operator import itemgetter, attrgetter, methodcaller from collections import OrderedDict import itertools from itertools import chain ...
import re import numpy as np import scipy.sparse import pytest from sklearn.datasets import load_digits, load_iris from sklearn.model_selection import train_test_split from sklearn.model_selection import cross_val_score from sklearn.utils._testing import assert_almost_equal from sklearn.utils._testing import assert...
import io, math, os, os.path, pickle, struct from struct import Struct from Catalog.Identifiers import PageId, FileId, TupleId from Catalog.Schema import DBSchema from Storage.Page import PageHeader, Page from Storage.SlottedPage import SlottedPageHeader, SlottedPage class FileHeader: """ A file heade...
# # 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...
""" Miscellaneous Routines. """ import struct # from sys import maxint as INF #doesn't work anymore under Python3, # but PDF still uses 32 bits ints INF = (1<<31) - 1 import six #Python 2+3 compatibility if six.PY3: import chardet # For str encoding detection in Py3 unicode = str def make_compat_bytes(in_...
"""Profile page test""" import datetime from django.test import TransactionTestCase from django.core.urlresolvers import reverse from django.contrib.auth.models import User from apps.managers.challenge_mgr import challenge_mgr from apps.utils import test_utils from apps.widgets.smartgrid.models import Activity, Actio...
from open_vsdcli.vsd_common import * @vsdcli.command(name='user-list') @click.option('--enterprise-id', metavar='<id>') @click.option('--group-id', metavar='<id>') @click.option('--filter', metavar='<filter>', help='Filter for firstName, lastName, userName, email, ' 'lastUpdatedDate, ...
# Copyright 2014 Rackspace Hosting # 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...
#!/usr/bin/python # # Copyright (c) 2016 Juniper Networks, Inc. All rights reserved. # alarm_list = [ { "alarm_rules": { "or_list" : [ { "and_list": [ { "operand1": "ContrailConfig.elements.virtual_router_ip...
""" Dynamically generated set of TestCases based on set of yaml files decribing some integration tests. These files are shared among all official Elasticsearch clients. """ import re from os import walk, environ from os.path import exists, join, dirname, pardir import yaml from elasticsearch import TransportError from...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Partially based on AboutMessagePassing in the Ruby Koans # from runner.koan import * class AboutAttributeAccess(Koan): class TypicalObject: pass def test_calling_undefined_functions_normally_results_in_errors(self): typical = self.Typ...
# 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/python2.7 # encoding: utf-8 # Copyright 2010 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 ...
import codepy.cgen from cgen import * import xml.etree.ElementTree as ElementTree # these are additional classes that, along with codepy's classes, let # programmers express the C code as a real AST (not the hybrid AST/strings/etc # that codepy implements. #TODO: add all of CodePy's classes we want to support class ...
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
# 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 ReportLab Europe Ltd. 2000-2004 #see license.txt for license details #history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/graphics/charts/piecharts.py # experimental pie chart script. Two types of pie - one is a monolithic #widget with all top-level properties, the other ...
from __future__ import absolute_import """Routine to monitor the modal gain in each pixel as a function of time. Uses COS Cumulative Image (CCI) files to produce a modal gain map for each time period. Modal gain maps for each period are collated to monitor the progress of each pixel(superpixel) with time. Pixels th...
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Creates a zip file of a build and upload it to google storage. This will be used by the ASAN/TSAN security tests uploaded to C...
"""Template class with arithmetic operations that can be passed through neural network. All classes that are being used for derest should inherit from this class.""" class Numlike(object): """Template class with arithmetic operations that can be passed through neural network. All classes that are being ...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # 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...
from oidc_provider.lib.errors import RedirectUriError try: from urllib.parse import urlencode, quote except ImportError: from urllib import urlencode, quote try: from urllib.parse import parse_qs, urlsplit except ImportError: from urlparse import parse_qs, urlsplit import uuid from mock import patch, m...
# coding=utf-8 # # # 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...
# Copyright 2010 Jacob Kaplan-Moss # Copyright 2011 OpenStack Foundation # Copyright 2011 Piston Cloud Computing, Inc. # Copyright 2013 Alessio Ababilov # Copyright 2013 Grid Dynamics # Copyright 2013 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you ...
#!/usr/bin/env python # ------------------------------------------------------------------------------ # Copyright (c) 2010-2013, EVEthing team # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # ...
# # BaseImage.py -- Abstraction of an generic data image. # # This is open-source software licensed under a BSD license. # Please see the file LICENSE.txt for details. # import numpy as np import logging from ginga.misc import Bunch, Callback from ginga import trcalc, AutoCuts class ImageError(Exception): pass ...
""" dj-stripe Event Handler tests """ from copy import deepcopy from decimal import Decimal from unittest.mock import ANY, call, patch from django.contrib.auth import get_user_model from django.test import TestCase from stripe.error import InvalidRequestError from djstripe.enums import SubscriptionStatus from djstrip...
""" A collection of functions to synchronize subtitle (SRT) file Synchronizes i.e. delays, or hastens a complete subtitle (SRT) file, or part of it Functions: sync -- Synchronizes a complete subtitle file sync_after_time -- Synchronizes the subtitles occuring after a ...
"""Dictionary Of Keys based matrix""" from __future__ import division, print_function, absolute_import __docformat__ = "restructuredtext en" __all__ = ['dok_matrix', 'isspmatrix_dok'] import functools import operator import numpy as np from scipy._lib.six import zip as izip, xrange from scipy._lib.six import iter...
from apollo.choices import CHARGE_LIST_OPEN from apollo.viewmixins import LoginRequiredMixin, ActivitySendMixin, StaffRequiredMixin from applications.business.models import Business from applications.charge_list.forms import ActivityChargeCatalog, TimeChargeCatalog, UnitChargeCatalog from applications.charge_list.model...
""" crmngr puppetmodule module """ # stdlib from collections import namedtuple import hashlib import logging from datetime import datetime # crmngr from crmngr import cprint from crmngr.forgeapi import ForgeApi from crmngr.forgeapi import ForgeError from crmngr.git import GitError from crmngr.git import Repository L...
#!/usr/bin/env python # -*- coding: utf-8 -*- from sqlalchemy import Column, DateTime, Float, Integer, String, Table, text from sqlalchemy.ext.declarative import declarative_base Base = declarative_base() metadata = Base.metadata class AllstarFull(Base): __tablename__ = u'AllstarFull' playerID = Column(Str...
#!/usr/bin/env python VERSION = "1.0.4" profiles = ''' <profiles> <profile> <id>scala-2.10</id> <activation> <activeByDefault>true</activeByDefault> </activation> <properties> <scala.version>2.10.6</scala.version> <scala.binary.version>2.10</scala.binary.version> ...
# # 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...
# 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...
# 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 use ...
"""Consulate CLI commands""" # pragma: no cover import argparse import base64 import json import sys import os try: import urlparse except ImportError: import urllib.parse as urlparse from requests import exceptions import consulate from consulate import adapters from consulate import utils CONSUL_ENV_VAR = ...
# Copyright (c) 2014 NetApp, Inc. # Copyright (c) 2015 Alex Meade. All Rights Reserved. # Copyright (c) 2015 Rushil Chugh. All Rights Reserved. # Copyright (c) 2015 Navneet Singh. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in comp...
""" types.py """ from __future__ import division import abc import copy import six from cryptography.hazmat.primitives.constant_time import bytes_eq from ..constants import PacketTag from ..decorators import sdproperty from ..types import Dispatchable from ..types import Field from ..types import Header as _Header...
# Copyright (C) 2015 ibu radempa <ibu@radempa.de> # # 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, me...
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Make coding more python3-ish from __future__ import (absolute_import, division, print_function) __metaclass__ = type import c...
# -*- encoding: utf-8 -*- # # 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...
# Copyright 2020 Tensorforce Team. 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 la...
# -*- coding: utf-8 -*- # 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,...
# -*- coding: utf-8 -*- import re from django import forms from django.db import models from django.contrib import messages from django.core.exceptions import ValidationError from django.db import transaction from django.http import Http404 from django.http import HttpResponseRedirect from django.utils import timezo...
#!/usr/bin/python # Copyright (C) 2015, WSID # 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, publ...
# # Copyright 2012 SAS Institute # # 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 ...
# coding: utf-8 """ DocuSign REST API The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign. # noqa: E501 OpenAPI spec version: v2.1 Contact: devcenter@docusign.com Generated by: https://github.com/swagger-api/swagger-codegen.gi...
''' Cosmo Zhang @ Purude neuromodules.py neuro layer toolkit in theano ''' import theano import theano.tensor as T import numpy as np class LogisticRegression(object): """ Multi-class Logistic Regression Class The logistic regression is fully described by a weight matrix :math:`W` and bias vector :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 u...
# -*- coding: utf-8 -*- """Setup the allura application""" import os import sys import logging import shutil from collections import defaultdict from datetime import datetime import tg from pylons import c, g from paste.deploy.converters import asbool from ming import Session, mim from ming.orm import state, session ...
"""Integration providing core pieces of infrastructure.""" import asyncio import itertools as it import logging import voluptuous as vol from homeassistant.auth.permissions.const import CAT_ENTITIES, POLICY_CONTROL import homeassistant.config as conf_util from homeassistant.const import ( ATTR_ENTITY_ID, ATTR...
import mock import unittest from .helper import _ResourceMixin class ChargeTest(_ResourceMixin, unittest.TestCase): def _getTargetClass(self): from .. import Charge return Charge def _getCardClass(self): from .. import Card return Card def _getSourceClass(self): ...
# vim: set et sw=4 sts=4 fileencoding=utf-8: # # Python camera library for the Rasperry-Pi camera module # Copyright (c) 2013-2017 Dave Jones <dave@waveform.org.uk> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # ...
import pygame from math import sqrt #http://www.raywenderlich.com/4946/introduction-to-a-pathfinding class GridWorld(): """Grid world that contains animals living in cells.""" def __init__(self,width=10,height=10,cell_size=50): pygame.init() self.screen = pygame.display.set_mode((height*cell_si...
import warnings import uuid from unittest import TestCase from .models import ( SimpleTestModel, DerivedPartitionPrimaryKeyModel, PartitionPrimaryKeyModel, ClusterPrimaryKeyModel, ColumnFamilyTestModel ) from .util import ( connect_db, destroy_db, create_model ) class DatabaseSimple...
#!/usr/bin/env python3 # # https://developers.strava.com/ # https://strava.github.io/api/ # # https://www.strava.com/settings/api # # https://groups.google.com/forum/#!forum/strava-api # # https://github.com/hozn/stravalib/ # # https://pythonhosted.org/stravalib/index.html # # Step #0 active the python virtual environm...
# coding: utf-8 """ Talon.One API The Talon.One API is used to manage applications and campaigns, as well as to integrate with your application. The operations in the _Integration API_ section are used to integrate with our platform, while the other operations are used to manage applications and campaigns. #...
"""Conversation objects.""" import asyncio import logging from hangups import (parsers, event, user, conversation_event, exceptions, schemas) logger = logging.getLogger(__name__) class Conversation(object): """Wrapper around Client for working with a single chat conversation.""" def ...
# 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...
import os import webapp2 import hmac import jinja2 from google.appengine.ext import db from google.appengine.api import memcache import re import json import logging import datetime import time import urllib2 import HTMLParser import pafy USER_RE = re.compile("^[a-zA-Z0-9_-]{3,20}$") PASSWORD_RE = re.compile("^.{3,20...
#!/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...
import inspect import json import os import sys from ryu.ofproto import ofproto_v1_3 from ryu.ofproto import ofproto_v1_3_parser # TODO: move configuration to separate directory CFG_PATH = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) class LoadRyuTables(object): def __init__(self):...
#!/usr/bin/env python # Copyright 2015, Google 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: # # * Redistributions of source code must retain the above copyright # notice, this list o...
# Copyright 2014-present MongoDB, 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 wr...
import unittest as real_unittest from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.db.models import get_app, get_apps from django.db.models.loading import unregister_app from django.test import _doctest as doctest from django.test.utils import setup_test_environment, ...
# coding=utf-8 # Copyright 2022 The Uncertainty Baselines 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 ap...
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'FaqCategoryTranslation' db.create_table(u'fluent_faq_faqc...