gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
from __future__ import absolute_import, division, print_function
import os
import re
import sys
from os.path import isdir, isfile, join
from conda.compat import iteritems, PY3, text_type
from conda.utils import memoized, md5_file
import conda.config as cc
from conda.resolve import MatchSpec
from conda.cli.common impo... | |
#!/usr/bin/env python
#
# pKarun - scripts for running pKa calculations
# Copyright (C) 2010 Jens Erik Nielsen
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, ... | |
#
# Copyright 2012 WebFilings, 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 writing... | |
# project
from checks import AgentCheck
from checks.libs.wmi.sampler import WMISampler
from collections import namedtuple
WMIMetric = namedtuple('WMIMetric', ['name', 'value', 'tags'])
class InvalidWMIQuery(Exception):
"""
Invalid WMI Query.
"""
pass
class MissingTagBy(Exception):
"""
WMI... | |
#
# 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 ... | |
# -*- coding: utf-8 -*-
# Copyright 2014 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | |
"""
Examples of widget types
dict(type='date', name='date2', default='2012/03/15', label='Bogus2:',
min="1893/01/01"), # Comes back to python as yyyy-mm-dd
"""
# Association of plots
daily_opts = [
{
"id": 51,
"label": (
"Accumulated Station Departures of Precip/GDD/SDD "
... | |
"""Collection of helper methods.
All containing methods are legacy helpers that should not be used by new
components. Instead call the service directly.
"""
from homeassistant.components.climate import _LOGGER
from homeassistant.components.climate.const import (
ATTR_AUX_HEAT, ATTR_AWAY_MODE, ATTR_FAN_MODE, ATTR_H... | |
# -*- 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 'Formula'
db.create_table(u'survey_formula', (
(u'id', self.gf('django.db.models.... | |
# 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 ... | |
"""
Rdocs v0.1
by Hiu Kung
"""
import sublime
import sublime_plugin
import re
import datetime
import time
import imp
from functools import reduce
def read_line(view, point):
if (point >= view.size()):
return
next_line = view.line(point)
return view.substr(next_line)
def write(view, str):
vi... | |
"""Support for Legacy MQTT vacuum."""
import json
import voluptuous as vol
from homeassistant.components.vacuum import (
ATTR_STATUS,
SUPPORT_BATTERY,
SUPPORT_CLEAN_SPOT,
SUPPORT_FAN_SPEED,
SUPPORT_LOCATE,
SUPPORT_PAUSE,
SUPPORT_RETURN_HOME,
SUPPORT_SEND_COMMAND,
SUPPORT_STATUS,
... | |
"""
Driver for PQSC V1
Author: Michael Kerschbaum
Date: 2019/09
"""
import time
import sys
import os
import logging
import numpy as np
import pycqed
import json
import copy
import pycqed.instrument_drivers.physical_instruments.ZurichInstruments.ZI_base_instrument as zibase
log = logging.getLogger(__name__)
########... | |
"""\
Ints.py Basic routines for integrals in the PyQuante framework
This program is part of the PyQuante quantum chemistry program suite.
Copyright (c) 2004, Richard P. Muller. All Rights Reserved.
PyQuante version 1.2 and later is covered by the modified BSD
license. Please see the file LICENSE that is part o... | |
# -*- 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
from oscar.core.compat import AUTH_USER_MODEL, AUTH_USER_MODEL_NAME
class Migration(SchemaMigration):
depends_on = [('basket', '0001_initial')]
... | |
from django.conf import settings
from django.core.paginator import Paginator
from django.shortcuts import get_object_or_404
from django.template.loader import render_to_string
from django.template.response import TemplateResponse
from django.urls import reverse
from django.utils.translation import gettext as _
from dja... | |
'''Label
=====
.. image:: images/label.png
:align: right
The :class:`Label` widget is for rendering text. It supports ascii and unicode
strings::
# hello world text
l = Label(text='Hello world')
# unicode text; can only display glyphs that are available in the font
l = Label(text=u'Hello world '... | |
# Copyright 2022 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0
import shutil
import tempfile
try:
from cStringIO import StringIO as IOStream
except ModuleNotFoundError:
from io import BytesIO as IOStream
from spotseeker_server.test.images import ImageTestCase
from django.core.files.up... | |
import tensorflow as tf
tf.reset_default_graph()
import slurm_manager as slm
import re, ast, os, sys, time, argparse
from random import sample
from hostlist import expand_hostlist
import numpy as np
from nn_helper import *
LOGDIR = 'logs/nn-dist/'
FLAGS = None
if os.environ['USER']=='ackdav':
cluster, myjob, my... | |
# 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 itertools
import re
from recipe_engine import recipe_api
class GitApi(recipe_api.RecipeApi):
_GIT_HASH_RE = re.compile('[0-9a-f]{40}', re.IGNORECA... | |
# Copyright (c) 2014 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | |
"""
Plot ScoCen in (l, b) coordinates, stars for each component with different
colours.
"""
import numpy as np
from astropy.table import Table, join
from astropy import units as u
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
plt.ion()
# Pretty plots
from fig_settings import *
##################... | |
from django.test import TestCase
from schools.models import *
from django.contrib.auth.models import Group
from datetime import datetime, timedelta
from django.utils.timezone import utc
from unittest import skip
class TestModelRelations(TestCase):
def setUp(self):
managers_group = Group.objects.create(nam... | |
"""Functionality to match phone numbers in a piece of text"""
# Based on original Java code:
# java/src/com/google/i18n/phonenumbers/PhoneNumberMatch.java
# java/src/com/google/i18n/phonenumbers/PhoneNumberMatcher.java
# Copyright (C) 2011 The Libphonenumber Authors
#
# Licensed under the Apache License, Ver... | |
# Copyright 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 l... | |
"""
pytest PluginManager, basic initialization and tracing.
(c) Holger Krekel 2004-2010
"""
import sys, os
import inspect
import py
from _pytest import hookspec # the extension point definitions
assert py.__version__.split(".")[:2] >= ['1', '4'], ("installation problem: "
"%s is too old, remove or upgrade 'py'" % ... | |
#!/usr/bin/env python
#--------------------------------------------------------
# Linac Accelerator Nodes for Transport Matrices generation
# These nodes are using the Initial Coordinates particles Attributes.
# Each node (if it is not the first one) calculates the transport matrix
# between the previous node and itse... | |
"""Functions to visualize matrices of data."""
import itertools
import colorsys
import matplotlib as mpl
from matplotlib.collections import LineCollection
import matplotlib.pyplot as plt
from matplotlib import gridspec
import numpy as np
import pandas as pd
from scipy.spatial import distance
from scipy.cluster import ... | |
""" test the label propagation module """
import numpy as np
import pytest
from scipy.sparse import issparse
from sklearn.semi_supervised import _label_propagation as label_propagation
from sklearn.metrics.pairwise import rbf_kernel
from sklearn.model_selection import train_test_split
from sklearn.neighbors import Ne... | |
#!/usr/bin/python3 -i
#
# Copyright (c) 2015-2020 The Khronos Group Inc.
# Copyright (c) 2015-2020 Valve Corporation
# Copyright (c) 2015-2020 LunarG, Inc.
# Copyright (c) 2019-2020 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance wit... | |
#####################################################################################
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# This source code is subject to terms and conditions of the Apache License, Version 2.0. A
# copy of the license can be found in the License.html file at the root of t... | |
# -*- 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 field 'AnswerRule.batch'
db.add_column(u'survey_answerrule', 'batch',
self.gf... | |
from django.contrib.gis import forms
from django.contrib.gis.db.models.lookups import (
RasterBandTransform, gis_lookups,
)
from django.contrib.gis.db.models.proxy import SpatialProxy
from django.contrib.gis.gdal import HAS_GDAL
from django.contrib.gis.gdal.error import GDALException
from django.contrib.gis.geometr... | |
from matplotlib import pyplot as plt
from multiprocessing import Pool
from multiprocessing import cpu_count
import numpy as np
from scipy.misc import imread, imsave
import scipy.ndimage
import sklearn.linear_model as lm
import sys
import os
import utils
def sense(img, k=1000, basis="wvt", wvt_level=4, alpha=None):
... | |
# Copyright 2014 Mellanox Technologies, Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | |
#!/usr/bin/env python3
import json
import re
import urllib.request, urllib.parse, urllib.error
import time
import weechat as w
description = "weebullet pushes notifications from weechat to pushbullet"
help_text = """
commands:
/weebullet ignore adds to the list of ignored channels
/weebullet unig... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2012 NetApp, 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.or... | |
# Copyright 2013 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 agree... | |
from django.shortcuts import render, redirect
from django.http import (
HttpResponseForbidden,
Http404,
HttpResponse
)
from django.core.mail import send_mail
from django.contrib.auth.decorators import login_required
from django.db import transaction
from django.core.paginator import Paginator, EmptyPage, Pa... | |
"""
Convert text/enriched MIME type to text/html MIME type.
Based on the program in Appendix B of RFC 1896 -- see
http://www.rfc-editor.org/rfc/rfc1896.txt.
However, it was entirely rewritten for Python and
refactored for flexibility and comprehension. Support
for color and fontfamily was added.
Usage: python enr... | |
from unittest import TestCase
import validictory
class TestProperties(TestCase):
props = {
"prop01": {"type": "string"},
"prop02": {"type": "number", "required": False},
"prop03": {"type": "integer"},
"prop04": {"type": "boolean"},
"prop05": {
"type": "object",... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Vim Colorscheme Converter
~~~~~~~~~~~~~~~~~~~~~~~~~
This script converts vim colorscheme files to valid pygments
style classes meant for putting into modules.
:copyright 2006 by Armin Ronacher.
:license: BSD, see LICENSE for details.
"""
impor... | |
# Mercurial built-in replacement for cvsps.
#
# Copyright 2008, Frank Kingswood <frank@kingswood-consulting.co.uk>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from __future__ import absolute_import
import functools
import os
i... | |
import os
import pytest
import requests
import time
import urllib3
import yaml
import socket
import subprocess
import json
import rancher
from sys import platform
from .common import random_str, wait_for_template_to_be_created
from kubernetes.client import ApiClient, Configuration, CustomObjectsApi, \
Apiextensions... | |
#
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
#
import gevent
import gevent.queue
import gevent.wsgi
import os
import sys
import logging
import pdb
import json
from pprint import pprint
import functools
import socket
import time
import errno
import re
import copy
import uuid
import contextlib
from ... | |
from pandac.PandaModules import *
from toontown.toonbase.ToonBaseGlobal import *
from DistributedMinigame import *
from direct.interval.IntervalGlobal import *
from direct.fsm import ClassicFSM, State
from direct.fsm import State
from toontown.safezone import Walk
from toontown.toonbase import ToontownTimer
from direct... | |
#!/usr/bin/python
"""
Pushover API module and command line tool
"""
from urllib2 import Request, HTTPError, URLError, build_opener, ProxyBasicAuthHandler, ProxyHandler, install_opener
from urllib import urlencode
from json import loads
from argparse import ArgumentParser
from ConfigParser import ConfigParser, Error as ... | |
#!/usr/bin/python
# -*- coding: latin-1 -*-
"""
A Python wrapper for the SVO Filter Profile Service
"""
from glob import glob
import inspect
import os
from pkg_resources import resource_filename
import warnings
import itertools
import astropy.table as at
import astropy.io.votable as vo
import astropy.units as q
from a... | |
# found a way to include it more easily.
'''
SDL2 Window
===========
Windowing provider directly based on our own wrapped version of SDL.
TODO:
- fix keys
- support scrolling
- clean code
- manage correctly all sdl events
'''
__all__ = ('WindowSDL2', )
from os.path import join
from kivy import kivy... | |
#!/usr/bin/env python3
"""
A SymbiFlow implementation of OpenFPGA re-packer.
The repacker utility is responsible for converting a VPR packed netlist
expressed using "operating" modes of pb_types so that it is expressed using
cells from physical modes that represent the underlying hardware. For more
details please refe... | |
#!/usr/bin/env python
# Copyright 2013 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 or ... | |
# Parse Stripe payment info via exported payments.csv files
import sys
from datetime import tzinfo, timedelta, datetime
# TODO: use stripe_customers.csv to match payments to our db data
# Stripe file format
# id,Description,Created (UTC),Amount,Amount Refunded,Currency,Converted Amount,Converted Amount Refunded,Fee,... | |
"""Tests for useful utilities for higher level polynomial classes. """
from sympy import S, I, Integer, sqrt, symbols, pi
from sympy.utilities.pytest import raises
from sympy.polys.polyutils import (
_sort_gens,
_unify_gens,
_analyze_gens,
_sort_factors,
_analyze_power,
_dict_from_basic_if_gen... | |
# This file is part of Indico.
# Copyright (C) 2002 - 2021 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from contextlib import contextmanager
from datetime import timedelta
from operator import attrgetter
impo... | |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function
import functools
from collections import namedtuple
import tensorflow as tf
from niftynet.layer import layer_util
from niftynet.layer.base_layer import TrainableLayer
from niftynet.layer.bn import BNLayer
from niftynet.layer.convolution i... | |
# -*- coding: utf-8 -*-
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | |
"""
Testcases for wrapping/unwrapping keys.
"""
import logging
from distutils.version import LooseVersion
from contextlib import contextmanager
import random
import pytest
from pycryptoki.session_management import c_open_session_ex, login_ex, c_close_session, c_logout
from pycryptoki.cryptoki import CK_ULONG
from pyc... | |
schema = {
"vtm": {
"fields": [
"nm",
"invalid",
"abbrevnm",
"vtmidprev",
"vtmiddt"
],
"dmd_obj_relations": [
"vmp"
],
"other_relations": []
},
"vmp": {
"fields": [
"nm"... | |
#!/usr/bin/env python3
import os
import time
import multiprocessing
from tqdm import tqdm
import argparse
# run DM procs
os.environ["USE_WEBCAM"] = "1"
import cereal.messaging as messaging
from cereal.services import service_list
from cereal.visionipc.visionipc_pyx import VisionIpcServer, VisionStreamType # pylint: d... | |
""" DIRECT Nine DoF Manipulation Panel """
from direct.showbase.DirectObject import DirectObject
from direct.directtools.DirectGlobals import *
from direct.tkwidgets.AppShell import AppShell
from direct.tkwidgets.Dial import AngleDial
from direct.tkwidgets.Floater import Floater
from panda3d.core import *
import sys, ... | |
import unittest
from harmonicmodel.chord_template import ChordTemplate
from structure.LineGrammar.core.line_grammar_executor import LineGrammarExecutor
from harmoniccontext.harmonic_context import HarmonicContext
from harmoniccontext.harmonic_context_track import HarmonicContextTrack
from tonalmodel.tonality import To... | |
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | |
"""Session object for building, serializing, sending, and receiving messages in
IPython. The Session object supports serialization, HMAC signatures, and
metadata on messages.
Also defined here are utilities for working with Sessions:
* A SessionFactory to be used as a base class for configurables that work with
Sessio... | |
from __future__ import absolute_import
import numpy as nm
import numpy.linalg as nla
from sfepy.base.base import output, get_default, pause, Struct
from sfepy.base.log import Log, get_logging_conf
from sfepy.base.timing import Timer
from sfepy.solvers.solvers import OptimizationSolver
import scipy.optimize as sopt
i... | |
#!/usr/bin/env python
# Compute dice coefficient script
# Two different dice coefficient are computed
# 1 :
# DICE coefficient between binarized tracts thresholded at 0.5 and masks created from user.
# For each user, the DICE coefficient is calculated for each tract between the user and the atlas
# and averaged over... | |
from __future__ import unicode_literals
import os.path
import optparse
import shlex
import sys
from .downloader.external import list_external_downloaders
from .compat import (
compat_expanduser,
compat_get_terminal_size,
compat_getenv,
compat_kwargs,
)
from .utils import (
preferredencoding,
w... | |
import json
import unittest
import redislite
from dotmap import DotMap
from app import config
from app import views
from tests.helper import testdata_helper
class TestView(unittest.TestCase):
@classmethod
def setUpClass(cls):
config.rdb = redislite.Redis('redis.db')
cls.test_apps = [testdata... | |
from m3t2 import rho_red_light, flux
# help(rho_red_light)
import numpy
from matplotlib import pyplot
from matplotlib import rcParams
rcParams['font.family'] = 'serif'
rcParams['font.size'] = 16
from matplotlib import animation
nx = 100
nt = 30
dx = 4.0/nx
rho_in = 5.
rho_max = 10.
V_max = 1.
x = numpy.linspace(0... | |
import pygame
from math import sqrt
from random import randint, randrange, choice
from unit import Unit
from actions import *
from mongo_wrapper import MongoWrapper
# place random
# place right of last unit
# place left of last unit
# place same as last unit
# place random right side
# place random left side
# place ... | |
"""
Continuous variables have values anywhere in the range minus
infinite to plus infinite. However, when creating a visual
representation of these values what usually matters is the
relative difference between the values. This is where rescaling
comes into play.
The values are mapped onto a range that a scale can dea... | |
import at_lite as at
from at_lite.tree import TreeModel as PureTree
__all__ = ['LPathTreeModel']
# IMPORTANT: We assume that the underlying tree is frozen and not modified
# in any case.
class LPathTreeModel(PureTree):
AxisParent = "AxisParent"
AxisAncestor = "AxisAncestor"
AxisSibling = "AxisSibling"
... | |
from chest.core import Chest, nbytes, key_to_filename
import os
import re
import json
import shutil
import pickle
from contextlib import contextmanager
import numpy as np
from chest.utils import raises
import time
@contextmanager
def tmp_chest(*args, **kwargs):
c = Chest(*args, **kwargs)
fn = c.path
try:... | |
# 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... | |
from __future__ import division, unicode_literals
import os
import re
import sys
import time
from ..compat import compat_str
from ..utils import (
encodeFilename,
format_bytes,
timeconvert,
)
class FileDownloader(object):
"""File Downloader class.
File downloader objects are the ones responsibl... | |
#!/usr/bin/env python
# encoding: utf-8
'''
Created by Brian Cherinka on 2016-04-08 14:31:34
Licensed under a 3-clause BSD license.
Revision History:
Initial Version: 2016-04-08 14:31:34 by Brian Cherinka
Last Modified On: 2016-04-08 14:31:34 by Brian
'''
from __future__ import print_function
from __future__... | |
# 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... | |
import qctests.ICDC_aqc_01_level_order as ICDC
import qctests.ICDC_aqc_02_crude_range as ICDC_crude_range
import util.testingProfile
import util.main as main
import numpy as np
##### ICDC crude range check.
##### --------------------------------------------------
class TestClass():
parameters = {}
def setU... | |
from portality.lib import dataobj
from portality.models.v1 import shared_structs
class GenericBibJSON(dataobj.DataObj):
# vocab of known identifier types
P_ISSN = "pissn"
E_ISSN = "eissn"
DOI = "doi"
# allowable values for the url types
HOMEPAGE = "homepage"
WAIVER_POLICY = "waiver_policy"... | |
import logging
from scrapy.shell import inspect_response
from pdb import set_trace
from urllib.parse import urlparse, unquote
from scrapy.downloadermiddlewares.redirect import RedirectMiddleware
from course_collector.spiders.tongshi import ELECT_URL
from bs4 import BeautifulSoup
from time import sleep
from scrapy.http ... | |
# modified copy of some functions from test/regrtest.py from PyXml
"""Copyright (c) 2003-2006 LOGILAB S.A. (Paris, FRANCE).
http://www.logilab.fr/ -- mailto:contact@logilab.fr
Run tests.
This will find all modules whose name match a given prefix in the test
directory, and run them. Various command line options pro... | |
from random import shuffle as reorder
from constants import *
from gameGui import get_asset_image
#this class represents a deck of cards like surprize cards or punishment cards
board=None
players=[]
console = -1
###########################################################################
#dont forget to set this before... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright 2016 Kitware 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 cop... | |
# -*- test-case-name: twisted.internet.test.test_pollingfile -*-
# Copyright (c) 2001-2009 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Implements a simple polling interface for file descriptors that don't work with
select() - this is pretty much only useful on Windows.
"""
from zope.interface import i... | |
"""Unit tests for :mod:`ozelot.cache`"""
import unittest
from os import path
import time
import requests
import datetime
from ozelot import config
from ozelot.cache import RequestCache, get_request_cache, reset_request_cache
class RequestCacheTest(unittest.TestCase):
"""Unit tests for :class:`ozelot.cache.Reque... | |
# Copyright 2012 OpenStack Foundation.
# All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | |
#!/usr/bin/env python
"""
Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
See https://llvm.org/LICENSE.txt for license information.
SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
Provides classes used by the test results reporting infrastructure
within the LLDB test suite.
Test... | |
"""
File name is purposefully not test_* to run this test separately.
"""
import inspect
import unittest
import os
import shutil
from manticore.platforms.evm import EVMWorld
from manticore.core.smtlib import operators, ConstraintSet
from manticore.ethereum import (
ManticoreEVM,
DetectIntegerOverflow,
De... | |
import sys
import itertools
import pytest
import numpy as np
from numpy.testing import assert_, assert_equal, assert_raises, IS_PYPY
# This is the structure of the table used for plain objects:
#
# +-+-+-+
# |x|y|z|
# +-+-+-+
# Structure of a plain array description:
Pdescr = [
('x', 'i4', (2,)),
('y', 'f8',... | |
# -*- coding: utf-8 -*-
import os
import glob
import importlib
import mimetypes
from bson import ObjectId
from modularodm import fields
from mako.lookup import TemplateLookup
from time import sleep
import requests
from modularodm import Q
from framework.auth.decorators import must_be_logged_in
from framework.mongo im... | |
import unittest
import numpy as np
from pysal.lib import cg, examples
from .. import network
from .. import analysis
from .. import util
class TestNetwork(unittest.TestCase):
def setUp(self):
self.ntw = network.Network(in_data=examples.get_path('streets.shp'))
def tearDown(self):
pass
... | |
# 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.
# pylint: disable=import-error,print-statement,relative-import
import copy
import re
SPECIAL_TOKENS = [
# This list should be sorted by length.
'We... | |
import os
import tempfile
import unittest
import numpy as np
import tensorflow as tf
from flaky import flaky
from nose.tools import assert_true
import shutil
import deepchem as dc
from deepchem.data import NumpyDataset
from deepchem.data.datasets import Databag
from deepchem.models.tensorgraph.layers import Dense, So... | |
# -*- coding: utf-8 -*-
"""
<DefineSource>
@Date : Fri Nov 14 13:20:38 2014 \n
@Author : Erwan Ledoux \n\n
</DefineSource>
A Noder defines Child ordered dicts with <DoStr> as KeyStr.
The items inside are automatically setted with Noded<DoStr><TypeStr> and have
a Pointer to the parent InstanceVariable. This is the... | |
#
# Copyright (C) 2014 Red Hat, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (c) 2013 William Adams
# Distributed under the terms of the Modified BSD License.
# The full license is in the file LICENSE, distributed with this software.
#
from izdvd import config
import os
import os.path
import argparse
import tempfile
from datetime ... | |
# Copyright 2008-2015 Nokia Solutions and Networks
#
# 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... | |
import os
from enum import Enum
import hmac
import hashlib
import logging
from queue import Queue
import traceback
from threading import Thread
from flask import request, jsonify
from github import Github
from azure_devtools.ci_tools.bot_framework import (
BotHandler
)
from .sdkbot import (
GithubHandler
)
f... | |
# Copyright 2014 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.
# Monkeypatch IMapIterator so that Ctrl-C can kill everything properly.
# Derived from https://gist.github.com/aljungberg/626518
import multiprocessing.pool
... | |
# encoding: 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):
# Changing field 'Issue.label'
db.alter_column('journalmanager_issue', 'label', self.gf('django.db.models.... | |
"""This module provides classes for an SMT abstraction of bit vectors."""
from operator import lshift, rshift, ne, eq
from typing import Union, Set, cast, Any, Optional, Callable
import z3
from mythril.laser.smt.bool import Bool
from mythril.laser.smt.expression import Expression
Annotations = Set[Any]
# fmt: off
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.