text
string
size
int64
token_count
int64
"""Jenkins source.""" from ..meta.entity import Color, EntityAttributeType from ..parameters import ( access_parameters, Days, FailureType, MultipleChoiceParameter, MultipleChoiceWithAdditionParameter, TestResult, ) from ..meta.source import Source def jenkins_access_parameters(*args, **kwarg...
4,946
1,396
import myouji_kenchi # Given that the output depends on what goes into the attested myouji file I'm # hesitant to write too many tests in the blast radius of changes to that file class TestTransducer(): nbt = myouji_kenchi.MyoujiBackTransliteration() def assert_transliteration(self, romaji, *expected_resul...
3,155
1,177
import unittest from typing import List, Optional # Consider making generic with: # https://stackoverflow.com/a/47970232/4885590 def merge_sort(items: List[int], lo: int = 0, hi: Optional[int] = None) -> None: if hi is None: hi = len(items) - 1 if lo < hi: mid = (lo + hi) // 2 # Range...
1,668
627
from selenium.webdriver.support.wait import WebDriverWait class MainPage: def __init__(self, driver): self.driver = driver self.wait = WebDriverWait(driver, 10) def open(self): self.driver.get("https://litecart.stqa.ru/en/") return self @property def product_item(sel...
392
122
import frrtest class TestNexthopIter(frrtest.TestMultiOut): program = "./test_nexthop_iter" TestNexthopIter.onesimple("Simple test passed.") TestNexthopIter.onesimple("PRNG test passed.")
196
74
# -*- coding: utf-8 -*- from setuptools import setup, find_packages import io import os about = {} about_filename = os.path.join( os.path.dirname(os.path.realpath(__file__)), 'themis', 'finals', 'checker', 'app', '__about__.py') with io.open(about_filename, 'rb') as fp: exec(fp.read(), about) setup( ...
1,319
545
begin_unit comment|'#!/usr/bin/env python' nl|'\n' nl|'\n' comment|'# Copyright 2013 OpenStack Foundation' nl|'\n' comment|'#' nl|'\n' comment|'# Licensed under the Apache License, Version 2.0 (the "License");' nl|'\n' comment|'# you may not use this file except in compliance with the License.' nl|'\n' comment|'# You m...
8,090
3,925
import datetime as dt import importlib.util import inspect import itertools import json import os import pathlib import sys import types import typing from typing import ( Any, Callable, Dict, Generic, Iterable, Iterator, List, Optional, Set, Tuple, Type, TypeVar, Uni...
13,324
3,969
import os import json import uuid from django.conf import settings from django.http import HttpResponse from django.utils.translation import ugettext_lazy as _ from django.views.generic import View import cloudinary class MarkdownImageUploader(View): """ custom image uploader for martor. """ def po...
2,758
765
import datetime from typing import Optional, Type, Generic, List, Tuple from ..base import T from .generic import PersistenceVariable class InMemoryPersistenceVariable(PersistenceVariable, Generic[T]): def __init__(self, type_: Type[T], keep: datetime.timedelta): super().__init__(type_, log=True) ...
1,776
519
# Copyright (c) 2015 Aptira Pty Ltd. # 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...
1,393
401
""" Author: Yiming Mao - mtroym@github Description: Transplant from "https://github.com/xunhuang1995/AdaIN-style/blob/master/train.lua" """ import functools import os from collections import OrderedDict import torch import torch.nn as nn from torchvision.models import vgg19 from datasets.utils import deno...
8,579
2,766
# -*- coding: utf-8 -*- # # 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 ...
1,099
411
# Michael A. Alcorn (malcorn@redhat.com) # An implementation of the Deep Semantic Similarity Model (DSSM) found in [1]. # [1] Shen, Y., He, X., Gao, J., Deng, L., and Mesnil, G. 2014. A latent semantic model # with convolutional-pooling structure for information retrieval. In CIKM, pp. 101-110. # http:/...
7,836
2,763
# Generated by Django 3.0.7 on 2020-10-14 07:46 import django.utils.timezone from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("posthog", "0086_team_session_recording_opt_in"), ] operations = [ migrations.AlterField( model_name...
469
157
""" Create a cartoon of a tumor given the frequencies of different genotypes. """ from .util import * import pandas as pd import matplotlib.pyplot as plt import click import os from pathlib import Path from pymuller import muller @click.command(help="Plot the evolution of a tumor.") @click.argument( "genotype-...
4,723
1,553
class Circular():
23
8
from django.conf.urls import url from .views import get_online_users, set_online app_name = 'online_users' urlpatterns = [ url(r'^so/$', set_online), url(r'^ous/$', get_online_users), ]
196
74
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import argparse import numpy as np import matplotlib as mpl mpl.use('Agg') #silent mode from matplotlib import pyplot as plt from mpl_toolkits.axes_grid1.inset_locator import inset_axes, InsetPosition, zoomed_inset_axes, mark_inset MAXLINE = 10000 class Sp...
5,881
2,230
import argparse import netifaces import sys import signal import os import asyncio from asyncio import CancelledError, Task from typing import Optional, List, Any from .services import ( Service_Manager, Packet_Parser, Packet_Submitter, Packet_Filter, ) from .configurations import generate_configu...
370
110
#!/usr/bin/py import pandas as pd import os # Holds investing.com candlestick patterns class CSPatternList: def __init__(self, path): self.data = None with os.scandir(path) as entries: for e in entries: if e.is_file() and os.path.splitext(e.path)[1] == '.csv': ...
1,516
468
from LaplaceWSAPIClient import * from MarkowitzSerde import * from TargetSerde import * from Operators import * from TargetOperators import * from RLStructure import * from ClientConfig import client_config query = RLQuery("default", datetime(2021,1,1), datetime(2021,1,21), { "BankAccount": 100000.0, ...
1,113
440
#!/usr/bin/env python # encoding: utf-8 # author: cookpan001 import sys import logging import time import mimetypes import urllib import urllib2 """ oauth2 client """ class OAuth2(object): ACCESS_TOKEN_URL = "https://auth.sina.com.cn/oauth2/access_token" AUTHORIZE_URL = "https://auth.sina.com.cn/oauth2/authoriz...
14,406
4,245
from setuptools import setup setup( name='netspeed', version='0.1', py_modules=['netspeed'], install_requires=[ 'Click', 'pyspeedtest' ], entry_points=''' [console_scripts] netspeed=netspeed:cli ''', )
263
93
from django.contrib import admin from .models import (Dish, Payments, Order, Delivery, OrderItem) admin.site.register(Dish) admin.site.register(Payments) admin.site.register(Order) admin.site.register(Delivery) admin.site.register(OrderItem)
244
79
import abc import json import re from collections import OrderedDict from oslo_log import log as logging import hpedockerplugin.exception as exception from hpedockerplugin.hpe import share LOG = logging.getLogger(__name__) class RequestContextBuilderFactory(object): def __init__(self, all_configs): sel...
31,109
8,855
import argparse import csv import os import os.path as osp import statistics import tqdm import time from datetime import datetime import copy import numpy as np import torch import torch.nn as nn import torch.optim as optim import helper_utils.network as network import helper_utils.loss as loss import helper_utils.pre...
32,369
10,278
import os from dataclasses import dataclass, field from typing import AnyStr, Dict, Optional from urllib.parse import urljoin @dataclass class FreshChatConfiguration: """ Class represents the base configuration for Freshchat """ app_id: str token: str = field(repr=False) default_channel_id: O...
1,230
343
#!/usr/bin/env python3.5 import sys import re import os import csv import numpy as np from operator import itemgetter from time import time from multiprocessing import Pool from extract_toc import parseargs from predict_using_toc_mapper import Mapper, get_topic, read_model_file from find_topics import toc_entries, ge...
20,120
7,380
from math import log2 import torch from torch import nn, einsum import torch.nn.functional as F from einops import rearrange from x_transformers import Encoder, Decoder # helpers def exists(val): return val is not None def masked_mean(t, mask, dim = 1): t = t.masked_fill(~mask[:, :, None], 0.) return t....
6,214
2,234
# -*- coding: utf-8 -*- from aiida.orm.data.folder import FolderData from aiida.parsers.parser import Parser from aiida.common.datastructures import calc_states from aiida.parsers.exceptions import OutputParsingError from aiida.common.exceptions import UniquenessError import numpy from aiida.orm.data.array import Arra...
7,668
2,115
import enum from typing import List import sys if sys.version_info >= (3, 9): from typing import TypedDict # pytype: disable=not-supported-yet else: from typing_extensions import TypedDict # pytype: disable=not-supported-yet from pydantic import BaseModel class TensorDtype(str, enum.Enum): F32 = "f32" ...
1,128
394
from django.apps import AppConfig class InstaphotosConfig(AppConfig): name = 'instaphotos'
97
32
import pytest from expiring_links.serializers import ExpiringLinkGeneratorSerializer @pytest.mark.serializers def test_fields(db, create_test_expiring_link_serializer_data): assert list(create_test_expiring_link_serializer_data.keys()) == ['image_id', 'expiration_time'] @pytest.mark.serializers def test_valid_...
2,835
832
# -*- coding: utf-8 -*- #--------------------------------------------------------------------------- # Copyright 2020 VMware, Inc. All rights reserved. # AUTO GENERATED FILE -- DO NOT MODIFY! # # vAPI stub file for package com.vmware.nsx.trust_management. #-------------------------------------------------------------...
91,609
25,957
"Test list input." # For support of python 2.5 from __future__ import with_statement import numpy as np from numpy.testing import assert_equal, assert_array_almost_equal import bottleneck as bn # --------------------------------------------------------------------------- # Check that functions can handle list input ...
4,255
1,712
#!/usr/bin/env python """warcindex - dump warc index""" import os import sys import sys import os.path from optparse import OptionParser from .warctools import WarcRecord, expand_files parser = OptionParser(usage="%prog [options] warc warc warc") parser.add_option("-l", "--limit", dest="limit") parser.add_option(...
1,475
480
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Dataset', fields=[ ('id', models.AutoField(prim...
1,469
402
"""Run control side-effect handler.""" import pytest from decoy import Decoy from opentrons.protocol_engine.state import StateStore from opentrons.protocol_engine.actions import ActionDispatcher, PauseAction from opentrons.protocol_engine.execution.run_control import RunControlHandler from opentrons.protocol_engine.st...
1,836
564
import json import glob def merge_drug(drug_dirpath): #start_time = time.time() print("\n----- MERGING json data into merged_drug.json -----") result = [] for f in glob.glob(drug_dirpath+'/*.json'): with open(f,"rb") as infile: result.append(json.load(infile)) with open("merge...
510
182
import os import sys from io import StringIO from unittest.mock import patch from django.core.management import call_command from django_dramatiq.management.commands import rundramatiq def test_rundramatiq_command_autodiscovers_modules(): assert rundramatiq.Command().discover_tasks_modules() == [ "django...
10,326
3,556
""" 'new_game' state. Includes character creation. """ from ...engine.gui.screen import const, Screen from ...engine.state_machine import State class New_Game(State): def __init__(self): """ Initiailize class and super class """ super(New_Game, self).__init__() self.screen = self._init...
3,620
1,088
#!/usr /bin/env python # -*- coding: utf-8 -*- __author__ = 'jiangge' from flask_sqlalchemy import SQLAlchemy from datetime import datetime from flask import Flask, request, render_template, redirect application = Flask(__name__) application.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///guestbook.db' app...
2,106
745
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('orgs', '0015_auto_20160209_0926'), ] operations = [ migrations.CreateModel( name='Contact', fields=[ ('id', models.AutoField(verbose_name='ID', seria...
707
215
from __future__ import absolute_import from business_rules.actions import rule_action, BaseActions from business_rules.engine import check_condition, run_all from business_rules.fields import FIELD_TEXT, FIELD_NUMERIC, FIELD_SELECT from business_rules.variables import BaseVariables, string_rule_variable, numeric_rule_v...
6,596
1,895
# -*- coding: utf-8 -*- import sys import argparse arg_no = len(sys.argv) tool_parser = argparse.ArgumentParser(add_help=False) tool_subparsers = tool_parser.add_subparsers(help='commands', dest='command') # The rename command. rename_parser = tool_subparsers.add_parser('rename', help='rename an existing user acco...
5,808
1,960
""" Climate Platform Device for Wiser Smart https://github.com/tomtomfx/wiserSmartForHA thomas.fayoux@gmail.com """ import asyncio import logging import voluptuous as vol from functools import partial from ruamel.yaml import YAML as yaml from homeassistant.components.climate import ClimateEntity from homeassistant...
6,235
1,987
import os from functools import partial from multiprocessing import Pool from typing import Any, Callable, Dict, List, Optional import numpy as np import pandas as pd from tqdm import tqdm from src.dataset.utils.waveform_preprocessings import preprocess_strain def id_2_path( image_id: str, is_train: bool = ...
4,765
1,823
# ---------------------------------------------------------------------- # managedobject set profile # ---------------------------------------------------------------------- # Copyright (C) 2007-2019 The NOC Project # See LICENSE for details # ---------------------------------------------------------------------- # NO...
637
165
# -*- coding: utf-8 -*- import sys PY2 = sys.version[0] == '2' PY3 = sys.version[0] == '3' if PY2: unicode = unicode long = long from StringIO import StringIO import Queue as queue else: # pragma : no cover unicode = str long = int from io import StringIO import queue
305
110
import os import json import boto3 class S3Data(object): """ Class for AWS S3 """ def __init__(self): """ Initialize the s3 client. """ self.s3 = boto3.client('s3') self.bucket = os.environ['S3_BUCKET'] def list(self, prefix): """ List S3 o...
1,563
440
#!/usr/bin/env python3 import os import boto3 import botocore.exceptions import argparse import yaml from nephele2 import NepheleError mand_vars = ['AWS_ACCESS_KEY_ID', 'AWS_SECRET_ACCESS_KEY'] perm_error = """\n\nIt seems you have not set up your AWS correctly. Should you be running this with Awssume? Or have profile...
5,980
2,066
"""Test VIMS wavelength module.""" from pathlib import Path import numpy as np from numpy.testing import assert_array_almost_equal as assert_array from pyvims import QUB from pyvims.vars import ROOT_DATA from pyvims.wvlns import (BAD_IR_PIXELS, CHANNELS, FWHM, SHIFT, VIMS_IR, VIMS_VIS, WLN...
9,196
4,233
import torch import torch.nn as nn import torch.nn.functional as F class LabelSmoothingCrossEntropy(nn.Module): def __init__(self, smoothing = 0.1): super(LabelSmoothingCrossEntropy, self).__init__() assert smoothing < 0.1 self.smoothing = smoothing self.confidence = 1. - smoothing ...
909
323
# -*- coding: utf-8 -*- """ Created on Sat Feb 27 18:16:24 2015 @author: Eugenio Panadero A raíz del cambio previsto: DESCONEXIÓN DE LA WEB PÚBLICA CLÁSICA DE E·SIOS La Web pública clásica de e·sios (http://www.esios.ree.es) será desconectada el día 29 de marzo de 2016. Continuaremos ofreciendo servicio en la nueva ...
5,783
2,122
class BrainfuckException(Exception): pass class BLexer: """ Static class encapsulating functionality for lexing Brainfuck programs. """ symbols = [ '>', '<', '+', '-', '.', ',', '[', ']' ] @staticmethod def lex(code): """ Return a generator for tokens in...
4,744
1,391
load("@fbcode_macros//build_defs:config.bzl", "config") load("@fbcode_macros//build_defs/config:read_configs.bzl", "read_int") load("@fbcode_macros//build_defs:core_tools.bzl", "core_tools") def _create_build_info( build_mode, buck_package, name, rule_type, platform, epochtime=0, host="", ...
3,476
1,067
#!#!/usr/bin/env python import os from github import Github from libraries.notify import Notify import json print("") print("Scanning Github repos") GITHUB_API_KEY = os.environ.get('GITHUB_API_KEY') WHITELIST = json.loads(os.environ.get('GITHUB_WHITELIST').lower()) GITHUB_SCAN = json.loads(os.environ.get('GITHUB_SCAN...
1,885
699
from flask.ext.sqlalchemy import SQLAlchemy from util import hex_to_rgb, rgb_to_hex from time2words import relative_time_to_text from datetime import datetime from dateutil.tz import tzutc import pytz db = SQLAlchemy() def created_on_default(): return datetime.utcnow() class Counter(db.Model): __tablename__ ...
3,634
1,193
#!/usr/bin/env python3 import os import setuptools DIR = os.path.dirname(__file__) REQUIREMENTS = os.path.join(DIR, "requirements.txt") with open(REQUIREMENTS) as f: reqs = f.read().strip().split("\n") setuptools.setup( name="rl", version="0.0.1", description="Reinforcement Learning: An Introduction...
732
267
from taxcalc.tbi.tbi import (run_nth_year_taxcalc_model, run_nth_year_gdp_elast_model, reform_warnings_errors)
169
51
import requests,time,json,re,base64 requests.packages.urllib3.disable_warnings() from io import BytesIO from PIL import Image,ImageDraw,ImageChops from lxml import etree from urllib.parse import urlparse, parse_qs username = "" #登录账号 password = "" #登录密码 s = requests.Session() s.headers.update({'User-Ag...
6,223
2,484
# pylint: disable=missing-docstring from __future__ import annotations import hashlib from io import BytesIO from pathlib import Path from typing import Any import pytest from beancount.core.compare import hash_entry from flask import url_for from flask.testing import FlaskClient from fava.context import g from fava...
11,174
3,509
# Generated by Django 2.2.6 on 2019-11-27 20:28 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('babybuddy', '0016_auto_20191127_1424'), ] operations = [ migrations.AddField( model_name='promocode', name='max_usag...
403
149
from luminoso_api.v5_client import LuminosoClient from luminoso_api.v5_upload import create_project_with_docs, BATCH_SIZE from unittest.mock import patch import pytest BASE_URL = 'http://mock-api.localhost/api/v5/' DOCS_TO_UPLOAD = [ {'title': 'Document 1', 'text': 'Bonjour', 'extra': 'field'}, {'title': 'Do...
6,218
1,903
# Copyright (c) initOS GmbH 2019 # Distributed under the MIT License (http://opensource.org/licenses/MIT). from ..commands import CommandError, parse_commands from ..config import OCABOT_EXTRA_DOCUMENTATION, OCABOT_USAGE from ..router import router from ..tasks.add_pr_comment import add_pr_comment @router.register("...
1,259
385
# -*- coding: utf-8 -*- # Definition for singly-linked list. class ListNode(object): def __init__(self, x): self.val = x self.next = None class Solution(object): def splitListToParts(self, root, k): res = [] size = 0 traverse = root while traverse: si...
1,151
470
import unittest import shutil import tempfile import numpy as np # import pandas as pd # import pymc3 as pm # from pymc3 import summary # from sklearn.mixture import BayesianGaussianMixture as skBayesianGaussianMixture from sklearn.model_selection import train_test_split from pmlearn.exceptions import NotFittedError ...
7,744
2,575
import random TUPLE_SIZE = 4 DIGIT_BASE = 10 MAX_GUESS = DIGIT_BASE ** TUPLE_SIZE def yield_all(): for i in xrange(DIGIT_BASE ** TUPLE_SIZE): tup = tuple([int(x) for x in '%04d' % i]) assert len(tup) == TUPLE_SIZE for l in tup: if tup.count(l) != 1: break ...
1,096
391
import torch import torch.nn as nn import torch.nn.functional as F def conv3x3x3(in_planes, out_planes, stride): # 3x3x3 convolution with padding return nn.Conv3d( in_planes, out_planes, kernel_size=3, stride=stride, padding=1) def upconv3x3x3(in_planes, out_planes, stri...
1,276
516
import logging import threading import json import base64 import os from subprocess import Popen import glob import time import urllib2 import re import string import datetime class DeviceHandler: logger = logging.getLogger() def __init__(self, config): self.service = None self.tunnel = None ...
8,258
2,405
from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import numpy as np from skimage import draw from skimage import measure from astropy.io import fits from astropy import units as u from astropy import wcs, coordinates from scipy.ndimage.filters impor...
7,882
2,811
""" @created_at 2015-01-18 @author Exequiel Fuentes Lettura <efulet@gmail.com> """ from pybrain.datasets import ClassificationDataSet from pybrain.tools.shortcuts import buildNetwork from pybrain.structure.modules import SoftmaxLayer from pybrain.supervised.trainers import BackpropTrainer from pybrain.utilities impor...
12,349
3,377
from sys import argv from subprocess import call try : link = argv[ 1 ] except IndexError: link = raw_input( " - which url interests you? " ) try: ydl_answ = call( "youtube-dl -F "+ link, shell = True ) if ydl_answ is not 0 : print "-- failed "+ link + " code "+ str(ydl_answ) except OSError as ose : print "Ex...
342
129
import discord from discord.ext import commands from discord import Embed from discord.utils import get import datetime import psycopg2 from bot import DB_NAME, DB_PASS, DB_HOST, DB_USER, logger, private_message class Welcome(commands.Cog): def __init__(self, bot): self.bot = bot logge...
9,689
2,938
#!/usr/bin/env python3 import os import sys import yaml file_name=sys.argv[1] file_name = '/root/etcd/' + file_name + '.yaml' with open(file_name) as f: y=yaml.safe_load(f) del y['metadata']['creationTimestamp'] del y['metadata']['generation'] del y['metadata']['resourceVersion'] del y['metad...
468
171
import os import cv2 from Segmentation import CombinedHist, get_histograms, HistQueue import matplotlib.pyplot as plt import numpy as np listofFiles = os.listdir('generated_frames') # change the size of queue accordingly queue_of_hists = HistQueue.HistQueue(25) x = [] y_r = [] y_g = [] y_b = [] def compare(current_h...
1,514
650
#!/usr/bin/env python3 # -*- coding: utf-8 -*- ''' Telegram Sticker Index Bot ''' import re import sys import time import json import queue import sqlite3 import logging import requests import functools import threading import collections import concurrent.futures import zhconv logging.basicConfig(stream=sys.stderr...
12,369
4,193
import json import unittest import requests from urllib3._collections import HTTPHeaderDict from wsgiadapter import WSGIAdapter class WSGITestHandler(object): def __init__(self, extra_headers=None): self.extra_headers = extra_headers or tuple() def __call__(self, environ, start_response): h...
4,571
1,432
""" ------------------------------------------------------------------------- shine - setup !!TODO: add file description here!! created: 2017/06/04 in PyCharm (c) 2017 Sven - ducandu GmbH ------------------------------------------------------------------------- """ from setuptools import setup setup(nam...
548
171
""" List of podcasts and their filename parser types. """ from .rss_parsers import BaseItem, TalkPythonItem, ChangelogItem, IndieHackersItem import attr @attr.s(slots=True, frozen=True) class Podcast: name = attr.ib(type=str) title = attr.ib(type=str) url = attr.ib(type=str) rss = attr.ib(type=str) ...
1,932
696
#!/usr/bin/env python # vim: set fileencoding=utf-8 ts=4 sts=4 sw=4 et tw=80 : # # Extract and save extended object catalogs from the specified data and # uncertainty images. This version of the script jointly analyzes all # images from a specific AOR/channel to enable more sophisticated # analysis. # # Rob Siverd # Cr...
20,543
6,805
from os import strerror import os import pytest import datetime import sqlalchemy from sqlalchemy import inspect from sqlalchemy import select from sqlalchemy.orm import session from sqlalchemy.sql.expression import func ################################################# # DATABASE CONNECTOR user = 'user' password = ...
6,594
2,077
from dataclasses import dataclass from quran.domain.entity import Entity @dataclass class Edition(Entity): id: str language: str name: str translator: str type: str format: str direction: str
223
68
""" Helper functions to visualize a graph in a notebook or save the plot to file. Import as: import dataflow.core.visualization as dtfcorvisu """ import IPython import networkx as networ import pygraphviz import dataflow.core.dag as dtfcordag import helpers.hdbg as hdbg import helpers.hio as hio def draw(dag: dtf...
1,231
451
"""Calculate pixel errors for a single run or all runs in an experiment dir.""" import torch import itertools import numpy as np import imageio import argparse import os import glob from model.main import main as restore_model from model.utils.utils import bw_transform os.environ["CUDA_VISIBLE_DEVICES"] = '-1' def...
7,714
2,811
from django.contrib import admin # Register your models here. """User admin classes.""" # Django from django.contrib import admin # Models from users.models import User @admin.register(User) class UserAdmin(admin.ModelAdmin): """User admin.""" list_display = ('pk', 'username', 'email','first_name','last_na...
770
241
# Generated by Django 2.2.3 on 2019-07-31 17:10 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Item', fields=[ ('id', models.AutoField(pri...
3,469
897
sm.setSpeakerID(1013000) sm.sendNext("Ugh. This isn't going to work. I need something else. No plants. No meat. What, you have no idea? But you're the master, and you're older than me, too. You must know what'd be good for me!") sm.setPlayerAsSpeaker() sm.sendSay("#bBut I don't. It's not like age has anything to do wi...
918
315
# Generated by Django 3.0.3 on 2020-03-01 00:58 from django.db import migrations, models import user.models class Migration(migrations.Migration): dependencies = [ ('user', '0001_initial'), ] operations = [ migrations.AddField( model_name='user', name='photo', ...
424
143
from .blvnet_tam import bLVNet_TAM __all__ = ['bLVNet_TAM']
61
34
# Copyright 2020 Toyota Research Institute. All rights reserved. """ Geometry utilities """ import numpy as np def invert_pose_numpy(T): """ 'Invert' 4x4 extrinsic matrix Parameters ---------- T: 4x4 matrix (world to camera) Returns ------- 4x4 matrix (camera to world) """ ...
438
186
#Minesweeper! from tkinter import * import random, time, math, threading, os.path, os #Tkinter Class class MinesweeperMain: #Initialising class def __init__(self, xLength, yLength, percentOfBombs, caller=None, winChoice=True): try: #kills the 'play again' host (if it exists) caller.root.destr...
27,209
8,084
# -*- coding: utf-8 -*- """ Scrape Website Data | Cannlytics Copyright © 2021 Cannlytics Author: Keegan Skeate <keegan@cannlytics.com> Created: 1/10/2021 License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANT...
5,431
1,812
""" Code borrowed from https://github.com/akanazawa/cmr/blob/master/utils/bird_vis.py Visualization helpers specific to birds. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import torch from torch.autograd import Variable import numpy as np import os...
22,326
9,130
""" Module that defines Corpus and DocumentSource/DocumentDestination classes which access documents as lines or parts in a file. """ import json from gatenlp.urlfileutils import yield_lines_from from gatenlp.document import Document from gatenlp.corpora.base import DocumentSource, DocumentDestination from gatenlp.cor...
10,764
2,831
import fastapi from starlette.requests import Request from web.viewmodels.account.AccountViewModel import AccountViewModel from web.viewmodels.account.LoginViewModel import LoginViewModel from web.viewmodels.account.RegisterViewModel import RegisterViewModel router = fastapi.APIRouter() @router.get('/account') def i...
709
199
# # Copyright (c) 2013 Juniper Networks, Inc. All rights reserved. # # # UVEServer # # Operational State Server for UVEs # import gevent import json import copy import xmltodict import redis import datetime import sys from opserver_util import OpServerUtils import re from gevent.coros import BoundedSemaphore from pys...
29,031
8,005
import numpy as np from tests.test_utils import run_track_tests from mirdata import annotations from mirdata.datasets import tonas TEST_DATA_HOME = "tests/resources/mir_datasets/tonas" def test_track(): default_trackid = "01-D_AMairena" dataset = tonas.Dataset(TEST_DATA_HOME) track = dataset.track(defa...
6,559
2,720
import os import hashlib import getpass import hmac import botocore.session import botocore.exceptions def _hash(value): return hmac.new(os.environ['TEST_KEY'], value, digestmod=hashlib.sha256).hexdigest() def main(): access_key = getpass.getpass("Access Key: ").strip() secret_acces...
1,064
354