content
stringlengths
5
1.05M
#!/usr/bin/env python3 # Copyright (C) 2020 anoduck # 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, mer...
#!/usr/bin/env python3.9 """ Copyright (c) 2012, Shai Shasag All rights reserved. Licensed under BSD 3 clause license, see LICENSE file for details. """ import os from pathlib import PurePath, Path import collections from typing import List, Optional, Union def something_to_bool(something, default=False)...
from pathlib import Path import typer from cgr_gwas_qc.parsers import sample_sheet from cgr_gwas_qc.reporting import REPORT_NAME_MAPPER from cgr_gwas_qc.workflow.scripts import sample_qc_table app = typer.Typer(add_completion=False) COLUMNS = ( "SR_Subject_ID", "LIMS_Individual_ID", "Sample_ID", "Pr...
# -*- coding: utf-8 -*- from allink_core.core.loading import get_model from allink_core.core.sitemap import HrefLangSitemap People = get_model('people', 'People') class PeopleSitemap(HrefLangSitemap): changefreq = "never" priority = 0.5 i18n = True def __init__(self, *args, **kwargs): self...
from __pyosshell__ import * from __cluster__ import * class MD_Operator(object): def __init__(self): seed = int(np.random.uniform(1,1000000)+0.5) self.verbose = True self.mdrun_cmd = '' self.grompp_cmd = '' self.tag = 'MD_' self.opt ={'_INTEGRATOR' : 'md', # steep md sd ... ...
# GENERATED BY KOMAND SDK - DO NOT EDIT from .files.action import Files from .run.action import Run
import wikipedia ''' This is a wikipedia API usage sample. ''' query = str(input('input: ')) wikipedia.summary(query, sentences=4) print(wikipedia.summary(query, sentences=4))
import os import settings import flask from flask import send_file, request, abort, render_template from functools import wraps import bucket import image app = flask.Flask(__name__) app.config["DEBUG"] = True def require_api_key(view_function): @wraps(view_function) def decorated_function(*args, **kwargs): ...
from django.core.exceptions import PermissionDenied from django.contrib.auth import get_user_model from django.shortcuts import get_object_or_404, render from django.urls import reverse from django.utils.translation import gettext as _ from ...core.exceptions import Banned from ..bans import get_user_ban from ..decora...
""" Rethinking Portrait Matting with Privacy Preserving Copyright (c) 2022, Sihan Ma (sima7436@uni.sydney.edu.au) and Jizhizi Li (jili8515@uni.sydney.edu.au) Licensed under the MIT License (see LICENSE for details) Github repo: https://github.com/ViTAE-Transformer/ViTAE-Transformer-Matting.git Paper link: https://arxi...
"""signalserver URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.9/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Clas...
a = ["A", "B", "C", "D", "E"] while True: b = int(input()) n = int(input()) if b == 1: for i in range(n): b = a.pop(0) a.append(b) if b == 2: for i in range(n): b = a.pop(4) a.insert(0, b) if b == 3: for i in range(n): ...
import numpy import matplotlib.pyplot as plt import os from os.path import dirname, join, exists curdir = dirname(__file__) """ Plot experimental slope """ def get_time(string): string = string.decode("ascii") h, m, s = map(float, string.split(":")) return 3600 * h + 60 * m + 1 * s data = numpy.genf...
from django import forms from ACCNTS.models import Invoice,PayRoll class PaymentForm(forms.ModelForm): class Meta: model = Invoice fields = ('amount',) class SearchForm(forms.ModelForm): start = forms.DateTimeField() end = forms.DateTimeField() class PayRollForm(forms.ModelForm): class Me...
#!/usr/bin/env python3 from common_functions import * class ExpressStatus: def __init__(self): notify.init(APPINDICATOR_ID) self.indicator = appindicator.Indicator.new(APPINDICATOR_ID, error_image, appindicator.IndicatorCategory.APPLICATION_STAT...
from __future__ import division import torch from torch_cluster import neighbor_sampler from torch_geometric.utils import degree from torch_geometric.utils.repeat import repeat from .data import size_repr class Block(object): def __init__(self, n_id, e_id, edge_index, size): self.n_id = n_id sel...
import pygame from pygame.locals import * from OpenGL.GL import * from OpenGL.GLU import * from functools import partial def cube(): glBegin(GL_LINE_STRIP) # calculate all points points = [] for x in range(8): points.append(((x & 4) >> 2, (x & 2) >> 1, x & 1)) # traverse path paths =...
#!/usr/bin/env python # encoding:utf-8 import unittest import time from datetime import datetime from app import create_app, db from app.models import User, AnonymousUser __author__ = 'zhangmm' class UserModelTestCase(unittest.TestCase): def setUp(self): self.app = create_app('testing') self.ap...
from .. import db import datetime class ChallengeSettings(db.Model): """ [summary] Args: ChallengeSettingsMixin ([type]): [description] db ([type]): [description] """ __tablename__ = "challenge_settings" id = db.Column(db.Integer, primary_key=True) language_name = db.Colu...
# Print solutions import numpy as np def printBest(data, solution): print() # SAVE OPTIMAL SOLUTION data['best_obj'] = solution.get_objective_value() data['best_facilities'] = data['y'] for i in range(data['I_tot_exp']): data['best_facilities'][i] = solution.get_values('y[' + s...
answer = input("Are you feeling happy today?") if answer == "yes": print("Glad to hear that! Keep pressing on!") if answer == "no": print("Oh no! Hope you overcome your problems soon and remember to never give up!")
import calendar from datetime import datetime from corehq.apps.products.models import SQLProduct from corehq.apps.locations.models import get_location, SQLLocation from corehq.apps.reports.datatables import DataTablesHeader, DataTablesColumnGroup, DataTablesColumn from corehq.apps.reports.standard import MonthYearMixin...
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
# Generated by Django 2.1.4 on 2019-10-03 13:44 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('core', '0032_auto_20190729_1249'), ] operations = [ migrations.AddField( model_name='ocrmodel', name='job', ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright 2019 Marcel Bollmann <marcel@bollmann.me> # # 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/L...
# -*- coding: utf-8 -*- u""" Created on 2015-7-13 @author: cheng.li """ from PyFin.tests import api from PyFin.tests import DateUtilities from PyFin.tests import Env from PyFin.tests import Math from PyFin.tests import PricingEngines from PyFin.tests import Analysis __all__ = ["api", "DateUtilities", ...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import cv2 import numpy as np from tracker.multitracker import JDETracker from tracking_utils import visualization as vis from tracking_utils.utils import mkdir_if_missing # from opts import opts ...
# pylint: disable=invalid-name """ Module for obtaining quadrature points and weights. Three types of gaussian quadrature are supported: normal Gaussian, Radau quadrature, and Lobatto quadrature. The first method does not include either endpoint of integration, Radau quadrature includes one endpoint of the integrati...
from setuptools import setup, find_packages with open("README.md", "r") as fh: long_description = fh.read() setup( name = 'thelogger', packages = ['thelogger', 'thelogger.notify'], version = 'v0.2.6', license='Apache 2.0', description = 'Easy logging, timing and email not...
#!/usr/bin/env python # -*- coding: utf-8 -*- import io import os import sys import gzip import glob import logging import time import collections as cs from functools import partial from optparse import OptionParser, Values import multiprocessing as mp # import multiprocessing.dummy as mt import threading as mt import...
from setuptools import find_packages, setup setup( name="disk-exporter", version="1.0", zip_safe=False, package_dir={"": "src"}, packages=find_packages(where="src"), include_package_data=True, py_modules=["twisted.plugins.disk_exporter_dropin"], install_requires=[ "twisted[tls]"...
import h5py import numpy as np import pandas as pd from argparse import ArgumentParser def dataframe_to_deepsurv_ds(df, event_col='Event', time_col='Time'): # Extract the event and time columns as numpy arrays e = df[event_col].values.astype(np.int32) t = df[time_col].values.astype(np.float32) # Extr...
import cx_Oracle import math import pandas as pd class connection_banner: """class to generate connection with databases in Banner. """ def init_oracle_database(path_oracle_client): """Init connection with oracle database with client. Args: path_oracle_client (str): path where ...
import string import random from django import forms from .models import Tool from utils.utilities import is_empty class ToolForm(forms.ModelForm): class Meta: model = Tool fields = ['name', 'status', 'shared_from', 'category', 'description', 'picture'] widgets = { ...
from wagtail.tests.utils import WagtailPageTests from wagtail.core.models import Page from .models import HomePage class SlugDiacriticsTestCase(WagtailPageTests): def test_basic_plane(self): root = Page.objects.get(url_path="/home/") page = HomePage(title="Hello Vienna") root.add_child(in...
import json import os from unittest.mock import MagicMock, patch, call import pytest from configobj import ConfigObj from peek.connection import ConnectFunc from peek.natives import ConnectionFunc, SessionFunc from peek.peekapp import PeekApp mock_history = MagicMock() MockHistory = MagicMock(return_value=mock_histo...
# -*- coding: utf-8 -*- # Generated by Django 1.10.6 on 2017-05-01 08:32 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('crm', '0011_auto_20170501_1459'), ] operations = [ migrations.AlterModelOptions( ...
import asyncio import json import signal from typing import Callable import pyppeteer from pyee import AsyncIOEventEmitter from pymessages.service import MessageService class ClientOptions: headless:bool credentials: object def __init__(self,headless=False, credentials={"cookies":[], "localStorage": {...
import numpy as np import pandas as pd import tensorflow as tf tf.enable_eager_execution() from sklearn.preprocessing import StandardScaler import pickle import sys sys.path.append('../../rumm') import lang import nets import bayesian # constants BATCH_SZ = 1024 vocab_size = 36 ''' # load the dataset zinc_df = pd.rea...
import os import sys from subprocess import Popen, run, PIPE from datetime import datetime import logging from configparser import ExtendedInterpolation import aiofiles import reusables from sanic import Sanic from sanic.response import json from box import Box, ConfigBox class PCError(Exception): """Pymote Cont...
from bokeh.io import curdoc from bokeh.layouts import row, widgetbox, column from bokeh.models import ColumnDataSource, Range1d from bokeh.models.widgets import Slider, Button, RadioGroup, Dropdown, RadioButtonGroup from bokeh.plotting import figure from bokeh.models.widgets import DataTable, DateFormatter, TableColumn...
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Fqtrim(MakefilePackage): """fqtrim is a versatile stand-alone utility that can be used to ...
import numpy as np def data_upsampling(data,size): data = np.kron(data, np.ones(size)) return data
# -*- coding: utf-8 -*- """ Created on Mon Apr 13 11:22:57 2015 @author: Wasit """ import numpy as np from matplotlib import pyplot as plt import pickle import os def gen_data(): clmax=5 spc=1e3 theta_range=2 samples=np.zeros(spc*clmax,dtype=np.uint32) I=np.zeros((spc*clmax,theta_range),dtype=np....
from tensorflow.python.framework import ops from tensorflow.python.ops import math_ops from .utils import get_xmodule xmodule = get_xmodule() xgemm = xmodule.xgemm @ops.RegisterGradient("XGEMM") def _xgemm_grad(op, grad): """ Gradient computation for the XGEMM :param op: XGEMM operation that is differen...
"""A TaskRecord backend using sqlite3 Authors: * Min RK """ #----------------------------------------------------------------------------- # Copyright (C) 2011 The IPython Development Team # # Distributed under the terms of the BSD License. The full license is in # the file COPYING, distributed as part of this s...
# coding=utf-8 from OTLMOW.OTLModel.BaseClasses.OTLAttribuut import OTLAttribuut from OTLMOW.OTLModel.Classes.AIMObject import AIMObject from OTLMOW.OTLModel.Datatypes.DtcDocument import DtcDocument from OTLMOW.OTLModel.Datatypes.DtcExterneReferentie import DtcExterneReferentie from OTLMOW.OTLModel.Datatypes.KlVerkeers...
# -*- encoding: utf-8 -*- """ Copyright (c) 2019 - present AppSeed.us """ from django.db import models from django.contrib.auth.models import User from django.db.models.base import Model # Create your models here. class Car(models.Model): car_brand = models.CharField(max_length=150, help_text='Car Brand') ca...
""" Include a dump of snapshot data from the live system""" SNAPSHOTS_LIST = { "snapshots": [ { "duration_in_millis": 54877, "end_time": "2018-05-06T05:00:54.937Z", "end_time_in_millis": 1525582854937, "failures": [], "indices": [ ...
# -*- coding: utf-8 -*- """Tests for `.db` module.""" import pytest from psycopg2 import OperationalError, sql from tile_processor import db class TestDB: """Testing config.db""" def test_failed_connection(self, bag3d_db): """Failed connection raises OperationalError""" with pytest.raises(...
#!/usr/bin/env python # # Copyright 2015 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can # be found in the LICENSE file. """This is the test suite for a vtgate_client implementation. """ import struct from google.protobuf import text_format from vtdb import dbex...
# Todo: Test replay_events().
from paddle_prompt.templates.base_template import Template class ManualTemplate(Template): """the Base abstract Template is in manual mode, there are no changes here """ pass
from .aux import create_graph_from_string, convert_graph_to_string from .node_matcher import StringNodeMatcher from .graph_builder import GraphBuilder from .match import MatchException from .code_container import CodeContainerFactory def convert_special_characters_to_spaces(line): line = line.replace('\t', ' ') ...
# Copyright (c) 2019 Graphcore Ltd. All rights reserved. import numpy as np import tensorflow as tf import util # Data pipeline parameters SHUFFLE_BUFFER = 10000 class MLPData: def __init__(self, opts, data_path): # Define data constants - these must be hardcoded. # Warning: data requires categ...
# # PySNMP MIB module ENTERASYS-TACACS-CLIENT-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ENTERASYS-TACACS-CLIENT-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 18:50:25 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python versio...
import json import requests from datetime import datetime, timedelta from src.celery.celery import app from src.file.models import FileInfo, FilesProxy from django.conf import settings @app.task def check_file(id): file_obj = FileInfo.objects.get(id=id) status = FileInfo.STATUS_OK try: file = fi...
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/74_callback.azureml.ipynb (unless otherwise specified). __all__ = ['AzureMLCallback'] # Cell import tempfile from ..basics import * from ..learner import Callback # Cell from azureml.core.run import Run # Cell class AzureMLCallback(Callback): "Log losses, metrics,...
#!/usr/bin/env python # coding: utf-8 # # AIChE 2019 pMuTT Workshop # # Instructions and materials for the Computational Catalysis workshop can be found on webpage. # # # Table of Contents # # | **1\. [Introduction](#section_1)** # # |-- **1.1. [Some of pMuTT's Capabilities](#section_1_1)** # # | **2\. [Useful L...
import datetime anoN = int(input('Ano de nascimento: ')) anoA = datetime.date.today().year idade = anoA - anoN # print(anoN, anoA, idade) print('Quem nasceu em {} tem {} anos em {}.'.format(anoN, idade, anoA)) print('''Qual seu sexo? Digite: [ F ] para sexo feminino [ M ] para sexo masculino''') lido = str(input('Opçã...
from PySide2 import QtGui from PySide2.QtCore import Slot, QObject, Signal from PySide2.QtWidgets import QWidget, QMessageBox from app.ui import qss from app.ui.ui_home import Ui_Home from app.lib.global_var import G from app.honey import all_app from app.setting import SettingWidget import webbrowser class HomeJob(...
#!/usr/bin/env python2.7 # coding=utf-8 ''' @date = '17/4/7' @author = 'chenliang' @email = 'chenliang2380@cvte.cn' ''' from FATERUI.paramwidget import * from collections import OrderedDict import FATERUI.editwidget import cv2 class ThresholdUi(ParamWidget): def __init__(self,param=''): super(Threshold...
"""The main module of this package.""" import importlib.metadata __version__ = importlib.metadata.version(__name__)
import os import pickle from os.path import join as pjoin import click from vocabirt.embed_nn.loader.common import get_resp_split from .discrimexp import Scorer, evaluate, prepare_args, print_summary, strategy_opt @click.command() @click.argument("vocab_response_path") @click.argument("irt_path_cv", type=click.Pat...
"""This script aimed at extracting several time-series for the IMPAC challenge. Parameters ---------- PATH_TO_DATA : list of str The path to the subjects with possibility to use a wildcard, e.g. ['/example/*', '/anotherone/*]. SUBJECTS_EXCLUDED : str Path to a csv containing a column 'subject_id' with the...
import torch import pandas as pd import numpy as np import time import traceback import torch.utils.data from pathlib import Path import os,sys import cv2 import yaml from imutils.paths import list_images from tqdm import tqdm import argparse import albumentations as A from sklearn.metrics import classification_report...
def pdfFile(filename): import PyPDF2 import time print("------------------------------------- PDF To Text Extraction Start Here -------------------------------------\n") x = 0 pdfFileObj = open(filename, 'rb') pdfReader = PyPDF2.PdfFileReader(pdfFileObj) x = pdfReader.numPages print("...
# Generated by Django 2.2.8 on 2020-07-13 15:01 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('sdf', '0002_auto_20200713_1449'), ] operations = [ migrations.AlterField( model_name='sdfcompounds', name='activitie...
# Unterprogramm zur Konvertierung und Einteilung von .ogg Dateien # Angelehnt an https://stackoverflow.com/a/62872679 from pydub import AudioSegment import os import math class SplitConvert(): def __init__(self,folder,filename): self.folder = folder self.filename = filename self.filepath = ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 7/6/2018 17:26 AM # @Author : jaykky # @File : zjai_6_comparison.py # @Software: ZJ_AI #此程序是用于比对模型的识别成果和真实情况,并得到精确率和召回率的模型指标。 #主要方法是对比两个xml文件的object差异 #属于测试fasterrcnn的模型性能 #输入:两个xml文件的路径, #输出:精确率和召回率 # ========================================================= imp...
# game environment parameters width = 540 height = 440 block_length = 20 brainLayer = [24, 16, 3] # neural network layers that act as brain of snake # genetic algorithm parameter population_size = 50 no_of_generations = 30 per_of_best_old_pop = 20.0 # percent of best performing parents to be included per_of_worst_ol...
from rest_framework import status from mayan.apps.documents.tests.mixins import DocumentTestMixin from mayan.apps.rest_api.tests.base import BaseAPITestCase from ..models import Index from ..permissions import ( permission_document_indexing_create, permission_document_indexing_delete, permission_document_inde...
"""Module for Deletion Tokenization.""" from .basic_regex_tokenizer import BasicRegexTokenizer class Deletion(BasicRegexTokenizer): """Deletion Tokenizer class.""" def pattern(self) -> str: """Return regex for Deletion.""" return r'\b(del|deletion|(copy number)? ?loss)\b' def token_type(...
import os import sys from collections import OrderedDict import logging from plenum.common.constants import ClientBootStrategy, HS_FILE, HS_LEVELDB, \ HS_ROCKSDB, HS_MEMORY, KeyValueStorageType from plenum.common.types import PLUGIN_TYPE_STATS_CONSUMER walletsDir = 'wallets' clientDataDir = 'data/clients' GENERA...
# import sys,os # sys.path.append(os.getcwd()) from selenium.webdriver.common.by import By """ 首页 """ # 首页登录列表 sy_login_list = ['登录/注册', '体验课程', '小学课程', '初中课程', '高中课程', '专题课程', '作业辅导', '模拟考试', '直播课堂', '订购/激活'] # sy_login_list_element= def sy_login_list_fun(): """ :return: 首页登录xpath定位列表 """ sy_lo...
""" Module to wrap an integer in bitwise flag/field accessors. """ from collections import OrderedDict from pcapng.ngsix import namedtuple, Iterable class FlagBase(object): """\ Base class for flag types to be used in a Flags object. Handles the bitwise math so subclasses don't have to worry about it. ...
import numpy as np from datasets import load_dataset from transformers import pipeline from dataset import KeyValueDataset from tasks.TaskTypes import TaskType def evaluate( operation, evaluate_filter, model_name, dataset_name, split="validation[:20%]", ): # (1) load model if model_name i...
# -*- coding: utf-8 -*- """Created on Sun Sep 8 13:28:53 2019. @author: Julian Märte Updated by: Brendan O'Dongohue, bodonoghue85@gmail.com, Oct 14th 2020 """ import re import numpy as np import scipy.sparse CORE_FILE_ROW_MODE = 'ROWS' CORE_FILE_COL_MODE = 'COLUMNS' CORE_FILE_RHS_MODE = 'RHS' CORE_FILE_BOUNDS_MODE...
from pathlib import Path import gzip files = list(Path('./jsons').glob('*')) for idx, path in enumerate(files): #print(path) last_hash = str(path).split('/')[-1] if Path(f'htmls/{last_hash}').exists(): print('exist', idx, len(files), last_hash) with Path(f'htmls/{last_hash}').open('wb') as...
# (C) Copyright 1996-2016 ECMWF. # # This software is licensed under the terms of the Apache Licence Version 2.0 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. # In applying this licence, ECMWF does not waive the privileges and immunities # granted to it by virtue of its status as an intergov...
from _Framework.ControlSurfaceComponent import ControlSurfaceComponent KEY_NAMES = ["C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B"] CIRCLE_OF_FIFTHS = [7 * k % 12 for k in range(12)] # KEY_CENTERS = CIRCLE_OF_FIFTHS[0:6] + CIRCLE_OF_FIFTHS[-1:5:-1] MUSICAL_MODES = [ 'Major', [0, 2, 4, 5, 7, 9, 11...
from artifactory_cleanup import rules import custom_rules from policy import RULES def test_repo_rules(): for repo_rules in RULES: assert isinstance(repo_rules.name, str) def test_keep_latest_n_version(): rule = rules.keep_latest_nupkg_n_version(2) result = [ { "name": ".nup...
#!/usr/bin/env python import pyparsing as pp lpar = pp.Literal("(") rpar = pp.Literal(")") string = pp.QuotedString('"', escQuote='""', multiline=True) keyword = ( pp.Keyword("unique") | pp.Keyword("enum") | pp.Keyword("object") | pp.Keyword("end") | pp.Keyword("adjust") ) number = pp.Regex(r"\-?[...
# -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available. Copyright (C) 2017-2018 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the MIT License (the "License"); you may not use this file except in co...
# -*- coding=utf-8 -*- import copy import json import random import re import time from collections import OrderedDict from time import sleep import TickerConfig from config.urlConf import urls from inter.GetPassCodeNewOrderAndLogin import getPassCodeNewOrderAndLogin1 from inter.GetRandCode import getRandCode from inte...
""" setup.py - Setup package with the help Python's DistUtils See https://www.python-ldap.org/ for details. """ import sys,os from setuptools import setup, Extension if sys.version_info < (3, 6): raise RuntimeError( 'The C API from Python 3.6+ is required, found %s' % sys.version_info ) from configparser im...
from .Strategy import Strategy
# -*- coding: utf-8 -*- # Copyright 2020 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...
"""Defines accessor with methods for preserving metadata TODO: Test on arrays with more than three dimensions TODO: Figure out when to use copying TODO: Add inplace kwarg? TODO: Verify docstrings, especially type being returned """ import numpy as np import xarray as xr from .metadata import MetadataRef from .utils i...
from urwid_pydux import ConnectedComponent from git_sew.ui.cli.components.generics import ListItem, OrderedList class StateView(ConnectedComponent): def map_state_to_props(self, state, own_props): return {"items": [ListItem(text=f"{k}: {v}") for k, v in state.items()]} def render_component(self, pro...
# students = [{"name": "Vova", # "last_name": "Zinkovsky", # "age": 17, # "scores": [1, 2, 3, 4, 5], # "hobbies": ['play', 'programming', 'reading'] # }, # {"name": "Begimai", # "last_name": "Zhumakova", # "age": 18, ...
import re from os.path import abspath, dirname, join from setuptools import setup, find_packages CURDIR = dirname(abspath(__file__)) with open("README.md", "r", encoding='utf-8') as fh: LONG_DESCRIPTION = fh.read() # Get the version from the _version.py versioneer file. For a git checkout, # this is computed bas...
# -*- coding: utf-8 -*- # Generated by Django 1.9.9 on 2016-10-13 23:13 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('questions', '0006_question_notes'), ] operations = [ migrations.AlterField( ...
#!/usr/bin/env python3 """ Authors: Venkat Ramaraju, Jayanth Rao Functionality implemented: - Generates and aggregates polarities across headlines and conversations """ # Libraries and Dependencies import os from nltk.sentiment.vader import SentimentIntensityAnalyzer import pandas as pd from nltk.stem import WordNetL...
# the following for unit test #this unittest for load_result_template as a dict data, then update import os import sys import concurrent.futures __filedir__ = os.path.dirname(os.path.abspath(__file__)) sys.path.insert(0, __filedir__ + '/../src/') sys.path.insert(0, __filedir__ ) #path = os.path.dirname(__filedir__) ...
""" This module comes up with test vectors that can be used to quickly sniff a user's time zone. It generates a decision tree that selects a time zone based on the the UTC offsets of various points in time. """ import attr from collections import OrderedDict from datetime import datetime import json import math impor...
from direct.controls import ControlManager from direct.showbase.InputStateGlobal import inputState #This is the new class for Toontown's ControlManager #Had to override some functions in order to fix 'want-WASD' class ToontownControlManager(ControlManager.ControlManager): wantWASD = base.wantWASD#Instead of checki...
import time import torch import torch.nn as nn from torch.utils.data import DataLoader import pandas as pd import numpy as np from surprise import Dataset, Reader, SVD, KNNBasic class BaselineMF: def __init__(self, cf_algo=None, logit=False): """ fit method takes a ContentDataset and fits it for nu...
##### # # This class is part of the Programming the Internet of Things project. # # It is provided as a simple shell to guide the student and assist with # implementation for the Programming the Internet of Things exercises, # and designed to be modified by the student as needed. # import logging from programmingth...
from dotbimpy.file import *