content stringlengths 5 1.05M |
|---|
from nuscenes.nuscenes import NuScenes
nusc = NuScenes(version='v1.0-mini', dataroot='../../data/nuscenes-mini', verbose=True) |
import numpy
n, m = map(int, input().split())
arr = numpy.array([list(map(int, input().split())) for _ in range(n)])
arr = numpy.min(arr, axis=1)
arr = numpy.max(arr)
print(arr)
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... |
# coding: utf-8
from tests.util import BaseGrabTestCase
from tests.spider_sigint import BaseKeyboardInterruptTestCase
SCRIPT_TPL = '''
import sys
import logging
try:
from grab import Grab
import os
import grab
#logging.error('PATH: ' + grab.__file__)
#logging.error('PID: ' + str(os.getpid()))
g... |
import magma
def AXI4SlaveType(addr_width, data_width):
"""
This function returns a axi4-slave class (parameterized by @addr_width and
@data_width) which can be used as the magma ports with these inputs
and outputs
Below is AXI4-Lite interface ports in verilog
input logic [`$axi_addr_width-1`... |
#Задача №1 Вариант 9
#Программа выводит имя и запрашивает его псевдоним
#Гасанов АФ
#29.02.2016
print ("Герой нашей сегоднящней программы - Доменико Теотокопули")
psev=input("Под каким же именем мы знаем этого человека? Ваш ответ:")
if (psev)==("Эль Греко"):
print ("Всё верно: - Доменико Теотокопули"+psev)... |
"""
- Double check that the targets are correct
- verify that substorms.get_next(input_idx + return idx) == input_idx + return idx
- verify all >= 0
- create files to test different situations?
- missing data -> mask is correct
""" |
USAGE = """USAGE
$ python anipix.py [imfile1] [imfile2] [outfile] [--color]
[outfile] must be .mp4
[--c] is an optional flag to use color mode (slower)
Examples:
$ python anipix.py cameraman.png lena.png gray.mp4
$ python anipix.py peppers.png mandrill.png color.mp4 --c
"""
if __name__ == "__main__":
... |
import numpy as np
from lmfit import Parameters
import sys
import os
sys.path.append(os.path.abspath('.'))
sys.path.append(os.path.abspath('./Functions'))
from utils import find_minmax
from PeakFunctions import Gaussian, LogNormal
from numba import jit
@jit(nopython=False)
def calc_dist(q,r,dist,sumdist):
ffactor... |
from tkinter import*
from tkinter import ttk
from tkinter import messagebox
import random
from datetime import date
import time
import sqlite3
root=Tk()
root.title("Cafe Management System")
root.geometry("1000x650")
root.resizable(width=False,height=False)
root.configure(bg="#220D0B")
logo = PhotoImage(file="logo.png... |
def get_version():
return "1.0.0"
|
import pygame
import time
import random
pygame.init()
white = (255,255,255)
black = (0,0,0)
red =(200,0,0)
light_red = (255,0,0)
yellow = (200,200,0)
light_yellow = (255,255,0)
green = (34,177,76)
light_green = (0,255,0)
display_width = 800
display_height = 600
clock = pygame.time.Clock()
gameDisplay = pygame.d... |
# Problem: https://www.hackerrank.com/challenges/apple-and-orange/problem
# Score: 10.0
first_multiple_input = input().rstrip().split()
s = int(first_multiple_input[0])
t = int(first_multiple_input[1])
second_multiple_input = input().rstrip().split()
a = int(second_multiple_input[0])
b = int(second_multiple_input[1]... |
from flask import Flask, jsonify, request
from Chem_Faiss import pipeline
import Chem_Faiss
app = Flask(__name__)
searcher = pipeline()
searcher.load_pipeline('sample')
mols = Chem_Faiss.load_sdf('molecules.sdf')
@app.route('/query', methods = ['GET','POST'])
def query():
d = request.get_json()
... |
from typing import Optional
from _custom_constants import *
import miscellaneous
import random
# defs is a package which claims to export all constants and some JavaScript objects, but in reality does
# nothing. This is useful mainly when using an editor like PyCharm, so that it 'knows' that things like Object, Cree... |
import os
import sys
from CM.CM_TUW40.f2_investment import dh_demand
from CM.CM_TUW40.f3_coherent_areas import distribuition_costs
path = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
if path not in sys.path:
sys.path.append(path)
def main(P, OFP):
# f2: calculate pixel based ... |
import os
import requests
import time
import random
import jieba
import matplotlib.pyplot as plt
from fake_useragent import UserAgent
from wordcloud import WordCloud, ImageColorGenerator
def get_response(user_agent, proxy_list, product_id, page):
url = 'https://sclub.jd.com/comment/productPageComments.action'
... |
####
####
####
#### Python Pocket Primer -
#### Exercises for chapter two
####
####
####
import sys
def wordPlay(list):
vowel = ['a','e','i','o','u']
list = list.split(' ')
v_list = []
for i in list:
if i[0] in vowel or i[-1] in vowel:
v_list.append(i)
dic ={}
for i in v_li... |
from .paac import PAAC
from .base_runner import BaseRunner
from .single_runner import SingleRunner
from .paac_runner import PAACRunner
from .eval_runner import EvalRunner
__all__ = ["BaseRunner", "SingleRunner", "PAACRunner"]
|
#!/usr/bin/env python
"""
create tilespecs from TEMCA metadata file
"""
import json
import os
import numpy
import renderapi
from asap.module.render_module import (
StackOutputModule, RenderModuleException)
from asap.dataimport.schemas import (GenerateEMTileSpecsOutput,
... |
# -*- coding: utf-8 -*-
import operator
import six
from sage.arith.misc import GCD
from sage.combinat.q_analogues import q_int
from sage.functions.generalized import sgn
from sage.functions.log import log
from sage.functions.other import ceil
from sage.functions.other import floor
from sage.functions.other import sqrt
... |
import sys
import os
import subprocess
from smt.sampling_methods import LHS
import numpy as np
from scipy import stats
from surmise.emulation import emulator
from dt import cross_section, s_factor
# Reduced mass in the deuteron channel.
MU_D = 1124.6473494927284
rel_unc = float(sys.argv[1])
indices = np.array([0, 1... |
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
# (c) 2013-2015 Zedge Inc.
#
# Author: Muhammad A. Norozi
# (ali@zedge.net)
import yaml
def get_options(config_file):
return yaml.load(open(config_file))
if __name__ == '__main__':
from pprint import PrettyPrinter
pp = PrettyPrinter()
c... |
from tkinter import *
from tkinter import messagebox
from tkinter import filedialog
from tkinter.ttk import Button, Style
from tkinter import ttk
import binascii
import os
import json
import sys
import base64
import datetime
import pprint
import copy
from core.client_core import ClientCore as Core
from transaction.tra... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import math
import numpy as np
from .AxiElement import AxiElement
from .Index import Index
from .tools import path_length,... |
from django.conf.urls import include, url
from . import views
urlpatterns = [
url(r'accounts/login/$',
'django.contrib.auth.views.login',
name='login'),
url(r'accounts/logout/$',
'django.contrib.auth.views.logout',
name='logout'),
url(r'^$', views.IndexView.as_view(), name=... |
from setuptools import setup, find_packages
long_description_text = '''
Pula is a python library that is meant to encompass the many various functions that the ordinary user
finds themselves needing in the different projects they are working on. These functions can span from
simple is_number functions all the way to ... |
# Copyright 2019-2021 by Peter Cock, The James Hutton Institute.
# All rights reserved.
# This file is part of the THAPBI Phytophthora ITS1 Classifier Tool (PICT),
# and is released under the "MIT License Agreement". Please see the LICENSE
# file that should have been included as part of this package.
"""Explore confli... |
# Generated by Django 2.0 on 2019-03-12 20:51
from django.db import migrations, models
import wagtail.core.blocks
import wagtail.core.fields
class Migration(migrations.Migration):
dependencies = [
('portfolio', '0016_auto_20190312_1954'),
]
operations = [
migrations.AddField(
... |
from __future__ import absolute_import
from __future__ import unicode_literals
from collections import defaultdict
from sqlalchemy.dialects.postgresql.base import PGDialect
from sqlalchemy.sql import sqltypes
from sqlalchemy import util, sql
from sqlalchemy.engine import reflection
from .base import BaseDialect, Mixed... |
#!/usr/bin/env python
# Copyright (c) 2014-2017 Max Beloborodko.
#
# 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
#
# Unl... |
"""
#####################################################################
Copyright (C) 1999-2015, Michele Cappellari
E-mail: michele.cappellari_at_physics.ox.ac.uk
For details on the method see:
Cappellari M., 2002, MNRAS, 333, 400
Updated versions of the software are available from my web page
http://purl.org/ca... |
"""Simple script for converting SVG files to PDF files."""
import argparse
import glob
import os
import subprocess
import sys
import textwrap
def main():
"""The main function of the application"""
try:
args = _parse_args()
svg_files = find_svgs(args.source_dir)
for svg in svg_files:... |
#
# Dynamic Routing Between Capsules
# https://arxiv.org/pdf/1710.09829.pdf
#
import torch
import torch.nn as nn
import torch.optim as optim
from torch.autograd import Variable
from torchvision import datasets, transforms
import torch.nn.functional as F
class Conv1(nn.Module):
def __init__(self, channels):
super(... |
# Generated by Django 3.0.7 on 2020-06-19 00:16
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0011_update_proxy_permissions'),
]
operations = [
migrations.CreateModel(
name='User',
f... |
from time import *
from base import *
def convert():
print("\n"+f"""\
{CRed}Valeur à convertir{CEnd}
""")
volumes = float(input(cmdline))
volumesChoices(volumes)
def volumesChoices(quantity):
print("\n"+f"""\
{CRed}Unité de volumes de base
\n
{CBlu... |
"""
BERT/RoBERTa layers from the huggingface implementation
(https://github.com/huggingface/transformers)
"""
import torch
import torch.nn as nn
import torch.nn.functional as F
from apex.normalization.fused_layer_norm import\
FusedLayerNorm as BertLayerNorm
from .modeling_utils import prune_linear_layer
import math... |
from django import forms
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from django.utils.translation import gettext_lazy as _
from core.admin_filters import UserIsActiveFilter
from .models import CustomUser, UserProfileDriver, \
UserProfileStaff
from .services import UserDeleteSe... |
from django.urls import path
from . import views
urlpatterns = [
path("sprawa-<int:case_pk>/", views.EventCreateView.as_view(), name="add"),
path("wydarzenie-<int:pk>", views.EventUpdateView.as_view(), name="edit"),
path(
"<int:year>-<int:month>",
views.CalendarEventView.as_view(month_form... |
# Generated from JavaParser.g4 by ANTLR 4.5.3
# encoding: utf-8
from antlr4 import *
from io import StringIO
def serializedATN():
with StringIO() as buf:
buf.write("\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\3q")
buf.write("\u0568\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7")
bu... |
"""
tests module
"""
import os
import sys
import sure
ROOT_DIR = os.path.join(os.path.dirname(__file__), "../..")
sys.path.append(ROOT_DIR)
|
from .binonobj import BinONObj
from .ioutil import MustRead
class IntObj(BinONObj):
kBaseType = 2
@classmethod
def DecodeData(cls, inF, asObj=False):
data = bytearray(MustRead(inF, 1))
byte0 = data[0]
if (byte0 & 0x80) == 0:
m = 0x7f
n = 1
elif (byte0 & 0x40) == 0:
m = 0x3fff
n = 2
elif (byt... |
from .genshin import get_user_stat
__all__ = ["get_user_stat"]
|
from bokeh.core.properties import (
Any, Bool, Dict, Either, Instance, List, Null, Nullable, String
)
from bokeh.models import ColumnDataSource, HTMLBox
class Perspective(HTMLBox):
aggregates = Either(Dict(String, Any), Null())
split_by = Either(List(String), Null())
columns = Either(List(Either(St... |
from validator.rules import Base64
def test_base64_01():
assert Base64().check("c2hPd1MgaSBMSWtFOg==")
assert Base64().check("U09VVEggUEFSSw==")
assert Base64().check("QkxBQ0sgTUlSUk9S")
assert Base64().check("RkFSR08=")
assert Base64().check("QnJlYUtJTkcgQmFkIA==")
def test_base64_02():
... |
#Free fall
#Askng for height
#Initial velociy is 0 m/s
#Acceleration due to gravity(g) = 9.8 sq.(m/s)
h = float(input("Enter the height = "))
#Final velocity = v
import math
v = math.sqrt(2 * 9.8 * h)
print("Final Velocity = ",v)
|
"""
"""
import os
import shutil
from pathlib import Path
from typing import List, Optional
from TestSuite.conf_json import ConfJSON
from TestSuite.global_secrets import GlobalSecrets
from TestSuite.json_based import JSONBased
from TestSuite.pack import Pack
class Repo:
"""A class that mocks a content repo
... |
import urllib, json
import sys
from __builtin__ import raw_input
from termcolor import colored
import os
import glob
import webbrowser
def jumbo():
print(colored(" .::.", "cyan"))
print(colored(" .:' .:", ... |
from pychology.behavior_trees import Action
from pychology.behavior_trees import Priorities
from pychology.behavior_trees import Chain
from pychology.behavior_trees import DoneOnPrecondition
from pychology.behavior_trees import FailOnPrecondition
import wecs
from wecs.panda3d.behavior_trees import DoneTimer
from wecs... |
version = "1.0.0a"
|
from django.core.management.base import BaseCommand, CommandError
from django.conf import settings
from django.db import connection
from django.db import IntegrityError
from django.utils.text import slugify
from django.http import HttpResponse, JsonResponse
from build.management.commands.base_build import Command as B... |
from dataclasses import dataclass
@dataclass
class FileContent:
content: str |
from itertools import product
from .constraints import Validator
def all_cut_edge_flips(partition):
for edge, index in product(partition.cut_edges, (0, 1)):
yield {edge[index]: partition.assignment[edge[1 - index]]}
def all_valid_states_one_flip_away(partition, constraints):
"""Generates all valid ... |
from ..lab2.TreeNode import TreeNode
from ..lab1.Type import Type
from ..lab1.Token import Token
from ..lab1.Tag import Tag
from ..lab2.NodeType import NodeType
from TypeException import TypeException
from SemanticException import SemanticException
class SemanticAnalyzer(object):
def __init__(self, symbol_table, ... |
#!/usr/bin/env python3 -u
"""
Main Script for training and testing
"""
import argparse
import json
import logging
import os
import pdb
import random
import sys
import time as t
from collections import OrderedDict
import numpy as np
import spacy
import torch
from torch import nn
from torch.optim.lr_scheduler import Red... |
# Demonstration showing plot of the 5 stations with the highest relative water levels as well as their best fit polynomials
import matplotlib.pyplot as plt
import matplotlib
from datetime import datetime, timedelta
from floodsystem.station import MonitoringStation
from floodsystem.plot import plot_water_level_with_fit... |
from sanic import Sanic
from sanic_cors import CORS
app = Sanic(__name__)
CORS(app) |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import logging
from progress.bar import ChargingBar
from scipy import linalg as LA
from .base import ComputationInterface
# noinspection PyUnr... |
from .. import db
class Enrollment(db.Model):
'''
Model handling the association between a user and the courses they are
enrolled in in a many-to-many relationship, with some added data
'''
__tablename__ = 'user_courses'
user_id = db.Column(db.Integer, db.ForeignKey('user.id'), primary_key=True)
course_id ... |
import sys
import os
# in order to get __main__ to work, we follow: https://stackoverflow.com/questions/16981921/relative-imports-in-python-3
PACKAGE_PARENT = '../..'
SCRIPT_DIR = os.path.dirname(os.path.realpath(os.path.join(os.getcwd(), os.path.expanduser(__file__))))
sys.path.append(os.path.normpath(os.path.join(SC... |
import argparse
import sys
from typing import Tuple
from bxcommon.models.blockchain_peer_info import BlockchainPeerInfo
from bxcommon.models.blockchain_protocol import BlockchainProtocol
from bxcommon.utils.blockchain_utils.eth import eth_common_constants
from bxgateway import log_messages
from bxutils import logging
... |
from setuptools import setup, find_namespace_packages
with open("README.md", "r") as fh:
long_description = fh.read()
setup(name='s3a_decorrelation_toolbox',
version='0.2.9',
description='Decorrelation algorithm and toolbox for diffuse sound objects and general upmix',
long_description=long_desc... |
# Creative Commons Legal Code
#
# CC0 1.0 Universal
#
# CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
# LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
# ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
# INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMON... |
# BLACK = \033[0;30m
# RED = \033[0;31m
# GREEN = \033[0;32m
# BROWN = \033[0;33m
# BLUE = \033[0;34m
# PURPLE = \033[0;35m
# CYAN = \033[0;36m
# YELLOW = \033[1;33m
# BOLD = \033[1m
# FAINT = \033[2m
# ITALIC = \033[3m
# UNDERLINE = \033[4m
# BLINK = \033[5m
# NEGATIVE = \033[7m
# CROSSED = \033[9m
# END = \033[0m
def... |
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('ct', '0002_auto_20141110_1820'),
]
operations = [
migrations.AlterField(
model_name='conceptlink',
name='relationship',
field=models.CharField(default='d... |
from pytest import mark
from ..crunch import crunch
@mark.parametrize(
"description,uncrunched,crunched",
[
["number primitive", 0, [0]],
["boolean primitive", True, [True]],
["string primitive", "string", ["string"]],
["empty array", [], [[]]],
["single-item array", [... |
import os
path = os.path.dirname(__file__)
def get(resource):
return os.path.join(path, resource).replace('\\', '/')
|
# Copyright 2021 Adobe. All rights reserved.
# This file is licensed to you 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... |
import os
import tempfile
from contextlib import contextmanager
from collections import OrderedDict
from neupy import plots, layers, algorithms
from neupy.plots.layer_structure import exclude_layer_from_graph
from base import BaseTestCase
@contextmanager
def reproducible_mktemp():
name = tempfile.mktemp()
r... |
"""Wrapper of the multiprocessing module for multi-GPU training."""
# To avoid duplicating the graph structure for node classification or link prediction
# training we recommend using fork() rather than spawn() for multiple GPU training.
# However, we need to work around https://github.com/pytorch/pytorch/issues/17199... |
"""
payload_generators.py
Copyright 2007 Andres Riancho
This file is part of w3af, http://w3af.org/ .
w3af 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 version 2 of the License.
w3af is distributed in the ho... |
from django.http import JsonResponse
from django.views.generic.edit import FormView
from .forms import (
UploadAttachmentForm, DeleteAttachmentForm
)
class FileUploadView(FormView):
"""Provide a way to show and handle uploaded files in a request."""
form_class = UploadAttachmentForm
def upload_file(... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""CSSubmissionCable model"""
from __future__ import absolute_import, unicode_literals
from datetime import datetime
from peewee import DateTimeField, ForeignKeyField
from playhouse.fields import ManyToManyField
from .base import BaseModel
from .challenge_binary_node ... |
import functools
import gc
import os
import sys
import traceback
import warnings
def is_in_ipython():
"Is the code running in the ipython environment (jupyter including)"
program_name = os.path.basename(os.getenv('_', ''))
if ('jupyter-notebook' in program_name or # jupyter-notebook
'ipytho... |
import collections
import math
import numbers
import numpy as np
from .. import base
from .. import optim
from .. import utils
__all__ = [
'LinearRegression',
'LogisticRegression'
]
class GLM:
"""Generalized Linear Model.
Parameters:
optimizer (optim.Optimizer): The sequential optimizer u... |
import sys
import os
import re
import shutil
import tempfile
import subprocess
from distutils import dir_util
from typing import Any, List, Mapping, Set
import pathspec
REPLACE_PATTERN = re.compile(r"#\[(\w+)\]#")
HELP = """
Usage: netbeansify <input directory> [options]
Available Options:
--help ... |
from __future__ import annotations
import pathlib
from contextlib import contextmanager
from typing import Any, Iterable, Iterator, Union
from alembic import command
from alembic.config import Config
from dcp import Storage
from dcp.storage.base import DatabaseStorageClass
from sqlalchemy.engine import Result
from sq... |
"""AyudaEnPython: https://www.facebook.com/groups/ayudapython
"""
from random import randint
# pip install prototools
from prototools import int_input, text_align, textbox
from prototools.colorize import *
LIMITE, MIN, MAX, intentos = 5, 1, 10, 0
NUMERO_ALEATORIO = randint(MIN, MAX)
textbox(
cyan("ADIVINA EL NUME... |
# -*- coding:utf-8 -*-
from xml.dom import minidom
from xlrd import open_workbook
import json
import re
jdict = {}
axls = open_workbook('student.xls')
sheet1 = axls.sheet_by_name('student')
for i in range(3):
sign = str(sheet1.cell(i,0).value)
jdict[sign] = []
for j in range(1,5):
if j... |
import os
import pytest
from analyzer.ResultsCollector.PytestResults import PytestResult
pytest_version = 'pytest-6.2.5'
@pytest.fixture(scope='module')
def data(data_dir):
return os.path.join(data_dir, 'PytestResults')
@pytest.fixture(scope='module')
def happy_day(data):
with open(os.path.join(data, 'hap... |
# -*- coding: utf-8 -*-
import plotly.graph_objs as go
def draw(x1, y1,
x2, y2,
x3, y3,
safety_factor,
flag=None,
x4=None, y4=None,
x5=None, y5=None,
x6=None, y6=None,
x7=None, y7=None,
x8=None, y8=None,
x9=None, y... |
'''
Created on 24 Nov 2015
@author: wnm24546
'''
from scipy.constants import c, h, k, pi
from scipy.optimize import curve_fit
from collections import OrderedDict
import numpy as np
from Lucky.LuckyExceptions import BadModelStateException
#k is kb
class CalculationService(object):
def __init__(self, pp):
... |
from rest_framework import serializers
from rest_framework_jwt.settings import api_settings
from django.contrib.auth.models import User
from .models import Employee, CostCenter, Unity
class UserSerializer(serializers.ModelSerializer):
class Meta:
model = User
fields = ('username',)
class UserSe... |
import numpy as np
import astropy.constants as cst
import astropy.units as u
def blackbody(wave, T):
'''
Blacbody function
Parameters
----------
wave : float
Wavelength(s) in micron
T : float
Temperature in Kelvin
Results
-------
bb_spectrum : float
Black... |
# To change this license header, choose License Headers in Project Properties.
# To change this template file, choose Tools | Templates
# and open the template in the editor.
import json
import sys
import re
import traceback
from os.path import expanduser
import os
import urllib
from uforge.objects.uforge import *
im... |
import argparse
import yaml
from train_eval.evaluator import Evaluator
import os
# Parse arguments
parser = argparse.ArgumentParser()
parser.add_argument("-c", "--config", help="Config file with dataset parameters", required=True)
parser.add_argument("-r", "--data_root", help="Root directory with data", required=True)... |
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render
from rest_framework.response import Response
from rest_framework.views import APIView
from users.models import super_table, teacher_table, student_table
from users.serializers import SuperSerializer, TeacherSerializer, Stude... |
"""Represents a tether from one actor to another"""
from nari.types.event.base import Event
from nari.types.actor import Actor
from nari.types.event import Type
class NetworkTether(Event):
"""Network tether event"""
__id__ = Type.networktether.value
def handle_params(self):
self.source_actor = Act... |
from flask import Flask, Blueprint, request
from flask_bcrypt import Bcrypt
from flask_cors import CORS
from api.models import db
from api.email import mail
import os
app = Flask(__name__)
CORS(app)
app.config.from_object(os.environ["APP_SETTINGS"])
app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False
db.init_app(... |
from tkinter import *
from tkinter.filedialog import askopenfilename
from tkinter.filedialog import asksaveasfilename
from os.path import basename
from tkinter.messagebox import askokcancel, askyesno
from tkinter import PhotoImage
# functions = Functions()
class Frontend():
activefile = 'unactive'
def __ini... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Create COMSOL compatible color encodings for the CET perceptually uniform
colour maps available at: http://peterkovesi.com/projects/colourmaps/
To install to COMSOL, copy the unzipped tsv files to the
comsol\data\colormap directory
Works at least for COMSOL 4.2a.
Cre... |
import ipaddress
import os.path
from unittest import TestCase
from unittest.mock import MagicMock, patch
from parameterized import parameterized
from salt.exceptions import CommandExecutionError
import yaml
import metalk8s_network
from tests.unit import mixins
from tests.unit import utils
YAML_TESTS_FILE = os.path... |
import torch.nn as nn
from .losses import get_loss
from ..architectures import get_backbone
from .wrapper import Wrapper
class SimpleClassifierWrapper(Wrapper):
def __init__(self, wrapper_config):
super().__init__()
self.backbone = None
self.classifier = None
self._init_modules(wra... |
# -*- coding: utf-8 -*-
#
# Project: silx (originally pyFAI)
# https://github.com/silx-kit/silx
#
# Copyright (C) 2012-2017 European Synchrotron Radiation Facility, Grenoble, France
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated docume... |
#!/usr/bin/env python3
import random
def emit_test_one(max_len_list,len_cmd_min,len_cmd_max,no_exception):
header = '''
#define CATCH_CONFIG_MAIN
#include "catch.hpp"
#include "DoublyLinkedList.h"
#include <list>
#include <stdexcept>
using namespace std;
'''
'''
Test cases
... |
import numpy as np
from tqdm import tqdm
LOOP_SIZE = 10000000
SEED = [0, 1, 0]
def monty_hall(typed):
doors = SEED
np.random.shuffle(doors)
opted_3 = np.random.randint(0, 3)
if not typed:
result = doors[opted_3]
return result
else:
for i in range(3):
if i != o... |
CARDINALITA = 10
lista_numeri = []
somma = 0.0
contatore = 0
while contatore < CARDINALITA:
numero = input('inserisci un numero ')
print "iterazione ", contatore
lista_numeri += [numero]
somma += float(numero)
contatore += 1
media = somma / CARDINALITA
varianza2 = 0.0
contatore = 0
while contato... |
from utils import test_execution
COUNT = 8000
@test_execution('with context manager')
def with_context_manager():
def runner():
for _ in range(COUNT):
with open('test.txt', 'r') as file:
content = file.read()
return runner
@test_execution('without context manager')
def ... |
import tensorflow as tf
import cv2
import numpy as np
IMG_SIZE=(224,224)
Model=tf.keras.models.load_model ('Ensamble_Model(Ori).h5')
path='C:/Users/mariotiara/Desktop/GUI/Sampel/ffc04fed30e6_(0)_Normal.jpeg'
img=tf.keras.preprocessing.image.load_img(path,target_size=IMG_SIZE)
x = tf.keras.preprocessing.i... |
#!/usr/bin/env python
__all__=['configstruc', 'loadpdb', 'loadstruc', 'molecule', 'protein', 'ligand', 'lipid']
from loadstruc import (FetchPDB, Loadstruc)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.