gt
stringclasses
1 value
context
stringlengths
2.49k
119k
import asynchat import smtpd from concurrent import futures #from tls import TLSHandshaker from .tls import TLSHandshaker try: from multiprocessing import cpu_count except ImportError: # some platforms don't have multiprocessing def cpu_count(): return 1 import sys try: import ssl except Impo...
from core.himesis import Himesis, HimesisPreConditionPatternLHS import uuid class HPP4_ConnectedLHS(HimesisPreConditionPatternLHS): def __init__(self): """ Creates the himesis graph representing the AToM3 model HPP4_ConnectedLHS. """ # Flag this i...
"""Module to perform data cleaning functions on EIA860 data tables.""" import logging import numpy as np import pandas as pd import pudl from pudl.metadata.classes import DataSource from pudl.metadata.codes import CODE_METADATA from pudl.metadata.fields import apply_pudl_dtypes logger = logging.getLogger(__name__) ...
#!/usr/bin/python # -*- coding: utf-8 -*- import logging logger = logging.getLogger("dialogs") import os.path from .dialog_exceptions import UnknownVerb from dialogs.helpers.helpers import colored_print def singleton(cls): instances = {} def getinstance(): if cls not in instances: inst...
import asyncio import sys import threading from asyncio import QueueEmpty as AsyncQueueEmpty from asyncio import QueueFull as AsyncQueueFull from collections import deque from heapq import heappop, heappush from queue import Empty as SyncQueueEmpty from queue import Full as SyncQueueFull from typing import Any, Callabl...
#!/usr/bin/env python # Import OE-Classic recipe data into the layer index database # # Copyright (C) 2013 Intel Corporation # Author: Paul Eggleton <paul.eggleton@linux.intel.com> # # Licensed under the MIT license, see COPYING.MIT for details import sys import os.path sys.path.insert(0, os.path.realpath(os.path.j...
# 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...
# 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...
#! /usr/bin/python # Copyright (c) 2015 Dave McCoy (dave.mccoy@cospandesign.com) # # This file is part of Nysa. # (http://wiki.cospandesign.com/index.php?title=Nysa.org) # # Nysa 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 So...
from direct.directtools.DirectSelection import * from direct.directtools.DirectUtil import ROUND_TO from direct.directtools.DirectGeometry import LineNodePath from direct.gui.DirectGui import * from panda3d.core import * from panda3d.direct import * from direct.showbase.DirectObject import DirectObject from toontown.to...
#!/usr/bin/env python3 # Snippets to read from the colmap database taken from: # https://github.com/colmap/colmap/blob/ad7bd93f1a27af7533121aa043a167fe1490688c / # scripts/python/export_to_bundler.py # scripts/python/read_write_model.py # License is that derived from those files. import argparse import logging import...
# Copyright 2012 VMware, 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 ...
import shutil import tempfile from model_mommy import mommy from django.test import TestCase, override_settings from django.urls import reverse from django.utils.text import slugify from rest_framework import status from cities.models import City from meupet import forms from meupet.models import Kind, Pet, PetStatu...
from kessel import combinators from kessel import primitives from kessel import test_utils class TryTest(test_utils.TestCase): def test_parses(self): self.assertParse(combinators.try_(primitives.match(lambda c: c == "h")), "h", "ello", "hello") def test_fails_to_parse(self): ...
# -*- coding: utf-8 -*- """Parser for Linux UTMP files.""" import construct import logging import os import socket from plaso.lib import errors from plaso.lib import event from plaso.lib import eventdata from plaso.lib import timelib from plaso.parsers import interface from plaso.parsers import manager __author__ =...
from twisted.internet import defer from twisted.trial import unittest from twisted.python.failure import Failure import trex from trex import redis from .mixins import REDIS_HOST, REDIS_PORT class SortedSetsTests(unittest.TestCase): ''' Tests for sorted sets ''' _KEYS = ['trex:testssets1', 'trex:tes...
from __future__ import print_function import datetime from typing import Dict, List, Optional, Union import collections import os import sys import numpy as np import time from ray.util.annotations import PublicAPI, DeveloperAPI from ray.util.queue import Queue from ray.tune.callback import Callback from ray.tune.l...
from tcga_encoder.utils.helpers import * from tcga_encoder.data.data import * from tcga_encoder.definitions.tcga import * #from tcga_encoder.definitions.nn import * from tcga_encoder.definitions.locations import * from tcga_encoder.analyses.survival_functions import * #from tcga_encoder.algorithms import * import seab...
import pygame, random, basic, sys, Pause, Pregame, pygame.mixer,database, time, Pygame_main, Category Black = basic.black White = basic.white Blue = basic.blue Red = basic.red Green = basic.green Yellow = basic.yellow Gold = basic.gold Dice_resize = (200,200) changeL = -28.5 changeR = 29 changeU = -42.5 #images #d...
# -*- coding: utf-8 -*- """ flask_security.core ~~~~~~~~~~~~~~~~~~~ Flask-Security core module :copyright: (c) 2012 by Matt Wright. :license: MIT, see LICENSE for more details. """ from flask import current_app, render_template from flask_login import AnonymousUserMixin, UserMixin as BaseUserMixi...
# 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...
import sys, os import scipy from pylab import * from matplotlib import * from scipy.stats import * from numpy import * from scipy import * import kepfit import kepmsg """ This code is based on the PyKE routine kepsff found at keplerscience.arc.nasa.gov The kepsff code is based on Vanderberg and Johnson 2014. If you ...
""" Contexts are the "values" that Python would return. However Contexts are at the same time also the "contexts" that a user is currently sitting in. A ContextSet is typically used to specify the return of a function or any other static analysis operation. In jedi there are always multiple returns and not just one. "...
# Copyright 2020 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 absolute_import, unicode_literals import docker import time from tests import unittest, mock from tests.factories.docker_client_factory import DockerClientFactory from freight_forwarder.container.config import Config from freight_forwarder.container.container import Container from fre...
from tkinter import * import ConnectFour from ConnectFour import C4Game from random import randint import games g = C4Game # class GameState: # def __init__(self, to_move, board, label=None, depth=8): # self.to_move= to_move # self.board = board # self.label = label # self.maxDepth...
# Licensed under a 3-clause BSD style license - see LICENSE.rst import pytest import numpy as np from astropy.table import Table, QTable, Column from astropy.table.table_helpers import simple_table from astropy.units import allclose as quantity_allclose from astropy.units.quantity import QuantityInfo from astropy.ut...
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
# -*- coding: utf-8 -*- # 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...
import numpy as np import pytest import dask.array as da from dask.array.numpy_compat import _numpy_120 from dask.array.utils import assert_eq from .test_dispatch import EncapsulateNDArray, WrappedArray @pytest.mark.parametrize( "func", [ lambda x: np.append(x, x), lambda x: np.concatenate([...
# # 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...
# Copyright 2017 BlyNotes. 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 agr...
from __future__ import absolute_import from __future__ import with_statement from mock import Mock from celery.worker import bootsteps from celery.tests.utils import AppCase, Case class test_Component(Case): class Def(bootsteps.Component): name = 'test_Component.Def' def test_components_must_be_n...
#!/usr/bin/python from collections import OrderedDict import time import gevent import random from dotstar import Adafruit_DotStar import sys import alsaaudio import wave import struct import math COOLING = 60 SPARKING = 60 numpixels = 120 # Number of LEDs in strip # Here's how to control the strip from any two GPIO ...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 Cloudbase Solutions Srl # # 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/LICE...
# # 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 The Mesh TensorFlow 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 applicab...
# 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 agreed t...
"""Support for Adafruit DHT temperature and humidity sensor.""" from __future__ import annotations from datetime import timedelta import logging import adafruit_dht import board import voluptuous as vol from homeassistant.components.sensor import ( PLATFORM_SCHEMA, SensorDeviceClass, SensorEntity, Se...
# coding: utf-8 """ Server API Reference for Server API (REST/Json) OpenAPI spec version: 2.0.6 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import re class UpdateExtractRequest(object): """ NOTE: This class...
""" Contains the POS tags, dependency relations, and morphological features defined by the Universal Dependencies project [0], for both of its major versions. [0] http://universaldependencies.org/ """ from collections import OrderedDict """ Tuples (one for each UD version) listing all possible universal POS tags w...
from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_HTTPError, compat_str, ) from ..utils import ( determine_ext, ExtractorError, fix_xml_ampersands, int_or_none, orderedSet, parse_duration, qualities, strip_jsonp, ...
""" Utility function to facilitate testing. """ import os import sys import re import operator from nosetester import import_nose __all__ = ['assert_equal', 'assert_almost_equal','assert_approx_equal', 'assert_array_equal', 'assert_array_less', 'assert_string_equal', 'assert_array_almost_equal',...
from importlib import import_module import os from django.core.exceptions import AppRegistryNotReady, ImproperlyConfigured from django.utils.module_loading import module_has_submodule from django.utils._os import upath MODELS_MODULE_NAME = 'models' class AppConfig(object): """ Class representing a Django a...
""" For the ePuck robot, a small simulator is provided. It allows to place ePuck in an arena, with unpassable walls and obstacles at (almost) arbitrary locations. Some environment objects are predefined in :py:mod:`HDPy.epuck.env`. The class :py:class:`Robot` provides the implementation of the simulated ePuck. Obstacle...
# Copyright 2021 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, ...
#!/usr/bin/env python """ lit - LLVM Integrated Tester. See lit.pod for more information. """ from __future__ import absolute_import import math, os, platform, random, re, sys, time import lit.ProgressBar import lit.LitConfig import lit.Test import lit.run import lit.util import lit.discovery class TestingProgress...
import wx import webbrowser from settings import settings BLANK = 'about:blank' COMMAND_CLOSE = 'http://close/' COMMAND_NEXT = 'http://next/' COMMAND_PREVIOUS = 'http://previous/' COMMAND_FIRST = 'http://first/' COMMAND_LAST = 'http://last/' COMMAND_PLAY = 'http://play/' COMMAND_PAUSE = 'http://pause/' def position_w...
# Copyright DataStax, 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 writing, softwa...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 OpenStack Foundation # Copyright 2013 IBM Corp. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at #...
#!/usr/bin/env python # #----------------------------------------------------------------------- # A test suite for the table interface built on bsddb.db #----------------------------------------------------------------------- # # Copyright (C) 2000, 2001 by Autonomous Zone Industries # Copyright (C) 2002 Gregory P. Sm...
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
"""This script contains relevant functions to read the configuration for MSAF. A bunch of it is basically shamefully copy pasted from the almighty theano.""" from __future__ import absolute_import, print_function, division try: from configparser import (ConfigParser, NoOptionError, NoSectionError, ...
# -*- coding: utf-8 -*- # # climlab-0.2.13 Documentation documentation build configuration file, created by # sphinx-quickstart on Mon Jan 25 10:23:51 2016. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # auto...
# Copyright 2021 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import annotations import logging import os.path import tokenize from collections import defaultdict from dataclasses import dataclass from typing import DefaultDict from...
""" This script generates a pandadoc.hpp file representing the Python wrappers that can be parsed by doxygen to generate the Python documentation. You need to run this before invoking Doxyfile.python. It requires a valid makepanda installation with interrogatedb .in files in the lib/pandac/input directory. """ __all_...
import copy import os import time import traceback from discord import Channel, Member, Server, User import asyncio from musicbot.exceptions import (BrokenEntryError, ExtractionError, OutdatedEntryError) from musicbot.lib.serialisable import Serialisable, WebSerialisable from musicbot...
# # AstroImage.py -- Abstraction of an astronomical data image. # # Eric Jeschke (eric@naoj.org) # # Copyright (c) Eric R. Jeschke. All rights reserved. # This is open-source software licensed under a BSD license. # Please see the file LICENSE.txt for details. # import sys, os import re import math import logging imp...
# -*- coding: utf-8; -*- import re import yaml from os.path import basename, abspath from sys import exit, argv from copy import deepcopy from getopt import getopt from getpass import getpass from functools import partial from subprocess import CalledProcessError from lxml import etree from jenkins import Jenkins, J...
from __future__ import unicode_literals import re from wtforms.compat import string_types, text_type __all__ = ( 'DataRequired', 'data_required', 'Email', 'email', 'EqualTo', 'equal_to', 'IPAddress', 'ip_address', 'InputRequired', 'input_required', 'Length', 'length', 'NumberRange', 'number_range', 'Opti...
import copy import gridfs import hashlib import datetime import numpy as np import pymongo as pm import cPickle as pickle from bson.binary import Binary from bson.objectid import ObjectId import torch # import base class DBInterface(object): """Interface for all DBInterface subclasses. Your database class s...
from os import path from django.template import Template, Context, TemplateSyntaxError try: from PIL import Image except ImportError: import Image from django.core.files import storage as django_storage from easy_thumbnails import alias, storage from easy_thumbnails.conf import settings from easy_thumbnails....
#!/usr/bin/python # David Wu # todo: add filters, # change for different kernel versions (i.e. 3.18 BR_TRANSACTION logging) # # line numbers from http://androidxref.com/kernel_3.4/xref/drivers/staging/android/binder.c ''' -d see kernel debug messages (i.e. binder printks) followed by the number for types of deb...
# Copyright 2013 - Mirantis, Inc. # Copyright 2018 - Extreme 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 # # ...
# -*- coding: utf-8 -*- """Tests for go.vumitools.bulk_send_application""" import json from twisted.internet.defer import inlineCallbacks, returnValue from vumi.message import TransportUserMessage from vumi.tests.helpers import VumiTestCase from go.apps.surveys.vumi_app import SurveyApplication from go.apps.tests....
# Copyright (c) 2012-2015 Netforce Co. Ltd. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publ...
# 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 the...
"""Support for Rheem EcoNet water heaters.""" import datetime import logging import voluptuous as vol from homeassistant.components.water_heater import ( DOMAIN, PLATFORM_SCHEMA, STATE_ECO, STATE_ELECTRIC, STATE_GAS, STATE_HEAT_PUMP, STATE_HIGH_DEMAND, STATE_OFF, STATE_PERFORMANCE, SUPPORT_OPERATION_MODE,...
from __future__ import annotations import re from typing import Generator from ..utils.fs import Path from .plugin.interface import PublisherInterface MULTIPLE_USE_METADATA_FIELDS = { 'classifier', 'dynamic', 'license_file', 'obsoletes_dist', 'platform', 'project_url', 'provides_dist', ...
from __future__ import (absolute_import, print_function) from base64 import b64decode, b64encode import cherrypy from datetime import datetime import dozer.dao as dao import dozer.filesystem as fs import dozer.jsonrpc as jsonrpc from dozer.exception import ( FileNotFoundError, InvalidParameterError, LoginDeniedErro...
# 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 agreed to in writing, software #...
# Copyright (c) 2011-2016 Rackspace US, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed ...
from ZODB.DB import DB import BTrees.IOBTree import BTrees.LOBTree import BTrees.OIBTree import BTrees.OLBTree import BTrees.OOBTree import ZODB.FileStorage import ZODB.POSException import argparse import collections import logging import pdb # noqa import transaction import persistent import zodbpickle log = loggin...
#!/usr/bin/env python import MKDatabase from MKFlowMessage import FBconvertLong # Main Class class MKFlowCommunication(): def __init__(self): self.nullNode = MKFlowNode(-1) self.node_numbers = [] self.nodes = [] def addNode(self, number): if not self.isNode(number): ...
"""Z-Wave Constants.""" DOMAIN = "zwave" ATTR_NODE_ID = "node_id" ATTR_TARGET_NODE_ID = "target_node_id" ATTR_ASSOCIATION = "association" ATTR_INSTANCE = "instance" ATTR_GROUP = "group" ATTR_VALUE_ID = "value_id" ATTR_OBJECT_ID = "object_id" ATTR_NAME = "name" ATTR_SCENE_ID = "scene_id" ATTR_BASIC_LEVEL = "basic_level...
''' Jared Smith PyMiner, Version 0.1 DatabaseUtilities.py Authored under MIT License. ''' # Built-in Modules import logging import urllib2 import re # 3rd-party imports import MySQLdb from django.utils.encoding import smart_str, smart_unicode # SQL class handles all database operations class SQL: ...
# 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...
from __future__ import division from Constant import Constant from Moment import Moment from Team import Team plt = None from sportvu import data import numpy as np class EventException(Exception): pass def format_pbp(pbp): event_str = "Play-By-Play Annotations\n" g = pbp.iterrows() for eind, pp in pb...
import pickle from kafka_base_monitor import KafkaBaseMonitor class InfoMonitor(KafkaBaseMonitor): regex = "info:*:*" def setup(self, settings): ''' Setup kafka ''' KafkaBaseMonitor.setup(self, settings) def handle(self, key, value): ''' Processes a vaild...
"""""FLASK'S VIEW FILE""""" from functools import wraps from flask import render_template, request, session, redirect, url_for, flash from app import app, usr_account, shopn_list, shopn_items from app import list_table_creator, item_table_creator @app.route('/') def index(): """LOADS HOME PAGE""" return rende...
#!/usr/bin/python2.7 -tt from __future__ import unicode_literals import sys if sys.version_info < (2, 7): print "Must use python 2.7 or greater\n" sys.exit() try: import wx except ImportError: print "You do not appear to have wxpython installed.\n" print "Without wxpython, this program cannot run.\n" print "You...
""" Sample showing chunked execution of expresions This sample constructs an expresion to be executed in chunks. Different aproaches are tested, and it is compared with the equivalent expresion written in numpy. """ import blaze import blaze.blir as blir import numpy as np from time import time import math # ======...
# coding=utf-8 # Copyright 2021 The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless r...
#!/usr/bin/env python # Copyright (c) 2013 Intel Corporation. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """This script will do: 1. Setup src's git initialization. 2. Place .gclient file outside of src. 3. Call gclient sync outside ...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # 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...
#!/usr/bin/env python # 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 # "L...
#Copyright ReportLab Europe Ltd. 2000-2012 #see license.txt for license details __version__=''' $Id: test_platypus_general.py 3959 2012-09-27 14:39:39Z robin $ ''' #tests and documents Page Layout API __doc__="""This is not obvious so here's a brief explanation. This module is both the test script and user guide for ...
# 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/python # -*- coding: utf-8 -*- ''' Custom filters for use in openshift-master ''' import copy import sys # pylint import-error disabled because pylint cannot find the package # when installed in a virtualenv from distutils.version import LooseVersion # pylint: disable=no-name-in-module,import-error from a...
""" Views for the ``django-frequently`` application. """ from math import fsum from django.contrib import messages from django.contrib.auth.models import User from django.http import HttpResponse, Http404 from django.template.response import TemplateResponse from django.urls import reverse from django.utils import ti...
""" Implements the PSLQ algorithm for integer relation detection, and derivative algorithms for constant recognition. """ from .libmp.backend import xrange from .libmp import int_types, sqrt_fixed # round to nearest integer (can be done more elegantly...) def round_fixed(x, prec): return ((x + (1<<(prec-1))) >> p...
""".. Ignore pydocstyle D400. .. autoclass:: resolwe.flow.executors.docker.run.FlowExecutor :members: """ # pylint: disable=logging-format-interpolation import asyncio import json import logging import os import shlex import tempfile import time from asyncio import subprocess from . import constants from ..globa...
#! /usr/bin/env python # -*- coding: utf-8 -*- #################### # Copyright (c) 2012, Perceptive Automation, LLC. All rights reserved. # http://www.perceptiveautomation.com # # Note that python version 2.5.6 is in use by Indigo. # import indigo import os import sys import time from Protocol import * from Mag...
"""plotting module for orbital This implementation was inspired by poliastro (c) 2012 Juan Luis Cano (BSD License) """ # encoding: utf-8 from __future__ import absolute_import, division, print_function from copy import copy import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np from matplotlib im...
## ## MCMC sampler for Mixture-of-Isoforms (MISO) model ## ## Yarden Katz <yarden@mit.edu> ## ## The sampler uses a Metropolis-Hastings sampling scheme, combined with ## a Gibbs sampling step. ## import scipy import misopy from misopy.reads_utils import count_aligned_reads, \ count_isofor...
import time import json from threading import Thread from random import sample, randint, choice, random from plugincon import bot_command, easy_bot_command, get_message_target, get_bot_nickname channel_data = {} def percent_chance(percentage): trandom = randint(0, 100) print trandom return percentage >= trandom...
import pieces, board, random, copy gray = (100, 100, 100) #Used fo rgenerating list of next pieces class PieceBag: def __init__(self): self.bag=[] self.refill_bag() def refill_bag(self): for x in range(7): self.bag.append(random.randint(0, 6)) self.remaining = 7 ...
# 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...
import logging from copy import deepcopy #for abusively making wrappers class BlockReinit: #def __new__(cls, *args, **kwargs): # pass # ?? is there a sensible way to trick wrapper def __init__(self, *args, **kwargs): logging.debug("blocking reinitialization of super() of %r; extra args...
import functools import hashlib import json import random import uuid from operator import attrgetter from django import http from django.conf import settings from django.db.transaction import non_atomic_requests from django.shortcuts import get_list_or_404, get_object_or_404, redirect from django.utils.translation im...