content
stringlengths
5
1.05M
#!/usr/bin/python from gearman.client import GearmanClient client = GearmanClient(['localhost']) URL = 'http://ifcb-data.whoi.edu/feed.json' client.submit_job('spider', URL)
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. from evaluator.CodeBLEU.parser import DFG_python, DFG_java, DFG_ruby, DFG_go, DFG_php, DFG_javascript, DFG_csharp from evaluator.CodeBLEU.parser import (remove_comments_and_docstrings, tree_to_token_index, ...
# import pandas as p # file = "weather_data.csv" # df = p.read_csv(file) # monday = df[df.day == "Wednesday"] # print(int(monday.temp) * 9/5 + 32) # x = (59 - 32) * 5/9 # print(x)
import re from metaflow.plugins.aws.eks.kubernetes import generate_rfc1123_name rfc1123 = re.compile(r'^[a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?$') def test_job_name_santitizer(): # Basic name assert rfc1123.match(generate_rfc1123_name('HelloFlow', '1', 'end', '321', '1')) # Step name ends with _ ...
import os import argparse import time from tqdm import tqdm import numpy as np np.random.seed(0) import torch import torch.nn as nn torch.manual_seed(0) import torchvision import torchvision.transforms as transforms from torchvision.utils import save_image, make_grid from model import Model from config import diffu...
#!/usr/bin/env python from distutils.core import setup #### Descriptions setup(name= "PHOSforUS", version = '1.0.3', description = "PHOSforUS horizontal information-based phosphorylation site predictor", url = "https://github.com/bxlab/PHOSforUS", author = "Min Hyung Cho", author_email = "mcho22@jhu.edu", license...
"""TcEx JSON Update""" # standard library import os from typing import TYPE_CHECKING, Optional if TYPE_CHECKING: # pragma: no cover from .tcex_json import TcexJson class TcexJsonUpdate: """Update install.json file with current standards and schema.""" def __init__(self, tj: 'TcexJson') -> None: # pyli...
""" IPython demo to illustrate the use of numpy matrices. To run, if you have ipydemo.py, do import ipydemo; ipydemo.rundemo('matrices_ipydemo.py') """ import math import numpy as np import numpy.fft as fft import matplotlib.pyplot as plt def printTypeAndValue(x): print type(x), "\n", x N = 8 I ...
""" This script obtains records from Kinesis and writes them to a local file as as defined by OUT_FILE. It will exit when no additional files have been read for WAIT_TIME. """ import os import sys import time import boto3 from botocore import exceptions from gzip import GzipFile from io import BytesIO from retry impo...
#!/usr/bin/python3 import requests import argparse import sys import time parser = argparse.ArgumentParser( sys.argv[0], description="Port scan a host for the top 1000 ports ", ) parser.add_argument("--target", help="The SSRF target to be port scanned", default="127.0.0.1") parser.add_argument("--cookie", help...
from django import template from badge.models import BadgeAward register = template.Library() @register.simple_tag def badge_count(user): """ Returns badge count for a user, valid usage is:: {% badge_count user %} or {% badge_count user as badges %} """ return BadgeAward.objec...
# This problem was recently asked by Microsoft: # A unival tree is a tree where all the nodes have the same value. # Given a binary tree, return the number of unival subtrees in the tree. class Node(object): def __init__(self, val): self.val = val self.left = None self.right = None def co...
from PyQuantum.Tools.PlotBuilder2D import * from PyQuantum.Tools.CSV import * import numpy as np x = [] y = [] path = 'oout' # path = 'out_2' count = 99 for i in range(count+1): Fidelity_s2_list = list_from_csv(path+'/fidelity_s2' + str(i) + '.csv') T_list = list_from_csv(path+'/T_list' + str(i) + '.csv') ...
import torch from torch.nn import functional as F class PGD: """ """ @staticmethod def attack(image, label, device, model, epsilon=0.3, steps=50, step_size = 2/255, no_kl=True): model.zero_grad() # random start perturbation = torch.zeros_like(image).uniform_(-epsilon, epsilon)...
#Soma tabb = [1+1] tab = [2+1] tab_2 = [3+1] tab_3 = [4+1] tab_4 = [5+1] tab_5 = [6+1] tab_6 = [7+1] tab_7 = [8+1] tab_8 = [9+1] tab_9 = [10+1] for y in tabb: print("1+1 = {}".format(y)) for i in tab: print("2+1 = {}".format(i)) for a in tab_2: print("3+1 = {}".format(a)) for b in tab_3: print("4+1 = {...
import asyncio import discord import random import json import os import io import safygiphy import requests from discord.ext import commands g = safygiphy.Giphy() voz = True if not discord.opus.is_loaded(): discord.opus.load_opus('libopus.so') class VoiceEntry: def __init__(self, message, player): s...
from . import __version__ as app_version app_name = "gwt" app_title = "GWT" app_publisher = "ERP Cloud Systems" app_description = "Custom App" app_icon = "octicon octicon-file-directory" app_color = "grey" app_email = "info@erpcloud.systems" app_license = "MIT" doc_events = { "Quotation": { "onload": "gwt.event_trig...
from numpy import * import statsmodels.api as sm import os import sys import re class Regression(): def __init__(self): self.statData = {} self.totalPrice = {} self.parameters = {} self.resultSummary = {} self.houseIndices = {} self.getHouseIndex() def getHouseI...
""" Publishes figure of merit data """ from decisionengine.framework.modules import Publisher from decisionengine_modules.AWS.publishers.AWS_generic_publisher import AWSGenericPublisher as publisher @publisher.consumes_dataframe("AWS_Figure_Of_Merit") class AWSFOMPublisher(publisher): def __init__(self, *args, *...
# uncompyle6 version 3.2.4 # Python bytecode 2.7 (62211) # Decompiled from: Python 2.7.15 (v2.7.15:ca079a3ea3, Apr 30 2018, 16:30:26) [MSC v.1500 64 bit (AMD64)] # Embedded file name: lib.coginvasion.hood.Walk from direct.fsm.ClassicFSM import ClassicFSM from direct.fsm.StateData import StateData from direct.fsm.State ...
# Copyright 2016 Google 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 applicable law or ag...
import glob import os import fire import numpy as np import pandas as pd class Split: def __init__(self): print("start preprocessing") def get_csv_dataframe(self): self.csv_df = pd.read_csv( os.path.join(self.data_path, "mtat", "annotations_final.csv"), header=None, ...
import logging from typing import Optional, Callable, Any from google.cloud import pubsub_v1 from gcp_mysql_backup_service.env import EnvironmentManager class SubscriptionEnvironmentManager(EnvironmentManager): @property def subscription_name(self) -> str: return self._get('SUBSCRIPTION_NAME') ...
# Copyright 2020 Xanadu Quantum Technologies 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 agre...
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Author : qichun tang # @Contact : qichun.tang@bupt.edu.cn import math def float_gcd(a, b): def is_int(x): return not bool(int(x) - x) base = 1 while not (is_int(a) and is_int(b)): a *= 10 b *= 10 base *= 10 return ma...
from typing import Any, Callable, Optional import numpy as np import torch class EarlyStopping: patience: int verbose: bool counter: int best_score: Optional[float] early_stop: bool val_loss_min: float delta: float path: str """Early stops the training if validation loss doesn't ...
l,r,n=map(int,input().split()) l2=[] for i in range(l+1,r,n): l2.append(i) print(len(l2))
import sortedcontainers import packet_common import route import table class RouteTable: def __init__(self, address_family, fib, log, log_id): assert fib.address_family == address_family self.address_family = address_family # Sorted dict of _Destination objects indexed by prefix s...
import time import board import displayio import terminalio from digitalio import DigitalInOut, Direction from adafruit_display_text import label import adafruit_displayio_ssd1306 import adafruit_ina260 first_line_y = 3 line_height = 11 line_glyphs = 63 # These voltage ranges assume that we have minimal voltage # dro...
from django.contrib import admin from .models import Products admin.site.register(Products)
import json import os from contextlib import contextmanager from typing import Iterator from unittest import mock import airflow.configuration import airflow.version import pytest from airflow.lineage import apply_lineage, prepare_lineage from airflow.models import DAG, Connection, DagBag from airflow.models import Ta...
from ..compat import unwrap, wraps from ..functional import merge from ..utils import is_a, unique def test_unique(): assert list(unique(iter([1, 3, 1, 2, 3]))) == [1, 3, 2] def test_is_a(): assert is_a(int)(5) assert not is_a(str)(5) def test_wrap_and_unwrap(): def f(a, b, c): # pragma: nocover ...
#encoding: utf-8 categories = [ f'Category:{s}' for s in ( 'Acrochordidae', 'Alethinophidia', 'Aniliidae', 'Anomalepidae', 'Anomochilidae', 'Boidae', 'Bolyeriidae', 'Colubrids', 'Colubrid_stubs', 'Crotalinae', 'Crotalis', 'Cylindrophiidae', 'Elapidae', 'Gerrhop...
# Copyright lowRISC contributors. # Licensed under the Apache License, Version 2.0, see LICENSE for details. # SPDX-License-Identifier: Apache-2.0 load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") def riscv_compliance_repos(): http_archive( name = "riscv-compliance", build_file ...
#!/usr/bin/env python import roslib; roslib.load_manifest('navigation') import rospy import tf.transformations from geometry_msgs.msg import Twist import math def callback(msg): #rospy.loginfo("Received a /cmd_vel message!") #rospy.loginfo("Linear Components: [%f, %f, %f]"%(msg.linear.x, msg.linear.y, msg.line...
from setuptools import setup setup( name='temboard-agent-sample-plugins', version='1.0', author='Dalibo', author_email='contact@dalibo.com', license='PostgreSQL', install_requires=['temboard-agent'], py_modules=['temboard_agent_sample_plugins'], entry_points={ 'temboardagent.plu...
"""Starlette middleware for Prerender.""" __version__ = "1.0.1" from prerender_python_starlette.middleware import ( # noqa: F401 DEFAULT_CRAWLER_USER_AGENTS, DEFAULT_EXTENSIONS_TO_IGNORE, PrerenderMiddleware, )
from __future__ import division from __future__ import print_function import numpy as np import PIL import matplotlib.pyplot as plt import SimpleITK as sitk import os import pandas as pd Dir = "/home/jana/Documents/PhD/ZajemInAnalizaSlike/Vaja1/" zob = PIL.Image.open(Dir + "zob-microct.png") zob.show() print(zob.si...
phone = "+123456789" mongo_uri = "mongodb://localhost:27017" device_uuid = None # str(uuid.uuid1()) api_uri = "./api.yaml" # from https://github.com/zhuowei/ClubhouseAPI max_retries = 5 token_file = None fresh_interval = 3600 user_limit = 500 first_run = False # not used
def RadiometricRecordType(): ''' Radiometric Record. https://www.eorc.jaxa.jp/ALOS-2/en/doc/fdata/PALSAR-2_xx_Format_CEOS_E_f.pdf ''' from isce3.parsers.CEOS.BasicTypes import ( BlankType, BinaryType, StringType, IntegerType, FloatType, MultiType) from isce3.parsers.CEOS.CEOSHeaderType i...
import csv import numpy as np import matplotlib.pyplot as plt from prettytable import PrettyTable from datetime import datetime as date # load data from csv files def load(): slot_no = 300 supervisor_no = 47 presentation_no = 118 preference_no = 3 presentation_supervisor = np.zeros([presentation_...
import logging import paho.mqtt.client as mqtt _LOGGER = logging.getLogger(__name__) class MQTTClient: def __init__(self, host, user, pwd): self.mqttc = mqtt.Client() self.mqttc.enable_logger() self.host = host self.user = user self.pwd = pwd def on_disconnect(c...
import setuptools __version__="0.0.1" with open("README.md", 'r') as fh: long_description = fh.read() setuptools.setup( name="pis_client", author="Gishobert Gwenzi", author_email="ilovebugsincode@gmail.com", version="0.0.1", description="Python PIS client", licence="MIT", long_descripti...
import unittest import pygame import os import Tests.tests_env as T from utils.bird import Bird path = os.getcwd() os.chdir(path + '/..') T.init() class Test_bird(unittest.TestCase): def test_create_bird(self): surf = T.create_surface() bird = Bird() bird.falling = True self.asse...
# Copyright (c) 2018 Fujitsu Limited. # 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 requ...
import functools import os import re import ipywidgets as widgets import numpy as np import pandas as pd import qgrid from IPython.display import display from IPython.display import Javascript from IPython.display import Markdown from ipywidgets import fixed from ipywidgets import interact from ipywidgets import inter...
# Copyright 2016, 2017 IBM 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 writin...
from os import environ from mongoengine import connect from hashlib import sha256 from Regions.region import Region if __name__ == '__main__': regions = ['BOGOTA', 'VALLE', 'ANTIOQUIA', 'CARTAGENA', 'HUILA', 'META', 'RISARALDA', 'NORTE SANTANDER', 'CALDAS', 'CUNDINAMARCA', 'BARRANQUILLA', 'SANTAN...
# -*- coding: utf-8 -*- from cefpython3 import cefpython as cef from importlib import reload import numpy as np import os import tempfile import unittest from unittest.mock import Mock, patch, mock_open import endless_bot.emitters.webbrowser from endless_bot.emitters.webbrowser import BrowserHandler from endless_bot....
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Jun 14 13:17:49 2021 @author: surajitrana """ import matplotlib.pyplot as plt import numpy as np def plot_piechart(): dataset = np.array([20, 25, 10, 15, 30]) chart_lables = np.array(["Audi", "Mercedez", "BMW", "Tesla", "Volvo"]) plt.pie(...
# core/operators/test_nonparametric.py """Tests for rom_operator_inference.core.operators._nonparametric.""" import pytest import numpy as np import rom_operator_inference as opinf _module = opinf.core.operators._nonparametric class TestConstantOperator: """Test core.operators._nonparametric.ConstantOperator....
import pytest import subprocess import requests import time import configparser from gameengine import GameEngine import socket def wait_until_up(watchdog): while True: try: s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect(('127.0.0.1', 5000)) s.close() ...
"""Defines a background widget to create a single-color background.""" from os.path import dirname as _dirname from typing import Optional as _Optional from kivy.lang.builder import Builder as _Builder from kivy.properties import ListProperty as _ListProperty from kivy.uix.widget import Widget as _Widget _Builder.lo...
from tkinter import * root = Tk() root.geometry('500x300') root.resizable(0,0) root.title("Website Blocker !") Label(root, text ='WEBSITE BLOCKER' , font ='arial 20 bold').pack() Label(root, text ='Website Blocker' , font ='arial 20 bold').pack(side=BOTTOM) host_path ='C:\Windows\System32\drivers\etc\h...
from .cli import cli_main cli_main()
count = 1 print(count) while (count <= 150): fizz = count / 3 buzz = count / 5 if (float(fizz).is_integer() and not float(buzz).is_integer()): print("fizz") elif (float(buzz).is_integer() and not float(fizz).is_integer()): print("buzz") elif (float(buzz).is_integer() and float(fizz...
# Copyright 2020 Alexis Lopez Zubieta # # 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 restriction, including without limitation the # rights to use, copy, modify, merge, publi...
# Copyright 2020 Google 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, soft...
# Copyright 2013 Red Hat, 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 agre...
from .smoothing import smooth_image from .utils import save_imgs from .data_loader import load_patches, ImageFolder720p
import basic import os import subprocess while True: text = input('Doge shell 0.1 (Beta) > ') if "import" in text: importing = text.split(" ") if importing[0] == "import": f = open(importing[1], 'r') imports = f.read() f2 = open(importing[2], 'r') ...
from .json_resource import json_tool from tkinter import * from tkinter import ttk import os class gui: def __init__(self, file_path, json_path): self.file_path = file_path self.json_path = json_path def main_frame(): """ MAINFRAME para configurar e iniciar o Robô de ...
from __future__ import absolute_import,print_function, division import numpy as np def correct_panel(img, copy=True, divide=True): """ Distributes the intensity in the larger Jungfrau pixels into smaller inserted pixels See: https://doi.org/10.1088/1748-0221/13/11/C11006 Parameters ========== img: a 2...
''' ML pipeline: run an experiment end-to-end. Input: Experiment Output: - Predictions - Evaluation metrics ''' from pathlib import Path import os import sys source_path = str(Path(os.path.abspath(__file__)).parent.parent) pipeline_path = str(Path(os.path.abspath(__file__)).parent) sys....
import pika from hipotap_common.proto_messages.auth_pb2 import AuthResponsePB, AuthStatus from hipotap_common.proto_messages.customer_pb2 import CustomerCredentialsPB, CustomerPB from hipotap_common.proto_messages.hipotap_pb2 import BaseResponsePB, BaseStatus from hipotap_common.queues.customer_queues import ( CUST...
expected_output = { "interfaces": { "Port-channel1": { "name": "Port-channel1", "protocol": "lacp", "members": { "GigabitEthernet2": { "interface": "GigabitEthernet2", "oper_key": 1, "admin_key": ...
def select_other_samples (project, list_samples, samples_prefix, mode, extensions, exclude=False, Debug=False): ## init dataframe name_columns = ("sample", "dirname", "name", "ext", "tag") ## initiate dataframe df_samples = pd.DataFrame(columns=name_columns) #Get all files in the folder "path_to_...
#!/usr/bin/env python from distutils.core import setup setup(name='gautocorr', version='1.0', author='Julius Bier Kirkegaard', py_modules=['gautocorr'], )
# SPDX-License-Identifier: BSD-3-Clause from argparse import ArgumentError import typing as t from urllib.parse import urlencode, quote_plus from . import exceptions as e from . import urls from . import http from . import utils _fields = set( """abs abstract ack aff aff_id alternate_bibcode alter...
from alertmanager import AlertManager, Alert from copy import copy from time import sleep # https://github.com/KennethWilke/qlight_userspace QLIGHT_PATH = "/opt/personal/qlight/qlight" LIGHT_STATUS = {'red': 'off', 'yellow': 'off', 'blue': 'off', 'green': 'on', ...
import torch import torch.nn as nn import common from itertools import izip def make_model(args, parent=False): return RDN(args) class RDN(nn.Module): def __init__(self, args, conv=common.default_conv): super(RDN, self).__init__() rgb_mean = (0.4488, 0.4371, 0.4040) rgb_std = (1....
# closed over variable 2 deep def f(): x = 1 def g(): def h(): return 1 + x
import textwrap import topside as top from ..procedures_bridge import ProceduresBridge from ..plumbing_bridge import PlumbingBridge from ..controls_bridge import ControlsBridge def make_plumbing_engine(): pdl = textwrap.dedent("""\ name: example body: - component: name: injector_valve ...
import os from subprocess import Popen import pipes from gi.repository import Gio class Applications(): def __init__(self): self.applications = {} self.APP_FOLDER = '/usr/share/applications/' def getProperties(self, app, file_path): name = app.get_name() exec = app.get_string(...
class ScrapperConfig: def __init__(self, file_with_classes=None, target_path='data/', path_to_driver=None, download_data=False, path_to_data=None): self.file_with_classes = file_with_classes self.path_to_driver = path_to_driver self.target_path = target_path self.dow...
from .signals import * from plogical.pluginManagerGlobal import pluginManagerGlobal class pluginManager: @staticmethod def preCreateFTPAccount(request): return pluginManagerGlobal.globalPlug(request, preCreateFTPAccount) @staticmethod def postCreateFTPAccount(request, response): retur...
# -*- coding: utf-8 -*- from django.db import models from django.db.models import Count, Case, When, Value class ModelAManager(models.Manager): def get_queryset(self): qs = super().get_queryset() qs = qs.annotate(annotation=Count('c_models')) qs = qs.annotate(boolean_annotation=Case( ...
# pattsquash.py # # Attempt to find duplicate patterns and produce a new pattern and index file # # Copyright (c) 2021 Troy Schrapel # # This code is licensed under the MIT license # # https://github.com/visrealm/hbc-56 # # import os, sys, csv, struct valDict = {} IND_OFFSET = 200 for infile in sys.argv[1:]: f,...
# coding: utf-8 import pytest from thermalprinter.exceptions import ThermalPrinterValueError def test_default_value(printer): assert printer._char_spacing == 0 def test_changing_no_value(printer): printer.char_spacing() assert printer._char_spacing == 0 def test_changing_good_value(printer): pri...
""" Help window of GUI interface to the Pip simulator Andy Harrington """ from graphics import * HELP_WIDTH = 680 HELP_HEIGHT = 550 helpWin = None helpMap = {} helpMap["Nowhere"] = """Pip Assember Summary | Symbols Used | | X for a symbolic or numeric data...
#!/usr/bin/env python import os, sys, logging, optparse import importlib bpy_in='bpy' in locals() if not bpy_in: try: importlib.import_module('bpy') bpy_in = True except: bpy_in = False if bpy_in: import bpy import bpy_extras import mathutils try: curdir = os.path.ab...
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2016-2018 CERN. # # Invenio is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. """Celery tasks to index records.""" from __future__ import absolute_import, print_f...
import functools from pathlib import Path from sources.simulators.serial_execution_simulator import \ SerialExecutionSimulator from experiments.celeba_experiments.celeba_metadata_providers import \ CELEBA_BASE_METADATA_SYS_EXP_PROVIDER, VARYING_LOCAL_EPOCHS_EXP_PARAMETER_MAP from sources.datasets.celeba.cele...
import os import glob import pathlib import json import inspect import numpy as np from datetime import datetime def simulation(): # Simulation id SIM_ID = datetime.now().strftime("%Y%m%d%H%M%S") DIR_BASE = "./experiments/JCC2019/data/" + SIM_ID + "/" pathlib.Path(DIR_BASE).mkdir(parents=True, exist_ok...
# -*- coding: utf-8 -*- """ Surrogate Analysis """ # Author: Avraam Marimpis <avraam.marimpis@gmail.com> from typing import Optional, Tuple, Callable import numpy as np import numbers def surrogate_analysis( ts1: "np.ndarray[np.float32]", ts2: "np.ndarray[np.float32]", num_surr: Optional[int] = 1000, ...
from six.moves.urllib.parse import parse_qs import six from oic.utils.authn.user import logger, UsernamePasswordMako from oic.utils.http_util import Unauthorized, Redirect __author__ = 'danielevertsson' class JavascriptFormMako(UsernamePasswordMako): """Do user authentication using the normal username password ...
# -*- coding: utf-8 -*- import asyncio from .decorator import decorate from .assertions import assert_corofunction ExceptionMessage = 'paco: coroutine cannot be executed more than {} times' @decorate def times(coro, limit=1, raise_exception=False, return_value=None): """ Wraps a given coroutine function to b...
# Generated by Django 3.0.6 on 2020-05-07 10:03 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('products', '0001_initial'), ] operations = [ migrations.AlterField( model_name='product', name='updated', ...
#! /usr/bin/env python3 from collections import defaultdict import crypt from manage_users.exceptions import (DuplicateUserError, NoSuchUserError, SSHKeyNotFoundError) import yaml class AnsibleUsers(object): """ Manage users in an ansible playbook. This playbo...
import shutil import tempfile import unittest from pandas.util.testing import assert_frame_equal from sqlalchemy import create_engine import atpy.data.cache.lmdb_cache as lmdb_cache import atpy.data.iqfeed.iqfeed_history_provider as iq_history from atpy.data.cache.postgres_cache import * from atpy.data.iqfeed.iqfeed_...
# send object to the back of the objects list import variables as var def send_to_back(entity): var.entities.remove(entity) var.entities.insert(0, entity)
#!/usr/bin/env python # encoding: utf-8 import os import sys from relo.core.config import * from relo.core.exceptions import ShellException from relo.core.log import logger def mkdirs(path): if not os.path.exists(path): os.makedirs(path) return True return False
"""Spread schedules accross servers.""" import datetime import sys from cicada.lib import postgres from cicada.lib import scheduler from cicada.lib import utils def csv_to_list(comma_separated_string: str) -> [int]: """Convert list of string to a list of integers""" try: return list(map(int, comma_s...
#!/usr/bin/env python3 import torch if torch.cuda.is_available(): DEVICE = torch.device('cuda') IS_CUDA = True else: DEVICE = torch.device('cpu') IS_CUDA = False VISUAL_FEATURES = 512 STATE_DIMS = 3 ACTION_DIMS = 2 NUM_PARTICLES = 500 RANDOM_SEED = 42 WIDTH, HEIGHT = 256, 256 BATCH_SIZE = 8 is_acts_di...
import torch from pathlib import Path class Walker_AI(torch.nn.Module): def __init__(self): super(Walker_AI, self).__init__() self.net = torch.nn.Sequential( torch.nn.Linear(14, 25), torch.nn.LeakyReLU(), torch.nn.Linear(25, 10), torch.nn.LeakyReLU()...
# Copyright 2019 Huawei Technologies Co., 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 agreed to...
from django import forms from allauth.account.forms import SignupForm from django.contrib.auth.forms import UserCreationForm, UserChangeForm from django.core.validators import MaxValueValidator, MinValueValidator from .models import CustomUser from .models import Booking from .models import Contact from .models import ...
class Config: """MTProto Proxy Config. """ users = [] n = 0 def __init__(self, port=None, fast_mode=None, prefer_ipv6=None, secure_only=None, listen_addr_ipv4=None, listen_addr_ipv6=None, ...
from django.db import models #Modelo usuario de Django from django.contrib.auth.models import User #Modelo de Usuarios class Usuarios(models.Model): nombre = models.CharField(max_length= 50) apellido = models.CharField(max_length = 50) email = models.CharField(max_length = 30, null = True, blank = True) ...
import copy import numpy as np import progressbar as pb def value_iteration(number_actions, number_states, transitions, rewards, theta=0.0001, discount_factor=1.0): def one_step_lookahead(state, V): A = np.zeros(number_actions) for a in range(number_actions): for next_state in range(num...