text stringlengths 6.04k 39.5k |
|---|
#!/usr/bin/env python3
from logic_tree import *
from menu import Menu
import pickle
from itertools import product
from collections import Counter
from random import choice, shuffle
class Player:
""" A class representing a player in the game Clue """
def __init__(self, name, ncards, is_cpu, knowns=None):
... |
"""
Contains TAF-specific functions for report parsing
"""
# stdlib
from datetime import date
from typing import Dict, List, Tuple
# module
from avwx.current.base import Report, get_wx_codes
from avwx.parsing import core, sanitization, speech, summary
from avwx.parsing.translate.taf import translate_taf
from avwx.sta... |
#!/usr/bin/env python3
import inspect
import json
import os
from json import JSONDecodeError
from otest.check import CriticalError as check_critical_error
from otest.check import Error as check_error
from otest.check import ExpectedError as check_expected_error
from otest.check import Warnings as check_warning
from ot... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import pytest
from lxml import etree
from interpparser import gpo_cfr
from regparser.test_utils.xml_builder import XMLBuilder
from regparser.tree.xml_parser import tree_utils
def test_interpretation_markers():
text = '1. Kiwis and Mangos'
asser... |
import copy
import logging
from typing import List, Tuple, Dict
import numpy as np
from pgdrive.component.lane.abs_lane import AbstractLane
from pgdrive.component.road.road import Road
from pgdrive.constants import Decoration
from pgdrive.utils.math_utils import get_boxes_bounding_box
from pgdrive.utils.scene_utils i... |
# -*- coding: utf-8 -*-
# FeedCrawler
# Projekt von https://github.com/rix1337
"""FeedCrawler.
Usage:
crawler.py [--config="<CFGPFAD>"]
[--test_run]
[--docker]
[--port=<PORT>]
[--jd-user=<NUTZERNAME>]
[--jd-pass=<<PASSWORD>WORT>]
... |
import os
import numpy as np
import nibabel as nb
import pandas as pd
import glob
from nltools.simulator import Simulator
from nltools.data import (Brain_Data,
Adjacency,
Groupby,
Design_Matrix)
from nltools.stats import threshold, align
from nltoo... |
#!/usr/bin/env python
import os
def rreplace(s, old, new, occurrence = 1):
"""
Replaces the last occurence(s) of an expression in a string.
"""
return new.join(s.rsplit(old, occurrence))
def createDir(path):
"""
Creates the specified directory if not exists.
"""
import errno
# cre... |
#!/usr/bin/env python
"""
The universe of the Game of Life is an infinite two-dimensional orthogonal grid of square cells,
each of which is in one of two possible states, alive or dead (populated or unpopulated).
Every cell interacts with its eight neighbours, which are the cells that are horizontally,
vertically, or d... |
#! python3
"""Process data acquired from the Malvern Mastersizer 2000. The csv output contains lots of factor information with the numeric data towards the end. A common feature of the classes and modules is to split thse datasets into associate 'head' and 'data' subsets so that the numerical data can be processed i... |
import os
import json
import signal
import shutil
import sys
import copy
from datetime import datetime
import traceback
import yaml
from infraboxcli.execute import execute
from infraboxcli.job_list import get_job_list, load_infrabox_file
from infraboxcli.log import logger
from infraboxcli.workflow import WorkflowCache... |
#!/usr/bin/env python3
#
# Copyright 2014 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... |
import logging
import argparse
import os
import re
import yaml
logger = logging.getLogger("config")
def print_color(string, color):
colors = {'red': '31', 'yellow': '33', 'blue': '34',
'magenta': '35', 'turquoise': '36', 'white': '37'}
attr = []
attr.append(colors[color])
attr.append('1... |
import argparse
import json
import warnings
# Quieten python-levenshtein warning
warnings.filterwarnings("ignore")
from fuzzywuzzy import process
from lyricsscraper import LyricsDotComScraper as Scraper
DESC = """Get song lyrics or find a song from a snippet of it's lyrics, and \
more."""
EXACT_TITLE_HEL... |
import numpy as np
from numpy.core.fromnumeric import size
import pandas as pd
import itertools
from scipy.spatial.distance import pdist
from scipy.spatial.distance import squareform
from scipy.stats import pearsonr, spearmanr
from numpy.lib.stride_tricks import sliding_window_view
from joblib import Parallel, delay... |
"""
Unit and regression test for the plbenchmark package.
"""
# Import package, test suite, and other packages as needed
from plbenchmark import utils
import pytest
import warnings
def test_find_pdb_url():
"""tests the find_pdb_url function"""
pdbs = ["6R8L", "6N5O", "6SVL", "6J5R", "6J6D"]
for pdb in pd... |
import logging
from collections import Counter
from pathlib import Path
from typing import Dict, List, Optional, Set, Union
import jsonschema
import pyam
import pydantic
import yaml
from nomenclature.codelist import PYAM_AGG_KWARGS
from nomenclature.definition import DataStructureDefinition
from nomenclature.error.reg... |
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import dgl
from dgl.base import DGLError
from dgl.ops import edge_softmax
import dgl.function as fn
class MergeLayer(nn.Module):
"""Merge two tensor into one
Which is useful as skip connection in Merge GAT's input with outp... |
# Create your views here.
from django.shortcuts import render, get_object_or_404
from django.template.loader import render_to_string
from django.contrib.auth import authenticate, login, get_user, logout
from django.http import HttpResponseRedirect, HttpResponse
from django.db.models import Q
from django.db.models impo... |
# ===========================================================================
# Using TIDIGITS dataset to predict gender (Boy, Girl, Woman, Man)
# ===========================================================================
# Saved WAV file format:
# 0) [train|test]
# 1) [m|w|b|g] (alias for man, women, boy, gir... |
from transformers import Wav2Vec2Processor, Wav2Vec2ForCTC
import librosa
from setup import *
from preprocess import *
from datasets import load_dataset, load_metric, load_from_disk, dataset_dict
from datasets import ClassLabel
def spec_augment(X, max_freq_mask=57, max_time_mask=80, nfreq_masks=1, ntime_masks=1, max_... |
from logging import basicConfig, getLogger, INFO
from datetime import datetime
import json
from pyion2json import ion_cursor_to_json
from amazon.ion.simpleion import dumps, loads
from sampledata.sample_data import convert_object_to_ion, get_document_ids, get_document_ids_from_dml_results, get_document, print_result,g... |
import json
from Utils import Request, Response # 可删除 作用为: 写的时候编辑器有提示
from Reflection import Qiass as Reflection # 作用极大 作用为: ...
from Robot.Function import QiassNews as Function # 作用极大 作用为: 功能
from Robot.API import Qiass as API # ...
fro... |
# -*- coding: utf-8 -*-
"""
Created on Tue May 5 07:24:33 2020
@author: Ciaran
"""
import numpy as np
import Metrica_Viz as mviz
import scipy
import scipy.signal as signal
def remove_player_velocities(team):
# remove player velocoties and acceleeration measures that are already in the 'team' datafram... |
"""Calculate the nominal exposure time for specified observing conditions.
Use :func:`exposure_time` to combine all effects into an exposure time in
seconds, or call functions to calculate the individual exposure-time factors
associated with each effect.
The following effects are included: seeing, transparency, galac... |
"""
Ported from Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
http://paperjs.org/
Copyright (c) 2011 - 2014, <NAME> & <NAME>
http://scratchdisk.com/ & http://jonathanpuckey.com/
Distributed under the MIT license. See LICENSE file for details.
All rights reserved.
An Algorithm for Automatically Fitting D... |
import requests
from requests import api
from dataclasses import dataclass
"""
Instruções para TODOS os exercícios/funções abaixo:
1. Veja as instruções de como instalar o treinador e os testes no documento
entregue junto com este arquivo.
2. Se um determinado parâmetro de uma função deve ser inteiro, então esta
funçã... |
# Software License Agreement (BSD License)
#
# Copyright (c) 2008, <NAME>, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyri... |
#!/usr/bin/env python
# -------------------------------------------------------------
# Kerala Quiz - A Telegram Bot for playing quiz in communities.
# @author: <NAME> zume
# @github: https://github.com/zume2020
# license: MIT
# -------------------------------------------------------------
import os
import logging
im... |
from django.db import models
from django.core.validators import MaxValueValidator, MinValueValidator
from django.utils import timezone
from .custom_functions import isOnlyOneTrue
from users.models import OpticUser, Account
import decimal
from termcolor import colored
# Create your models here.
class Patie... |
# helpers.py
import pandas as pd
import numpy as np
import requests
import lxml.html as lh
import math
def build_players(path, season_paths, season_names, teams):
# read in player information for each season and add to list
season_players = []
for season_path in season_paths:
players = pd.read_c... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
A simple utility to translate among the SRAM/EEPROM/Flash dump formats for
Nintendo 64 cartridges as supported by various dumpers, emulators, and flash
cartridges.
--snip--
A simple Python reimplementation of saturnu's ED64-Saveswap utility as posted
at https://github... |
# Script to disaggregate data
#
# 2019
#
import geopandas as gpd
import json
import csv
import math
from tqdm import tqdm
from fractions import Fraction
def getf(ds, f, blk_pct):
return 0 if not (f in ds) else (round(float(ds[f]) * blk_pct, 3))
def handle_datasets(blk, blk_pct, datasets):
# {"D10F": {"A... |
"""Utilities for abstract values and inference."""
from functools import reduce
from itertools import chain
from .. import dtype
from ..utils import overload
from .loop import Pending, is_simple, PendingTentative
from .ref import Reference, Context
from .data import (
ABSENT,
ANYTHING,
Possibilities,
... |
#!/usr/bin/env python3
# Built from direct port of the Arduino NeoPixel library strandtest example. Showcases
# various animations on a strip of NeoPixels.
from neopixel import *
from .message import SceneMessage, AdministrativeMessage
import animations
import argparse
import logging
import threading
import time
imp... |
from __future__ import print_function
import argparse
import numpy as np
import torch
import scipy.misc as m
import cv2
from torch.utils import data
from tqdm import tqdm
from joblib import Parallel, delayed
from ptsemseg.models.fcn_seg import *
from ptsemseg.models.segnet_seg import *
from ptsemseg.models.frrn_seg i... |
'''
this is where i'll develop the UI form that can open a music file, edit the
contents, save, and move to another file.
things to fix:
* control text size in all items with one variable - done
* give root (self.R) window a title - done
* instead of grid, may want to use place - no, using grid. - done
* be able t... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
__author__ = '<NAME>'
#parser algoritmhs import
import pandas as pd
import os
from datetime import datetime, timedelta
from logparser.logparser.Drain import Drain
from logparser.logparser.LogSig import LogSig
from logparser.logparser.LenMa import LenMa
from pipeline.parser... |
import numpy as np
import numba as nb
from numba import types, typed, typeof
from numba import jit
from numba.experimental import jitclass
from nrc_spifpy.spif import TIME_CHUNK
# The size of the metadata in a particle record
# Word 1 = Flag 2S
# Word 2 = word for h image metadata
# Word 3 = word for v image metadata... |
#!/usr/bin/env python3
import os
import sys
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import pandas as pd
import seaborn as sn
import column_names as cols
file_formats = ["pdf", "svg"]
def save(name):
if not os.path.isdir("figs"):
os.mkdir("figs")
for fmt in file_formats:
... |
import pytest
import numpy as np
from hera_sim.visibilities import VisCPU
from hera_sim import io
from hera_sim.beams import PerturbedPolyBeam, PolyBeam, efield_to_pstokes
from hera_sim.defaults import defaults
from astropy_healpix import healpy as hp
from vis_cpu import HAVE_GPU
np.seterr(invalid="ignore")
def ante... |
import os
import numpy as np
import pandas as pd
from skimage import io, transform
import torch
from torch.utils.data import Dataset, DataLoader
# Ignore warnings
import warnings
warnings.filterwarnings("ignore")
class AnimalBoundBoxDataset(Dataset):
def __init__(self, root_dir, inputvec, anchors, maxann, trans... |
from functools import wraps, cached_property
from typing import Mapping, Optional, Union, Iterable
from collections.abc import KeysView, ValuesView, ItemsView
from collections import ChainMap
from pymongo import MongoClient
from dol import KvReader
from dol import Collection as DolCollection
from mongodol.constants ... |
# -*- coding: utf-8 -*-
"""
A collection of functions that use oTherm APIs to retrieve data from an oTherm instance. The typical application
is to first retrieve the *site* data. Then, using the *site* dataclass object, retrieve information about the:
- *weather_station*,
- *thermal_load*,
- *monitoring... |
import time
from itertools import chain
from typing import List, Optional, Tuple, Union
import navis
import networkx as nx
import numpy as np
import plotly.graph_objs as go
from matplotlib import pyplot as plt
from plotly.offline import iplot, plot
from neuroboom.utils import calc_cable, check_valid_neuron_input
# f... |
import re
import numpy as np
import pandas as pd
try:
import holoviews as hv
except ImportError:
hv = None
from . import StarModel, get_ichrone
from .starmodel import SingleStarModel, BinaryStarModel, TripleStarModel
from .catalog import StarCatalog
from .priors import PowerLawPrior, FlatLogPrior, FehPrior, ... |
import mysql.connector
from mysql.connector import errorcode
from datetime import datetime, date
import pandas as pd
import numpy
def connect_db_hg():
try:
config = {
'user': 'guest',
'password': '<PASSWORD>',
'host': '192.168.9.41',
'database': 'mydb',
... |
import dataclasses
import functools
import math
import pathlib
import sys
from pathlib import Path
from typing import List, Tuple, Dict
import matplotlib.colors as mcolors
import numpy as np
from scipy.stats import linregress
from scipy.stats._stats_mstats_common import LinregressResult
import matplotlib.pyplot as pl... |
"""String filtering, truncation and padding."""
# Note: These functions consider unicode string length and
# displayed string length to be equal, so any string with zero
# length characters (eg combining) will be incorrectly
# truncated and/or padded. Output to fixed-width displays
# like DHI and track announce... |
"""
These are all the view functions for the app.
"""
import json
import logging
import os
import random
import shutil
import threading
import traceback
from string import ascii_letters, digits
from flask import redirect
from flask import render_template
from flask import request
from flask import send_from_directory... |
import importlib
import re
import sys
from abc import ABC, abstractmethod
from copy import deepcopy
from statistics import mean
import matplotlib.pyplot as plt
import numpy as np
from MAPLEAF.IO import Logging, SimDefinition, SubDictReader, subDictReader
from MAPLEAF.IO.simDefinition import getAbsoluteFilePath
from MA... |
# import standard packages
import time
import warnings
import numpy as np
from sklearn.neighbors import KDTree
from scipy.spatial.distance import cdist
from scipy.spatial.distance import pdist, squareform
# only for kmeans++
from sklearn.cluster import kmeans_plusplus
from sklearn.utils.extmath import row_norms
from... |
# -*- coding: utf8 -*-
"""
======================================
Project Name: NLP
File Name: convert_dataset
Author: czh
Create Date: 2021/8/19
--------------------------------------
Change Activity:
======================================
"""
# 将其它数据转换成tplinker plus要求的格式
import sys
sys.path.appe... |
#!/usr/bin/env python3
import numpy as np
import nabla
from nabla import grad, Dual, minimise
def close(x, y, eps=1e-12):
return abs(x-y)<eps
def dualclose(x, y, eps=1e-12):
isclose = close(x.real, y.real, eps)
for i in range(x.nvars):
isclose = isclose and close(x.dual[i], y.dual[i], eps)
r... |
#!/usr/bin/env python
# encoding: utf-8
"""
analyze.py
Command line tool for analyzing variants that are annotated with genmod.
Created by <NAME> on 2014-09-03.
Copyright (c) 2014 __MoonsoInc__. All rights reserved.
"""
from __future__ import print_function
import sys
import os
import click
import inspect
try:
... |
import math
from itertools import combinations
from collections import namedtuple, defaultdict
import cvxpy as cvx
import numpy as np
import numpy.linalg as LA
import scipy.optimize
import matplotlib.pyplot as plt
PI2 = math.pi * 2
MAX_ANGLE = PI2 / 8 / 10
cmap = plt.get_cmap("brg")
def vp_from_lines(x1, y1, x2, y2... |
import json
import os
from abc import ABC
import joblib
import tensorflow
import torch
from compoundFeaturization import deepChemFeaturizers
from compoundFeaturization.rdkitDescriptors import TwoDimensionDescriptors
from compoundFeaturization.rdkitFingerprints import RDKFingerprint, MorganFingerprint, AtomPairFingerpr... |
#!/usr/bin/env python3.6
from os import path
from sklearn import preprocessing
import pandas as pd
import numpy as np
import json
import argparse
try:
import _pickle as pickle
except:
import pickle
import os
import librosa
import collections
from bbn_primitives.time_series import *
from d3m_metadata.container... |
# -*- mode:python; sh-basic-offset:4; indent-tabs-mode:nil; coding:utf-8 -*-
# vim:set tabstop=4 softtabstop=4 expandtab shiftwidth=4 fileencoding=utf-8:
#
# Copyright (c) 2012, <NAME> <<EMAIL>>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted,... |
"""This module contains the simulation setup and execution.
.. autosummary:
ControlledEnvironment
Controller
.. moduleauthor:: <NAME> <<EMAIL>>
.. moduleauthor:: <NAME> <<EMAIL>>
"""
from simpy.core import Environment
from cs143sim.actors import Flow
from cs143sim.actors import Host
from cs143sim.actors imp... |
import csv
import math
import os
import random
import time
import numpy as np
from myRobotCell import *
def move_tcp_to_point_grasp_release(robot_cell, goal_position, goal, position_accuracy, save_path, no_tries, tries_threshold=40):
"""
moves the TCP to the goal point and returns if the goal was achieved -... |
import dask
import glob
import matplotlib
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
import numpy as np
import os
import pandas as pd
from pymicro.view.vol_utils import compute_affine_transform
import scipy
import scipy.optimize
import secrets
matplotlib.use("Agg")
TRACKID = "... |
"""
This file is part of the TheLMA (THe Laboratory Management Application) project.
See LICENSE.txt for licensing, CONTRIBUTORS.txt for contributor information.
The classes in this module serve the creation of an ISO request for a
library creation process.
The ISO request requires a base layout (provided by the user... |
# sqlalchemy/event.py
# Copyright (C) 2005-2013 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Base event API."""
from . import util, exc
from itertools import chain
import ... |
# -*- coding: utf-8 -*- {{{
# vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et:
#
# Copyright (c) 2020, <NAME>, Godithi.
# All rights reserved.
#
#
# IIIT Hyderabad
#}}}
#Sam
import datetime
import logging
import sys
import uuid
from volttron.platform.vip.agent import Agent, Core, PubSub, compat, RPC
from volttron.... |
from plugins import tarot
from plugins import dataManage
from plugins import TRPG
# ==========================================================
key_allow = [
'#', '*',
',', ',',
'.', '。',
'!', '!',
'?', '?',
':', ':',
';', ';',
'+',
'-',
'/'
]
table = TRPG.TableRolePlayGame()
... |
#!/usr/bin/env python3
"""
The ARC Tool box
"""
import os
import re
import datetime
import numpy as np
import matplotlib.pyplot as plt
import shutil
import glob
import logging
from copy import deepcopy
from arc import settings
from arc.main import ARC
from arc.job.ssh import SSHClient, write_file
from arc.common impor... |
import collections.abc
import os
import numpy as np
import pycuda.driver as cuda
import pycuda.gpuarray as gpuarray
from pycuda.compiler import SourceModule
import pyconrad
import pyconrad.config
from conebeam_projector._utils import divup, ndarray_to_float_tex
_SMALL_VALUE = 1e-12
_ = pyconrad.ClassGetter(
'ed... |
"""
Generate hourly temperature and precipitation data for use in the snow model
The daily gridded fields (e.g. from VCSN) are downscaled using the same methods given in "Simulations of seasonal snow for the South Island, New Zealand"
Clark et al, 2009
"""
from __future__ import division
import os
#os.environ['PROJ_LI... |
#!/usr/bin/env python
'''
Calculate topological measures of a DIRECTED graph.
Mainly from:
http://networkx.readthedocs.org/en/stable/reference/algorithms.html
- Return node properties: dictionaries keyed by node label
{REACTION: VALUE}
'''
import os
import sys
import networkx as nx
def ... |
"""
Encoding TCRs as one-hot vectors and back again.
Someday this may do the same for BCRs.
The current gene names are for Adaptive data.
Erick: try to keep everything that assumes this gene set in here so
generalization is easier.
"""
from collections import OrderedDict
import pkg_resources
import numpy as np
impo... |
from __future__ import print_function
import os
import sys
import timeit
import numpy
import theano
import theano.tensor as T
from theano.tensor.signal import pool
from theano.tensor.nnet import conv2d
from fashion_mnist import load_mnist
import scipy.io
import six.moves.cPickle as pickle
class Logistic... |
from __future__ import print_function
import argparse
import collections
import logging
import json
import math
import os
import random
import pickle
from tqdm import tqdm, trange
import re
import numpy as np
import torch
from torch import nn
from pytorch_pretrained_bert.modeling import BertPreTrainedModel, BertModel... |
# Copyright 2020 <NAME>
#
# 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,... |
'''
Collection of functions that are rather header-dependent than the data.
'''
import re
from warnings import warn
import numpy as np
from astropy import units as u
from astropy import wcs as astropywcs
from astropy.coordinates import EarthLocation, SkyCoord
from astropy.io import fits
from astropy.io.fits import Car... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Created : 2021/09/21 5:17 오후
# @Author : <NAME>
# @Site :
# @File : vae_train.py
# @Software : PyCharm
import copy
import matplotlib.pyplot as plt
import numpy as np
import torch
import torch.nn as nn
from torch.optim.lr_scheduler import ExponentialLR
... |
from typing import Callable, List, Optional
class FormattedException(Exception):
pass
class TemplateParserException(Exception):
def __init__(self, message: str) -> None:
self.message = message
def __str__(self) -> str:
return self.message
class TokenizationException(Exception):
de... |
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from __future__ import print_function
import abc
import logging
import random
import six
import uuid
from collections import OrderedDict
from itertools import chain, product
from mazebase.games import featuri... |
# -*- python -*-
# This software was produced by NIST, an agency of the U.S. government,
# and by statute is not subject to copyright in the United States.
# Recipients of this software assume all responsibilities associated
# with its operation, modification and maintenance. However, to
# facilitate maintenance we as... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# ---
# jupyter:
# jupytext:
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.4'
# jupytext_version: 1.1.4
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
# # s_no... |
#!/usr/bin/env python3
from tinydb import TinyDB, Query
import datetime
import sys
from shutil import copyfile, move
import os
import configparser
import netorconf
import netorlogging
_NETOR_HOME_DIRECTORY = "/home/adrian/netor-master/"
class DB:
"""
Class DB with parameters used by all the methods to push ... |
import sys
import yaml
import pandas as pd
import logging
import os
from os import path
import importlib
import subprocess
import shutil
logging.basicConfig(format='%(message)s',level=logging.INFO)
LOG = logging.getLogger(__name__)
def clone_from_git(kedro_project_path,git_url,kedro_project_p... |
##############################################################################################################################################################
##############################################################################################################################################################
""... |
""" SERVER APP.PY """
import os
from flask import Flask, send_from_directory, json, redirect, request, url_for, redirect, session
from flask_socketio import SocketIO
from flask_cors import CORS
from flask_sqlalchemy import SQLAlchemy
import functions
from functions import searchStock, fetchNews, send_email_SSL, send_e... |
import pygame as pg
from pygame import freetype
import pieces
import sys
width,height,offsetX,offsetY = 900,600,25,25
#define 2 colors that can be used for the peices
BLACK = (0, 0, 0)
WHITE = (255, 255, 255)
#chessboard colors
LIGHT = (252, 204, 116)
DARK = (87, 58, 46)
#other colors
GREY = (54, 57, 62)
SILVER = (19... |
import mimetypes
import os
import json
import requests
from moodle.exceptions import MoodleException
from moodle.fieldnames import text_format as moodle_text_format
from moodle.fieldnames import JsonFieldNames as Jn
from moodle.parsers import strip_mlang
import logging
log = logging.getLogger('moodle.communication... |
"""
PYFAB API using Fabber command line tool(s)
===========================================
This API uses Fabber command line tools, run within temporary
directories, to implement the required functions. For short
runs this is likely to be slower than the shared-library
based API however it can be used when the shared... |
import machine
from network import WLAN
import utime
from network import LoRa
import socket
import time
import ubinascii
import crypto
from LoRaAirTimeCalc import *
import sys
from pycoproc import Pycoproc
from microWebCli import MicroWebCli
## PARAMETERS
# Debug messages
debug = 0
# Fixed channel and spreading factor... |
from __future__ import absolute_import
import dill as pickle
from pathlib import Path
# Local utilities for comparison
from jetmontecarlo.utils.montecarlo_utils import *
from jetmontecarlo.jets.observables import *
from examples.comparison_plot_utils import *
# Local analytics
from jetmontecarlo.analytics.soft_drop i... |
# Copyright (c) 2016 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... |
# (c) <NAME>. GPL licensed, see LICENSE.rst.
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import absolute_import
import h5py
import numpy as np
from shapely import wkt
from shapely.geometry import MultiPoint, Point
from threedigrid.admin import ... |
import numpy as np
import cv2
import os
import matplotlib.pyplot as plt
import csv
import random
train_img_path = './task1/train/img/'
train_lab_path = './task1/train/gt/'
img_fn='./task1/train/img/'
grid_size = 32
def get_image(img_fn):
files = []
exts = ['jpg', 'png', 'jpeg', 'JPG']
for parent, dirname... |
#!/usr/bin/env python3
# Copyright 2014-2017 <NAME> <<EMAIL>>
#
# 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, this
# list of conditions... |
import pathlib
import struct
import pytest
import numpy
import pandas
import necstdb
TIME = 1630042892.423945
DATA1_HEADER = {
"data": [
{"key": "test_bool", "format": "?", "size": 1},
{"key": "test_int8", "format": "b", "size": 1},
{"key": "test_int16", "format": "h", "size": 2},
... |
import numpy as np
from collections import OrderedDict
from shapely.geometry import Polygon
import pyclipper
import torch
import cv2
import math
import random
class Compose(object):
def __init__(self, transforms):
self.transforms = transforms
def __call__(self, data):
for t in self.transfor... |
import logging
import random
import uuid
from collections import namedtuple
from os.path import join
from random import randint
from typing import Optional
from django.db import models
from django.urls import reverse
from django.utils.text import slugify
from utils.utils import file_extension, django_now, add_url_par... |
import os
import gym
import numpy as np
from collections import deque
import matplotlib.pyplot as plt
import random
import seaborn as sns
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import torch.distributed as dist
import torch.multiprocessing as mp
from torch.distrib... |
import dash
import dash_core_components as dcc
import dash_html_components as html
import plotly.graph_objs as go
from ECAgent.Core import Model
# Can be used to customize CSS of Visualizer
external_stylesheets = ['https://rawgit.com/BrandonGower-Winter/ABMECS/master/Assets/VisualizerCustom.css',
... |
# coding: utf8
# !/usr/env/python
r""" **PrecipChanger** changes precipitation frequency and intensity over time.
This terrainbento boundary-condition handler was designed to change the
precipitation frequency and intensity over time in order to modify the water
erodibility coefficient.
In order to accomplish this, w... |
"""!
@brief A dataset creation which is used in order to combine the
mixtures form the dataset and also store them inside a specified folder
@author <NAME> {<EMAIL>}
@copyright University of Illinois at Urbana Champaign
"""
import argparse
import os
import sys
import numpy as np
from random import shuffle
from pprint... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.