content
stringlengths
0
894k
type
stringclasses
2 values
import logging import os import time import traceback from math import floor from threading import Thread from typing import List, Tuple, Optional, Dict from PyQt5.QtWidgets import QApplication, QStyleFactory from bauh import ROOT_DIR, __app_name__ from bauh.api.abstract.controller import SoftwareManager from bauh.ap...
python
from coinbase import CoinbaseAccount from info import API_KEY def main(): account = CoinbaseAccount(api_key=API_KEY) print "coinbase balance:", str(account.balance), "BTC" if __name__ == "__main__": main()
python
#!/usr/bin/env python3 from planb.cli import cli if __name__ == '__main__': cli()
python
import tkinter as tk #from interface_adapters.view_models import PositionViewModel class OutputView(tk.Frame): """View for Positions""" def __init__(self, pos_view_model, time_view_model, parent, *args, **kwargs): """Constructor method. Inject pos_view_model, time_view_model an...
python
import os.path import datetime from dateutil.relativedelta import relativedelta # var find path import os class Lastmodif: def diftoday(modification, date_jour): print(os.path.abspath("text.docx")) modification = datetime.date.fromtimestamp(os.path.getmtime("C:\\Users\\DELL\\Deskto...
python
""" am 9 margin data to bcolz """ import time import zipline.data.bundles as bundles_module import logbook import sys logbook.set_datetime_format('local') logbook.StreamHandler(sys.stdout).push_application() log = logbook.Logger('ingest'.upper()) def main(): """margin data to bcolz""" from zipline.pipeline...
python
from .context import models from models import (fc_100_100_10, pca_filtered_model, train, accuracy, fastica_filtered_model, kernelpca_filtered_model, incrementalpca_filtered_model, nmf_filtered_model, truncatedsvd_filtered_model, save_to_file, load_from_file, ...
python
# class Comida(object): def __init__(self): self.tipopan = None self.tipocarne = None self.vegetales = None self.condimentos = None self.hazcombo = None def set_tipopan(self, pan): self.typeBread = pan def set_tipocarne(self, carne): self.typeMeat = ...
python
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: ipc.protodevel from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection ...
python
"""Defines various classes and definitions that provide assistance for unit testing Actors in an ActorSystem.""" import unittest import pytest import logging import time from thespian.actors import ActorSystem def simpleActorTestLogging(): """This function returns a logging dictionary that can be passed as ...
python
special.stdtridf(p,t)
python
#!/usr/bin/env python3 # # Copyright (c) 2018, Cisco and/or its affiliates # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # ...
python
# Interfas Grafica XI # Menu from tkinter import * root=Tk() barraMenu=Menu(root) root.config(menu=barraMenu, width=600, height=400) archivoMenu=Menu(barraMenu, tearoff=0) archivoMenu.add_command(label="Nuevo") archivoMenu.add_command(label="Guardar") archivoMenu.add_command(label="Guardar Como") archivoMenu.add_s...
python
import boto3, json, os, logging, random sqs = boto3.client('sqs') queue_url = os.environ['SQS_QUEUE_URL'] pinpoint_long_codes = os.environ['PINPOINT_LONG_CODES'].split(',') # This function can be used within an Amazon Pinpoint Campaign or Amazon Pinpoint Journey. def lambda_handler(event, context): logging.get...
python
# -*- coding: utf-8 -*- # Generated by Django 1.9.5 on 2016-04-25 08:41 from __future__ import unicode_literals from django.db import migrations import isi_mip.contrib.blocks import wagtail.core.blocks import wagtail.core.fields import wagtail.images.blocks class Migration(migrations.Migration): dependencies = ...
python
# MIT License # # Copyright (c) 2021 Andrew Krepps # # 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...
python
import os import pandas as pd import numpy as np root = 'D:\\MT\\mt_framework\\evaluation' folder = ['add_car', 'add_bicycle', 'add_person', 'night', 'rainy'] model = ['basecnn', 'vgg16', 'resnet101'] for f in folder: img_list = os.listdir(os.path.join(root, f)) for m in model: data = [[0, 0] for i i...
python
from urlparse import parse_qs from django.http import HttpResponse from ocgis.util.inspect import Inspect from ocgis.util.helpers import get_temp_path from ocgis import env import util.helpers as helpers from ocgis.util.shp_cabinet import ShpCabinet import os.path from ocgis.api.definition import SelectUgid, Prefix, Un...
python
# -*- coding: utf-8 -*- import numpy as np import torch import torchtestcase as ttc from torch.nn import functional from transformer import multi_head_attention as mha __author__ = "Patrick Hohenecker" __copyright__ = ( "Copyright (c) 2018, Patrick Hohenecker\n" "All rights reserved.\n" "\...
python
""" This module contains the definition of the ConditionalGenerator. """ import numpy as np class ConditionalGenerator: """Conditional Generator. This generator is used along with the model defined in :class:`ctgan.models.Generator`, to sample conditional vectors. Parameters ---------- data:...
python
__source__ = 'https://leetcode.com/problems/merge-k-sorted-lists/' # https://github.com/kamyu104/LeetCode/blob/master/Python/merge-k-sorted-lists.py # Time: O(nlogk) # Space: O(1) # heap # # Description: Leetcode # 23. Merge k Sorted Lists # # Merge k sorted linked lists and return it as one sorted list. Analyze and d...
python
# coding: utf-8 # # Copyright 2019 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/ # # or in the "lice...
python
#!/usr/bin/python3 """ Rectangle class defination """ class Rectangle: """ an empty class of squre """ pass
python
from django.db import models from django.urls import reverse class BlogPost(models.Model): title = models.CharField(max_length=255) pub_date = models.DateTimeField() body = models.TextField() image = models.ImageField(null=True, blank=True) def get_absolute_url(self): return reverse('blog_post', args=[str(sel...
python
#!/usr/bin/env python3 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Copyright 2010 California Institute of Technology. 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...
python
USERS_CLIENT_ID = "som_core_users" USERS_CLIENT_SECRET = "17d76b65-b8dc-44e6-b23a-73813a2feb63"
python
import time from os import path from core_data_modules.cleaners import Codes, PhoneCleaner from core_data_modules.cleaners.cleaning_utils import CleaningUtils from core_data_modules.traced_data import Metadata from core_data_modules.traced_data.io import TracedDataCodaV2IO from core_data_modules.util import IOUtils f...
python
import random from core.skills.skillsLoader import SkillsList from core.utils.cleanOrder import * class Skill: def __init__(self, keyphrases, superwords,badwords, result): self.keyphrases = cleanStringList(keyphrases) # On clean les phrases connues et les mots clés self.superwords = cleanStringLi...
python
from typing import Any import tensorflow as tf from determined import tensorboard class TFKerasTensorBoard(tf.keras.callbacks.TensorBoard): # type: ignore def __init__(self, *args: Any, **kwargs: Any): log_dir = str(tensorboard.get_base_path({}).resolve()) super().__init__(log_dir=log_dir, *arg...
python
#!/usr/bin/env python import math class Areas: def __init__(self): pass def circle(self, _, radiusEntry, label): radius = float(radiusEntry.get_text()) result = radius**2 * math.pi result = round(result, 3) label.set_text("RESULT: " + str(result)) def triangle(self, _, baseEntry, heightEntry, label): ...
python
from setuptools import setup import setuptools setup(name="rubikenv", version="0.1", description="Gym env for rubik cube", author="Adrien Bufort", author_email="adrienbufort@gmail.com", packages=setuptools.find_packages(), package_dir={"rubikenv": "rubikenv"}, install_requires...
python
import collections from supriya import CalculationRate from supriya.synthdefs import UGen class FreeVerb(UGen): """ A FreeVerb reverb unit generator. :: >>> source = supriya.ugens.In.ar(bus=0) >>> supriya.ugens.FreeVerb.ar( ... source=source, ... ) FreeVe...
python
# print(bin(int(input(),8))[2:]) 짧은 풀이 def change(num, first = False): ret = '' while num: ret += chr(num % 2 + 48) num //= 2 while len(ret) < 3: ret += '0' idx = 3 if first: while idx > 1 and ret[idx - 1] == '0': idx -= 1 return ret[:idx][::-1] N =...
python
import config import transformers import torch.nn as nn class HateSpeechClassifier(nn.Module): def __init__(self): super(HateSpeechClassifier, self).__init__() self.bert = transformers.BertModel.from_pretrained(config.BERT_PATH, return_dict=False) self.bert.resize_token_embeddings(len(conf...
python
import json import sys from extract_excel_create import ExtractExcelCreate from extract_excel_insert import ExtractExcelInsert from extract_excel_update import ExtractExcelUpdate class App: FILE_NAME = '.\excel_config.json' def __init__(self): self._config = self.retrieveData() self._program_t...
python
""" General-purpose PDE System class """ import numpy from dolfin import * from .illposed import * from .errorest import * from .utilities import _call from collections import OrderedDict parameters["refinement_algorithm"] = "plaza_with_parent_facets" __all__ = ["PDESystem", "LinearPDE", "NonlinearPDE", "GoalAdaptiv...
python
class RandomActor: def __init__(self, game): self.game = game def getActionProb(self, board, player): valids = self.game.getValidMoves(board, player) probs = valids sum_probs = sum(probs) probs = [x/float(sum_probs) for x in probs] return probs
python
''' For further detail/future revisions, visit https://shyam.saladi.org/pymol_viridis DESCRIPTION Makes perceptually uniform and colorblind accessible color palettes available in PyMOL Certain colors are indistinguishable to people with the various forms of color blindness, and therefore are better n...
python
from html import unescape from alertserver.config import Trello as config_trello import trolly client = trolly.client.Client(config_trello.api_key, config_trello.token) assert client is not None member = client.get_member() assert member is not None print('Connected by Member: %s' % member.get_member_information()[...
python
from snapedautility.plot_corr import plot_corr import pandas as pd import numpy as np from pytest import raises import altair def df(): df = pd.DataFrame({"a":np.random.normal(100, 30, 5), "b":np.random.normal(8, 5, size=5), "c":np.random.randint(100, size=5), ...
python
import os from django.conf import settings from utils.email import add_outgoing_email # expense emails def send_accountingsystem_expense_email(expense): """ Sends an email to the accountingsystem with the invoice as an attachment, and with the expense uuid and description in email subject """ a...
python
from .proxyselenium import get_chromedriver
python
from django import template from django.utils.safestring import mark_safe import commonmark register = template.Library() @register.filter() def commonmark_safe(text): ast = commonmark.Parser().parse(text) walker = ast.walker() # Remove images for node, entering in walker: if node.t == 'ima...
python
import plotly.graph_objects as go import networkx as nx from pathlib import Path import os import subprocess import importlib.util """ This file handles the logic when a button is pressed on our GUI __author__ Cade Tipton __author__ Gatlin Cruz __version__ 9/15/20 """ BASE_DIR = Path(__file__).resolve().parent.parent ...
python
#!/usr/bin/env python3 import os import logging logger = logging.getLogger("rpifancontrol.cputemp") def get(): """ Obtains the current CPU temperature. :returns: Current CPU temperature if successful, zero value otherwise. :rtype: float """ result = -1. # The first line in this file hol...
python
import json import os import boto3 from botocore.exceptions import ClientError from typing import Any, Dict from aws_lambda_powertools import Logger, Tracer from aws_lambda_powertools.utilities.typing import LambdaContext from aws_lambda_powertools.utilities.data_classes import APIGatewayProxyEvent from boto3.dynamodb....
python
import dace.library def assert_exists(name): dace.library.get_library(name) def assert_not_exists(name): raised = False try: dace.library.get_library(name) except: raised = True pass if not raised: raise RuntimeError("Library " + name + " exists.") assert_not_exist...
python
from train import ex def main(): batch_size = 8 sequence_length = 327680 model_complexity = 48 ex.run( config_updates={ "split": "redux", "audio": "mix.flac", "instrument": "all", "midi_programs": range(96), "max_harmony": None, ...
python
#!/usr/bin/env python from bs4 import BeautifulSoup import glob import pandas as pd import re import sys from parsers import parse_totals, parse_tests from util import normalize_int def is_testing_table(table): headers = [th.text for th in table.findAll("th")] return "Tests" in headers # Use the historical...
python
# -*- coding: utf-8 -*- """ Orchestration for operations on the contacts collection. This is simply pass-through now, but left as a place-holder as an example of a more robust service. """ from typing import List, Dict import falcon from ..common.logging import LoggerMixin from ..repository.contacts_repository impor...
python
# -*- coding: utf-8 -*- import time import numpy as np import torch from app.rangechecker import RangeChecker from videoholder import VideoHolder from track import centroidtracker from util import box_center __all__ = ['CarRecord', 'FeatureExtractor', 'CarCounter'] class CarRecord(): def __init__(self, oid, ...
python
# FIXME: file is only used by Tektronix_driven_transmon.py: we disabled methods overriden there to limit dependencies import logging import numpy as np from scipy.optimize import brent from .qubit_object import Transmon from qcodes.utils import validators as vals from qcodes.instrument.parameter import ManualParamete...
python
if __name__ == '__main__': from vdirsyncer.cli import app app()
python
from abc import ABC, abstractmethod from dataclasses import dataclass from typing import Optional from foundation.value_objects import T from pomodoros.application.queries.tasks import GetRecentTasksByProjectId from pomodoros.application.repositories.tasks import TaskRepository from pomodoros.domain.value_objects impo...
python
#!/usr/bin/env python # coding: utf-8 # Required libraries import os import numpy as np import pandas as pd def define_folder(loc_): """ Creating folder based on the giving location information. If the given information is not folder, it gives error message. Parameters ---------- loc_ : ...
python
import unittest from eqs import Vector from eqs.matrix import Matrix class MatrixTest(unittest.TestCase): def test_is_square(self): self.assertTrue( Matrix(2, 2).is_square ) def test_is_not_square(self): self.assertFalse( Matrix(2, 3).is_square ) ...
python
""" reference http://oppython.hatenablog.com/entry/2015/09/28/222920 """ import numpy as np from matplotlib import pyplot as plt from scipy import optimize def approximate_polynomial(coefficients,x,y=0): """calc polynomial f(x)=sum(a[i]*x**i) using Horner method""" fx=0 for i in range(len(coefficients))...
python
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: MIT-0 import boto3 import os # Define the environment variables for repository branch name and region REGION = os.getenv('AWS_REGION') MAIN_BRANCH_NAME = os.getenv('MAIN_BRANCH_NAME') REPOSITORY_NAME = os.getenv('REPO...
python
import re p = re.compile("^(\D+)\s(\d+),(\d+)\s\D+\s(\d+),(\d+)$") lights = [[0 for x in range(1000)] for x in range(1000)] with open('input.txt') as f: for inst in f.readlines(): m = p.match(inst) action = m.group(1) x1 = int(m.group(2)) y1 = int(m.group(3)) x2 = int(m.g...
python
o = object() r = o.__reduce__() print type(r), len(r) class C(object): def __repr__(self): return "<C>" c = C() r = c.__reduce__() print type(r), len(r) assert len(r) == 2 c2 = r[0](*r[1]) print c, c2
python
# -*- coding: utf-8 -*- # Generated by Django 1.11.3 on 2017-09-28 16:38 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('fdi', '0007_auto_20170925_1600'), ] operations = [ migrations.AddField( ...
python
"""add server description Revision ID: 5bb20df3f035 Revises: ffdd07363665 Create Date: 2020-08-21 21:40:14.688639 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '5bb20df3f035' down_revision = 'ffdd07363665' branch_labels = None depends_on = None def upgrade(...
python
""" pyart.util.xsect ================ Function for extracting cross sections from radar volumes. .. autosummary:: :toctree: generated/ cross_section_ppi _copy_dic """ from copy import copy import numpy as np from ..core import Radar def cross_section_ppi(radar, target_azimuths): """ Extract...
python
# coding:utf-8 import urllib.request from selenium import webdriver import re import json import os import timeit def get_num(filename): # 获取每一话的url尾缀的集合 with open(filename, 'rb') as f: res = f.read().decode() ans = res.split('\n') return ans def get_all_img_url(base_url, download_filen...
python
from django.conf.urls import url, include from rest_framework.routers import DefaultRouter from .views import UserView router = DefaultRouter() router.register('', UserView) urlpatterns = [ url('', include(router.urls)) ]
python
from django.db.models import Q from django.contrib.auth.mixins import LoginRequiredMixin from django.shortcuts import get_object_or_404 from django.views.generic import TemplateView from cajas.users.models.employee import Employee from cajas.users.models.group import Group from cajas.office.models.officeCountry impor...
python
""" Hook for https://github.com/libtcod/python-tcod You should skip this hook if you're using a custom font. """ from PyInstaller.utils.hooks import collect_data_files # Package tdl's 'default' font file. datas = collect_data_files('tdl')
python
__all__ = ['commands']
python
import numpy as np from helper.dataHelper import getAll def getBestFit(score, exam_type, expense): ## Get all schools' information allSchools = getAll() usefulInfo = [] # Construct the array to store useful information for school in allSchools: schoolInfo = [] schoolInfo.append(sch...
python
from __future__ import division from itertools import chain from sklearn.feature_extraction.text import CountVectorizer import numpy as np import pandas as pd from fisher import pvalue import re import collections from nltk.stem.porter import PorterStemmer import math from percept.tasks.base import Task from percept.fi...
python
import getopt from sys import argv from . import Serve, init_app from .configs.Config import UserConfig production = False opts,args = getopt.getopt(argv[1:],'-p',['production']) for opt_name,opt_value in opts: if opt_name in ('-p', '--production'): production = True if production: Serve(UserConfig....
python
from twitter.pants.targets.jvm_target import JvmTarget class OinkQuery(JvmTarget): def __init__(self, name, dependencies, sources=None, excludes=None): JvmTarget.__init__(self, name, sources, dependencies, excludes) # TODO: configurations is required when fetching jar_dependencies but should not be self...
python
import sys class Solution(object): def threeSumClosest(self, nums, target): """ :type nums: List[int] :type target: int :rtype: int """ numsSorted = sorted(nums) minDiff, minS = sys.maxint, None i = 0 while i < len(numsSorted) - 2: ...
python
from telethon import events from ..db import db from ..globals import limited_client @events.register(events.NewMessage(pattern=r"^/start", func=lambda m: m.is_private)) async def start_user_handler(event): print("start") user_id = event.chat_id con = db.get() if con["max_sub_count"] <= len(con["subs"...
python
# Source: https://github.com/micropython/micropython-lib from umqttsimple import MQTTClient as NotSoRobust import utime class MQTTClient(NotSoRobust): DELAY = 2 DEBUG = True def reconnect(self): i = 0 while 1: try: if self.sock: self.poller_r...
python
# Licensed under a 3-clause BSD style license - see LICENSE.rst import os import json DEFAULTS = { 'lincor max': 3500, 'y range': [625, 1225], 'x range': [1040, 1901], 'step': 5, 'bottom': 624, 'top': 1223, 'readnoise': 12, 'gain': 1.5, 'spextool_path': os.path.join(os.path.expandu...
python
import pyhop import map ###OPERATORS### """ Moves the robot 'a' from it current position to position 'x'. If the robot is carrying a box, the position of that box changes together with the position of the robot """ def moveto(state, a, x): if map.room_of(state.loc[a])==map.room_of(x): state.loc[a] = x ...
python
# -*- coding: utf-8 -*- import tensorflow as tf import matplotlib.pyplot as plt import matplotlib as mpl import simulators import derivatives import utils import books import hedge_models import preprocessing import approximators from constants import FLOAT_DTYPE class BrownianMotion(simulators.GBM): def __init_...
python
coset_init = lib.coset_init_lf insert = lib.cs_insert_lf remove = lib.cs_remove_lf get_s = lib.cs_get_size_lf clear = lib.cs_clear_lf get_min = lib.cs_min_lf get_max = lib.cs_min_lf upper_bound = lib.cs_upper_bound_lf rupper_bound = lib.cs_rupper_bound_lf get_k = lib.cs_get_k_lf
python
# Copyright (c) 2015 Mirantis, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
python
from airflow import DAG from airflow.operators.python_operator import PythonOperator from datetime import datetime default_args = { 'owner': 'demo', 'depends_on_past': False, 'start_date': datetime(2020, 9, 9), 'email': ['demo.cheng@hotmail.com'], 'queue': 'cheetah_q1' } dag = DAG("daily_maintain...
python
from .__init__ import * def multiplicationFunc(maxRes=99, maxMulti=99): a = random.randint(0, maxMulti) b = random.randint(0, min(int(maxMulti / a), maxRes)) c = a * b problem = str(a) + "*" + str(b) + "=" solution = str(c) return problem, solution
python
s = list(input()) c=0 for i in range(0,len(s),3): if s[i]!='P': c+=1 if s[i+1]!='E': c+=1 if s[i+2]!='R': c+=1 print(c)
python
#!/usr/bin/env python3 # encoding:utf-8 ''' File Observer daemon ''' import time import argparse import requests from watchdog.observers.polling import PollingObserver as Observer from watchdog.events import FileSystemEventHandler from lib.logger import Logger __author__ = 'Marco Espinosa' __version__ = '1.0' __email...
python
# # Copyright 2018 Analytics Zoo 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 law or agreed to...
python
#!/usr/bin/python3 # # Use the data in a spreadsheet to compute some statistics about the number of students in eahc program, track, and addmission group # # Input # ./add_stats_to_spreadsheet.py spreadsheet_filae.xls sheet_name # # Éxamples: # # last modified: 2020-07-25 # import pprint import time import json impor...
python
import mido import fluidsynth import os from midi2audio import FluidSynth import music21 from music21 import * from mido import MidiFile, MidiTrack from F2 import melody from Bass import bass def compile(melodySong, bassSong): melody(melodySong) bass(bassSong) harm = mido.MidiFile('four-chor...
python
#!/usr/bin/env python import rospy from geometry_msgs.msg import TwistStamped from nav_msgs.msg import Odometry import tf_conversions class drive_straight_controller: def __init__(self): self.setup_parameters() self.setup_publishers() self.setup_subscribers() def setup_parameters(self): self.gain_distance...
python
# epydoc recognizes @param f2 as a parameter despite the space after the # argument, but does not recognize note as a field (because of the space). def sample(f1, f2, f3, f4): """ @see: field 1 @note : is it a field? has space before colon @param f1: field 3 with an arg @type f1: integer @param f2 : is it a...
python
import jwt; from colorconsole import terminal screen = terminal.get_terminal(conEmu=False) string = """ ___ _________ _____ _ | \ \ / /__ __/ ____| | | | |\ \ /\ / / | | | | _ __ __ _ ___| | _____ _ __ _ | | \ \/ \/ / | | | | | '__/ _` |/ ...
python
import os import PIL from PIL import Image import numpy as np import argparse # import sys # sys.path.append('/usr/local/bin/cuda-9.0/lib64') import tensorflow as tf import keras from keras import backend as K from keras.layers import Input, Lambda, Conv2D from keras.models import load_model, Model from keras.callbacks...
python
from django.urls import path from rest_framework.authtoken.views import obtain_auth_token from server.users.views import LogoutView, RegisterView urlpatterns = [ path("users/register/", RegisterView.as_view(), name="register"), path("users/login/", obtain_auth_token, name="login"), path("users/logout/", L...
python
import random import time import sys # Developed By: Leo Power # https://powerthecoder.xyz main_list= [] list_am = input("Enter amount of players: ") for i in range(int(list_am)): name = input("Enter Player Name: ") main_list.append(name) x = 0 while x != 1: print() amount_per_team = input("Player Pe...
python
import attrdict class InventoryItem(attrdict.AttrMap): def __init__(self, *args, **kwargs): """Idea from http://stackoverflow.com/questions/4984647/accessing-dict-keys-like-an-attribute-in-python. Initialise with: >>> item = InventoryItem(item_json_dictionary)""" super(InventoryIte...
python
"""Subclass of QPP Measure to calculate measure 407 (MSSA).""" import collections from claims_to_quality.analyzer.calculation.qpp_measure import QPPMeasure from claims_to_quality.analyzer.processing import claim_filtering from claims_to_quality.config import config from claims_to_quality.lib.connectors import idr_quer...
python
# -*- coding: utf-8 -*- # # analyze learning experiments # # 18 Sep 2015 by Ulrich Stern # # notes: # * naming: # calculated reward: entering of actual or virtual (fly 2) training circle # control reward: entering of control circle ("top vs. bottom") # # TODO # * always for new analysis: make sure bad trajectory data...
python
#  Copyright 2019 LINE 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 # #       https://www.apache.org/licenses/LICENSE-2.0 # #  Unless required by applicable law or agreed to...
python
import numpy as np from matplotlib import pyplot as plt from matplotlib import cm from UncertainSCI.distributions import UniformDistribution """ This script demonstrates basic instantiation and manipulation of a bivariate uniform probability distribution on a rectangle. """ dim = 2 bounds = np.zeros([2,dim]) bounds...
python
#!/usr/bin/python3 from usb.core import find as finddev devices = finddev(find_all=1, idVendor=0x1366) for dev in devices: try: dev.reset() except: pass
python
"""It is necessary to traverse the bam file sort some data by read name""" import argparse, sys, os, gzip, pickle, zlib, base64 from shutil import rmtree, copy from multiprocessing import cpu_count, Pool, Lock from tempfile import mkdtemp, gettempdir from subprocess import Popen, PIPE from seqtools.format.sam.bam.fil...
python