text
string
size
int64
token_count
int64
data = [i.strip() for i in open("input.txt").readlines()] two = 0 three = 0 for code in data: counts = {} for i in range(0,len(code)): if code[i] in counts.keys(): counts[code[i]] += 1 else: counts[code[i]] = 1 if (2 in counts.values()): two += 1 if (3 in...
384
138
# -*- coding: utf-8 -*- import factory from symposion.speakers.models import Speaker from conf_site.accounts.tests.factories import UserFactory class SpeakerFactory(factory.django.DjangoModelFactory): user = factory.SubFactory(UserFactory) name = factory.Faker("name") class Meta: model = Speake...
322
100
# flake8: noqa import pokediadb.dbuilder.version import pokediadb.dbuilder.type import pokediadb.dbuilder.ability import pokediadb.dbuilder.move import pokediadb.dbuilder.pokemon
179
66
#!/usr/bin/python3 import sys import os import io from orderedset import OrderedSet from shell import Shell import logpath as LogPath VERSION = '1.1' HEADER = '\033[95m' OKBLUE = '\033[94m' OKGREEN = '\033[92m' WARNING = '\033[93m' FAIL = '\033[91m' ENDC = '\033[0m' BOLD = '\033[1m' UNDERLINE = '\033[4m' current_path...
10,171
3,347
# These were used when I was trying to map between controllers # To map to a wheel - but was defeated in that by using a driver # 2021 comment (What did I mean there?) GAMEPAD_TRIANGLE = (0, 0x08) GAMEPAD_CIRCLE = (0, 0x04) GAMEPAD_CROSS = (0, 0x02) GAMEPAD_SQUARE = (0, 0x01) GAMEPAD_DPAD_MASK = 0x0F GAMEPAD_DPAD_NON...
3,514
2,199
# Copyright (c) 2017 Huawei, Inc. # # 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...
4,185
1,148
import requests import re import sqlite3 db =sqlite3.connect("db_tver.db",check_same_thread =False) cur = db.cursor() cur.execute( '''CREATE TABLE if not exists `tver` ( `reference_id` TEXT NOT NULL, `service` TEXT NOT NULL, `player_id` TEXT NOT NULL, `name` TEXT NOT NULL, `title` TEXT, ...
9,046
4,108
from pathlib import Path from click.testing import CliRunner from resolos.interface import res, res_run from resolos.shell import run_shell_cmd from tests.common import verify_result import logging logger = logging.getLogger(__name__) def test_init_empty(): runner = CliRunner() with runner.isolated_filesyste...
1,696
493
import os import sys op_name = [] with open("name.txt") as lines: for line in lines: line = line.strip() op_name.append(line) with open("shape.txt") as lines: index = 0 for line in lines: name = op_name[index] line = line.strip() items = line.split("\t") if "conv" in name: input_shape = [int(s) for ...
946
413
# Wrapper for Mesh Bee library # helping to easier communicate with Mesh Bee module # # Copyright (C) 2014 at seeedstudio # Author: Jack Shao (jacky.shaoxg@gmail.com) # # The MIT License (MIT) # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associate...
6,086
1,859
import unittest import json import requests from unittest import mock from .reqhandler import send_req from pythonapm.agent import Agent from pythonapm import constants class Resp: def __init__(self): self.data = json.dumps({'txn':'success'}) def json(self): return json.loads(self.data) cl...
1,669
536
from django.contrib import admin # Register your models here. from .models import * # To import all the model from .models, then specify those in register admin.site.register(Customer) admin.site.register(Staff) admin.site.register(Service) admin.site.register(Appointment)
277
78
def conv_world(kaist_world_dict): pieces = {} for (sx, sy), count in kaist_world_dict['beepers'].items(): for i in range(count): beeper_id = len(pieces) pieces[beeper_id] = { 'type': 'beeper', 'piece_type': 'marker', 'id': beeper_...
17,263
10,979
def convert_class_to_code(label_map, max_num_classes, use_display_name=True): categories = [] list_of_ids_already_added = [] if not label_map: label_id_offset = 1 for class_id in range(max_num_classes): categories.append({ 'id': class_id +...
934
297
from abc import ABCMeta, abstractproperty, abstractmethod import inspect import random import re import time from requests.exceptions import HTTPError class RoutePathInvalidException(Exception): def __init__(self, name, value, path, validator): self.path = path self.name = name self.value =...
5,694
1,730
# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2018-01-06 00:30 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('polls', '0107_auto_20180101_2108'), ('polls', '0107_auto_20180105_1858'), ] operation...
332
152
from flask import Flask from flask import render_template, redirect, url_for from flask import request import blockChain app = Flask(__name__) @app.route('/', methods=['GET', 'POST']) def index(): # print(request.method ) if request.method == 'POST': text = request.form['text'] if len(text) < ...
5,141
1,755
__author__ = 'TechWhizZ199'
27
15
import os import wget import time import argparse import subprocess import geckodriver_autoinstaller import chromedriver_autoinstaller from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver import FirefoxOptions from selenium.webdriver import DesiredCapabilities fr...
5,668
1,732
from kafka import KafkaProducer import json import random from time import sleep from datetime import datetime # Create an instance of the Kafka producer producer = KafkaProducer(bootstrap_servers='kafka-server:9092', value_serializer=lambda m: json.dumps( m).encod...
781
220
""":mod:`kinsumer.helpers` --- Implements various helpers ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ """ from threading import RLock _missing = object() class locked_cached_property(object): def __init__(self, func, name=None, doc=None): self.__name__ = name or func.__name__ self....
897
262
import os import tempfile import unittest from py4j.protocol import Py4JJavaError from pyspark.ml import Pipeline from pyspark.sql import types as t from mleap.pyspark.feature.string_map import StringMap from mleap.pyspark.spark_support import SimpleSparkSerializer from tests.pyspark.lib.assertions import assert_df f...
4,886
1,524
from .predict import YolactK from .data import * __version__ = "0.1.0"
72
29
#!/usr/bin/env python # coding: utf-8 # In[6]: import pandas as pd import io import requests import time import random # In[3]: # gets the hidden API keys api_key = pd.read_csv('secrets.csv').api_key.to_string().split()[1] # In[124]: # gets data using user's parameters def get_data(symbol, interval): """...
4,210
1,396
#!/bin/python3 from collections import Counter def pairs(socks): return sum(list(map(lambda sock: sock // 2, Counter(socks).values()))) _ = int(input().strip()) socks = list(map(int, input().strip().split(' '))) print(pairs(socks))
241
89
import os from dpsniper.utils.my_multiprocessing import initialize_parallel_executor from dpsniper.utils.paths import get_output_directory, set_output_directory from statdpwrapper.algorithms_ext import * from statdpwrapper.experiments.base import run_statdp from statdpwrapper.experiments.mechanism_config import statd...
1,834
616
__all__ = ['symimg'] from tempfile import mktemp from .reflect_image import reflect_image from .interface import registration from .apply_transforms import apply_transforms from ..core import image_io as iio def symimg(img, gs=0.25): """ Symmetrize an image Example ------- >>> import ants ...
1,134
446
import datetime time=datetime.datetime.today().strftime("%H-%M-%S") text_file = open("/home/pi/TutorCal/CRONtest/"+time+".txt", "w") text_file.write("Hello world!") text_file.close()
184
70
import dlib import face_recognition import glob import pickle import cv2 import numpy as np import os from PIL import Image,ImageFont, ImageDraw, ImageEnhance def add_target_faces(path): faces = {} for img in glob.glob(path + "/*.jpg"): print("encoding img...") f_image = face_recognition.load_image_...
3,775
1,402
from . import text from .base import IFormatter try: from . import binary except ImportError: binary = None
117
33
from django.conf.urls import include, url from django.contrib import admin urlpatterns = [ url(r'^example/', include('pulpo_example.urls')), url(r'^pulpo/', include('pulpo_forms.urls'), name='base'), url(r'^admin/', include(admin.site.urls)), url(r'^model_field_form/$', 'pulpo_forms.views.rend...
378
136
import codecs from contextlib import contextmanager import hashlib import logging from logging.handlers import RotatingFileHandler import random import string from pathlib import Path def random_string(length=32, prefix='', suffix=''): ''' Generate random string length : Length of string prefix :...
2,903
851
from logging import lastResort from pydantic import BaseModel from invmonApi.database import Base from invmonInfra.enum import InventoryLastStatusEnum from sqlalchemy import Column, String, Boolean from uuid import uuid4 class InventorySqlModel(Base): __tablename__ = "inventory" id = Column(String, primary_ke...
1,573
478
# coding: utf-8 """ Module `chatette.parsing.lexing.rule_slot_val` Contains the definition of the class that represents the lexing rule to tokenize a slot value being set within a unit rule (only for a slot). """ from chatette.parsing.lexing.lexing_rule import LexingRule from chatette.parsing.lexing import LexicalToke...
2,201
620
# -*- coding: utf-8 -*- """ Created on Sun Feb 23 20:28:51 2020 @author: Administrator """ """ 已知随机数rand7()产生的随机数是整数1~7的均匀分布,如何构造rand10()函数,使其产生的随机数是整数1-10的均匀分布. """ import random def rand7(): return random.randint(1,7) def rand10(): x = 0 while True: x = (rand7() - 1) * 7 + ra...
441
256
from abc import ABC, abstractmethod from enum import Enum from functools import partial # from math import isinf from typing import Union, Optional, Any from typing import Callable, Tuple, Dict, List, Set, Type # noqa: F401 from ..builtin_values import Bool, ops_symbols from ..abstract_value import AbstractValue from...
26,432
7,857
import keras import tensorflow as tf import numpy.random as rng from keras.datasets import cifar10 from keras.utils import np_utils def data_cifar10(**kwargs): """ Preprocess CIFAR10 dataset :return: """ # These values are specific to CIFAR10 img_rows = 32 img_cols = 32 nb_classes = ...
2,249
850
#!/usr/bin/python #-*- coding:utf-8 -*- from . import const const.UK = 'UK' const.US = 'US'
93
43
# There are copyright holders. import pandapower as pp import pandapower.networks as pn net = pn.case9() pp.runpp(net) print ("Canvass NR Power Flow Results At The Buses") print ("------------------------------------------") print (net.res_bus)
248
81
from django.urls import include, path from . import arche_rdf_views app_name = "archeutils" urlpatterns = [ path('<app_name>/<model_name>/<pk>', arche_rdf_views.res_as_arche_graph, name='res_as_arche_graph'), path('<app_name>/<model_name>', arche_rdf_views.qs_as_arche_graph, name='qs_as_arche_graph'), ]
315
132
import sys from shutil import copyfile def main(): inputArgs = sys.argv #First let's process the arguments argBIM = inputArgs.index("--filenameBIM") + 1 bimFile = inputArgs[argBIM] argEVENT = inputArgs.index("--filenameEVENT") + 1 eventFile = inputArgs[argEVENT] argInputFile = inputArg...
763
259
x = 2 ** (1/2) y = 3 ** (1/3) z = 5 ** (1/5) print(x) print(y) print(z) print() if x>y and x>z: print(x,'jest największa') elif y>x and y>z: print(y,'jest największa') elif z>x and z>y: print(z,'jest największa') print() if x<y and x<z: print(x,'jest najmniejsza') elif y<x and y<z: print(y,'jest...
384
190
title=open("file.txt","w") title.write("《悯农》\n" ) title.close() sum=0 while 1: sentence=open("file.txt","a") sum+=1 if sum>4: sentence.close() break k =input("请输入句子(包括标点符号):") sentence.write(f"{k}\n") sentence.close()
259
121
import bluesky.plan_stubs as bps import bluesky.plans as bp from xpdacq.beamtime import _configure_area_det from xpdacq.glbl import glbl from xpdacq.xpdacq import open_shutter_stub, close_shutter_stub from xpdacq.xpdacq_conf import xpd_configuration def acq_rel_grid_scan( dets: list, exposure: float, wait...
1,635
564
# -*- coding: utf-8 -*- # Generated by Django 1.9.7 on 2016-08-09 17:25 from __future__ import unicode_literals import django.core.validators import django.db.models.deletion import kolibri.content.models from django.db import migrations, models class Migration(migrations.Migration): initial = True dependen...
5,172
1,480
from setuptools import setup, find_packages setup( name='picker-my-sticker', version='0.0.1', description='Stickers for Slack', long_description='S t i c k e r s', url='https://github.com/kennydo/pick-my-stick', author='Kenny Do', author_email='chinesedewey@gmail.com', classifiers=[ ...
555
185
class JsonAttributes: TIMESTAMP = "timestamp" STATE = "state" DIM_STATE = "dim_state" SWITCH_STATE = "switch_state" VALUE = "value" BUTTON = "button" SINCE = "since" DEVICE = "device"
223
92
import numpy as np import time import matplotlib.pyplot as plt import imageio from scipy.optimize import fsolve from body import Body def get_position_from_Kepler(semimajor_axis, eccentricity, inclination, ascending_node, argument_of_periapsis, mean_anomaly, mass_orbit, G=6.67430 * 10**(-11)): """ Get the pos...
10,562
4,797
""" Copyright (c) 2015 Marshall Farrier license http://opensource.org/licenses/MIT lib/ui/handlers.py Handlers for edit menu """ from bson.codec_options import CodecOptions import datetime as dt from functools import partial import json from pymongo.errors import BulkWriteError from ..dbschema import SPREADS from ...
10,897
3,433
# class SidebarView(GenericAPIView): # permission_classes = [AllowAny] # def get(self, request, *args, **kwargs): # org_id = request.GET.get("org", None) # user_id = request.GET.get("user", None) # room = settings.ROOM_COLLECTION # plugin_id = settings.PLUGIN_ID # roomi...
4,126
1,191
# -*- coding: utf-8 -*- """ Load Duqa labeled dataset. """ from __future__ import absolute_import, division, print_function import collections import json import logging import math from io import open from tqdm import tqdm from transformers.tokenization_bert import BasicTokenizer, whitespace_tokenize logger = log...
6,331
1,931
from typing import Any class Orchestrator: # __class__ Reference to the object's class # # __dict__ Mapping that stores the writable attributes of an object or class # # __slots__ Attribute that may be defined in a class to limit the attributes its instances can have. # # def __init_...
1,973
631
import collections import colorsys from typing import Iterable, List, Tuple import matplotobjlib as plot from backports import zoneinfo from matplotlib.colors import ListedColormap import utils from gui.components import PlotComponent from gui.options import ArtistChooser, ColorMap, Spinbox from track import Track ...
1,360
464
# [h] interpolated nudge dialog '''a simple RoboFont dialog for the famous "interpolated nudge" script''' # Interpolated Nudge for RoboFont -- Travis Kochel # http://tktype.tumblr.com/post/15254264845/interpolated-nudge-for-robofont # Interpolated Nudge -- Christian Robertson # http://betatype.com/node/18 from vani...
3,524
1,139
""" This module defines a mixin, which can be used by all implementations for all databases. All the databases have a different hierarchy of DatabaseWrapper, but all of them derive from BaseDatabaseWrapper """ from abc import ABC from typing import Optional from django.db.backends.base.base import BaseDatabaseWrapper...
1,547
387
''' Webserver for the Penguin Guano Classification AI4Earth API To run: export FLASK_APP=frontend-server.py python -m flask run --host=0.0.0.0 To access the website, enter your IP address:5000 into a browser. e.g., http://127.0.0.1:5000/ ''' from flask import Flask, send_from_directory, request import requests pri...
1,736
627
# -*- coding: utf-8 -*- # Generated by Django 1.11.20 on 2019-06-29 13:56 from __future__ import unicode_literals import django.contrib.postgres.fields.jsonb import django.db.models.deletion from django.db import migrations, models import brouwers.shop.models.utils class Migration(migrations.Migration): depend...
2,947
704
# # # Copyright (C) 2015, 2016 Google Inc. # 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 notice, # this list of condition...
12,330
4,402
# Donk Project # Copyright (c) 2021 Warriorstar Orion <orion@snowfrost.garden> # SPDX-License-Identifier: MIT import pathlib from typing import Dict from iconparse.reader import DmiData, Reader from iconparse.extractor import Extractor class ImageStore: def __init__(self, root: pathlib.Path): self.root: ...
918
313
from .gan import SNPatchGAN
28
11
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2013 MATOBA Akihiro <matobaa+trac-hacks@gmail.com> # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. from trac.core import * from trac.config imp...
10,601
4,246
#Author: Matthew Wicker # Impliments the BayesByBackprop optimizer for BayesKeras import os import math import logging import numpy as np import tensorflow as tf import tensorflow_probability as tfp from tensorflow.keras.models import * from tensorflow.keras.layers import * from tqdm import tqdm from tqdm import tran...
6,767
2,261
#!/usr/bin/env python """Create a .cxx file that performs explicit instantiation over float/double and dimensions 1, 2, and 3. Writes the file to the current directory.""" usage = "ExplicitInstantiation.py <class_name>" import sys if len(sys.argv) < 2 or sys.argv[1] == '-h' or sys.argv[1] == '--help': print(us...
1,435
505
from concurrent.futures import ThreadPoolExecutor from functools import partial from time import time try: from gpsoauth import perform_master_login, perform_oauth except ImportError: def perform_master_login(*args, **kwargs): raise ImportError('Must install gpsoauth to use Google accounts') perfor...
3,231
971
def test25(a, b): (a) + (b.x) (None) + (a[1]) def test0(): return 1, 2, 3
86
49
def evenly_parallelize(input_list): '''return evenly partitioned spark resilient distributed dataset (RDD)''' import numpy as np from pyspark.sql.session import SparkSession spark = SparkSession.builder.getOrCreate() sc = spark.sparkContext n_input = len(input_list) n_parts = sc.paralleliz...
518
163
"""Model helper module. """ from __future__ import annotations from typing import Union import numpy as np import torch class Scaler: """ Standardize features by removing the mean and scaling to unit variance. Accepts both torch.Tensor and numpy.ndarray. """ def __init__(self, astype="float32"): ...
3,153
1,047
# 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 'license' file acc...
1,491
507
#!/usr/bin/python2.5 # Copyright (C) 2019 KUWAYAMA, Masayuki # # 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 applic...
2,584
778
# Generated by Django 2.2.5 on 2020-09-30 09:47 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('questions', '0002_create_questions'), ] operations = [ migrations.RemoveField( model_name='question', name='type', ...
651
209
# Exercício Python 076: Crie um programa que tenha uma tupla única com nomes de produtos e seus respectivos preços, na sequência. # No final, mostre uma listagem de preços, organizando os dados em forma tabular. produtos = ('LÁPIS', 1.75, 'BORRACHA', 2, 'CADERNO', 20, 'CANETAS', 7, ...
565
243
import unittest from unittest.mock import patch from libsimba.simba import Simba class TestSimba(unittest.TestCase): def setUp(self): self.simba = Simba() patcher_send = patch("libsimba.simba_request.SimbaRequest.send") patcher_init = patch("libsimba.simba_request.SimbaRequest.__init__") ...
8,558
2,757
from golem import actions description = 'Verify wait_for_element_enabled action' def test(data): actions.navigate(data.env.url+'dynamic-elements/?delay=3') actions.wait_for_element_enabled('#button-three', 10) actions.verify_element_enabled('#button-three') actions.navigate(data.env.url + 'dynamic-el...
521
163
#!/usr/bin/env python # -*- 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...
4,263
1,665
from rest_framework.routers import SimpleRouter from transactions.api.views import TransactionsViewSet router_v1 = SimpleRouter(trailing_slash=False) router_v1.register(r'transactions', TransactionsViewSet, base_name='transactions')
236
68
#!/usr/bin/python # 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 # di...
8,480
2,395
import collections from cluster import Cluster import logging logging.basicConfig(format='%(asctime)s - %(levelname)s: %(message)s', datefmt='%H:%M:%S', level=logging.INFO) VoteResult = collections.namedtuple('VoteResult', ['term', 'vote_granted', 'id']) class NodeState: def __init__(self, node=None): ...
2,104
629
#!/usr/bin/env python # encoding: utf-8 import _load_lib import sys import logging import os from unicorn.language.app\ import main as languae_main if __name__ == '__main__': try: languae_main() except Exception as ex: logging.exception("main except") os._exit(1)
303
101
import incremental_evaluation.utils as IE import incremental_evaluation.scenario_sets as SS import incremental_evaluation.visualisation_helper as VH import models.basic_predictor_interfaces import models.ensgendel_interface import incremental_evaluation.data_file_helper as DFH import os import argparse SS_MNIST012 = "...
10,303
3,125
import os import re from bs4 import BeautifulSoup from django.core.exceptions import ObjectDoesNotExist from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator from django.db import models from django.db.models import Case, Count, Q, Value, When from django.utils.encoding import python_2_unicode_compa...
15,792
4,825
class Solution: def validSquare(self, p1: List[int], p2: List[int], p3: List[int], p4: List[int]) -> bool: """Math. Running time: O(1) """ v = [p1, p2, p3, p4] e = [] for i, p in enumerate(v): for j, q in enumerate(v[i+1:]): e.append(((p[0...
542
240
#!/usr/bin/python from calvin.utilities import certificate import os print "Trying to create a new domain configuration." testconfig = certificate.Config(domain="test") # testconfig2 = certificate.Config(domain="evil") print "Reading configuration successfull." print "Creating new domain." certificate.new_domain(test...
868
275
# -*- coding: utf-8 -*- # Generated by Django 1.11.3 on 2017-10-23 05:30 from __future__ import unicode_literals import django.core.validators from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('hostel', ...
2,526
744
# _*_ coding:utf-8 _*_ #按相反的顺序输出列表的值。 arr=["aaa",True,100,"ccc"] print arr print arr[::-1]
93
59
''' EASY 441. Arranging Coins You have a total of n coins that you want to form in a staircase shape, where every k-th row must have exactly k coins. ''' class Solution: def arrangeCoins(self, n: int) -> int: rows = [0] count = 1 def recur(n, count): if n - count >= 0: ...
475
156
# Written by Minh Nguyen and CBIG under MIT license: # https://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md import unittest import torch import cbig.Nguyen2020.rnn as rnn class RnnCellTest(unittest.TestCase): """ Unit tests for recurrent cells """ def setUp(self): torch.manual_seed(0) ...
1,167
450
from django import forms from django.forms import ModelForm from django.contrib.auth.forms import UserCreationForm from django.contrib.auth.models import User from django.core.validators import EmailValidator from . import models from .models import ProfileModel from io import BytesIO from PIL import Image, ExifTags ...
4,816
1,656
from up.utils.general.registry_factory import MODULE_ZOO_REGISTRY from up.tasks.cls.models.heads import BaseClsHead, ConvNeXtHead __all__ = ['SparseBaseClsHead', 'SparseConvNeXtHead'] @MODULE_ZOO_REGISTRY.register('sparse_base_cls_head') class SparseBaseClsHead(BaseClsHead): def __init__(self, num_classes, in_pl...
1,442
507
# Copyright (c) 2019. Partners HealthCare and other members of # Forome Association # # Developed by Sergey Trifonov based on contributions by Joel Krier, # Michael Bouzinier, Shamil Sunyaev and other members of Division of # Genetics, Brigham and Women's Hospital # # Licensed under the Apache License, Version 2....
4,753
1,346
import pyttsx3 import speech_recognition as sr import os import subprocess #from requests import request , session #from pprint import pprint as pp import json import requests import datetime from datetime import date import time import calendar import warnings import random import wikipedia import web...
23,209
7,034
import random # najprej konstante STEVILO_DOVOLJENIH_NAPAK = 10 PRAVILNA_CRKA = "+" PONOVLJENA_CRKA = "o" NAPACNA_CRKA = "-" ZMAGA = "W" PORAZ = "X" class Igra: def __init__(self, geslo, crke): self.geslo = geslo.upper() # pravilno geslo self.crke = crke.upper() # do sedaj ugibane črke ...
1,748
673
import numpy as np import tensorflow as tf from tensorflow.keras.callbacks import EarlyStopping from tensorflow.keras.layers import Dropout, Input from tensorflow.keras.models import Model from tensorflow.keras.regularizers import l2 from tensorflow.random import set_seed from spektral.transforms.layer_preprocess impor...
2,443
827
from numpy import arcsin, exp from ....Classes.Segment import Segment from ....Classes.Arc1 import Arc1 from ....Classes.SurfLine import SurfLine def get_surface_active(self, alpha=0, delta=0): """Return the full winding surface Parameters ---------- self : SlotUD2 A SlotUD2 object alpha...
792
246
# from https://gogul09.github.io/software/texture-recognition import cv2 import numpy as np import os import glob import mahotas as mt from sklearn.svm import LinearSVC from typing import List import matplotlib.pyplot as plt import pickle # load the training dataset train_path = "../inputs/for_texture_model/train" tra...
3,402
946
def inception_module(x,filters_1x1,filters_3x3_reduce,filters_3x3,filters_5x5_reduce,filters_5x5,filters_pool_proj,trainable=True): conv_1x1 = Conv3D(filters_1x1, (1,1,1), padding='same', activation='relu',kernel_initializer=kernel_init, bias_initializer=bias_init,trainable=trainable)(x) conv_3x3 = Conv3D(filte...
6,645
2,666
# Copyright (C) 2019-2020, TomTom (http://tomtom.com). # # 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 o...
4,441
1,448
import pyexlatex as pl import pyexlatex.table as lt import pyexlatex.presentation as lp import pyexlatex.graphics as lg import pyexlatex.layouts as ll def get_model_structure_graphic() -> lg.TikZPicture: inputs_block_options = [ 'fill=orange!30' ] model_block_options = [ 'fill=blue!50' ...
2,511
835
# Hello python a = "Hello I m Robot Jai" print(a)
51
23
from alfabeto import * from main import nameSur # Listas letras = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U...
1,748
683
""" Device Base Package """ from __future__ import absolute_import, division, print_function import struct from binascii import hexlify from collections import deque, namedtuple import enum import socket from ...aid.sixing import * from ...aid.odicting import odict from ...aid.byting import bytify, unbytify, packify...
10,174
2,650