content
stringlengths
5
1.05M
from django.contrib import admin from .models import Profile, Notification, Vote @admin.register(Profile) class ProfileAdmin(admin.ModelAdmin): list_display = ['user', 'photo', 'social_link'] @admin.register(Notification) class NotificationAdmin(admin.ModelAdmin): list_display = ['user', 'title', 'date_cre...
from microquake.ml.classifier import SeismicModel from microquake.processors.processing_unit import ProcessingUnit from loguru import logger import requests import json class Processor(ProcessingUnit): """ Class wrapper around SeismicClassifierModel, load inputs from kwargs. """ @property def ...
from dataclasses import dataclass from typing import List, Set, Dict from symengine.lib.symengine_wrapper import Expr, Symbol from program import Program from program.assignment import Assignment from program.condition import TrueCond from program.type import Type, Finite from type_inference import Typer from .excepti...
from django.shortcuts import render from rest_framework.response import Response from rest_framework.views import APIView from awwards.models import Post, Profile from .serializers import PostSerializer,ProfileSerializer from rest_framework import status,viewsets from .permissions import IsAdminOrReadOnly class Ov...
# Funktion zum Zeichnen von Kreisausschnitten. Die # Anzahl an Kreisen(= Spalten) wird als ganzzahliger # Wert an die Funktion übergeben. def drawArcs(numArcsPerRow): # Setze Radius für jeden Kreis, # nutze dabei gegebenen Platz bestmöglich aus # Den kleineren Wert des Ausgabebereichs bestimmen # und f...
""" Copyright 2019 Tae-Hwan Jung MIT LICENSE code reference : https://soooprmx.com/archives/6436 ventilator for masked language model preprocessing pipeline This code must be executed after wikiextractor script has been **finished**. `data` : dump data root folder path, it has to seems like bel...
import sys import numpy as np import pandas as pd import matplotlib.pyplot as plt from collections import namedtuple from icecream import ( ic, install, ) install() sys.path.append('.') from vi_dem.particles import ( Particles, NList, ) from vi_dem.variational_int import ( HookianContact, Bon...
""" From original at https://github.com/facebookresearch/detectron2/blob/master/detectron2/checkpoint/detection_checkpoint.py Original copyright of Facebook code below, modifications by Yehao Li, Copyright 2021. """ # Copyright (c) Facebook, Inc. and its affiliates. import logging import os import pickle import torch f...
"""This file show how we can use Pycuda compiled fct in a Theano Op. Do no use those op in production code. See the TODO. You can use them as a guide to use your pycuda code into a Theano op. The PycudaElemwiseSourceModuleOp is a Theano op use pycuda code generated with pycuda.compiler.SourceModule Their is a test i...
# 4.1 Creating a Subset of Rows and Columns import pandas as pd import numpy as np from revoscalepy import rx_data_step np.random.seed(59) x = np.random.normal(size = 100) y = np.random.uniform(size = 100) z = np.tile(np.array(range(1,21)),5); s = np.stack((x, y, z)) s = np.transpose(s) myData = pd.DataFrame(s, col...
# -*- coding: utf-8 -*- # # ngsv-console # http://github.com/xcoo/ngsv-console # Copyright (C) 2012-2013, Xcoo, 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.apac...
import json import boto3 import sys import os SNS = os.environ['SNS'] def lambda_handler(event, context): client = boto3.client('cloudtrail') if event['detail']['eventName'] == 'StopLogging' or event['detail']['eventName'] == 'DeleteTrail': subject='' if event['detail']['eventName'] == 'StopL...
# Generated by Django 2.1.5 on 2019-02-26 19:32 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('main', '0007_post_likedp...
# -*- coding: utf-8 -*- ############################################################################## # # This program 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 #...
# This files contains your custom actions which can be used to run # custom Python code. # # See this guide on how to implement these action: # https://rasa.com/docs/rasa/core/actions/#custom-actions/ # This is a simple example for a custom action which utters "Hello World!" from typing import Any, Text, Dict, List ...
from sympy.core.basic import Basic as sp_Basic class Basic(sp_Basic): """Basic class for Pyccel AST.""" _fst = None def set_fst(self, fst): """Sets the redbaron fst.""" self._fst = fst @property def fst(self): return self._fst
# Generated by Django 3.2.8 on 2021-10-10 16:12 import uuid from os import environ import django.db.models.deletion from django.apps.registry import Apps from django.conf import settings from django.db import migrations, models from django.db.backends.base.schema import BaseDatabaseSchemaEditor from django.db.models ...
"""Generate a keymap.c from a configurator export. """ import json from argcomplete.completers import FilesCompleter from milc import cli import qmk.keymap import qmk.path @cli.argument('-o', '--output', arg_only=True, type=qmk.path.normpath, help='File to write to') @cli.argument('-q', '--quiet', arg_only=True, ac...
# Exercício 100: '''Faça um programa que tenha uma lista chamada números e duas funções chamadas sorteia() e somaPar(). A primeira função vai sortear 5 números e vai colocá-los na lista e a segunda função mostra a soma entre todos os valores pares sorteados.''' from random import sample from time import sleep valore...
from paver import svn, runtime from paver.tests.mock import Mock, patch @patch(svn, "sh") def test_simple_checkout(sh): svn.checkout("http://foo", "bar") assert sh.called assert sh.call_args[0][0] == "svn co http://foo bar" @patch(svn, "sh") def test_checkout_with_revision(sh): svn.checkout("http://fo...
from .configs import * from .core import NDTHead from .core import NNBMNBHead from .core import NNBNormalHead __all__ = ["NDTHead", "NNBMNBHead", "NNBNormalHead"]
#!/usr/bin/env python """ Program to generate monthly summaries for a specific set of interface, aggregated on the device/interface/endpoint. These aggregations are derived from the daily rollup data and are written to the timestamp of the first second of the month being aggregated. Usage and args: -U : the url t...
# coding=utf-8 # Copyright 2022 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Nov 24 09:22:07 2020 @author: mavroudo """ import sys, getopt from numpy import random from scipy.stats import truncnorm import numpy as np import matplotlib.pyplot as plt help_me=""" This is a script to generate data in a form of csv (comma seperated)...
# coding: utf-8 """ BillForward REST API OpenAPI spec version: 1.0.0 Generated by: https://github.com/swagger-api/swagger-codegen.git 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...
#!/usr/bin/env python # -*- coding:utf-8 -*- ''' 用于添加页面的数据处理,针对FK、M2M添加PopUp功能,以及相关页面渲染。 ''' from django.template import Library from django.forms import ModelChoiceField from django.urls import reverse from caroadmin.service import site register = Library() @register.inclusion_tag('popup.html') def add_list(form)...
""" Given an array of intervals representing ‘N’ , find out if a person can attend all the appointments. Example 1: Appointments: [[1,4], [2,5], [7,9]] Output: false Explanation: Since [1,4] and [2,5] overlap, a person cannot attend both of these appointments. Example 2: Appointments: [[6,7], [2,4], [8,12]] Output: ...
import collections import logging from copy import deepcopy from .span import Span from .pin import Pin from .utils.merge import deepmerge log = logging.getLogger(__name__) class ConfigException(Exception): """Configuration exception when an integration that is not available is called in the `Config` obje...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Example python code to call the theory clustering functions from python. This script calls the python extensions directly; however the recommended use is via the wrappers provided in :py:mod:`Corrfunc.theory`. """ from __future__ import (absolute_import, division, pri...
import sys import time from phenix.api.api_objects import SceneAPI if sys.version_info.major == 2: import Pyro4 import Pyro4.naming else: import Pyro5 import Pyro5.server import Pyro5.nameserver import Pyro5.api class PhenixServer: """ A general server that controls programs, data, and scenes. It m...
# Note: This functions won't work without pandas # import pandas as pd from plotlyextreme import utilities def create_big_number(title, large_number, render_func, pacing='--'): """ title = description of big number large_number = whatever number you want to highlight render_func = plotly rendering fu...
import urllib.request import urllib.parse movie_ids = {"The Matrix": "tt0133093", "Rick and Morty": "tt2861424"} IMBD_URL_QUOTE = 'https://www.imdb.com/title/{movie_id}/quotes' DEFAULT_MAX_QUOTES = 100 def html_from_url(url, params=None): if params: url += urllib.parse.quote(params) re...
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # import functools import itertools import logging import os import sys import time import warnings from pathlib import Path from typing impor...
import os import warnings from django.shortcuts import render, HttpResponse from django.views.generic import View from django.views.generic.edit import FormView from django.core.files.storage import FileSystemStorage from django.conf import settings from model_import_export.forms import ImportForm class ResourceExpo...
from copy import deepcopy from typing import List class StringReprMixin: def __str__(self) -> str: params = ', '.join( [f'{k}={v}' for k, v in self.__dict__.items()]) return f'{self.__class__.__name__}({params})' def __repr__(self) -> str: return self.__str__() class Address(Stri...
numero = int(input('Digite um numero: ')) u = numero // 1 % 10 d = numero // 10 % 10 c = numero // 100 % 10 m = numero // 1000 % 10 print('Analisando o numero: {}'.format(numero)) print('Unidade(s): {}'.format(u)) print('Desena(s): {}'.format(d)) print('Centena(s): {}'.format(c)) print('Milhar(es): {}'.format(m))
""" deviantart.status ^^^^^^^^^^^^^^^^^ Data model of the status object :copyright: (c) 2015 by Kevin Eichhorn """ from .user import User from .deviation import Deviation class Status(object): def __init__(self): self.statusid = None self.body = None self.ts = None self.url = None ...
from shop.models import Customer, Cart from django.contrib.auth.decorators import login_required from django.shortcuts import render @login_required(login_url='/login') def cart(request): current_user = request.user customer = Customer.objects.get(user_id=current_user.id) carts = Cart.objects.filter(user_i...
weapons = { 'bandits dagger': {'weight': 0.5, 'attack': 56 }, 'bastard sword': {'weight': 6.0, 'attack': 105}, 'crescent axe': {'weight': 7.0, 'attack': 115}, 'silver knight spear': {'weight': 6.0, 'attack': 163}, 'darkmoon bow': {'weight': 1.0, 'attack': 80}, } def show_weapons(weapons): title...
# -*- coding: utf-8 -*- """ Missing Person Registry @author: nursix """ module = request.controller prefix = request.controller resourcename = request.function if prefix not in deployment_settings.modules: raise HTTP(404, body="Module disabled: %s" % prefix) MISSING = str(T("Missing")) FOUND = str(T("F...
# -*- coding: utf-8 -* from __future__ import unicode_literals from __future__ import division # 引用这些可以在2.7环境下运行3.x的语法 __author__ = 'shawn' # still run on Python 2.7 print '\'xxx\' is unicode?', isinstance('xxx', unicode) print 'u\'xxx\' is unicode?', isinstance(u'xxx', unicode) print '\'xxx\' is str?', isinstance('...
#!/usr/bin/env python #-*-*- encoding: utf-8 -*-*- # This variable contains a path, which should point to the place # where the Virtual Machine images are stored. In the case of Virtual # Box, this will be the "Machines" folder, which under Windows is # often located under "c:/Users/<user_name>/.VirtualBox". Its ex...
""" Spoof IPv4 source address +++++++++++++++++++++++++ Send SNMP GET request from a non-local IP address: * with SNMPv2c, community 'public' * over IPv4/UDP * to an Agent at 104.236.166.95:161 * from a non-local, spoofed IP 1.2.3.4 (root and Python 3.3+ required) * for OIDs in string form This script performs simil...
#!/usr/bin/env python # -*- encoding: utf-8 -*- import sublime import sublime_plugin import re regexAll = re.compile('<([a-zA-Z0-9/ _=;\"\.\-]+)>') regexTagname = re.compile('(^[a-zA-Z0-9]+)') regexNonCloseTag = re.compile( '^(br|wbr|hr|img|col|base|link|meta|input|keygen|area|param|embed|source|track|command)')...
# -*- coding: utf-8 -*- from __future__ import absolute_import import logging import tarfile from cStringIO import StringIO from osxcollector.output_filters.analyze import AnalyzeFilter from osxcollector.output_filters.base_filters.output_filter import _run_filter from amira.results_uploader import FileMetaInfo from...
import numpy as np from scipy.integrate import odeint '''import scipy.integrate as integrate''' import matplotlib.pyplot as plt import matplotlib import math import sympy import statistics import sys import operator import collections import time import random font = {'family' : 'normal', 'weight' : 'bold', ...
"""Tests for the /auth route.""" from __future__ import annotations import base64 from unittest.mock import ANY import pytest from httpx import AsyncClient from gafaelfawr.auth import AuthError, AuthErrorChallenge, AuthType from gafaelfawr.config import Config from gafaelfawr.factory import Factory from gafaelfawr....
# (C) Datadog, Inc. 2018-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) # Constant for SQLServer cntr_type PERF_LARGE_RAW_BASE = 1073939712 PERF_RAW_LARGE_FRACTION = 537003264 PERF_AVERAGE_BULK = 1073874176 PERF_COUNTER_BULK_COUNT = 272696576 PERF_COUNTER_LARGE_RAWCOUNT = 657...
import math import os import tempfile from glob import glob import numpy as np import pandas as pd import torch from torch import Tensor from torch.utils.data import Dataset from ..data.adding_features import adding_no_features from ..data.dataload import iterate_json_files_directory from .datatransform import conve...
from docs.source.plots.logical_systems.draw_logic import draw_system from yvain.logical_systems import Drastic if __name__ == '__main__': draw_system(Drastic(), "Drastic system")
#!/usr/bin/python import os files = os.listdir('.') pngs = [ x for x in files if len(x)==6 and ".png" in x ] pngs.sort() cnt = len( pngs ) i=0 while i < cnt : oname = "row%03d.png" % ( i, ) cmd = "convert +append " for j in range(16) : if i+j < cnt : cmd += pngs[ i+j ] cmd += " " cmd += oname print cmd...
import wandb from wandb import data_types import numpy as np import pytest import os import sys import datetime from wandb.sdk.data_types._dtypes import * class_labels = {1: "tree", 2: "car", 3: "road"} test_folder = os.path.dirname(os.path.realpath(__file__)) im_path = os.path.join(test_folder, "..", "assets", "test...
# This code is copied from [pysignald](https://pypi.org/project/pysignald/) and modified to run locally with payments import os import json import random import re import socket from typing import Iterator, List # noqa from .types import Attachment, Message # We'll need to know the compiled RE object later. RE_TYPE...
from setuptools import setup setup( name='snoowatch', version='0.1', packages=[''], url='https://github.com/plygrnd/snoowatch', license='MIT', author='Dan Urson', author_email='dan@plygrnd.net', description='SnooWatch: the Friendly FOSS Reddit Indexer' )
from .flops_counter import get_model_complexity_info from .registry import Registry, build_from_cfg from .draw_box_in_img import draw_boxes_with_label_and_scores __all__ = ['Registry', 'build_from_cfg', 'get_model_complexity_info', 'draw_boxes_with_label_and_scores']
from odict import odict from yafowil.base import factory DOC_MUTABLE_DICT = """ Mutable Dict ------------ Dict where key/value pairs can be added, deleted and sorted. .. code-block:: python value = odict() value['foo'] = 'Foo' value['bar'] = 'Bar' dict = factory('#field:dict', value=value, props={ ...
# Copyright (c) 2016 Rocky Bernstein """ spark grammar differences over Python 3.3 for Python 3.4 """ from uncompyle6.parser import PythonParserSingle from spark_parser import DEFAULT_DEBUG as PARSER_DEFAULT_DEBUG from uncompyle6.parsers.parse33 import Python33Parser class Python34Parser(Python33Parser): def __...
c = float(input('Digite a teperatura em celsius: ')) f = c * 1.8 + 32 print('A temperatura em Fº é: {:.1f}'.format(f))
from scipy.stats import linregress import numpy as np def mass_ppm_error(x, mass): return abs(x - mass) / mass * 1e6 class SteppedFieldCCS: """compute the ccs for the multi-fields (stepped field method) """ def __init__(self, meta_df, adduct_mass, old_drift_tube_length, charge_state=1): """ ...
# classificando os nadadores from datetime import date atual = date.today().year nascimento = int(input('Em que ano o atleta nasceu? ')) idade = atual - nascimento print('O atleta tem {} anos.'.format(idade)) if 9 >= idade: print('Classificação: MIRIM.') elif idade <= 14: print('Classificação: IFANTIL.') elif ...
"""Defines constants for the RoleBot""" import functools import command ROLES = ["Top", "Jungle", "Mid", "Support", "Bot"] ROLE_SYNONYMS = { 'Top': ['top', 'top lane', 'toplane'], 'Jungle': ['jg', 'jungle'], 'Mid': ['mid', 'middle', 'mid lane', 'middle lane'], 'Support': ['support', 'sup'], 'Bot':...
import sys if __name__ == '__main__': family_file = sys.argv[1] # If 'yes', PO edges have an unknown direction muddle_directionality = (sys.argv[2] == 'y' or sys.argv[2] == 'yes') edges = {} with open(family_file, 'r') as ifile: for line in ifile: line = line.strip() if line == '': ...
# coding:utf-8 import time import os from mmap import mmap def get_lines(fp): with open(fp, "r+") as f: for i in f: yield i def get_lines_by_mmap(fp): with open(fp, "r+") as f: m = mmap(f.fileno(), 0) tmp = 0 for i, char in enumerate(m): if char == b"...
#!/usr/bin/env python from setuptools import setup, find_packages requires = ['Sphinx>=0.6', ] setup( name='sphinxcontrib-cmd2img', version='1.0.7', url='https://github.com/stathissideris/sphinxcontrib-cmd2img', license='BSD', author='Yongping Guo', author_email='guoyoooping@163.com', ...
import os EXAM_FROM_CONF_INI = "Exam from conf.ini" def save_app_configuration(file_path): text = "[Default]\n" file_path.write_text(text) def save_app_configuration_set(file_path): text = f"[Default]\nnumber = 3\nexam = {EXAM_FROM_CONF_INI}\n" file_path.write_text(text) def save_log_configuratio...
from .mapper import ApiResponse, ApiResponseInterface from .mapper.types import Timestamp, AnyType from .model import DirectSeenItemPayload __all__ = ['DirectSeenItemResponse'] class DirectSeenItemResponseInterface(ApiResponseInterface): action: AnyType payload: DirectSeenItemPayload class DirectSeenItemRe...
# coding=utf-8 # Copyright 2022 The TensorFlow Datasets Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
class Solution(object): def reverseString(self, s): """ :type s: str :rtype: str """ # s[i] = 'char' will cause error # TypeError: 'unicode'/'str' object does not support item assignment return s[::-1]
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import (division, absolute_import, print_function, unicode_literals) import os import sys from fs import open_fs file_path = sys.argv[1] fs_url = sys.argv[2] filename = os.path.basename(file_path) with open_fs(fs_url) as fs: ...
#!/usr/bin/env python3 # # actorname - library for generating human-readable, random names # for objects (e.g. hostnames, containers, blobs) # Copyright (c) 2013 Casey Marshall <casey.marshall@gmail.com> # Copyright (c) 2019 Mark Christopher West <markchristopherwest@gmail.com> # # ssh-import-id is free softw...
""" This plugin is meant for linux Shellcheck this """ import os import sublime_plugin class ShellcheckCommand(sublime_plugin.TextCommand): def run(self, edit): file_path = self.view.file_name() current_directory = os.path.dirname(file_path) command = 'gnome-terminal --wo...
# -*- coding: utf-8 -*- ############################################################ # # Autogenerated by the KBase type compiler - # any changes made here will be overwritten # ############################################################ from __future__ import print_function # the following is a hack to get the basec...
import items class Title: def __init__(self,title): self.title = title def is_achieved(self, inventory, stats): raise NotImplementedError() class Mage(Title): def __init__(self): super().__init__(title = ' \033[95m{}\033[0m'.format('the Mage')) def calc_status_...
from __future__ import print_function import sys sys.path.insert(1,"../../../") from tests import pyunit_utils import h2o from h2o.estimators.glm import H2OGeneralizedLinearEstimator from h2o.utils.typechecks import assert_is_type def h2oget_model(): """ Python API test: h2o.get_model(model_id) """ tra...
''' Faça um Programa que leia 20 números inteiros e armazene-os num vetor. Armazene os números pares no vetor PAR e os números IMPARES no vetor impar. Imprima os três vetores. ''' numeros=[] par=[] impar=[] for numero in range(1,21): numeros.append(numero) if numero%2 == 0: par.append(numero) else:...
# An example of plotting the recall curves for two ASREVIEW files in one plot, # with a legend. from asreview import open_state import matplotlib.pyplot as plt from asreviewcontrib.insights.plot import plot_recall fig, ax = plt.subplots() with open_state("tests/asreview_files/sim_van_de_schoot_2017_1.asreview") as ...
from __future__ import division __author__ = 'Victor Ruiz, vmr11@pitt.edu' from math import log import numbers import numpy as np import pandas as pd from ..metrics import entropy, cut_point_information_gain class MDLP_Discretizer(object): def __init__(self, dataset, class_label, out_path_data=None, out_path_...
from .. import settings from .. import logging as logg from ..preprocessing.moments import get_connectivities from ..tools.utils import strings_to_categoricals from . import palettes import os import numpy as np import matplotlib.pyplot as pl from matplotlib.ticker import MaxNLocator from mpl_toolkits.axes_grid1.inset...
q = 2**255 - 19 def expmod(b,e,m): if e == 0: return 1 t = expmod(b,e/2,m)**2 % m if e & 1: t = (t*b) % m return t def inv(x): return expmod(x,q-2,q) def radix255(x): x = x % q if x + x > q: x -= q x = [x,0,0,0,0,0,0,0,0,0] bits = [26,25,26,25,26,25,26,25,26,25] for i in range(9):...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Mar 1 01:11:12 2021 @author: Clement """ import pandas from matplotlib import dates import matplotlib.pyplot as plt import numpy import os import matplotlib.lines as mlines import matplotlib.backends.backend_pdf import matplotlib.image as image import ...
import unittest import sys import os import shutil sys.path.append(os.path.abspath('..')) from pipelines.txt_ops import TextPreparation class Test(unittest.TestCase): def setUp(self): params = {} params['input_path'] = 'data/intents_test.json' params['output_path'] = 'test_data' ...
# Code from Chapter 13 of Machine Learning: An Algorithmic Perspective # by Stephen Marsland (http://seat.massey.ac.nz/personal/s.r.marsland/MLBook.html) # You are free to use, change, or redistribute the code in any way you wish for # non-commercial purposes, but please maintain the name of the original author. # Th...
# Copyright (c) 2009-2020 Arm Limited # SPDX-License-Identifier: Apache-2.0 # # 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 ...
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) import os from spack import * class PyBasemap(PythonPackage): """The matplotlib basemap toolkit is a library for pl...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'C:\Users\Void\Desktop\StringReplacer.ui' # # Created by: PyQt5 UI code generator 5.11.3 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_Dialog(object): def setupUi(self, Dial...
#------------------------------------------------------------------------------- # # Project: EOxServer <http://eoxserver.org> # Authors: Fabian Schindler <fabian.schindler@eox.at> # #------------------------------------------------------------------------------- # Copyright (C) 2013 EOX IT Services GmbH # # Permission...
from collections import defaultdict import sys sys.setrecursionlimit(10**9) N, Q = map(int, input().split()) G = defaultdict(list) for _ in range(N - 1): a, b = map(int, input().split()) a, b = a - 1, b - 1 G[a].append(b) G[b].append(a) depth = [-1] * N depth[0] = 0 q = [0] while q: at = q.pop(...
# Copyright 2016 Isotoma Limited # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
# Import multiprocessing import multiprocessing as mp from multiprocessing import Process, Manager, Value from RL.ppo import PPO from RL.parallel_worker import ParWorker from RL.worker import EvalWorker import torch from torch.utils.tensorboard import SummaryWriter import os import time def init_worker(constructo...
# ------------------------------------------------------------------------------ # <auto-generated> # This code was generated by a tool. # Changes to this file may cause incorrect behavior and will be lost if # the code is regenerated. # </auto-generated> # # Copyright (c) Microsoft Corporation. All rights ...
import transfer_pb2 as transfer_manager import transfer_pb2_grpc as transfer_manager_grpc import grpc import json import os import subprocess #from asyncio.windows_events import NULL from urllib.parse import urlparse sdk_grpc_url = None def set_grpc_url(url): global sdk_grpc_url print("Hello") sdk_grpc_ur...
from django.contrib.auth.models import User from django.db import models from django.contrib.contenttypes import fields from .attachment import Attachment from .survey import Survey from django_q.tasks import async_task from notifications import tasks try: from django.conf import settings if settings.AUTH_U...
# # # Copyright 2019 Asylo authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
# Copyright (c) The Libra Core Contributors # SPDX-License-Identifier: Apache-2.0 from .utils import StructureException, StructureChecker, \ REQUIRED, OPTIONAL, WRITE_ONCE, UPDATABLE, \ JSONSerializable from .shared_object import SharedObject from .status_logic import Status from .libra_address import LibraAdd...
def fancy_divider(divider_length): divider = '' for i in range(divider_length): if i % 2 == 0: divider += '=' else: divider += '-' print(divider)
# conda activate autocheml import pandas as pd import numpy as np from scipy.stats import rankdata import collections df = pd.read_csv("data_7.csv") df = df.round(3) columns = [ "ActivityClfAutoML", "ActivityRegAutoML", "ActivityClfGraph", "ActivityRegGraph" ] for col in columns: values = np.arr...
from bitshares_pricefeed.sources.okcoin import Okcoin def test_okcoin_fetch(checkers): source = Okcoin(quotes=['BTC'], bases=['USD', 'EUR']) feed = source.fetch() checkers.check_feed(feed, ['BTC:USD', 'BTC:EUR'])
import numpy as np def Ochiai(e_p, n_p, e_f, n_f): return e_f/np.sqrt((e_f + n_f) * (e_f + e_p)) def Tarantula(e_p, n_p, e_f, n_f): r_f = e_f/(e_f + n_f) r_p = e_p/(e_p + n_p) return r_f/(r_f + r_p) def Jaccard(e_p, n_p, e_f, n_f): return e_f/(e_f + n_f + e_p) def RussellRao(e_p, n_p, e_f, n_f):...
import re result = re.match(r'^weather/(?P<city>\w*)/(?P<year>\d{4})/$', "weather/beijing/2008/") print(result.group('city'))
#ATS:SlurmProcessorScheduled SELF SlurmProcessorScheduled 12 #ATS:slurm8 SELF SlurmProcessorScheduled 8 #ATS:slurm12 SELF SlurmProcessorScheduled 12 #ATS:slurm16 SELF SlurmProcessorScheduled 16 #ATS:slurm20 SELF SlurmProcessorScheduled 20 #ATS:slurm24 ...