text
string
size
int64
token_count
int64
from bullet import Bullet, Prompt, Check, Input, YesNo from bullet import styles cli = Prompt( [ Bullet("Choose from a list: ", **styles.Example), Check("Choose from a list: ", **styles.Example), Input("Who are you? "), YesNo("Are you a student? ") ], spacing = 2 ) result =...
347
109
def test_pck_2012_adb(style_checker): """Style check test against pck_2012.adb.""" style_checker.set_year(2006) p = style_checker.run_style_checker('repo_name', 'pck_2012.ads') style_checker.assertEqual(p.status, 0, p.image) style_checker.assertRunOutputEmpty(p) def test_pck_2012_adb_with_alt_conf...
671
287
# -*- coding: utf-8 -*- import sys def amida(w, side_bar): result = [] side_bar.reverse() for x in range(1, w+1): status = x for bar in side_bar: if status == bar[0]: status = bar[1] elif status == bar[1]: status = bar[0] resu...
594
205
from timeit import default_timer import numpy as np class Profiler: __slots__ = ('active', 'gpuquery', 't0', 'cpubuffer', 'gpubuffer', 'counter', '_size', 'worst_cpu', 'worst_gpu') def __init__(self, gpu=False, ctx=None, buffer_size=200): self.active = False ...
1,832
631
import numpy as np from toolbox.exp.OutputSchema import OutputSchema from toolbox.utils.LaTeXSotre import EvaluateLaTeXStoreSchema from toolbox.utils.MetricLogStore import MetricLogStoreSchema from toolbox.utils.ModelParamStore import ModelParamStoreSchema from toolbox.utils.Visualize import VisualizeSchema class Ex...
2,972
976
import json import os from django.core.management import call_command from django.test.runner import DiscoverRunner from django.db import connections from dataloader.tests.data import data_manager class ODM2TestRunner(DiscoverRunner): test_connection = None database_alias = u'odm2' def setup_test_envir...
893
263
#Originally created By KingMars ✅ Rain Sequence 2 {Updated} from telethon import events import asyncio from collections import deque @ItzSjDude(outgoing=True, pattern=r"km_rain2") async def _(event): if event.fwd_from: return deq = deque(list("☁️⛈Ř/~\İŇ🌬⚡🌪")) for _ in range(100): await asyncio.sleep(0.1) a...
364
168
from preprocessing.generate_and_save_data import generate_and_save_data
73
22
import matplotlib.pyplot as plt import csv import statistics import math plt.title('Population Diversity') plt.ylabel('Diversity Score') plt.xlabel('Iteration Number') random = [] randombars = [] rmin = [] rmax = [] hill = [] hillbars = [] hmin = [] hmax = [] evo = [] emin = [] emax = [] evobars = [] cross = [] cross...
6,126
2,088
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import unicode_literals import logging from datetime import date import click from .data import DISCIPLINE_MAP from .outputs import OUTPUT_MAP @click.command() @click.option('--discipline', type=click.Choice(DISCIPLINE_MAP.keys()), required=True) @click...
1,918
597
import json with open('bibliography.json', 'r', encoding='utf-8') as bib_data: bib = sorted(json.load(bib_data), key=lambda d: d['ID']) with open('abstracts.json', 'r', encoding='utf-8') as tex_data: tex = sorted(json.load(tex_data), key=lambda d: d['ID']) ID1 = [b['ID'] for b in bib] ID2 = [t['ID'...
657
268
from .qton import Qcircuit, Qcodes import warnings warnings.filterwarnings("ignore") __all__ = [ # 'Simulator', 'Qcircuit', 'Qcodes' ]
147
54
from typing import Sequence import numpy class PizzeriasSearcher: """ This object takes the size of the city and number of shops, and construct the matrices each shop delivery can cover and number of delivery for each cell in the city. It can also computes number of delivery for a given cell, ...
7,563
2,236
import numpy as np import matplotlib.pyplot as plt import corner mcmc = np.loadtxt("mychain1.dat") ntheta = mcmc.shape[1] fig = plt.figure(1, figsize=(15, 6)) ax = fig.add_subplot(231) ax.hist(mcmc[:, 0]/np.log(10.0), 100, normed=True, range=(-0.9, -0.1)) ax = fig.add_subplot(232) ax.hist(mcmc[:, 1]/np.log(10.0)...
1,213
706
import numpy as np import pandas as pd import pastas as ps def acf_func(**kwargs): index = pd.to_datetime(np.arange(0, 100, 1), unit="D", origin="2000") data = np.sin(np.linspace(0, 10 * np.pi, 100)) r = pd.Series(data=data, index=index) acf_true = np.cos(np.linspace(0.0, np.pi, 11))[1:] acf = ps...
1,158
520
import warnings from .base import Registry __author__ = "Artur Barseghyan" __copyright__ = "2013-2021 Artur Barseghyan" __license__ = "MPL-1.1 OR GPL-2.0-only OR LGPL-2.1-or-later" __all__ = ("Registry",) warnings.warn( "The `Registry` class is moved from `tld.registry` to `tld.base`.", DeprecationWarning, )
320
135
# -*- coding: utf-8 -*- from valverest.database import db7 as db from sqlalchemy.ext.hybrid import hybrid_property class Solution(db.Model): __tablename__ = 'solutions' __bind_key__ = 'gps' sid = db.Column(db.Integer, primary_key=True) cid = db.Column(db.Integer, primary_key=True) x = db.Column(d...
2,963
1,125
from instruments import VNA_handler, Fridge_handler import os import time from datetime import date, datetime today = date.today() d1 = today.strftime("_%d_%m") directory = "data"+d1 dir_path=os.path.join(os.path.dirname(os.path.abspath(__file__)),directory) if not os.path.isdir(dir_path): try: os.mkdir(di...
2,091
835
#!/usr/bin/env python3 """ Get a json dump of all the repos belonging to a GitHub org or user. """ import json import os import sys from functools import reduce import requests url = "https://api.github.com/graphql" token = os.environ["GITHUB_TOKEN"] headers = {"Authorization": "bearer {}".format(token)} FIELDS =...
1,356
474
class BasicLogger: def __init__(self): self.loss_history = [] self.accuracy_history = [] self.val_loss_history = [] self.val_accuracy_history = [] self.initialise() def initialise(self): self.total_loss = 0 self.total_accuracy = 0 self.curren...
994
346
from conans import ConanFile, CMake, tools, RunEnvironment class CasadiTestConan(ConanFile): settings = "os", "compiler", "build_type", "arch" generators = ("cmake_paths", "cmake", "virtualrunenv", "virtualenv") _cmake = None def _configure_cmake(self): if self._cmake is None: se...
3,705
1,194
from django import template from datetime import datetime from datetime import date from datetime import time from datetime import timedelta register = template.Library() @register.filter def timediffer(now, posttime): posttime = posttime.replace(tzinfo=None) timedif= now -posttime timestr="" if timed...
1,995
668
""" title : ma.py description : Marshmallow object author : Amanda Garcia-Garcia version : 0 usage : python server_api.py python_version : 3.6.1 """ from flask_marshmallow import Marshmallow ma = Marshmallow()
254
82
#!/usr/bin/env python ### This program simulates Fisher's geometric model with abiotic change equal to fixations during conflict simulations (from FGMconflict.py) ### ### python3 FGMabiotic.py -help for input options ### ### Written by Trey J Scott 2018 ### ### python --version ### ### Python 3.5.2 :: Anaconda 4.2.0 (...
6,107
2,220
import spidev import RPi.GPIO as GPIO import time import yaml with open("config.yml", 'r') as f: cfg = yaml.load(f, Loader=yaml.FullLoader) # Pin definition RST_PIN = cfg['pinout']['RST_PIN'] DC_PIN = cfg['pinout']['DC_PIN'] CS_PIN = cfg['pinout']['CS_PIN'] BUSY_PIN = cfg['pinout']['BUSY_PIN'] # SPI device, bus...
873
433
from datetime import date from unicodedata import name from urllib import request import requests from bs4 import BeautifulSoup as bs import pandas as pd import datetime import os import zipfile import glob CoinName= input('Enter the coin name: ').upper() duration= input('Enter the duration of data you w...
2,469
883
from flask import Flask, jsonify, request, session,redirect, url_for import bcrypt from flask_sqlalchemy import SQLAlchemy from sqlalchemy.sql import func from sqlalchemy.exc import IntegrityError import os from sqlalchemy.orm import load_only from flask_bcrypt import Bcrypt import urllib.parse from itertools import g...
19,370
5,597
from django import forms from .pqrsf import pqrsf class ContactForm(forms.Form): #Atributos del formulario de contacto usuario = forms.CharField(label="Nombre", required=True, widget=forms.TextInput(attrs={'class':'formulario input', 'placeholder':'Nombre'})) correo = forms.EmailField(label="Correo Electr...
741
236
__doc__ = ''' This file is generated by the `prisma-client-py-tortoise-orm (0.2.2)`, Please do not modify directly. repository: https://github.com/mao-shonen/prisma-client-py-tortoise-orm ''' import typing from enum import Enum from tortoise import fields from tortoise.models import Model from prisma import base as b...
3,244
1,199
from os.path import join, realpath from os import listdir, environ import shlex import subprocess import pickle import json import pickle as pkl import time import numpy as np from copy import copy MODEL_PATH = ("/root/Projects/models/intel/person-detection-retail-0013/FP32" "/person-detection-retail-0...
2,536
848
# -*- coding: utf-8 -*- # Generated by Django 1.11.2 on 2018-11-06 08:34 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion def set_temp_program_id(apps, schema_editor): Indicator = apps.get_model('indicators', 'Indicator') for indicator in Indic...
2,883
831
import requests import json from urllib3.exceptions import HTTPError class Client(object): """Client to connect to the mockserver""" def __init__(self, host='localhost', port=1080): """ Class initialization :param str host: host of the mockserver :param int port: port of th...
4,335
1,120
from validators.validation_configurator import ValidationConfigurator from pipeline.models import InputFile class HugoValidator(object): # hugo_genes_map (Dictionary): a dictionary that has the hugo genes and # respective aliases. Each entry is db:{gene: Set(aliases),}. # This is created the first time th...
5,277
1,434
from ..utils import Object class InputMessageVideoNote(Object): """ A video note message Attributes: ID (:obj:`str`): ``InputMessageVideoNote`` Args: video_note (:class:`telegram.api.types.InputFile`): Video note to be sent thumbnail (:class:`telegram.api.type...
1,290
372
""" Exceptions for Read Group headers """ class NoReadGroupError(Exception): """NoReadGroupError""" class SamtoolsViewError(Exception): """SamtoolsViewError""" class InvalidPlatformError(Exception): """InvalidPlatformError""" class InvalidPlatformModelError(Exception): """InvalidPlatformError""" cl...
520
145
""" Tests for calculations. """ from __future__ import print_function from __future__ import absolute_import import os import numpy as np def test_process(logger_code): """ Test running a calculation. Also checks its outputs. """ from aiida.plugins import DataFactory, CalculationFactory fr...
2,098
656
class Table: def __init__(self, columns, name): self.columns = columns self.name = name class CreateTable: def __init__(self, table_obj, sheet_obj): self.table = table_obj self.sheet = sheet_obj def create_table(self): cols = len(self.table.columns) name = ...
2,155
674
#!/usr/bin/env python3 # -*- coding:utf-8 -*- """Requests test package initialisation."""
90
34
import json import logging import os from typing import List, Dict import click import numpy as np import tensorflow as tf from sklearn.metrics import cohen_kappa_score, precision_recall_fscore_support, accuracy_score from tqdm import tqdm from discopy.components.component import Component from discopy.components.con...
9,425
3,166
class Solution: def numSquares(self, n: int) -> int: if n==0: return 0 dp = [float('inf')]*(n+1) dp[0] = 0 c = n n = int(sqrt(n)) a = [i**2 for i in range(1,n+1)] for i in range(1,len(dp)): for j in a: ...
533
191
from django.db import models class Agency(models.Model): gtfs_agency_id = models.CharField(max_length=200) feed = models.ForeignKey('Feed') name = models.CharField(max_length=200) class Meta: unique_together = ('gtfs_agency_id', 'feed') def __str__(self): return f'{self.feed.slug...
361
132
from enum import Enum class Priority(Enum): MANDATORY = "mandatory" HIGH = "high" MEDIUM = "medium" LOW = "low" class Source(Enum): SOURCE = "source" TRANSFORM = "transform" LOOKUP = "lookup" class Category(Enum): MISSING = "missing" INCORRECT = "incorrect" DUPLICATE = "dup...
328
131
from flask import Flask, render_template, request, url_for, redirect from forms import * from model import generate_recommendations, get_desc import os app = Flask(__name__) SECRET_KEY = os.urandom(32) app.config['SECRET_KEY'] = SECRET_KEY @app.route('/', methods=["GET", "POST"]) def landing(): title = 'Neurolens...
2,386
865
import matplotlib import matplotlib.pyplot as plt import numpy as np labels = ['AP on bin (0,10)', 'AP on bin (10,100)'] baseline = [0.0, 13.3] fc2_ncm = [6.0, 18.9] fc2 = [8.6, 22.0] fc3_rand = [9.1, 18.8] fc3_ft = [13.2, 23.1] x = np.arange(len(labels)) # the label locations width = 0.15 # the width of the bars ...
2,057
885
from datetime import datetime from itertools import count from tkinter import * import tkinter.ttk as ttk from functools import partial from tkcalendar import DateEntry from case import COD, CONTRIES, Case, INCIDENT, ORGANIZATION, POLICESTATION, STATES from db import referred_other_agency from preview import CasePrev...
9,916
3,087
""" Use repro_eval from the command line with e.g. python -m repro_eval -t rpd -q qrel_orig -r orig_b rpd_b python -m repro_eval -t rpd -q qrel_orig -r orig_b orig_a rpd_b rpd_a python -m repro_eval -t rpd -m rmse -q qrel_orig -r orig_b rpd_b python -m repro_eval -t rpl -q qrel_orig qrel_rpl -r orig_b rpl_b python...
7,406
2,224
import math from game_objects import Turret, Troop players = [] class Location: def __init__(self, x: int, y: int): self.x = x self.y = y class Lane: # for this prototype we are going to imagine our lanes as straight lines def __init__(self, left_start_location: Location, right_start_l...
2,377
742
import os from pathlib import Path from difflib import SequenceMatcher supported_bibtex_types = {"article", "book", "booklet", "inbook", "incollection", "inproceedings", "manual", "mastersthesis", "misc", "phdthesis", "proceedings", "techreport", "unpublished"} supported_fields = ["author",...
7,110
2,154
from selenium import webdriver import time import userdata as udata import random randomUsers = set() class Browser: def __init__(self, link): self.link = link self.browser = webdriver.Chrome() Browser.Instagram(self) Browser.Login(self) Browser.goFollowers(s...
2,105
680
''' Title : Linear Algebra Subdomain : Numpy Domain : Python Author : codeperfectplus Created : 10 May 2020 ''' import numpy n=int(input()) a=numpy.array([input().split() for _ in range(n)],float) print(round(numpy.linalg.det(a),2))
246
93
# -*- coding: utf-8 -*- import numpy as np from ..dim_processors_base import DimProcessorBase from ...registry import DIMPROCESSORS from sklearn.preprocessing import normalize from typing import Dict, List @DIMPROCESSORS.register class L2Normalize(DimProcessorBase): """ L2 normalize the features. """ ...
774
241
import csv import person from random import randrange headers = ['Name', 'Messages', 'Char Count', 'Likes Given', 'Likes Received', 'Image URL'] #tester code people = ['bob', 'joe', 'gmo'] bob = person.Person(111, 'bob', 'www.bob.com', people) joe = person.Person(222, 'joe', 'www.joe.com', people) gmo = p...
1,631
670
import pandas as pd from hydroDL.data import usgs, gageII, gridMET, ntn, GLASS, transform, dbBasin import numpy as np import matplotlib.pyplot as plt from hydroDL.post import axplot, figplot from hydroDL import kPath, utils import json import os import importlib from hydroDL.master import basinFull from hydroDL.app.wa...
866
362
import math as m import numpy as np from BDMesh import Mesh1DUniform from BDFunction1D import Function from BDFunction1D.Functional import Functional from BDFunction1D.Interpolation import InterpolateFunction from BDPoisson1D.DirichletNonLinear import dirichlet_non_linear_poisson_solver_arrays from BDPoisson1D.Dirich...
9,733
3,382
import argparse import gzip import os import pytest from ..dumpSTR import * from trtools.testsupport.utils import assert_same_vcf, assert_same_file # Set up base argparser @pytest.fixture def args(tmpdir): args = argparse.ArgumentParser() args.vcf = None args.vcftype = "auto" args.out = str(tmpdir /...
23,282
8,758
begin_unit comment|'# Copyright 2012 Andrew Bogott for the Wikimedia Foundation' nl|'\n' comment|'#' nl|'\n' comment|'# Licensed under the Apache License, Version 2.0 (the "License"); you may' nl|'\n' comment|'# not use this file except in compliance with the License. You may obtain' nl|'\n' comment|'# a copy ...
27,895
14,357
# -*- coding: utf-8 -*- """ 1946. Largest Number After Mutating Substring https://leetcode.com/problems/largest-number-after-mutating-substring/ Example 1: Input: num = "132", change = [9,8,5,0,3,6,4,2,6,8] Output: "832" Explanation: Replace the substring "1": - 1 maps to change[1] = 8. Thus, "132" becomes "832". "8...
2,554
936
import pytest from bot.bot import Bot class TestBotClass: # Can't instantiate abstract classes. skipping test for abstract class. def setup(self): self.bot = 1 def test_init(self): test_bot = 1 assert test_bot == self.bot
261
81
""" Hackerrank Day 9: Recursion 3 https://www.hackerrank.com/challenges/30-recursion/problem?h_r=email&unlock_token=bc6d5f3963afb26ed0b2f69c3f4f3ddb1826e1b2&utm_campaign=30_days_of_code_continuous&utm_medium=email&utm_source=daily_reminder Objective Today, we are learning about an algorithmic concept called recursion....
1,437
470
from django.db import models class Card(models.Model): """ Stores all information about the TODOlist item """ id = models.AutoField(primary_key=True) name = models.CharField('Название', max_length=50) description = models.TextField('Описание', max_length=500) is_archived = models.BooleanFi...
408
127
import logging from qbrobot import qsettings try : from util import send_dingding except ImportError: DINGDING_CANUSE = False else: DINGDING_CANUSE = True """ class DingDingLogger pass all args to logger.method, and call dingding.send_msg() 1. debug message don't send to dingding. 2....
2,358
826
# %% import os import pandas as pd import numpy as np import datetime # %% CARGA DE DATOS path = r'F:\Trabajo\Promotive\Chile\PRT\7\CSV\3' os.chdir(path) files = os.listdir(path) files # %% files_xls = [f for f in files if f[-3:] == 'csv'] files_xls # %% columnas = ['PPU', 'MARCA', 'MODELO', 'ANO_FABRICACION', 'NU...
722
320
import os.path as osp import numpy as np from PIL import Image import torch.utils.data as data import torch __all__ = ['LFW_CROP'] EXTENSION_FACTOR = 2 class LFW_CROP(data.Dataset): def __init__(self, train, transform, args): self.root = osp.join(args.data_root, 'lfw') self.transform = transfor...
3,850
1,307
from pyimei import ImeiSupport def checkImeisArray(imeis): for imei in imeis: if ImeiSupport.isValid(imei): print("IMEI: '{}' is valid".format(imei)) else: print("IMEI '{}' is NOT valid".format(imei)) #testing classes ImeiSupport.test() valid_imeis = [ 356...
1,065
503
""" .. code-block:: python from aioauth import responses Response objects used throughout the project. ---- """ from dataclasses import dataclass, field from http import HTTPStatus from typing import Dict from .collections import HTTPHeaderDict from .constances import default_headers from .types import ErrorTyp...
2,175
670
#!/usr/bin/env python3 import logging import platform import time from functools import partial from statistics import stdev from typing import List, Tuple, Dict, Union, Any import psutil from joblib import Parallel, delayed from fimdp.objectives import BUCHI from fipomdp import ConsPOMDP from fipomdp.energy_solvers ...
5,441
1,881
import network import time # deactivate AP ap = network.WLAN(network.AP_IF) ap.active(False) # activate static network wlan = network.WLAN(network.STA_IF) wlan.active(True) # connect to local WIFI wlan.connect('TFM-Attendees') # wait until connected while not wlan.isconnected(): print('connecting...') time....
399
142
import asyncio import logging import os import time from addict import Addict from aiogram.types import Message from hikcamerabot.config.config import get_result_queue from hikcamerabot.constants import Event, VideoGifType from hikcamerabot.utils.utils import format_ts, gen_random_str class RecordVideoTask: _vi...
3,317
1,014
""" Provides functionalilty for working with celled hypercubes. Hypercubes are extensions of lines, squares and cubes into higher dimensions. Celled hypercubes can be thought as a grid or lattice structure. From this point, hypercubes is used to mean celled hypercubes. A hypercube can be described by its dimension a...
71,349
27,643
# Package version __version__ = "0.16.31"
42
19
class SelectelException(ValueError): pass class InvalidSchema(SelectelException): pass class EmptyUsername(SelectelException): pass class EmptyPassword(SelectelException): pass class EmptyContainerName(SelectelException): pass
255
73
# SPDX-FileCopyrightText: 2021 Division of Intelligent Medical Systems, DKFZ # SPDX-FileCopyrightText: 2021 Janek Groehl # SPDX-License-Identifier: MIT from simpa.core.device_digital_twins import SlitIlluminationGeometry, LinearArrayDetectionGeometry, PhotoacousticDevice from simpa import perform_k_wave_acoustic_forw...
11,140
3,813
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2016, Silvio Peroni <essepuntato@gmail.com> # # Permission to use, copy, modify, and/or distribute this software for any purpose # with or without fee is hereby granted, provided that the above copyright notice # and this permission notice appear in all copies. ...
10,881
3,527
from rest_framework import serializers from backend_app import models class AllowedPropertySerializer(serializers.ModelSerializer): class Meta: model = models.AllowedProperty fields = '__all__' # exclude = ['id'] class DatasetSerializer(serializers.ModelSerializer): class Meta: ...
3,823
1,061
"""The database connection manager. """ import logging import psycopg2 class DatabaseConnection(): """Database connection manager. """ def __init__(self, host, port, user, dbname, password, sslmode): self._conn = None self._host = host self._port = port self._user = user ...
1,296
306
""" cvp.py Functions for generating CVP feeds. :copyright: (C) 2014 by github.com/alfg. :license: MIT, see README for more details. """ def cvp_player_to_dict(player): """ Convert a player object from a Tree to a CVP-compliant dict. """ return { "session": player.session, "userid": ...
1,154
403
# Copyright (C) 2010 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
5,951
1,858
# -*- coding: utf-8 -*- from skimage import transform import tensorflow as tf import numpy as np import glob import face_recognition as FR import os import shutil def read_one_image(image_file, width, height): # img = io.imread(image_file) img = FR.load_image_file(image_file) img = transform.resize(img,(wi...
2,796
1,173
def cyl(h, r): area_cyl = 2 * 3.14 * r * h return(area_cyl) def con(r, l): area_con = 3.14 * r * l return(area_con) def final_price(cost): tax = 0.18 * cost re_price = cost + tax return(re_price) print("Enter Values of cylindrical part of tent ") h = float(input("Height : ")) r = float(inpu...
693
276
# Plotly integration for the Moku:Lab Datalogger # Copyright 2016 Liquid Instruments Pty. Ltd. from pymoku import InvalidOperationException def stream_init(moku, uname, api_key, str_id1, str_id2, npoints=100, mode='lines', line={}): line = ';'.join([ '='.join(i) for i in list(line.items())]) settings = [ ('plo...
1,282
522
import publisher test_pdf_filename = "test/test.pdf" test_css_filename = "test/test.css" test_md_filename = "test/test.md" test_html_filename = "test/test.html" test_sender = "cpg@yakko.cs.wmich.edu" test_recipient = "cpgillem@gmail.com" test_md = "# Test heading\n\n- test item 1\n- test item 2" def from_html_file()...
1,126
428
from .train import Train
24
6
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('orgs', '0013_auto_20150715_1831'), ('contacts', '0004_auto_20150324_1024'), ('msgs', '0004_message_pollrun'), ] oper...
1,185
366
#!/usr/bin/env python # -*- coding:utf-8 -*- from .Contract import * from .Receivable import * from .Receipt import * from .Shop import * from .Statement import * from .Application import *
191
63
# -*- coding: utf-8 -*- import csv from stop_words import get_stop_words from nltk.stem.porter import PorterStemmer from gensim import corpora import gensim import os import re from nltk.tokenize import RegexpTokenizer #SET PATH path = r'' inputname="" def remove_html_tags(text): """Remove html tags from a s...
1,630
583
#!/usr/bin/env python import sys import os sys.path.append(os.path.join(os.path.dirname('__file__'), '..', 'src')) from random import randint from datetime import datetime, timedelta from logsandra.model.client import CassandraClient client = CassandraClient('test', 'localhost', 9160, 3) keywords = ['foo', 'bar', ...
596
215
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup, find_packages setup( # name of the lib name='bioshadock_biotools', # version version='1.0.1', packages=find_packages(), author="Francois Moreews", description="Import tool for biotools from Dockerfile", i...
867
284
import numpy as np from tensorflow.keras.models import Sequential from tensorflow.keras.layers import Dense from tensorflow.keras.optimizers import RMSprop from tensorflow.lite.python import lite X_train = np.array([[0.0, 0.0], [1.0, 0.0], [0.0, 1.0], [1.0, ...
1,176
431
from django.db import models from django.contrib.auth.models import AbstractUser from django.utils.translation import ugettext_lazy as _ class User(AbstractUser): """ Extends the basic django user model with a longer first and last name """ first_name = models.CharField( _("first name"), ...
473
140
import logging from abc import ABC, abstractmethod from os.path import isfile, splitext import pathlib import torch from .waveform import get_waveform logger = logging.getLogger(__name__) class Feature(ABC): def __init__(self, params): self.params = params super().__init__() @abstr...
1,710
532
import os import sys import serial import time import struct ser = serial.Serial('/dev/ttyACM0',9600) led = sys.argv[1] act = sys.argv[2] l = str(led) """a = str(act)""" time.sleep(5) ser.write(struct.pack(l.encode()) """ ser.write(l.encode()) """
251
105
""" Primary module for Froggit This module contains the main controller class for the Froggit application. There is no need for any additional classes in this module. If you need more classes, 99% of the time they belong in either the lanes module or the models module. If you are unsure about where a new class should...
11,397
3,183
import logging from functools import wraps from PIL import Image, ImageFont, ImageDraw from config import LIST_ALLOWED_USERS def restricted(func): @wraps(func) def wrapped(_, bot, update, *args, **kwargs): user_id = update.effective_user.id if LIST_ALLOWED_USERS: if user_id not in LIST_ALLOWED_USER...
1,252
443
from .Camera import * from .GloveBox import * from .Microscope import * from .Stage import * from .UserInterface import * from .NeuralNetwork import *
152
47
""" Copyright 2019-2021 Boris Shminke 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 t...
4,444
1,367
from __future__ import absolute_import, division, print_function import cv2 import random import numpy as np import colorsys import matplotlib.pyplot as plt import matplotlib.patches as patches from matplotlib.patches import Polygon from skimage.measure import find_contours def log(text, array=None): """Prints a...
7,501
2,622
import pytest @pytest.fixture(autouse=True) def set_up(monkeypatch): monkeypatch.setenv('TABLE_NAME', 'test-table') monkeypatch.setenv('TWILIO_ACCOUNT_SID', 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') monkeypatch.setenv('TWILIO_AUTH_TOKEN', 'my_auth_token')
265
110
"""Particle filters for inference in state space models.""" import abc from typing import Tuple, Dict, Callable, Any, Optional import numpy as np from numpy.random import Generator from scipy.special import logsumexp from scipy.sparse import csr_matrix from dapy.filters.base import AbstractEnsembleFilter from dapy.mod...
7,741
1,999
import random class Pokemon: def __init__(self, especie, level=None, nome=None): self.especie = especie if nome: self.nome = nome else: self.nome = especie if level: self.level = level else: self.level = ra...
1,477
521
""" Copyright 2011 Shao-Chuan Wang <shaochuan.wang AT gmail.com> 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 ...
2,254
774