text
string
size
int64
token_count
int64
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2020, Juan B Cabral # License: BSD-3-Clause # Full Text: https://github.com/carpyncho/carpyncho-py/blob/master/LICENSE # ============================================================================= # DOCS # =============================================...
15,862
4,515
import matplotlib.pyplot as plt import base64 from io import BytesIO def get_graph(): buffer = BytesIO() plt.savefig(buffer, format='png') buffer.seek(0) image_png = buffer.getvalue() graph = base64.b64encode(image_png) graph = graph.decode('utf-8') buffer.close() return graph def get_...
498
186
#!/usr/bin/env python3.8 import time from typing import List, Dict import json import requests from requests.exceptions import HTTPError from urllib3.exceptions import InsecureRequestWarning from json_utilities import json_get from titan_qradar_sync_config import TitanQRadarSyncConfig class QRadarUtilities: def...
26,953
7,411
# Generated by Django 3.0.5 on 2020-06-21 14:52 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('project', '0001_initial'), ] operations = [ migrations.CreateModel( name='ShoppingList', ...
1,664
490
# coding=utf-8 import logging import numpy as np import pandas as pd from sklearn import metrics from sklearn.linear_model import LogisticRegression from sklearn.multiclass import OneVsRestClassifier from sklearn.preprocessing import LabelBinarizer from sklearn.utils import shuffle logging.basicConfig(format='%(level...
2,766
993
import os import glob import argparse as ap import shutil as sh import re def main(): parser = ap.ArgumentParser(description="""Uses minimum basis term file to extract the data for a simulation that used the minimum number of basis terms for each frequency""") parser.add_argument('min_file',type=str,help="...
2,505
798
from input import flip from utilities.surface import * import utilities.time as time from nodes import Control, init from shape import draw import pygame import pygame.key as key from event import get, typename2 from input import map screen = pygame.display.set_mode((800, 800), pygame.RESIZABLE) _mask = AlphaSurface(...
1,291
521
# turingmachine.py - implementation of the Turing machine model # # Copyright 2014 Jeffrey Finkelstein. # # This file is part of turingmachine. # # turingmachine is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation,...
15,379
4,318
# Copyright 2004-2005 Joe Wreschnig, Michael Urman # 2009-2014 Christoph Reiter # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation import sys import base64 import mutagen fro...
14,274
4,318
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun Jul 5 23:04:10 2020 @author: y3 749e8aa818a63c61c31acd7ee948d6d8 """ import requests api_address = "https://api.openweathermap.org/data/2.5/weather?q=" api_key_url = "&APPID=749e8aa818a63c61c31acd7ee948d6d8" city_name = "Bet shemesh,IL" weather_data...
413
216
#!/usr/bin/python3 import os import click import sys import csv import time import pandas as pd import country_converter as coco import hashlib import phonenumbers from tqdm import tqdm from uszipcode import SearchEngine HEADER_TRANSLATIONS = { "email1": "Email", "phone1": "Phone", "person_country": "Count...
17,750
5,220
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import re import pwndbg.memoize NORMAL = "\x1b[0m" BLACK = "\x1b[30m" RED = "\x1b[31m" GREEN ...
2,383
1,008
import io from PIL import Image from torchvision import models import torch import torchvision.transforms as transforms import torch.nn as nn import torch.nn.functional as F import urllib import os def get_model_from_global_agent(): global_model = models.squeezenet1_1(pretrained=True) global_model.classifier[1...
1,473
535
# line drawing as shape, where drawing doesn't "lift pen from paper" # coords are given as a list from (0,0), and sublists can be used to # branch off then return to a particular point # # drawing the outline of a polygon, then retracing the steps backwards, # renders the polygon outline as opposed to filling it impor...
1,599
758
"""Initial schema Revision ID: 25276717e6b8 Revises: None Create Date: 2016-03-25 17:58:19.963883 """ # revision identifiers, used by Alembic. revision = '25276717e6b8' down_revision = None from alembic import op import sqlalchemy as sa def downgrade(): op.drop_table('server_log') op.drop_table('user') ...
1,671
621
""" This Code is Contributed by Arpit Bhushan Sharma Codechef-@koderarpit Github - @arpit1920 Kaggle - arpit3043 Mail - arpit3043@gmail.com Two integers A and B are the inputs. Write a program to find GCD and LCM of A and B. Input The first line contains an integer T, total number of testcases. Then follow T...
911
403
# Generated by Django 2.2.4 on 2019-10-22 00:36 from django.db import migrations, models import django.db.models.deletion import django.utils.timezone class Migration(migrations.Migration): initial = True dependencies = [ ('cie10_django', '0001_initial'), ('nhpgd_django', '0001_initial'), ...
4,270
1,373
""" main(terminal).py Author: Fabio Condomitti """ from solver import print_grid, solve def main(): sudoku_grid = [ [0,8,0, 0,0,0, 2,0,0], [0,0,0, 0,8,4, 0,9,0], [0,0,6, 3,2,0, 0,1,0], [0,9,7, 0,0,0, 0,8,0], ...
1,057
548
import subprocess import os import requests import pyttsx3 from bs4 import BeautifulSoup class Commander: def __init__(self): self.confirm = ["yes", "ok", "go on", "sure", "do it", "yeah", "yaa", "Imm", "confirm", "of course"] self.cancel = ["nope", "no", "noo", "not yet", "don't", "do not", "stop...
2,239
662
def rotations(l): out = [] for i in range(len(l)): a = shift(l, i) out += [a] return out def shift(l, n): return l[n:] + l[:n] if __name__ == '__main__': l = [0,1,2,3,4] for x in rotations(l): print(x)
251
108
# -*- coding: utf-8 -*- """ Created on Tue Dec 28 17:41:18 2021 @author: Adhmir Renan Voltoni Gomes """ import pandas as pd import MCDM_V_001 as mcdm def pegar_dados(): file_path = mcdm.label_file["text"] excel_filename = r"{}".format(file_path) if excel_filename[-4:] == ".csv": df = ...
423
182
#!/usr/bin/env python3 # _*_ coding: utf-8 -*- # Используя замыкания функций, объявите внутреннюю функцию, # которая принимает в качестве аргумента коллекцию (список # или кортеж) и возвращает или минимальное значение, или # максимальное, в зависимости от значения параметра type внешней # функции. Если type равен «max»...
742
304
# Generated by Django 2.2.12 on 2020-04-29 18:42 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('cmsplugin_remote_form', '0004_remoteform_notification_emails'), ] operations = [ migrations.AlterField( model_name='extrafield'...
2,561
741
import csv import cv2 import numpy as np import pandas as pd import sys from datetime import datetime from numpy.random import RandomState import keras import tensorflow as tf from keras.models import Sequential from keras.callbacks import ModelCheckpoint from keras.layers import Flatten, Dense, Lambda, Cropping2D, C...
17,348
7,607
# The script is intended to get a list of all devices available via Tuya Home Assistant API endpoint. import requests import pprint # CHANGE THIS - BEGINNING USERNAME = "" PASSWORD = "" REGION = "eu" # cn, eu, us COUNTRY_CODE = "1" # Your account country code, e.g., 1 for USA or 86 for China BIZ_TYPE = "smart_life" # ...
1,418
503
""" (c) RIKEN 2015. All rights reserved. Author: Keitaro Yamashita This software is released under the new BSD License; see LICENSE. """ import socket import subprocess import time import os import getpass import tempfile class Adxv: def __init__(self, adxv_bin=None, no_adxv_beam_center=True): self.adxv_...
3,562
1,274
import torch from torch import nn from configs import ANCHOR_SIZES class PostRes(nn.Module): def __init__(self, n_in, n_out, stride=1): super(PostRes, self).__init__() self.conv1 = nn.Conv3d(n_in, n_out, kernel_size=3, stride=stride, padding=1) self.bn1 = nn.BatchNorm3d(n_out) self...
4,661
1,810
import codecs import distutils.spawn import os.path import platform import re import subprocess import sys from collections import defaultdict from functools import partial try: from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * from PyQt5.QtWebEngineWidgets import QWebE...
5,743
1,857
from django.urls import path from rest_framework_simplejwt.views import ( TokenObtainPairView, TokenRefreshView, TokenVerifyView, ) from . views import * urlpatterns = [ path('register/', UserRegisterView.as_view()), path('logout/', LogoutView.as_view()), path('token/', TokenObtainPairView.as_...
571
182
# -*- coding: utf-8 -*- # Copyright (C) 2016 Jerry Life import urllib import urllib2 import re import xlwt START_PAGE = 0 # start page ALL_PAGE = 82 # number of all pages class PhyTestOnline(object): """ This class is specially for a HUST Physics Test Online providing a crawler to downloa...
3,450
1,147
from __future__ import print_function import os import argparse import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torch.utils.data import DataLoader, Dataset from collections import OrderedDict import numpy as np from edgeml_pytorch.trainer.drocc_trainer import DROCCTra...
7,554
2,446
import re import imaplib def checkinbox(user,passw,imapserver): imap = imaplib.IMAP4_SSL(imapserver) try: imap.login(user,passw) print("Connecting and Fetching required info,Please Wait..") select_folder = input("Enter the folder : ") imap.select(select_folder) status, messages =...
1,518
503
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! import grpc from proto import catalog_item_pb2 as proto_dot_catalog__item__pb2 from proto import pyvcloudprovider_pb2 as proto_dot_pyvcloudprovider__pb2 from proto import vapp_pb2 as proto_dot_vapp__pb2 class PyVcloudProviderStub(object): """I...
13,736
3,983
from . import Command from .. import utils import wolframalpha class Math(Command): names = ["math", "calc", "calculate", "solve"] description = "Solves a math problem" usage = "!math [expression]" examples = "!math d/dx sin(x)^2" show_in_help = True async def execute_command(self, client, ms...
1,820
475
from django import forms class ContactForm(forms.Form): user_name = forms.CharField(max_length=60, label='', required=True, widget=forms.TextInput(attrs={'placeholder': 'Your Name'})) user_email = forms.EmailField(label='', required=True) message = forms.CharField(label='', required=True, widget=forms.Te...
854
244
#coding:utf-8 import ftplib import os from ...core import constants from . import base class Configurer(base.Configurer): def __init__(self,config): self._config = config self._key = constants.KEY_CONFIGURER_INSTANCES self._results = {} self.instance = ftplib.FTP() self.inst...
6,517
1,999
# Name: load.py # Date: June 2019 # Function: goes trough a bookmark file checking the status of each URL # Input: bookmark file in json format # Output: new text and json files including those URLs according with their status import os import ast try: import requests except: sys.stderr.write("%s: Please inst...
4,248
1,384
from __future__ import print_function, absolute_import import numbers class KernelRuntimeError(RuntimeError): def __init__(self, msg, tid=None, ctaid=None): self.tid = tid self.ctaid = ctaid self.msg = msg t = ("An exception was raised in thread=%s block=%s\n" "\t%s")...
1,248
387
class GitrackException(Exception): """ General giTrack's exception """ pass class ConfigException(GitrackException): """ Exception related to Config functionality. """ pass class InitializedRepoException(GitrackException): """ Raised when user tries to initialized repo that ...
1,013
279
from tir import Webapp import unittest from tir.technologies.apw_internal import ApwInternal import datetime import time DateSystem = datetime.datetime.today().strftime('%d/%m/%Y') DateVal = datetime.datetime(2120, 5, 17) """------------------------------------------------------------------- /*/{Protheus.doc} PLSA809T...
4,617
2,039
import sys from sympy.external import import_module matchpy = import_module("matchpy") if not matchpy: #bin/test will not execute any tests now disabled = True if sys.version_info[:2] < (3, 6): disabled = True from sympy.integrals.rubi.utility_function import ( sympy_op_factory, Int, ...
80,233
46,992
from __future__ import print_function from P13pt.mascril.measurement import MeasurementBase from P13pt.mascril.parameter import Sweep, String, Folder, Boolean from P13pt.drivers.bilt import Bilt, BiltVoltageSource, BiltVoltMeter from P13pt.drivers.zilockin import ZILockin import time import numpy as np import os clas...
3,759
1,355
import re import struct from typing import List class Core: def __init__(self): self.registers = [] def SP(self) -> int: return self.registers[0] def PC(self) -> int: return self.registers[1] def SREG(self) -> int: return self.registers[-1] def r(self, i: int) ...
1,281
477
from datetime import datetime,timedelta import re def get_time_to_expiry(maturity): if maturity ==0: return 0 # Today's date day_0 = datetime.today() # Maturity date date_format = "%Y-%m-%d" day_exp = datetime.strptime(maturity, date_format) # Delta date: i.e. 1 day, 0:00:00 dat...
1,046
420
from brownie import * from .contract_addresses import * import time def publish(): if network.show_active() == "development": return False else: return True def main(): publish_Goober_nft() def publish_Goober_nft(): dream_frames_NFT_address = CONTRACTS[network.show_active()]["drea...
484
169
# NOTE: Following example requires boto3 package. import boto3 from InquirerPy import prompt from InquirerPy.exceptions import InvalidArgument from InquirerPy.validator import PathValidator client = boto3.client("s3") def get_bucket(_): return [bucket["Name"] for bucket in client.list_buckets()["Buckets"]] de...
1,787
557
""" # Copyright 2021 Huawei Technologies Co., Ltd # # 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 a...
1,999
721
import sys import argparse from collections import defaultdict, OrderedDict class ArgumentUsageError(Exception): """Exception class you can raise (and catch) in order to show the help""" def __init__(self, message, subcommand=None): self.message = message self.subcommand = subcommand class Arg...
7,211
1,952
# Generated by Django 2.0.1 on 2018-01-03 15:50 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('omis_invoice', '0005_populate_billing_fields'), ] operations = [ migrations.AddField( model_name='invoice', name='co...
491
163
default_app_config = 'waldur_openstack.openstack.apps.OpenStackConfig'
71
24
#!/bin/sh ''''[ ! -z $VIRTUAL_ENV ] && exec python -u -- "$0" ${1+"$@"}; command -v python3 > /dev/null && exec python3 -u -- "$0" ${1+"$@"}; exec python2 -u -- "$0" ${1+"$@"} # ''' import sys import os import argparse HERE = os.path.dirname(__file__) ROOT = os.path.abspath(os.path.join(HERE, "..")) sys.path.insert(0...
1,513
482
import pyHook from threading import Timer import win32gui import logging class blockInput(): def OnKeyboardEvent(self,event): return False def OnMouseEvent(self,event): return False def unblock(self): logging.info(" -- Unblock!") if self.t.is_alive(): ...
1,261
425
def make_cut(l): smallest = min(l) return [ x - smallest for x in l if x - smallest > 0 ] length = int(input()) current = list( map( int, input().split() ) ) while current: print(len(current)) current = make_cut(current)
302
104
import gzip import numpy as np import os import pandas as pd import shutil import sys import tarfile import urllib import zipfile from scipy.sparse import vstack from sklearn import datasets from sklearn.externals.joblib import Memory if sys.version_info[0] >= 3: from urllib.request import urlretrieve else: fr...
2,631
1,018
""" This python code demonstrates an edge-based active contour model as an application of the Distance Regularized Level Set Evolution (DRLSE) formulation in the following paper: C. Li, C. Xu, C. Gui, M. D. Fox, "Distance Regularized Level Set Evolution and Its Application to Image Segmentation", IEEE Trans. Im...
2,458
901
""" bot handlers """ import os from pymongo import MongoClient from utils import main_keyboard import settings from db import get_or_create_user, save_detected_defects, save_car_counts from db import defects_stat, cars_stat from processing import process_picture from cars_counting import detect_all_autos from dl import...
2,421
864
import os import matplotlib.pyplot as plt def biplot(score,coeff,pcax_index,pcay_index,labels=None): pcax=pcax_index pcay=pcay_index pca1=pcax-1 pca2=pcay-1 xs = score[:,pca1] ys = score[:,pca2] n=score.shape[1] scalex = 1.0/(xs.max()- xs.min()) scaley = 1.0/(ys.max()- ys.min()) ...
873
404
import abc class Button(abc.ABC): @abc.abstractmethod def register_callback(self, callabck): pass @abc.abstractmethod def pressed(self): pass
176
54
""" File: Polynomial_vec.py Copyright (c) 2016 Andrew Malfavon License: MIT Exercise 7.27 Description: Use vectorized expressions in the Polynomial class. """ import numpy as np import unittest as ut class Polynomial: def __init__(self, coefficients): if isinstance(coefficients, np.ndarray): s...
4,384
1,618
# Student:Richard Deegan # Student NUmber: G00387896 # Import libraries import os import csv #****** CREATE DATA CLASS******# # Create a data class for Product class Product: def __init__(self, name, price=0): self.name = name self.price = price def __repr__(self): ...
18,637
5,239
import sys import copy def find_available(graph, steps): return [s for s in steps if s not in graph] def trim_graph(graph, item): removed_keys = [] for step, items in graph.items(): if item in items: items.remove(item) if len(items) == 0: removed_keys.appe...
2,607
721
#!/usr/bin/python # vim: set fileencoding=utf-8 : # Copyright 2019 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LIC...
14,502
4,495
#!/usr/bin/env python # coding: utf-8 # # Lab 02 # # ## Solving a system of nonlinear equations # # ### Konks Eric, Б01-818 # # IV.12.7.д # $$\begin{cases} x^7 - 5x^2y^4 + 1510 = 0 \\ y^3 - 3x^4y - 105 = 0 \end{cases}$$ # $$\begin{cases} x_{n+1} = \sqrt{\frac{x_n^7 + 1510}{5y_n^4}} \\ y_{n+1} = \sqrt[3]{3x_{n}^4y...
4,318
2,031
#!/usr/bin/env python3 """A tic tac toe game with an unbeatable AI that uses the Python turtle module. The AI player chooses it's move using the minimax algorithm. """ from ttt_util import TicTacToeUI, HumanPlayer, BotPlayer from random import shuffle class TicTacToe: def __init__(self, player1, player2): ...
9,035
2,821
# -*- coding: utf-8 -*- # # test_tatoeba.py # cjktools # from __future__ import unicode_literals import os from .._common import to_unicode_stream, to_string_stream import unittest from six import text_type from functools import partial from datetime import datetime from cjktools.resources import tatoeba, auto_f...
21,722
8,252
from .sql_models import SQLQuiz, SQLQuestion, SQLAnswerOption
65
21
#!/usr/bin/env python3 """PenIn setup script.""" from setuptools import setup, find_packages from penin.core.version import get_version VERSION = get_version() readme_file = open("README.md", "r") LONG_DESCRIPTION = readme_file.read() readme_file.close() setup( name="penin", version=VERSION, description=...
899
307
from tyled.tileset.orthogonal.orthogonal import OrthogonalTileset
65
20
import typing as T import numpy as np def decode_run_length(compressed: T.Iterable[int]): compressed
107
36
__copyright__ = "Copyright (C) 2019 Andreas Kloeckner" __license__ = """ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, ...
3,556
1,137
from django.core.management.base import BaseCommand from exact.users.models import User, Team, TeamMembership from exact.tagger_messages.models import TeamMessage, GlobalMessage from datetime import timedelta from django.utils import timezone from random import randint from faker import Faker import sys faker = Faker(...
3,742
1,144
import numpy as np import pickle from Libraries.Enums import NNLibs from Libraries.Reader import Reader #TODO Complete read() function for SimplyNet #TODO SimplyNet init(self,path) - path should go to read's parameter(like torch) class SimplyNet(Reader): def __init__(self,path): self.weights_list = [] ...
1,529
469
from datetime import datetime from dateutil import tz import glob import os import pandas as pd import sys import time def timestamp_records(): """ """ print("running format_source") sensors = ['EDA', 'HR', 'TEMP'] path_folders = os.path.join('..', '..', 'source_measurements', 'PMR', 'ref' )...
2,636
794
# MIT License # # Copyright (c) 2018 kuangliu # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, pub...
15,114
5,142
from rubinlander.parsers.lsstdoc.parser import LsstDocParser __all__ = ["LsstDocParser"]
90
35
import abc from config import MODEL_DIR class Network: __metaclass__ = abc.ABCMeta @abc.abstractmethod def __init__(self): self.model = None self.model_history = None self.X_train = None self.X_test = None self.y_train = None self.y_test = None @abc.a...
961
309
# -*- coding: utf-8 -*- """ Copyright (c) 2012 University of Oxford Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modif...
3,000
909
#!/usr/bin/env python3 #------------------------------------------------------------------------------# # Filename: apod_linux_config.py / \ # # Project : APOD_Linux | () | # # Date : 06/23/2021 ...
31,291
10,948
#!/usr/bin/python3 #-*- coding: utf-8 -*- import setuptools longdesc = """ Esse módulo foi criado com o objetivo de realizar a busca de mensagens na caixa de e-mail de forma simplificada e intuitiva utilizando o módulo imaplib para conexão. A instalação pode ser feita utilizando: ``pip install git+https://github.co...
1,083
352
import vtk class Scene(object): def __init__(self): self.sceneSources = list() self.sceneMappers = list() self.sceneActors = list() self.sceneLights = list() self.sceneSources.append(vtk.vtkCubeSource()) self.sceneSources[-1].SetXLength(50000) self.sceneSou...
2,156
832
#!/usr/bin/env python # -*- coding: utf-8 -*- # author: maxime déraspe # email: maximilien1er@gmail.com # date: 2017-08-24 # version: 0.01 from subprocess import call import os import argparse import gzip import re import glob from Bio import SeqIO #from Bio.SeqFeature import FeatureLocation def open_file(f):...
7,856
2,717
import sys import matplotlib.pyplot as plt import matplotlib.image as mpimg import random from cobras_ts.querier import Querier from IPython import display def _query_yes_no(question, default="yes"): """Ask a yes/no question via raw_input() and return their answer. "question" is a string that is presented t...
2,875
946
import os import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from dataclasses import dataclass from argparse import ArgumentParser from tqdm import tqdm from torch.utils.data import DataLoader from data import VCTKAudio from model import WaveNet def set_option(): parse...
4,669
1,621
import os def remove_comments_and_crlf(inp_path, comment_string=';', overwrite=False): tmpfilename = os.path.splitext(os.path.basename(inp_path))[0] + '_mod.inp' tmpfilepath = os.path.join(os.path.dirname(inp_path), tmpfilename) with open (inp_path) as oldf: with open(tmpfilepath, 'w') as newf: ...
1,933
567
#!/usr/bin/env python3 # https://codeforces.com/problemset/problem/1023/A def f(ll): n,k = ll #1e14 f = k//2 + 1 e = min(k-1,n) return max(0,e-f+1) l = list(map(int,input().split())) print(f(l))
221
110
import re import pprint pp = pprint.PrettyPrinter(indent=4) from sys import version_info # py3, for checking type of input def combine_messages(messages): """ Combines messages that have one or more integers in them, such as "trial001" "trial002", into a single message like "trial# (#=1-2)". Thi...
9,956
2,996
# Generated by Django 3.0.1 on 2020-01-02 22:21 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='CustomerProfile', fields=[ ('id', models.Au...
639
192
# Autogenerated from KST: please remove this line if doing any edits by hand! import unittest from cast_nested import CastNested class TestCastNested(unittest.TestCase): def test_cast_nested(self): with CastNested.from_file('src/switch_opcodes.bin') as r: self.assertEqual(r.opcodes_0_str.valu...
509
176
""" Model Description @author: Xiayu Li @contact: xiayu_li@shannonai.com @version: 0.1 @license: Apache Licence @file: person_processor.py @time: 2019/11/14 3:08 PM """ import json import os from typing import List, Tuple, Dict from allennlp.predictors.predictor import Predictor from allennlp.modules.token_embedders...
6,390
4,536
import logging logging.basicConfig(level=logging.INFO) from flask import Flask from application.config import Config app = Flask(__name__) app.config.from_object(Config) from application.models.classifiers.CNNClassifier import CNNClassifier from application.models.classifiers.MLPClassifier import MLPClassifier fro...
1,130
365
'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/80C4285C-779E-DD11-9889-001617E30CA4.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7...
21,089
13,161
"""Base class for ball device handlers.""" import asyncio from mpf.core.utility_functions import Util class BallDeviceStateHandler: """Base class for ball device handler.""" __slots__ = ["ball_device", "machine", "_task"] def __init__(self, ball_device): """Initialise handler. Args: ...
1,410
421
from .validator import ( And, Attr, Chain, Const, Contains, ExcMax, ExcMin, Float, Macro, Max, Min, MultipleOf, Not, Or, Pattern, Proto, Type, Validator, Xor, ) __all__ = [ "And", "Attr", "Chain", "Const", "Validator", ...
500
211
import numpy as np import unittest from itertools import product from ml_techniques.svm import * class PermutationDataTest(unittest.TestCase): def testpropershape(self): data = np.random.random((10, 4)) labels = np.random.randint(0, 2, 10)*2-1 data_per = permut_data(data) self.a...
7,549
2,523
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") def deno_repository(): # Get Deno archive http_archive( name = "deno-amd64", build_file = "//ext/deno:BUILD", sha256 = "7b883e3c638d21dd1875f0108819f2f13647b866ff24965135e679c743013f46", type = "zip", u...
430
209
# coding: utf-8 # Copyright (c) 2016, 2022, 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,184
2,628
# 127. Word Ladder # ttungl@gmail.com # Given two words (beginWord and endWord), and a dictionary's word list, find the length of shortest transformation sequence from beginWord to endWord, such that: # Only one letter can be changed at a time. # Each transformed word must exist in the word list. Note that beginWord i...
1,905
566
# -*- coding: utf-8 -*- """ Lexer for the Groovy programming language http://groovy.codehaus.org """ from pygments.lexer import RegexLexer class GroovyLexer(RegexLexer): """ For `Groovy <http://groovy.codehaus.org/>`_ source code. """ name = 'Groovy' aliases = ['groovy'] filenames = [...
2,530
980
# Copyright 2021 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 required by applica...
10,243
3,150
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.conf import settings from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'StoredOEmbed' db.create_table('oembed_storedoembed', ( ...
7,119
2,236