gt
stringclasses
1 value
context
stringlengths
2.49k
119k
from test.support import verbose, TestFailed import locale import sys import test.support as support import unittest maxsize = support.MAX_Py_ssize_t # test string formatting operator (I am not sure if this is being tested # elsewhere but, surely, some of the given cases are *not* tested because # they crash python) ...
# Copyright 2012 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed t...
#!/usr/bin/env vpython # Copyright 2018 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. """Tests for cluster.py.""" import unittest import json import cluster import process_profiles from test_utils import (ProfileFile, ...
#! /usr/bin/env python # encoding: utf-8 __author__ = "Nils Tobias Schmidt" __email__ = "schmidt89 at informatik.uni-marburg.de" ''' Little helper for the `google-play-crawler` ''' import csv from datetime import datetime import json import os from os.path import abspath import subprocess import sys import time impo...
# Copyright (c) 2010-2011 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 agree...
import pickle import numpy as np import pytest from numpy.testing import assert_array_equal from sklearn.utils._encode import _unique from sklearn.utils._encode import _encode from sklearn.utils._encode import _check_unknown @pytest.mark.parametrize( "values, expected", [ (np.array([2, 1, 3, 1, 3], ...
# 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 required by applicable ...
""" Copyright (c) 2015 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 following disclaimer. - Redistributions in ...
""" A set of helper classes for better pipelining of data preprocessing for machine learning and beyond. """ import numpy as np from sklearn.base import BaseEstimator, clone from sklearn.pipeline import Pipeline from sklearn.ensemble import GradientBoostingRegressor from sklearn.tree import DecisionTreeRegressor from ...
# -*-coding:utf-8-*- # Copyright (c) 2020 PaddlePaddle 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 # # U...
# -*- coding: utf-8 -*- # ================================================================= # # Authors: Tom Kralidis <tomkralidis@gmail.com> # # Copyright (c) 2015 Tom Kralidis # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation # files (the ...
# Copyright (c) "Neo4j" # Neo4j Sweden AB [http://neo4j.com] # # This file is part of Neo4j. # # 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...
import os import platform import unittest from conans.paths import CONANFILE from conans.test.utils.tools import TestClient, GenConanfile tool_conanfile = """ import os from conans import ConanFile class Tool(ConanFile): name = "Tool" version = "0.1" exports_sources = "mytool*" def package(self): ...
""" Copyright (c) 2015, 2019 Red Hat, Inc All rights reserved. This software may be modified and distributed under the terms of the BSD license. See the LICENSE file for details. """ from __future__ import unicode_literals, absolute_import import json import os from osbs.exceptions import OsbsResponseException from...
# coding=utf-8 import numpy as np import scipy.sparse as sprs from scipy.interpolate import BarycentricInterpolator def next_neighbors_periodic(p, ps, k): """ Function to find the next neighbors for a periodic setup This function gives for a value p the k points next to it which are found in in the v...
# -*- 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 writing, software #...
# -*- coding: utf-8 -*- # Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
# 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 2020 Google LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
import datetime import re from string import capwords from typing import List, Optional, Tuple, Union from loguru import logger from flexget.utils.qualities import Quality logger = logger.bind(name='parser') SERIES_ID_TYPES = ['ep', 'date', 'sequence', 'id'] def clean_value(name: str) -> str: for char in '[](...
# 3D display code for stereo camera preview # Written by Hugh Fisher, CECS ANU, 2011 # Distributed under MIT/X11 license: see file COPYING # The renderer displays the two video sources. # Current options are side by side, overlaid at # 50% alpha each, or anaglyph (red-blue) stereo...
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
# Copyright 2016 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 agre...
from datetime import ( datetime, timedelta, ) import numpy as np import pytest import pandas as pd from pandas import ( Categorical, DataFrame, DatetimeIndex, Index, NaT, Period, PeriodIndex, RangeIndex, Series, Timedelta, TimedeltaIndex, Timestamp, date_ran...
# -*- coding: utf-8 -*- # Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
# # 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 re...
""" Upload API for Flickr. It is separated since it requires different treatments than the usual API. Two functions are provided: - upload (supporting both sync and async modes) - replace (presently not working) Author: Dmitriy Bryndin email: bryndin@gmail.com Date: 08/24/2014 ...
import time import shutil import os from pkg_resources import resource_filename from fanstatic.checksum import list_directory, md5, mtime from fanstatic.checksum import VCS_NAMES, IGNORED_EXTENSIONS def _copy_testdata(tmpdir): src = resource_filename('tests', 'testdata/SomePackage') dst = tmpdir / 'SomePack...
# python3 # Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
import functools import logging import simplejson import urlparse import werkzeug.utils from werkzeug.exceptions import BadRequest import openerp from openerp import SUPERUSER_ID from openerp import http from openerp.http import request from openerp.addons.web.controllers.main import db_monodb, ensure_db, set_cookie_...
# Copyright (c) 2012 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 req...
import sys import ctypes import unittest from dynd import ndt class TestType(unittest.TestCase): def test_tuple(self): tp = ndt.tuple(ndt.int32, ndt.float64) def test_struct(self): tp = ndt.struct(x = ndt.int32, y = ndt.float64) def test_callable(self): tp = ndt.callable(ndt.void,...
# Copyright (c) 2016,2017 MetPy Developers. # Distributed under the terms of the BSD 3-Clause License. # SPDX-License-Identifier: BSD-3-Clause """ =========================== Upper Air Sounding Tutorial =========================== Upper air analysis is a staple of many synoptic and mesoscale analysis problems. In this...
# Copyright 2018 The TensorFlow Probability 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 applicable law o...
# Copyright 2014 Rackspace, Andrew Melton # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
# 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. import logging import os import re import signal import subprocess import sys import tempfile from telemetry.core import platform from telemetry.core import...
from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import compat_str from ..utils import ( clean_html, determine_ext, dict_get, ExtractorError, int_or_none, parse_duration, try_get, unified_strdate, ) class XHamsterIE(InfoExtractor): ...
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
# Copyright 2017 The dm_control 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 applicable law or agreed to i...
import pytest from urlparse import urlparse from api_tests.nodes.views.test_node_contributors_list import NodeCRUDTestCase from api.base.settings.defaults import API_BASE from framework.auth.core import Auth from osf_tests.factories import ( ProjectFactory, CommentFactory, RegistrationFactory, Institut...
# coding: utf-8 """ Copyright 2015 SmartBear Software Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applica...
""" Provide functionality to TTS. For more details about this component, please refer to the documentation at https://home-assistant.io/components/tts/ """ import asyncio import functools import hashlib import logging import mimetypes import os import re from aiohttp import web import voluptuous as vol from homeassi...
# Copyright (c) 2016-2021 Adobe Inc. All rights reserved. # # 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, modif...
# Copyright (c) 2012-2014 roger # Copyright (c) 2012-2015 Tycho Andersen # Copyright (c) 2013 dequis # Copyright (c) 2013 Tao Sauvage # Copyright (c) 2013 Craig Barnes # Copyright (c) 2014 Sean Vig # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documen...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2013 New Dream Network, LLC (DreamHost) # # 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/li...
import bme680 import time import logging from blinker import signal class BME680: BURN_IN_TIME_IN_SECONDS = 300 AIR_QUALITY_SAMPLE_TIME_IN_SECONDS = 60 COOL_DOWN_TEMPERATURE_DIFFERENCE = 0.25 def __init__(self, address): logging.info('Initialising BME680 sensor with address {}'.format(addres...
# =============================================================================== # Copyright 2012 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...
try: import Crypto.Hash.SHA3_256 as _SHA3_256 # from pycryptodome sha3_256 = _SHA3_256.new except ImportError: from sha3 import sha3_256 from bitcoin import privtopub import sys import rlp from rlp.sedes import big_endian_int, BigEndianInt, Binary from rlp.utils import decode_hex, encode_hex, ascii_chr, st...
# -*- coding: utf-8 -*- """Django settings for kitsune project.""" import logging import os import platform import re from datetime import date from bundles import PIPELINE_CSS, PIPELINE_JS from kitsune.lib.sumo_locales import LOCALES DEBUG = True TEMPLATE_DEBUG = DEBUG STAGE = False LOG_LEVEL = logging.INFO SYSLOG...
# yellowbrick.classifier.threshold # DiscriminationThreshold visualizer for probabilistic classifiers. # # Author: Nathan Danielsen # Author: Benjamin Bengfort # Created: Wed April 26 20:17:29 2017 -0700 # # Copyright (C) 2017 The scikit-yb developers # For license information, see LICENSE.txt # # ID: threshold.py []...
## # Copyright (c) 2013-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.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
#!/usr/bin/env python # Authors: # Trevor Perrin # Kees Bos - Added tests for XML-RPC # Dimitris Moraitis - Anon ciphersuites # Marcelo Fernandez - Added test for NPN # Martin von Loewis - python 3 port # # See the LICENSE file for legal information regarding use of this file. from __future__ import print_...
from __future__ import absolute_import import json import os import shutil import tempfile import unittest import mock import nose import yaml from cumulusci.core.tests.utils import EnvironmentVarGuard from cumulusci.core.config import BaseGlobalConfig from cumulusci.core.config import BaseProjectConfig from cumulus...
import json, urllib, urllib2, zlib from django.conf import settings from id_tools import netflix_id_from_input from webapp.models import Movies from oauth import OAuthRequest from oauth.signature_method.hmac_sha1 import OAuthSignatureMethod_HMAC_SHA1 from xml.dom.minidom import parseString # Return movies from wikiped...
# Copyright 2013 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
# coding: utf-8 """ Onshape REST API The Onshape REST API consumed by all clients. # noqa: E501 The version of the OpenAPI document: 1.113 Contact: api-support@onshape.zendesk.com Generated by: https://openapi-generator.tech """ from __future__ import absolute_import import re # noqa: F401 im...
# 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...
"""Class to purely handle everything that concerns the board""" from typing import Tuple, List import numpy as np from src import Utils if not Utils.in_pyinstaller_mode(): from scipy import ndimage """Just to adjust the internal representation of color at a single location, instead of all over the code ;) Just i...
"""Tests -- run with nosetests, or from command line python -mtatl.test [-u] (The -u will update artifacts) """ from tatl import ExprParser, ExprSemantics, Compiler, front_matter import os, sys, json, glob from contextlib import contextmanager import traceback, cStringIO import tatlrt G_TESTS = 'grammar/test.txt' G_E...
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
# -*- coding: utf-8 -*- # Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
# -*- coding: utf-8 -*- # Copyright 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...
import time from requests import request, ConnectionError from ..utils import SSLHttpAdapter, module_member, parse_qs, user_agent from ..exceptions import AuthFailed class BaseAuth(object): """A authentication backend that authenticates the user based on the provider response""" name = '' # provider na...
#!/usr/bin/env python # # Copyright 2017 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
from test import support import array import io import marshal import sys import unittest import os import types try: import _testcapi except ImportError: _testcapi = None class HelperMixin: def helper(self, sample, *extra): new = marshal.loads(marshal.dumps(sample, *extra)) self.assertEqu...
# -*- coding: utf-8 -*- # # Copyright (c) 2015, Alcatel-Lucent Inc, 2017 Nokia # 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 copyrigh...
# coding=utf-8 # Copyright 2022 TF.Text 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 applicable law or ag...
import os import logging import datetime from collections import defaultdict from google.appengine.ext import ndb from base_controller import LoggedInHandler from consts.account_permissions import AccountPermissions from consts.client_type import ClientType from consts.model_type import ModelType from consts.notifi...
## # 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.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
#!/usr/bin/env python ''' Extract reads which aren't mapped from a SAM or SAM.gz file. Behavior for PE: -Write out PE only if both do not map (if either of the pair maps, neither is retained) Behavior for SE: -Write out SE if they don't map Iterate over a SAM or SAM.gz file. take everything where the 3rd and 4th ...
#IGE (Indirect genetic effects) = SGE (Social genetic effects). IEE = SEE. #the potential presence of NAs in input phenotype, covs, cages etc means that in this code we introduce two sets of animals (not discussed in the paper): #focal animals, defined as having phenotype, covs (if covs are provided), cage and kinship...
# -*- coding: utf-8 -*- import numpy as np import linecache import math # Constants eps0 = 8.854187817e-14 # F*cm^-1 q = 1.602176462e-19 # C def cv_read(cv_file, model): """ Read Capacitance-Voltage data from *.CV file Parameters ---------- cv_file : str, path to the CV file model : str, ...
''' parse_schedules.py Andrew Benson Parses scheduling information from the Schedule Of Classes for a given school quarter and year for reference, here is what each column number refers to in the raw HTML 0: COURSE i.e. '15122' 1: TITLE i.e. 'Principles of Imperative Computation' 2: UNITS i.e. '10.0' 3: LEC/SEC i...
import bioinf from numpy import array, dot, arccos, rad2deg, ndarray, cross from numpy.linalg import norm from constants import * from collections import OrderedDict, namedtuple class PDBATOMFileReader(object): def __init__(self, file_or_path): self._parse_atom_lines(file_or_path) self._set_residue...
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. import operator import os import platform import sys from typing import Any, Callable, Dict, List, Optional, Tuple, Union from pip._vendor...
"""Run migrations.""" import typing as t from functools import wraps import peewee as pw from playhouse.migrate import ( MySQLMigrator as MqM, PostgresqlMigrator as PgM, SchemaMigrator as ScM, SqliteMigrator as SqM, Operation, SQL, PostgresqlDatabase, operation, SqliteDatabase, MySQLDatabase, ...
""" This script is used to design the design matrix for our linear regression. We explore the influence of linear and quadratic drifts on the model performance. Script for the filtered data. Run with: python noise-pca_filtered_script.py from this directory """ from __future__ import print_function, division im...
from keras import backend as K from keras import activations from overrides import overrides from .word_alignment import WordAlignmentEntailment from ..attention import WeightedSum from ...tensors.backend import switch, apply_feed_forward class DecomposableAttentionEntailment(WordAlignmentEntailment): """ Th...
import os import sys import pytest from mock import Mock import pip._internal.req.req_uninstall from pip._internal.req.req_uninstall import ( StashedUninstallPathSet, UninstallPathSet, UninstallPthEntries, compact, compress_for_output_listing, compress_for_rename, uninstallation_paths, ) f...
from collections import namedtuple import glob import pickle from pathlib import Path import re import numpy as np import pandas as pd from ..data.survey_utils import ExperimentType DATA_DIR = Path(__file__).parent.joinpath("../../data") SURVEY_DIR = DATA_DIR.joinpath("raw") CSV_DIR = DATA_DIR.joinpath("interim") ...
import logging import math import re import sys from .exceptions import PapermillException from .models import Parameter logger = logging.getLogger(__name__) class PapermillTranslators(object): ''' The holder which houses any translator registered with the system. This object is used in a singleton man...
"""The tests for the REST switch platform.""" import asyncio from http import HTTPStatus import aiohttp from homeassistant.components.rest import DOMAIN import homeassistant.components.rest.switch as rest from homeassistant.components.switch import DEVICE_CLASS_SWITCH, DOMAIN as SWITCH_DOMAIN from homeassistant.const...
import numpy as np import tensorflow as tf import helpers tf.reset_default_graph() sess = tf.InteractiveSession() #Vocabulary size. PAD = 0 EOS = 1 vocab_size = 50 input_embedding_size = 20 #character length encoder_hidden_units = 20 #num neurons decoder_hidden_units = encoder_hidden_units * 2 #in original paper,...
# 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...
import logging from io import BytesIO from azure.common.credentials import ServicePrincipalCredentials from azure.mgmt.compute import ComputeManagementClient from azure.mgmt.network import NetworkManagementClient from azure.mgmt.resource import ResourceManagementClient from azure.mgmt.resource.subscriptions import Su...
#!/usr/bin/env python # -*- encoding: utf-8 -*- # vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8: # Author: Binux<i@binux.me> # http://binux.me # Created on 2014-02-07 17:05:11 import itertools import json import logging import os import time from collections import deque from six import iteritems, itervalues...
import os import binascii import py from pyshark.packet.common import Pickleable class LayerField(object): """ Holds all data about a field of a layer, both its actual value and its name and nice representation. """ # Note: We use this object with slots and not just a dict because # it's much more...
# # 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...
""" Implementation of double ended queue. """ from __future__ import annotations from dataclasses import dataclass from typing import Any, Iterable class Deque: """ Deque data structure. Operations ---------- append(val: Any) -> None appendleft(val: Any) -> None extend(iter: Iterable) -> ...
#!/usr/bin/env python # # Helper for automating the creation of a package by looking at you # current directory and asking the user questions. # # Available as either a stand-alone file or callable from the distutils2 # package: # # python -m distutils2.mkcfg # or: # python mkcfg.py # # Written by Sean Re...
from selenium import webdriver import selenium.webdriver.support.ui as ui from selenium.webdriver.common.keys import Keys #from selenium.webdriver.common.action_chains import ActionChains import time import datetime import csv import random import sys import urllib2 import socket #from metricsCollect import metricsCol...
"""JSON (de)serialization framework. The framework presented here is somewhat based on `Go's "json" package`_ (especially the ``omitempty`` functionality). .. _`Go's "json" package`: http://golang.org/pkg/encoding/json/ """ import abc import binascii import logging import OpenSSL import six from josepy import b64,...
""" Created on Apr 18, 2017 @author: Christopher Bruns """ import os import numpy from OpenGL import GL from OpenGL.GL.shaders import compileShader, compileProgram from OpenGL.arrays import vbo from openvr.glframework.glmatrix import identity, pack, rotate_y, scale from openvr.glframework import shader_string cla...
from django.contrib.gis.db.models.fields import BaseSpatialField from django.contrib.gis.measure import Distance from django.db import NotSupportedError from django.db.models.expressions import Expression from django.db.models.lookups import Lookup, Transform from django.db.models.sql.query import Query from django.uti...
#this is the base class for tester objects import sys import subprocess import logging import os from time import clock from result import Result studentLogger = logging.getLogger('errorLogger.progressLogger.studentLogger') studentLogger.setLevel(logging.INFO) h = logging.StreamHandler() h.setLevel(logging.INFO) stude...
# # Promise package for Python 2.7+. Node has such a wonderful way to handle server side. With all of the debates # on what to do with Python around GIL, I decided to support both GIL via threads and also multicore in the same # API structure. # # Threads version (default) uses GIL and therefore all your data is thr...
# -*- coding: utf-8 -*- """ github3.git =========== This module contains all the classes relating to Git Data. See also: http://developer.github.com/v3/git/ """ from __future__ import unicode_literals from json import dumps from base64 import b64decode from .models import GitHubObject, GitHubCore, BaseCommit from .u...
# -*- coding: utf-8 -*- from __future__ import with_statement from django.contrib.sites.models import Site from cms.utils.urlutils import admin_reverse from djangocms_text_ckeditor.models import Text from django.core.cache import cache from django.core.management.base import CommandError from django.core.management im...
# 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...
__author__ = '116_24' import pygame import sys import time from pygame.locals import * import random import math import entities pygame.init() mainClock = pygame.time.Clock() windowSurface = pygame.display.set_mode((500, 400), 0, 32) pygame.display.set_caption('Dungeon Sam is pretty damn cool v0.9, 10/16/11') white...