text
stringlengths
957
885k
<filename>corehq/apps/accounting/enterprise.py import re from datetime import datetime, timedelta from django.utils.translation import ugettext as _ from memoized import memoized from couchforms.analytics import get_last_form_submission_received from dimagi.utils.dates import DateSpan from corehq.apps.accounting.ex...
<filename>bluesky_widgets/qt/search_results.py<gh_stars>0 import collections import logging from qtpy import QtCore from qtpy.QtCore import ( QAbstractTableModel, # QItemSelection, # QItemSelectionModel, QTimer, Qt, ) from qtpy.QtWidgets import QAbstractItemView, QHeaderView, QTableView from .thre...
<filename>createProject.py #!/usr/bin/python # -*- coding: UTF-8 -*- #import urllib.request #from urllib import request,parse # pip install ruamel.yaml import sys import os import getopt import time import io import git from git import Repo import ruamel.yaml from ruamel.yaml.util import load_yaml_guess_indent p...
<gh_stars>1-10 ############################################################################################## # Copyright 2017 The Johns Hopkins University Applied Physics Laboratory LLC # All rights reserved. # Permission is hereby granted, free of charge, to any person obtaining a copy of this # software and ass...
from datetime import datetime, timezone from django.core.management.base import BaseCommand import logging from multiprocessing import Process, Queue from organisation.models import DepartmentUser, CostCentre, Location from organisation.utils import ms_graph_users def get_users(queue): # Worker function to call ...
<filename>pyuac/main_decorator.py #!/usr/bin/env python # -*- coding: utf-8; mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vim: fileencoding=utf-8 tabstop=4 expandtab shiftwidth=4 """ See main_requires_admin """ from __future__ import absolute_import import os import sys from logging import getLogge...
# pyGestalt Mechanics Module """A set of objects and methods for defining, analyzing, and utilizing mechanisms.""" #---- INCLUDES ---- import math from pygestalt import errors, units, utilities, geometry class transformer(object): """Base class for all types that transform from one state to another. M...
# -*- coding: utf-8 -*- import unittest from mahjong.ai.shanten import Shanten from utils.tests import TestMixin class ShantenTestCase(unittest.TestCase, TestMixin): def test_shanten_number(self): shanten = Shanten() tiles = self._string_to_34_array(sou='111234567', pin='11', man='567') ...
# 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...
<reponame>Tenderize/audius-protocol from datetime import date, timedelta import redis from src.challenges.challenge_event_bus import ChallengeEvent, ChallengeEventBus from src.challenges.track_upload_challenge import track_upload_challenge_manager from src.models import Block, Track, User from src.models.models import...
<gh_stars>1-10 """ Runs a communication test with a target node.""" # ---- IMPORTS ---- from pygestalt import nodes, config import time #for clocking data exchange rate import csv #for outputting data # ---- SYNTHETIC MODE ---- # config.syntheticModeOn() #Un-comment this line to run in synthetic mode (i.e. test mode...
<reponame>froec/BQonRDM import numpy as np from core import geodesics from core import utils from bayesquad.bq_wrapper import BQWrapper import time import copy import dill class LandQuadrature(): def __init__(self, land): self.land = land self.integration_params = land.integration_params ...
from __future__ import annotations from typing import Any, Dict, Optional from .ast import TypeEnum, Type, TermEnum, Term, SemEnum, Sem from .util import errorln __all__ = ("reflect", "reify", "meaning", "nbe") class Ctx: """Typing context""" def __init__(self): self._d: Dict[str, Any] = {} de...
from functools import lru_cache import logging from elecsim.plants.fuel.fuel_registry.fuel_registry import fuel_registry, plant_type_to_fuel from elecsim.plants.plant_type.power_plant import PowerPlant from elecsim.role.plants.costs.fuel_plant_cost_calculations import FuelPlantCostCalculations logger = logging.getL...
<reponame>chivandikwa/pulumi-aws # coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequenc...
############################################################################### # Copyright (c) 2021 Habana Labs, Ltd. an Intel Company # # SPDX-License-Identifier: Apache-2.0 # ############################################################################### """Snapshot script for analysis/debug of models in Habana mod...
<gh_stars>10-100 import random from Levenshtein import distance from fastapi import FastAPI, HTTPException from pydantic import BaseModel from playwright.async_api import async_playwright, Playwright, Browser, Page import shortuuid import cv2 import numpy as np from typing import Any, Dict, List, Optional, Tuple app ...
#!/usr/bin/python # -*- coding: utf-8 -*- # author: FesianXu # 20210227 import json import copy import os import sys import argparse UNK_MARK = "" CATE_SPLIT_MARK = '.' PAGES_MARK = '--' CSV_SPLIT_MARK = ',' ROOT_MARK = "root" REGISTER_CATE_JSON = '../papers_categories/register_categories.json' CA...
<reponame>SayanGhoshBDA/code-backup<filename>python/advanced_sw/GIT-SCRAPER/scraper.py<gh_stars>10-100 import json from pprint import pprint from selenium import webdriver from bs4 import BeautifulSoup from pathlib import Path from tqdm import tqdm import json import time import urllib.request, urllib.parse, urllib.err...
<filename>hmlvaraus/api/hml_reservation.py<gh_stars>1-10 import arrow import django_filters import re import hashlib import logging from arrow.parser import ParserError from django.core.exceptions import PermissionDenied, ImproperlyConfigured, SuspiciousOperation, ValidationError from django.utils import timezone from ...
"""Tests for command handling""" from __future__ import annotations import argparse from contextlib import contextmanager import os import pytest from sopel import config from sopel.cli.run import ( build_parser, get_configuration, get_pid_filename, get_running_pid, ) TMP_CONFIG = """ [core] owner ...
<filename>python_indent.py #!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2013 <NAME> <<EMAIL>> # This file is released under the terms of the MIT license. """ Python PEP8 indent Sublime text plugin for automatic PEP8-style indent. """ import re import traceback from itertools import izip try: ...
<filename>lib/models/transformer_encoding.py import copy from turtle import forward import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from typing import Optional from torch import Tensor from .position_encoding import build_position_encoding, _onnx_nested_tensor_from_tensor_list from...
<filename>test/test_bleu.py # Copyright 2017 Amazon.com, Inc. or its affiliates. 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. A copy of the License # is located at # # http://aws.amazon.com/apache2.0/ # # ...
from PyQt5 import QtWidgets from PyQt5.QtWidgets import QMainWindow, QTableWidget from PyQt5.uic import loadUi from src.Users.View.UserCardView import UserCardView from src.Users.controllers.UserManager import UserManager from src.Utils.UI import Popup, DeletePopup, EnableDisableUserPopup class UserView(QMainWindow):...
<reponame>DeepRank/DeepRank_VariantPred<gh_stars>0 import os from tempfile import mkdtemp, mkstemp from shutil import rmtree import h5py import numpy import torch.optim as optim from nose.tools import ok_ from deeprank.models.variant import PdbVariantSelection from deeprank.generate.DataGenerator import DataGenerator...
import streamlit as st st.set_page_config(layout="wide") import argparse import numpy as np import torch from additional_utils.models import LSeg_MultiEvalModule from modules.lseg_module import LSegModule from PIL import Image import matplotlib.pyplot as plt from encoding.models.sseg import BaseNet import matplotl...
<reponame>weihaosky/SMVmatching import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import pytorch_ssim import time import IPython, cv2 SSIM_WIN = 5 class WrappedModel(nn.Module): def __init__(self, module): super(WrappedModel, self).__init__() self.module = module # that I act...
""" MIT License Copyright (c) 2021 <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, distri...
<reponame>cmlino/scraper from dotenv import load_dotenv import os import requests from bs4 import BeautifulSoup import json import re load_dotenv() def addConflicts(data): for department in data: for course in department["courses"]: for section in course["sections"]: section["...
<reponame>ComputermindCorp/DeepEye<gh_stars>1-10 # django libs from django.http import FileResponse from django.core.serializers import serialize from django.utils import translation from django.utils.translation import gettext # deepeye setting & models & form from main.models import Project from .models imp...
<filename>tests/unit/__init__.py # -*- coding: utf-8 -*- import json import os from mock import Mock DIRPATH = os.path.dirname(__file__) FIXTURES = os.path.join(DIRPATH, 'fixtures') def create_response(status, fixture=None): def request(*args, **kwargs): response = Mock() response.status_code =...
#!/bin/env python #encoding=utf-8 import re import lxml import lxml.html try: from urllib.parse import urlparse except ImportError: from urlparse import urlparse from .tags_util import clean_tags_only, clean_tags_hasprop, clean_tags from .region import Region class PageModel(object): def __init__(self, pa...
<filename>serie2/summe.py # coding=utf-8 # Authors: <NAME> (lambertt) and <NAME> (odafaluy) from __future__ import print_function import time import numpy as np import Console as Console import Sum as Sum import warnings warnings.filterwarnings("ignore") class AddendGenerator: """Provides algorithms to genera...
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Tests for traffic control library.""" import unittest import traffic_control class TrafficControlUnitTests(unittest.TestCase...
# coding: utf-8 """ Base para desarrollo de modulos externos. Para obtener el modulo/Funcion que se esta llamando: GetParams("module") Para obtener las variables enviadas desde formulario/comando Rocketbot: var = GetParams(variable) Las "variable" se define en forms del archivo package.json Para modifica...
<reponame>Thomasjkeel/Exploratory-Data-Analysis-GUI<gh_stars>0 ## useful references: # http://www.science.smith.edu/dftwiki/index.php/PyQt5_Tutorial:_A_Window_Application_with_File_IO # https://blog.aaronhktan.com/posts/2018/05/14/pyqt5-pyinstaller-executable # https://realpython.com/pyinstaller-python/ import os impo...
<gh_stars>10-100 #!/usr/bin/python3 r'''Tests special-case projection functions Simple things like project_lonlat(), project_stereographic(), etc. I do 3 things: Here I make sure the projection functions return the correct values. This is a regression test, so the "right" values were recorded at some point, and any...
<reponame>tradenity/python-sdk<filename>tradenity/resources/shopping_cart.py # coding: utf-8 """ Tradenity API Tradenity eCommerce Rest API Contact: <EMAIL> """ from __future__ import absolute_import import re import pprint # python 2 and python 3 compatibility library import six from tradenity.api...
<gh_stars>0 import os import sys import time import json import socket import base64 import struct import logging import platform import subprocess import threading from enum import Enum from types import SimpleNamespace # ==============================================================================...
<reponame>leniartek/trino-admin # -*- coding: utf-8 -*- # # 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...
<reponame>tcosmo/coreli """ This file contains the relevant tools to study predecessor sets in the Collatz graph.\ In particular, it is proven in `https://arxiv.org/abs/1907.00775 <https://arxiv.org/abs/1907.00775>`_\ that these sets can be partionned in **Regular Languages**.\ We provide the tools to const...
<filename>src/python/pants/rules/core/strip_source_roots_test.py # Copyright 2019 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from pathlib import PurePath from typing import List, Optional, Union from unittest.mock import Mock import pytest from p...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import types import cv2 import pandas as pd import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from models import get_model from losses import get_loss from transforms impor...
<gh_stars>0 _base_ = '../../_base_/models/movinet/movinetA2.py' model = dict( cls_head=dict( type='MoViNetHead', in_channels=640, hidden_dim=2048, num_classes=600, spatial_type='avg', tf_like=True, causal=False, conv_type='3d', dropout_ratio=0...
<reponame>ComputerSystemsLaboratory/YaCoS #! /usr/bin/env python3 """ Copyright 2021 <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 requ...
# coding: utf-8 ''' magi.machine ~~~~~~~~~~~~ A simple virtual machine implement. ''' from magi import const, utils from magi.instruction import Instruction class MachineRunError(RuntimeError): '''Machine runtime error.''' class MachineHalt(StopIteration): '''Halt machine.''' machine_state_...
<gh_stars>0 """ Data base to save and recall motor positions Author: <NAME> Date created: 2019-05-24 Date last modified: 2019-05-31 """ __version__ = "1.0.5" # issue: __builtins__.getattr: 'dict' object has no attribute 'getattr' # Solution: made setattr, getattr static methods from logging import debug,info,warn,erro...
<filename>numpyro/nn/block_neural_arn.py<gh_stars>1000+ # Copyright Contributors to the Pyro project. # SPDX-License-Identifier: Apache-2.0 import numpy as np import jax from jax import random from numpyro.util import _versiontuple if _versiontuple(jax.__version__) >= (0, 2, 25): from jax.example_libraries impo...
""" Pyro4 compatibility layer for RA's support module. """ import logging import time import os import signal import re import Pyro4 from support.tunneling import Tunnel from support.process import invoke, search_response, BasicProcess from support.logs import logging_config from pyro3_util import full_name from pyr...
<reponame>Arlind1992/PolimiResearch #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Feb 19 16:27:01 2019 @author: arlind """ import ai_analysis.join_data_different_sources as ds import sys import pandas as pd from PyQt5.QtWidgets import QApplication, QMainWindow, QMenu, QVBoxLayout, QSizePol...
#!/usr/bin/env python import sys from collections import defaultdict from networkx import shortest_path import json iii = None def pathFromRoot(graph, cand, node, root): nodes = shortest_path(graph, root, node) pathComponents = [root] waypoints = nodes[0:-1] for (f,t) in zip(waypoints, waypoints[1:])...
<reponame>itavero/revprox #!/usr/bin/env python3 import argparse from git import Repo from pathlib import Path import sys from blessings import Terminal import os import yaml import pprint import sewer import traceback from datetime import datetime, timedelta from OpenSSL import crypto import nginx from shutil import w...
import io import zipfile from datetime import date from unittest.mock import patch import pytest from applications.enums import ApplicationStatus, BenefitType from applications.services.ahjo_integration import ( export_application_batch, generate_composed_files, generate_single_approved_file, generate_...
<gh_stars>0 # -*- coding: utf-8 -*- """ Created on Wed Jul 12 12:09:37 2017 @author: alxgr """ import numpy as np import matplotlib.pyplot as plt from scipy.interpolate import RectBivariateSpline as interpol2D from scipy.interpolate import griddata from scipy.interpolate import LinearNDInterpolator ''' ###########...
<filename>DirectoryCreate/DirectoryCreateEngine.py """ AyxPlugin (required) has-a IncomingInterface (optional). Although defining IncomingInterface is optional, the interface methods are needed if an upstream tool exists. """ import os, sys os.environ['PATH'] = r'C:\program files\Alteryx\bin;' + os.environ['PATH'] sy...
<filename>streamlabswater/stream.py from urllib.parse import urljoin, urlencode import requests import os class Stream(object): __STREAMLABSWATER_API_HOST = "" def __init__(self, api_key: str = None, api_host:str = None): api_key= api_key or os.environ.get('STREAMLABSWATER_API_KEY') if api_k...
<filename>cloneAlexNet.py import os import csv import cv2 import numpy as np from keras.models import Sequential from keras.layers import Flatten, Dense, Lambda, Cropping2D, Dropout from keras.layers.convolutional import Conv2D from keras.layers.pooling import MaxPooling2D from keras.layers.normalization import BatchNo...
import pytest from mendola import graph from nose.tools import assert_raises, assert_equal def test_graph(): net = graph.Graph() net.add_edge(0, 1, weight=5) net.add_edge(0, 5, weight=2) net.add_edge(1, 2, weight=3) net.add_edge(2, 3, weight=4) net.add_edge(3, 4, weight=5) net.add_edge(3, ...
<reponame>kyokyos/bioinform<filename>physical_period.py # 运行程序,只需输入某人生日,计算机就可智能列出此人生理周期最值(max,min),并可以图形化展示,抽取部分数据验证,程序计算准确。但仍有一些小瑕疵,以后有空改进。 #time transformation #common year, month accumulation of days #python 2.7 import do not support """ """ mark format import leap_common_year def total_day_calculate(year,month,d...
#!/usr/bin/env python # -*- coding: utf-8 -*- """Tests for `EVRClient`.""" import unittest from pyevr import EVRClient from pyevr.openapi_client.models import ForestNotice, ForestNoticeAllOf class TestEVRClient(unittest.TestCase): api_key = 'asd123' host = 'https://api.evr.test' def setUp(self) -> Non...
from yann.special.gan import gan from yann.network import network from yann.utils.graph import draw_network from theano import tensor as T import numpy import theano import cPickle rng = numpy.random class igan (object): """ This class creates and train two networks a GAN and a MLP. """ def __...
<reponame>gitrymt/qgm<filename>qgm/evaluation.py import copy import pandas as pd import numpy as np import scipy as sp from numba import jit import PIL from PIL import Image from . import image from . import function def psf_evaluation(image: image, coordinates): pass # return img_psf def lattice_ge...
<gh_stars>1-10 # 从dfcf 抓取基金趋势数据进行分析 import requests import json import time # 线性回归 import matplotlib.pyplot as plt from matplotlib.font_manager import FontProperties from sklearn import linear_model # 正常显示 负号 plt.rcParams["axes.unicode_minus"] = False # 正常显示负号标签 plt.rcParams["font.sans-serif"] = ["SimHei"] # 类型枚举 #...
<gh_stars>100-1000 """Proof pruning library. The purpose of this library is to optimize proofs. Currently we minimize the number of tactic application parameters in oder to generate better training data (with minimum number of tactic parameters). """ from __future__ import absolute_import from __future__ import divis...
import datetime from django.shortcuts import render, get_object_or_404, redirect from markdownx.utils import markdownify from .forms import EventForm from .forms import MemberForm from .forms import RegionForm from .forms import StoryForm from .forms import TrackForm from .models import Event from .models import Memb...
import json import requests from tqdm import tqdm import os def get_file_from_modac(fname, origin): """ Downloads a file from the "Model and Data Clearning House" (MoDAC) repository. Users should already have a MoDAC account to download the data. Accounts can be created on modac.cancer.gov Parame...
<gh_stars>0 # -*- coding: utf-8 -*- import sys import numpy as np from numpy import pi, sqrt, exp, sin, cos, tan, log, log10 import scipy as sp import scipy.integrate import h5py from aux import * ## ## Command line options ## if len(sys.argv) == 5: ## Alpha parameter alpha = float(sys.argv[1]) print...
import numpy as np import cv2 import glob import matplotlib.pyplot as plt import matplotlib.image as mpimg from moviepy.editor import VideoFileClip from line import Line from camera import Camera from laneimageprocessor import LaneImageProcessor debugMode = True if __name__ == "__main__": # create camera object...
<reponame>jld23/python-dlpy<gh_stars>1-10 from dlpy.speech import * import unittest import swat import swat.utils.testing as tm import tempfile import os class TestSpeechUtils(unittest.TestCase): def setUp(self): self.data_dir_local = None if "DLPY_DATA_DIR_LOCAL" in os.environ: self.d...
# -----------------------------------------------------. # 線形状をポリゴンメッシュのエッジに変換. # # @title \en Convert line shape to polygon mesh edges \enden # @title \ja 線形状をポリゴンメッシュのエッジに変換 \endja # -----------------------------------------------------. import numpy import math scene = xshade.scene() #-----------------------------...
import json from typing import Union from cryptojwt.jwk.jwk import key_from_jwk_dict from django.core.exceptions import ValidationError from django.utils.translation import gettext as _ from spid_cie_oidc.provider.settings import ( OIDCFED_DEFAULT_PROVIDER_PROFILE, OIDCFED_PROVIDER_PROFILES ) from spid_cie_oid...
import asyncio from datetime import datetime import uuid from urllib.parse import * from .comms import * from . import logger from .modules.echo import EchoModule from .modules.socks5 import Socks5Module from .tcp_proxy import * from .fakehttpserver import * import websockets class CommsAgentClient: def __init__(s...
import os import logging import time from dataclasses import dataclass from typing import List, Tuple, Optional, TypeVar, Type from medcat.cdb import CDB from medcat.utils.decorators import check_positive T = TypeVar("T", bound="Checkpoint") class Checkpoint(object): r""" The base class of checkpoint objects ...
from .fdc import FDC from .classify import CLF import numpy as np import pickle from scipy.cluster.hierarchy import dendrogram as scipydendroed from scipy.cluster.hierarchy import to_tree from .hierarchy import compute_linkage_matrix import copy from collections import OrderedDict as OD from collections import Counter ...
expected_output = { "bgp-information": { "bgp-peer": [ { "bgp-option-information": { "bgp-options": "Preference LocalAddress HoldTime LogUpDown Cluster PeerAS Refresh Confed", "bgp-options-extended": "GracefulShutdownRcv", ...
<reponame>funjack/launchcontrol """Launchcontrol client The module exposes the Launchcontrol API as a Client object. Data: scripttypes -- list of a dictionaries containing supported script formats. """ import urllib2 scripttypes = [ { "name" : "funscript", "extensions": ["funsc...
# =============================================================================== # Copyright 2013 <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/LI...
<reponame>KamilRizatdinov/marvelowe-server from fastapi.testclient import TestClient from src.application import app client = TestClient(app) def test_get_characters_no_auth(setup_marvel_api): characher_response = client.get("/characters") assert characher_response.status_code == 400 def test_get_charact...
__author__ = "<NAME>" __copyright__ = "Copyright 2012-2013, The SAGA Project" __license__ = "MIT" """ LSF job adaptor implementation """ import radical.utils.which import radical.utils.threads as sut import saga.url as surl import saga.utils.pty_shell import saga.adaptors.base import saga.adaptors.cpi.job f...
#!/usr/bin/env python2 #-*- coding: utf-8 -*- from __future__ import print_function, division import sys, os, os.path, itertools pkg_dir = os.path.dirname(os.path.realpath(__file__)) + '/../../' sys.path.append(pkg_dir) from scipy.stats import poisson from MPBNP import * from MPBNP import BaseSampler, BasePredictor f...
<filename>pandas/tseries/plotting.py """ Adapted from scikits.timeseries by <NAME> & <NAME> """ #!!! TODO: Use the fact that axis can have units to simplify the process from matplotlib import pylab from matplotlib.axes import Subplot from matplotlib.figure import Figure from matplotlib.ticker import Formatter, Locat...
import rhinoscriptsyntax as rs import math import clr def countDeskFunc(k): return len(k) def lenCurveFunc(k): return rs.CurveLength(k) def filterEdges(e): return rs.CurveLength(e) > 1 def scaleLine(line, scale): midPoint = rs.CurveMidPoint(line) plane = rs.PlaneFromNormal(midPoint, rs.V...
<gh_stars>1-10 #!/usr/bin/env python from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import time import json import random import tensorflow as tf import model as bm import util def get_training_examples(config, test_fold=-1): num_fold = config...
<reponame>stautonico/blackhat-simulator __package__ = "blackhat.bin" from os import system, remove from secrets import token_hex from ..helpers import Result from ..lib.input import ArgParser from ..lib.output import output from ..lib.unistd import read, write from ..lib.sys.stat import stat from ..lib.fcntl import c...
import argparse import os from time import time as t import matplotlib.pyplot as plt import numpy as np import torch from torchvision import transforms from tqdm import tqdm from sklearn.preprocessing import normalize from scipy.stats import entropy from bindsnet import ROOT_DIR from bindsnet.analysis.pl...
#using activated venv, so no shebang import os import unittest from app import create_test_app from models import User, Student, Group, Mentor, Session, SessionAction, Payment from flask.ext.sqlalchemy import SQLAlchemy app = create_test_app() db = SQLAlchemy(app) class TestCase(unittest.TestCase): def setUp(sel...
##!/usr/bin/env python3 import pygame import constants as c from scene import Scene from level_scene import LevelScene from high_score_table import HighScoreTable from transition_gui import TransitionGui class HighScoreScene(Scene): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) ...
# -*- coding: utf-8 -*- import pygame import numpy as np import random import os.path import json import base64 import hashlib from cryptography.fernet import Fernet from io import BytesIO from sys import exit class SpaceInvaders: """ Space Invaders Game Copyright © 2022-2222 <NAME> & <NAME> ...
import datetime from sqlalchemy.util import OrderedDict from sqlalchemy.ext.orderinglist import ordering_list from sqlalchemy import orm from pylons import config import vdm.sqlalchemy import vdm.sqlalchemy.stateful from sqlalchemy import types, Column, Table, ForeignKey, and_ import meta import core import package a...
import pandas as pd import glob import yaml from os.path import join from . import serialization, history def read_data(*args, group=False, **kwargs): iterable = _read_data(*args, **kwargs) if group: return group_trials(iterable) else: return list(iterable) def _read_data(pattern, *arg...
# copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve. # # 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...
<reponame>salkku/salkku-sdk-python<filename>src/sdkhttp.py import requests import json from requests.auth import HTTPBasicAuth class HTTPClient: def __init__(self, api_uri, user, password, options): # type: (string, string, string, Dict[str, bool]) -> HTTPClient self.api_uri = api_uri se...
<gh_stars>0 # coding: utf-8 # In[19]: import os import json import tensorflow as tf import tensorflow.contrib.slim as slim from models.nnets import NN from utils.vocabulary import Vocabulary from config.config import Config from models.models import ShowAttendTell from copy import deepcopy def update_dict(file_n...
''' Created on Jul 9, 2013 @author: <NAME> ''' import time from multiprocessing.pool import Pool from SegmentTreeSum import SegmentTreeSum from bitstring import BitArray parallelSolve = False INF = 1 << 31 def solve(par): M, Q, construct, queries = par bits = BitArray() for m in construct: for i i...
import numpy as np import pytest from atompack.crystal.spatial import MillerIndex, Orientation, Plane ########################### # MillerIndex Tests # ########################### @pytest.mark.parametrize("test_input,expectation", [ (np.array([1 / 2, 2 / 3, 1]), MillerIndex((4, 3, 2))), (np.array([-1 ...
<filename>oura/converters.py import pandas as pd class UnitConverter: """ Use this class to convert units for certain dataframe cols :param convert_cols: A set of columns to apply predefined conversions :type convert_cols: list/set """ all_dt_metrics = [] all_sec_metrics = [] all_met...
import pymultinest import json import matplotlib.pyplot as plt import numpy as np import pandas as pd from pymultinest.solve import solve import scipy as sp import scipy.stats import os from gp_project.kronecker import gaussian_kernel if not os.path.exists("chains"): os.mkdir("chains") def prior(cube): mu2, ...
<reponame>swryan/OpenMDAO-Framework<filename>openmdao.util/src/openmdao/util/publickey.py """ Support for generation, use, and storage of public/private key pairs. The :func:`pk_encrypt`, :func:`pk_decrypt`, :func:`pk_sign`, and :func:`pk_verify` functions provide a thin interface over :class:`Crypto.PublicKey.RSA` met...
# coding: utf-8 """ Pdf4me No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 OpenAPI spec version: v1 Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint import re # noqa: F401 import six class...