text
stringlengths
957
885k
<reponame>nppo/search-portal<filename>harvester/core/tests/views/test_extension.py from django.test import TestCase from django.contrib.auth.models import User class TestExtensionAPI(TestCase): fixtures = ["datasets-history"] @classmethod def setUpClass(cls): super().setUpClass() cls.use...
<filename>refresh/virology.py from database import hic_conn from refresh import export SQL_DROP_TABLE = ''' IF OBJECT_ID(N'dbo.virology', N'U') IS NOT NULL BEGIN DROP TABLE dbo.virology; END; ''' SQL_INSERT = ''' SET QUOTED_IDENTIFIER OFF; SELECT * INTO wh_hic_covid.dbo.virology FROM OPENQUERY( uhldwh,...
#!/usr/bin/python """ Benchmarking experiment for fidelity Test bandwidth (using iperf) on string/chain networks of fixed size 40, using kernel datapaths. First construct a network of 2 hosts and N switches, connected as follows: h1 - s1 - s2 - ... - sN - h2 Varying link bw, with & without virtual time, te...
import speech_recognition as sr import pyttsx3 from pyttsx3.drivers import sapi5 import sys import time import datetime import os import glob voice_id = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Speech\\Voices\\Tokens\\TTS_MS_EN-US_ZIRA_11.0" INITIAL_TALKING = True INITIAL_USING_MIC = False MUSIC_DIR = "C:...
<reponame>Shihab-Shahriar/scikit-clean import warnings import numpy as np from sklearn import clone from sklearn.base import BaseEstimator from sklearn.linear_model import LogisticRegression from sklearn.naive_bayes import GaussianNB from sklearn.neighbors import KNeighborsClassifier from sklearn.tree import DecisionT...
<reponame>maheshwarigagan/nlp-architect<filename>examples/cross_doc_coref/cross_doc_coref_sieves.py # ****************************************************************************** # Copyright 2017-2018 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file exc...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.test import TestCase from django.urls import reverse from django.contrib.auth import get_user_model from django.contrib.auth.models import Group from rest_framework.test import APITestCase from rest_framework import status import json from ...
<reponame>Shmuma/Run-Skeleton-Run import argparse import os import json import copy import torch import torch.multiprocessing as mp from multiprocessing import Value from common.misc_util import boolean_flag, str2params, create_if_need from common.env_wrappers import create_env from common.torch_util import activation...
# -*- coding: utf-8 -*- """ Created on Sat Jan 20 11:27:20 2018 @author: DrLC """ import pandas import math import nltk import re import gzip, pickle import matplotlib.pyplot as plt def load_csv(path="test.csv"): return pandas.read_csv(path, header=None) def load_class(path="classes.t...
<filename>tests/unittest_typesafe.py #!/usr/bin/python -tt # -*- coding: utf-8 -*- import unittest from pytraits import type_safe class TestTypeSafe(unittest.TestCase): def test_shows_unassigned_arguments_error_for_omitted_arguments(self): # We need to make sure that when user misses argument from the ...
import asyncio import time import pytest from falcon import testing from falcon.asgi import App import falcon.util def test_sync_helpers(): safely_values = [] unsafely_values = [] shirley_values = [] class SomeResource: async def on_get(self, req, resp): safely_coroutine_objects...
# -*- coding: utf-8 -*- ################################################################################ ## Form generated from reading UI file 'viewerWindow.ui' ## ## Created by: Qt User Interface Compiler version 6.2.1 ## ## WARNING! All changes made in this file will be lost when recompiling UI file! ##############...
import argparse from pathlib import Path import torch import torch.nn as nn import torch.utils.data as data from PIL import Image, ImageFile from tensorboardX import SummaryWriter from torchvision import transforms from tqdm import tqdm from torchvision.utils import save_image import re, os import math import vgg impo...
<filename>example/test_unit.py<gh_stars>10-100 """TDD-like unit test. This file is made available under the Creative Commons CC0 1.0 Universal Public Domain Dedication. The person who associated a work with this deed has dedicated the work to the public domain by waiving all of his or her rights to the work worldwide...
######################################################################## # written by : <NAME>, <NAME>, CS, # # Im<NAME> AlFaisal University # #----------------------------------------------------------------------# # # # This interface is the user main menu where the users can ...
from typing import Tuple import noise import logging import numpy from worldgen.island_mesh.mesh_data import MeshData3D class IslandMesh: def __init__(self, size: Tuple[int, int, int], offset: Tuple[int, int, int] = (0, 0, 0), scale: float = .9, level: float = .5, ocean_level: float = 0, mount...
<filename>src/stratis_cli/_actions/_top.py # Copyright 2016 Red Hat, 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 require...
<reponame>pyjads/Python_module_helper<filename>image_processing/watermarking_1.py #%% import cv2 import matplotlib.pyplot as plt import numpy as np #%% watermark = cv2.imread(r"E:\Pycharm_Workspace\Data_Science\image_processing\watermark_1.jpg") original_1 = cv2.imread(r'E:\Pycharm_Workspace\Data_Science\image_process...
<gh_stars>0 #!/usr/bin/env python3 from aiohttp import web from asyncio import sleep, subprocess, gather, Lock, shield from collections import OrderedDict import argparse import ast import json import logging import os import re import sys if sys.version_info.major == 3 and sys.version_info.minor < 7: from asynci...
from typing import TYPE_CHECKING, List import graphene from django.core.exceptions import ValidationError from ...channel.models import Channel from ...checkout.calculations import calculate_checkout_total_with_gift_cards from ...checkout.checkout_cleaner import clean_billing_address, clean_checkout_shipping from ......
"""gmail.py: Fetch queries from gmail & send replies back Contains Gmail class which initializes the Gmail service, and has a method to watch the Gmail mailbox for any changes. When a change occurs, unread messages are retrieved. If any of the unread messages are from senders in the contact list, the text of the messa...
from .mock_response import MockHTTPResponse from datetime import datetime from requests.models import PreparedRequest, Response from requests.packages.urllib3 import HTTPResponse from requests.structures import CaseInsensitiveDict from requests.status_codes import _codes from requests.cookies import RequestsCookieJar ...
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file") def tools_repositories(): excludes = native.existing_rules().keys() if "buildifier" not in excludes: http_file( name = "buildifier", executable = True, sha256 = "4c985c883eafdde9c0e8cf3...
""" Copyright Amazon.com, Inc. or its affiliates. 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...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from cleverhans.attacks import FastGradientMethod from cleverhans.model import CallableModelWrapper import sys import os import os.path import tensorflow as tf sys.path.append(os.path.join(os.path.dirname(__...
import pandas as pd import pandas.io.data as web from pandas.tseries.offsets import BDay import numpy as np from scipy.stats import itemfreq today = pd.datetime.today() yesterday = today - BDay(5000) np.set_printoptions(precision=2) np.set_printoptions(suppress=True) def hist(x): if (x>=1.0): y = 1.05 ...
import re import unittest import urllib from flask.ext.testing import TestCase from leash import app, db, mail, views from leash.models import Puppy, Shelter, User from leash.forms import ( AccountForm, EmailForm, EmailPasswordForm, PasswordForm, PuppyForm, PuppyProfileForm, ShelterForm, ...
<filename>test/cli/package_command/pkg_info/test_pkg_info_s.py #!/usr/bin/python3 # ****************************************************************************** # Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. # licensed under the Mulan PSL v2. # You can use this software according to the...
"""Script for plotting the results of the 'suite' benchmark. Invoke without parameters for usage hints. :Author: <NAME> :Date: 2010-06-01 """ from __future__ import print_function import matplotlib as mpl from pylab import * KB_ = 1024 MB_ = 1024*KB_ GB_ = 1024*MB_ NCHUNKS = 128 # keep in sync with bench.c linew...
import os import sys import math import argparse import numpy as np from tqdm import tqdm import torch from torch.multiprocessing import Queue, Process sys.path.insert(0, '../lib') sys.path.insert(0, '../model') # from data.CrowdHuman import CrowdHuman from data.CrowdHuman_json import CrowdHuman from utils import mis...
<filename>tests/test_population.py<gh_stars>100-1000 from time import sleep, time import os from copy import copy from pytest import raises, mark from random import random, choices, seed from evol import Population, ContestPopulation from evol.helpers.groups import group_duplicate, group_stratified from evol.helpers....
#!/usr/bin/env python # coding=utf-8 # # Copyright 2018 Google 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 # <https://apache.org/licenses/LICENSE-2.0>. # # Unless required by applica...
<gh_stars>10-100 """ Command line reference manager with a single source of truth: the .bib file. Inspired by beets. """ import pkg_resources import click import click_constraints import click_plugins # type: ignore import pybibs import pyperclip # type: ignore import requests from . import cite from . import inte...
<reponame>shreyasnagare/Brick import csv import logging from collections import defaultdict from rdflib import Graph, Literal, BNode, URIRef from rdflib.namespace import XSD from rdflib.collection import Collection from bricksrc.ontology import define_ontology from bricksrc.namespaces import BRICK, RDF, OWL, RDFS, TA...
#! /usr/bin/env python # coding=utf-8 # Authors: Hanxiaoyang <<EMAIL>> # simple naive bayes classifier to classify sohu news topic # data can be downloaded in http://www.sogou.com/labs/dl/cs.html # 代码功能:简易朴素贝叶斯分类器,用于对搜狐新闻主题分类,数据可在http://www.sogou.com/labs/dl/cs.html下载(精简版) # 详细说明参见博客http://blog.csdn.net/han_xiaoyang/...
<filename>hwilib/coldcardi.py # Trezor interaction script from .hwwclient import HardwareWalletClient from ckcc.client import ColdcardDevice from ckcc.protocol import CCProtocolPacker from ckcc.constants import MAX_BLK_LEN from .base58 import xpub_main_2_test from hashlib import sha256 import base64 import json impor...
<reponame>jiahuei/sparse-image-captioning<filename>tests/test_train.py # -*- coding: utf-8 -*- """ Created on 08 Jan 2021 17:39:15 @author: jiahuei """ import unittest import os from sparse_caption.opts import parse_opt from sparse_caption.utils.config import Config from .paths import TEST_DIRPATH, TEST_DATA_DIRPATH ...
""" Implementation of binary search trees. """ from __future__ import annotations class Node: def __init__(self, val: int) -> None: self.val = val self.left: Node | None = None self.right: Node | None = None class BinarySearchTree: def __init__(self) -> None: self.root: Node...
#!/usr/bin/env python3.7 ''' FLASK_APP=hello.py flask run ''' import argparse from datetime import datetime, timedelta import json import time import boto3 from botocore.exceptions import ClientError #from flask_bootstrap import Bootstrap from flask import Flask, render_template, request app = Flask(__name__) #boots...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2012 Cisco Systems, 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...
""" the :mod:`linear` module includes linear features-based algorithms. """ from __future__ import (absolute_import, division, print_function, unicode_literals) import warnings import numpy as np from sklearn import linear_model from .predictions import PredictionImpossible from .algo_base im...
<gh_stars>0 """Test pydeCONZ utilities. pytest --cov-report term-missing --cov=pydeconz.utils tests/test_utils.py """ import asyncio from unittest.mock import Mock, patch from asynctest import CoroutineMock import pytest import aiohttp from pydeconz import errors, utils API_KEY = "1234567890" IP = "127.0.0.1" POR...
import pandas as pd '''Takes all of the merged block, block group, and tract files, renames the headings, adds state abbreviations, and reorders the columns. Creates 2 new csvs, big_table and big_table_pro. The first does not have prorated values, the second does. ''' # leading in and changing column names of all 8 f...
""" Cartesian fields """ #----------------------------------------------------------------------------- # Copyright (c) 2013, yt Development Team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this software. #-------------------------...
<reponame>PerFuchs/edge-frames<filename>src/sharesCalculator.py import csv import itertools from functools import reduce from typing import List, Tuple, Dict from string import ascii_lowercase import operator as op # from poibin.poibin import PoiBin from collections import deque from math import sqrt, ceil, isclose ...
<gh_stars>1-10 # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import os import numpy as np import torch from pterotactyl.utility import utils BASE_MESH_SIZE = 1824 BASE_CHART_SIZE = 25 # ...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2011 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # no...
<reponame>pip-services3-python/pip-services3-expressions-python # -*- coding: utf-8 -*- from abc import ABC, abstractmethod from .IVariantOperations import IVariantOperations from .Variant import Variant from .VariantType import VariantType class AbstractVariantOperations(IVariantOperations, ABC): """ Imple...
# This is a sample Python script. # Press Shift+F10 to execute it or replace it with your code. # Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings. # https://medium.com/@keagileageek/paramiko-how-to-ssh-and-file-transfers-with-python-75766179de73 import paramiko import os...
<reponame>LordKBX/EbookCollection import os, sys sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.realpath(__file__)))) from common.lang import * from common.bdd import * dialogStyleBtnGreen = 'background-color: rgb(0, 153, 15); color: rgb(255, 255, 255);' def __get_bases(): language = Lang() bdd ...
########################################################################## # # Copyright (c) 2019, Image Engine Design 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: # # * Redistrib...
<filename>11 - Extra-- sonos snips voice app/action-sonos.py #!/usr/bin/env python2 # -*-: coding utf-8 -*- import logging import sys import traceback from hermes_python.hermes import Hermes from snipssonos.helpers.snips_config_parser import read_configuration_file from snipssonos.helpers.snips_configuration_validat...
<gh_stars>0 # Copyright The OpenTelemetry Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
""" Define the Device class. Authors: <NAME> <<EMAIL>> Created: Jan 2018 Modified: Jan 2018 """ from typing import Set, List from mgb.local_detection import Neighborhood from mgb.shared import Configuration class Device(object): """Define a mobile device. A mobile device keep track of its neighborhood ...
<reponame>nearj/mpvr-motionfiltering from .definitions import * class ScenarioSetting(): def __init__(self, name, motion_data, video_data, incidence_data): self.name = name self.motion_data = motion_data self.video_data = video_data class RawData: def __init__(self, path): self...
<gh_stars>10-100 import math, time, ctypes, platform import numpy as np from OpenGL import GL from renderable import TileRenderable class LineRenderable(): "Renderable comprised of GL_LINES" vert_shader_source = 'lines_v.glsl' vert_shader_source_3d = 'lines_3d_v.glsl' frag_shader_source = 'li...
<reponame>scottwedge/OpenStack-Stein # 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...
<filename>assets/src/ba_data/python/bastd/actor/onscreentimer.py # Released under the MIT License. See LICENSE for details. # """Defines Actor(s).""" from __future__ import annotations from typing import TYPE_CHECKING, overload import ba if TYPE_CHECKING: from typing import Optional, Union, Any, Literal class ...
<reponame>Jagermeister/out_of_many_one """ Constant SQL Statements """ ### Document Link Raw DOCUMENT_LINK_RAW_TABLE_CREATE = ''' CREATE TABLE IF NOT EXISTS document_link_raw ( document_link_raw_key INTEGER PRIMARY KEY, document_link_raw_hash TEXT, name_first TEXT, name_last TEXT, ...
from collections import OrderedDict import Pyro4 from pocs.camera import create_cameras_from_config as create_local_cameras from pocs.utils import error from pocs.utils import logger as logger_module from huntsman.pocs.camera.pyro import Camera as PyroCamera from huntsman.pocs.utils import load_config def list_dis...
<reponame>buddwm/hubble # -*- coding: utf-8 -*- ''' Module for returning various status data about a minion. These data can be useful for compiling into stats later. ''' # Import python libs import datetime import logging import os import re import time import hubblestack.utils.files import hubblestack.utils.path imp...
import os import pytest from ci_output_parser.log_file_parsers.log_file_parser import LogFileParser @pytest.fixture def mock_file_write_functions(mocker): mocker.patch.object(LogFileParser, 'output_lint_lines_to_file', return_value=True) mocker.patch.object(LogFileParser, 'output_lint_lines_to_json_file', r...
# imoot matplotlib and pandas toolkit # Python SQL toolkit and Object Relational Mapper # import flask from matplotlib import style import matplotlib.pyplot as plt import numpy as np import pandas as pd import datetime as dt import sqlalchemy from sqlalchemy.ext.automap import automap_base from sqlalchemy.orm import Se...
""" This package implements pytorch functions for Fourier-based convolutions. While this may not be relevant for GPU-implementations, convolutions in the spatial domain are slow on CPUs. Hence, this function should be useful for memory-intensive models that need to be run on the CPU or CPU-based computations involving ...
<gh_stars>1-10 # Copyright (c) 2021 slbotzone <https://t.me/slbotzone> # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, version 3. # # This program is distributed in t...
<filename>AnalyzeResults.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Apr 2 15:49:01 2020 Analyze results @author: <NAME>, <NAME>, <NAME> """ import matplotlib.pyplot as plt import pandas as pd import matplotlib, glob import seaborn as sns from numpy.linalg import norm from calcFreeEnergy impo...
<reponame>Melca-G/Aeolus<gh_stars>0 import sys import ConfigParser from os.path import expanduser # Set system path home = expanduser("~") cfgfile = open(home + "\\STVTools.ini", 'r') config = ConfigParser.ConfigParser() config.read(home + "\\STVTools.ini") # Master Path syspath1 = config.get('SysDir','MasterPackage') ...
# --- # jupyter: # jupytext: # formats: ipynb,py:percent # text_representation: # extension: .py # format_name: percent # format_version: '1.2' # jupytext_version: 1.2.1 # kernelspec: # display_name: tester # language: python # name: tester # --- # %% [markdown] # This n...
import time import pygame as pg from Player_Objects import * from main import * from Values import * # Text Back grount image def text_box_background(): text_box = pg.image.load(os.path.join('Art', 'Text Box.png')) textbox = pg.Rect((5 * TILESIZE, 12 * TILESIZE, 14 * TILESIZE, 3 * TILESIZE)) text_container...
from dataclasses import dataclass from inspect import getmodule, getsourcelines, getsource from operator import attrgetter from textwrap import indent from time import process_time from typing import List @dataclass class Measure: name: str hertz: float code: str highlight: bool = False def summa...
<gh_stars>1-10 import os import json import argparse import numpy as np from time import time from flowmatch.utils import load_config from combine.utils import evaluate, nms_wrapper, plot_pr_curves from combine.scores import HardAND from combine.evaluator import Evaluator COLORS = ['tab:blue', 'tab:red', 'tab:green']...
<filename>kg/triple_extract/triple_extract_rule.py """ 基于依存句法和语义角色标注的三元组抽取 """ from pyhanlp import HanLP import os, re class TripleExtractor: def __init__(self): self.parser = HanlpParser() '''文章分句处理, 切分长句,冒号,分号,感叹号等做切分标识''' def split_sents(self, content): return [sentence for sentence in...
# encoding=utf8 # pylint: disable=mixed-indentation, multiple-statements, line-too-long, expression-not-assigned, len-as-condition, no-self-use, unused-argument, no-else-return, old-style-class, dangerous-default-value from numpy import random as rand, inf, ndarray, asarray, array_equal from NiaPy.util import Task, Opt...
<reponame>richardsonlima/amonone import unittest from nose.tools import eq_ from amonone.web.apps.alerts.models import AlertsModel, AlertGroupsModel class AlertGroupsModelTest(unittest.TestCase): def setUp(self): self.model = AlertGroupsModel() self.collection = self.model.mongo.get_collection('alert_groups') ...
<reponame>ZhenghengLi/lcls2 from psdaq.configdb.get_config import get_config from p4p.client.thread import Context import json import time import pprint class xpm_link: def __init__(self,value): self.value = value def is_xpm(self): return (int(self.value)>>24)&0xff == 0xff def xpm_num(se...
<filename>gym_ultrasonic/tests/test_env.py import math import random import unittest import gym import numpy as np from numpy.testing import assert_array_almost_equal from gym_ultrasonic.envs.obstacle import Obstacle class TestUltrasonicEnv(unittest.TestCase): @classmethod def setUpClass(cls) -> None: ...
import tensorflow as tf import os import time import math import sys import shutil import numpy import keras import keras.backend as K import h5py import logging import argparse import random import inspect import matplotlib.pyplot as plt from functools import * import vtxops import vtx parser = argparse.ArgumentPar...
r""" Interface to GAP3 This module implements an interface to GAP3. AUTHORS: - <NAME> (February 2010) - <NAME> (March 2016) .. WARNING:: The experimental package for GAP3 is Jean Michel's pre-packaged GAP3, which is a minimal GAP3 distribution containing packages that have no equivalent in GAP4, see ...
<gh_stars>1-10 import datetime, yaml, re import urllib, hashlib from .base import BaseModule from md2book.config import * from md2book.templates import TemplateFiller from md2book.formats.mdhtml import extract_toc from md2book.util.exceptions import SimpleWarning from md2book.util.common import download_url class Met...
<gh_stars>0 # -*- coding: utf-8 -* # Copyright (c) 2019 BuildGroup Data Services Inc. # All rights reserved. import json import datetime import inspect from django.utils import six, timezone from django.utils.timezone import utc try: from dse.cqlengine.usertype import UserType except ImportError: from cassand...
# -*- encoding: utf-8 -*- ''' Model Managers RexChain BlockManager RXmanager TXmanager ''' import json import logging from datetime import timedelta from django.db import models from django.apps import apps from django.conf import settings from django.utils import timezone from django.core.cache import cache from core...
# This file is part of beets. # Copyright 2016, <NAME>. # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, ...
# Generated by Django 2.0.1 on 2018-11-27 10:46 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('core', '0036_auto_20181124_1705'), ] operations = [ migrations.AlterField( model_name='aluno_au...
<filename>convert.py #!/usr/bin/python3 # Convert data from Kartverket and Posten into GeoJson import xml.etree.ElementTree as ET import json import pyproj from shapely.geometry import Point, Polygon, LineString, mapping from shapely.ops import linemerge, transform import csv # Log configuration import logging loggin...
import json import logging from redes_neurais.mlp import Mlp from redes_neurais.som import SOM from PIL import Image import numpy import pprint from termcolor import colored colors = { "0": "white", "1": "red", "2": "blue", "3": "green" } class DataProcessor(object): def __init__(self, path_to_tr...
import sys import os import argparse import util import time import datetime import threading import logging from subprocess import call from concurrent.futures import ThreadPoolExecutor, wait, ALL_COMPLETED from os.path import join, getsize lock = threading.RLock() gl_threadTotTime = 0 gl_errorNum = 0 #func defin...
<filename>jobboard/views.py from django.shortcuts import render, get_object_or_404, redirect import jobboard from .forms import CreateNewJobForm from .models import Job from datetime import date, timedelta from student.models import Student from recruiter.models import Recruiter from job_application.models import Appli...
<filename>grillen.py #encoding=utf-8 from flask import Flask, render_template, request from sqlalchemy import update from forms import WurstOrderForm, DeleteOrderForm, IndexForm import config import os #TODO: Nachträgliche Änderungen der getätigten Bestellungen app = Flask(__name__) app.config['SECRET_KEY'] = confi...
#! /usr/bin/env python3 """ Entry point for Postkutsche. """ import os import sys import zlib import shutil import asyncio import logging import subprocess from os import listdir from os.path import isfile, isdir, join, exists import onlinebrief24 from guy import Guy from guy import http from jinja2 import Environme...
<gh_stars>10-100 from surgeo.models.base_model import BaseModel from bias_detector.common import * import pandas as pd import surgeo import pathlib class FullNameZipcodeModel(BaseModel): def __init__(self): super().__init__() self._package_root = pathlib.Path(surgeo.__file__).parents[0] ...
""" Класс дома """ import pygame from random import random from match import Match from paper import Paper class House(object): """Описывает дом""" def __init__(self, forest, physical_x: float, physical_y: float): """ Параметры forest - объект леса physical_x - Физическая к...
''' Compendium of generic DNS utilities ''' # Import salt libs import salt.utils # Import python libs import logging log = logging.getLogger(__name__) def __virtual__(): ''' Generic, should work on any platform ''' return 'dnsutil' def parse_zone(zonefile=None, zone=None): ''' Parses a zo...
""" @author <NAME> @file enum.py @note The singleton example is taken from: http://www.python.org/dev/peps/pep-0318/#examples @note I don't use TAB's and indentation is 4. @note epydoc wrongly interprets the class as a function. Probably because of the decorator (without it ...
import argparse import collections import logging import os import matplotlib.pyplot as plt from lib.ctoolswrapper import CToolsWrapper import gammalib logging.basicConfig(format='%(asctime)s %(levelname)s:\n%(message)s', level=logging.WARNING) # PYTHONPATH=.. python test_events_generation.py --model ../crab_simulati...
from django.shortcuts import render, get_object_or_404, redirect from django.template import Context, RequestContext from django.contrib.auth.decorators import login_required from django.http import HttpResponse from django.conf import settings from signbank.video.models import Video, GlossVideo, GlossVideoHistory from...
<gh_stars>1-10 # # # Copyright (c) 2010 <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
############################################################################################### # Varna SVG color script # # Author: <NAME> # <EMAIL> # Steve modified to plot T1 cleavage data # Steve modified to plot additional custom nuc colors and lines between nucs # ...
<filename>sazabi/__init__.py<gh_stars>0 import asyncio import logging import threading import discord import imgurpython import twython import yaml from sazabi.plugins.twitch import Twitch from sazabi.types import SazabiBotPlugin, LoggedObject client = discord.Client() class Sazabi(LoggedObject): def __init__(se...
# Importing testing frameworks: import unittest # Importing 3rd party packages for testing: import sqlite3 import sqlalchemy import pandas as pd import bs4 import numpy as np # Importing velkoz web packages for testing: from velkoz_web_packages.objects_stock_data.objects_fund_holdings.web_objects_fund_holdings import...
<reponame>theEpsilon/slr-tool import boto3 import json from bson import json_util from db_service import DBService from event_validator import EventValidator def handler(event, context): validator = EventValidator(event) if not validator.validate_event(): return { "statusCode": 400, "body": "Bad ...