gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
##########
# Contribution by the Center on Long-Term Risk:
# https://github.com/longtermrisk/marltoolbox
##########
import random
from ray.rllib.examples.env.matrix_sequential_social_dilemma import (
IteratedPrisonersDilemma,
IteratedChicken,
IteratedStagHunt,
IteratedBoS,
)
ENVS = [IteratedPrisonersD... | |
# Copyright 2016 OVH SAS
#
# 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 ... | |
"""
then/verification steps
"""
from behave import *
import logging
import ast
import re
import time
from selenium.common.exceptions import NoSuchElementException
from mobilebdd.steps.input import switch_to
from selenium.webdriver.support.ui import WebDriverWait
log = logging.getLogger(u'mobilebdd')
# mapping of r... | |
# coding=utf-8
# Copyright 2018 The Google AI Language Team 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 ... | |
# orm/unitofwork.py
# Copyright (C) 2005, 2006, 2007, 2008 Michael Bayer [email protected]
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""The internals for the Unit Of Work system.
Includes hooks into the attributes package e... | |
"""Test inter-conversion of different polynomial classes.
This tests the convert and cast methods of all the polynomial classes.
"""
from __future__ import division, absolute_import, print_function
import operator as op
from numbers import Number
import pytest
import numpy as np
from numpy.polynomial import (
P... | |
# Copyright 2016 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | |
# -*- coding: utf-8 -*-
#
# SelfTest/PublicKey/test_importKey.py: Self-test for importing RSA keys
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication to the public domain is not available,
# everyone i... | |
from rest_framework import generics
import django_filters.rest_framework
from qmpy.web.serializers.optimade import OptimadeStructureSerializer
from qmpy.materials.formation_energy import FormationEnergy
from qmpy.materials.entry import Composition
from qmpy.models import Formation
from qmpy.utils import query_to_Q, par... | |
import operator
from copy import deepcopy
from collections import defaultdict
from itertools import chain, product
from StringIO import StringIO
from contextlib import closing
from pymaptools.io import SimplePicklableMixin
class GraphError(Exception):
"""Usually fatal"""
pass
class SkipEdge(Exception):
... | |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.7.4
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
... | |
#!/usr/bin/env python
"""
@package coverage_model.test.test_bricking_utils
@file coverage_model/test/test_bricking_utils.py
@author Christopher Mueller
@brief Tests for the bricking_utils module
"""
from nose.plugins.attrib import attr
import unittest
from coverage_model import CoverageModelUnitTestCase, CoverageMod... | |
from __future__ import absolute_import, unicode_literals
from django.core.exceptions import FieldError
from django.db.models import F
from django.test import TestCase
from django.utils import six
from .models import Company, Employee
class ExpressionsTests(TestCase):
def test_filter(self):
Company.objec... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Nebula, 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
#
# ... | |
# Copyright 2013: Mirantis 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 b... | |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
"""Support for Google Assistant Smart Home API."""
from asyncio import gather
from collections.abc import Mapping
from itertools import product
import logging
from homeassistant.util.decorator import Registry
from homeassistant.core import callback
from homeassistant.const import (
CLOUD_NEVER_EXPOSED_ENTITIES, C... | |
"""
Various searching, selecting and finding algorithms
"""
##### STDLIB
import sys
##### 3RD PARTY
##### PROJECT
import adsl.common
##### INIT AND DECLARATIONS
if sys.version_info.major >= 3:
xrange = range
##### CLASSES AND FUNCTIONS
def binsearch(array, elem, left=None, right=None, cmp_func=cmp):
""... | |
# mssql/pyodbc.py
# Copyright (C) 2005-2015 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
"""
.. dialect:: mssql+pyodbc
:name: PyODBC
:dbapi: pyodbc
:connectstrin... | |
# Released under The MIT License (MIT)
# http://opensource.org/licenses/MIT
# Copyright (c) 2013-2015 SCoT Development Team
"""
Summary
-------
Object oriented API to SCoT.
Extended Summary
----------------
The object oriented API provides a the `Workspace` class, which provides high-level functionality and serves as... | |
from random import shuffle
from random import randint
import matplotlib.pyplot as plt
class Session(object):
def __init__(self, n, capacity, course):
self.n = n
self.capacity = capacity
self.enrolled = 0
self.students = []
self.course = course
def add(self, student):
... | |
# 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... | |
"""
homeassistant.components.media_player.kodi
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Provides an interface to the XBMC/Kodi JSON-RPC API
Configuration:
To use the Kodi you will need to add something like the following to
your configuration.yaml file.
media_player:
platform: kodi
name: Kodi
url: http://192... | |
#!/usr/bin/python
import unittest
import tempfile
import os
import unittest_base
import sys
import shutil
import xenapi_mock
from config import CONFIG
from autocertkit import utils
from datetime import datetime
K = 1024
M = K * 1024
G = M * 1024
class ExpressionMatchingTests(unittest_base.DevTestCase):
"""Tests... | |
# Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
from __future__ import absolute_import
import math
import os
import random
import numpy as np
import PIL.Image
import PIL.ImagePalette
from digits.utils import image, subclass, override, constants
from digits.utils.constants import COLOR_PALETTE_ATTRIBU... | |
# Copyright (C) 2015 YouCompleteMe contributors
#
# This file is part of YouCompleteMe.
#
# YouCompleteMe 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) ... | |
################################################################################
# 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... | |
import sys
import numpy as np
import matplotlib.pyplot as plt
dimensions=[2,3,4,5,6,7,8,9,10]
print("Gaussian dimensional analysis \n")
#Decision Tree
p_1_dt = []
p_2_dt = []
p_3_dt = []
for dim in range(2,11):
temp1,temp2,temp3 = np.loadtxt("../dt_gauss/"+str(dim)+'Dgauss_dt_p_values_1_2_3_std_dev.txt')
p_1_dt.ap... | |
import os
from os import path
import cherrypy
from cherrypy.lib import auth_basic
import subprocess
import signal
import cgi
import tempfile
import json
import schedule
import time
import threading
def validate_password(realm, username, password):
with open('users.json') as users_file:
users = json.load(users_file)... | |
"""
Summary:
Contains the Conduit unit type classes.
This holds all of the data read in from the conduit units in the dat file.
Can be called to load in the data and read and update the contents
held in the object.
Author:
Duncan Runnacles
Copyright:
Duncan Runnacles 2020
TODO:
Upda... | |
"""
CUDA driver bridge implementation
NOTE:
The new driver implementation uses a "trashing service" that help prevents a
crashing the system (particularly OSX) when the CUDA context is corrupted at
resource deallocation. The old approach ties resource management directly
into the object destructor; thus, at corruptio... | |
import logging
import os
import socket
import mock
from time import sleep
from unittest import TestCase
import zmq
from zmcat import ZMCat, tool
log = logging.getLogger(__name__)
log.setLevel(logging.DEBUG)
TYPES = ("pub", "sub", "push", "pull")
class GetOutOfLoopException(Exception):
pass
class FakeArgs:
... | |
"""
The utils module handles helper routines for equilibrium calculation.
"""
import warnings
import pycalphad.variables as v
from pycalphad.core.halton import halton
from pycalphad.core.constants import MIN_SITE_FRACTION
from sympy.utilities.lambdify import lambdify
from sympy import Symbol
import numpy as np
import ... | |
# -*- coding: utf8 -*-
# ...
try:
from graphviz import Digraph as Digraph_graphviz
GRAPH=True
except ImportError:
GRAPH=False
# ...
# ...
class Node:
def __init__(self, key, attributs={}):
if key is None:
print ("key is None.")
raise()
self._ID = id(key)
# ... | |
# 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.apache.org/licenses/LICENSE-2.0
#
# Unless req... | |
from __future__ import unicode_literals
import errno
import io
import hashlib
import json
import os.path
import re
import types
import sys
import youtube_dl.extractor
from youtube_dl import YoutubeDL
from youtube_dl.compat import (
compat_os_name,
compat_str,
)
from youtube_dl.utils import (
preferredenco... | |
# 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, ... | |
from __future__ import print_function, division
from collections import MutableMapping, defaultdict
from sympy.core import (Add, Mul, Pow, Integer, Number, NumberSymbol,)
from sympy.core.numbers import ImaginaryUnit
from sympy.core.sympify import _sympify
from sympy.core.rules import Transform
from sympy.core.logic i... | |
import math
import sortedcontainers
class UnorderableElements(TypeError):
pass
class UnhashableType(TypeError):
pass
class Histogram(sortedcontainers.SortedDict):
@classmethod
def from_dict(cls, in_dict, *args, **kwargs):
self = cls(*args, **kwargs)
for key, value in in_dict.items... | |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import inspect
import math
import time
import warnings
from django import template
from django.core.cache import cache
from django.template.base import get_library, InvalidTemplateLibrary, TemplateSyntaxError, TOKEN_BLOCK
from django.template.defaulttags... | |
##########################################################################
#
# Copyright (c) 2007, Image Engine Design Inc. 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... | |
from __future__ import division
import numpy as np
na = np.newaxis
import scipy.weave
import pyhsmm
import os
eigen_path = os.path.join(os.path.dirname(__file__),'../../../deps/Eigen3')
######################################################
# used by pyhsmm.plugins.factorial.factorial class #
#####################... | |
from parameter_domain import ParameterDomain
from vector_calculus.containers import Vector, Tensor
from vector_calculus.operators import dot, cross
from sympy import Number, symbols, diff, Matrix, sqrt, Rational
from numpy import array, ndarray
from numpy.linalg import det
# Symbols in terms of which the mapping is d... | |
# coding: utf-8
from datetime import date, datetime
from typing import List, Dict, Type
from openapi_server.models.base_model_ import Model
from openapi_server.models.hudson_master_computerexecutors import HudsonMasterComputerexecutors
from openapi_server.models.hudson_master_computermonitor_data import HudsonMaster... | |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
# Copyright 2015 IBM Corp.
# 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/LIC... | |
from .ddt_container import ddt_container
from .ddt_tile import ddt_tile
from .ddt_tile_html import ddt_tile_html
class ddt_container_nSvgTable(ddt_container):
def make_nSvgTable(self,
data1,data2,
data1_keys,data1_nestkeys,data1_keymap,
data2_keys,data2_nestkeys,data2_keymap,
tilehe... | |
from duplication_handler import DuplicationHandler
from unittest import TestCase
from mock import patch
class TestUtils(TestCase):
def test_get_media(self):
subject = DuplicationHandler()
dummy_entry = {
'booktitle': 'Dragon balls',
'year': '1991'
}
casual_... | |
#!/usr/bin/python
from __future__ import print_function
import configparser
import os
import sys
import re
import MySQLdb
import argparse
import getpass
import subprocess
import logging
import uuid
def update():
## Assemble list of all bookworms on the system.
bookworms = [] ### ...
## Create on-disk ve... | |
import os
import re
import errno
import gzip
import shutil
import xml.etree.ElementTree as ET
from datetime import datetime
from .models import Video
from groups.models import Result, Row
from policies.models import Policy, Operation
from .constants import STORED_FILEPATH
def get_filename(original_name):
if origi... | |
#!/usr/bin/python
import sys
sys.path += ['lib']
import os
import time
import ConfigParser
import flask
import requests
import utils
import math
import MySQLdb
import MySQLdb.cursors
from thread import start_new_thread as daemonize
from pprint import pprint
# Attempt to read the configuration file
cfg = ConfigParser... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Metacloud
#
# 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... | |
# -*- coding: utf-8 -*-
'''WebSocket_ Protocol is implemented via the :class:`Frame` and
:class:`FrameParser` classes.
To obtain a frame parser one should use the :func:`frame_parser` function.
frame parser
~~~~~~~~~~~~~~~~~~~
.. autofunction:: frame_parser
Frame
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. autoclass:: Frame
... | |
#----------------------------------------------------------------------
# Copyright (c) 2010-2013 Raytheon BBN Technologies
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and/or hardware specification (the "Work") to
# deal in the Work without restriction, including ... | |
#
# Copyright (c) 2008-2015 Citrix Systems, 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 l... | |
#!/usr/bin/env python
"""
A command line tool for running reports on XML files.
trimxslt allows you to rapidly extract details from large XML files
on the command line.
Run "trimxslt --help" for details of the command line parameters, but
here are some pointers to get you started.
Let's say you have a simple databas... | |
#!/usr/bin/python
import json
import os
import random
import unittest
import numpy as np
from pymatgen.analysis.structure_matcher import StructureMatcher
from pymatgen.core.lattice import Lattice
from pymatgen.core.structure import Structure
from pymatgen.core.surface import (
ReconstructionGenerator,
Slab,... | |
from __future__ import division, print_function
import numpy as np
import os
from auxiliary import *
from scipy.integrate import odeint, ode
import matplotlib.pyplot as plt
from smatrix import compute_S_matrix, compute_S_matrix_fast, mean_poisson
from ttsolution import TTsolution
import sys
try:
xrange
except NameE... | |
import re
from calendar import monthrange
import datetime
class Card(object):
"""
A credit card that may be valid or invalid.
"""
# A regexp for matching non-digit values
non_digit_regexp = re.compile(r'\D')
# A mapping from common credit card brands to their number regexps
BRAND_VISA = '... | |
# Copyright (c) 2013 eBay Software 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
#
# Unl... | |
"""
Tool Name: Create Filled Contours
Source Name: CreateFilledContours.py
Version: ArcGIS 10.0
Author: ESRI
This utility creates filled polygons from an input raster.
Limitations:
- Cannot output to shapefile because of string length>254 required
in SpatialJoin
- If more than 3 contour lines cross a s... | |
# -*- 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... | |
import pytz
import datetime
from inflector import Inflector
from collections import OrderedDict
from rethinkengine.connection import get_conn
from rethinkengine.fields import BaseField, ObjectIdField, ReferenceField
from rethinkengine.query_set import QuerySetManager
from rethinkengine.errors import DoesNotExist, \
... | |
#!/usr/bin/env python
# coding:utf-8
# vi:tabstop=4:shiftwidth=4:expandtab:sts=4
import theano
import theano.tensor as T
import lasagne
import math
from .. import stacked
from ..stacked import Layers, register_layers_class
from ..stacked import register_concat_handler, register_inputs_handler
from ..stacked import re... | |
import socket
from struct import *
import sys
import time
import ipaddress
def server_greeting(received_data):
(mode,) = unpack('!I', received_data[12:16]) # get Mode field; bytes 12,13,14 and 15
return mode
def set_up_response():
mode = pack('!I', 1)
rest_of_packet = pack('!20Q', 0, 0, 0, 0, 0, 0,... | |
import sqlalchemy as sa
from sqlalchemy import Column
from sqlalchemy import event
from sqlalchemy import Integer
from sqlalchemy import Table
from sqlalchemy import util
from sqlalchemy.ext import instrumentation
from sqlalchemy.orm import attributes
from sqlalchemy.orm import class_mapper
from sqlalchemy.orm import c... | |
import collections
import re
from datetime import datetime
"""
State machine concept...
States:
BeforeBlock
LeadingComments
Summary
Postings
Line classifications:
Empty
GlobalComment
Summary
TransactionComment
Posting
"""
BLANK = 0
COMMENT = 1
SUMMARY = 2
POSTING = 3
TXNCOMMENT = 4
INVALID = 5
COMMENT_CH... | |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import sys
import inspect
import argparse
import abc
from fnmatch import fnmatch
from collections import OrderedDict
from six import add_metaclass, text_type
from .resource import Resource
from .resource import Collection, RootCollection
from .schema impo... | |
import hmac
import json
import urllib.parse
from .main import PullReqState, parse_commands, db_query, INTERRUPTED_BY_HOMU_RE, synchronize
from . import utils
from .utils import lazy_debug
import github3
import jinja2
import requests
import pkg_resources
from bottle import get, post, run, request, redirect, abort, respo... | |
import codecs
import configparser
import errno
import os
import pty
import shutil
from subprocess import (
DEVNULL,
PIPE,
CalledProcessError,
Popen,
check_call,
check_output
)
import yaml
from termcolor import colored
from bundleplacer.bundle import Bundle
from bundleplacer.charmstore_api impo... | |
# -*- coding: utf-8 -*-
# Copyright (c) 2016-2017, Thierry Lemeunier <thierry at lemeunier dot net>
# 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 reta... | |
# Copyright 2015 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 a... | |
"""
Support for MQTT lights.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/light.mqtt/
"""
import logging
import voluptuous as vol
from homeassistant.core import callback
from homeassistant.components import mqtt
from homeassistant.components.light im... | |
# coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
int_or_none,
parse_resolution,
try_get,
unified_timestamp,
url_or_none,
urljoin,
)
class PeerTubeIE(InfoExtractor):
_INSTANCES_RE = r'... | |
#!/usr/bin/env python3
#
# Copyright (c) 2019, The OpenThread Authors.
# 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
# ... | |
#!/usr/bin/env python
#
# Copyright (C) 2010 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... | |
# 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 t... | |
#!/usr/bin/env python
#
# Copyright 2014 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the 'License');
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | |
#!/usr/bin/env python
#
# Copyright 2017 the V8 project 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 random
import sys
# Adds testrunner to the path hence it has to be imported at the beggining.
import base_runner
from tes... | |
#!/usr/bin/env python
#
# Copyright 2015 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 (c) 2015, The MITRE Corporation. All rights reserved.
# See LICENSE.txt for complete terms.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated Thu Apr 11 15:07:51 2013 by generateDS.py version 2.9a.
#
import sys
from mixbox.binding_utils import *
from stix.bindings import register_extension
fr... | |
from functools import partial
from tremendous.api import (
apply_color,
apply_256,
apply_256_bg,
apply_256_hl,
)
from tremendous.bindings import lib as __lib
from tremendous.bindings import ffi
colors_16 = dict(
bold=__lib.BOLD,
italic=__lib.ITALIC,
under=__lib.UNDER,
under2=__lib.UNDE... | |
from __future__ import unicode_literals
import re
from django.template import (Node, Variable, TemplateSyntaxError,
TokenParser, Library, TOKEN_TEXT, TOKEN_VAR)
from django.template.base import _render_value_in_context
from django.template.defaulttags import token_kwargs
from django.utils import six
from django.ut... | |
"""
A base contact form for allowing users to send email messages through
a web interface, and a subclass demonstrating useful functionality.
"""
from django import forms
from django.conf import settings
from django.core.mail import send_mail
from django.template import loader, RequestContext
from django.contrib.site... | |
"""
Patient panel
"""
import tempfile
import wx
from ObjectListView import ObjectListView, ColumnDefn, OLVEvent
from images import bitmap_from_base64, toolbar_print_one_b64
from objectlistviewmod import ObjectListViewMod, EVT_OVL_CHECK_EVENT
from pdfviewer import PDFViewer
from printing import generate_prescription
fr... | |
# 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 sqlalchemy as sa
from sqlalchemy import testing, util
from sqlalchemy.orm import mapper, deferred, defer, undefer, Load, \
load_only, undefer_group, create_session, synonym, relationship, Session,\
joinedload, defaultload, aliased, contains_eager, with_polymorphic
from sqlalchemy.testing import eq_, Asse... | |
# -*- coding: utf-8 -*-
"""
Dependencies: flask, tornado
SeeAlso:
routes.turk_identification
"""
from __future__ import absolute_import, division, print_function, unicode_literals
from ibeis.control import accessor_decors, controller_inject
from ibeis.algo.hots import pipeline
from flask import url_for, request, c... | |
"""Author: Cole Howard
Email: [email protected]
network.py is a basic implementation of a one layer linear neural network, to
examine an implementation of backpropagation. It is based on the basic model
of the Perceptron. Information on that can be found at:
https://en.wikipedia.org/wiki/Perceptron
The intent ... | |
"""Calxeda: ubootenv.py """
# Copyright (c) 2012-2013, Calxeda Inc.
#
# 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 copyright
# noti... | |
"""Tests for acme.client."""
import datetime
import json
import unittest
from six.moves import http_client # pylint: disable=import-error
import mock
import requests
from acme import challenges
from acme import errors
from acme import jose
from acme import jws as acme_jws
from acme import messages
from acme import ... | |
# Copyright 2021 Google 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 required by applicable law o... | |
#!/usr/bin/env python
# __BEGIN_LICENSE__
# Copyright (c) 2009-2013, United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration. All
# rights reserved.
#
# The NGT platform is licensed under the Apache License, Version 2.0 (the
# "License"); you may not use ... | |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'BCCFBabyPage.short_title'
db.delete_column(u'bccf_bccfb... | |
"""
Provides functionality to interact with image processing services.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/image_processing/
"""
import asyncio
from datetime import timedelta
import logging
import voluptuous as vol
from homeassistant.const ... | |
"""
:mod:`pandas.io.xml` is a module for reading XML.
"""
from __future__ import annotations
import io
from pandas._typing import (
Buffer,
CompressionOptions,
FilePathOrBuffer,
StorageOptions,
)
from pandas.compat._optional import import_optional_dependency
from pandas.errors import (
AbstractMe... | |
from AppKit import NSMatrix, NSRadioButton, NSButtonCell, NSRadioModeMatrix, NSFont, NSCellDisabled
from vanilla.vanillaBase import VanillaBaseControl, _sizeStyleMap
from vanilla.vanillaButton import Button
from vanilla.vanillaStackGroup import VerticalStackGroup, HorizontalStackGroup
try:
from AppKit import NSRad... | |
#!/usr/bin/env python
from __future__ import print_function
import matplotlib
matplotlib.use('WXAgg')
import matplotlib.pyplot as plt
import pymongo
import sys
sys.path.append("/home/ggdhines/github/aggregation/engine")
from agglomerative import Agglomerative
import csv
import os
import urllib
import matplotlib.cbook a... | |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
"""
SendKeys.py - Sends one or more keystroke or keystroke combinations
to the active window.
Copyright (C) 2003 Ollie Rutherfurd <[email protected]>
Python License
Version 0.3 (2003-06-14)
$Id$
"""
import sys
import time
from _sendkeys import char2keycode, key_up, key_down, toggle_numlock
__all__ = ['KeySeq... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.