gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
import logging
from typing import Any
from decimal import Decimal
import flask
from flask import Blueprint, Response, render_template, request,\
url_for, redirect
from flask_babel import gettext, lazy_gettext
from flask_login import login_required, current_user
from waitlist.base import db
from waitlist.permissions... | |
# Copyright 2017 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 ... | |
from __future__ import print_function
import errno
import json
import os
import platform
import re
import shlex
import signal
import signal
import subprocess
import sys
import tempfile
import textwrap
import time
import traceback
from pynailgun import NailgunConnection, NailgunException
from timing import monotonic_ti... | |
# 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 a... | |
import sys, os, glob
import re
import subprocess
import numpy as np
from astropy.table import Table, vstack
from desiutil.log import get_logger
import desispec.io
from desispec.workflow.exptable import get_exposure_table_pathname
from desispec.workflow import batch
from desispec.util import parse_int_args
def parse... | |
from pyCovertAudio_lib import *
from BaseDemodulator import BaseDemodulator
from Debug import Debug
from SignalFunctions import SignalFunctions
import time
import math
class FHSSDemodulator(BaseDemodulator):
def __init__(
self, bitsPerSymbol, sampleRate, samplesPerSymbol,
symbolExpansion... | |
""" Various kinds of lyaout widgets.
"""
from __future__ import absolute_import
from functools import wraps
from six import string_types
import logging
import copy
from ...properties import abstract
from ...properties import Int, Instance, List, String, Dict, Either
from ...util.functions import cached_property, arg_... | |
#! /usr/bin/python
# Test case to test multi-port functionality
# The configuration file for this test case specifies 2 different cores, each with a different
# data source. Three search terms are tested, each expected to be returned by one and only one
# of the cores. The usual syntax of the queriesAndResults.txt f... | |
# A module to expose various thread/process/job related structures and
# methods from kernel32
#
# The MIT License
#
# Copyright (c) 2003-2004 by Peter Astrand <astrand@lysator.liu.se>
#
# Additions and modifications written by Benjamin Smedberg
# <benjamin@smedbergs.us> are Copyright (c) 2006 by the Mozilla Foundation... | |
from gym.spaces import Box
from functools import partial
import logging
import numpy as np
import gym
from typing import Dict, Tuple, List
import ray
import ray.experimental.tf_utils
from ray.rllib.agents.ddpg.ddpg_tf_model import DDPGTFModel
from ray.rllib.agents.ddpg.ddpg_torch_model import DDPGTorchModel
from ray.r... | |
import pyjd
from pyjamas import log
import browser
import gdk
#import lxml.etree
# WINDOW TYPES
WINDOW_TOPLEVEL = 1
# GTK OPTIONS (flags)
EXPAND = 1
FILL = 2
# GTK WIDGET FLAGS
TOPLEVEL = 1
NO_WINDOW = 2
REALIZED = 4
MAPPED = 8
VISIBLE = 16
SENSITIVE = 32
PARENT_SENSITIVE = 64
CAN_FOCUS = 128
HAS_FOCUS = 256
CAN_D... | |
"""
Compliance Checker suite runner
"""
import codecs
import inspect
import itertools
import os
import re
import subprocess
import sys
import textwrap
import warnings
from collections import defaultdict
from datetime import datetime, timezone
from distutils.version import StrictVersion
from operator import itemgetter... | |
"""
**Parameters:**
| markdown_directory (*string*) -- Generally used for development purposes only.
| project_directory (*string) -- Path to your project directory
| css_directory (*string*) -- Path to your projects CSS directory
| docs_directory (*string*) -- Path to Sphinx docs.
| file_types = (*tuple of string... | |
# 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, Google 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
# notice, this list of conditions and the f... | |
#
# 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 2013 Canonical Ltd.
# 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... | |
"""Utilities for writing code that runs on Python 2 and 3"""
# Copyright (c) 2010-2012 Benjamin Peterson
#
# 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 with... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Proxy models for augmenting our source data tables with methods useful for processing.
"""
import datetime
from django.db import transaction
from django.db.models import Count
from .proxies import OCDCandidacyProxy, OCDPersonProxy
def merge_persons(persons):
"""
... | |
"""String-based code generation utilities."""
import re
import cypy
## Code generator
class CG(object):
"""Provides a simple, flexible code generator."""
@cypy.autoinit
def __init__(self, processor=None,
code_builder=cypy.new[list],
convert=str,
... | |
# Copyright 2011 OpenStack Foundation.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance w... | |
# 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 ... | |
"""
Code to manage the creation and SQL rendering of 'where' constraints.
"""
import datetime
from django.utils import tree
from django.db import connection
from django.db.models.fields import Field
from django.db.models.query_utils import QueryWrapper
from datastructures import EmptyResultSet, FullResultSet
# Connec... | |
#############################################################################
#
# Voronoi diagram calculator/ Delaunay triangulator
# Translated to Python by Bill Simons
# September, 2005
#
# Additional changes by Carson Farmer added November 2010
#
# Calculate Delaunay triangulation or the Voronoi polygons for a set o... | |
#!/usr/bin/python
#
# Copyright (c) 2011 The Ferretcoin developers
# Distributed under the MIT/X11 software license, see the accompanying
# file license.txt or http://www.opensource.org/licenses/mit-license.php.
#
import time
import json
import pprint
import hashlib
import struct
import re
import base64
import httplib... | |
# -*- 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):
# Adding field 'TagKey.status'
db.add_column(
'sentry_filterke... | |
#!/usr/bin/env python
import os, uuid, urllib, re, sys, datetime, webbrowser
import tornado.httpserver
import tornado.ioloop
import tornado.options
import tornado.web
import tornado.websocket
from pymongo import MongoClient
from bson.objectid import ObjectId
mongo_client = None
class NCBI:
def __init__(self):
... | |
# Copyright 2013 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | |
#!/usr/bin/python
# (c) 2016, NetApp, Inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | |
from __future__ import division
import math
import operator
import os
import numpy
import pyglet
from pyglet.gl import *
import yaml
from edge import *
from const import *
from model import *
from state import *
class Util(object):
'''Utility class with various helpful functions.'''
@staticmethod
def sh... | |
import base64
import binascii
import struct
from enum import Enum
from xdrlib import Packer, Unpacker
from . import xdr as stellar_xdr
from .exceptions import (
Ed25519PublicKeyInvalidError,
Ed25519SecretSeedInvalidError,
MuxedEd25519AccountInvalidError,
TypeError,
ValueError,
)
from .type_checked ... | |
import dis
import unittest
from test.support.bytecode_helper import BytecodeTestCase
def count_instr_recursively(f, opname):
count = 0
for instr in dis.get_instructions(f):
if instr.opname == opname:
count += 1
if hasattr(f, '__code__'):
f = f.__code__
for c in f.co_consts... | |
# -*- coding: utf-8 -*-
###
# Copyright (c) 2013, spline
# All rights reserved.
#
#
###
# my libs
from base64 import b64decode
import cPickle as pickle
from BeautifulSoup import BeautifulSoup
import sqlite3
import os.path
import datetime # utc time.
from itertools import chain
# extra supybot libs
import supybot.conf ... | |
import sys
from django.conf import settings
from django.core.signals import got_request_exception
from django.http import HttpResponse
from django.template.response import TemplateResponse
from django.template import Template
from django.test import TestCase
class TestException(Exception):
pass
# A middleware ba... | |
__all__ = ['atleast_1d', 'atleast_2d', 'atleast_3d', 'block', 'hstack',
'stack', 'vstack']
import functools
import itertools
import operator
import warnings
from . import numeric as _nx
from . import overrides
from .multiarray import array, asanyarray, normalize_axis_index
from . import fromnumeric as _fro... | |
# Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | |
#!/usr/bin/env python
# Copyright (c) Microsoft Corporation.
# All rights reserved.
#
# This code is licensed under the MIT License.
#
# 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 ... | |
# AUTHOR: Kale Miller
# DESCRIPTION: The 'main brain' of the program is held in here.
# 50726f6772616d6d696e6720697320627265616b696e67206f66206f6e652062696720696d706f737369626c65207461736b20696e746f20736576
# 6572616c207665727920736d616c6c20706f737369626c65207461736b732e
# DEVELOPMENT LOG:
# 07/12/16: Initialized ... | |
# -*- coding: utf-8 -*-
"""Tests for pomodoro service."""
import os
import sys
import time
import unittest
import pytest
from unittest.mock import Mock
from pomito import main, pomodoro, task
from pomito.plugins.ui import UIPlugin
from pomito.plugins.task import TaskPlugin
from pomito.test import PomitoTestFactory
... | |
"""Defines parsing functions used by isort for parsing import definitions"""
from collections import OrderedDict, defaultdict
from functools import partial
from itertools import chain
from typing import TYPE_CHECKING, Any, Dict, List, NamedTuple, Optional, Tuple
from warnings import warn
from . import place
from .comm... | |
import inspect
import re
from django.apps import apps as django_apps
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured, PermissionDenied
from django.middleware.csrf import rotate_token
from django.utils.crypto import constant_time_compare
from django.utils.module_loading import i... | |
#!/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... | |
from __future__ import unicode_literals
import pickle
import time
from datetime import datetime
from django.conf import settings
from django.template import Context, engines
from django.template.response import (
ContentNotRenderedError, SimpleTemplateResponse, TemplateResponse,
)
from django.test import (
Re... | |
"""Mean shift clustering algorithm.
Mean shift clustering aims to discover *blobs* in a smooth density of
samples. It is a centroid based algorithm, which works by updating candidates
for centroids to be the mean of the points within a given region. These
candidates are then filtered in a post-processing stage to elim... | |
# maxdb/base.py
# Copyright (C) 2005-2012 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
"""Support for the MaxDB database.
.. note::
The MaxDB dialect is **non-functional... | |
# Copyright 2016 Mario Graff Guerrero
# 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 wri... | |
# Copyright (c) 2014 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | |
"""
This module defines the mpf, mpc classes, and standard functions for
operating with them.
"""
__docformat__ = 'plaintext'
import re
from .ctx_base import StandardBaseContext
from .libmp.backend import basestring, BACKEND
from . import libmp
from .libmp import (MPZ, MPZ_ZERO, MPZ_ONE, int_types, repr_dps,
r... | |
# 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 (t... | |
# Copyright 2017 Battelle Energy Alliance, 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 t... | |
from collections import defaultdict
from json import JSONEncoder
import hashlib
class Node(object):
APPENDIX = u'appendix'
INTERP = u'interp'
REGTEXT = u'regtext'
SUBPART = u'subpart'
EMPTYPART = u'emptypart'
INTERP_MARK = 'Interp'
def __init__(self, text='', children=[], label=[], title... | |
# Load protobufs
from POGOProtos.Networking.Requests import(
Request_pb2 as Request,
RequestType_pb2 as RequestType
)
from POGOProtos.Networking.Requests.Messages import(
EncounterMessage_pb2 as EncounterMessage,
FortSearchMessage_pb2 as FortSearchMessage,
FortDetailsMessage_pb2 as FortDetailsMessag... | |
# Copyright (c) 2007 by Mark Bergsma <mark@nedworks.org>
#
# 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... | |
"""
Cache middleware. If enabled, each Django-powered page will be cached based on
URL. The canonical way to enable cache middleware is to set
``UpdateCacheMiddleware`` as your first piece of middleware, and
``FetchFromCacheMiddleware`` as the last::
MIDDLEWARE_CLASSES = [
'django.middleware.cache.UpdateCa... | |
# Natural Language Toolkit: Expectation Maximization Clusterer
#
# Copyright (C) 2001-2013 NLTK Project
# Author: Trevor Cohn <tacohn@cs.mu.oz.au>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
from __future__ import print_function, unicode_literals
try:
import numpy
except ImportError:
pa... | |
"""
Dummy client runner
This module implements a stand-alone launcher for stress-testing
an Evennia game. It will launch any number of fake clients. These
clients will log into the server and start doing random operations.
Customizing and weighing these operations differently depends on
which type of game is tested. T... | |
# -*- coding: utf-8 -*-
'''
Created on Jan 04, 2013
@author: Mourad Mourafiq
About: This is an attempt to solve the Quora challenge Typehead.
'''
import re
import copy
import datetime
COMMANDS = "(ADD)|(DEL)|(W?QUERY)"
ANY_STRING = "(\\S*.*)"
SEPARATORS = "(?: |\\t)"
IDS = "\\w+"
TYPES = "user|topic|que... | |
import copy
import sys
from rodney import sprites
import rodney.ai as ai
def make_framebuffer(width, height):
"""
A framebuffer is just a big 2D list (coordinates are [y][x])
:param width: Width of the framebuffer
:param height: Height of the framebuffer
:return: Empty framebufer
"""
# Sin... | |
"""
Bbox Target Operator
select foreground and background proposal and encode them as training target.
"""
import mxnet as mx
import numpy as np
import numpy.random as npr
from ast import literal_eval
from operator_py.detectron_bbox_utils import bbox_overlaps, bbox_transform_inv
def _sample_proposal(proposals, gt_bbo... | |
from neurons import spiking
__author__ = 'johannes'
import pytest
import numpy as np
class TestVarious:
def test_neuron_no_spike(self):
# Neuron should not spike
timesteps = 20
# Two neurons
spiking_model = spiking.SRM(neurons=2, threshold=1.0, t_current=0.3,
... | |
# 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 required by applicable ... | |
# coding=utf-8
"""
Copyright 2012 Ali Ok (aliokATapacheDOTorg)
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 ... | |
"""
Definition of the Session class.
"""
import re
import sys
import time
import json
import base64
import random
import hashlib
import asyncio
import weakref
import datetime
from http.cookies import SimpleCookie
from ..event._component import new_type
from ._component2 import PyComponent, JsComponent, AppComponentM... | |
##########################################################################
#
# Copyright (c) 2011-2012, John Haddon. All rights reserved.
# Copyright (c) 2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided ... | |
"""Loader for the Labeled Faces in the Wild (LFW) dataset
This dataset is a collection of JPEG pictures of famous people collected
over the internet, all details are available on the official website:
http://vis-www.cs.umass.edu/lfw/
Each picture is centered on a single face. The typical task is called
Face Veri... | |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
class Migration(migrations.Migration):
dependencies = [
('app', '0016_auto_20151019_1506'),
]
operations = [
migrations.AddField(
model_name='events',
... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 1.0.2.7202 (http://hl7.org/fhir/StructureDefinition/TestScript) on 2016-06-23.
# 2016, SMART Health IT.
from . import domainresource
class TestScript(domainresource.DomainResource):
""" Describes a set of tests.
TestScript is a reso... | |
# 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 ... | |
"""
Command line interface logic.
The application classes in this module are installed as executables via
setuptools entry points.
"""
# import udiskie.depend first - for side effects!
from .depend import has_Notify, has_Gtk, _in_X
import inspect
import logging.config
import traceback
import asyncio
import gbulb
f... | |
"""
Name Server and helper functions.
Pyro - Python Remote Objects. Copyright by Irmen de Jong (irmen@razorvine.net).
"""
from __future__ import with_statement
import warnings
import re
import logging
import socket
import sys
from Pyro4.threadutil import RLock, Thread
from Pyro4.errors import NamingError, PyroError,... | |
import re
import os
import hcp
import mne
import numpy as np
from glob import glob
from copy import deepcopy
from joblib import Memory
from hcp.io.file_mapping.file_mapping import kind_map
from ..utils import check_random_state
HCP_DIR = "/storage/store/data/HCP900/"
CONVERSION_MAP = {v: k for k, v in kind_map.items... | |
# Copyright (c) 2016,2017 MetPy Developers.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
"""Tests for the `station_plot` module."""
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import pytest
from metpy.plots import (curr... | |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
import codecs
import copy
import hashlib
import json
import os
import requests
import numpy as numpy
import pandas as pd
from datetime import date
from slugify import slugify
from time import sleep
class OpenContextAPI():
''' Interacts with the Open Context API
to get lists of records for analysis
... | |
#!/usr/bin/env python
# Copyright (c) 2012 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.
"""Unit tests for rietveld.py."""
import logging
import os
import sys
import unittest
sys.path.insert(0, os.path.dirname(os.path.... | |
# (c) Copyright 2014 Hewlett-Packard Development Company, L.P.
# 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... | |
#!/usr/bin/python
# Copyright (c) 2011 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.
"""Prints the size of each given file and optionally computes the size of
libchrome.so without the dependencies added for building w... | |
from datetime import datetime, timedelta
from logging import getLogger
from collections import defaultdict
from sqlalchemy.orm import contains_eager, joinedload
from sqlalchemy.sql import func
from flask import Blueprint
from flask.templating import render_template
from flask.globals import g, request
from overc impo... | |
#------------------------------------------------------------------------------
# Copyright (C) 2007 Richard W. Lincoln
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 dated June, 19... | |
"""
The MIT License (MIT)
Copyright (c) 2015-present Rapptz
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, merg... | |
# -*- 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):
# Adding field 'Vote.vote_type'
db.add_column(u'laws_vote', 'vote_type',
... | |
'''
'''
import struct
# this gets populated via the class decorators on the DataType subclasses
DATA_TYPE_REGISTRY = {}
def data_type(name):
'''Decorator that:
a) populates the DATA_TYPE_REGISTRY
b) modifies the decorated class to include a DATA_TYPE_NAME field
'''
def dummy(cls):
... | |
"""The tests for the Group components."""
# pylint: disable=protected-access,too-many-public-methods
import unittest
from homeassistant.bootstrap import _setup_component
from homeassistant.const import (
STATE_ON, STATE_OFF, STATE_HOME, STATE_UNKNOWN, ATTR_ICON, ATTR_HIDDEN,
ATTR_ASSUMED_STATE, )
import homeas... | |
import os, sys
from traits.api \
import HasTraits, Str, Float, Int, List, Bool, Enum, Instance, Button,Float
from traitsui.api \
import TreeEditor, TreeNode, View, Item, VSplit, \
HGroup, VGroup, Handler, Group, Tabbed,spring
from traitsui.menu \
import Menu, Action, Separator
from traitsui.wx.tree_editor \
i... | |
#!/usr/bin/env python
"""Distutils based setup script for SymPy.
This uses Distutils (http://python.org/sigs/distutils-sig/) the standard
python mechanism for installing packages. For the easiest installation
just type the command (you'll probably need root privileges for that):
python setup.py install
This will... | |
from sys import version_info
import gdb
if version_info[0] >= 3:
xrange = range
ZERO_FIELD = "__0"
FIRST_FIELD = "__1"
def unwrap_unique_or_non_null(unique_or_nonnull):
# BACKCOMPAT: rust 1.32
# https://github.com/rust-lang/rust/commit/7a0911528058e87d22ea305695f4047572c5e067
ptr = unique_or_nonnul... | |
# file eulxml/xpath/ast.py
#
# Copyright 2010,2011 Emory University Libraries
#
# 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
#
# ... | |
#!/usr/bin/env python
#
# Gaze tracking calibration
# - use calibration video heatmap and priors
#
# AUTHOR : Mike Tyszka
# PLACE : Caltech
# DATES : 2014-05-15 JMT From scratch
#
# This file is part of mrgaze.
#
# mrgaze is free software: you can redistribute it and/or modify
# it under the terms of the GNU Ge... | |
"""IPython extension to reload modules before executing user code.
``autoreload`` reloads modules automatically before entering the execution of
code typed at the IPython prompt.
This makes for example the following workflow possible:
.. sourcecode:: ipython
In [1]: %load_ext autoreload
In [2]: %autoreload 2... | |
from PyQt4 import QtGui, QtCore
import time
class StoryTelling(QtGui.QWidget):
storytelling_event = QtCore.pyqtSignal(list)
def __init__(self):
super(StoryTelling, self).__init__()
self.isRealTime = True
##GUI
self.layoutMain = QtGui.QHBoxLayout()
sel... | |
# -*- coding: utf-8 -*-
# Copyright 2015 OpenMarket Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | |
#!/usr/bin/env python
# Copyright 2014-2020 The PySCF Developers. 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
#
# U... | |
import six
from abc import ABCMeta
from pyticketswitch.exceptions import InvalidParametersError
@six.add_metaclass(ABCMeta)
class PaymentMethod(object):
"""Abstract base class for payment methods"""
def as_api_parameters(self):
"""Generate keyword arguments suitable for consumption by the
tic... | |
from unittest.mock import call
from unittest.mock import Mock
from sqlalchemy import exc
from sqlalchemy.orm import collections
from sqlalchemy.orm import relationship
from sqlalchemy.orm import validates
from sqlalchemy.testing import assert_raises
from sqlalchemy.testing import assert_raises_message
from sqlalchemy.... | |
"""
Randomized tests for invariant properties of some clustering metrics
"""
import numpy as np
import warnings
from lsh_hdc.metrics import ClusteringMetrics, ConfusionMatrix2, \
hmean, _div, adjusted_rand_score, mutual_info_score, \
adjusted_mutual_info_score, gmean
from numpy.testing import assert_array_alm... | |
#!/usr/bin/env python
# -*-coding:utf-8-*-
# @Time : 2015/9/1 ~ 2019/11/6
# @Author : Allen Woo
# coding: utf-8
import random
from PIL import Image
from PIL import ImageFilter
from PIL.ImageDraw import Draw
from PIL.ImageFont import truetype
from apps.configs.sys_config import FONT_PATH
try:
from cStringIO import... | |
#!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | |
import sys
import platform
import llvmlite.binding as ll
import llvmlite.llvmpy.core as lc
from llvmlite import ir
from numba import _dynfunc
from numba.core.callwrapper import PyCallWrapper
from numba.core.base import BaseContext, PYOBJECT
from numba.core import utils, types, config, cgutils, callconv, codegen, exte... | |
#!/usr/bin/env python
#
# Copyright (c) 2001 - 2016 The SCons Foundation
#
# 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 us... | |
from __future__ import absolute_import, division, print_function
import itertools
from numbers import Number
import numpy as np
import scipy as sp
from odin.visual.plot_utils import tile_raster_images, to_axis
def plot_heatmap(data,
cmap="Blues",
ax=None,
xticklabe... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.