content
stringlengths
0
1.05M
origin
stringclasses
2 values
type
stringclasses
2 values
"""CFNgin entrypoint.""" import logging import os import re import sys from yaml.constructor import ConstructorError from runway._logging import PrefixAdaptor from runway.util import MutableMap, SafeHaven, cached_property from .actions import build, destroy, diff from .config import render_parse_load as load_config ...
nilq/baby-python
python
x3 = ('foo' ('bar'<caret>
nilq/baby-python
python
import numpy as np from pymgt import * from pymgt.metrics import * from pymgt.ppmt_utils import friedman_index def test_(): ndata = 1000 np.random.seed(1) x = np.random.uniform(0.0, 1.0, size=ndata) metrics = [ ("friedman", FRIEDMAN_METRIC, False), ("kstest", KS_METRIC, False), ...
nilq/baby-python
python
# -*- coding: utf-8 -*- # # Copyright (c) {% now 'utc', '%Y' %}, {{ cookiecutter.author }} # All rights reserved. # import unittest from cnct import ConnectClient from connect_processor.app.cancel import Cancel from unittest.mock import patch, MagicMock from tests.test_util import TestUtils client = ConnectClient('Key...
nilq/baby-python
python
#!/usr/bin/env python # -*- coding: utf-8 -*- """ This module contains functions used to convert osm data to json and save to MongoDB. """ import xml.etree.cElementTree as ET import json #some post on stackoverflow def elementtree_to_dict(element): """ Function used to recursively convert a eleme...
nilq/baby-python
python
class Solution: def productExceptSelf(self, nums): """ :type nums: List[int] :rtype: List[int] """ productions = [] n = len(nums) if n == 0: return None # def recursiveProductExceptSelf(idx=0, previous_value=1): # nonlo...
nilq/baby-python
python
# Generated by Django 3.0.4 on 2020-03-22 13:50 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('backend', '0006_auto_20200322_1440'), ] operations = [ migrations.AddField( model_name='violationreport', name='cont...
nilq/baby-python
python
# import the necessary packages from sklearn.preprocessing import LabelBinarizer import numpy as np class CifarGenerator: """ Generator class responsible for supplying data to the model. Attributes ---------- x: np ndarray array of images y: np ndarray array of class labels ...
nilq/baby-python
python
"""Functions to assist with remote logging of InVEST usage.""" import logging import urllib import urllib2 import json import Pyro4 LOGGER = logging.getLogger('natcap.invest.remote_logging') Pyro4.config.SERIALIZER = 'marshal' # lets us pass null bytes in strings _ENDPOINTS_INDEX_URL = ( 'http://data.naturalca...
nilq/baby-python
python
from dolfin.fem.problem import LinearVariationalProblem from dolfin.cpp.fem import LinearVariationalSolver from fenics_utils.formulation.cfd import IncompressibleNsIpcs from fenics_utils.formulation.cfd import AdvectionDiffusionScalar from fenics_utils.solvers.linear import LinearSolver class AdvectionDiffusionScala...
nilq/baby-python
python
from __future__ import print_function import boto3 import logging import time current_session = boto3.session.Session() current_region = current_session.region_name logger = logging.getLogger() logger.setLevel(logging.INFO) #create a client connection to ec2 ec2_client = boto3.client('ec2', current_region) ...
nilq/baby-python
python
"""! @brief Phase oscillatory network for patten recognition based on modified Kuramoto model. @details Implementation based on paper @cite article::nnet::syncpr::1. @authors Andrei Novikov (pyclustering@yandex.ru) @date 2014-2020 @copyright BSD-3-Clause """ import math import cmath import numpy from pyclustering....
nilq/baby-python
python
from api.libs.base import CoreView from cmdb.models import MachineRoom, DataCenter from account.models import UserProfile from django.db.utils import IntegrityError class MachineRoomView(CoreView): """ 机房视图类 """ login_required_action = ["get_list", "post_create", "post_delete", "post_change"] supe...
nilq/baby-python
python
#!"D:\STORE\0-Admin\Desktop\Chatbot-Osiris bkp\python.exe" import sys import subprocess subprocess.call("start cmd /k echo "+sys.argv[1], shell=True)
nilq/baby-python
python
from django import template from django.template.loader import get_template register = template.Library() @register.filter(name='is_deploma') def is_deploma(value): return value['year'] == '2' and value['course'] == 'BTech' @register.filter(name='is_first_year') def is_first_year(value): return value['year']...
nilq/baby-python
python
import discord from discord.ext import commands import sqlite3 from helper import utils class SettingsCog(commands.Cog): def __init__(self, bot): self.bot = bot @commands.command(help= 'Used to set the prefix of the bot in this server, use default to default to the global prefix', usage='pref...
nilq/baby-python
python
# coding: utf-8 from nltk.corpus import stopwords from sklearn.feature_extraction.text import TfidfVectorizer, CountVectorizer import networkx as nx import itertools import pandas from networkx.readwrite import json_graph from scipy import spatial import re __author__ = "Adrien Guille, Pavel Soriano" __email__ = "adri...
nilq/baby-python
python
import RPi.GPIO as GPIO import time import threading import os import sys # constants SLOWFLASHTIMES = [2,2] FASTFLASHTIMES = [0.5,0.5] # class for managing LED class LEDControl(): class LEDStates(): #states of LED OFF = 0 ON = 1 FLASH = 2 def __init__(self, gpioPin): ...
nilq/baby-python
python
# REQUIRES: bindings_python # RUN: %PYTHON% %s | FileCheck %s import circt from circt.dialects import rtl from mlir.ir import * from mlir.dialects import builtin with Context() as ctx, Location.unknown(): circt.register_dialects(ctx) i32 = IntegerType.get_signless(32) m = builtin.ModuleOp() with In...
nilq/baby-python
python
#!/usr/bin/env pytest ############################################################################### # $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read functionality for FITS driver. # Author: Even Rouault <even dot rouault @ mines-paris dot org> # ########################################################...
nilq/baby-python
python
from xml.dom.minidom import Document from django.shortcuts import redirect, render def add_file(request): if request.method == 'POST': updated_file = request.FILES['document'] print(updated_file.name) print(updated_file.size) return render(request, 'base/add_file.html',{})
nilq/baby-python
python
import os import json import importlib from typing import Callable, TypeVar AnyFunction = Callable Handler = TypeVar('Handler') def getClass(modulePath: str, className: str): mod = importlib.import_module(modulePath) return getattr(mod, className) def getAction(fileName: str, actionName: str) -> Callable:...
nilq/baby-python
python
# -*- coding: utf-8 -*- # -------------------------------------------------------- # Licensed under the terms of the BSD 3-Clause License # (see LICENSE for details). # Copyright © 2018-2021, A.A Suvorov # All rights reserved. # -------------------------------------------------------- """Tests prototype.py""" from patt...
nilq/baby-python
python
import numpy as np from scipy.stats import iqr from ..config import MAX_VAL_AFTER_NORMALIZATION from ..utils.dataUtils import morphDilation, gaussianFilter, radial_profile, applyRelativeThr, getCoordsWithinSphere from ..utils.genericException import GenericError DEFAULT_PERCENTIL = 95 DEFAULT_BINARY_MASK_THR= 0.01 d...
nilq/baby-python
python
import pytest import requests from log_config import log_, pformat from core import config from tests.utils.utils import get_server_api, client ### - - - - - - - - - - - - - - - - - - - - - - - ### ### LOGINS ### - - - - - - - - - - - - - - - - - - - - - - - ### def client_anonymous_login( as_test = True...
nilq/baby-python
python
import glob import os import re class JasmineTest: def __init__(self, test_name, test_class_name, test_path, included_tags: list, excluded_tags: list): self.test_name = test_name self.test_class_name = test_class_name self.test_path = test_path self.included_tags = included_tags ...
nilq/baby-python
python
STATS = [] num_timeouts = 15 num_timeouts = 40 num_problems = 55
nilq/baby-python
python
#!/usr/bin/env python # -*- coding: UTF-8 -*- # Configuracion Pyro4 DATABASE = 'ws.db' OBJETO_PYRO = 'servidor1.configura' DIRECCION_PYRO = '192.168.1.115' # en nuestro caso la direccion del objeto y del servidor de nombrado será el mismo ya que estan en la misma maquina DIRECCION_PYRO_LOCAL = '192.168.1.115' KEY = ...
nilq/baby-python
python
from django.contrib import admin from django.contrib.admin.utils import reverse_field_path from django.db.models import Max, Min from django.db.models.fields import DecimalField, FloatField, IntegerField from .forms import RangeNumericForm, SingleNumericForm, SliderNumericForm class NumericFilterModelAdmin(admin.Mod...
nilq/baby-python
python
# -*- coding: utf-8 -*- # @Author: Liu Shaoweihua # @Date: 2019-11-18 # Copyright 2018 The Google AI Language Team 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://w...
nilq/baby-python
python
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2022 Busana Apparel Group. All rights reserved. # # This product and it's source code is protected by patents, copyright laws and # international copyright treaties, as well as other intellectual property # laws and treaties. The product is licensed, not s...
nilq/baby-python
python
import cv2 import os import glob from matplotlib import pyplot as plt import numpy as np def readImages(path): img_array = [] imgc = [] names = [] for filename in glob.glob(path): names.append(filename) names.sort() for filename in names: img = cv2.imread(filen...
nilq/baby-python
python
#!/usr/bin/env python from __future__ import absolute_import import sys import argparse import symstore class CompressionNotSupported(Exception): pass def parse_args(): parser = argparse.ArgumentParser( description="publish windows debugging files") parser.add_argument("-d", "--delete", ...
nilq/baby-python
python
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** 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, Sequence, Union, overload from ... import _utilities fro...
nilq/baby-python
python
__version__ = "v0.1.0"
nilq/baby-python
python
# flake8: noqa from .load_catalog import load_catalog
nilq/baby-python
python
import ctypes class MemoryBuffer: def __init__(self, ptr): self.start_addr = ptr self.position = ptr def tell(self): return self.position def read(self, count): if count == 0: return b'' if count < 0: raise Exception('Cant read negative num...
nilq/baby-python
python
# coding: utf-8 from graph import UndirectedGraph, Vertex from reporter import Reporter from typing import Callable, List, Set import random PivotChoice = Callable[[UndirectedGraph, Set[Vertex]], Vertex] def visit(graph: UndirectedGraph, reporter: Reporter, pivot_choice_X: bool, candidates: Set[Vertex], ...
nilq/baby-python
python
class Solution(object): def reorderLogFiles(self, logs): """ :type logs: List[str] :rtype: List[str] """ lls = {} dls = [] for log in logs: _, v = log.split(" ", 1) if v.split(" ", 1)[0].isalpha(): lls[log] = v ...
nilq/baby-python
python
from flask import render_template,request,redirect,url_for, abort from . import main from flask_login import login_required,current_user from .forms import PitchesForm,CommentsForm,UpdateProfile from ..models import Pitches,Comments,User from .. import photos, db from datetime import datetime # from ..requests import ...
nilq/baby-python
python
from hashlib import sha256 import json from typing import Protocol from flask import * from flask_cors import CORS from Crypto.Cipher import AES from script import decrypt, encrypt from get_data import get_all_data from flask_talisman import Talisman from addData import readJson,writeJson import json from ml import pre...
nilq/baby-python
python
import pygame import utils import constants import os, sys # ----------------------------------------------------------- # class Environment # ----------------------------------------------------------- class Environment: def __init__(self, zone_name, map_name): if zone_name is None o...
nilq/baby-python
python
# Generated by Django 3.1.8 on 2021-06-24 16:23 from django.conf import settings import django.core.validators from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ...
nilq/baby-python
python
import pathlib import pyopenephys import numpy as np """ The Open Ephys Record Node saves Neuropixels data in binary format according to the following the directory structure: (https://open-ephys.github.io/gui-docs/User-Manual/Recording-data/Binary-format.html) Record Node 102 -- experiment1 (equivalent to a Session...
nilq/baby-python
python
import yaml import xdg from dataclasses import dataclass, field from typing import Dict from pathlib import Path @dataclass class Configuration: path: str = field(default=xdg.XDG_DATA_HOME / "quest/tasks.yaml") trello: Dict = field(default_factory=dict) taskfile: Path = field(default=xdg.XDG_DATA_HOME / "...
nilq/baby-python
python
import os def modifyFile(_f): _new_f = _f.replace(' - 副本.js', '.ts') os.rename(_f, _new_f) def getFile(_d): dirs = os.listdir(_d) for k in dirs: fpth = _d + "/" + k f = os.path.isfile(fpth) if f == False: getFile(fpth) else: i =...
nilq/baby-python
python
from time import sleep import unittest,random,sys sys.path.append('./models') sys.path.append('./page_obj') from models import function,myunit from page_obj.loginPage import Login class LoginTest(myunit.MyTest): '账户登录测试' def user_login_verify(self,username='',password=''): Login(self.driver).user_log...
nilq/baby-python
python
#-*- coding:utf-8; mode:python; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- from bes.testing.unit_test import unit_test from bes.version.software_version import software_version as VC class test_software_version(unit_test): def test_compare(self): self.assertEqual( -1, VC.compare('1.2.3', '1.2.4...
nilq/baby-python
python
# Generated by Django 3.1.6 on 2021-05-01 19:10 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('ecom', '0007_contact'), ] operations = [ migrations.AlterModelOptions( name='category', options={'verbose_name_plural': 'Cat...
nilq/baby-python
python
import sys import math import numpy as np import pandas as pd def topsis_fun(file,wght,impact): try: mat=pd.read_csv(file) except FileNotFoundError: raise Exception("File does not exist") #print(mat) row_count=mat.shape[0] col_count=mat.shape[1] if(len...
nilq/baby-python
python
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Jan 22 20:19:16 2020 @author: taotao """ import check_db def status_check(): print('进入计算检测') return def calculate(message,trigger,item_price):#识别并计算 if(trigger == 1): people = message[-1].split("@") people = people[1:] print('people_list:',p...
nilq/baby-python
python
# Generated by Django 2.1.5 on 2019-03-24 01:56 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('api', '0007_auto_20190324_0118'), ] operations = [ migrations.RemoveField( model_name='serveruser', name='password', ...
nilq/baby-python
python
import math import bcolors class Plot(object): def __init__(self, x_min, x_max, x_size, y_min, y_max, y_size, t_min, t_max, t_size): self.x_min = x_min self.x_max = x_max self.x_size = x_size self.y_min = y_min self.y_max = y_max self.y_size = y_size self.t_min = t_min self.t_max = t_max self.t_siz...
nilq/baby-python
python
# Copyright 2013-2014 The rust-url developers. # # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or # http://www.apache.org/licenses/LICENSE-2.0> or the MIT license # <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your # option. This file may not be copied, modified, or distributed # except ac...
nilq/baby-python
python
# pyOCD debugger # Copyright (c) 2013-2019 Arm Limited # SPDX-License-Identifier: Apache-2.0 # # 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...
nilq/baby-python
python
from rest_framework import viewsets from rest_framework.exceptions import MethodNotAllowed from rest_framework_extensions.mixins import NestedViewSetMixin from resources_portal.models import Material from resources_portal.serializers import MaterialRelationSerializer class OrganizationMaterialViewSet(NestedViewSetM...
nilq/baby-python
python
""" Usage: source env.sh ; python storage.py create_blob_container openflights-raw source env.sh ; python storage.py create_blob_container openflights-adf source env.sh ; python storage.py create_blob_container test source env.sh ; python storage.py delete_blob_container openflights-raw source env.s...
nilq/baby-python
python
"""Command-line interface for Acton.""" import logging import struct import sys from typing import BinaryIO, Iterable, List import acton.acton import acton.predictors import acton.proto.wrappers import acton.recommenders import click def read_bytes_from_buffer(n: int, buffer: BinaryIO) -> bytes: """Reads n byte...
nilq/baby-python
python
import logging def debug(*args, **kw): logging.basicConfig(level=logging.ERROR, format="%(message)s") logger = logging.getLogger(__name__) logger.debug(*args, **kw)
nilq/baby-python
python
import os from os import path from IPython import embed import click import pandas as pd import numpy as np from root2csv import converter from csv2hdf5 import glob_and_check from remove_events import get_run from melibea import process_melibea def check_globs(glob1, glob2): if isinstance(glob1, str): fna...
nilq/baby-python
python
# -*- coding: utf-8 -*- __all__ = ['Sample', 'reserved_keys'] reserved_keys = ['image_bytes', 'image_type', 'image_path', 'image', 'bboxes', 'bbox_labels'] class Sample(dict): """ Sample class is a subclass of dict, storing information of a single sample The following keys are reserved: 'image_bytes...
nilq/baby-python
python
# -*- coding: utf-8 -*- import json class User(object): def __init__(self, user_id, user_name, user_surname, email): self.user_id = user_id self.user_name = user_name self.user_surname = user_surname self.email = email # self.userLevel = userLevel # self.userTitle ...
nilq/baby-python
python
from pandas import DataFrame, read_csv import matplotlib.pyplot as plt import pandas as pd from qgis.core import ( QgsApplication, QgsDataSourceUri, QgsCategorizedSymbolRenderer, QgsClassificationRange, QgsPointXY, QgsProject, QgsExpression, QgsField, QgsFields, QgsFeature, QgsFeatu...
nilq/baby-python
python
"""Поле для ссылки на сертификат Revision ID: 7f6d52e2a594 Revises: 4028ddc57d5b Create Date: 2021-01-17 16:47:35.551727 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '7f6d52e2a594' down_revision = '4028ddc57d5b' branch_labels = None depends_on = None def u...
nilq/baby-python
python
""" This class defines the Attention Layer to use when training the model with the attention mechanism. Code readapted (under the courtesy of the author) from: https://github.com/lukemelas/Machine-Translation """ import torch.nn as nn import torch.nn.functional as F class Attention(nn.Module): def __init__(self, b...
nilq/baby-python
python
"""app URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.1/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-based vie...
nilq/baby-python
python
import numpy as np from scipy.fftpack import dct def cutSample(data): if len(np.shape(data))==2: data=data[:,0] fadeamount = 300 maxindex = np.argmax(data > 0.01) startpos = 1000 if len(data) > 44100: if maxindex > 44100: if len(data) > maxindex + (44100): ...
nilq/baby-python
python
import json from dagster_slack import slack_resource from mock import patch from dagster import ModeDefinition, execute_solid, solid @patch("slack_sdk.WebClient.api_call") def test_slack_resource(mock_api_call): @solid(required_resource_keys={"slack"}) def slack_solid(context): assert context.resour...
nilq/baby-python
python
import base64, httplib, json def googlecloud_tagimage(filename): with open(filename, 'rb') as image_file: encoded_string = base64.b64encode(image_file.read()) endpoint = '/v1/images:annotate?key=ADD_YOUR_KEY_HERE' request_body = { 'requests':[ { 'image':{ ...
nilq/baby-python
python
import sys numArray = sys.argv uniques = [] for num in numArray: if num not in uniques: uniques.append(num) print("Unique Numbers are ", end=':') for num in uniques: print(num, sep=",")
nilq/baby-python
python
# -*- coding: utf-8 -*- import unittest from includes import * from common import getConnectionByEnv, waitForIndex, sortedResults, toSortedFlatList from time import sleep from RLTest import Env def testSyntax1(env): conn = getConnectionByEnv(env) env.expect('ft.create', 'idx', 'ONfoo*', ...
nilq/baby-python
python
def python_vignette(): from tests import pyunit_utils story1 = [pyunit_utils.locate("python/ipython_dataprep_input.py")] story2 = [pyunit_utils.locate("python/ipython_machinelearning_input.py")] approved_py_code_examples = story1+story2 pybooklet_utils.check_code_examples_in_dir(approved_py_code_e...
nilq/baby-python
python
# ---------------------------- PASSWORD GENERATOR ------------------------------- # import random import pyperclip import json def genrate_password(): letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B',...
nilq/baby-python
python
from sys import path from os.path import dirname as dir path.append(dir(path[0])) __package__ = "model" from model import inference from datetime import datetime INFERENCE_TYPE = 'local' # local' | 'cmle' instances = [ { 'is_male': 'True', 'mother_age': 26.0, 'mother_ra...
nilq/baby-python
python
def palindrome(number): return number == number[::-1] if __name__ == '__main__': init = int(input()) number = init + 1 while not palindrome(str(number)): number += 1 print(number - init)
nilq/baby-python
python
import unittest from bdflib import reader import charset class JISTest(unittest.TestCase): def test_jis(self): with open('bdf/jiskan24-2003-1.bdf', 'rb') as f: bdf = reader.read_bdf(f) cconv = charset.JIS() single_cp = 0 multi_cp = 0 for cp in bdf.codepoints(...
nilq/baby-python
python
""" This is the main program file for the DDASM assembler. It will read a DDA program file and convert it to a VHDL \ description of a ROM file. This ROM file serves as the program memory for the LDD mark II processor. DDASM = Digital Design Assmebly LDD = Lab Digital Design Digital Design refers to the Digital Design ...
nilq/baby-python
python
# 短信验证码 过期时间 SMS_CODE_EXPIRETIME = 300 # 手机号码在redis中的过期时间,解决短时间内 向同一手机号重复发送短信 的问题 MOBILE_EXPIRETIME = 60 # 标识某一属性在 redis 中的使用次数,解决类似于抽奖次数的问题 MOBILE_FREQUENCY = 1
nilq/baby-python
python
import os import threading from cheroot import wsgi from wsgidav.wsgidav_app import WsgiDAVApp from powerhub.directories import WEBDAV_RO, WEBDAV_BLACKHOLE, \ UPLOAD_DIR, WEBDAV_DIR from powerhub.args import args import time from watchdog.observers import Observer from watchdog.events import FileSystemEventHand...
nilq/baby-python
python
#!/usr/bin/env python3 import os import time import subprocess import shutil import datetime import tempfile def main(): TMPROOT = r'/Volumes/RAM Disk' REPO = r"/Volumes/RAM Disk/redis/" SIT_BIN = r"/Users/abcdabcd987/Developer/sit/bin/sit" report = open('stress_test_%s.csv' % datetime.datetime.today()...
nilq/baby-python
python
# ##################################################################################################################### # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # # ...
nilq/baby-python
python
from vstutils.models import BQuerySet, BModel, Manager, models class HostQuerySet(BQuerySet): def test_filter(self): return self.filter(name__startswith='test_') class Host(BModel): objects = Manager.from_queryset(HostQuerySet)() name = models.CharField(max_length=1024) class HostGroup(BModel)...
nilq/baby-python
python
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import mptt.fields class Migration(migrations.Migration): dependencies = [ ('publication_backbone', '0006_auto_20160224_1345'), ('fluent_contents', '0001_initial'), ] operations = [ ...
nilq/baby-python
python
import time import pygame from pygame.locals import * # The individual event object that is returned # This serves as a proxy to pygame's event object # and the key field is one of the strings in the button list listed below # in the InputManager's constructor # This comment is actually longer than the class defin...
nilq/baby-python
python
from interface import GameWindow from PyQt5.QtWidgets import QApplication import sys if __name__ == "__main__": app = QApplication(sys.argv) demo = GameWindow() demo.update() demo.showMaximized() sys.exit(app.exec_())
nilq/baby-python
python
# Okta intel module - Group import json import logging from typing import Dict from typing import List from typing import Tuple import neo4j from okta.framework.ApiClient import ApiClient from okta.framework.OktaError import OktaError from okta.framework.PagedResults import PagedResults from okta.models.usergroup impo...
nilq/baby-python
python
import time import requests from models.states import OrderSide class DeribitExchangeInterface: def __init__(self, key, secret, base_url, api_url, instrument): self.key = key self.secret = secret self.base_url = base_url self.api_url = api_url self.url = base_url + api_url ...
nilq/baby-python
python
import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation DT = 0.01 FRAMERATE = 60 N_ROWS = 64 SECONDS = 10 def read_field_file(file_path, type): if type != 'scalar' and type != 'vector': raise ValueError('type must be scalar or vector') file_str = open(file_path, 'r...
nilq/baby-python
python
import requests from abc import ABC, abstractmethod from collections import OrderedDict from coronacli.config import OWID_DATA_URL class BaseScraper(ABC): """ Abstract scraper class defining common functionality among all scrapers and abstract methods to implement """ def __init__(self): super().__...
nilq/baby-python
python
from __future__ import print_function import collections import os os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID" # The GPU id to use, usually either "0" or "1" os.environ["CUDA_VISIBLE_DEVICES"]="3" import tensorflow as tf from keras.models import Sequential, load_model from keras.utils import multi_gpu_model from kera...
nilq/baby-python
python
from gym_trading.envs.trading_env import TradingEnv from gym_trading.envs.Testing_Env import TestingEnv
nilq/baby-python
python
import unittest import numpy as np from materialscoord.einstein_crystal_perturbation import perturb_einstein_crystal from pymatgen.core.structure import Structure class EinsteinTest(unittest.TestCase): """Test einstein perturbation functionality.""" def test_perturb(self): # basic test to check str...
nilq/baby-python
python
class Config(object): DEBUG = False TESTING = False class DevConfig(Config): DEBUG = False
nilq/baby-python
python
class MyPolynomialDecay: """ Class to define a Polynomial Decay for the learning rate """ def __init__(self, max_epochs=100, init_lr=1e-3, power=1.0): """ Class constructor. :param max_epochs (int): Max number of epochs :param init_lr (float): Initial Learning Rate ...
nilq/baby-python
python
import tensorflow as tf from niftynet.application.base_application import BaseApplication from niftynet.engine.application_factory import \ ApplicationNetFactory, InitializerFactory, OptimiserFactory from niftynet.engine.application_variables import \ CONSOLE, NETWORK_OUTPUT, TF_SUMMARIES from niftynet.engine....
nilq/baby-python
python
import numpy as np import os import tensorflow as tf from tensorflow.contrib.framework import nest def loop_tf(loop_fn, inputs, persistent_initializer, transient_initializer, n=None, time_major=False): def create_tensor_array(initial_tensor: tf.Tensor): return tf.TensorArray(initial_tensor.dtype, size=n, ...
nilq/baby-python
python
# import to namespace from .base import IRRBase # noqa from .native import IRRClient # noqa
nilq/baby-python
python
# Generated by Django 3.1.1 on 2020-09-19 21:11 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Contact', fields=[ ('id', models.AutoField(...
nilq/baby-python
python
import numpy as np import tensorflow as tf from .utils import * class Graph2Gauss: """ Implementation of the method proposed in the paper: 'Deep Gaussian Embedding of Graphs: Unsupervised Inductive Learning via Ranking' by Aleksandar Bojchevski and Stephan Günnemann, published at the 6th Internati...
nilq/baby-python
python
# Copyright (C) 2005, Giovanni Bajo # Based on previous work under copyright (c) 2002 McMillan Enterprises, Inc. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the Licen...
nilq/baby-python
python