gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
##########################################################################
#
# 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 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 or agreed to in writing, ... | |
from twBase import * # NOQA
from cfg import Config
import h5py
import pandas as pd
from pandas import DataFrame
from pandas import read_csv
from pandas import datetime
from sklearn.preprocessing import MinMaxScaler
import matplotlib.pyplot as plt
from matplotlib.collections import LineCollection
# date-time parsing... | |
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | |
import json
import re
from django.db import models
from django.conf import settings
from django.urls import reverse
from django.utils.translation import gettext_lazy as _, pgettext_lazy
from django.utils import timezone
from django.utils.functional import cached_property
from django.template import Template, Context
... | |
# ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistribu... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 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.apac... | |
"""An example of training A2C against OpenAI Gym Envs.
This script is an example of training a A2C agent against OpenAI Gym envs.
Both discrete and continuous action spaces are supported.
To solve CartPole-v0, run:
python train_a2c_gym.py 8 --env CartPole-v0
"""
from __future__ import division
from __future__ imp... | |
'''
This module provides several functions for Monte-Carlo integration
'''
from __future__ import division
import numpy as np
import rbf.halton as hlt
import rbf.geometry as gm
import logging
logger = logging.getLogger(__name__)
def mcint(f,vert,smp,samples=None,lower_bounds=None,
upper_bounds=None,rng=Non... | |
import pytest
import os
import numpy as np
from threeML.plugins.XYLike import XYLike
from threeML import Model, DataList, JointLikelihood, PointSource
from threeML import BayesianAnalysis, Uniform_prior, Log_uniform_prior
from threeML.analysis_results import MLEResults, load_analysis_results, AnalysisResultsSet
from a... | |
#!/usr/bin/python
# Copyright (c) 2014, MicroStrategy, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
import s... | |
#!/usr/bin/env python
from __future__ import unicode_literals
import datetime
import mwparserfromhell
import pywikibot
import re
site = pywikibot.Site('en', 'wikipedia')
GA_SUBPAGES = ['Agriculture, food and drink', 'Art and architecture', 'Engineering and technology',
'Geography and places', 'History... | |
"""
MultiGPU model similar to the one used in model tutorials. The model keeps
one copy of the weights on each device and handles syncing the parameters
across devices.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import tensorflow... | |
"""
level.py
Class instance used for modifying level via Display window.
"""
# Load the needed packages
from functools import partial
from ..core import Variable, Component, QtGui, QtCore
class LevelButtonWindow(Component):
'''
Class to display the Window with Level radio buttons.
The level can represe... | |
#!/usr/bin/env python3
import os
import sys
import traceback
import re
import argparse
import ipaddress
import time
import threading
from subprocess import call
from colorama import init, Fore, Style
from flask import Flask, request
from werkzeug.exceptions import (BadRequest, HTTPException,
... | |
from __future__ import absolute_import, division, unicode_literals
import re
from xml.sax.saxutils import escape, unescape
from six.moves import urllib_parse as urlparse
from .tokenizer import HTMLTokenizer
from .constants import tokenTypes
content_type_rgx = re.compile(r'''
^
... | |
# -*- coding: utf-8 -*-
from __future__ import print_function
import weakref
import numpy as np
import scipy.ndimage
import pyqtgraph as pg
from acq4.Manager import getManager
from acq4.modules.TaskRunner.analysisModules.AnalysisModule import AnalysisModule
from acq4.util import Qt
Ui_Form = Qt.importTemplate('.Pho... | |
# -*-coding:utf-8 -*
# Copyright (c) 2011-2015, Intel Corporation
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, thi... | |
# -*- coding: utf-8 -*-
#
#Created on Mon Apr 10 14:20:27 2017
#
#author: Elina Thibeau-Sutre
#
import numpy as np
import h5py
from .base import BaseMixture, _check_saving
def dist_matrix(points,means):
XX = np.einsum('ij,ij->i', points, points)[:, np.newaxis] # Size (n_points,1)
squared_matrix = np.d... | |
__author__ = 'guorongxu'
import os
import subprocess
import itertools
from datetime import datetime
tumor_types = ["PRAD", "STES"]
#tumor_types = ["ACC", "BLCA", "BRCA", "CESC", "CHOL", "COAD", "COADREAD", "DLBC",
# "ESCA", "GBM", "GBMLGG", "HNSC", "KICH", "KIPAN", "KIRC", "KIRP",
# "LAML"... | |
from nsbaseresource import NSBaseResource
__author__ = 'vlazarenko'
class NSServiceGroup(NSBaseResource):
def __init__(self, json_data = None):
"""
Supplied with json_data the object can be pre-filled
"""
super(NSServiceGroup, self).__init__()
self.options = {
... | |
# Copyright (c) 2017 Civic Knowledge. This file is licensed under the terms of the
# MIT License, included in this distribution as LICENSE.txt
""" """
from itertools import islice
from .appurl.web.download import Downloader
default_downloader = Downloader.get_instance()
class RowGenerator(object):
"""Main class... | |
from __future__ import division, print_function, absolute_import
import numpy as np
from scipy._lib.six import callable, xrange
from scipy._lib._numpy_compat import suppress_warnings
from collections import namedtuple
__all__ = ['binned_statistic',
'binned_statistic_2d',
'binned_statistic_dd']
... | |
"""Test run delta feature."""
# pylint: disable=too-many-arguments
# pylint: disable=protected-access,too-many-public-methods,invalid-name
from __future__ import absolute_import
from rotest.core.runner import run
from rotest.core.models.run_data import RunData
from rotest.core.models.case_data import TestOutcome
from r... | |
# Copyright 2012 New Dream Network, LLC (DreamHost)
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | |
from symbol.builder import FasterRcnn as Detector
from symbol.builder import ResNetV1bC4 as Backbone
from symbol.builder import Neck
from symbol.builder import RpnHead
from symbol.builder import RoiAlign as RoiExtractor
from symbol.builder import BboxC5V1Head as BboxHead
from mxnext.complicate import normalizer_factory... | |
from __future__ import absolute_import, division, print_function
import os
import sys
from os.path import join, isdir, isfile, abspath, expanduser
from shutil import copytree, copy2
from conda.fetch import download
from conda.utils import hashsum_file
from conda_build import external
from conda_build.config import c... | |
import curses
import sys
import time
import logging
from .content import SubmissionContent
from .page import BasePage, Navigator, BaseController
from .helpers import open_browser, open_editor
from .curses_helpers import (Color, LoadScreen, get_arrow, get_gold, add_line,
show_notification)
... | |
"""Details about printers which are connected to CUPS."""
from datetime import timedelta
import importlib
import logging
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import CONF_HOST, CONF_PORT, PERCENTAGE
from homeassistant.exceptions import PlatformNo... | |
from cs50 import SQL
# from sql import SQL --> if not in cs50_ide
from flask import Flask, flash, redirect, render_template, request, session, url_for
from flask_session import Session
from passlib.apps import custom_app_context as pwd_context
from tempfile import mkdtemp
from sqlquery import *
from helpers import *
#... | |
import sys
import os
import difflib
import warnings
import traceback
import pkg_resources
import datetime
import re
import subprocess
import locale
import codecs
from functools import wraps
import unicodedata
import click
from cloudify._compat import StringIO, urlquote
from cloudify_rest_client.constants import Visib... | |
from __future__ import unicode_literals
import os, re
import boto3
import boto.kms
import botocore.exceptions
from boto.exception import JSONResponseError
from boto.kms.exceptions import AlreadyExistsException, NotFoundException
from moto.kms.exceptions import NotFoundException as MotoNotFoundException
import sure # ... | |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2015, Alcatel-Lucent Inc, 2017 Nokia
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyrigh... | |
from __future__ import with_statement
import sys
from unittest import TestCase
from fudge import Fake, patched_context, with_fakes
from fudge.patcher import with_patched_object
from nose.tools import eq_, raises
from fabric.state import output
from fabric.utils import warn, indent, abort, puts, fastprint, error, Rin... | |
import logging
import traceback
from django.contrib.auth.models import User
from corehq.apps.locations.models import Location
from corehq.apps.sms.mixin import PhoneNumberInUseException, VerifiedNumber
from corehq.apps.users.models import WebUser, CommCareUser, CouchUser, UserRole
from custom.api.utils import apply_upd... | |
# Python-Diskcache driver https://github.com/grantjenks/python-diskcache
# Versa is a Web semi-structured metadata toolkit
'''
Key is origin
Value is list:
[
{rel1: [
(target11, {attrname1: attrval1, attrname2: attrval2})
(target12, {attrname1: attrval1, attrname2: attrval2})
]}
{rel2: [
... | |
#!/usr/bin/python2.4
#
# Copyright 2008 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... | |
# Copyright 2019 The KerasTuner 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | |
from flask import render_template, request, redirect, abort, jsonify, url_for, session, Blueprint
from CTFd.utils import sha512, is_safe_url, authed, admins_only, is_admin, unix_time, unix_time_millis, get_config, \
set_config, sendmail, rmdir, create_image, delete_image, run_image, container_status, container_port... | |
##############################################################################
# Copyright (c) 2015 Ericsson AB and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available... | |
"""
Test functions for models.tools
"""
from statsmodels.compat.pandas import assert_frame_equal, assert_series_equal
from statsmodels.compat.python import lrange
import string
import numpy as np
from numpy.random import standard_normal
from numpy.testing import (assert_equal, assert_array_equal,
... | |
from django.test import TestCase
from ..base import media_keys, comment_keys, keys_obs
from ..utils import (
get_responses,
get_fields,
get_mediafiles,
get_info_comment,
create_observation_row
)
class UtilsTest(TestCase):
def setUp(self):
self.data = [
{
'display_fie... | |
# 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... | |
"""
Functions for reading and writing the standard JSON-based
basis set format
"""
import json
import bz2
import os
from .sort import sort_basis_dict, sort_references_dict
# The encoding to use for reading/writing files.
# For all the files in the project, UTF-8 is used
_default_encoding = 'utf-8'
def _read_plain_... | |
# 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... | |
from __future__ import unicode_literals
from django.template import Template
from django.template.loader import render_to_string
from django.utils.html import conditional_escape
from crispy_forms.compatibility import string_types, text_type
from crispy_forms.utils import render_field, flatatt, TEMPLATE_PACK, get_temp... | |
import random
import math
import threading
import time
usleep = lambda x: time.sleep(x/1000000.0)
class Neuron():
def __init__(self, network):
self.network = network
self.subscriptions = {}
self.publications = {}
self.potential = random.uniform(0.0, 1.0)
self.desired_poten... | |
# -*- 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 'Param'
db.create_table('SITE_PARAMETER', (
('dateCreate', self.gf('django.db.mod... | |
#-------------------------------------------------------------------------------
#
# Project: EOxServer <http://eoxserver.org>
# Authors: Stephan Krause <stephan.krause@eox.at>
# Stephan Meissl <stephan.meissl@eox.at>
#
#-------------------------------------------------------------------------------
# Copyrigh... | |
import os
from django.core.paginator import Paginator
from django.http import HttpResponse, JsonResponse
from django.shortcuts import get_object_or_404, redirect, render
from django.urls import reverse
from django.urls.exceptions import NoReverseMatch
from django.utils.translation import ugettext as _
from django.view... | |
#!/usr/bin/env python
# encoding: utf-8
"""
Copyright (c) 2010 The Echo Nest. All rights reserved.
Created by Tyler Williams on 2010-04-25.
Utility functions to support the Echo Nest web API interface.
"""
import urllib
import urllib2
import httplib
import config
import logging
import socket
import re
import time
imp... | |
import collections
import contextlib
import copy
import warnings
import numpy
import six
from chainer import cuda
from chainer import initializers
from chainer import variable
def _is_shape(value):
if value is None:
return True
elif isinstance(value, collections.Sequence):
try:
r... | |
from __future__ import unicode_literals
from django.test import TestCase
from mongoengine import Document, fields
from rest_framework import serializers
from rest_framework_mongoengine.serializers import DocumentSerializer
from rest_framework_mongoengine.validators import (
UniqueTogetherValidator, UniqueValidato... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import copy
import inspect
from django.db import router
from django.db.models import Model, Manager
from django.db.models.query import RawQuerySet
from django.utils import six
from mosql.query import select, join, delete
from mosql... | |
#! /usr/bin/python
# Copyright 2016, 2017, 2018, 2019, 2020 Joachim Wolff
# PhD Thesis
#
# Copyright 2015, 2016 Joachim Wolff
# Master Thesis
# Tutor: Fabrizio Costa
# Winter semester 2015/2016
#
# Chair of Bioinformatics
# Department of Computer Science
# Faculty of Engineering
# Albert-Ludwigs-University Freiburg im ... | |
#!/usr/bin/env python
# Copyright (c) 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 collections
import fnmatch
import optparse
import os
import sys
# 'KEY' : ( <TYPE>, [Accepted Values], <Required?>)
DSC_FOR... | |
import asyncio
import datetime
import http.cookies
import unittest
from unittest import mock
import pytest
from aiohttp import helpers, test_utils
def test_parse_mimetype_1():
assert helpers.parse_mimetype('') == ('', '', '', {})
def test_parse_mimetype_2():
assert helpers.parse_mimetype('*') == ('*', '*'... | |
#
# Project:
# glideinWMS
#
# File Version:
#
# Description:
# Classes needed to handle dictionary files
#
import os,os.path,string,shutil,copy
from glideinwms.lib import hashCrypto
import cStringIO
########################################
#
# File dictionary classes
#
########################################
cl... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2009-2013 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://trac.edgewall.org/wiki/TracLicense.
#... | |
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Test cases for Twisted.names' root resolver.
"""
from random import randrange
from zope.interface import implements
from zope.interface.verify import verifyClass
from twisted.python.log import msg
from twisted.trial import util
from twisted... | |
from __future__ import print_function, division
from sympy.core import sympify
from sympy.core.add import Add
from sympy.core.function import Lambda, Function, ArgumentIndexError
from sympy.core.cache import cacheit
from sympy.core.numbers import Integer
from sympy.core.power import Pow
from sympy.core.singleton impor... | |
# 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... | |
"""Unit test for TravelCalculator objects."""
from unittest.mock import patch
from xknx.devices import TravelCalculator, TravelStatus
class TestTravelCalculator:
"""Test class for TravelCalculator objects."""
# TravelCalculator(25, 50) means:
#
# 2 steps / sec UP
# 4 steps / sec DOWN
... | |
# -*- coding: utf-8 -*-
"""TimeDelayingRidge class."""
# Authors: Eric Larson <larson.eric.d@gmail.com>
# Ross Maddox <ross.maddox@rochester.edu>
#
# License: BSD (3-clause)
import numpy as np
from scipy import linalg
from .base import BaseEstimator
from ..cuda import _setup_cuda_fft_multiply_repeated
from .... | |
"""GraphLasso: sparse inverse covariance estimation with an l1-penalized
estimator.
"""
# Author: Gael Varoquaux <gael.varoquaux@normalesup.org>
# License: BSD 3 clause
# Copyright: INRIA
import warnings
import operator
import sys
import time
import numpy as np
from scipy import linalg
from .empirical_covariance_ im... | |
"""
Views for telltrail.
"""
from django.http import HttpResponse, HttpResponseRedirect
from telltrail.utils import template, catch
from telltrail.forms import *
from django.contrib import auth
from telltrail.models import CanonicalIdentity
@template('telltrail/landing.html')
def landing(request):
"""
Landing ... | |
from collections import namedtuple
from collections import defaultdict
import funcy
from intervaltree import IntervalTree
from PyQt5.QtCore import QObject
from PyQt5.QtCore import pyqtSignal
from .mutablenamedtuple import mutablenamedtuple
from .colortheme import SolarizedColorTheme
def row_start_index(index):
... | |
# -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListTy... | |
# This file is part of the pyMOR project (http://www.pymor.org).
# Copyright Holders: Rene Milk, Stephan Rave, Felix Schindler
# License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
""" This module provides a few methods and classes for visualizing data
associated to grids. We use the `PySide <h... | |
# -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | |
#!/usr/bin/python
import sys
import time
import math
import pdb
from Utils import GeomUtils
from SketchFramework import Stroke
from SketchFramework import Point
from Tkinter import *
from tkMessageBox import *
# Constants
TEMPLATE_FILE = "board_templates.dat"
TEMPLATE_SAMPLE = 64 #num points in a template
WIDTH = ... | |
# -*- coding: utf-8 -*-
# Copyright (c) Vispy Development Team. All Rights Reserved.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
import numpy as np
from numpy.testing import assert_allclose
import pytest
import vispy.visuals.transforms as tr
from vispy.geometry import Rect
from vispy.tes... | |
import json
import sys
import sentiment_analysis
import relationship
import setting
import handle_db
import couchdb
# Setting the path of the data file.
file_path = '/mnt/test/tweets.json'
server_URL = 'http://118.138.247.75:5984/'
db = handle_db.Handle_DB(server_URL)
city = ''
args = []
is_add_data = False
is_query... | |
# -*- coding: utf-8 -*-
"""pytest Team Memberships functions, fixtures and tests."""
import itertools
import pytest
import ciscosparkapi
# Helper Functions
def add_person_to_team_by_email(api, team, person, isModerator=False):
return api.team_memberships.create(team.id,
... | |
#!/usr/bin/env python
"""
runtests.py [OPTIONS] [-- ARGS]
Run tests, building the project first.
Examples::
$ python runtests.py
$ python runtests.py -s {SAMPLE_SUBMODULE}
$ python runtests.py -t {SAMPLE_TEST}
$ python runtests.py --ipython
$ python runtests.py --python somescript.py
"""
#
# Th... | |
"""Support for UV data from openuv.io."""
from __future__ import annotations
import asyncio
from typing import Any
from pyopenuv import Client
from pyopenuv.errors import OpenUvError
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
ATTR_ATTRIBUTION,
CONF_API_KEY,
CON... | |
__author__ = 'Anthony'
"""
Solve the unique lowest-cost assignment problem using the
Hungarian algorithm (also known as Munkres algorithm).
"""
# Based on original code by Brain Clapper, adapted to NumPy by Gael Varoquaux.
# Heavily refactored by Lars Buitinck.
# Copyright (c) 2008 Brian M. Clapper <bmc@clapper.org>,... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Test the functionality of NetDevice, NetDevices, and Vendor objects.
This uses the mockups of netdevices.xml, acls.db, and autoacls.py in
tests/data.
"""
__author__ = 'Jathan McCollum, Michael Shields'
__maintainer__ = 'Jathan McCollum'
__copyright__ = 'Copyright 200... | |
import re
from django.shortcuts import render_to_response
from django.http import Http404
from django.conf import settings
from django.core.urlresolvers import get_script_prefix
from graphite.account.models import Profile
from graphite.compat import HttpResponse, HttpResponseBadRequest
from graphite.logger import log... | |
import sublime, sublime_plugin
import sys, os, time
sys.path.append(os.path.join(os.path.dirname(__file__), "plugin"))
sys.path.append(os.path.join(os.path.dirname(__file__), "third-party"))
import helpers
import environment
import actions
import inputs
class WamEventListener(sublime_plugin.EventListener):
# def... | |
# -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2016, Adrian Sampson.
#
# 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 t... | |
from cardboard import types
from cardboard.ability import (
AbilityNotImplemented, spell, activated, triggered, static
)
from cardboard.cards import card, common, keywords, match
@card("Flesh-Eater Imp")
def flesheater_imp(card, abilities):
def flesheater_imp():
return AbilityNotImplemented
def ... | |
__author__ = 'sharvey'
import multiprocessing
import mysql.connector
import sys
import time
import traceback
from corpus import Corpus
class MySQLCorpus(Corpus):
cnx = None
def __init__(self, cpu_count=None):
super(MySQLCorpus, self).__init__(cpu_count)
def __del__(self):
if self.cnx i... | |
#!/usr/bin/python -OOBRStt
""""""
from pysec.core import is_int, is_str, is_dict
SPECIAL_CHARS = '\\', '*', '?', '!', '[', ']', '{', '}', '-', ',', '#', '@'
ALPHA = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
DIGITS = '0123456789'
LOWER = 'abcdefghijklmnopqrstuvwxyz'
UPPER = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
A... | |
"""Support for RSS/Atom feeds."""
from datetime import datetime, timedelta
from logging import getLogger
from os.path import exists
from threading import Lock
import pickle
import voluptuous as vol
from homeassistant.const import EVENT_HOMEASSISTANT_START, CONF_SCAN_INTERVAL
from homeassistant.helpers.event import tr... | |
# -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Pedro Algarvio (pedro@algarvio.me)`
Virtual Terminal
This code has been heavily inspired by Python's subprocess code, the `non
blocking version of it`__, some minor online snippets about TTY handling
with python including `Python's own ``pty`` sour... | |
#!/usr/bin/env python
# Copyright 2015 The Kubernetes 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 appli... | |
from __future__ import absolute_import, unicode_literals
from django.core.exceptions import ValidationError
from django.forms import Form
from django.forms.fields import IntegerField, BooleanField
from django.forms.util import ErrorList
from django.forms.widgets import Media, HiddenInput
from django.utils.encoding imp... | |
from copy import deepcopy
from pydlm.base.tools import getInterval
from pydlm.access._dlmGet import _dlmGet
class dlmAccessModule(_dlmGet):
""" A dlm module for all the access methods
"""
def getAll(self):
""" get all the _result class which contains all results
Returns:
The... | |
#STANDARD LIB
from datetime import datetime
from decimal import Decimal
from itertools import chain
import warnings
#LIBRARIES
import django
from django.conf import settings
from django.db import models
from django.db.backends.util import format_number
from django.db import IntegrityError
from django.utils import tim... | |
# : by PART_NO/CORE
# : by DEV_ID
# : by flash_size and or device type
DEVICES = [
{
'part_no': 0xc20,
'core': 'CortexM0',
'idcode_reg': 0x40015800,
'devices': [
{
'dev_id': 0x440,
'flash_size_reg': 0x1ffff7cc,
... | |
#!/usr/bin/env python3
# Copyright 2020 The gRPC Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""An extensible ASCII table reader and writer.
ui.py:
Provides the main user functions for reading and writing tables.
:Copyright: Smithsonian Astrophysical Observatory (2010)
:Author: Tom Aldcroft (aldcroft@head.cfa.harvard.edu)
"""
import re
impor... | |
"""File system utilities such as making dirs/files and mounts etc.
"""
import errno
import glob
import io
import logging
import os
import stat
import tarfile
import tempfile
from treadmill import exc
from treadmill import osnoop
from treadmill import utils
from treadmill import subproc
_LOGGER = logging.getLogger(__... | |
# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
#
# 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, modi... | |
# Copyright (c) 2006-2008 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.
"""Shared process-related utility functions."""
import errno
import os
import subprocess
import sys
class CommandNotFound(Exception): pass
TASKKI... | |
# Copyright 2012 NEC Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | |
from unittest import TestCase
from mock import Mock, patch, create_autospec, MagicMock
from pyqryptonight.pyqryptonight import StringToUInt256
from qrl.core.AddressState import AddressState
from qrl.core.Block import Block
from qrl.core.misc import logger
from qrl.core.ChainManager import ChainManager
from qrl.core.M... | |
# Test methods with long descriptive names can omit docstrings
# pylint: disable=missing-docstring
import unittest
from functools import reduce
import numpy as np
import scipy.sparse as sp
from Orange import preprocess
from Orange.preprocess import impute
from Orange import data
from Orange.data import Unknown, Table... | |
from assembla.error import AssemblaError
from assembla.models import Ticket
import logging
import re
from copy import deepcopy
logger = logging.getLogger('ATMT')
def prettify(changes):
if isinstance(changes,str) or isinstance(changes,unicode):
changes = changes.replace('---','*Emulated Ticket Change*', 1)... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.