content
stringlengths
5
1.05M
#!/usr/bin/env python from __future__ import print_function import cProfile import pstats import argparse from examples.pybullet.utils.pybullet_tools.kuka_primitives import BodyPose, BodyConf, Command, get_grasp_gen, \ get_stable_gen, get_ik_fn, get_free_motion_gen, \ get_holding_motion_gen, get_movable_coll...
"""Calculate collision matrix of direct solution of LBTE.""" # Copyright (C) 2020 Atsushi Togo # All rights reserved. # # This file is part of phono3py. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistribu...
import argparse import dataclasses from pathlib import Path from typing import Dict, List, Optional from omegaconf import DictConfig, OmegaConf as oc from .. import settings, logger @dataclasses.dataclass class Paths: query_images: Path reference_images: Path reference_sfm: Path query_list: Path ...
from urllib.request import urlopen as ureq from bs4 import BeautifulSoup import requests import os, os.path, csv my_url = 'https://www.newegg.com/Laptops-Notebooks/Category/ID-223?Tid=17489' # loading connection/grabbing page xClient = ureq(my_url) p_html = xClient.read() # html parsing page_soup = BeautifulSoup(p_h...
# by amounra : http://www.aumhaa.com from __future__ import with_statement import contextlib from _Framework.SubjectSlot import SubjectEvent from _Framework.Signal import Signal from _Framework.NotifyingControlElement import NotifyingControlElement from _Framework.Util import in_range from _Framework.Debug import debu...
# -*- encoding: utf-8 import sys import pytest import lswifi # WirelessNetworkBss class TestElements: def test_parse_rates(self): test1 = lswifi.elements.OutObject( value="1(b) 2(b) 5.5(b) 11(b) 6(b) 9 12(b) 18 24(b) 36 48 54" ) test2 = lswifi.elements.OutObject( ...
import kaggle import pathlib import shutil # You need to have ~/.kaggle/kaggle.json in your device. competition_name = 'tgs-salt-identification-challenge' out_path = pathlib.Path('Dataset') def download(train: bool = True) -> None: fn = 'train' if train else 'test' print(f'[INFO] Downloading {fn} data.') ...
#!/usr/bin/env python # Copyright 2015-2016 Yelp 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 ...
from discord.ext import commands from ytdl.source import YTDLSource from asyncio import sleep class Kakatua(commands.Cog): def __init__(self, bot: commands.Bot): self.bot = bot self.playlist = [] self.player = None @commands.command() async def check(self, ctx: commands.Context, ...
from __future__ import division from mmcv import Config from mmcv.runner import obj_from_dict from mmdet import datasets, __version__ from mmdet.apis import (train_detector, get_root_logger) from mmdet.models import build_detector import os import os.path as osp import getpass import torch """ Author:Yuan Yuan Date:2...
import csv import time from gensim.models.doc2vec import Doc2Vec from chatterbot import ChatBot data_input_filename = 'training_data.csv' doc2vec_filename = 'doc2vecmodel' punctuation = ['.',',',';','!','?','(',')'] data_input_file = open(data_input_filename, 'r', encoding='UTF-8', newline='') csv_reader = csv.reader...
from setuptools import setup, find_packages install_requires = [ "setuptools>=41.0.0", "numpy>=1.16.0", "joblib", "scipy" ] extras_require = { "tf": ["tensorflow==2.0.0"], "tf_gpu": ["tensorflow-gpu==2.0.0"] } setup( name="tf2gan", version="0.0.0", description="Generative Adversar...
from images import api urlpatterns = api.urlpatterns
# coding=utf8 # Author: TomHeaven, hanlin_tan@nudt.edu.cn, 2017.08.19 from __future__ import print_function from tensorflow.contrib.layers import conv2d, avg_pool2d import tensorflow as tf import numpy as np from data_v3 import DatabaseCreator import time import tqdm import cv2 import re import os import argparse impo...
# ------------------------------------------------------------------------------ # Program: The LDAR Simulator (LDAR-Sim) # File: Operator # Purpose: Initialize and manage operator detection module # # Copyright (C) 2018-2020 Thomas Fox, Mozhou Gao, Thomas Barchyn, Chris Hugenholtz # # This program is f...
# Generated from parser/TinyPy.g4 by ANTLR 4.5.1 from antlr4 import * if __name__ is not None and "." in __name__: from .TinyPyParser import TinyPyParser else: from TinyPyParser import TinyPyParser # This class defines a complete listener for a parse tree produced by TinyPyParser. class TinyPyListener(ParseTre...
import os import sys import argparse import pathlib import fpipelite.data.project import fpipelite.data.data import json def print_parser(parser:argparse.ArgumentParser): parser.add_argument("path", type=pathlib.Path,nargs="?", default=".") parser.description = "Prints the data for a found project via {path}."...
class SesDevException(Exception): pass class AddRepoNoUpdateWithExplicitRepo(SesDevException): def __init__(self): super().__init__( "The --update option does not work with an explicit custom repo." ) class BadMakeCheckRolesNodes(SesDevException): def __init__(self): ...
#!/usr/bin/python # main.py """ @author: Maxime Dréan. Github: https://github.com/maximedrn Telegram: https://t.me/maximedrn Copyright © 2022 Maxime Dréan. All rights reserved. Any distribution, modification or commercial use is strictly prohibited. """ # Selenium module imports: pip install seleni...
#!/usr/bin/env python3 """Driver for controlling leg position""" from inpromptu import Inpromptu, cli_method from .five_bar_kins import FiveBarKinematics2D from .odrive_driver import OdriveDriver import odrive class ParetoLeg(Inpromptu): #class ParetoLeg(object): # constants CALIB_ANGLE_DEGS = [90, 90] ...
import _km_omp as _cp import networkx as nx from itertools import compress import numpy as np import scipy from scipy.sparse import triu def detect(G, nodes_in_part1, nodes_in_part2, part_to_project, resol = 1, node_capacity = {}, num_samples = 100, consensus_threshold=0.9, significance_level = 0.05, num_rand_nets = ...
# Webhooks for external integrations. from __future__ import absolute_import from typing import Text from django.http import HttpRequest, HttpResponse from zerver.lib.actions import check_send_message from zerver.lib.response import json_success from zerver.decorator import REQ, has_request_variables, api_key_only_we...
# -*- coding: utf-8 -*- """The interface for Windows Registry objects.""" import abc from plaso.dfwinreg import definitions class WinRegistryFile(object): """Class that defines a Windows Registry file.""" _KEY_PATH_SEPARATOR = u'\\' def __init__(self, ascii_codepage=u'cp1252', key_path_prefix=u''): """I...
#!/usr/bin/env python import sys sys.path.append('../') from logparser import SLCT input_dir = '../logs/HDFS/' # The input directory of log file output_dir = 'SLCT_result/' # The output directory of parsing results log_file = 'HDFS_2k.log' # The input log file name log_format = '<Date> <Time> <Pid> <Level> <Com...
import logging import os import queue import threading import time import traceback import uuid from signal import SIGINT, SIGTERM, signal import zmq from pyrsistent import pmap from rx.subject import Subject from .mixins import ( AuthenticationMixin, NotificationsMixin, RouterClientMixin, WebserverMi...
str1 = “Hello” str2 = “World” str1 + str2
#!/usr/bin/env python # Copyright (c) 2009 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ appid.py -- Chromium appid header file generation utility. """ import optparse import sys GENERATED_APPID_INCLUDE_FILE_CONTEN...
""" Torrent Search Plugin for Userbot. CMD: `.tsearch` <query>\n `.ts` <query or reply>\n `.movie torrentz2.eu|idop.se` <query> """ import cfscrape # https://github.com/Anorov/cloudflare-scrape from bs4 import BeautifulSoup as bs import requests import asyncio from uniborg.util import admin_cmd, humanbytes from datet...
# Generated by Django 3.2.4 on 2021-06-16 10:40 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('accounts', '0002_auto_20210616_1024'), ] operations = [ migrations.AddField( model_name='address', name='created_at'...
"""Test ComprehensionChecker""" def should_be_a_list_copy(): """Using the copy() method would be more efficient.""" original = range(10_000) filtered = [] for i in original: filtered.append(i) def should_be_a_list_comprehension_filtered(): """A List comprehension would be mor...
start = [90.0, 30.0, 30.0, 0.0, 0.0, 0.0] scan = [90.0, 90.0, 0.0, 0.0, 0.0, 0.0] grip = [90.0, 120.0, 30.0, 0.0, 0.0, 0.0] evaluate = [90.0, 120.0, -30.0, 0.0, 0.0, 0.0] trash = [-90.0, 120.0, 30.0, 0.0, 0.0, 0.0] transport_a = [180.0, 120.0, 30.0, 0.0, 0.0, 0.0] transport_b = [0.0, 120.0, 30.0, 0.0, 0.0, 0.0] detach ...
#!/usr/bin/env python import numpy as np; import sys; import string; import numpy.linalg as lg import argparse as ap atb=1.88971616463 parser=ap.ArgumentParser(description="Parse polarisation from Gaussian logfile") parser.add_argument("-f","--logfile", help="Gaussian logfile") args=parser.parse_args() inputfile=args...
"""Import all the LINQ observable extension methods.""" # flake8: noqa from . import all from . import amb from . import and_ from . import some from . import asobservable from . import average from . import buffer from . import bufferwithtime from . import bufferwithtimeorcount from . import case from . import catch ...
from django.shortcuts import render, redirect from django.core.files.storage import FileSystemStorage from .models import Document from .forms import DocumentForm import logging from cid.locals import get_cid from collections import OrderedDict from common.mq.kafka import producer import os KAFKA_BROKER_URL = os.e...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** 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 _utilities fro...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # BioSTEAM: The Biorefinery Simulation and Techno-Economic Analysis Modules # Copyright (C) 2020, Yoel Cortes-Pena <yoelcortes@gmail.com> # Bioindustrial-Park: BioSTEAM's Premier Biorefinery Models and Results # Copyright (C) 2020, Yalin Li <yalinli2@illinois.edu>, # Saran...
# Taken from https://ubuntuforums.org/showthread.php?t=2117981 import os import re import subprocess import time if __name__ == '__main__': cmd = 'synclient -m 100' p = subprocess.Popen(cmd, stdout = subprocess.PIPE, stderr = subprocess.STDOUT, shell = True) skip = False first = True ...
import pyxel,math from pyxel import init,image,tilemap,mouse,run,btn,cls,KEY_SPACE,btnp,KEY_Q,quit,text,clip,pix,line,rect,rectb,circ,circb,blt,bltm,pal class App: def __init__(self): init(256, 256, caption="Pyxel Draw API",scale=1) image(0).load(0, 0, "assets/cat_16x16.png") image(1).load(0...
import os import shutil from django.conf import settings from django.core.management import BaseCommand import django class Command(BaseCommand): help = "Update django locales for three-digit codes" args = "" def handle(self, *args, **options): # if we were feeling ambitious we could get this from...
import pytest pytestmark = [pytest.mark.django_db] def test_single_member(mailchimp, post, mailchimp_member): mailchimp.mass_subscribe( list_id='test1-list-id', members=[mailchimp_member], ) post.assert_called_once_with( url='lists/test1-list-id', payload={ ...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from decimal import Decimal from django.conf import settings from django.contrib.auth.models import User from django.core.exceptions import ValidationError from django.core.validators import MinValueValidator from django.db import models from django.temp...
# import sys # sys.path.append("/root/csdc3/src/sensors/") # sys.path.append("/root/csdc3/src/utils/") # from sensor_manager import SensorManager # from sensor_constants import * # from statistics import median def returnRandInt(minValue, maxValue): return int(random.random()*(maxValue - minValue + 1)) % (maxValue...
# Generated by Django 2.1.1 on 2018-10-27 17:56 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('music', '0007_auto_20181027_1618'), ] operations = [ migrations.AddField( model_name='favorite'...
from st2common.runners.base_action import Action from thehive4pyextended import TheHiveApiExtended __all__ = [ 'PromoteAlertToCaseAction' ] class PromoteAlertToCaseAction(Action): def run(self, alert_id, case_template=None): api = TheHiveApiExtended(self.config['thehive_url'], self.config['thehive_ap...
from django.contrib import admin from django.urls import path from . import views app_name = 'todoapp' urlpatterns = [ # ex: /todo/ path('', views.index, name='index'), # ex: /todo/tasks/ path('tasks/', views.tasks, name='tasks'), # ex: /todo/hashtags/ path('hashtags/', views.hashtags, name=...
import sys from time import sleep from sense_hat import SenseHat class Morse: senseHat = None sentence = None multiplierSpeed = 1 transcriber = None flashColor = [255,255,255] loop = False def __init__(self): if len(sys.argv) < 2: print("ERROR: This scri...
from __future__ import print_function import os import sys, logging import json import re import mechanize import boto3 mechlog = logging.getLogger("mechanize") mechlog.addHandler(logging.StreamHandler(sys.stdout)) if os.getenv('DEBUG') != None: logging.basicConfig(level=logging.DEBUG) mechlog.setLevel(loggi...
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. # # Copyright (c) 2014, Lars Asplund lars.anders.asplund@gmail.com from vunit.color_printer import ColorPrinter from xml...
# META: timeout=long import pytest from webdriver import Element from tests.support.asserts import ( assert_element_has_focus, assert_error, assert_events_equal, assert_in_events, assert_success, ) from tests.support.inline import inline @pytest.fixture def tracked_events(): return [ ...
""" References: https://fdc.nal.usda.gov/api-guide.html#food-detail-endpoint https://fdc.nal.usda.gov/portal-data/external/dataDictionary """ import datetime from typing import List, Dict, Union from datatrans import utils from datatrans.fooddata.detail.base import IdMixin from datatrans.fooddata.detail.nutri...
import sys sys.modules['pkg_resources'] = None import pygments.styles import prompt_toolkit
# -- # File: aelladata/aelladata_consts.py # # Copyright (c) Aella Data Inc, 2018 # # This unpublished material is proprietary to Aella Data. # All rights reserved. The methods and # techniques described herein are considered trade secrets # and/or confidential. Reproduction or distribution, in whole # or in part, is f...
from typing import Dict, List from rest_framework import serializers from rest_framework.exceptions import ValidationError from rest_framework.fields import empty from rest_framework.reverse import reverse from rest_framework_nested import serializers as nested_serializers from api.helpers import uuid_helpers from be...
# -*- coding: utf-8 -*- # Generated by Django 1.9.6 on 2016-06-07 07:14 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('tasks', '0002_auto_20160607_1133'), ] operations = [ migrations.AddField( ...
from os import path import numpy as np import torch import torch.utils.data as td import torchvision.datasets as dsets import torchvision.transforms as tt import vsrl_utils as vu from faster_rcnn.datasets.factory import get_imdb import faster_rcnn.roi_data_layer.roidb as rdl_roidb import faster_rcnn.fast_rcnn.config a...
#Client name: Laura Atkins #Programmer name: Griffin Cosgrove #PA purpose: Program to determine net pay check of employees and provide new access codes. #My submission of this program indicates that I have neither received nor given unauthorized assistance in writing this program #Creating the prompts for the use...
"""VBR ContainerType routes""" from typing import Dict from fastapi import APIRouter, Body, Depends, HTTPException from vbr.api import VBR_Api from vbr.utils.barcode import generate_barcode_string, sanitize_identifier_string from ..dependencies import * from .models import ContainerType, CreateContainerType, GenericR...
n1 = int(input("qual o salario do funcionario?")) s = 15 * n1 des = s/100 prom = n1 + des print("O salario atual do funcionario é de {} e com o aumento de 15% vai para {}".format(n1,prom))
# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2018-11-03 20:19 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('query', '0023_auto_20181101_2104'), ] operations = [...
# encoding: utf-8 """ .. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com> """ from __future__ import absolute_import, print_function, unicode_literals import collections import re from textwrap import dedent import pytablewriter as ptw import pytest import six # noqa: W0611 from pytablewriter.style imp...
class Game: def __init__(self): self.is_active = True self.LEVEL_CLASSES = [Level_1, Level_2, Level_3] self.curr_level_index = 0 self.curr_level = self.LEVEL_CLASSES[self.curr_level_index]( self.go_to_next_level ) def go_to_next_level(self): self.curr...
#!/usr/bin/python from my_func3 import hello3 hello3()
#!/usr/bin/env python import rospy from std_msgs.msg import String from ros_rover.msg import Rover from numpy import interp from PanTilt import PanTilt pt = PanTilt() def callback(data): #rospy.loginfo(rospy.get_caller_id() + 'I heard %s', data.speed) pan=int(interp(data.camera_pan_axis,[-255,255],[-90...
# Copyright 2018 The TensorFlow 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 applica...
"""Trivial filter that adds an empty collection to the session.""" # pylint: disable=no-self-use,unused-argument from typing import TYPE_CHECKING, Any, Dict import dlite from oteapi.models import FilterConfig from pydantic import Field from pydantic.dataclasses import dataclass from oteapi_dlite.models import DLiteSe...
from ..serializers import ClienteSerializer from ..models import Cliente class ControllerCliente: serializer_class = ClienteSerializer def crearcliente(request): datosCliente= request.data try: ClienteNuevo = Cliente() ClienteNuevo.cliente = datosCliente['client...
from random import randint from typing import Tuple from pymetaheuristics.genetic_algorithm.types import Genome from pymetaheuristics.genetic_algorithm.exceptions import CrossOverException def single_point_crossover( g1: Genome, g2: Genome, **kwargs ) -> Tuple[Genome, Genome]: """Cut 2 Genomes on index p (ra...
from src.floyd_warshall import (floyd_warshall, floyd_warshall_with_path_reconstruction, reconstruct_path) def test_floyd_warshall(graph1): dist = floyd_warshall(graph1) assert dist[0][2] == 300 assert dist[0][3] == 200 assert dist[1][2] == 200 def test_floyd_warshall_with_path_reconstruction(g...
# Generated by Django 2.0.8 on 2019-08-18 19:16 import django.contrib.postgres.fields.jsonb from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('tasks', '0022_auto_20190812_2145'), ] operations = [ migrations.AddField( model_name='task',...
"Genedropping with IBD constraints" from pydigree.common import random_choice from pydigree.genotypes import AncestralAllele from .simulation import GeneDroppingSimulation from pydigree.exceptions import SimulationError from pydigree import paths from pydigree import Individual import collections class ConstrainedMe...
# The parameters were taken from the ReaxFF module in lammps: #! at1; at2; De(sigma); De(pi); De(pipi); p(be1); p(bo5); 13corr; p(bo6), p(ovun1); p(be2); p(bo3); p(bo4); n.u.; p(bo1); p(bo2) # 1 1 156.5953 100.0397 80.0000 -0.8157 -0.4591 1.0000 37.7369 0.4235 ...
#codeby : Dileep #Write a Python program to simulate the SSTF program disk scheduling algorithms. num=int(input("Enter the Number:")) print("Enter the Queue:") requestqueue=list(map(int,input().split())) head_value=int(input("Head Value Starts at: ")) final=[] for i in requestqueue: emptylist=[] for j in reques...
# -*- coding: utf8 -*- from nose.tools import * from mbdata.api.tests import with_client, assert_json_response_equal @with_client def test_label_get(client): rv = client.get('/v1/label/get?id=ecc049d0-88a6-4806-a5b7-0f1367a7d6e1&include=area&include=ipi&include=isni') expected = { u"response": { ...
import datetime import logging import os import traceback import flask import google.auth from google.auth.transport import requests as grequests from google.oauth2 import id_token, credentials import googleapiclient.discovery from typing import Optional, NamedTuple from app.util.exceptions import BadPubSubTokenExce...
from TunAugmentor import transformations def test_transform1(): assert transformations.transform1('mahdi')=='mahdi'
from sqlalchemy import Integer, String, Column, Float from api.db.base_class import BaseLayerTable from geoalchemy2 import Geometry class CommunityLocations(BaseLayerTable): """ https://catalogue.data.gov.bc.ca/dataset/first-nation-community-locations """ __tablename__ = 'fn_community_locations' ...
import csv def find_labels(xmap, contig_start_label, contig_end_label, contig_orientation): """ this does not account for split mapped molecules i.e., assumes one molecule ID per line in XMAP fix later """ # swap if -: #print(contig_start_label, contig_end_label) if contig_orientation == "-": conti...
#################### # Gui V3 16 Sept. 2017 Malacophonous ##################### ''' API for Gui v3 guiAPP guiWIN guiWID ''' from buildingblocks import guiRectangle,guiLines import random as r class Widget(): def __init__(self,_x,_y,_w,_h): self.x = _x self.y = _y ...
# coding: utf-8 # ====================================================================== # DZI-IIIF # DeepZoom(dzi)形式のファイルをIIIF Image APIでアクセスできるようにする # ====================================================================== # 2020-05-21 Ver.0.1: Initial Version, No info.json handling. # 2020-05-22 Ver.0.2: Add info.js...
# Returns the upper triangular part of a matrix (2-D tensor) # torch.triu(input, diagonal=0, *, out=None) → Tensor # The argument 'diagonal' controls which diagonal to consider. import torch source_tensor = torch.ones((10, 10)) # print(source_tensor) tensor = (torch.triu(source_tensor) == 1).transpose(0, 1) print(te...
import cant_utils as cu import numpy as np import matplotlib.pyplot as plt import glob import bead_util as bu import tkinter import tkinter.filedialog import os, sys from scipy.optimize import curve_fit import bead_util as bu from scipy.optimize import minimize_scalar as minimize import pickle as pickle import time #...
import logging import time import cv2 as cv import numpy as np from scipy.sparse import lil_matrix from scipy.optimize import least_squares def project(points, camera_params, K, dist=np.array([])): """ Project 2D points using given camera parameters (R matrix and t vector), intrinsic matrix, ...
# Copyright (c) 2010-2019 openpyxl import pytest from openpyxl.xml.functions import fromstring, tostring from openpyxl.tests.helper import compare_xml @pytest.fixture def Marker(): from ..marker import Marker return Marker class TestMarker: def test_ctor(self, Marker): marker = Marker(symbol=N...
from telegram import InlineKeyboardButton def generate_buttons(labels): buttons = [[InlineKeyboardButton(labels[0], callback_data=labels[0]), InlineKeyboardButton(labels[1], callback_data=labels[1])], [InlineKeyboardButton(labels[2], callback_data=labels[2]), Inline...
import base64 from authlib.common.encoding import to_bytes, to_unicode import fence.utils def create_basic_header(username, password): """ Create an authorization header from the username and password according to RFC 2617 (https://tools.ietf.org/html/rfc2617). Use this to send client credentials i...
# ywo queue to stack import queue class ArrayQueue(object): def __init__(self): self.queue1 = queue.Queue(5) self.help = queue.Queue(5) def push(self, data): """模仿压栈""" if self.queue1.full() == True: raise RuntimeError('the stack is full') self.queue1.put(...
''' Written by Jinsung Yoon Date: Jul 9th 2018 (Revised Oct 19th 2018) Generative Adversarial Imputation Networks (GAIN) Implementation on MNIST Reference: J. Yoon, J. Jordon, M. van der Schaar, "GAIN: Missing Data Imputation using Generative Adversarial Nets," ICML, 2018. Paper Link: http://medianetlab.ee.ucla.edu/pap...
import datetime import names from django.contrib.auth import get_user_model from usersetting.models import UserSetting User = get_user_model() def initialize_usersetting(email): while(True): try: nickname = names.get_first_name() UserSetting.objects.get(nickname=nickname) e...
import numpy as np import pandas as pd def create_rolling_ts( input_data, lookback=5, return_target=True, apply_datefeatures=True, return_np_array=False ): """ Make flat data by using pd.concat instead, pd.concat([df1, df2]). Slow function. Save data as preprocessed? """ ...
import time def merge(data, low, high, middle, drawData, timetick): color=[] for i in range (len(data)): color.append('sky blue') left = data[low:middle+1] right = data[middle+1:high+1] i = 0 j = 0 for k in range(low, high+1): if i< len(left) and j<len(right): ...
from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton, CallbackQuery from pyrogram import Client, emoji from datetime import datetime, timedelta from shamil.voicechat import mp @Client.on_callback_query() async def cb_handler(client: Client, query: CallbackQuery): if query.data == "replay": ...
#!/usr/bin/env python import yaml import json def main(): my_list = range(8) my_list.append('0 through 7 are cool numbers') my_list.append({}) my_list[-1]['subnet_mask'] = '255.255.255.0' my_list[-1]['gateway'] = '192.168.1.1' with open("first_yaml_file.yml", "w") as f: f.write(yaml....
import os import glob import sys class CAPSProfile: def __init__(self): self.streams = [] # List of strings, e.g. XY.ABCD.*.* self.stations = [] # List of network, station tuples, e.g. (XY,ABCD) self.oldStates = [] # Content of old state file ''' Plugin handler for the CAPS plugin. ''' ...
#!/usr/bin/env python # -*- coding: utf-8 -*- import unittest import time import xlrd from public import saveScreenshot from core import LoginPage from test import support from public.log import logger from public.pyse import Pyse class LoginTest(unittest.TestCase): def setUp(self): self.driver = Pyse("ch...
import os import pprint import random import collections from ai_list_common import ( ListInterface, ListBase, ListTypeNgram, TestRunnerCheckNgram, ) class NgramList(ListTypeNgram, ListBase, ListInterface): def check_num_of_gram(self, num_of_gram): if super().check_num_of_gram(num_of_gram)...
# -*- coding: utf-8 -*- from __future__ import absolute_import import os import six from aiida import orm from aiida.common.lang import classproperty from aiida.plugins import factories from aiida_quantumespresso.calculations import BasePwCpInputGenerator class PwCalculation(BasePwCpInputGenerator): """`CalcJob...
# -*- coding: utf-8 -*- from com.pnfsoftware.jeb.client.api import IClientContext from com.pnfsoftware.jeb.core import IRuntimeProject from com.pnfsoftware.jeb.core.units import IUnit from com.pnfsoftware.jeb.core.units.code import IDecompilerUnit, DecompilationOptions, DecompilationContext from com.pnfsoftware.jeb.cor...
#!/usr/bin/env python # # ---------------------------------------------------------------------- # # Brad T. Aagaard, U.S. Geological Survey # Charles A. Williams, GNS Science # Matthew G. Knepley, University of Chicago # # This code was developed as part of the Computational Infrastructure # for Geodynamics (http://ge...
# coding=utf-8 import sys from enum import Enum from typing import List class VarType(Enum): INVALID = -1 EXIT = 0 OPERATION = 1 CONDITION = 2 SUBROUTINE = 3 START = 4 END = 5 SELECTED = 6 # 包含选择的条件语句 即yes分支或者no分支 class ConnectType(Enum): NONE = 0, NORMAL = 1, YSE = 2, ...
def lcm(*values): values = set([abs(int(v)) for v in values]) if values and 0 not in values: n = n0 = max(values) values.remove(n) while any( n % m for m in values ): n += n0 return n return 0 lcm(-6, 14) 42 lcm(2, 0) 0 lcm(12, 18) 36 lcm(12, 18, 22) 396