text
stringlengths
3.07k
22.1k
from sqlalchemy import Column, Enum, ForeignKey, Integer, String, Text from sqlalchemy.ext.declarative import declared_attr, declarative_base from sqlalchemy.orm import relationship from sqlalchemy.schema import UniqueConstraint from sqlalchemy.inspection import inspect import bcrypt import enum class Base(object):...
"""Routing for user pages.""" from typing import Optional from datetime import datetime, timedelta from flask import Blueprint, render_template, request, flash, abort, url_for, \ redirect from flask_login import login_user, logout_user, current_user from flask_babel import _ from is_safe_url import is_safe_url fro...
import argparse import numpy as np # import tensorflow as tf import tensorflow.compat.v1 as tf tf.disable_v2_behavior() import data_loader import os import requests from OGRU import OGRU_cell from module import LSTM_cell, GRU_cell import timeseries_loader import time import matplotlib.pyplot as plt # from ppretty impor...
import logging import copy import six import json from brewtils.models import LoggingConfig class LoggingLoadingError(Exception): pass class PluginLoggingLoader(object): """A class for loading plugin logging configuration from files. Usually used by simply calling `load`. If given a filename, it will a...
#!/usr/bin/env python ''' CryptoKnight @gregorydhill ''' import os, sys, csv, shutil, datetime, argparse, subprocess, signal, math import numpy as np from src.generate import Generate from src.setup import alive, setup from src.title import title BASE = os.path.dirname(os.path.realpath(__file__)) HEAD = os.path.jo...
# Change Jira number custom filed value # 1) using REST API # 2) using Python lib # 27.7.2019 <EMAIL> # # NOTES: # 1) For this POC removed .netrc authetication, using pure arguments # 2) Requires Jira issue as a parameter (issue holds numberic custom field to be changed) # # Using Python V2 # #from __future__ import...
from pyrogram import Client, filters from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup, Message, CallbackQuery from config import Config import subprocess from threading import Thread from pykeyboard import InlineKeyboard import time import asyncio import re from os import mkdir, system import ff...
import math import os import requests from typing import Any import time import numpy as np from pandas.core.frame import DataFrame import pandas as pd from progress_keeper import Progress def timer(func) -> Any: """ Decorator used to time a function call. After function is run, the time of the functio...
#!/usr/bin/env python3 """ AGILE BLINKT! An Octopus Agile and Energy Consumption Visualizer. This script is written to be used with the Pimoroni Blinkt LED board, Octopus Energy Agile price tariff, and a live power consumption/export feed (e.g. from Open Emon CMS). Of course, you could use other ...
''' Created on 2021-01-04 @author: wf ''' import re import uuid from flask import render_template_string, request, Markup import os import site import sys import jinja2 from xml.dom import minidom from wtforms import FileField, StringField from wtforms.widgets import HTMLString, html_params class Widget(object): ...
# coding=utf-8 # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import itertools imp...
import numpy as np from pathlib import Path from scipy.ndimage import fourier_shift from skimage._shared import testing from skimage._shared.testing import assert_equal from skimage.data import camera from skimage.feature.register_translation import register_translation from skimage.feature.masked_register_translation ...
from os import mkdir, listdir from os.path import splitext, exists, join from PIL import Image, ImageOps from tqdm import tqdm import torchvision.transforms.functional as F import cv2 import numpy as np import os import math import shutil from .coordinate import get_information SOURCE_DIR = [join("original_data", "f0...
# -*- coding: utf-8 -*- import argparse import logging import math import os import os.path as path import random import shutil import sys from time import time import tensorflow as tf from tensorflow.python.client import device_lib import jtr.jack.readers as readers from jtr.jack.data_structures import load_labelle...
import subprocess, re import matplotlib.pyplot as plt import numpy as np import signal import tensorflow as tf #TODO clean up the code, import * has some strange features regarding sharing global variables. # It looks like they create copies inside these files. LINEAR_TOLERANCE = 1e-05 LINEAR_TOLERANCE_SCALE = 1e+05 ...
"""This package provides dataset models and methods as well as a DatasetClient""" import csv import gzip import ujson import ndjson from enum import Enum from logging import Logger from humps import decamelize from requests import Session from typing import List, Dict from dataclasses import dataclass, asdict, field fr...
# -*- coding: utf-8 -*- # cli.py # Copyright (c) 2014-?, <NAME> # 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 copyright # notice, th...
#coding: utf8 """ rat-facts.py - Fact reciting module Copyright 2015, Dimitri "Tyrope" Molenaars <<EMAIL>> Copyright 2016, Daniel "Dewin" Grace Licensed under the Eiffel Forum License 2. These modules are built on top of the Sopel system. http://sopel.chat/ """ import json import os.path import re import glob import ...
import os import numpy as np from tqdm import tqdm import pickle import torch import random import torch.nn as nn import torch.nn.functional as F from torch.utils.data import DataLoader from torch.utils.data import Dataset from sklearn.metrics import accuracy_score class ARGS(): def __init__(self): self.cud...
import pygmsh import numpy as np import simfempy __pygmsh6__ = False if hasattr(pygmsh, "built_in"): __pygmsh6__ = True # ------------------------------------- # def unitline(h): if __pygmsh6__: geom = pygmsh.built_in.Geometry() p0 = geom.add_point([0, 0, 0], lcar=h) p1 = geom.add_point([1...
# note: modules are imported in each function to reduce overhead when using these utilities. This way, only the modules # that are needed for the functions you use will be imported, rather than the modules needed for all utilities. import numpy as np import os def reduced_chi_sq(model, data, errors, num_parameters): ...
""" Created on 05/March/2021 File that contains processing of trajectory datasets, available in '../datasets(...)' folders, assuming fixed length This is what is used by social GAN method. Some differences may be present, but they are minimal @inproceedings{gupta2018social, title={Social GAN: Socially Acceptable Tr...
import os import numpy as np import matplotlib.pyplot as plt import pylab TIME_PAUSE = 2.0 RANGE_SHADE = 1.96 COLORS = [ 'red', 'blue', 'green', 'orange', 'purple', 'olive', 'darkred', 'deepskyblue', 'limegreen', 'lightsalmon', 'navy', 'aquamarine', 'rosybrown', ...
import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import numpy as np from scipy import ndimage from scipy.spatial.distance import euclidean from scipy.optimize import linear_sum_assignment import pandas as pd from pdb import set_trace as bp import os import iocsv def computeAssignment(list_dete...
import logging from typing import Any, Iterable, Iterator, Optional import psycopg from psycopg import Connection logger = logging.getLogger(__name__) def connect_db(db_config: dict[str, str]) -> Connection: return psycopg.connect(**db_config) class SimpleDatabase: def __init__(self, connection: Connectio...
import datetime from django.conf import settings from django.core.cache import cache from django.db import models, transaction from django.urls import reverse from reversion import revisions as reversion from xSACdb.roles.functions import is_instructor, is_training from xsd_auth.permissions import ModelPermissions,...
# -*- coding: utf-8 -*- # __author__:<NAME> # 2021-01-20 from abc import ABC import torch import torch.nn as nn from ..layers import Conv2dBNLayer, ResidualBlock from . import register_rec_backbone, register_det_backbone def make_divisible(v, divisor=8, min_value=None): if min_value is None: min_value = ...
""" Config formatting code. @NOTE this code has gone through three major iterations, starting with a single function, expanded to be module, expanded further with regex, expanded again with centralized processing using regex, and finally this parser. Some of the comments may be out of date. """ import logging...
import logging import os import sys from ansible.errors import AnsibleError, AnsibleParserError from ansible.plugins.lookup import LookupBase class LookupModule(LookupBase): def __init__(self, loader=None, templar=None, **kwargs): LookupBase.__init__(self, loader=None, templar=None, **kwargs) def look...
''' Module: Add various types of annotations to a plot. ''' from pylab import * import numpy as np from matplotlib.patches import * import matplotlib.pyplot as plt # set default value def set_default(arguments, separator, length, default, conversion='none', consistent=False): if arguments is not None...
'''This module contains functions related to raw metrics. The main function is :func:`~radon.raw.analyze`, and should be the only one that is used. ''' import tokenize import operator import collections try: import StringIO as io except ImportError: # pragma: no cover import io __all__ = ['OP', 'COMMENT', ...
import requests import json import time import tkinter as tk from tkinter import * ########### API Functions - data fetching from api.warframestat.us def fetchTimer(): response = requests.get("https://api.warframestat.us/pc/cetusCycle") #get my data to display data =response.json() # some formatting to do...
################################################################################ # Authors: # · <NAME> - <EMAIL> # · <NAME> - <EMAIL> # File: Clasificador.py # Date: Oct. 24, 2020 # Project: Assignment 1 Fundamentals of Machine Learning # File Description: Implementation of class 'Clasificador'. T...
# MIT LICENSE Copyright (c) 2018 <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, publish, d...
import googlemaps import requests import json import string import time as tee from django.http.response import JsonResponse from django.views.decorators.csrf import csrf_exempt from django.contrib.auth import login from django.utils.decorators import method_decorator from rest_framework import generics, permissions,...
# Copyright 2019-2020 Xanadu Quantum Technologies 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...
# Written by <NAME> import copy import warnings import numpy as np from torch.utils.data import DataLoader from ..utils.dist_utils import get_dist_info from .datasets import build_dataset from .samplers import build_test_sampler, build_train_sampler from .transformers import build_test_transformer, build_train_trans...
import torch from torch import nn import torch.nn.functional as F from torchvision import datasets, transforms import torch.optim as optim from torch.autograd import Variable from torchvision.utils import save_image import numpy as np import os from tqdm import tqdm import argparse par = argparse.ArgumentParser() par....
# -*- coding: utf-8 -*- """ @author: <NAME> need to get a price based of run time (will need 2nd compressor data) free air cooling time / year or time peroid % of time in free cooling actual time in free cooling price for whole year """ import pandas as pd from datetime import datetime...
# Copyright 2018 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...
from collections import defaultdict from datetime import datetime import os from lxml import etree import nltk from nltk.corpus import framenet as fn_en from .rdf_utils import get_rdf_label, get_lu_identifier, load_graph def get_sentence(wf_els): tokens = [wf_els[0].text] for prev_wf_el, cur_wf_el in zip(...
import json import gzip import os import subprocess import eel import gevent import pytest import backend import backend.sim import backend.utils def call_exposed_api(func, *args): if func == backend.sim.start: gevent.spawn(func, *args) else: func(*args) # yield the CPU so that the func ...
""" Tests for fastuaparser. """ import os import json import time from fastuaparser import parse_ua ua_file = os.path.join(os.path.dirname(os.path.abspath(__file__)), "ua_data.json") if not os.path.isfile(ua_file): raise RuntimeError("ua_data.json does not exist, maybe run generator script first?") # Some uas ...
"""This module contains functions for validating an XIR program""" import re from decimal import Decimal from itertools import chain from typing import MutableSet, Optional, Sequence, Union from xir.decimal_complex import DecimalComplex from xir.program import Declaration, ObservableStmt, Param, Program, Statement, W...
# 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 unittest import uuid as u import foowise.test.Assert as Assert import foowise.channels.Cla as C import foowise.channels.InfoPair as I import foowise.channels.Index as Id class Test_Cla(unittest.TestCase): def assertValid(self, c, tok, typ): message = str(tok) + " |= " + str(typ) self.as...
import discord import db, utils from math import floor from config import ADMIN_ACCESS, CMD_PREFIX, RANKS, SERVER_URL from user import parse_mention ADMIN_HELP_MES = ( f"Give XP to a user: `{CMD_PREFIX}addxp USER XP` (Can be negative)\n" f"Define a custom message: `{CMD_PREFIX}define NAME [%mention%] MESSAGE`\...
"""SCRU128: Sortable, Clock and Random number-based Unique identifier""" from __future__ import annotations __all__ = [ "scru128", "scru128_string", "Scru128Generator", "Scru128Id", ] import datetime import enum import re import secrets import threading import typing # Maximum value of 48-bit times...
import shutil import typing as t import logging from typing import TYPE_CHECKING from simple_di import inject from simple_di import Provide from bentoml import Tag from bentoml import Runner from bentoml.exceptions import BentoMLException from bentoml.exceptions import MissingDependencyException from ..types import ...
# encoding: utf-8 """ Initializes oxml sub-package, including registering custom element classes corresponding to Open XML elements. """ from __future__ import absolute_import from lxml import etree from .ns import NamespacePrefixedTag, nsmap # configure XML parser element_class_lookup = etree.ElementNamespaceCla...
import pandas as pd import numpy as np import yaml import json import sys import os.path # from openpyxl import load_workbook import re import requests import unicodedata import time import schema import argparse import functools sys.path.append('/home/mika/Bookmarks/c3_cloud_client') from c3cloud_semanticmapper_clie...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Script showing how to select only text that is contained in a given rectangle on a page. We use the page method 'getTextWords()' which delivers a list of all words. Every item contains the word's rectangle (given by its coordinates, not as a fitz.Rect in this c...
import pytest from colors import color from pygments import highlight from pygments.formatters.terminal import TerminalFormatter from pygments.lexers import get_lexer_by_name from cmr.renderer import TerminalRenderer, render from cmr.tables import TableRenderer from cmr.theme import DEFAULT_THEME def test_headings...
import numpy as np import pytest from sympy import Derivative, simplify, diff from conftest import skipif from devito import (Grid, Function, TimeFunction, Eq, Operator, clear_cache, NODE, ConditionalDimension, left, right, centered, generic_derivative) from devito.finite_differences import Differe...
"""Asynchronous HTTP client for swaggerpy Copyright (c) 2014, <NAME> <NAME> <<EMAIL>> This program is free software, distributed under the terms of the MIT License (MIT) This module provides an asynchronous HTTP client for SwaggerPy, along with supporting classes. The asynchronous HTTP client uses a twisted HTTP age...
import re import os import requests import datetime import json import pytz from blogapp.models import Hole, HoleComment class Comment(object): def __init__(self, cid='', pid='', text='', time=''): self.cid = cid self.pid = pid self.text = text self.time = time class Post(object...
import os from celery import Celery from flask import Flask, g from gopublish.api.file import file from gopublish.api.token import token from gopublish.api.view import view from ldap3 import Connection, NONE, Server import requests # Import model classes for flaks migrate from .db_models import PublishedFile # n...
""" Create files on disk for user defined projects registered on alyx. Will create a new project with users and subjects from Alyx info Creates project if exists on Alyx Create default rig subjects and all subjects associated to the project_name Create default user and currently logged in user (uses ONE params ALYX_USE...
import argparse import enum import importlib import inspect import logging import os import pathlib import pkgutil import pydoc import sys logger = logging.getLogger(__name__) class Type(enum.Enum): MODULE = 1 CLASS = 2 FUNCTION = 3 def report(coverage, output, output_types, is_all=False): """ ...
import sys import random def read_file(filename): eFile = open(filename, 'r') content = eFile.read() eFile.close() return content # takes an int def readable(x): i = 0 s = str(x) while i < (len(str(x))-1) / 3: s = s[:-3*(i+1)-i] + "," + s[-3*(i+1)-i:] i += 1 return s def uniq(array): seen = set(...
from concurrent.futures import ProcessPoolExecutor from pathlib import Path from tempfile import TemporaryDirectory import pytest from gallica_autobib import pipeline from gallica_autobib.pipeline import BibtexParser, InputParser, RisParser @pytest.fixture() def bibtex_parser(): """A bibtex parser which download...
# -*- coding: utf-8 -*- import sys import os sys.path.append(os.path.abspath("..")) import curses from termux2d import Canvas, line from time import sleep from thread import start_new_thread from Queue import Queue import locale from random import randint locale.setlocale(locale.LC_ALL,"") stdscr = curses.initscr() ...
#!/usr/bin/python3 # Copyright 2021 Red Hat, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # ...
## AUTHOR: <NAME> ################################################################################## # main.py ################################################################################## import argparse import pickle import matplotlib.pyplot as plt import numpy as np from IE643_160050064_src import criterion,...
import pygame from gameobjects_local.vector2 import Vector2 from pygame.locals import * # CONSTANTS UP = "UP" DOWN = "DOWN" LEFT = "LEFT" RIGHT = "RIGHT" # class GameControl(object): def __init__(self): self.key_direction = Vector2(0,0) self.action = None #self.key_direction = None ...
""" Help function for the app Get list of states, Get DataFrame of the businesses around point """ import json, csv from pathlib import Path import itertools as itts from operator import itemgetter from typing import List, Dict, Tuple import requests import pandas as pd from sqlalchemy import distinct from geoalche...
# # Copyright (c) 2015 Nutanix Inc. All rights reserved. # import inspect import logging import math import os import socket import time from functools import wraps import requests from curie.curie_error_pb2 import CurieError, ErrorRet from curie.curie_extensions_pb2 import descriptor_pb2 from curie.curie_server_sta...
import os import numpy as np from collections import OrderedDict from shutil import copyfile import imageio import glob import datetime import sys class Logger(object): def __init__(self, log_path): self.terminal = sys.stdout self.log = open(log_path, "a") def write(self, message): s...
from collections import Counter import nltk, spacy, numpy as np from rake_nltk import Rake def get_pos_group(idx): if idx == 1: return ["AUX", "VERB", "PART"] elif idx == 2: return ["NOUN", "NUM", "PRON", "PROPN"] elif idx == 3: return ["ADJ", "ADV", "ADP", "INTJ", "SCONJ"] def mas...
#!/usr/bin/env python3 # -*- coding: utf8 -*- # SPDX-FileCopyrightText: 2022 UdS AES <https://www.uni-saarland.de/lehrstuhl/frey.html> # SPDX-License-Identifier: MIT """Translation of information about a FMU to RDF""" import json import os import fmpy import pydash import rdflib from loguru import logger from rdfl...
__doc__ = """ """ __author__ = "<NAME>" print("Importing `.materials.electron.makeBrem`") from ...settings import __montecarlo__ __path__ = __montecarlo__/'materials'/'electron'/'NRC_BREM' __data__ = str(__path__) + '/nrc_brems_' # External Imports from numpy import array from numpy import zeros from numpy import...
from sklearn.metrics import matthews_corrcoef import numpy as np def customized_precision_recall_fscore_support(MCM, beta=1.0, labels=None, pos_label=1, average="binary", warn_for=('precision', 'recall', ...
from django import forms from django.conf import settings from django.contrib.auth.decorators import login_required from django.core.urlresolvers import reverse from django.shortcuts import redirect from django.shortcuts import render from django.utils.translation import ugettext as _ from assopy import forms as afor...
import os import logging import jiant.proj.main.preprocessing as preprocessing import jiant.shared.caching as shared_caching import jiant.shared.model_resolution as model_resolution import jiant.shared.model_setup as model_setup import jiant.tasks as tasks import jiant.tasks.evaluate as evaluate import jiant.utils.zco...
""" @author: Phi-C @date: 20220118 """ import os import glob import time import random from multiprocessing import Process, Queue import sys sys.path.append('/mnt/e/workspace/FaceX-Zoo/') sys.path.append('/mnt/e/workspace/FaceX-Zoo/face_sdk') import logging.config logging.config.fileConfig("config/logging....
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Feb 23 15:55:18 2022 @author: katie """ #import svd_sm import ancc import cv2 as cv import matplotlib.pyplot as plt import math import numpy as np def pipeline(image_L, image_R): matches_windows_indices_L_and_R = svd_stereo_matching(image_L, image...
#!/usr/bin/env python # # Copyright (C) 2016 The Android Open Source Project # # 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 req...
import contextlib import json import secrets import time import boto3 from botocore.exceptions import ClientError from tenacity import retry, stop_after_delay, wait_fixed ACCOUNT_ID = "975596993436" READ_ONLY_ROLE_ARN = "arn:aws:iam::975596993436:role/storage-read_only" DEV_ROLE_ARN = "arn:aws:iam::975596993436:rol...
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters import matplotlib.pyplot as plt import requests import numpy as np import telegram import logging # OpenDota Constants openDotaMatchInfoCall = "https://api.opendota.com/api/players/{}/matches?limit={}" matchesToJudge = 15 timeTable = "week" # On...
import sys import time from PyQt5.QtCore import QSize, Qt, QRunnable, QThreadPool, QTimer from PyQt5.QtGui import QIcon from PyQt5.QtWidgets import (QComboBox, QDockWidget, QVBoxLayout, QToolBar, QSizePolicy, QMessageBox, QLineEdit, QGroupBox, QDialog, ...
import warnings import time import random from pybullet_planning import INF, Pose from pybullet_planning import multiply, wait_for_user from pychoreo.utils import is_any_empty from pychoreo.cartesian_planner.ladder_graph import LadderGraph, append_ladder_graph from pychoreo.cartesian_planner.dag_search import DAGSear...
import json import re import subprocess from argparse import ArgumentParser from collections import namedtuple from pathlib import Path import numpy as np from matplotlib import pyplot as plt # gcloud alpha compute tpus tpu-vm scp thomas-dev-tpu:~/arch_objective_exps_v2 . --zone us-central2-b --recurse def get_args...
# camera-ready import sys from datasets import DatasetTrain, DatasetVal # (this needs to be imported before torch, because cv2 needs to be imported before torch for some reason) sys.path.append("/mnt/sdc/yuxianwang/deeplabv3/model") from model.deeplabv3 import DeepLabV3 sys.path.append("/mnt/sdc/yuxianwang/deeplabv3...
from time import time import pandas as pd import pytest import tenacity as tny from pydantic import create_model from toucan_connectors.common import ConnectorStatus from toucan_connectors.google_sheets_2.google_sheets_2_connector import GoogleSheets2Connector from toucan_connectors.mongo.mongo_connector import Mongo...
import numpy as np import torch from rlcore.algo import JointPPO from rlagent import Neo from mpnn import MPNN, GatedMPNN from utils import make_multiagent_env def setup_master(args, env=None, return_env=False): if env is None: env = make_multiagent_env(args.env_name, num_agents=args.num_agents, dist_thre...
"""Helper classes.""" import os import datetime import logging import time import threading import subprocess import sys import queue import signal from typing import List, Tuple, Dict from enum import Enum import pytz import pytz.tzinfo import pushover log = logging.getLogger("pyrestreamer") class Service(): ...
#!/usr/bin/env python # vim:fileencoding=utf-8 from urllib.request import Request, urlopen from urllib.error import HTTPError, URLError from acme_lite.error import ACMEError from acme_lite.utils import linkurl from cryptography import x509 from cryptography.hazmat.primitives import serialization from cryptography.hazm...
""" fal telemetry code uses source code from: https://github.com/ploomber/ploomber Modifications are made to ensure that the code works with fal. """ import datetime import http.client as httplib import warnings import posthog import pkg_resources import yaml import os from pathlib import Path import sys import uuid...
from gluonnlp.utils.lazy_imports import try_import_sentencepiece,\ try_import_subword_nmt, try_import_yttm, try_import_huggingface_tokenizers import argparse import textwrap import os from collections import OrderedDict import json from uuid import uuid4 from gluonnlp.data import Vocab def get_parser(): parse...
import datetime import json import optparse import string import sys import iotbx.cif.model import xia2.XIA2Version from cctbx.xray import scatterer from cctbx.xray.structure import structure from iotbx.reflection_file_reader import any_reflection_file from iotbx.shelx import writer from iotbx.shelx.hklf import miller...
# -*- coding: utf-8 -*- from unittest.mock import patch import environ import pytest from selenium import webdriver from selenium.webdriver.chrome.options import Options from wagtail_factories import SiteFactory from core import cms_slugs, helpers as core_helpers from directory_api_client import api_client from direc...
import collections import os import glob import nltk import torch import numpy as np import faiss import requests import io import PIL from CLIP import clip from nltk.tokenize import wordpunct_tokenize from pathlib import Path from tqdm import tqdm from PIL import Image from torch.utils.data import DataLoader from tor...
# -*- coding: utf-8 -*- # Copyright (c) 2012 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Test the filelib module.""" from __future__ import print_function import os import shutil from chromite.lib import cros_...
import pickle import numpy as np import zipfile import gzip import os import random import copy from collections import OrderedDict from astrodash.create_arrays import AgeBinning, CreateLabels, ArrayTools, CreateArrays from astrodash.helpers import temp_list random.seed(42) class CreateTrainingSet(object): def ...
# Authors: CommPy contributors # License: BSD 3-Clause """ ================================================== Modulation Demodulation (:mod:`commpy.modulation`) ================================================== .. autosummary:: :toctree: generated/ PSKModem -- Phase Shift Keying (PSK) Modem. QA...
import json import os import sys from datetime import datetime from io import UnsupportedOperation from os.path import join from pathlib import Path from time import time import numpy as np from kivy.app import App from kivy.clock import Clock from kivy.core.window import Window from kivy.lang import Builder import c...
import os os.environ["NUMBA_DISABLE_JIT"] = "1" import geopandas as gpd import numpy as np import pandas as pd import pytest import shapely.geometry as sg import xarray as xr from xugrid.snapping import snap_nodes, snap_to_nodes, snap_to_structured_grid def test_snap__three_points(): x = y = np.array([0.0, 1.0...
import lsf import liontk from liontk.symbols import * editor_code = """ ttk::panedwindow .editor.p -orient horizontal ttk::frame .editor.p.l -width 300 -height 1000 -padding "5 5 0 5" ttk::treeview .editor.p.l.tree -selectmode browse -yscrollcommand ".editor.p.l.s set" ttk::scrollbar .editor.p.l.s -orient vertical ...
import tensorflow as tf import numpy as np import sys import os import glob import scipy.io import skimage.io from PIL import Image sys.path.append("..") import third_party.rasterize_triangles as rasterize from utils.basis import load_3dmm_basis, get_geometry from utils.const import * from utils.misc import tf_blend_u...
from django.contrib.auth.models import User from django.conf import settings from rest_framework import serializers, pagination from rest_framework.fields import Field import pytz from datetime import datetime, timedelta from talks.events.models import Event, Person, EventGroup from talks.users.models import Collecti...