text
stringlengths
2
999k
""" Django settings for ops project. Generated by 'django-admin startproject' using Django 1.11.10. For more information on this file, see https://docs.djangoproject.com/en/1.11/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.11/ref/settings/ """ import os im...
begin_unit comment|'# Copyright 2010 United States Government as represented by the' nl|'\n' comment|'# Administrator of the National Aeronautics and Space Administration.' nl|'\n' comment|'# All Rights Reserved.' nl|'\n' comment|'#' nl|'\n' comment|'# Licensed under the Apache License, Version 2.0 (the "License"); ...
""" Reads shake_data.hdf from the event's current directory and adds local configs, data, etc., then writes a new shake_data.hdf. """ # stdlib imports import argparse import inspect import os.path import glob import datetime import shutil import sys import logging # third party imports from configobj import ConfigObj...
import datetime from os.path import dirname, join import pytest from city_scrapers_core.constants import ADVISORY_COMMITTEE, PASSED from city_scrapers_core.utils import file_response from freezegun import freeze_time from city_scrapers.spiders.chi_mayors_pedestrian_advisory_council import ( ChiMayorsPedestrianAdv...
# 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...
#!/usr/bin/env python # Agent training script for completing call-to-action tasks on websites # Chapter 6, TensorFlow 2 Reinforcement Learning Cookbook | Praveen Palanisamy import argparse import os from datetime import datetime import gym import numpy as np import tensorflow as tf from tensorflow.keras.layers import...
import os from invoke import task from tests.refapi import JenkinsCLI from tests.install import JenkinsInstall JENKINS_WAR_URL = 'http://mirrors.jenkins-ci.org/war/latest/jenkins.war' JENKINS_CLI_JAR = 'tests/tmp/latest/jenkins-cli.jar' JENKINS_HOST = 'localhost' JENKINS_PORT = 60888 JENKINS_CPORT = 60887 JENKINS_D...
import argparse from pdm.cli import actions from pdm.cli.commands.base import BaseCommand from pdm.cli.options import clean_group, dry_run_option, groups_group, install_group from pdm.project import Project class Command(BaseCommand): """Synchronize the current working set with lock file""" def add_argument...
"""Unittests for the various HTTPServer modules. Written by Cody A.W. Somerville <cody-somerville@ubuntu.com>, Josip Dzolonga, and Michael Otteneder for the 2007/08 GHOP contest. """ from http.server import BaseHTTPRequestHandler, HTTPServer, \ SimpleHTTPRequestHandler, CGIHTTPRequestHandler import os import sy...
"""Setuptools entry point.""" import codecs import os import pathlib from typing import Dict, List try: from setuptools import setup # type: ignore except ImportError: from distutils.core import setup package_name = 'lib_ip' # type: str requir...
# Copyright 2020 Red Hat, 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 required by...
from django_filters import CharFilter from django_filters.constants import EMPTY_VALUES class TagFilter(CharFilter): """ The tag filter makes sure objects with the given tag is returned. """ def filter(self, qs, value): if value in EMPTY_VALUES: return qs return qs.filter(...
#!/usr/bin/env python3 # Copyright (c) 2020 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test error messages for 'getaddressinfo' and 'validateaddress' RPC commands.""" from test_framework.test_fr...
from fastapi import FastAPI, HTTPException from dotenv import load_dotenv import config, uvicorn, os, datetime, accommFunctions, accommModel accommodationApp = FastAPI() # Our root endpoint @accommodationApp.get("/") def index(): return {"message": "Hello World"} # Hotel Information Endpoint: # The function getH...
# 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 (the # "License"); you may not u...
from kivy.factory import Factory from utils import DisallowInterfaceInstantiation, DivideFrequency from utils import DecorCoordNormalizer, MechCoordNormalizer from resource import ResourceStack from invariants import NoExcept from inventory import Inventory import resource DecorationsEnum = {} class IDecoration(Dis...
import cv2 import numpy as np import imutils import time import easygopigo3 import config as cfg import bleScanner as ble # from bleCommunication.bleScanner import DeviceScanner from threading import Thread from collections import OrderedDict from picamera.array import PiRGBArray from utils import findC...
""" The 'Message of the Day' interface. """ # Enthought library imports. from traits.api import Interface class IMOTD(Interface): """ The 'Message of the Day' interface. """ def motd(self): """ Return the message of the day. Returns an object that implements the 'IMessage' interface. ...
from sqlalchemy import Column, Integer, String from wikimetrics.configurables import db from custom_columns import MediawikiTimestamp from sqlalchemy.dialects.mysql import TINYBLOB, VARBINARY from wikimetrics.utils import UNICODE_NULL __all__ = ['MediawikiUser'] class MediawikiUser(db.MediawikiBase): __tablename...
''' Sample This script loads a pretrained net and a weightsfile and sample ''' import functools import math import numpy as np from tqdm import tqdm, trange import torch import torch.nn as nn from torch.nn import init import torch.optim as optim import torch.nn.functional as F from torch.nn import Parameter as P i...
# -*- coding: utf-8 -*- # Copyright (c) 2013 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Stress test for dev_server_wrapper. Test script runs a long time stressing the ability to start and stop the dev_server_wr...
from __future__ import division import numpy as nm import matplotlib.pyplot as plt class draw_circle(object): def __init__(self,x,y,r,col,opt): ''' ''' theta = range(start=0, stop=nm.pi, step=0.1) def run(): fig = plt.figure() plt.xlim(0,10) p...
# coding=utf-8 r""" This code was generated by \ / _ _ _| _ _ | (_)\/(_)(_|\/| |(/_ v1.0.0 / / """ from twilio.base import serialize from twilio.base import values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.l...
""" The aim of this script is to automate some process in the Design of experiments (DoE) workflow. """ __author__ = "Vincent STRAGIER" # Maths modules from itertools import permutations, combinations from scipy.special import erfinv import numpy as np # Plotting module import matplotlib.pyplot as plt def gen_desig...
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. from typing import List import reagent.types as rlt import torch from reagent.core.configuration import resolve_defaults from reagent.core.dataclasses import field from reagent.optimizer import Optimizer__Union, SoftUpdate ...
class ColorTheme: def __init__(self, name: str, display_name: str, version: str): self.name = name self.display_name = display_name self.version = version
""" Copyright 2019-present NAVER 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 or agreed to in writing, so...
# # Copyright (c) 2017 Wind River Systems, Inc. # # SPDX-License-Identifier: Apache-2.0 # from six.moves import configparser import os from sysinv.common import utils from sysinv.common import constants from tsconfig import tsconfig from six.moves.urllib.parse import urlparse from sysinv.puppet import openstack O...
test = { 'name': 'q3a4', 'points': 2, 'suites': [ { 'cases': [ { 'code': '>>> ' 'np.sum(train_confusion_matrix) ' '== 691\n' 'True', ...
# -*- coding: utf-8 -*- """Dynamically creates tests for all schemas and example files.""" # pylint: disable=protected-access from __future__ import print_function import logging import os import subprocess from pathlib import Path from typing import TYPE_CHECKING, Optional import pytest from ansiblelint.config impor...
#!/usr/bin/env python """ 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 (the "License");...
import fileinput from sklearn import datasets, linear_model from sklearn.linear_model import LinearRegression #######Extract the Training and Testing data i=-1 for line in fileinput.input(): if i==-1: no_feature=int(line.split(" ")[0]) no_row=int((line.split(" ")[1])) training_feature=[] ...
""" **Project Name:** MakeHuman **Product Home Page:** http://www.makehuman.org/ **Code Home Page:** https://bitbucket.org/MakeHuman/makehuman-utils **Authors:** Thomas Larsson **Copyright(c):** MakeHuman Team 2001-2014 **Licensing:** AGPL3 (http://www.makehuman.org/doc/node/the_make...
"""Base urls used by Satchmo. Split out from urls.py to allow much easier overriding and integration with larger apps. """ from django.conf.urls import patterns, include from satchmo_utils.signals import collect_urls from product.urls.base import adminpatterns as prodpatterns from shipping.urls import adminpatterns as...
import numpy as np def sum_squares_error(y,t): return 0.5*np.sum((y-t)**2) """ def cross_entropy_error(y,t) delta=1e-7 return -np.sum(t*np.log(y+delta)) """ def cross_entropy_error(y,t): if y.ndim==1: t=t.reshape(1,t.size) y=y.reshape(1,y.size) batch_size=y.shape[0] delta=1e-7 return -np.sum(np.log(y[np....
import json from pathlib import Path from .hockey import Hockey with open(Path(__file__).parent / "info.json") as fp: __red_end_user_data_statement__ = json.load(fp)["end_user_data_statement"] async def setup(bot): cog = Hockey(bot) bot.add_cog(cog) await cog.initialize()
# Copyright 2022 The FastEstimator 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 appl...
# Generated by Django 3.0.11 on 2021-01-30 13:08 import datetime from django.conf import settings from django.db import migrations, models import django.db.models.deletion import django.db.models.manager import django.utils.timezone from django.utils.timezone import utc # Functions from the following migrations need...
from pydantic import BaseSettings, Field class MyInfo(BaseSettings): consumer_key: str = Field(..., env="TWITTER_API_KEY") consumer_secret: str = Field(..., env="TWITTER_API_SECRET_KEY") access_token: str = Field(..., env="TWITTER_ACCESS_TOKEN") access_token_secret: str = Field(..., env="TWITTER_ACCES...
#!/usr/bin/env python # # 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 (the # "...
import pickle import gzip def decode_from_latent_space(latent_points, grammar_model): decode_attempts = 500 decoded_molecules = [] for i in range(decode_attempts): current_decoded_molecules = grammar_model.decode(latent_points) current_decoded_molecules = [ x if x != '' else 'Sequence too...
""" .. module:: importance_sampling :synopsis: Perform an Importance Sampling from an existing folder .. moduleauthor:: Benjamin Audren <benjamin.audren@epfl.ch> """ from __future__ import print_function try: from collections import OrderedDict as od except ImportError: from ordereddict import OrderedDict ...
from typing import List from copy import deepcopy import spacy import torch use_cuda = torch.cuda.is_available() DEFAULT_LABEL = ['O', 'B-PER', 'I-PER', 'B-ORG', 'I-ORG', 'B-LOC', 'I-LOC', 'B-MISC', 'I-MISC'] BIO_MAP = { "B": 3, "I": 1, "O": 2 } nlp = spacy.load("en_core_web_sm") class...
#!/usr/bin/python3 # -*- coding: utf-8 -*- import sys import json import urllib.request import smallsmilhandler from xml.sax import make_parser class KaraokeLocal: def __init__(self, file): parser = make_parser() cHandler = smallsmilhandler.SmallSMILHandler() parser.setContentHandler(cH...
from .base import ( HookCollectorInfo, DataCollector, MetricsCalculator, SparsityAllocator, TaskGenerator ) from .data_collector import ( WeightDataCollector, WeightTrainerBasedDataCollector, SingleHookTrainerBasedDataCollector ) from .metrics_calculator import ( NormMetricsCalculato...
#!/usr/bin/env python # coding: utf-8 # # Explore Dataset # We will explore the **data_train.csv dataset** from the Tailwind Traders support team department. # # This is historical data about the features of each support ticket submitted. This data could unlock insights to help the support team become more efficie...
import carla import pygame import queue import numpy as np def carla_vec_to_np_array(vec): return np.array([vec.x, vec.y, vec.z]) class CarlaSyncMode(object): """ Context manager to synchronize output from different sensors. Synchronous mode is ...
import paho.mqtt.client as mqtt import RPi.GPIO as GPIO import json # MQTT Broker config broker = '127.0.0.1' port = 1883 topic = 'smartHomeHubs/led' def on_connect(client, userdata, flags, rc): print("Connecting to the MQTT server...") if rc == 0: print("Connection success") else: print...
from src.application import Application Application()
from .share import app app.run()
# -*-coding:utf-8-*- from setuptools import setup setup( name='rocketchat_API', version='1.7.0', packages=['rocketchat_API', 'rocketchat_API.APIExceptions'], url='https://github.com/jadolg/rocketchat_API', license='MIT', author='Jorge Alberto Díaz Orozco', author_email='diazorozcoj@gmail.c...
# -*- coding: utf-8 -*- # Built-in import sys import os # import itertools as itt import copy import warnings from abc import ABCMeta, abstractmethod import inspect # Common import numpy as np import scipy.interpolate as scpinterp # import matplotlib.pyplot as plt # from matplotlib.tri import Triangulation as mplTr...
from django.conf import settings from django.conf.urls.static import static from django.contrib import admin from django.urls import path, re_path from django.conf.urls import include from django.views.generic.base import RedirectView from rest_framework.decorators import api_view from rest_framework.response import ...
#!/usr/bin/python # -*- coding: utf-8 -*- # note: #www.pythonchallenge.com/pc/return/evil.html """ def transfer(strs): return ''.join(byte if ' '<byte<'~' else '.' for byte in strs) fp=open('evil2.jpg','rb') jpg_cont=fp.read(16) fp.close() fp1=open('../09/9.png','rb') png_cont=fp1.read(16) fp1.close() ...
# (C) Datadog, Inc. 2021-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) import pytest from datadog_checks.base import AgentCheck from .common import create_query_manager, mock_executor pytestmark = pytest.mark.db class TestCustomQueries: def test_instance(self, aggreg...
# DExTer : Debugging Experience Tester # ~~~~~~ ~ ~~ ~ ~~ # # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. # See https://llvm.org/LICENSE.txt for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception """Calculate a 'score' based on some dextI...
# Copyright (c) 2009 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. { 'targets': [ { 'target_name': 'variants', 'type': 'executable', 'sources': [ 'variants.c', ], 'variants': { '...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # BSD 3-Clause License (see LICENSE file) # Copyright (c) Image and Signaling Process Group (ISP) IPL-UV 2021 # All rights reserved. """ Explain latent space of LatentGranger """ import os import git import numpy as np import argparse, yaml from datetime import datetime...
b='Na Quan Feng Bi Li Bie Nian Dong Lian Ni Lian Ma Zhe Jia Yi Long Yi Dai Du Si Yi Tai Hang Shu Wan Su Yao Er Zhen Zyu Dou Jian Si Pang Hui Cha Shan Lu Wei Yu Yan Wan Qiao Luo Yu Tu Wei Ngam Tun Hun Ben Qie Jin Lai Mei Zhi Yu Ci Ye Die Cha Dian Man Deng Wei Nian Lei Bing Wu...
from .middleware import process_request from .routes import ROUTES from .errors import rate_limit_exceeded __all__ = ( 'ROUTES', 'process_request', 'rate_limit_exceeded', )
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: tb_paddle/proto/graph.proto from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_databas...
#!/usr/bin/env python # # Replication repair # Copyright (C) 2015 Larroque Stephen # # Licensed under the MIT License (MIT) # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restricti...
def predict(sentence: str) -> str: """ For a given sentence, predict the next word. :param sentence: sentence to continue :return: word predicted """ from happytransformer import HappyWordPrediction happy_wp = HappyWordPrediction("ROBERTA", "roberta-base") result = happy_wp.predict_...
""" Cisco Intersight Cisco Intersight is a management platform delivered as a service with embedded analytics for your Cisco and 3rd party IT infrastructure. This platform offers an intelligent level of management that enables IT organizations to analyze, simplify, and automate their environments in more advan...
#!/usr/bin/python # # linearize-hashes.py: List blocks in a linear, no-fork version of the chain. # # Copyright (c) 2013-2014 The Bitcoin developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # from __future__ import pri...
from typing import List def _set_module_names_for_sphinx(modules: List, new_name: str): """ Trick sphinx into displaying the desired module in these objects' documentation. """ for obj in modules: obj.__module__ = new_name
# encoding: utf-8 # MyHand # Este código va destinado al reconocimiento del movimiento # de un brazo robótico mediante la librería open cv en Python... # Programador Sergio Luis Beleño Díaz # Enero.2019 ''' Para empezar se importan las librerías de Open cv para visión Artificial y se utiliza la librería numpy p...
class Solution(object): def findDiagonalOrder(self, matrix): """ :type matrix: List[List[int]] :rtype: List[int] """ n = len(matrix) if n: m = len(matrix[0]) if n == 0 or m == 0: return [] di = [-1, 1] dj = [1, -1] ...
# # author: Jungtaek Kim (jtkim@postech.ac.kr) # last updated: October 8, 2021 # """test_bo_bo_w_tp""" import pytest import numpy as np from bayeso.bo import bo_w_tp as package_target from bayeso import covariance from bayeso.utils import utils_covariance BO = package_target.BOwTP TEST_EPSILON = 1e-5 def test_load...
# Copyright 2020 MONAI Consortium # 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, s...
from flask import Blueprint from flask_restful import Api from app.blueprints.kat.resources.user import UserListResource, UserResource from app.blueprints.kat.resources.guild import GuildListResource, GuildResource from app.blueprints.kat.resources.member import MemberListResource, MemberResource, MemberLeaderboardRes...
from . import response # NOQA from .server import * # NOQA
# --coding=utf-8-- _base_ = '../retinanet/retinanet_r50_fpn_1x_coco.py' model = dict( bbox_head=dict( num_classes=5, anchor_generator=dict(ratios=[0.2, 0.5, 1.0, 2.0, 5.0]) ) ) load_from = 'checkpoints/retinanet_r50_fpn_1x_coco_20200130-c2398f9e.pth' optimizer...
# # MLDB-2025-st_contains.py # Francois Maillet, 2016-10-21 # This file is part of MLDB. Copyright 2016 Datacratic. All rights reserved. # from mldb import mldb, MldbUnitTest, ResponseException class MLDB2025StContains(MldbUnitTest): # noqa @classmethod def setUpClass(cls): mldb.post("/v1/procedures...
from django.apps import AppConfig class BrailleExperienceConfig(AppConfig): name = 'braille_experience'
try: from setuptools import setup, find_packages except ImportError: from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages setup( name='ferrox', version="", #description='', #author='', #author_email='', #url='', install_requires=["...
from copy import deepcopy from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.test import TestCase from cms.api import add_plugin from cms.models.pluginmodel import CMSPlugin from cms.models.placeholdermodel import Placeholder from cms.test_utils.project.pluginapp.plug...
from django.contrib import admin from django.urls import path from .views import UsersView, PingView urlpatterns = [ path('admin/', admin.site.urls), path('ping/', PingView.as_view()), # Endpoints for user URL. path('users/', UsersView.as_view(), name='users'), path('users/<uuid:id>/...
import re import six ACTION_PATTERN = re.compile(r"^[_a-zA-Z0-9-]+$") def is_valid_action(action_str): ''' Check whether an action_str is valid. Valid action examples: "gesafe:storage:*" "tianfu:article:write" ''' segment_list = action_str.strip().split(":") if not segment_lis...
# coding: utf-8 # Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved. # This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c...
from enum import Enum from recognizers_text import RegExpUtility from ...resources.chinese_date_time import ChineseDateTime from ..constants import Constants from .base_date_time_extractor import ChineseBaseDateTimeExtractor class TimePeriodType(Enum): ShortTime = 1 FullTime = 2 class ChineseTimePeriodExtr...
import importlib __all__ = ["registry", "get_filesystem_class", "default"] # mapping protocol: implementation class object _registry = {} # internal, mutable class ReadOnlyError(TypeError): pass class ReadOnlyRegistry(dict): """Dict-like registry, but immutable Maps backend name to implementation cl...
import csv import json df = open("bridgeData3.csv",'r').readlines() fin = open('final.csv','r').readlines() # Skips the header of the csv finCsv = fin[1:] finalCsv = df[1:] obj = {} # loop through the csv with images for i in finalCsv: x = i.split(',') obj[x[1]] = {'bridge_name':x[0],'proj_code':x[1],'before_i...
"""Adds column for conference challenge Revision ID: 5d4dee3e24fc Revises: 8b67c774279d Create Date: 2020-03-27 10:47:57.672426 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = "5d4dee3e24fc" down_revision = "8b67c774279d" branch_labels = None depends_on = None ...
import os import sys sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '../..'))) import apiserver as apiserver import apiserver.storage as storage
import colorama def info(extra): print(f"{colorama.Back.BLUE}{colorama.Fore.GREEN}{colorama.Style.BRIGHT}" f"INFO:{colorama.Style.RESET_ALL} {colorama.Fore.WHITE}{extra}") def error(extra): print(f"{colorama.Back.RED}{colorama.Fore.WHITE}{colorama.Style.BRIGHT}" f"ERROR:{colorama.Style.RES...
#!/usr/bin/env python """ Copyright (c) 2006-2018 sqlmap developers (http://sqlmap.org/) See the file 'LICENSE' for copying permission """ import re from lib.core.enums import HTTP_HEADER from lib.core.settings import WAF_ATTACK_VECTORS __product__ = "FortiWeb Web Application Firewall (Fortinet)" def detect(get_pa...
from .base_model import Model from .base_transformer import Transformer from gensim.models import HdpModel import numpy as np class HDPModel(Model, Transformer): def __init__(self, corpus=None, **kwargs): self._m = HdpModel(corpus, **kwargs) def fit(self, corpus): self._m.update(corpus) ...
nis=get('nis') q="xpto1" + koneksi q=escape_string(q,nis) koneksi = execute(q)
# ch14/example2.py import threading import random import time def update(): global counter with count_lock: current_counter = counter # reading in shared resource time.sleep(random.randint(0, 1)) # simulating heavy calculations counter = current_counter + 1 counter = 0 count_lock = t...
import torch from torch import nn from torch.nn import Parameter import torch.nn.functional as F from torch.autograd.variable import Variable import fast_self_multihead_attn_norm_add class FastSelfAttnNormAddFunc(torch.autograd.Function) : @staticmethod def forward(ctx, use_time_mask, is_training, heads, inp...
""" This is the list of method that will be used by the api """ import logging import os from extensions.api.api import Namespace from flask_restplus_patched import Resource from . import schemas, parameters from ..common import custom_fields from ..common.FEAT.F107_scaling_hdm import F_107 log = logging.getLogge...
#!/usr/bin/env python # -*- coding: utf-8 -*- import __future__ import sys import random number_of_dice = 3 run_cycles = 100000 sides = 6 summary = {} winnings_map = { 0: -1, 1: 1, 2: 2, 3: 3, } def getrun(): retval = [] for val in range(0,number_of_dice): retval.append(random.randint...
# -*- coding: utf-8 -*- import sys import os import random from random import randint import re import unicodedata class AgentConversationnel(object): def __init__(self, chemin_donnees=None, nom_agent=None ): """ :param chemin_donnees: le chemin vers le fichier de données donnees.txt ...
# -*- coding: utf-8 -*- ''' fastmat/inspect/__init__.py -------------------------------------------------- part of the fastmat demos Author : wcw Introduced : 2017-07-19 ------------------------------------------------------------------------------ Copyright 2016 Sebastian Semper, Christoph Wagner ...
# (C) British Crown Copyright 2011 - 2019, Met Office # # This file is part of cartopy. # # cartopy is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the # Free Software Foundation, either version 3 of the License, or # (at your option)...
import pandas as pd import os import sys sys.path.append('../../') from models.indirect.policy_learning_thresholding import get_iat_broad from utils.evaluation_utils import calculate_ci def get_best_case_idsa_baseline(resist_df, switch_props, option='doc',...
from fastapi import APIRouter from app_folder.controllers import api, auth, user, task router_ready = APIRouter(prefix='/api') router_ready.include_router(api.ready_route, tags=['ready']) router_auth = APIRouter(prefix='/auth') router_auth.include_router(auth.auth_route, tags=['auth']) router_user = APIRouter(prefix...
#!/usr/bin/env python # Copyright 2017 Calico 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
from .client import Client import argparse import arrow import sys def date(value): return arrow.get(value) def run(argv=None): client = Client() parser = argparse.ArgumentParser(description="Snoo CLI") parser.add_argument( "command", default="status", choices=["status", "sessions", "days"] ...