gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
import os
import shutil
from textwrap import dedent
from traitlets import List, Bool
from .baseapp import BaseNbConvertApp, nbconvert_aliases, nbconvert_flags
from ..preprocessors import (
AssignLatePenalties, ClearOutput, DeduplicateIds, OverwriteCells, SaveAutoGrades, Execute, LimitOutput)
from ..api import Gra... | |
"""
A flexible and relatively robust implementation
of the Observer Pattern.
"""
import weakref
"""
----------------------
Internal Documentation
----------------------
Storage Structures:
registry : {
(notification, observable) : ObserverDict(
observer : method name
)
}
holds : {
... | |
#
# Copyright 2015 LinkedIn Corp. 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 ... | |
# Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Widget bar models.
We have multiple models for the widget bar since each object can have it's
own rules what is mappable to it"""
from lib import base
from lib import factory
from lib.element import widg... | |
#!/usr/bin/env python
from __future__ import division
from __future__ import with_statement
import numpy as np
#from pylab import ion
import matplotlib as mpl
#from matplotlib.path import Path
from matplotlib import pyplot as plt
from scipy.optimize import curve_fit
#import numexpr as ne
#from numba import autojit
i... | |
__author__ = 'rolandh'
EDUPERSON_OID = "urn:oid:1.3.6.1.4.1.5923.1.1.1."
X500ATTR_OID = "urn:oid:2.5.4."
NOREDUPERSON_OID = "urn:oid:1.3.6.1.4.1.2428.90.1."
NETSCAPE_LDAP = "urn:oid:2.16.840.1.113730.3.1."
UCL_DIR_PILOT = 'urn:oid:0.9.2342.19200300.100.1.'
PKCS_9 = "urn:oid:1.2.840.113549.1.9.1."
UMICH = "urn:oid:1.3.... | |
# -*- coding: utf-8 -*-
import os
import json
import posixpath
from seaserv import seafile_api
from django.urls import reverse
from seahub.test_utils import BaseTestCase
from seahub.utils import check_filename_with_rename
from seahub.utils.file_revisions import get_all_file_revisions
from tests.common.utils import ... | |
#!/usr/bin/env python
#
# Copyright 2010 Facebook
# Copyright 2015 Mobolic
#
# 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 requi... | |
"""
Support for the Uber API.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.uber/
"""
import logging
from datetime import timedelta
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.helpers.... | |
# 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 use ... | |
# Copyright (c) 2016 Yubico AB
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that the following
# conditions are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditi... | |
# 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 agreed to in writing, ... | |
'''Metrics to compare disaggregation performance against ground truth
data.
All metrics functions have the same interface. Each function takes
`predictions` and `ground_truth` parameters. Both of which are
nilmtk.MeterGroup objects. Each function returns one of two types:
either a pd.Series or a single float. Most... | |
from subprocess import call
import re
from common import *
class _AnyNumber(int):
def __eq__(self, other):
return True
ANY = _AnyNumber(1)
class PathTester(object):
def __init__(self, test, root):
self.test = test
self.root = root
self.paths = []
self.m... | |
# SoLoud C-Api Code Generator (c)2013-2015 Jari Komppa http://iki.fi/sol/
# Warning: This file is generated. Any manual changes will be overwritten.
# Data for SoLoud glue code generation
# Enumerations
soloud_enum = {
'SOLOUD_AUTO': 0,
'SOLOUD_SDL': 1,
'SOLOUD_SDL2': 2,
'SOLOUD_PORTAUDIO': 3,
'SOLOUD_WINMM': 4,
'SOLO... | |
import datetime
import os
from nose.tools import eq_, ok_
from django.contrib.auth.models import User, Group, Permission
from django.utils import timezone
from django.core import mail
from funfactory.urlresolvers import reverse
from airmozilla.main.models import (
Event,
Channel,
Tag,
SuggestedEvent... | |
# Authors: Gilles Louppe, Mathieu Blondel, Maheshakya Wijewardena
# License: BSD 3 clause
import numpy as np
from .base import SelectorMixin
from ..base import TransformerMixin, BaseEstimator, clone
from ..externals import six
from ..utils import safe_mask, check_array, deprecated
from ..utils.validation import chec... | |
import argparse
import csv
import os
import platform
import re
from collections import defaultdict, UserDict
import pytablewriter
class Result:
def __init__(self, timing, parsed_value, exception, matched_expected):
self.timing = timing
self.parsed_value = parsed_value
self.exception = exc... | |
#!/usr/bin/env python3
# Author: Gabriel Bordeaux (gabfl)
# Github: https://github.com/gabfl/mysql-batch
# Compatible with python 2.7 & 3
import sys
import time
import pymysql.cursors
import pymysql.constants.CLIENT
import argparse
def update_batch(ids, table, set_, sleep=0, primary_key='id'):
"""
Updat... | |
# Default Django settings. Override these with settings in the module
# pointed-to by the DJANGO_SETTINGS_MODULE environment variable.
# This is defined here as a do-nothing function because we can't import
# django.utils.translation -- that module depends on the settings.
gettext_noop = lambda s: s
#################... | |
# Copyright 2016 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.
"""Presubmit script for sync component.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the presubmit API... | |
"""Base geometry class and utilities
"""
import sys
from warnings import warn
from binascii import a2b_hex
from ctypes import pointer, c_size_t, c_char_p, c_void_p
from shapely.coords import CoordinateSequence
from shapely.ftools import wraps
from shapely.geos import lgeos, ReadingError
from shapely.geos import WKBWr... | |
from __future__ import with_statement
from distutils.version import StrictVersion
from itertools import chain
from select import select
import os
import socket
import sys
import threading
import warnings
try:
import ssl
ssl_available = True
except ImportError:
ssl_available = False
from redis._compat impo... | |
#!/usr/bin/env python
"""Function to compute a user-defined distance function among lists.
Distances can be between one (intra-distance) or two (inter-distances) lists.
Author: Federico Tomasi
Copyright (c) 2016, Federico Tomasi.
Licensed under the FreeBSD license (see LICENSE.txt).
"""
import multiprocessing as mp
i... | |
"""
dnapositions.py
Specification of DNA molecules in a variety of co-ordinate systems
"""
from typing import Dict, List
import pdb
import re
from copy import deepcopy
from itertools import combinations
import matplotlib.pyplot as plt
import numpy as np
from mpl_toolkits.mplot3d import Axes3D
from fractaldna.utils... | |
# Lint as: python3
# Copyright 2021 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 ... | |
# 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 use ... | |
#!/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... | |
# Lint as: python3
# Copyright 2019 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 agr... | |
# Copyright 2012-2017 The Meson development team
# 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... | |
"""TitanCNA: Subclonal CNV calling and loss of heterogeneity in cancer.
https://github.com/gavinha/TitanCNA
"""
import csv
import glob
import os
import shutil
import pandas as pd
from bcbio import utils
from bcbio.bam import ref
from bcbio.distributed.transaction import file_transaction, tx_tmpdir
from bcbio.heterog... | |
"""Test read write
"""
from xml.etree import ElementTree as ET
from io import BytesIO
from ...gui import test
from ...registry import global_registry, WidgetRegistry, WidgetDescription
from .. import Scheme, SchemeNode, SchemeLink, \
SchemeArrowAnnotation, SchemeTextAnnotation
from .. import readwrite... | |
# -*- coding: utf-8 -*-
from collections import OrderedDict
t = {
'Building digitizing': [
{'Building': 'building:yes'}
],
'Building feature': [
{'Housenumber': 'addr:housenumber'},
{'Housename': 'addr:housename'},
{'Street': 'addr:street'},
],
'Place... | |
import logging
import random
import threading
import time
from collections import defaultdict
from typing import Any, Callable, Dict, List, Mapping, Optional, Set
import orjson
import pika
import pika.adapters.tornado_connection
from django.conf import settings
from pika.adapters.blocking_connection import BlockingCha... | |
"""
Glue code for logic around calling associated backend
libraries to support the dcos installer.
"""
import json
import logging
import os
import botocore.exceptions
import gen
import gen.build_deploy.aws
import gen.calc
import release
import release.storage.aws
import release.storage.local
from dcos_installer impor... | |
# Copyright(c) 2014, The LIMIX developers (Christoph Lippert, Paolo Francesco Casale, Oliver Stegle)
#
#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... | |
from sqlalchemy import Column, String, Integer, ForeignKey
from sqlalchemy.orm import relationship
from sqlalchemy.ext.declarative import declarative_base
from MaudeMiner.core.database.base import base
def create(engine, tables=[]):
print " === Creating Table(s) === "
for t in tables:
print " " + str(t)
base.m... | |
#!/usr/bin/env python
#
# Ubuntu Packages :
# apt-get install python-svn
# apt-get install python-elementtree
import sys
import pygtk
pygtk.require('2.0')
import gtk
import gtk.glade
import gnomeapplet
import gnome.ui
import os
import re
import gobject
import gc
import pysvn
import svn_applet_globals
import xml.etr... | |
import socket
import threading
import time
import warnings
from selenium.webdriver import Chrome
from selenium.common.exceptions import NoSuchWindowException, TimeoutException, WebDriverException
from six.moves import BaseHTTPServer
from six.moves.urllib.parse import urlparse
import requests
import six
import tld
FI... | |
"""
Users
=====
"""
from pipes import quote
import posixpath
import random
import string
from fabric.api import hide, run, settings, sudo, local
from fabtools.group import (
exists as _group_exists,
create as _group_create,
)
from fabtools.files import uncommented_lines
from fabtools.utils import run_as_root... | |
"""
Matrix functions that use Pade approximation with inverse scaling and squaring.
"""
from __future__ import division, print_function, absolute_import
import warnings
import numpy as np
from scipy.linalg._matfuncs_sqrtm import SqrtmError, _sqrtm_triu
from scipy.linalg.decomp_schur import schur, rsf2csf
from scipy... | |
import os
import json
import uuid
import typing
import hashlib
import logging
from waterbutler.core import utils
from waterbutler.core import signing
from waterbutler.core import streams
from waterbutler.core import provider
from waterbutler.core import exceptions
from waterbutler.core.path import WaterButlerPath
from... | |
#import warnings
#warnings.filterwarnings("ignore", message="using a non-integer number instead of an integer will result in an error in the future")
def template_names():
import glob as glob
template_files = glob.glob('miles_models/Mun*.fits')
return template_files
def choose_templates(templates, age_lim = 20.0,... | |
import os
import copy
import traceback
import codecs
import stat
import shutil
from collections import deque
from .log import LoggerFactory
from .gossip import gossiper
from .library import libstore
from .evaluater import evaluater
from .util import unified_diff, exec_command, PY3
# Global logger for this part
logger... | |
__author__ = 'ehiller@css.edu'
__author__ = 'ram8647@gmail.com'
import datetime
import logging
import random
import traceback
from models import transforms
from models.models import Student
from models.models import EventEntity
from models import utils as models_utils
from models import jobs
from models import event_... | |
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 15 20:17:23 2016
@author: jasonniu
#CLRS Exercises and PS
"""
# Ex2.1-3
def linear_search(data, num):
# Ex2.1-3
for i in range(len(data)):
if num == data[i]:
print 'Found it! ', i, data[i]
return i
print 'Not found'
return ... | |
from __future__ import print_function
# Copyright (c) 2017, Simon Brodeur
# 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 no... | |
# coding: utf-8
# ### Lock animated
# This is a simulation of a ship lock, similar to the ones we can see in the Panama Canal or in some North European ports.
# The lock has two doors (left and right) which can open when the level of water is the same at both sides of the door.
# The picture below shows a particular ... | |
from django.utils.encoding import smart_str
from django.utils.translation import ugettext_lazy as _
from django.utils import timezone
from django.contrib.auth.models import _user_has_perm, _user_get_all_permissions, _user_has_module_perms
from django.db import models
from django.contrib.contenttypes.models import Conte... | |
import os, sys, socket, random
from urllib import quote_plus
from pandac.PandaModules import HTTPClient
from pandac.PandaModules import HTTPCookie
from pandac.PandaModules import URLSpec
from pandac.PandaModules import Ramfile
from pandac.PandaModules import Ostream
from pandac.PandaModules import HTTPDate
from pandac.... | |
from copy import deepcopy
import numpy as nump
ndsa = 58
#####################################################Organ Allocation Procedures, Offer Routines, and Matching Functions#######################################################################
def Allocate(organ, OPTN, Sim, Regions, SharingPartners, Patients_Accep... | |
from __future__ import print_function, division
from sympy.core import S, C
from sympy.core.compatibility import u
from sympy.core.exprtools import factor_terms
from sympy.core.function import (Function, Derivative, ArgumentIndexError,
AppliedUndef)
from sympy.core.logic import fuzzy_not
from sympy.functions.eleme... | |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
Wrapper for the common graph algorithms.
"""
import sys
import logging
import networkx as nx
from collections import deque
from string import maketrans
from jcvi.utils.iter import pairwise
from jcvi.formats.base import must_open
"""
Bidirectional graph.
"""
dirs =... | |
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
import os
from arcproject.waterquality import classes
from arcproject.scripts.load_data_bulk import slurp
# path to location with data
data = r"C:\Users\Andy\Desktop\ArcData" # or location on x drive
def jan():
print("January 2016")
path = os.path.join(data, "Jan_2016")
s = slurp.Slurper()
s.add_new_sites = Tru... | |
from __future__ import unicode_literals
try:
from urllib import parse as urlparse
except ImportError:
import urlparse # Python 2
try:
basestring
except NameError:
basestring = str # Python 3
from django import forms
from django.core import checks, exceptions
from django.contrib.admin.filters impor... | |
# Copyright (c) 2010, 2011, 2012 Nicira, 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 agre... | |
"""
:created: 2018-01
:author: Alex BROSSARD <abrossard@artfx.fr>
"""
from PySide2 import QtWidgets, QtCore, QtGui
from pymel import core as pmc
from auri.auri_lib import AuriScriptView, AuriScriptController, AuriScriptModel, is_checked, grpbox
from auri.scripts.Maya_Scripts import rig_lib
from auri.scripts.Maya_Scri... | |
# GOALS
# Compare rush hour to non for consistency
from pprint import pprint
import csv
from datetime import *
from dateutil.relativedelta import *
import calendar
import dateutil.parser
import matplotlib.pyplot as plt
import operator
# Collect and Store Data in Memory
def fetch_data():
with open("turnstile_150404.... | |
# -*- coding: utf-8 -*-
# Copyright 2015-2019 grafana-dashboard-builder contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | |
#!/usr/bin/env python
# This little script allows check DAS is up and running
# It is derived from the DAS CLI code that can be downloaded at
# https://cmsweb.cern.ch/das/cli
import sys
if sys.version_info < (2, 6):
raise Exception("DAS requires python 2.6 or greater")
import os
import re
import time
import jso... | |
#!/usr/bin/python2.7
#
# setup_leveldb.py
#
# Compiles and installs Minecraft Pocket Edtition binary support.
#
__author__ = "D.C.-G. 2017"
__version__ = "0.4.0"
import sys
import os
import platform
import fnmatch
import re
if sys.platform != "linux2":
print "This script can't run on other platforms than Linux on... | |
import time, copy
import os
import sys
import numpy
import h5py
#from PnSC_ui import *
#from PnSC_dataimport import *
from PnSC_SCui import *
#from PnSC_math import *
from PnSC_h5io import *
from PnSC_main import *
from matplotlib.ticker import FuncFormatter
import scipy.integrate
celllist=[1, 2]+range(4, 21)+[22]+[24... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""test foreground and background colors"""
import time
from colored import fg, bg, attr
def main():
colors = (
"#000000",
"#800000",
"#008000",
"#808000",
"#000080",
"#800080",
"#008080",
"#c0c0c0",
... | |
# 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 (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe, json
import frappe.utils
import frappe.share
import frappe.defaults
import frappe.desk.form.meta
from frappe.model.utils.user_settings import get_user_settings
from... | |
from collections import defaultdict
from itertools import chain
import logging
from networkx import NetworkXError
from cle.backends.cgc import CGC
from .errors import IdentifierException
from .functions import Functions
from .runner import Runner
from .. import Analysis
from ... import options
from ...errors import... | |
import contextlib
import json
import pathlib
from threading import Timer
from typing import Optional
import uuid
from bottle import Bottle, HTTPError, request, template, static_file
from ..apps import BaseApp
from ..geoip import GeoIPOO
from ..nodes import Manager as NodesManager, Node
from ..onionoo import getOniono... | |
from django.shortcuts import render, get_object_or_404, redirect
from django.core.urlresolvers import reverse
from django.http import Http404, QueryDict
from django.contrib import auth
from django.contrib import messages
from django.utils.translation import ugettext_lazy as _
from django.views.decorators.http import re... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os, sys, sqlite3, datetime, urllib, gzip, requests
from time import sleep
from flask import Flask, render_template, g, request, redirect, url_for, send_from_directory, session, flash, jsonify, make_response, Markup, Response
from flask_login import LoginManager, Us... | |
# orm/loading.py
# Copyright (C) 2005-2021 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""private module containing functions used to convert database
rows into object ins... | |
"""
Handle data encryption and decryption while transferring the file to and
from the cloud.
"""
import base64
import errno
import gnupg
import json
import os
import tempfile
import urllib
import urllib2
from StringIO import StringIO
from lib import checksum_data, checksum_file
from lib.encryption import generate_ran... | |
# Copyright (c) 2014 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 required by applic... | |
# -*- coding: utf-8 -*-
symbols = (
"H",
"He",
"Li",
"Be",
"B",
"C",
"N",
"O",
"F",
"Ne",
"Na",
"Mg",
"Al",
"Si",
"P",
"S",
"Cl",
"Ar",
"K",
"Ca",
"Sc",
"Ti",
"V",
"Cr",
"Mn",
"Fe",
"Co",
"Ni",
"Cu",
... | |
import sys
import datetime
import os
helpers_dir = os.getenv("PYCHARM_HELPERS_DIR", sys.path[0])
if sys.path[0] != helpers_dir:
sys.path.insert(0, helpers_dir)
from tcunittest import TeamcityTestResult
from tcmessages import TeamcityServiceMessages
from pycharm_run_utils import import_system_module
from pycharm_r... | |
# Copyright 2012 Nicira, 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 a... | |
# Copyright (c) 2018 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 app... | |
"""
@file coi-services/mi.idk/comm_config.py
@author Bill French
@brief Comm Configuration object used to gather and store connection information for the logger.
Usage:
#
# Create a CommConfig object. Use the factory method to get the correct object type.
#
comm_config = get_config_from_type(filename, 'ethernet'):
... | |
# Copyright 2013 IBM Corp.
# Copyright 2013 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 r... | |
from ..utils import appid, have_appserver, on_production_server
from .creation import DatabaseCreation
from django.db.backends.util import format_number
from djangotoolbox.db.base import NonrelDatabaseFeatures, \
NonrelDatabaseOperations, NonrelDatabaseWrapper, NonrelDatabaseClient, \
NonrelDatabaseValidation, ... | |
"""
Yarr model managers
"""
import datetime
import time
from django.db import connection, models, transaction
import bleach
from yarr import settings
from yarr.constants import ENTRY_UNREAD, ENTRY_READ, ENTRY_SAVED
###############################################################################
# ... | |
# -*- coding: utf-8 -*-
# Copyright 2014 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.
"""Automated tests for many websites"""
import argparse
from environment import Environment
from websitetest import WebsiteTest
c... | |
"""
An HTTP trigger Azure Function that returns a SAS token for Azure Storage for the specified container and blob name.
You can also specify access permissions for the container/blob name and optionally its token time-to-live period.
The SAS token expires in an hour by default.
[HTTP Request body format]
HTTP Reques... | |
"""
Network Utilities
(from web.py)
"""
__all__ = [
"validipaddr", "validip6addr", "validipport", "validip", "validaddr",
"urlquote",
"httpdate", "parsehttpdate",
"htmlquote", "htmlunquote", "websafe",
]
import urllib, time
try: import datetime
except ImportError: pass
import re
import socket
def validip6ad... | |
# -*- coding: utf-8 -*-
# Copyright (C) 2015 Michael Hogg
# This file is part of pyvct - See LICENSE.txt for information on usage and redistribution
import os
from abaqus import session
from abaqusConstants import ELEMENT_NODAL
from cythonMods import createElementMap
import elementTypes as et
import copy
from odbAcc... | |
#!/usr/bin/env python3
"""This module implements finding of Radio Frequency Interference for LOFAR data.
This module is strongly based on pyCRtools findrfi.py by Arthur Corstanje.
However, it has been heavily modified for use with LOFAR-LIM by Brian Hare
"""
from pickle import load
import numpy as np
from matplotl... | |
# Copyright 2012, 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 agr... | |
# Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
import csv
import os
import numpy as np
import PIL.Image
class ObjectType:
Dontcare, Car, Van, Truck, Bus, Pickup, VehicleWithTrailer, SpecialVehicle,\
Person, Person_fa, Person_unsure, People, Cyclist, Tram, Person_Sitting,\
Misc = range(1... | |
#
# Handler library for Linux IaaS
#
# Copyright 2014 Microsoft Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | |
#!/usr/bin/env python
# coding:utf-8
"""
GAEProxyHandler is the handler of http proxy port. default to 8087
if HTTP request:
do_METHOD()
elif HTTPS request:
do_CONNECT()
What is Direct mode:
if user access google site like www.google.com, client.google.com,
we don't need forward re... | |
import argparse
import json
import os
import readchar
import sys
import time
import readline
from subprocess import call, Popen, PIPE
from clint import resources
from clint.textui import puts, colored
targets = []
config_name = ''
# Time to sleep between transitions
TRANSITION_DELAY_TIME = 0.5
NUMBER_ENTRY_EXPIRE_T... | |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
Base class for all drawbot drivers
Author: tennessee
Created on: 2017-03-21
Copyright 2017, Tennessee Carmel-Veilleux.
"""
import threading
import Queue
import logging
import json
import numpy as np
from collections import deque, namedtuple
class DrawbotDriverExcept... | |
from _collections import defaultdict
import datetime
from urllib import urlencode
import dateutil
from django.core.urlresolvers import reverse
import math
from django.db.models.aggregates import Max, Min, Avg, StdDev, Count
import numpy
import operator
import pytz
from corehq.apps.es.forms import FormES
from corehq.app... | |
from unittest import mock
from olympia import amo
from olympia.addons.models import Addon
from olympia.amo import search
from olympia.amo.tests import ESTestCaseWithAddons, TestCase
from olympia.tags.models import Tag
class TestESIndexing(ESTestCaseWithAddons):
# This needs to be in its own class for data isola... | |
import csv
import os
import re
import sys
from national_voter_file.transformers.base import (DATA_DIR,
BasePreparer,
BaseTransformer)
import usaddress
__all__ = ['default_file', 'StatePreparer', 'StateTransformer']
... | |
#!/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... | |
# coding: utf-8
"""
Generated by: https://openapi-generator.tech
"""
from dataclasses import dataclass
import re # noqa: F401
import sys # noqa: F401
import typing
import urllib3
from urllib3._collections import HTTPHeaderDict
from openapi_client import api_client, exceptions
import decimal # noqa: F401
fro... | |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from gym.spaces import Discrete
import numpy as np
from scipy.stats import entropy
import ray
from ray.rllib.policy.policy import Policy
from ray.rllib.policy.sample_batch import SampleBatch
from ray.rllib.mod... | |
#!/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... | |
# Copyright 2010 Jacob Kaplan-Moss
# 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/lice... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.