text stringlengths 3.07k 22.1k |
|---|
import numpy as np
import numpy.testing as npt
from astropy.modeling import models
from ..spectral_stacking_models import (fit_gaussian, fit_2gaussian, fit_hwhm,
find_linewing_asymm)
np.random.seed(347895209)
def gauss_with_noise(vels, amp, mean, stddev, noise_level,
... |
import numpy as np
import pygame, sys
from numpy import sin,cos
import drawSvg as draw
pygame.init()
def info(d,datalabel,x,y,textsize,textcolor,datacolor):
d.append(draw.Text(datalabel, textsize, x,y, center=False, fill=textcolor,stroke=textcolor, stroke_width=0))
d.append(draw.Line(x-50, y+textsize/4, x-5, y+te... |
# coding: utf-8
# # Helper Functions
# In[1]:
# This function takes in a DAC textfile and converts it into a 2D array where the the first
# column is the time values and the rest of the columns are the different DACs
import numpy as np
def arrayDAC(file):
# open and read text file
with open(file, 'r') as t... |
#!/usr/bin/env python
import wx
import wx.adv
import wx.lib.inspection
import wx.lib.mixins.inspection
import sys
import os
import esptool
import threading
import json
import images as images
from serial import SerialException
from serial.tools import list_ports
__version__ = "5.0.0"
__auto_select__ = "Auto-select"
... |
# -*- coding: utf-8 -*-
# Copyright © 2013 by its contributors. See AUTHORS for details.
# Distributed under the MIT/X11 software license, see the accompanying
# file LICENSE or http://www.opensource.org/licenses/mit-license.php.
"""\
Create core bitcoin data structures.
Revision ID: 221200742ae7
Revises: None
Create... |
"""Use symbolic execution to determine supported IOCTLs.
This function will attempt to symbolically execute the driver's IOCTL
dispatch routine with a symbolid IRP. Once the IRP's io_control_code
field is constrained to a single value, terminate the symbolic execution
for that path and report the code as supported.
T... |
import asyncio
import logging
import os
import signal
from dataclasses import dataclass
from functools import wraps
from os import listdir
from os.path import dirname, exists, join
from typing import List, cast
import asyncclick as click
import sentry_sdk
from dotenv import load_dotenv
from fcache.cache import FileCac... |
#std imports
import logging
import socket
import hashlib
from datetime import datetime
import re
#Fabric for ssh connections
from fabric import tasks
from fabric.api import run,env, run, execute, parallel,settings,hide
from fabric.network import disconnect_all
from fabric.exceptions import CommandTimeout,NetworkError
... |
import pygame
from pygame.math import Vector3 as Vec, Vector2 as Vec2
from time import time
from math import radians, sqrt
from random import randint, choice
import string
import os
def make_if_not_exists(path):
if not os.path.exists(path):
os.mkdir(path)
else:
for file in os.listdir(path):
os.re... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2019 <NAME> <<EMAIL>>
#
# Distributed under terms of the MIT license.
"""Clean the raw quantities from the dynamics analysis.
This is a collection of utilities for cleaning up the raw data from the calculation of
the dynamics.
"""
import... |
# This module contains a script manager which implements Matlab like live scripting
# Support call of scripts which can be automatic reloaded without leaving the Python interpreter
# The user can modify code in a script file
# These script files will be reloaded based on modify time stamps
# New compiled code is direct... |
from django.conf import settings
from django.contrib.auth.models import AbstractUser
from django.db import models
from django.db.models.signals import post_save
from django.dispatch import receiver
from django.template.defaultfilters import slugify
from django.urls import reverse
from django.utils import timezone
from ... |
import asyncio
from cmath import e
import json
from operator import xor
import websockets
from datetime import datetime
import time
import config
import logging
import sys
import os
import math
import random
import string
logging.basicConfig(format='%(asctime)s - %(message)s', level=logging.INFO)
logging.basicConfig(fo... |
#!/usr/bin/env python3
import lyricwikia
from .authorize import spotify
def get_tracks(search_string=None):
"""
Get mulitple matching tracks along with their details,
details like artist, album, and so on.
:param search_string: Name of track to be searched
:returns: A list of dictionary of track ... |
import pytest
from django import forms
from django.core.cache import cache
from django.core.exceptions import ValidationError
from django.test import TestCase
from ppa.archive.forms import (
AddFromHathiForm,
FacetChoiceField,
ModelMultipleChoiceFieldWithEmpty,
RadioSelectWithDisabled,
RangeField,
... |
import torch
# import torch.nn as nn
import torch.optim
import torch.distributed
# from torch.nn.parallel import DistributedDataParallel as DDP
import torch.multiprocessing
import numpy as np
import os
# from collections import OrderedDict
# from ddp_model import NerfNet
import time
from data_loader_split import load_d... |
"""abcmd - ABCs & Mixins for wrapping commands with static configuration."""
__version__ = "0.4.0"
__author__ = "<NAME> <<EMAIL>>"
__all__ = ("Command",)
import abc
import re
import shlex
import subprocess as sp
import sys
from functools import lru_cache
from string import Formatter
import logging
if sys.version_in... |
from functools import lru_cache
from .base import ErConnector
from .customfield import get_custom_field_by_key
from .candidate import delete_candidate_custom_field_rest
gender_choices = [(0, 'Male'), (1, 'Female'), (3, 'Other'), (4, 'Decline') ]
# not in api, convenience #
gender_pronoun_choices = ['he/him/his','she/... |
# -*- coding: utf-8 -*-
#pylint: disable=invalid-name
import re
from collections import defaultdict
import six
import torch
from torch import nn
from aw_nas import ops, utils
from aw_nas.weights_manager.base import BaseWeightsManager
# INIT_RANGE = 0.1
INIT_RANGE = 0.04
class RNNSharedNet(BaseWeightsManager, nn.Mo... |
import cv2
import numpy as np
from transform import four_point_transform
import argparse
import matplotlib.image as mpimg
from matplotlib import pyplot as plt
import time
def apply_smoothing(image, kernel_size=15):
"""
kernel_size must be positive and odd
"""
return cv2.GaussianBlur(image, (kernel_size... |
from abc import ABCMeta
# from covertutils.handlers import ResponseOnlyHandler
from covertutils.helpers import defaultArgMerging
import covertutils
from functools import wraps
from threading import Condition, Thread
try:
from queue import Queue # Python 3
except ImportError:
from Queue import Queue # Python 2
i... |
"""
Handles the schema creation and upgrade.
"""
import time
from .schema_metadata import METADATA_DB_TABLES
from .tabledef import DbTableDef
from ..cfg.config import Config
from ..util import out
_TIMEOUT = [2]
def install_db(config):
"""
Install or upgrade the DynamoDB tables.
:par... |
# geomdl-cli - Copyright (c) 2018-2019 <NAME> <<EMAIL>>
#
# 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, ... |
"""@package ecohydrolib.nhdplus2.webservice
@brief Methods for querying the NHDPlus V2 data set via custom web service
This software is provided free of charge under the New BSD License. Please see
the following license information:
Copyright (c) 2013, University of North Carolina at Chapel Hill
All rights reser... |
from fabric.api import env, require, task, settings, run, sudo, roles, cd, prefix, put
from fabric.operations import prompt
from fabric.contrib.files import exists, sed, upload_template
from fabric.colors import *
from contextlib import contextmanager
import os
import calendar
import time
from time import gmtime, st... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""ADS-B Cursor-on-Target Gateway Function Tests."""
import asyncio
import csv
import io
import urllib
import xml.etree.ElementTree
import pytest
import stratuxcot
import stratuxcot.functions
__author__ = '<NAME> W2GMD <<EMAIL>>'
__copyright__ = 'Copyright 2021 Orion... |
#!/usr/bin/python3
"""
TODO: Add Description
"""
import argparse
import datetime
import os.path
import ipaddress
import configparser
import urllib.parse
from urllib.error import HTTPError
from classes.rdns import ReverseDNS
from classes.pstrace import PsTrace
from classes.base import Jinja2Template
from lib import jso... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# auto_py2to3 is licensed under the Mulan PSL v2.
# You can use this software according to the terms and conditions of the Mulan PSL v2.
# You may obtain a copy of Mulan PSL v2 at:
# http://license.coscl.org.cn/MulanPSL2
# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WIT... |
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 31 02:11:49 2020
@author: Timothe
"""
import numpy as np
from scipy.signal import savgol_filter, filtfilt, butter, find_peaks, peak_prominences
from scipy.interpolate import interp1d
import logging, warnings
import scipy.ndimage as scpnd
########## 1D signal processing ... |
from collections import defaultdict
# AVL
outputdebug = False
def debug(msg):
if outputdebug:
print(msg)
class Node():
def __init__(self, key):
self.key = key
self.left = None
self.right = None
class AVLTree():
def __init__(self, *args):
self.node = None
... |
import asyncio
import logging
import threading
import typing
import pandas as pd
from mlservicewrapper.core import (configuration, context_sources, contexts,
errors, server, services)
from pandas.core import base
from starlette.applications import Starlette
from starlette.requests im... |
"""
Elements of the runtime are (for now, at least) principally implementations of
AbstractTensor which work by sifting, filtering, and combining other Tensor objects.
Continuing to KEEP IT SIMPLE, SALLY!
Just a note: there's a lot of parallelism between (most of) the structures defined here
and those defined for the... |
import ast
from configparser import ConfigParser
from pathlib import Path
import re
import time
from intspan import intspan
from read_version import read_version
from setuptools.config import read_configuration
import yaml
from . import util # Import module to keep mocking easy
from .readme import Readme
def inspect... |
import argparse
import os
import pandas as pd
import matplotlib.pyplot as plt
import sys
sys.path.append('../')
from load_paths import load_box_paths
import matplotlib as mpl
import matplotlib.dates as mdates
import seaborn as sns
from processing_helpers import *
mpl.rcParams['pdf.fonttype'] = 42
def parse_args():
... |
from django.contrib.auth.mixins import LoginRequiredMixin, UserPassesTestMixin
from django.contrib.auth.decorators import login_required, user_passes_test
from django.contrib import messages
from django.http import HttpResponse, JsonResponse
from django.urls import reverse_lazy
from django.views.generic import ListView... |
import argparse
import sys
from typing import Optional
import gym
from gym.core import Env
import numpy as np
import matplotlib.pyplot as plt
from gym.spaces import Box, Dict
from stable_baselines3 import HerReplayBuffer, PPO, SAC
from sb3_contrib import TQC
from sb3_contrib.common.wrappers import TimeFeatureWrapper... |
from __future__ import print_function
import csv, os, cPickle
import numpy
from sklearn import model_selection as cv, metrics
from sklearn.model_selection import StratifiedShuffleSplit
from sklearn.ensemble import RandomForestRegressor, RandomForestClassifier
import validation, config as cfg, utils
def get_k_strati... |
# coding=utf-8
# Copyright 2022 The Google Research 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 the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
"""
trains a sequence to sequence (seq2seq) model for Phoneme to English (Grapheme) translation.
After training the model, you will be able to input a Phoneme sentence,
such as *""B EY1 B IY0 Y UW1 K AE1 N D R AY1 V M AY1 K AA1 R""*, and return the
English graphemes: *"Baby, you can drive my car"*
The translation qua... |
import sys
from collections import OrderedDict
import numpy as np
from resources import PROCESSED_PATH, BASE_DIR
from summariser.utils.corpus_reader import CorpusReader
from summariser.utils.reader import readSummaries
from summariser.utils.evaluator import evaluateReward,evaluateSummary
from summariser.utils.misc imp... |
"""
Controller class will control all the functions to perform
it will link all the libs together and work each process by process
Since, threads and processes need to communicate, the controller
object would be shared in functions
"""
import gc
import os
from time import time
from multiprocessing import Process
from... |
import logging
# Stripe SDK original module
import stripe as orig_stripe
from django.conf import settings
from django.contrib.auth.models import User
from lessons.payments import plans
from lessons.signals import (checkout_complete_error,
checkout_complete_success,
... |
import torch
import torch.nn as nn
from torch.autograd import Variable
import onqg.dataset.Constants as Constants
from onqg.models.modules.Attention import ConcatAttention
from onqg.models.modules.MaxOut import MaxOut
from onqg.models.modules.DecAssist import StackedRNN, DecInit
class RNNDecoder(nn.Modul... |
import numpy as np
import yaml
import os
from optparse import OptionParser
import multiprocessing
class MakeYamlFake:
"""
class to generate yaml files used as input to generate fake observations
Parameters
---------------
zval: float
redshift values
fake_orig: str
original yaml fi... |
# emacs: -*- mode: python; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil -*-
# ex: set sts=4 ts=4 sw=4 noet:
# ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the datalad package for the
# copyright and license terms.
#
# ## ### ##... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import time
import ctypes
import cv2
from VIGITIA_toolkit.data_transportation.VIGITIAVideoStreamer import VIGITIAVideoStreamer
from VIGITIA_toolkit.sensors.cameras.realsense_D435_camera import RealsenseD435Camera
from VIGITIA_toolkit.sensors.cameras.... |
#!/usr/bin/env python
# coding: utf-8
# # Distributed Computation of Attributions using Captum
# In this tutorial, we provide some examples of using Captum with the torch.distributed package and DataParallel, allowing computing attributions in a distributed manner across processors, machines or GPUs.
#
# In the firs... |
import sys
sys.path.append('..')
import json
import os
from itertools import combinations
import onPPILinkPred as ppiLPred
import bioGRID as bg
import IntAct
import STRING as string
import numpy as np
import traversalHelper as tr
import pandas as pd
from collections import defaultdict
import time
import MINT
class hel... |
import csv, numpy as np
def read(filename):
with open(filename, 'r') as f:
csv_reader = csv.reader(f, delimiter='\t')
# headers
for i in range(12):
csv_reader.next()
data = np.array([ [ float(x) for x in row[2:-1] ] for row in csv_reader ])
return data
import ma... |
import time
import os
import sys
from flask import Flask, render_template, request, url_for
import oauth2 as oauth
import urllib.request
import urllib.parse
import urllib.error
import json
import twitter
import tweepy
app = Flask(__name__)
app.debug = False
request_token_url = 'https://api.twitter.com/oauth/request_... |
import asyncio
import re
from urllib import parse
from difflib import SequenceMatcher as SM
import click
from salmon.common import RE_FEAT, make_searchstrs
from salmon.errors import AbortAndDeleteFolder
from salmon.errors import RequestError
from salmon import config
loop = asyncio.get_event_loop()
def dupe_check... |
import argparse
import socket
import time
import queue
import threading
import multiprocessing
import serial
class ConnectionManager():
def __init__(self):
self.connections = []
self.listeners = []
self.lock = threading.Lock()
def append(self, sock):
with self.lock:
... |
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) 2022 Osyris contributors (https://github.com/osyris-project)
import argparse
import os
import shutil
import warnings
parser = argparse.ArgumentParser(description='Convert legacy Ramses output formats to '
'new format that can be ... |
import json
import sys
from os import path
import vk
from PyQt5 import QtGui
from PyQt5.QtCore import QRegExp, QObject, pyqtSignal, QEventLoop
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from PyQt5.uic import loadUi
import google_export
import vktests
class Window(QMainWindow):
def __init__(self, pa... |
from django.db import models
from .behaviors.models import Timestampable, Taggable, Versionable
from django.utils.translation import ugettext_lazy as _
# Create your models here.
class PopoloDateTimeField(models.DateTimeField):
"""Converting datetime to popolo."""
def get_popolo_value(self, value):
ret... |
import itertools
import pathlib
import shutil
import sys
import numpy as np
import pytest
import kwiiyatta
import kwiiyatta.convert_voice as cv
from tests import dataset, feature
from tests.plugin import assert_any
pytestmark = pytest.mark.slow
@pytest.fixture(scope='session', autouse=True)
def scope_session():... |
import os
from copy import deepcopy
import logging
import rastervision as rv
from rastervision.core import CommandIODefinition
from rastervision.core.config import (Config, ConfigBuilder)
from rastervision.utils.files import save_json_config
from rastervision.protos.experiment_pb2 \
import ExperimentConfig as Expe... |
import pygame
from pygame.locals import *
import random
import asyncio
import alpha_packet
from bleak import discover,BleakClient
class GameParams:
def __init__(self):
self.scroll_speed = 4
self.pipe_gap = 200
self.pipe_frequency = 1500
self.screen_width = 864
self.screen_... |
# SMOP compiler runtime support library
# Copyright 2014 <NAME>
# MIT license
import numpy as np
import unittest
from runtime import *
from sparsearray import sparsearray
class Sparsearray(unittest.TestCase):
def setUp(self):
self.a = np.arange(1,5).reshape(2,2,order="F")
self.b = sparsearray(self... |
import os
import random
import pygame
import sys
# If the code is frozen, use this path:
if getattr(sys, 'frozen', False):
currentPath = sys._MEIPASS
# If it's not use the path we're on now
else:
currentPath = os.path.dirname(__file__)
# Game Variables
game_active = False
game_start = True
gravity = 0.25
bi... |
import os
import re
import json
import logging
import warnings
from enum import Enum
from pathlib import Path
from collections.abc import Iterable
import dateutil.parser
from intervaltree import IntervalTree
from stixcore.util.logging import get_logger
__all__ = ['SOOPManager', 'SoopObservationType', 'KeywordSet',
... |
# coding: utf-8
import argparse
import textwrap
import logging
from datetime import datetime
import re
import shortuuid
import glob
from sqlalchemy.orm.exc import MultipleResultsFound
from werkzeug.security import generate_password_hash
from app import db
from app import logger
from app import get_db_cursor
from gri... |
# -*- coding: utf-8 -*-
# Copyright (C) 2018 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
"""
CLI logger
"""
import logging
import sys
import os
import io
VERBOSE = any(arg.startswith("-v") for arg in sys.argv)
XML_REPORTING = any(arg.startswith("-x") for arg in sys.argv)
class StreamHandler(logging.St... |
from UI_dist.Des_UI import Ui_MainWindow
from UI_dist.customize import Ui_Dialog
from PySide2.QtGui import *
from PySide2.QtWidgets import *
from PySide2.QtCore import QSettings
import pandas as pd
import os, re, math
import webbrowser
from threading import Thread
class MainWindow(Ui_MainWindow, QMainWindow):
de... |
"""
Program: lab4-DouglasG_and_JakeW
Authors: <NAME> and <NAME>
1. Constants
#Constants of the Card class
RANKS, #A tuple of the ranks possible for the cards
SUITS, #A tuple of the suits possible for the cards
BACK_OF_CARD #The filename connecting to the back image of the car... |
# 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, softwa... |
import logging
import os
import shlex
import subprocess
import sys
from argparse import Namespace
import xdg
from catkin_tools.metadata import find_enclosing_workspace
from catkin_tools.terminal_color import ColorMapper
from catkin_tools.verbs import catkin_config, catkin_build
from future.moves.urllib.error import UR... |
# ******************************************************
# Program: stencil2d
# Author: <NAME>
# Email: <EMAIL>
# Date: 20.05.2020
# Description: Simple stencil example
# ******************************************************
import time
import math
import numpy as np
import click
import matplotl... |
#!/bin/python
""" Print a visualization of the lattice in html.
Start with building the DOT for the lattice.
"""
import sys
import logging
import os
import html
from string import Template
from fixrgraph.annotator.protobuf.proto_acdfg_pb2 import Acdfg
from fixrgraph.annotator.protobuf.proto_acdfg_bin_pb2 import La... |
import time
from tfcore.interfaces.ITraining import *
from cnn.architecture import Network, Network_Params
from tfcore.utilities.preprocessing import *
from tfcore.utilities.files import get_filename
class Trainer_Params(ITrainer_Params):
"""
Parameter-Class for Example-Trainer
"""
def __init__(self,... |
########
# Copyright (c) 2014 GigaSpaces Technologies 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... |
import pandas as pd
import numpy as np
import os
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import MinMaxScaler
###################### Acquire Spotify Data ######################
def acquire_spotify():
'''
This function reads the spotify data from the kaggle into a df,
... |
#!/usr/bin/env python
# coding: utf-8
# In[1]:
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import sys
from file_read_backwards import FileReadBackwards as readreverse
import math
examine_edge_option = 0
iteration = 30
threshold = 0.5 # to determine whether it's switched on or off after ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os.path
import logging
import datetime
import markdown
from dateutil.parser import *
from dateutil.relativedelta import *
import trialcondition
import trialmedication
import trialallergy
import triallab
import trialmutation
import clinicaltrials.jsondocument.jsond... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
import os
import sys
from django.core.exceptions import ImproperlyConfigured
# translation needed for date and time format setup
from django.utils.translation im... |
from traceback import print_tb
from flask import request, redirect
from sqlalchemy import or_, func
from sqlalchemy.orm.exc import NoResultFound
from app.api import bp
from app.api.auth import is_user_oc_member, authenticate
from app.models import Language, Resource, Category, Key
from app import Config, db
from app.... |
"""
Provide some tools to manipulate CogAlg frames and for debugging.
"""
import pickle
from collections import defaultdict
from itertools import chain, tee
import cv2
import numpy as np
import matplotlib.pyplot as plt
# -----------------------------------------------------------------------------
# miscs
def try_ex... |
import os, argparse,sys,pdb
import numpy as np
import time
from tqdm import tqdm
def parseArguments():
parser = argparse.ArgumentParser()
parser.add_argument('-e' , '--experimentType', type=int, choices = [0,1],required=True, help="0: Build SuccessVSFail Dataset - 1: Build FinalScorePrediction Dataset")
... |
#!/usr/bin/env python3
'''
Emulate the target app along the SE Proxy Hal server.
'''
import argparse
import binascii
import ctypes
from elftools.elf.elffile import ELFFile
from mnemonic import mnemonic
import os
import re
import signal
import socket
import sys
import pkg_resources
from mcu import apdu as apdu_serve... |
import sys
import time
from collections import namedtuple
from multiprocessing import cpu_count, Pool, Lock
from concurrent.futures import as_completed, ThreadPoolExecutor, ProcessPoolExecutor
from functools import partial
from pathlib import Path
from statistics import mean
from dataclasses import dataclass
from typin... |
# -*- coding: cp1253 -*-
from tkinter import *
from time import sleep
var = 0
def create(w, x1, y1):
w.place(x=x1, y=y1)
def erase(w):
w.destroy()
def reset(w):
w.destroy()
start()
def exit(w):
w.destroy()
def callback(event):
print("clicked at", event.x, event.y)
def clicked(event)... |
#!/usr/bin/python3
#========================================================
# Python script for linux to build a set of user archives
# on the primary server.
#--------------------------------------------------------
# Depends on the classifydir python module, and scans
# supplied paths for a user, outputting tar file... |
"""MPI Async Communication Interface."""
import io
import pickle
import logging
import collections
from mpi4py import MPI
from .evars import (
get_max_message_size,
get_min_send_size,
get_num_recv_buffers,
get_max_send_buffers,
)
COMM_WORLD = MPI.COMM_WORLD
WORLD_RANK = COMM_WORLD.Get_rank()
WORLD_S... |
#coding:utf-8
from pyglet.gl import *
import numpy as np
import OpenGL.GL.shaders
import ctypes
import pyrr
import time
from math import sin
from pyrr import Vector3, matrix44, Matrix44
import time
import numpy
class ObjLoader:
def __init__(self):
self.vert_coords = []
self.text_coords = []
... |
from typing import *
class CogniteResource:
pass
class CogniteUpdate:
pass
class CogniteFilter:
pass
class CognitePrimitiveUpdate:
pass
class CogniteObjectUpdate:
pass
class CogniteListUpdate:
pass
class CognitePropertyClassUtil:
@staticmethod
def declare_property(tmp):
... |
# do_extra_processing.py
from datetime import date
from extract_field_from_characterization_xml import extract_field_from_characterization_xml
def do_extra_processing(value: str or dict, extra_processing: str, json_field_definition: dict, bendo_server_base_url: str, schema_api_version: int, standard_json: dict) -> s... |
from src.AutoMLpy.parameter_generators import SearchType
from src.AutoMLpy import logs_file_setup, log_device_setup
from tests import execute_optimisation
import pandas as pd
import numpy as np
import plotly.graph_objects as go
import os
from src.AutoMLpy.tools import plotly_colors
import logging
import multiprocessing... |
# Owner(s): ["oncall: distributed"]
import functools
import itertools
import sys
import torch
import unittest
from torch import distributed as dist
from torch.cuda.amp.common import amp_definitely_not_available
from torch.distributed.fsdp.fully_sharded_data_parallel import ShardingStrategy
from torch.distributed.fsdp... |
#### tests for dataset.py (Dataset class) ####
# tested functions:
# load_combined_hemisphere_data
# Dataset - behaviour with different flags, active selection
# NOTE:
# these tests require a test dataset, that is created with get_test_data()
# executing this function may take a while the first time (while the ... |
# <NAME>
# <EMAIL>
# Developed for fun
# Feel free to use this code as you wish as long as you quote me as author
"""
map.py
~~~~~~~~~~
This module is for building map for the snake game
The map:
- Contains its structure in a matrix form (see MAP in constants.py)
- Contains a instance of a snake and an instance of a... |
from fpdf import FPDF
import os
from os import listdir
from os.path import isfile, join
import ghostscript
import locale
import win32com.client
from pdf2image import convert_from_path
import tempfile
import time
from PIL import Image, ImageDraw, ImageFont
cur = os.getcwd()
def start(prefix,vol_num,prod_num):
prod... |
import adsk.core
import adsk.fusion
import traceback
import os
import sys
sys.path.append(os.path.dirname(__file__))
from BMLib import (
genFrontPoints,
genBackPoints,
genLeftPoints,
genRightPoints,
genBottomPoints,
genTopPoints,
)
# global set of event handlers to keep them referenced for the... |
import time
from decimal import Decimal
import discord
from discord.ext import commands
from application.cogs import math as emath
class Gacha(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.command(name='sq',
description='Chances for a servant with x amount ... |
# 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, software
# d... |
#!/usr/bin/env python3
# (C) Copyright 2020 ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
# In applying this licence, ECMWF does not waive the privileges and immunities
# granted to it by virtue of its statu... |
import random
import dataclasses
@dataclasses.dataclass(frozen=True)
class Vec2:
x: int
y: int
def __add__(self, other):
return Vec2(self.x + other.x, self.y + other.y)
def __sub__(self, other):
return Vec2(self.x - other.x, self.y - other.y)
def turn(self, direction):
if di... |
'''
Defines all the SimConnect messages (both the sending messages and their responses) along
with functions for converting from raw data to messages. Messages are defined by the sender,
e.g. a client message is not a message *to* a client but a message *from* a client.
'''
import struct
classMap = {} # (fromAgent ('... |
"""
ald_grid
--------
for the purposes of this file ALD(or ald) refers to Active layer depth,
and PL (or pl) to Protective layer
"""
import numpy as np
from .constants import ROW, COL, create_deepcopy
import copy
from multigrids import TemporalMultiGrid, common
def random_grid (shape, minimum, maximum, mask = Non... |
from audioop import tomono
from platform import release
from typing import Sized
from pywhatkit.main import search
from pywhatkit.sc import cancelShutdown
import speech_recognition as sr
import pyttsx3
import pywhatkit
import datetime
import wikipedia
import pyjokes
import googlesearch
import os
import time
import date... |
import importlib
import importlib.machinery
import importlib.util
import itertools
import os
import os.path
import sys
from django.db import transaction
import modules.entrance.models
from . import models
r"""
Example of running
import modules.topics.models as models
q = models.TopicQuestionnaire.objects.get()
impo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.