text
stringlengths
2
999k
def create_registry(attr_name): """Create a new registry type that tracks objects by the given attribute name. Arguments: attr_name -- the string name of the attribute by which to key the registry """ class Registry(type): """An abstract registry for objects keyed by an attribute value.""" _registered = {...
import torch import torch.nn as nn from collections import deque from mol_tree import Vocab, MolTree from nnutils import create_var, GRU MAX_NB = 8 class JTNNEncoder(nn.Module): def __init__(self, vocab, hidden_size, embedding=None): super(JTNNEncoder, self).__init__() self.hidden_size = hidden_s...
import os from src.models import _PROCESSED_DATA, _RAW_DATA, _MODEL_DIR import torch from torch import nn import pytorch_lightning as pl from torch.utils.data import DataLoader, random_split from torch.nn import functional as F from torchvision import transforms from src.libs.utils import load_raw_data from tests.test...
#!/usr/bin/env python import sys import time import roslibpy import rospy from twisted.internet import reactor from sensor_msgs.msg import JointState from rospy_message_converter import message_converter from robot_arm_dvrk import RobotArmDVRK """ Rosbridge node for PSM-s. """ class RobotArmPSM(RobotArmDVRK): #...
#!/usr/bin/env python """Django's command-line utility for administrative tasks.""" import os import sys def main(): os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'allswap.settings') try: from django.core.management import execute_from_command_line except ImportError as exc: raise Import...
import time import array import math import audioio import board import digitalio button = digitalio.DigitalInOut(board.A1) button.switch_to_input(pull=digitalio.Pull.UP) tone_volume = 0.1 # Increase this to increase the volume of the tone. frequency = 440 # Set this to the Hz of the tone you want to generate. leng...
#!/usr/bin/env python3 # Copyright 2017 The Kubernetes 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 appl...
from setuptools import setup, find_packages def readme(): with open('README.md') as f: return f.read() setup( name='flask-expects-json', version='1.4.0', description='Decorator for REST endpoints in flask. Validate JSON request data.', long_description=readme(), long_description_cont...
# Copyright 2020 Huawei Technologies Co., Ltd # # 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 agree...
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # http://www.sphinx-doc.org/en/master/config # -- Project information ----------------------------------------------------- project = 'bioutils' copyr...
import datetime as dt import time import random from termcolor import colored def random_color_print(text='hello world'): color_str = 'red, green, yellow, blue, magenta, cyan, white' color_lis = color_str.split(', ') color_dic = {i:color_lis[i] for i in range(len(color_lis))} seed = int(dt.datetime.no...
# coding: utf-8 """ Hydrogen Nucleus API The Hydrogen Nucleus API # noqa: E501 OpenAPI spec version: 1.9.4 Contact: info@hydrogenplatform.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint import re # noqa: F401 import six from nucleus_api.configuration i...
from django.core.exceptions import PermissionDenied from django.test import TestCase from django_marina.db import DisableMigrations from .models import ProtectedModel class ProtectedModelMixinTestCase(TestCase): def test_update_protected(self): protected = ProtectedModel(name="protected", is_update_prot...
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- from io im...
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. 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 cop...
# ----------------------------------- # import # ----------------------------------- import os import codecs import re from typing import Iterator, Any, List, Optional # ----------------------------------- # define # ----------------------------------- CUR_PATH = os.path.join(os.path.dirname(__file__)) # ------------...
from functools import reduce def maybe(func): def inner(*args): for arg in args: if isinstance(arg, Exception): return arg try: return func(*args) except Exception as e: return e return inner def repeat(func, until): def inner(*a...
import pathlib import os import dotenv from aiogram import Bot, Dispatcher from aiogram.contrib.fsm_storage.files import PickleStorage from config.logger import logger_init from .handlers import start_handler # Load dotenv dotenv.load_dotenv() # Configure logging. # 4-levels for logging: INFO, DEBUG, WARNING, ERROR...
# -*- coding: utf-8 -*- import numpy as np import logging from scipy.stats import normaltest class Diagnostic(object): def __init__(self, parent): self.parent = parent self._logger = logging.getLogger("chainconsumer") def gelman_rubin(self, chain=None, threshold=0.05): r""" Runs the G...
# Copyright 2017 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...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion import django.core.validators class Migration(migrations.Migration): dependencies = [ ('picmodels', '0054_providerlocation_state_province'), ] operations = [...
""" This module defines various classes that can serve as the `output` to an interface. Each class must inherit from `OutputComponent`, and each class must define a path to its template. All of the subclasses of `OutputComponent` are automatically added to a registry, which allows them to be easily referenced in other ...
#!/usr/bin/env python # -- coding: utf-8 -- # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (th...
__author__ = 'andrewfowler'
#!/usr/bin/env python # -*- coding: utf-8 -*- # pylint: disable-msg=C0103 ################################################################################ # Copyright (c) 2006-2017 Franz Inc. # All rights reserved. This program and the accompanying materials are # made available under the terms of the MIT License wh...
import mysql.connector from model.group import Group from model.contact import Contact class DbFixture: #все контакты sel_all_cont = "select distinct a.id, a.firstname, a.middlename, a.lastname, a.nickname, a.address, " \ "a.email, a.email2, a.email3, a.home, a.mobile, a.work, a.phone2 " \ ...
import pickle from bitglitter.palettes.paletteobjects import DefaultPalette, TwentyFourBitPalette from bitglitter.read.assembler import Assembler class Config: '''This is the master object that holds all session data.''' def __init__(self): self.colorHandler = PaletteHandler() self.statsHan...
from app import app from app.selection import newsselector from elasticsearch import Elasticsearch from app import db from flask import request newsselector = newsselector() '''Homepage that displays news articles in json format''' @app.route('/', methods= ['GET', 'POST']) @app.route('/homepage', methods= ['GET', 'PO...
import numpy as np import matplotlib.pyplot as plt microwave_positions = ['closer', 'closer_angled'] kettle_positions = ['top_right', 'bot_right', 'bot_right_angled', 'bot_left_angled'] cabinet_textures = ['wood1', ...
# -*- coding: utf-8 -*- from erpbrasil.febraban.entidades import Boleto from erpbrasil.febraban.boleto.custom_property import CustomProperty class BoletoCaixa(Boleto): ''' Gera Dados necessários para criação de boleto para o banco Caixa Economica Federal ''' conta_cedente = CustomPropert...
# -------------------------------------------------------------------------- # # Copyright (c) Microsoft Corporation. All rights reserved. # # The MIT License (MIT) # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the ""Software""), ...
import pygame import numpy as np import math import time from gym.spaces.box import Box import matplotlib.pyplot as plt class Reacher: def __init__(self, screen_size=1000, num_joints=2, link_lengths = [200, 140], ini_joint_angles=[0.1, 0.1], target_pos = [669,430], render=False, change_goal=False): # Globa...
### # Pickpocket list: area > person > item # Add XP, Gold, Rep ### import struct import os from manual.area_names import gen_area_names from template_index import index from handle_page import handle from root_index import root_index # wrapper function to convert byte string to regular string def mystr(a_str): ret...
# Import all the models, so that Base has them before being # imported by Alembic from .chat import Chat from .db import db from .user import User __all__ = ("db", "Chat", "User")
""""Test adapter specific config options.""" from pprint import pprint from tests.integration.base import DBTIntegrationTest, use_profile import textwrap import yaml class TestBigqueryAdapterSpecific(DBTIntegrationTest): @property def schema(self): return "bigquery_test" @property def model...
__authors__ = ['Chick3nputer', 'Supersam654'] from itertools import islice, product import string import hashlib import multiprocessing from multiprocessing import Process from random import shuffle from sys import argv chars = "0123456789abcdef" def generate_strings(size): alphabet = list(chars * size) whi...
# Copyright 2019, 2020, 2021 IBM Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to ...
# settings.py import os from os.path import join, dirname from dotenv import load_dotenv dotenv_path = join(dirname(__file__), '.env') load_dotenv(dotenv_path) CONSUMER_KEY = os.environ.get("CONSUMER_KEY") CONSUMER_SECRET = os.environ.get("CONSUMER_SECRET") ACCESS_TOKEN = os.environ.get("ACCESS_TOKEN") ACCESS_SECRET ...
from __future__ import absolute_import from pants.build_graph.target import Target from pants.base.payload import Payload from pants.base.payload_field import PrimitiveField class YoyoTarget(Target): def __init__(self, db_string=None, prod_db_envvar='POSTGRES_URL', payloa...
#!/usr/bin/env python # -*- coding: utf-8 -*- import simplejson as json from alipay.aop.api.FileItem import FileItem from alipay.aop.api.constant.ParamConstants import * from alipay.aop.api.domain.AlipayEcoEduKtSchoolinfoModifyModel import AlipayEcoEduKtSchoolinfoModifyModel class AlipayEcoEduKtSchoolinfoModifyReq...
from numpy.random import random from bokeh.io import curdoc from bokeh.plotting import figure from bokeh.layouts import column, widgetbox from bokeh.models import Button, ColumnDataSource from bokeh.server.server import Server """ create and run a demo bokeh app on a cloud server """ def run(doc): fig = figure(t...
# # Copyright (c) 2019-2020 Google LLC. All Rights Reserved. # Copyright (c) 2016-2018 Nest Labs 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 # # ...
# Copyright (c) 2016-present, Facebook, Inc. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # pyre-unsafe import unittest from unittest.mock import MagicMock, patch from ... import commands, configuration_monitor, project_files_monitor fr...
# -*- coding: utf-8 -*- """ flask.app ~~~~~~~~~ This module implements the central WSGI application object. :copyright: (c) 2014 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import os import sys from threading import Lock from datetime import timedelta from itertools import...
#!/usr/bin/env python """Django's command-line utility for administrative tasks.""" import os import sys def main(): os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'treasurehunt.settings') try: from django.core.management import execute_from_command_line except ImportError as exc: raise I...
from sklearn.datasets import load_breast_cancer from sklearn.linear_model import Ridge from sklearn.model_selection import GridSearchCV, train_test_split from sklearn.tree import DecisionTreeRegressor from ngboost import NGBClassifier from ngboost.distns import k_categorical if __name__ == "__main__": # An exampl...
''' Train QSAR models DESCRIPTION This module holds functions for training QSAR models. ''' # Imports import pandas as pd import numpy as np import sklearn.preprocessing as skp import sklearn.decomposition as skd import sklearn.ensemble as ske import sklearn.model_selection as skm import sklearn.neural_network as...
# coding=utf-8 __author__ = 'stefano' import logging from django.core.management.base import BaseCommand from django.db.transaction import set_autocommit, commit from openaid.projects.models import Initiative, Project, Activity # This one-time procedure get data from projects and transfer it to Initiative. # for the l...
# Copyright 2022 Deep Learning on Flink 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 applicable l...
import sys import os import glob root_path = os.path.join(os.getcwd(), 'kinect_leap_dataset', 'acquisitions') p_id = ['P1', 'P2', 'P3', 'P4', 'P5', 'P6', 'P7', 'P8', 'P9', 'P10', 'P11', 'P12', 'P13', 'P14'] g_id = ['G1', 'G2', 'G3', 'G4', 'G5', 'G6', 'G7', 'G8', 'G9', 'G10'] dest_path = os.path.join(os.getcwd(), 'rgb...
from django.core.management.base import BaseCommand from ...models import Deal import requests def make_records(deals_data): for deal in deals_data: Deal.objects.update_or_create( dealID = deal['dealID'], defaults = { 'title': deal['title'], ...
''' BINARY TREE DISPLAY Description: A utility help visualize binary trees by using ASCII text. Author: Thanh Trung Nguyen thanh.it1995 (at) gmail.com License: 3-Clause BSD License ''' from .parsingnode import ParsingNode from .valueutil import ValueUtil from .matrixbuffer impor...
# -*- coding: utf-8 -*- # # Copyright 2020 Google LLC. 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 requir...
# 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...
# -*- coding: utf-8 -*- """Utilities for `BandsData` nodes.""" def get_highest_occupied_band(bands, threshold=0.005): """Retun the index of the highest-occupied molecular orbital. The expected structure of the bands node is the following: * an array called `occupations` * with 3 dimensions i...
import time from discord.ext import commands import os import psutil import platform uname = platform.uname() class Status(commands.Cog): def __init__(self, client): self.client = client @commands.command(name="status", aliases=["stats", "dash", "dashboard", "übersicht", "performance", "stat"]) ...
# 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...
from django.contrib.auth import authenticate from django.db import IntegrityError from django.db.models import Q from rest_framework import status from rest_framework.authtoken.models import Token from rest_framework.permissions import IsAuthenticated from rest_framework.views import APIView from account.models import...
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 5/15/20 4:49 PM # @File : grover.py # qubit number=5 # total number=40 import cirq import cirq.google as cg from typing import Optional import sys from math import log2 import numpy as np #thatsNoCode from cirq.contrib.svg import SVGCircuit # Symbols for...
# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals. # Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the Lice...
import os import torch import shutil from collections import OrderedDict import logging import numpy as np def load_pretrained_models(model, pretrained_model, phase, ismax=True): # ismax means max best if ismax: best_value = -np.inf else: best_value = np.inf epoch = -1 if pretrained_...
__author__ = 'Casey Bajema' import logging from jcudc24ingesterapi import typed, APIDomainObject, ValidationError from jcudc24ingesterapi.schemas.data_types import DataType logger = logging.getLogger(__name__) class TypedList(list): def __init__(self, valid_type): self.valid_type = valid_type def app...
import ctypes class Struct(ctypes.Structure): """ This class exists to add common python functionality to ctypes.Structure. This includes: Value equality via the `==` operator. Showing contents in `repr(struct)`. """ def __eq__(self, other): """ Note: if your Struc...
from django.contrib import admin from .models import Image, Profile, Comments # Register your models here. admin.site.register(Image) admin.site.register(Profile) admin.site.register(Comments)
import os import pytest from locuspocus import Locus, Loci from locuspocus.exceptions import MissingLocusError, StrandError import minus80 as m80 """ Unit tests for Loci """ NUM_GENES = 39656 def test_init(testRefGen): try: testRefGen return True except NameError: return False ...
# Generated by Django 3.2.10 on 2021-12-19 13:49 from django.db import migrations import wagtail.core.blocks import wagtail.core.fields import wagtail_references.blocks class Migration(migrations.Migration): dependencies = [ ('example', '0002_blogpage_bib_reference'), ] operations = [ m...
#!/usr/bin/env python # -*- coding: utf-8 -*- import cherrypy import os import collections import api import monitorfrontend import tablesfrontend import sprocsfrontend import indexesfrontend import report import performance import hosts import export import hostsfrontend import welcomefrontend import datadb import tp...
import os from .vendored import colorconv import numpy as np import vispy.color _matplotlib_list_file = os.path.join(os.path.dirname(__file__), 'matplotlib_cmaps.txt') with open(_matplotlib_list_file) as fin: matplotlib_colormaps = [line.rstrip() for line in fin] def _all_r...
from socket import socket path = "/~bsetzer/4720sp19/nanoc/output/index.html" host = "ksuweb.kennesaw.edu" PORT = 80 conn = socket() conn.connect((host,PORT)) try: first_line = "GET " + path + " HTTP/1.1\r\n" header1 = "Host: " + host + "\r\n" black_line = "\r\n" message = first_line + header1 + b...
# Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file ex...
#!/usr/bin/python3 # -*- coding: utf-8 -*- """ https://github.com/cgloeckner/pyvtt/ Copyright (c) 2020-2021 Christian Glöckner License: MIT (see LICENSE for details) """ import unittest, tempfile, pathlib from buildnumber import BuildNumber class BuildNumberTest(unittest.TestCase): def setUp(self): ...
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. # This product includes software developed at Datadog (https://www.datadoghq.com/). # Copyright 2019-Present Datadog, Inc. import re # noqa: F401 import sys # noqa: F401 from datadog_api_client.v1.model_uti...
import logging import re from flask import abort, has_request_context, request from flask_login import current_user from notifications_python_client import __version__ from notifications_python_client.base import BaseAPIClient from notifications_python_client.errors import HTTP503Error logger = logging.getLogger(__na...
# Generated by Django 2.1.5 on 2019-07-14 02:33 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('courses', '0006_course_prerequisite'), ] operations = [ migrations.AlterField( model_name='course', name='units', ...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
"""Invokes the Java semgrex on a document The server client has a method "semgrex" which sends text to Java CoreNLP for processing with a semgrex (SEMantic GRaph regEX) query: https://nlp.stanford.edu/nlp/javadoc/javanlp/edu/stanford/nlp/semgraph/semgrex/SemgrexPattern.html However, this operates on text using the C...
from guardian.shortcuts import get_objects_for_user from .serializers import MungerSerializer, DataFieldSerializer, PivotFieldSerializer, FieldTypeSerializer from rest_framework.response import Response from rest_framework import status, filters, mixins, generics, permissions class MungerPermissions(permissions.Djan...
import cv2 from pyzbar import pyzbar def read_barcodes(frame): barcodes = pyzbar.decode(frame) for barcode in barcodes: x, y , w, h = barcode.rect barcode_text = barcode.data.decode('utf-8') print(barcode_text) cv2.rectangle(frame, (x, y),(x+w, y+h), (0, 255, 0), 2) return f...
# This example shows how to automatically move and measure a set of points using a laser tracker. from robolink import * # API to communicate with RoboDK for simulation and offline/online programming from robodk import * # Robotics toolbox for industrial robots # Any interaction with RoboDK must be done throug...
'''This module implements concrete agent controllers for the rollout worker''' import copy import time from collections import OrderedDict import math import numpy as np import rospy import logging import json from threading import RLock from gazebo_msgs.msg import ModelState from std_msgs.msg import Float64, String fr...
from xviz.builder.base_builder import XVIZBaseBuilder, CATEGORY from xviz.v2.core_pb2 import TimeSeriesState class XVIZTimeSeriesBuilder(XVIZBaseBuilder): def __init__(self, metadata, logger=None): super().__init__(CATEGORY.TIME_SERIES, metadata, logger) # Stores time_series data by timestamp then...
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! import grpc import image_embedding_pb2 as image__embedding__pb2 class ImageEmbeddingStub(object): # missing associated documentation comment in .proto file pass def __init__(self, channel): """Constructor. Args: channel: A gr...
from .datatypes import Image from .eval_info import EvalInfo from .renderer import Renderer from .glsl_renderer import GLSLRenderer from .registry import RegisterNode, UnregisterNode, NODE_REGISTRY from .project_file import ProjectFileIO
#! /usr/bin/env python3 '''SMTP/ESMTP client class. This should follow RFC 821 (SMTP), RFC 1869 (ESMTP), RFC 2554 (SMTP Authentication) and RFC 2487 (Secure SMTP over TLS). Notes: Please remember, when doing ESMTP, that the names of the SMTP service extensions are NOT the same thing as the option keywords for the R...
import re import matplotlib.pyplot as plt import numpy as np import pandas as pd import pyperclip import seaborn as sns class QPCRAnalysis: def __init__(self, data, genes, samples, ntc_cols=True, columns_per_sample=2): '...
import sys import csv import requests import json from datetime import datetime, date from io import StringIO from sots import app, db from flask import render_template, request, redirect, url_for, Response from sqlalchemy import func, desc, or_, distinct, and_ #from sqlalchemy.orm import lazyload from sots.models impo...
import pdf_to_json as p2j import json url = "file:data/multilingual/Latn.ENG/Sun-ExtA_8/udhr_Latn.ENG_Sun-ExtA_8.pdf" lConverter = p2j.pdf_to_json.pdf_to_json_converter() lConverter.mImageHashOnly = True lDict = lConverter.convert(url) print(json.dumps(lDict, indent=4, ensure_ascii=False, sort_keys=True))
from bottle import route, view, template, request, response, redirect import pymysql.cursors import pymysql.err from database import dbapi @route('/create_profile', method=['GET']) @view('create_profile') def view_create_profile(): return {'message':''} @route('/create_profile', method=['POST']) @view('create_pr...
# Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
# Natural Language Toolkit: SemCor Corpus Reader # # Copyright (C) 2001-2015 NLTK Project # Author: Nathan Schneider <nschneid@cs.cmu.edu> # URL: <http://nltk.org/> # For license information, see LICENSE.TXT """ Corpus reader for the SemCor Corpus. """ from __future__ import absolute_import, unicode_literals...
class BungieProfile: """Represents the data of a users' bungie profile. :param dict responseData: The raw data given back by the API request. uniqueName The unique name of the bungie profile. membershipID The ID of the bungie profile. displayName The display name of the bun...
import math cx = 0.5 focal_length = 0.6028125 alpha = 0.0 chi = 0 mx = cx / focal_length r2 = mx ** 2 mz = (1 - alpha ** 2 * r2) / (alpha * math.sqrt(1 - (2 * alpha - 1) * r2) + 1 - alpha) beta = (mz * chi + math.sqrt(mz ** 2 + (1 - chi ** 2) * r2)) / (mz ** 2 + r2) print 2 * (math.pi / 2 - math.atan2(beta * mz - chi...
# -*- coding: utf-8 -*- """ Created on Tue Jun 8 22:09:47 2021 @author: Apple """ def start(): import numpy as np import scipy.io as sio import sklearn.ensemble from sklearn import svm from sklearn.model_selection import StratifiedKFold from sklearn.metrics import confusion_matrix from skl...
#!/usr/bin/env python3 import argparse import os import os.path import pickle from collections import OrderedDict parser = argparse.ArgumentParser() parser.add_argument('--lang1', default='cpp', help='language 1') parser.add_argument('--lang2', default='java', help='language 2') parser.add_argument('--output', default=...
# coding: utf-8 """ Copyright 2016 SmartBear Software 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 baselines.common.mpi_running_mean_std import RunningMeanStd import baselines.common.tf_util as U import tensorflow as tf import gym from baselines.common.distributions import make_pdtype class MlpPolicy(object): recurrent = False def __init__(self, name, *args, **kwargs): with tf.variable_scope(...
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: def configuration(parent_package='',top_path=None): from numpy.distutils.misc_util import Configuration config = Configuration('pynifti', parent_package, top_path) return config if __name__ =...
# SPDX-License-Identifier: Apache-2.0 # # The OpenSearch Contributors require contributions made to # this file be licensed under the Apache-2.0 license or a # compatible open source license. import glob import os import re from manifests.input_manifest import InputManifest from manifests.manifests import Manifests ...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Copy files to latest/ in the project's default file storage. """ import os import re import boto3 import random import logging from django.conf import settings from calaccess_raw.models import RawDataVersion from django.core.management.base import BaseCommand logger = l...
""" eZmax API Definition (Full) This API expose all the functionnalities for the eZmax and eZsign applications. # noqa: E501 The version of the OpenAPI document: 1.1.7 Contact: support-api@ezmax.ca Generated by: https://openapi-generator.tech """ import sys import unittest import eZmaxApi from...