content stringlengths 5 1.05M |
|---|
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from math import sqrt
from sklearn.metrics import mean_squared_error
from sklearn.preprocessing import MinMaxScaler
from sklearn.metrics import mean_squared_error
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import LST... |
class ChoicesIsEmpty(Exception):
pass
class InvalidChoicesElements(Exception):
pass
class MixedChoicesElements(Exception):
pass
|
#!/usr/bin/env python
# Copyright (C) 2011 Ion Torrent Systems, Inc. All Rights Reserved
import sys
from os.path import dirname, abspath
from distutils.sysconfig import get_python_lib
fpath = abspath(__file__)
prefix = dirname(dirname(fpath))
pypath = get_python_lib(prefix=prefix)
if pypath not in sys.path:
sys.p... |
"""(Higher)HRNet backbone.
This implementation is based on the PyTorch implementation of HRNet, modified to
implement HigherHRNet's configuration and new deconvolution heads.
Refs:
https://arxiv.org/pdf/1902.09212.pdf
https://arxiv.org/pdf/1908.10357.pdf
"""
import tensorflow as tf
import attr
from typing import Lis... |
#!/usr/bin python3
import click
import numpy as np
import json
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable
plt.rcParams["font.sans-serif"] = ["Arial", "sans-serif"]
plt.rcParams.update({"font.size": 12})
@click.command()
@click.option(
"--group",
default="1Lbb",... |
"""132 Pattern"""
import sys
from typing import List
def find_132_pattern(numbers: List[int]) -> bool:
"""https://leetcode.com/problems/132-pattern/"""
# search for subsequence (s1, s2, s3) with s1 < s3 < s2
s3 = -sys.maxsize
stack = []
for value in reversed(numbers):
# s1 candidate
... |
import pandas as pd
import numpy as np
import datetime as dt
rolling_window_size = 10000
rolling_window_time = '600s' # in seconds
def calculate_features(df):
# connection based features
# 2. Number of times a specific SRCADDRESS has appeared in the last X flow records
df['conn_src_adr_count'... |
import asyncio
import logging
import os
from TelegramBotAPI.types import sendMessage, sendPhoto
from TelegramBot.plugin import BotPlugin
log = logging.getLogger(__name__)
class Ping(BotPlugin):
@asyncio.coroutine
def startPlugin(self):
pass
@asyncio.coroutine
def on_message(self, msg):
... |
#!/usr/bin/env python3
import sys, os
import glob
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
from collections import Counter
from Bio import SeqIO
from Bio.SeqFeature import SeqFeature, FeatureLocation
# General info about the genome references and the location of the... |
# navigation.py
from .evedb import EveDb
from .solarmap import SolarMap
from .evescout import EveScout
from .tripwire import Tripwire
class Navigation:
"""
Navigation
"""
def __init__(self, gates, system_desc, wh_codes, trip_url, trip_user, trip_pass):
self.eve_db = EveDb(gates, system_desc, ... |
# -*- coding: utf-8 -*-
"""
Created on Dec 20, 2011
@author: Tyranic-Moron
"""
from IRCMessage import IRCMessage
from IRCResponse import IRCResponse, ResponseType
from CommandInterface import CommandInterface
class Command(CommandInterface):
triggers = ['stats']
help = 'stats - Responds with a link to the c... |
import base64
import struct
import datetime
import numpy as np
# Calculate watermark of sensordata
def calcWatermark(oldData, newData, key=0xa5a5):
reg = (oldData >> 13) ^ (newData >> 13) ^ key
return reg
# Calculate phase of sensordata
def calcPhase(oldPhase, newWatermark):
return (oldPhase ^ (newWaterma... |
import json
import fire
import imageio
import numpy as np
import torch
from scipy.optimize import linear_sum_assignment
from torchvision.models.detection import fasterrcnn_resnet50_fpn
from torchvision.transforms.functional import to_tensor
def track(
video_path: str,
output_path: str = "out.json",
scor... |
import redis
from assert_helper import *
import time
import threading
from conn import *
def subscribe(channel, master=True):
conn = get_redis_conn(master)
p = conn.pubsub()
p.subscribe(channel)
for item in p.listen():
if item['type'] == "message":
assert (item['data'] == "a")
... |
import unittest
from uuid import uuid4
from Jumpscale import j
class BaseTest(unittest.TestCase):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
@staticmethod
def info(message):
j.core.tools.log(msg=message, level=20)
@staticmethod
def generate_random_str(... |
import os
import config
import random
import json
def create_key():
alpaha = "abcdefghijklmnopqrstuvwxyz"
Alpaha = alpaha.upper()
number = "1234567890"
k = random.randint(5, 11)
key = random.choices(alpaha + Alpaha + number, k=k)
return "".join(key)
def letstalk(user_id):
"""
返回web端聊... |
import os
import csv
from random import randint
from django.db import transaction
from registros.models import Empresa
# Run inside python manage.py shell
# from registros.bulk_add_clientes import add_clientes
# add_clientes()
# CLIENTES_CSV = "/home/heitor/sistema/setup/clientes.csv"
CLIENTES_CSV = "C:/Users/heit... |
from django.db import models
from django.contrib.auth.models import User
from PIL import Image
class Profile(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE,related_name='profile',verbose_name='username')
image = models.ImageField(default='default.jpg', upload_to='profile_pics')
... |
#!/home/ssericksen/anaconda2/bin/python2.7
import pandas as pd
import numpy as np
import sys
try:
sheet = sys.argv[1] # 'pkis1_set' or pkis2_set'
outcsv = sys.argv[2]
except:
print ""
print "script.py sheetname outputcsv "
print " 'pkis1_set' ./data/newtarg_sim_pkis1.csv"... |
import DHCPOption
class DHCPMessage():
def __init__(self, data):
self.op = data[0]
self.htype = data[1]
self.hlen = data[2]
self.hops = data[3]
self.xid = data[4:8]
self.secs = data[8:10]
self.flags = data[10:12]
self.ciaddr = data[12:16]
self.yiaddr = data[16:20]
self.siaddr ... |
import pytest
from django.utils.crypto import get_random_string
from django.db.utils import IntegrityError
from ..models import Building, Apartment, Parking
def test_create_parent_without_child():
addr1 = get_random_string()
Building.objects.create(address=addr1)
assert Building.objects.filter(address=ad... |
import types
from itertools import product
import numpy as np
from scipy.interpolate import interp1d
import tensorflow.keras as K
from . import Layers_mimo
from .tf_helper import complexx
from estimators.Templates import Estimator_mimo_cnn, Descriptor
class MMSEEstimator(Estimator_mimo_cnn, Descriptor):
"""MMSE ... |
import unittest
"""
Leetcode(https://leetcode.com/problems/maximum-subarray)
"""
# def maxSubArray(nums):
# max_sum = float('-inf')
# preMinS = [0] * len(nums)
# preSum = [0] * len(nums)
#
# for i in range(len(preSum)):
# if i == 0:
# preSum[i] = nums[i]
# continue
# ... |
#!/usr/bin/env python3
import os
import sys
import getpass
import shutil
comp_path = sys.path[0]
print("comp_path:")
print(comp_path)
# original folder
org_image_path = comp_path + "/example/image"
# new folder
data_path = comp_path + "/../../hardware/chip/haas1000/prebuild/data"
image_path = data_path + "/ucloud_a... |
from modules.can_access import can_access
from modules.check_post_action import check_post_action
from modules.has_correct_favicon import has_correct_favicon
from modules.has_password_field import has_password_field
from modules.html_has_same_domain import html_has_same_domain
from modules.is_masquerading import is_mas... |
from vii.Dispatcher import Dispatcher, TokenExecption
from vii.Command import Command
from nose.tools import *
class FinshActionSeen(Exception): pass
class Action:
finishSeen = False
def finish(self): self.finishSeen = True
def act(self): return "actSeen"
class ActionManager:
actionCalled = 0
de... |
import inspect
import re
import typing
from contextvars import ContextVar
from dataclasses import dataclass, field
from typing import Any, Dict, Iterable, Optional, Union
from babel.support import LazyProxy
from aiogram import types
from aiogram.dispatcher.filters.filters import BoundFilter, Filter
from aiogram.types... |
import argparse
import shutil
from pathlib import Path
import mlflow
from mlflow.store.tracking.file_store import FileStore
import pytorch_lightning as pl
from diameter_learning.plmodules import CarotidArteryChallengeDiameterModule
from diameter_learning.handlers import SegmentationSaver
from diameter_learning.settings... |
import copy
import gzip
import jsonpickle
import logging
import os
from dataclasses import dataclass, field
from . import xltypes, reader, parser, tokenizer
@dataclass
class Model():
cells: dict = field(
init=False, default_factory=dict, compare=True, hash=True, repr=True)
formulae: dict = field(
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Mar 23 11:50:04 2020
@author: marios
"""
import numpy as np
import matplotlib.pyplot as plt
from scipy.integrate import odeint
# Use below in the Scipy Solver
def f(u, t ,lam=1):
x, y, px, py = u # unpack current values of u
derivs = [... |
from .numpyextractors import NumpyImagingExtractor, NumpySegmentationExtractor
|
import os
from tempfile import NamedTemporaryFile
from pyfibre.addons.shg_pl_trans.tests.probe_classes import (
ProbeSHGImage,
ProbeSHGPLTransImage)
from pyfibre.tests.pyfibre_test_case import PyFibreTestCase
from pyfibre.addons.shg_pl_trans.tools.figures import (
create_shg_figures,
create_shg_pl_tra... |
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
#from torchvision import datasets, transforms
from torch.autograd import Variable
import torch.distributed as dist
import h5py
import time
import os
import io
import sys
from RNN_language_model import RN... |
import pytest
import attr
from ..abc import SendStream, ReceiveStream
from .._highlevel_generic import StapledStream
@attr.s
class RecordSendStream(SendStream):
record = attr.ib(default=attr.Factory(list))
async def send_all(self, data):
self.record.append(("send_all", data))
async def wait_se... |
import json
from PyQt5.QtWidgets import QDialog
from PyQt5.uic import loadUi
from PyQt5.QtCore import QRegExp
from PyQt5.QtGui import QRegExpValidator, QIcon
iconpath = "media\\Images\\use-tool-key.png"
class ChangeKey(QDialog):
def __init__(self, key):
super().__init__()
self.initUI()
s... |
# encoding: utf-8
##################################################
# This script shows how to find the closest point from a geodataframe
# The pricess was drafted by checking official docs and proposal from developers
# https://pandas.pydata.org/docs/reference/api/pandas.read_csv.html
# https://github.com/shapely/sh... |
from httprequest_blueprints import execute_request, download_file
import argparse
import os
import json
import sys
import requests.auth
def get_args():
parser = argparse.ArgumentParser()
parser.add_argument('--api-key', dest='api_key', required=True)
parser.add_argument('--api-secret', dest='api_secret',... |
# coding: utf-8
"""
LogicMonitor REST API
LogicMonitor is a SaaS-based performance monitoring platform that provides full visibility into complex, hybrid infrastructures, offering granular performance monitoring and actionable data and insights. logicmonitor_sdk enables you to manage your LogicMonitor account... |
n=-1;
while (n<0):
try:
print 'before'
n=n+1
continue
print 'error'
except StandardError:
print 'error' |
import math
from ..util import f_string_print
@f_string_print
def sin(x:int)->float:
"""
This function takes in input as redians and returns the
computed sin value
"""
return math.sin(x)
@f_string_print
def sin_d(x:int)->float:
"""
This function takes in input in int and returns the
co... |
# -*- coding: utf-8 -*-
# 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, sub... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import pandas as pd
import json
from scipy.optimize import curve_fit
from scipy.interpolate import interp1d
from .isotope import Isotope
from .data import _get_connection
from .plotting imp... |
from page_objects import PageSelect, PageObject, PageElement
from selenium import webdriver
from time import sleep
class SelectPage(PageObject):
elm = PageElement(xpath="//select")
def test_select():
"""测试选择框的操作"""
dr = webdriver.Chrome()
page = SelectPage(dr)
page.get("http://www.w3school.com.... |
import unittest
import numpy as np
from ifcb.data.adc import SCHEMA_VERSION_1, SCHEMA_VERSION_2
from ..ml_analyzed import compute_ml_analyzed
class MockBinS2():
def __init__(self):
self.schema = SCHEMA_VERSION_2
self.headers = {
'runTime': 56.8045,
'inhibitTime': 36.7328 ... |
# coding=utf-8
from __future__ import unicode_literals
import re
import io
import pprint
import collections as coll
import itertools
import sys
from xml.etree import ElementTree
from railroad_diagrams import *
import railroad_diagrams as rr
if sys.version_info >= (3, ):
basestring = (str, bytes)
class TokenStr... |
"""allSales URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-b... |
# -*- coding: utf-8 -*-
"""
Create by sandy at 11:35 23/12/2021
Description: ToDo
"""
from django.contrib.auth import get_user_model
from django.utils.translation import ugettext_lazy as _
AUTHOR_USER = get_user_model()
BOOL_CHOICES = {
(0, _('否')),
(1, _('是'))
}
STATUS_CHOICES = (
(0, _('禁用')),
(1... |
#!/usr/bin/env python
import math
import numpy as np
import argparse
from PIL import Image
import time
import chainer
import chainer.links as L
import chainer.functions as F
from chainer import Variable, cuda, serializers
class ResidualBlock(chainer.Chain):
def __init__(self, n_in, n_out, stride=1, ksize=3):
... |
class Solution:
def maxRotateFunction(self, A: List[int]) -> int:
n = len(A)
total = sum(A)
ans = cur = sum(i * v for i, v in enumerate(A))
for v in A[n - 1: 0: -1]:
cur += total - n * v
ans = max(ans, cur)
return ans
|
import random
print("------------Snake Water Gun---------------")#between two Player
print("S for Snake\nW for Water\nG for Gun")
print()
chances = 10
computer_points = 0
user_points = 0
while True:
computer_choice = random.choice(("S", "W", "G"))
# print(f"Computer choice is {computer_choice}"... |
"""
Utility for creating Crypt Streams, which are encrypted blobs and associated metadata.
"""
import os
import logging
from cryptography.hazmat.primitives.ciphers.algorithms import AES
from twisted.internet import defer
from lbrynet.blob.CryptBlob import CryptStreamBlobMaker
log = logging.getLogger(__name__)
clas... |
class Station:
def __init__(self,name,peopleCount,imgfile="s1.jpeg"):
self.peopleCount = peopleCount
self.name = name
self.next = []
self.image = imgfile
def getPeopleCount(self):
return self.peopleCount
def getName(self):
return self.name
def addN... |
#-*- coding : utf-8 -*-
# file : import uinit
import os
import sys
def import_uno():
# Add the URE_BOOTSTRAP environment variable #3
os.environ['URE_BOOTSTRAP'] = 'vnd.sun.star.pathname:c:\Program Files\OpenOffice.org 3\program\\fundamental.ini'
# Add the UNO_PATH environment variable ... |
import socket
import random
import json
import collections
import config
from round import Round
class Game:
def __init__(self, ip, port):
self.s = socket.socket()
self.s.bind((ip, port))
self.s.listen(3)
self.client = []
while len(self.client) < config.number_of_players:
conn, addr = self.... |
# -*- coding: utf-8 -*-
# Test various interfaces defined in the pytpm_vec.pxi file.
import unittest
from pytpm import tpm
class TestV3Structure(unittest.TestCase):
"""Test the V3 wrapper for _tpm_vec.V3"""
def testCreate(self):
"""V3.init => create V3 object."""
v3 = tpm.V3()
self.asse... |
#coding = utf-8
import cv2
import numpy as np
import sys
if __name__ == '__main__':
image_path ="E:/IntelliJ Projects/Thyroid/Thyroid Maven Webapp/out/artifacts/Thyroid_Maven_Webapp_Web_exploded/Thyroid_images/"+sys.argv[1]
img = cv2.imread(image_path)
image = c... |
import web
from contribute.contribute import Contribute
from api.urls import urls
app = web.application(urls, globals())
if __name__ == "__main__":
app.run()
|
SECRET_KEY = 'q%ixkho6aa51z&foxw#728c=i8u-7b3rf6t+@2xu5cmh)l*0pb'
INSTALLED_APPS = [
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'braces',
'rest_framework',
'url_filter',
'jcms'
]
JCMS = {... |
__copyright__ = 'Copyright 2016-2021, The RADICAL-Cybertools Team'
__license__ = 'MIT'
import os
from .base import RMInfo, ResourceManager
# ------------------------------------------------------------------------------
#
class Torque(ResourceManager):
# -----------------------------------------------------... |
import rrPython
import numpy
import matplotlib.pyplot as plot
model = open('C:\\roadRunner\\models\\feedback.xml', 'r').read()
rrPython.loadSBML(model)
timeStart = 0.0
timeEnd = 10.0
numPoints = 50
results = rrPython.simulateEx(timeStart, timeEnd, numPoints)
print results
S1 = results[:,2]
S2 = results[:... |
from unittest import TestCase
import orbital_transfer_pathfinder.lib.mmath.mmath as mmath
class Test(TestCase):
def test_v_avg(self):
self.assertEqual(mmath.v_avg(10), 10,
"v_avg() should be able to calculate average for 1 parameter.")
self.assertEqual(mmath.v_avg(5, 10,... |
from datetime import datetime
from io import StringIO
import logging
import os
from Bio import Entrez, Medline
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker, scoped_session
from zope.sqlalchemy import ZopeTransactionExtension
import transaction
from src.models import Referencedbentity, ... |
import time
import threading
from unittest import SkipTest
from threading import Event
import param
from holoviews.core.spaces import DynamicMap
from holoviews.core.options import Store
from holoviews.element import Curve, Polygons, Path, HLine
from holoviews.element.comparison import ComparisonTestCase
from holovie... |
import re
import functools
import colander
import venusian
import six
from pyramid import exceptions as pyramid_exceptions
from pyramid.decorator import reify
from pyramid.security import Everyone
from pyramid.httpexceptions import (HTTPNotModified, HTTPPreconditionFailed,
HTTPNotFo... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Extinction functions."""
import os
import numpy as np
from scipy.ndimage import map_coordinates
import astropy.coordinates as coord
import astropy.units as u
from astropy.io import fits
from astropy.utils import isiterable
from astropy.config import ... |
from __future__ import absolute_import, division
"""
Modules for using Caterpillar-GAMMA data
"""
import numpy as np
import itertools
from scipy import interpolate, optimize
from NuPyCEE import omega, sygma, stellab
from JINAPyCEE import gamma, omega_plus
from . import plot, calc
#### Define some element informat... |
# -*- coding: utf-8 -*-
"""
Copyright 2017-2018 Shota Shimazu.
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 appl... |
# 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 ... |
# -*- utf-8 -*-
from PyQt5 import QtCore,QtGui,QtWidgets
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
import re,requests,os,sys,queue,time,subprocess
from bs4 import BeautifulSoup
from fake_useragent import UserAgent
import threading
ua = UserAgent()
all_header_checkbox = []
clas... |
import gym
import numpy as np
from collections import deque
import sys
class Agent:
def __init__(self, Q, env, mode, eps=1.0, alpha=0.01, gamma=1.0):
self.env = env
self.Q = Q
self.eps_min = 0.00001
self.eps = eps
self.gamma = gamma
self.shape = int(np.sqrt(self.en... |
class GameBoard:
def __init__(self, size=3):
# TODO: make dynamic
self.board = [
[0, 0, 0],
[0, 0, 0],
[0, 0, 0]
]
def make_move(self, value, pos_x, pos_y):
if pos_x > 3 or pos_y > 3:
print("invalid index")
return
... |
dia = input("Digite seu dia de nascimento ")
mes = input("Digite seu mês de nascimento ")
ano = input("Digite seu ano de nascimento ")
print("Sua data de nascimento é {}/{}/{}".format(dia, mes, ano))
|
# Copyright 2019 TWO SIGMA OPEN SOURCE, 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 agre... |
#!/usr/bin/env python3
import os
import sys
import subprocess
PKG_DIR = os.path.dirname(os.path.realpath(__file__))
def main():
main_script = os.path.join(PKG_DIR, 'main')
main_args = [main_script] + sys.argv[:1]
return subprocess.run(main_args).returncode
if __name__ == "__main__":
sys.exit(main(... |
from django.conf import settings
def site_data(request):
return {
"django_debug": settings.DEBUG,
}
|
from django.contrib import admin
from .models import UserProfile,ItemListed ,Comment ,cart
admin.site.register(UserProfile)
admin.site.register(ItemListed)
admin.site.register(Comment)
admin.site.register(cart)
# Register your models here.
|
# -*- coding: utf-8 -*-
import xlrd,os,shutil,re,getopt,sys
from toolkits import tools
CURPATH = os.path.split(os.path.realpath(__file__))[0]
# 正则替换
RE_REPS = (
("/\*{1,2}[\s\S]*?\*/",""),
("//[\s\S]*?\n",""),
("[\s]+"," ")
)
# 类型格式
TYPE_FMT = {
"int8" :("b","0"),
"uint8" :("B","0"),
"int16" :("h","0"),
"... |
# Generated by Django 2.1.1 on 2019-04-20 15:44
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('partners', '0003_historicalcampuspartner_historicalcampuspartneruser_historicalcommunitypartner_historicalcommunitypa'),
]
operations = [
migrations... |
from .godnames import *
|
import numpy as np
import pandas as pd
#import seaborn as sns
import matplotlib.pyplot as plt
dataset = pd.read_csv(r"C:\Users\Poulomi\Desktop\python new\real estate eval")
#dataset = pd.read_csv(r"F:\python new\teacher assistant evaluation details\teacher eval data.csv")
import sklearn
from sklearn.fe... |
import url_normalize
from urlutility import URLUtility
from page import Page
class Website(object):
def __init__(self, url):
#url = url_normalize.url_normalize(url)
self.host = URLUtility.get_host(url)
self.pages = []
self.word_set = set()
self.vsm = None
self.jaccar... |
import torch
import numpy as np
import os
import uuid
from p2m_options import MANIFOLD_DIR
import glob
def manifold_upsample(mesh, save_path, Mesh, num_faces=2000, res=3000, simplify=True):
# export before upsample
fname = os.path.join(save_path, 'recon_{}.obj'.format(len(mesh.faces)))
mesh.export(fname)
... |
# -*- coding: utf-8 -
"""Test debugging warning.
This file is part of project oemof (github.com/oemof/oemof). It's copyrighted
by the contributors recorded in the version control history of the file,
available from its original location oemof/tests/tool_tests.py
SPDX-License-Identifier: MIT
"""
import warnings
imp... |
# Copyright 2016, 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 The IETF Trust 2008, All Rights Reserved
from django.conf.urls import include
from django.views.generic import RedirectView
from django.conf import settings
from ietf.group import views, views_edit
from ietf.utils.urls import url
urlpatterns = [
url(r'^$', views.active_groups),
url(r'^summary.tx... |
# This scripts also follows standard Flower tutorial from
# https://flower.dev/docs/example-pytorch-from-centralized-to-federated.html
# =======================================================
import os
import matplotlib.pyplot as plt
# import cv2
from PIL import Image
import numpy as np
import nibabel as nib
# !pi... |
# 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 th... |
import csv
class DataFile:
"""A class to represent a File provided by the user containing data
Attributes:
path (property): str
- absolute path of the file
delimeter (read-only property): str
- delimeter of the file
has_headers (read-only property): bool
... |
from datetime import datetime
import spiceypy as spice
from glob import glob
import numpy as np
import os
def findIDSPK(n, key):
loc = 2 #order setting bsp files (1=DEXXX.bsp, 2=Ast.bsp)
m, header, flag = spice.dafec(loc, n)
spk = ''
for row in header:
if row[:len(key)] == key:
spk... |
from __future__ import unicode_literals
from __future__ import print_function
from ..cache import Cache
from collections import OrderedDict, namedtuple
from time import time as get_time
import logging
log = logging.getLogger("moya.runtime")
CacheEntry = namedtuple("CacheEntry", "value,expire_time")
class Memory... |
"""
Unit and regression test for kissim.io.PocketDataFrame class methods.
Note that class
- methods (`from_structure_klifs_id`)
- attributes (`_residue_ids`, `residue_ixs`) and
- properties (`residues`)
are tested in test_io.py.
Note also that PocketDataFrame is a subclass of opencadd's PocketKlifs class,
which is... |
#!/usr/bin/env python
import sys
import rospy
from math import atan2
from sensor_msgs.msg import Range
from geometry_msgs.msg import Pose
from geometry_msgs.msg import PoseStamped
from tf.transformations import quaternion_from_euler
class UWB_Lidar_Position :
def __init__(self) :
'''
Init node, subsc... |
#!/usr/bin/env python
# encoding: utf-8
"""
__init__.py
Created by Ponzoni Cuadra, Nelson E. on 2015-09-21.
Copyright (c) 2015 Ponzoni Cuadra, Nelson E.. All rights reserved.
"""
from rbm import RBM
|
import copy
import operator
class Error (Exception): pass
class VcfRecord:
def __init__(self, line):
'''Constructs VcfRecord from a line of a VCF file.
Assumes only one sample in the file'''
assert not line.startswith('#')
fields = line.rstrip().split('\t')
# #CHROM ... |
# -*- coding:utf-8 -*-
# Copyright (c) 2020 Huawei Technologies Co.,Ltd.
#
# openGauss is licensed under Mulan PSL v2.
# You can use this software according to the terms
# and conditions of the Mulan PSL v2.
# You may obtain a copy of Mulan PSL v2 at:
#
# http://license.coscl.org.cn/MulanPSL2
#
# THIS SOFTWARE... |
from __future__ import annotations
from typing import List, Tuple, Union
from collections import deque
import numpy as np
import torch
from config import OthelloConfig
from utils.game import Othello
from utils.model import Network
class ReplayBuffer(object):
def __init__(self, buffer: list):
cfg = Othel... |
"""
Admin for the records app
"""
from django.contrib import admin
from .models import Education, Experience, Project, Skill, Social
@admin.register(Education, Experience, Project, Skill, Social)
class RecordAdmin(admin.ModelAdmin):
pass
|
"""
:summary: Testing setup
:license: Apache License, Version 2.0
:author: Mark LaPerriere
:contact: otupman@antillion.com
:copyright: Mark LaPerriere 2015
"""
__docformat__ = "restructuredtext en"
import os
import logging
import uuid
from rundeck.client import Rundeck
from rundeck.api import RundeckApi, RundeckNode... |
# Copyright 2019 Huawei Technologies Co., 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 agreed to... |
# -*- coding: utf-8 -*-
"""
Common functionality for API endpoints.
"""
import typing as tp
from fastapi import (
Depends,
HTTPException,
status,
)
from fastapi.security import OAuth2PasswordBearer
from jose import jwt
from pydantic import ValidationError
from app import schema
from app.core import securi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.