text
string
size
int64
token_count
int64
def fac(n): if n in [0, 1]: return 1 else: return n * fac(n-1) def sum_of_the_factorial_of_their_digits(n): fac_of_the_digits = [fac_dic[int(x)] for x in str(n)] return sum(fac_of_the_digits) def main(): for n in range(10, 2540161): if n == sum_of_the_fac...
505
214
import torch import torch.nn.functional as F import torchaudio import numpy as np from scipy.signal import get_window from librosa.util import pad_center, tiny from librosa.filters import window_sumsquare from librosa.filters import mel as librosa_mel_fn def get_mel_basis(sampling_rate=22050, filter_length=1024, n_m...
7,638
2,698
"""This module defines the ndk_cc_toolchain_config rule. This file is based on the `external/androidndk/cc_toolchain_config.bzl` file produced by the built-in `android_ndk_repository` Bazel rule[1], which was used to build the SkCMS repository up until this revision[2]. The paths in this file point to locations insid...
13,771
4,528
import re from http import cookiejar from urllib import request, parse from bs4 import BeautifulSoup from VirtualJudgeSpider import Config from VirtualJudgeSpider.Config import Problem, Spider, Result from VirtualJudgeSpider.OJs.BaseClass import Base class HDU(Base): def __init__(self): self.code_type =...
7,149
2,239
''' 입력 ''' n = int(input()) # 지도의 크기 square_map = [] for i in range(n): square_map.append(list(map(int, input()))) ''' 입력 ''' _house_count = 0 house = [] bundle = 0 def dfx(x, y): global _house_count if x <= -1 or x >= n or y <= -1 or y >= n: return False if square_map[x][y] == 1: ...
705
303
""" Attachment File which implements the Hiven Attachment type and its methods (endpoints) --- Under MIT License Copyright © 2020 - 2021 Luna Klatzer 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 Soft...
3,329
972
from django.shortcuts import render from .models import Task from rest_framework import serializers from rest_framework.response import Response from rest_framework.decorators import api_view # Create your views here. class TaskSerializer(serializers.ModelSerializer): """ Task serializer class """ class Meta: "...
1,530
539
# -*- coding: utf-8 -*- """ This file contains all the settings that defines the development server. SECURITY WARNING: don't run with debug turned on in production! """ import logging from typing import List from server.settings.components.common import INSTALLED_APPS, MIDDLEWARE # Setting the development status: ...
471
158
import sys import json from random import choice, random import time from pyaidoop_graphql_client.api import Client def main(argv): workspaceName = argv[1] client = Client("http://localhost:3000", "system") client.signin("admin@hatiolab.com", "admin") # client.robot_go_home(name='robot01') # cl...
605
252
#!/bin/env python3 """ Extracts all metro and RER stations from an OSM dump. """ import xml.etree.cElementTree as ET import argparse import csv from math import radians, cos, sin, asin, sqrt class Station(object): """A train station""" def __init__(self, name, osm_id, lat, lon, accessible=False): self...
6,275
2,161
# note : this does not create the link between the map and the world. It only spawns the robots. # Please make sure to go back and manually add the path to the bitmap file file_name = 'plots.txt' f = open("../new_results/" + file_name, "w+") counter = 1 for i in range(1, 10): for j in range(1, 6): f.write('...
493
173
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*- # ex: set expandtab softtabstop=4 shiftwidth=4: # # Copyright (C) 2018-2019 Contributor # # 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 #...
5,615
1,769
from types import SimpleNamespace import pytest import threading from py4web.core import Fixture result = {'seq': []} def run_thread(func, *a): t = threading.Thread(target=func, args=a) return t class Foo(Fixture): def on_request(self): self._safe_local = SimpleNamespace() @property de...
1,618
599
# uncompyle6 version 3.7.4 # Python bytecode 3.7 (3394) # Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)] # Embedded file name: T:\InGame\Gameplay\Scripts\Server\objects\components\object_inventory_component.py # Compiled at: 2020-10-06 03:00:48 # Size of source...
13,049
3,622
from __future__ import absolute_import, unicode_literals from django.core.management import BaseCommand, CommandError from sqs_consumer.worker.service import WorkerService class Command(BaseCommand): help = 'Command to process tasks from one or more SQS queues' def add_arguments(self, parser): pars...
786
214
import numpy as np def indep_array(start, finish, num_steps): x = np.zeros(num_steps) for i in range(0, num_steps): x[i] = start * ((finish / start) ** (1. / (num_steps - 1.))) ** i return x
212
82
# coding: utf-8 from the import expect from filesystem import paths from filesystem.paths import root class TestFilesystemPaths: def setup_method(self): pass def test_that_root_exists(self): expect(paths.ROOT).to.be.NOT.empty def test_that_app_is_correct(self): expect(paths.AP...
4,890
1,807
from openpharmacophore.databases.zinc import get_zinc_urls, discretize_values import pytest @pytest.mark.parametrize("subset,mol_weight,logp,format", [ ("Drug-Like", None, None, "smi"), (None, (250, 350), (-1, 1), "smi"), (None, (365, 415), (1.5, 2.25), "smi"), ("Drug-Like", None, None, "sdf"), (No...
2,222
959
import numpy as np import matplotlib.pyplot as plt from scipy.integrate import odeint from scipy.optimize import minimize import pandas as pd # generate data file from TCLab or get sample data file from: # http://apmonitor.com/pdc/index.php/Main/ArduinoEstimation2 # Import data file # Column 1 = time (t) # ...
3,608
1,751
from math import gcd moons = [(-16, -1, -12), (0, -4, -17), (-11, 11, 0), (2, 2, -6)] velocities = [(0,0,0),(0,0,0),(0,0,0),(0,0,0)] x_positions = set() y_positions = set() z_positions = set() x_positions.add((moons[0][0],moons[1][0],moons[2][0],moons[3][0],velocities[0][0],velocities[1][0],velocities[2][0],velociti...
4,052
1,921
import AutoTicketsBot as tBot configDestination = 'var/config.yml' args = tBot.addArgs() config = tBot.configRead(configDestination) if tBot.configWrite(configDestination, args, config) is True: print("Successfully store new config to {}".format(configDestination)) ticketsBot = tBot.AutoTicketsBot(config) #schedul...
643
253
def get_map_from_input(input_location): f = open(input_location, 'r') input_map = f.read().split('\n') f.close() lines = len(input_map) columns = len(input_map[0]) print(f"Original map = {lines} x {columns}") extended_map = [] for line in input_map: extended_map.append(line *...
1,834
700
import os import sys import pytest from django.contrib.auth import get_user_model from users.tests.factories import UserFactory sys.path.append(os.path.join(os.path.dirname(__file__), 'app')) User = get_user_model() @pytest.fixture(autouse=True) def enable_db(db): pass @pytest.fixture def user() -> User: ...
343
121
import numpy as np import numba from numba import jit @jit(nopython=True) def distance(a,b): d = 0 for i in range(max(len(a),len(b))): d += (a[i] - b[i])**2 return d**0.5
191
84
''' Smallest factor to reach a number composed of digit '1' Status: Accepted ''' ############################################################################### def main(): """Read input and print output""" while True: try: number = int(input()) except EOFError: break...
751
191
from flask import request, abort from flask_restful_swagger_3 import Resource, swagger from flask_jwt_extended import jwt_required, get_jwt_identity, get_jwt from models.message import Message, MessageCreate from database.manager import db from emails import send_new_message class MessageAPICreate(Resource): @jwt_re...
2,190
688
#!/usr/bin/env python3 # # Copyright (c) 2015, Intel Corporation # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditi...
5,544
1,827
# coding:utf-8 # example 17: quick_sort.py import random # def quick_sort(array): # if len(array) <= 1: # return array # pivot_idx = 0 # pivot = array[pivot_idx] # less_part = [num for num in array[pivot_idx + 1:] if num <= pivot] # great_part = [num for num in array[pivot_idx + 1:] if nu...
1,859
699
from zope.interface import implements from epsilon.extime import Time from axiom.iaxiom import IScheduler from axiom.item import Item from axiom.attributes import text from axiom.test.historic.stubloader import StubbedTest from xquotient.exmess import _UndeferTask, Message, INBOX_STATUS, CLEAN_STATUS from xquotient....
3,129
918
""" A test file for testing zestimation The learned file could be downloaded at [learned_zqso_only_model_outdata_full_dr9q_minus_concordance_norm_1176-1256.mat] (https://drive.google.com/file/d/1SqAU_BXwKUx8Zr38KTaA_nvuvbw-WPQM/view?usp=sharing) """ import os import re import time import numpy as np from .test_selec...
2,304
1,005
import pytest from quart.xml_parser_quart import fusion_vulnerability_dictionaries EXPECTED_1 = \ {u'1': {'category': u'Category 1', 'consequence': u'Consequence 1', 'diagnosis': u'Diagnosis 1', 'hosts': [{'ip': u'1.1.1.1', 'name': 'host1'}, {'ip': u'2.2.2...
2,981
1,178
from poker import poker, kind, two_pair, hand_rank, card_ranks, best_hand def test(): "Test cases for the functions in poker program" sf = "6C 7C 8C 9C TC".split() # Straight Flush fk = "9D 9H 9S 9C 7D".split() # Four of a Kind fh = "TD TC TH 7C 7D".split() # Full House tp = "5S 5D AC AS KS".sp...
1,651
781
""" base estimator class for megaman """ # Author: James McQueen -- <jmcq@u.washington.edu> # LICENSE: Simplified BSD https://github.com/mmp2/megaman/blob/master/LICENSE import numpy as np from scipy.sparse import isspmatrix from sklearn.base import BaseEstimator, TransformerMixin from sklearn.utils.validation impo...
5,249
1,567
#!/usr/bin/env python # -*- coding: UTF-8 -*- # # generated by wxGlade 0.9.4 on Sat Feb 1 19:14:54 2020 # import wx from pymorsecode import MorseCode # begin wxGlade: dependencies # end wxGlade # begin wxGlade: extracode # end wxGlade class MyFrame(wx.Frame): def __init__(self, *args, **kwds): # begi...
8,048
3,146
"""update user profile definition Revision ID: d3f96fb8b8e5 Revises: 2b13f89aa1b3 Create Date: 2021-10-18 15:45:33.906745 """ from alembic import op import sqlalchemy as sa from alembic_utils.pg_function import PGFunction from sqlalchemy import text as sql_text # revision identifiers, used by Alembic. revision = 'd3...
1,032
374
""" On an 8 x 8 chessboard, there is one white rook.  There also may be empty squares, white bishops, and black pawns.  These are given as characters 'R', '.', 'B', and 'p' respectively. Uppercase characters represent white pieces, and lowercase characters represent black pieces. The rook moves as in the rules of Ches...
2,948
1,052
# Copyright (c) 2020, Huawei Technologies.All rights reserved. # # Licensed under the BSD 3-Clause License (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://opensource.org/licenses/BSD-3-Clause # # Unless required by applicable law...
3,200
1,235
# -*- coding: utf-8 -*- from simmate.website.core_components.filters import ( Structure, Forces, Thermodynamics, Calculation, ) from simmate.database.base_data_types.dynamics import ( DynamicsRun as DynamicsRunTable, DynamicsIonicStep as DynamicsIonicStepTable, ) class DynamicsRun(Structure, ...
968
282
import numpy as np import pandas as pd from taller1.models import Userid_Timestamp_Count class Coseno(): def recomendacionUsuario(self,usuario_activo): print("Modelo Coseno Usuario") cant = 10 df_mapreduce = Coseno.cargarDatos(self) print("df_mapreduce.shape",df_mapreduce.shape) df_pivot = df_mapr...
3,821
1,608
"""Convert Shapefiles to Tecplot plt format usage: > python shapefile_to_plt.py shapefile.shp outfile.plt Necessary modules ----------------- pyshp The Python Shapefile Library (pyshp) reads and writes ESRI Shapefiles in pure Python. https://pypi.python.org/pypi/pyshp https://www.esri.com/library/whi...
5,646
1,778
"""When creating factory functions, plain functions are good unless you need to inherit from a higher level class. If you don't need to inherit, dont use a class.""" from functools import partial from .suits import * from .cards import * def card(rank, suit): if rank == 1: return AceCard('A', suit) ...
2,746
871
# -*- coding: utf-8 -*- import unittest from app.services.spider_qidian import QidianSpider class TestSpider(unittest.TestCase): def test_init(self): spider = QidianSpider() self.assertTrue(isinstance(spider, QidianSpider)) def test_query_book_list(self): spider = QidianSpider() ...
2,645
1,143
class Solution: def watchedVideosByFriends(self, watchedVideos: List[List[str]], friends: List[List[int]], ID: int, level: int) -> List[str]: n = len(friends) # BFS frontier = [ID] levels = {ID : 0} nsteps = 0 while frontier: if level == 0: ...
847
237
from __future__ import annotations import logging import socket import pytest from .constants import TEST_HOST, TEST_PORT logger = logging.getLogger("tests.fixtures.client") class BaseClient: """ Blocking test client to connect to an app server """ name: str def __init__(self, name: str): ...
2,614
795
"""Standard raspberry GPIO access layer. It defines abstract layer that extends InOutInterface to access all standard ports on rapsberry pi. It uses RPi.GPIO under the hood. Thanks to that you have a standardized way of accessing these ports, as well as any others implementing InOutInterface. """ import logging fr...
7,768
2,363
import discord import os import json from discord.ext import commands, tasks import time import asyncio import random from discord.utils import MAX_ASYNCIO_SECONDS ########################################################################## #generalrole = discord.utils.get(ctx.guild.roles, id=661454256251076613) #logch...
4,190
1,703
#First, we import the relevant libraries import sys import pandas as pd from sqlalchemy import create_engine def load_data(messages_filepath, categories_filepath): '''This function will load the messages and categories datasets. Then, this function will merge the datasets by left join using the common id...
5,007
1,359
import torch from argparse import ArgumentParser, Namespace import logging import os from collections import namedtuple import random import torch Transition = namedtuple('Transition', ('state', 'action', 'next_state', 'reward', 'done')) class AgentMemory(object): def __init__(self, capaci...
7,123
2,037
import pandas as pd from modules import bedtools from modules import intervals def generator(ARGUMENTS): if not ARGUMENTS.input_bed and not ARGUMENTS.gtf_anno: print(f"get random intervals from genome {ARGUMENTS.reference}") RANDOM_BED = bedtools.random_interval( ARGUMENTS.reference, A...
1,568
605
#!/usr/bin/env python3 f=1 fprev=1 n=2 while f < 10**999: f,fprev = f + fprev,f n += 1 print(n)
100
59
test = list() test.append('Werberty') test.append(21) galera = list() galera.append(test[:]) test[0] = 'Maria' test[1] = 22 galera.append(test[:]) print(galera) pessoal = [['joão', 19], ['Ana', 33], ['Joaquim', 13], ['Maria', 45]] print(pessoal[1]) print(pessoal[2][1]) for p in pessoal: print(f'{p[0]} tem {p[1]} a...
532
244
from summariser.ngram_vector.base import Sentence from summariser.utils.data_helpers import * from nltk.stem.porter import PorterStemmer from summariser.ngram_vector.state_type import * import random class Vectoriser: def __init__(self,docs,sum_len=100,no_stop_words=True,stem=True,block=1,base=200,lang='english')...
4,667
1,441
from setuptools import setup setup(name='betbright_test', version='0.1', description='Python product category classification kit', url='', author='Oleksii Nidzelskyi', author_email='alexey.education@gmail.com', license='MIT', packages=['betbright_test'], zip_safe=False)
320
101
from docsie_universal_importer.providers.base.urls import default_urlpatterns from .import_provider import GoogleCloudStorageProvider urlpatterns = default_urlpatterns(GoogleCloudStorageProvider)
198
53
import argparse import json import os import time from elf.segmentation.multicut import get_multicut_solver, _to_objective from elf.segmentation.utils import load_multicut_problem def simple_performance_experiments(problem, solvers): os.makedirs("problems", exist_ok=True) path = f"./problems/{problem}" s...
2,182
695
IMAP_GMAIL = 'imap.gmail.com' IMAP_OUTLOOK = 'outlook.office365.com' IMAP_YAHOO = 'imap.mail.yahoo.com'
104
56
"""Unit test package for oadds."""
35
12
from schematics.types import StringType, BooleanType, MD5Type, BaseType from schematics.exceptions import ValidationError from schematics.types.compound import ModelType from openprocurement.api.models import ListType from openprocurement.tender.core.procedure.models.award import ( Award as BaseAward, PatchAwar...
1,296
382
from __future__ import print_function import numpy as np from fidimag.atomistic import Sim from fidimag.common import CuboidMesh from fidimag.atomistic import UniformExchange def init_m(pos): x, y, z = pos return (x - 0.5, y - 0.5, z - 0.5) def test_exch_1d(): """ Test the x component of the exchang...
4,448
1,894
from geomdl import BSpline import numpy as np import math import ezdxf import burin.types class Spline: def __init__(self,degree, control, knots): self.degree = degree self.control = np.array(control) self.knots = np.array(knots) def length_upper_bound(self): acc = 0 ...
2,475
833
API_ROOT = 'http://localhost:6000' #'https://bookbeat.herokuapp.com' TOKEN_VALIDATION_ABS_ENDPOINT = API_ROOT + '/validate-token' REQ_USER_ID_KEY_NAME = 'id'
161
73
from output.models.nist_data.list_pkg.date.schema_instance.nistschema_sv_iv_list_date_min_length_3_xsd.nistschema_sv_iv_list_date_min_length_3 import NistschemaSvIvListDateMinLength3 __all__ = [ "NistschemaSvIvListDateMinLength3", ]
238
97
#!/usr/bin/env python #********************************************************************* # Software License Agreement (BSD License) # # Copyright (c) 2011 andrewtron3000 # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the ...
2,717
941
# coding:utf-8 import matplotlib.pyplot as plt import matplotlib as mpl # Def def GetDefRate(d): if d/(3360.0+d) > 0.9: return 0.9 return d/(3360.0+d) def GetDamageRate(d): return 1-GetDefRate(d) def GetDefImp(currDef, prevDef, pofang): return 1 - GetDamageRate(currDef*(1-pofang)) / GetDamageRat...
4,359
2,085
# Generated by Django 3.1.7 on 2021-03-09 16:06 from django.db import migrations, models import djrichtextfield.models class Migration(migrations.Migration): dependencies = [ ('portfolio_app', '0004_delete_service'), ] operations = [ migrations.AddField( model_name='project'...
759
226
"""Demo for latent factor model""" from __future__ import division import numpy as np import numpy.random as nr import matplotlib.pyplot as plt from IBPFM import IBPFM from utils.tracePlot import trace from utils.scaledimage import scaledimage N = 100 chain = 1000 K_finite = 6 # # read the keyboard input for the num...
4,882
2,015
# 기본 파라미터 설정 ######################### Nin = 784 Nh_l = [100, 50] number_of_class = 10 Nout = number_of_class # 분류 DNN 모델 구현 ######################## from keras import layers, models class DNN(models.Sequential): def __init__(self, Nin, Nh_l, Nout): super().__init__() self.add(layers.Dense(Nh_l[...
1,391
588
def dynamicArray(n, queries): Q = len(queries) seqList = [[] for _ in range(n)] lastAnswer = 0 la = [] for i in range(Q): t, x, y = queries[i][0], queries[i][1], queries[i][2] if t == 1: seqList[(x ^ lastAnswer) % n].append(y) else: lastAnswer = seqLis...
492
165
""" The exceptions for the crosslang module """ class CompilationError(Exception): """ Exception raised when failed to compile the user script """ def __init__(self, file, reason): self.file = file self.reason = reason def __str__(self): return "Failed to compile '{}':\n{}"...
649
173
from sqlalchemy import Column, Sequence from sqlalchemy import Integer, String, Text from meirin.db.base_class import Base class MetaPolicy(Base): __tablename__ = 'metapolicy' # helper metapolicy_id_seq = Sequence('metapolicy_id_seq', metadata=Base.metadata) # columns id = Column(Integer, met...
663
239
from .bn import ABN, InPlaceABN, InPlaceABNSync from .functions import ACT_RELU, ACT_LEAKY_RELU, ACT_ELU, ACT_NONE
115
53
import os import pkg_resources from mitba import cached_function @cached_function def get_logged_in_username(): try: import pwd user_id = os.getuid() os_info = pwd.getpwuid(user_id) return os_info.pw_name except (ImportError, KeyError): # ImportError: For windows users...
779
245
import sys import lief import json import struct import os def filter_file(fname): f = fname.replace("/", "_") + ".json" if f[0] == ".": f = f[1:] return f def main(fname): # load filter ffname = "policy_%s" % filter_file(fname) filters = None try: filters = json.loads(ope...
1,176
433
"""Generic regex-based parser.""" import re from collections import deque from typing import Union, Any, List, Deque, Tuple, Dict, Callable from scoff.parsers.linematch import MatcherError, LineMatcher EMPTY_LINE = re.compile(b"\s*$") class ParserError(Exception): """Parser error.""" class DataParser: """...
5,826
1,605
#!/usr/bin/python3 ''' @author: snellenbach Config sequence model ''' from enum import Enum, unique import re from cfg.model.RegModelWrapper import RegModelWrapper from cfg.model.Utils import MsgUtils from cfg.output.OutBuilder import OutBuilder as ob # ------- config model node classes class BaseCfgNode: _nodeS...
34,279
9,863
# Exercício Python 097: Faça um programa que tenha uma função chamada escreva(), # que receba um texto qualquer como parâmetro e mostre uma mensagem com tamanho adaptável. # Ex: # escreva(‘Olá, Mundo!’) Saída: ...
922
192
#!/usr/bin/env python # vim: ai:sw=4:ts=4:sta:et:fo=croql # coding=utf-8 import pytest # Uncomment to run test in debug mode # import pudb; pudb.set_trace() from reinforcement_learning.dict_qtable import DictQTable from test_qaction import QActionTest from test_qstate import QStateTest """ DictQTable """ @pytest.m...
2,061
720
import tornado.web import tornado.gen import json import io import logging import motor from bson.objectid import ObjectId import mickey.userfetcher from mickey.basehandler import BaseHandler class AcceptMemberHandler(BaseHandler): @tornado.web.asynchronous @tornado.gen.coroutine def post(self): ...
2,851
819
from typing import Optional from dataclasses import dataclass from .InvoiceAppearance import InvoiceAppearance from .InvoiceCategory import InvoiceCategory from .PaymentMethod import PaymentMethod from .Source import Source @dataclass class AdditionalQueryParams: """Additional params of the invoice query :pa...
1,366
347
# # GDELT data will be published to Kafka # Topics will be created - one topic per country using the Alpha-2 country codes # from kafka import KafkaProducer from datetime import datetime import pickle # # Initialize the producer # brokerlist='ec2-54-186-208-110.us-west-2.compute.amazonaws.com:9092,ec2-52-11-172-126.u...
1,213
604
from src.infra.config import * from src.infra.db_entities import * from src.main.utils import hash_password db_conn = DBConnectionHandler() engine = db_conn.get_engine() Base.metadata.create_all(engine) with DBConnectionHandler() as db: try: new_user = Users(name='admin', role=1, email='admin@suzy.com', p...
529
168
import logging.config import random import re from collections import defaultdict from datetime import datetime from enum import Enum import requests from example.util import log_call from icq.bot import ICQBot, FileNotFoundException from icq.constant import TypingStatus from icq.filter import MessageFilter from icq....
14,767
4,527
#! /usr/bin/python3 import curses import sys import subprocess def main_menu(stdscr): k = 0 cursor_x = 0 cursor_y = 0 # Start colors in curses curses.start_color() curses.init_pair(1, curses.COLOR_CYAN, curses.COLOR_BLACK) curses.init_pair(2, curses.COLOR_RED, curses.COLOR_BLACK) cur...
2,920
1,024
import plotly.graph_objects as go import numpy as np def multi_trace(x, y, color, label=None, fig=None, insert_nans=False): """Create multiple traces that are associated with a single legend label Parameters ---------- x: array-like y: array-like color: str label: str, optional fig: g...
2,458
742
from django.conf import settings class SAMLServiceProviderSettings(object): contact_info = { # Contact information template, it is recommended to suply a # technical and support contacts. "technical": { "givenName": settings.SAML['CONTACT_INFO']['TECHNICAL']['GIVEN_NAME'], ...
5,997
1,597
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # 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 applicab...
25,972
6,754
from typing import List from please_conform import PleaseConform from structures import Interval class PleaseConformSquared(PleaseConform): def please_conform(self, caps: List[str]) -> List[Interval]: if len(caps) == 0: return list() caps: List[str] = caps.copy() caps.append...
1,547
421
from django import forms from .models import * class FormCadastraModelo(forms.ModelForm): class Meta: model = Modelo fields = ['nome', 'descricao', ] def __init__(self, *args, **kwargs): super(FormCadastraModelo, self).__init__(*args, **kwargs) for key in self.fields.keys()...
5,784
1,879
# -*- coding: utf-8 -*- """ Created on Mon Mar 2 16:43:45 2020 @author: micha """ import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns from MD_Analysis import Angle_Calc from pydmd import DMD pdb="pdbs/WT_295K_200ns_50ps_0_run.pdb" #Extract phi, psi angles A...
1,980
966
# Generated by Django 4.0.1 on 2022-02-18 10:26 from django.conf import settings import django.core.validators from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AU...
2,629
782
from telegram.ext import Updater, CommandHandler import re import os import logging from model import Anime from gateway import * def recommend_anime(bot, update): logging.debug('Received recommendation request') anime = get_best_anime().to_prettified_dict() logging.debug('Answer: '.format(anime)) cha...
24,914
8,783
from dataclasses import dataclass, field from typing import Optional from xml.etree.ElementTree import QName from .t_event_definition import TEventDefinition __NAMESPACE__ = "http://www.omg.org/spec/BPMN/20100524/MODEL" @dataclass class TCompensateEventDefinition(TEventDefinition): class Meta: name = "tC...
695
209
import html from googletrans import Translator from slackbot.bot import default_reply, respond_to, listen_to translator = Translator() def translate(message): msg_in = html.unescape(message.body["text"]) if msg_in != "": if translator.detect(msg_in).lang == "en": text = translator.transla...
822
266
from . import database
22
5
import collections import os from pathlib import Path from typing import List import streamlit as st from sentence_transformers import SentenceTransformer from search.engine import Engine, Result from search.model import load_minilm_model from search.utils import get_memory_usage os.environ["TOKENIZERS_PARALLELISM"]...
1,324
445
from tkinter import * class EditBoxWindow: def __init__(self, parent = None): if parent == None: parent = Tk() self.myParent = parent self.top_frame = Frame(parent) # Criando a barra de rolagem scrollbar = Scrollbar(self.top_frame) self.editbox = Text(...
1,596
516
import psycopg from flask import Flask, render_template from flask_compress import Compress app = Flask(__name__) DATABASE_URL = "" Compress(app) @app.route("/") def index(): with psycopg.connect(DATABASE_URL, sslmode="require") as conn: with conn.cursor() as cur: cur.execute("SELECT * FROM t...
426
131
import re class Bag: def __init__(self, _name, _contents): self.name = _name self.contents = _contents self.c_cache = None self.has_cache = {} def hasBagType(self, _name, bags): try: return self.has_cache[_name] except: if _name != self.name: for i in self.contents: if bags[i[1]].hasBagTyp...
1,404
606
from datetime import datetime, timedelta from io import BytesIO from pathlib import Path from time import altzone, daylight, localtime, timezone from pydrive.auth import GoogleAuth, AuthenticationRejected from pydrive.drive import GoogleDrive as Drive, GoogleDriveFile as File from requests import patch from .auth impor...
3,209
1,223
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function import pkg_resources import pytest import string import yaml definition_yamls = { fn for fn in pkg_resources.resource_listdir("dials_data", "definitions") if fn.endswith(".yml") } hashinfo_yamls = { fn for fn...
1,967
628