gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
#!/usr/bin/python
# (c) 2018 Piotr Olczak <piotr.olczak@redhat.com>
# (c) 2018-2019, NetApp, Inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '... | |
# -*- coding: utf-8 -*-
#
# tree.py
#
# (c) D.C.-G. 2014
#
# Tree widget for albow
#
from albow.widget import Widget
from albow.menu import Menu
from albow.fields import IntField, FloatField, TextFieldWrapped
from albow.controls import CheckBox, AttrRef, Label, Button
from albow.dialogs import ask, alert, input_text_bu... | |
# 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://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Description: add work hours
'''
#import sys
from core.people.person import Profile, Session, ProfileTimesheet
from core.utils.sys.report import report_bug
#from core.config import settings
from config.settings import logger
import datetime
#import zmq
class Reaction... | |
# Copyright 2015, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complianc... | |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
"""
Test for Nest sensors platform for the Smart Device Management API.
These tests fake out the subscriber/devicemanager, and are not using a real
pubsub subscriber.
"""
from google_nest_sdm.device import Device
from google_nest_sdm.event import EventMessage
from homeassistant.components.sensor import ATTR_STATE_CL... | |
from datetime import (
datetime,
timedelta,
)
import operator
import numpy as np
import pytest
import pytz
from pandas._libs.tslibs import iNaT
from pandas.core.dtypes.common import is_datetime64_any_dtype
from pandas import (
DatetimeIndex,
DatetimeTZDtype,
Index,
NaT,
Period,
Serie... | |
#!/usr/bin/env python3
# Copyright (c) 2015-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test node responses to invalid network messages."""
import asyncio
import struct
import sys
from test_... | |
# 6.00 Problem Set 8
#
# Intelligent Course Advisor
#
# Name: Felipo Soranz
# Time:
# 18:18 started
# 18:24 problem 1
# 19:00 problem 2
# 19:17 problem 3
import time
SUBJECT_FILENAME = "subjects.txt"
VALUE, WORK = 0, 1
#
# Problem 1: Building A Subject Dictionary
#
def loadSubjects(filename):
"""
Returns ... | |
"""
Testing for the tree module (sklearn.tree).
"""
import pickle
from functools import partial
from itertools import product
import platform
import numpy as np
from scipy.sparse import csc_matrix
from scipy.sparse import csr_matrix
from scipy.sparse import coo_matrix
from sklearn.random_projection import sparse_rand... | |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
Copyright (c) 2014, Kersten Doering <kersten.doering@gmail.com>, Christian Senger <der.senger@googlemail.com>
"""
import xappy
import sys
from sqlalchemy import *
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
from... | |
#!/usr/bin/python
import itertools
class FPNode:
def __init__(self,id, parent):
self.frequency = 0
self.id = id
self.next = None
self.children = dict()
self.parent = parent
def __str__(self):
return "id:%s freq:%s" % (self.id, self.frequency)
def add(self,p... | |
# -*- coding: utf-8 -*-
"""
sphinx.builders.applehelp
~~~~~~~~~~~~~~~~~~~~~~~~~
Build Apple help books.
:copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from __future__ import print_function
import codecs
import pipes
from os import pat... | |
# Copyright 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | |
import gc
import sys
import time
import blinker
from nose.tools import assert_raises
jython = sys.platform.startswith('java')
pypy = hasattr(sys, 'pypy_version_info')
try:
from _test_async import test_send_async
except (SyntaxError, ImportError):
pass
def collect_acyclic_refs():
# cpython releases th... | |
#!/usr/bin/env python
import os
import sys
import stat
import errno
import logging
import StringIO
try:
import _find_fuse_parts
except ImportError:
pass
import fuse
from linode import Api
fuse.fuse_python_api = (0, 2)
write_cache = {}
class LinodeFSStat(fuse.Stat):
def __init__(self):
self.st... | |
# -*- coding: utf-8 -*-
import mock
from django.utils.timezone import now as timezone_now
from zerver.lib.soft_deactivation import (
do_soft_deactivate_user,
do_soft_deactivate_users,
get_users_for_soft_deactivation,
do_soft_activate_users,
get_soft_deactivated_users_for_catch_up,
do_catch_up... | |
#!/usr/bin/python
import sys
from klampt import *
from klampt.glprogram import *
from OpenGL.GLUT import *
import math
#Sphero local axes: [0,0,1] is "turn", [1,0,0] is "drive"
#can be 'left','up','down','right', 'home', 'insert', 'end', and the function keys.
keymap = {'up':(0,[-1,0,0]),'down':(0,[1,0,0]),'left':(0,... | |
# Python Tools for Visual Studio
# Copyright(c) Microsoft Corporation
# 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
#
# THI... | |
# 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... | |
#!/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... | |
import datetime
import hashlib
import json
from dateutil.parser import parse
from django.core.urlresolvers import reverse
from django.http import HttpResponse
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.template.loader import render_to_string
from mongoengine.... | |
# -*- coding: utf-8 -*-
#
# SelfTest/Hash/common.py: Common code for Crypto.SelfTest.Hash
#
# Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net>
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedicat... | |
# Copyright 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
#
# Unless required by applicable law... | |
"""Tests for the linalg._isolve.lgmres module
"""
from numpy.testing import (assert_, assert_allclose, assert_equal,
suppress_warnings)
import pytest
from platform import python_implementation
import numpy as np
from numpy import zeros, array, allclose
from scipy.linalg import norm
from sc... | |
# Copyright (C) 2008 Valmantas Paliksa <walmis at balticum-tv dot lt>
#
# Licensed under the GNU General Public License Version 3
#
# This program 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... | |
import math
import struct
import time
import smbus # pylint: disable=E0401
global i2c
EC_SALINITY = 0x3c # EC Salinity probe I2C address
EC_MEASURE_EC = 80
EC_MEASURE_SW = 40
EC_MEASURE_TEMP = 20
EC_CALIBRATE_EC = 10
EC_CALIBRATE_SW = 8
EC_I2C = 4
EC_READ = 2
EC_WRITE = 1
EC_VERSION_REGISTER = 0 ... | |
import time, copy
import os, os.path
import sys
import numpy
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from scipy import optimize
from echem_plate_ui import *
from echem_plate_math import *
import pickle
#p='C:/Users/Gregoire/Documents/CaltechWork/echemdrop/20120728NiFeCoTiplate1_test21Aug2012'
#p='C:/User... | |
from scad import *
import math
import os
class SpindleBaseHD(SCAD_Object):
top_cyl_dia = 14.5 + 0.3
top_cyl_height = 3.7
mid_cyl_dia = 25 + 0.3
mid_cyl_height = 5.0
bot_cyl_dia = 30.2
bot_cyl_height = 2.1
spindle_height = top_cyl_height + mid_cyl_height - 1
screw_count = 6
screw_dia... | |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
This module provides classes to define a phonon band structure.
"""
import collections
import numpy as np
from monty.json import MSONable
from pymatgen.core.lattice import Lattice
from pymatgen.core.stru... | |
#!/usr/bin/env python
import os
import sys
import subprocess
import cPickle
def run_uniquify_fasta(fasta_file, output_file, pickle_file):
"""
Returns a subprocess from command-line script "uniquify_fasta.py" <subprocess.Popen>
Input:
fasta_file <str> -- path to fasta file
output_file <st... | |
# Copyright 2013 IBM Corp.
#
# 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... | |
from __future__ import unicode_literals
import datetime
import uuid
from copy import deepcopy
from django.core.exceptions import FieldError
from django.db import DatabaseError, connection, models, transaction
from django.db.models import TimeField, UUIDField
from django.db.models.aggregates import (
Avg, Count, M... | |
import logging
import asyncio
import typing
import binascii
from lbry.utils import resolve_host
from lbry.dht import constants
from lbry.dht.protocol.distance import Distance
from lbry.dht.protocol.iterative_find import IterativeNodeFinder, IterativeValueFinder
from lbry.dht.protocol.protocol import KademliaProtocol
fr... | |
'''
Action Bar
==========
.. versionadded:: 1.8.0
.. image:: images/actionbar.png
:align: right
The ActionBar widget is like Android's ActionBar, where items are stacked
horizontally.
The :class:`ActionBar` will contain one :class:`ActionView` and many
:class:`ContextualActionView`\s.
An :class:`ActionView` wil... | |
from ctypes import (
c_char_p, c_char, c_int, c_uint, c_ubyte, c_void_p, c_double, c_size_t,
Structure, Union, POINTER
)
# Data types (artypes.h).
ARLong32 = c_int
ARULong32 = c_uint
ARUIntPtr = c_size_t
# General limits (ar.h line 67).
# max actions for 1 filter/active link
AR_MAX_ACTIONS = 25
# max size o... | |
import random
from collections import OrderedDict
from copy import deepcopy
import gym
from gym_minigrid.roomgrid import RoomGrid
from .verifier import *
class RejectSampling(Exception):
"""
Exception used for rejection sampling
"""
pass
class RoomGridLevel(RoomGrid):
"""
Base for levels ba... | |
# Copyright 2015 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 a... | |
# -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | |
from __future__ import print_function, division
import hashlib
import numpy as np
from astropy.table import Table, Column
from ..util.integrate import integrate_linlog_subset
from ..util.interpolate import (interp1d_fast, interp1d_fast_loglog,
interp1d_fast_linlog)
from ..util.functio... | |
from __future__ import annotations
import argparse
import decimal
import importlib
import inspect
import json
import optparse
import os
import tempfile
from collections import namedtuple
from unittest import mock
import pytest
import stomp as stomppy
import workflows
import workflows.transport
from workflows.transpo... | |
# Copyright 2013-present Barefoot Networks, 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... | |
#!/usr/bin/env python
''' Installation script for dipy package '''
import numpy as np
import os
import sys
from copy import deepcopy
from os.path import join as pjoin, dirname
from glob import glob
# BEFORE importing distutils, remove MANIFEST. distutils doesn't properly
# update it when the contents of directories c... | |
from django.db.models import Field, FloatField
from django.db.models.expressions import CombinedExpression, Func, Value
from django.db.models.lookups import Lookup
class SearchVectorExact(Lookup):
lookup_name = 'exact'
def process_rhs(self, qn, connection):
if not hasattr(self.rhs, 'resolve_expressio... | |
"""
sentry.plugins.base.v2
~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2013 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import, print_function
__all__ = ('Plugin2',)
import logging
from django.http import HttpResponseRedirect
fro... | |
# Copyright 2020 The StackStorm Authors.
# Copyright 2019 Extreme Networks, 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 ... | |
#!/usr/bin/env python
"""
MIDImeter v0.2 by Art Chaidarun
2012-08-03
"""
from __future__ import division
import os
import time
import pygame as pg
import pygame.midi
def textblit(text, x, y, boxwidth, align="l"):
"""Display text in the custom font"""
textwidth = typeface.size(text)[0]
if textwidth > boxwidt... | |
# 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 ... | |
import numpy as np
from sklearn.base import BaseEstimator, TransformerMixin
from sklearn.decomposition import PCA, RandomizedPCA
from sklearn.preprocessing import StandardScaler, Normalizer
from sklearn.utils import check_array
from .features import Features, as_features
# TODO: support inplace transformations here
... | |
# Copyright 2015: Mirantis 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 b... | |
import sys
import os
import shutil
import zipfile
import glob
import subprocess
import argparse
import re
import vstudio
import util
def cleanArtifacts(in_artifactsPath):
print()
print("Cleaning artifacts")
if os.path.exists(in_artifactsPath):
shutil.rmtree(in_artifactsPath)
os.mkdir(in_artifactsPath)
return
... | |
"""
Unit tests for ./yaml_parse.py
"""
import os
import numpy as np
import cPickle
import tempfile
from numpy.testing import assert_
from pylearn2.config.yaml_parse import load, load_path, initialize
from os import environ
from decimal import Decimal
import yaml
from pylearn2.models.mlp import MLP, Sigmoid
from pylea... | |
"""This package contains the "front end" classes and functions
for Beaker caching.
Included are the :class:`.Cache` and :class:`.CacheManager` classes,
as well as the function decorators :func:`.region_decorate`,
:func:`.region_invalidate`.
"""
import warnings
import beaker.container as container
import beaker.util ... | |
#!/usr/bin/env python
"""Build the SeqAn Releases Website."""
import operator
import optparse
import os
import os.path
import re
import sys
import xml.sax.saxutils
import pyratemp
# Patterns matching seqan apps and library.
LIBRARY_PATTERN = (r'seqan-library-([0-9])\.([0-9])(?:\.([0-9]))?\.'
'(tar... | |
"""
smartaws.ec2.vpc
~~~~~~~~~~~~~~~~
This module manages Amazon VPC objects and related resources.
:copyright: (c) 2016 by Yann Lambret.
:license: MIT, see LICENSE for more details.
"""
from boto3 import Session
from botocore.exceptions import ClientError
from botocore.exceptions import ParamValidationError
from sm... | |
#!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, Inc.
#
# This program 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 Lic... | |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | |
__author__ = 'schlitzer'
__all__ = [
'Connection',
'Hash',
'HyperLogLog',
'Key',
'List',
'Publish',
'Scripting',
'Set',
'SSet',
'String',
'Subscribe',
'Transaction'
]
class BaseCommand(object):
def __init__(self):
self._cluster = False
def execute(self... | |
# Copyright 2011 OpenStack Foundation
# Copyright 2013 IBM Corp.
#
# 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 ... | |
from __future__ import print_function
import sys, os
import re
sys.path.insert(1, os.path.join("..","..",".."))
import h2o
from h2o import H2OFrame
from h2o.automl import H2OAutoML
from tests import pyunit_utils as pu
from _automl_utils import import_dataset, get_partitioned_model_names
def check_model_property(mod... | |
# Copyright 2016-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
#
# or in the "license" f... | |
"""Tasks related to projects, including fetching repository code, cleaning
``conf.py`` files, and rebuilding documentation.
"""
import fnmatch
import os
import shutil
import json
import logging
import socket
import requests
import datetime
from celery import task
from django.conf import settings
from django.core.urlre... | |
"""Allow to set up simple automation rules via the config file."""
import asyncio
from functools import partial
import importlib
import logging
import voluptuous as vol
from homeassistant.const import (
ATTR_ENTITY_ID, ATTR_NAME, CONF_ID, CONF_PLATFORM,
EVENT_AUTOMATION_TRIGGERED, EVENT_HOMEASSISTANT_START, S... | |
import logging
import re
import datetime
import json
from pytz.gae import pytz
from google.appengine.api import memcache
from google.appengine.ext import db
from google.appengine.datastore import entity_pb
from data_model import DeveloperRequest
def validateDevKey(devKey):
if devKey is None or devKey == "kios... | |
# Copyright (c) 2015 Infortrend Technology, 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
#
# ... | |
"""Definitions for the `Fallback` class."""
import os
import astropy.constants as c
import numpy as np
from scipy.interpolate import interp1d
from mosfit.constants import C_CGS, DAY_CGS, FOUR_PI, M_SUN_CGS
from mosfit.modules.engines.engine import Engine
CLASS_NAME = 'Fallback'
class Fallback(Engine):
"""A tde... | |
#
# Copyright 2013 Radware LTD.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | |
# antioch
# Copyright (c) 1999-2019 Phil Christensen
#
#
# See LICENSE for details
"""
Parse command strings sent by the client.
This parser can understand a variety of phrases, but they are all represented
by the (BNF?) form:
<verb>[[[<dobj spec> ]<direct-object> ]+[<prep> [<pobj spec> ]<object-of-the-preposition>... | |
"""
Jonathan Reem
Implementation of Monads from Haskell in Python as a "copy" of
Control.Monad from the GHC libraries.
docstrings of functions heavily influenced by Control.Monad
"""
# pylint: disable=C0322, C0103, R0921, R0922, W0141, W0142
import func
import infix
def monadize(monad):
"Decorator for creating... | |
"""
Utilities for working with numpy arrays.
"""
from datetime import datetime
from warnings import (
catch_warnings,
filterwarnings,
)
from numpy import (
broadcast,
busday_count,
datetime64,
dtype,
empty,
nan,
vectorize,
where
)
from numpy.lib.stride_tricks import as_strided
f... | |
import collections
import json
import logging
logger = logging.getLogger('app.subscriber')
class Subscriber(object):
"""Subscribes to messages from WAMP Router on 'com.opentrons.browser_to_robot' and dispatches commands according to the :obj:`dispatcher` dictionary.
The Subscriber class is intended to... | |
import cython
from Cython import __version__
import re, os, sys, time
try:
from glob import iglob
except ImportError:
# Py2.4
from glob import glob as iglob
try:
import gzip
gzip_open = gzip.open
gzip_ext = '.gz'
except ImportError:
gzip_open = open
gzip_ext = ''
import shutil
import s... | |
#!/bin/python2.7
import re
import glob
import sys
import os
from fnmatch import fnmatch
################################################################
# lib_file_t
################################################################
class lib_file_t:
""" top class for lib file parser. 3 steps:
1. read_file... | |
# Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | |
# This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains t... | |
from nbt import nbt
from nbt.nbt import (TAG_Short, TAG_Compound, TAG_String, TAG_List, TAG_Float,
TAG_Byte, TAG_Long, TAG_Double, TAG_Int)
import mc_objects
import struct
import uuid
def get_tag_for_type(tag_type):
if tag_type == 'Byte':
return TAG_Byte
elif tag_type == 'Int':
return TAG_... | |
import re
import os
import glob
import shlex
import subprocess
import charmhelpers.core.decorators as decorators
import charmhelpers.core.hookenv as hookenv
def format_pci_addr(pci_addr):
"""Pad a PCI address eg 0:0:1.1 becomes 0000:00:01.1
:param pci_addr: str
:return pci_addr: str
"""
domain, ... | |
# coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import deserialize
from twilio.base import values
from twilio.base.instance_context import InstanceContext
from twilio.base.instance_resource import InstanceResource
from twilio.base... | |
"""Routines related to PyPI, indexes"""
from __future__ import absolute_import
import cgi
import itertools
import logging
import mimetypes
import os
import posixpath
import re
import sys
from collections import namedtuple
from pip._vendor import html5lib, requests, six
from pip._vendor.distlib.compat import unescape
... | |
"""Search (Chapters 3-4)
The way to use this code is to subclass Problem to create a class of problems,
then create problem instances and solve them with calls to the various search
functions."""
from utils import *
import sys
import math
import random
#_______________________________________________________________... | |
# 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 python3
# Copyright (c) 2018-2021 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the Partially Signed Transaction RPCs.
"""
from decimal import Decimal
from itertools import prod... | |
from collections import deque
import os
from time import sleep
import numpy as np
import yaml
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from robovis import *
from robovis import RVArmVis
offset_increment = 1.08
start_param = 'elevator_length'
class RVWindow(QMainWindow):
... | |
from os import path
from django.conf import settings
from django.shortcuts import render, redirect
from django.views.decorators.cache import never_cache
from django.utils.translation import LANGUAGE_SESSION_KEY, check_for_language, ugettext_lazy as _
from django.utils.http import is_safe_url, urlsafe_base64_decode
fro... | |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
from django.contrib.auth import get_user_model
User = get_user_model()
class Migration(SchemaMigration):
depends_on = (
("images", "0001_initial"),
("articles", "0001... | |
# -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListTy... | |
"""This tutorial introduces the LeNet5 neural network architecture
using Theano. LeNet5 is a convolutional neural network, good for
classifying images. This tutorial shows how to build the architecture,
and comes with all the hyper-parameters you need to reproduce the
paper's MNIST results.
This implementation simpl... | |
# This program 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 of the License, or (at your option) any later
# version.
#
# This program is distributed in the hope that it will be usefu... | |
__author__ = 'Alfredo Saglimbeni'
from datetime import datetime
import re
import uuid
from django.forms import forms, widgets
from django.forms.widgets import MultiWidget, DateTimeInput, DateInput, TimeInput
from django.utils.formats import get_format, get_language
from django.utils.safestring import mark_safe
from ... | |
#!/usr/bin/env python
import netaddr
import pprint
import re
from JumpScale import j
import VXNet.vxlan as vxlan
import VXNet.netclasses as netcl
from VXNet.utils import *
class NetConfigFactory():
def __init__(self):
self._layout=None
self.PHYSMTU = 2000 # will fit all switches
def getCon... | |
#!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | |
import calendar
import time
from dataclasses import dataclass
from typing import Any, Dict, List, Optional, Tuple
from django.conf import settings
from django.http import HttpRequest
from django.utils import translation
from two_factor.utils import default_device
from zerver.context_processors import get_apps_page_ur... | |
#!C:\Users\DMoran\Downloads\WinPython-64bit-2.7.13.1Zero\python-2.7.13.amd64\python.exe
"""PILdriver, an image-processing calculator using PIL.
An instance of class PILDriver is essentially a software stack machine
(Polish-notation interpreter) for sequencing PIL image
transformations. The state of the instance is th... | |
from HappyTools.util.fitting import gauss_function
from bisect import bisect_left, bisect_right, bisect
from math import sqrt, log
from numpy import amax, argmax, array, exp, greater, less, linspace, mean, std
from scipy.interpolate import InterpolatedUnivariateSpline
from scipy.optimize import curve_fit
from scipy.sig... | |
#!/usr/bin/python
# This file is part of Ansible
#
# Ansible 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) any later version.
#
# Ansible is distributed... | |
"""Module implementing the Pool for :mod:``requests_toolbelt.threaded``."""
import multiprocessing
import requests
from . import thread
from .._compat import queue
class Pool(object):
"""Pool that manages the threads containing sessions.
:param queue:
The queue you're expected to use to which you sh... | |
#!/usr/bin/env python2.4
import itertools
import time
import operator
def izip_longest(*args, **kwds):
# izip_longest('ABCD', 'xy', fillvalue='-') --> Ax By C- D-
fillvalue = kwds.get('fillvalue')
def sentinel(counter = ([fillvalue]*(len(args)-1)).pop):
yield counter() # yields the fillval... | |
# 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 ... | |
from __future__ import unicode_literals
import logging
import sys
from io import BytesIO
from threading import Lock
from django import http
from django.core import signals
from django.core.handlers import base
from django.core.urlresolvers import set_script_prefix
from django.utils import datastructures
from django.u... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.