content
stringlengths
5
1.05M
#!/usr/bin/env python # coding=utf-8 from setuptools import setup, find_packages from codecs import open import os import versioneer CLASSIFIERS = """ Development Status :: 3 - Alpha Intended Audience :: Science/Research License :: OSI Approved :: MIT License Programming Language :: Python :: 3 Programming Language...
from builtins import str from builtins import object import codecs import mimetypes import sys import uuid try: import io except ImportError: pass # io is requiered in python3 but not available in python2 class MultiPartForm(object): def __init__(self): self.boundary = uuid.uuid4().hex sel...
# -*- coding: utf-8 -*- """Mocks for tests.""" from typing import Optional, Tuple import torch from torch import nn from pykeen.models import EntityRelationEmbeddingModel, Model from pykeen.nn.emb import EmbeddingSpecification, RepresentationModule from pykeen.triples import TriplesFactory __all__ = [ 'CustomR...
# Copyright (C) 2020 THL A29 Limited, a Tencent company. # All rights reserved. # Licensed under the BSD 3-Clause License (the "License"); you may # not use this file except in compliance with the License. You may # obtain a copy of the License at # https://opensource.org/licenses/BSD-3-Clause # Unless required by appl...
# 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 use ...
from PySide.QtGui import QGraphicsView as _QGraphicsView from PySide.QtCore import QObject as _QObject from PySide.QtGui import QGraphicsObject as _QGraphicsObject class _Property(object): def __call__(*args, **kwargs): """ x.__call__(...) <==> x(...) """ pass def...
#!/opt/splunk/bin/python """ Common functions """ import os import re import sys import traceback app_home = "{}/etc/apps/OSweep".format(os.environ['SPLUNK_HOME']) tp_modules = "{}/bin/_tp_modules".format(app_home) sys.path.insert(0, tp_modules) import splunk.Intersplunk as InterSplunk import requests config_path ...
#!/usr/bin/env python from histcensusgis.microdata import * from histcensusgis.Clean import clean_microdata city_name = sys.argv[1] state_abbr = sys.argv[2] decade = sys.argv[3] ed_map_flag = sys.argv[4] batch = sys.argv[5] city_info = [city_name, state_abbr, decade] print(city_info, ed_map_flag) if batch: batch_cl...
import numpy as np from src.model.maze.IMaze import IMaze class Maze(IMaze): def __init__(self, cell_array=None, grid_shape=(10, 10)): super().__init__(cell_array, grid_shape) def to_string(self): string = "" for row in self.grid: for cell in row: string +=...
import unittest from unittest import mock from requests.exceptions import RequestException from gitssue.request.requests import Requests from gitssue.request.unsuccessful_http_request_exception import UnsuccessfulHttpRequestException class RequestsTest(unittest.TestCase): def setUp(self): self.requests =...
"""Provide common test tools for Z-Wave JS.""" AIR_TEMPERATURE_SENSOR = "sensor.multisensor_6_air_temperature" SWITCH_ENTITY = "switch.smart_plug_with_two_usb_ports_current_value"
from __future__ import absolute_import import sys, os import glob import imp import numpy as np import h5py as h5 import pandas as pd from functools import wraps try: import simplejson as json except ImportError: import json def file_finder(find_file_func): ''' Decorator to help find files. This...
from brownie import ( network, accounts, config, interface, Contract, MotorbikeAttack, ) from scripts.helpful_scripts import ( get_account, get_new_instance, submit_instance, get_web3 ) from web3 import Web3 def main(): player = get_account() instance_address = get_new_...
import random #配列から確率でセリフを取り出す #構造は[[重み, "セリフ"], ] def get_quotes(q_list): total_weight = 0 for i in q_list: total_weight += i[0] #順番に確率に当てはまるかやっていく target = q_list[0] for i in q_list: if random.randint(0, total_weight) <= i[0]: target = i break ...
import sys restart_times = "{{cookiecutter.restart_times}}" try: restart_times = int(restart_times) if restart_times < 0: raise ValueError except ValueError: print(f"restart_times ({restart_times}) must be a non-negative integer.") sys.exit(1) latency_wait = "{{cookiecutter.latency_wait}}" try...
#!/usr/bin/env python3 # Copyright (c) 2017 Anki, 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 in the file LICENSE.txt or at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unles...
# -*- coding: utf-8 -*- __author__ = ["Markus Löning"] __all__ = ["MatrixProfileTransformer"] import pandas as pd from sktime.transformations.base import _SeriesToSeriesTransformer from sktime.utils.validation.series import check_series from sktime.utils.validation._dependencies import _check_soft_dependencies _chec...
import sys import pickle newc=pickle.load(open('cmd3g.p')) nx={} c=0 for i in newc: if newc[i]>100: c+=1 nx[i]=newc[i] print c,len(nx) pickle.dump(nx,open('cutcmd3g.p','w'))
from setuptools import setup, find_packages with open("README.txt", "r") as fh: long_description = fh.read() setup( name='robotframework-openpyxllib', version='0.7', description='Robotframework library for excel xlsx file format', long_description=long_description, long_description_content_type=...
""" graphics.py Danny Tsai This program will call the crawler to get index from https://finance.yahoo.com/world-indices/ then draw the candlestick chart of each index. """ import index_data_crawler as crawler import tkinter as tk from tkinter import ttk # Index name and index code # INDICES = { # 'TSEC weighted i...
from typing import List from sdmxthon.model.utils import FacetType, string_setter, FacetValueType class Facet: """Defines the format for the content of the Component when reported in a data or metadata set. """ def __init__(self, facetType: str = None, facetValue: str = None, facetValue...
# encoding: utf-8 from __future__ import (absolute_import, division, print_function, unicode_literals) import numpy as np import sys import os import pickle from tqdm import trange from astropy.table import Table import torch from torch.autograd import Variable from astra.utils import log # Check for CUDA suppor...
# -*- coding:utf8 -*- from __future__ import print_function import numpy as np from nltk.corpus import stopwords from nltk.stem import SnowballStemmer from nltk.stem.porter import * from string import punctuation from keras.preprocessing.text import Tokenizer from keras.preprocessing import sequence from config imp...
import pandas as pd import numpy as np import math import matplotlib.pyplot as plt from datetime import datetime from ipywidgets import interact, interactive, fixed, interact_manual import ipywidgets as widgets import sys import pickle def loss(a,b): x = np.abs(a-b) y = math.pi*2-np.abs(a-b) z = np.greater...
def getDigitizerName(digitizerNumber): digitizers = { 0: "Unknown", 1: "Demo", 2: "MiniDigi", 3: "DD132X", 4: "OPUS", 5: "PATCH", 6: "Digidata 1440", 7: "MINIDIGI2", 8: "Digidata 1550" } if (digitizerNumber in digitizers.keys()): ...
# # Copyright (c) 2022 Airbyte, Inc., all rights reserved. # from typing import Any, List, Mapping, Tuple import requests from airbyte_cdk.models import SyncMode from airbyte_cdk.sources import AbstractSource from airbyte_cdk.sources.streams import Stream from airbyte_cdk.sources.streams.http.auth import TokenAuthen...
import mock import pytest import re from chalice import cli from chalice.cli.factory import CLIFactory from chalice.config import Config from chalice.local import LocalDevServer, ProxyServerRunner def test_cannot_run_local_mode_with_trailing_slash_route(): local_stage_test = 'local_test' factory = mock.Mock(...
import torch import sys HUMANTORCH_WEIGHTS_PATH = sys.argv[1] CONVERTED_WEIGHTS_OUT_PATH = sys.argv[2] humantorch_weights = torch.load(HUMANTORCH_WEIGHTS_PATH, map_location='cpu') humantorch_weights = humantorch_weights['state_dict'] if 'state_dict' in humantorch_weights else humantorch_weights humantorch_weights = {...
import matplotlib.pyplot as plt import numpy as np from selfdrive.config import Conversions as CV x = [-60, -44.80314961, -35.09104331, -25.04585719, -17.59238547, -11.06657122, -6.83182713, -4.97584109, -3.36547065, -1.76896922, -0.71492484, 0.0, 1.25, 3.06057623, 4.24570508, 6.11041518, 10.0] y = [.76, 0.62323, 0.49...
import torch import torch.nn as nn import torch.nn.functional as F from collections import OrderedDict from environment_model.mini_pacman.model.basic_blocks import BasicBlock from model_helpers.flatten import Flatten from model_helpers.model_initialization import xavier_weights_init_relu class MiniPacmanEnvModel(tor...
from .resnet32 import *
import requests import bs4 # res = requests.get('http://example.edu/') # print(type(res)) # print(res.text) # soup = bs4.BeautifulSoup(res.text, 'lxml') # title_tag_list = soup.select('title') # print(title_tag_list[0].getText()) # res = requests.get('https://en.wikipedia.org/wiki/Room_641A') # soup = bs4.BeautifulS...
from dataclasses import dataclass from ..base.base_config import BaseConfig @dataclass class ApiConfig(BaseConfig): base_url: str = None doc_url: str = None is_debug: bool = None version: str = None port: int = None origins: str = None authorizations: any = None security: any = None
from flask_cache import Cache from threading import Lock from collections import OrderedDict from openslide import OpenSlide import openslide from openslide.deepzoom import DeepZoomGenerator from utils.config import get_app_configurations class SlideCache(object): def __init__(self, cache_size, dz_opts): ...
from __future__ import division, print_function, absolute_import import tensorflow as tf from tensorflow.python.framework import ops from tensorflow.python.ops import control_flow_ops from tensorflow.contrib.layers.python.layers.optimizers import _clip_gradients_by_norm FLAGS = tf.app.flags.FLAGS class NNModel(object...
from pathlib import Path from PySide2 import QtCore, QtWidgets, QtGui from transectdata import TransectData from drawingdata import DrawingDataList from .gridmodel import QImageGridModel, UserRoles from .merging import MergedIndexes from .delegates import ImageDelegate class QImageGridView(QtWidgets.QTableView): ...
"""Module engine""" import asyncio import importlib import logging from hat import util from hat.event.server import common from hat.util import aio mlog = logging.getLogger(__name__) class ModuleEngineClosedError(Exception): """Error signaling closed module engine""" async def create(conf, backend_engine):...
from sqlalchemy import or_, select from ..core.errors import Err, Exc, Ok from . import Task class BaseSqlTask(Task): target_table_exists = None _target_db = None @property def target_db(self): return self.connections[self._target_db] def run(self): return self.execute_steps() ...
# Generated by Django 2.1.5 on 2019-01-24 18:43 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('categories', '0001_initial'), ] operations = [ migrations.AlterField( model_name='category', name='slug', ...
from mantid.simpleapi import DeleteWorkspace, LoadDiffCal from mantid.api import AnalysisDataService import pooch def get_file(): return pooch.create( path=pooch.os_cache('test-loaddiffcal'), base_url='https://public.esss.dk/groups/scipp/ess/powgen/1/', registry={ 'PG3_FERNS_d4...
# Copyright (c) 2015 Michel Oosterhof <michel@oosterhof.net> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistributions of source code must retain the above copyright # notice, th...
import math from collections import namedtuple from operator import itemgetter # Generate samples # import json; import random as rnd; rnd.seed(); # with open('divide_and_conquer/data/example.json', 'w') as f: # json.dump({ # 'points': [ # { # 'x': rnd.randint(0, 1000000), # ...
import csv import json import re from pymongo import MongoClient from os import path, environ from datetime import datetime import smtplib import requests import math import time class Coronavirus(): # constructor def __init__(self): # read config, if config.json file is not available then try OS envir...
from distutils.core import setup setup( name='py-config-env', version='1.0', description='Read environment variables from configuration file, accessible from a dictionary.', license='BSD', author='Aaron Estrada Poggio', author_email='aaron.estrada.poggio@gmail.com', url='https://github.com/...
# -*- coding: utf-8 -*- def main(): from bisect import bisect_right from itertools import combinations import sys input = sys.stdin.readline n, k, p = map(int, input().split()) a = list(map(int, input().split())) ans = 0 for ki in range(k + 1): group1 = list() group2...
__version__ = "0.4.34"
from ncclient import manager import sys from lxml import etree import xmltodict import collections import time from functools import partial def is_instance(list_or_dict): """Converts dictionary object to list""" if isinstance(list_or_dict, list): make_list = list_or_dict else: ...
""" Cog that looks for new video of a channel if a new video comes then posts a notification """ import json import xml.etree.ElementTree as ET from datetime import datetime import aiofiles import discord from aiohttp import request from discord.ext import tasks from discord.ext.commands import Cog from config import B...
# https://leetcode.com/problems/remove-outermost-parentheses/ # Easy (84.8%) # Total Accepted: 4,648 # Total Submissions: 5,481 class Solution(object): def removeOuterParentheses(self, S): """ :type S: str :rtype: str """ length = len(S) if length == 0: ...
# -*- coding: UTF-8 -*- #------------------------------------------------------------------------------- # Name: xgrablib.py # Purpose: Create a sqlite database from a xGRAB-file and the other way # around. # Author: Kay Warrie # # Created: 28/04/2014 # Copyright: (c) Kay Warrie 2014 ...
# Copyright (c) 2013 Huan Do, http://huan.do import ast from utils import value_of class ConstantChanger(ast.NodeTransformer): def __init__(self, env): self.env = env def visit_Constant(self, node): if not hasattr(node, 'isdoc'): value = value_of(node) return ast.Nam...
def title_str(str_): original_uppers = [] on_upper = False upper_start = None upper_end = None for i, character in enumerate(str_): if character.isupper(): if on_upper: upper_end += 1 else: on_upper = True upp...
from helpers.swp_reservoir_scraper import aggregate_scraped_data __author__ = 'anthonymendoza' from rest_framework import status from rest_framework.decorators import api_view from rest_framework.response import Response from django.apps import apps from water_store.serializer_register import ReservoirSerializer from...
# import the necessary packages from __future__ import print_function from imutils.video.pivideostream import PiVideoStream from imutils.video import FPS from picamera.array import PiRGBArray from picamera import PiCamera import argparse import imutils import time import cv2 # construct the argument parse and parse t...
# This script automates a query into historic news articles and fetches headline data # from Helsingin Sanomat news archive at https://www.hs.fi/arkisto/ # Only the headlines and their dates of publishing are returned. # You can search for names, words etc to appear in the articles and select how many headlines you wan...
import pyrax # pylint: disable=3rd-party-module-not-gated class Authenticate: def __init__(self, username, password, region, **kwargs): cloud_kwargs = {"password": password, "region": region} pyrax.settings.set("identity_type", kwargs.get("identity_type", "rackspace")) pyrax.settings.set(...
#!/usr/bin/python # SPDX-License-Identifier: MIT # Copyright (c) 2016-2020 Michael Purcaro, Henry Pratt, Jill Moore, Zhiping Weng import cherrypy import jinja2 import os import sys import uuid import requests import numpy import json import gzip from api.autocomplete_ws import AutocompleteWebService from api.cart...
import random import pandas as pd raw_train_file = '/home/lixiangyu/Desktop/20003001#2017-03.csv' # raw_train_file = '/home/lixiangyu/Desktop/20180104.csv' # processed_train_file = '/home/lixiangyu/Desktop/test_data.csv' processed_train_file = '/home/lixiangyu/Desktop/train_data.csv' # processed_train_file = '/home/l...
#!/usr/bin/env python3 # Nick Stucchi # 03/23/2017 # Filter out words and replace with dashes def replaceWord(sentence, word): wordList = sentence.split() newSentence = [] for w in wordList: if w == word: newSentence.append("-" * len(word)) else: newSentence.append(...
import os import numpy as np import h5py import faiss import sys # # Get parameters # dbase = "deep-1B" nlist = 2097152 qbits = 768 nbits = 512 nt = 83886080 is_f16 = True num_records = 1000000000 output_dir = "/mnt/localdisk2/George/Projects/BigANN/gemini/indexes" # # Form the path to the source files # resources_pa...
import unittest import os from programy.context import ClientContext from programytest.aiml_tests.client import TestClient class PatternBotTestClient(TestClient): def __init__(self): TestClient.__init__(self) def load_configuration(self, arguments): super(PatternBotTestClient, self).load_c...
from __future__ import print_function, division import os import glob import pandas as pd import numpy as np class bcolors: HEADER = '\033[95m' OKBLUE = '\033[94m' OKGREEN = '\033[92m' WARNING = '\033[93m' FAIL = '\033[91m' ENDC = '\033[0m' BOLD = '\033[1m' UNDERLINE = '\033[4m' def ...
# -*- coding: utf-8 -*- # ____ __ __ ___ _ _ _ # |_ /___ / _|/ _|/ __| (_)___ _ _| |_ # / // -_) _| _| (__| | / -_) ' \ _| # /___\___|_| |_| \___|_|_\___|_||_\__| # """Zeff Validator.""" __author__ = """Lance Finn Helsten <lanhel@zeff.ai>""" __copyright__ = """Copyright © 2019, Ziff, Inc. — All Rig...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import torch from ..lazy import LazyTensor class NonLazyTensor(LazyTensor): def __init__(self, tsr): """ Not a lazy tensor Args: - ...
import html import os import re from typing import Iterable import playwright import playwright.async_api from flanautils import Media, MediaType, OrderedSet, Source from flanaapis.exceptions import InstagramMediaNotFoundError from flanaapis.scraping import constans INSTAGRAM_BASE_URL = 'https://www.instagram.com/' ...
from flask import Flask, request, redirect, render_template, Markup app = Flask(__name__) # app._static_folder = "/home/vijay/hackathon/lahacks/uber_squats" import cv2 import numpy as np import pyzbar.pyzbar as pyzbar import subprocess @app.route('/challenge', methods = ['POST']) def challenge(): username = re...
from .User import User
#!/usr/bin/env python #该脚本通过单线程进行下载图书排名信息的调用 from atexit import register from re import compile from threading import Thread from time import ctime from urllib import urlopen as uopen REGEX = compile(b'#([\d,]+) in Books ') AMZN = 'http://amazon.con/dp/' ISBNs = { '0132269937' : 'Core Python Programming', '0...
# -*- coding: utf-8 -*- """ Copyright (C) 2018, MuChu Hsu Contributed by Muchu Hsu (muchu1983@gmail.com) This file is part of MIT license <https://opensource.org/licenses/MIT> """ import logging from bpn.gui.frame import Application def entry_point(): #logging 層級設定 logging.basicConfig(level=logging.INFO) ...
# -*- coding: utf-8 -*- """An automatic command that handles subcommand dispatch. Functions: main: The console script entry point set by autodetected CLI scripts. """ import logging import sys import types # noqa: F401 pylint: disable=unused-import import typing # noqa: F401 pylint: disable=unused-import from ...
from sys import stdin, stdout for _ in range(int(input().strip())): d, n = map(int, stdin.readline().strip().split()) nums = list(map(int, stdin.readline().strip().split())) remFreqs = [0] * d partSum = 0 for idx in range(n): partSum += nums[idx] remFreqs[partSum % d] += 1 res =...
import glob import os import cv2 import numpy def get_gray_resized_image(image_path): image = cv2.imread(image_path) gray_image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) gray_resized_image = cv2.resize(gray_image, (500, 500)) return gray_resized_image def get_label(path): return int(path.split...
import boto3 import pandas as pd from fastparquet import write as pq_write from batch.data_util import Column from batch.util import getenv columns = [ Column("key"), Column("last_modified", dtype="datetime64[ns, utc]"), Column("size", dtype="int64"), ] def _s3_object_summary_to_list(obj_s): """Retu...
from django.shortcuts import render from rest_framework.views import APIView from rest_framework.response import Response from .models import Company # Create your views here. def company_article_view(request): return render(request,'charts/plotly.html',{}) class ChartData(APIView): authentication_classes=[] ...
# Copyright The IETF Trust 2021, 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 o...
#!/usr/bin/env python """ Read a maf file and write out a new maf with only blocks having all of the passed in species, after dropping any other species and removing columns containing only gaps. This will attempt to fuse together any blocks which are adjacent after the unwanted species have been dropped. usage: %prog...
import secrets import codec import api from collections import defaultdict # TODO LAB2 annotations class DummyServer: """A dummy server. Useful for testing.""" def __init__(self, database=None): if database is None: self._storage = DummyStorage() else: self._storage =...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- ''' @author: rakshit This file generates objects with train and testing split information for each dataset. Each dataset has a predefined train and test partition. For more info on the partitions, please see the file <datasetSelections.py> ''' import os import sys import...
from django.urls import path from .views import index urlpatterns = [ path('',index), path('login',index), path('user',index), path('register',index) ]
from rest_framework.response import Response from rest_framework.views import APIView from rest_framework.viewsets import GenericViewSet, mixins from telegram.api.serializers import LiveSubscriptionSerializer, SubscriptionDetailSerializer from telegram.models import LiveSubscription from accounts.permissions import A...
g_login_text = {'username_placeholder':'Nimi','password_placeholder':'Salasana', 'username_text':'Käyttäjä', 'password_text':'Salasana'} g_form_placeholders = {'sex':'Sukupuoli', 'color':'Väri', 'specie':'Laji', 'race':'Rotu', 'name':'Nimi', 'official_name':'Virallinen nimi', 'birthday':'Syntymäpäivä'...
# Copyright 2021 Zilliz. 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 agree...
from datetime import date from django.db import models try: import simplejson as json except ImportError: import json class BatchPushItem(models.Model): batch = models.ForeignKey('Batch') version = models.ForeignKey('reversion.Version') last_tried = models.DateTimeField(null=True) success = m...
#!/usr/bin/env python ''' This action module uploads files on WN to DFC. ''' import os import glob from DIRAC import S_OK, S_ERROR, gLogger, exit from DIRAC.Core.Base import Script Script.parseCommandLine() from DIRAC.ConfigurationSystem.Client.Helpers import Registry from DIRAC.Core.Security.ProxyInfo import getPr...
""""Generate stereo baselines for kitti evaluation""" import warnings from collections import defaultdict import numpy as np from ..utils import get_keypoints def baselines_association(baselines, zzs, keypoints, keypoints_right, reid_features): """compute stereo depth for each of the given stereo baselines"""...
# # This file is a part of the normalize python library # # normalize is free software: you can redistribute it and/or modify # it under the terms of the MIT License. # # normalize is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FI...
# from __future__ import annotations # import os # import tempfile # from typing import Type # import pytest # from snapflow.storage.data_records import MemoryDataRecords, as_records # from snapflow.storage.db.api import DatabaseApi, DatabaseStorageApi # from snapflow.storage.db.mysql import MysqlDatabaseStorageApi #...
import requests from audiobooker import AudioBook, BookAuthor from audiobooker.scrappers import AudioBookSource class StephenKingAudioBook(AudioBook): base_url = "https://stephenkingaudiobooks.com/" def parse_page(self): author_name = "Stephen King" title = self.soup.find("h1", {"class": "tit...
from google.oauth2.credentials import Credentials from google.auth.transport.requests import Request from google.auth.exceptions import RefreshError from logging import getLogger as gL LOGGER = gL(__name__) def checkCredentials( CREDENTIALS: Credentials, TOKEN_FILE: str = "token.json", *args, **kwargs ) -> No...
from flask import Blueprint, request from classes import ApiResponse from classes import ThreadsManager from crawlers import CrawlerRegistry from database import CrawlerCacheModel from constants import get_default_city_name query_blueprint_name = 'query' query_handler_blueprint = Blueprint(query_blueprint_name, __nam...
from __future__ import print_function from __future__ import unicode_literals from __future__ import division from __future__ import absolute_import from future import standard_library standard_library.install_aliases() # NOQA import argparse import logging import sys import numpy as np import matplotlib.pyplot as pl...
import urllib.request from time import sleep page = urllib.request.urlopen(r'http://www.pudim.com.br/') text = page.read().decode('utf8') stretch = str(input('Write a term you want to search in the link: ')).strip() size = len(stretch) start_pos = text.find(stretch) final_pos = start_pos + size print('Searching stri...
""" distribution.py Author: Eric Goodney Credit: Mr. Dennison, Patrick, (https://stackoverflow.com/questions/14032521/python-data-structure-sort-list-alphabetically),(https://developers.google.com/edu/python/lists) Assignment: Write and submit a Python program (distribution.py) that computes and displays the distrib...
""" Recursive Directory Contents """ #***************************************************************************** # Copyright (C) 2014 Volker Braun <vbraun.name@gmail.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published...
# REQUIRES: bindings_python # RUN: %PYTHON% %s 2> %t | FileCheck %s # RUN: cat %t | FileCheck --check-prefix=ERR %s import circt from circt import msft from circt.dialects import hw, seq import mlir.ir as ir import sys with ir.Context() as ctx, ir.Location.unknown(): circt.register_dialects(ctx) i32 = ir.Integer...
from __future__ import absolute_import, division, print_function from abc import ABCMeta, abstractproperty, abstractmethod from future.utils import with_metaclass from bingads.v12.bulk.entities import BulkError from bingads.v12.internal.bulk.bulk_object import _BulkObject class _BulkEntityIdentifier(with_metaclass(...
import numpy as np import copy import os import sys import time import shutil import re import signal import subprocess import numpy as np import math from random import randint, sample from Policy import * SWITCH_STAGE_THRESHOLD = 10 MAX_TXN_BUF_SIZE = 32 class record: def __init__(self, idx, reward): s...
import pytest, os import numpy as np from ..algorithms.baseline_algorithm import baseline_rechunk from ..exp_utils import create_input_chunks, create_empty_dir, verify_results from ..algorithms.utils import get_file_manager from ..algorithms.clustered_writes import clustered_writes # different test cases @pytest.fi...
# -*- coding: utf-8 -*- """ Created on Thu Mar 24 18:59:16 2022 https://github.com/leomcg108/FinData-Extraction @author: Leo """ from os import scandir, getcwd, path import csv import datetime as dt import pickle import pandas as pd import yfinance as yf import matplotlib.pyplot as plt class FinD...
from os.path import join import argparse import os import numpy as np import pandas as pd from PIL import Image from tqdm import tqdm from sklearn.decomposition import PCA import torch from torch.utils.data.dataset import Dataset from torchvision import transforms, models LAYERS_RES18 = [ lambda m: m.layer...