text
string
size
int64
token_count
int64
#! /usr/bin/env python """ Compare bruker read_pdata to read. """ import nmrglue as ng import matplotlib.pyplot as plt # read in the data data_dir = "data/bruker_exp/1/pdata/1" # From pre-procced data. dic, data = ng.bruker.read_pdata(data_dir, scale_data=True) udic = ng.bruker.guess_udic(dic, data) uc = ng.fileiob...
1,320
574
import io import os import unittest import boto3 from botocore.response import StreamingBody from botocore.stub import Stubber from functions.posts_get.posts_get_logic import posts_get_logic class GetSomethingLogicTest(unittest.TestCase): def setUp(self): # https://docs.python.org/3/library/unittest.htm...
4,404
1,281
from typing import Union, List import copy import math import numpy as np """ Principles: - geometry objects are defined by the minimum required information - Points are made of coordinates (floats), everything else is based on Points except for Vectors """ class Point: def __init__(self, x: float, y: float, ...
21,050
6,766
import os, logging if not os.path.exists('config'): os.mkdir('config') log = logging.getLogger('danmu') log.setLevel(logging.DEBUG) fileHandler = logging.FileHandler(os.path.join('config', 'run.log'), encoding = 'utf8') fileHandler.setLevel(logging.DEBUG) formatter = logging.Formatter('%(asctime)-17s <%(message...
556
207
import multiprocessing import time import gym import gym3 import numpy as np from gym.vector import make as make_vec_env from procgen import ProcgenGym3Env population_size = 112 number_env_steps = 1000 def run_episode_full(u): env = gym.make('procgen:procgen-heist-v0') obs = env.reset() reward = 0 ...
2,016
760
import time import typing class PaymentRequest: def __init__(self, amount: int, identifier: int = None): self.amount = amount self.identifier = identifier if identifier is None: self.identifier = int(time.time()) def to_dict(self) -> typing.Dict[str, typing.Any]: ...
1,641
482
def zeroOneKnapsack(v, w, W): c = [] n = len(v) c = [[0 for x in range(W+1)] for x in range(n)] for i in range(0,n): for j in range(0,W+1): if (w[i] > j): c[i][j] = c[i-1][j] else: c[i][j] = max(c[i-1][j],v[i] +c[i-1][j-w[i]]) retur...
823
415
# Generated by Django 3.0.2 on 2020-10-08 22:36 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('tasks', '0001_initial'), ] operations = [ migrations.AddField( model_name='user', name='background', fie...
587
197
import os import sys import django sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) os.environ.setdefault("DJANGO_SETTINGS_MODULE", "museum.settings") django.setup() from django.contrib.auth.models import User # noqa: E402 from museum_site.models import * # noqa: E402 def main(): ...
874
312
import matplotlib.pylab as plt import numpy as np plt.figure() axes=plt.gca() y= np.random.randn(9) col_labels=['col1','col2','col3'] row_labels=['row1','row2','row3'] table_vals=[[11,12,13],[21,22,23],[28,29,30]] row_colors=['red','gold','green'] the_table = plt.table(cellText=table_vals, colWidth...
553
229
import re import os def extract(regularE : str, init : str, stop : str, string : str): """ regularE: RE to catch string init: First string to replace stop: Last string to replace string: String to apply the RE With a regular expression and init and stop t...
1,258
361
#!/usr/env/python3 # coding=utf-8 # # Generate Steamguard OTP with the shared secret passed as an argument # Ganesh Velu import hmac import base64 import hashlib import codecs import time import sys STEAM_DECODE_CHARS = ['2', '3', '4', '5', '6', '7', '8', '9', 'B', 'C', 'D', 'F', 'G', 'H', 'J',...
1,054
428
""" """ class Node: INFINITY = 1000000000 def __init__(self, row, col, cost = 0): self.row = row self.col = col # Default node value self.G = self.INFINITY self.rhs = self.INFINITY self.par = None self.key = (None, None) # Cost (for obstacles...
1,783
606
"""Handle rendering of the Energy Power Meter widget.""" from apps.widgets.resource_goal import resource_goal def supply(request, page_name): """Return the view_objects content, which in this case is empty.""" _ = page_name team = request.user.get_profile().team if team: interval = resource_...
556
159
import argparse import json from authlib.jose import JsonWebKey from cryptography.hazmat.primitives import serialization def generate_key_pair(filename, kid=None): """ 'kid' will default to the jwk thumbprint if not set explicitly. Reference: https://tools.ietf.org/html/rfc7638 """ options = {} ...
1,408
470
### # Copyright (c) 2019-present, IBM Research # Licensed under The MIT License [see LICENSE for details] ### from collections import defaultdict from hkpy.hkpyo.model import HKOContext, HKOContextManager, HKOConcept, HKOSubConceptAxiom, HKOConjunctionExpression, \ HKODisjunctionExpression, HKOConceptAssertion, H...
4,855
1,514
from django.contrib import admin from .models import Account, Product, Drink, Topping, Order admin.site.register(Account) admin.site.register(Product) admin.site.register(Drink) admin.site.register(Topping) admin.site.register(Order)
237
74
from __future__ import absolute_import from influxdb_client.client.influxdb_client import InfluxDBClient
106
33
from django.contrib.auth.models import User from django import forms from .models import UserProfile class UserRegistrationForm(forms.ModelForm): password = forms.CharField(max_length=20 , widget=forms.PasswordInput , label='Password') password2 = forms.CharField(max_length=20 , widget=forms.PasswordInput , label...
809
273
import sys import numpy as np import os import requests import json import logging from json import JSONEncoder from keras.models import model_from_json sys.path.append('..') from preprocessing.InputHelper import InputHelper from model.lstm import rmse from model.lstm import buildModel from keras.preprocessing.sequenc...
8,031
2,843
from manhattan.manage import config from manhattan.nav import Nav, NavItem from blueprints.accounts.manage import blueprint from blueprints.accounts.models import Account __all__ = ['AccountConfig'] class AccountConfig(config.ManageConfig): frame_cls = Account blueprint = blueprint @classmethod de...
1,429
363
from aiohttp import ClientConnectionError from wsrpc_aiohttp.testing import BaseTestCase, async_timeout class TestDisconnect(BaseTestCase): @async_timeout async def test_call_error(self): class DataStore: def get_data(self, _): return 1000 self.WebSocketHandler.add...
599
169
import logging import logging.config import os LOG_DIR = os.path.dirname(os.path.abspath(__file__)) log_config = { 'version': 1, 'formatters': { 'verbose': { 'class': 'logging.Formatter', 'format': '%(asctime)s [%(name)s] %(levelname)-8s %(pathname)s:%(lineno)d - %(message)s', ...
2,325
734
#!/usr/bin/env python import os import platform from glob import glob import utils.appconfig as appconfig # GLOBAL CONSTANTS # --- File Structure Constants --- BASE_DIRS = { 'delivery': [ 'CritiqueArchive' ], 'docs': [], 'frames': [], ...
5,280
1,814
# coding=utf-8 # Copyright 2020 The TensorFlow Datasets Authors and the HuggingFace Datasets 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/LI...
3,024
1,262
from lib.interface import cabecalho def arquivoExiste(arq): try: a = open(arq, 'rt') a.close() except FileNotFoundError: return False else: return True def criarArquivo(arq): try: a = open(arq, 'wt+') a.close() except: print('Houve um erro ...
1,215
457
from graph import Graph matrix = [] with open('p083_matrix.txt') as file: for line in file.readlines(): currentline = [int(n) for n in line.split(',')] matrix.append(currentline) numGraph = Graph() # add each node first for i in range(len(matrix)): for j in range(len(matrix[i])): num...
2,626
1,074
from django.core.exceptions import ObjectDoesNotExist from django.shortcuts import render, redirect, get_object_or_404 from designs import models as design_models from feet import models as foot_models from products import models as product_models from .models import Cart, CartItem # 現在のセッション宛にカートを生成するための関数 def _sess...
4,010
1,546
""" Script to deploy a website to the server by ftp. - Compares local directory with remote directory - Updates modified files - Adds new files - Optionally, removes deleted files from remote Requires: python 3.3+ Due to use of ftplib.mlsd() The MIT License (...
13,515
4,074
""" Author : Robin Singh Programs List: 1.Queue 2.Circular Queue 3.Double Ended Queue """ import inspect class Queue(object): def __init__(self, length=5): """ :param length: pass queue length while making object otherwise default value will be 5 """ self.items = [] self....
6,079
1,644
from wataru.commands.models.base import CommandBase from wataru.logging import getLogger import wataru.rules.models as rmodels import os import sys logger = getLogger(__name__) class Create(CommandBase): def apply_arguments(self, parser): parser.add_argument('--name', action='store', dest='projectname')...
1,740
505
# A Sensation which creates a Polyline of 35 points of the finger joints, along which a Circle Path is animated. from pysensationcore import * import sensation_helpers as sh import HandOperations # We will use the joint positions of the fingers to animate a Circle along a PolylinePath fingers = ["thumb", "indexFinger"...
2,914
891
"""Extract inception_v3_feats from videos for Youtube-8M feature extractor.""" import os import torch import init_path import misc.config as cfg from misc.utils import (concat_feat_var, get_dataloader, make_cuda, make_variable) from models import inception_v3 if __name__ == '__main__': #...
2,053
593
from collections import deque from ..utils.collections import DictLike from ..matcher.core import ReteNet from ..matcher.actions import make_node_token, make_edge_token, make_attr_token from .sampler import NextReactionMethod class SimulationState: def __init__(self,nodes=[],**kwargs): self.cache = DictLike(nodes)...
4,208
1,667
### performing function similar to --snapcheck option in command line ###### from jnpr.jsnapy import SnapAdmin from pprint import pprint from jnpr.junos import Device js = SnapAdmin() config_file = "/etc/jsnapy/testfiles/config_single_snapcheck.yml" snapvalue = js.snapcheck(config_file, "snap") for snapcheck in snap...
594
189
from typing import * class Solution: # 32 ms, faster than 53.97% of Python3 online submissions for Number of Steps to Reduce a Number to Zero. # 14.2 MB, less than 35.20% of Python3 online submissions for Number of Steps to Reduce a Number to Zero. def numberOfSteps(self, num: int) -> int: ans = 0 ...
1,068
348
import Tkinter as tk from PIL import Image, ImageTk import aggdraw window = tk.Tk() label = tk.Label(window) label.pack() # schedule changing images import itertools, random, time def agg2tkimg(aggimage): t = time.clock() img = aggimage colorlength = len(img.mode) width,height = img.size imgb...
1,370
546
from utils import utils def part_1(data): count_1 = sum([1 if data[i] - data[i-1] == 1 else 0 for i in range(len(data))]) count_3 = sum([1 if data[i] - data[i-1] == 3 else 0 for i in range(len(data))]) return count_1*count_3 def part_2(data): dynm = [1] + [0]*(len(data)-1) for i in range(1, len(da...
693
309
""" @author: Alexander Studier-Fischer, Jan Odenthal, Berkin Oezdemir, Isabella Camplisson, University of Heidelberg """ from HyperGuiModules import * import logging import os #logging.basicConfig(level=logging.DEBUG) xSize=None ySize=None def main(): (window, introduction, input_output, image_diagram, hist_cal...
5,510
2,067
# Free the prisoner, defeat the guard and grab the gem. hero.moveRight() # Free Patrick from behind the "Weak Door". hero.attack("Weak Door") hero.moveRight(2) # Defeat the guard, named "Two". # Get the gem. hero.moveRight() hero.moveDown(3)
241
89
# -*- coding: utf-8 -*- # import libraries import os from PIL import Image import nltk import numpy as np import matplotlib.pyplot as plt import random from scipy.ndimage import gaussian_gradient_magnitude from wordcloud import WordCloud, ImageColorGenerator, STOPWORDS # import mask image. Search for stencil image...
1,120
390
# -*- coding: utf-8 -*- """ Created on Thu Oct 26 08:19:16 2017 @author: 0 """ from scipy.misc import imresize from scipy.signal import convolve,convolve2d import scipy from PIL import Image import cv2 import numpy as np img = cv2.imread("C://Users/0/Downloads/basketball1.png",0) img2 = cv2.imread("C://Users/0/Downloa...
2,120
1,126
#!usr/bin/env python3 #import dependecies import sqlite3 import csv #connect to test_data conn = sqlite3.connect('test_data.db') #create a cursor c = conn.cursor() c.execute("DROP TABLE test_data") #create a test_data table c.execute("""CREATE TABLE test_data(age integer, sex te...
743
223
from swift_cloud_py.entities.control_output.fixed_time_schedule import FixedTimeSchedule from swift_cloud_py.entities.intersection.intersection import Intersection from swift_cloud_py.validate_safety_restrictions.validate_bounds import validate_bounds from swift_cloud_py.validate_safety_restrictions.validate_completene...
1,824
505
from timingsignal import TimingSignal from brick_characterizer.CharBase import CharBase class CellRiseFall_Char(CharBase): def __init__(self,toplevel,output_filename,temperature,use_spectre=False): self.toplevel = toplevel self.output_filename = output_filename self.load_capacitance = 0...
20,366
6,676
from .str2num import str2num __all__ = [ 'str2num' ]
58
27
import sys # First: to understand the uses of "format" below, read these: # Format String Syntax https://docs.python.org/2/library/string.html#formatstrings # Format Specification Mini-Language https://docs.python.org/2/library/string.html#formatspec # In Python 2, there are two integer types: int, long. # int i...
2,168
855
import os from sendDetailedEmail.email import MailAttachment def sendMail(clientEmail): try: sender = MailAttachment(clientEmail=clientEmail) sender.send() except Exception as e: raise e if __name__=="__main__": clientEmail = input("input a valid client email ID: ") sendMail(c...
332
95
from contextlib import contextmanager import pathlib import sys from typing import Union, List from .import_hook import PyFinder, PyHTTPFinder # Singleton instance of PyFinder pyfinder: PyFinder = None def _update_syspath(path: str): """ Append `path` to sys.path so that files in path can be imported """...
2,933
811
#!/usr/bin/env python3 import uuid import click from rastervision.rv_config import RVConfig def _batch_submit(cmd, debug=False, profile=False, attempts=5, parent_job_ids=None, num_array_jobs=None, use_gpu=Fa...
1,982
692
from fastapi import APIRouter from models.item_model import Payload from service import item_service router = APIRouter() @router.get("/") async def read_root(): return {"Hello": "Universe"} @router.post("/indexitem") async def index_item(payload: Payload): return item_service.index_item(payload)
311
95
""" Docker Configurator http://www.github.com/EnigmaCurry/docker-configurator This tool creates self-configuring docker containers given a single YAML file. Run this script before your main docker CMD. It will write fresh config files on every startup of the container, based off of Mako templates embedded in the doc...
6,867
2,024
from datetime import date import boundaries boundaries.register('federal-electoral-districts', # The slug of the boundary set # The name of the boundary set for display. name='Federal electoral districts', # Generic singular name for a boundary from this set. Optional if the # boundary set's name ends...
2,583
785
# # from .subscriber import Subscriber from .logger import Logger from .constants import Constants from .events import Events # import json class Publisher(Subscriber): def __init__(self, name, eventDefault=None, host=None, port=None, protocol=None): super(Publisher, self).__init__(name, host, port, proto...
2,962
909
''' Authentication methods for cs166 final project. ''' import random, hashlib from .db import retrieve_accounts lower_case = ['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'] upper_case = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', '...
3,560
1,103
# coding: utf-8 """ @author: csy @license: (C) Copyright 2017-2018 @contact: wyzycao@gmail.com @time: 2018/11/22 @desc: """ import unittest from orm.data_base import Database class BaseTestCase(unittest.TestCase): def setUp(self): url = 'mysql://root:zy123456@localhost/wiki?charset=utf8' self.db...
337
146
import distutils from setuptools import setup try: from kervi.platforms.windows.version import VERSION except: VERSION = "0.0" try: distutils.dir_util.remove_tree("dist") except: pass setup( name='kervi-hal-win', version=VERSION, packages=[ "kervi/platforms/windows", ], in...
381
135
import argparse import materia as mtr import dask.distributed if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument("--qcenv", type=str) parser.add_argument("--scratch", type=str) parser.add_argument("--dask_scratch", type=str) parser.add_argument("--num_evals", type=int...
877
342
# -*- coding: utf-8 -*- """Top-level package for simple.""" __author__ = """John Bridstrup""" __email__ = 'john.bridstrup@gmail.com' __version__ = '0.1.8' # import Data # import data_analysis # import kernels # import KMC # import running # import simple # import simulations # import statevector
300
108
# from traceback import TracebackException from django.contrib.auth.forms import UserCreationForm # from django.contrib.auth.models import User from django.contrib.auth import login, authenticate from django.contrib.auth.decorators import login_required from django.core.paginator import Paginator, EmptyPage, PageNotAn...
13,482
3,992
import discord import utils import inspect from discord.ext import commands from io import StringIO class Misc(commands.Cog): """Commands that show info about the bot""" def __init__(self, bot: utils.CustomBot): self.bot: utils.CustomBot = bot @commands.command(aliases=['i', 'ping']) async ...
3,683
1,138
""" Setup. python setup.py build_ext --inplace """ from distutils.core import setup from Cython.Build import cythonize setup(ext_modules=cythonize('splay_tree.pyx'))
171
63
from WebApp.mainapp import app import dash_html_components as html import flask from REST_API.rest_api import API from WebApp.Layout import Layout app.layout = Layout() app.server.register_blueprint(API) server = app.server if __name__ == '__main__': # app.run_server(debug=False, host='0.0.0.0', port=90) app....
343
119
''' Leia 2 valores inteiros (A e B). Após, o programa deve mostrar uma mensagem "Sao Multiplos" ou "Nao sao Multiplos", indicando se os valores lidos são múltiplos entre si. ''' data = str(input()) values = data.split(' ') first_value = int(values[0]) second_value = int(values[1]) if(second_value > first_value): ...
719
247
import re from slack_bolt import App from app.onboarding import ( message_multi_users_select, message_multi_users_select_lazy, ) from app.tutorials import ( tutorial_page_transition, tutorial_page_transition_lazy, app_home_opened, app_home_opened_lazy, page1_home_tab_button_click, page...
2,767
973
import nltk import re from nltk.corpus import wordnet # This method reads the file and redacts names in it and writes redacted data to file with extension python3.redacted def redactNames(path): data = open(path).read() # Reading the file to be redacted tokenized_data = nltk.word_tokenize(data) # Sp...
1,213
392
# Space : O(n) # Time : O(m*n) class Solution: def crawl(self, grid, x, y): def bfs(dx, dy): nonlocal area if grid[dy][dx] == 1: area += 1 grid[dy][dx] = 0 elif grid[dy][dx] == 0: return for ax, ay in c...
935
334
import os from datetime import datetime import time import pandas as pd from datasets.linear import LinearProblem from regresion.linear.feature import PolFeatures from regresion.linear.linear import LinearRegression class ParkingProblem(LinearProblem): def dataset_title(self) -> str: return "Parking" ...
1,000
318
from output.models.nist_data.atomic.name.schema_instance.nistschema_sv_iv_atomic_name_max_length_1_xsd.nistschema_sv_iv_atomic_name_max_length_1 import NistschemaSvIvAtomicNameMaxLength1 __all__ = [ "NistschemaSvIvAtomicNameMaxLength1", ]
244
97
""" 1. Normalizing the entire dataset with mean and variance, shuffle, compression=9 runs for more than 8 hours on ocelote and results in a file of more than 150GB. 2. Try normalizing with only variance and without shuffle. """ import os.path import sys import time import h5py import numpy as np def calculate_...
4,888
1,622
from flask_restful import fields from .custom import Num, EdgeUrl, PaginateUrl getCommentField = { "id": fields.Integer, "time": fields.DateTime(attribute="timestamp"), "author_name": fields.String(attribute="username"), "article_id": fields.Integer(attribute="postid"), "body": fields.String, "...
780
247
from django import template from faq.forms import FaqInstanceForm, FaqAnswerForm from faq.models import FaqInstance, FaqAnswer register = template.Library() @register.inclusion_tag('faq/jagdreisencheck/create-question-form.html', takes_context=True) def create_question_form(context, model, identifier): form = ...
1,132
336
# flake8: noqa """ MarkFlow MarkDown Section Detection Library This library provide this functions MarkFlow uses to split a document into it's individual text types. """ from .atx_heading import * from .blank_line import * from .block_quote import * from .fenced_code_block import * from .indented_code_block import * f...
486
144
from django import forms from apps.forms import FormMixin from django.core import validators from .models import User from django.core.cache import cache class LoginForm(forms.Form,FormMixin): telephone = forms.CharField(max_length=11,min_length=11) password = forms.CharField(max_length=30,min_length=6,error_me...
2,129
833
import pytest from receives.receiver import Receiver @pytest.fixture def receive(): receiver = Receiver() yield receiver receiver.finalize()
156
47
import json import logging from django.core.exceptions import ValidationError from django.db import transaction from django.forms import DateField, CharField import requests import requests.exceptions from . import models from contracts.crawler_forms import EntityForm, ContractForm, \ TenderForm, clean_place, Pr...
18,099
5,292
""" Precisely APIs Enhance & enrich your data, applications, business processes, and workflows with rich location, information, and identify APIs. # noqa: E501 The version of the OpenAPI document: 11.9.3 Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F4...
36,251
10,138
from .api_handler import DefaultFourHundredResponse from .api_keys import ApiKeys from .xray import XRay
105
32
import copy import json import os from unittest.mock import MagicMock, call from bravado.client import SwaggerClient import bravado.exception from bravado_falcon import FalconHttpClient import falcon import pytest import pytest_falcon.plugin import responses import yaml from data_acquisition.acquisition_request impor...
7,392
2,524
import sys import platform from neo4j import ServiceUnavailable from GraphOfDocs.neo4j_wrapper import Neo4jDatabase from GraphOfDocs.utils import generate_words, read_dataset, clear_screen from GraphOfDocs.parse_args import parser from GraphOfDocs.create import * def graphofdocs(create, initialize, dirpath, wi...
4,216
1,180
# # Autogenerated by Frugal Compiler (3.4.3) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # from threading import Lock from frugal.middleware import Method from frugal.exceptions import TApplicationExceptionType from frugal.exceptions import TTransportExceptionType from frugal.processor impo...
27,144
7,971
# 279. Perfect Squares # Runtime: 60 ms, faster than 96.81% of Python3 online submissions for Perfect Squares. # Memory Usage: 14.7 MB, less than 42.95% of Python3 online submissions for Perfect Squares. class Solution: # Greedy Enumeration def numSquares(self, n: int) -> int: square_nums = set([i *...
886
289
""" Definitions for Card, Suit, Pip, etc. WARN: DO NOT CHANGE THE ENUMS IN THIS FILE! Changing the values might affect the ordering of the state/action space of agents, and will break compatibility with previously saved model checkpoints. """ from enum import IntEnum class Suit(IntEnum): schellen = 0 herz =...
1,650
577
MAX_COPIES = 2 RECV_SIZE = 1024 SEND_SIZE = 1024 SERVER_IP = "172.24.1.107" SERVER_PORT = 10000 def recv_line(conn): data = "" data += conn.recv(RECV_SIZE) # data += conn.recv(RECV_SIZE).decode("utf-8") return data def make_request(entity_type, type, filename = None, auth = None, filesize = None, ip ...
2,720
978
def repeat(srcs, convs, tags): new_src = [] new_conv = [] new_tag = [] print("size before repeat: " + str(len(srcs))) for i in zip(srcs, convs, tags): tag_list = i[2].split(";") for j in range(len(tag_list)): new_src.append(i[0]) new_conv.append(i[1]) ...
1,361
528
import mock def test_index_template(app, client, db, captured_templates): res = client.get('/') assert res.status_code == 200 template, context = captured_templates[0] assert template.name == "index.html" @mock.patch("taste_dive.main.routes.get_movies", mock.MagicMock(return_value=[{"Title": "Fast &...
1,540
543
"""Script that establishes a session in a wireless network managed by Cisco Web Authentication. This script requests for re-establishing a session in a wireless network managed by Cisco Web Authentication. Copyright 2013 Dario B. darizotas at gmail dot com This software is licensed under a new BSD License. Unported...
5,711
1,602
from django.urls import path from qr_code import views app_name = 'qr_code' urlpatterns = [ path('images/serve-qr-code-image/', views.serve_qr_code_image, name='serve_qr_code_image') ]
192
76
""" Stable Marriage Problem solution using Gale-Shapley. Copyright 2020. Siwei Wang. """ # pylint: disable=no-value-for-parameter from typing import Optional from click import command, option, Path from read_validate import get_smp from marriage import compute_smp from write import print_results @command() @option('...
974
315
import pysam import json import bisect import subprocess def LoadFragmentMap(RestrSitesMap): FragmentMap = {} with open(RestrSitesMap, 'rt') as MapFile: for Contig in MapFile: List = Contig[:-1].split(' ') FragmentMap[List[0]] = [int(item) for item in List[1:]] return FragmentMap def CalcDist(Item1, Item2)...
7,908
3,257
# https://open.kattis.com/problems/carrots import sys print sys.stdin.read().split()[1]
95
43
from abc import ABC, abstractmethod from typing import Any, List, Optional import pandas as pd from yacht.config import Config class Transform(ABC): @abstractmethod def __call__(self, sample: Any) -> Any: pass class Compose(Transform): def __init__(self, transforms: List[Transform]): s...
1,799
560
import csv import logging import os import discord from discord.ext import commands, tasks from discord.utils import get # logging config logging.basicConfig( filename=".log/reg.log", format="%(asctime)s - %(message)s", level=logging.INFO, datefmt="%d-%b-%y %H:%M:%S", ) # set up channel ids and enviro...
4,088
1,307
#!/usr/bin/env python # skeleton from http://kmkeen.com/socketserver/2009-04-03-13-45-57-003.html import socketserver, subprocess, sys from threading import Thread from pprint import pprint import json my_unix_command = ['bc'] HOST = 'localhost' PORT = 12321 with open('storage.json') as data_file: JSONdata = js...
1,551
456
from keycloakclient.aio.mixins import WellKnownMixin from keycloakclient.openid_connect import ( KeycloakOpenidConnect as SyncKeycloakOpenidConnect, PATH_WELL_KNOWN, ) __all__ = ( 'KeycloakOpenidConnect', ) class KeycloakOpenidConnect(WellKnownMixin, SyncKeycloakOpenidConnect): def get_path_well_know...
360
134
""" Handles operator precedence. """ from jedi._compatibility import unicode from jedi.parser import representation as pr from jedi import debug from jedi.common import PushBackIterator from jedi.evaluate.compiled import CompiledObject, create, builtin from jedi.evaluate import analysis class PythonGrammar(object): ...
9,987
2,996
#!/usr/bin/env python __author__ = 'Will Kamp' __copyright__ = 'Copyright 2013, Matrix Mariner Inc.' __license__ = 'BSD' __email__ = 'will@mxmariner.com' __status__ = 'Development' # 'Prototype', 'Development', or 'Production' import os class MapPathSearch: def __init__(self, directory, map_extensions=['kap', ...
1,967
571
class Style: def __init__(self, parent_styles=None, color=(0, 0, 0, 0), hover_color=None, click_color=None, disabled_color=None, border_color=None, border_line_w=0, fade_in_time=0...
1,585
498
"""Command line interface for fsh-validator.""" import os import sys import argparse from pathlib import Path import yaml from .fsh_validator import ( print_box, run_sushi, validate_all_fsh, validate_fsh, download_validator, bcolors, VALIDATOR_BASENAME, store_log, assert_sushi_instal...
5,041
1,592
def read_input(): try: data = input().replace(" ", "") # take the input and remove the extra spaces input_array = data.split(",") # split the sub substring input_array[-1] = input_array[-1][:-1] array = [] for el in input_array: array.append(float(el)) # conv...
475
134