text
string
size
int64
token_count
int64
#!/usr/bin/env python from __future__ import unicode_literals # Allow direct execution import os import sys import unittest sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from haruhi_dl.aes import aes_decrypt, aes_encrypt, aes_cbc_decrypt, aes_cbc_encrypt, aes_decrypt_text from haruh...
2,361
990
import dash_core_components as dcc import dash_html_components as html import dash_bootstrap_components as dbc def generate_simulation_procedure(): return html.Div([ # instruction button to notify the user how to use the simulation tool dcc.Markdown(children='''There are three panels on the right:...
14,566
3,760
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. # This test is based on the test suite implemented for Recommenders project # https://github.com/Microsoft/Recommenders/tree/master/tests import papermill as pm import pytest import scrapbook as sb from utils_cv.common.data...
4,046
1,483
_base_ = [ '../retinanet_r50_fpn_1x_coco.py', '../../_base_/datasets/hdr_detection_minmax_glob_gamma.py', ] # optimizer # lr is set for a batch size of 8 optimizer = dict(type='SGD', lr=0.0005, momentum=0.9, weight_decay=0.0001) optimizer_config = dict(grad_clip=None) # dict(grad_clip=dict(max_norm=35, norm_t...
524
236
"""Placeholder/template for staging envs."""
45
14
from cognito.check import Check from cognito.table import Table import os import pytest import pandas as pd import numpy as np from os import path from sklearn import preprocessing
182
47
from reportlab.lib.units import inch from reportlab.platypus import SimpleDocTemplate, Spacer from reportlab.rl_config import defaultPageSize from reportlab.lib.units import inch from reportlab.platypus.flowables import Flowable def generate_order(job, path, door_style, doors=[], drawers=[]): PAGE_HEIGHT = defaul...
14,585
5,380
from app.bq_service import BigQueryService if __name__ == "__main__": bq_service = BigQueryService() bq_service.migrate_daily_bot_probabilities_table() print("MIGRATION SUCCESSFUL!")
201
76
from copy import deepcopy from dataclasses import asdict, dataclass from enum import IntEnum from colosseum.utils.random_vars import deterministic, get_dist try: from functools import cached_property except: from backports.cached_property import cached_property from typing import Any, Dict, List, Tuple, Type...
12,063
3,676
#coding:utf-8 # # id: bugs.core_6266 # title: Deleting records from MON$ATTACHMENTS using ORDER BY clause doesn't close the corresponding attachments # decription: # Old title: Don't close attach while deleting record from MON$ATTACHMENTS using ORDER BY clause. # ...
3,258
1,182
from bs4 import BeautifulSoup import logging import pandas as pd import csv import re import requests from urllib.parse import urljoin logging.basicConfig(format="%(asctime)s %(levelname)s:%(message)s", level=logging.INFO) def get_html(url): return requests.get(url).text class SenateCrawler: def __init__(...
1,276
401
from test_plus.test import TestCase from ...administrative_units.factories import AdministrativeUnitFactory from ...cases.factories import CaseFactory from ...channels.factories import ChannelFactory from ...events.factories import EventFactory from ...features.factories import FeatureFactory, FeatureOptionFactory fro...
4,173
1,248
from typing import Any, List from ..actions.iaction import IAction from ..model.state import LennyBotState class LennyBotPlan: def __init__(self, state: LennyBotState, actions: List[IAction]) -> None: self._state = state self._actions = actions @property def applications(self) -> List...
1,085
284
# -*- coding: utf-8 -*- """ Lacework Container Registries API wrapper. """ import logging logger = logging.getLogger(__name__) class ContainerRegistriesAPI(object): """ Lacework Container Registries API. """ def __init__(self, session): """ Initializes the ContainerRegistriesAPI obj...
6,101
1,529
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/01_seq2seq.ipynb (unless otherwise specified). __all__ = ['Encoder', 'NewDecoder', 'Seq2Seq'] # Cell from torch import nn from torch import optim import torch import torch.nn.functional as F from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence # Ce...
10,024
3,240
import json import re import responses from werkzeug.test import Client from werkzeug.wrappers import Response from satosa.proxy_server import make_app from satosa.satosa_config import SATOSAConfig class TestConsent: def test_full_flow(self, satosa_config_dict, consent_module_config): api_url = "https:/...
1,994
629
# Copyright 2022 Quantapix 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 required by applicable l...
18,072
6,639
import argparse import glob import os import pickle from pathlib import Path import numpy as np from PIL import Image from tqdm import tqdm from src.align.align_trans import get_reference_facial_points, warp_and_crop_face # sys.path.append("../../") from src.align.detector import detect_faces if __name__ == "__main...
3,429
1,094
from srtvoiceext import extract if __name__ == '__main__': ext = extract('video.mkv', 'subtitles.srt', 'outdir')
117
43
import collections class ReadOnlyDict(collections.MutableMapping): def __init__(self, store): self.store = store def __getitem__(self, key): return self.store[key] def __setitem__(self, key, value): raise TypeError('Cannot modify ReadOnlyDict') def __delitem__(self, ke...
632
184
# encoding: utf-8 import urwid import time, os, copy from rpg_game.utils import log, mod, distance from rpg_game.constants import * from urwid import raw_display SIZE = lambda scr=raw_display.Screen(): scr.get_cols_rows() MIN_HEADER_HEIGHT = 3 MAX_MENU_WIDTH = 48 FOOTER_HEIGHT = 4 PALETTE = [ ("line",...
25,699
8,343
from numpy import inf, nan from sklearn.linear_model import LinearRegression as Op from lale.docstrings import set_docstrings from lale.operators import make_operator class LinearRegressionImpl: def __init__(self, **hyperparams): self._hyperparams = hyperparams self._wrapped_model = Op(**self._hy...
4,851
1,377
import numpy as np from keras.applications.inception_v3 import InceptionV3 from keras.initializers import RandomNormal from keras.layers import (BatchNormalization, Conv2D, Conv2DTranspose, Conv3D, Cropping2D, Dense, Flatten, GlobalAveragePooling2D, Input, Lambda, Max...
12,689
4,693
#!/bin/env python """Drop and create a new database with schema.""" from sqlalchemy_utils.functions import database_exists, create_database, drop_database from flunkybot.db import engine, base from flunkybot.models import * # noqa db_url = engine.url if database_exists(db_url): drop_database(db_url) create_datab...
386
127
#!/usr/bin/env python # -*- coding: utf-8 -*- import os from setuptools import find_packages, setup from app import __version__ # get the dependencies and installs here = os.path.abspath(os.path.dirname(__file__)) with open(os.path.join(here, 'requirements.txt')) as f: all_requirements = f.read().split('\n') set...
1,309
480
# # Python documentation build configuration file # # This file is execfile()d with the current directory set to its containing dir. # # The contents of this file are pickled, so don't put values in the namespace # that aren't pickleable (module imports are okay, they're removed automatically). import sys, os, time sy...
6,038
1,936
# Import the matplotlib module here. No other modules should be used. # Import plotting library import matplotlib.pyplot as plt #import.... from os import * # Import Numpy import numpy as np def mean(my_list): # This is the defintion in the head. i = 0 my_sum = 0 for number in my_list: my_sum ...
2,178
821
"""This script renames the forthcoming section in changelog files with the upcoming version and the current date""" from __future__ import print_function import argparse import datetime import docutils.core import os import re import sys from catkin_pkg.changelog import CHANGELOG_FILENAME, get_changelog_from_path fr...
4,987
1,481
import os import unittest import torch import torch.distributed as dist from torch.multiprocessing import Process import torch.nn as nn from machina.optims import DistributedAdamW def init_processes(rank, world_size, function, backend='tcp'): os.environ['MASTER_ADDR'] = '127.0.0.1' os.env...
1,199
359
""" Squeak model. W_Object W_SmallInteger W_MutableSmallInteger W_AbstractObjectWithIdentityHash W_AbstractFloat W_Float W_MutableFloat W_Character W_PointersObject W_AbstractObjectWithClassReference ...
870
234
# This code is referenced from # https://github.com/facebookresearch/astmt/ # # Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # License: Attribution-NonCommercial 4.0 International import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.modules.module import Modu...
6,352
2,148
from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt from matplotlib import cm import numpy as np import os import contorno from constantes import INTERVALOS, PASSOS, TAMANHO_BARRA, DELTA_T, DELTA_X z_temp = contorno.p_3 TAMANHO_BARRA = 2 x = np.linspace(0.0, TAMANHO_BARRA, INTERVALOS+1) y = np.lin...
826
411
# solution 1: class Solution1: def convert(self, s: str, numRows: int) -> str: if numRows == 1 or numRows >= len(s): return s L = [''] * numRows index, step = 0, 1 for x in s: L[index] += x if index == 0: step = 1 ...
1,406
420
# -*- coding: utf-8 -*- """ Created on Thu Feb 11 13:42:45 2021 @author: ASUS """ import pandas as pd df = pd.read_csv(r'D:\nlp\fake-news-data\train.csv') df = df.dropna() X = df.drop('label',axis = 1) y = df['label'] import tensorflow as tf from tensorflow.keras.layers import Embedding, Dense, LSTM from tensorflo...
2,013
764
import sys from class_vis import prettyPicture from prep_terrain_data import makeTerrainData import matplotlib.pyplot as plt import copy import numpy as np import pylab as pl features_train, labels_train, features_test, labels_test = makeTerrainData() ########################## SVM ###################...
860
263
# Copyright (c) 2021 PaddlePaddle 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 required by applic...
1,890
602
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from builtins import open from builtins import str from future import standard_library standard_library.install_aliases() try: from queue i...
4,408
1,300
import copy import itertools from functools import partial from typing import Any, Iterable, List, Optional, Set, Tuple, Type from isort.format import format_simplified from . import parse, sorting, wrap from .comments import add_to_line as with_comments from .identify import STATEMENT_DECLARATIONS from .settings imp...
26,267
6,573
import datetime import io import json_tricks import logging import os from os.path import (abspath, basename, dirname, exists, expanduser, join, realpath, relpath, splitext) import re import shutil import sys from traits.api import (Any, Dict, Enum, HasTraits, Instance, List, Long, ...
24,928
7,416
"""This submodule contains a JSON reference translator.""" __author__ = 'Štěpán Tomsa' __copyright__ = 'Copyright © 2021 Štěpán Tomsa' __license__ = 'MIT' __all__ = () import prance.util.url as _url def _reference_key(ref_url, item_path): """ Return a portion of the dereferenced URL. format - ref-url_o...
5,659
1,539
from io import StringIO from unittest import TestCase from dropSQL.parser.streams import * class StreamTestCase(TestCase): def test(self): s = '12' cs = Characters(StringIO(s)) ch = cs.peek().ok() self.assertEqual(ch, '1') ch = cs.peek().ok() self.assertEqual(ch,...
800
283
import os import filecmp import unittest import numpy as np from openql import openql as ql from utils import file_compare curdir = os.path.dirname(os.path.realpath(__file__)) output_dir = os.path.join(curdir, 'test_output') class Test_bugs(unittest.TestCase): @classmethod def setUp(self): ql.initiali...
3,501
1,280
#!/usr/bin/python """Looks for sensor on the bus and changes it's address to the one specified on command line""" import argparse import minimalmodbus import serial from time import sleep parser = argparse.ArgumentParser() parser.add_argument('address', metavar='ADDR', type=int, choices=range(1, 248), help='An ad...
1,530
582
# coding: utf-8 import os import pickle import shutil import tempfile import unittest import ray from ray import tune from ray.rllib import _register_all from ray.tune import Trainable from ray.tune.utils import validate_save_restore class SerialTuneRelativeLocalDirTest(unittest.TestCase): local_mode = True ...
6,577
2,111
MANIFEST = { "hilt": { "h1": { "offsets": {"blade": 0, "button": {"x": (8, 9), "y": (110, 111)}}, "colours": { "primary": (216, 216, 216), # d8d8d8 "secondary": (141, 141, 141), # 8d8d8d "tertiary": (180, 97, 19), # b46113 ...
4,291
1,795
import numpy as np import pytest import theano import theano.tensor as tt # Don't import test classes otherwise they get tested as part of the file from tests import unittest_tools as utt from tests.gpuarray.config import mode_with_gpu, mode_without_gpu, test_ctx_name from tests.tensor.test_basic import ( TestAll...
21,788
8,142
# coding: spec from interactor.commander.store import store, load_commands from photons_app.mimic.event import Events from photons_app import helpers as hp from photons_canvas.points.simple_messages import Set64 from unittest import mock import pytest @pytest.fixture() def store_clone(): load_commands() r...
9,238
2,774
from pytube import YouTube def download_video(watch_url): yt = YouTube(watch_url) (yt.streams .filter(progressive=True, file_extension='mp4') .order_by('resolution') .desc() .first() .download())
245
79
# Copyright 2015 Open Source Robotics Foundation, 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...
5,741
1,587
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import torch from neuralcompression.functional import soft_round, soft_round_inverse def test_soft_round_inverse(): x = torch.linspac...
870
349
from easydict import EasyDict hopper_ppo_default_config = dict( env=dict( env_id='HopperMuJoCoEnv-v0', norm_obs=dict(use_norm=False, ), norm_reward=dict(use_norm=False, ), collector_env_num=8, evaluator_env_num=10, use_act_scale=True, n_evaluator_episode=10, ...
1,738
610
import json from cisco_sdwan_policy.BaseObject import BaseObject class Application(BaseObject): def __init__(self,name,app_list,is_app_family,id=None,reference=None,**kwargs): self.type = "appList" self.id = id self.name = name self.references = reference self.app_family=...
1,519
445
"""DNS docker object.""" import logging from ..const import ENV_TIME from ..coresys import CoreSysAttributes from .interface import DockerInterface _LOGGER: logging.Logger = logging.getLogger(__name__) DNS_DOCKER_NAME: str = "hassio_dns" class DockerDNS(DockerInterface, CoreSysAttributes): """Docker Supervisor...
1,575
468
# Copyright 2019, Kay Hayen, mailto:kay.hayen@gmail.com # # Part of "Nuitka", an optimizing Python compiler that is compatible and # integrates with CPython, but also works on its own. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in complianc...
2,927
1,024
import sys from dagster import check from dagster.config.validate import validate_config_from_snap from dagster.core.host_representation import ExternalPipeline, PipelineSelector, RepositorySelector from dagster.core.workspace.context import BaseWorkspaceRequestContext from dagster.utils.error import serializable_erro...
6,130
1,699
import os from tempfile import TemporaryDirectory from quickbase_client.utils.pywriting_utils import BasicPyFileWriter from quickbase_client.utils.pywriting_utils import PyPackageWriter class TestBasicFileWriter: def test_outputs_lines(self): w = BasicPyFileWriter() w.add_line('import abc') ...
1,552
532
""" Residual Networks (ResNet) """ # adapted from # https://github.com/fchollet/deep-learning-models/blob/master/resnet50.py import tensorflow as tf def identity_block( input_tensor, filters, stage, block, train_bn=False ): """ Builds an identity shortcut...
7,268
2,588
from rds_log_cat.parser.parser import Parser, LineParserException class Mysql57(Parser): def __init__(self): Parser.__init__(self) def compose_timestamp(self, datetime, timezone): if len(datetime) != 27: raise LineParserException('wrong length of datetime - wrong date is: ' + dat...
1,060
302
from functools import partial from corpustools.corpus.classes import Word from corpustools.symbolsim.edit_distance import edit_distance from corpustools.symbolsim.khorsi import khorsi from corpustools.symbolsim.phono_edit_distance import phono_edit_distance from corpustools.symbolsim.phono_align import Aligner from co...
16,090
4,612
# Generated by Django 2.1.1 on 2018-11-06 17:19 from django.conf import settings from django.db import migrations class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('brokenChains', '0002_auto_20181106_1723'), ] operations ...
456
165
import gym import numpy as np from itertools import product import matplotlib.pyplot as plt def print_policy(Q, env): """ This is a helper function to print a nice policy from the Q function""" moves = [u'←', u'↓',u'→', u'↑'] if not hasattr(env, 'desc'): env = env.env dims = env.desc.shape ...
5,046
2,029
# Generated by Django 3.0.4 on 2020-07-14 11:00 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ("core", "0026_auto_20200713_1535"), ("ai_lab", "0002_ailabusecase"), ] operations = [ migrations.Cre...
1,189
341
from .BaseRequest import BaseRequest class UpdateWorkbookConnectionRequest(BaseRequest): """ Update workbook connection request for sending API requests to Tableau Server. :param ts_connection: The Tableau Server connection object. :type ts_connection: class :param server_add...
3,258
786
# -*- coding: utf-8 -*- # Copyright (c) 2019, Frappe Technologies and Contributors # License: MIT. See LICENSE import unittest import frappe from frappe.utils import set_request from frappe.website.serve import get_response test_dependencies = ["Blog Post"] class TestWebsiteRouteMeta(unittest.TestCase): def test_m...
1,116
425
import numpy as np from .VariableUnitTest import VariableUnitTest from gwlfe.MultiUse_Fxns.Runoff import AgRunoff class TestAgRunoff(VariableUnitTest): # @skip("not ready") def test_AgRunoff(self): z = self.z np.testing.assert_array_almost_equal( AgRunoff.AgRunoff_f(z.NYrs, z.Day...
644
257
# Lint as: python3 # Copyright 2019 The TensorFlow 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 ...
3,397
1,029
import oblate import numpy as np import pytest # TODO!
56
19
# -*- coding: utf-8 -*- # @Filename : take_snapshot.py # @Date : 2019-07-15-13-44 # @Project: ITC-sniff-for-changes-in-directory # @Author: Piotr Wołoszyn # @Website: http://itcave.eu # @Email: contact@itcave.eu # @License: MIT # @Copyright (C) 2019 ITGO Piotr Wołoszyn # Generic imports import os import pickle import...
2,167
724
# Copyright 2020, Kay Hayen, mailto:kay.hayen@gmail.com # # Part of "Nuitka", an optimizing Python compiler that is compatible and # integrates with CPython, but also works on its own. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in complianc...
7,221
1,922
import math import pytest import chainerx def _check_cast_scalar_equals_data(scalar, data): assert bool(scalar) == bool(data) assert int(scalar) == int(data) assert float(scalar) == float(data) all_scalar_values = [ -2, 1, -1.5, 2.3, True, False, float('inf'), float('nan')] @pytest.mark.parametr...
6,298
2,829
import sys import pygame from app_window import App_window from button import Button from snake import Snake from food import Food from settings import WIDTH, HEIGHT, FONT, BG_COL, QUIT_BUTTON_COLOUR, PLAY_BUTTON_COLOUR, BLACK, FPS, RED class App: def __init__(self): pygame.init() self.clock = pyg...
8,265
2,360
from pupa.utils import fix_bill_id from opencivicdata.legislative.models import (Bill, RelatedBill, BillAbstract, BillTitle, BillIdentifier, BillAction, BillActionRelatedEntity, BillSponsorship, BillSource, BillDocument, ...
4,697
1,295
from sklearn.metrics import f1_score,accuracy_score import numpy as np from utilities.tools import load_model import pandas as pd def predict_MSRP_test_data(n_models,nb_words,nlp_f,test_data_1,test_data_2,test_labels): models=[] n_h_features=nlp_f.shape[1] print('loading the models...') for i in range...
2,099
814
# coding=utf-8 import logging import traceback from os import makedirs from os.path import exists, join from textwrap import fill import matplotlib.patheffects as PathEffects import matplotlib.pyplot as plt import numpy as np import seaborn as sns from koino.plot import big_square, default_alpha from matplotlib import...
6,799
2,473
import typing nt = typing.NamedTuple("name", [("field", str)])
63
22
#!/usr/bin/env python # -*- coding: utf-8 -*- # import web import time from bson.objectid import ObjectId from config import setting import helper db = setting.db_web # 删除聊天规则 url = ('/plat/index_news_remove') class handler: def GET(self): if not helper.logged(helper.PRIV_USER, 'TALKBOT'): ...
637
238
#!/usr/bin/env python # encoding: utf-8 # # Copyright SAS Institute # # 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 b...
3,504
934
from CommonServerPython import * ''' IMPORTS ''' import re import requests # Disable insecure warnings requests.packages.urllib3.disable_warnings() ''' GLOBALS/PARAMS ''' VENDOR = 'Have I Been Pwned? V2' MAX_RETRY_ALLOWED = demisto.params().get('max_retry_time', -1) API_KEY = demisto.params().get('api_key') USE_SS...
12,017
3,966
from moshmosh.extension import Extension from moshmosh.ast_compat import ast class PipelineVisitor(ast.NodeTransformer): """ `a | f -> f(a)`, recursively """ def __init__(self, activation): self.activation = activation def visit_BinOp(self, n: ast.BinOp): if n.lineno in self.activ...
817
255
import argparse import os import r2pipe import struct import mmap import base64 from shutil import copyfile import pprint pp = pprint.PrettyPrinter(indent=4) def precompute_hash(r2, offset, size): print('Precomputing hash') h = 0 print("r2 command to get the function body in base64:\np6e {}@{}".format(siz...
3,641
1,143
# Generated by Django 2.2.15 on 2021-01-29 20:20 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('sitewebapp', '0010_auditionanswers_auditionquestions_audtionrounds_candidates'), ] operations = [ migratio...
1,074
334
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2016, Julien Stroheker <juliens@microsoft.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_ve...
6,420
1,778
import inspect import json import os import random import subprocess import time import requests import ast import paramiko import rancher from rancher import ApiError from lib.aws import AmazonWebServices DEFAULT_TIMEOUT = 120 DEFAULT_MULTI_CLUSTER_APP_TIMEOUT = 300 CATTLE_TEST_URL = os.environ.get('CATTLE_TEST_URL'...
40,433
12,883
# Given a string containing just the characters '(', ')', '{', '}', '[' and ']', # determine if the input string is valid. # An input string is valid if: # Open brackets must be closed by the same type of brackets. # Open brackets must be closed in the correct order. # Note that an empty string is also considered val...
1,195
396
from flask import current_app from sqlalchemy.exc import InterfaceError from sqlalchemy.exc import OperationalError try: from ibutsu_server.db.model import Result IS_CONNECTED = True except ImportError: IS_CONNECTED = False def get_health(token_info=None, user=None): """Get a health report :rty...
1,706
536
"""Bindings for the Barnes Hut TSNE algorithm with fast nearest neighbors Refs: References [1] van der Maaten, L.J.P.; Hinton, G.E. Visualizing High-Dimensional Data Using t-SNE. Journal of Machine Learning Research 9:2579-2605, 2008. [2] van der Maaten, L.J.P. t-Distributed Stochastic Neighbor Embedding http://homepa...
9,200
2,886
# contains any CRUD not related to strictly editing users info and courses info from .views import admin
105
23
r''' This module provides utilities to get the absolute filenames so that we can be sure that: - The case of a file will match the actual file in the filesystem (otherwise breakpoints won't be hit). - Providing means for the user to make path conversions when doing a remote debugging session in ...
22,787
6,870
import os import socket from random import randint from src import Constants from src.Constants import Network from src.networking import NetworkPackets, Actions from src.networking.Client import Client from src.utils.DH_Encryption import Encryption from src.utils.Enum import Enum class SessionManager: """ T...
5,481
1,583
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: resource_requirements.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from googl...
3,332
1,193
from __future__ import absolute_import, division, print_function import pytest import json import asyncio import stripe import urllib3 from stripe import six, util from async_stripe.http_client import TornadoAsyncHTTPClient pytestmark = pytest.mark.asyncio VALID_API_METHODS = ("get", "post", "delete") class Str...
12,738
4,089
"""\ Provides html file visualization of a json dataset """ import json import subprocess class JsonVis: def _open_list(self): self.instructions.append(('open_list', None)) def _list_item(self, data): self.instructions.append(('list_item', str(data))) def _horiz_rule(self): self....
1,685
478
import sys from PyQt5 import QtGui from PyQt5.QtCore import QEvent, QPoint, Qt from PyQt5.QtGui import QIcon from PyQt5.QtWidgets import (QApplication, QDialog, QGroupBox, QMainWindow, QTabWidget, QVBoxLayout, QWidget) from sim2d_game_analyzer.fmdb_tab import FMDBTab class MainWindow(QM...
1,104
391
# pip install openpyxl # pip install cuid import os.path import json import datetime from openpyxl import load_workbook import cuid # https://github.com/necaris/cuid.py - create uuid's in the format that graphcool expects SOURCE_XLSX = "./data/CLP_combined.xlsx" EXTRACT_OUTPUT_DIR = "../server/extract" SCHOOL_TITL...
12,543
4,401
import os import sys from lxml import html import pathlib import json import m3u8 from seleniumwire import webdriver from selenium.common.exceptions import TimeoutException, NoSuchElementException from selenium.webdriver.firefox.options import Options as FirefoxOptions IFRAME_CSS_SELECTOR = '.iframe-container>iframe'...
6,148
1,901
VERSION = "1.4.0" DATE = "2016-Sept-21"
40
28
import pygame import shared class Explosion(): def __init__(self, images:list, centre:tuple, key:str) -> None: ''' Class variables. key: 'sm', 'lg', 'player ''' self.images = images # list of 8 images self.centre = centre # use for all frames self.key = key # key used later self.image = ...
1,371
571
import sys import threading import logging import time logger = logging.getLogger("interchange.strategy.base") class BaseStrategy(object): """Implements threshold-interval based flow control. The overall goal is to trap the flow of apps from the workflow, measure it and redirect it the appropriate execu...
6,950
1,852
import torch import torchvision import matplotlib import matplotlib.pyplot as plt from PIL import Image from captum.attr import GuidedGradCam, GuidedBackprop from captum.attr import LayerActivation, LayerConductance, LayerGradCam from data_utils import * from image_utils import * from captum_utils import * import nump...
7,409
2,379
from collections import namedtuple Genotype = namedtuple('Genotype', 'normal normal_concat reduce reduce_concat') PRIMITIVES = [ 'none', 'max_pool_3x3', 'avg_pool_3x3', 'skip_connect', 'sep_conv_3x3', 'sep_conv_5x5', 'dil_conv_3x3', 'dil_conv_5x5' ] CRBPRIMITIVES = [ 'max_pool_3x3...
3,713
1,791