text
string
size
int64
token_count
int64
# -*- coding: utf-8 -*- import difflib import xml.etree.ElementTree as ET tmp_path = "data/template.xml" prefix = ".//{http://www.tei-c.org/ns/1.0}" xml = ".//{http://www.w3.org/XML/1998/namespace}" tree = ET.parse(tmp_path) ET.register_namespace('', "http://www.tei-c.org/ns/1.0") root = tree.getroot() body = root...
19,028
31,473
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import os import sub...
6,342
1,990
# Generated by Django 3.2.8 on 2021-10-13 16:04 from django.conf import settings from django.db import migrations, models import django.db.models.deletion import ireporterApp.models class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_...
2,036
589
from ethronsoft.gcspypi.package.package_manager import PackageManager from ethronsoft.gcspypi.utilities.console import Console from ethronsoft.gcspypi.parsers.commons import init_repository def handle_(config, data): with Console(verbose=config.get("verbose", False), exit_on_error=True) as c: repo = init_r...
1,090
306
#!/usr/bin/python # Copyright (c) 2017, 2018, 2019, Oracle and/or its affiliates. # This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Apache License v2.0 # See LICENSE.TX...
18,880
5,355
#!/usr/bin/env python3 __author__ = 'otakucode' import argparse import sys from urllib import parse from bs4 import BeautifulSoup import requests def get_title(search_type, search_title): search_encoded = parse.quote(search_title) page = requests.get('http://www.canistream.it/search/{0}/{1}'.format(search_t...
4,066
1,235
"""Constants for the Hardware integration.""" DOMAIN = "hardware"
67
20
#!/usr/bin/env python3 import json import os import sys sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../red-agate/') # pylint: disable=import-error, wrong-import-position from redagate_lambda import call, LambdaInternalErrorException # pylint: enable=import-error, wrong-import-position if __name__...
2,646
845
from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('cms', '0013_urlconfrevision'), ('cmsplugin_cascade', '0008_sortableinlinecascadeelement'), ] operations = [ migrations.CreateModel( name...
1,290
385
from elasticsearch_dsl import * import os from glob import glob import json import re from . import to_zh_cn class Poet(Document): dynasty = Text() author = Text() title = Text(analyzer='jieba_index', search_analyzer='jieba_search') paragraphs = Text(analyzer='jieba_index', search_analyzer='jieba_sear...
1,679
574
from threading import Thread import tkinter as tk from tkinter import ttk, messagebox from . import pyenv from ._custom_widgets import Treeview class VersionManagementFrame(ttk.Frame): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) # Installed versions options s...
5,785
1,518
class Solution: def minSwapsCouples(self, row: List[int]) -> int: parent=[i for i in range(len(row))] for i in range(1,len(row),2): parent[i]-=1 def findpath(u,parent): if parent[u]!=u: parent[u]=findpath(parent[u],parent) ...
636
229
import requests # host = 'localhost:8080' # path = '/member/changeAppId' # payload = {'UserId' : userId } # r = requests.get('localhost:8080/member/changeAppId', params=payload) # import requests # import json # # # GET # res = requests.get('http://localhost:8080/member/changeAppId') # print(str(res.status_code) + " ...
1,951
749
from PIL import ImageGrab, Image import cv2 as cv import numpy as np import match.template_matching as tm import match.bilging as b from mss import mss def grab_screen(): img_src = ImageGrab.grab() return cv.cvtColor(np.array(img_src.convert('RGB')), cv.COLOR_RGB2BGR) class ScreenGrabber(object): def gr...
1,549
577
from src.event import Event from src.rng import prng from src.eventoChegadaFilaUm import EventoChegadaFilaUm from src.eventoChegadaFilaDois import EventoChegadaFilaDois class EventoSaidaFilaZero(Event): def __init__(self,t,i): super().__init__(t,i) def processEvent(self, simulador): ...
1,917
664
"""Single simple camera example.""" import time from remio import Camera # Initialize Single Camera device camera = Camera(name="webcam", src=0, size=[400, 400]) camera.start() while True: print("Doing some tasks...") time.sleep(2)
242
78
#!/usr/bin/env python from __future__ import print_function import os import stat import comptools as comp here = os.path.abspath(os.path.dirname(__file__)) wrapper_path = os.path.join(here, 'wrapper.sh') wrapper_virtualenv_path = os.path.join(here, 'wrapper_virtualenv.sh') wrapper = """#!/bin/bash -e eval `/cvmfs/...
1,481
509
""" --- title: Deep Convolutional Generative Adversarial Networks (DCGAN) summary: A simple PyTorch implementation/tutorial of Deep Convolutional Generative Adversarial Networks (DCGAN). --- # Deep Convolutional Generative Adversarial Networks (DCGAN) This is a [PyTorch](https://pytorch.org) implementation of paper [...
3,899
1,453
from .flexible_model import FlexibleModel from src.utils import GPT2_BLOCK_SIZE import torch from src.flexible_models.GPT2_lm_segment_model import GPT2LMSegmentModel class FlexibleGPT2(FlexibleModel): """ A FlexibleGPT2 model is simply the combination of a huggingface gpt2 transformers model and a decoding strate...
2,846
1,094
import os import sys import pandas as pd import numpy as np import scipy.stats as st import matplotlib.pyplot as plt def read_udp(file_path): with open(file_path, "r") as f: data_dict = {'send':{}, 'rec':{}} data = pd.read_csv(file_path, sep=",", engine='python', error_bad_lines=False, skiprows=1) ...
2,091
736
"""Python utilities.""" import os import functools from types import GeneratorType as generator import warnings from collections import Counter def file_mod(s, nam='', prefix='', suffix='', odir='', ext=''): """Modify a file path. Parameters ---------- s : str File path. nam : str, defaul...
10,236
2,853
from django.dispatch import receiver from django.contrib import messages from django.core.exceptions import ValidationError from django.utils.translation import ugettext from django.utils.html import format_html from django.utils.safestring import mark_safe from danceschool.core.signals import check_student_inf...
2,895
864
import re from collections.abc import MutableMapping from typing import Dict, List import markovify import nltk class RangeDict(MutableMapping): """Enables a dictionary whose keys are ranges.""" def __init__(self, iterable: Dict): if not isinstance(iterable, dict): raise TypeError("You m...
1,577
475
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # File : live_visualisation.py # Author : Duy Anh Pham <duyanh.y4n.pham@gmail.com> # Date : 10.04.2020 # Last Modified By: Duy Anh Pham <duyanh.y4n.pham@gmail.com> from djitellopy.realtime_plot.RealtimePlotter import * import redis import nu...
3,907
1,515
import os import click from app import app from flask.cli import with_appcontext from app.auth.models import Role def register(app): @app.cli.group() def translate(): """Translation and localization commands.""" pass @translate.command() @click.argument('lang') def init(lang): ...
1,187
316
""" tableofcontents =============== .. module:: tableofcontents :platform: Unix, Windows :synopsis: a tableofcontents that breaks not to the next frame but to the next page .. moduleauthor:: Johannes Eckstein """ from reportlab import rl_config from reportlab.platypus import Table, Paragraph, PageBreak from re...
2,918
850
import unittest from conans.errors import ConanException from conans.model.username import Username class UsernameTest(unittest.TestCase): def username_test(self): Username("userwith-hypens") self.assertRaises(ConanException, Username, "") self.assertRaises(ConanException, Username, "A"*...
570
189
""" Faça um Programa que peça a temperatura em graus Fahrenheit, transforme e mostre a temperatura em graus Celsius. C = (5 * (F-32) / 9) """
152
67
#!/usr/bin/env python from control4.algs.save_load_utils import load_agent_and_mdp from control4.core.rollout import rollout from tabulate import tabulate import numpy as np import pygame from control3.pygameviewer import PygameViewer, pygame from collections import namedtuple from copy import deepcopy path = [] if _...
1,641
642
class Token: def __init__(self, type=None, value=None): self.type = type self.value = value def __str__(self): return "Token({0}, {1})".format(self.type, self.value)
201
69
""" Define convention-based global, coordinate and variable attributes in one place for consistent reuse """ DEFAULT_BEAM_COORD_ATTRS = { "frequency": { "long_name": "Transducer frequency", "standard_name": "sound_frequency", "units": "Hz", "valid_min": 0.0, }, "ping_time": ...
1,772
632
import mne import numpy as np import matplotlib.pyplot as plt from scipy import stats import seaborn as sns from tf_analysis import single_trial_tf plt.ion() data_folder = "/home/mje/Projects/agency_connectivity/data/" epochs = mne.read_epochs(data_folder + "P2_ds_bp_ica-epo.fif") # single trial morlet tests frequ...
2,072
874
import json import os import pickle as pkl import random import math import numpy as np import pandas as pd import torch from torch.utils.data import Dataset import torchvision.transforms as T import torch.nn.functional as F from PIL import Image from data.SomethingElse.config import action_to_number_of_instances, acti...
17,645
5,534
Meine neuer Code.. Neue Codezeile .... Tst stash zum 2. mal
60
25
# Copyright (c) 2015 Mirantis, 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/LICENSE-2.0 # # Unless requir...
1,195
372
#!/usr/bin/env python #coding=utf-8 import pickle import sys, os, re, subprocess, math reload(sys) sys.setdefaultencoding("utf-8") from os.path import abspath, dirname, join whereami = abspath(dirname(__file__)) sys.path.append(whereami) from sklearn.metrics import roc_auc_score import pandas as pd import numpy as np ...
4,808
2,199
from django.apps import AppConfig from django_gotolong.bhav.views import start class BhavConfig(AppConfig): name = 'bhav' def ready(self): start()
166
54
""" ******************************************************************************** * Name: pagintate.py * Author: nswain * Created On: April 17, 2018 * Copyright: (c) Aquaveo 2018 ******************************************************************************** """ def paginate(objects, results_per_page, page, resul...
2,130
678
import os from os.path import dirname import sys ROOT = dirname(dirname(dirname(os.path.abspath(__file__)))) sys.path.append(ROOT)
133
47
# Primeiro Trabalho Pratico de EDAII (UFBA) # Desenvolvido em dupla: # Laila Pereira Mota Santos e Pedro Antonhyonih Silva Costa # Versão Python 3.8.10 # # OBSERVACAO IMPORTANTE: # A CONSTANTE GRAUMINIMO ESTA NO ARQUIVO node.py import os from struct import Struct from typing import Optional, Tuple from enum import Enu...
1,996
743
import torch import hcat.lib.functional from hcat.lib.functional import IntensityCellReject from hcat.backends.backend import Backend from hcat.models.r_unet import embed_model as RUnet from hcat.train.transforms import median_filter, erosion import hcat.lib.utils from hcat.lib.utils import graceful_exit import os.pat...
6,134
1,953
from mortar_rdb import register_session, get_session from mortar_rdb.interfaces import ISession from testfixtures.components import TestComponents from sqlalchemy.exc import OperationalError from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm.session import Session from sqlalchemy.schema import ...
6,656
1,843
#!/usr/bin/env python """ This node talks directly to the pololu driver It takes in PID control effort and maps it to commands for the pololu driver """ from __future__ import division import rospy from std_msgs.msg import Float64, Int8MultiArray DRIVE_PUB_INDEX = 0 YAW_PUB_INDEX = 1 SIDE_IR_THRESH = 10 FRONT_IR_T...
2,637
888
"""GageRnR. The input data should be structured in a 3d array n[i,j,k] where i = operator, j = part, k = measurement Stored to file this data would look: m1 m2 m3 3.29; 3.41; 3.64 # p1 | o1 2.44; 2.32; 2.42 # p2 3.08; 3.25; 3.07 # p1 | o2 2.53; 1.78; 2.32 # p2 3.04; 2.89; 2.85 # p1 | o3 1.62; 1.87; 2.04 # ...
4,025
1,493
import numpy as np import os import glob import torch import argparse def parse_args(script): parser = argparse.ArgumentParser(description= 'few-shot script %s' %(script)) parser.add_argument('--task', default='fsl', help='fsl/cdfsl-single/cdfsl-multi') parser.add_argument('--dataset', default='miniImagenet', he...
4,536
1,564
import pytest from wikidict.render import parse_word from wikidict.utils import process_templates @pytest.mark.parametrize( "word, pronunciations, gender, etymology, definitions", [ ("ababalhar", [], "", ["De baba."], ["<i>(popular)</i> babar; conspurcar"]), ( "alguém", ...
6,322
2,158
import django, json, datetime from django.conf import settings from django.db.models import Sum from pathlib import Path from datetime import datetime, timedelta from gui.lnd_deps import lightning_pb2 as ln from gui.lnd_deps import lightning_pb2_grpc as lnrpc from gui.lnd_deps import router_pb2 as lnr from gui.lnd_deps...
10,792
3,425
# -*- coding: utf-8 -*- import logging import types from collections import Iterable class BaseField(object): """The base class for all Fields and Arguments. Field objects are used by Resources to define the data they return. They include a name, a type, a short description, and a long description. O...
5,112
1,311
from django import forms from .models import * class routeForm(forms.ModelForm): class Meta: model = Routes fields = ('route_short_name',)
160
46
""" These tests require an AWS account to be set up, but don't require any manual intervention beyond some initial setup. Also, these tests create instances (which cost money!). Either `meadowrun-manage install` needs to be set up, or `meadowrun-manage clean` needs to be run periodically """ import asyncio import date...
9,802
2,910
def not_found_handler(): return '404. Path not found' def internal_error_handler(): return '500. Internal error'
117
41
from django.contrib.auth.models import User from rest_framework import permissions, status from rest_framework.decorators import ( api_view, authentication_classes, permission_classes, throttle_classes, ) from rest_framework.response import Response from rest_framework_expiring_authtoken.authentication...
11,536
3,267
# SPDX-FileCopyrightText: 2021 Wolfgang Traylor <wolfgang.traylor@senckenberg.de> # # SPDX-License-Identifier: MIT import os import shutil import subprocess from termcolor import cprint from trace_for_guess.skip import skip def rescale_file(in_file, out_file, template_file, alg): """Regrid a NetCDF file using ...
2,207
711
from getratings.models.ratings import Ratings class NA_Khazix_Top_Aatrox(Ratings): pass class NA_Khazix_Top_Ahri(Ratings): pass class NA_Khazix_Top_Akali(Ratings): pass class NA_Khazix_Top_Alistar(Ratings): pass class NA_Khazix_Top_Amumu(Ratings): pass class NA_Khazix_Top_Anivia(Ratings): ...
6,545
3,595
from distutils.core import setup setup( name='libkloudtrader', version='1.0.0', author='KloudTrader', author_email='admin@kloudtrader.com', packages=['libkloudtrader'], url='https://github.com/KloudTrader/kloudtrader', license='LICENSE', description="KloudTrader's in-house library that ...
616
206
# ~*~ coding: utf-8 ~*~ __doc__ = """ `opencannabis.media` --------------------------- Records and definitions that structure digital media and related assets. """ # `opencannabis.media`
197
67
from typing import Callable, Optional, Union, Tuple, List import torch from torch import nn from cfg import Opts from torch import Tensor from torch.nn import functional as F from mlutils import LogitToPreds EPS = 1.0e-8 __all__ = ['IOULoss', 'GDiceLoss', 'SoftDiceLoss', 'CrossEntropyLoss', 'BCELossWithL...
14,581
4,711
from typing import Union import yaml class ConfigReader: def __init__(self): with open("config.yml", "r") as f: data = yaml.safe_load(f) self.data = data def __getattr__(self, __name: str): s = __name.split("_") data = self.data try: for i in s...
1,136
334
# import itertools # from functools import partial # from scipy.stats import norm # from scipy.sparse import csc_matrix, linalg as sla # from scipy import sparse # from scipy.optimize import minimize, minimize_scalar # from collections import deque, namedtuple import numpy as np from networkx import Graph from pygfl.so...
14,688
4,847
#!/usr/bin/env python import numpy as np import cv2 as cv cap1 = cv.VideoCapture(0) cap2 = cv.VideoCapture(1) while(cv.waitKey(1) & 0xFF != 27): ret, frame1 = cap1.read() ret, frame2 = cap2.read() cv.imshow('c1',frame1) cv.imshow('c2',frame2) gray1 = cv.cvtColor(frame1, cv.COLOR_RGB2GRAY) ...
438
197
import plotly.plotly as py """Get data from csv and split it""" data = open('Real_Final_database_02.csv') alldata = data.readlines() listdata = [] for ix in alldata: listdata.append(ix.strip().split(',')) """Seperate data in each type of disaster.""" all_disaster = {'Drought':0, 'Flood':0, 'Storm':0, 'Epidemic':0...
1,109
437
import numpy as np from matplotlib.patches import Ellipse import matplotlib.pyplot as plt import matplotlib from matplotlib import cm from scipy import signal import matplotlib.image as mpimg # matplotlib.use('Agg') # define normalized 2D gaussian def gaus2d(x, y, mx, my, sx, sy): return 1. / (2. * np.pi * sx *...
2,515
1,324
import requests class BuscaEndereco: def __init__(self,cep): if self.valida_cep(str(cep)): self.cep = str(cep) else: raise ValueError("CEP Inválido !!!") def __str__(self): return self.formata_cep() def valida_cep(self,cep): if len(self.cep ==...
620
211
#! /usr/bin/python #small script that shits out the venot file format equivalent for the lightening project import numpy as np import pylab as pl import pyfits as pf import glob, os, sys AMU = 1.660538921e-27 KBOLTZ = 1.380648813e-23 G = 6.67384e-11 RSOL = 6.955e8 RJUP = 6.9911e7 #RJUP = 7.1492e7 # Jo's radius MJ...
3,928
1,939
from setuptools import find_packages, setup setup( name="src", packages=find_packages(), version="0.1.0", description="This project contains the final exercise of S1, " + "in which we will continue to build upon", author="Nicolai Weisbjerg", license="MIT", )
288
89
# Talking to the music player and sanitizing data. import datetime import requests from requests.exceptions import Timeout from unihandecode import Unihandecoder from settings import server_url def asciify(script, args): if args.lang_code is None: return Unihandecoder().decode(script) return Unihand...
2,534
774
""" This module contains the high-level functions to access the library with asyncio. Care is taken to make this as pythonic as possible and hide as many of the gory implementations as possible. This module provides "syntactic sugar" around the lower-level, but almost identical, module :py:mod:`puresnmp.aio.api.raw`. ...
7,239
2,342
import numpy as np from .normalizer import Normalizer class AroundZeroNormalizer(Normalizer): def __init__(self, data): self.minVal = np.min(data) self.maxVal = np.max(data) self.maxVal = max(abs(self.maxVal), abs(self.minVal)) def transform(self, data): if self.maxVal == 0: #can't normalize if the whole ...
471
184
import helpers import sys from representations.sequentialembedding import SequentialEmbedding """ Let's examine the closest neighbors for a word over time """ import collections from sklearn.manifold import TSNE import numpy as np import matplotlib.pyplot as plt WORDS = helpers.get_words() if __name__ == "__main__"...
1,160
368
############################################################################## # # Copyright (c) 2000-2009 Jens Vagelpohl and Contributors. All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS S...
10,108
2,557
# -*- coding: utf-8 -*- """ Exceptions for Arequests Created on Tue Nov 13 08:34:14 2018 @author: gfi """ class ArequestsError(Exception): """Basic exception for errors raised by Arequests""" pass class AuthorizationError(ArequestsError): '''401 error new authentification required''' pass class Some...
461
152
#### #### Nov 16, 2021 #### """ Regularize the EVI and NDVI of fields in individual years for training set creation. """ import csv import numpy as np import pandas as pd from math import factorial import scipy import scipy.signal import os, os.path from datetime import date import datetime import time import sys s...
5,014
1,663
""" One electron integrals. """ from numpy import pi,exp,floor,array,isclose from math import factorial from pyquante2.utils import binomial, fact2, Fgamma, norm2 # Notes: # The versions S,T,V include the normalization constants # The version overlap,kinetic,nuclear_attraction do not. # This is so, for example, the k...
7,227
3,380
import os import subprocess import glob import pytest # test_pyhive_runBCFTools_VC.py def test_runBCFTools_VC(bcftools_folder, hive_dir, datadir, clean_tmp): """ Test function to run BCFTools mpileup|call on a BAM file """ bam_file = "{0}/exampleBAM.bam".format(datadir) reference = "{0}/exampleFA...
2,169
762
from __future__ import absolute_import import six from rest_framework.response import Response from sentry.api.base import DocSection from sentry.api.bases.organization import OrganizationEndpoint from sentry.api.serializers import serialize from sentry.models import Project, Team from sentry.utils.apidocs import sc...
2,497
652
from django.db import models from django.conf import settings from django.contrib.auth.models import User from django.shortcuts import render from cloudinary.models import CloudinaryField from .utils import get_random_code from django.template.defaultfilters import slugify from django.contrib.auth import get_user_model...
3,708
1,144
# -*- coding: utf-8 -* """ :py:class:`GenerateLabelFieldReader` """ import numpy as np from senta.common.register import RegisterSet from senta.common.rule import DataShape, FieldLength, InstanceName from senta.data.field_reader.base_field_reader import BaseFieldReader from senta.data.util_helper import generate_pad_...
6,708
2,124
class Solution: def alphabetBoardPath(self, target): """ Time Complexity: O(N) Space Complexity: O(N) """ m = {c: [i // 5, i % 5] for i, c in enumerate("abcdefghijklmnopqrstuvwxyz")} x0, y0 = 0, 0 res = [] for c in target: x, y = m[c] ...
1,270
409
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
20,881
6,512
import asyncio from aiogram.dispatcher.middlewares import BaseMiddleware class EnvironmentMiddleware(BaseMiddleware): def __init__(self, context=None): super(EnvironmentMiddleware, self).__init__() if context is None: context = {} self.context = context def update_data(s...
720
205
""" module init """
21
10
from Dao.squad_dao import SquadDao from Model.squad import * from Controller.backend_controller import BackendController from Controller.frontend_controller import FrontendController from Controller.sgbd_controller import SgbdController class SquadController: dao = SquadDao() be = BackendController() fro =...
899
307
# # Copyright (c) 2021 Airbyte, Inc., all rights reserved. # from typing import Union def separate_by_count(total_length: int, part_count: int) -> (int, int): """ Calculates parts needed to separate count by part_count value For example: separate_by_count(total_length=196582, part_count=10000) returns (1...
1,065
381
def transform_file(infile,outfile,templates): with open(infile,'r') as fh: indata = fh.read() lines = indata.split('\n') outlines = [] for line in lines: if '//ATL_BEGIN' in line: start = line.find('//ATL_BEGIN') spacing = line[:start] s...
678
236
""" Plots design space exploration results. """ import json from collections import OrderedDict, defaultdict import matplotlib from jsonschema import Draft4Validator from pkg_resources import resource_stream matplotlib.use("agg") # noqa import matplotlib.pyplot as plt from matplotlib.legend_handler import HandlerLin...
19,218
5,768
from django import forms from django.contrib.auth.forms import AuthenticationForm, UserCreationForm, PasswordChangeForm, UserChangeForm from authapp.models import UserProfile, Status class LoginForm(AuthenticationForm): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) for na...
1,872
537
from rest_framework import serializers from .models import Device, SensorType class SensorTypeSerializer(serializers.ModelSerializer): class Meta: model = SensorType fields = "__all__" class DeviceSerializer(serializers.HyperlinkedModelSerializer): class Meta: model = Device ...
340
92
from .technews_helper import TechNews from .mail_helper import EmailContentHelper
82
22
# Generated by Django 2.2.6 on 2019-11-02 17:34 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('core', '0001_initial'), ] operations = [ migrations.AddField( model_name='item', name='category', field=...
696
232
from ._advent_timer import *
28
10
# -*- coding: utf-8 -*- # Generated by Django 1.9.9 on 2016-12-08 16:58 from __future__ import unicode_literals import datetime from django.db import migrations, models from django.utils.timezone import utc class Migration(migrations.Migration): dependencies = [ ('stamper', '0003_auto_20161122_1253'), ...
915
339
import argparse,time,os,pickle import matplotlib.pyplot as plt import numpy as np from player import * plt.switch_backend('agg') np.set_printoptions(precision=2) class lemon: def __init__(self, std, num_sellers, num_actions, unit, minx): self.std = std self.unit = unit self.num_sellers = num_sellers self.nu...
7,493
3,138
# pylint: disable=too-many-arguments """ Observer implemtation doing OS command """ from base.iobserver import IObserver import subprocess import logging import os import sys logging.basicConfig( format='%(asctime)s %(levelname)s:%(name)s: %(message)s', level=os.environ.get('LOGLEVEL', 'INFO').upper(), d...
1,910
572
import numpy import numpy.testing import skimage.morphology import cellprofiler.modules.opening instance = cellprofiler.modules.opening.Opening() def test_run(image, module, image_set, workspace): module.x_name.value = "example" module.y_name.value = "opening" if image.dimensions == 3 or image.multich...
1,407
464
TOKEN = "YOUR_TOKEN_HERE"
26
16
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright 2017-2022 Univertity of Bristol - High Performance Networks Group # 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.a...
52,972
15,465
import os import json import shutil import tempfile import datetime import pytest from unittest import mock from openstates.data.models import ( Bill, Jurisdiction, Division, LegislativeSession, Organization, Person, ) from openstates.scrape import Bill as ScrapeBill from openstates.importers.ba...
6,179
2,205
#!/usr/bin/env python # Copyright 2017 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/LICENSE-2.0 # # Unless require...
3,777
1,109
import pytest import gpmap from epistasis import models import numpy as np import pandas as pd import os def test__genotypes_to_X(test_data): # Make sure function catches bad genotype passes d = test_data[0] gpm = gpmap.GenotypePhenotypeMap(genotype=d["genotype"], p...
14,678
5,323
# File name: spyview.py # # This example should be run with "execfile('spyview.py')" from numpy import pi, linspace, sinc, sqrt from lib.file_support.spyview import SpyView x_vec = linspace(-2 * pi, 2 * pi, 100) y_vec = linspace(-2 * pi, 2 * pi, 100) qt.mstart() data = qt.Data(name='testmeasurement') # to make the...
871
357