text
string
size
int64
token_count
int64
""" Rackspace Cloud Backup API Test Suite """
46
18
import argparse import json import os import pathlib import numpy as np import pexpect from scipy.special import softmax base_path = str(pathlib.Path(__file__).parent.absolute()) def get_arg_parser(): p = argparse.ArgumentParser( description="This is a predictor for trained RL drafts.", formatte...
5,647
1,848
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Removing unique constraint on 'Licence', fields ['sn'] db.delete_unique('ralph_assets_licence', ['sn']) ...
57,014
18,038
#!/usr/bin/python # # This file is part of Ansible # # Ansible 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 option) any later version. # # Ansible is distribut...
3,981
1,265
import connexion import six from openapi_server import query_manager from openapi_server.utils.vars import VARIABLE_TYPE_NAME, VARIABLE_TYPE_URI from openapi_server.models.variable import Variable # noqa: E501 from openapi_server import util def variables_get(username=None, label=None, page=None, per_page=None): # ...
3,506
1,181
""" formatters to translate various parameters and options into URL parameters that can be parsed by JPL Horizons' CGI. These are mostly intended to be used by LHorizon methods and should probably not be called directly. """ from collections.abc import Mapping, Sequence from typing import Union import numpy as np imp...
3,482
1,169
#!/usr/bin/env python import sys if sys.version_info >= (3, 8): from typing import List, TypedDict else: from typing import List from typing_extensions import TypedDict class KinesisStreamKinesis(TypedDict): """ KinesisStreamKinesis Attributes: ---------- kinesisSchemaVersion: str ...
1,327
434
from bw2parameters import * def test_mangle_formula(): given = "log(foo * bar) + 7 / baz" prefix = "pre" assert mangle_formula(given, prefix, ['bar']) == '(log((pre__foo * bar)) + (7 / pre__baz))' def test_prefix_parameter_dict(): given = { 'a': {'formula': 'a + b / c', 'foo': True}, ...
1,478
583
from __future__ import absolute_import, print_function, unicode_literals class ShowHelp(Exception): pass class ClyentError(Exception): pass
150
44
def test(): assert "spacy.load" in __solution__, "Rufst du spacy.load auf?" assert nlp.meta["lang"] == "de", "Lädst du das korrekte Modell?" assert nlp.meta["name"] == "core_news_sm", "Lädst du das korrekte Modell?" assert "nlp(text)" in __solution__, "Verarbeitest du den Text korrekt?" assert "prin...
538
193
import pycxsimulator from pylab import * import copy as cp nr = 500. # carrying capacity of rabbits r_init = 100 # initial rabbit population mr = 0.03 # magnitude of movement of rabbits dr = 1.0 # death rate of rabbits when it faces foxes rr = 0.1 # reproduction rate of rabbits f_init = 30 # initial fox population ...
2,482
895
import torch import numpy as np from collections import OrderedDict from torch import optim from itertools import chain from .base import Base from torch import nn class BaseAE(Base): def __init__(self, generator, lamb=1.0, beta=1.0, recon_loss='l...
4,832
1,539
"""Universal network struture unit definition.""" import torch import math from torch import nn import torchvision from torch.utils import model_zoo from torchvision.models.resnet import BasicBlock, model_urls, Bottleneck def define_squeeze_unit(basic_channel_size): """Define a 1x1 squeeze convolution with norm an...
10,608
3,954
NFSW_Texts = [ 'سکس' ,'گایید' ,' کص' ,'جنده' ,'کیر' ,'jnde' ,'jende' ,'kos' ,'pussy' ,'kir' ,'lashi' ,'لاشی' ,'jakesh' ,'جاکش' ,'مادر خراب' ,'madar kharab' ,'mde kharab' ,'khar kose' ,'fuck' ,'bitch' ,'haroomzade' ,'حرومی' ,'حرامزاده' ,'حرومزاده' ,'جندس' ,'کصه ' ] NFSW_Names=[ 'خاله' ,'ج...
819
484
# Copyright 2021 The ML Collections 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...
14,784
5,115
import numbers import os import sys import typing import numpy as np from dataclasses import dataclass from pathlib import Path import ir import type_interface as ti import type_resolution as tr from ASTTransform import build_module_ir_and_symbols from ccodegen import codegen from canonicalize import NormalizePath...
3,829
1,116
import os import pickle import logging logger = logging.getLogger(__name__) import cv2 import numpy as np from skimage.transform import hough_circle, hough_circle_peaks import ipso_phen.ipapi.base.ip_common as ipc from ipso_phen.ipapi.base.ipt_abstract import IptBase from ipso_phen.ipapi.ipt.ipt_edge_d...
20,552
5,719
import sqlite3 from flask import current_app, g def get_db(): """ Connect to the application's configured database. The connection is unique for each request and will be reused if this is called again. """ if 'db' not in g: g.db = sqlite3.connect( '../data/cloud_db.db', ...
1,278
405
from .common import random_str from .test_catalog import wait_for_template_to_be_created import time def test_app_mysql(admin_pc, admin_mc): client = admin_pc.client name = random_str() ns = admin_pc.cluster.client.create_namespace(name=random_str(), proj...
8,467
2,621
# Copyright 2018 IBM Corp. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
1,455
466
from __future__ import print_function from awsshell.fuzzy import fuzzy_search from awsshell.substring import substring_search class AWSCLIModelCompleter(object): """Autocompletion based on the JSON models for AWS services. This class consumes indexed data based on the JSON models from AWS service (which ...
6,177
1,624
#!/usr/bin/env python # -*- coding: UTF-8 -*- ''' パッケージpyserialをインストールすること pytho2.x系で動作(python3.*系も動作検証済み) Creater:Kaname Takano ''' import serial import binascii import signal import sys import platform from serial.tools import list_ports #platformの切り替え if platform.system() == 'Windows': #windows用 ports = list_p...
3,809
1,659
from test.webdnn_test.graph_test.operators_test.util import template_test_unary_operator from webdnn.graph.operators.sigmoid import Sigmoid def template(): template_test_unary_operator(Sigmoid) def test(): template()
229
80
from hw_asr.metric.cer_metric import ArgmaxCERMetric, BeamsearchCERMetric from hw_asr.metric.wer_metric import ArgmaxWERMetric, BeamsearchWERMetric __all__ = [ "ArgmaxWERMetric", "ArgmaxCERMetric", "BeamsearchCERMetric", "BeamsearchWERMetric" ]
262
108
import wx import wx.lib.stattext as ST import board import score_board from os.path import expanduser SCORE_FILE_PATH = expanduser('~/.config/my2048/scores.conf') class My2048_wx(wx.Frame): def __init__(self, parent, id, title, size, board_object, score_board_object): super(My2048_wx, self).__init__(parent, title...
6,746
2,798
import numpy as np import unittest import discretize from SimPEG import maps, models, utils from discretize.utils import mesh_builder_xyz, refine_tree_xyz import inspect TOL = 1e-14 np.random.seed(121) REMOVED_IGNORE = [ "FullMap", "CircleMap", "Map2Dto3D", "Vertical1DMap", "ActiveCells", ] MAP...
19,153
7,532
import pybullet_data import pybullet as p import time import numpy as np from src.utils_geom import * from src.utils_depth import * from src.panda import Panda def full_jacob_pb(jac_t, jac_r): return np.vstack((jac_t[0], jac_t[1], jac_t[2], jac_r[0], jac_r[1], jac_r[2])) class pandaEnv(): def __init__(self, ...
11,569
5,334
import pygame pygame.mixer.init() pygame.init() pygame.mixer.music.load('/home/jaab/Música/bach_1.wav') pygame.mixer.music.play() input() pygame.event.wait() pygame.mixer.stop()
178
77
from .embedding import * from .sequence import * from .mlp import *
67
20
import json import os import pickle from dataclasses import dataclass, field from os.path import join from typing import Dict, Any, ClassVar @dataclass class ScoresAttributes: global_based: str sample_based: str explanations: str method_names: str data_weights: str model_weights: str model...
1,765
588
import spn #from spn.structure.leaves.mvgauss.MVG import * from spn.io.Text import * import sys from spn.structure.leaves.parametric.Parametric import * from spn.structure.leaves.parametric.MLE import * from spn.algorithms.MPE import mpe from spn.structure.prometheus.disc import * from scipy.stats import multivariate_n...
1,623
741
import datetime import decimal import enum import typing as T import uuid import graphene import graphene.types import pydantic import pytest from pydantic import BaseModel, create_model import graphene_pydantic.converters as converters from graphene_pydantic.converters import ConversionError, convert_pydantic_field ...
5,592
1,856
import numpy as np import pandas as pd from pathlib import Path import multiprocessing as mp from functools import partial from src.audio import read_as_melspectrogram from src.utils import get_params_hash from src import config NOISE_SOUNDS = [ 'Buzz', 'Car_passing_by', 'Crackle', 'Cricket', 'Hi...
3,158
1,112
""" Module containing all code related to json schema validation. """ from collections.abc import Mapping import contextlib from copy import deepcopy import io import os import typing as t import urllib.parse import urllib.request from jsonschema import Draft4Validator, RefResolver from jsonschema.exceptions import R...
5,338
1,498
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe, unittest from erpnext.accounts.doctype.fiscal_year.fiscal_year import FiscalYearIncorrectDate test_records = frappe.get_test_records('...
779
331
#!/usr/bin/env python3 if __name__ == '__main__': # Python can represent integers. Here are a couple of ways to create an integer variable. Notice the truncation, # rather than rounding, in the assignment of d. a = 5 b = int() c = int(4) d = int(3.84) print(a, b, c, d) # Integers ha...
1,008
357
#! /usr/bin/env python3 """Convert picture to asciiArt, requrie python3.6 or higher. Dependence: - fire - PIL - numpy Usage: - chmod +x asciiart.py - asciiart.py ${path_to_image} [Height] [Width] Also, you can remove the filetype ".py" and put it to $HOME/bin/ then enjoy it:) One example: *&&&&&&&&&...
1,976
644
from typing import Callable, Generator, Any from unittest import mock import pytest from screenpy import AnActor, pacing, settings from screenpy.abilities import AuthenticateWith2FA, BrowseTheWeb, MakeAPIRequests from screenpy.narration.narrator import Narrator @pytest.fixture(scope="function") def Tester() -> AnAc...
2,057
649
#!/usr/bin/env python # Copyright 2016 Google 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...
14,729
4,116
from .epub import EpubEdition from .html import HtmlEdition from .pdf import PdfEdition __all__ = ["EpubEdition", "HtmlEdition", "PdfEdition"]
144
51
# Copyright 2019 Microsoft Corporation # # 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...
5,052
1,534
import numpy as np import pandas as pd from sklearn.externals import joblib #from sklearn.ensemble import RandomForestRegressor #from sklearn.multioutput import MultiOutputRegressor #from sklearn.multioutput import MultiOutputRegressor from sklearn.model_selection import train_test_split df = pd.read_csv('https://dr...
2,662
1,165
# Python 3 import numpy as np np.seterr(divide='ignore', invalid='ignore') class Model: def __init__(self, x, y, number_of_hidden_layers=2, number_of_hidden_nodes=30, quiet=False): self.x = x self.y = y self.number_of_hidden_layers = number_of_hidden_layers self.number_of_hidden_nodes = numb...
6,806
2,447
#! /usr/bin/env python # -*- coding: utf-8 -*- import os import argparse import docx from docx.shared import Cm import pylatex from pytablewriter import MarkdownTableWriter def set_column_width(column, width): column.width = width for cell in column.cells: cell.width = width def generate_word_revisio...
5,287
1,694
import torch import numpy as np import utility from decimal import Decimal from tqdm import tqdm from option import args from torchvision import transforms from PIL import Image import matplotlib matplotlib.use('TkAgg') import matplotlib.pyplot as plt import copy class Trainer(): def __init__(self, opt, loader...
7,550
2,433
# Get the database using the method we defined in pymongo_test_insert file from pymongo_test_insert import get_database dbname = get_database() # Create a new collection collection_name = dbname["user_1_items"] item_details = collection_name.find() for item in item_details: # This will give readable output...
1,356
371
import json from django.core.serializers.json import DjangoJSONEncoder from django.http import HttpResponse from django.template import Context from django.template import RequestContext from django.template.loader import render_to_string, select_template from django.utils.encoding import force_unicode from ..compat i...
3,358
922
""" This demo will fill the screen with white, draw a black box on top and then print Hello World! in the center of the display This example is for use on (Linux) computers that are using CPython with Adafruit Blinka to support CircuitPython libraries. CircuitPython does not support PIL/pillow (python imaging library)...
1,801
649
#! /usr/bin/env python from setuptools import setup, Extension import importlib import os # copied from kymatio's setup.py: https://github.com/kymatio/kymatio/blob/master/setup.py sfm_version_spec = importlib.util.spec_from_file_location('sfm_version', 'sfm/version.py') sfm_version_module = importlib.util.module_from...
1,150
380
# from pipet.core.sql.query_interface import * from pypipet.core.operations.inventory import * import pytest from pprint import pprint _supplie_id = 1 def test_update_invs(session, obj_classes, shop_conn): invs = [ {'sku':'s22456', 'supplier_id':_supplie_id, 'qty':20}] update_inventory_bulk(obj_classes, sess...
1,490
561
# Costs # 2019 - Luque, Straub - Risk-based optimal inspection strategies for # structural systems using dynamic Bayesian networks # Table 4, case 1 import numpy as np class InspectionMaintenance: """ Inspection and Maintenance ========================== Cost calculation for inspection and main...
2,982
1,097
''' SLab Example Example_22.py Create several waveforms Connect DAC 1 to ADC 1 ''' # Locate slab in the parent folder import sys sys.path.append('..') sys.path.append('.') import slab # Set prefix to locate calibrations slab.setFilePrefix("../") # Open serial communication slab.connect() # Se...
1,515
673
from distutils.core import setup, Extension import os #os.environ['USE_CUDA'] = '1' #os.environ['USE_BLAS'] = '1' #os.environ['USE_OPENMP'] = '1' cuda_obj = [] cuda_extra = [] cuda_include = [] cuda_macro = [(None, None)] blas_obj = [] blas_extra = [] blas_include = [] blas_macro = [(None, None)] open_mp_extra = [...
1,693
791
from __future__ import absolute_import, division, print_function import json import os.path as op import six import numpy as np import scipy.signal as sig import scipy.io.wavfile as sciwav MAXINT16 = 2**15 - 1 FS = 44100 COEFF_DIR = op.join(op.dirname(op.abspath(__file__)), 'coeffs') def normalize(data, maxamp=1): ...
4,324
1,476
# Standard library import atexit import os os.environ["OMP_NUM_THREADS"] = "1" import sys import traceback # Third-party from astropy.utils import iers iers.conf.auto_download = False import astropy.table as at import numpy as np # This project from totoro.config import cache_path from totoro.data import datasets, el...
5,952
1,866
""" Problem: You are given a huge list of airline ticket prices between different cities around the world on a given day. These are all direct flights. Each element in the list has the format (source_city, destination, price). Consider a user who is willing to take up to k connections from their origin city A to thei...
3,209
1,091
"""PyTorch Distributed Data Parallel example from NVIDIA.""" # https://github.com/NVIDIA/DeepLearningExamples import argparse import utils import virtual_machine def main(): parser = argparse.ArgumentParser(description='Optional app description') parser.add_argument('--vm-name', dest='vm_name', type=str, require...
2,518
995
import json import itertools from datetime import datetime, timedelta import pandas as pd from sqlalchemy import select, and_, join from sqlalchemy.exc import IntegrityError import copy from ecoreleve_server.core import RootCore from ecoreleve_server.core.base_resource import DynamicObjectResource, DynamicObjectColle...
19,880
5,416
from core.himesis import Himesis, HimesisPreConditionPatternNAC import cPickle as pickle from uuid import UUID class HIgnoreRuleNAC0(HimesisPreConditionPatternNAC): def __init__(self, LHS): """ Creates the himesis graph representing the AToM3 model HIgnoreRuleNAC0. """ ...
6,002
1,791
from torch.utils.data import Dataset from skimage import io import os import torch class MnistData(Dataset): def __init__(self, root_dir): self.root_dir = root_dir img_list = [] label_list = os.listdir(self.root_dir) for label in label_list: file_names = os.li...
918
317
from qunetsim.backends.rw_lock import RWLock from qunetsim.objects.logger import Logger import queue class QuantumStorage(object): """ An object which stores qubits. """ STORAGE_LIMIT_ALL = 1 STORAGE_LIMIT_PER_HOST = 2 STORAGE_LIMIT_INDIVIDUALLY_PER_HOST = 3 def __init__(self): #...
20,478
6,088
# -*- coding: utf-8 -*- import datetime from pagseguro.utils import (is_valid_cpf, is_valid_cnpj, is_valid_email, parse_date) from pagseguro.exceptions import PagSeguroValidationError import pytest from dateutil.tz import tzutc def test_is_valid_email(): valid = 'test@email.com' ...
2,098
914
from server.controller.app import app as webapp # import Flask app so that it can be launched with gunicorn app = webapp
121
34
def test(): obj = { 'xxx1': 1, 'xxx2': 2, 'xxx3': 4, 'xxx4': 4, 'foo': 123 } i = 0 while i < 1e7: obj['foo'] = 234 obj['foo'] = 234 obj['foo'] = 234 obj['foo'] = 234 obj['foo'] = 234 obj['foo'] = 234 obj['foo'] = 234 obj['foo'] = 234 ob...
383
182
from itertools import chain import numpy as np import pandas as pd from pandas.api.types import union_categoricals from ..progress import Progress from ..result import QueryResult class NumpyQueryResult(QueryResult): """ Stores query result from multiple blocks as numpy arrays. """ def store(self, ...
3,563
963
# -*- coding: utf-8 -*- """ Created on Wed May 15 10:22:47 2019 @author: lawdfo Purpose: Read in the csv results file generated by (e.g.) riskModelsParamSweep.py and report back some useful statistics. """ # Some fairly standard modules import os, csv, lzma import numpy as np import matplotlib.pyplot as ...
33,383
11,026
''' -*- coding: utf-8 -*- Created on Fri Jan 17 12:34:15 2020 @author: Paul ''' import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns from sklearn.model_selection import train_test_split df=pd.read_excel(r'C:\Users\Paul\Desktop\Python projects\HIV_3.xlsx') print(df) ...
1,280
598
#-*- conding:utf-8 -*- #2018-02-02 11:04:54 import time,random,requests from lxml import etree from fake_useragent import UserAgent import urllib.request as ur from pymongo import MongoClient from multiprocessing.dummy import Pool as ThreadPool client = MongoClient('localhost',27017) db = client['test'] ip_list = db[...
2,425
848
#!/usr/bin/python3 # -*- coding: utf-8 -*- """ Read & write snapshot of node status data dumped to local file system. This data is used to detect things like sytem changes that may need to be reported. """ import json import time import logging import os import socket import psutil import netifaces as ni logging.ba...
5,359
1,448
#!/usr/local/bin/python # -*- coding: utf-8 -*- """ """ __author__ = 'joscha' __date__ = '03.08.12'
104
57
counter_name = 'I0_PIN' Size = wx.Size(1007, 726) logfile = '/net/helix/data/anfinrud_1502/Logfiles/I0_PIN-2.log' average_count = 1 max_value = 11 min_value = 0 start_fraction = 0.401 reject_outliers = False outlier_cutoff = 2.5 show_statistics = True time_window = 172800
273
138
import re import os import os.path import logging from register_printer.template_loader import get_template LOGGER = logging.getLogger(__name__) def print_uvm_block(block, out_path): uvm_block_name = block.block_type.lower() + "_reg_model" file_name = os.path.join( out_path, uvm_block_name +...
1,976
724
""" 開発初期段階では、サイトレポートをVIEWに直書きしていた パフォーマンス改善のため、バッチ処理に変更 このVIEWは今は使われていないが、一応残しておく """ from django.conf import settings from django.db.models import Q, Count from django.utils import html from .models import Post, Category, Tag from datetime import datetime from janome.tokenizer import Tokenizer from janome...
5,466
2,369
# -*- coding: utf-8 -*- # @Time : 2021/1/27 22:33 # @Author : BINGO # @School: 浙江大学 # @Campany: 竺星 # @FileName: __init__.py.py
131
81
from typing import Optional, Sequence import dynet as dy import numpy as np from xnmt import batchers class ExpressionSequence(object): """A class to represent a sequence of expressions. Internal representation is either a list of expressions or a single tensor or both. If necessary, both forms of representat...
8,502
2,647
# -*- coding: utf-8 -*- """ Copyright (C) 2015, MuChu Hsu Contributed by Muchu Hsu (muchu1983@gmail.com) This file is part of BSD license <https://opensource.org/licenses/BSD-3-Clause> """ import unittest import logging from cameo.localdb import LocalDbForCurrencyApi from cameo.localdb import LocalDbForTECHORANGE from...
12,423
4,513
import unittest from shexer.shaper import Shaper from test.const import G1, BASE_FILES, G1_NT, default_namespaces, BASE_FILES_GENERAL from test.t_utils import file_vs_str_tunned_comparison import os.path as pth from shexer.consts import NT, TURTLE _BASE_DIR = BASE_FILES + "graph_list_of_files_input" + pth.sep ...
3,456
1,056
import numpy as np def PrimaryWave(x, velocity, tinterp): return tinterp + 1.0 / velocity * x def ReflectedWave(x, velocity, tinterp): time = np.sqrt(x ** 2 / velocity ** 2 + tinterp ** 2) return time
217
84
# Copyright 2018 Uber Technologies, Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
6,487
1,954
"""Favorites Revision ID: 299e2bc265af Revises: 24f1df018932 Create Date: 2021-06-25 17:24:27.020289 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '299e2bc265af' down_revision = '24f1df018932' branch_labels = None depends_on = None def upgrade(): # ### ...
889
340
u""" Fixer for "class Foo: ..." -> "class Foo(object): ..." """ from lib2to3 import fixer_base from lib2to3.fixer_util import LParen, RParen, Name from libfuturize.fixer_util import touch_import_top def insert_object(node, idx): node.insert_child(idx, RParen()) node.insert_child(idx, Name(u"object")) no...
902
323
from pinochle.State import State from classes.Deck import Deck from classes.Hand import Hand from pinochle.MeldUtil import MeldUtil from pinochle.Meld import Meld from pinochle.Trick import Trick from pinochle.MeldTuple import MeldTuple from util.Constants import Constants as cs from util.util import print_divider from...
14,825
4,657
import os def check(cmd, mf): m = mf.findNode('matplotlib') if m is None or m.filename is None: return None if cmd.matplotlib_backends: backends = {} for backend in cmd.matplotlib_backends: if backend == '-': pass elif backend == '*': ...
737
229
# Generated by Django 3.1.6 on 2021-02-14 18:13 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('core', '0008_auto_20210214_2039'), ] operations = [ migrations.AlterField( model_name='device', name='ip_address', ...
711
262
import requests import re pattern_hashes = "^[a-f0-9]{64}$" pattern_url = "https?:\/\/.*" pattern_ip = "(?:(?:\d|[01]?\d\d|2[0-4]\d|25[0-5])\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d|\d)(?:\/\d{1,2})?" pattern_domain = "^[a-zA-Z0-9][a-zA-Z0-9-_]{0,61}[a-zA-Z0-9]{0,1}\.([a-zA-Z]{1,6}|[a-zA-Z0-9-]{1,30}\.[a-zA-Z]{2,3})$" head...
1,552
651
# -*- coding: utf-8 -*- """ Created on Thu Mar 17 19:08:54 2022 @author: julian """ import pandas as pd import matplotlib.pyplot as plt import seaborn as sns def heatmap(df): correlation_matrix = df.corr().round(2) print(correlation_matrix) sns_h = sns.heatmap(data=correlation_matrix, annot=True) s...
1,134
473
# coding: utf-8 import wx import wx.lib.sized_controls as sc from dataclasses import dataclass from functools import partial from wx.adv import CommandLinkButton from bookworm import app from bookworm import config from bookworm import typehints as t from bookworm.i18n import LocaleInfo from bookworm.concurrency impor...
20,048
5,639
from django.conf import settings from django.core import validators from django.db import models DEFAULT_RTMP_PORT = 1935 class Server(models.Model): listen = models.PositiveIntegerField( default=DEFAULT_RTMP_PORT, unique=True, validators=[ validators.MinValueValidator(1024), ...
1,376
412
# Copyright (c) 2012 Luke McCarthy <luke@iogopro.co.uk> # # This is free software released under the MIT license. # See COPYING file for details, or visit: # http://www.opensource.org/licenses/mit-license.php # # The file is part of FSMonitor, a file-system monitoring library. # https://github.com/shaurz/fsmonitor imp...
6,513
1,982
import math import random import string from datetime import datetime, timedelta from textwrap import dedent import config import discord from discord.ext import commands import asyncio class etc(commands.Cog): def __init__(self, bot): self.bot = bot @commands.command(name="clear") async def _m...
2,302
732
import tensorflow as tf L2_LAMBDA = 1e-04 def _residual_block(x, size, dropout=False, dropout_prob=0.5, seed=None): residual = tf.layers.batch_normalization(x) # TODO: check if the defaults in Tf are the same as in Keras residual = tf.nn.relu(residual) residual = tf.layers.conv2d( residual, ...
1,887
714
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Aug 23 15:15:05 2021 @author: qichen """ from aiida.plugins import DataFactory, CalculationFactory from aiida.engine import run from aiida.orm import Code, SinglefileData, Int, Float, Str, Bool, List, Dict, ArrayData, XyData, SinglefileData, FolderData,...
3,071
1,228
from .horizontalSelectionSquareGraphicsView import * from .selectionSquare import *
83
19
#!/usr/bin/python from k5test import * plugin = os.path.join(buildtop, "plugins", "kadm5_hook", "test", "kadm5_hook_test.so") hook_krb5_conf = { 'all' : { "plugins" : { "kadm5_hook" : { "module" : "test:" + plugin } } } } realm = K...
557
211
# -*- coding: utf-8 -*- äöü vim: sw=4 sts=4 et tw=79 """ Tools für Produkt-Setup (Migrationsschritte, "upgrade steps"): _tree """ # Python compatibility: from __future__ import absolute_import # Standard library: from posixpath import normpath # Zope: from Products.CMFCore.utils import getToolByName # Plone: from p...
11,465
3,238
import logging import sys import os import itertools from .conftest import requires_gpkg import pytest import fiona from fiona.errors import DatasetDeleteError def create_sample_data(filename, driver, **extra_meta): meta = { 'driver': driver, 'schema': { 'geometry': 'Point', ...
3,738
1,185
import math import sympy import numpy as np from scipy.special import binom import scipy class Taylor_based_methods: def __init__(self, tools): self.tools = tools # Taylorization (babbush2016exponential) # Let us know calcula the cost of performing Phase Estimation. # 1. We have already me...
15,023
5,871
#!/usr/bin/python3 from time import sleep from sys import exit import keypad_4x4_lib_sumar kp =keypad_4x4_lib_sumar.keypad() # Setup variables attempt = "0000" passcode = "1912" counter = 0 # Loop while waiting for a keypress while True: # Loop to get a pressed digit digit = None while digit == None: digit = ...
775
315
# Generated by Django 3.0.3 on 2020-02-28 13:21 import django.utils.timezone from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [] operations = [ migrations.CreateModel( name="Image", fields=[ ( ...
1,342
311
# Copyright 2019 Xilinx 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 agreed to in writing, ...
4,007
1,645