text
string
size
int64
token_count
int64
data = ( 'bols', # 0x00 'bolt', # 0x01 'bolp', # 0x02 'bolh', # 0x03 'bom', # 0x04 'bob', # 0x05 'bobs', # 0x06 'bos', # 0x07 'boss', # 0x08 'bong', # 0x09 'boj', # 0x0a 'boc', # 0x0b 'bok', # 0x0c 'bot', # 0x0d 'bop', # 0x0e 'boh', # 0x0f 'bwa', # 0x1...
5,010
3,417
from social_core.backends.azuread import AzureADOAuth2
55
18
# Copyright (c) 2012 Israel Herraiz <isra@herraiz.org> # 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, me...
6,556
2,212
import traceback from typing import Optional from .i18n import _ class UspsToolsException(Exception): """ Base class for all errors. """ def __init__(self, message: Optional[str] = None, origin: Exception = None): """ :param message: :param origin: """ super()._...
2,837
801
import sys import csv import requests from parsel import Selector from scraper.parser import get_features_from_item start_url = 'http://www.world-art.ru/animation/rating_top.php' SIGN_STDOUT = '-' FORMAT_CSV = 'csv' FORMAT_JL = 'jl' def parse(url: str, out_path: str, out_format: str): """ gets link and ret...
1,158
397
from __future__ import print_function import os import sys import serial.tools.list_ports from PyQt4 import QtCore from PyQt4 import QtGui from photogate_ui import Ui_PhotogateMainWindow from photogate_serial import PhotogateDevice from photogate_serial import getListOfPorts import dependency_hack try: import scipy...
14,592
4,346
from core import Variable from operation import * a = Variable(2) b = square(a) c = square(b) print(c.data)
114
46
name = 'sharepoint' from .sharepoint import SharePointSite __author__='James Classen' __version__='0.0.2'
106
37
# Copyright 2015 The Offline Content Packager 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 requi...
3,188
1,031
from pathlib import Path from pyspark.sql import SparkSession, functions as f from pyspark.sql.dataframe import DataFrame # Monkeypatch in case I don't use Spark 3.0 def transform(self, f): return f(self) DataFrame.transform = transform def query_mpns_v8_name_relationships( input_filepath: str, outp...
2,308
863
# -*- coding: utf-8 -*- """ Created on Wed May 23 16:56:57 2018 @author: tommy_mizuki """ import my_library my_func(1,2)
124
69
n = int(input()) count = 0 number = 0 while True: if '666' in str(number): #문자열로 변경하였을때 '666'이 포함되어있다면 count를 세준다. count += 1 if count == n: #count가 입력값과 동일할 때 print -> n번째 값 출력 print(number) break number += 1
246
160
""" plot request rate """ import os, sys sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "../")) from utils.common import * def _cal_req_rate(trace_reader, window): metadata_name = "reqRateList_w{}_{}.pickle".format(window, trace_reader.trace_path.split("/")[-1]) loaded = load_metadata(...
3,599
1,491
import os import redis import logging class Config(object): #配置数据库连接 SQLALCHEMY_DATABASE_URI = 'mysql://root:19920917@127.0.0.1:3306/data_monster' SQLALCHEMY_TRACK_MODIFICATIONS = False #配置redis数据库 REDIS_HOST = '127.0.0.1' REDIS_PORT = 6379 # 配置flask_session SESSION_TYPE = 'redis' ...
1,373
585
import tensorflow as tf from tensorflow.python import pywrap_tensorflow from tensorflow.python.platform import tf_logging as logging from tensorflow.python.training import saver as tf_saver def average_gradients(tower_grads): """Calculate the average gradient for each shared variable across all towers. Note t...
5,097
1,509
class MMDConfiguration: def __init__(self, mmd_rbf_gamma, mmd_rbf_ncomponents, mmd_representative_set_size): self.mmd_rbf_gamma=mmd_rbf_gamma self.mmd_rbf_ncomponents=mmd_rbf_ncomponents self.mmd_representative_set_size=mmd_representative_s...
328
116
from dataclasses import dataclass from typing import List from paralleldomain.model.annotation.common import Annotation from paralleldomain.model.annotation.polyline_2d import Polyline2D @dataclass class Polygon2D(Polyline2D): """A closed polygon made a collection of 2D Lines. Args: lines: :attr:`~....
1,234
389
import os import shutil import sys from maplist import installed_games backup_dir = "F:/bsps" if len(sys.argv) == 2: backup_dir = sys.argv[1] print(f"Making backups in '{backup_dir}'") i = 0 for base_dir, game_dir in installed_games: i += 1 print(f"Backing up ({i}/{len(installed_games)}) {game_dir}...")...
828
301
from typing import List, Optional from pydantic import AnyHttpUrl from infobip_channels.core.models import CamelCaseModel, ResponseBase class Button(CamelCaseModel): text: str type: str phone_number: Optional[str] = None url: Optional[AnyHttpUrl] = None class Header(CamelCaseModel): format: st...
770
236
import logging from flask import Flask, request, jsonify from extractor.document import Document from extractor.five_w_extractor import FiveWExtractor app = Flask(__name__) log = logging.getLogger(__name__) host = None port = 5000 debug = False options = None extractor = FiveWExtractor() ch = logging.StreamHandler() ...
1,391
418
import os import tempfile import pkg_resources as p from CPAC.utils.symlinks import create_symlinks mocked_outputs = \ p.resource_filename( "CPAC", os.path.join( 'utils', 'tests', 'test_symlinks-outputs.txt' ) ) def test_symlinks(): temp_dir ...
826
277
# -*- coding: utf-8 -*- # Generated by Django 1.10.1 on 2016-09-09 15:33 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion import django_extensions.db.fields class Migration(migrations.Migration): initial = True dependencies = [ ] ope...
14,488
3,985
"""Script for running the dserve server.""" import os from flask import ( Flask, jsonify, send_file, abort, request, ) from flask_cors import CORS, cross_origin app = Flask(__name__) cors = CORS(app) @app.route("/") @cross_origin() def root(): content = { "_links": { "s...
4,799
1,523
#!/usr/bin/env python # -*- coding: utf-8 -*- # """ util regex tool refs: http://www.symantec.com/connect/articles/detection-sql-injection-and-cross-site-scripting-attacks """ import re INJECTION_REGEX = re.compile( r"(%27)|(\')|(\-\-)|(%23)|(#)|" # Regex for detection of SQL meta-characters r"\w*((%27)|(\...
1,610
701
#!/usr/bin/env python REGISTERS = { 'IOCFG2': 0x00, 'IOCFG1': 0x01, 'IOCFG0': 0x02, 'FIFOTHR': 0x03, 'SYNC1': 0x04, 'SYNC0': 0x05, 'PKTLEN': 0x06, 'PKTCTRL1': 0x07, 'PKTCTRL0': 0x08, 'ADDR': 0x09, 'CHANNR': 0x0A, 'FSCTRL1': 0x0B, 'FSCTRL0': 0x0C, 'FREQ2': 0x0D, ...
1,520
885
''' @func:to store useful links module @create:2021.10.20 ''' def usefullink(): import streamlit as st st.write('[1].在线Latex公式编辑器') st.write('https://latex.codecogs.com/eqneditor/editor.php?lang=zh-cn') st.write('[2].装饰Github README.md文件的logo') st.write('https://shields.io/') st.write('[3...
384
180
# Copyright 2017 Regents of the University of California # # 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 conditions and the follow...
78,713
22,226
''' https://leetcode.com/contest/weekly-contest-150/problems/last-substring-in-lexicographical-order/ SA algorithm mostly copied from https://cp-algorithms.com/string/suffix-array.html Status: tle. probably py3 lists ''' class SuffixArray: def __init__(self, s): self.s = s self.n = len(s) ...
2,053
781
from antlr4 import * from .antlr import GraphQLLexer, GraphQLListener, GraphQLParser from .codegen import CodegenTool, Class, String, ClassInstance, IfElse, If, Method, Expr, Variable import re from math import floor from datetime import datetime from .utils import strip_string_quotes, camel_case_to_snake_case, process...
18,555
4,358
from flask import Flask, request, jsonify,Blueprint from flask_marshmallow import Marshmallow from app.models import User, Group, Role from app import ma api = Blueprint('api', __name__) class UserSchema(ma.Schema): class Meta: # Fields to expose fields = ('id', 'confirmed','first_name','last_nam...
2,231
757
""" Setup script for samply """ from setuptools import setup import re extra_args = {} def get_property(prop, project): """ Helper function for retrieving properties from a project's __init__.py file @In, prop, string representing the property to be retrieved @In, project, ...
2,335
721
# -*- coding: utf-8 -*- # @Author: TD21forever # @Date: 2018-11-14 15:41:57 # @Last Modified by: TD21forever # @Last Modified time: 2018-11-15 16:50:48 file = open('input.txt','r')#读取文件 #预处理 传入字符串 def preprocess(article): article = article.strip() article = article.replace(",", ", ") article...
4,353
1,835
from django.test import TestCase from authors.apps.authentication.models import ( User ) class UserModelTest(TestCase): """ This tests the User model class, ability to create a user and create a super user. """ def test_create_user(self): """ Checks whether a user can be created...
1,405
384
#!/usr/bin/env python #-*- coding:utf-8 -*- """ Created on Nov 23, 2020 @author: Chengning Zhang """ ## simulation for Scenario A: generate X0 and X1. def MonteCarlo_1(T, n0, n1, u0, u1, sigma0, sigma1, log_bool = False): """simulation for first scenario: multivarite normal with equal variance T: number of simula...
5,908
2,450
import requests def pages_crawler(): http_header = { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36', } url = r'https://robo.datayes.com/v2/indicator_library' response = requests.get(url, headers=http_header) p...
389
167
import sys import logging import pytz logging.basicConfig(format='%(levelname)s: %(message)s') if (sys.version_info < (3, 0)):#NO MORE PYTHON 2!!! https://pythonclock.org/ logging.error(" ########################### ERROR ###########################") logging.error(" ============================================...
11,662
3,398
class NoMoreData(Exception): pass
38
12
#Stock inventory control system. def menu(): print("""1. Add New Stock 2. Update existing stock 3. Sell stock, even though 2 will work too 8. Display Inventory 9. Exit""") while True: try: choice = int(input("Please select an option")) break except: ...
3,327
1,019
bind = "0.0.0.0:5000" threads = 10 worker_class = "gthread" accesslog = '-' errorlog = '-'
91
45
""" 2017 Day 23 https://adventofcode.com/2017/day/23 """ from typing import Dict import aocd # type: ignore class Program: def __init__(self, text: str): self.registers: Dict[str, int] = {} self.commands = text.split("\n") self.position = 0 self.mul_count = 0 def get(self, k...
1,780
617
import sys from sklearn.datasets import make_blobs from src.simulator.wsn.network import Network from src.simulator.wsn.utils import * from src.simulator.wsn.fcm import * from src.simulator.wsn.direct_communication import * from src.utils import complete, star seed = 1 np.random.seed(seed ) logging.basic...
1,641
620
# -*- coding: utf-8 -*- try: from collections.abc import Iterable except ImportError: from collections import Iterable import numpy as np from numpy import ndarray from dewloosh.math.array import atleast1d from dewloosh.math.utils import to_range from .celldata import CellData from .utils import jacobian_mat...
4,149
1,411
from .rmq_item import RMQItem
30
12
import os import numpy as np from gym import utils from mujoco_safety_gym.envs import fetch_env # Ensure we get the path separator correct on windows MODEL_XML_PATH = os.path.join('fetch', 'slide.xml') class FetchSlideEnv(fetch_env.FetchEnvNew, utils.EzPickle): def __init__(self, reward_type='sparse'): ...
968
380
from setuptools import setup, find_packages setup( name="raspi_ip", version="1.0.0", author="atoy322", description="", long_description="" )
163
59
__title__ = "open_kite_connect" __description__ = "Fork of the official Kite Connect python client, allowing free access to the api." __url__ = "https://kite.trade" __download_url__ = "https://github.com/AnjayGoel/pykiteconnect" __version__ = "4.0.0" __author__ = "Anjay Goel" __author_email__ = "anjay.goel@gmail.com" _...
339
129
# @Author: DivineEnder # @Date: 2018-03-08 22:24:45 # @Email: danuta@u.rochester.edu # @Last modified by: DivineEnder # @Last modified time: 2018-03-11 01:25:41 # -*- coding: utf-8 -*- # Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: https://doc.scrapy....
1,679
591
import os import json from enum import Enum from datetime import datetime,date import logging import pathlib from tqdm import tqdm from datastructures import Volume, IndexedFile,load_index_if_exists, save_index from os import listdir from os.path import isfile, join import itertools import csv logger = lo...
2,227
718
import unittest from collections import namedtuple from jike.objects.wrapper import * class TestWrapper(unittest.TestCase): def setUp(self): self.Test = namedtuple('Test', ['id', 'content', 'other', 'none']) def test_repr_namedtuple(self): self.Test.__repr__ = repr_namedtuple test = s...
1,056
366
#!/usr/bin/env python """ The various ChannelUI classes. Hazen 04/17 """ import os from PyQt5 import QtCore, QtWidgets def loadStyleSheet(name): text = "" with open(os.path.join(os.path.dirname(__file__), name)) as fp: text += fp.read() return text class ChannelUI(QtWidgets.QFrame): "...
10,125
3,197
import sys import struct from io import FileIO, BufferedWriter import S9Compressor as S9 BLOCKSIZE = (64*1024) / 4 # number of Int LexiPos = 0 # record the current position for new lexicon writing lexiconBuffer = [] IIBuffer = [] WriteThreshold = 0 def docidPrepare(docidList): # calculate the diff, return ...
4,051
1,662
#CASA script to create cutouts of fits cubes directoryA = '/Volumes/TARDIS/Work/askap/' directoryB = '/Volumes/NARNIA/pilot_cutouts/' import numpy as np sources=np.loadtxt('/Users/emma/GitHub/possum-tools/DataProcess/pilot_sources.txt',dtype='str') for i in range(0,sources.shape[0]): objectname=sources[i,0] POSSUM...
5,028
2,270
from cv_comparison_slider_window.cv_comparison_slider_window import CvComparisonSliderWindow
92
27
from ..language import get_text from ..database.query import ( user_exist, is_admin) END = -1 def warning_the_user_that_already_have_an_account(update, context): text = get_text("user_have_account", context) update.message.reply_text(text) return END def warning_the_user_that_he_dont_have_an_a...
1,207
385
"""" This package contains the OpenGL demonstration classes """
63
15
#!/usr/bin/env python3 # -*- coding: ISO-8859-1 -*- # https://github.com/starze/openhab2 # https://github.com/roggmaeh/nilan-openhab import minimalmodbus import serial import os, sys import csv import httplib2 minimalmodbus.CLOSE_PORT_AFTER_EACH_CALL = True instrument = minimalmodbus.Instrument('/dev/ttyUSB0', 30, m...
1,640
649
import cv2 import numpy as np import os def prepare_training_data(data_folder_path): #------STEP-1-------- #get the directories (one directory for each subject) in data folder dirs = sorted(os.listdir(data_folder_path)) #print(dirs) faces = [] labels = [] for label,coun...
2,316
736
"randompicker.py" import random "A very short practice program designed to spit out a random, user-determined sample of input names"
138
43
from __future__ import absolute_import, division import numpy as np import matplotlib.pyplot as plt from matplotlib import gridspec from fisspy.analysis.filter import FourierFilter from interpolation.splines import LinearSpline from matplotlib.animation import FuncAnimation import astropy.units as u from astropy.time i...
15,873
5,105
""" Author: André Bento Date last modified: 26-02-2019 """ import subprocess import sys from os.path import dirname, abspath, join from setuptools import find_packages, Command, setup from setuptools.command.test import test as TestCommand this_dir = abspath(dirname(__file__)) NAME = 'graphy' VERSION = '0.0....
2,806
896
import pytz from datetime import datetime, timedelta, timezone from rest_framework.decorators import api_view, parser_classes, renderer_classes from rest_framework.parsers import JSONParser from rest_framework.renderers import JSONRenderer from rest_framework.request import Request from rest_framework.response import ...
1,317
376
import pandas as pd import datetime as dt class FundType( object ): OF = 'Open Ended Fund' ETF = 'Exchange Traded Fund' LOF = 'Listed Open Ended Fund' MMF = 'Money Market Fund' def getFundType( fundCode ): fundTypeDf = pd.read_csv( 'refData/fund_list.csv', names = [ 'fundCode', 'fundType...
1,615
554
import json def lambda_handler(event, context): unicorns = [ { "name": "Gaia", "gift": "Speed" }, { "name": "Magestic", "gift": "Magic" }, { "name": "Sparkles", "gift": "Glitter" } ] r...
398
138
import uvio async def route(req): pass async def handler(req, res): await route(req, res)() res.end("Yes") @uvio.run async def main(): server = await uvio.http.listen(handler, host='127.0.0.1', port=80) print("server", server)
253
100
# Copyright 2016 United States Government as represented by the Administrator # of the National Aeronautics and Space Administration. All Rights Reserved. # # Portion of this code is Copyright Geoscience Australia, Licensed under the # Apache License, Version 2.0 (the "License"); you may not use this file # except in ...
7,933
2,497
import cleaner as dataStream import plotly.graph_objects as go import plotly.io as pio #DONUT PLOT - CONDITIONS ----------------------------------------- labels = ['Diabetes','Hypertension','Coronary Heart(D)','Chronic Kidney(D)','No Conditions','Obstructive Pulmonary(D)'] values = dataStream.PIEList fig_cond = go.Fi...
2,014
870
from ..math import geometry as geo from ..image.color import Color import math class Material: def __init__(self,color,diffuse_rate,specular_rate,specular_exponent,reflection_rate): self.color = color self.diffuse_rate = diffuse_rate self.specular_rate = specular_rate self.specular_exponent = specular_expon...
1,847
670
import time from tkinter import * from PIL import Image, ImageTk from Configuration import config class Led: imageOn = Image.open(config.get('APPLICATION', 'LED_ON_IMG')) imageOff = Image.open(config.get('APPLICATION', 'LED_OFF_IMG')) STATE_ON = "ON" STATE_OFF = "OFF" def __init__(self, pare...
1,401
453
import pytest from bank_ddd_es_cqrs.accounts import SocialSecurityNumber def test_social_security_number_throws_app_exception_with_status_422_if_too_much_digits(): with pytest.raises(ValueError) as e: SocialSecurityNumber(1324352351)
249
95
from setuptools import setup from setuptools import find_packages setup(name='rl_traders', version='0.1.0', description='Reinforcement Learning for Trading', url='https://github.com/jjakimoto/rl_traders.git', author='jjakimoto', author_email='f.j.akimoto@gmail.com', license='MIT', ...
358
117
from pyrogram import Client import asyncio from Music.config import API_ID, API_HASH, BOT_TOKEN, MONGO_DB_URI, SUDO_USERS from motor.motor_asyncio import AsyncIOMotorClient as MongoClient import time import uvloop from Music import config import importlib from pyrogram import Client as Bot from Music.config import API_...
2,219
822
import random from random import shuffle import numpy as np import tensorflow as tf from tensorflow.python.tools import freeze_graph import datetime import time import queue import threading import logging from PIL import Image import itertools import yaml import re import os import glob import shutil import sys import...
9,372
3,462
from troposphere import Template, Ref, Parameter, GetAtt from troposphere.ec2 import SecurityGroup from troposphere.rds import DBSubnetGroup, DBInstance def create_rds_template(): template = Template() vpc = template.add_parameter( parameter=Parameter( title='Vpc', Type='Strin...
3,037
850
# Generated by Django 3.0.7 on 2021-01-26 09:57 import django.contrib.postgres.fields from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('hlwtadmin', '0043_auto_20210126_0833'), ] operations = [ migrations.AddField( model_name='...
514
181
from conans import ConanFile, CMake, tools class NativeFileDialogExtendedConan(ConanFile): name = "nativefiledialog-extended" version = "1.0" license = "zlib" author = "Marius Elvert marius.elvert@googlemail.com" url = "https://github.com/ltjax/nativefiledialog-extended" description = "Small C...
1,855
602
""" # Sample code to perform I/O: name = input() # Reading input from STDIN print('Hi, %s.' % name) # Writing output to STDOUT # Warning: Printing unwanted or ill-formatted data to output will cause the test cases to fail """ # Write your code here import bisect def check(arr, x, ln, val):...
960
317
from django.urls import path, re_path from . import views app_name = "departments" urlpatterns = [path("", views.departmentList, name="energy department"), path( "<slug:department>/", views.department_detail, name="department_detail", ), path( "<slug:departm...
712
203
# 5. How do you Count The Number Of Times Each Value Appears In An Array Of Integers? # [0, 5, 4, 0, 4, 4, 3, 0, 0, 5, 2, 1, 1, 9] # Answer should be array([4, 2, 1, 1, 3, 2, 0, 0, 0, 1]) which means 0 comes 4 times, 1 comes 2 times, 2 comes 1 time, 3 comes 1 time and so on. array = [0, 5, 4, 0, 4, 4, 3,...
432
231
from time import sleep print("Welcome to Tic Tac Toe! \nWe'll be playing in a sec, but, first..") general_board = {'7': ' ', '8': ' ', '9': ' ', '4': ' ', '5': ' ', '6': ' ', '1': ' ', '2': ' ', '3': ' '} # prints board structure def show_board(board): print('\t\t', board['7'],...
4,957
1,434
""" Auth Providers which provides LDAP login """ from typing import List, Dict from ldap3 import Connection, Server, AUTO_BIND_TLS_BEFORE_BIND, SUBTREE from ldap3.core.exceptions import LDAPSocketOpenError, LDAPBindError from ..login import LoginProvider from .. import APP, AUTH_LOGGER class LDAPAuthProvider(LoginPr...
7,119
2,094
#!/usr/bin/env python3 import re, os, glob template = """ <!doctype html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes"> <style> body { font-family: PMingLiu, HanaMinA, HanaMinB, Helvetica, arial, sans-serif; writing-mode: vertical-rl...
4,117
1,531
# -*- encoding: utf-8 -*- from PyQt5.QtCore import QCoreApplication from PyQt5.QtWidgets import QMainWindow, QFrame import mobase class HideRunPanelPlugin(mobase.IPlugin): _runFrame: QFrame def __init__(self): super().__init__() def init(self, organizer: mobase.IOrganizer): """ For a ...
2,460
694
from ._inv_prop_lr import InvPropLR from ._constant_lr import ConstantLR from ._step_size_lr import StepSizeLR from ._dynamic_step_size_lr import DynamicStepSizeLR
164
53
# -*- coding: utf-8 -*- """ utils/strava.py ================= Utility class to Strava API """ import json import time from configparser import ConfigParser, NoOptionError from datetime import datetime from pathlib import Path from typing import Tuple from loguru import logger from stravalib import Client, exc from ut...
8,645
2,371
""" Author: brooklyn train with synthText """ import torch import torch.nn as nn import torch.optim as optim import torchvision.transforms as transforms import os from net.craft import CRAFT import sys from utils.cal_loss import cal_synthText_loss from dataset.synthDataset import SynthDataset import argparse from eval...
5,293
1,895
from django.db import models class FriendCircle(models.Model): name = models.CharField(blank=True, max_length=255) description = models.CharField(blank=True, max_length=1000) interests = models.ManyToManyField('interests.Interest', blank=True) members = models.ManyToManyField( 'users.CustomUser...
1,896
584
"""Unit tests for the Jira issues collector.""" from .base import JiraTestCase class JiraIssuesTest(JiraTestCase): """Unit tests for the Jira issue collector.""" METRIC_TYPE = "issues" async def test_issues(self): """Test that the issues are returned.""" issues_json = dict(total=1, issu...
474
145
import numpy as np import pandas as pd import pytest import xarray as xr import cf_xarray as cfxr @pytest.mark.parametrize( "mindex", [ pd.MultiIndex.from_product([["a", "b"], [1, 2]], names=("lat", "lon")), pd.MultiIndex.from_arrays( [["a", "b", "c", "d"], [1, 2, 4, 10]], names=(...
1,485
557
"""The base class of Socket Mode client implementation. If you want to build asyncio-based ones, use `AsyncBaseSocketModeHandler` instead. """ import logging import signal import sys from threading import Event from slack_sdk.socket_mode.client import BaseSocketModeClient from slack_sdk.socket_mode.request import Sock...
1,908
507
# coding=utf-8 import numpy as np import scipy.interpolate as intpl import scipy.sparse as sprs def to_sparse(D, format="csc"): """ Transform dense matrix to sparse matrix of return_type bsr_matrix(arg1[, shape, dtype, copy, blocksize]) Block Sparse Row matrix coo_matrix(arg1[, shape, dtype, ...
8,344
2,948
"""rbtree_graphviz.py - create a graphviz representation of a LLRBT. The purpose of this module is to visually show how the shape of a LLRBT changes when keys are inserted in it. For every insert, sub graph (tree) is added to the main graph. `initialization_list` holds the values that are inserted in the tree. This l...
7,266
2,311
class ParameterError(Exception): pass class NotChoicesFound(Exception): pass
87
25
from django.apps import AppConfig class HwSystemConfig(AppConfig): name = 'hw_system'
97
35
from pathlib import Path from typing import Generator from airflow.hooks.base_hook import BaseHook from azure.storage.filedatalake import FileSystemClient from azure.storage.filedatalake._generated.models._models_py3 import ( StorageErrorException, ) class ADLSGen2Hook(BaseHook): """ Hook to interact with...
5,721
1,507
# -*- coding: utf-8 -*- # Generated by Django 1.11.3 on 2017-07-14 17:10 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('ciudadano', '0043_ciudadanorn_numero_dni_ciudadano'), ] operations = [ migra...
536
193
from time import sleep import pyqtgraph as pg import threading from graphtiny.api import IChart, IDataStreamWindow from graphtiny.domain import DataStreamWindow, Chart class FuncThread(threading.Thread): def __init__(self, t, *a) -> None: self._t = t self._a = a threading.Thread.__init__(...
2,499
727
from typing import Generator, Dict, Any from fastapi import Depends, HTTPException, status from fastapi.security import OAuth2PasswordBearer from jose import jwt from pydantic import ValidationError from sqlalchemy.orm import Session from tlbx import json, pp from zillion.configs import load_warehouse_config, zillion_...
2,576
828
def match_plus(string, matching_value): matches = match_star(string, matching_value) return matches != 0, matches def match_star(string, matching_value): found_occurrences = 0 for i, char in enumerate(string): if not match_identity(char, matching_value): return found_occurrences ...
517
147
from BufferStockModel import BufferStockModelClass updpar = dict() updpar["Np"] = 1500 updpar["Nm"] = 1500 updpar["Na"] = 1500 model = BufferStockModelClass(name="baseline",solmethod="egm",**updpar) model.test()
212
91
#! /usr/bin/env python3 # ## Copyright (C) 2015-2018 Rolf Neugebauer. All rights reserved. ## Copyright (C) 2015 Netronome Systems, 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 co...
4,629
1,648