text
string
size
int64
token_count
int64
import logging import subprocess logging.basicConfig(level=logging.INFO, format='%(levelname)s: %(name)s: %(message)s (%(asctime)s; %(filename)s:%(lineno)d)', datefmt="%Y-%m-%d %H:%M:%S", ) logger = logging.getLogger(__name__) def get_img_attributes(fname): # ToDo: this sh...
1,056
347
# -*- coding:utf-8 -*- # !/usr/bin/python3.6 from numpy import * import matplotlib import matplotlib.pyplot as plt from matplotlib.patches import Rectangle import logRegress, regIteration dataMat,labelMat=logRegress.loadDataSet() dataArr = array(dataMat) weights = regIteration.stocGradAscent0(dataArr,label...
1,292
625
import json import threading from .distribute_params import run_scan_with_split_params from .distribute_utils import return_current_machine_id, ssh_connect, ssh_file_transfer, ssh_run from .distribute_database import update_db def run_central_machine(self, n_splits, run_central_node): ''' Parameters ----...
2,596
768
# coding: utf-8 # Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. # This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c...
8,063
2,158
import datetime import pandas import collections import argparse from collections import OrderedDict from jinja2 import Environment, FileSystemLoader, select_autoescape from http.server import HTTPServer, SimpleHTTPRequestHandler def get_age(foundation_year): today = datetime.datetime.now() current_year = tod...
2,220
736
expected_output = { "ospf-statistics-information": { "ospf-statistics": { "dbds-retransmit": "203656", "dbds-retransmit-5seconds": "0", "flood-queue-depth": "0", "lsas-acknowledged": "225554974", "lsas-acknowledged-5seconds"...
2,703
846
#!/usr/bin/env python3 # # Copyright (c) 2021 Arled Papa # Author: Arled Papa <arled.papa@tum.de> # # 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...
6,981
3,967
import asyncio import argparse import os from multiprocessing.synchronize import Event from typing import Union, Dict import grpc import zmq.asyncio from .async_call import AsyncPrefetchCall from ... import BasePea from ....zmq import send_message_async, recv_message_async, _init_socket from .....enums import SocketT...
3,531
1,079
from toee import * def OnBeginSpellCast(spell): print "Improvisation OnBeginSpellCast" print "spell.target_list=", spell.target_list print "spell.caster=", spell.caster, " caster.level= ", spell.caster_level def OnSpellEffect(spell): print "Improvisation OnSpellEffect" spell.duration = spell.cast...
895
318
from operator import attrgetter import pyangbind.lib.xpathhelper as xpathhelper from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType from pyangbind.lib.base import PybindBase from d...
131,586
45,117
__author__ = 'Amias Channer <amias.channer@iohk.io> for IOHK' __doc__ = 'Daedalus Testing functions' from .Cardano import * from .Daedalus import * from .Common import *
171
65
from .Layer import * class Multiply(Layer): def __init__(self, models, *args, **kwargs): self.check_inputs(models, 2) Layer.__init__(self, models, *args, **kwargs) def reshape(self): self.Y = np.zeros(self.X[0].shape) def forward(self): self.Y = np.multiply(self.X[0], self.X...
907
337
from project.settings import INSTALLED_APPS, ALLOWED_HOSTS, BASE_DIR import os INSTALLED_APPS.append( 'webpack_loader',) INSTALLED_APPS.append( 'app',) ALLOWED_HOSTS.append('*',) # STATIC_ROOT = os.path.join(BASE_DIR, 'static') STATICFILES_DIRS = [ # os.path.join(BASE_DIR, 'static',) os.path.join(BASE_DIR, ...
581
256
import sys [_, varfile] = sys.argv plotdir = "plots" igvfile = "igv.txt" igvsh = "igv.sh" with open(varfile, 'r') as f: for line in f: dat = line.split('\t') chr = dat[0] start = dat[1] end = dat[2] data = dat[3].split(',')
268
108
# coding: gbk """ @author: sdy @email: sdy@epri.sgcc.com.cn Abstract distribution and generation class """ class ADG(object): def __init__(self, work_path, fmt): self.work_path = work_path self.fmt = fmt self.features = None self.mode = 'all' def distribution_assess(self): ...
691
217
# # The ValidateSigner applies a ChainRatchet to the signature request # and then passes it down to a signer. In order to do this, it must # parse the request and to obtain the level and round to pass to the # ratchet code. import logging from src.sigreq import SignatureReq class ValidateSigner: def __init__(s...
903
288
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Dec 1 17:48:01 2021 @author: bartelsaa """ # boiler plate stuff import re, os, io from glob import glob import pandas as pd import sys import pytz from models import Sensor from datetime import datetime, timezone import pathlib from data_schema import ...
25,766
7,912
import pytest try: import simplejson as json except ImportError: import json from ioflo.aio.http import Valet # import didery.routing from diderypy.lib import generating as gen from diderypy.lib import otping as otp vk, sk, did = gen.keyGen() otpData = { "id": did, "blob": "AeYbsHot0pmdWAcgTo5sD8iA...
3,078
1,294
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed u...
3,722
1,238
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import sys import numpy as np from PyQt5 import QtWidgets as QtWid import pyqtgraph as pg from dvg_pyqtgraph_threadsafe import PlotCurve USE_OPENGL = True if USE_OPENGL: print("OpenGL acceleration: Enabled") pg.setConfigOptions(useOpenGL=True) pg.setConfigO...
1,863
629
import hashlib import hmac from django.conf import settings from django.template.loader import render_to_string from django.utils.crypto import constant_time_compare from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from froide.helper.email_sending import send_mail from .models ...
1,889
566
from turtle import forward, left, right, width, color, clearscreen clearscreen() color("lightblue") width(3) for i in range(6): forward(50) left(60) forward(25) left(180) forward(25) left(60) forward(25) left(180) forward(25) right(120) forward(25) left(180) forwar...
340
151
#!/usr/bin/env python # encoding: utf-8 """ Copyright (c) 2010 The Echo Nest. All rights reserved. Created by Tyler Williams on 2010-04-25. Global configuration variables for accessing the Echo Nest web API. """ __version__ = "4.2.8" import os if('ECHO_NEST_API_KEY' in os.environ): ECHO_NEST_API_KEY = os.envir...
1,185
458
import numpy as np import itertools from .contrib import compress_filter, smooth, residual_model from .contrib import reduce_interferences def expectation_maximization(y, x, iterations=2, verbose=0, eps=None): r"""Expectation maximization algorithm, for refining source separation estimates. This algorith...
18,836
6,143
import csv import datetime import json import re import os import time from typing import List import matplotlib import matplotlib.pyplot as plt from tweepy import OAuthHandler from tweepy import Stream from tweepy.api import API from tweepy.streaming import StreamListener from tweepy.cursor import Cursor from textblo...
9,170
2,714
# coding=utf-8 import logging from subliminal.providers.legendastv import LegendasTVSubtitle as _LegendasTVSubtitle, \ LegendasTVProvider as _LegendasTVProvider, Episode, Movie, guess_matches, guessit, sanitize logger = logging.getLogger(__name__) class LegendasTVSubtitle(_LegendasTVSubtitle): def __init__(...
2,149
641
""" This file must be kept up-to-date with Stripe, especially the slugs: https://manage.stripe.com/plans """ PLANS = {} class Plan(object): def __init__(self, value, slug, display): self.value = value self.slug = slug self.display = display PLANS[slug] = self FREE = Plan(1, 'f...
339
121
from django.shortcuts import render, redirect, get_object_or_404 import json from django.http import HttpResponse, Http404 from django.urls import reverse from django.contrib.auth.decorators import login_required from django.utils import timezone # Create your views here. from socialnetwork.forms import * from soci...
34,864
10,072
from abc import ABC,abstractmethod import os import binascii import subprocess import time import datetime import platform import tempfile import requests import json import aiohttp from sanic import response from asyncinit import asyncinit from errors_module.errors import MnemonicRequiredError from errors_module.err...
24,095
7,609
N = int(input()) S = input() if N % 2 == 1: print('No') exit() if S[:N // 2] == S[N // 2:]: print('Yes') else: print('No')
141
68
#!/usr/bin/python import RPi.GPIO as GPIO import os gpio_pin_number=21 GPIO.setmode(GPIO.BCM) GPIO.setup(gpio_pin_number, GPIO.IN, pull_up_down=GPIO.PUD_UP) try: GPIO.wait_for_edge(gpio_pin_number, GPIO.FALLING) os.system("sudo shutdown -h now") except: pass GPIO.cleanup()
289
143
rows = int(input()) x = [input() for i in range(rows)] print(x)
64
26
""" Run capture as a separate process """ import time from barcap.barcode import BarcodeCapture def main(): # Default camera index camera_index = 0 # Camera selection routine try: from .device_list import select_camera, camera_list # Get camera list dev_list = camera_list()...
1,056
316
#!/usr/bin/env python # # Cloudlet Infrastructure for Mobile Computing # - Task Assistance # # Author: Zhuo Chen <zhuoc@cs.cmu.edu> # # Copyright (C) 2011-2013 Carnegie Mellon University # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the...
6,162
2,499
""" This file contains utilities that bind the Jupyter notebook to our platform. It performs two functions: 1. On startup, pull the contents of the notebook from platform to the local disk 2. As a Jupyter post-save hook, push the contents of the notebook and a HTML preview of the same back to platform. 3. Cus...
5,670
1,710
import os import requests from typing import Optional, List from pydantic import Field, validator from dbt_cloud.command.command import DbtCloudAccountCommand from dbt_cloud.field import JOB_ID_FIELD class DbtCloudJobRunCommand(DbtCloudAccountCommand): """Triggers a dbt Cloud job run and returns a status JSON res...
2,118
577
# Generated by Django 3.0.3 on 2020-10-14 12:25 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('modelzoo', '0023_model_con_mod_dims'), ] operations = [ migrations.RemoveField( model_name='model', name='author_ema...
1,266
379
from __future__ import division from __future__ import print_function from __future__ import absolute_import import os from time import time, localtime, strftime import numpy as np from scipy.io import savemat from dotmap import DotMap from src.modeling.trainers import BNN_trainer from src.misc.DotmapUtils import ge...
5,982
1,652
#!/usr/bin/env python # coding=utf-8 from __future__ import absolute_import from __future__ import division from __future__ import print_function from .activations import * from .losses import * from .initializers import * from .optimizers import *
252
75
import time class processingElement: def __init__(self, name, op, flex, regs, ports, bdwth, route, ctrl, branch): self.name = name self.op = op self.tick = 1 self.ins = [0, 0] self.outs = [None, None] self.flex = flex self.regs = regs self.p...
3,273
1,103
__author__ = 'victor'
22
11
from eblib import libcollect # Create a LibCollect object lc = libcollect.LibCollect() # Prepare arguments for do_collect # # Path to the script (can be absolute or relative) scriptname = 'plotting_data_monitor.pyw' # Ask the resulting distribution to be placed in # directory distrib targetdir = 'distr...
799
233
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance # with the License. A copy of the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "LICENSE.txt" file accom...
3,751
1,101
""" Maintainer script for ruwiki's administrator attention requests table ([[:ru:ВП:ЗКАБ]]). Log file is used for saving "администратор" field in deleted requests. Usage: python fastrfaa.py [logfile] """ import re import sys from datetime import datetime import pywikibot REGEXP = re.compile(r""" (?P<indent>...
7,263
2,551
# Copyright 2021 David Li # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
1,102
344
from operator import attrgetter import pyangbind.lib.xpathhelper as xpathhelper from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType from pyangbind.lib.base import PybindBase from d...
16,502
5,826
import os import sys from typing import Iterable from jinja2 import Environment, FileSystemLoader, Template import config as cfg from . import app_root_dir, doc_root_dir, resource_dir, template_dir _usage = "Usage: generate.py <onprem|aws|gcp|azure|k8s|alibabacloud|oci|programming|saas>" def load_tmpl(tmpl: str) -...
3,253
1,191
import users import sys import encryption import googleDriveAPI u= users e= encryption g= googleDriveAPI #Function to generate menu for privileged (admin) user def privilegeMenu(): try: while True: #Menu system used to navigate the management console user_In = input("|U - Upload fi...
5,023
1,264
# Generated by Django 3.2.8 on 2022-05-31 10:13 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("eap_api", "0004_auto_20220531_0935"), ] operations = [ migrations.AlterField( model_name="eapuser", name="is_active"...
657
198
import torch class TFMSMonochromeTo(torch.nn.Module): def __init__(self, num_dimensions: int = 3): super(TFMSMonochromeTo, self).__init__() if not isinstance(num_dimensions, int): raise TypeError() elif num_dimensions < 2: raise ValueError() self.num_dimensi...
465
152
import unittest import numpy as np from op_test import OpTest def modified_huber_loss_forward(val): if val < -1: return -4 * val elif val < 1: return (1 - val) * (1 - val) else: return 0 class TestModifiedHuberLossOp(OpTest): def setUp(self): self.op_type = 'modified_...
1,027
369
#!/usr/bin/env python # pylint: disable=C0116,W0613 # This program is dedicated to the public domain under the CC0 license. """ First, a few callback functions are defined. Then, those functions are passed to the Dispatcher and registered at their respective places. Then, the bot is started and runs until we press Ctr...
5,626
1,725
"""The WaveBlocks Project Plot some quadrature rules. @author: R. Bourquin @copyright: Copyright (C) 2010, 2011 R. Bourquin @license: Modified BSD License """ from numpy import squeeze from matplotlib.pyplot import * from WaveBlocks import GaussHermiteQR tests = (2, 3, 4, 7, 32, 64, 128) for I in tests: ...
746
331
import os import cv2 import numpy as np import matplotlib.pyplot as plt import scipy ROWS = 64 COLS = 64 CHANNELS = 3 TRAIN_DIR = 'Train_data/' TEST_DIR = 'Test_data/' train_images = [TRAIN_DIR+i for i in os.listdir(TRAIN_DIR)] test_images = [TEST_DIR+i for i in os.listdir(TEST_DIR)] def read_image(file_path): ...
7,141
2,801
""" A module for generating a map with 10 nearest movies """ from data_reader import read_data, select_year from locations_finder import coord_finder, find_nearest_movies from map_generator import generate_map def start(): year = int(input("Please enter a year you would like to have a map for:")) user_location...
798
252
import math import re from typing import List, Dict from wbtools.db.generic import WBGenericDBManager from wbtools.lib.nlp.common import EntityType from wbtools.lib.nlp.literature_index.abstract_index import AbstractLiteratureIndex ALL_VAR_REGEX = r'({designations}|m|p|It)(_)?([A-z]+)?([0-9]+)([a-zA-Z]{{1,4}}[0-9]*)?...
9,003
2,693
"""Test motif.features.bitteli """ import unittest import numpy as np from motif.feature_extractors import bitteli def array_equal(array1, array2): return np.all(np.isclose(array1, array2, atol=1e-7)) class TestBitteliFeatures(unittest.TestCase): def setUp(self): self.ftr = bitteli.BitteliFeatures...
3,228
1,112
class Node(): def __init__(self, value=None): self.children = [] self.parent = None self.value = value def add_child(self, node): if type(node).__name__ == 'Node': node.parent = self self.children.append(node) else: raise ValueErro...
412
117
# Copyright 2016-present CERN – European Organization for Nuclear Research # # 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...
3,436
955
# Generated by Django 2.2.6 on 2019-10-16 02:53 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] ope...
2,643
778
"""Hamming Distance from Exercism""" def distance(strand_a, strand_b): """Determine the hamming distance between two RNA strings param: str strand_a param: str strand_b return: int calculation of the hamming distance between strand_a and strand_b """ if len(strand_a) != len(strand_b): ...
515
170
#def spam(): # eggs = 31337 #spam() #print(eggs) """ def spam(): eggs = 98 bacon() print(eggs) def bacon(): ham = 101 eggs = 0 spam() """ """ # Global variables can be read from local scope. def spam(): print(eggs) eggs = 42 spam() print(eggs) """ """ # Local and global variables with th...
1,384
507
# -*- coding: utf-8 -*- """ # 3D Image Data Synthesis. # Copyright (C) 2021 D. Eschweiler, M. Rethwisch, M. Jarchow, S. Koppers, J. Stegmaier # # 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 Liceense at ...
3,114
1,041
import os import sys import tempfile import unittest sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', 'IDFVersionUpdater')) from VersionUpdaterWindow import VersionUpdaterWindow class TestGetIDFVersion(unittest.TestCase): def setUp(self): self.idf_name = tempfile.mktemp() ...
1,003
354
# https://leetcode.com/problems/minimum-moves-to-equal-array-elements/ # Explanation: https://leetcode.com/problems/minimum-moves-to-equal-array-elements/discuss/93817/It-is-a-math-question # Source: https://leetcode.com/problems/minimum-moves-to-equal-array-elements/discuss/272994/Python-Greedy-Sum-Min*Len class Solu...
421
171
from pyminion.decisions import binary_decision def test_yes_input(monkeypatch): monkeypatch.setattr("builtins.input", lambda _: "y") assert binary_decision(prompt="test") is True def test_no_input(monkeypatch): monkeypatch.setattr("builtins.input", lambda _: "n") assert binary_decision(prompt="test"...
583
197
import utils import functions as func from commands.base import Cmd help_text = [ [ ("Usage:", "<PREFIX><COMMAND>\n" "<PREFIX><COMMAND> `N`"), ("Description:", "Use when already in a channel - Limit the number of users allowed in your channel to either the current " ...
1,658
568
import errno import os.path import yaml from parameterized import param, parameterized from salt.exceptions import CommandExecutionError from salttesting.mixins import LoaderModuleMockMixin from salttesting.unit import TestCase from salttesting.mock import MagicMock, mock_open, patch import metalk8s_solutions from...
11,548
3,146
#def add(num,num1): # add1=num+num1 # print add1 #add(6,7) #def welcome(): # print "python kaisa lagta h aapko" # print "but please reply na kare aap" #welcome() user = int(raw_input("enter a number")) i = 0 new = [] while i < (user): user1 = int(raw_input("enter a number")) new.append(user1) i = i + 1 print new ...
523
232
from lottocoin import app
29
12
""" This is the views module which encapsulates the backend logic which will be riggered via the corresponding path (url). """ import collections import json import logging from django.conf import settings from django.contrib import messages from django.contrib.auth.decorators import login_required from django.contrib...
30,883
8,961
import datetime import io import json import os import random import traceback import aiohttp from PIL import Image import rin from rin import R from .config import get_api_num, get_config, key_vaildable_query, set_key_invaild quota_limit_time = datetime.datetime.now() def generate_image_struct(): return { 'id'...
8,151
3,632
__author__ = 'meignier' import s4d.clustering.hac_bic import s4d.clustering.hac_clr import s4d.clustering.hac_iv import s4d.clustering.hac_utils import s4d.model_iv from s4d.clustering.cc_iv import ConnectedComponent from s4d.diar import Diar from s4d.segmentation import sanity_check, bic_linear, div_gauss from s4d.vi...
363
156
import dash_bootstrap_components as dbc from dash import html from .util import make_subheading list_group = html.Div( [ make_subheading("ListGroup", "list_group"), dbc.ListGroup( [ dbc.ListGroupItem("No color applied"), dbc.ListGroupItem("The primary it...
1,217
317
# Generated by Django 3.2.3 on 2021-07-15 20:06 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('products', '0003_auto_20210709_0117'), ] operations = [ migrations.AlterField( model_name='category', name='friendly...
865
272
## task_landscape.py ## ## Run RecurJac/FastLip bounds for exploring local optimization landscape ## ## Copyright (C) 2018, Huan Zhang <huan@huan-zhang.com> and contributors ## ## This program is licenced under the BSD 2-Clause License, ## contained in the LICENCE file in this directory. ## See CREDITS for a list of ...
5,967
2,073
import pytest from unittest.mock import MagicMock import logging from ecs_crd.canaryReleaseInfos import CanaryReleaseInfos from ecs_crd.prepareDeploymentContainerDefinitionsStep import PrepareDeploymentContainerDefinitionsStep from ecs_crd.canaryReleaseInfos import ScaleInfos logger = logging.Logger('mock') infos = C...
5,956
1,859
from Sim.A_star.heap import node_heap,heapify_down,heapify_up,extract_min,append_node from math import inf from math import pow # Recibe x, y componentes de la matriz y devuelve la distancia euclideana entre ellos def euclidean_distance(x, y): distance = pow(x[0] - y[0], 2) + pow(x[1] - y[1], 2) distance = p...
4,871
1,821
import setuptools with open("README.md", "r") as fh: long_description = fh.read() setuptools.setup( name="youtube-channel-transcript-api", # Replace with your own username version="0.0.1", author="Daniel Liu", author_email="dcliu@ucdavis.edu", description="A python package the utilizes the You...
919
287
# Given two binary strings, return their sum (also a binary string). # # For example, # a = "11" # b = "1" # Return "100". class Solution: def addBinary(self, a, b): """ :type a: str :type b: str :rtype: str """ la = len(a) lb = len(b) if la >= lb: ...
1,252
377
from fastapi import HTTPException, Query, APIRouter from starlette.requests import Request from starlette.status import HTTP_404_NOT_FOUND from .models import db, Metadata mod = APIRouter() @mod.get("/metadata") async def search_metadata( request: Request, data: bool = Query( False, descript...
2,761
894
from django import forms from django.core import validators from .models import UserInfo class UserInfoForm(forms.ModelForm): class Meta: model = UserInfo fields = [ 'name', 'email', 'phone', 'age', 'gender', 'comment' ...
695
215
# @lc app=leetcode.cn id=54 lang=python3 # # [54] 螺旋矩阵 # # https://leetcode-cn.com/problems/spiral-matrix/description/ # # algorithms # Medium (43.22%) # Total Accepted: 129.4K # Total Submissions: 284.1K # Testcase Example: '[[1,2,3],[4,5,6],[7,8,9]]' # # 给你一个 m 行 n 列的矩阵 matrix ,请按照 顺时针螺旋顺序 ,返回矩阵中的所有元素。 # # # 示例 ...
2,668
1,106
from __future__ import absolute_import from infi.gevent_utils.os import path import sys import os sys.path.append(os.path.dirname(__file__)) from utils import GreenletCalledValidatorTestCase class PathTestCase(GreenletCalledValidatorTestCase): def test_exists(self): self.switch_validator.assert_called(0)...
660
216
#!/usr/bin/env python # Download .mp3 podcast files of Radio Belgrade show Govori da bih te video (Speak so that I can see you) # grab all mp3s and save them with parsed name and date to the output folder import requests import os import time import xml.dom.minidom from urllib.parse import urlparse url = "https://www....
2,951
944
import setuptools setuptools.setup( name='conditional_independence', version='0.1a.4', description='Parametric and non-parametric conditional independence tests.', long_description='', author='Chandler Squires', author_email='chandlersquires18@gmail.com', packages=setuptools.find_packages(e...
830
274
# -*- coding: utf-8 -*- from django.conf.urls import patterns, url from . import views urlpatterns = patterns( '', url(r'feedback$', views.FeedbackView.as_view(), name='feedback-post') )
200
74
# ================================================================= # # Authors: Timo Tuunanen <timo.tuunanen@rdvelho.com> # # Copyright (c) 2019 Timo Tuunanen # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation # files (the "Software"), to de...
6,466
1,796
# -*-coding:utf-8 -*- from openstack import connection # create connection username = "xxxxxx" password = "xxxxxx" projectId = "xxxxxxxxxxxxxxxxxxxxxxxxxxxx" # tenant ID userDomainId = "xxxxxxxxxxxxxxxxxxxxxxxxxxxx" # user account ID auth_url = "xxxxxxxxxxxxxxxxxxxxxxxxxxxx" # endpoint url conn = connection....
1,975
638
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from ... import _utilities fro...
9,060
2,611
########################################################################## # # Copyright (c) 2019, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistrib...
7,795
2,614
from django.utils.deprecation import MiddlewareMixin from django.utils.autoreload import logger class Scheduler(MiddlewareMixin): def process_request(self, request): pass # logger.info(request) def process_response(self, request, response): return response
294
83
#!/usr/bin/env python from __future__ import division import sys from string import ascii_lowercase with open(sys.argv[1]) as f: data = f.read().splitlines() d = {} for line in data: for letter in line: letter = letter.lower() if letter not in ascii_lowercase+' ': continue ...
631
230
import unittest from brightics.function.extraction.encoder import label_encoder, \ label_encoder_model from brightics.common.datasets import load_iris import random def get_iris_randomgroup(): df = load_iris() random_group1 = [] random_group2 = [] random_group2_map = {1:'A', 2:'B'} for i in ra...
946
327
import hashlib import json import logging import re import sqlite3 from typing import List, Optional, Tuple import pystache from redash.models import Query, User from redash.query_runner import TYPE_STRING, guess_type, register from redash.query_runner.query_results import Results, _load_query, create_table from reda...
4,629
1,360
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.db.models.deletion from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('notes', ...
1,111
331
''' Created on 25 Jan 2022 @author: ucacsjj ''' from .airport_map import MapCellType from .airport_map import AirportMap # This file contains a set of functions which build different maps. Only # two of these are needed for the coursework. Others are ones which were # used for developing and testing the algorithms a...
5,479
2,378
from setuptools import setup setup( name='csv_locate', version='0.1', py_modules=['csv_to_json'], install_requires=[ 'click', 'colorama', 'geocoder', 'geojson', 'jinja2', ], entry_points=''' [console_scripts] csv_locate=csv_to_json:convert...
332
118
from flask import Flask from Config import app_config, app_active from flask import render_template from flask_sqlalchemy import SQLAlchemy import Forms import LDB import gGraficos config = app_config[app_active] def create_app(config_name): app = Flask(__name__, template_folder='templates') app.secret_key...
1,600
535
import numpy as np import torch from modules.frustum import get_box_corners_3d from kitti_meters.util import get_box_iou_3d __all__ = ['MeterFrustumKitti'] class MeterFrustumKitti: def __init__(self, num_heading_angle_bins, num_size_templates, size_templates, class_name_to_class_id, metric='iou_...
4,852
1,754