gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
from sympy.mpmath.libmpf import *
from sympy.mpmath.libelefun import *
from sympy.mpmath import *
import random
import time
import math
import cmath
def mpc_ae(a, b, eps=eps):
res = True
res = res and a.real.ae(b.real, eps)
res = res and a.imag.ae(b.imag, eps)
return res
#-----------------------------... | |
# Added Fortran compiler support to config. Currently useful only for
# try_compile call. try_run works but is untested for most of Fortran
# compilers (they must define linker_exe first).
# Pearu Peterson
from __future__ import division, absolute_import, print_function
import distutils
import os
import signal
import ... | |
###############################################################################
##
## Copyright (c) Crossbar.io Technologies GmbH
##
## 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
##
##... | |
# coding: utf-8
"""
Onshape REST API
The Onshape REST API consumed by all clients. # noqa: E501
The version of the OpenAPI document: 1.113
Contact: [email protected]
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import re # noqa: F401
im... | |
"""
==============================
Compare over-sampling samplers
==============================
The following example attends to make a qualitative comparison between the
different over-sampling algorithms available in the imbalanced-learn package.
"""
# Authors: Guillaume Lemaitre <[email protected]>
# License... | |
import unittest
from graphene.server.server import GrapheneServer
from graphene.query.planner import QueryPlanner
from graphene.storage import (StorageManager, GrapheneStore, Property)
from graphene.expressions import *
from graphene.errors import *
from graphene.traversal import Query
class TestQueryPlanner(unittest... | |
from collections import defaultdict
from dataclasses import dataclass, field
from typing import TYPE_CHECKING, Any, DefaultDict, Dict, List, Set
from datahub.ingestion.source.aws.sagemaker_processors.common import (
SagemakerSourceReport,
)
if TYPE_CHECKING:
from mypy_boto3_sagemaker import SageMakerClient
... | |
#!/usr/env/python
# -*- coding: utf-8 -*-
'''
Library for identifying articles that require side-chaining in a prediction
model's workflow.
Copyright (c) 2017 Morten Wang
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), ... | |
# Copyright (c) 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | |
# 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 required by applicable law or agre... | |
#!/usr/bin/env python
# Copyright 2016 Vimal Manohar
# 2016 Johns Hopkins University (author: Daniel Povey)
# Apache 2.0
from __future__ import print_function
import sys, operator, argparse, os
from collections import defaultdict
# This script reads and writes the 'ctm-edits' file that is
# produced by... | |
import bpy
import bmesh
import shutil
import os
import json
from os import listdir
from os.path import isfile, join
# image = bpy.data.images['mergeatlas']
# width = image.size[0]
# height = image.size[1]
# pixels = image.pixels[:] # create a copy
# # Use the tuple objects, which is way faster than direct access to I... | |
from django.db import models
from django.contrib.auth.models import AbstractUser, User
import hashlib
from django.core.exceptions import ObjectDoesNotExist
from django.core.mail import send_mail
from IESPV.settings import EMAIL_HOST_USER
from datetime import datetime
from six import with_metaclass
from core.models impo... | |
# Copyright (c) 2013 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... | |
# 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 unittest import mock
from zerver.lib.actions import check_add_realm_emoji, do_create_realm, do_create_user
from zerver.lib.test_classes import ZulipTestCase
from zerver.lib.test_helpers import get_test_image_file
from zerver.models import Realm, RealmEmoji, UserProfile, get_realm
class RealmEmojiTest(ZulipTestC... | |
"""Support for Synology NAS Sensors."""
import logging
from datetime import timedelta
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import (
CONF_HOST, CONF_USERNAME, CONF_PASSWORD, CONF_PORT, CONF... | |
#!/usr/bin/env python
# =================================================================================================
# check_CloudEndure_replication.py
#
# Version 2016-02-02
#
# By Stefan Wuensch, Jan. 2016
#
# This script is a Nagios plugin which will query the CloudEndure API for the
# replication / sync s... | |
# -*- coding: utf-8 -*-
from __future__ import with_statement
from cms.api import create_page
from cms.menu import CMSMenu, get_visible_pages
from cms.models import Page
from cms.models.permissionmodels import GlobalPagePermission, PagePermission
from cms.test_utils.fixtures.menus import (MenusFixture, SubMenusFixture,... | |
import numpy as np
import scipy.linalg as slg
from pyscf.lib import logger
def get_tdm_uhf(pymol, C0, C1, s1e=None, r_aos=None, orth=0, thr_zero=1.E-9):
""" C0 and C1 be a list of two numpy arrays, [Caocc, Cbocc]. For RHF, simply replicate the C matrix twice, i.e., np.asarray([Cocc, Cocc])
orth:
0 ... | |
import unittest, random, sys, time, math
sys.path.extend(['.','..','py'])
import h2o, h2o_cmd, h2o_hosts, h2o_browse as h2b, h2o_import as h2i, h2o_glm
BINS = 100
def gen_rand_equation(colCount,
INTCPT_VALUE_MIN, INTCPT_VALUE_MAX,
COEFF_VALUE_MIN, COEFF_VALUE_MAX, SEED):
r1 = random.Random(SEED)
coeffi... | |
import requests
import json
from threading import Thread
def own_thread(func):
"""
Decorator that starts a method or function on its own thread
:param func: function
:return: wrapped function
"""
def wrapped_f(*args, **kwargs):
thread = Thread(target=func, args=args, kwargs=kwargs, da... | |
from __future__ import division, unicode_literals
import os
import re
import sys
import time
from ..compat import compat_str
from ..utils import (
encodeFilename,
decodeArgument,
format_bytes,
timeconvert,
)
class FileDownloader(object):
"""File Downloader class.
File downloader objects are... | |
"""Utilities for input validation"""
# Authors: Olivier Grisel and Gael Varoquaux and others (please update me)
# License: BSD 3
import warnings
import numbers
import numpy as np
from scipy import sparse
from .fixes import safe_copy
def _assert_all_finite(X):
"""Like assert_all_finite, but only for ndarray."""... | |
"""
Starter fabfile for deploying the quantfi_project project.
Change all the things marked CHANGEME. Other things can be left at their
defaults if you are happy with the default layout.
"""
import posixpath
from fabric.api import run, local, env, settings, cd, task
from fabric.contrib.files import exists
from fabri... | |
#!/usr/bin/env python3
# -*- coding: Utf-8 -*-
"""
Swap
A puzzle game with a grid of blocks. Form associations of blocks by
swapping blocks to destroy them!
Modes:
Survival
Battle vs CPU/Human
Stamina (life bar)
Projectile (throw blocks to opponent)
"""
import sys
from random import randrange
from time import t... | |
from matplotlib import colors, gridspec
from astro.plot import puttext, A4LANDSCAPE, axvlines
from astro.constants import Ryd_Ang, eV, Ryd, k
from astro.utilities import indexnear
#pl.cm.register_cmap(name='BRG', cmap=make_cmap(*cvals.brg))
# number of axes to plot
nplot=24
M = loadobj('qg_grid.sav.gz')
#if M.nH[-1]... | |
# Copyright (C) 2016-2018 Cuckoo Foundation.
# This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org
# See the file 'docs/LICENSE' for copying permission.
import logging
import mock
import os
import pytest
import shutil
import tempfile
from cuckoo.apps.import_ import (
identify, import_legacy_analyse... | |
from liblinearutil_xiao import *
from active_learning import *
from check_dataset import *
def get_all_used_docs(fname, labelIndex, parents):
docs = []
n_index = 0
fd = open(fname)
for line in fd:
line = line.strip().split(' ')
id = line[0]
num_label = int(line[1])
labels = line[2:]
labels = [int(l) for ... | |
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
import fu... | |
#!/usr/bin/env python
import splashdown
import dxencode
import sys
import dxpy.exceptions
class Patchdown(splashdown.Splashdown):
post_templates = {
# For looking up previous result files, use wild-cards
# used with old lrnaLaunch script
"tophat_bam": {
"file_format": "bam",
... | |
import re
from mangrove.errors.MangroveException import AnswerNotInListException, AnswerHasTooManyValuesException, AnswerHasNoValuesException, LatitudeNotFloat, LongitudeNotFloat, LatitudeNotInRange, LongitudeNotInRange, RegexMismatchException, ShortCodeRegexMismatchException
from mangrove.utils.types import is_empty
... | |
# -*- coding: utf-8 -*-
"""
Human Resource Management
"""
module = request.controller
resourcename = request.function
if not settings.has_module(module):
raise HTTP(404, body="Module disabled: %s" % module)
s3db.hrm_vars()
# =============================================================================
def ... | |
import json
import os
import unittest
import mock
import numpy as np
import pandas as pd
from ddt import ddt, unpack, data
from .. import io
from .. import models
from . import FIXTURES_DIR
class TestCase(unittest.TestCase):
def get_fixture_data(self, fname):
path = os.path.join(FIXTURES_DIR, fname)
... | |
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | |
"""
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 this ... | |
from functools import partial
from itertools import product
from string import ascii_letters
import warnings
import numpy as np
from pandas import (
Categorical, DataFrame, MultiIndex, Series, TimeGrouper, Timestamp,
date_range, period_range)
import pandas.util.testing as tm
method_blacklist = {
'object... | |
from .core import position_relationship
from .core import messenger
from .core import console_print
from .core import query_exec
from .core import constants as c
from .core import transaction_factory
from .models import Customer, CustomerTransaction, Assistance, Crowd
from .models import CustomerTable, CustomerTransact... | |
#!/usr/bin/env python2.3
# -*- coding: latin-1 -*-
# $Id: edmmotions.py,v 1.1 2006/04/27 14:20:20 twfy-live Exp $
import xml.sax
import datetime
import sys
import urllib
import urlparse
import re
import string
import os
import time
sys.path.append("../pyscraper/")
from resolvemembernames import memberList
class edmL... | |
import base64
import logging
import quopri
import re
import urllib2
from email import message_from_string
from email.utils import parseaddr
from django.conf import settings
from django.core.urlresolvers import reverse
from django.utils import translation
from email_reply_parser import EmailReplyParser
import mkt
fr... | |
from datetime import datetime
import os
try:
import unittest2 as unittest
except:
import unittest
from prisoner.gateway import *
from prisoner import SocialObjects
from prisoner.workflow import PolicyProcessor
from prisoner.workflow.Exceptions import *
"""
This test suite ensures:
- the PolicyProcessor validates X... | |
"""Mean shift clustering algorithm.
Mean shift clustering aims to discover *blobs* in a smooth density of
samples. It is a centroid based algorithm, which works by updating candidates
for centroids to be the mean of the points within a given region. These
candidates are then filtered in a post-processing stage to elim... | |
'''
Created on Jul 1, 2009
This module contains tests for the face recognition algorithms.
@author: bolme
'''
import unittest
import pyvision as pv
import numpy as np
#from optic_flow import *
#from distance import *
#import cv
import os.path
class _TestNormalize(unittest.TestCase):
def setUp(self):
... | |
import os
import unittest
from decimal import Decimal
from django.utils.copycompat import copy
from django.contrib.gis.gdal import DataSource
from django.contrib.gis.tests.utils import mysql
from django.contrib.gis.utils.layermapping import LayerMapping, LayerMapError, InvalidDecimal, MissingForeignKey
from models i... | |
# 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 applicable ... | |
#!/usr/bin/python
import pygame
import sys
from gi.repository import Gtk
from entity import Entity
from bucket import Bucket
from grape import Grape
from background import Background
import random
class grapes:
def __init__(self, debug):
# Set up a clock for managing the frame rate.
self.clock = py... | |
#!/usr/bin/env python3
# Copyright 2015-2016 Open Source Robotics Foundation, 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
#
# Unle... | |
# -*- coding: utf-8 -*-
"""
werkzeug._internal
~~~~~~~~~~~~~~~~~~
This module provides internally used helpers and constants.
:copyright: 2007 Pallets
:license: BSD-3-Clause
"""
import inspect
import logging
import re
import string
from datetime import date
from datetime import datetime
from itert... | |
# -*- coding: utf-8 -*-
"""
.. module:: debooubuntu.py
:platform: Unix
:synopsis: Script for creating bootable debian based systems
"""
import os
import fabric.contrib.files
from fabric.api import task, execute, env, run, sudo
from fabric.utils import puts, warn, error
from fabric.contrib.console import confirm
... | |
#
# pdis.xpath.syntax
#
# Copyright 2004 Helsinki Institute for Information Technology (HIIT)
# and the authors. All rights reserved.
#
# Authors: Ken Rimey <[email protected]>
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "So... | |
from __future__ import absolute_import, unicode_literals
from datetime import datetime
from django.conf import settings
from django.contrib import admin
from django.contrib.admin import helpers
from django.contrib.admin.util import (display_for_field, flatten_fieldsets,
label_for_field, lookup_field, NestedObject... | |
# -*- coding: utf-8 -*-
"""
Created on Wed Aug 10 14:41:26 2016
@author: Stuart
"""
import sys
import os
import os.path
import datetime
import traceback
import Tkinter as tk
import tkFileDialog
import tkMessageBox
from ..update import update
from ..share.share import ShareXPortfolio
from ..share.share_factory impo... | |
from __future__ import division
import math
import os
import matplotlib
from matplotlib import verbose
from matplotlib.cbook import is_string_like, onetrue
from matplotlib import backend_bases
from matplotlib.backend_bases import IdleEvent, cursors
from matplotlib._pylab_helpers import Gcf
from matplotlib.figure impor... | |
# -*- encoding: utf-8 -*-
"""
Disassembly support.
:copyright: (c) 2016 H2O.ai
:license: Apache License Version 2.0 (see LICENSE for details)
"""
from __future__ import absolute_import, division, print_function, unicode_literals
from opcode import * # an undocumented builtin module
import inspect
from h2o.utils.c... | |
# 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... | |
from drawable import Drawable
import ezdxf
from utils import btu
class Symbol(Drawable):
def __init__(self):
super().__init__()
def draw_no_contact(self):
self.add_line((0, 0), (5, 0))
self.add_line((15, 0), (20, 0))
self.add_line((5, 10), (5, -10))
self.add_line(... | |
#!/usr/bin/env python
#
# Copyright 2016 Roanuz Softwares Private 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 ... | |
#!/usr/bin/env python
# Copyright 2015 The PDFium 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 distutils.spawn
import itertools
import os
import shutil
import sys
# pylint: disable=relative-import
import common
class PathM... | |
# Copyright (c) 2014 Evalf
#
# 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, publish, distribute, s... | |
from common_fixtures import * # NOQA
import copy
from cattle import ApiError
from test_authorization import service_client # NOQA
from test_machines import machine_context
from test_svc_discovery import _validate_compose_instance_start
_ = machine_context # Needed just to avoid a pep-8 quirk
@pytest.fixture()
de... | |
"""
SleekXMPP: The Sleek XMPP Library
Copyright (C) 2010 Nathanael C. Fritz
This file is part of SleekXMPP.
See the file LICENSE for copying permission.
"""
from sleekxmpp.xmlstream import ElementBase
from sleekxmpp.plugins import xep_0082
class Geoloc(ElementBase):
"""
XMPP's <geoloc> sta... | |
from __future__ import absolute_import, unicode_literals
import django
from django.db import transaction
from django.db.models.query import QuerySet
from django.db.models.query_utils import QueryWrapper
from django.db.models.sql.constants import SINGLE
from django.db.models.sql.datastructures import EmptyResultSet
fro... | |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""An extensible ASCII table reader and writer.
ui.py:
Provides the main user functions for reading and writing tables.
:Copyright: Smithsonian Astrophysical Observatory (2010)
:Author: Tom Aldcroft ([email protected])
"""
import re
impor... | |
'''
TODO:
. CS (chip select) equivalent when write to memory mapped IO address
'''
'''----------------------------- Imports -----------------------------'''
# Built ins
import math
# Hack computer
from ._x__components import *
import Assembler.disassembler as dis
'''------------------------------- CPU ---------... | |
# Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.
import os
import re
import tempfile
import random
import flask
import werkzeug.exceptions
import numpy as np
from google.protobuf import text_format
try:
import caffe_pb2
except ImportError:
# See issue #32
from caffe.proto import caffe_... | |
# Author: Roman Goj <[email protected]>
#
# License: BSD (3-clause)
import copy as cp
import numpy as np
from scipy.fftpack import fftfreq
from ..io.pick import pick_types
from ..utils import logger, verbose, warn
from ..time_frequency.multitaper import (dpss_windows, _mt_spectra,
... | |
import subprocess
import io
import os
import tempfile
import glob
import json
import logging
import sys
import requests
from . import docker
from .process import get_feature, empty_subtree, stageFiles
from .errors import WorkflowException
import shutil
import stat
import re
import shellescape
import string
from .docker... | |
import six
import hashlib
import random
from django.conf import settings
from django.contrib.auth import models as auth_models
from django.core.urlresolvers import reverse
from django.db import models
from django.template import Template, Context, TemplateDoesNotExist
from django.template.loader import get_template
fr... | |
# -*- 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
#... | |
#
# Copyright (c) 2017 Orange.
#
# 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... | |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | |
# 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.
"""This script runs power measurements for browsers using Intel Power Gadget.
This script only works on Windows/Mac with Intel CPU. Intel Power Gadget needs
... | |
# coding: utf-8
"""
Copyright 2015 SmartBear Software
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... | |
# -*- coding: utf-8 -*-
"""
molvs.charge
~~~~~~~~~~~~
This module implements tools for manipulating charges on molecules. In particular, :class:`~molvs.charge.Reionizer`,
which competitively reionizes acids such that the strongest acids ionize first, and :class:`~molvs.charge.Uncharger`,
which attempts to neutralize i... | |
from plenum.common.constants import NAME, NONCE
from plenum.common.signer_did import DidIdentity
from plenum.common.types import f
from plenum.common.util import prettyDateDifference, friendlyToRaw
from plenum.common.verifier import DidVerifier
from anoncreds.protocol.types import AvailableClaim
from indy_common.exce... | |
# -*- coding: utf-8 -*-
import logging
import pprint
import re
from cssselect import HTMLTranslator
import lxml.html
from lxml.html.clean import Cleaner
logger = logging.getLogger(__name__)
class Parser():
"""Default Parse"""
no_results_selector = []
effective_query_selector = []
num_results_searc... | |
# 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... | |
# Copyright 2022 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
import dataclasses
import re
from dataclasses import dataclass
from typing import Iterable
from urllib.parse import quote_plus as url_quote_plus
from p... | |
# -*- coding: utf-8 -*-
#!/usr/bin/python
from sklearn.linear_model import LogisticRegression
from sklearn.grid_search import GridSearchCV
import mord
def fit_classifier_with_crossvalidation(X, y, basemod, cv, param_grid,
scoring='r2', verbose=False):
"""Fit a classifier ... | |
"""Tests for gree component."""
from datetime import timedelta
from greeclimate.device import HorizontalSwing, VerticalSwing
from greeclimate.exceptions import DeviceNotBoundError, DeviceTimeoutError
import pytest
from homeassistant.components.climate.const import (
ATTR_FAN_MODE,
ATTR_HVAC_MODE,
ATTR_PRE... | |
"""
Here is probably the place to write the docs, since the test-cases
show how the type behave.
Later...
"""
from ctypes import *
import sys, unittest
try:
WINFUNCTYPE
except NameError:
# fake to enable this test on Linux
WINFUNCTYPE = CFUNCTYPE
import _ctypes_test
dll = CDLL(_ctypes_test.__file__)
if ... | |
from __future__ import print_function, unicode_literals
from future.builtins import input, int
from optparse import make_option
try:
from urllib.parse import urlparse
except:
from urlparse import urlparse
from django.contrib.auth import get_user_model
from django.contrib.redirects.models import Redirect
from d... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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.apach... | |
# Copyright (C) 2014 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | |
# coding=utf-8
import os
import sys
import time
import logging
import traceback
import configobj
import inspect
# Path Fix
sys.path.append(
os.path.abspath(
os.path.join(
os.path.dirname(__file__), "../")))
import diamond
from diamond.collector import Collector
from diamond.handler.Handler i... | |
import codecs
import io
import csv
import datetime
import decimal
import hashlib
import os
import random
import re
import uuid
import binascii
import pystache
import pytz
import simplejson
import sqlparse
from flask import current_app
from funcy import select_values
from redash import settings
from sqlalchemy.orm.quer... | |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | |
#!/usr/bin/env python2
# 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 "Lice... | |
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
This module provides support for Twisted to interact with CoreFoundation
CFRunLoops. This includes Cocoa's NSRunLoop.
In order to use this support, simply do the following::
| from twisted.internet import cfreactor
| cf... | |
# ===============================================================================
# Copyright 2013 Jake Ross
#
# 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... | |
import struct
import glob
from warnings import warn
from pcapdump import *
from daintree import *
from pcapdlt import *
from kbutils import * #provides serial, usb, USBVER
from zigbeedecode import * #would like to import only within killerbee class
from dot154decode import * #would like to import only within kil... | |
import calendar
import datetime
from decimal import Decimal
from typing import Any, Dict, List, Optional, Tuple
import swagger_client as saltedge_client
from budget.models import Account, Category, Connection, Transaction
from django.db.models import QuerySet, Sum
from django.http.request import QueryDict
from users.m... | |
# ----------------------------------------------------------------------------
# Copyright (c) 2017-, labman development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# -----------------------------------------------------... | |
# Copyright (C) 2006-2007 Robey Pointer <[email protected]>
#
# This file is part of paramiko.
#
# Paramiko is free software; you can redistribute it and/or modify it under the
# terms of the GNU Lesser General Public License as published by the Free
# Software Foundation; either version 2.1 of the License, or (a... | |
"""
precision_four_panel.py
-----------------------
Plot a Figueira et al. (2016) Figure 1 like plot.
"""
import argparse
import sys
from os.path import join
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from eniric import config
from eniric.utilities import rv_cumulative, ... | |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | |
"""
Tests for chimpy. Run them with noserunner
You need to activate groups in the Mailchimp web UI before running tests:
* Browse to http://admin.mailchimp.com
* List setting -> Groups for segmentation
* Check "add groups to my list"
"""
import os
import pprint
import operator
import random
import md5
import da... | |
from __future__ import absolute_import
from django.contrib.auth.models import AnonymousUser
from sentry.models import (
ApiKey,
AuditLogEntryEvent,
DeletedOrganization,
DeletedTeam,
DeletedProject,
Organization,
OrganizationStatus,
)
from sentry.testutils import TestCase
from sentry.utils.... | |
"""
Link checker for ANDS DOIs.
"""
"""
Data structures used throughout this module:
client_list: dict (despite the name, grr)
key: int: client_id
value: tuple: The row the doi_client table
that has client_id as its key.
doi_list: list
element: tuple: a row from the doi_object table.
testing_array: dict... | |
import re
from django.utils.translation import ugettext_lazy as _
from .base import (
ADDON_DICT, ADDON_EXTENSION, ADDON_LPAPP, ADDON_PERSONA, ADDON_PLUGIN,
ADDON_SEARCH, ADDON_STATICTHEME, ADDON_THEME)
from olympia.versions.compare import version_int as vint
class App(object):
@classmethod
def mat... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.