gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# Copyright 2011 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 ... | |
import base64
import logging
import pickle
from datetime import datetime
from django.core.mail import EmailMessage
from django.db import models
PRIORITIES = (
("1", "high"),
("2", "medium"),
("3", "low"),
("4", "deferred"),
)
class MessageManager(models.Manager):
def non_deferred(self):
... | |
###
# Copyright (c) 2009, Juju, 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 condi... | |
# -*- coding: utf-8 -*-
"""Provides strategy object."""
from __future__ import absolute_import
from functools import partial
import re
from .. import t1types
from ..entity import Entity
from ..utils import suppress
PIXEL_PATTERN = re.compile(r'\[(\d+)\]')
OPERATOR_PATTERN = re.compile(r'(AND|OR)')
class Strategy(En... | |
#!/usr/bin/env vpython
# Copyright 2018 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.
"""Unittests for xcodebuild_runner.py."""
import logging
import mock
import os
import unittest
import iossim_util
import result_sink... | |
"""
:mod:`zsl.resource.guard`
-------------------------
Guard module defines tools to inject security checks into a resource. With
help of the ``guard`` class decorator and ``ResourcePolicy`` declarative
policy class a complex security resource behaviour can be achieved.
"""
from __future__ import absolute_import, di... | |
#!/usr/bin/python
#
# Autofocosing routines.
#
# You will need: scipy matplotlib sextractor
# This should work on Debian/ubuntu:
# sudo apt-get install python-matplotlib python-scipy python-pyfits sextractor
#
# If you would like to see sextractor results, get DS9 and pyds9:
#
# http://hea-www.harvard.edu/saord/ds9/
#
... | |
import math
import copy
# counting functions ******************************************************
def n_c_k(n,k):
'''
Purpose
return C(n,k)
Precondition
n,k strictly positive integers
n >= k
'''
return math.factorial(n) / (math.factorial(k) * math.factorial(n-k))
# Group_list ***************************... | |
# Copyright (c) 2013-2021 khal contributors
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publi... | |
"""The main form for the application"""
from PythonCard import model
# Allow importing of our custom controls
import PythonCard.resource
PythonCard.resource.APP_COMPONENTS_PACKAGE = "vb2py.targets.pythoncard.vbcontrols"
class Background(model.Background):
def __getattr__(self, name):
"""If a name was no... | |
# -*- coding: utf-8 -*-
'''
Installation of Python Packages Using pip
=========================================
These states manage system installed python packages. Note that pip must be
installed for these states to be available, so pip states should include a
requisite to a pkg.installed state for the package which... | |
#!/usr/bin/env python
from django.db import models
import json
import os.path
import time
from datetime import datetime, timedelta
import random
from .resources import Project, Account, Allocation
from qmpy.analysis.vasp import Calculation
from qmpy.db.custom import *
import qmpy
class TaskError(Exception):
"""... | |
"""
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... | |
######################
# CARTRIDGE SETTINGS #
######################
# The following settings are already defined in cartridge.shop.defaults
# with default values, but are common enough to be put here, commented
# out, for convenient overriding.
# Sequence of available credit card types for payment.
# SHOP_CARD_TYPES... | |
import datetime
import json
import os
import pickle
import glob
import numpy as np
from dialogue import qa_pipeline, data_helpers
from dialogue.errors import ParameterMissingError
from daphne_context.models import UserInformation, DialogueHistory, DialogueContext
from dialogue.nn_models import nn_models
from .mycrof... | |
import datetime
import string
import random
import re
import sys
from django.core.management.color import no_style
from django.db import transaction, models
from django.db.utils import DatabaseError
from django.db.backends.util import truncate_name
from django.db.backends.creation import BaseDatabaseCreation
from dja... | |
import logging
import os
import pathlib
import tempfile
import time
import pandas
import pytest
from cellpy import log, prms
from cellpy.utils import batch as batch
from cellpy.utils import helpers
from cellpy.utils.batch_tools import (
batch_experiments,
batch_exporters,
batch_journals,
batch_plotter... | |
#!/usr/bin/env python3
# Copyright (c) 2018 Bradley Denby
# Distributed under the MIT software license. See the accompanying file COPYING
# or http://www.opensource.org/licenses/mit-license.php.
"""Test transaction behaviors under the Dandelion spreading policy
Tests:
1. Resistance to active probing:
Stem: 0 --> 1... | |
#Copyright ReportLab Europe Ltd. 2000-2004
#see license.txt for license details
#history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/lib/codecharts.py
#$Header $
__version__=''' $Id '''
__doc__="""Routines to print code page (character set) drawings. Predates unicode.
To be sure we ... | |
import logging
from django import template
from django.conf import settings
from django.template.defaultfilters import stringfilter
from django.utils.dateparse import parse_datetime
import utils
logger = logging.getLogger(__name__)
register = template.Library()
def unquoted_tag(func=None, name=None):
functi... | |
# Copyright 2020 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
from __future__ import division, unicode_literals
import collections
import itertools
import os
import datetime
import logging
from argparse import RawTextHelpFormatter
import sys
if sys.platform != 'win32':
import resource
try:
import cPickle as pickle
except ImportError:
import pickle
from django.conf ... | |
"""
This file contains the `Board` class, which implements the rules for the
game Isolation as described in lecture, modified so that the players move
like knights in chess rather than queens.
You MAY use and modify this class, however ALL function signatures must
remain compatible with the defaults provided, and none... | |
from __future__ import absolute_import, division
import logging
import os
import re
from matplotlib import pyplot as plt
import numpy as np
import pandas as pd
import pyproteome as pyp
LOGGER = logging.getLogger('pyproteome.volcano')
MAX_VOLCANO_LABELS = 500
VOLCANO_TEXT_SIZE = 10
VOLCANO_LARGE_TEXT_SIZE = 20
d... | |
#
# This file is part of the PyMeasure package.
#
# Copyright (c) 2013-2017 PyMeasure Developers
#
# 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 limit... | |
# Copyright (C) 2010 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... | |
# _ _ _____ _ _____ _ _ _
# | | | | | __ \ | | / ____| | | | | |
# | |__| | _____ _____ | |__) |__ __| | | | ___ _ __ | |_ _ __ ___ | | | ___ _ __
# | __ |/ _ \ \/ / _ \| ___/ _ \ / _` | | | ... | |
# -*- coding: utf-8 -*-
#
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | |
'''
Code taken from: https://github.com/eugenium/mmd
(modified slightly for efficiency/PEP by Stephanie Hyland)
Python implementation of MMD and Covariance estimates for Relative MMD
Some code is based on code from Vincent Van Asch
which is based on matlab code from Arthur Gretton
Eugene Belilovsky
eugene.belilovs... | |
#!/usr/bin/env python2.7
"""Check CFC - Check Compile Flow Consistency
This is a compiler wrapper for testing that code generation is consistent with
different compilation processes. It checks that code is not unduly affected by
compiler options or other changes which should not have side effects.
To use:
-Ensure th... | |
# core.py
#
# Copyright (C) 2016 Diamond Light Source, Karl Levik
#
# 2016-11-30
#
# Methods to store and retrieve data in the core tables
#
import copy
import ispyb.interface.core
from ispyb.strictordereddict import StrictOrderedDict
class Core(ispyb.interface.core.IF):
"""Core provides methods to store and... | |
import mock
import pytest
from django.conf import settings
from django.core.management import call_command
from django.core.management.base import CommandError
from olympia import amo
from olympia.addons.management.commands import approve_addons
from olympia.devhub.models import AddonLog
from olympia.editors.models i... | |
from __future__ import division
import os
import six
import numpy as np
from rdkit import Chem
from rdkit.Chem.rdPartialCharges import ComputeGasteigerCharges
from ._base import Descriptor
from ._util import atoms_to_numpy
halogen = {9, 17, 35, 53, 85, 117}
getter_list = []
if six.PY2:
from collections impo... | |
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.1 (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.mozilla.org/MPL/
#
# Softwa... | |
"""Gaussian Mixture Model."""
# Author: Wei Xue <xuewei4d@gmail.com>
# Modified by Thierry Guillemot <thierry.guillemot.work@gmail.com>
# License: BSD 3 clause
import numpy as np
from scipy import linalg
from .base import BaseMixture, _check_shape
from ..externals.six.moves import zip
from ..utils import check_arra... | |
#!/usr/bin/env python
"""A slippy map GUI.
Implements a tiled slippy map using Tk canvas. Displays map tiles using
whatever projection the tiles are in and only knows about tile coordinates,
(as opposed to geospatial coordinates.) This assumes that the tile-space is
organized as a power-of-two pyramid, with the origi... | |
import numpy as np
from ..utils import check_random_state
# Maze state is represented as a 2-element NumPy array: (Y, X). Increasing Y is South.
# Possible actions, expressed as (delta-y, delta-x).
maze_actions = {
'N': np.array([-1, 0]),
'S': np.array([1, 0]),
'E': np.array([0, 1]),
'W': np.array([0... | |
# -*- coding: utf-8 -*-
""" Sahana Eden Transport Model
@copyright: 2012-13 (c) Sahana Software Foundation
@license: MIT
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 witho... | |
"""Test to verify that Home Assistant core works."""
# pylint: disable=protected-access
import asyncio
import unittest
from unittest.mock import patch, MagicMock
from datetime import datetime, timedelta
import pytz
import homeassistant.core as ha
from homeassistant.exceptions import InvalidEntityFormatError
from home... | |
import numpy as nm
from sfepy.base.base import assert_
from sfepy.linalg import dot_sequences
from sfepy.terms.terms import Term, terms
from sfepy.terms.terms_th import THTerm, ETHTerm
class DotProductVolumeTerm(Term):
r"""
Volume :math:`L^2(\Omega)` weighted dot product for both scalar and vector
fields.... | |
"""Test the MySensors config flow."""
from __future__ import annotations
from unittest.mock import patch
import pytest
from homeassistant import config_entries, setup
from homeassistant.components.mysensors.const import (
CONF_BAUD_RATE,
CONF_DEVICE,
CONF_GATEWAY_TYPE,
CONF_GATEWAY_TYPE_MQTT,
CON... | |
# Copyright (c) 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/LICENSE-2.0
#
# Unless ... | |
import numpy as np
import matplotlib.pyplot as plt
import h5py
import scipy.io
import sklearn
import sklearn.datasets
def sigmoid(x):
"""
Compute the sigmoid of x
Arguments:
x -- A scalar or numpy array of any size.
Return:
s -- sigmoid(x)
"""
s = 1/(1+np.exp(-x))
return s
def re... | |
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test replace by fee code
#
from test_framework.test_framework import BitcoinTestFramework
from test_... | |
# Chicago Tribune News Applications fabfile
# No copying allowed
from fabric.api import *
"""
Base configuration
"""
#name of the deployed site if different from the name of the project
env.site_name = 'censusweb'
env.project_name = 'censusweb'
env.database_password = 'Xy9XKembdu'
env.site_media_prefix = "site_media... | |
import threading
import new
import logging
import django
from django.db import router, connections, models
from django.apps import apps
from django.utils.encoding import smart_text
from djangae.crc64 import CRC64
class SimulatedContentTypeManager(models.Manager):
"""
Simulates content types without actua... | |
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | |
import os
import shutil
import zipfile
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect, Http404
from django.shortcuts import get_object_or_404... | |
import pytest
from mitmproxy.test import tflow
from mitmproxy.addons import view
from mitmproxy import flowfilter
from mitmproxy import exceptions
from mitmproxy import io
from mitmproxy.test import taddons
from mitmproxy.tools.console import consoleaddons
from mitmproxy.tools.console.common import render_marker, SYM... | |
from whoosh.fields import *
from whoosh.index import create_in, open_dir
from whoosh.qparser import MultifieldParser
from whoosh.query import *
import abc
import copy
import csv
import json
import os.path
import sys
import utils
class GenericSearchEngine(object):
"""
An abstract class for any search engine, ... | |
import os
import json
import uuid
import logging
import requests
import predix.config
import predix.service
import predix.security.uaa
class Asset(object):
"""
Client library for working with the Predix Asset Service. For more details
on use of the service please see official docs:
https://www.pred... | |
"""
pyscgi.py - Portable SCGI implementation
This module has been written as part of the Cherokee project:
http://www.cherokee-project.com/
"""
# Copyright (c) 2006-2010, Alvaro Lopez Ortega <alvaro@alobbs.com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or withou... | |
"""Conferences API Version 1.0.
This API client was generated using a template. Make sure this code is valid before using it.
"""
import logging
from datetime import date, datetime
from .base import BaseCanvasAPI
from .base import BaseModel
class ConferencesAPI(BaseCanvasAPI):
"""Conferences API Version 1.0."""
... | |
# Copyright 2014 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... | |
import os
import codecs
import logging
import json
from collections import namedtuple
from django.utils.datastructures import MultiValueDict as MultiDict
from django.conf import settings
from django.utils.http import urlencode
from django.core.urlresolvers import reverse
import dateutil.parser
from time import mkti... | |
"""Support for Motion Blinds sensors."""
import logging
from motionblinds import BlindType
from homeassistant.const import (
DEVICE_CLASS_BATTERY,
DEVICE_CLASS_SIGNAL_STRENGTH,
PERCENTAGE,
SIGNAL_STRENGTH_DECIBELS_MILLIWATT,
)
from homeassistant.helpers.entity import Entity
from homeassistant.helpers.... | |
"""Plotting of motion fields and other visualization tools."""
from matplotlib.pylab import cm, figure
from numpy import arange, meshgrid, nan, size
from scipy.ndimage import gaussian_filter
try:
from skimage.measure import find_contours
skimage_imported = True
except ImportError:
skimage_imported = False
def p... | |
from collections.abc import Mapping
import os
import numpy as np
import pytest
import openmc
import openmc.exceptions as exc
import openmc.lib
from tests import cdtemp
@pytest.fixture(scope='module')
def pincell_model():
"""Set up a model to test with and delete files when done"""
openmc.reset_auto_ids()
... | |
# written by python 3.6.1
#-*- coding: utf-8 -*-
from urllib.request import urlopen
import json
import string
import re
from bs4 import BeautifulSoup
import logging
import time
FILE_PATH = "./boxofficemojo.com/movie_data.txt"
LOG_PATH = "./boxofficemojo.com/scraping.log"
logging.basicConfig(filename=LOG_PATH,level=... | |
#!/usr/bin/env python
# Siconos is a program dedicated to modeling, simulation and control
# of non smooth dynamical systems.
#
# Copyright 2016 INRIA.
#
# 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 L... | |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | |
# 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/LICENSE-2.0
#
# Unless requ... | |
# -*- coding: utf-8 -*-
# Copyright 2015 Metaswitch Networks
#
# 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... | |
"""Base async HTTP client implementation."""
import sys
from http.client import responses
from vine import Thenable, maybe_promise, promise
from kombu.exceptions import HttpError
from kombu.utils.compat import coro
from kombu.utils.encoding import bytes_to_str
from kombu.utils.functional import maybe_list, memoize
... | |
## step_stats_watcher.py
## Author: Daniel "Albinohat" Mercado
## This script parses through Stepmania's Stats.xml file and stores information in a text file to be displayed on a livestream.
## Standard Imports
import os, re, sys, threading, time
## Third-Party Imports
from bs4 import BeautifulSoup
## Global Variabl... | |
'''
Created on Mar 8, 2015
@author: hijungshin
'''
from visualobjects import VisualObject
from video import Video
import sys
import os
import util
import numpy as np
import process_aligned_json as pjson
from sentence import Sentence
import cv2
import label
from sublinebreak import SublineBreaker
from moviepy.editor i... | |
import os
from glob import glob
import xarray as xr
import pandas as pd
import geopandas as gpd
import bmorph
import numpy as np
from scipy.stats import entropy
from string import Template
import subprocess
CONTROL_TEMPLATE = Template(
"""<ancil_dir> $ancil_dir !
<input_dir> $input_dir !
<output_... | |
from ucsmsdk.ucsexception import UcsException
import re, sys
# given an array and a string of numbers, make sure they are all in the array:
#
def check_values(array, csv):
indexes = csv.split(',')
for i in indexes:
try:
i = int(i) - 1
except:
print "bad value: " + i
... | |
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | |
# Copyright 2020 kubeflow.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 by applicable law or agreed to in writing,... | |
# -*- coding: utf-8 -*-
"""
Created on Sat May 10 00:29:46 2014
@author: Nate
"""
import ctypes
#from numpy.ctypeslib import ndpointer
import numpy
from bitarray import bitarray
import time, pdb
import file_locations, uuid
from numpy.ctypeslib import ndpointer
class repas():
def __init__(self):
prin... | |
# -*- coding: utf-8 -*-
"""
Inventory Management
A module to record inventories of items at a locations (sites),
including Warehouses, Offices, Shelters & Hospitals
"""
module = request.controller
resourcename = request.function
if not deployment_settings.has_module(module):
raise HTTP(404, body="Mo... | |
# coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from tests import IntegrationTestCase
from tests.holodeck import Request
from twilio.base.exceptions import TwilioException
from twilio.http.response import Response
class FactorTestCase(Integratio... | |
# yellowbrick.model_selection.importances
# Feature importance visualizer
#
# Author: Benjamin Bengfort
# Author: Rebecca Bilbro
# Created: Fri Mar 02 15:21:36 2018 -0500
#
# Copyright (C) 2018 The scikit-yb developers
# For license information, see LICENSE.txt
#
# ID: importances.py [] benjamin@bengfort.com $
"""
I... | |
# -*- coding: utf-8 -*-
#
# 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
#... | |
from sympy.core import (S, symbols, Eq, pi, Catalan, EulerGamma, Lambda,
Dummy, Function)
from sympy.core.compatibility import StringIO
from sympy import erf, Integral, Piecewise
from sympy import Equality
from sympy.matrices import Matrix, MatrixSymbol
from sympy.printing.codeprinter import Ass... | |
import click
def validate_value(ctx, param, value):
"""
Check to make sure the arg is fomatted correctly...
"""
#TODO: Write this function
toreturn = []
for v in value:
toreturn.append((str(v[0]), int(v[1])))
return toreturn
@click.group()
def cli():
pass
def find_fit_prom... | |
from nose.tools import * # flake8: noqa
from api.base.settings.defaults import API_BASE
from tests.base import ApiTestCase
from osf_tests.factories import SubjectFactory, PreprintProviderFactory
class TestPreprintProviderSubjects(ApiTestCase):
def create_subject_rules(self):
'''
Subject Hierarc... | |
# moosic/client/cli/main.py - The client portion of the moosic jukebox system.
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
# binary, for any purpos... | |
#!/usr/bin/env python3
import argparse
import logging
import os
import stat
import subprocess
import sys
import time
import yaml
class ConfigurationError(Exception):
pass
def configure_httpd(logger, run_dir, mgmt_ip):
sh_file = "{}/httpd_config-{}.sh".format(run_dir, time.strftime("%Y%m%d%H%M%S"))
logge... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Time processing functions for use with GEOS-Chem/Data analysis
Use help(<name of function>) to get details on a particular function.
Notes
-----
- This module is underdevelopment vestigial/inefficient code is being removed/updated.
- Where external code is used, credit ... | |
# Copyright (c) 2014 Alex Meade. All rights reserved.
# Copyright (c) 2015 Dustin Schoenbrun. All rights reserved.
# Copyright (c) 2015 Tom Barron. 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 ... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Created on 19 March 2012
@author: tcezard
'''
import sys
import os
import logging
from optparse import OptionParser
from glob import glob
from utils import utils_logging
import command_runner
from RAD_merge_bam_files import merge_bam_files
#get the path to the curr... | |
# coding=utf-8
# 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.
"""Common code to manage .isolate format.
"""
import logging
import os
import posixpath
import re
import sys
import trace_inputs
PATH_... | |
"""Task runner"""
import sys
from multiprocessing import Process, Queue as MQueue
from threading import Thread
import pickle
import six
from six.moves import queue, xrange
import cloudpickle
from .exceptions import InvalidTask, CatchedException
from .exceptions import TaskFailed, SetupError, DependencyError, UnmetDe... | |
"""Support for Tibber sensors."""
import asyncio
from datetime import datetime, timedelta
import logging
from random import randrange
import aiohttp
from homeassistant.components.sensor import (
DEVICE_CLASS_CURRENT,
DEVICE_CLASS_ENERGY,
DEVICE_CLASS_POWER,
DEVICE_CLASS_SIGNAL_STRENGTH,
DEVICE_CLA... | |
#! /usr/bin/env python
#
# See README for usage instructions.
import glob
import os
import subprocess
import sys
import platform
# We must use setuptools, not distutils, because we need to use the
# namespace_packages option for the "google" package.
from setuptools import setup, Extension, find_packages
from distuti... | |
#!/usr/bin/env python3
import os
import pymssql
import pymysql.cursors
from contextlib import contextmanager
from enum import Enum
REDCAP_VERSION = '7.2.2'
REDCAP_PATH = 'redcap/redcap_v{}/'.format(REDCAP_VERSION)
REDCAP_UOL_PATH = 'redcap_v{}/'.format(REDCAP_VERSION)
REDCAP_INTERNAL_URL = 'https://briccs.xuhl-tr.nhs... | |
# 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 applicable law or agreed to in writ... | |
import asyncio, discord, time
from discord.ext import commands
from Cogs import DisplayName, ReadableTime, Utils, Nullify
def setup(bot):
# Add the bot
settings = bot.get_cog("Settings")
bot.add_cog(Invite(bot, settings))
class Invite(commands.Cog):
# Init with the bot reference, and a reference to the setti... | |
#
# 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
# ... | |
"""
The fields module defines various field classes all of which are derived from
BaseField.
Field Methods
~~~~~~~~~~~~~
.. automethod:: BaseField.validate(raw_data, **kwargs)
.. automethod:: BaseField.deserialize(raw_data, **kwargs)
.. automethod:: BaseField.serialize(py_data, **kwargs)
"""
try:
from collect... | |
#!/usr/bin/env python
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "... | |
# -*- coding: utf-8 -*-
# Copyright 2015 Metaswitch Networks
#
# 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... | |
import os
import time
import random
import threading
import socket
from TCAction import TCActionBase
from NativeLog import NativeLog
from NativeLog import ThroughputResult
from Utility import RSSICalibrator
from Utility import MakeFolder
LOG_FOLDER = os.path.join("Performance", "Throughput")
AP_PROP_KEY = ("ssid",... | |
from yuuhpizzakebab import app, admin_required, login_required
from .models import Order
from yuuhpizzakebab.pizza.models import Pizza
from yuuhpizzakebab.kebab.models import Kebab
from yuuhpizzakebab.drink.models import Drink
from yuuhpizzakebab.user.database_functions import get_user_by_id
from flask import render_te... | |
#!/usr/bin/env python3
# Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import argparse
import contextlib
import copy
import glob
import io
import itertools
import os
import unittest
import re
import shutil... | |
from __future__ import with_statement
try:
import MySQLdb
from MySQLdb.cursors import DictCursor
except ImportError:
import pymysql as MySQLdb
from pymysql.cursors import DictCursor
from flask import (
Flask, request, redirect, session, url_for, abort,
render_template, _app_ctx_stack, Response... | |
__author__ = 'saeedamen' # Saeed Amen
#
# Copyright 2016-2020 Cuemacro - https://www.cuemacro.com / @cuemacro
#
# 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/LI... | |
from django.db import migrations
class MigrationOptimizer(object):
"""
Powers the optimization process, where you provide a list of Operations
and you are returned a list of equal or shorter length - operations
are merged into one if possible.
For example, a CreateModel and an AddField can be opt... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.