content stringlengths 5 1.05M |
|---|
import datetime
import io
import pickle
from whylogs.app import Session
from whylogs.core.datasetprofile import DatasetProfile
def profiles_eq(profile1: DatasetProfile, profile2: DatasetProfile):
assert set(profile1.columns) == set(profile2.columns)
assert profile1.constraints == profile2.constraints
ass... |
#!/usr/bin/env python3
import os
import sys
import argparse
from codegen import fblas_types
sys.path.append(os.path.dirname(os.path.dirname(__file__)))
from codegen import fblas_codegen
from codegen import json_parser
from codegen import fblas_types
if __name__ == '__main__':
parser = argparse.ArgumentParser()
... |
import numpy as np
import matplotlib.pyplot as plt
import datetime as dt
import pandas as pd
#snp1=np.loadtxt('S&P2001-2010.csv',dtype='float',delimiter=',',usecols=(4),unpack=True)
#snp11=np.loadtxt('S&P2011-2020.csv',dtype='float',delimiter=',',usecols=(4),unpack=True)
dji1=np.loadtxt('DJI2001-2010.csv',dtype... |
import brownie
import pytest
import math
@pytest.mark.parametrize("amount", [1, 100, 10**18])
def test_mutiple_withdraw_mock(amount, alice, bob, charlie, dave, mock_vault, alcx, mock_ss_compounder):
prior_alcx_balance_alice = alcx.balanceOf(alice)
prior_alcx_balance_bob = alcx.balanceOf(bob)
prior_alcx_b... |
from django.conf.urls import include, url
from django.urls import path
from . import views
app_name = 'notes'
urlpatterns = [
path('',views.WorkToNote, name='notes'),
# url(r'^$', views.WorkToNote, name='notes'),
] |
# -*- coding: utf-8 -*-
from plugpy.ext.skype import SimpleSkypePlugin
import itertools
import mimetools
import mimetypes
from cStringIO import StringIO
import urllib2
import os
import feedparser
from pyquery import PyQuery as pq
import random
import tempfile
import Image
url = "http://pinkimg.blog57.fc2.com/?xml"
... |
# Python - 3.6.0
stray = lambda arr: [n for n in set(arr) if arr.count(n) == 1][0]
|
#!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2006-2015 (ita)
"""
Tool Description
================
This tool helps with finding Qt5 tools and libraries,
and also provides syntactic sugar for using Qt5 tools.
The following snippet illustrates the tool usage::
def options(opt):
opt.load('compiler_cxx qt... |
from macropy.core.test.macros.quote_macro import macros, my_macro
def run(x):
pass
pass
with my_macro:
pass
pass
return x
|
__author__ = 'yinpengcheng'
|
import numpy as np
#np.set_printoptions(threshold=np.nan)
import os
from models_pointnet import QueryAndGroup, PointNetMLP
from config import Config as cfg
import torch.utils.data
from utils import create_dir
torch.set_printoptions(precision=8)
path_to_pcl_data = "/mnt/raid/pablo/data/FlyingThings3D/pointcloud_voxe... |
from cloudshell.shell.core.driver_context import ResourceCommandContext, AutoLoadDetails, AutoLoadAttribute, \
AutoLoadResource
from collections import defaultdict
class LegacyUtils(object):
def __init__(self):
self._datamodel_clss_dict = self.__generate_datamodel_classes_dict()
def migrate_autol... |
from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
from app.core.models import *
class RegistroDesocupado(UserCreationForm):
dni = forms.CharField(required=True)
fecha_nacimiento = forms.DateField(required=True)
profesion = forms.Char... |
get_distance_inches(short_range=False)
Gets the measured distance in inches.
Parameters
short_range
Whether or not to use short range mode. Short range mode increases accuracy, but it can only detect nearby objects.
Type
:
boolean
Values
:
True or False
Default
:
False
Returns
The measured distance or "none" if the dis... |
from django.contrib import admin
from .models import SubShop
admin.site.register(SubShop)
|
from __future__ import annotations
import logging
import numpy as np
from collections import defaultdict
from typing import Dict, Optional, List
from .common import Vec2, dist2
from .events import AnimationEndedEvent, Event, PlayerShootEvent
from .graphics import Canvas, Line, LineType, Sprite, AnimatedSprite
from .... |
from functools import wraps
try: # Assume we're a sub-module in a package.
from utils import arguments as arg
from loggers.logger_interface import LoggerInterface
from loggers.extended_logger_interface import ExtendedLoggerInterface, LoggingLevel
from loggers.selection_logger_interface import Selectio... |
#!/usr/bin/python
# Copyright (C) 2010-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 ... |
from typing import Any
class ContainsLoopError(Exception):
pass
class Node:
def __init__(self, data: Any) -> None:
self.data = data
self.next_node = None
def __iter__(self):
node = self
visited = []
while node:
if node in visited:
rais... |
"""
Functionality related to updating dynamic update packages and
engine upgrades
"""
from smc.base.model import SubElement
from smc.administration.tasks import Task
class PackageMixin(object):
"""
Manages downloads and activations of update packages and software
upgrades
"""
def download(self, t... |
"""Contains class for model training."""
import os
import itertools
import time
import numpy as np
import imageio
import torch
import torch.optim as optim
from torch import nn
from torch.utils.data import DataLoader
from ..utils.visualize import (
plot_boxes, plot_grad_flow, plot_patches, plot_bg, get_reward_ann... |
# vim:fileencoding=utf-8:noet
import sys
if sys.version_info < (2, 7):
from unittest2 import TestCase, main # NOQA
from unittest2.case import SkipTest # NOQA
else:
from unittest import TestCase, main # NOQA
from unittest.case import SkipTest # NOQA
|
"""
:file: tracker.py
:author(s): Louis Cruz, Frank Chan, Orens Xhagolli
:description: Module that contains functions that poll the LeapMotion device
"""
import Leap #LeapMotion module
import math
def get_hand(controller, hand, log=False):
""" Hand handler.
:par... |
##
# Copyright 2021 IBM Corp. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
##
from .neuron import _NeuronActivation
"""
Static neuron activation function
"""
class _StaticActivation(_NeuronActivation):
pass
|
"""
GaleraCnf - file ``/etc/my.cnf.d/galera.cnf``
=============================================
This module provides parsing for the galera configuration of
MySQL. The input is the contents of the file
`/etc/my.cnf.d/galera.cnf`. Typical contents of the `galera.cnf`
file looks like this::
[client]
port = 330... |
from flask import Blueprint
main = Blueprint('main', __name__,
template_folder='templates',
static_folder='static',
static_url_path='/main')
from . import routes
|
import strax
import straxen
from straxen.get_corrections import get_correction_from_cmt
import numpy as np
import numba
from straxen.numbafied_scipy import numba_gammaln, numba_betainc
from scipy.special import loggamma
import tarfile
import tempfile
export, __all__ = strax.exporter()
@export
@strax.takes_config(
... |
import numpy as np
import matplotlib.pyplot as plt
from awave.experimental.filters import gabor_filter, edge_filter, curve_filter
from awave.experimental.filters_agg import *
import awave.experimental.viz as viz
from tqdm import tqdm
from pytorch_lightning.core.lightning import LightningModule
import torchmetrics
impor... |
import os
import re
import sys
from io import BytesIO
from distutils import log
from distutils.cmd import Command
from subprocess import check_output
from distutils.errors import DistutilsError
def simple_call(cmd):
return check_output(cmd.split(" "))
class SimpleCommand(Command):
"""Default behavior for si... |
# -*- coding: utf-8 -*-
# pylint: disable=wrong-import-position
"""IPX Socket Types"""
###############################################################################
# NOTE: fix duplicated name of ``socket```
import sys
path = sys.path.pop(0)
##########################################################################... |
from pylab import *
import os
from os.path import join
import pickle
dirname = "dqn_atari"
data = pickle.load(open(os.path.join(dirname, 'Q1_huber_loss_delta=2.pkl'),'rb'))
fig, ax = plt.subplots(figsize=(25,20))
ax.set_title("Graph representing Q-Learning results on Pong for Huber_Loss delta = 2")
ax.set_xlabel("It... |
"""Utilities for translating ORF detection
"""
import warnings
from collections import Counter
from collections import defaultdict
import pysam
from tqdm import *
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
import numpy as np
import pa... |
import pytest
@pytest.mark.vcr
def test_vcrtest(dataproxy):
seq = dataproxy.get_sequence("NC_000013.11",50_000_000,50_000_050)
assert len(seq) == 50
assert seq == "TTAGGTGTTTAGATGATTTCTAAGATGCTTTTAAGCCCAGTATTTCTATT"
|
# coding=utf-8
from google.appengine.ext import ndb
class BookRecord(ndb.Model):
# item_ids are stored in key like so '1234|345345|345254352'
item_id_array = ndb.StringProperty(repeated=True)
author = ndb.StringProperty(indexed=False)
title = ndb.StringProperty(indexed=False)
year = ndb.IntegerPro... |
import unittest
from languages.asp.asp_mapper import ASPMapper
from test.language.asp.cell import Cell
class ASPMapperTest(unittest.TestCase):
def runTest(self):
instance = ASPMapper.get_instance()
try:
instance.register_class(Cell)
obj = instance.get_object("cell(1,2,5... |
numbers = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55]
even_numbers = [n for n in numbers if n % 2 == 0]
print(even_numbers) |
'''
Crie um programa que leia um número inteiro
e mostre na tela se ele é par ou ímpar.
'''
num = int(input('Digite um número inteiro: '))
if num % 2 == 0:
print('O número {} é PAR!'.format(num))
else:
print('O número {} é ÍMPAR!'.format(num))
|
nome=input('Olá amigo(a)! como você se chama? ')
print('Que belo nome! Muito prazer em te conhecer {}! Meu nome é Rex!'.format(nome))
idade=input('Quantos anos você tem? ')
print('Nossa, quanta experiência né? Hahaha. Eu tenho 74 anos. ')
conta=input('quero praticar minha matemática... Você pode me ajudar? ')
sub=int(7... |
import bs4
import requests
import smtp,time
url = "Url_to_the_product"
headers = {"User-Agent": 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36'}
#Scraping the data according the url provided
def check_price():
page = requests.get(url... |
#crop_map.py
def crop_map( image , xi, xf, yi, yf):
#"Crops the map out of the whole screenshot"
print(image)
map_img = image[xi:xf][yi:yf]
return [map_img] |
# Licensed to the .NET Foundation under one or more agreements.
# The .NET Foundation licenses this file to you under the Apache 2.0 License.
# See the LICENSE file in the project root for more information.
import collections
import unittest
from iptest import IronPythonTestCase, path_modifier, run_test
glb = 0
res ... |
import re
from exclude_modules_b import match
def a():
re.match()
def b():
match()
a()
b()
|
from pathlib import Path
import aiofiles
import asyncio
from inflection import underscore
import aiodocker
import os
import re
from prodict import Prodict
import ujson
import subprocess
from pprint import pprint
from .. import logger
"""
links:
http://aiodocker.readthedocs.io/en/latest/
https://docs.docker.com/engine... |
from __future__ import unicode_literals
from django.utils.translation import ugettext_lazy as _
from navigation import Link
def has_usable_password(context):
return context['request'].user.has_usable_password
link_logout = Link(
icon='fa fa-sign-out', text=_('Logout'), view='authentication:logout_view'
)
... |
# Copyright 2021 NVIDIA Corporation
#
# 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 numpy as np
import scipy as sc
import os
import time
from sklearn.datasets import make_circles
# CREAR DATASET
n = 10 # FILAS DEL DATASET
p = 2 # COLUMNAS DEL DATASET
xi = [[-1, 0],[1, 0], [-0.5, 0], [0.5, 0]]
yi = [0,0,1,1]
x, y = make_circles(n_samples=n, factor=0.5, noise=0.05)
y = y[:, np.newaxis]
#x =... |
"""
Evaluate the model using Eigen split of KITTI dataset
- prepare gt depth running the script https://github.com/nianticlabs/monodepth2/blob/master/export_gt_depth.py
"""
import argparse
import os
import cv2
import numpy as np
import tensorflow as tf
from tqdm import tqdm
from eval_utils import compute_errors, comp... |
from django.contrib import admin
from django import forms
from django.db import models
from django.conf import settings
from academic.content.models import *
admin.site.register(Download)
|
import csv
result = list(csv.reader(open("predictions_test.csv", "r", encoding="utf-8")))
result.remove(result[0])
real_result = [i[0] for i in result]
oringin_answer = list(csv.reader(
open("test_stances_unlabeled.csv", "r", encoding="utf-8")))
oringin_answer.remove(oringin_answer[0])
real_answer = []
f... |
# relative import hack
# https://stackoverflow.com/questions/16981921/relative-imports-in-python-3
import os, sys; sys.path.append(os.path.dirname(os.path.realpath(__file__)))
|
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="river-engine",
version="0.0.1a",
author="cysnake4713",
author_email="cysnake4713@gmail.com",
description="A framework to synchronize between different data source",
long_description=lo... |
from __future__ import print_function
import maya.cmds as cmds
def cancelCallback(windowID, *pArgs ):
if cmds.window( windowID, exists=True ):
cmds.deleteUI( windowID )
def text_val(field):
return cmds.textField( field, query=True, text=True )
|
import sys
import os
from time import time
from glob import glob
from scipy import io
import multiprocessing as mp
sys.path.append('../pc2convex')
sys.path.append('../npy2mat')
from npy2mat import mat2npy
from my_utils import *
from frame import frame_gen
from segmentation import label_pts, segmentation
import config... |
from flask_app import application
if __name__ == '__main__':
application.run(debug=True, host='0.0.0.0', port='5000')
|
from typing import Any, Dict
from fennel.client.actions import result
from fennel.client.state import get_status
from fennel.exceptions import ResultsDisabled, TaskFailed
from fennel.job import Job
from fennel.utils import EMPTY
class AsyncResult:
def __init__(self, job: Job, app):
"""
A handle f... |
import requests
import json
url = "http://127.0.0.1:5000/tweets/"
json_input={"message":"oxygen AND agra AND verified"}
j_data=json.dumps(json_input)
headers = {'content-type': 'application/json', 'Accept-Charset': 'UTF-8'}
r = requests.post(url, data=j_data, headers=headers)
print(r, r.text)
|
#!/usr/bin/python2.7
# Copyright 2016 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... |
from tamproxy import Sketch, SyncedSketch, Timer
from tamproxy.devices import Motor
# Cycles a motor back and forth between -255 and 255 PWM every ~5 seconds
class MotorWrite(Sketch):
def setup(self):
self.motor = Motor(self.tamp, 2, 3)
self.motor.write(1,0)
self.delta = 1
self.mo... |
# Use GPS locations and elapsed time to get maximum speeds.
from datetime import datetime
from osgeo import ogr
import ch7funcs
date_format = '%Y-%m-%d %H:%M:%S.%f'
ds = ogr.Open(r'D:\osgeopy-data\Galapagos')
lyr = ds.GetLayerByName('albatross_lambert')
# Loop through each tag, initialize max_speed to 0, and limit t... |
"""Schema module for GraphQL."""
from collections import OrderedDict
import logging
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
import graphene
from graphene.types import generic
from nautobot.circuits.graphql.types import CircuitTerminationType
from nautobot.core.grap... |
import copy
import time
import warnings
import numpy as np
from .bnet import partition
from .mcmc_moves import DAG_edgerev, R_basic_move, R_swap_any
class PartitionMCMC:
"""Partition-MCMC sampler :footcite:`kuipers:2017` with efficient
scoring."""
def __init__(
self,
C,
score,
... |
#######################################################################
# Copyright (C) #
# 2017-2018 Shangtong Zhang(zhangshangtong.cpp@gmail.com) #
# Permission given to modify the code as long as you keep this #
# declaration at the top ... |
#!/bin/python3
def rotLeft(a, d):
b = a[:]
for i in range (0,len(a)):
newLocation = (i + (len(a) - d)) % len(a)
a[newLocation] = b[i]
return a
if __name__ == '__main__':
nd = input().split()
n = int(nd[0])
d = int(nd[1])
a = list(map(int, input().rstrip().split()))
... |
import os, logging, re
from datetime import datetime
import hashlib
from pprint import pprint
from collections import Counter
import html
import geopandas as gpd
from . import unicodetokeniser
from . import geo
##########
# util
##########
def hash(prefix, str):
return prefix + '_' + hashlib.sha256(str.lower().... |
# -*- coding: utf-8 -*-
import pytest
from io import BytesIO
from lxml import etree
from pyramid.path import DottedNameResolver
from shapely.geometry import MultiPolygon, Polygon
from pyramid_oereb.core.records.disclaimer import DisclaimerRecord
from pyramid_oereb.core.records.extract import ExtractRecord
from pyrami... |
# Generated by Django 3.2.3 on 2021-06-07 11:09
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('base', '0004_auto_20210607_1216'),
]
operations = [
migrations.AddField(
model_name='neighborhood',
name='descriptio... |
import argparse
# ------------------------------------------------------------------------------
def collision_checker(obstacle_map: list, dx: int, dy: int, verbose: bool) -> int:
""" Lool for tree collisions along the specified path, return the number of collisions
Inputs:
obstacle_map: list - The grid map ... |
#encoding:utf-8
# Create your views here.
from django.shortcuts import render_to_response
from django.template.context import RequestContext
from Application import util
from forms import CuadroForm, DescripcionForm
from Application.forms import AutorForm
from django.core.paginator import Paginator, EmptyPage, PageNot... |
""""
This script solves the famous "fold piece of paper to the moon" problem
Problem description: how many times would you have to fold a piece of paper onto itself to reach the Moon?
"""
import numpy as np
# paper width in meters: 0.1 mm
paperWidth = 0.1*10**-3
# distance earth moon: 384,400 km
distance = 384... |
# Copyright 2018 PerfKitBenchmarker 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 appli... |
#! python
import numpy as np
import cv2
import datetime
import PyCapture2 as fc2
import sys
import time
import os
import re
import skimage.io as io
import csv
from itertools import islice
import beeDataAcq.cameraSetup as cs
####################################################################
### Get a calibration... |
#!/usr/local/bin/python
# -*- coding: utf-8 -*-
# Author: illuz <iilluzen[at]gmail.com>
# File: AC_simulation_n.py
# Create Date: 2015-07-29 20:57:10
# Usage: AC_simulation_n.py
# Descripton:
# Definition for a binary tree node.
class TreeNode:
def __init__(self, x):
self.val = x
... |
# Assumes ODBLink MX on Bluetooth COM port, attached to 2019 Audi e-tron. Should also work with other ELM327 adapters.
import collections
import numpy as np
import serial
import time
from matplotlib import pyplot as plt
from matplotlib.animation import FuncAnimation
import logging
import sys
import requests
liveplot ... |
"""JSON osid metadata configurations for proxy service."""
from .. import types
from ..primitives import Type
DEFAULT_LANGUAGE_TYPE = Type(**types.Language().get_type_data("DEFAULT"))
DEFAULT_SCRIPT_TYPE = Type(**types.Script().get_type_data("DEFAULT"))
DEFAULT_FORMAT_TYPE = Type(**types.Format().get_type_data("DEFAUL... |
def activitySelect(start, finish):
activities = []
finTime = max(finish)
for i in xrange(len(start)):
activity = (start[i], finish[i])
activities.append(activity)
activities.sort(key=lambda x: x[1])
time = 0
selected = []
while (time < finTime):
activity = None
... |
import keras
import skimage.transform as tf
import numpy as np
import random
import scipy
class BaseGenerator(keras.utils.Sequence):
def __init__(self, batch_size, input_shape, augment):
self.batch_size = batch_size
self.input_shape = input_shape
self.augment = augment
self._mid ... |
"""
Convex Contracts for Starfish
"""
__version__ = '0.0.2'
|
# @lc app=leetcode id=583 lang=python3
#
# [583] Delete Operation for Two Strings
#
# https://leetcode.com/problems/delete-operation-for-two-strings/description/
#
# algorithms
# Medium (52.97%)
# Likes: 2154
# Dislikes: 39
# Total Accepted: 93.1K
# Total Submissions: 174.8K
# Testcase Example: '"sea"\n"eat"'
#
... |
import numpy as np
import cv2
def det_banana(filename):
cap = cv2.VideoCapture(filename)
# take first frame of the video
ret,frame = cap.read()
cv2.imwrite(filename+".jpg",frame)
# setup initial location of window
r,h,c,w = 250,90,400,125 # simply hardcoded the values
track_window = (c,r... |
from gitlab import Gitlab
def create(key, repository, title, description, head, base='master', close_source_branch=False, reviewer=None,
label=None, url='https://gitlab.com/', **_):
if not reviewer:
reviewer = []
gl = Gitlab(url=url, private_token=key)
assignee_ids = [
gl_id(r, ... |
""""""
import sys
import time
import matplotlib.pyplot as plt
import matplotlib as mpl
import numpy as np
import os
import pandas as pd
from calc_execwise_features import calc_simulation_metrics as load_and_calc_simulation_metrics # Borrowed function
from nodewise_features_metapop import calc_node_metric, load_and_p... |
from polygraphy.tools.data.data import Data
|
from igramscraper.instagram import Instagram
from time import sleep
import os
from os import path
import datetime
import discord_webhook
import ast
import sys
from pytz import timezone
FOLLOWER_LIMIT = 10**6
#Your instagram bot account username
insta_username = 'Enter your bot insta ID'
#Your instagram bot account p... |
from django.contrib import admin
from notenrechner.models import Fach
admin.site.register(Fach)
|
# -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# https://doc.scrapy.org/en/latest/topics/items.html
import scrapy
class RencaiItem(scrapy.Item):
job_name=scrapy.Field()
company = scrapy.Field()
salary = scrapy.Field()
degree = scrapy.Field()
exp... |
#!/usr/bin/env python
import sys
import os
def split(delimiters, string, maxsplit=0):
import re
regexPattern = '|'.join(map(re.escape, delimiters))
return re.split(regexPattern, string, maxsplit)
def toHtml(input, outputPart="full"):
head=input.split("$content")[0]
body=input.split("$content")[1]
hea... |
from torch import nn
import torch.nn.functional as F
import torch
import numpy as np
from torch.quantization.default_mappings import DEFAULT_QAT_MODULE_MAPPING
from torch.quantization.observer import MinMaxObserver
_NBITS = 8
_ACTMAX = 4.0
class MovingAverageQuantileObserver(MinMaxObserver):
def __init__(self... |
import scipy.io as sio
import math
import pyqtgraph as pg
from pyqtgraph.Qt import QtCore, QtGui
import numpy as np
from matplotlib import pyplot as plt
from datetime import datetime
import WetLab_NewportDelayStage as dstage
import time
import os
from ctypes import *
import ctypes as ct
ADQAPI = cdll.LoadLibrary("A... |
from .base import *
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = []
# Database
# https://docs.djangoproject.com/en/3.1/ref/settings/#databases
DATABASES = {
'default': env.db('DEV_DB_URL')
}
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.... |
# 17269
cnt = list(map(int,input().split(" ")))
names = list(map(str, str(input()).upper().split(" ") ))
line = [3,2,1,2,4,3,1,3,1,1,3,1,3,2,1,2,2,2,1,2,1,1,1,2,2,1]
length = len(names[0]) if len(names[0]) >= len(names[1]) else len(names[1])
fit_num = []
for i in range(0, length) :
if i < cnt[0] :
fit_num... |
#!/usr/bin/env python3
"""
A set of utilities for handling rr graph GSB data.
"""
import os
from collections import namedtuple
import lxml.etree as ET
# =============================================================================
class GsbEntry:
"""
Stores a single GSB entry which corresponds to a single N... |
import unittest
import numpy as np
from openaerostruct.aerodynamics.wave_drag import WaveDrag
from openaerostruct.utils.testing import run_test, get_default_surfaces
from openmdao.api import Group, IndepVarComp, BsplinesComp
import numpy as np
class Test(unittest.TestCase):
def test(self):
surface = get_d... |
VERSION = (0, 5, 3,)
__version__ = '.'.join(map(str, VERSION))
default_app_config = 'django_rest_messages.apps.DjangoMessagesConfig'
|
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def printTree(self, root):
"""
:type root: TreeNode
:rtype: List[List[str]]
"""
def get_h... |
from fastapi import APIRouter, Query, Path, Body, HTTPException, Depends
from fastapi.openapi.utils import get_openapi
from uuid import UUID
from typing import List
from starlette.status import HTTP_201_CREATED, HTTP_204_NO_CONTENT, HTTP_200_OK
from starlette.responses import JSONResponse, HTMLResponse
# model librar... |
# !/usr/bin/env python
# coding: utf-8
"""
this script automates the process of slicing the same stl file with many possible combinations of command line arguments
that can be passed to slic3r
"""
import glob
import itertools as it
import logging
import os
from logging.config import dictConfig # pylint: disable=ungro... |
# Under MIT License, see LICENSE.txt
from math import ceil, sqrt
import numpy
from RULEngine.Util.constant import *
from RULEngine.Util.Position import Position
from ai.Algorithm.IntelligentModule import IntelligentModule
__author__ = 'RoboCupULaval'
class InfluenceMap(IntelligentModule):
"""
Une classe r... |
import sys
from rply.token import BaseBox, Token
from rply import ParsingError
# -hacking-
def _token_init(self, name, value, lineno=0):
self.name = name
self.value = value
self.lineno = lineno
def _basebox_getsourcepos(self):
return self.lineno
def _basebox_append_item(self, item):
raise No... |
#!/usr/bin/env python
# coding=utf-8
# Author: Yao
# Mail: zhangyao215@mails.ucas.ac.cn
import os
import argparse
import numpy as np
import pandas as pd
import nibabel as nib
from medpy import metric
from collections import OrderedDict
from scipy.ndimage.measurements import label
from metrics import *
join = os.path.... |
#!/usr/bin/python
# coding: utf-8
#
# example:
# $ ./xsvf -c disasm ../xsvf/XC2C64A/idcode_simpler.xsvf
#
import JTAGTAP
import XSVFDecoder
class XSVFDisassembler(XSVFDecoder.XSVFDecoder):
"""
XSVF Disassembler
"""
@staticmethod
def add_arguments(p):
"""Adds the necessary arguments to th... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.