gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# Copyright 2011 OpenStack Foundation
# All Rights Reserved.
# 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/LIC... | |
"""
Models for the in-game communication system.
The comm system could take the form of channels, but can also be
adopted for storing tells or in-game mail.
The comsystem's main component is the Message (Msg), which carries the
actual information between two parties. Msgs are stored in the
database and usually not d... | |
# Copyright 2013, Big Switch Networks, 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 applic... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | |
import json
import os
from pokemongo_bot import inventory
from pokemongo_bot.human_behaviour import action_delay
from pokemongo_bot.base_task import BaseTask
from pokemongo_bot.inventory import Pokemons, Pokemon
class TransferPokemon(BaseTask):
SUPPORTED_TASK_API_VERSION = 1
def work(self):
pokemon_... | |
#!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | |
# coding: utf-8
import plumber
from xylose.scielodocument import Article, Journal
import xylose
from articlemeta import export_sci
from articlemeta import export_rsps
from articlemeta import export_doaj
from articlemeta import export_pubmed
from articlemeta import export_crossref
class CustomArticle(Article):
@... | |
#!/usr/bin/env python3
import time
import copy
import random
import colorsys
import signal
import asyncio
from enum import Enum
# from termcolor import colored
import helper
def stringify(container, vertical_border = '', horizontal_border = ''):
s = ''
if len(horizontal_border) > 0:
s += vertical_bo... | |
# Natural Language Toolkit: Graphical Representations for Trees
#
# Copyright (C) 2001-2017 NLTK Project
# Author: Edward Loper <edloper@gmail.com>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
"""
Graphically display a Tree.
"""
from six.moves.tkinter import IntVar, Menu, Tk
from nltk.util im... | |
import sys
import numpy as np
import pickle
import os
from tqdm import tqdm
from itertools import chain
from sklearn.preprocessing.data import MinMaxScaler
from sklearn.svm import SVC, LinearSVC
from sklearn.naive_bayes import MultinomialNB, GaussianNB
from sklearn.neighbors import KNeighborsClassifier
from sklearn.di... | |
"""Unit tests illustrating usage of the ``history_meta.py``
module functions."""
from unittest import TestCase
from sqlalchemy.ext.declarative import declarative_base
from .history_meta import Versioned, versioned_session
from sqlalchemy import create_engine, Column, Integer, String, \
ForeignKey, Boolean, select
... | |
#!/usr/bin/env python
# Copyright 2013 Google, Inc. or its affiliates. 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 limitati... | |
"""
Read SAS7BDAT files
Based on code written by Jared Hobbs:
https://bitbucket.org/jaredhobbs/sas7bdat
See also:
https://github.com/BioStatMatt/sas7bdat
Partial documentation of the file format:
https://cran.r-project.org/web/packages/sas7bdat/vignettes/sas7bdat.pdf
Reference for binary data compression:
h... | |
# -*- coding: utf-8 -*-
#
# Copyright 2018 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... | |
from datetime import datetime, timedelta
import itertools
import sys
import os
import time
import unittest
from lxml import html
from tpb.tpb import TPB, Search, Recent, Top, List, Paginated
from tpb.constants import ConstantType, Constants, ORDERS, CATEGORIES
from tpb.utils import URL
if sys.version_info >= (3, 0):... | |
"""
Views for SymmetricalEureka
"""
from importlib import import_module
try:
from inspect import signature
except ImportError:
# pylint: disable=import-error
from funcsigs import signature
from django.core.exceptions import PermissionDenied, ValidationError
from django.core.urlresolvers import reverse_laz... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012-2013 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.... | |
import json
import urllib
from collections import OrderedDict
from datetime import datetime
from django.conf import settings
from django.core.cache import cache
from django.db.models import Q
import commonware.log
from elasticsearch_dsl import filter as es_filter
from tower import ugettext_lazy as _lazy
import mkt
f... | |
# coding= utf-8
# todo 1 (interaction, feature) +1: multiline TODO
# todo 2131 (interaction, feature) +0: popup todo history
# todo 232 (feature) +1: introduce sub-todo's that are part of other, todo yyy: becomes xxx/yyy
# todo 2141 (feature) +0: 232, create sub-todo's with inherited state and priority
import sub... | |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright (c) 2010 Citrix Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in complianc... | |
#Copyright 2012 EasyDevStdio , wes342
#
#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, ... | |
import __builtin__
import ast
import inspect
import types
from collections import OrderedDict
import numpy as np
from dsltools import NestedBlocks, ScopedDict
from .. import config, names, prims, syntax
from ..names import NameNotFound
from ..ndtypes import Type
from ..prims import Prim
from ..syntax import (Expr,... | |
import argparse
import os
import random
import time
import numpy as np
from keras.layers import (LSTM, BatchNormalization, Convolution3D, Dense, Dropout, Flatten, Input,
MaxPooling3D, TimeDistributed, ZeroPadding3D)
from keras.models import Model, Sequential
from src.data import import_label... | |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | |
# -*- coding: utf-8 -*-
"""Inception V3 model for Keras.
Note that the input image format for this model is different than for
the VGG16 and ResNet models (299x299 instead of 224x224),
and that the input preprocessing function is also different (same as Xception).
# Reference
- [Rethinking the Inception Architecture... | |
# coding=utf-8
import vdebug.ui.interface
import vdebug.util
import vim
import vdebug.log
import vdebug.opts
class Ui(vdebug.ui.interface.Ui):
"""Ui layer which manages the Vim windows.
"""
def __init__(self,breakpoints):
vdebug.ui.interface.Ui.__init__(self)
self.is_open = False
s... | |
#!/usr/bin/env python
# Copyright 2017 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
"""Bootstrap script to clone and forward to the recipe engine tool.
*******************
** DO NOT MODIFY **
**************... | |
from __future__ import annotations
from io import (
BytesIO,
StringIO,
)
import os
from urllib.error import HTTPError
import numpy as np
import pytest
import pandas.util._test_decorators as td
from pandas import DataFrame
import pandas._testing as tm
from pandas.io.xml import read_xml
"""
CHECK LIST
[x] ... | |
# -*- coding: utf-8 -*-
"""
Example:
```
df = pd.DataFrame({
'date': ['2014-01-01', '2014-01-02', '2014-01-03', '2014-01-04'],
'c1': [1.0, 3.0, 4.0, 2.4],
'c2': [1.0, 3.0, 4.0, 9.4],
'c3': [1.0, 3.0, 4.0, 1.4],
})
p = TimeSeriesPlot()
p.add(df['date'], df['c1'])
p.add(df['date'], df['c2'])
p.add(df['d... | |
from base import BaseClient
class MetadataClient(BaseClient):
_supportedFieldTypes = [
'AutoNumber',
'Checkbox',
'Currency',
'Date',
'DateTime',
'E... | |
# Copyright (c) 2016 GeoSpark
#
# Released under the MIT License (MIT)
# See the LICENSE file, or visit http://opensource.org/licenses/MIT
"""ILI9341 Font Packer v1.1
Converts TrueType fonts to a compact binary bitmap format for use with Paul Stoffregen's ILI9341 library for the Teensy.
Usage:
font_packer.py --h... | |
# -*- coding: utf-8 -*-
import base64
import hashlib
import json
import logging
import os
import shutil
import subprocess
import sys
import tempfile
import traceback
import urlparse
import uuid
import zipfile
from django import forms
from django.conf import settings
from django.core.files.storage import default_storag... | |
from __future__ import absolute_import
import binascii
import contextlib
import logging
import os
import struct
import types
import weakref
import datetime
from collections import namedtuple
from . import sched_basic as sched
def use_gevent():
global sched
from . import sched_gevent as sched
def default_wrapper(fu... | |
#!/usr/bin/env python2
#
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
from .mininode import *
from .blockstore import BlockStore, TxStore
from .util import p2p_port
'''
This is a tool for comparing two or more ulmds to e... | |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import time
import numpy as np
import pickle
import os
import tensorflow as tf
import ray
from ray.rllib.common import Agent, TrainingResult
from ray.rllib.dqn import logger, models
from ray.rllib.dqn.common.... | |
# Copyright (c) 2013 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | |
"""This module contains tests for the weighted graph implementation."""
"""This module contains the tests for a graph data structure."""
# Until we refactor our WGraph class to be ble to take in negative numbers, we're leaving negatives out for Floyd Warshall.
import pytest
TEST_NODES = [1, 2, 3, 4, "five", "six", "s... | |
import collections
import functools
import json
import mock
import six
from fabric import api as fab
import fabricio
from fabricio import docker, utils
from fabricio.docker import stack as stack_module
from tests import SucceededResult, args_parser, FabricioTestCase
def as_ordereddict(result):
return collecti... | |
import urllib2
import urllib
import re
import sys
import os
import time
from threading import Thread, Lock, Event
class Task(Thread):
_obj = None
def __init__(self, obj, args = None):
self._obj = obj
self._args = args
self._flag_stop = Event()
self._flag_pause = Event()
... | |
#
"""leveldb log datastore.
Format is described at:
https://github.com/google/leveldb/blob/master/doc/log_format.md
block := record* trailer?
record :=
checksum: uint32 // crc32c of type and data[] ; little-endian
length: uint16 // little-endian
type: uint8 // One of FULL, FIRST, MIDDLE, ... | |
#!/usr/bin/env python
__author__ = 'Brian McKenna <bmckenna@asascience.com>'
from collections import Counter
import gevent
from nose.plugins.attrib import attr
import os
import smtplib
import time
import unittest
from pyon.event.event import EventPublisher
from pyon.public import IonObject, OT, CFG
from pyon.util.in... | |
"""
Written by Jason Pitt
Revised by Dominic Fitzgerald on 30 May 2017
swiftseq run [args]
The entry point for starting a new SwiftSeq run.
"""
import os
import warnings
from collections import defaultdict
from itertools import product
import six
from swiftseq.core import SwiftSeqStrings
from swiftseq.core.readgroup... | |
import sys
from PyQt5 import QtWidgets, QtGui, QtCore
import androguard.session as session_module
from androguard.gui.DataModel import ApkModel, DexClassModel
from androguard.gui.apiwindow import APIWindow
from androguard.gui.binwindow import binWidget
from androguard.gui.fileloading import FileLoadingThread
from and... | |
# -*- coding: utf-8 -*-
# FOGLAMP_BEGIN
# See: http://foglamp.readthedocs.io/
# FOGLAMP_END
import http.client
import json
import urllib.parse
from foglamp.common import logger
from foglamp.common.microservice_management_client import exceptions as client_exceptions
__author__ = "Ashwin Gopalakrishnan"
__copyright__... | |
"""
Algorithm:
starting number of schedules
places all of these in a pq
do batches of randomizations of schedules, rescore
in each randomization of a schedule generate more schedules, each in a varying level of randomization
put them all back along with the original, unchanged schedule
randomization ... | |
# -*- encoding: utf-8 -*-
"""Prints the location of python object definition in your file-system.
"""
from __future__ import print_function
import sys
import argparse
import importlib
import inspect
import re
import os
from textwrap import dedent
import ast
from collections import namedtuple
# =============== #
# Co... | |
# 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 ... | |
#!/usr/bin/env python
"""Tests for grr.lib.aff4_objects.standard."""
import hashlib
import StringIO
import zlib
from grr.lib import aff4
from grr.lib import rdfvalue
from grr.lib import test_lib
class BlobImageTest(test_lib.GRRBaseTest):
"""Tests for cron functionality."""
def testAppendContentError(self):
... | |
"""The tests for the Tasmota binary sensor platform."""
import copy
from datetime import timedelta
import json
from hatasmota.utils import (
get_topic_stat_status,
get_topic_stat_switch,
get_topic_tele_sensor,
get_topic_tele_will,
)
from homeassistant.components import binary_sensor
from homeassistant... | |
# Copyright (C) 2013-2015 MetaMorph Software, Inc
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this data, including any software or models in source or binary
# form, as well as any drawings, specifications, and documentation
# (collectively "the Data"), to deal in the Data witho... | |
import pandas as pd
import json, hashlib, os, codecs, base64
from igf_data.igfdb.baseadaptor import BaseAdaptor
from igf_data.igfdb.igfTables import User
class UserAdaptor(BaseAdaptor):
'''
An adaptor class for table User
'''
def _email_check(self, email):
'''
An internal function to check if email_id ... | |
from __future__ import division, absolute_import, print_function
import os
import re
import sys
import types
import shlex
import time
from copy import copy
from distutils import ccompiler
from distutils.ccompiler import *
from distutils.errors import DistutilsExecError, DistutilsModuleError, \
... | |
from interpreter.kmp_py import reader, evaluator,schemeExceptions, initialize
from interpreter.kmp_py.scheme import *
from unittest import TestCase
import sys
# initialize global environments and adds initial bindings to globalEnv and syntaxEnv
initialize.initialize()
def eval_string(string, env = evaluator.SchemeEva... | |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
"""
Utilities for using modules
"""
import frappe, os, json
import frappe.utils
from frappe import _
lower_case_files_for = ['DocType', 'Page', 'Report',
"Workflow", 'Module De... | |
import os
import sys
import time
import atexit
import datetime
import argparse
CUR_DIR = os.path.dirname(os.path.realpath(__file__))
try:
import RPi.GPIO as GPIO
except ImportError:
# If you aren't running this on a Pi, you won't have
# the GPIO avaialble, so there is a file in utilities that
# stub... | |
import sys
import json
import re
from deriva.core import ErmrestCatalog, AttrDict, ermrest_model, get_credential
from deriva.config.base_config import BaseSpec, BaseSpecList, ConfigUtil, ConfigBaseCLI
if sys.version_info > (3,):
unicode = str
MY_VERSION = 0.99
class NoForeignKeyError(ValueError):
pass
cla... | |
## IMPORTS #####################################################################
import math
import numpy as np
from numpy import atleast_2d as twod
from numpy import asmatrix as mat
from numpy import asmatrix as arr
from .utils import toIndex
########################################################################... | |
#!python3
#-*- coding: utf-8 -*-
import os
import sys
import json
import webbrowser
import operator
from math import ceil
from geopy.distance import vincenty
def dump_poke_groups(poke_groups, pokeGroups):
data = []
for groupNum in range(pokeGroups):
groupId = '@'+str(groupNum)
groupNode = poke... | |
# Copyright 2018 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, ... | |
""" Principal Component Analysis
"""
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Olivier Grisel <olivier.grisel@ensta.org>
# Mathieu Blondel <mathieu@mblondel.org>
# Denis A. Engemann <d.engemann@fz-juelich.de>
#
# License: BSD 3 clause
from math import log, sqrt
import warnin... | |
import numpy as np
import os
import cv2
import logging
import scipy
import scipy.interpolate
import ImageTools
import StackTools
import CompleteAlignParallel
import FastAlignParallel
import ComputeStdevImage
import FrameStack
logger = logging.getLogger(__name__)
class AoRecording:
"""Class for information about a... | |
# Copyright 2017 The PDFium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Classes that draw conclusions out of a comparison and represent them."""
from collections import Counter
FORMAT_RED = '\033[01;31m{0}\033[00m'
FORMAT_GREEN... | |
# 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 ... | |
import os
import logging, logging.handlers
# Live site settings (others should override in local.py)
ROOT_PATH = os.path.dirname(__file__)
DEBUG = False
TEMPLATE_DEBUG = DEBUG
TESTING = False # Override this in test_settings.py
DATABASE_ENGINE = 'mysql'
DATABASE_NAME = 'bookworm'
DATABASE_USER = 'threepress'
DAT... | |
##########################################################################
#
# Copyright 2008-2009 VMware, 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 withou... | |
# 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... | |
# Copyright (c) 2014 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 ... | |
"""
Allow Panflute to be run as a command line executable
to be used as a Pandoc filter or used in Pandoctools
shell scripts as Pandoc filter with arguments.
Exports ``main`` and ``panfl``.
"""
import os
import os.path as p
from pathlib import Path
import sys
import click
from io import StringIO
from .io import load... | |
# Copyright 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 a... | |
## @file
# This file is used to create a database used by build tool
#
# Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.<BR>
# (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
# This program and the accompanying materials
# are licensed and made available under the terms and condition... | |
# 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... | |
# engine/default.py
# Copyright (C) 2005-2020 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Default implementations of per-dialect sqlalchemy.engine classes.
These are se... | |
"""
This module defines the :class:`GenericFunction` class, which is the base for
the implementation of spatial functions in GeoAlchemy. This module is also
where actual spatial functions are defined. Spatial functions supported by
GeoAlchemy are defined in this module. See :class:`GenericFunction` to know how
to cre... | |
""" A *Marker* is a proxy class which wraps some schema.
Immediately, the example is:
```python
from good import Schema, Required
Schema({
'name': str, # required key
Optional('age'): int, # optional key
}, default_keys=Required)
```
This way, keys marked with `Required()` will report errors if no value i... | |
# coding: utf-8
'''
The MIT License (MIT)
Copyright (c) 2014 Andreas "Akki" Nitsch
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 ... | |
# Copyright 2017 Telstra Open Source
#
# 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... | |
import inspect
import logging
from collections import OrderedDict
import baseEdge
from ds.vortex.core import baseNode
from ds.vortex.core import vortexEvent
from ds.vortex.nodes import allNodes
logger = logging.getLogger(__name__)
class Graph(object):
"""This graph class stores the nodes and will evaluate the g... | |
# Copyright (c) 2011 Openstack, LLC.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | |
#!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | |
# Copyright 2019 Fortinet, Inc.
#
# 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, or
# (at your option) any later version.
#
# This program is distributed in the... | |
from cStringIO import StringIO
import os
import urlparse
import struct
from struct import calcsize
from twisted.protocols import basic
from twisted.internet import protocol, defer
from twisted.application import service
from twisted.internet.endpoints import TCP4ClientEndpoint
from twisted.web import xmlrpc, server
... | |
# 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
#
# unless required by app... | |
import random
import minesweeper_util as u
import minesweeper as mnsw
import math
import time
class MinesweeperGame(object):
def __init__(self, num_mines=None, mine_prob=None):
self.cell_ids = list(self.gen_cells())
self.num_cells = len(self.cell_ids)
assert num_mines is not None or mine_p... | |
# -*- 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... | |
# -*- 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 'Project'
db.create_table(u'project_project', (
('projectid', self.gf('django.db.... | |
# This class implements the AIML pattern-matching algorithm described
# by Dr. Richard Wallace at the following site:
# http://www.alicebot.org/documentation/matching.html
import marshal
import pprint
import re
import string
import sys
class PatternMgr:
# special dictionary keys
_UNDERSCORE = 0
_STAR = 1
_T... | |
import logging
import pykka
import serial
import time
logger = logging.getLogger('mopidy_arcam')
class ArcamTalker(pykka.ThreadingActor):
"""
Independent thread which does the communication with the Arcam amplifier.
"""
# Serial link config
BAUDRATE = 38400
BYTESIZE = 8
PARITY = 'N... | |
# Software License Agreement (BSD License)
#
# Copyright (c) 2009-2010, Tijn van der Zant and Komei Sugiura.
# Copyright (c) 2010-2013, Dirk Holz and Luca Iocchi.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following condi... | |
from __future__ import unicode_literals
from rbpkg.package_manager.errors import (DependencyConflictError,
PackageInstallError)
from rbpkg.package_manager.pending_install import PendingInstall
from rbpkg.repository.loaders import InMemoryPackageDataLoader, set_data_loader
from... | |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
# ----------------------------------------------------------------------------
# Copyright (c) 2013--, scikit-bio development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
# --------------------------------------------... | |
# coding=utf-8
# flake8: noqa E302
"""
Cmd2 testing for argument parsing
"""
import argparse
from typing import (
Optional,
)
import pytest
import cmd2
from .conftest import (
run_cmd,
)
class ArgparseApp(cmd2.Cmd):
def __init__(self):
self.maxrepeats = 3
cmd2.Cmd.__init__(self)
de... | |
"""Tests for classes defining properties of ground domains, e.g. ZZ, QQ, ZZ[x] ... """
from sympy.polys.algebratools import (
ZZ, QQ, RR, PolynomialRing, FractionField, EX
)
from sympy.polys.polyerrors import (
UnificationFailed,
GeneratorsNeeded,
DomainError,
)
from sympy import S, sqrt, sin, oo, ra... | |
"""Methods and classes related to executing Z-Wave commands and publishing these to hass."""
from __future__ import annotations
import asyncio
import logging
from typing import Any
import voluptuous as vol
from zwave_js_server.client import Client as ZwaveClient
from zwave_js_server.const import CommandStatus
from zw... | |
# -*- coding: utf-8 -*-
from urlparse import urlparse
from nose.tools import * # flake8: noqa
from framework.auth.core import Auth
from website.models import NodeLog
from website.views import find_dashboard
from website.util import permissions
from website.util.sanitize import strip_html
from api.base.settings.defa... | |
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
from dateu... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack LLC.
# 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/l... | |
"""
Integration tests for the vault execution module
"""
import logging
import time
import pytest
import salt.utils.path
from tests.support.case import ModuleCase
from tests.support.runtests import RUNTIME_VARS
from tests.support.sminion import create_sminion
from tests.support.unit import SkipTest, skipIf
log = log... | |
# Copyright (C) 2013-2016 Martin Vejmelka, CU Denver
#
# 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, mer... | |
from __future__ import division
from iotbx.pdb.multimer_reconstruction import multimer
from iotbx.ncs.ncs_preprocess import ncs_only
import mmtbx.monomer_library.server
import iotbx.reflection_file_utils
from libtbx.utils import null_out
from iotbx.pdb import fetch
from libtbx import easy_run
import cPickle as pickle
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.