text
string
size
int64
token_count
int64
import sys import subprocess import time import json import krpc import math import scipy.integrate import numpy as np from PrePlanningChecklist import PrePlanningChecklist from PlannerUiPanel import PlannerUiPanel from MainUiPanel import MainUiPanel from ConfigUiPanel import ConfigUiPanel from AutopilotUiPanel import ...
1,166
393
import os from discord import Webhook, RequestsWebhookAdapter, Colour, Embed def send_alert(item): hook = os.environ.get("WEB_HOOK") webhook = Webhook.from_url(hook, adapter=RequestsWebhookAdapter()) embedVar = Embed(title="Stock Hunter") if item.in_stock: embedVar.description = "{} **IN STOC...
617
212
#%% #https://github.com/timesler/facenet-pytorch from facenet_pytorch import MTCNN, extract_face import torch import numpy as np import mmcv, cv2 import os import matplotlib.pyplot as plt from PIL import Image # %% #%% device = torch.device('cuda:0' if torch.cuda.is_available() else 'cpu') print('Running on...
4,593
1,910
"""Launch Gazebo server and client with command line arguments.""" from launch import LaunchDescription from launch.substitutions import LaunchConfiguration from launch.actions import DeclareLaunchArgument from launch.actions import IncludeLaunchDescription from launch.actions import ExecuteProcess from launch.conditi...
1,441
341
from contextlib import contextmanager import torch.nn as nn @contextmanager def evaluate(module: nn.Module): """ A context manager for evaluating the module. Args: module: The module to switch to evaluating in the context. Returns: A generator for the context of the module. """ ...
957
249
import unittest from calculator import tokens, evaluator from calculator.parser import tokenize, infix_to_postfix class MyTestPostfixCase(unittest.TestCase): def test_simple_operator(self): expression = "2 + 1" computed_token_list = tokenize(expression) postfix_token_list = infix_to_postf...
3,180
967
from flask import Flask, render_template, request import requests import json import os app = Flask(__name__) picfolder = os.path.join('static','pics') app.config['UPLOAD_FOLDER'] = picfolder @app.route('/temperature', methods=['POST']) def temperature(): pic1 = os.path.join(app.config['UPLO...
1,124
431
from django.conf.urls import url from core.views import me from core.rest import CardViewSet, UserViewSet, NfcCardViewSet, GroupViewSet from core.utils import SharedAPIRootRouter # SharedAPIRootRouter is automatically imported in global urls config router = SharedAPIRootRouter() router.register(r"core/users", UserVie...
561
177
from flora_tools.experiment import * class MeasureTimeIRQProcess(Experiment): def __init__(self): description = "Measures the time needed for an IRQ to be processed." Experiment.__init__(self, description) def run(self, bench, iterations=10000): self.iterations = iterations ...
2,931
916
from rest_framework import serializers from main.models import Suco class SucoSerializer(serializers.ModelSerializer): class Meta: model = Suco fields = ('nome', 'litros', 'link', 'qtd_disp')
213
62
from .matern_kernel import MaternKernel from .rbf_kernel import RBFKernel from .spectralgp_kernel import SpectralGPKernel __all__ = ["MaternKernel", "RBFKernel", "SpectralGPKernel"]
183
66
# Generated by Django 2.2.10 on 2020-03-24 16:30 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ("recruitment", "0017_merge_20200318_1104"), ("recruitment", "0013_image_block"), ] operations = []
271
115
import requests import os from datetime import datetime import pandas as pd def ensure_folder_exists(foldername): try: # Create tmp folder os.mkdir(foldername) print("Directory created: " + foldername) except FileExistsError: pass def download_and_save(url, filename): pri...
1,901
655
import os import yoloCarAccident as yc # yc.find('test.txt') f1 = open('result2.txt','r') i = 0 s = "" for lines in f1: if(i<80000): s += lines i+=1 else: f2 = open('test.txt','w') f2.write(s) f2.close() try: yc.find('test.txt') except ValueError: pass s = "" i = 0 # break # f2 = open('t...
382
204
import socketserver import socket class TextStreamRequestHandler(socketserver.BaseRequestHandler): """Define textual self.rfile and self.wfile for stream sockets.""" # Default buffer sizes for rfile, wfile. # We default rfile to buffered because otherwise it could be # really slow for large data (a g...
1,853
536
#!/usr/bin/env python3 import os, sys sys.path.append(os.path.abspath(__file__ + "/../../")) # just so we can use 'libs' import torch.utils.data import torch.optim as optim from torch import nn import numpy as np import torch from libs.Loader import Dataset from libs.shufflenetv2 import ShuffleNetV2AutoEncoder BA...
4,560
1,507
from .progress_bar import ProgressBar from .read_config import read_config
75
20
#%% # PAGE EXAMPLE # {'title': 'Zuppa_di_pesce_(film)', # 'chains': [{'revisions': ['95861493', '95861612', '95973728'], # 'users': {'93.44.99.33': '', 'Kirk39': '63558', 'AttoBot': '482488'}, # 'len': 3, # 'start': '2018-04-01 04:54:40.0', # 'end': '2018-04-05 07:36:26.0'}], # 'n_chains': 1, # 'n_rever...
2,871
1,101
from django.contrib.auth.forms import AuthenticationForm from django.core.urlresolvers import reverse from django.views.generic.base import View from django.views.generic.detail import SingleObjectMixin,DetailView from django.shortcuts import render,get_object_or_404,redirect from django.http import HttpResponseRedirec...
5,105
1,414
#!/usr/bin/python ''' Created on May 23, 2012 @author: Charlie ''' import unittest from mock import patch import xml.etree.ElementTree as ET from TestCgiMainBase import TestCgiMainBase @patch('cgi.FieldStorage') class TestCgiMainXml(TestCgiMainBase): def tearDown(self): pass def testName(self, MockC...
721
240
from enum import Enum import random import collections import numpy as np # ####################################################################### # Data Types ####################################################################### # class DivideRatio(Enum): DR_8 = ('0', 8.0, '8') DR_643 = ('1', 64.0/3, '64/...
38,783
13,657
''' Given an n x n matrix where each of the rows and columns are sorted in ascending order, return the kth smallest element in the matrix. Note that it is the kth smallest element in the sorted order, not the kth distinct element. Input: matrix = [[1,5,9],[10,11,13],[12,13,15]], k = 8 Output: 13 Explanation: The elem...
1,500
595
from unittest import TestCase from unittest.mock import Mock import numpy as np from pathfinding.domain.angle import Angle from pathfinding.domain.coord import Coord from vision.domain.image import Image from vision.domain.rectangle import Rectangle from vision.infrastructure.cvVisionException import CameraDoesNotExi...
5,088
1,589
from .feature_maps import * import torch.nn as nn class LayerGradientComputation: """ Abstract base class that can be used as a second base class for layers that support the computation of gradient features """ def __init__(self): super().__init__() # in case this is used with multiple i...
8,753
2,388
from configparser import ConfigParser from configparser import DuplicateSectionError from PyQt5 import QtCore, QtGui, QtWidgets from pinsey import Constants from pinsey.Utils import clickable, center, picture_grid, horizontal_line, resolve_message_sender, name_set, windows from pinsey.gui.MessageWindow import MessageW...
35,389
10,355
from os import system as c i = "ipconfig" input(c(i)) # import win32clipboard # from time import sleep as wait # set clipboard data # while True: # win32clipboard.OpenClipboard() # win32clipboard.EmptyClipboard() # win32clipboard.SetClipboardText('Clipboard Blocked!') # win32clipboard.CloseClipboard() ...
336
123
# -*- encoding: utf-8 -*- """ @File : emails.py @Contact : 1053522308@qq.com @License : (C)Copyright 2017-2018, Liugroup-NLPR-CASIA @Modify Time @Author @Version @Desciption ------------ ------- -------- ----------- 2020/9/27 10:22 下午 wuxiaoqiang 1.0 None """ import as...
1,506
657
import time import copy import random import logging from functools import partial import numpy as np import torch from torch.utils.data import DataLoader from transformers import DistilBertModel, DistilBertForSequenceClassification, DistilBertTokenizer, AlbertModel, AlbertForSequenceClassification, DistilBertTokenize...
13,487
4,368
#!/usr/bin/env python ############################################################################### # # scomdominfo.py - Report information folds and classes of a list of SCOP sids # # File: scomdominfo.py # Author: Alex Stivala # Created: November 2008 # # $Id: scopdominfo.py 3009 2009-12-08 03:01:48Z alexs $ # ...
4,542
1,549
# Copyright (C) 2020 Intel Corporation # # SPDX-License-Identifier: MIT from tools.test import * import os class ModelHandler: def __init__(self): # Setup device self.device = torch.device('cuda' if torch.cuda.is_available() else 'cpu') torch.backends.cudnn.benchmark = True base_d...
1,334
440
import torch import torch.nn as nn from torch.nn import (TransformerEncoder, TransformerDecoder, TransformerEncoderLayer, TransformerDecoderLayer) from torch import Tensor from typing import Iterable, List import math import os import numpy as np try: from janome.tokenizer import Tokenizer ex...
10,842
4,067
# Copyright 2010-2012 Opera Software ASA # # 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 ...
9,185
3,975
def for_E(): for row in range(7): for col in range(5): if (col==0 ) or (row==0 or row==3 or row==6): print("*",end=" ") else: print(end=" ") print() def while_E(): i=0 while i<7: j=0 while j<5: ...
498
179
from flask import Flask from loguru import logger from flasgger import Swagger from patron.api import api_bp logger.add("api.log", format="{time:YYYY-MM-DD at HH:mm:ss} | {level} | {message}", rotation="500 MB") template = { "swagger": "2.0", "info": { "title": "PATRON", "description": "", ...
574
209
import numpy as np import matplotlib.pylab as plt def step_function(x): y = x > 0 return y.astype(np.int) def sigmoid(x): return 1 / (1 + np.exp(-x)) def relu(x): return np.maximum(0, x) def AND(x1, x2): x = np.array([x1, x2]) w = np.array([0.5, 0.5]) b = -0.7 tmp = np.sum(w * x) + b...
735
347
# with tidy long table fig, ax = plt.subplots() sns.violinplot(x='station', y='no2', data=data_tidy[data_tidy['datetime'].dt.year == 2011], palette="GnBu_d", ax=ax) ax.set_ylabel("NO$_2$ concentration (µg/m³)")
210
91
""" Project: dncnn Author: khalil MEFTAH Date: 2021-11-26 DnCNN: Deep Neural Convolutional Network for Image Denoising model implementation """ import torch from torch import nn import torch.nn.functional as F # helper functions def eval_decorator(fn): def inner(model, *args, **kwargs): was_training = m...
1,729
598
#!/usr/bin/python from __future__ import print_function import logging from fabric.api import task,run,local,put,get,execute,settings from fabric.decorators import * from fabric.context_managers import shell_env,quiet from fabric.exceptions import * from fabric.utils import puts,fastprint from time import sleep from c...
41,886
13,466
from django import forms from mezzanine.blog.forms import BlogPostForm from .models import BlogPost # These fields need to be in the form, hidden, with default values, # since it posts to the blog post admin, which includes these fields # and will use empty values instead of the model defaults, without # these spe...
651
181
# -*- coding: utf-8 -*- # Generated by Django 1.11.6 on 2019-03-02 15:56 from __future__ import unicode_literals import ckeditor.fields from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('reviews', '0021_auto_20190302_1514')...
14,533
6,189
import platform from setuptools import setup if platform.system() == "Windows": setup( name="intermezzo", version="0.1.0", description="A library for creating cross-platform text-based interfaces using termbox-go.", long_description="", url="https://github.com/imdaveho/inter...
1,414
456
from django.urls import path from . import views urlpatterns = [ path('', views.index, name='index'), path('<str:nome>', views.cumprimentar, name='cumprimentar'), ]
173
60
import numpy as np import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec import cv2, os, sys, glob import scipy import sklearn import imageio import matplotlib.cm as cm import matplotlib import time from sklearn import decomposition, metrics, manifold, svm from tsne import bh_sne from matplotlib.path ...
70,016
25,346
import pygame from game.game_data.cells.Cell import Cell from game.pygame_ import PICS_pygame, CELL_SIZE from game.pygame_.Object import Object class PyGCell(Object, Cell): # TODO не передавать лишнее def __init__(self, id__, cell: Cell, x_: int, y_: int): Object.__init__(self, id__, *self.create_coo...
619
224
import json import os import torch import math def adjust_learning_rate(optimizer, scale): """ Scale learning rate by a specified factor. :param optimizer: optimizer whose learning rate must be shrunk. :param scale: factor to multiply learning rate with. """ for param_group in optimizer.param...
2,690
846
from enum import Enum class FeedType(str, Enum): OSM = 'osm' OVERPASS = 'overpass'
93
39
#!/bin/python3 """This is the top-level program to operate the Raspberry Pi based lego sorter.""" # Things I can set myself: AWB, Brightness, crop, exposure_mode, # exposure_speed,iso (sensitivity), overlays, preview_alpha, # preview_window, saturation, shutter_speed, # Thought for future enhancement: at start...
8,774
2,968
# -*- coding: utf-8 -*- from yaml import load, dump try: from yaml import CSafeLoader as SafeLoader print "Using CSafeLoader" except ImportError: from yaml import SafeLoader print "Using Python SafeLoader" import os import sys reload(sys) sys.setdefaultencoding("utf-8") from sqlalchemy import Table def importyaml...
6,061
1,634
from django.shortcuts import render from core.models import Projects,InfoNotifications,WarningNotifications from django.http import HttpResponse from .tasks import sleepy def index(reuqest): sleepy(10) return HttpResponse('Done!')
242
69
import tensorflow as tf import numpy as np EPS = 1e-5 def KL_monte_carlo(z, mean, sigma=None, log_sigma=None): """Computes the KL divergence at a point, given by z. Implemented based on https://www.tensorflow.org/tutorials/generative/cvae This is the part "log(p(z)) - log(q(z|x)) where z is sampled from...
5,017
1,877
from tkinter import * import os, xmltodict, requests def knop1(): 'Open GUI huidig station' global root root.destroy() os.system('Huidig_Station.py') def knop2(): 'Open GUI ander station' global root root.destroy() os.system('Ander_Station.py') def nl_to_eng(): 'Wanneer er op d...
4,288
1,349
from .py2ifttt import IFTTT
27
12
import socket import tokens import connection import io import os from PIL import Image from message.literalMessage import LiteralMessage from baseApplication import BaseApplication class ClientApplication(BaseApplication): def __init__(self, host, port): super().__init__(host, port, token...
3,806
1,195
import sys import socket ETH_P_ALL=3 # not defined in socket module, sadly... s=socket.socket(socket.AF_PACKET, socket.SOCK_RAW, socket.htons(ETH_P_ALL)) s.bind((sys.argv[1], 0)) r=s.recv(2000) sys.stdout.write("<%s>\n"%repr(r))
230
107
#!/usr/bin/env python3 from json import loads from urllib.request import urlopen, Request SITE = input('Site: ') COOKIE = 'pj=' + input('pj=') examList = loads(urlopen(Request(f'{SITE}/data/module/homework/all.asp?sAct=GetHomeworkListByStudent&iIsExam=1&iPageCount=' + loads(urlopen(Request(f'{SITE}/data/module/home...
1,110
374
import sys import os import tkinter.filedialog as fd from time import sleep import datetime import tkinter import tkinter as tk from tkinter import ttk from tkinter import scrolledtext import threading # New File & Duplicate File Save def saveasFilePath( filetype=[ ("",".txt"), ("CSV",".csv") ] ): return fd.asksa...
3,803
1,257
#!/usr/bin/python # # Copyright 2018-2021 Polyaxon, 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 ...
6,005
1,758
# -*- coding: utf-8 -*- # AUTHOR: Zeray Rice <fanzeyi1994@gmail.com> # FILE: judge/base/__init__.py # CREATED: 01:49:33 08/03/2012 # MODIFIED: 15:42:49 19/04/2012 # DESCRIPTION: Base handler import re import time import urllib import hashlib import httplib import datetime import functools import traceback import simp...
8,810
2,623
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import markdownx.models import myblog.filename from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ...
1,839
532
test = {'name': 'q6', 'points': 10, 'suites': [{'cases': [{'code': '>>> increment = lambda x: x + 1\n' '\n' '>>> square = lambda x: x * x\n' '\n' '>>> do_nothing = make_zipper(increment, ' ...
1,545
401
""" This problem was asked by Google. Suppose we represent our file system by a string in the following manner: The string "dir\n\tsubdir1\n\tsubdir2\n\t\tfile.ext" represents: dir subdir1 subdir2 file.ext The directory dir contains an empty sub-directory subdir1 and a sub-directory subdir2 containin...
3,566
1,109
from os.path import expanduser, exists from os import makedirs TURBOT_PATH = expanduser('~/.turbot') UPVOTE_LOGS = expanduser("%s/upvote_logs" % TURBOT_PATH) CHECKPOINT = expanduser("%s/checkpoint" % TURBOT_PATH) REFUND_LOG = expanduser("%s/refunds" % TURBOT_PATH) def load_checkpoint(fallback_block_num=None): tr...
1,315
510
from output.models.ms_data.additional.member_type021_xsd.member_type021 import Root __all__ = [ "Root", ]
111
45
def estimator(data): return data def __init__(self,reportedCases,name,days,totalHospitalbeds,avgDailyIncomeInUsd,avgDailyIncomePopulation): self.reportedCases=reportedCases self.name=name self.days=days self.totalHospitalbeds=totalHospitalbeds self.avgDailyIncomeInUsd=avg...
4,361
1,444
#!/usr/bin/env python3 # Original Author @elitest # This script uses boto3 to perform client side decryption # of data encryption keys and associated files # and encryption in ways compatible with the AWS SDKs # This support is not available in boto3 at this time # Wishlist: # Currently only tested with KMS managed s...
3,752
1,163
from IPython.display import HTML #TO DO - the nested table does not display? #Also, the nested execution seems to take a long time to run? #Profile it to see where I'm going wrong! def obj_display(v, nest=False, style=True): def nested(v): if nest: return obj_display(v, style=False) re...
1,777
646
from turtle import width import streamlit as st import numpy as np import pandas as pd from dis import dis import streamlit as st from data.get_saved_library import get_saved_library, display_user_name, display_user_pic from data.get_recently_played import get_recently_played from data.get_top_artists import get_top_ar...
984
312
# Author: allannozomu # Runtime: 56 ms # Memory: 13 MB class Solution: def longestCommonPrefix(self, strs: List[str]) -> str: res = "" max_length = -1 for s in strs: if max_length < 0: max_length = len(s) else: max_length = min(len(s),...
595
177
import pytest from models.contact_number import ContactNumberModel @pytest.fixture def contact_number_attributes(faker): def _contact_number_attributes(): return { "number": faker.phone_number(), "numtype": faker.random_element(("home", "work", "mobile")), "extension": ...
884
250
import unittest import numpy as np from sciquence.sequences import * class TestSequences(unittest.TestCase): def test_seq_equals(self): x = [np.array([1, 2, 3]), np.array([4, 5, 6])] y = [np.array([1, 2, 7]), np.array([4, 5, 9])] assert lseq_equal(x, x) assert not lseq_equal(x, y)...
835
431
# -*- coding: utf-8 -*- """ Simple example using BarGraphItem """ # import initExample ## Add path to library (just for examples; you do not need this) import numpy as np import pickle as p import pandas as pd from analysis_guis.dialogs.rotation_filter import RotationFilter from analysis_guis.dialogs impor...
8,191
3,496
""" downloads gmail atts """ import base64, os from auth.auth import get_service from msg.label import agencies, get_atts from report.response import get_threads, get_status from att.drive import get_or_create_atts_folder,\ check_if_drive, make_drive_folder, upload_to_drive ### START CONFIG ### buffer_path = ...
2,852
844
# Copyright 2022 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import absolute_import from pex.pip.log_analyzer import LogAnalyzer from pex.typing import TYPE_CHECKING, Generic if TYPE_CHECKING: from typing import Iterable, Mappi...
1,147
392
from typing import Any from typing import Callable from typing import Iterable def _create_getter_and_setter(name: str): def getter(self): return getattr(self.func, name) getter.__name__ = name prop = property(getter) def setter(self, value): setattr(self.func, name, value) setter...
3,424
1,025
from pbpstats.resources.enhanced_pbp import StartOfPeriod class NbaPossessionLoader(object): """ Class for shared methods between :obj:`~pbpstats.data_loader.data_nba.possessions_loader.DataNbaPossessionLoader` and :obj:`~pbpstats.data_loader.stats_nba.possessions_loader.StatsNbaPossessionLoader` Bot...
2,096
570
# Copyright 2015 OpenStack Foundation # 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 requ...
7,033
2,120
#!/usr/bin/env python # coding: utf-8 # In[2]: from collections import defaultdict import csv import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt # ## read data to numpy(not in use) # In[385]: # def readCsvToNumpy(file_name, feat_num): # util_mat = [] # with open...
3,650
1,334
# -*- coding: utf-8 -*- from __future__ import absolute_import import keras.backend as K from time import sleep def switch(condition, t, e): if K.backend() == 'tensorflow': import tensorflow as tf return tf.where(condition, t, e) elif K.backend() == 'theano': import theano.tensor as tt ...
1,492
598
import asyncio cond = None p_list = [] # 生产者 async def producer(n): for i in range(5): async with cond: p_list.append(f"{n}-{i}") print(f"[生产者{n}]生产商品{n}-{i}") # 通知任意一个消费者 cond.notify() # 通知全部消费者:cond.notify_all() # 摸拟一个耗时操作 await asyncio.s...
1,050
466
from collections import Counter class Solution: def isNStraightHand(self, hand: List[int], W: int) -> bool: n = len(hand) groups = 0 if n == 0 or n % W != 0: return False groups_num = n // W c = Counter(hand) keys = list(c.keys()) keys.sort() ...
930
263
"""Mini-functions that do not belong elsewhere.""" from datetime import datetime def current_time(template="%Y%m%d %H:%M:%S"): return datetime.now().strftime(template)
174
56
import flask_admin as admin # from flask_admin.contrib.sqla import ModelView from app import app # from app import db from models import * # Admin admin = admin.Admin(app) # Add Admin Views
193
59
# Generated by Django 3.0.6 on 2020-05-21 20:38 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('courses', '0005_auto_20200521_2038'), ] operations = [ migrations.AlterField( model_name='module', name='segments', ...
467
159
import os def import_module(name): module = __import__(name) components = name.split('.') for components in components[1:]: module = getattr(module, components) return module # We should try to import any custom settings. SETTINGS_MODULE_NAME = os.getenv("MYPI_SETTINGS_MODULE") if SETTINGS_M...
776
299
#!/usr/bin/env python # -*- coding: utf-8 -*- import simplejson as json from alipay.aop.api.constant.ParamConstants import * class KbAdvertPreserveCommissionClause(object): def __init__(self): self._claimer_id_type = None self._claimers = None @property def claimer_id_type(self): ...
1,866
617
from __future__ import division # Use floating point for math calculations from flask import Blueprint from CTFd.models import ( ChallengeFiles, Challenges, Fails, Flags, Hints, Solves, Tags, db, ) from CTFd.plugins import register_plugin_assets_directory from CTFd.plugins.challenges...
4,495
1,343
shopping_list = { 'Tomatoes': 6, 'Bananas': 5, 'Crackers': 2, 'Sugar': 1, 'Icecream': 1, 'Bread': 3, 'Chocolate': 2 } # Just the keys print(shopping_list.keys()) # Just the values # print(shopping_list.values()) # Both keys and values # print(shopping_list.items())
295
132
from .surface import * from .modifiers import * from .evaluator import Evaluator from .lowlevel import display_results
119
33
import math from math import* def isPrime(num): if num%2==0 or num%3==0: return False for n in range(5, int(num**(1/2))): if num%n==0: return False return True print('enter a positive integer') FacMe=int(input()) primefacts=[1] if not isPrime(FacMe): if FacMe...
588
236
# encoding: utf-8 """ binary butterfly validator Copyright (c) 2021, binary butterfly GmbH Use of this source code is governed by an MIT-style license that can be found in the LICENSE.txt. """ import re from typing import Any, Optional from ..abstract_input import AbstractInput from ..fields import Field from ..vali...
1,130
349
from runner.run_descriptions.run_description import RunDescription, Experiment, ParamGrid _params = ParamGrid([ ('prediction_bonus_coeff', [0.00, 0.05]), ]) _experiments = [ Experiment( 'doom_maze_very_sparse', 'python -m algorithms.curious_a2c.train_curious_a2c --env=doom_maze_very_sparse --g...
1,270
520
import os from xappt_qt.__version__ import __version__, __build__ from xappt_qt.plugins.interfaces.qt import QtInterface # suppress "qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow)" os.environ['QT_LOGGING_RULES'] = '*.debug=false;qt.qpa.*=false' version = tuple(map(int, __version__.split('.'))) + (__build__, )...
383
146
#!/usr/bin/python3 import sys import sqlite3; import re; import os; import random import qualification from cttable import CandidateTable, TableVotingGroup, PhantomTableVotingGroup import cttable SW_VERSION_SPLIT = (1, 1, 4) SW_VERSION = ".".join([str(x) for x in SW_VERSION_SPLIT]) EARLIEST_COMPATIBLE_DB_VERSION = (...
145,150
45,472
# Copyright (c) Jeremías Casteglione <jrmsdev@gmail.com> # See LICENSE file. from glob import glob from os import path, makedirs def test_deploy_testing(testing_plugin): makedirs(path.join('tdata', 'deploy', 'plugin'), exist_ok = True) p = testing_plugin('testing', ns = '_sadmtest', deploy = True) print('-- deploy...
995
384
""" ############## # jsonReader # ############## """ # Import import json from platform import system from enum import Enum from datetime import timedelta # %% ____________________________________________________________________________________________________ # ____________________________________________________...
4,189
1,303
import re test = input("請輸入字串 : ") test.encode('unicode-escape').decode().replace('\\\\', '\\') print("輸入為 : "+test) if re.match(test, "a"): print(test + " Match 1") if re.match(test, "aa"): print(test + " Match 2") if re.match(test, "aaaa"): print(test + " Match 3")
286
129
#初始化 t=0 #运算 for x in range(1,9): for y in range(1,11): for z in range(1,13): if 6*x+5*y+4*z==50: print("计算出x值为 ",x," y值为 ",y," z值为 ",z," 。") t=t+1 print("计算出一共有 {} 个结果。".format(t)) #by xiaozhiyuqwq #https://www.rainyat.work #2021-12-23
306
170
# from job_scrapper_gui import naukri_gui from tkinter import * from PIL import ImageTk import PIL.Image import naukri_scrapper import linkedin_scrapper import indeed import simply_hired_scrapper from selenium import webdriver root = Tk() root.title("Compare Jobs") root.geometry("1000x670") root.configure(background=...
15,088
5,463
""" multispectrum Zhiang Chen, Feb, 2020 """ import gdal import cv2 import numpy as np import math import os class MultDim(object): def __init__(self): pass def readTiff(self, tif_file, channel=3): self.ds = gdal.Open(tif_file) B = self.ds.GetRasterBand(1).ReadAsArray() G = se...
3,648
1,411
import json from engine.serializers.template import TemplateCellSerializer def test_template_cell_to_dict(template_cell_obj): assert template_cell_obj.to_dict()["sheet_name"] == "Test Sheet 1" def test_template_cell_serializer(template_cell_obj): json_output = json.dumps(template_cell_obj, cls=TemplateCell...
399
130