content
stringlengths
5
1.05M
import json from django.contrib.gis.geos import GEOSGeometry from django.test import TestCase from organisations.boundaries.management.base import BaseOsniCommand from organisations.models import DivisionGeography from organisations.tests.factories import ( DivisionGeographyFactory, OrganisationFactory, Org...
# Cell from sklearn.datasets import make_regression
# Copyright 2019-2021 Wingify Software Pvt. Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
#!/usr/bin/python # Script by Grant Emsley <grant@emsley.ca> to create rdiffweb users from the command line # Written 2016-04-23 # # Usage: ./rdiffweb-adduser.py username -p password -d /home/username -e user@example.com # # Script will create an rdiffweb account with the specified username, and optionally a password, ...
from django.contrib import admin from ttc_rest_api.models import TTC_POST_TB, TTC_COMMENT_TB # Register your models here. admin.site.register(TTC_POST_TB) admin.site.register(TTC_COMMENT_TB)
# -*- coding: UTF-8 -*- # Copyright 2013-2016 Luc Saffre # This file is part of Lino Voga. # # Lino Voga is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your op...
# A module to run simulation functions #Pass a command line argument of the number of images desired. Max is currently ~115,000 #Psss a command line argument of the mode # -- Choices: 'lenses', 'foregrounds', 'galaxies' #Example: python run_simulator.py 10000 lenses import glob import pandas as pd import sys import...
from unittest import TestCase from django.conf import settings from django.template import Context, Template from django.test import RequestFactory, SimpleTestCase, override_settings class TestEmailPopupSettings(TestCase): def test_setting_should_be_dict(self): self.assertIsInstance(settings.EMAIL_POPUP_...
import sys #def Analyzer() : #fin = open('shallowCopyDeepCopy') if len(sys.argv) == 1 : print('Invalid input ') #word = '' d = {} def updateD(word) : if word not in d : d[word] = 1 else : d[word] = d[word] + 1 for i in sys.argv : if i == sys.argv[0] : continue fin = open(i, 'r') for line in fin.readlin...
#!/usr/bin/python from mininet.net import * from mininet.node import * from mininet.link import * from mininet.cli import * from mininet.log import * from mininet.util import * from subprocess import * import select import os # Using this constant for init_cmd will allow # the docker image to execute # its own startu...
from graphviz import Digraph INBOUND_TYPES: dict = { 'IpRanges': 'CidrIp', 'Ipv6Ranges': 'CidrIpv6', 'UserIdGroupPairs': 'GroupId', 'PrefixListIds': 'GroupId' } def check_if_security_group_is_attached_to_an_instance( ec2_instances, group_name ) -> bool: for reservation in ec2_inst...
from __future__ import absolute_import, print_function import os import pytest import shutil import subprocess import sys import tempfile import uuid from elasticsearch import Elasticsearch from flask import Flask, make_response from flask_login import LoginManager, login_user from flask_principal import RoleNeed, Pri...
class mqtt_broker: address = "adddress of MQTT broker on the network" username = "user name to log on to MQTT broker" password = "password to log on to MQTT broker" topic = b"/topic/to/publish/ADC/data/to" class wifi: ssid = "name of WiFi access point" password = "password to WiFi access point" dhcp_host...
import flask from flask import jsonify, make_response, request from main.all.data import db_session from main.all.data.users import User from main.web.run import send_message_to_bot blueprint = flask.Blueprint( 'web_api', __name__, template_folder='templates' ) @blueprint.route('/api/version') def get_v...
""" How to use TensorBoard with PyTorch =================================== TensorBoard is a visualization toolkit for machine learning experimentation. TensorBoard allows tracking and visualizing metrics such as loss and accuracy, visualizing the model graph, viewing histograms, displaying images and much more. In ...
#!/usr/bin/env python3 import collections import itertools import os import re import subprocess import sys PUC = "../pamu2fcfg/pamu2fcfg" resident = ["", "-r"] presence = ["", "-P"] pin = ["", "-N"] verification = ["", "-V"] Credential = collections.namedtuple( "Credential", "keyhandle pubkey attributes old...
import os import click import gym import json import pickle as pkl from bc.agent import BCAgent from bc.utils.videos import write_video @click.command(help='net_agent env_name [options]') @click.argument('env_name', type=str) @click.option('--seed', '-s', default=0, help='seed') @click.option('-np', '--net_path', t...
from collections import namedtuple import logging import sqlalchemy import flask from sqlalchemy.orm import sessionmaker, scoped_session from dataactcore.config import CONFIG_DB logger = logging.getLogger(__name__) class _DB(namedtuple('_DB', ['engine', 'connection', 'scoped_session_maker', 'session'])): """Rep...
# -*- coding: utf-8 -*- # http://www.apache.org/licenses/LICENSE-2.0.txt # # Copyright 2016 Intel 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/li...
#machine learning import torch USE_CUDA = torch.cuda.is_available() device = torch.device("cuda" if USE_CUDA else "cpu") # Model """Cf. Report on the code for details about the architecture of the model - [**Pytorch LSTM doc**](https://pytorch.org/docs/stable/nn.html#torch.nn.LSTM) - [**Pytorch GRU doc**](https://pyto...
import torch import os from datetime import datetime import numpy as np import itertools from mpi4py import MPI from HER_mod.mpi_utils.mpi_utils import sync_networks, sync_grads from HER_mod.mpi_utils.normalizer import normalizer from HER_mod.her_modules.her import her_sampler from HER_mod.rl_modules.replay_buffer i...
"""Constants for teamspeak.""" # Base component constants NAME = "Teamspeak 3 Server" DOMAIN = "teamspeak" DOMAIN_DATA = f"{DOMAIN}_data" VERSION = "0.1.0" MANUFACTURER = "TeamSpeak Systems, Inc" ATTRIBUTION = f"Data from this is provided by a Teamspeak 3 Server by {MANUFACTURER}." ISSUE_URL = "https://github.com/Larsi...
# Largely a helper to quickly trigger fixtures to smoke test them # and possibly go through their internal asserts from pathlib import Path def test_organized_nwb_dir(organized_nwb_dir: Path) -> None: pass # Just a smoke test to trigger fixture's asserts def test_organized_nwb_dir2(organized_nwb_dir2: Path) -...
# -*- coding: utf-8 -*- from rest_framework import serializers from system.models import User, Role class RoleSerializer(serializers.HyperlinkedModelSerializer): class Meta: model = Role fields = ('id', 'name', 'permission', 'create_time', 'update_time') class UserSerializer(serializers.Hyperl...
# -*- coding: utf-8 -*- # # Copyright 2015 Simone Campagna # # 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 .core import FracFocusPDFParser, Report from .helpers1 import Logger
from collections import defaultdict class Graph: def __init__(self, vertices): self.graph = defaultdict(list) self.vertices = vertices def add_edge(self, u, v): self.graph[u].append(v) def bfs(self, s): visited = [False] * self.vertices queue = [] queu...
#a script to run several replicates of several treatments locally directory = "resets2/" seeds = range(10, 21) periods_resets = [[25,26400,0.0141,0.0081],[50,13200,0.0136,0.0068],[100,6600,0.0128,0.0059],[110,6000,0.0382,0.0331],[120,5500,0.1298,0.0222],[132,5000,0.1718,0.0234],[150,4400,0.2012,0.0293],[176,3750,0.227...
# encoding: utf-8 # module System.Windows.Diagnostics calls itself Diagnostics # from PresentationCore,Version=4.0.0.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35 # by generator 1.145 """ NamespaceTracker represent a CLS namespace. """ # no imports # no functions # classes class VisualDiagnostics(object...
import cv2 import numpy as np import os from random import shuffle import matplotlib.pyplot as plt training_directory = '/home/helpologist/junction_detection/junc_frames_return/' testing_directory = '/home/helpologist/Downloads/test-images/' img_size = 80 learn_rate = 1e-3 epochs = 1 model_name = 'junction_detecti...
from flask import Flask from flask_cors import CORS from app.routes import root def create_app(): appBuilder = Flask(__name__) appBuilder.register_blueprint(root) CORS(appBuilder) return appBuilder app = create_app()
# -*- coding: utf-8 -*- from django.contrib.auth.forms import UserCreationForm, UserChangeForm from django import forms from django.contrib.auth import get_user_model User = get_user_model() class RegisterForm(UserCreationForm): email = forms.EmailField(label='E-mail') first_name = forms.CharField(label='Primeiro n...
#!/usr/bin/env python from setuptools import setup, find_packages import re import os from codecs import open name = "pout" kwargs = {"name": name} def read(path): if os.path.isfile(path): with open(path, encoding='utf-8') as f: return f.read() return "" vpath = os.path.join(name, "__i...
import mmcv def ava_classes(): return [ 'bend/bow (at the waist)', 'crawl', 'crouch/kneel', 'dance', 'fall down', 'get up', 'jump/leap', 'lie/sleep', 'martial art', 'run/jog', 'sit', 'stand', 'swim', 'walk', 'answer phone', 'brush teeth', 'carry/hold (an object)', 'catch (an object...
# Copyright (c) 2017 Cisco Systems, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless r...
# [기초-비트단위논리연산] 비트단위로 AND 하여 출력하기(설명) # minso.jeong@daum.net ''' 문제링크 : https://www.codeup.kr/problem.php?id=1060 ''' n1, n2 = map(int, input().split()) print(n1 & n2)
DEBUG = True TESTING = True BCRYPT_LEVEL = 12 MAIL_FROM_EMAIL = 'tuanquanghpvn@gmail.com' SECRET_KEY = '&%^%&12o)!JHGHVJBK671i2lkj;^*&:' SQLALCHEMY_DATABASE_URI = 'mysql://root:abc!@#ABC@localhost/flask_intro' SQLALCHEMY_TRACK_MODIFICATIONS = True WTF_CSRF_CHECK_DEFAULT = True SAVE_DIR = '/apps/media/'
import numpy as np from sklearn.metrics import roc_auc_score try: import torch except ImportError: torch = None class Evaluator: def __init__(self, metric='mse', **kwargs) -> None: self.eval_metric = metric def eval(self, input_dict): y_true, y_pred = self._parse_and_check_input(inpu...
import sys import pymongo import urllib.request import json import time from datetime import datetime from bs4 import BeautifulSoup # To get everything from pymongo import MongoClient #connect to MongoDB client = MongoClient() db = client.Stocks articles = db.Articles def main(arg1): #Query site for HTML ticker = a...
# Copyright 2017 The Sonnet 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 applicable l...
# -*- coding: UTF-8 -*- # 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 (t...
import json import sys with open('reports/servers/index.json') as file_: report = json.load(file_) failures = sum(value['behavior'] == 'FAILED' for value in report['websockets'].values()) if failures > 0: sys.exit(1) else: sys.exit(0)
from contextlib import redirect_stdout import io import unittest from vimgolf.html import ( get_element_by_id, get_elements_by_tagname, get_text, parse_html, ) from vimgolf.vimgolf import ( get_api_key, GOLF_HOST, http_request, main, RUBY_CLIENT_VERSION_COMPLIANCE, set_api_key, ...
# -*- coding: utf-8 -*- """ Created on Fri Jun 26 23:09:38 2020 @author: Jieyun Hu """ # This file is for PAMAP2 data processing from matplotlib import pyplot as plt import pandas as pd import numpy as np import h5py import os from sklearn.preprocessing import MinMaxScaler, StandardScaler activities = {0: 'None', # 0...
""" Get items static data, like cost, notes, description, etc. """ import requests import pandas as pd import json import os from data.mappings import item_cols items_map_raw = requests.get('https://api.opendota.com/api/constants/items') items_map = json.loads(items_map_raw.text) items_df = pd.json_normalize(items_map...
""" The fridrich module is a set of scripts used to drive a Server, which is used mainly for the Votings (There is much more to this, but it's not really easy to explain), and a Client that connects to the Server Author: Nilusink """ from fridrich import cryption_tools class ConsoleColors: HEADER = '\033[95m' ...
import zmq import msgpack import threading as mt from typing import Optional, Union, Iterator, Any, Dict from ..ids import generate_id from ..url import Url from ..misc import as_string from ..host import get_hostip from ..logger import Logger from ..profile import Profiler from ..debug import get_...
# Splits Keras/Tensorflow models into two or more parts # Email: na10web@gmail.com from tensorflow import keras from tensorflow.keras import layers as KL from tensorflow.keras import Model def split_network(model, split_layer_name: str, on_head=True, names=('head', 'tail'), custom_objects: dict=None) -> (Model, Model...
# __all__ = ['Alias', 'Channel', 'Command', 'CommandChannelBlacklist', 'CommandUserBlacklist', # 'DiscordServer', 'User']
from unittest.mock import Mock import pytest from dagster import resource, ModeDefinition, ResourceDefinition, SolidExecutionResult, execute_solid from dagster_utils.contrib.data_repo.typing import JobId from google.cloud.storage import Client, Blob from hca_orchestration.contrib.bigquery import BigQueryService from ...
import logging logger = logging.getLogger(__name__) class ElasticsearchFetch: def __init__(self, elasticsearch, timestamp_field="@timestamp"): """ :param elasticsearch: elasticsearch instance from the ``elasticsearch``-library. :param timestamp_field: Denotes which field in the elasticsea...
import cv2 from bitbots_vision.vision_modules.candidate import Candidate class BallFinder(): """ Deprecated BallFinder class. """ def __init__(self, config, cascade): # type: (dict, cv2.CascadeClassifier) -> None self._candidates = None self._ball = None self._cascade =...
# --- # jupyter: # jupytext: # formats: ipynb,py:percent # text_representation: # extension: .py # format_name: percent # format_version: '1.2' # jupytext_version: 1.1.1 # kernelspec: # display_name: Python 3 # language: python # name: python3 # --- # %% [markdown] # # P...
class Solution: def XXX(self, s: str) -> int: max_sub_s = '' len_sub_s = 0 for i_s in s: if i_s in max_sub_s: max_sub_s = max_sub_s[max_sub_s.index(i_s)+1:] max_sub_s += i_s len_sub_s = max(len_sub_s, len(max_sub_s)) return len_sub...
from consts import Powerups, Speed from game import LEVEL_POWERUPS import queue import Movement import mapa LEVEL_POWERUPS = { 1: "Flames", 2: "Bombs", 3: "Detonator", 4: "Speed", 5: "Bombs", 6: "Bombs", 7: "Flames", 8: "Detonator", 9: "Bombpass", 10: "Wallpass", 11: "Bombs"...
# !/usr/bin/python # -*- coding: utf-8 -*- """ Created on January 25 09:48:12 2020 @author: nlog2n Data Visualization using Folium and GeoPandas """ import geopandas as gpd import mplleaflet import folium from folium import IFrame from folium.features import DivIcon print(folium.__version__) # import pandas_bokeh...
import copy import os from visitor import * from stringstream import * from itertools import chain class Analysis(): """ Apply transformations to the original AST. Includes: 1. Local Memory 2. Stencil Local Memory 3. Placing data in registers 4. Transposing arrays 5. Unrolling loops 6. Addi...
from .EnvironmentSecretLookup import EnvironmentSecretLookup from .SecretLookup import SecretLookup
import spacy import nltk import numpy as np import pandas as pd import streamlit as st from nltk.util import ngrams from nltk.tokenize import word_tokenize from sklearn.metrics import silhouette_score from sklearn.cluster import KMeans from src.nlp_utils.text_preprocessing import normalize_text, apply_tfidf from src.he...
from .termui import ( confirm, echo, edit, launch, prompt, raw_terminal, flair, terminalsize, unstyle, )
from .coalesce import * # NOQA
import setuptools with open("README.md", "r") as fh: long_description = fh.read() setuptools.setup( name="redispubsub", version=__import__("redisrpc").VERSION, author="Munis Isazade", author_email="munisisazade@gmail.com", description="Redis RPC server for microservices", long_description=...
import unittest import unittest.mock from programy.storage.entities.spelling import SpellingStore class SpellingStoreTests(unittest.TestCase): def test_load_spelling(self): store = SpellingStore() with self.assertRaises(NotImplementedError): spell_checker = unittest.mock.Mock() ...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from .. import...
import numpy as np from matplotlib import pyplot as plt from threading import Thread import time def remove_i(x, i): """Drops the ith element of an array.""" shape = (x.shape[0]-1,) + x.shape[1:] y = np.empty(shape, dtype=float) y[:i] = x[:i] y[i:] = x[i+1:] return y def a(i, x, G, m): ""...
# # Copyright (c) 2008-2016 Citrix Systems, 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 l...
from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional, Tuple from rotkehlchen.accounting.structures.base import ( HistoryBaseEntry, HistoryEventSubType, HistoryEventType, ) from rotkehlchen.assets.asset import EthereumToken from rotkehlchen.chain.ethereum.decoding.interfaces import DecoderI...
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
# -*- coding: utf-8 -*- """Initial conversion from sqlalchemy create all to alembic Revision ID: 1b2a8e1a4d45 Revises: None Create Date: 2014-01-20 15:40:30.883533 """ # revision identifiers, used by Alembic. revision = '1b2a8e1a4d45' down_revision = None from alembic import op import sqlalchemy as sa def upgrade...
import sys import unittest from parameterized import parameterized_class # TODO: fix it sys.path.append("./") from calculus_of_variations import MultidimensionalSolver from calculus_of_variations.utils import E, I, exp, t C1 = MultidimensionalSolver.C1 C2 = MultidimensionalSolver.C2 C3 = MultidimensionalSolver.C3 C4...
from django.shortcuts import render, redirect from django.core.urlresolvers import reverse_lazy from django.contrib.auth.models import User from django.db.models import Q from django.views import generic from django.views.generic.edit import CreateView, UpdateView, DeleteView from . models import Book, BookDetails fr...
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv) import numpy as np # linear algebra import scipy.io # path = "~/Documents/Spacebergs/src/input/" # gbm_scores = pd.read_csv(path + "gbm_preds.csv") # cnn_scores = pd.read_csv(path + "cnn_scores.csv") # gbm_scores = pd.read_csvc path = "/home/em...
# -*- coding: utf-8 -*- from rest_framework import status as http_status from modules.shared.infrastructure.log import LoggerDecorator, PyLoggerService from modules.shared.domain.requests import Request from modules.shared.domain.responses import Response from modules.shared.domain.serializers import SerializerManag...
import sys, os sys.path = [os.path.dirname(__file__), os.path.dirname(os.path.dirname(__file__))] + sys.path os.chdir(os.path.dirname(__file__)) import bottle from bottle import Bottle import services # importa los servicios REST application = bottle.default_app() # Carga la aplicacion por defecto con los servicios...
from .q_learner import QLearner from .coma_learner import COMALearner from .latent_q_learner import LatentQLearner from .hierarchical_q_learner import HierarchicalQLearner from .hierarchical_rode_learner import HierarchicalRODELearner from .hierarchical_noise_q_learner import HierarchicalNoiseQLearner REGISTRY = {} R...
import requests from requests.auth import HTTPBasicAuth import json import numpy as np import math from django.core.exceptions import ObjectDoesNotExist from django.db.models import Sum from django.db.models.functions import Coalesce from datetime import timedelta from django.core import management # Get an instance o...
CONFIG = "./webrepl_cfg.py" RC = "./boot.py" def change_daemon(): pass def exists(): pass def get_daemon_status(): pass def getpass(): pass def input_choice(): pass def input_pass(): pass machine = None def main(): pass os = None sys = None
from src.database.base import Base from src.database.session import engine, get_db
""" Modified from https://medium.com/analytics-vidhya/understanding-totp-in-python-bbe994606087 Any improvements are considered. """ import hmac, base64, struct, hashlib, time def get_hotp_token(secret, intervals_no): key = base64.b32decode(secret, True) #decoding our key msg = struct.pack(">Q", intervals_no...
import numpy as np def recursive_matrix_mult(A, B): """ Recursively multiplies sub matrices of A and B :param a: The first Matrix A implemented as a np.array :param b: The second Matrix B implemented as a np.array :return: The product of a and b """ a = np.array(A) b = np.array(B) i...
# 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 ...
import tkinter import re import os import argparse import pathlib import json import urllib import urllib.request # Regular Expressions for retrieving contents from page source code. PHOTOS_EXPRESSION = r'"display_resources":(.*?)]' VIDEO_EXPRESSION = r'"video_url":"(.*?)"' CONTENT_EXPRESSION = r'<meta content="(.*?)"...
class Map: def __init__(self): self._map = { 'objects': {} } def get_object(self, object_id): return self._map['objects'][object_id] def add_object(self, obj): self._map['objects'][obj.get_id()] = obj def remove_object(self, obj): del(self._map['ob...
# coding: utf-8 """ Fates List Current API: v2 beta 3 Default API: v2 API Docs: https://apidocs.fateslist.xyz Enum Reference: https://apidocs.fateslist.xyz/structures/enums.autogen # noqa: E501 OpenAPI spec version: 0.3.0 Generated by: h...
# coding=utf-8 from __future__ import division, print_function, unicode_literals import io import sys import unittest from mwel import ErrorLogger, toxml, fromxml from . import TempFilesMixin class TestErrorLogger(unittest.TestCase): def test_basic(self): el = ErrorLogger() expected_output = ''...
__copyright__ = """ Copyright 2019 Samapriya Roy 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 applicabl...
import ImageGrab img = ImageGrab.grab() img.save('test.jpg','JPEG') import pyscreenshot as ImageGrab # fullscreen im=ImageGrab.grab() im.show() # part of the screen im=ImageGrab.grab(bbox=(10,10,500,500)) im.show() # to file ImageGrab.grab_to_file('im.png') import wx wx.App() # Need to create an App instance bef...
open(filename, encoding='utf-8').read()
#!/usr/bin/env python # Add a CSV file as a table into <split>.db and <split>.tables.jsonl # Call as: # python add_csv.py <split> <filename.csv> # For a CSV file called data.csv, the table will be called table_data in the .db # file, and will be assigned the id 'data'. # All columns are treated as text - no attempt ...
from collections import namedtuple from data.database import (ApprTag, ApprTagKind, ApprBlobPlacementLocation, ApprManifestList, ApprManifestBlob, ApprBlob, ApprManifestListManifest, ApprManifest, ApprBlobPlacement, ApprChannel) ModelsRef = namedtuple('ModelsRef',...
from . import arch_space, torch
""" Astronomy Tutorial: exercise 2 Photometric redshift determination usage: python exercise_02.py datadir - datadir is $TUTORIAL_DIR/data/sdss_photoz This directory should contain the files: - sdss_photoz.npy Here we will take a closer look at the photometric redshift problem discussed in section 5 of...
""" Test that the q-values estimated by the qvalues module are correct """ import pytest import numpy as np from targetdecoy import qvalues SCORES1 = np.array([10, 10, 9, 8, 7, 7, 6, 5, 4, 3, 2, 2, 1, 1, 1, 1]) SCORES2 = np.array([ 1, 1, 2, 3, 4, 4, 5, 6, 7, 8, 9, 9, 10, 10, 10, 10]) TARGET = np.array([ 1, 1, 1...
import itertools import numpy as np import pandas as pd import pytest import xarray as xr from xarray.core.missing import ( NumpyInterpolator, ScipyInterpolator, SplineInterpolator, _get_nan_block_lengths, get_clean_interp_index, ) from xarray.core.pycompat import dask_array_type from xarray.tests...
from datetime import datetime from time import sleep from random import choice from os import listdir from os.path import join from botUtils import * from videoUpload import * while True: while datetime.now().weekday() != 4: print "Apparently, it is still not SEXTA FEIRA, SUA LINDA..." sleep(28800)...
import rpa as r import pyautogui as p r.init() r.url('https://www.google.com') janela = p.getActiveWindow() janela.maximize() r.wait(2.0) # esperar 2 seg r.type('//*[@name="q"]', 'RPA[enter]') # r.type('//*[@id="tsf"]/div[2]/div[1]/div[1]/div/div[2]/input', 'RPA[enter]') r.wait(2.0) r.snap('page', 'rpa_page.png') ...
from collections import OrderedDict expected = OrderedDict( [ ("type", "figure"), ( "assets", [ OrderedDict( [ ("type", "image"), ("doi", u"10.7554/eLife.00109.004"), ...
import asyncio from ipaddress import IPv4Address from typing import Union, Text, Tuple from . import get_logger class PingError(Exception): def __init__(self, message: str, wrapped_exception: Exception = None): self.wrapped_exception = wrapped_exception self.__cause__ = wrapped_exception class ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import json import subprocess DEFAULT_PATH = "/tmp/resource_object" class KubernetesResources(object): def __init__(self): self._resources = {} def load_json_file(self, path): try: with open(path, "r") as f: self._re...
from django.db import models from django.contrib import admin # Create your models here. class food_daily(models.Model): fid=models.AutoField(primary_key=True) fname=models.CharField(verbose_name='菜名',max_length=30) price=models.DecimalField(verbose_name='价格',max_digits=6,decimal_places=2) f_types=( ...