content
stringlengths
0
894k
type
stringclasses
2 values
# Copyright 2016 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """API for interacting with the buildbucket service directly. Instead of triggering jobs by emitting annotations then handled by the master, this module all...
python
from parsers import golden_horse_parser parser = golden_horse_parser() args = parser.parse_args() REDUNDANT_INFO_LINE_NUM = 4 TRAILING_USELESS_INFO_LINE_NUM = -1 def clean_line(string, remove_trainling_position=-2): return string.replace('\t', '').split(',')[:remove_trainling_position] def main(): with op...
python
from setuptools import setup setup(name='money', version='0.1', description='Implementation of Fowler\s Money', url='https://github.com/luka-mladenovic/fowlers-money', author='Luka Mladenovic', author_email='', license='MIT', packages=['money'], install_requires=[ ...
python
from . import sequence from . import sampler as sampler_trw import numpy as np import collections import copy from ..utils import get_batch_n, len_batch # this the name used for the sample UID sample_uid_name = 'sample_uid' class SequenceArray(sequence.Sequence): """ Create a sequence of batches from numpy a...
python
from cli import * # # VTOC layout: (with unimportant fields removed) # # OFFSET SIZE NUM NAME # 0 128 1 label VTOC_VERSION = 128 # 128 4 1 version # 132 8 1 volume name VTOC_NUMPART = 140 # 140 2 ...
python
import os from pathlib import Path from setuptools import find_packages, setup def parse_req_file(fname, initial=None): """Reads requires.txt file generated by setuptools and outputs a new/updated dict of extras as keys and corresponding lists of dependencies as values. The input file's contents are...
python
import sys from PyQt5 import QtWidgets from gui import MainWindow """ Guitario, simple chord recognizer All created MP4 files are stored in saved_accords directory """ if __name__ == '__main__': print("Loading application!") app = QtWidgets.QApplication(sys.argv) app.setApplicationName("Guitario") app...
python
from abc import ABC, abstractmethod class MyAbstract(ABC): def __init__(self): pass @abstractmethod def doSomething(self): pass class MyClass1(MyAbstract): def __init__(self): pass def doSomething(self): print("abstract method") ...
python
""" Overrides the align-items value for specific flex items. """ from ..defaults import BREAKPOINTS, UP, DOWN, FULL, ONLY from ...core import CssModule vals = [ ('fs', 'flex-start'), ('fe', 'flex-end'), ('c', 'center'), ('b', 'baseline'), ('s', 'stretch') ] mdl = CssModule( 'Align self', ...
python
#!/usr/bin/env python3 import sys try: import psycopg2 postgres = True except: import sqlite3 postgres = False if __name__ == "__main__": if len(sys.argv) != 2: print("You must supply the database name as the first argument") sys.exit() if postgres: conn = psycopg2.conn...
python
class Cache(object): def __init__(self, j): self.raw = j if "beforeRequest" in self.raw: self.before_request = CacheRequest(self.raw["beforeRequest"]) else: self.before_request = None if "afterRequest" in self.raw: self.after_request = CacheReque...
python
from OpenGL.GL import * from OpenGL.GL.ARB import * from OpenGL.GLU import * from OpenGL.GLUT import * from OpenGL.GLUT.special import * from OpenGL.GL.shaders import * frame_count = 0 def pre_frame(): pass def post_fram(): frame_count += 1 def disable_vsyc(): import glfw glfw...
python
# Create your tasks here from __future__ import absolute_import, unicode_literals from celery import shared_task """ @shared_task def hello(): print("It's a beautiful day in the neighborhood") """
python
# -*- coding: utf-8 -*- import logging import lecoresdk def handler(event, context): it = lecoresdk.IoTData() set_params = {"productKey": "YourProductKey", "deviceName": "YourDeviceName", "payload": {"LightSwitch":0}} res = it.setThingProperties(set_params) print(res) get_pa...
python
from pathlib import Path from cgr_gwas_qc.exceptions import GtcMagicNumberError, GtcTruncatedFileError, GtcVersionError from cgr_gwas_qc.parsers.illumina import GenotypeCalls def validate(file_name: Path): try: # Illumina's parser has a bunch of different error checks, so I am just # using those ...
python
from selenium import webdriver #import time #import unittest browser = webdriver.Chrome() browser.get('http://localhost:8000') #unittest.TestCase.assertTrue(browser.get('http://localhost:8000'),msg='OK!') assert 'The install worked successfully!' in browser.title print('pass!') browser.quit()
python
# Django imports from django.shortcuts import render from django.core.urlresolvers import reverse_lazy from django.views import generic as django_generic from django.http import HttpResponse from django.contrib import messages # 3rd Party Package imports from braces.views import LoginRequiredMixin #Lackawanna Specifi...
python
from __future__ import absolute_import, division, print_function from .version import __version__ import __main__ try: import etelemetry etelemetry.check_available_version("incf-nidash/pynidm", __version__) except ImportError: pass
python
import sys import os sys.path.append(os.path.join(os.getcwd(), 'deep_api')) from deep_app import create_app application = create_app() if __name__ == '__main__': application.run()
python
""" 切片:定位多个元素 for number in range(开始,结束,间隔) """ message = "我是花果山水帘洞美猴王孙悟空" # 写法1:容器名[开始: 结束: 间隔] # 注意:不包含结束 print(message[2: 5: 1]) # 写法2:容器名[开始: 结束] # 注意:间隔默认为1 print(message[2: 5]) # 写法3:容器名[:结束] # 注意:开始默认为头 print(message[:5]) # 写法4:容器名[:] # 注意:结束默认为尾 print(message[:]) message = "我是花果山水帘洞美猴王孙悟空" # 水帘洞...
python
from flask import request, make_response import json from themint import app from themint.service import message_service from datatypes.exceptions import DataDoesNotMatchSchemaException @app.route('/', methods=['GET']) def index(): return "Mint OK" # TODO remove <title_number> below, as it is not used. @app.ro...
python
import json import os os.environ['GIT_PYTHON_REFRESH'] = 'quiet' from configparser import ConfigParser import lstm_model as lm from itertools import product from datetime import datetime import data_preprocess as dp from sacred import Experiment from sacred.observers import MongoObserver ex = Experiment() ex.observer...
python
from PIL import Image import os from os.path import join import scipy.io as sio import matplotlib.pyplot as plt import numpy as np from scipy import ndimage from Network import Network from utils import plot_images , sigmoid , dsigmoid_to_dval , make_results_reproducible , make_results_random make_results_reproducibl...
python
import json import re import os import pytest import requests import pytz import datetime as dt import connaisseur.trust_data import connaisseur.notary_api as notary_api from connaisseur.image import Image from connaisseur.tuf_role import TUFRole from connaisseur.exceptions import BaseConnaisseurException @pytest.fix...
python
def identidade(n): I = [[0 for x in range(n)] for y in range(n)] for i in range(0,n): I[i][i] = 1 return I def transposta(mA): #transposta n = len(mA) mT = identidade(n) for i in range(n): for j in range(n): mT[i][j] = mA[j][i] print("Matriz Transposta : ") ...
python
# Copyright 2019 The FastEstimator Authors. 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 required by appl...
python
from datetime import datetime, timedelta import pytest from api.models.timetables import Timetable from fastapi import status from fastapi.testclient import TestClient pytestmark = pytest.mark.asyncio @pytest.fixture def timetable2(timetable): return Timetable( id=1, action="on", start=d...
python
import enum from typing import Optional from sqlalchemy import ( BigInteger, Boolean, Column, DateTime, Enum, Float, ForeignKey, ForeignKeyConstraint, Index, Integer, String, UnicodeText, func ) from sqlalchemy.orm import relationship from .database import Base UNK...
python
#!/usr/local/bin/python3 import os import re import sys import argparse import plistlib import json def modifyPbxproj(): data = '' flag = False end = False with open(filePath, 'r') as file: for line in file.readlines(): if not end: find = line.find('3B02599D20F49A43001F9C82 /* Debug */') ...
python
# coding: utf-8 # # Dogs-vs-cats classification with ViT # # In this notebook, we'll finetune a [Vision Transformer] # (https://arxiv.org/abs/2010.11929) (ViT) to classify images of dogs # from images of cats using TensorFlow 2 / Keras and HuggingFace's # [Transformers](https://github.com/huggingface/transformers). # ...
python
################################################################################# # Autor: Richard Alexander Cordova Herrera # TRABAJO FIN DE MASTER # CURSO 2019-2020 # MASTER EN INTERNET DE LAS COSAS # FACULTAD DE INFORMATICA # UNIVERSIDAD COMPLUTENSE DE MADRID ##################################################...
python
from django.apps import AppConfig class TambahVaksinConfig(AppConfig): default_auto_field = 'django.db.models.BigAutoField' name = 'tambah_vaksin'
python
# Data Preprocessing Template # Importing the libraries import numpy as np import matplotlib.pyplot as plt import pandas as pd # Importing the dataset dataset = pd.read_csv('Salary_Data.csv') X = dataset.iloc[:, :-1].values y = dataset.iloc[:, 1].values # Splitting the dataset into the Training set and Test set from...
python
"""Utilities relative to hunspell itself."""
python
# -*- coding: utf-8 -*- """ Created on Thu Jan 30 19:39:10 2020 @author: esol """ from neqsim.thermo import fluid, addOilFractions, printFrame, dataFrame, fluidcreator,createfluid,createfluid2, TPflash, phaseenvelope from neqsim.process import pump, clearProcess, stream, valve, separator, compressor, runProcess, view...
python
# Copyright 2018 Lawrence Kesteloot # # 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 agr...
python
def check(): import numpy as np dataOK = np.loadtxt('nusselt_ref.out') dataChk= np.loadtxt('data/post/wall/nusselt.out') tol = 1e-6 nts = 10000 chk = (np.mean(dataOK[-nts:,2])-np.mean(dataChk[-nts:,2]))<tol return chk def test_answer(): assert check()
python
import pytt assert pytt.name == "pytt"
python
from discord.ext import commands import discord import cogs import random import asyncio import requests from discord import File import os from datetime import datetime import traceback import tabula import json bot = commands.Bot(command_prefix='$') class VipCog(commands.Cog): def __init__(self,...
python
from collections import OrderedDict from copy import deepcopy from functools import partial from ml_collections import ConfigDict import numpy as np import jax import jax.numpy as jnp import flax import flax.linen as nn from flax.training.train_state import TrainState import optax import distrax from .jax_utils impo...
python
import sys import os from inspect import getmembers from types import BuiltinFunctionType, BuiltinMethodType, MethodType, FunctionType import zipfile from util import isIronPython, isJython, getPlatform cur_path = os.path.abspath(os.path.dirname(__file__)) distPaths = [os.path.join(cur_path, '../../../indigo/dist'), ...
python
import os from .base import * BASE_SITE_URL = 'https://rapidpivot.com' AMQP_URL = 'amqp://guest:guest@localhost:5672//' ALLOWED_HOSTS = ['rapidpivot.com'] ADMINS = (('Name', 'email@service.com'),) DEBUG = False TEMPLATE_DEBUG = False # SSL/TLS Settings SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https') ...
python
from setuptools import find_packages, setup import os # load README.md as long_description long_description = '' if os.path.exists('README.md'): with open('README.md', 'r') as f: long_description = f.read() setup( name='XMCD Projection', version='1.0.0', packages=find_packages(include=['xmcd_...
python
from random import sample from time import sleep lista = [] print('\033[0;34m-'*30) print(' \033[0;34mJOGOS DA MEGA SENA') print('\033[0;34m-\033[m'*30) j = int(input('Quantos jogos você deseja gerar? ')) print('SORTEANDO...') for i in range(0, j): ran = sorted(sample(range(1, 60), 6)) lista.append(ran[:]) ...
python
from PyQt5.QtWidgets import QWidget, QMainWindow from PyQt5.QtCore import Qt import gi.repository gi.require_version('Gdk', '3.0') from gi.repository import Gdk from utils import Rect # from keyboard import Keybroad # from button import Button # moved inside classes to prevent cyclic import # Window(parent, t...
python
# Generated by Django 3.1.5 on 2021-02-01 18:11 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('rentalsapp', '0001_initial'), ] operations = [ migrations.AlterField( model_name='tenants', name='amou...
python
# -*- coding: utf-8 -*- def main(): from itertools import accumulate n = int(input()) # 大きさを基準に昇順で並び替えておく a = sorted(list(map(int, input().split()))) sum_a = list(accumulate([0] + a)) # 色は最大でN種類 ans = [False for _ in range(n)] # 初期化:最も大きいモンスターは,確実に最後まで生き残る ans[n - 1] ...
python
# Python code for 2D random walk. import json import sys import random import time import math import logging import asyncio from .DataAggregator import DataAggregator from .PositioningTag import PositioningTag from pywalkgen.walk_model import WalkAngleGenerator from pywalkgen.pub_sub import PubSubAMQP from pywalkgen...
python
from tkinter import* from tkinter import messagebox from PIL import ImageTk import sqlite3 root=Tk() root.geometry("1196x600") root.title("Hotel Management System") #bg=PhotoImage(file ="D:\Python\HotelManagement\Background.png") #bglabel=Label(root,image=bg) #bglabel.place(x=0,y=0) backimage=PhotoImage("D:...
python
import os import pytest from cctbx import sgtbx, uctbx from dxtbx.serialize import load import dials.command_line.cosym as dials_cosym from dials.algorithms.symmetry.cosym._generate_test_data import ( generate_experiments_reflections, ) from dials.array_family import flex from dials.util import Sorry @pytest.m...
python
def print_section_header(header: str) -> None: print(f"========================================================================") print(f"=== {header} ") def print_section_finish() -> None: print(f"=== SUCCESS\n")
python
names = [] posx = [] posy = [] caps = [] with open('sink_cap.txt') as f: for line in f: tokens = line.split() names.append(tokens[0]) posx.append(float(tokens[1])) posy.append(float(tokens[2])) caps.append(float(tokens[3])) minx = min(posx) miny = min(posy) maxx = max(posx) maxy = max(posy) #print(" -...
python
from block_model.controller.block_model import BlockModel from drillhole.controller.composites import Composites from geometry.controller.ellipsoid import Ellipsoid from kriging.controller.search_ellipsoid import SearchEllipsoid from kriging.controller.point_kriging import PointKriging from variogram.controller.model i...
python
"""This module demonstrates usage of if-else statements, while loop and break.""" def calculate_grade(grade): """Function that calculates final grades based on points earned.""" if grade >= 90: if grade == 100: return 'A+' return 'A' if grade >= 80: return 'B' if gra...
python
from pinata.response import PinataResponse from pinata.session import PinataAPISession class PinataClient: def __init__(self, session: PinataAPISession, api_namespace: str): self.session = session self._prefix = api_namespace def _post(self, uri, *args, **kwargs) -> PinataResponse: re...
python
import music_trees as mt from music_trees.tree import MusicTree from copy import deepcopy import random from tqdm import tqdm NUM_TAXONOMIES = 10 NUM_SHUFFLES = 1000 output_dir = mt.ASSETS_DIR / 'taxonomies' output_dir.mkdir(exist_ok=True) target_tree = mt.utils.data.load_entry( mt.ASSETS_DIR / 'taxonomies' / ...
python
from PIL import Image import sys im = Image.new("L", (256, 256)) c = 0 with open(sys.argv[1], "rb") as f: f.read(8) byte = f.read(1) while c < 65536: #print(c) im.putpixel((c % 256, int(c / 256)), ord(byte)) byte = f.read(1) c = c + 1 im.save("fog.png")
python
from ..std.index import * from .math3d import * from .math2d import * from ..df.blizzardj import bj_mapInitialPlayableArea class TerrainGrid(Rectangle): grids = [] _loc = None def __init__(self,r,sampling=8): Rectangle.__init__(self,GetRectMinX(r),GetRectMinY(r),GetRectMaxX(r),GetRectMaxY(r)) ...
python
from collections.abc import Callable def update( # <1> probe: Callable[[], float], # <2> display: Callable[[float], None] # <3> ) -> None: temperature = probe() # imagine lots of control code here display(temperature) def probe_ok() -> int: # <4> return 42 def display_wrong(te...
python
# pylint: disable=invalid-name # pylint: disable=too-many-locals # pylint: disable=too-many-arguments # pylint: disable=too-many-statements # pylint: disable=unbalanced-tuple-unpacking # pylint: disable=consider-using-f-string) # pylint: disable=too-many-lines """ A module for finding M² values for a laser beam. Full ...
python
''' 09.60 - Use the 8x8 LED Matrix with the max7219 driver using SPI This sketch shows how to control the 8x8 LED Matrix to draw random pixels. Components ---------- - ESP32 - One or more 8x8 LED matrix displays with the max7219 driver - GND --> GND - VCC --> 5V - CS --> GPIO 5 (SPI SS) ...
python
#!/usr/bin/python from setuptools import setup, find_packages version = '0.9.4' setup(name='workerpool', version=version, description="Module for distributing jobs to a pool of worker threads.", long_description="""\ Performing tasks in many threads made fun! This module facilitates distributing s...
python
""" For more details, see the class documentation. """ from django.db.models import Q from map_annotate_app.dto import CrimeDTO from map_annotate_app.extras import Location from map_annotate_app.models import Crime class CrimeDAO: """ This class represents the data access layer for a crime record. """ ...
python
""" $url mediavitrina.ru $type live $region Russia """ import logging import re from urllib.parse import urlparse from streamlink.plugin import Plugin, pluginmatcher from streamlink.plugin.api import validate from streamlink.stream.hls import HLSStream from streamlink.utils.url import update_qsd log = logging.getLog...
python
#!/usr/bin/env python from __future__ import absolute_import, division, print_function import sys from socket import * from time import strftime import datetime def main(): if len(sys.argv) < 4: print("completion_logger_server.py <listen address> <listen port> <log file>") exit(1) host = sys.argv[1] por...
python
#!/usr/bin/python """ python 1.5.2 lacks some networking routines. This module implements them (as I don't want to drop 1.5.2 compatibility atm) """ # $Id: net.py,v 1.2 2001/11/19 00:47:49 ivo Exp $ from string import split import socket, fcntl, FCNTL def inet_aton(str): """ convert quated dot...
python
""" this is for pytest to import everything smoothly """ import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)))
python
from fastapi import FastAPI from fastapi.responses import JSONResponse app = FastAPI() store = { 'demo': 'this is important data!' } @app.get('/') # Return all key-value pairs def read_keys(): return store @app.post('/') # Create a new key-value pair def create_key(key: str, value: str): ...
python
import pytest import logging import tempfile from lindh import jsondb # Logging FORMAT = '%(asctime)s [%(threadName)s] %(filename)s +%(levelno)s ' + \ '%(funcName)s %(levelname)s %(message)s' logging.basicConfig(format=FORMAT, level=logging.DEBUG) @pytest.fixture(scope='function') def db(): db = jsondb...
python
import sys import os from PIL import Image, ImageDraw # Add scripts dir to python search path sys.path.append(os.path.dirname(os.path.abspath(sys.argv[0]))) from maps_def import maps as MAPS BORDERS = True IDS = True def bake_map(tiles, info): size = tiles[0].size[0] res = Image.new("RGB", (len(info[0]) * si...
python
#@+leo-ver=5-thin #@+node:edream.110203113231.741: * @file ../plugins/add_directives.py """Allows users to define new @direcives.""" from leo.core import leoGlobals as g directives = ("markup",) # A tuple with one string. #@+others #@+node:ekr.20070725103420: ** init def init(): """Return True if the plugin has...
python
# Microsoft API results index & search features generator """ Copyright 2016 Fabric S.P.A, Emmanuel Benazera, Alexandre Girard Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyrig...
python
""" This module is used to interface with classical HPC queuing systems. """
python
from django.contrib import admin from .models import SiteToCheck @admin.register(SiteToCheck) class SiteToCheckAdmin(admin.ModelAdmin): list_display = ['url', 'last_status', 'last_response_time']
python
# Based on https://github.com/petkaantonov/bluebird/blob/master/src/promise.js from .compat import Queue # https://docs.python.org/2/library/queue.html#Queue.Queue LATE_QUEUE_CAPACITY = 0 # The queue size is infinite NORMAL_QUEUE_CAPACITY = 0 # The queue size is infinite class Async(object): def __init__(sel...
python
#!/usr/bin/env python3 import sys import os import time # # Generate the master out.grid # Create a 3M point file of lat/lons - and write to ASCII file called out.grd. # This file will be used as input to ucvm_query for medium scale test for images # if not os.path.exists("out.grd"): print("Creating grd.out file.") ...
python
import trcdproc.navigate.raw as nav from trcdproc.core import H5File def test_all_signal_dataset_paths_are_found(organized_faulty_data: H5File): """Ensures that all dataset paths are found """ dataset_paths_found = {path for path in nav.all_signal_dataset_paths(organized_faulty_data)} all_paths = [] ...
python
from nhlscrapi.games.events import EventType as ET, EventFactory as EF from nhlscrapi.scrapr import descparser as dp def __shot_type(**kwargs): skater_ct = kwargs['skater_ct'] if 'skater_ct' in kwargs else 12 period = kwargs['period'] if 'period' in kwargs else 1 if period < 5: return ET.Shot # elif p...
python
from django import VERSION if VERSION < (3, 2): default_app_config = ( "rest_framework_simplejwt.token_blacklist.apps.TokenBlacklistConfig" )
python
# exercise/views.py # Jake Malley # 01/02/15 """ Define all of the routes for the exercise blueprint. """ # Imports from flask import flash, redirect, render_template, \ request, url_for, Blueprint, abort from flask.ext.login import login_required, current_user from forms import AddRunningForm, AddCy...
python
#!/usr/bin/env python """Tests for `magic_dot` package.""" import pytest from collections import namedtuple from magic_dot import MagicDot from magic_dot import NOT_FOUND from magic_dot.exceptions import NotFound def test_can(): """Test that dict key is accessible as a hash .""" md = MagicDot({"num": 1}) ...
python
message = 'This is submodule 1.' def module_testing(): print(message)
python
# SISO program G.py # This function is a placeholder for a generic computable function G. # This particular choice of G returns the first character of the input # string. import utils from utils import rf def G(inString): if len(inString) >= 1: return inString[0] else: return "" def testG()...
python
''' LICENSE: MIT https://github.com/keras-team/keras/blob/a07253d8269e1b750f0a64767cc9a07da8a3b7ea/LICENSE 実験メモ Dropoutをなくしてみたが、あまりへんかなし SGDにへんこうしたら、しゅうそくがすごくおそくなった 面白い。 試したいアイデアがあるので、 自前のactivation functionを書いてみる。 ''' from __future__ import print_function import keras from keras.datasets import mnist from keras.mo...
python
from .tracebackturbo import *
python
from __future__ import unicode_literals import csv import io import json import os import string from collections import OrderedDict from unittest import TestCase import pandas as pd from backports.tempfile import TemporaryDirectory from tempfile import NamedTemporaryFile from hypothesis import ( given, He...
python
#coding=utf-8 from datetime import datetime from django.db import models from django.utils import timezone from django.core.urlresolvers import reverse from aops.settings import INT_CHOICES, STATUS_CHOICES from cmdb import signals from cmdb.models.ip_record import IpRecord from cmdb.models.physical_server import Phy...
python
# -*- coding:utf-8 -*- from unittest import TestCase from simstring.measure.cosine import CosineMeasure class TestCosine(TestCase): measure = CosineMeasure() def test_min_feature_size(self): self.assertEqual(self.measure.min_feature_size(5, 1.0), 5) self.assertEqual(self.measure.min_feature_s...
python
# -*- coding: utf-8 -*- """ Created on Thu Apr 23 15:28:07 2020 @author: ESOL """ # Import module import jpype # Enable Java imports import jpype.imports # Pull in types from jpype.types import * jpype.addClassPath('C:/Users/esol/OneDrive - Equinor/programming/neqsim/NeqSim.jar') # Launch the JVM #jpype.startJVM() ...
python
from fontbakery.callable import check from fontbakery.callable import condition from fontbakery.checkrunner import Section, PASS, FAIL, WARN from fontbakery.fonts_profile import profile_factory from tests.test_general import ( is_italic, com_roboto_fonts_check_italic_angle, com_roboto_fonts_check_fs_type, ...
python
import socket as sk import sys import threading from PyQt4.QtCore import * MAX_THREADS = 50 #def usage(): #print("\npyScan 0.1") #print("usage: pyScan <host> [start port] [end port]") class Scanner(threading.Thread): def __init__(self, host, port): threading.Thread.__init__(self) # host an...
python
""" Tyson Reimer October 08th, 2020 """ import os import numpy as np import pandas as pd import statsmodels.api as sm from scipy.stats import norm from umbms import get_proj_path, get_script_logger from umbms.loadsave import load_pickle ##############################################################...
python
#encoding=utf-8 import sys #encoding=utf-8 ''' SocialMiner https://github.com/paulyang0125/SocialMiner Copyright (c) 2015 Yao-Nien, Yang Licensed under the MIT license. ''' import re from optparse import OptionParser import nltk #from nltk import * import nltk.cluster import nltk.cluster.kmeans import nltk.cluster....
python
#!/usr/bin/python # Copyright 2016 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Allow creation of uart/console interface via usb google serial endpoint.""" import argparse import array import exceptions import os ...
python
import numpy as np # general convolve framework def convframe(input, weight, output=None, init=0, mode='reflect', buffertype=None, keeptype=True, func=None): if output is None: output = np.zeros(input.shape, buffertype or input.dtype) output[:] = input if init is None else init buf = np...
python
import unittest from user import User class UserTest(unittest.TestCase): """ Test class that defines test cases for the contact class behaviours. Args: unittest.TestCase: Inherits the testCase class that helps in creating test cases """ def setUp(self): """ Set up method to ...
python
# Generated by Django 2.0.8 on 2018-08-12 16:09 from django.db import migrations, models from django_add_default_value import AddDefaultValue class Migration(migrations.Migration): dependencies = [("dadv", "0001_initial")] operations = [ migrations.CreateModel( name="TestTextDefault", ...
python
import boto3 import json from datetime import datetime, timedelta from botocore.client import Config def handler(event, context): s3 = boto3.client('s3', config=Config(signature_version='s3v4')) BUCKET_NAME = 'photostorage113550-dev'; s3_bucket_content = s3.list_objects(Bucket=BUCKET_NAME)['Contents'] contents...
python
import collections import logging import os import time import suds.xsd.doctor import suds.client from suds.plugin import MessagePlugin from suds import WebFault from . import base logger = logging.getLogger(__name__) # Suds has broken array marshaling. See these links: # http://stackoverflow.com/questions/351981...
python
import os import random import sys, getopt def getDesiredROMCount(): #Asks the user how many roms they want to select from, loops until it gets a valid input asking = True numFiles = 0 while asking: try: numFiles = int(input("Please enter the number of games you'd like randomly sel...
python