text
stringlengths
3.07k
12.6k
# Copyright 2013-2020 <NAME> """ Upload data to OpenWeatherMap http://openweathermap.org Thanks to <NAME> for the dewpoint, longitude, and radiation fixes. [StdRESTful] [[OpenWeatherMap]] appid = APPID station_id = STATION_ID """ # FIXME: set the station lat/lon/alt using [PUT]/stations/{:id} ...
# -*- coding: utf-8 -*- import hashlib import hmac import warnings import six from six.moves.urllib.parse import quote, urlparse try: from furl.omdict1D import omdict HAS_FURL = True except ImportError: # pragma: no cover HAS_FURL = False from . import compat ALLOWED_METHODS = ('GET', 'POST', 'PUT', 'DE...
"""Application exporter""" import os import time from prometheus_client import start_http_server, Gauge import requests import json import logging from pathlib import Path # Read log level as environment variable (by default INFO) LOGLEVEL = os.environ.get('LOGLEVEL', 'INFO').upper() assert (LOGLEVEL in ['DEBUG', 'IN...
#!/usr/bin/env python3 import requests import json import json # install pyyaml import yaml import logging import time import os import sys from central import auth logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) # serial = "CM0300585" # iperf_server = "172.16.58.3" account = "default" ...
#!/usr/bin/env python3 """ Compile CUDA source code and setup Python 3 package 'nipet' for namespace 'niftypet'. """ import logging import re import sys from pathlib import Path from textwrap import dedent from setuptools import find_packages from setuptools_scm import get_version from skbuild import setup from nifty...
from __future__ import print_function import json from .protocol import Protocol from .unit import Unit from .container import WellGroup import argparse import sys if sys.version_info[0] >= 3: string_type = str else: string_type = basestring ''' :copyright: 2015 by The Autoprotocol Development Team, see A...
# This module adds a monkey patch to ReplayBuffer, such that octrees are # directly supported and there is no extra RAM -> VRAM -> RAM overhead # Note: needs to be included before `from stable_baselines3.common.buffers import ReplayBuffer` in the module that uses this from stable_baselines3.common.buffers import Repl...
from collections import defaultdict import logging from fulfilment import FulfilmentDispatcher from utils import Wikipedia from threading import Condition from topomap import TOPO_NODES class SimulationSingleton: # Here will be the instance stored. __instance = None @staticmethod def getInstance(): ...
import multiprocessing from time import perf_counter import click import pandas as pd import numpy as np from rfidam.chains import estimate_rounds_props, estimate_id_probs from rfidam.protocol.symbols import TagEncoding, DR from rfidam.scenario import parse_scenario, mark_scenario from rfidam.simulation import ModelP...
from django.db import models from django.core import serializers from django.utils.timezone import now import uuid import json # from django.conf import settings # Create your models here. # <HINT> Create a Car Make model `class CarMake(models.Model)`: # - Name # - Description # - Any other fields you would li...
from json import loads from os.path import join from requests import get from yapf.yapflib.yapf_api import FormatCode def _identifier(name): """ :param name: string :return: name in lower case and with '_' instead of '-' :rtype: string """ if name.isidentifier(): return name retur...
from enum import Enum from typing import Callable import tensorflow as tf from tensorflow.keras import layers from flows.flowbase import FlowComponent Layer = layers.Layer Conv2D = layers.Conv2D class LogScale(Layer): def build(self, input_shape: tf.TensorShape): shape = [1, input_shape[-1]] se...
#!/usr/bin/env python3 import sys import os from cyvcf2 import VCF from collections import defaultdict from argparse import ArgumentParser import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt def main(): args = get_args() len_dict = defaultdict(list) ignored_chroms = args.filter.split("...
#! /usr/bin/env python3 """ This is a "docstring". It describes the file at a high level. The Python infrastructure has doctools, which can read a source file and generate documentation, class relationship diagrams, etc. from it. In this way, you you don't have to (try to) maintain code and documentation separately (...
# CYBERUSERBOT - Luciferxz # """ Evaluator """ import asyncio from getpass import getuser from os import remove from sys import executable from userbot import CMD_HELP, BOTLOG, BOTLOG_CHATID from userbot.events import register from userbot.cmdhelp import CmdHelp # ██████ LANGUAGE CONSTANTS ██████ # from userbot.lan...
from __future__ import annotations import os import pandas as pd import streamlit as st st.set_page_config(layout="wide") class Pager: """Generates cycled stepper indices.""" def __init__(self, count) -> None: self.count = count self.current = 0 @property def next(self) -> int: """Fetches next index."...
import ftplib import logging import re import socket import ssl import tempfile from contextlib import contextmanager, suppress from datetime import datetime from functools import partial from ipaddress import ip_address from os.path import basename, join from time import sleep from typing import Dict, List, Optional f...
import abc import uuid from collections import namedtuple from enum import Enum import six from dagster import check from dagster.core.definitions.schedule import ScheduleDefinition, ScheduleDefinitionData from dagster.core.serdes import whitelist_for_serdes @whitelist_for_serdes class ScheduleStatus(Enum): RUN...
#!/usr/bin/env python3 import bluetooth import argparse import time import sys from PIL import Image, ImageOps, ImageEnhance from tqdm import tqdm import qrcode from cairosvg import svg2png from io import BytesIO parser = argparse.ArgumentParser(description="Print an image to a Peripage A6 via Bluetooth") parser.add_a...
# -*- coding: utf-8 -*- """ Created on Fri Apr 3 10:05:00 2020 Refactor when confirm that it works @author: willi """ import random import math import copy learning = .1 loop_time = 5000 # always one layar input_layer = [2, 1] expected_outputs = [0.1, 0] weights_from_input = [] weights_hidden_to_hidden = [] weigh...
#!/usr/bin/python3 # -*- coding: utf-8 -*- """ OLIVIA MFSK Modulator @author: <NAME> Source code is lightly commented for clarity. Please read the document to better understand the various processes. """ # Libraries import os, sys import numpy as np import sounddevice as sd from numpy.fft import fft ...
"""empty message Revision ID: <KEY> Revises: Create Date: 2019-03-20 18:15:34.208187 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '<KEY>' down_revision = None branch_labels = None depends_on = None def upgrade(): # ### commands auto generated by Alembi...
import datetime from pathlib import Path from typing import Optional, Union import h5py import numpy as np import pandas as pd from ndx_events import Events from nwb_conversion_tools import NWBConverter, SpikeGLXRecordingInterface, SpikeGLXLFPInterface from nwb_conversion_tools.basedatainterface import BaseDataInterfa...
import pickle import importlib import os import argparse import numpy as np from datasets.datasets import get_dataloader from tqdm import tqdm from utils.tester import Tester from utils.utils import get_data_in_np_array, transform_pc, get_num_key_points,\ get_output_file_name def get_args(): parser = argpar...
import salabim as sim import pytest def test_queue_iter(): env = sim.Environment() x = [sim.Component(name="x.") for _ in range(20)] q = sim.Queue("q", fill=x[:10]) collect = [] for c in q: collect.append(c) if c == x[5]: x[2].leave(q) x[3].leave(q) ...
from __future__ import print_function import logging import json # --------------- Helpers that build all of the responses ---------------------- def build_speechlet_response(title, output, reprompt_text, should_end_session): return { 'outputSpeech': { 'type': 'PlainText', 'text': ...
import json import math class TreeNode(object): # Generic tree node. def __init__(self, player='x', children=None, _from='', _to='', name='node', score=0, n_plays=0, n_wins=0, parent=None): if name == 'node': self.name = "%s:%s=>%s" % (player, _from, _to) else: ...
import sys from pathlib import Path from collections import namedtuple import datetime as dt import numpy as np import re import os import multiprocessing from functools import partial from itertools import repeat import pandas as pd from .EC_DataLoader.CreateCV import create_CVs from .HER.HER_analyze_scans import HE...
#!/usr/bin/env python import sys import numpy as np import argparse def read_pdb_protein(file_name): fp = open(file_name) lines = fp.readlines() fp.close() protein = dict() for line in lines: if line[0:6] != "ATOM ": continue res_name = line[17:20].strip() res...
from tkinter import filedialog from tkinter import ttk import tkinter.messagebox from tkinter import * import os import threading from ttkthemes import themed_tk as tk from mutagen.mp3 import MP3 import time from pygame import mixer root = tk.ThemedTk() #root.geometry("555x290") root["bg"]="#195FBA" #set...
## TODO: boilerplate ## from distutils.command.build import build from distutils.command.build_ext import build_ext from setuptools import setup, Command, Extension, find_packages from codecs import open import distutils.errors import distutils.ccompiler import distutils.sysconfig import contextlib import os import...
""" This is a helper class providing a pilight-daemon in python. This daemon just simulates the behavior of the real pilight-daemon and is used for testing only. Of cause only a few important commands are supported. This is a very hackish synchronous daemon that is not an example for good socket s...
# Volatility # Copyright (C) 2007-2013 Volatility Foundation # # This file is part of Volatility. # # Volatility is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your o...
# # @ 2021. TU Dortmund University, # Institute of Energy Systems, Energy Efficiency and Energy Economics, # Research group Distribution grid planning and operation # import pickle import utilities import numpy as np import matplotlib.pyplot as plt # berechnet auf Basis der Ladezeiten die Anzahl der ladenden Fahrezue...
from __future__ import print_function import numpy as np import os import os.path import sys import random import math from pprint import pprint from itertools import combinations import torch # from torch.autograd import Variable """ script to compute tripelts """ def distance(vectors): return -2 * np.matmul(v...
import sys import os import time from numpy.random import choice from bet_database import SqlMaker # noqa: E402 from surebets_calculator import surebet # noqa: E402 import threading import platform # Exit dialog if the user hits Ctrl + c def exitDialog(): print("Are you sure you don't want to make more money? \...
# -*- coding: utf-8 -*- """ Created on Fri Mar 12 01:06:02 2021 @author: Isaac """ import cv2 import numpy as np from skimage import morphology from tensorflow.keras.models import load_model from tensorflow.keras.preprocessing import image import os class ProcesarVideo(): image=[] image_1=[] ...
#!/usr/bin/env python from argparse import ArgumentParser from copy import deepcopy import pandas as pd import numpy as np import os.path as op import os import boutiques.creator as bc from bids.layout import BIDSLayout import nibabel as nib import metrics import noise def loadImage(path): im = nib.load(path) ...
import numpy as np from math import floor, pow, sin, sqrt def ackley(X, Y): x = np.array([X, Y]) cost = np.zeros(x.shape[1:]) a = 20.0 b = 0.2 c = 2.0 * np.pi cost = -a * np.exp(-b * np.sqrt(0.5 * (x[0]**2 + x[1]**2))) - np.exp( 0.5 * (np.cos(c * x[0]) + np.cos(c * x[1]))) + a + np.exp(...
#! /usr/bin/env python # -*- coding: utf-8 -*- """ Prototype code for annotating a VCF with ExAC data via API Design Note: I generally prototpye programs purely functionally, then go back and build classes where they make sense. For example, in this case using a variant object could streamline the initilization and c...
#!/usr/bin/env python3 import os import re import glob import time import shutil import tempfile import fileinput import subprocess from typing import Union # Number of benchmark iterations to run ITERATIONS = 60 # Confidence interval to present PRECISION_PERCENT = 50 # Number of throwaway iterations to run befor...
import torch from typing import Callable, Type, Union, Tuple, List import numpy as np import matplotlib.pyplot as plt from stpy.borel_set import BorelSet, HierarchicalBorelSets from stpy.kernels import KernelFunction from stpy.point_processes.poisson_rate_estimator import PoissonRateEstimator from stpy.point_processes....
import argparse import sys from os import makedirs from os.path import join import joblib import numpy as np from sklearn.metrics import euclidean_distances sys.path.append("..") from topological_data_analysis.geometric_anomaly_detection import ( # noqa: E402 grid_search_gad_annulus_radii, ) from word_embedding...
#!/usr/bin/env python """Simple parsers for configuration files.""" import logging from grr.lib import lexer from grr.lib import parsers from grr.lib import rdfvalue from grr.lib import utils from grr.parsers import config_file class LSBInitLexer(lexer.Lexer): """Parse out upstart configurations from init scripts....
## -*- coding: utf-8 -*- import numpy as np import cv2 import torch import numpy as np from resnet_model import resnext50_32x4d import cv2 device = torch.device('cuda:0' if torch.cuda.is_available() else 'cpu') resnet = resnext50_32x4d(pretrained=None, num_classes = 2).to(device) resnet.eval() checkpoin...
#This is like ops.py, but for larger compositions of graph nodes. #TODO: could use a better name from hypergan.util.ops import * #TODO Remove def build_reshape(output_size, nodes, method, batch_size, dtype): node_size = sum([int(x.get_shape()[1]) for x in nodes]) dims = output_size-node_size if(method == '...
import sys sys.path.append('..') from vanilla_mlp import MLP from data.generate_data import GenerateData import tensorflow as tf import numpy as np import pandas as pd import ast import math import time train_model = False eval_model = False predict = True def write_result(): pass def normalize(x, min, max):...
# -*- coding: utf-8 -*- import math import collections import torch import numpy as np from . import system from . import fields from . import integrators class Memory(object): def __init__(self, alpha, alpha_lim=0.05): self.alpha = alpha self.alpha_lim = alpha_lim self.maxlen = int(math...
''' Operaciones para procesar las imágenes en base al umbral ingresado ''' import math from os import listdir, remove, path from PIL import Image from tkinter import messagebox imgGray = Image.open("img/machu_picchu.jpg").convert("L") weight, height = imgGray.size average = [ [0.1,0.1,0.1], [...
# Video Synthesis via Transform-Based Tensor Neural Network # <NAME> # 8/4/2020 # <EMAIL> import numpy as np import DefineParam as DP import os import math from time import time # Input: Parameters pixel_w, pixel_h, ...
from argparse import ArgumentParser import os import cv2 import numpy as np from glob import glob import torch import pytorch_lightning as pl from pytorch_lightning import Trainer, loggers from torchsummary import summary import torch.nn.functional as F from autoencoder import Autoencoder from views import views from...
# Copyright 2016 <NAME> # 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 applic...
#!/usr/bin/env python # This document is part of CrowdProjects # https://github.com/skytruth/CrowdProjects # =========================================================================== # # # Copyright (c) 2014, SkyTruth # All rights reserved. # # Redistribution and use in source and binary forms, with or without...
""" Module that contains interface code with JoSIM """ from typing import List, Optional from numpy import interp from sys import exit import re import attr from pyjosim import Input, AnalysisType, Matrix, Output, Simulation, ParameterName, Trace, Parameter class CircuitSimulatorOuput: """ Property class for o...
import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' import numpy as np from PIL import Image import matplotlib.pyplot as plt from tensorflow import keras from tensorflow.keras.models import Model, Sequential from tensorflow.keras.layers import Input, Dense, Reshape, Flatten, Dropout from tensorflow.keras.layers import...
#!/usr/bin/env python import os import csv import torch as th import torch.nn as nn import torch.nn.functional as F from torch import Tensor as T from torch.autograd import Variable as V from torch.optim import Adam, SGD from torchvision.datasets.folder import default_loader from torchvision import transforms from to...
from toil.job import Job from toil.common import Toil from toil.lib.docker import apiDockerCall from toil.wdl.wdl_functions import generate_docker_bashscript_file from toil.wdl.wdl_functions import select_first from toil.wdl.wdl_functions import sub from toil.wdl.wdl_functions import size from toil.wdl.wdl_functions im...
import os import glob import shutil import re import tarfile import zipfile import requests # setup struct for tids base_titleid = '0005000' titleids = {'game': base_titleid + '0', 'demo': base_titleid + '2', 'dlc': base_titleid + 'C', 'update': base_titleid + 'E'} # setup temp folder root = os.getcwd() t...
import math from typing import Callable, Dict, List from librosa.core import time_to_samples, tone import numpy as np from scipy.signal import correlate, find_peaks, hilbert # set fft window size # this corresponds to a resolution of about 2% of the sampling frequency _fft_width = 512 def _get_window_size_ms(dur...
# coding=utf-8 import logging import struct from ghidra.util.task import TaskMonitor from ghidra.program.model.symbol.SourceType import USER_DEFINED from ghidra.app.util.demangler import DemangledException from ghidra.app.util.demangler.gnu import GnuDemangler from ghidra.program.model.listing.CodeUnit import PLATE_COM...
# Standard Library import logging # Third-Party from django_fsm import TransitionNotAllowed from pprint import pprint from django.shortcuts import render from django.views.decorators.csrf import csrf_exempt from django.conf import settings from .models import SfConvention, SfAward, SfChart, SfGroup, SfPerson, SfGr...
# Copyright 2022 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...
''' // // Date: 02/18/2021 // FileName: CommandResponse.py // // Engineer: <NAME> // Contact: <EMAIL> // // Description: will output appropriate response based on incoming command will handle accessing the database for sensor data ''' import sys # translates to the Home-Suite-Home/Source director...
from sklearn.model_selection import KFold from sklearn.utils import shuffle from sklearn import preprocessing import pandas as pd import numpy as np import os import sys from random import shuffle import pickle import json def df_split(df, month): trainData = df.iloc[:-month] testData = df.iloc[-month:] ...
from django.http import HttpResponse, HttpResponseRedirect, Http404 from django.shortcuts import render from django.urls import reverse from cotidia.cms.models import Page, PageTranslation from cotidia.cms.conf import settings def get_page( request, model_class=Page, translation_class=PageTra...
# -*- coding: utf-8 -*- # Copyright: (c) 2016-2017, <NAME> <<EMAIL>> # Copyright: (c) 2017, <NAME> <<EMAIL>> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type import os from random impor...
import numpy as np import tensorflow_hub as hub import pandas as pd from dataclasses import dataclass model = None blocking_file = "..\data\X2_blocking_keys.csv" clusters_file = "..\data\clustered_x2.csv" @dataclass(frozen=True) class Record: """ Data structure representing record titles. """ id: int...
# -*- coding: utf-8 -*- """ Created on Sat Sep 29 19:15:42 2018 @author: Kotori_Y @WEIBO: Michariel E-mail: <EMAIL> μ’sic Forever♪♪♪♪♪♪♪♪♪ I love Kotori forever(・8・) """ from selenium import webdriver import time import re driver = webdriver.Firefox(executable_path = r'~/geckodriver.exe') def login(): driver.g...
from bs4 import BeautifulSoup import requests import os import pathlib import re import csv N = 100 # scrapes webpage's search results # saves a subset of the webpage, and images to a folder def main(): #test conditions # url = 'URL GOES HERE' # i = 1 # scrape_how_to(url, i) # lo...
# Copyright (c) 2019 <NAME> <<EMAIL>> # ISC License <https://opensource.org/licenses/isc> import enum import typing import attr import pytest import jsonschema from hypothesis import given, settings, HealthCheck from hypothesis.strategies import characters import file_config from .strategies import config, config_v...
# # 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...
""" Functions for determining the state of the system clock. See clock_state() below. """ import pscheduler import datetime import ntplib import pytz import tzlocal # The ntp_adjtime code is the only bit of BWCTL (actually BWCTL2) that # survived into pScheduler. from ctypes import * from ctypes.util import find_li...
'''Python file that loads and plots results of PDE''' import matplotlib.pyplot as plt import numpy as np import sys from PIL import Image def get_matrix(filename, mat_size): '''Reads a given file and returns a matrix of mat_size''' retval = np.zeros(mat_size) with open(filename, 'r+') as in_file: ...
import pathlib import json import pytest from weedcoco.importers.voc import main TEST_DATA_DIR = pathlib.Path(__file__).parent / "voc_data" TEST_VOC_DIR = TEST_DATA_DIR / "VOC" TEST_IMAGE_DIR = TEST_DATA_DIR / "images" AGCONTEXT = { "bbch_growth_range": "na", "camera_angle": 12, "camera_fov": "variable",...
# lab05Tests.py Tests for lab05, UCSB CS20, <NAME>, 04/26/2016 import unittest from lab05Funcs import * class TestLab05Functions(unittest.TestCase): # tests for isList def test_isList1(self): self.assertEqual( isList(3), False) def test_isList2(self): self.assert...
""" author: <NAME> email: <EMAIL> license: BSD Please feel free to use and modify this, but keep the above information. Thanks! """ import numpy as np from math import sin, cos, asin, atan2, sqrt def RotToRPY_ZXY(R): phi = asin(R[1,2]) theta = atan2(-R[0,2]/cos(phi),R[2,2]/cos(phi)) psi = atan2(-R[1,0]/co...
import numpy as np # This function maps an index in the range [0, count*(count - 1) // 2] # to a tuple of integers in the range [0,count). The mapping will cover # all pairs if you use all indices between [0, count*(count - 1) // 2]. def pair_to_index(p1, p2): if (p1 < p2): p1, p2 = p2, p1 return (p1 * (p1 - ...
import wx import glob import eyed3 class EditDialog(wx.Dialog): def __init__(self, mp3): title = f'Редактирование {mp3.tag.title}' super().__init__(parent=None, title=title) self.mp3 = mp3 self.main_sizer = wx.BoxSizer(wx.VERTICAL) self.title = wx.TextCtrl( sel...
"""An implementation of simple arithmetic calculator using a grammar based on BNF (Backus-Naur-Form) notation. The grammar is: expr ::= expr1 "+" expr1 | expr1 "-" expr1 | expr1 expr1 ::= expr2 "*" expr2 | expr2 "/" expr2 | expr2 expr2 ::= "-" expr3 | expr3 expr3 ::=...
""" Pygments regex lexer tests ~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import time import pytest from pygments.token import Keyword, Name, String, Text from pygments.lexers.perl import PerlLexer @pyte...
import vk import time # Log in using VK... (read more in VK API documentation) app_id = '' user_login = '' user_password = '' # ... or using access token access_token = '' # Depending on your choice, use one of the following session authorizations (uncomment it) # session = vk.AuthSession(app_id=app_id, us...
""" Copyright (C) 2018-2021 Intel 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 License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to i...
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
import numpy as np FUNCS = { 'mean' : lambda c, co, *args : c[c>co].mean(), 'sum' : lambda c, co, *args : c[c>co].sum(), 'max' : lambda c, co, *args : c[c>co].max(), 'lnr' : lambda c, co, t, *args : c[c>co].sum() / (t.time[-1] - t.time[0]), 'nlnr' : lambda c, co, t, cl, *args : c[c>co].su...
# -*- coding: utf-8 -*- # Copyright (c) 2016, 2017, 2018, 2019 Sqreen. All rights reserved. # Please refer to our terms for more information: # # https://www.sqreen.io/terms.html # """ DBApi2 strategy and custom connection and cursor classes """ import inspect import logging from ...utils import update_wrapper fro...
# -*- coding: utf-8 -*- # @author: <NAME>, <EMAIL> # @date: 2020-01 # This script will show an example using Kaggle data: https://www.kaggle.com/c/web-traffic-time-series-forecasting import os import numpy as np import pandas as pd import tensorflow as tf seed = 2021 np.random.seed(seed=seed) def log_transform(x, s...
# -*- coding: utf-8 -*- import json from django.http import HttpResponse import mock import pytest import requests import settings from olympia import amo from olympia.amo.tests import addon_factory from olympia.discovery.models import DiscoveryItem from olympia.discovery.utils import ( call_recommendation_serve...
from layout import TopLevel, RoundRect, Widget, Layout, State, Rel, Constraint from string import repr from flash.display import Shape from game import Frame, Keys level = """ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX Xg....................................gX X.XX.XXXXX.XX.XXX.XXXX.XXX.XX.XXXXX.XX.X X.XX.XXXXX.XX.XXX.XX...
# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
""" Pelican BibTeX ============== A Pelican plugin that populates the context with a list of formatted citations, loaded from a BibTeX file at a configurable path. The use case for now is to generate a ``Publications'' page for academic websites. """ # Author: <NAME> <<EMAIL>> # Unlicense (see UNLICENSE for details) ...
from dataclasses import dataclass from pathlib import Path from typing import Optional, Union import tokenizers import torch import transformers from tensortree import TensorTree from tokenizecode.bpe import TokenizerBPE from tokenizecode.parser import CodeParser, CodeParsingOutput, Span from tokenizecode.utils impo...
#! /usr/bin/env python # -*- coding: utf-8 -*- # # GUI module generated by PAGE version 6.2 # in conjunction with Tcl version 8.6 # Sep 14, 2021 08:22:41 PM IST platform: Windows NT import sys try: import Tkinter as tk except ImportError: import tkinter as tk try: import ttk py3...
#!/usr/bin/env python3 # Copyright 2020 <NAME> # 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, # pu...
# (C) 2021 GoodData Corporation from __future__ import annotations import functools import os import re from pathlib import Path from typing import Any, Callable, Dict, NamedTuple, Union, cast import yaml from gooddata_metadata_client import ApiAttributeError from gooddata_sdk.compute.model.base import ObjId # Use ...
# Copyright 2016-2018 <NAME> Pty Ltd. 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 la...
from rest_framework import test, authtoken, reverse, status from django.conf import settings from django.contrib.auth import get_user_model from django.core.files import File from .models import Media from .serializers import MediaSerializer import pathlib class MediaCreationTestCase(test.APITestCase): def setUp...
import logging import os from behave import given, when, then from hamcrest import (assert_that, has_item, is_, is_not, equal_to, greater_than) from StringIO import StringIO from pptx import packaging from pptx import Presentation from pptx.util import Inches def absjoin(*paths): return o...
# Copyright 2020 DeepMind Technologies Limited. # # 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...
class Graph: def __init__(self): self.edges = {} self.vertices = set() def add_edge(self, u, v, data): self.vertices.add(u) self.vertices.add(v) self.edges.setdefault(u, {})[v] = data def remove_edge(self, u, v): return self.edges[u].pop(v, None) def b...
""" XPS spectra are collected from numerous individual measurements (spectrum). """ import numpy as np from abc import ABC, abstractmethod from collections.abc import Hashable from copy import deepcopy class Spectra(ABC): """Abstract base class for spectra objects. """ class Dimension(Hashable): ...