gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
import datetime
from django.conf import settings
from django.contrib.auth.models import User
from django.core import mail
from django.core.urlresolvers import reverse
from django.test import TestCase
from registration import forms
from registration.models import RegistrationProfile
class RegistrationViewTests(TestC... | |
# 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 ... | |
"""
Drop-in replacement for ``django.conf.settings`` that provides a
consistent access method for settings defined in applications, the project
or Django itself. Settings can also be made editable via the admin.
"""
from __future__ import unicode_literals
from future.builtins import bytes, str
from functools import p... | |
import logging
import sys
from datetime import datetime
from sqlalchemy import create_engine, event
from sqlalchemy.orm import class_mapper, mapper, scoped_session, sessionmaker
from unihan_etl import process as unihan
from . import dirs, importer
from .tables import Base, Unhn
from .util import merge_dict
log = lo... | |
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
import tabletmanagerdata_pb2 as tabletmanagerdata__pb2
class TabletManagerStub(object):
"""TabletManager is a service definition for tabletmanagerdata.TabletManager.
Various read-only methods
"""
def __init__(self, channel):... | |
# coding: utf-8
"""X509 Certificate API."""
from __future__ import unicode_literals
import hashlib
from asn1crypto import x509, cms, pem
from .pubkey import RSAPublicKeyCipher
class CertificateError(Exception):
"""Certificate has errors."""
pass
class Certificate(object):
"""X509 certificates."""
... | |
'''
Created on Jan 23, 2016
@author: David Zwicker <dzwicker@seas.harvard.edu>
'''
from __future__ import division
import logging
import numpy as np
import yaml
from ..files import open_filename
class AffineTransformation(object):
""" class that represents an affine coordinate transformation """
... | |
#!/usr/bin/python
# -- Content-Encoding: UTF-8 --
"""
Cohorte Web Admin Servlet
:authors: Bassem Debbabi
:copyright: Copyright 2014, isandlaTech
:license: Apache Software License 2.0
"""
# iPOPO decorators
from pelix.ipopo.decorators import ComponentFactory, Provides, Property, Instantiate, \
Validate, Invalida... | |
# Copyright 2013 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.
"""Dispatches tests, either sharding or replicating them.
Performs the following steps:
* Create a test collection factory, using the given tests
- If sha... | |
import pyb
from midi.midiout import MidiOut
# initiliaze the servo
servo = pyb.Servo(2)
servo.speed(0)
# setup the UART pins and MIDI channel
uart = pyb.UART(2, baudrate=31250)
midiout1 = MidiOut(uart, ch=1)
# set up the on board switch, and itial volume
SW = pyb.Switch()
# each pin on the board is connected to a p... | |
import time
import fnmatch
import logging
import collections
import regex
import synapse.exc as s_exc
import synapse.common as s_common
import synapse.lib.auth as s_auth
import synapse.lib.tufo as s_tufo
import synapse.lib.cache as s_cache
import synapse.lib.syntax as s_syntax
import synapse.lib.interval as s_interv... | |
# Copyright 2013 IBM Corp.
# 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 app... | |
"""
Collection of commonly used functions for general file input and output.
Functions:
check_iris_var -- Check if a variable is in the list of iris standard names
check_time_units -- Check time axis units
check_wfo_sign -- Check that the wfo variable has correct sign
check_globa... | |
"""Utility functions used across Superset"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from builtins import object
from datetime import date, datetime, time, timedelta
import decimal
from email.mime.application i... | |
# 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 requir... | |
"""Support for Minut Point."""
import asyncio
import logging
from pypoint import PointSession
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
CONF_CLIENT_ID,
CONF_CLIENT_SECRET,
CONF_TOKEN,
CONF_WE... | |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# Copyright (c) 2011-2020, wradlib developers.
# Distributed under the MIT License. See LICENSE.txt for more info.
"""
Raster Functions
^^^^^^^^^^^^^^^^
.. autosummary::
:nosignatures:
:toctree: generated/
{}
"""
__all__ = [
"read_gdal_values",
"read_gda... | |
#!/usr/bin/env python
from __future__ import print_function
import argparse
import string
import sys
from nlp_util import pstree, nlp_eval, treebanks, parse_errors, init, render_tree
def get_reference(text, sep='-'):
parts = []
cur = []
for i in range(len(text) -1, -1, -1):
cur.insert(0, tex... | |
"""
NOTE:
the below code is to be maintained Python 2.x-compatible
as the whole Cookiecutter Django project initialization
can potentially be run in Python 2.x environment
(at least so we presume in `pre_gen_project.py`).
TODO: ? restrict Cookiecutter Django project initialization to Python 3.x environ... | |
from __future__ import unicode_literals
from django.db import models
from django.db.migrations.operations.base import Operation
from django.db.migrations.state import ModelState
from django.db.models.options import normalize_together
from django.utils import six
from django.utils.functional import cached_property
cl... | |
from .. import util
import colorsys
def hsv2rgb_raw(hsv):
"""
Converts an HSV tuple to RGB. Intended for internal use.
You should use hsv2rgb_spectrum or hsv2rgb_rainbow instead.
"""
HSV_SECTION_3 = 0x40
h, s, v = hsv
# The brightness floor is minimum number that all of
# R, G, and ... | |
# -*- coding: utf-8 -*-
"""
Created on Thu Aug 11 05:28:55 2016
@author: Stuart
"""
import xml.dom.minidom
import dateutil
import os
from ..core.status import Status
isoDateFormat = "%Y-%m-%dT%H:%M:00"
class XmlBase(object):
def readDoc(self, path):
return xml.dom.minidom.parse(path)
def getPath(... | |
# 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 (c) 2013 Bull.
#
# 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, sof... | |
# -*- mode: python; coding: utf-8 -*-
# Copyright 2013, 2016-2018 Peter Williams <peter@newton.cx> and collaborators
# Licensed under the MIT License.
# NB. This is super-redundant with both dftphotom and dftspect; things are
# getting a little silly here. But I think it's faster to copy/paste/hack than
# it is to mer... | |
from uuid import uuid4
from django.db import models
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from django.conf import settings
from django.core.cache import cache
from frozendict import frozendict
from vms.utils import PickleDict, FrozenAttrDict
# noinspection PyProtecte... | |
from functools import partial
from inspect import signature
from itertools import product
from itertools import chain
from itertools import permutations
import numpy as np
import scipy.sparse as sp
import pytest
from sklearn.datasets import make_multilabel_classification
from sklearn.preprocessing import LabelBinari... | |
# 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... | |
"""config.py Parse the daemon config file"""
__author__ = "Wim Leers (work@wimleers.com)"
__version__ = "$Rev$"
__date__ = "$Date$"
__license__ = "GPL"
import os
import os.path
import xml.etree.ElementTree as etree
from xml.parsers.expat import ExpatError
import re
import logging
from filter import *
# Define ex... | |
import os
import sys
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), ".."))
from db.db_manager import db_sync_manager
from mapper.utils.filter import PathFinderTNtoSDNFilterUtils as FilterUtils
from mapper.utils.format import PathFinderTNtoSDNFormatUtils as FormatUtils
from mapper.utils.combin... | |
#!/usr/bin/python
import apihelper
import aerospike
found = {}
elements = {
"Client": {
"admin_change_password": {
},
"admin_create_role": {
},
"admin_create_user": {
},
"admin_drop_role": {
},
"admin_drop_user": {
},
"admin_... | |
import sys
import numpy as np
from scipy.sparse import lil_matrix
from lxmls.parsing.dependency_reader import *
class DependencyFeatures():
'''
Dependency features class
'''
def __init__(self, use_lexical = False, use_distance = False, use_contextual = False):
self.feat_dict = {}
self.... | |
"""convenient default functions for use with rt1.rtfits.processfunc()"""
import sys
import pandas as pd
import numpy as np
import traceback
from pathlib import Path
from .rtfits import load
from . import log
try:
import xarray as xar
except ModuleNotFoundError:
log.debug("xarray could not be imported, " + "po... | |
"""Task runner"""
from multiprocessing import Process, Queue as MQueue
from threading import Thread
import pickle
import queue
import cloudpickle
from .exceptions import InvalidTask, CatchedException
from .exceptions import TaskFailed, SetupError, DependencyError, UnmetDependency
from .task import Stream, DelayedLoa... | |
#!/usr/bin/env python2
# Copyright 2015 Mathias Garbe <mail@mathias-garbe.de>
#
# 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 re... | |
import hashlib
import hmac
import os
import posixpath
import secrets
import typing as t
import warnings
if t.TYPE_CHECKING:
pass
SALT_CHARS = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
DEFAULT_PBKDF2_ITERATIONS = 260000
_os_alt_seps: t.List[str] = list(
sep for sep in [os.path.sep, os.p... | |
# 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... | |
# common functions for stuff you would want to do inside of a workspace.
import ConfigParser
import logging
import os
import paramiko
import re
import StringIO
from .sshshell import SSHShell
class ToolSessionShell(SSHShell):
def importfile(self,remotepath,localpath,mode=None,is_data=False):
"""
... | |
# 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... | |
# 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 ... | |
# -*- test-case-name: twisted.web.test.test_xmlrpc -*-
# Copyright (c) 2001-2009 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
A generic resource for publishing objects via XML-RPC.
Maintainer: Itamar Shtull-Trauring
"""
# System Imports
import sys, xmlrpclib, urlparse
# Sibling Imports
from twisted.w... | |
'''
The MIT License (MIT)
Copyright (c) 2013-2017 Robert H Chase
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,... | |
"""
:copyright: Copyright since 2006 by Oliver Schoenborn, all rights reserved.
:license: BSD, see LICENSE_BSD_Simple.txt for details.
"""
from typing import Tuple, List, Sequence, Mapping, Dict, Callable, Any, Optional, Union
from .topicmgr import (
TopicManager,
TreeConfig
)
from .listener import IListener... | |
__all__ = ['Kane']
from sympy import Symbol, zeros, Matrix, diff, solve_linear_system_LU, eye
from sympy.utilities import default_sort_key
from sympy.physics.mechanics.essential import ReferenceFrame, dynamicsymbols
from sympy.physics.mechanics.particle import Particle
from sympy.physics.mechanics.point import Point
f... | |
# -*- coding: utf-8 -*-
"""Module to prepare the resultset."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import warnings
from influxdb.exceptions import InfluxDBClientError
_sentinel = object()
class ResultS... | |
# Copyright (c) 2012 OpenStack Foundation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | |
# Backport of the weakrefset module for Python 2.5 and 2.6
# Licencend under New BSD License, code from http://code.google.com/p/weakrefset/
from __future__ import with_statement
from _weakref import ref
__all__ = ['WeakSet']
__version__ = '1.0.0'
class _IterationGuard(object):
# This context manager registe... | |
# 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... | |
""" Internal utils related to Tornado
"""
from __future__ import absolute_import, print_function
import logging
log = logging.getLogger(__name__)
from tornado import gen
from bokeh.document import NextTickCallback, PeriodicCallback, TimeoutCallback
@gen.coroutine
def yield_for_all_futures(result):
""" Converts... | |
"""Test the cross_validation module"""
from __future__ import division
import warnings
import numpy as np
from scipy.sparse import coo_matrix
from scipy.sparse import csr_matrix
from scipy import stats
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_false
from sklearn.utils.test... | |
#!/usr/bin/env python
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2012 Cisco 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
#
# ... | |
import copy
import random
from .hand import TableCards, TakenCards, Hand
from .deck import Deck
class GameStateException(Exception):
pass
class GameState(object):
"""The GameState specifies the complete state of the game, including the
player's hands, cards on the table and scoring.
"""
def __i... | |
# Copyright 2017 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 a... | |
"""Pathname and path-related operations for the Macintosh."""
import os
from stat import *
__all__ = ["normcase","isabs","join","splitdrive","split","splitext",
"basename","dirname","commonprefix","getsize","getmtime",
"getatime","getctime", "islink","exists","isdir","isfile",
"walk",... | |
<<<<<<< HEAD
<<<<<<< HEAD
#
# Module implementing synchronization primitives
#
# multiprocessing/synchronize.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#
__all__ = [
'Lock', 'RLock', 'Semaphore', 'BoundedSemaphore', 'Condition', 'Event'
]
import threading
import... | |
# -*- coding: utf-8 -*-
'''
Configure ``portage(5)``
'''
# Import python libs
import os
import shutil
# Import salt libs
import salt.utils
# Import third party libs
try:
import portage
HAS_PORTAGE = True
except ImportError:
HAS_PORTAGE = False
import sys
if os.path.isdir('/usr/lib/portage/pym'):
... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 OpenStack LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | |
# -*- coding: utf-8 -*-
"""
Vehicle
@author: Fran Boon
@date-created: 2011-06-20
Vehicle Management Functionality
http://eden.sahanafoundation.org/wiki/BluePrint/Vehicle
"""
if deployment_settings.has_module("vehicle"):
# Vehicles as component of Assets
s3mgr.model.add_component("vehic... | |
#!/usr/bin/env python3
# Copyright (c) 2010 ArtForz -- public domain half-a-node
# Copyright (c) 2012 Jeff Garzik
# Copyright (c) 2010-2020 The Fujicoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test object... | |
# -*- coding: utf-8 -*-
from ..vendor import Qt
from ..vendor.Qt import QtCore, QtGui, QtWidgets
class Ui_Form(object):
def setupUi(self, Form):
Form.setObjectName("Form")
Form.resize(283, 349)
Form.setMinimumSize(QtCore.QSize(0, 0))
self.gridLayout = QtWidgets.QGridLayout(Form)
... | |
##########################################################################
#
# Copyright (c) 2012, John Haddon. All rights reserved.
# Copyright (c) 2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that ... | |
# -*- test-case-name: calendarserver.tap.test.test_caldav -*-
##
# Copyright (c) 2005-2015 Apple 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... | |
# Copyright (C) 2012-2013, Christof Buchbender
# BSD Licencse
import sys
import os
import numpy as np
import pyfits
import matplotlib.pyplot as plt
import astrolyze.maps.main as main
import astrolyze.maps.fits as fits
import astrolyze.maps.gildas as gildas
import astrolyze.maps.miriad as miriad
import astrolyze.maps.s... | |
import os.path
import datetime
# Django
from django.conf import settings
from django.db import models
from django.contrib.auth.models import User
from django.db.models import Avg, Max, Min, Count, Q
from django.core.urlresolvers import reverse
# Smrtr
from network.models import Network,UserNetwork
from resources.models... | |
# -*- encoding: utf-8 -*-
# Copyright (c) 2016 b<>com
#
# 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... | |
#
# This source file is part of appleseed.
# Visit http://appleseedhq.net/ for additional information and resources.
#
# This software is released under the MIT license.
#
# Copyright (c) 2017 Petra Gospodnetic, The appleseedhq Organization
#
# Permission is hereby granted, free of charge, to any person obtaining a co... | |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under th... | |
import numpy as np
import numpy.testing as npt
import pytest
from pulse2percept.stimuli import (AsymmetricBiphasicPulse, BiphasicPulse,
MonophasicPulse, Stimulus)
from pulse2percept.utils.constants import DT
DECIMAL = int(-np.log10(DT))
@pytest.mark.parametrize('amp', (-1, 13))
@p... | |
#!/usr/bin/env python3
# Copyright (c) 2014-2017 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 behavior of headers messages to announce blocks.
Setup:
- Two nodes:
- node0 is the node-und... | |
#!/usr/bin/env python
from ctypes import *
from ctypes.util import find_library
import sys
from os import path
#
# [paul.tunison@kitware.com]: This original search method for the library is
# insufficient for an install, thus the new search method under neath the
# commented section.
#
# # For unix the prefix 'lib' ... | |
import calendar
import logging
import os
import time
from datetime import datetime
import numpy as np
import grd
__author__ = 'Trond Kristiansen'
__email__ = 'trond.kristiansen@niva.no'
__created__ = datetime(2009, 1, 30)
__modified__ = datetime(2021, 11, 13)
__version__ = "1.6"
__status__ = "Development"
# Change... | |
# Copyright 2012 NEC Corporation
# Copyright 2015 Cisco Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Un... | |
import json
from math import ceil
import time
import redis
from tasktiger import RetryException, TaskTiger
from tasktiger.retry import fixed
from tasktiger.runner import BaseRunner, DefaultRunner
from .config import DELAY, TEST_DB, REDIS_HOST
from .utils import get_tiger
LONG_TASK_SIGNAL_KEY = 'long_task_ok'
tige... | |
import logging
import time
from _thread import RLock
from functools import lru_cache, wraps
from os import environ
from select import select
import paramiko
from . import master_ip, master_leader_ip, marathon_leader_ip
from .helpers import validate_key, try_close, get_transport, start_transport
from ..errors import D... | |
__VERSION__="ete2-2.2rev1056"
# -*- coding: utf-8 -*-
# #START_LICENSE###########################################################
#
#
# This file is part of the Environment for Tree Exploration program
# (ETE). http://ete.cgenomics.org
#
# ETE is free software: you can redistribute it and/or modify it
# under the t... | |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""this is a basic test script for simple indices work"""
import os
import sys
import numpy as np
import unittest
import faiss
from common_f... | |
# flake8: noqa
# -*- coding: utf-8 -*-
# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = "1.0"
import sys
import os
import inspect
import importlib
import m2r2
import sphinx_compas_theme
from sphinx.ext.napoleon.docstring import NumpyDocstring
sys.path.append(os.path.join(os.... | |
# Copyright (c) 2009-2011 Reza Lotun http://reza.lotun.name/
# Copyright (c) 2011 Jann Kleen
# Copyright (c) 2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this sof... | |
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.news.database}.
"""
__metaclass__ = type
from email.Parser import Parser
from socket import gethostname
from twisted.trial.unittest import TestCase
from twisted.internet.defer import succeed
from twisted.mail.smtp import... | |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | |
# django imports
from django.conf import settings
from django.contrib.flatpages.models import FlatPage
from django.test import TestCase
# reviews imports
from portlets.example.models import TextPortlet
from portlets.models import PortletAssignment
from portlets.models import PortletBlocking
from portlets.models import... | |
"""For running Python code that could interrupt itself at any time in order to,
for example, ask for a read on stdin, or a write on stdout
The CodeRunner spawns a greenlet to run code in, and that code can suspend its
own execution to ask the main greenlet to refresh the display or get
information.
Greenlets are basi... | |
import torch
import torch.nn as nn
import torch.optim as optim
import torch.optim.lr_scheduler as lr_scheduler
import torch.distributed as dist
from torch.utils.data import DataLoader
import sys
import time
import os
import shutil
import uuid
import tempfile
import tarfile
import copy
import math
from threading import ... | |
"""
SQL functions reference lists:
https://web.archive.org/web/20130407175746/http://www.gaia-gis.it/gaia-sins/spatialite-sql-4.0.0.html
http://www.gaia-gis.it/gaia-sins/spatialite-sql-4.2.1.html
"""
import re
import sys
from django.contrib.gis.db.backends.base.operations import \
BaseSpatialOperations
from django... | |
# (C) Catchoom Technologies S.L.
# Licensed under the MIT license.
# https://github.com/catchoom/craftar-python/blob/master/LICENSE
# All warranties and liabilities are disclaimed.
"Provides functions for accessing the CraftAR's management API."
from craftar._common import _get_object_list, _get_object, _create_o... | |
from __future__ import absolute_import
from django.core.management.base import BaseCommand
from django.utils.timezone import now
from django.contrib.sites.models import Site
from zerver.models import Message, UserProfile, Stream, Recipient, Client, \
Subscription, Huddle, get_huddle, Realm, UserMessage, \
get... | |
# Copyright 2016 Tesora 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... | |
# coding=utf-8
import datetime
import logging
import os
import shutil
import pytz
from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Group
from django.contrib.gis.geos.point import Point
from django.core.files.base import File
from django.core.urlreso... | |
# repo.py
# Copyright (C) 2008, 2009 Michael Trier (mtrier@gmail.com) and contributors
#
# This module is part of GitPython and is released under
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
from git.exc import (
InvalidGitRepositoryError,
NoSuchPathError,
GitCommandError
)
from gi... | |
from __future__ import absolute_import, unicode_literals
import itertools
import django
from django import template
from django.conf import settings
from django.contrib.humanize.templatetags.humanize import intcomma
from django.contrib.messages.constants import DEFAULT_TAGS as MESSAGE_TAGS
from django.template.defaul... | |
# 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 -*-
"""Module providing a json data storage api for categories"""
from builtins import str
from builtins import object
import datetime
import json
import time
import uuid as uuid_tool
from Products.CMFPlone.utils import safe_unicode
from collective.beaker.interfaces import ISession
from plone import... | |
# -*- coding: utf-8 -*-
# pylint: disable=W0102
from datetime import datetime, date
import operator
import sys
import pytest
import numpy as np
import re
from distutils.version import LooseVersion
import itertools
from pandas import (Index, MultiIndex, DataFrame, DatetimeIndex,
Series, Categorical... | |
"""
Support for Broadlink RM devices.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/switch.broadlink/
"""
from datetime import timedelta
from base64 import b64encode, b64decode
import asyncio
import binascii
import logging
import socket
import voluptuou... | |
# Copyright (c) 2016 IBM
# 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 appli... | |
"""A docker-based mininet host"""
import json
import operator
import os
import pty
import select
from subprocess import PIPE, STDOUT
from functools import reduce
# pylint: disable=import-error
# pylint: disable=no-name-in-module
from mininet.log import error, debug
from mininet.node import Host
from mininet.util impo... | |
# future statements for Python 2 compatibility
from __future__ import (
unicode_literals, division, print_function, absolute_import)
# built in modules
import os
import sys
import datetime
# installed modules
import spacy
from unidecode import unidecode
# project modules
try:
import toolbox
import consta... | |
#
# 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... | |
#!/opt/anaconda2/bin/python
# -*- coding: utf-8 -*-
"""
################################################################################
#
# Copyright (c) 2015 Wojciech Migda
# All rights reserved
# Distributed under the terms of the MIT license
#
####################################################################... | |
#!/usr/bin/python
# Copyright 2017 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.
"""Pretty-prints certificates as an openssl-annotated PEM file."""
import argparse
import base64
import errno
import hashlib
import os
imp... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.