text
stringlengths
2
999k
from __future__ import print_function, division from sympy.concrete.expr_with_limits import AddWithLimits from sympy.concrete.expr_with_intlimits import ExprWithIntLimits from sympy.core.function import Derivative from sympy.core.relational import Eq from sympy.core.singleton import S from sympy.core.symbol import Dum...
# Copyright 2021 Sony Semiconductors Israel, 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 b...
INPUTPATH = "input.txt" #INPUTPATH = "input-test.txt" with open(INPUTPATH) as ifile: raw = ifile.read() program = tuple(map(int, raw.strip().split(","))) from enum import Enum class Mde(Enum): POS = 0 IMM = 1 REL = 2 from itertools import chain, repeat, islice from collections import defaultdict from typing import...
#!/usr/bin/env python """User dashboard tests.""" from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals from absl import app from future.builtins import range from grr_response_core.lib import rdfvalue from grr_response_server import access_control from grr_re...
import socialite.engine.LocalEngine as LocalEngine import socialite.engine.ClientEngine as ClientEngine import socialite.tables.QueryVisitor as QueryVisitor import socialite.tables.Tuple as Tuple import socialite.util.SociaLiteException as SociaLiteException import socialite.type.Utf8 as Utf8 import sys import java.uti...
""" discord.types ~~~~~~~~~~~~~~ Typings for the Discord API :copyright: (c) 2015-2021 Rapptz & (c) 2021-present Pycord Development :license: MIT, see LICENSE for more details. """
import pdf_to_json as p2j import json url = "file:data/multilingual/Latn.NHN/Sun-ExtA_12/udhr_Latn.NHN_Sun-ExtA_12.pdf" lConverter = p2j.pdf_to_json.pdf_to_json_converter() lConverter.mImageHashOnly = True lDict = lConverter.convert(url) print(json.dumps(lDict, indent=4, ensure_ascii=False, sort_keys=True))
import pytest from RobinhoodTrader.config import getConfiguration, getQrCode def test_getConfiguration(maintainConfig): config = getConfiguration() assert type(config).__name__ == "ConfigParser" assert "login" in config.keys() assert "qrCodePattern" in config["login"].keys() def test_getQrCode_NoCo...
from datetime import datetime, timedelta import jwt from reader.arg import Arg_Reader def create_token(): now = datetime.now() exp = now + timedelta(minutes=10) payload = { 'iat': now.timestamp(), 'exp': exp.timestamp(), 'nbf': now.timestamp() } token = jwt.encode(payload...
import requests url = "https://imdb8.p.rapidapi.com/title/get-top-rated-movies" headers = { 'x-rapidapi-host': "imdb8.p.rapidapi.com", 'x-rapidapi-key': "6fae38f5d6msh5243996cd2a9653p122166jsnc11c3ed7fb29" } response = requests.request("GET", url, headers=headers) # write the list of dictionaries ("id":...
from tests.utils_testing import * # ============================================================================== # Selection functions # ============================================================================== @pytest.fixture def metrics(): return np.array([18, 5, 12, 11, 20, 17, 8, 10, 6, 5, 3, 2,...
import random import numpy as np from ...core.sampler.proposal import JumpProposal class SkyLocationWanderJump(JumpProposal): """ Jump proposal for wandering over the sky location. Does a Gaussian step in RA and DEC depending on the temperature. """ def __call__(self, sample, **kwargs): ...
"""FrontStreetInformer-Discord-Bot A Discord-Bot that encompasses several functions to enhance the users' experience""" __author__ = "Marten Scheuck" from functionality.cogs import add_cogs from functionality.tools import * def main(): """The bots main functionality""" # Startup-function that calls the bot...
import string from functools import partial as p from pathlib import Path from textwrap import dedent import pytest from tests.helpers.agent import Agent from tests.helpers.assertions import has_datapoint_with_dim, tcp_socket_open from tests.helpers.kubernetes.utils import get_discovery_rule, run_k8s_monitors_test, g...
""" Find and replace for an S3 bucket. Usage: s3replace <bucket> [--dry-run] [--access-key-id=<key>] [--secret-access-key=<key>] s3replace -h | --help s3replace --version Options: -h --help Show this screen. --version Show version. --dry-run Don't replace. ...
#!/bin/python3 ''' Python script to allow a simple access of WebDAV servers from a drone.io file. ''' import os import sys import inspect from webdav3.client import Client WEBDAV_CON_SETTINGS = [ 'webdav_hostname', 'webdav_login', 'webdav_password', 'webdav_token', 'webdav_root', 'webdav_cer...
# -*- coding: utf-8 -*- """ author:wnl date:2018-12-7 """ from flask import Flask from flask_sqlalchemy import SQLAlchemy app = Flask(__name__) app.config.from_pyfile('settings.py') app.jinja_env.trim_blocks = True app.jinja_env.lstrip_blocks = True db = SQLAlchemy(app) from sayhello import views,errors,commands...
#!/usr/bin/env python3 ########################################## # Duino-Coin Console Wallet (v1.5) # https://github.com/revoxhere/duino-coin # Distributed under MIT license # © revox 2020 ########################################## import socket, configparser, getpass, os, platform, sys, time, json from signal impo...
# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals. # Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation. # # 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 Lice...
#! /usr/bin/env python """A template for mne-python compatible packages.""" import codecs import os from setuptools import find_packages, setup # get __version__ from _version.py ver_file = os.path.join('mne_camcan_func_connectivity_study', '_version.py') with open(ver_file) as f: exec(f.read()) DISTNAME = 'mne...
""" .autobio""" import asyncio import time from telethon.tl import functions from telethon.errors import FloodWaitError from userbot.utils import admin_cmd from userbot import ALIVE_NAME BIO_MSG = Config.BIO_MSG if BIO_MSG is None: BIO_MSG = "I am a pro @Dark_cobra_support" DEL_TIME_OUT = 60 @borg.on(admin_...
__author__ = 'ShelockLiao' import torch import torch.nn as nn from torch.autograd import Variable from torch.utils.data import DataLoader from torchvision import transforms from torchvision import datasets from torchvision.utils import save_image import os if not os.path.exists('./dc_img'): os.mkdir('./dc_img') ...
# -------------------------------------------------------- # Fast R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick # -------------------------------------------------------- import time import torch class Timer(object): """A si...
import requests import string import random import openmined_psi as psi import flask from Neo4jConnection import Neo4jConnection from google.protobuf.json_format import MessageToJson from google.protobuf import json_format from flask import Flask, abort, request from flask_restful import Api from colorama imp...
#!/usr/bin/env python import rospy import operator import copy from std_msgs.msg import String from twitch_chat_ros.msg import twitch_message vote_seconds = 6 VALID_COMMANDS = ["GO","GC","G1","G2","G3","G4","G5","G6","G7","G8","G9","TX+","TX-","TY+","TY-","TZ+","TZ-","RX+","RX-","RY+","RY-","RZ+","RZ-"] register = {} ...
# -*- coding: utf-8 -*- import numpy as np import pandas as pd def trend_dampen(damp_fact, trend): zeroed_trend = trend - trend[0] damp_fact = 1 - damp_fact if damp_fact < 0: damp_fact = 0 if damp_fact > 1: damp_fact = 1 if damp_fact == 1: dampened_trend = zeroed_trend ...
from multiprocessing import Pool class Collection: """ Helper to provide a natural Functional Programming approach in Python. """ def __init__(self, val): self.val = val def apply(self, f): return Collection(f(self.val)) def filter(self, f): return Collection(filt...
# flake8: noqa: E501 import asyncio import logging import os from argparse import Namespace from typing import Optional, List, Dict import pytest from blspy import G1Element, AugSchemeMPL from cactus.consensus.block_rewards import calculate_base_farmer_reward, calculate_pool_reward from cactus.plotting.create_plots i...
#! /usr/bin/env python # -*- coding: utf-8 -*- """ Created on 4 jul 2017 12:31:39 CEST @author: BMMN """ from __future__ import print_function # make print python3 compatible import gc # garbage collector import nacl.secret import nacl.utils import nacl.encoding class Salsa20Cipher(object): def __init__(self...
from http import HTTPStatus from starlette.middleware.base import BaseHTTPMiddleware, RequestResponseEndpoint from starlette.requests import Request from starlette.responses import Response from fastapi.responses import JSONResponse from basicauth import decode from oxigraph_admin.crud.security import is_security_ena...
"""Trains many convolutional neural nets with native (3-D) GridRad images.""" import os import pickle import argparse import traceback from multiprocessing import Pool, Manager import numpy from gewittergefahr.gg_utils import time_conversion from gewittergefahr.gg_utils import soundings from gewittergefahr.gg_utils im...
from slicegan import preprocessing, util import torch import torch.nn as nn import torch.backends.cudnn as cudnn import torch.optim as optim import time import matplotlib def train(pth, imtype, datatype, real_data, Disc, Gen, nc, l, nz, sf): """ train the generator :param pth: path to save all files, imgs ...
import os # toolchains options ARCH = 'arm' CPU = 'cortex-m3' CROSS_TOOL = 'gcc' # cross_tool provides the cross compiler # EXEC_PATH is the compiler execute path, for example, CodeSourcery, Keil MDK, IAR if os.getenv('RTT_CC'): CROSS_TOOL = os.getenv('RTT_CC') PLATFORM = CROSS_TOOL EXEC_PATH = os.getenv...
from collections import defaultdict with open("input.txt", 'r', encoding="utf-8") as file: food = [ ( set(ingredients.split()), set(map(str.strip, allergens.strip().lstrip("contains").split(", "))) ) for ingredients, allergens in (line.strip().rstrip(')').split('(') ...
import math, random from unittest import TestCase from vec import * class TestVec(TestCase): def setUp(self): self.rnd = random.Random() def _prob(self, p): return self.rnd.uniform(0,1) < p def _randint(self, range): x = self.rnd.randint(1,range) return x if self._prob(.5...
from ..collection.Collection import Collection class BaseRelationship: def __init__(self, fn, local_key=None, foreign_key=None): if isinstance(fn, str): self.local_key = fn self.foreign_key = local_key else: self.fn = fn self.foreign_key = foreign_ke...
class BagVo(): pass
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat Jun 27 14:21:31 2020 @author: theomacmillan """ #%% import torch import numpy as np from models import AE import matplotlib.pyplot as plt import matplotlib.cm as cm from utils import trajectory_jet from mpl_toolkits.mplot3d import Axes3D from scipy.st...
""" The server module starts the elaster server and initiates the elasticsearch connection. It also takes addtional option example parameter to initiate the example indices. """ import tornado.ioloop import tornado.httpserver import tornado.web from tornado.options import define, options import logging import o...
# This file is part of QuTiP: Quantum Toolbox in Python. # # Copyright (c) 2011 and later, Paul D. Nation and Robert J. Johansson. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: ...
#!/usr/bin/env python # -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # ---------------------------------------------...
from datetime import datetime from enum import Enum from typing import List from pydantic import BaseModel, Field class TypeEnum(str, Enum): CURSEFORGE = "CURSEFORGE" FABRIC = "FABRIC" FORGE = "FORGE" VANILLA = "VANILLA" class EnvironmentModel(BaseModel): version: str = Field(default="latest", ...
#=============================================================================== # Redditor Scraper #=============================================================================== from .. import cli, titles def run_redditor(args,s_t,parser,reddit,redditor_functions): titles.u_title()...
import discord import util import command_template class ShowChannelBD(command_template.Command): def __init__(self, client): super(ShowChannelBD, self).__init__(client) self.enabled = True self.perm_level = self.permission_levels["admin"] self.cmd_name = "showchannelbd" ...
# Copyright (c) 2015-2017 Cisco Systems, 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 # # Unl...
import taichi as ti import os import numpy as np import cv2 import math import time import random from renderer_utils import out_dir, ray_aabb_intersection, inf, eps, \ intersect_sphere, sphere_aabb_intersect_motion, inside_taichi import sys res = 1280, 720 num_spheres = 1024 color_buffer = ti.Vector(3, dt=ti.f32) s...
from docutils import nodes from sphinx.util import logging from sphinx.util.docutils import SphinxDirective from sphinx.transforms import SphinxTransform from docutils.nodes import compound logger = logging.getLogger(__name__) class TableOfContentsNode(nodes.Element): """Add a TableOfContents node that will be...
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/cloud/dataproc_v1/proto/autoscaling_policies.proto import sys _b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) from google.protobuf import descriptor as _descriptor from google.protobuf ...
from datetime import datetime, timedelta from django import forms from .models import Donation, Message, Room class RoomRegisterForm(forms.ModelForm): date_expires = forms.DateField( input_formats=('%d/%m/%Y',), label='Data wygaśnięcia', help_text='Zbiórka nie może trwać więcej niż 183 dni') ...
import json import requests def get_backlogItems(server_url, access_token,workspaceid,offset): api_url = server_url+'/agm/api/workspaces/'+workspaceid+'/backlog_items'+'?offset='+offset print api_url header = {'Content-Type': 'application/json', 'Authorization': 'Bearer {0}'.format(access_token)} response =...
# coding: utf-8 """ Kubernetes No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 OpenAPI spec version: release-1.15 Generated by: https://openapi-generator.tech """ import pprint import re # noqa: F401 import six class V1Ser...
# Crack an uncrackable cypher import re pattern = re.compile(r'^([\/\\]{1})[^a-zA-Z0-9]*(?P<username>[a-zA-Z0-9]+)[^a-zA-Z0-9]*(?P=username)[^a-zA-Z0-9]*(?P<password>[a-zA-Z0-9]+)[^a-zA-Z0-9]*(?P=password)[^a-zA-Z0-9]*(?P=username)[^a-zA-Z0-9]*(?P=password)[^a-zA-Z0-9]*\1$') while True: user_input = input() ...
# 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 from .. import _utilities, _tables from ...
# Imports, sorted alphabetically. # Python packages import sys # Third-party packages # Nothing for now... # Modules from this project from items import * __all__ = ( 'Inventory', ) class Inventory: sort_mode = 0 def __init__(self, slot_count = 27): self.slot_count = slot_count self....
""" Parses http://www.live-footballontv.com for info about live matches """ import re from datetime import datetime, timedelta import requests from bs4 import BeautifulSoup url = 'https://www.live-footballontv.com' headers = {'User-Agent': 'Football Push Notifications'} def convert_date(date): """ Returns ...
#!/usr/bin/env python # encoding: utf-8 # # Copyright SAS Institute # # 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 b...
#!/usr/bin/env python3 # # Copyright 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. import argparse import logging import os import re import threading import uuid import yaml from cros.factory.device.bluetooth ...
from sympy.external import import_module matchpy = import_module("matchpy") from sympy.utilities.decorator import doctest_depends_on if matchpy: from matchpy import Wildcard else: class Wildcard(object): def __init__(self, min_length, fixed_size, variable_name, optional): pass from symp...
import logging from scrapy.exceptions import NotConfigured from scrapy import signals logger = logging.getLogger(__name__) class AutoThrottle: def __init__(self, crawler): self.crawler = crawler if not crawler.settings.getbool("AUTOTHROTTLE_ENABLED"): raise NotConfigured sel...
from ... import objects, strutil from ...meta import pattern class TransformBase: def __init__(self, response): self.response = response @classmethod def get_transform(self, name): for subclass in self.__subclasses__(): if subclass.__name__ == name: return subc...
"""create memory table Revision ID: 0b35c351f36e Revises: Create Date: 2022-04-21 18:18:53.401740 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '0b35c351f36e' down_revision = None branch_labels = None depends_on = None def upgrade(): op.create_table( ...
import tensorflow as tf assert tf.__version__.startswith("1.4") # the version we used import numpy as np import logging import os from os.path import join as jp import library.helpers as h import library.tensorflow_helpers as tfh import time from library.vocabulary import * from tensorflow.contrib.tensorboard.plugins ...
"""patterns.threetier (3-tier arch) test.""" import unittest import unittest.mock import patterns.threetier from patterns.threetier import DataTier, LogicTier from patterns.threetier import PresentationTier as PresTier class TestThreeTier(unittest.TestCase): """3-tier test case.""" def setUp(self): ...
import pandas as pd from mpl_toolkits import mplot3d import numpy as np import matplotlib.pyplot as plt from matplotlib import cm import matplotlib as mpl from scipy.integrate import odeint import cPickle as pickle import os import argparse parser = argparse.ArgumentParser(description='Plot simulation of MMP upon a tre...
""" Cisco_IOS_XR_ipv4_acl_datatypes This module contains a collection of generally useful derived YANG data types. Copyright (c) 2013\-2017 by Cisco Systems, Inc. All rights reserved. """ from collections import OrderedDict from ydk.types import Entity, EntityPath, Identity, Enum, YType, YLeaf, YLeafList, YList, L...
import yahoo_finance def get_stock_info_and_historical_data(symbol): """Retrieve stock info and historical data for `symbol` Leverages yahoo-finance for Python https://github.com/lukaszbanasiak/yahoo-finance """ share = yahoo_finance.Share(symbol) info = share.get_info() start_date = info...
# import logging from webapp2 import * NEWS_POSTS = { '/2012/01/26/revisiting-equality.html' : '/2012/01/proposed-changes-for-equality.html', '/2012/01/20/dart-language-spec-0.07.html' : '/2012/01/dart-language-spec-v007-now-available.html', '/2012/01/17/new-editor-build...
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2020/04/12 18:16 # @Author : Xu # @Site : https://xuccc.github.io/ import os from enum import IntEnum from core.utils import load_py_script class Status(IntEnum): SUCCESS = 1 FAIL = 2 ERROR = 9 TBD = 0 class Payload(object): def __...
#!/usr/bin/env python import optparse import numpy as np import scipy.signal import scipy.fftpack as fft import gnsstools.glonass.ca as ca import gnsstools.nco as nco import gnsstools.io as io import gnsstools.util as util # # Acquisition search # def search(x,chan,doppler_search,ms): fs = 16384000.0 n = 16384...
import jax.numpy as jnp from flax import nn from ml_params_flax.train import CNN def create_model(key, shape=(1, 28, 28, 1), dtype=jnp.float32): _, initial_params = CNN.init_by_shape(key, [(shape, dtype)]) return nn.Model(CNN, initial_params)
from django.urls import reverse from tests.base import TestCase class UsersTest(TestCase): def test_user_posts_view(self): url = reverse('pybb:user_posts', kwargs={ 'username': self.user.username }) response = self.client.get(url) self.assertEqual(response.status_cod...
import unittest import os import os.path from infrastructure.ctags.ctags_class_mapper import CTagClassMapper, MapperError, CTagLanguage class CTagClassMapperTest(unittest.TestCase): def get_ctags_exe(self): # TODO this is probably neither the right place to do this, nor the right way i...
import os import sys def get_parent_dir(n=1): """returns the n-th parent dicrectory of the current working directory""" current_path = os.path.dirname(os.path.abspath(__file__)) for _ in range(n): current_path = os.path.dirname(current_path) return current_path src_path = os.path.join(ge...
import json import pandas as pd import requests import numpy as np ## FRANCE def download_data(): #Flux a url = "https://www.data.gouv.fr/fr/datasets/r/6c39a8be-cd65-465a-a656-f8c645c839ac" data = requests.get(url) with open('data/input/flux-a-pfizer-nat.csv', 'wb') as f: f.write(data.content) #F...
from niaaml.utilities import Factory from niaaml.preprocessing.feature_transform.normalizer import Normalizer from niaaml.preprocessing.feature_transform.standard_scaler import StandardScaler from niaaml.preprocessing.feature_transform.max_abs_scaler import MaxAbsScaler from niaaml.preprocessing.feature_transform.quant...
import base64 class UpdateResponseHashes(object): def __init__(self, jsoninput): rawobject = jsoninput["rawHashes"] prefixlen = rawobject["prefixSize"] rawhashes = rawobject["rawHashes"] rawhashes = base64.b64decode(rawhashes) if not (len(rawhashes)%prefixlen) == 0: ...
# # PySNMP MIB module HPN-ICF-DHCPS-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HPN-ICF-DHCPS-MIB # Produced by pysmi-0.3.4 at Wed May 1 13:37:53 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Ma...
#!/usr/bin/env python2 # Copyright (c) 2014-2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """ Run Regression Test Suite This module calls down into individual test cases via subprocess. It will ...
# # __init__.py # # This source file is part of the FoundationDB open source project # # Copyright 2013-2018 Apple Inc. and the FoundationDB project authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of t...
#!/usr/bin/env python3 """ Starts a demo HTTP server to capture and transform audio as a live demonstration of the trained model. As an experiment, this version attempts to break the audio into a stream of chunks and evaluate each one independently of one another. Brandon Thomas 2019-07-29 <bt@brand.io> <echelon@gma...
import pytest from click.testing import CliRunner from driven import cli @pytest.fixture def runner(): return CliRunner() def test_cli(runner): result = runner.invoke(cli.main) assert result.exit_code == 0 assert not result.exception assert result.output.strip() == 'Hello, world.' def test_cli...
#!/usr/bin/env python import os, sys, optparse from Utils import Fasta ################################################# def options(): parser = optparse.OptionParser('usage: python %prog -i filename -n size') parser.add_option('-i', '--fasta', dest='fasta', help='FASTA file to filter', metavar='FASTA', defau...
# -*- coding: utf-8 -*- from dataiku.customrecipe import get_recipe_config from dku_timeseries import Resampler from io_utils import get_input_output from recipe_config_loading import check_and_get_groupby_columns, check_time_column_parameter, check_python_version, get_resampling_params check_python_version() # ---...
from grou.grou_main import main
'''OpenGL extension AMD.gpu_shader_half_float This module customises the behaviour of the OpenGL.raw.GL.AMD.gpu_shader_half_float to provide a more Python-friendly API Overview (from the spec) This extension was developed based on the NV_gpu_shader5 extension to allow implementations supporting half fl...
""" This file is part of The Cannon analysis project. Copyright 2014 Melissa Ness. # NOTE THE ISSUE MAY BE THE Fe_H SCALE THIS IS DIFFERENT IN THE UNFILTERED VERSIONA # TO DO - CHECK THE UNFILTERED VERSION WITH THE 5 LABELS HERE GIVES THE SAME RESULTS # urls - http://iopscience.iop.org/1538-3881/146/5/133/suppdata/aj4...
import socket import struct from Queue import Queue from Queue import Empty as QueueEmpty import time import multiprocessing as mp import errors COMMAND_CONNECT = "connect" COMMAND_REGISTER = "register" COMMAND_DISCONNECT = "disconnect" class TCPCLient(object): """ Simple TCP client for work with NMCSer...
# -*- coding: utf-8 -*- # # django-pandas documentation build configuration file, created by # sphinx-quickstart on Mon Aug 5 09:30:44 2013. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. #...
#!/usr/bin/env python import itertools for i in itertools.accumulate([x*x for x in range(1, 20)]): print(i)
class Coffee: coffeecupcounter =0 def __init__(self, themilk, thesugar, thecoffeemate): self.milk = themilk self.sugar = thesugar self.coffeemate = thecoffeemate Coffee.coffeecupcounter=Coffee.coffeecupcounter+1 print(f'You now have your coffee with {self.milk} milk, {s...
#!/usr/bin/env python import subprocess import os import sys import videoMode proc = None # Set a specific video mode def runCommand(command): global proc videoMode.setVideoMode(command.videomode, command.delay) command.env.update(os.environ) proc = subprocess.Popen(command.array, env=command.env, ...
import requests from anvil import Anvil def main(): requests.packages.urllib3.disable_warnings() in_file = open("./kiln_base_url.txt", "r") base_url = in_file.read().replace('\n', '') in_file.close() anvil = Anvil(base_url, False) anvil.create_session_by_prompting() repo_indices = set() ...
import os import argparse import configparser from pprint import pprint import gitviper import gitviper.utilities import gitviper.gitconnector as gitconnector from gitviper.gitconnector import connection from gitviper.colors import * import time from pathlib import Path import os home_dir = str(Path.home()) project...
""" Independent Model Ensemble of binary classifiers with resulting probabilities normalized across all classes. Assumes all classes are independent and are not related by any class hierarchy. """ import numpy as np from mainmodel.mainmodel import MainModel from classifiers.binary.optbinary import OptimalBinaryClass...
import os import json import time import click import pickle import signal import requests import subprocess import numpy as np import logging import socket import errno from tqdm import tqdm elog = logging.getLogger('eval') formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s') fh = l...
# -*- coding:utf-8 -*- from __future__ import absolute_import from __future__ import print_function from __future__ import division import os import sys import tensorflow as tf import tensorflow.contrib.slim as slim import numpy as np import cv2 sys.path.append("../../") from tools.train_base import Train from libs....
import heapq import pathlib import pickle import string from collections import defaultdict from typing import List, Tuple import click import matplotlib.pyplot as plt import networkx as nx import numpy as np import torch from pydantic import BaseModel from spacy.lang.en.stop_words import STOP_WORDS from tqdm.auto imp...
import tabula as tb import tkinter as tk import tkinter.font as font from tkinter.filedialog import askopenfilename as open_as from PIL import ImageTk, Image def msg_from_author(): msg=''' \tConvert Your Pdf tables into csv format easily \tJust Search/Browse the file and hit the convert button \tTHANK YOU FOR USING ...
from django.urls import reverse_lazy from django.views.generic import UpdateView, DetailView from petstagram.main_app.models import PetPhoto, Pet, LikesModel from petstagram.profile_app.forms import ProfileEditForm from petstagram.profile_app.models import Profile class ProfilePageView(DetailView): model = Prof...
#!/usr/bin/env python3 # This script will take convert intended config data and data collected from DUTs into a diff-comparable YAML format. from translate.tools import * # translate_data.py requires some configuration to find files to be translated. config_yaml_filename = './translate_data_cfg.yml' run_translation...