text
string
size
int64
token_count
int64
# -*- coding: utf-8 -*- """ Created on Mon Feb 17 01:08:13 2020 @author: OAdeoye """ class Dog: def __init__(self, name): self.name = name def respond_to_command(self, command): if (command == self.name): print(self.name + " is Barking!!!") bingo = Dog("Bingo") bingo.respond_to_c...
391
158
#!/usr/bin/python # -*- coding: utf-8 -*- import unittest from datetime import datetime, timedelta from analytics_query import analytics_query as aq START_DATE = (datetime.now() - timedelta(7)).strftime('%Y-%m-%d') END_DATE = (datetime.now() - timedelta(1)).strftime('%Y-%m-%d') start_date = '2015-03-03' end_date = '...
704
276
from WordList import WordList, WordCard import pygame class GameManager: def __init__(self): self.wordList = WordList() self.cards = [] self.badCards = (None, None) self.goodCards = (None, None) self.timer = 0 def startGame(self, pairCount): self.cards = self.w...
2,864
850
from plot import * from experiments import * import warnings warnings.filterwarnings("ignore") #Ignore warnings for now import sys import os import argparse def main(): parser = argparse.ArgumentParser(description='Analysis of Go Games') parser.add_argument('dir',nargs='*') parser.add_argument('--conn',...
1,687
505
# -*- coding: utf-8 -*- # this made for python3 from os import environ def expand_env(params, verbose=False): """ dotenv like function, but not dotenv """ for key, val in params.items(): _print('try %s, %s'%(key, val), verbose) if isinstance(val, dict): _print('ORDEREDDICT', verbos...
1,358
414
""" A file for setup. """ # Metadata __author__ = "cpuabuse.com" __copyright__ = "cpuabuse.com 2019" __license__ = "ISC" __version__ = "0.0.1" __email__ = "cpuabuse@gmail.com" __status__ = "Development" # Minimum python version is 3.6
236
103
from admin.upload import FileUploadField, ImageUploadField from flask_babelex import Babel from flask_admin._compat import urljoin from flask import redirect from flask_admin._compat import quote from flask_admin.contrib.fileadmin import FileAdmin from flask_admin import Admin, BaseView, expose from flask_admin....
6,392
1,905
import json from airflow.contrib.operators.kubernetes_pod_operator import KubernetesPodOperator def _split_list(seq, num): k, m = divmod(len(seq), num) return list( (seq[i * k + min(i, m):(i + 1) * k + min(i + 1, m)] for i in range(num)) ) _IS_SPLIT_KEY = 'is_split' class PrepareInputOperator...
4,137
1,274
import inspect from . import actionscenes from . import dd_combatmission from . import dd_customobjectives from . import dd_distanttown from . import dd_homebase from . import dd_intro from . import dd_lancedev from . import dd_main from . import dd_roadedge from . import dd_roadedge_propp from . import dd_roadstops f...
1,440
512
# -*- coding: utf-8 -*- """ Base class to handle collection of profiles and means across multiple .h5 files """ import logging import numpy as np import os import sys import psutil import pandas as pd import time import shutil from warnings import warn from reV.handlers.outputs import Outputs from reV.utilities.except...
27,696
7,930
from core.errors import LEO_ERRORS from django import template register = template.Library() from utility.currency import to_price as to_price_origin from utility.num import to_horuf as to_horuf_num,to_tartib as to_tartib_ @register.filter def to_price(value): return to_price_origin(value=value) @register.filter...
964
331
# Time: O(m*n) # Space: O(n) # 85 # Given a 2D binary matrix filled with 0's and 1's, # find the largest rectangle containing all ones and return its area. # Ascending stack solution. class Solution(object): def maximalRectangle(self, matrix): # USE THIS """ :type matrix: List[List[str]] ...
3,119
1,110
n=int(input()) a = [int(s) for s in input().split(' ')] increment=1 max_increment=1 for i in range(1,n): if a[i]>a[i-1]: increment=increment+1 else: max_increment=max(max_increment,increment) increment=1 max_increment=max(max_increment,increment) print(max_increment)
299
108
#!/usr/bin/python from SocketServer import TCPServer, StreamRequestHandler import socket from subprocess import call import datetime import json import re import sys import os CONF = {} RRDTOOL = '/usr/bin/rrdtool' PERIODS = [] CHART_BACKGROUNDCOLOR = '#000000' CHART_CANVASCOLOR = '#000000' CHART_DIRECTORY = '/tmp/'...
8,869
3,006
# цветная спираль из имени пользователя import turtle t = turtle.Pen() turtle.bgcolor("black") colors = ["red", "yellow", "blue", "green"] # gui text input name = turtle.textinput("Введи своё имя", "Как тебя зовут?") for x in range(100): t.pencolor(colors[x%4]) t.penup() t.forward(x*4) ...
410
186
# coding:utf-8 # @Time : 2019/5/15 # @Author : xuyouze # @File Name : base_config.py import importlib import os import sys import torch import logging from .dataset_config import build_dataset_config from .logger_config import config __all__ = ["BaseConfig"] class BaseConfig(object): def __init...
1,537
598
from fact.io import read_data def test_sumupCountsOfRun(): from ratescan.utils import sumupCountsOfRun df = read_data("test/test.hdf5", key="ratescan") df_summed = sumupCountsOfRun(df) assert df_summed.run_id.unique() == 182 assert len(df_summed.ratescan_trigger_thresholds) == 1000 ...
814
317
''' @copyright: 2022 - Symas Corporation ''' import sys import pickle import argparse from rbac.util import global_ids from rbac.model import Perm, User from rbac import access from rbac.util import RbacError from ..cli.utils import print_user, print_entity from rbac.cli.utils import ( load_entity, add_args, ADD,...
4,080
1,261
from httprider.core.generators import utility_func_map class UtilityFunctionsPresenter: def __init__(self, view, parent): self.view = view self.parent = parent # update list of functions for f in utility_func_map.keys(): self.view.function_selector.addItem(f) ...
1,678
488
import argparse import numpy as np import os from numpy.linalg import inv import torch import torch.nn as nn from torch.utils.data import TensorDataset import torch.optim as optim from torch.distributions.multivariate_normal import MultivariateNormal from torch.distributions.uniform import Uniform from torch.distribut...
12,745
4,622
#!/usr/bin/env python import os import requests import json import time import sys import subprocess import csv import json import numpy as np def main(): start_time = time.time() post_url = "http://0.0.0.0:8000/cpu" mean_cpu = 0 counter = 0 s = 0.75 container_name = subprocess.check_output(["d...
1,764
584
import os import pandas as pd import numpy as np from pandas.testing import assert_series_equal from madic import io class TestChromatogramExpansion(object): def setup_method(self): # two rows of comma separated intensity chromatograms self.df = pd.DataFrame([['1,2,3,4,5,6,5,4,3,2,1'], ...
5,264
1,677
import matplotlib.pyplot as plt x = [] y = [] with open('points') as f: for point in map(lambda x: x.split(), f.readlines()): x.append(int(point[0])) y.append(int(point[1])) plt.scatter(x, y) plt.show()
226
90
# Copyright 2015-2018,2020 Ivan Yelizariev # License MIT (https://opensource.org/licenses/MIT). { "name": "POS debranding", "version": "13.0.1.0.0", "author": "IT-Projects LLC, Ivan Yelizariev", "license": "Other OSI approved licence", # MIT "category": "Debranding", "support": "help@itpp.dev",...
509
204
import tensorflow as tf # We will train all layers except hidden[12]. Therefore, Layers 1 and 2 are frozen train_vars = tf.get_collection(tf.GraphKeys.TRAINABLE_VARIABLES, scope="hidden[34]|outputs") loss = None # Your loss is here train_op = tf.train.GradientDescentOptimizer(learning_rate=0.01).minimize(loss, var_l...
335
120
# from Calculator.Addition import addition from Calculator.Division import division def populationmean(num): try: num_values = len(num) total = sum(num) return division(total, num_values) except ZeroDivisionError: print("Error: Enter values greater than 0") except ValueErro...
371
99
# -*- coding: utf-8 -*- import os class Configuration: def __init__(self): self.DOTA_BUFF_BASE_URL = 'https://pt.dotabuff.com' self.HEROES = f'{self.DOTA_BUFF_BASE_URL}/heroes' self.HERO_COUNTERS = '/counters' self.HERO_COUNTERS_FULL = f'{self.DOTA_BUFF_BASE_URL}/hero-name/{self.H...
585
254
""" The Python implementation of the GRPC image client. Modified from grpc/examples/python/helloworld/greeting_client.py. """ from __future__ import print_function import logging from io import BytesIO from PIL import Image import grpc import image_pb2 import image_pb2_grpc def run(): # NOTE(gRPC Python Team)...
908
293
import numpy as np from sklearn.neural_network import MLPRegressor from sklearn.exceptions import NotFittedError from inter.interfaces import QLearning from utility import set_all_args class NFQ(QLearning): gamma = 0.9 beta = 0.8 def __init__(self, **kwargs): self.mlp = MLPRegressor( ...
1,842
633
import datetime from database.chemprop.endpoints import Endpoints from database.chemprop.parameters import Parameters from database.database_schemas import Schemas from sqlalchemy import Column, Integer, String, DateTime, ForeignKey from sqlalchemy.orm import relationship from database.base import Base class Endpoi...
1,062
299
label_name_mapping = { 0: "unlabeled", 1: "outlier", 10: "car", 11: "bicycle", 13: "bus", 15: "motorcycle", 16: "on-rails", 18: "truck", 20: "other-vehicle", 30: "person", 31: "bicyclist", 32: "motorcyclist", 40: "road", 44: "parking", 48: "sidewalk", 49: ...
2,009
1,170
#!/usr/bin/env python from __future__ import absolute_import def main(): import src.barrier if __name__ == '__main__': main()
137
48
from state import TurtleState # TODO : improve... but with useful things for illustrating the point... def test_move(distance): s = TurtleState() s.move(distance) def test_turn(angle): s = TurtleState() s.turn(angle) def test_random_path(): s = TurtleState # TODO
295
102
""" The transitionFinder module is used to calculate finite temperature cosmological phase transitions: it contains functions to find the phase structure as a function of temperature, and functions to find the transition (bubble nucleation) temperature for each phase. In contrast, :mod:`.pathDefomration` is useful for ...
66,843
21,311
import sys import random import networkx as nx from write_nx_graph import write_graph uncommons = set() # Everything except the 3300 common words in SGB f = open ('data/words.txt','r') words = [] for line in f: if len(line)>0 and line[0] == '*': continue word = line.strip()[:5] words.append(wo...
3,720
1,241
#!/usr/bin/env python2 # # Strelka - Small Variant Caller # Copyright (c) 2009-2018 Illumina, 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 3 of the License, or # at your...
7,490
2,150
# This code is part of Qiskit. # # (C) Copyright IBM 2022. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivative wo...
2,750
707
import re from enum import Enum from typing import List import libkol from .request import Request class Furniture(Enum): Nail = (1, 0) GirlsCalendar = (1, 1) BoyCalendar = (1, 2) Painting = (1, 3) MeatOrchid = (1, 4) Bookshelf = (2, 0) ArcaneTomes = (2, 1) SportsMemorabilia = (2, 2)...
1,381
565
# -*- coding: utf-8 -*- # __author__:Song Zhenqi # 2021-01-20 import os import sys import yaml import logging import functools logger_initialized = set() def get_img_list(img_file): img_lists = [] if img_file is None or not os.path.exists(img_file): raise FileNotFoundError("file path: {} is not exis...
2,155
811
from monitoring.uss_qualifier.test_data import test_report from monitoring.uss_qualifier.utils import USSQualifierTestConfiguration from monitoring.uss_qualifier.main import uss_test_executor from monitoring.uss_qualifier.rid.simulator import flight_state_from_kml from monitoring.uss_qualifier.rid.utils import FullFlig...
2,130
700
""" BasketManagementRelated modules """ # import basket models from basket.models import Basket from basket.models import BasketProductLine # import configuration models from grenades_services.all_configuration_data import get_currency_instance from grenades_services.all_configuration_data import get_customer_instance...
11,853
3,242
import numpy as np import matplotlib.pyplot as plt acc = np.array([7.95549917, 7.46641684, 8.16141701, 8.80025005, 7.29208231, 7.73391724, 8.16333294, 9.02033329, 7.60566664, 7.88175011, 7.77574968, 8.79116631, 8.24524975, 8.98549938, 7.3717494 , 7.32324982, 8.14583302, 8.53608322, 9.301250...
2,935
2,574
""" BPF-related stuff. """
27
13
import os import json import geojson import mappyfile_geojson import mappyfile import pytest def get_geojson(fn): tests = os.path.dirname(os.path.realpath(__file__)) fn = os.path.join(tests, fn) with open(fn) as f: gj = geojson.load(f) return gj def test_point(): gj ...
4,485
1,957
''' @Author: Hata @Date: 2020-05-24 15:30:19 @LastEditors: Hata @LastEditTime: 2020-05-24 15:32:04 @FilePath: \LeetCode\230.py @Description: https://leetcode-cn.com/problems/kth-smallest-element-in-a-bst/ ''' class Solution: def kthSmallest(self, root, k): def gen(r): if r is not None: ...
517
207
# ---------------------------------------------------------------------- # | # | PythonUnittestTestParser.py # | # | David Brownell <db@DavidBrownell.com> # | 2018-05-22 07:59:46 # | # ---------------------------------------------------------------------- # | # | Copyright David Brownell 2018-22. # | ...
3,430
936
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import os from typing import Any, Dict from fairseq import checkpoint_utils from fairseq.data.legacy.masked_lm_dictionary import MaskedLMDict...
7,116
2,154
#!/usr/bin/python # Classification (U) """Program: process_request.py Description: Unit testing of process_request in mysql_db_admin.py. Usage: test/unit/mysql_db_admin/process_request.py Arguments: """ # Libraries and Global Variables # Standard import sys import os if sys.version_info < ...
7,249
2,402
#!/usr/bin/env python3 # -*- coding: UTF-8 -*- """ FST test -- test your Foma finite-state transducers! """ from .__version__ import VERSION as __version__ from ._fst import FST from ._results import FailedTestResult, PassedTestResult, TestResults from ._run import execute_test_case, run_tests from ._test_case import...
594
201
import copy import numpy as np import torch from scipy import optimize import logging def sharpness(model, criterion_fn, A, epsilon=1e-3, p=0, bounds=None): """Computes sharpness metric according to https://arxiv.org/abs/1609.04836. Args: model: Model on which to compute sharpness criterion_...
3,674
1,112
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Standalone benchmark runner """ import cProfile import pstats import profile import numpy as np print("Running Rust + Cython benchmarks") # calibrate pr = profile.Profile() calibration = np.mean([pr.calibrate(100000) for x in xrange(5)]) # add the bias profile.Profil...
1,164
438
import time from random import randint def random_int(x): value = [] for i in range(x): value.append(randint(0, x)) return value def Quick_sort(list1): N = len(list1) if N <=1: return list1 pivot = list1.pop() # mid = len(list1)//2 Left_H = [] Right_H = [] for i...
850
372
#REST from rest_framework import viewsets,mixins from rest_framework.permissions import IsAuthenticated #Filters from rest_framework.filters import SearchFilter,OrderingFilter from django_filters.rest_framework import DjangoFilterBackend #Models, serializers from cride.circles.models import Circle,Membership from cri...
1,929
543
from adminweb.services import cep_service from adminweb.models import Profissional from rest_framework import serializers import json def listar_profissionais_cidade(cep): codigo_ibge = buscar_cidade_cep(cep)['ibge'] try: profissionais = Profissional.objects.filter(codigo_ibge=codigo_ibge).order_by('i...
780
248
from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.support.ui import WebDriverWait import shutil import os class GoogleKeywordScreenshooter: def __init__(...
6,680
1,985
"""Extension function related to numpy """ from __future__ import annotations from typing import List, Tuple import numpy as np import pandas from numpy.typing import ArrayLike def dict_to_numpy_array(d: dict, dtype: List[Tuple]) -> np.array: """convert dictionary to numpy array Examples: >>> d = {"aa...
9,414
3,903
from datetime import date from typing import List from attr import attrs, attrib @attrs() class ProjectListProjection: name: str = attrib() total_downloads: int = attrib() @attrs() class DownloadProjection: date: date = attrib() downloads: int = attrib() @attrs() class ProjectProjection: name...
838
266
""" This script computes word masks based on sentiment lexicons """ import os import torch import argparse from tqdm import tqdm from transformers import AutoTokenizer from transformers import GlueDataTrainingArguments as DataTrainingArguments from transformers import GlueDataset as Dataset parser = argparse.Argumen...
3,039
989
class Solution: def compress(self, chars: List[str]) -> int: l = 0 while l < len(chars): r = l + 1 while r < len(chars) and chars[l] == chars[r]: r += 1 num = r - l for k in range(r - l, 1, -1): chars.pop(l) if num > 1: for ...
456
157
from logger import Logger from numpy import average log = Logger(None) def show_queue_length_average(number_of_packets): timestamps = [] vals = [] if len(number_of_packets) == 0: log.info(f"Average number of packets: NO DATA") return 0 for k, v in number_of_packets.items(): ...
3,524
1,358
import repo import export.csv as csv # CONSTANTS milk_q = "SELECT * FROM \"%s\" WHERE price != 0 AND discount = false AND (name ILIKE '%%1l%%' OR name ILIKE '%%1 l%%') AND (name ILIKE '%%piim %%' OR name ILIKE '%%piim,%%') AND name NOT ILIKE '%%juust%%' AND name NOT ILIKE '%%kohupiim%%' AND name NOT ILIKE '%%laktoos%%...
5,946
2,206
# EX1 # if x < y: # y = 0 # x = x + 1 # else: # x = y def max(a, b, c): if a > b and a > c: print(a,' is maximum among all') elif b > a and b > c: print(b, ' is maximum among all') else: print(c, ' is maximum among all') max(30, 28, 18) # def triangleType(a, b, c): # ...
1,755
781
import random import time while (1): def clear(): ##Placeholder code time.sleep(1) clearConsole = lambda: print('\n' * 150) ## clearConsole() wmsg = "Good morning!" events = { 1 : "calm", 2 : "calm", 3...
1,193
386
import numpy as np import OpenEXR as exr import cv2 import Imath import matplotlib.pyplot as plt def readEXR(filename): exrfile = exr.InputFile(filename) header = exrfile.header() dw = header['dataWindow'] isize = (dw.max.y - dw.min.y + 1, dw.max.x - dw.min.x + 1) channelData = dict() # conver...
774
287
from yggdrasil.serialize.SerializeBase import SerializeBase class FunctionalSerialize(SerializeBase): r"""Class for serializing/deserializing a Python object into/from a bytes message using defined functions. Args: encoded_datatype (schema, optional): JSON schema describing the type t...
2,972
773
''' This file is the glue between the Discord bot and the game logic. ''' from wordle_logic import evaluate_guess, generate_new_word from wordy_types import ActiveGame, EndResult, LetterState def begin_game() -> ActiveGame: """ Begin a game for a user. """ # Select a word answer = ge...
2,046
784
import numpy as np def readNNet(nnetFile, withNorm=False): ''' Read a .nnet file and return list of weight matrices and bias vectors Inputs: nnetFile: (string) .nnet file to read withNorm: (bool) If true, return normalization parameters Returns: weights: List of ...
2,422
789
from typing import Dict import neptune.new as neptune import numpy as np import pytorch_lightning as pl import torch import torch.nn as nn from config import NEPTUNE_API_TOKEN, NEPTUNE_PROJECT_NAME from sklearn.metrics import classification_report, f1_score from utils.summary_loss import SummaryLoss from math import c...
13,668
3,743
from functools import lru_cache from collections import defaultdict import pandas as pd import numpy as np with open('input.txt') as fh: depthmap = pd.DataFrame([{ 'row': row, 'col': col, 'height': int(d) } for row, line in enumerate(fh) for col, d in enumerate(line.str...
2,305
835
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html import re import subprocess import sys from pathlib import Path # -- Path setup ------...
3,467
1,050
from .token_types import TT from .token_types import BadTT from .position import Position from .keywords import is_keyword from .keywords import keyword_declared_type from ..lexer import errors class Token: def __init__(self, token_type, value = None, position = None): self.type = token_type self.v...
1,345
398
#!/usr/bin/env python3 """Squares and Cubes for a range of numbers. Given a start and end, calucate the Square x**2 and the Cube x**3 for all numbers. Example of generator and functools.partial. """ from functools import partial def power(base, exponent): """Raise a base to the exponent.""" return base *...
689
240
#program to find the index of an item in a specified list. num =[10, 30, 4, -6] print(num.index(30))
101
43
from django.test import TestCase from django.core.exceptions import ValidationError from mozdns.txt.models import TXT from mozdns.domain.models import Domain class TXTTests(TestCase): def setUp(self): self.o = Domain(name="org") self.o.save() self.o_e = Domain(name="oregonstate.org") ...
1,748
614
#!/usr/bin/env python # Copyright (c) 2019 Orange and others. # # All rights reserved. This program and the accompanying materials # are made available under the terms of the Apache License, Version 2.0 # which accompanies this distribution, and is available at # http://www.apache.org/licenses/LICENSE-2.0 """Define t...
6,698
2,199
# coding=utf-8 from fabric.api import env, run COMMAND_COLLECTSTATIC = 'collectstatic' COMMAND_SYNCDB = 'syncdb' COMMAND_MIGRATE = 'migrate' _default_command = '{python} {manage} {command}' _commands_list = { COMMAND_COLLECTSTATIC: 'yes yes | {python} {manage} {command}', COMMAND_MIGRATE: '{python} {manage} ...
963
338
from django.http import HttpResponseRedirect from django.core.urlresolvers import reverse from django.conf import settings from django.core.exceptions import ValidationError from datetime import datetime, timedelta from commercialoperator.components.main.models import Park from commercialoperator.components.proposals....
8,820
2,826
""" models.py App Engine datastore models Documentation: https://developers.google.com/appengine/docs/python/ndb/entities """ from google.appengine.ext import ndb from google.appengine.ext import blobstore from google.appengine.api import users import functools import flask from flaskext import login from flaskex...
3,552
1,203
import pygame import math import path_planning as pp class Driver(): def __init__(self, vehicle, path, settings): """ Driver """ #_______main objects references_______ #reference to driver vehicle object: self.vehicle = vehicle #creating a plan object: self.plan = p...
2,488
683
#coding:utf-8 ''' Demo for calling API of deepnlp.org web service Anonymous user of this package have limited access on the number of API calling 100/day Please Register and Login Your Account to deepnlp.org to get unlimited access to fully support api_service API module, now supports both windows and linux platforms. ...
2,752
976
# -*- coding: utf-8 -*- """ The built-in Round-Robin algorithm. """ # standard library from typing import Union # scip plugin from spring_cloud.commons.client.service_instance import ServiceInstance from spring_cloud.utils.atomic import AtomicInteger from .loadbalancer import LoadBalancer from .supplier import Servi...
1,195
356
import os import sys import numpy as np import torch from torchvision import datasets, transforms ROOT_DIR = os.path.dirname(os.getcwd()) if ROOT_DIR not in sys.path: sys.path.append(ROOT_DIR) import DeepSparseCoding.utils.data_processing as dp import DeepSparseCoding.datasets.synthetic as synthetic class CustomTe...
4,245
1,354
#!/usr/bin/env python3 from ctypes import * import m2m2_core class M2M2_LED_COMMAND_ENUM_t(c_uint8): M2M2_LED_COMMAND_GET = 0x0 M2M2_LED_COMMAND_SET = 0x1 class M2M2_LED_PATTERN_ENUM_t(c_uint8): M2M2_LED_PATTERN_OFF = 0x0 M2M2_LED_PATTERN_SLOW_BLINK_DC_12 = 0x1 M2M2_LED_PATTERN_SLOW_BLINK_DC_12_...
1,051
585
import networkx as nx import numpy as np import argparse if __name__ == '__main__': np.random.seed(555) NUM = 10000 parser = argparse.ArgumentParser() parser.add_argument('-d', type=str, default='music') args = parser.parse_args() DATASET = args.d kg_np = np.load('../data/' + DATASET + '...
2,327
830
import pygame from pygame.locals import* from pygame import mixer pygame.init() # loading in background image backgroundClassic_image=pygame.image.load('image/WallPaper.png') backgroundAncient_image=pygame.image.load('image/WallPaper2.png') # loading in player image player_imageClassic=pygame.image....
6,317
4,278
import filters as f from filters.test import BaseFilterTestCase # noinspection PyProtectedMember from iso3166 import Country, countries_by_alpha3 from language_tags import tags from language_tags.Tag import Tag from moneyed import Currency, get_currency class CountryTestCase(BaseFilterTestCase): filter_type = f.e...
8,170
2,426
''' Equivalence of AR(1) and MA(infinity) To better understand the relationship between MA models and AR models, you will demonstrate that an AR(1) model is equivalent to an MA(∞ ∞ ) model with the appropriate parameters. You will simulate an MA model with parameters 0.8,0.82,0.83,… 0.8 , 0.8 2 , 0.8 3 , … for a lar...
1,179
440
import PIL.Image import random import numpy as np import cv2 class RandomHorizontalFlip(): def __init__(self): return def __call__(self, inputs): if bool(random.getrandbits(1)): outputs=[] for inp in inputs: out = np.fliplr(inp).copy() ou...
3,752
1,356
#!/usr/bin/env python3 import os import subprocess if __name__ == '__main__': out_dir = 'out' if not os.path.exists(out_dir): os.mkdir(out_dir) subprocess.run(['cargo', 'build', '--release']) exe = 'target/release/svg' subprocess.run([exe, '-i', 'test/simple-text.svg', '-o', 'out/simple-t...
398
150
""" String format type value enumeration. """ TRUE = '1' FALSE = '0' NONE = ''
79
31
from django.contrib import admin from .models import Museums admin.site.register(Museums)
90
26
#!/usr/bin/env python # -*- coding: UTF-8 -*- """ setup ~~~~~ Setup Script Run the build process by running the command 'python setup.py build' :copyright: (c) 2018 by Oleksii Lytvyn. :license: MIT, see LICENSE for more details. """ import osc.osc as osc try: from setuptools import setup...
1,584
500
import asyncio import ssl import aiohttp from . import constants as c def _get_rate_limit_wait(log, resp, opts): """ Returns the number of seconds we should wait given a 429 HTTP response and HTTP options. """ max_wait = 3600 wait = opts['wait'] header_name = opts['rate_limit_reset_he...
2,501
691
#!/usr/bin/env python3 from kubernetes.shell_utils import simple_run as run run(( "python3 gcloud_dataproc/v02/run_script.py " "--cluster create-ht-clinvar " "download_and_create_reference_datasets/v02/hail_scripts/write_clinvar_ht.py"))
252
97
from discord.ext import commands from flegelapi.pg import default, server from distutils.util import strtobool import discord member_table= """ member_( id serial PRIMARY KEY, server_id interger NOT NULL, role_ld interger, channel_id interger, custom_mes character varying DEFAULT が入出しました。, on_o...
4,324
1,440
import gym import numpy as np import sys import theano import theano.tensor as T import layers from layers import FullyConnectedLayer, SoftmaxLayer env = gym.make('CartPole-v0') #Number of actions action_n = env.action_space.n #Number of features observed feature_n = env.observation_space.shape[0] epochs = 100 min...
4,388
1,587
#!/usr/bin/python ''' Andrei Dorin 06/10/2018 User interface for WISP chat implementation ''' import argparse import logging import signal import sys import time import queue import select import getpass from wisp_client import WispClient from wisp_common import State, WispRequest, WispResponse, WispMessage, WISP_DEF...
7,720
2,297
from newpy.loggers.colored_formatter import ColoredFormatter
61
18
# coding: utf8 """Sources provide an abstraction between a source of music notes and putao projects.""" from . import mml # noqa from .reg import formats, loads, register # noqa
181
53
# -*- coding: utf-8 -*- """ Created by libsedmlscript v0.0.1 """ from sed_roadrunner import model, task, plot from mpmath import csc #---------------------------------------------- csc(0.5)
206
79