text
string
size
int64
token_count
int64
from mandaw import * mandaw = Mandaw("Window!", width = 800, height = 600, bg_color = (0, 0, 0, 255)) mandaw.loop()
117
58
import numpy as np with open("./dice.txt",'r') as f: input_str = f.read() input_data=list(map(int,input_str)) inf = -float('inf') class box(): def __init__(self): self.v = inf self.root = -1 def __repr__(self): return str(self.v) def run_viterbi(n,k): if X[n][k].v != inf:...
1,333
630
from unittest import TestCase from parameterized import parameterized from scheduling.schedule_config import ScheduleConfig from utils import date_utils def to_datetime(short_datetime_string): dt_string = short_datetime_string + ':0.000000Z' return date_utils.parse_iso_datetime(dt_string.replace(' ', 'T')) ...
10,464
6,799
# Copyright 2014 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. import math import unittest # Generated files # pylint: disable=F0401 import sample_service_mojom import test_constants_mojom class ConstantBindingsTest(un...
1,458
530
import requests, lxml.html, re import htmlentitydefs, urllib, random from lxml.cssselect import CSSSelector from StringIO import StringIO import cherrypy import requests from cachecontrol import CacheControl _PROXY_LIST = None _HEADERS = { 'accept':'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*...
5,219
2,035
# 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 in writing, software # distributed under the ...
5,672
1,802
from http import HTTPStatus from unittest import TestCase, mock import jwt from fastapi.testclient import TestClient from src.api.review_resource import REVIEWS from src.config import config from src.main import app from src.models.article import Article from src.models.review import Review def _bearer(**payload): ...
6,534
2,212
import json sequence_name_list = ['A','G','L','map2photo','S'] description_list = ['Viewpoint Appearance','Viewpoint','ViewPoint Lighting','Map to Photo','Modality'] label_list = [ ['arch', 'obama', 'vprice0', 'vprice1', 'vprice2', 'yosemite'], ['adam', 'boat','ExtremeZoomA','face','fox','graf','mag','...
2,354
814
<html> salman.py <html/>
27
15
from pyrogram import Client ,filters import os from helper.database import getid ADMIN = int(os.environ.get("ADMIN", 1696230986)) @Client.on_message(filters.private & filters.user(ADMIN) & filters.command(["broadcast"])) async def broadcast(bot, message): if (message.reply_to_message): ms = await message.reply_te...
579
198
# Calibration methods including Histogram Binning and Temperature Scaling import numpy as np from scipy.optimize import minimize from sklearn.metrics import log_loss import pandas as pd import time from sklearn.metrics import log_loss, brier_score_loss from tensorflow.keras.losses import categorical_crossentropy from...
11,351
3,460
"""Module which implements various types of projections.""" from typing import List, Callable import tensorflow as tf from neuralmonkey.nn.utils import dropout def maxout(inputs: tf.Tensor, size: int, scope: str = "MaxoutProjection") -> tf.Tensor: """Apply a maxout operation. Implementa...
2,259
791
# properties detail please read \ # default_properties.py in dophon_properties module \ # inside your used dophon module package. # author: CallMeE
148
39
from datetime import datetime from textwrap import shorten from typing import Optional, Union import discord from discord.abc import Messageable from discord.errors import Forbidden from discord.ext.commands import Bot, Cog, Context, check, command, is_owner from discord.utils import get from config import ...
5,989
1,891
# The shape of the numbers for the dice dice = { 1: [[None, None, None], [None, "", None], [None, None, None]], 2: [["", None, None], [None, None, None], [None, None, ""]], 3: [["", None, None], [None, "", None], [None, None, ""]], 4: [["", None, ""], [None, None, None], ["", None, ""]], ...
2,176
823
from ..command.encrypt import EncryptionCommand class Encryption: def __init__(self, owner: str = '', user: str = '') -> None: self.__owner = owner self.__user = user self.__verify_entries() @property def owner(self): return self.__owner @property def user(self)...
769
209
# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2019-06-16 15:12 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('photos', '0001_initial'), ] operations = [ migrations.RemoveField( model_...
709
213
import time, datetime, argparse import os, sys import numpy as np np.set_printoptions(precision=2) import matplotlib.pyplot as plt import copy as cp import pickle PROJECT_PATH = '/home/nbuckman/Dropbox (MIT)/DRL/2020_01_cooperative_mpc/mpc-multiple-vehicles/' sys.path.append(PROJECT_PATH) import casadi as cas import ...
17,853
7,000
import os import sys import shutil import re INPUT_PATH = "d:\\dbmaps\\test\\final\\" OUTPUT_PATH = "d:\\dbmaps\\test\\zoom17\\" for filename in os.listdir(INPUT_PATH): InputFile = INPUT_PATH + filename matchResult = re.search('([a-zA-Z]+)-([0-9]+)-([0-9]+)-([0-9]+)\.', filename) if (not ma...
712
287
""" [[https://rememberthemilk.com][Remember The Milk]] tasks and notes """ REQUIRES = [ 'icalendar', ] import re from pathlib import Path from typing import Dict, List, Optional, Iterator from datetime import datetime from .common import LazyLogger, get_files, group_by_key, cproperty, make_dict from my.config i...
2,984
1,043
# def fib2(n): # 返回到 n 的斐波那契数列 # result = [] # a, b = 0, 1 # while b < n: # result.append(b) # a, b = b, a+b # return result # # a = fib2(500) # print(a) def recur_fibo(n): """递归函数 输出斐波那契数列""" if n <= 1: return n else: return(recur_fibo(n-1) + recur_fibo(n-2))...
350
200
import taco.aws_wrappers.dynamodb_wrapper.consts as dynamodb_consts from taco.boto3.boto_config import Regions DEFAULT_REGION = Regions.n_virginia.value RESPONSE_KEY_NAME = 'Responses' PRIMARY_KEY_NAME = 'KEY1' ATTRIBUTE_DEFINITIONS = [ dynamodb_consts.property_schema(PRIMARY_KEY_NAME, dynamodb_consts.AttributeTy...
820
332
import numpy as np from scipy import constants measured_species = ["HMF", "DFF", "HMFCA", "FFCA", "FDCA"] all_species = measured_species.copy() all_species.extend(["H_" + s for s in measured_species]) all_species.extend(["Hx_" + s for s in measured_species]) def c_to_q(c): c_e = list() for i, s in enumera...
1,790
925
import pytest from cayennelpp.lpp_type import LppType @pytest.fixture def hum(): return LppType.get_lpp_type(104) def test_humidity(hum): val = (50.00,) hum_buf = hum.encode(val) assert hum.decode(hum_buf) == val hum_buf = hum.encode(50.25) assert hum.decode(hum_buf) == val val = (50.50...
905
369
from frogtips.api.Credentials import Credentials from frogtips.api.Tip import Tip from frogtips.api.Tips import Tips
118
43
#!/usr/bin/env python from mission_ctrl_msgs.srv import * from studs_defines import * import rospy import time import carlos_vision as crlv from geometry_msgs.msg import PointStamped from geometry_msgs.msg import PoseArray from geometry_msgs.msg import Pose from carlos_controller.msg import StudsPoses #import geometry...
5,218
2,105
# -*- coding: utf-8 -*- """ utils.py ~~~~~~~~ Helper functions for setting up the environment and parsing args, etc. """ import os os.environ['PYTHONHASHSEED'] = '0' from numpy.random import seed import random random.seed(1) seed(1) import sys import logging import argparse import pickle import json import numpy a...
9,204
2,859
import math from functools import lru_cache class Polygon: def __init__(self, n, R): if n < 3: raise ValueError('Polygon must have at least 3 vertices.') self._n = n self._R = R def __repr__(self): return f'Polygon(n={self._n}, R={self._R})' @property def c...
2,539
800
""" PoW.py """ import DSA import sys import hashlib if sys.version_info < (3, 6): import sha3 def rootMerkle(TxBlockFile, TxLen): #To Get the Root Hash of the Merkle Tree TxBlockFileBuffer = open(TxBlockFile, "r") lines = TxBlockFileBuffer.readlines() TxBlockFileBuffer.close() Tx...
1,937
727
# ---------------------------------------------------------------------- # SubNode # ---------------------------------------------------------------------- # Copyright (C) 2007-2020 The NOC Project # See LICENSE for details # ---------------------------------------------------------------------- # Python modules from ...
637
170
import numpy as np # softmax function def softmax(a): exp_a = np.exp(a) sum_a = np.sum(exp_a) return exp_a / sum_a # modified softmax function def modified_softmax(a): maxA = np.max(a) exp_a = np.exp(a - maxA) sum_a = np.sum(exp_a) return exp_a / sum_a
287
125
# example of mask inference with a pre-trained model (COCO) import sys from keras.preprocessing.image import img_to_array from keras.preprocessing.image import load_img from mrcnn.config import Config from mrcnn.model import MaskRCNN from mrcnn.visualize import display_instances from tools import load_config # load co...
1,770
632
import os import csv import copy import json import torch import numpy as np from os import path as osp from bootstrap.lib.logger import Logger from bootstrap.lib.options import Options from block.datasets.vqa_utils import AbstractVQA from copy import deepcopy import random import tqdm import h5py class VQA2(AbstractV...
8,260
2,826
import datetime x = datetime.datetime.now() print(x) # 2021-07-13 22:55:43.029046 print(x.year) print(x.strftime("%A")) """ 2021 Tuesday """ x = datetime.datetime(2020, 5, 17) print(x) # 2020-05-17 00:00:00 x = datetime.datetime(2018, 6, 1) print(x.strftime("%B")) # June
281
165
# Copyright 2014 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 "license" file accompa...
2,564
761
#!/usr/bin/env python #coding=utf-8 import os import re import requests import datetime import BeautifulSoup #url requests setting host_url = 'https://oj.leetcode.com' login_url = 'https://oj.leetcode.com/accounts/login/' question_list_url = 'https://oj.leetcode.com/problems/' code_...
11,237
3,372
# -*- encoding: utf-8 -*- ############################################################## ## Author: Abdulmumen Naas ## Description: Arabic Natural Language Processor (Kalam-lp) ## Version: 0.0.1 ## Copyright (c) 2014 Abdulmumen Naas ############################################################## import re impo...
1,028
411
__author__ = 'techsparksguru' from selenium.webdriver.common.by import By from .base_page_object import BasePage class SummerDressesCatalogPage(BasePage): def __init__(self, context): BasePage.__init__( self, context.browser, base_url='http://www.automationpractice.com...
1,617
507
import unittest import collatz class TestCollatz(unittest.TestCase): '''tests the collatz.py script''' def test_collatz(self): '''table driven test to verify collatz''' tests = ((742, 371), (418, 209), (118, 59), (1978, 989)) for tes...
446
157
from sklearn.ensemble import RandomForestRegressor from openbox.utils.config_space import ConfigurationSpace from openbox.utils.config_space import UniformFloatHyperparameter, \ CategoricalHyperparameter, Constant, UniformIntegerHyperparameter import numpy as np from openbox.utils.config_space.util import convert_c...
4,046
1,463
import subprocess, os # constants with global scope INPUT = "--input" OUTPUT = "--output" FILTERS = "--filters" SUPPPLEMENTS = "--supplements" JAR_DIRECTORY = "target" JAR_NAME = "report-engine.jar" def build_jar(): should_package = input("\nBuild " + JAR_NAME + " file from src (Y/N) ? ") # check ...
3,258
1,054
##======================================================================================== import numpy as np from scipy import linalg from sklearn.preprocessing import OneHotEncoder from scipy.spatial import distance #========================================================================================= def itab(n...
11,267
4,675
import sys if __name__ == '__main__': # Set the defaults a = '' b = '' # If arguments were passed to this script, use those try: a = sys.argv[1] b = sys.argv[2] except Exception: pass # Sets the result to the longer of the two Strings result = a if len(a) ...
335
112
""" PGN Scraper is a small program which downloads each of a user's archived games from chess.com and stores them in a pgn file. When running the user is asked for the account name which shall be scraped and for game types. The scraper only downloads games of the correct type. Supported types are: bullet, rapid, blitz...
5,050
1,615
import sqlite3 import codecs # for using '한글' import os # 타이틀 정보 읽어오기 f = codecs.open("jjd_info_title.txt", "r") title_list = [] while True: line = f.readline() # 한 줄씩 읽 if not line: break # break the loop when it's End Of File title_list.append(line) # split the line and append it to...
2,117
798
from opt_utils import * import argparse parser = argparse.ArgumentParser() parser.add_argument("-s", "--skip_compilation", action='store_true', help="skip compilation") args = parser.parse_args() if not args.skip_compilation: compile_all_opt_examples() for example in all_examples: args = [] output = run_example(ex...
429
141
# Generated by Django 3.1.1 on 2020-09-22 20:01 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('rec', '0004_auto_20200922_1633'), ] operations = [ migrations.AlterField( model_name='convenio', name='cnpj', ...
801
268
""" Copyright 2017 Neural Networks and Deep Learning lab, MIPT 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 a...
6,452
1,928
'''Read grammar specifications for test cases.''' import re import sys from pprint import pprint from cfg.core import ContextFreeGrammar, Terminal, Nonterminal, Marker from cfg.table import END_MARKER, ParseTableNormalForm class GrammarTestCase(object): '''Contains a CFG and optionally a parse table.''' def ...
3,345
1,078
import os import re import copy import json import pyblish.api import clique import pype.api import pype.lib class ExtractReview(pyblish.api.InstancePlugin): """Extracting Review mov file for Ftrack Compulsory attribute of representation is tags list with "review", otherwise the representation is ignored...
59,286
15,707
import unittest from unittest.mock import Mock import mock import peerfinder.peerfinder as peerfinder import requests from ipaddress import IPv6Address, IPv4Address class testPeerFinder(unittest.TestCase): def setUp(self): self.netixlan_set = { "id": 1, "ix_id": 2, "nam...
6,683
2,577
# -*- encoding: utf-8 -*- # # Copyright © 2012 New Dream Network, LLC (DreamHost) # # Author: Julien Danjou <julien@danjou.info> # # 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:...
5,372
1,467
# Lint as: python3 # Copyright 2019 DeepMind Technologies Limited. 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 # # ...
2,407
886
#!/usr/bin/env python """Provides the entities, the building blocks of the SMRCA hierachy representation of a macromolecular structure. The MultiEntity class is a special Entity class to hold multiple instances of other entities. All Entities apart from the Atom can hold others and inherit from the MultiEntity. T...
44,868
13,478
import unittest from ..dispatcher import Dispatcher class Math: @staticmethod def sum(a, b): return a + b @classmethod def diff(cls, a, b): return a - b def mul(self, a, b): return a * b class TestDispatcher(unittest.TestCase): def test_empty(self): self.ass...
3,381
1,190
from itertools import product import struct import pickle import numpy as np from scipy import sparse from scipy import isnan as scipy_isnan import numpy.matlib ASCII_FACET = """facet normal 0 0 0 outer loop vertex {face[0][0]:.4f} {face[0][1]:.4f} {face[0][2]:.4f} vertex {face[1][0]:.4f} {face[1][1]:.4f} {face[1][2]...
7,206
2,965
''' This is a python script that requires you have python installed, or in a cloud environment. This script scrapes the CVS website looking for vaccine appointments in the cities you list. To update for your area, update the locations commented below. If you receive an error that says something is not installed, type...
4,759
1,619
from .pefile import *
22
8
# coding: utf-8 # /*########################################################################## # # Copyright (c) 2016-2017 European Synchrotron Radiation Facility # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to d...
6,643
2,207
# __init__.py # Copyright 2017 Roger Marsh # Licence: See LICENCE (BSD licence) """Miscellaneous modules for applications available at solentware.co.uk. These do not belong in the solentware_base or solentware_grid packages, siblings of solentware_misc. """
260
92
__author__ = "Music" # MNIST For ML Beginners # https://www.tensorflow.org/versions/r0.9/tutorials/mnist/beginners/index.html
127
48
#!/usr/bin/python # mapper.py import sys for line in sys.stdin: row, values = line.strip().split('\t') row_values = values.split(' ') for (col, col_value) in enumerate(row_values): # out: <col> <row> <value> print("{0}\t{1}\t{2}".format(col, row, col_value))
294
112
from ray.rllib.algorithms.maddpg.maddpg import ( MADDPGConfig, MADDPGTrainer, DEFAULT_CONFIG, ) __all__ = ["MADDPGConfig", "MADDPGTrainer", "DEFAULT_CONFIG"]
171
69
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Perform RTM on marmousi """ import os import numpy as np import h5py as h5 from scipy.ndimage.filters import gaussian_filter import sys import shutil from SeisCL import SeisCL names = ['fp32', 'fp16io', 'fp16com'] filedata = os.getcwd() + '/marmfp32' seis = SeisCL() ...
1,849
717
#!/usr/bin/python3 from typing import List from registry import the_registry from param_collector import the_collector class MetaConfig(type): """ Meta class for all configs """ def __new__(mcs, name, bases, namespace): ret = super().__new__(mcs, name, bases, namespace) i = 0 ...
954
306
""" File : argonneV14.py Language : Python 3.6 Created : 7/13/2018 Edited : 7/13/2018 San Digeo State University Department of Physics and Astronomy #https://journals.aps.org/prc/pdf/10.1103/PhysRevC.51.38 --argonneV18 This code implements Argonne V14 potential outlined in ... --CONSTANTS -- ...
3,437
1,626
# -*- coding: utf-8 -*- """ 1556. Thousand Separator Given an integer n, add a dot (".") as the thousands separator and return it in string format. Constraints: 0 <= n < 2^31 """ class Solution: def thousandSeparator(self, n: int) -> str: res = "" str_n = str(n) count = 0 ind = ...
543
186
''' Controller para fornecer dados da CEE ''' from flask_restful import Resource from service.qry_options_builder import QueryOptionsBuilder from model.thematic import Thematic class BaseResource(Resource): ''' Classe de base de resource ''' DEFAULT_SWAGGER_PARAMS = [ {"name": "valor", "required": Fals...
6,483
2,159
# -*- coding: utf-8 -*- CHECKLIST_MAPPING = { 'checklist_retrieve': { 'resource': '/checklists/{id}', 'docs': ( 'https://developers.trello.com/v1.0/reference' '#checklistsid' ), 'methods': ['GET'], }, 'checklist_field_retrieve': { 'resource': ...
3,155
998
import json import os def calculo(self): meta = float(input('valor da meta: ')) # 1000000 valorinicial = float(input('valor inicial: ')) # 5637.99 valormensal = float(input('investimento mensal: ')) # 150 dividendos = float(input('dividendos: ')) # 16.86 meta = meta - valorinicial - valormensal - d...
2,962
1,140
# this version is adapted from http://wiki.ipython.org/Old_Embedding/GTK """ Backend to the console plugin. @author: Eitan Isaacson @organization: IBM Corporation @copyright: Copyright (c) 2007 IBM Corporation @license: BSD All rights reserved. This program and the accompanying materials are made available under ...
10,718
3,539
from django.conf.urls import url from . import views urlpatterns = [ url(r'^$', views.index, name='index'), url(r'^get', views.index, name='index'), url(r'^details/(?P<id>\w)/$', views.details, name='details'), url(r'^add', views.add, name='add'), url(r'^delete', views.delete, name='delete'), ...
513
194
days = int(input()) sladkar = int(input()) cake = int(input()) gofreta = int(input()) pancake = int(input()) cake_price = cake*45 gofreta_price = gofreta*5.8 pancake_price = pancake*3.2 day_price = (cake_price + gofreta_price + pancake_price)*sladkar total_price = days*day_price campaign = total_price - (total_price/8)...
336
140
###################################################################### ## DeepBiome ## - Loss and metrics (mse, cross-entropy) ## ## July 10. 2019 ## Youngwon (youngwon08@gmail.com) ## ## Reference ## - Keras (https://github.com/keras-team/keras) ###################################################################### i...
9,234
3,531
import cv2 import numpy as np import matplotlib.pyplot as plt #from matplotlib import pyplot as plt from tkinter import filedialog from tkinter import * root = Tk() root.withdraw() root.filename = filedialog.askopenfilename(initialdir = "/",title = "Select file",filetypes = (("all files",".*"),("jpg files","...
3,177
1,391
# Binary Sentiment Analysis using Recurrent Neural Networks # Import libraries & dataset list import tensorflow as tf import tensorflow_datasets as dslist # Load Dataset print("\nLoading dataset...") # Download dataset and dataset info DATASET_CODE = 'imdb_reviews/subwords8k' # Usin...
3,927
1,300
import selenium from selenium import webdriver import time import requests import os from PIL import Image import io import hashlib # All in same directory DRIVER_PATH = 'chromedriver.exe' def fetch_image_urls(query:str, max_links_to_fetch:int, wd:webdriver, sleep_between_interactions:int=0.5): def scroll_to_end...
5,146
1,650
""" MIT License Copyright (c) 2020 Maxim Krivich 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, publish,...
1,515
575
"""The geojson module provides data model classes for initialization and storing of GeoJSON objects. """ import typing import typing_extensions import pydantic import numpy as np import brahe.astro as astro import brahe.coordinates as coords import brahe.frames as frames geographic_point = pydantic.conlist(float, mi...
5,305
1,524
n = int(input()) lst = list(map(int, input().split())) def sort1(arr): l = len(arr) for i in range(1, n): cur = arr[i] pos = i check = False while pos > 0: if arr[pos - 1] > cur: check = True arr[pos] = arr[pos - 1] e...
521
170
#!/usr/bin/env python3 # -*- coding:utf-8 -*- ################################################################################## # File: c:\Projects\KENYA ONE PROJECT\CORE\engines\Gudmundsson_Constraint.py # # Project: c:\Projects\KENYA ONE PROJECT\CORE\engines # # Created Date: Thur...
7,141
2,818
from nose.tools import raises from blocks.bricks import Bias, Linear, Logistic from blocks.bricks.parallel import Merge from blocks.filter import VariableFilter from blocks.graph import ComputationGraph from blocks.roles import BIAS, FILTER, PARAMETER, OUTPUT from theano import tensor def test_variable_filter(): ...
3,988
1,305
from collections import Counter import pandas as pd import ipywidgets as widgets import techminer.core.dashboard as dash from techminer.core import ( CA, Dashboard, TF_matrix, TFIDF_matrix, add_counters_to_axis, clustering, corpus_filter, exclude_terms, ) #  from techminer.core.params...
12,437
3,804
import sys from PyQt5.QtWidgets import * from PyQt5.QtCore import * from PyQt5.QtGui import * import qtawesome import matplotlib.pyplot as plt import csv import numpy as np import datetime import os class Stack: def __init__(self): self.items=[] def isEmpty(self): return self.i...
56,425
20,203
from datetime import datetime from django.db import connection from posthog.models import Person from posthog.test.base import BaseTest # How we expect this function to behave: # | call | value exists | call TS is ___ existing TS | previous fn | write/override # 1| set | no | N/A ...
11,800
3,530
from setuptools import setup, find_packages with open("README.md", "r") as fh: long_description = fh.read() setup(name='aif360', version='0.1.0', description='IBM AI Fairness 360', author='aif360 developers', author_email='aif360@us.ibm.com', url='https://github.com/IBM/AIF360', ...
762
285
radiobutton_style = ''' QRadioButton:disabled { background: transparent; } QRadioButton::indicator { background: palette(dark); width: 8px; height: 8px; border: 3px solid palette(dark); border-radius: 7px; } QRadioButton::indicator:checked { background: palette(highlight); } QRadioButton:...
390
130
from __future__ import annotations import lzma, pickle from typing import TYPE_CHECKING from numpy import e from tcod.console import Console from tcod.map import compute_fov import exceptions, render_functions from message_log import MessageLog if TYPE_CHECKING: from entity import Actor from game_map import...
1,788
571
# # PySNMP MIB module ERI-DNX-STS1-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ERI-DNX-STS1-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 18:51:50 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar ...
19,132
9,279
# flake8: noqa # pylint: disable=cyclic-import from .base import db, Model, metadata from .link import Link from .user import User from .event import Event, Repeat from .bookmark import Bookmark from .tag import Tag from .doc import Doc, DocTag from .recipe import Recipe, RecipeImage from .pagination import paginate, P...
357
108
import tensorflow as tf from tensorflow.keras.models import Model from tensorflow.keras.layers import Dense from activations.activations import tan_sigmoid, exponential, ReLU class FFNN(Model): """ Creates a generic Feedforward neural network. """ def __init__(self): super(FFNN, self).__init__() ...
632
204
# Copyright (c) 2021 PaddlePaddle Authors. 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 appli...
3,495
1,279
# VOC分割训练集和测试集 import os import random import shutil trainval_percent = 0.1 train_percent = 0.9 imgfilepath = '../myData/JPEGImages' #原数据存放地 total_img = os.listdir(imgfilepath) sample_num = len(total_img) trains = random.sample(total_img,int(sample_num*train_percent)) for file in total_img: if file in trains...
530
229
"""Example SciUnit model classes.""" import random from sciunit.models import Model from sciunit.capabilities import ProducesNumber from sciunit.utils import class_intern, method_cache from sciunit.utils import method_memoize # Decorator for caching of capability method results. from typing import Union class ConstM...
3,104
833
from sentence_transformers import SentenceTransformer from semantic.config import CONFIG model = SentenceTransformer(CONFIG["model_name"])
140
35
from tensorflow.keras.models import Model from tensorflow.keras.layers import Dense, Flatten, Dropout, Input from tensorflow.keras.layers import MaxPooling1D, Conv1D from tensorflow.keras.layers import LSTM, Bidirectional from tensorflow.keras.layers import BatchNormalization, GlobalAveragePooling1D, Permute, concatena...
8,619
3,301
# Copyright 2022 The AI Flow 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 in wri...
2,468
856
#!/usr/bin/env python3 from isEven import isEven def testRange(min, max, evens): print('Testing [{},{}] {}...'.format(min, max, 'evens' if evens else 'odds')) for i in range(min, max, 2): i = i if evens else i - 1 result = isEven(i) if(not result and evens): raise Exception('Test faile...
628
225
#! /usr/bin/python # encoding=utf-8 import os import datetime,time from selenium import webdriver import config import threading import numpy as np def writelog(msg,log): nt=datetime.datetime.now().strftime('%Y-%m-%d %H-%M-%S') text="[%s] %s " % (nt,msg) os.system("echo %s >> %s" % (text.encode('utf8'),l...
1,139
423
import re from abc import ABC, abstractmethod from sherlockpipe.star.EpicStarCatalog import EpicStarCatalog from sherlockpipe.star.KicStarCatalog import KicStarCatalog from sherlockpipe.star.TicStarCatalog import TicStarCatalog class LightcurveBuilder(ABC): OBJECT_ID_REGEX = "^(KIC|TIC|EPIC)[-_ ]([0-9]+)$" NU...
1,584
593