text stringlengths 12 6.59M |
|---|
"""Tree output plugin
Idea copied from libsmi.
"""
import optparse
import sys
import re
from pyang import plugin
from pyang import statements
def pyang_plugin_init():
plugin.register_plugin(TreePlugin())
class TreePlugin(plugin.PyangPlugin):
def __init__(self):
plugin.PyangPlugin.__init__(self, 'tr... |
from pyardrone import at
from pyardrone.at import ATClient
from pyardrone.navdata import NavDataClient
from pyardrone.navdata.states import DroneState
from pyardrone.utils import logging
from pyardrone.abc import BaseClient
# import VideoMixin only if opencv is available
try:
import cv2
except ImportError:
cla... |
# -*- coding: utf-8 -*-
import requests
import re
class BacklogClient(object):
def __init__(self, space_name, api_key):
self.space_name = space_name
self.api_key = api_key
## auto detetcion of space location
self.endpoint = BacklogClient._detect_endpoint(space_name, api_key)
... |
import sys
import numpy as np
import matplotlib.pyplot as plt
import _pybinding
from .utils import cpuinfo, progressbar
from .results import Sweep
__all__ = ['num_cores', 'sweep']
num_cores = cpuinfo.physical_core_count()
def _plain_sweep(variables, produce, report, num_threads=num_cores, queue_size=num_cores):
... |
#!/usr/bin/env python
try:
from . import pychrm
except:
import pychrm
# FeatureRegistration.py is where the SWIG wrapped objects get put into a dict
# for use in signature calculation
try:
from . import FeatureRegistration
except:
import FeatureRegistration
# FeatureNameMap.py contains mapping from old style na... |
from pycket import values
from pycket import vector
from pycket.prims import prim_env
from pycket.error import SchemeException
from pycket.cont import Cont
from rpython.rlib import jit, debug
from small_list import inline_small_list
class Env(object):
_immutable_fields_ = ["toplevel_env"]
... |
from pycket.AST import AST
from pycket import values
from pycket import vector
from pycket.prims.expose import prim_env, make_call_method
from pycket.error import SchemeException
from pycket.cont import Cont, nil_continuation, label
from py... |
import collections
import pyconll._parser
from pyconll.unit import Sentence
class Conll:
"""
The abstraction for a CoNLL-U file. A CoNLL-U file is more or less just a
collection of sentences in order. These sentences can be accessed by
sentence id or by numeric index. Note that sentences must be sepa... |
from itertools import izip
from bisect import bisect_right
import numpy as np
from pydigree.exceptions import NotMeaningfulError
from pydigree.cyfuncs import fastfirstitem
from pydigree.io.genomesimla import read_gs_chromosome_template
from pydigree.common import all_same_type
class AlleleContainer(object):
" ... |
import json
import logging
import os
import re
import sys
import uuid
import importlib
from io import StringIO
from django.shortcuts import render
from django.views.generic import View
from django.views.decorators.csrf import csrf_exempt
from django.utils.decorators import method_decorator
from django.db import transac... |
"""
:mod:`disco.util` --- Helper functions
======================================
This module provides utility functions that are mostly used by Disco
internally.
The :func:`external` function below comes in handy if you use the Disco
external interface.
"""
import os
import cPickle, marshal, sys, time, traceback
fr... |
#!/usr/bin/env python
# vim: set sw=4 et:
import logging
import json
import time
import threading
import kombu
import socket
from brozzler.browser import BrowserPool, BrowsingException
import brozzler
import urlcanon
class AmqpBrowserController:
"""
Consumes amqp messages representing requests to browse urls,... |
import sys, socket, errno
from struct import pack
from pyed.event import event
class tcpconnection(object):
OK = 0
ERROR = -1
AGAIN = -2
def __init__(self, sock, srvconf):
self.__sock = sock
self.__blocking = srvconf["blocking"]
self.__recvbuf = srvconf["recvbuf"]
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2008 Adriano Monteiro Marques.
#
# Author: Bartosz SKOWRON <getxsick at gmail dot com>
#
# This library 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 Softwa... |
# Copyright 2012-2015, Andrey Kislyuk and argcomplete contributors.
# Licensed under the Apache License. See https://github.com/kislyuk/argcomplete for more info.
from __future__ import absolute_import, division, print_function, unicode_literals
import os, sys, argparse, contextlib
from . import completers, my_shlex ... |
"""
The :mod:`pyeda.boolalg.expr` module implements
Boolean functions represented as expressions.
Interface Functions:
* :func:`exprvar`
* :func:`expr`
* :func:`ast2expr`
* :func:`expr2dimacscnf`
* :func:`upoint2exprpoint`
* :func:`Not`
* :func:`Or`
* :func:`And`
* :func:`Nor`
* :func:`Nand`
* :func:`Xor`
* :func:`... |
import logging
from calendar import timegm
from flask import current_app, render_template, \
request, flash, url_for, redirect
from flask.ext.login import login_required, current_user
from flask.ext.babel import gettext
import conf
from web.lib.utils import redirect_url
from web import utils
from web.lib.view... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2011 Yann GUIBET <yannguibet@gmail.com>
# See LICENSE for details.
import sys
import ctypes
import ctypes.util
OpenSSL = None
class CipherName:
def __init__(self, name, pointer, blocksize):
self._name = name
self._pointer = pointer... |
# Ariane CLI Python 3
# Ariane Core Mapping API
#
# Copyright (C) 2015 echinopsii
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) ... |
VERSION = (0, 9, 2)
__version__ = ".".join([str(x) for x in VERSION])
|
from __future__ import unicode_literals
from django.db import models
from django.core.validators import RegexValidator
from django_markdown.models import MarkdownField
from django.conf import settings
from easy_thumbnails.fields import ThumbnailerImageField
@python_2_unicode_compatible
class News(models.Model):
C... |
"""PyFlyCap2 Library
====================
Project that provides python bindings for the FlyCapture2 library
by Point Gray.
"""
__version__ = '0.3.1.dev0'
import sys
import os
from os.path import join, isdir
__all__ = ('dep_bins', )
_bins = join(sys.prefix, 'share', 'pyflycap2', 'flycapture2', 'bin')
... |
#
# Copyright 2015 Quantopian, 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 wr... |
import copy
import math
import operator
import sys
import typing as t
import warnings
from functools import partial
from functools import update_wrapper
from .wsgi import ClosingIterator
if t.TYPE_CHECKING:
from wsgiref.types import WSGIApplication
try:
from greenlet import getcurrent as _get_ident
except Im... |
# !/usr/bin/env python
# -*- coding: utf-8 -*-
import uuid
import numpy as np
# import matplotlib.pyplot as plt
from pydatset.cifar10 import get_CIFAR10_data
from pydatset.data_augmentation import (random_flips,
random_crops)
from resnet import ResNet
from solver import Solver a... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""Utility Classes and Functions
author: Liangjun Zhu
changlog: 12-04-12 jz - origin version
16-07-01 lj - reorganized for pygeoc
17-06-25 lj - check by pylint and reformat by Google style
"""
import argparse
import glob
import os
impo... |
# ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistribu... |
from ..overrides import override
from ..importer import modules
from gi.repository import GObject
Accounts = modules['Accounts']._introspection_module
__all__ = []
def _get_string(self, key, default_value=None):
value = GObject.Value()
value.init(GObject.TYPE_STRING)
if self.get_value(key, value) != Acco... |
# -*- coding: utf-8 -*-
from collections import Counter
import numpy as np
from scipy import sparse
from pygsp import utils
from . import fourier, difference # prevent circular import in Python < 3.5
class Graph(fourier.GraphFourier, difference.GraphDifference):
r"""Base graph class.
* Provide a common i... |
# -*- coding: utf-8 -*-
import warnings
from itertools import groupby
from collections import Counter
import numpy as np
from scipy import sparse
from pygsp import utils
from . import fourier, difference # prevent circular import in Python < 3.5
class Graph(fourier.GraphFourier, difference.GraphDifference):
r... |
import numpy as np
import h5py
CHUNK_0_MAX=32
CHUNK_1_MAX=128
class Element(object):
def append(self, *args, **kwargs):
raise NotImplementedError
class FixedElement(h5py.Dataset, Element):
def __init__(self, loc, name, **kwargs):
if name in loc:
d = loc[name]
else:
... |
#!/usr/bin/env python
"""Command line utility for querying the Logitech Harmony."""
from __future__ import print_function
import argparse
import logging
import json
import sys
from pyharmony import auth
from pyharmony import client as harmony_client
import code
class EmbeddedConsole(code.InteractiveConsole):
def... |
# -*- coding: utf-8 -*-
"""Plotting utility for generating maps, windroses and everything else under
the sun.
This module provides a wrapper around `Basemap` and `windrose` packages. It
tries to be general so to work for others, but may contain some unfortunate
hard coded values. Bad daryl!
Example:
Here is a b... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
from astropy.io import fits as pf
from propobject import BaseObject
__all__ = ["load_cube","load_spectrum"]
def load_cube(filename,**kwargs):
""" Load a Cube from the given filename
Returns
-------
Cube
"""
return Cube(... |
#!/usr/bin/env python3
import os
import sys
import filecmp
import io
import re
import shutil
import subprocess
from collections import defaultdict
import stat
import zlib
import utils
import aYaml
from .instlInstanceBase import InstlInstanceBase
from .batchAccumulator import BatchAccumulator
from configVar import va... |
__version_info__ = ('1', '11', '1')
__version__ = '.'.join(__version_info__)
from .wrappers import (ObjectProxy, CallableObjectProxy, FunctionWrapper,
BoundFunctionWrapper, WeakFunctionProxy, PartialCallableObjectProxy,
resolve_path, apply_patch, wrap_object, wrap_object_attribute,
function_wra... |
#!/usr/bin/env python3.6
import logging
log = logging.getLogger()
import os
import sys
import traceback
import filecmp
import multiprocessing as mp
import time
import datetime
import re
import redis
import boto3
import threading
import utils
import aYaml
from .instlInstanceBase import InstlInstanceBase
from pybatch ... |
__version_info__ = ('1', '11', '0')
__version__ = '.'.join(__version_info__)
from .wrappers import (ObjectProxy, CallableObjectProxy, FunctionWrapper,
BoundFunctionWrapper, WeakFunctionProxy, resolve_path, apply_patch,
wrap_object, wrap_object_attribute, function_wrapper,
wrap_function_wrapper,... |
#!/usr/bin/env python2.7
from __future__ import print_function
import filecmp
import subprocess
import StringIO
import boto
import rsa
from instlException import *
from pyinstl.log_utils import func_log_wrapper
from pyinstl.utils import *
from aYaml.augmentedYaml import writeAsYaml, YamlDumpDocWrap
from instlInstan... |
# Copyright 2013 Mike Wakerly <opensource@hoho.com>
#
# This file is part of the Pykeg package of the Kegbot project.
# For more information on Pykeg or Kegbot, see http://kegbot.org/
#
# Pykeg is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by... |
# Copyright (c) 2015, Open Source Robotics Foundation, Inc.
# Copyright (c) 2013, Willow Garage, 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 ... |
#!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import copy
import gyp.input
import optparse
import os.path
import re
import shlex
import sys
import traceback
from gyp.common import GypErr... |
# Copyright (c) 2015, Open Source Robotics Foundation, Inc.
# Copyright (c) 2013, Willow Garage, 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 ... |
"""
This module provides a general "estimate" function and EstimationObj class for
pylogit's logit-type models.
"""
import sys
import time
import numpy as np
from scipy.optimize import minimize
import choice_calcs as cc
from choice_calcs import create_matrix_block_indices
from choice_tools import ensure_ridge_is_scala... |
"""
Open compressed files transparently.
"""
from __future__ import print_function, division, absolute_import
import gzip
import sys
import io
import os
import time
import signal
from subprocess import Popen, PIPE
from ._version import version as __version__
_PY3 = sys.version > '3'
if not _PY3:
import bz2file... |
"""Base backend for traces
See the docstring for pymc.backends for more information (includng
creating custom backends).
"""
import numpy as np
from ..model import modelcontext
class BaseTrace(object):
"""Base trace object
Parameters
----------
name : str
Name of backend
model : Model
... |
"""
Functions for creating UI elements, as well as their class counterparts.
"""
import re, sys, functools, traceback
import pymel.util as _util
import pymel.internal.pmcmds as cmds
import pymel.internal.factories as _factories
import pymel.internal as _internal
import pymel.versions as _versions
from language impor... |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... |
import sys
from . import _instrument
from . import _oscilloscope
from . import _siggen
from . import _phasemeter
from . import _specan
from . import _lockinamp
from . import _datalogger
from . import _stream_instrument
from . import _frame_instrument
from . import _stream_handler
''' Preferred import point. Aggregate... |
class Semigroup:
"""
In mathematics, a semigroup is an algebraic structure
consisting of a set together with an associative binary operation.
A semigroup generalizes a monoid in that there might not exist an identity element.
It also (originally) generalized a group (a monoid with all inverses)
... |
import logging
import os.path as op
import shutil
from collections import OrderedDict, defaultdict
import pandas as pd
import numpy as np
import requests
from Bio.PDB.PDBExceptions import PDBConstructionException
from Bio.PDB.PDBExceptions import PDBException
from Bio.Seq import Seq
from cobra.core import DictList
fro... |
# Copyright 2009 10gen, 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, soft... |
import logging
import time
__version__ = '0.2.7'
class Server():
"""Store configuration about one server instance."""
def __init__(self, port, password, method, host='0.0.0.0', timeout=180,
udp=True, fast_open=True):
self._traffic = 0
self._is_running = False
self.po... |
from ._compat import PY2, text_type, long_type, JYTHON, IRONPYTHON
import sys
import binascii
import datetime
from decimal import Decimal
import re
import time
from .constants import FIELD_TYPE, FLAG
from .charset import charset_by_id, charset_to_encoding
ESCAPE_REGEX = re.compile(r"[\0\n\r\032\'\"\\]")
ESCAPE_MAP ... |
#!/usr/bin/env python3.6
import rdflib
from rdflib.extras import infixowl
from IPython import embed
from pyontutils.scigraph_client import Graph, Vocabulary
from pyontutils.utils import makeGraph, makePrefixes
from pyontutils.ilx_utils import ILXREPLACE
__all__ = [
'AND',
'OR',
'getPhenotypePredicates',
... |
#!/usr/bin/env python3
import tempfile
from pyontutils.core import auth
__doc__ = f"""Use SciGraph to load an ontology from a loacal git repository.
Remote imports are replaced with local imports.
NIF -> http://ontology.neuinfo.org/NIF
Usage:
ontload graph [options] <repo> <remote_base>
ontload config [options... |
from hashlib import sha256, new
from binascii import hexlify, unhexlify
from base58 import b58encode, b58decode
from secp256k1 import PrivateKey
from . import networks
class Kutil:
'''pubkey/privkey operations'''
def __init__(self, wif=None, privkey=None, network=None, seed=None):
'''wif=<WIF> import ... |
# Pyperclip
# A cross-platform clipboard module for Python. (only handles plain text for now)
# By Al Sweigart al@inventwithpython.com
# BSD License
# Usage:
# import pyperclip
# pyperclip.copy('The text to be copied to the clipboard.')
# spam = pyperclip.paste()
# On Windows, no additional modules are needed.... |
"""
This package is an abstraction layer over the various different Qt bindings
for python (PyQt5, PyQt4 and PySide).
It mimics the structure of PyQt5 but let you choose the binding to use through
the ``QT_API`` environment variable.
PyQt5
~~~~~
For pyqt5, you don't have to set anything
>>>from pyqode.qt import QtG... |
# This Python module is part of the PyRate software package.
#
# Copyright 2017 Geoscience Australia
#
# 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/... |
# This Python module is part of the PyRate software package.
#
# Copyright 2017 Geoscience Australia
#
# 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/... |
# -*- coding: utf-8 -*-
from collections import namedtuple
import struct
from starbound import sbon
# Override range with xrange when running Python 2.x.
try:
range = xrange
except:
pass
HEADER = '>8sQ'
HEADER_SIZE = struct.calcsize(HEADER)
IndexEntry = namedtuple('IndexEntry', ['offset', 'length'])
c... |
"""
Luigi tasks to convert GAMMA headers to ESRI's BIL format.
GAMMA headers need to be translated into a GDAL recognisable format for use in
PyRate. This module translates GAMMA headers into into ESRI's BIL format,
allowing GDAL to access the raster data
The types of GAMMA files converted by PyRate are:
- DEM: with... |
__version__ = "0.8.4"
|
#!/usr/bin/env python
##############################################################
# preparation of srtm data for use in gamma
# module of software pyroSAR
# John Truckenbrodt 2014-18
##############################################################
"""
A collection of functions to handle digital elevation models in Ga... |
from starlette.datastructures import MutableHeaders
from starlette.types import Receive, Send
import json
import typing
StrPairs = typing.Sequence[typing.Tuple[str, str]]
StrDict = typing.Mapping[str, str]
class Response:
media_type = None
charset = "utf-8"
def __init__(
self,
content: t... |
###############################################################################
# universal core routines for processing SAR images with GAMMA
# Copyright (c) 2014-2022, the pyroSAR Developers.
# This file is part of the pyroSAR Project. It is subject to the
# license terms in the LICENSE.txt file found in the top-le... |
#!/usr/bin/env python
##############################################################
# universal core routines for processing SAR images with GAMMA
# John Truckenbrodt 2014-2019
##############################################################
"""
This module is intended as a set of generalized processing routines for mo... |
#!/usr/bin/env python
# Full license can be found in License.md
# Full author list can be found in .zenodo.json file
# DOI:10.5281/zenodo.1199703
# ----------------------------------------------------------------------------
"""
Coordinate transformation functions for pysat
"""
import datetime as dt
import numpy as np... |
# MIB modules loader
import os
from pysnmp.smi import error
try:
import pysnmp_mibs
except ImportError:
pysnmp_mibs = None
from pysnmp import debug
class MibBuilder:
def __init__(self):
self.lastBuildId = self._autoName = 0L
paths = (
os.path.join(os.path.split(error.__file__)[0... |
# Copyright 2019 Ram Rachum and collaborators.
# This program is distributed under the MIT license.
'''
PySnooper - Never use print for debugging again
Usage:
import pysnooper
@pysnooper.snoop()
def your_function(x):
...
A log will be written to stderr showing the lines executed and variables
ch... |
# Copyright 2014 Dan Kilman
#
# 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, softw... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2011 by Florian Mounier, Kozea
# This file is part of pystil, licensed under a 3-clause BSD license.
from datetime import datetime, date
from time import mktime
from flask import jsonify
from multicorn.requests import CONTEXT as c
from pystil.corns import V... |
from __future__ import print_function, division, unicode_literals
import re
from numbers import Number
from .formatbase import FormatBase
from .ssaevent import SSAEvent
from .ssastyle import SSAStyle
from .common import text_type, Color, PY3, binary_string_type
from .time import make_time, ms_to_times, timestamp_to_ms,... |
# Copyright (C) 2012 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... |
# -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.base.exchange import Exchange
import json
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import AuthenticationE... |
"""
This is a bottom-up chart parser for a fragment of English.
It uses the active chart datastructure. The design is based
on Steve Isard's LIB CHART, a teaching tool (written in 1983) that
comes with the wonderful Poplog AI development environment.
References
----------
The original LIB CHART [1]_ and the Poplog w... |
#!/usr/bin/env python
# Copyright 2016 University of Chicago
# Licensed under the APL 2.0 license
import argparse
import os
import re
import shutil
import subprocess
import sys
import time
import psycopg2
import fsurfer
import fsurfer.helpers
import fsurfer.log
PARAM_FILE_LOCATION = "/etc/freesurfer/db_info"
VERSIO... |
from agnostic import ticks_ms
story = None
signature = "engine, story, box, node, card, sack"
def loadStory(storyIdString):
storyModulePath = "stories." + storyIdString
print("Loading story from " + storyModulePath)
loaded = __import__(storyModulePath)
module = getattr(loaded, storyIdString)
retu... |
##
## Author(s):
## - Cedric GESTES <gestes@aldebaran-robotics.com>
##
## Copyright (C) 2009, 2010, 2011 Aldebaran Robotics
##
import os
import glob
import platform
import subprocess
import logging
import qitools.configstore
import qitools.qiworktree
import qibuild
from qibuild.project import Project
import q... |
"""
spec_simple.py - A library of functions to do various basic spectroscopy
processing and plotting operations
Classes and their most useful methods (UNDER CONSTRUCTION, BUT GETTING THERE.)
Spec2d
display_spec
spatial_profile
find_and_trace
extract
Spec1d
plot
smooth_boxcar
plo... |
# BSD Licence
# Copyright (c) 2011, Science & Technology Facilities Council (STFC)
# All rights reserved.
#
# See the LICENSE file in the source distribution of this software for
# the full license text.
import os, sys
import stat
import datetime
import re
import itertools
from drslib.cmip5 import make_translator
fro... |
# Copyright (c) 2015 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
from UM.Tool import Tool
from UM.Event import Event, MouseEvent, KeyEvent
from UM.Math.Plane import Plane
from UM.Math.Vector import Vector
from UM.Math.Float import Float
from UM.Operations.TranslateOperation import T... |
#!/usr/bin/env python
"""
Test driver
Runs off plain text files, similar to how PHP's test harness works
"""
import os
import glob
from libinjection import *
from words import *
print version()
def print_token_string(tok):
"""
returns the value of token, handling opening and closing quote characters
"""
... |
# (C) Datadog, Inc. 2019-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
from __future__ import division
from itertools import chain
from time import time as timestamp
import ibm_db
from datadog_checks.base import AgentCheck, is_affirmative
from datadog_checks.base.utils.con... |
"""python wrapper for the duck duck go zero-click api"""
import urllib
import urllib2
import json as jsonlib
def search(query, **kwargs):
useragent = 'py-ddg'
params = {
'q': query,
'format': 'json',
'pretty': '1',
'no_redirect': '1',
'no_html': '1',
'skip_disa... |
#!/usr/bin/env python
# coding: utf-8 -*-
# (c) 2016, Ariel Opincaru <aopincar@redhat.com>
#
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option... |
from match_images import project_to_header,match_fits,register_fits
from fits_overlap import fits_overlap,header_overlap
from hcongrid import hcongrid,zoom_fits
|
import os,sys,django
sys.path.append(os.path.dirname(os.path.abspath('.')))
os.environ["DJANGO_SETTINGS_MODULE"] = 'skill_huddle.settings'
django.setup()
from sh_app.models import SH_User,League,Suggestion,Huddle
from django.contrib.auth.models import User
from django_countries import countries
from localflavor.us.us... |
# import_export_google_civic/controllers.py
# Brought to you by We Vote. Be good.
# Complete description of all Google Civic fields:
# https://developers.google.com/resources/api-libraries/documentation/civicinfo/v2/python/latest/index.html
# voterInfoQuery Details:
# https://developers.google.com/
# resources/api-li... |
# -*- Coding: utf-8 -*-
import websocket
import urllib2
import time
import hashlib
import random
import re
import json
import logging
import threading
logger = logging.getLogger("turntable-api")
class Bot:
def __init__(self, auth, user_id, room_id):
self.auth = auth
self.userId =... |
#!/usr/bin/env python
#
# Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
# Copyright (c) 2013 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://... |
# This file is a minimal clang-include-fixer vim-integration. To install:
# - Change 'binary' if clang-include-fixer is not on the path (see below).
# - Add to your .vimrc:
#
# noremap <leader>cf :pyf path/to/llvm/source/tools/clang/tools/extra/include-fixer/tool/clang-include-fixer.py<cr>
#
# This enables clang-incl... |
import unittest
from django.test import Client
class TestServerAvailability(unittest.TestCase):
def setUp(self):
self.Client = Client()
def testServer(self):
response = self.Client.get('/weather/')
self.assertEqual(response.status_code, 200)
def testWeather(self):
respon... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is subject to the terms and conditions defined in
# file 'LICENSE.md', which is part of this source code package.
#
from kubernetes.K8sObject import K8sObject
from kubernetes.K8sContainer import K8sContainer
from kubernetes.models.v2alpha1.CronJob import Cro... |
import numpy as np
from ..core import CatalogueManager
from ..core.utils import *
from ..core.controllers import DeviceEvent, Key
from ..components import InputComponent
from ..model import Actions
import threading
class InputManager(object):
""" Input Worker Class
This class will manage all the events sent b... |
from __future__ import print_function, absolute_import
import numpy as np
from PyQt4.Qt import Qt
from PyQt4.QtCore import QLineF, QPointF, QRectF
from PyQt4.QtGui import QGraphicsEllipseItem, QGraphicsLineItem, \
QGraphicsPathItem, QPainterPath, QGraphicsPixmapItem, \
QGraphicsSimpleTextItem, QGraphicsItem, ... |
# coding: utf-8
"""Main stb-tester python module. Intended to be used with `stbt run`.
See `man stbt` and http://stb-tester.com for documentation.
Copyright 2012-2013 YouView TV Ltd and contributors.
Copyright 2013-2018 stb-tester.com Ltd.
License: LGPL v2.1 or (at your option) any later version (see
https://github.c... |
"""
Copyright 2014 Google Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or ... |
# Copyright 2020 Google LLC, Derek Liu
#
# 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 i... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.