text
stringlengths
1
927k
from django.db import models from django.contrib.auth import get_user_model class MessagingMessage(models.Model): title = models.CharField(max_length=100) text = models.TextField(max_length=2000, blank=True, null=True) message_sent_date = models.DateTimeField(verbose_name="message sent date", auto_now_add...
import pyeccodes.accessors as _ def load(h): def wrapped(h): discipline = h.get_l('discipline') parameterCategory = h.get_l('parameterCategory') parameterNumber = h.get_l('parameterNumber') if discipline == 0 and parameterCategory == 1 and parameterNumber == 10: retu...
# import the necessary packages from django.shortcuts import render from django.views.decorators.csrf import csrf_exempt from django.http import JsonResponse,HttpResponse import numpy as np import urllib import json import cv2 import os from .face import dog_ear from glob import glob from .forms import ImgForm,...
import os from django.conf.urls import include, url from django.contrib import admin from django.urls import path from django_prometheus import exports as django_prometheus from rest_framework.authtoken.views import obtain_auth_token from rest_framework.documentation import include_docs_urls from scheduler import vie...
import numpy as np import pandas as pd import tensorflow as tf import os import warnings import time warnings.filterwarnings('ignore') from tensorflow import keras from sklearn.preprocessing import RobustScaler, Normalizer, StandardScaler from sklearn.model_selection import train_test_split from datasets import load...
#!/usr/bin/python2 # # Copyright (c) 2009 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'cPatches.ui' # # Created by: PyQt5 UI code generator 5.6 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_Patches(object): def setupUi(self, Patches): Patches.setObjec...
from guillotina.async_util import IAsyncJobPool from guillotina.async_util import IQueueUtility from guillotina.browser import View from guillotina.component import get_utility from guillotina.tests import utils import asyncio class AsyncMockView(View): def __init__(self, context, request, func, *args, **kwargs...
# -*- coding: utf-8 -*- # FROM: https://github.com/lucidm/i2lcd import smbus class PCA9535(object): INPUT_PORT0 = 0 INPUT_PORT1 = 1 OUTPUT_PORT0 = 2 OUTPUT_PORT1 = 3 POL_INV0 = 4 POL_INV1 = 5 CONF_PORT0 = 6 CONF_PORT1 = 7 def __init__(self, bus, address): self.bus = smbus...
from pyfakeuse.pyfakeuse import fake_use # noqa: F401
"""A simple cnn model.""" import argparse from collections import OrderedDict from typing import Any, Dict, Optional import torch import torch.nn as nn class SimpleCNN(nn.Module): """A simple CNN model. Args: data_config: a dictionary containing information about data. args (optional): arg...
# MODELS contains a set of functions for minimisation to seismic spectra. # It can be modified as appropriate. import numpy as np from . import config as cfg MODS = ["BRUNE", "BOATWRIGHT"] # UTIL FUNCS def which_model(mod): if mod in MODS: if mod == "BRUNE": return BRUNE_MODEL if mod =...
from __future__ import annotations from datetime import datetime import re import numpy as np import pytest from pandas.compat import np_version_under1p20 import pandas as pd from pandas import ( DataFrame, Index, Series, Timestamp, date_range, ) import pandas._testing as tm @pytest.fixture de...
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
# -*- coding: utf-8 -*- conjunto = {"alface", "tomate", "cenoura", "beterraba", "tomate"} print ("Atente que o tomate não é repetido:", conjunto)
''' Created by auto_sdk on 2016.04.13 ''' from top.api.base import RestApi class FenxiaoProductcatUpdateRequest(RestApi): def __init__(self,domain='gw.api.taobao.com',port=80): RestApi.__init__(self,domain, port) self.agent_cost_percent = None self.dealer_cost_percent = None self.name = None self.product_lin...
import requests import sqlite3 import pprint def Crear_tabla(): try: conexion = sqlite3.connect('usuarios.db') cursor = conexion.cursor() print('Conectado a SQLite') query = '''CREATE TABLE IF NOT EXISTS usuarios ( id INTEGER PRIMARY KEY, nam...
# created by atom import math import numpy as np from selfdrive.config import Conversions as CV from selfdrive.car.hyundai.values import Buttons from common.numpy_fast import clip, interp from cereal import log import cereal.messaging as messaging from common.params import Params import common.log as trace1 import co...
from __future__ import print_function from pymol.wizard import Wizard from pymol import cmd import pymol import copy default_map = [ '', '', ''] default_level = [ 1.0, 3.0, -3.0] default_radius = 8.0 default_track = 0 class Density(Wizard): def __init__(self,_self=cmd): self.cmd = _self self.cm...
from tkinter import * from tkinter import messagebox from winreg import * TITLE = "Alto's editor" RESOLUTION = "200x50" PATH = r"Software\Team Alto\The Alto Collection" def get_coins(): key = OpenKey(HKEY_CURRENT_USER, PATH) for i in range(0, QueryInfoKey(key)[1]): entry = EnumValue(key, i) i...
import mediaoutput import argparse import cv2 import os from slides import SlideDataHelper class SlideParser(object): """ Reverses the effect of SlideSorter. Basically takes the timetable and the unique set of slides and turns them back into slides with their name representing their timestamp. (Possi...
import unittest from CSVReader import CSVReader, class_factory class MyTestCase(unittest.TestCase): def setUp(self): self.csv_reader = CSVReader('/src/Unit Test Addition.csv') def test_return_data_as_object(self): num = self.csv_reader.return_data_as_object('number') self.ass...
""" Code is generated by ucloud-model, DO NOT EDIT IT. """ from ucloud.core.typesystem import schema, fields class ParamSchema(schema.ResponseSchema): """Param - 工作流参数""" fields = { "Name": fields.Str(required=False, load_from="Name"), "Type": fields.Str(required=False, load_from="Type"), ...
"""Tests for methods in row_handling.py.""" from claims_to_quality.lib.teradata_methods import row_handling import mock from tests.assets import test_helpers def test_convert_list_of_lists_to_teradata_rows(): """Test that lists of lists can be converted to Teradata row objects.""" data = [('value1', 2, 3), ...
import unittest2 as unittest import copy import numpy as np from svm_specializer.svm import * class BasicTests(unittest.TestCase): def test_init(self): svm = SVM() self.assertIsNotNone(svm) class SyntheticDataTests(unittest.TestCase): def read_data(self, in_file_name): feats = open(in...
import urllib.request import os import zipfile import gzip import sys import igraph as ig from collections import defaultdict def download_with_notes(url, filename, data_dir, progressbar=True): """ Uses urllib to download data from URL. Saves the results in data_dir/FILENAME. Provides basic logging to stdo...
####################################################################### # Copyright (C) 2017 Shangtong Zhang(zhangshangtong.cpp@gmail.com) # # Permission given to modify the code as long as you keep this # # declaration at the top # ################################...
from .._py2 import * class CacheError(Exception): '''Base class for exceptions related to the cache''' pass class PageNotCachedError(CacheError): '''Exception raised when a non-existent page is requested''' def __init__(self): super().__init__('This page has not been cached yet.') class Page...
""" The following code is intended to be run only by travis for continuius intengration and testing purposes. For implementation examples see notebooks in the examples folder. """ from PIL import Image, ImageDraw import torch from torch.utils.data import DataLoader from torchvision import transforms, datasets import n...
from lamp import Lamp def run(): lamp = Lamp(is_turned_on=False) while True: command = str( input(''' ¿Qué deseas hacer? [p]render [a]pagar [s]alir ''')) if command == 'p': lamp.turn_on() elif command == 'a': ...
import itertools import numpy as np from timeit import default_timer as timer from graph_tool.all import * import pickle import networkx as nx import matplotlib as mpl #mpl.use('TkAgg') import matplotlib.pyplot as plt from igraph import * def nodes_edges(num_nodes): """ this function takes number of nodes and ret...
#!/usr/bin/env python """The setup script.""" from setuptools import setup, find_packages with open('README.rst') as readme_file: readme = readme_file.read() with open('HISTORY.rst') as history_file: history = history_file.read() requirements = [ ] setup_requirements = ['pytest-runner', ] test_requiremen...
# =============================================================================== # Copyright 2013 Jake Ross # # 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/licens...
# -*- coding: utf-8 -*- # ------------------------------------------------------------------------------ # # Copyright 2018-2019 Fetch.AI 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 ...
# Exercício Python 065: Crie um programa que leia vários números inteiros pelo teclado. # No final da execução, mostre a média entre todos os valores e qual foi o maior e o menor valores lidos. # O programa deve perguntar ao usuário se ele quer ou não continuar a digitar valores. sum = average = bigger = smaller = co...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright (C) IBM Corporation 2018 # # 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 # # U...
# yacon.models.hierarchy.py import re, logging from django.db import models from django.template.defaultfilters import slugify from treebeard.mp_tree import MP_Node from yacon.models.common import Language, TimeTrackedModel, NodePermissionTypes from yacon.models.pages import Page, MetaPage from yacon.definitions imp...
# Generated by Django 3.0 on 2020-06-12 11:01 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('webapp', '0004_auto_20200611_1928'), ] operations = [ migrations.AddField( model_name='raffle', name='active', ...
""" PERIODS """ numPeriods = 60 """ STOPS """ numStations = 6 station_names = ( "Hamburg Hbf", # 0 "Landwehr", # 1 "Hasselbrook", # 2 "Wansbeker Chaussee*", # 3 "Friedrichsberg*", # 4 "Barmbek*", # 5 ) numStops = 12 stops_position = ( (0, 0), # Stop 0 (2, 0), # Stop 1 (3, 0), # Stop 2 (4, 0), # S...
######################################################## # Copyright 2019-2021 program was created VMware, Inc. # # SPDX-License-Identifier: Apache-2.0 # ######################################################## import time import pulsar from fate_arch.common import log LOGGER = log.getLogger() CHANN...
# Copyright 2017-2018 Capital One Services, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed ...
# Generated by Django 2.2.2 on 2020-03-05 00:56 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('ordenes', '0001_initial'), ] operations = [ migrations.AddField( model_name='orden', name='preferencia_de_pago', ...
""" Test the processor hooks """ from pathlib import Path from tempfile import TemporaryDirectory import warnings import pytest from .. import Pooch from ..processors import Unzip, Untar, ExtractorProcessor, Decompress from .utils import pooch_test_url, pooch_test_registry, check_tiny_data REGISTRY = pooch_test_re...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Oct 9 16:50:42 2019 @author: dberke Tests for star.py. """ import datetime as dt from pathlib import Path import numpy as np import pytest import unyt as u import varconlib as vcl from varconlib.exceptions import StarDirectoryNotFoundError from va...
from schematics.types import ModelType, StringType, PolyModelType from spaceone.inventory.libs.schema.metadata.dynamic_field import TextDyField, DateTimeDyField, EnumDyField, \ ListDyField, SizeField, StateItemDyField from spaceone.inventory.libs.schema.metadata.dynamic_layout import ItemDynamicLayout, TableDynami...
import pytest pytestmark = pytest.mark.asyncio @pytest.mark.app_settings({"applications": ["guillotina", "guillotina.contrib.vocabularies"]}) async def test_contrib_vocabulary(container_requester): async with container_requester as requester: response, _ = await requester("GET", "/db/guillotina/@vocabul...
from testutils import assertRaises assert dict(a=2, b=3) == {'a': 2, 'b': 3} assert dict({'a': 2, 'b': 3}, b=4) == {'a': 2, 'b': 4} assert dict([('a', 2), ('b', 3)]) == {'a': 2, 'b': 3} assert {} == {} assert not {'a': 2} == {} assert not {} == {'a': 2} assert not {'b': 2} == {'a': 2} assert not {'a': 4} == {'a': 2} ...
#!/usr/bin/python # # gethostlatency Show latency for getaddrinfo/gethostbyname[2] calls. # For Linux, uses BCC, eBPF. Embedded C. # # This can be useful for identifying DNS latency, by identifying which # remote host name lookups were slow, and by how much. # # This uses dynamic tracing of user-level ...
from django.shortcuts import render from django.http import HttpResponse from .models import Placa def index(request): data = dict() data['regulamentacao'] = Placa.objects.filter(categoria='reg').order_by('pk') data['advertencia'] = Placa.objects.filter(categoria='adv').order_by('pk') return render(r...
from __future__ import absolute_import '''Copyright 2015 LinkedIn Corp. 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 ...
# -*- coding: utf-8 -*- """ These functions "walk" the profile, and return either a boolean variable to tell whether an option is configured or not, or the actual value """ import base64 import inspect import logging import hashlib import os import re import shutil import sys import yaml from cryptography.fernet import...
import sys sys.setrecursionlimit(1500) def vsota_potenc(n): if n == 1: return 1 else: return n ** n + vsota_potenc(n - 1) print(vsota_potenc(1000) % (10 ** 10))
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "cdrc_cms.settings") try: from django.core.management import execute_from_command_line except ImportError: # The above import may fail for some other reason. Ensure that the...
""" Copyright (c) 2016-present, Facebook, Inc. All rights reserved. This source code is licensed under the BSD-style license found in the LICENSE file in the root directory of this source tree. An additional grant of patent rights can be found in the PATENTS file in the same directory. """ import asyncio import loggi...
import enum import functools from typing import Dict, Type from electrum_gui.common.basic import bip44 from electrum_gui.common.coin import data from electrum_gui.common.conf import chains as chains_conf from electrum_gui.common.secret import data as secret_data CHAINS_DICT = {} COINS_DICT = {} def _replace_enum_fi...
#!/usr/bin/env python # coding: utf-8 # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. from os.path import join as pjoin import json import os import sys # Our own imports from jupyter_packaging import ( create_cmdclass, get_version, command_for_func, combin...
from functions import * from log import * from conf import * wait_time=int(config['programconfig']['checktimemins'])*60 heart_time=int(config['programconfig']['heartbeatmins'])*60 websiteurl=config['urls']['siteurl'] ff_visible=0 if config['programconfig'].getboolean('hide_ff') == False: ff_visible=1 count...
import requests from types import FunctionType import plotly.io as pio import json from .core import EndaqCloud, ENV_PRODUCTION, ENV_STAGING, ENV_DEVELOP __all__ = [ 'create_cloud_dashboard_output', 'produce_dashboard_plots', ] def create_cloud_dashboard_output(name_to_fig: dict) -> str: """ A func...
import numpy as np import talib from typing import Union def mom(candles: np.ndarray, period=10, sequential=False) -> Union[float, np.ndarray]: """ MOM - Momentum :param candles: np.ndarray :param period: int - default=10 :param sequential: bool - default=False :return: float | np.ndarray ...
import copy import grokcore.component as grok import zeit.cms.content.property import zeit.content.cp.interfaces import zeit.edit.block import zeit.edit.interfaces import zope.component import zope.interface @zope.interface.implementer(zeit.content.cp.interfaces.ICenterPage) @zope.component.adapter(zeit.edit.interfac...
import enum import datetime import textwrap import freezegun import pytest pytest_plugins = ["pytester"] @pytest.fixture(name="emoji_tests", autouse=True) def fixture_emoji_tests(testdir): """Create a test module with several tests that produce all the different pytest test outcomes. """ emoji_tests...
#!/usr/bin/env false from htd_validate.decompositions import TreeDecomposition from htd_validate.validators.validator import Validator class TreeDecompositionValidator(Validator): _baseclass = TreeDecomposition
# Copyright (c) 2015 Mirantis 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 or agreed to in writing...
# Generated by Django 2.2.4 on 2019-08-27 13:35 # flake8: noqa # fmt: off from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ('auth', '0011_update_proxy_permissions'), ] operations = [ migrations.CreateModel( ...
import os import numpy as np from matplotlib import pyplot as plt import matplotlib import config as cfg from utils import read_from_pickle_file # Server to Dell box matplotlib.use('TkAgg') train_loss = [] validation_loss = [] train_loss_loc = os.path.join(cfg.loss_dir, 'train_loss') validation_loss_loc = os.path.j...
from numba import jit, int32 @jit(int32(int32, int32)) def f(x, y): # A somewhat trivial example return x + y print(f) # print(f(123, 123**30)) @jit(nopython=True) def f(x, y): return x + y
"""UMBuysDjango URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/3.1/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-...
# coding: utf-8 """ CRM Imports No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 The version of the OpenAPI document: v3 Generated by: https://openapi-generator.tech """ import pprint import re # noqa: F401 import six from h...
# Copyright 2018-present Facebook, 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 or agreed to i...
"""Support for Homekit device discovery.""" from __future__ import annotations import asyncio from typing import Any import aiohomekit from aiohomekit.model import Accessory from aiohomekit.model.characteristics import ( Characteristic, CharacteristicPermissions, CharacteristicsTypes, ) from aiohomekit.mo...
# exported from PySB model 'model' from pysb import Model, Monomer, Parameter, Expression, Compartment, Rule, Observable, Initial, MatchOnce, Annotation, ANY, WILD Model() Monomer('Ligand', ['Receptor']) Monomer('ParpU', ['C3A']) Monomer('C8A', ['BidU', 'C3pro']) Monomer('SmacM', ['BaxA']) Monomer('BaxM', ['BidM', '...
import torch import torch.nn as nn import torch.nn.functional as F from torch.utils.checkpoint import checkpoint from einops import rearrange, repeat class CrissCrossAttention(nn.Module): def __init__(self, in_dim): super(CrissCrossAttention, self).__init__() self.query_conv = nn.Conv2d(in_channel...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Author: Pradeep Jairamani , github.com/pradeepjairamani import socket import socks import time import json import threading import string import random import sys import struct import re import os from OpenSSL import crypto import ssl from core.alert import * from core.t...
# # Author : A. Bruneton # from pyqtside.QtGui import QGridLayout, QVBoxLayout, QTabWidget, QWidget, QLabel, QGroupBox from pyqtside.QtCore import Qt def setup4Lay(lay): """ Handy function to setup a 4-cols layout """ lay.setColumnStretch(0, 0) lay.setColumnStretch(1, 10) lay.setColumnStretch(2, 20) lay.set...
# Generated by Django 3.0.5 on 2020-04-24 10:55 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), ('snippets', '0001_initial...
import cv2 import random import math import numpy as np import os import sys from jangjorim_client import resource_path # constants threshold = 50 interpol = 0.7 velocity = 0 # target color target_color = { "blue" : (255,0,0), "green" : (0,255,0), "red" : (0,0,255), "yellow" : (0,255,255), "origin" : (255,...
from aspose.email.storage.pst import * from aspose.email.mapi import MapiContact from aspose.email.mapi import ContactSaveFormat def run(): dataDir = "Data/" #ExStart: AccessContactInformation pst = PersonalStorage.from_file(dataDir + "SampleContacts_out.pst") folderInfo = pst.get_predefined_folder(StandardIp...
import os import re from setuptools import setup, find_packages try: from pypandoc import convert read_md = lambda f: convert(f, 'rst') except ImportError: print("warning: pypandoc module not found, could not convert Markdown to RST") read_md = lambda f: open(f, 'r').read() def read_version(): # __PATH__ = ...
from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt import numpy as np skip = 15 #source = '/home/eugen/catkin_ws/src/Camera_Lidar/DATA/pcd/0002.csv' #data = np.genfromtxt(source, delimiter=',')[1::skip,:3] #print ('data ', np.shape(data)) #x,y,z = data[:,0],data[:,1],data[:,2] '''fig = plt.figur...
# -*- coding: utf-8 -*- from __future__ import print_function import hashlib import os import time import warnings import requests from ._protos.public.common import CommonService_pb2 as _CommonCommonService from ._protos.public.modeldb import DatasetService_pb2 as _DatasetService from ._protos.public.modeldb impor...
""" Low-dependency indexing utilities. """ import numpy as np from pandas.core.dtypes.common import is_list_like from pandas.core.dtypes.generic import ABCIndexClass, ABCSeries # ----------------------------------------------------------- # Indexer Identification def is_list_like_indexer(key) -> bool: """ C...
from django.test import TestCase import mock from templatetags import active from msgvis.apps.corpus import models as corpus_models from django.utils import timezone as tz from datetime import timedelta class TemplateTagActiveTest(TestCase): def test_matches_request_path(self): request = mock.Mock() ...
from lib.common import helpers class Module: def __init__(self, mainMenu, params=[]): self.info = { 'Name': 'Invoke-WMIDebugger', 'Author': ['@harmj0y'], 'Description': ('Uses WMI to set the debugger for a target binary on a remote ' 'mach...
# mmpdb - matched molecular pair database generation and analysis # # Copyright (c) 2015-2017, F. Hoffmann-La Roche Ltd. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must ret...
import pytest from data.add_student import testdata_add_student from model.registration import Reg @pytest.mark.run(order=3) # @pytest.mark.repeat(20) @pytest.mark.parametrize('students', testdata_add_student, ids=[repr(x) for x in testdata_add_student]) def test_add_student(app, students): user = 'dmitriev+9@uch...
#! /usr/bin/python # -*- coding: utf-8 -*- import json import time class Message: def __init__(self, type: str, data: dict, timestamp: float = None): self.timestamp = time.time() if timestamp is None else timestamp self.type = type self.data = data self.client_address = None ...
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. import os import subprocess import sys from pathlib import Path from setuptools import Ex...
""" 单源点最短路径算法,所有顶点对之间的最短路径算法 """ from prioqueue import PrioQueue # , PrioQueueError from graph import * # Find nearest pathes from a single vertex to other reachable # vertices using Dijkstra algorithm. # Use a loop to find next nearest vertex, time O(V^2), space O(V) def dijkstra_shortest_paths(graph, v0): vn...
import importlib def test_import(): """The package imports correctly.""" # Capturing the exception and then asserting for it makes the failure mode # look normal; if we call pytest.fail() inside the except block, we get # a long traceback with exceptions raised during outer exception handling. exc...
# -*- coding: utf-8 -*- from __future__ import print_function import re import sys from datetime import datetime, timedelta import numpy as np import pandas as pd import pandas.compat as compat from pandas.types.common import (is_object_dtype, is_datetimetz, needs_i8_conversion) impo...
""" Dendritic Geometry Model, described by Jaap van Pelt et al. in [1], chapter 7.1. [1] Computational neuroscience: Realistic modeling for experimentalists, edited by Erik De Schutter, 2001, CRC Press. """ import math import random import textwrap import itertools from utils import counted class InvalidModelParam(...
from typing import Counter from warnings import resetwarnings from bottle import route, run, request, template import os import csv import webbrowser cwd = os.getcwd() xcwd = cwd.replace('\\','/') print(xcwd) sscwd = xcwd + "/server/security" print(sscwd) def fsync(): global sscwd ssucwd = sscwd + "/user.csv...
""" Defines the Cell class """ #*************************************************************************************************** # Copyright 2015, 2019 National Technology & Engineering Solutions of Sandia, LLC (NTESS). # Under the terms of Contract DE-NA0003525 with NTESS, the U.S. Government retains certain right...
import os import sqlite3 import re data_filename = 'dhcp_snooping.txt' db_filename = 'dhcp_snooping.db' schema_filename = 'dhcp_snooping_schema.sql' regex = re.compile(r'(\S+) +(\S+) +\d+ +\S+ +(\d+) +(\S+)') result = [] with open('dhcp_snooping.txt') as data: for line in data: match = regex.search(line...
# model settings conv_cfg = dict(type='ConvWS') norm_cfg = dict(type='GN', num_groups=32, requires_grad=True) model = dict( type='MaskRCNN', pretrained='open-mmlab://jhu/resnext101_32x4d_gn_ws', backbone=dict( type='ResNeXt', depth=101, groups=32, base_width=4, num_st...
# Copyright 2014-2016 Insight Software Consortium. # Copyright 2004-2008 Roman Yakovenko. # Distributed under the Boost Software License, Version 1.0. # See http://www.boost.org/LICENSE_1_0.txt import os import unittest import autoconfig import parser_test_case from pygccxml import parser from pygccxml import declarat...
import os import re import unittest import six from conans.client.build.cmake_flags import CMakeDefinitionsBuilder from conans.client.conf import default_settings_yml from conans.client.generators import CMakeFindPackageGenerator, CMakeFindPackageMultiGenerator from conans.client.generators.cmake import CMakeGenerato...
import torch device = torch.device('cuda') if torch.cuda.is_available() else torch.device('cpu') FloatTensor = torch.cuda.FloatTensor if torch.cuda.is_available() else torch.FloatTensor LongTensor = torch.cuda.LongTensor if torch.cuda.is_available() else torch.LongTensor
""" Biomass Pellet configuration ---------------------------- Contains biomass wood configuration info for community data yaml file, and other set-up requirements """ import aaem.components.biomass_base as bmb from copy import deepcopy COMPONENT_NAME = "Biomass for Heat (Cordwood)" IMPORT = "IMPORT" UNKNOWN =...
# Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. # # Use of this source code is governed by a BSD-style license # that can be found in the LICENSE file in the root of the source # tree. An additional intellectual property rights grant can be found # in the file PATENTS. All contributing project au...