gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
#
# 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 ... | |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | |
# Copyright 2011 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | |
import logging
logger = logging.getLogger(__name__)
ch = logging.StreamHandler()
ch.setLevel(logging.INFO)
logger.addHandler(ch)
logger.setLevel(logging.INFO)
try:
from pygame.transform import flip, rotate
import pygame
except ImportError:
logger.error('cannot import pygame (is it installed?)')
raise
... | |
#!/usr/bin/python
#
# Combine all source and header files in source directory into
# a single C file.
#
# The process is not very simple or clean. This helper is not
# a generic or 100% correct in the general case: it just needs
# to work for Duktape.
#
# Overview of the process:
#
# * Parse all relevant C an... | |
"""Base test case support for tools.
Version Added:
3.0
"""
from __future__ import unicode_literals
import os
import tempfile
from copy import deepcopy
from functools import wraps
from unittest import SkipTest
import kgb
import six
from reviewbot.config import config
from reviewbot.repositories import GitRepos... | |
''' COSMO-VIEW,
Quim Ballabrera, May 2017
Script for visualizing model outputs provided by various operational
systems
EGL, 06/2020:
A heap variable MESSAGE has been introduce to store "print" messages
'''
import tkinter as tk
from tkinter import ttk
from tkinter import messagebox
import datetime... | |
# coding: utf-8
from __future__ import division, unicode_literals
"""
Wrapper classes for Cif input and output from Structures.
"""
__author__ = "Shyue Ping Ong, Will Richards"
__copyright__ = "Copyright 2011, The Materials Project"
__version__ = "3.0"
__maintainer__ = "Shyue Ping Ong"
__email__ = "shyuep@gmail.com... | |
# Copyright (c) 2010-2015 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | |
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 9 17:09:09 2016
@author: Tobias Jachowski
"""
import hashlib
import inspect
import numpy as np
from .. import config as cf
from .. import traces as tc
from .region import Region
class Record(Region):
"""
A Record consists of:
- a filename, containing t... | |
# Copyright (c) 2012 NetApp, 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... | |
"""This module includes tests of the code object representation.
>>> def f(x):
... def g(y):
... return x + y
... return g
...
>>> dump(f.__code__)
name: f
argcount: 1
kwonlyargcount: 0
names: ()
varnames: ('x', 'g')
cellvars: ('x',)
freevars: ()
nlocals: 2
flags: 3
consts: ('None', '<code object g>',... | |
import os
import sys
import time
import re
import pprint
import random
import types
import unittest
import imp
import jsonpickle
class DevNull(object):
def __init__(self, *writers):
self.writers = writers
def write(self, text):
return
def f_noarg(self):
return
def f_varg(self, *args, **kwargs... | |
#!/usr/bin/env python3
from reporter.connections import RedcapInstance
from reporter.emailing import (
RECIPIENT_PREDICT_ADMIN as RECIPIENT_ADMIN,
RECIPIENT_PREDICT_MANAGER as RECIPIENT_MANAGER,
RECIPIENT_IT_DQ,
)
from reporter.application_abstract_reports.redcap.data_quality import (
RedcapInvalidStud... | |
# coding: utf-8
"""
Stakeholder engagement API
This API enables Intelligent Engagement for your Business. iEngage is a platform that combines process, augmented intelligence and rewards to help you intelligently engage customers.
OpenAPI spec version: 1.0
Generated by: https://github.com/swagger... | |
# Meme: a fast mind-mapping tool
# (c) 2010 Jamie Webb - MIT license
import math, sys, pygtk, gtk, cairo, time
pygtk.require('2.0')
from meme.layout import Layout
from meme.model import *
from meme.renderer import Renderer
from meme.style import GlobalStyle
from meme import io
class MemeGui(Observer):
def __init__(... | |
#
# This file is part of pysnmp software.
#
# Copyright (c) 2005-2016, Ilya Etingof <ilya@glas.net>
# License: http://pysnmp.sf.net/license.html
#
import time, sys
from pysnmp.proto.secmod.base import AbstractSecurityModel
from pysnmp.proto.secmod.rfc3414.auth import hmacmd5, hmacsha, noauth
from pysnmp.proto.secmod.rf... | |
# -*- coding: utf-8 -*-
#!/usr/bin/env python
#
# Copyright 2012-2015 BigML
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
"Write your forwards methods here."
# Note: Don't use "from appname.models imp... | |
import datetime
import uuid
import mock
from django.utils import timezone
from django.core import mail
from rest_framework import status
from rest_framework.test import APITestCase
from cla_common.constants import CASE_SOURCE
from cla_eventlog.models import Log
from checker.serializers import CaseSerializer
from core... | |
import mock
import pytest
from cmdtree import shortcuts
@pytest.fixture()
def do_nothing():
def func(*args, **kwargs):
return "do_nothing"
return func
@pytest.fixture()
def mocked_parser():
return mock.Mock()
@pytest.fixture()
def parser_proxy():
return shortcuts.ParserProxy()
@pytest... | |
# pylint: disable=missing-module-docstring
# pylint: disable=missing-class-docstring
# pylint: disable=missing-function-docstring
import os.path
import logging
import datetime
from six import ensure_binary, ensure_str
from six.moves.urllib.parse import urlencode
from tornado.testing import AsyncHTTPTestCase
from tornad... | |
from sqlalchemy.test.testing import eq_, assert_raises, assert_raises_message
from sqlalchemy import *
from sqlalchemy.orm import attributes
from sqlalchemy import exc as sa_exc
from sqlalchemy.orm import exc as orm_exc
from sqlalchemy.orm import *
from sqlalchemy.test.util import gc_collect
from sqlalchemy.test impor... | |
from __future__ import unicode_literals
from functools import partial, wraps
from collections import namedtuple
from .predicate import match_instance
from .compat import string_types
from .predicate import PredicateRegistry
from .arginfo import arginfo
from .error import RegistrationError
class dispatch(object):
... | |
# -*- coding: utf-8 -*-
# This file is part of QuTiP: Quantum Toolbox in Python.
#
# Copyright (c) 2014 and later, Alexander J G Pitchford
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# ... | |
from random import randrange
class Male:
def __init__(self):
self.pronoun = "M'Lord"
self.address = "Sir"
self.highaddress = "King"
self.refer = "He"
class Female:
def __init__(self):
self.pronoun = "M'Lady"
self.address = "Mam"
self.highaddress = "Queen... | |
"""HDL Primitives."""
import pytest
import ast
from hdltools.abshdl.vector import HDLVectorDescriptor
from hdltools.abshdl.module import HDLModule, HDLModuleParameter
from hdltools.abshdl.port import HDLModulePort
from hdltools.abshdl.expr import HDLExpression
from hdltools.abshdl.signal import HDLSignal, HDLSignalSli... | |
# coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | |
#!/usr/bin/env python
from marmoset import Marmoset
from getpass import getpass
import os
import glob
import sys
import threading
import fileinput
# monkey-patch SSL because verification fails on 2.7.9
if sys.hexversion == 34015728:
import ssl
if hasattr(ssl, '_create_unverified_context'):
# noinspec... | |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
import os
class Migration(SchemaMigration):
def forwards(self, orm):
# TODO: Load sample json
# os.system("shp2pgsql -s 26986 -g geometry data/parcels/Parcels_L3E.shp ... | |
#------------------------------------------------------------------------------
# Copyright (c) 2005, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions describe... | |
# test_remote.py
# Copyright (C) 2008, 2009 Michael Trier (mtrier@gmail.com) and contributors
#
# This module is part of GitPython and is released under
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
import random
import tempfile
try:
from unittest import skipIf
except ImportError:
from ... | |
import base64
from collections import defaultdict
import datetime
import hashlib
import json
import Levenshtein
import logging
import math
import os
import pytz
import requests
import traceback
import xml.etree.ElementTree as ET
import urllib
from dateutil.relativedelta import relativedelta
from django.conf import se... | |
#=========================================================================
# mesh_net_RTL_v1.py
#=========================================================================
from pymtl import *
from pclib.ifcs import InValRdyBundle, OutValRdyBundle, NetMsg
from pclib.rtl import Crossbar, RoundRobinArbiterEn, Normal... | |
from common import * # NOQA
from cattle import ClientApiError
SP_CREATE = "storagepool.create"
VOLUME_CREATE = "volume.create"
def more_hosts(context):
host2 = register_simulated_host(context)
host3 = register_simulated_host(context)
return context.host, host2, host3
def from_context(context):
ret... | |
import os
import simplejson
from datetime import datetime, timedelta
from uuid import uuid4
from django.conf import settings
import boto
from celery.decorators import task
from celery.task import PeriodicTask
from pdf.models import Document
BOOTSTRAP_SCRIPT = """#!/bin/bash
apt-get update
apt-get install -y imag... | |
# 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 with the License. You may obtain
# a ... | |
from model.contact import Contact
import re
import time
class ContactHelper:
def __init__(self, app):
self.app = app
def create(self, contact):
wd = self.app.wd
# init contact creation
wd.find_element_by_link_text("add new").click()
self.fill_contact_form(contact)
... | |
"""Config flow for Network UPS Tools (NUT) integration."""
import logging
import voluptuous as vol
from homeassistant import config_entries, core, exceptions
from homeassistant.const import (
CONF_ALIAS,
CONF_HOST,
CONF_PASSWORD,
CONF_PORT,
CONF_RESOURCES,
CONF_SCAN_INTERVAL,
CONF_USERNAME... | |
# 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 with the License. You may obtain
# a ... | |
"""
Test for the SmartThings climate platform.
The only mocking required is of the underlying SmartThings API object so
real HTTP calls are not initiated during testing.
"""
from pysmartthings import Attribute, Capability
from pysmartthings.device import Status
import pytest
from homeassistant.components.climate.cons... | |
from django.conf import settings
from django.utils.translation import gettext
from rest_framework import serializers
import olympia.core.logger
from olympia import amo
from olympia.access import acl
from olympia.access.models import Group
from olympia.amo.templatetags.jinja_helpers import absolutify
from olympia.amo... | |
#!/usr/bin/env python
# Plugin Update Service Code
#------------------------------------------------------------
# Code modified from installservice.py and bundleservice.py
#------------------------------------------------------------
# Twoure - 09/07/2016
from os.path import split as split_path
import shutil
#CHECK_... | |
#! /usr/bin/env python
import operator
################################################################################
def evaluate(source, local):
"Execute all math operations found in the source."
for expression in expressions(source):
local['_'] = tokens(expression).evaluate(local)
def expression... | |
# -*- coding: utf-8 -*-
"""
===============================
eeglcf.py
===============================
This is the main file from the eeglcf package.
"""
import numpy as np
import scipy.signal as sp_signal
# Define here the dimensions for readability of the algorithm
_comp_dim = 0 # Components dimension
_t_dim = 1... | |
# vim:fileencoding=utf-8:ts=2:sw=2:expandtab
#
# Copyright 2013 AppCove, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in ... | |
#
# Copyright 2013 Julien Danjou
# Copyright 2014 Red Hat, Inc
#
# Authors: Julien Danjou <julien@danjou.info>
# Eoghan Glynn <eglynn@redhat.com>
# Nejc Saje <nsaje@redhat.com>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... | |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2004-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.
#
# This software consi... | |
#!/usr/bin/env python
version = "1.0.0.1"
###############################################################################
#
# 17 Mar 2011
#
# A commandline script to build and run an alarm script. When alarm expires,
# an xterm is exec'd to show alarm content.
#
########################################################... | |
from Box2D import *
import pyglet
from pyglet.gl import *
from itertools import chain
from math import *
import sys
def equals(x, y, epsilon=1e-9):
return abs(x - y) < epsilon
def normalize_angle(angle):
if angle < 0.:
while angle < 0.:
angle += 2 * pi
else:
while angle >= 2 *... | |
# Copyright (C) 2011 Lukas Lalinsky
# Distributed under the MIT license, see the LICENSE file for details.
import logging
import mb2freedb
logger = logging.getLogger(__name__)
class CDDB(object):
EOL = "\r\n"
def __init__(self, config, conn):
self.config = config
self.conn = conn
s... | |
# Authors: Nicolas Tresegnie <nicolas.tresegnie@gmail.com>
# Sergey Feldman <sergeyfeldman@gmail.com>
# License: BSD 3 clause
import numbers
import warnings
from collections import Counter
import numpy as np
import numpy.ma as ma
from scipy import sparse as sp
from scipy import stats
from ..base import Base... | |
"""
Flux for Home-Assistant.
The idea was taken from https://github.com/KpaBap/hue-flux/
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/switch.flux/
"""
import datetime
import logging
import voluptuous as vol
from homeassistant.components.light impor... | |
# coding: utf-8
"""
KubeVirt API
This is KubeVirt API an add-on for Kubernetes.
OpenAPI spec version: 1.0.0
Contact: kubevirt-dev@googlegroups.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class V1beta1D... | |
"""
Tests for the throttling implementations in the permissions module.
"""
import pytest
from django.contrib.auth.models import User
from django.core.cache import cache
from django.core.exceptions import ImproperlyConfigured
from django.http import HttpRequest
from django.test import TestCase
from rest_framework.req... | |
from mpi4py import MPI
import mpiunittest as unittest
import arrayimpl
from functools import reduce
prod = lambda sequence,start=1: reduce(lambda x, y: x*y, sequence, start)
def skip_op(typecode, op):
if typecode in 'FDG':
if op in (MPI.MAX, MPI.MIN):
return True
return False
def maxvalue... | |
# The MIT License (MIT)
# Copyright (c) 2015 Ole Krause-Sparmann
# 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,... | |
# Copyright 2019 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from functools import partial
from textwrap import dedent
from typing import List, Optional
import pytest
from pants.backend.project_info.dependencies import Dependencies, DependencyType... | |
"""
Requirements file parsing
"""
from __future__ import absolute_import
import os
import re
import shlex
import optparse
from pip._vendor.six.moves.urllib import parse as urllib_parse
from pip._vendor.six.moves import filterfalse
import pip
from pip.download import get_file_content
from pip.req.req_install import ... | |
#------------------------------------------------------------------------------
# Copyright (c) 2013, Nucleic Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#-------------------------------------------------... | |
import os
import shutil
import linktastic
import lnkr
import term
from import_section import ImportSection, MODE_COPY, MODE_LINK, MODE_SYMLINK
from export_section import ExportSection
def do_link_app(app_config):
term.info('\nStart Linking App: %s' % term.format_path(app_config.path))
for section in app_conf... | |
# -*- coding: utf-8 -*-
# Copyright 2015, 2016 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 applica... | |
#!/usr/bin/env python
#
# meza command
#
import sys, getopt, os
def load_yaml ( filepath ):
import yaml
with open(filepath, 'r') as stream:
try:
return yaml.load(stream)
except yaml.YAMLError as exc:
print(exc)
defaults = load_yaml( "/opt/meza/config/defaults.yml" )
# Hard-coded for now, because I'm n... | |
"""
REST API Documentation for the NRS TFRS Credit Trading Application
The Transportation Fuels Reporting System is being designed to streamline compliance reporting for transportation fuel suppliers in accordance with the Renewable & Low Carbon Fuel Requirements Regulation.
OpenAPI spec version: v1
... | |
#
# 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... | |
#!/usr/bin/env python3
#
# 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 requir... | |
import distutils.sysconfig
import itertools
import os
import os.path
import sys
import sysconfig
from glob import iglob
from typing import List
import setuptools.command.build_ext
from setuptools import Distribution, Extension, setup
def _get_turbodbc_libname():
builder = setuptools.command.build_ext.build_ext(D... | |
"""
Routines for filling missing data
"""
import operator
import numpy as np
from distutils.version import LooseVersion
from pandas._libs import algos, lib
from pandas.compat import range, string_types
from pandas.core.dtypes.common import (
is_numeric_v_string_like,
is_float_dtype,
is_datetime64_dtype,
... | |
import json
import pickle
from typing import Any, Tuple, Union
from abc import ABC, abstractmethod
from couchbase.exceptions import ValueFormatException
from couchbase_core._libcouchbase import (Transcoder, FMT_JSON,
FMT_BYTES, FMT_UTF8, FMT_PICKLE,
... | |
# Copyright (c) 2016 Dell Inc. or its subsidiaries.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | |
# Copyright (c) 2012-2015 Kapiche Ltd.
# Author: Ryan Stuart<ryan@kapiche.com>
from __future__ import absolute_import, division, print_function, unicode_literals
from django.core.exceptions import ImproperlyConfigured
from django.contrib.auth.models import _user_has_perm, _user_get_all_permissions, _user_has_module_pe... | |
# ----------------------------------------------------------------------------
# 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... | |
from typing import Optional, Any, Dict, Text
from django.utils.translation import ugettext as _
from django.conf import settings
from django.contrib.auth import authenticate, update_session_auth_hash
from django.http import HttpRequest, HttpResponse
from django.shortcuts import redirect, render
from django.urls import... | |
#!/usr/bin/python
#
# Copyright 2017 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 a... | |
#!/usr/bin/env python
#
# Use the raw transactions API to spend bitcoins received on particular addresses,
# and send any change back to that same address.
#
# Example usage:
# spendfrom.py # Lists available funds
# spendfrom.py --from=ADDRESS --to=ADDRESS --amount=11.00
#
# Assumes it will talk to a bitcoind or Bit... | |
#!/usr/bin/env python
# This script generates C++ code for compiler diagnostics.
import argparse
import os
import shlex
def writefile(path, contents):
try:
with open(path, 'r') as f:
existing = f.read()
except OSError:
existing = ''
if existing != contents:
with open(pa... | |
# -*- coding: utf-8 -*-
# Copyright 2013 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | |
# Copyright 2014 Yahoo! Inc.
# Licensed under the Apache 2.0 license. Developed for Yahoo! by Sean Gillespie.
#
# Yahoo! licenses this file to you under the Apache License, Version
# 2.0 (the "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at:
#
#... | |
#!/usr/bin/env python
# coding: utf-8
# References:
# man curl
# https://curl.haxx.se/libcurl/c/curl_easy_getinfo.html
# https://curl.haxx.se/libcurl/c/easy_getinfo_options.html
# http://blog.kenweiner.com/2014/11/http-request-timings-with-curl.html
from __future__ import print_function
import os
import json
import s... | |
# -*- test-case-name: txweb2.dav.test.test_prop.PROP.test_PROPPATCH -*-
##
# Copyright (c) 2005-2017 Apple 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 without ... | |
#! /usr/bin/env python
"""Static analysis tool for checking docstring conventions and style.
Implemented checks cover PEP257:
http://www.python.org/dev/peps/pep-0257/
Other checks can be added, e.g. NumPy docstring conventions:
https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt
The repository is l... | |
#!/usr/bin/env python
#
# 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 require... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
This module implements the handler for state of Denon AVR receivers.
:copyright: (c) 2021 by Oliver Goetz.
:license: MIT, see LICENSE for more details.
"""
import logging
import time
from typing import Hashable, Optional
import attr
from .appcommand import AppComm... | |
# 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 unde... | |
#!/usr/bin/env python
# ===================================
# Copyright (c) Microsoft Corporation. All rights reserved.
# See license.txt for license information.
# ===================================
import subprocess
import shutil
import pwd
import grp
import os
import sys
import stat
import tempfile
import imp
impo... | |
# -*- 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... | |
# Copyright (c) 2016-present, Facebook, 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... | |
#!/usr/bin/env python
"""Test client RDFValues."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import platform
import socket
from absl import app
from absl.testing import absltest
from future.builtins import int
from future.builtins import str
import... | |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
# Copyright 2013 IBM Corp.
# 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/LIC... | |
# Lint as: python3
# Copyright 2019 DeepMind Technologies Limited.
#
# 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 ap... | |
"""
Retrieve Pillar data by doing a SQL query
This module is not meant to be used directly as an ext_pillar.
It is a place to put code common to PEP 249 compliant SQL database adapters.
It exposes a python ABC that can be subclassed for new database providers.
:maturity: new
:platform: all
Theory of sql_base ext_pil... | |
#1
import pygame
from pygame.locals import*
import math
import random
import time
#2
shootInterval=15
shootTimer=0
badtimer=100
badtimer1=0
badguys=[]
healthvalue=194
acc=[0,0]
arrows=[]
keys=[False,False,False,False]
autoshoot=False
playerpos=[100,100]
pygame.init()
width,height=1000,750
screen=pygame.display.set_mode... | |
import binascii
import logging
from rdflib import Literal
log = logging.getLogger('fedoralink.utils')
try:
from cis_django_modules.cis_util.czech import czech_sorting_key
except:
czech_sorting_key = lambda x:x
def get_class( kls ):
parts = kls.split('.')
module = ".".join(parts[:-1])
m = __im... | |
from datetime import datetime, timedelta, date, time
import nose
from pandas.compat import lrange, zip
import numpy as np
from pandas import Index, Series, DataFrame
from pandas.tseries.index import date_range, bdate_range
from pandas.tseries.offsets import DateOffset
from pandas.tseries.period import period_range, ... | |
from __future__ import absolute_import, division
import copy
import functools
import heapq
import itertools
import logging
import random
import threading
# selectors in stdlib as of py3.4
try:
import selectors # pylint: disable=import-error
except ImportError:
# vendored backport module
from .vendor impo... | |
# -*- coding: utf-8 -*-
import unittest
from mongoengine import *
from mongoengine import signals
signal_output = []
class SignalTests(unittest.TestCase):
"""
Testing signals before/after saving and deleting.
"""
def get_signal_output(self, fn, *args, **kwargs):
# Flush any existing signal ... | |
"""
Sphinx plugins for Django documentation.
"""
import json
import os
import re
from docutils import nodes
from docutils.parsers.rst import directives
from sphinx import __version__ as sphinx_ver, addnodes
from sphinx.builders.html import StandaloneHTMLBuilder
from sphinx.util.compat import Directive
from sphinx.util... | |
# 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 unde... | |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
import pytest
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.patches import Circle, Rectangle
from matplotlib import rc_context
from .... import units as u
from ....io import fits
from ....wcs import WCS
from ....coordinate... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.