text
string
size
int64
token_count
int64
import enc import config import motor import threading import time enc_t = None pwm_range = (50, 90) class EncoderThread(enc.EncoderReader, threading.Thread): def __init__(self): enc.EncoderReader.__init__(self) threading.Thread.__init__(self) def main(): global enc_t enc_t = EncoderTh...
1,198
411
from typing import Final, Literal DefaultPermissionsType = Final[list[tuple[str, str]]] # Default ResponsibleGroup types PRIMARY_TYPE: Literal["PRIMARY"] = "PRIMARY" HR_TYPE: Literal["HR"] = "HR" ORGANIZATION: Final = "Organization member" INDOK: Final = "Indøk" REGISTERED_USER: Final = "Registered user" PRIMARY_GRO...
1,364
484
from __future__ import annotations from typing import Optional from colorama import Fore, Style from magda.utils.logger.parts import LoggerParts from magda.utils.logger.printers.base import BasePrinter from magda.utils.logger.printers.shared import with_log_level_colors class MessagePrinter(BasePrinter): EVENT_S...
1,037
331
from typing import List def zcount(list: List[float]) -> float: return len(list) # print("stats test") # print("zcount should be 5 ==", zcount([1.0,2.0,3.0,4.0,5.0])) def zmean(list: List[float]) -> float: return sum(list) / zcount(list) def zmode(list: List[float]) -> float: return max(set(list), key...
1,615
594
"""Mixtape Model.""" from masoniteorm.models import Model class Mixtape(Model): __table__="mixtape"
106
40
import numpy as np from scipy.linalg import solve_toeplitz, solve from scipy.signal import fftconvolve from scipy.interpolate import Rbf from scorr import xcorr, xcorr_grouped_df, xcorrshift, fftcrop, corr_mat # Helpers # ===================================================================== def integrate(x...
10,872
3,816
from longest import longest import unittest class Test(unittest.TestCase): def test_1(self): result = longest("aretheyhere", "yestheyarehere") self.assertEqual(result, "aehrsty") def test_2(self): result = longest("loopingisfunbutdangerous", "lessdangerousthancoding") self.ass...
661
224
name = "getv"
14
8
#!/usr/bin/env python # -*- coding: utf-8 -*- """ @author: zparteka """ def read(infile): with open(infile, 'r') as f: line = f.readline() rules = {} while line != "\n": rule = line.strip().split(':') key = rule[0] r1 = rule[1].split()[0].split("-") ...
3,035
944
''' ''' from django.contrib.auth.models import User, Group from rest_framework import status, viewsets from rest_framework.exceptions import ValidationError from rest_framework import mixins from rest_framework.filters import OrderingFilter from django_filters.rest_framework import DjangoFilterBackend fr...
1,527
469
from random import randint from core.players import Players class Human(Players): def __init__(self, name, classe): super().__init__(name, classe) self.hp = 100 self.strengh = 15 self.defense = 15 self.speed = 50 def __str__(self, super_desc=None, super_stats=None): ...
2,481
876
from raytracerchallenge_python.tuple import Color from math import pow class Material: def __init__(self): self.color = Color(1, 1, 1) self.ambient = 0.1 self.diffuse = 0.9 self.specular = 0.9 self.shininess = 200.0 self.pattern = None self.reflective = 0.0 ...
1,893
560
import subprocess, shlex from dawgmon import commands def local_run(dirname, commandlist): for cmdname in commandlist: cmd = commands.COMMAND_CACHE[cmdname] # shell escape such that we can pass command properly onwards # to the Popen call cmd_to_execute = shlex.split(cmd.command) p = subprocess.Popen(cmd_...
673
240
class Employee(): def __init__(self, name, doc_number, salary): self._name = name self._doc_number = doc_number self._salary = salary
162
49
import matplotlib.pyplot as plt years = [1950, 1955, 1960, 1965, 1970, 1975, 1980, 1985, 1990, 1995, 2000, 2005, 2010, 2015] pops = [2.5, 2.7, 3, 3.3, 3.6, 4.0, 4.4, 4.8, 5.3, 5.7, 6.1, 6.5, 6.9, 7.3] deaths = [1.2, 1.7, 1.8, 2.2, 2.5, 2.7, 2.9, 3, 3.1, 3.3, 3.5, 3.8, 4, 4.3] plt.plot(years, pops, color=(255/255, 1...
504
351
import tkinter as tk from tkinter import ttk from matplotlib.pyplot import close from matplotlib.figure import Figure from matplotlib.backends.backend_tkagg import (FigureCanvasTkAgg, NavigationToolbar2Tk) from matplotlib.mathtext import math_to_image from io import BytesIO from PIL import ImageTk, Image from sympy im...
38,747
12,571
from .audit import auditApiCall from .exceptions import InvalidCommand __all__ = ['Host'] class Host(object): """ The Host provides an abstraction of the caller of API functions. Largely to provide information about the Document state to the Manager, without requiring specific knowledge of which host it is...
6,136
1,657
import copy import queue import pydot class NZP: def __init__(self): self.names = ['-', '0', '+'] self.vals = [-1, 0, 1] self.stationary = [False, True, False] class ZP: def __init__(self): self.names = ['0', '+'] self.vals = [0, 1] self.stationary = [True, Fa...
17,259
5,439
from fhwebscrapers.B3derivatives.curvasb3 import ScraperB3 from fhwebscrapers.CETIP.getcetipdata import CETIP __all__ = ['ScraperB3', 'CETIP']
144
66
from .lite_data_store import LiteDataStore
43
15
from conf import settings import pandas as pd import numpy as np import datetime import os def stringify_results(res, reg_conf, regression_key): res_string = """ ------------------------------- {datetime} SELECTED MODEL: {model} Link Function (y-transform): {link} Other Transformations (x-t...
6,040
2,040
# print("aaaaaaaaaa bbbbbbbbbb") # # print(chr(27) + "[2J") import os import sys from enum import Enum import signal print(getOutputType()) exit() # import os # os.system('cls' if os.name == 'nt' else 'clear') size = os.get_terminal_size() print(size[0]) if signal.getsignal(signal.SIGHUP) == signal.SIG_DFL...
665
271
import os import time import cv2 import random import colorsys import numpy as np import tensorflow as tf import pytesseract import core.utils as utils from core.config import cfg import re from PIL import Image from polytrack.general import cal_dist import itertools as it import math # import tensorflow as tf physica...
7,674
2,865
from setuptools import setup from codecs import open from os import path NAME_REPO="imagechain" here = path.abspath(path.dirname(__file__)) with open(path.join(here, 'README.md'), encoding='utf-8') as f: long_description = f.read() setup( name=NAME_REPO, packages=[NAME_REPO], version='0.1', lice...
765
255
from django import forms from .models import * from django import forms from django.contrib.auth.forms import UserCreationForm from django.db import transaction from bookstoreapp.models import * #ordersystem from django import forms # from django.contrib.auth.models import User from django.contrib.auth import get_user...
3,077
904
import sys, pygame,math import numpy as np from pygame import gfxdraw import pygame_lib, nn_lib import pygame.freetype from pygame_lib import color import random import copy import auto_maze import node_vis
207
61
import os def parse_config_env(default_dict): config_dict = {} for key, value in default_dict.items(): config_dict[key] = os.environ.get(key, value) return config_dict SMTP_KEYS = { "SMTP_HOST": "localhost", "SMTP_PORT": 25, "SMTP_FROM": "no-reply@example.com", "SMTP_USER": Non...
563
245
#!/usr/bin/env python # pylint: disable=redefined-outer-name,too-many-arguments,too-many-locals """The actual fixtures, you found them ;).""" import logging import itertools from base64 import b64encode from distutils.util import strtobool from functools import partial from pathlib import Path from ssl import creat...
31,253
9,473
import socket import threading import FetchData class TCPserver(): def __init__(self): self.server_ip="localhost" self.server_port=9998 def main(self): server = socket.socket(socket.AF_INET,socket.SOCK_STREAM) server.bind((self.server_ip,self.server_port)) s...
1,346
428
#source code: https://github.com/alvarobartt/trendet import psycopg2, psycopg2.extras import os import glob import csv import time import datetime import string import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns from matplotlib import patches from matplotlib.pyplot import fi...
11,122
3,438
class AbstractSummarizerAlgo(object): """ AbstractSummarizerAlgo defines the run method that every text summarization must implement. """ def run(self, text, percentage): raise NotImplementedError('Subclasses must override run()!')
257
67
import requests import json content = None with open("scored_output.json") as file: content = json.load(file) matrix = [[0 for i in range(len(content))] for j in range(len(content))] mapping = {} for i, origin in enumerate(content): mapping[i] = origin for j, destination in enumerate(content): pr...
978
326
''' __author__: Ellen Wu (modified by Jiaming Shen) __description__: A bunch of utility functions __latest_update__: 08/31/2017 ''' from collections import defaultdict import set_expan import eid_pair_TFIDF_selection import extract_seed_edges import extract_entity_pair_skipgrams def loadEidToEntityMap(filename): eid...
2,416
853
#!/usr/bin/env pytest-3 import pytest # Exercice: iter def multiples_of(n): i = 0 while True: yield i i += n # test def test_iter(): gen = multiples_of(3) for n, mult in enumerate(gen): assert n * 3 == mult if n >= 100: break for n, mult in enumerat...
534
197
from onegov.gis.forms.fields import CoordinatesField from onegov.gis.forms.widgets import CoordinatesWidget __all__ = ['CoordinatesField', 'CoordinatesWidget']
161
48
"""Release Planning.""" import argparse import github3 import logging import os import sys import traceback from pds_github_util.issues.utils import get_labels, is_theme from pds_github_util.zenhub.zenhub import Zenhub from pds_github_util.utils import GithubConnection, addStandardArguments from pkg_resources import...
8,468
2,531
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.contrib.auth.models import AbstractUser from django.db import models # Create your models here. class User(AbstractUser): """ Bu model kullanıcılar için kullanılacaktır. """ adres = models.CharField(max_length=255, null=True...
612
213
""" Aravind Veerappan BNFO 601 - Exam 2 Question 2. Protein BLAST """ import math from PAM import PAM class BLAST(object): FORWARD = 1 # These are class variables shared by all instances of the BLAST class BACKWARD = -1 ROW = (0, 1) COLUMN = (1, 0) def __init__(self, query=None,...
19,404
5,707
class Solution(object): def isHappy(self, n): """ :type n: int :rtype: bool """ table = set() while n != 1: if n in table: return False else: table.add(n) sum = 0 while n > 0: ...
437
121
n = input('Digite um algo: ') print(n.isalpha()) print(n.isupper())
68
28
# -*- coding: utf-8 -*- from setuptools import setup, find_packages with open('README.md') as f: readme = f.read() setup( name='ilias2nbgrader', version='0.4.3', license='MIT', url='https://github.com/DigiKlausur/ilias2nbgrader', description='Exchange submissions and feedbacks between ILIAS an...
717
257
from __future__ import absolute_import, print_function from numba import jit import numpy as np # from externals.six.moves import range def bayes_boot_probs(n): """Bayesian bootstrap sampling for case weights Parameters ---------- n : int Number of Bayesian bootstrap samples Re...
2,343
760
from django.shortcuts import render, get_object_or_404 from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from django.views.generic import ListView from .models import Post , Comment from .forms import EmailPostForm , CommentForm , SearchForm from django.core.mail import send_mail from taggit.mod...
4,820
1,357
from django.utils import timezone from django.db.models import Q from celery.decorators import task, periodic_task from celery.utils.log import get_task_logger from celery.task.schedules import crontab from accounts.models.user_profile import ClubUserProfile from management.models.activity_apply import ActivityApplica...
2,424
845
import threading from datetime import datetime from io import BytesIO capture_lock = threading.Lock() def take_picture(camera): # Create an in-memory stream stream = BytesIO() camera.rotation = 180 camera.annotate_text = datetime.now().strftime('%Y-%m-%d %H:%M:%S') with capture_lock: cam...
433
147
import pytest from tests.tf_tests.functional import BaseFunctionalTest, TENSORFLOW_SUPPORTED, TENSORFLOW_AVAILABLE, MODEL, DATA class TestTFInference(BaseFunctionalTest): def test_get_acc(self): from deeplite.tf_profiler.tf_inference import get_accuracy assert get_accuracy(MODEL, DATA['test']) < 10...
692
260
# Copyright (c) 2008-2011, Jan Gasthaus # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, this # list of conditions...
24,372
8,208
# Generated by Django 3.2.6 on 2021-09-24 07:53 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ("documents", "0006_auto_20210924_0613"), ] operations = [ migrations.RemoveField( model_name="documentsort", name="html_fragm...
343
127
# Copyright 2019 AT&T Intellectual Property. All other 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...
8,061
2,208
import numpy as np from optparse import OptionParser from sigvisa.treegp.gp import GP, GPCov from sigvisa import Sigvisa from sigvisa.source.event import get_event from sigvisa.treegp.cover_tree import VectorTree import pyublas def main(): parser = OptionParser() s = Sigvisa() cursor = s.dbconn....
2,162
752
# ================================================= # GUI program to analyse STEM images of filamentous structures: TRACKING # ----------------------------------------------------------------------------- # Version 1.0 # Created: November 7th, 2017 # Last modification: January 8th, 2019 # author: @Cristina_MT # ...
1,048
378
import random p = [4, 3, 4, 4, 5, 3, 5, 4, 4, 5, 4, 4, 3, 4, 5, 4, 3, 4] b = ['b', 0, 'B'] f = [{i: [0, 0] for i in range(4)} for z in range(3)] w = None for r in range(3): c = True a = [0, 1, 2, 3] m = None while c: t = [map(lambda x: random.randint(x-1, x+1), p) for i in range(4)] s = ...
946
463
"""Util module tests """ import os.path from unittest import TestCase import mupub from clint.textui.validators import ValidationError from .tutils import PREFIX _SIMPLE_PATH = os.path.join(PREFIX, 'SorF', 'O77', 'sorf-o77-01',) _LYS_PATH = os.path.join(PREFIX, 'PaganiniN', 'O1', 'Caprice_1',) class UtilsTest(TestCa...
1,479
496
"""CLI handling for `routemaster`.""" import logging import yaml import click import layer_loader from routemaster.app import App from routemaster.cron import CronThread from routemaster.config import ConfigError, load_config from routemaster.server import server from routemaster.middleware import wrap_application fr...
2,736
842
import datetime import logging import moto import pytest from .. import s3_cleanup class TestBucketsMoreThanTTL: @pytest.fixture def test_class(self): with moto.mock_s3(): whitelist = {} settings = { "general": {"dry_run": False}, "services": {...
2,988
912
""" When a widget is positioned with sticky, the size of the widget itself is just big enough to contain any text and other contents inside of it. It won’t fill the entire grid cell. In order to fill the grid, you can specify "ns" to force the widget to fill the cell in the vertical direction, or "ew" to fill the cell ...
965
345
#!/usr/bin/env python ''' ************************************************************************** * This class performs most of the graph manipulations. * @authors Benjamin Renoust, Guy Melancon * @created May 2012 ************************************************************************** ''' import json impo...
27,529
7,359
# coding: utf-8 """ Functions for working with pitch data This file depends on the praat script get_pitch_and_intensity.praat (which depends on praat) to extract pitch and intensity values from audio data. Once the data is extracted, there are functions for data normalization and calculating various measures from the...
20,151
6,247
import pandas as pd from keras.models import Sequential from keras.layers import Dense, Dropout from keras.wrappers.scikit_learn import KerasClassifier from keras.utils import np_utils # return the best three results def top_n(matrix_prob, label_map): ans = [] for line in matrix_prob: rank = [label_map[item[0]] fo...
1,488
568
import numpy as np import cv2 import os import time import requests import shutil def get_route_tile(x, y, out_file): #http://mt1.google.com/vt/lyrs=y&x=5975&y=2598&z=13 url = 'http://mt1.google.com/vt/lyrs=y&x={}&y={}&z=13'.format(x, y) response = requests.get(url, stream=True) with open(out_file, 'wb') ...
2,012
870
"""Example __init__.py to wrap the wod_latency_submission module imports.""" from . import model initialize_model = model.initialize_model run_model = model.run_model DATA_FIELDS = model.DATA_FIELDS
200
64
# -*- coding: utf-8 -*- """ Clustering Methods """ import numpy as np from sklearn.cluster import KMeans from sklearn.preprocessing import normalize class ClusteringMethods: """ Base class of clustering methods """ @staticmethod def _normalize_values(arr, norm=None, axis=None): """ Normal...
1,933
555
from .controller_sorteosLnac import sorteosLnac
47
17
""" This folder contains training loops and accompanying loggers and listeners """
87
22
import os def boot(): print print (' _____ _____ _____ _____ _____ _______ _____ ') print (' /\ \ /\ \ /\ \ /\ \ /...
3,902
1,275
#Python的内建模块itertools提供了非常有用的用于操作迭代对象的函数。 import itertools #从10开始数自然数 naturals =itertools.count(10) from collections import Iterator #判断naturals的类型 print(isinstance(naturals,Iterator)) for x in naturals: if x>70: break print(x) #cycle()会把传入的一个序列无限重复下去: cycles =itertools.cycle("szhualeilei") pr...
918
478
# 该模块提供了一个数据库的通用CURD接口 # 通过该接口能够快速进行数据库的增删查改功能 # 该模块还提供了获取数据库所有表表名,各表表头的接口 import traceback import pymysql from userManage import commmitChangeToUserlist, privilegeOfUser, ifManage global db # TODO: improve the robustness def checkValibleTableName(targetTable, user): if user != None and targetTable == 'user_lis...
8,536
2,882
from __main__ import *
23
8
N = int(input()) nums = [] for _ in range(N): nums.append(int(input())) nums.sort() for num in nums: print(num)
121
52
from typing import Optional import specs import validatorlib as vlib class ASAPValidator(vlib.BRValidator): # Always $lash and prosper! validator_behaviour = "asap" def attest(self, known_items) -> Optional[specs.Attestation]: # Not the moment to attest if self.data.current_atte...
1,207
369
# -*- coding: utf-8 -*- # show.py # Copyright (c) 2016-?, Matěj Týč # 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...
3,864
1,306
""" Distributions (Re)generation Script This script generates likelihood and cost distributions based on threat intelligence data stored in a connected Neo4j graph database. It attempts to do so for every possible permutation of (size, industry) values. These are then consumed by `montecarlo.py`, ...
9,897
3,129
print("hello from santa")
26
9
# Copyright (c) 2014 Rackspace, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
3,939
1,207
# vim: set ts=2 expandtab: # -*- coding: utf-8 -*- """ Module: info.py Desc: print current stream info Author: on_three Email: on.three.email@gmail.com DATE: Sat, Oct 4th 2014 This could become very elaborate, showing stream status (up/down) and number of viewers, etc, but at present i'm just going to display...
1,476
508
#1 number = int(input("Enter a number to find the square root : ")) #2 if number < 0 : print("Please enter a valid number.") else : #3 sq_root = number ** 0.5 #4 print("Square root of {} is {} ".format(number,sq_root))
229
85
# Copyright (C) 2019 Apple 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: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
12,141
4,975
import logging import time from typing import List import pytest import pymq from pymq import NoSuchRemoteError from pymq.exceptions import RemoteInvocationError from pymq.typing import deep_from_dict, deep_to_dict logger = logging.getLogger(__name__) class EchoCommand: param: str def __init__(self, param...
8,530
2,787
#Intro Intro_Tavern_Elrick = u"¿Qué os parece? ¿Trabajaremos juntos?" Intro_Tavern_Alida = u"¿Pero si todos superamos las pruebas, quien se casara con la princesa?" Harek = u"Supongo que la princesa se casará con quién más le guste" Elrick = u"Sería lo más inteligente. Utilizar las pruebas para conocernos y ver nuestra...
2,178
780
from keys.keys import pwd import pymongo from flask import Flask, request, abort from flask_restful import Resource, Api, reqparse, marshal_with, fields """ DATABASE CONFIGURATION """ databaseName = "students" connection_url = f'mongodb+srv://crispen:{pwd}@cluster0.3zay8.mongodb.net/{databaseName}?retryWrites=true&w=...
3,488
1,075
import csv import math import datetime def build_target_possession(player_file, till): possessions = [] to_skip = 1 # first line with open(player_file) as csv_file: reader = csv.reader(csv_file, delimiter=';') for row in reader: if to_skip: to_skip -= 1 ...
4,703
1,549
from directory_constants import urls from django.conf import settings from django.utils import translation from directory_components import helpers def ga360(request): user = helpers.get_user(request) is_logged_in = helpers.get_is_authenticated(request) context = {'ga360': {'site_language': translation...
6,065
2,242
# encoding='utf-8' ''' /** * This is the solution of No.316 problem in the LeetCode, * the website of the problem is as follow: * https://leetcode-cn.com/problems/smallest-subsequence-of-distinct-characters * <p> * The description of problem is as follow: * =======================================================...
1,962
744
# -*- coding: utf-8 -*- import os from setuptools import setup current_directory = os.path.abspath(os.path.dirname(__file__)) with open(os.path.join(current_directory, "VERSION"), "r", encoding="utf-8") as f: version = f.read() with open(os.path.join(current_directory, "README.rst"), "r", encoding="utf-8") as f:...
1,055
330
#!/usr/bin/env python """ generate the planet market """ from spacetrading.create_svg.svg_commands import Svg from spacetrading.create_svg import generate_svg_symbols def draw_planet(svg, planet, name, fill_colour): """ actually draw the planet market """ x_shift = 30 y_shift = [0, 30, 80] x_...
4,530
1,557
import subprocess import sys import os while True: line = input('> ') exec = line.strip().split(' ') status = subprocess.run(exec)
146
48
from sly import Lexer, Parser import vm class MyLexer(Lexer): tokens = {IDENTIFIER, NUMBER, SEMICOLON, PLUS, MINUS, ASTERISK, FORWARD_SLASH, EQUALS, KEYWORD_VAR} KEYWORD_VAR = r'var' IDENTIFIER = r'[a-zA-Z_][a-zA-Z0-9_]*' NUMBER = r'[0-9]+' SEMICOLON = r';' PLUS = r'\+' MINU...
1,858
729
from abc import abstractmethod from jaxvi.abstract import ABCMeta, abstract_attribute import jax.numpy as jnp from jax.scipy.stats import norm, gamma class Model(metaclass=ABCMeta): @abstract_attribute def latent_dim(self): pass @abstractmethod def inv_T(self, zeta: jnp.DeviceArray) -> jnp.De...
1,098
399
# -*- coding: utf-8 -*- """ Created on Sat Jul 21 22:59:41 2018 @author: user """ import chainer import numpy as np import chainer.functions as F x = np.arange(1, 37).reshape(1, 1, 6, 6).astype(np.float32) x = chainer.Variable(x) print(x) pooled_x, indexes = F.max_pooling_2d(x, ksize=2, stride=2, return_indices=Tru...
696
339
var = "James Bond" print(var[2::-1])
36
17
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'resources/templates/wizard_depend_depend_version.ui' # # Created by: PyQt5 UI code generator 5.5.1 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_Form(object): def setupUi(s...
1,322
422
from django.db import models class BehaviourReport(models.Model): NOT_REVIEWED = 'not_reviewed' UNDER_REVIEW = 'under_review' COMPLETED = 'completed' STATUS_CHOICES = ( (NOT_REVIEWED, 'Not reviewed'), (UNDER_REVIEW, 'Under review'), (COMPLETED, 'Completed') ) # Automa...
1,093
385
from setuptools import setup setup( version=open("rpyc_mem/_version.py").readlines()[-1].split()[-1].strip("\"'") )
121
46
# Generated by Django 3.2.2 on 2021-05-10 06:15 from django.db import migrations, models import django.utils.timezone class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Post', fields=[ ...
957
302
# -*- coding: utf-8 -*- from __future__ import unicode_literals import logging from ..action import ContainerUtilAction from ..input import ItemType log = logging.getLogger(__name__) class ExecMixin(object): """ Utility mixin for executing configured commands inside containers. """ action_method_na...
2,879
801
# -*- coding: utf-8 -*- import codecs from senapy.parsing.question_search_result_parser import parse_question_search_result def test_parsing(): html = codecs.open('tests/resources/question_search_result.html', encoding='iso-8859-1') url = 'http://www.senat.fr/basile/rechercheQuestion.do?off=30&rch=qa&de=201...
846
342
import signal import numpy as np from PIL import ImageGrab import cv2 import time import sys import os flips_time_mins = 30 interval = 5 # seconds num_frames = flips_time_mins*60/interval num_frames = int(num_frames) year = -1 month = -1 day = -1 out_fps = 24 cammode = 0 shutdown_msg = False def signal_handler(sign...
3,678
1,386
import unittest import spacy from spacy.language import Language try: from src.MordinezNLP.tokenizers import spacy_tokenizer except: from MordinezNLP.tokenizers import spacy_tokenizer class TestTokenizers(unittest.TestCase): nlp: Language = spacy.load("en_core_web_sm") nlp.tokenizer = spacy_tokenizer...
1,823
489
def foo(b=1): pass
20
11
import random import requests import tempfile from io import BytesIO from PIL import Image, ImageDraw, ImageFont FONTS = [ 'https://cdn.statically.io/gh/google/fonts/main/ofl/neucha/Neucha.ttf', # 'https://cdn.statically.io/gh/google/fonts/main/ofl/catamaran/Catamaran%5Bwght%5D.ttf', # font_base_url + 'lob...
3,905
1,710