text
string
size
int64
token_count
int64
import unittest from unittest.mock import ANY, patch from tests.fixtures.fit import fit_fixture from pandas import DataFrame from .context import PySIP class MetadataTestSuite(unittest.TestCase): """Metadata test cases.""" @patch("metalog.metalog.fit") @patch("json.dump") @patch("builtins.open") ...
2,765
1,440
import bpy # Lists class ZmeySceneTypeList(bpy.types.UIList): def draw_item(self, context, layout, data, item, icon, active_data, active_propname): if item: layout.prop(item, "name", text="", emboss=False) # Panels class ZmeyWorldPropertyPanel(bpy.types.Panel): """Zmey Scene Type...
2,643
940
# -------------------------------------------------------- # Copyright (c) 2021 Microsoft # Licensed under The MIT License # -------------------------------------------------------- import torch.nn as nn from utils.torch_funcs import init_weights_fc, init_weights_fc0, init_weights_fc1, init_weights_fc2 __all__ = ['B...
3,710
1,248
from __future__ import absolute_import, division, print_function, unicode_literals from amaascore.parties.company import Company class Fund(Company): def __init__(self, asset_manager_id, party_id, base_currency, description='', party_status='Active', display_name='', legal_name='', url='', ...
955
244
from django.test import TestCase class TestPhoneTokenSerializer(TestCase): """ This class is designed to test django_flex_user.serializers.PhoneTokenSerializer """ def setUp(self): from django_flex_user.models.user import FlexUser self.user = FlexUser.objects.create_user(phone='+1202...
1,127
309
validation_messages = { "en": { "e-mail": "Invalid e-mail address.", "telephone": "Invalid telephone number.", "code": "Invalid postal code." }, "pl": { "e-mail": "Niewłaściwy adres e-mail.", "telephone": "Niewłaściwy format numeru telefonu.", "code": ...
367
124
class RedisStatusError(Exception): pass
44
13
class Solution: def removeOuterParentheses(self, s: str) -> str: stack = [] start = 0 primitives = [] # retrieve all the primitives for index, letter in enumerate(s): if letter == "(": stack.append(letter) else: stack.p...
637
173
#!/usr/bin/env python3 # ## @file # checkout_pin_command.py # # Copyright (c) 2017 - 2020, Intel Corporation. All rights reserved.<BR> # SPDX-License-Identifier: BSD-2-Clause-Patent # import os from git import Repo from edkrepo.commands.edkrepo_command import EdkrepoCommand, OverrideArgument, SourceMani...
8,009
2,490
from typing import List, Set, Dict, Tuple, Optional, Union, Any from multiple_futures_prediction.train_carla import train, Params import gin import argparse def parse_args() -> Any: parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser.add_argument('--config', type=str, de...
634
213
# This file is a part of the CMToolbox. # It is licensed under the BSD 3-clause license. # (See LICENSE.) # # Copyright Toby Driscoll, 2014. # (Re)written by Everett Kropf, 2014, # adapted from code by Toby Driscoll, originally 20??. # Python Port Copyright Andrew Walker, 2015 import numpy as np from .conformalmap impo...
2,215
838
##################################### # Database/postgres.py ##################################### # Description: # * Objects related to interacting # with SQL database that uses PostGres # as SQL flavor language. from Database.base import DBInterface, TableObject from Database.columnattributes import ColumnAttributes...
9,263
2,522
# -*- coding:utf-8 -*- # &Author AnFany # 不同池化得到的图片对比 import pooling as p from skimage import io from PIL import Image import numpy as np def generate_fig(fig, file, func): """ # 首先读取图片的矩阵,然各三个通道各自池化,将得到的结果合成为图片矩阵,最后根据矩阵显示图片 :param fig: 需要处理的图片的路径 :param file: 最周保存图片的路径 :retur...
1,492
871
# -*- coding: utf-8 -*- """ Copyright 2015-Present Randal S. Olson This file is part of the TPOT library. TPOT is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your...
2,406
723
from .import_lightcurve import ReadLC_MACHO from .Feature import FeatureSpace from .alignLC import Align_LC from .PreprocessLC import Preprocess_LC
148
45
import bs import random import bsUtils def bsGetAPIVersion(): # see bombsquadgame.com/apichanges return 4 def bsGetGames(): return [ProtectionGame] class SpazClone(bs.SpazBot): def __init__(self, player): self.character = player.character self.color = player.color self.hi...
25,217
6,994
# write_NAICS_from_Census.py (scripts) # !/usr/bin/env python3 # coding=utf-8 """ Uses a csv file manually loaded, originally from USEEIOR (4/18/2020), to form base NAICS crosswalk from 2007-2017 Loops through the source crosswalks to find any NAICS not in offical Census NAICS Code list. Adds the additional NAICS to ...
2,612
970
from xlwt import * import sys from struct import pack, unpack def cellname(rowx, colx): # quick kludge, works up to 26 cols :-) return chr(ord('A') + colx) + str(rowx + 1) def RK_pack_check(num, anint, case=None): if not(-0x7fffffff - 1 <= anint <= 0x7fffffff): print "RK_pack_check: not ...
4,662
1,983
#!/usr/bin/env python # Copyright (c) 2011 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # based on an almost identical script by: jyrki@google.com (Jyrki Alakuijala) """Prints out include dependencies in chrome. Since ...
7,843
2,809
''' Package for built-in selection operators '''
50
12
import sys, requests, json def main(dict): print 'Received data' print dict missing_values = [] required_values = ['logmet_host', 'logmet_port', 'space_id', 'logmet_token'] for key in required_values: if not key in dict: missing_values.append(key) if len(missing_values) > 0: return {'re...
10,098
3,009
from django.test import TestCase from djexperience.crm.models import PhoneEmployee, Employee from .data import EMPLOYEE_DICT class PhoneEmployeeTest(TestCase): def setUp(self): self.employee = Employee.objects.create(**EMPLOYEE_DICT) phone = PhoneEmployee( phone='11 98765-4321', ...
495
156
import base64 import json import random import string from os import remove from hashlib import sha256 from cryptography.hazmat.primitives.ciphers.aead import AESGCM def get_nonce(): chars = string.ascii_letters + string.digits result_str = "".join(random.choice(chars) for _ in range(12)) return result_str ...
1,008
381
# with open('./weather_data.csv') as f: # data = [line.split(',') for line in f.read().split('\n')] # print(data) # # import csv # # with open('weather_data.csv') as f: # data = csv.reader(f) # temperature = [] # for row in data: # try: # temperature.append(int(row[1])) # exc...
369
128
# preliminaries import sys,os,time,cv2 import numpy as np import matplotlib.pyplot as plt from utils import imread_to_rgb, img_rgb2bw DB_PATH = '/home/jhchoi/datasets4/RAF/' raf_dict = dict() #FER: 0=angry, 1=disgust, 2=fear, 3=happy, 4=sad, 5=surprise, 6=neutral #RAF-basic and RAF-multi: # 1:Surprise, 2:Fear, 3:Disg...
4,519
2,004
# -*- coding: utf-8 -*- """ Common handlers for ibpy Created on Thu Mar 19 22:34:20 2015 @author: Jev Kuznetsov License: BSD """ import pandas as pd from ib.ext.Order import Order class Logger(object): """ class for logging and displaying icoming messages """ def __init__(self,tws): tws.registerAll...
5,322
1,546
# Generated by Django 3.1.12 on 2021-08-24 12:39 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('comparer', '0016_auto_20210820_1328'), ] operations = [ migrations.AddField( model_name='rankingbrowserpluginmodel', ...
1,149
339
# In the 20*20 grid below, four numbers along a diagonal line # have been marked in red. # The product of these numbers is 26 * 63 * 78 * 14 = 1788696. # What is the greatest product of four adjacent numbers in the same direction # (up, down, left, right, or diagonally) in the 20*20 grid? rows = 20 columns = 20 grid =...
2,294
827
import pandas as pd #histogram for each column df.plot.hist() #scatter chart using pairs of points df.plot.scatter(x='w',y='h')
128
47
from .cnn import CNN, CNNMultiChannel MODELS = ('random', 'static', 'non-static', 'multi-channel') def get_model(model_type, num_classes, pretrained_word2vec): if model_type not in MODELS: raise ValueError("Invalid model type: %s" % model_type) if model_type == 'random': return CNN(num_clas...
636
207
"""Main module.""" import sys from dependency_injector.wiring import Provide from .listers import MovieLister from .containers import Container def main(lister: MovieLister = Provide[Container.lister]) -> None: print('Francis Lawrence movies:') for movie in lister.movies_directed_by('Francis Lawrence'): ...
680
229
import logging from contextlib import suppress from datetime import datetime from typing import Optional, Union import discord from redbot.core import Config, commands from redbot.core.bot import Red from redbot.core.utils.chat_formatting import bold, error, humanize_list from .abc import CompositeMetaClass from .api...
16,502
4,378
from .generate_src_collection import GenerateSrcCollection
59
15
from django.test import TestCase from django.core.mail import send_mail from django.conf import settings from .views import email_inquiry from .forms import ContactForm # Create your tests here. class EmailTesting(TestCase): def test_send_mail(self): print("\nTesting email sending functionality...") ...
607
167
from plaid.api.api import API class Item(API): '''Sandbox item endpoints.''' def reset_login(self, access_token): ''' Put an item into an ITEM_LOGIN_REQUIRED error state. :param str access_token: ''' return self.client.post('/sandbox/item/reset_login', { ...
2,392
667
""" Settings for Pact Verification Tests. """ from .test import * # pylint: disable=wildcard-import, unused-wildcard-import #### Allow Pact Provider States URL #### PROVIDER_STATES_URL = True #### Default User name for Pact Requests Authentication ##### MOCK_USERNAME = 'Mock User' ######################### Add Aut...
483
143
from collections import OrderedDict n = int(input()) d = OrderedDict() for _ in range(n): items = input() item_name, price = items.rsplit(" ", 1) d[item_name] = d.get(item_name, 0) + int(price) for k, v in d.items(): print(k, v)
249
100
from django.apps import AppConfig class TradingConfig(AppConfig): name = 'trading' verbose_name = 'Intercambios'
123
40
# Class for the data_screen. Manages displaying data stored by the meter. from kivy.clock import Clock from kivy.uix.screenmanager import Screen from kivy.uix.button import Button from kivy.uix.popup import Popup from kivy.uix.label import Label from kivy.core.window import Window from kivy.uix.boxlayout import BoxLa...
4,048
1,310
#!/usr/bin/env python3 import sys # This was very hard, but I attempted a blackbox general solution without # analyzing the code by hand first. # Trying to solve this with sympy hangs while building and simplifying # expressions far from the required depth, and I didn't want to mess with # better solvers. # I had to ...
2,104
712
from pydantic import BaseModel, Field from uuid import UUID class Image(BaseModel): id: int classified_id: int class Config: orm_mode = True class ImageCreate(BaseModel): classified_id: int class ImageDB(Image): id: int filename: UUID extension: str = Field(max_length=8) cla...
359
121
from __future__ import absolute_import from __future__ import division from __future__ import print_function import logging import sys logging.basicConfig( stream=sys.stdout, level=logging.DEBUG, format='%(asctime)s %(name)s-%(levelname)s: %(message)s', datefmt='%Y-%m-%d %H:%M:%S') from os.path import...
6,471
1,963
import os import time import keras import numpy as np import scipy # scipy.misc.imresize() is was removed in scipy-1.3.0 import runai.reporter.keras BATCH_SIZE = 64 IMAGE_SIZE = 224 def resize_images(src, shape): resized = [scipy.misc.imresize(img, shape, 'bilinear', 'RGB') for img in src] return np.stack(r...
3,893
1,490
# Generated by Django 3.0.5 on 2020-06-17 13:42 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('expense', '0005_auto_20200617_1820'), ] operations = [ migrations.AlterField( model_name='expense', name='date', ...
393
145
from pydantic import BaseModel, Field from typing import Optional class FooRequest(BaseModel): foo: Optional[str] = Field( None, description='foo', example='foo', min_length=1, regex='^[a-zA-Z0-9]+$', ) class FooResponse(BaseModel): foo: str = Field( ..., ...
430
143
from quasimodo.serializable import Serializable from .predicate_interface import PredicateInterface class Predicate(PredicateInterface, Serializable): """Predicate Default implementation of a PredicateInterface """ def to_dict(self): res = dict() res["type"] = "Predicate" res[...
748
211
import numpy as np from sparse_soft_impute import SoftImpute, SPLR from scipy.sparse import coo_matrix, csr_matrix, csc_matrix, lil_matrix from sklearn.utils.testing import assert_raises, assert_equal, assert_array_equal import unittest class TestPredict(unittest.TestCase): ''' Unit Tests for the Sparse implement...
7,134
2,798
import requests from bs4 import BeautifulSoup def stock_price(symbol: str = "AAPL") -> str: url = f"https://in.finance.yahoo.com/quote/{symbol}?s={symbol}" soup = BeautifulSoup(requests.get(url).text, "html.parser") class_ = "My(6px) Pos(r) smartphone_Mt(6px)" return soup.find("div", class_=class_).fi...
501
186
#!/usr/bin/env python # -*- coding: utf-8 -*- """The setup script.""" from setuptools import setup, find_packages with open('README.rst') as readme_file: readme = readme_file.read() with open('HISTORY.rst') as history_file: history = history_file.read() requirements = ['Click>=6.0', 'colossus', 'astropy', ...
2,006
661
import pickle import numpy as np import gym # import pybobyqa import tensorflow as tf import matplotlib.pyplot as plt import pandas as pd from simulated_tango import SimTangoConnection class FelLocalEnv(gym.Env): def __init__(self, tango, **kwargs): self.max_steps = 10 print('init env ' * 20) ...
13,091
4,088
t = int(input()) for i in range(t): count = 0 score = 0 s = input() for j in s: if j == 'O': count += 1 score += count else: count = 0 print(score)
220
76
from typing import Optional, Dict, Any, List import blxr_rlp as rlp from bxcommon.messages.eth.serializers.transaction_type import EthTransactionType from bxcommon.messages.eth.serializers.unsigned_transaction import UnsignedTransaction from bxcommon.utils import convert from bxcommon.utils.blockchain_utils.eth impor...
13,710
4,136
#! /usr/bin/env python3 import os import numpy as np import scipy.stats as stats import matplotlib.pyplot as plt import matplotlib.dates as mdates from multiprocessing import Pool from datetime import datetime import arrow data_dir = 'clean_data/' out_dir = 'curves/' out_dir = os.path.dirname(out_dir) + '/' if out_d...
3,425
1,327
# Copyright (c) 2014-present PlatformIO <contact@platformio.org> # # 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 appli...
1,185
348
from ..utils import clean, http_client
39
11
from mrjob.job import MRJob from mrjob.step import MRStep from datetime import datetime class MRTask01(MRJob): def steps(self): return [ MRStep(mapper=self.mapper1, reducer=self.reducer1), MRStep(reducer=self.reducer2) ] def mapper1(self, _, line): ...
1,474
496
import os import sys import io import pickle import torch import functools from PIL import Image from starlette.applications import Starlette from starlette.responses import Response, FileResponse from starlette.exceptions import HTTPException from starlette.staticfiles import StaticFiles from starlette.routing impor...
2,595
906
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! """Client and server classes corresponding to protobuf-defined services.""" import grpc import MasterServer_pb2 as MasterServer__pb2 class MasterServerStub(object): """Missing associated documentation comment in .proto file.""" def __init...
15,866
4,191
from typing import Optional import pytest from c_mock_generator.module_definition.exceptions import MockGeneratorError from c_mock_generator.module_definition.parameter_documentation import \ ParameterDocumentation, ActiveAttributions from c_mock_generator.module_definition.parameter import Parameter from c_mock_g...
6,569
1,916
# -*- coding: utf-8 -*- # Copyright (c) 2011 Naranjo Manuel Francisco <manuel@aircable.net> # Copyright (c) 2001-2009 Twisted Matrix Laboratories. # See Twisted LICENSE for details. """ Various Bluetooth Socket classes """ # System Imports import os import types import socket import sys import operator import bluetoo...
7,496
2,170
# Задача 2. Вариант 21. # Напишите программу, которая будет выводить на экран наиболее понравившееся вам высказывание, автором которого является Леонардо да Винчи. Не забудьте о том, что автор должен быть упомянут на отдельной строке. # Rotkin A.M. # 02.04.2016 print ('За сладкое приходтся горько расплачиваться') prin...
381
158
# 練習17 借金を返済しよう (ex17.py) # 借金をして月々、定額を返済していくと借金はどうなっていくのかを調べるプログラムを作成しよう。 # 借金の金額と、利息の年利率(%)、月々の返済額を入力すると、毎月、借金がなくなるまで月数と借金の金額を表示するものとする。 # 月々の借金は、借金の利息年利率/12(月割り)分増加するが、返済分だけ減る。 # 実行結果 # 借金> 100000 # 年利率(%)> 14.0 # 返済額> 20000 # 1月: 返済額 20000 円 残り 81166 円 # 2月: 返済額 20000 円 残り 62113 円 # 3月: 返済額 20000 円 残り 42838 円 # 4月:...
959
824
''' Module to generate a demo folder structure for testing purpose. This demo takes the structure of individual Excel files based on an assessor of the test candidate. Each candidate is assigned 3 assessors and will be assessed on 3 criteria ''' # Import libraries import os import numpy as np import pandas as...
2,531
906
import pandas as pd import numpy as np from sklearn.base import BaseEstimator from luminol.anomaly_detector import AnomalyDetector from luminol.modules.anomaly import Anomaly from luminol.modules.time_series import TimeSeries from AnomalyAlgorithms import anomaly_detect_ts from Utils import * from abc import abstract...
22,715
8,063
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import unittest import onnx from onnx.tools import update_model_dims from onnx import helper, TensorProto class TestToolsFunctions(unittest.TestCase): def test_upda...
1,722
610
from . import io, operations, ui __version__ = "0.2" __all__ = ["io", "operations", "ui"]
91
36
import numpy as np import scipy.sparse as sp def subsetNpMatrix(matrix, row_bounds, column_bounds): rows = np.array([x for x in range(row_bounds[0], row_bounds[1]) if 0 <= int(x) < matrix.shape[0]]) cols = np.array([y for y in range(column_bounds[0], column_bounds[1]) if 0 <= int(y) < matrix.shape[1]]) if...
2,551
1,110
import torch model = torch.hub.load('pytorch/vision:v0.10.0', 'deeplabv3_resnet101', pretrained=True) model.eval()
114
54
import math from typing import Optional, Sequence from assembly_gym.environment.generic import Object from ..object_velocity_sensor import ObjectVelocitySensor from task import StackingTask class FixedNumberPlacedPartsVelocitySensor(ObjectVelocitySensor[StackingTask]): """ A sensor that provides the velocit...
2,003
559
#!/usr/bin/env python """ task 1.4 Unit circles # ToDo: Implement it in three dimensions # L_p norm # https://www.youtube.com/watch?v=SXEYIGqXSxk # unit circle: # https://www.youtube.com/watch?v=qTbDQ9gkKJg """ import pylab import matplotlib.pyplot as plt import numpy as np from auxiliar import * @save_figure("out...
1,888
911
import logging import requests import json import os import time def after(current_configuration, output, test_id): jaeger_host = current_configuration["jaeger_host_url"] jaeger_services = current_configuration["jaeger_services"].split(" ") service_to_test = current_configuration["jaeger_test_if_service_i...
2,388
657
class ParserResult: def __init__(self, value): self.__value = value def get(self, name): return self.__value.get(name, None) def __getattr__(self, item): return self.__value.get(item, None)
229
74
# Define here the models for your scraped items # # See documentation in: # https://docs.scrapy.org/en/latest/topics/items.html import scrapy class StatusItem(scrapy.Item): # define the fields for your item here like: indice = scrapy.Field() ticker = scrapy.Field() empresa = scrapy.Field() empres...
1,757
662
from django.db import models from cms.models import CMSPlugin from polls.models import Poll class PollPluginModel(CMSPlugin): poll = models.ForeignKey(Poll, on_delete="models.CASCADE") def __str__(self): return self.poll.question
249
81
import argparse from datetime import datetime import msgpack from persistent_queue import PersistentQueue import pytz from tabulate import tabulate parser = argparse.ArgumentParser(description='View data from a queue') parser.add_argument('queue') parser.add_argument('start', type=int) parser.add_argument('end', typ...
984
299
"""Tests for :mod:`numpy.core.fromnumeric`.""" import numpy as np A = np.array(True, ndmin=2, dtype=bool) B = np.array(1.0, ndmin=2, dtype=np.float32) A.setflags(write=False) B.setflags(write=False) a = np.bool_(True) b = np.float32(1.0) c = 1.0 d = np.array(1.0, dtype=np.float32) # writeable np.take...
4,002
2,287
#!/usr/bin/python #-*- encoding:utf-8 -*- #title:workyi_Talent system SQL injection #author: xx00 #ref: http://www.wooyun.org/bugs/wooyun-2010-0148657 import urlparse def assign(service, arg): if service == 'ruijie_router': arr = urlparse.urlparse(arg) return True, '%s://%s/' % (arr.sch...
871
388
import pytest from django.conf import settings from django.core.exceptions import ValidationError from django.utils import translation from wagtail.core.models import Page from find_a_supplier.tests.factories import IndustryPageFactory from invest.tests.factories import InvestAppFactory, \ SectorLandingPageFactor...
2,716
921
import os from collections.abc import Iterable DIRECTORY = os.path.dirname(os.path.realpath(__file__)) TEMPLATES = os.path.join(DIRECTORY, 'templates') def load_template(path): with open(os.path.join(TEMPLATES, path)) as f: return f.read() def render_html(template, table): return template.replace(...
1,315
445
""" Handles the validation and loading of a non-fungible item and its associated parent type to the db. """ from bitcoinstore.extensions import db from bitcoinstore.api.models.NonFungibleItem import NonFungibleItem from bitcoinstore.api.models.NonFungibleType import NonFungibleType def put_non_fungible(sku, sn, prope...
1,562
459
from django.contrib import admin from .models import onepiece, naruto, afrosamurai, aot, bleach, \ bnha, deathnote, fairytail, fmab, haikyu, hxh, kny, onepunchman admin.site.site_header = 'Anime View' # Register your models here. class AnimeListAdmin(admin.ModelAdmin): list_display = ('Episode', 'EpisodeLin...
955
344
from setuptools import setup, find_packages from codecs import open as copen from os import path here = path.abspath(path.dirname(__file__)) # Get the long description from the README file with copen(path.join(here, 'README.md'), encoding='utf-8') as f: long_description = f.read() # get the dependencies and ins...
1,565
518
# apps/contact/urls.py # Django modules from django.shortcuts import render, get_object_or_404, redirect from django.views.generic import ListView, DetailView from django.db.models import Q from django.views.generic.edit import ( CreateView, UpdateView, DeleteView ) from django.contrib.auth.forms import User...
5,800
2,140
from copy import copy from pathlib import Path from .tox_base_case import ToxBaseCase from .tox_helper import Tox BASH = "cd {} && molecule {} lint -s {}" class ToxLintCase(ToxBaseCase): description = "Auto-generated lint for ansible cases" def __init__(self, cases, name_parts=None): self._cases =...
1,808
575
from minpair.generator import Generator def generator(**args): return Generator(**args) def vowel_minpair(vowels: list): return generator().vowel_minpair(vowels) __all__ = ['__version__'] try: from minpair._version import version as __version__ except ImportError: # broken installation, we don't e...
421
127
from .delta_type import DeltaType from .namedtuples.bind_args import BindArgs from .namedtuples.bound import Bound from .simplad_base import SimpladBase from .simplad_monad import WrappedDelta import abc ''' bind process input (~bound~, []) extract unbound and annotation from ~bound~ call bind until lowest lay...
3,498
1,042
from django.shortcuts import render_to_response, HttpResponse from django.http import HttpRequest from django.template import RequestContext from django.http import HttpResponseRedirect from django.core.urlresolvers import reverse from gym.models import FitnessListing, FitnessListingForm # from gym.forms import Docume...
5,215
1,516
from algosdk.future.transaction import ApplicationNoOpTxn, PaymentTxn, AssetTransferTxn from .prepend import get_init_txns from ..utils import Transactions, TransactionGroup from ..contract_strings import algofi_manager_strings as manager_strings def prepare_mint_transactions(sender, suggested_params, storage_accoun...
3,381
971
# Generated by Django 3.2 on 2021-04-13 17:33 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('spotify', '0001_initial'), ] operations = [ migrations.AlterField( model_name='artist', name='external_urls', ...
1,627
475
from app import db from flask_login import current_user from app.models import Ticket, Reclamation, User, Message from flask import url_for def send_message(EventClass, event_id, recipient): if EventClass == Ticket: content = create_msg_body_for_new_ticket(event_id) msg = Message(author=current_us...
1,794
593
def bar(): return 'THIS_IS_FOO_BAR'
40
20
from setuptools import find_packages, setup # read the contents of README file from os import path from io import open # for Python 2 and 3 compatibility this_directory = path.abspath(path.dirname(__file__)) # read the contents of requirements.txt with open(path.join(this_directory, 'requirements.txt'), e...
1,891
580
import os import cv2 import time import numpy as np import pyautogui import matplotlib.pyplot as plt from input_feeder import InputFeeder from mouse_controller import MouseController from face_detection import Model_fd from gaze_estimation import Model_ge from facial_landmarks_detection import Model_fld from head_pose_...
7,200
2,358
from ..commandparser import Member from ..discordbot import unmoot_user import discord name = 'unmoot' channels = None roles = ('helper', 'trialhelper') args = '<member>' async def run(message, member: Member): 'Removes a moot from a member' await unmoot_user( member.id, reason=f'Unmooted by {str(message.autho...
425
160
import numpy as np import matplotlib.pyplot as plt from sklearn.cluster import KMeans from sklearn import datasets from datareduction.bayesian_pca_DR import BayesianPCA_DR from prml.feature_extractions import BayesianPCA, PCA from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets...
1,531
708
# Copyright 2017 Google 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 required by applicable ...
1,525
503
# -*- coding: utf-8 -*- # Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1) # # (1) Kamaelia Contributors are listed in the AUTHORS file and at # http://www.kamaelia.org/AUTHORS - please extend this file, # not this notice. # # Licensed under the Apache License, Version 2.0 (the "Lice...
5,520
1,599
# This file is part of the P3IV Simulator (https://github.com/fzi-forschungszentrum-informatik/P3IV), # copyright by FZI Forschungszentrum Informatik, licensed under the BSD-3 license (see LICENSE file in main directory) import numpy as np import warnings def hypot(a, b): # do not use np.hypot(a, b); may not wor...
4,180
1,450
# -*- coding: utf-8 -*- def main(): x = list(input()) print(max(x)) if __name__ == "__main__": main()
118
53
# -*- coding:utf-8 -*- import hashlib import hmac import time try: from urllib import quote # Python 2.X except ImportError: from urllib.parse import quote # Python 3+ from functools import reduce import json import base64 import requests import random class Sts: def __init__(self, config={}): ...
6,901
1,992