text
stringlengths
2
999k
"""Generate a matplotlib canvas and add it to a QWidget contained in a QMainWindow. This will provide the display and interactions for the PyCCD plots.""" from lcmap_tap.logger import log, exc_handler from lcmap_tap.Plotting import POINTS, LINES import sys import datetime as dt import numpy as np import pkg_resource...
# 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 ._dispatch_wrapper import DispatchWrapper class StackingPatternItem(DispatchWrapper): """Stores a stacking pattern over an interval. StackingPattern items are part of a StackingPattern Log and stores the top and bottom widths over a depth interval. Width values are between 0.0 and 1.0 and depth ...
# Copyright (c) 2009 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. { 'targets': [ { 'target_name': 'All', 'type': 'none', 'dependencies': [ '../prog1/prog1.gyp:*', '../prog2/prog2.gyp:*', ...
""" Mask R-CNN The main Mask R-CNN model implementation. Copyright (c) 2017 Matterport, Inc. Licensed under the MIT License (see LICENSE for details) Written by Waleed Abdulla """ import os import random import datetime import re import math import logging from collections import OrderedDict import multiprocessing im...
import pytest from ..packet import (Packet, RequestAccountCreate, Packet, PacketInvalidData, NotifyAccountCreate, NotifyPersonDuplicate, NotifyUserModify, RequestUserModify) from .fixtures import DEMO_JSON_PKT_1, DEMO_JSON_PKT_2 class TestClient: """ Test packet cr...
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Renaming field 'Role.order' db.rename_column(u'units_role', 'ordre', 'o...
# -*- coding: utf-8 -*- # # Copyright 2018 Amir Hadifar. 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 req...
import os import glob import random import pickle from data import common import numpy as np import imageio import torch import torch.utils.data as data class SRData(data.Dataset): def __init__(self, args, name='', train=True, benchmark=False): self.args = args self.name = name self.train...
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- # If ext...
# You are to retrieve the following document using the HTTP protocol in a way that you can examine the HTTP Response headers. import socket mysock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) mysock.connect(('data.pr4e.org', 80)) cmd = 'GET http://data.pr4e.org/intro-short.txt HTTP/1.0\r\n\r\n'.encode() ...
#!/usr/bin/python3 """ TODO: Module-level description """ import argparse import os import numpy as np from asaplib.compressor import fps, CUR_deterministic from asaplib.data import ASAPXYZ def main(fxyz, fy, prefix, nkeep, algorithm, fmat, fkde, reweight_lambda): """ Select frames from the supplied xyz fi...
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. """ Utilities for downloading and building data. These can be replaced if your particular file system does not...
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import ast import collections import contextlib import logging import os import re import traceback from collections import OrderedDict from t...
#!/usr/bin/env python3 ''' MIT License Copyright (c) 2021 Nicholas Brunhart-Lupo 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 u...
#!/usr/bin/env python3 import os from vycodi.utils import loadJSONConfig, storeJSONConfig with open('/etc/hosts', 'r') as f: line = f.readline() ip = line.split()[0] config = loadJSONConfig('docker/host_config.json') config['address'] = ip if "REDIS_PORT_6379_TCP_ADDR" in os.environ: config['dbhost'] = os.environ...
import os, sys, threading from string import Template from ncrypt.rand import bytes as rand_bytes from ncrypt.rsa import RSAKey, RSAError from nitro.selectreactor import SelectReactor from nitro.tcp import tcpListen, TCPStream from nitro.ssl import sslAbort from nitro.linestream import TCPLineStream from cspa...
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: yandex/cloud/mdb/redis/v1alpha/resource_preset.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import messa...
# USAGE # Start the server: # python app.py # Submit a request via cURL: # curl -X POST -F image=@dog.jpg 'http://localhost:5000/predict' # import the necessary packages from tensorflow.keras.applications import ResNet50 from tensorflow.keras.preprocessing.image import img_to_array from tensorflow.keras.applic...
# coding: utf-8 """ Copyright 2016 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...
__author__ = "dhruv, Sidd Karamcheti" from grt.core import GRTMacro, Constants import wpilib constants = Constants() class TurnMacro(GRTMacro): """ Macro that turns a set distance. """ TP = constants['TP'] TI = constants['TI'] TD = constants['TD'] TOLERANCE = constants['TMtol'] class...
from roverio import scout def test_scout(): result = scout.Scout.search_for_string('roverio', 'def main()') assert 'File: roverio/scout.py\nSearch: def main():\nLine: 70\n' in result
import os import os.path as p import sys import time import datetime import pytest from contextlib import contextmanager sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from helpers.cluster import ClickHouseCluster from helpers.test_tools import TSV from helpers.client import QueryRunti...
from typing import List from fastapi import APIRouter, Depends, HTTPException, Query from sqlalchemy.orm import Session from dispatch.database import get_db, search_filter_sort_paginate from .models import ( TagTypeCreate, TagTypePagination, TagTypeRead, TagTypeUpdate, ) from .service import create, ...
# Copyright © 2019 Province of British Columbia # # 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...
# ------------------------------------------------------------------------- # # Part of the CodeChecker project, under the Apache License v2.0 with # LLVM Exceptions. See LICENSE for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception # # ---------------------------------------------------...
from collections import OrderedDict from typing import List from usaspending_api.search.filters.elasticsearch.naics import NaicsCodes from usaspending_api.search.filters.elasticsearch.tas import TasCodes from usaspending_api.search.filters.mixins.psc import PSCCodesMixin def upper_case_dict_values(input_dict): f...
# model settings model = dict( type='FasterRCNN', pretrained='torchvision://resnet50', backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, style='pytorch'), neck=dict( type='FPN', in_channels=[25...
c = 30
# encoding: utf-8 from __future__ import unicode_literals import re import json from .common import InfoExtractor from ..compat import compat_str from ..utils import ( ExtractorError, int_or_none, orderedSet, sanitized_Request, str_to_int, unescapeHTML, unified_strdate, urlencode_postd...
'''Window class ''' # pylint: disable=too-many-arguments from xcffib.xproto import ColormapAlloc, CW, EventMask, WindowClass events = EventMask.ButtonPress | EventMask.EnterWindow \ | EventMask.LeaveWindow | EventMask.Exposure \ | EventMask.PropertyChange | EventMask.StructureNotify def createWindo...
import torch.nn as nn from easydict import EasyDict as edict from torchvision import transforms as trans # from common.transform import MotionBlur from nn.center_loss import CenterLoss color_channel_index = { 'L': 1, 'RGB': 3, 'YCbCr': 3, } def get_config(): conf = edict() conf.data = edict()...
from __future__ import absolute_import from .compare import ( distance, simple_distance, ) from .compare import AnnotatedTree, Operation from .simple_tree import Node __all__ = ['distance', 'simple_distance', 'Node', 'AnnotatedTree', 'Operation'] __version__ = '1.2.0'
# ------------------------------------------------------------------------------ # # Copyright 2021 Fetch.AI Limited # # 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://w...
from vkbottle.api import UserApi from vkbottle.rule import FromMe from vkbottle.user import Blueprint, Message from idm_lp.logger import logger_decorator from idm_lp.database import Database, MutedMembers from idm_lp.utils import edit_message, get_ids_by_message, get_full_name_by_member_id, generate_user_or_groups_lis...
# -*- coding: utf-8 -*- """Implementation of a net resources file.""" from __future__ import unicode_literals import os import re class NetRCFile(object): """Net resources (.netrc) file.""" _NETRC_SEPARATOR_RE = re.compile(r'[^ \t\n]+') def __init__(self): """Initializes a .netrc file.""" super(NetRC...
{ "includes": [ "../../common.gypi" ], "targets": [ { "target_name": "libproj", "type": "static_library", "cflags_cc": ["-Wno-attributes"], "cflags": ["-Wno-attributes"], "sources": [ '<!@(python ../glob-files.py "proj/src/*.c")', '<!@(python ../glob-files.py "proj/src/*.cpp")', '<!@(p...
######################################################################## # import python-library ######################################################################## # default import glob import argparse import sys import os import itertools import re # additional import numpy as np import librosa import librosa.c...
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) class PyArgon2Cffi(PythonPackage): """The secure Argon2 password hashing algorithm..""" homepage = "https://argo...
# Copyright (c) 2019, NVIDIA 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 # # Unless required by applic...
import typing import sys import numpy as np import numba as nb @nb.njit( (nb.i8[:, :], ), cache=True, ) def shortest_dist_floyd_warshall( g: np.ndarray, ) -> np.ndarray: n = len(g) assert g.shape == (n, n) dist = g.copy() for i in range(n): dist[i, i] = 0 for k in range(n): for i in range(n): ...
class Debug: def __init__(self): self.playerLocation = False
print "my name is sonali"
#!/usr/bin/python -tt # -*- coding: utf-8 -*- # (c) Copyright 2016 Hewlett Packard Enterprise Development LP # (c) Copyright 2017 SUSE 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 # #...
import hashlib import json from time import time # this is pulling the lower object time from the time package from urllib.parse import urlparse import requests # author: @alexwerner class Blockchain(object): def __init__(self): self.chain = [] # [] is an empty list - lists are the best part of p...
from pathlib import Path PROJECT_ROOT = Path(__file__).resolve().parent DATA_ROOT = PROJECT_ROOT / 'data'
# Generated by Django 1.11.4 on 2017-09-08 17:52 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('zerver', '0104_fix_unreads'), ] operations = [ migrations.AddField( model_name='userprofile', name='enable_stream_pu...
from abc import abstractmethod, ABC from sklearn.metrics import log_loss, mean_squared_error class Encoder(ABC): @abstractmethod def encode(self, x): pass @abstractmethod def decode(self, encoded_x): pass def recon_error(self, x, metric='cross_entropy'): encoded_x = self.e...
# Copyright (c) OpenMMLab. All rights reserved. import warnings import torch from ..builder import BBOX_ASSIGNERS from ..iou_calculators import build_iou_calculator from .assign_result import AssignResult from .base_assigner import BaseAssigner @BBOX_ASSIGNERS.register_module() class ATSSAssigner(BaseAssigner): ...
import numpy from aydin.features.extensible_features import ExtensibleFeatureGenerator from aydin.features.groups.dct import DCTFeatures from aydin.features.groups.median import MedianFeatures from aydin.features.groups.random import RandomFeatures from aydin.features.groups.spatial import SpatialFeatures from aydin.f...
#!/usr/bin/python """Help to calculate dependance of a symbol in Mathematica package Example Usage: python dep.py --pretty \ --package-context IndexNotation \ Scope\`UniqueIndex unit/test/transform_rules/t-t.m etc. For more info please run 'python dep.py -h' """ from __future__ i...
# Local imports import logging import bb_auditlogger import config_services import bb_dbconnector_factory from messaging import bb_sms_handler import bb_notification_handler as notify # Set up the logger logger = logging.getLogger(__name__) # Method is run when a SET command to determine which particular setting the...
""" Django settings for NewsAppDjango project. Generated by 'django-admin startproject' using Django 3.2.8. For more information on this file, see https://docs.djangoproject.com/en/3.2/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/3.2/ref/settings/ """ from p...
#!/usr/bin/env python """ Southern California Earthquake Center Broadband Platform Copyright 2010-2016 Southern California Earthquake Center This module contains plot-specific parameters that are shared among multiple plotting scripts. $Id: plot_config.py 1785 2017-01-24 19:40:10Z fsilva $ """ from __future__ import d...
import os.path from pathlib import Path import requests home = str(Path.home()) purchase_url = 'http://localhost:8000/purchase' data = { 'paymentReference': "PR0001", 'poNumber': "PON0001", 'quantity': 3, 'customerNumber': "CUS0001", 'lineItem': "LI0001" } response = requests.post(purchase_url...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Author : mjc # @Time : 2017/2/28 15:09 from common.writelog import writelog import time from HTMLTestRunner import HTMLTestRunner import unittest test_dir = './interface' discover = unittest.defaultTestLoader.discover(test_dir,pattern='test_*.py') writelog('info','==...
from time import time import numpy as np from scipy.stats import multivariate_normal from experiments.lnpdfs.create_target_lnpfs import build_GPR_iono_with_grad_lnpdf from sampler.SVGD.python.svgd import SVGD as SVGD num_dimensions = 34 tmp_lnpdf = build_GPR_iono_with_grad_lnpdf(True) def dlnpdf(theta): input =...
''' Problem 513 - Integral median ABC is an integral sided triangle with sides a≤b≤c. mc is the median connecting C and the midpoint of AB. F(n) is the number of such triangles with c≤n for which mc has integral length as well. F(10)=3 and F(50)=165. Find F(100000). ''' from math import sqrt n = 50 if __nam...
#!/usr/bin/env python3 import matplotlib.pyplot as plt from matplotlib import cm import numpy as np from numpy import linalg as LA import re def sol(xin, t): return np.sin(np.pi*(xin-t)) def extractN(ns): reg = re.compile(r''+ns+'.+') file1 = open('info.dat', 'r') strings = re.search(reg, file1.read()) fil...
n=int(input())#casos de prueba c=0#contador while True: if(c==n): break c=c+1 palabra=input("") tamaño=len(palabra) if(tamaño==5): print("3") elif(palabra[0]=="t" and palabra[1]=="w" or palabra[0]=="t" and palabra[2]=="o"or palabra[1]=="w" and palabra[2]=="o"): print("2") else: print("1"...
class MenuItem: PLAY = 0 SETUP = 1 HALL_OF_FAME = 2 QUIT = 3 MUSIC = 10 SOUND = 11 MAIN_MENU = 12 SCREEN_SIZE = 13 FULLSCREEN = 14 SAVE = 15 CANCEL = 16 CONTINUE = 17 TYPE_NONE = 0 TYPE_SLIDER = 1 TYPE_LIST = 2 def __init__(self, id, text, type = None, value = 0, position = 0): sel...
import Constant.Constant as const from requests.exceptions import HTTPError from requests.structures import CaseInsensitiveDict import asyncio import aiohttp import logging class HttpRequest(): __header: CaseInsensitiveDict __body: dict __url: str __cookie: dict @property def Body(self): ...
"""Text wrapper and formatter""" import argparse import os import sys from collections import deque from tempfile import NamedTemporaryFile from typing import List def wrap(filename: str, linewidth: int) -> int: """Main function""" if not os.path.isfile(filename): print(f"Error: file '{filename}' not ...
import time,os,re,csv,sys,uuid,joblib, yaml import pickle from datetime import date import numpy as np import pandas as pd from dotenv import find_dotenv, load_dotenv from sklearn import ensemble from sklearn.pipeline import Pipeline from sklearn.preprocessing import StandardScaler, OneHotEncoder from sklearn.compose i...
import unittest from mock import MagicMock, Mock from slack_bot import SlackBot class TestSlackBot(unittest.TestCase): def setUp(self): pass # Tests __init__ by passing in a dummy set of clients, and then # ensuring that those clients are found in slackbot.clients def test_init(self): ...
# -*- coding: utf-8 -*- from time import sleep from .baseapi import BaseAPI class Action(BaseAPI): def __init__(self, *args, **kwargs): self.id = None self.token = None self.status = None self.type = None self.started_at = None self.completed_at = None self...
# test mod_md notify support import os from TestEnv import TestEnv from TestHttpdConf import HttpdConf class TestNotify: notify_cmd = None notify_log = None domain = None @classmethod def setup_class(cls): print("setup_class:%s" % cls.__name__) TestEnv.init() TestEnv.clea...
""" Cisco Intersight Cisco Intersight is a management platform delivered as a service with embedded analytics for your Cisco and 3rd party IT infrastructure. This platform offers an intelligent level of management that enables IT organizations to analyze, simplify, and automate their environments in more advan...
import os import sys import subprocess import signal import pickle import logging import time from threading import Thread from easydict import EasyDict import numpy as np from ding.worker import Coordinator, create_comm_collector, create_comm_learner, LearnerAggregator from ding.config import read_config, compile_conf...
import torch import os from PIL import Image from xml.dom.minidom import parse import numpy as np import utilities.transforms as T class FacialDataset(object): def __init__(self, root, transforms, train=True): self.root = root self.transforms = transforms # load all image files, sorting th...
from django.contrib import admin from django.contrib.auth.admin import UserAdmin from django.contrib.auth.models import User, Group from django.db.models import Q, Count from django.utils.timezone import now from djangoql.admin import DjangoQLSearchMixin from djangoql.schema import DjangoQLSchema, IntField, StrField ...
# Time: O(n^2) # Space: O(n * d) import collections class Solution(object): def numberOfArithmeticSlices(self, A): """ :type A: List[int] :rtype: int """ result = 0 dp = [collections.defaultdict(int) for i in xrange(len(A))] for i in xrange(1, len(A)): ...
#!/usr/bin/python # -*- coding: utf-8 -*- # PiNumberStation over icecast # # Requires: # # - icecast (https://icecast.org/download | brew install icecast) # - liquidsoap (https://www.liquidsoap.info/doc-dev/install.html) # - liquidsoap-cry (liquidsoup plugin for stream to icecast) # # Configure: # # - 1. (requi...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'gui/mainwindow.ui' # # Created by: PyQt5 UI code generator 5.12.2 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_MainWindow(object): def setupUi(self, main_window): ...
import numpy as np import _transformations as trans from abc import ABCMeta, abstractmethod from ratcave.utils.observers import IterObservable import itertools from operator import setitem class Coordinates(IterObservable): coords = {'x': 0, 'y': 1, 'z': 2} def __init__(self, *args, **kwargs): " Retu...
# coding=utf-8 # Copyright 2018 Google LLC & Hwalsuk Lee. # # 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 ...
import setuptools with open("README.md", "r") as fh: long_description = fh.read() setuptools.setup( name="np-xarr", # Replace with your own username version="0.1.6", author="jagkagd", author_email="jagkagd@gmail.com", description="Perform a numpy array transformation by giving examples.", ...
# -*- coding: utf-8 -*- # --------------------------------------------------------------------- # DLink.DAS.get_version # --------------------------------------------------------------------- # Copyright (C) 2007-2017 The NOC Project # See LICENSE for details # ----------------------------------------------------------...
from django.db import models from Contacts.models import Contact from django.utils.html import format_html # Create your models here. class ProductCategory(models.Model): """产品类别类""" category_name = models.CharField(verbose_name="产品类别", max_length=50) class Meta: verbose_name = '产品类别' # 单个对象的名称 ...
# resulttool - store test results # # Copyright (c) 2019, Intel Corporation. # Copyright (c) 2019, Linux Foundation # # SPDX-License-Identifier: GPL-2.0-only # import tempfile import os import subprocess import json import shutil import scriptpath scriptpath.add_bitbake_lib_path() scriptpath.add_oe_lib_path() import r...
import matplotlib.pyplot as plt import pickle import numpy as np with open('cost_fib.pkl','rb') as inp: cost_gld = pickle.load(inp) with open('cost_rand.pkl','rb') as inp: cost_reg = pickle.load(inp) # print(cost_gld) # print(cost_reg) x_ax = np.arange(300) plt.plot(x_ax, cost_gld) plt.plot(x_ax, ...
# Generated by Django 2.0.3 on 2018-05-01 09:24 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('catalog', '0006_merge_20180501_1413'), ] operations = [ migrations.AlterField( model_name='invi...
#!/Users/rtjfarrimond/spotify-recommender/extractor/event-lambda/venv/bin/python3 # Author: # Contact: grubert@users.sf.net # Copyright: This module has been placed in the public domain. """ man.py ====== This module provides a simple command line interface that uses the man page writer to output from ReStructuredT...
""" WSGI config for geodjango project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_SET...
from utilities.logging import Logging from music.artist import Artist import psycopg2 import psycopg2.extras class Album: "Music Album class" def __init__(self, log, ytmusic, dbh, name=None, artist_id=None, release_date=None, release_year=None, number_of_disks=0, track_count=0, rating=0): ...
''' to_toml ------- Convert float conformance test cases to TOML. ''' import argparse import json import sys import unittest import numpy as np import tomlkit # ARGPARSE # -------- parser = argparse.ArgumentParser( description='Convert floats to TOML.', allow_abbrev=False ) parser.add_argument(...
#!/usr/bin/python3 '''Updates the user ranking.''' import argparse import datetime import logging import os import sys from typing import Sequence, NamedTuple import MySQLdb import MySQLdb.cursors sys.path.insert( 0, os.path.join( os.path.dirname(os.path.dirname(os.path.realpath(__file__))), ".")) i...
# blender modules import bpy # addon modules from .. import utils from .. import xray_ltx from .. import version_utils SECTION_NAME = 'action_xray_settings' def get_xray_settings(): obj = bpy.context.object if not obj: return anim_data = obj.animation_data if anim_data: action = ani...
""" WSGI config for weblog project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/ """ import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "weblog.settings") from django.core.wsg...
# Copyright 2017,2021 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 agr...
import pandas as pd def infer_freq(series): """ infer the frequency from a pandas Series with `DatetimeIndex` :param pandas.Series series: a pandas Series with `DatetimeIndex` :return: the inferred frequency object :rtype: pandas.DateOffset """ if series.index.freq is not None and hasattr...
import unittest import tangled.site class Tests(unittest.TestCase): def test_something(self): self.assert_(tangled.site)
# Copyright 2013-2018 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Cubew(AutotoolsPackage): """Component of CubeBundle: High performance C Writer library """...
# ------------------------------------------------------------------------------ # MIT License # # Copyright (c) 2021, Hieu Pham. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # i...
# this class provides basic i2c functionality # attach to address, read bytes, write bytes from machine import Pin, I2C class i2cBase(): addr = 0x0 def __init__(self): #print("i2cBase init()") self.i2c = I2C(-1, scl=Pin(22), sda=Pin(21)) def write(self, buf): self.i2c.writeto...
from setuptools import setup, find_packages setup(name='citrination-client', version='4.7.0', url='http://github.com/CitrineInformatics/python-citrination-client', description='Python client for accessing the Citrination api', packages=find_packages(exclude=('docs')), install_requires=[ ...
# Lint as: python2, python3 # Copyright 2020 The TensorFlow Probability Authors. # # 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 python3 # Copyright (c) 2019 The Bitcoin developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """ This tests the treatment of Schnorr transaction signatures: - acceptance both in mempool and blocks. - check ban...
"""Classes and functions for handling Arbin battery cycler data. """ import os from datetime import datetime import pytz import pandas as pd from beep.conversion_schemas import ARBIN_CONFIG from beep import logger from beep.structure.base import BEEPDatapath class ArbinDatapath(BEEPDatapath): """A datapath for...
# Copyright 2021 BlueCat Networks (USA) Inc. and its affiliates. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. """Enumeration class to be used in constant classes in BlueCat Address Manager.""" from enum import Enum class StrEnum(s...