text stringlengths 1 927k |
|---|
import os
import numpy as np
import numba as nb
def create_folder(storage_path):
if not os.path.isdir(storage_path):
os.makedirs(storage_path,exist_ok=True)
lsdir = os.listdir(storage_path)
for item in ["info","hist","soln","figs"]:
if item not in lsdir:
os.makedirs(storage_pat... |
#! python
# Removes letter from word to make characters go alphabetically.
# It doesn't work all the time, but is efficient.
import unittest
class TestRemoveLettersAlphabet(unittest.TestCase):
def test_object1(self):
self.assertEqual(letters_to_remove('mateusz'), 3)
def test_object2(self):
s... |
##
# Copyright (c) 2006-2016 Apple 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 required by applicable l... |
import h5py
import os
import numpy as np
base_path = os.path.dirname(os.path.realpath(__file__))
feature_file = '/media/uttaran/FCE1-7BF3/Gamma/Gait/classifier_stgcn/model_classifier_stgcn/featuresCombineddeep_features.txt'
f = np.loadtxt(feature_file)
fCombined = h5py.File('/media/uttaran/FCE1-7BF3/Gamma/Gait/data/fe... |
# Configuration for Finarfin
"""Copyright (c) 2005-2022, University of Oxford.
All rights reserved.
University of Oxford means the Chancellor, Masters and Scholars of the
University of Oxford, having an administrative office at Wellington
Square, Oxford OX1 2JD, UK.
This file is part of Chaste.
Redistribution and u... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# s3upload.py
# It is an example that handles S3 buckets on AWS.
# It uses Client API (low-level) of Boto3.
# Upload a local file to a S3 bucket.
# You must provide 1 parameter:
# BUCKET_NAME = Name of the bucket
# OBJECT_NAME = Object file name in the bucket
# LOCAL_FI... |
import numpy as np
import timeit
import cv2
from PIL import Image
from aws_lambda_powertools.logging import Logger
from aws_lambda_powertools.tracing import Tracer
logger = Logger(service='face-detector', child=True)
tracer = Tracer(service='face-detector')
@tracer.capture_method(capture_response=False)
def resize_... |
from .base import * # noqa
from .base import env
# GENERAL
# ------------------------------------------------------------------------------
# https://docs.djangoproject.com/en/dev/ref/settings/#debug
DEBUG = True
# https://docs.djangoproject.com/en/dev/ref/settings/#secret-key
SECRET_KEY = env(
"DJANGO_SECRET_KEY... |
from contextlib import ContextDecorator
from operator import itemgetter
from wagtail.utils.apps import get_app_submodules
_hooks = {}
def register(hook_name, fn=None, order=0):
"""
Register hook for ``hook_name``. Can be used as a decorator::
@register('hook_name')
def my_hook(...):
... |
# -*- coding: utf-8 -*-
# snapshottest: v1 - https://goo.gl/zC4yUc
from __future__ import unicode_literals
from snapshottest import Snapshot
snapshots = Snapshot()
snapshots['test_schema[deleteMap] 1'] = {
'data': {
'deleteMap': {
'ok': True
}
}
}
snapshots['test_schema[deleteMa... |
from django.contrib.admin.views.decorators import staff_member_required
from django.contrib.auth.decorators import login_required
from django.utils.decorators import method_decorator
from django.http import Http404
class StaffRequiredMixin(object):
@classmethod
def as_view(self, *args, **kwargs):
view ... |
"""
Django settings for app project.
Generated by 'django-admin startproject' using Django 2.1.15.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.1/ref/settings/
"""
import os
# Bu... |
# state.py - fsmonitor persistent state
#
# Copyright 2013-2016 Facebook, Inc.
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from __future__ import absolute_import
import errno
import os
import socket
import struct
from mercur... |
import os, sys, re
import shutil
import optparse
import shutil
import pandas
import numpy
import subprocess
import fnmatch
from joblib import Parallel, delayed
import multiprocessing
from Bio import SeqIO
import glob
#####################################
#This is the script to produce SSL file outputs for skyline spec... |
"""Find modules used by a script, using introspection."""
from __future__ import generators
import dis
import imp
import marshal
import os
import sys
import types
import struct
if hasattr(sys.__stdout__, "newlines"):
READ_MODE = "U" # universal line endings
else:
# Python < 2.3 compatibility, no longer stric... |
import inspect
class _D:
def _m(self): pass
class _C:
def _m(self): pass
_x = _C()
_x2 = _D()
a=121111
r = input('hahah')
print(r)
raise AttributeError('Provider test already registered')
print (type(_C),_x.__class__,dir(_x),"------------")
import types
###print (dir(types))
print (type(inspect))
... |
def adicionar_tarefa(lista_tarefas, tarefas):
lista_tarefas.append(tarefas)
def deletar_tarefa(lista_tarefas, tarefas_deletadas):
"""
Esta função serve para deletar a ultima tarefa da lista e guarda esta tarefa em outra lista.
"""
if not lista_tarefas:
print("Nada a deletar")
r... |
from pyuvm.s05_base_classes import uvm_object
import pyuvm.error_classes as error_classes
import cocotb
# 9.1
#
# This is a dramatically simplified version of UVM phasing. We don't have
# to deal with simulation time and we are not going to deal with a generalized
# phasing system.
#
# So this system simply traverses ... |
"""Mixin class for handling harmony callback subscriptions."""
import asyncio
import logging
# pylint: disable-next=deprecated-typing-alias
# Issue with Python 3.9.0 and 3.9.1 with collections.abc.Callable
# https://bugs.python.org/issue42965
from typing import Any, Callable, NamedTuple, Optional
from homeassistant.... |
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Helpful routines for regression testing
#
import os
import sys
from binascii import hexlify, unhex... |
import numpy as np
from skimage.segmentation import random_walker
from skimage.transform import resize
from skimage._shared._warnings import expected_warnings
from skimage._shared import testing
# older versions of scipy raise a warning with new NumPy because they use
# numpy.rank() instead of arr.ndim or numpy.linal... |
#!/usr/bin/env python
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
from twisted.spread import pb
from twisted.internet import reactor
class One(pb.Root):
def remote_takeTwo(self, two):
print "received a Two called", two
print "telling it to print(12)"
tw... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import xavier_init
from mmdet.core import auto_fp16
from ..registry import NECKS
from ..utils import ConvModule
from mmdet.ops.context_block import ContextBlock
from mmdet.models.plugins.squeeze_excitation import ChannelSELayer
@NECKS.... |
"""MXNet Module for Attention-based Graph Neural Network layer"""
# pylint: disable= no-member, arguments-differ, invalid-name
import mxnet as mx
from mxnet.gluon import nn
from .... import function as fn
from ..softmax import edge_softmax
from ..utils import normalize
from ....utils import expand_as_pair
class AGNN... |
from Adafruit_MotorHAT import Adafruit_MotorHAT, Adafruit_DCMotor, Adafruit_StepperMotor
import time
import atexit
MH = Adafruit_MotorHAT(0x60)
STEPRES = 1.8 # Step resulition in units of degree/step
DIRECTIONS = { "ccw":Adafruit_MotorHAT.FORWARD,
"cw":Adafruit_MotorHAT.BACKWARD}
STEPTYPES = { "single":Adafruit_Mo... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2012-2019 Snowflake Computing Inc. All right reserved.
#
import pytest
@pytest.mark.skip(
reason="Cython is not enabled in build env")
def test_select_with_num(conn_cnx):
with conn_cnx() as json_cnx:
with conn_cnx() as arrow_cnx:
... |
"""Tasks for reading and writing data.
Tasks
=====
.. autosummary::
:toctree:
LoadFiles
LoadMaps
LoadFilesFromParams
Save
Print
LoadBeamTransfer
File Groups
===========
Several tasks accept groups of files as arguments. These are specified in the YAML file as a dictionary like below.
.... |
# Copyright (c) 2020-2021 Danilo G. Baio <dbaio@bsd.com.br>
#
# 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... |
import os
import sys
import polib
import django
from django.conf import settings
from django.core.management.base import BaseCommand
from django.utils import translation
# This is almost a management command, but we do not want it to be added to the django-admin namespace for the simple
# reason that it is not expec... |
# -*- coding: utf-8 -*-
# Copyright (c) 2020, Siddhant and Contributors
# See license.txt
from __future__ import unicode_literals
# import frappe
import unittest
class TestCoordinators(unittest.TestCase):
pass |
try:
# If relman-auto-nag is installed
from bugzilla.agents import BMOAgent
from bugzilla.utils import os
from bugzilla.utils import get_config_path
except:
# If relman-auto-nag not installed, add project root directory into
# PYTHONPATH
import os
import sys
import inspect
curren... |
#!/usr/bin/env python3
"""
Parser for calculate_callability.py
"""
import logging
import json
from multiqc.utils import report
log = logging.getLogger(__name__)
def parse_reports(self):
# Set up vars
self.calculate_callability = dict()
# Collect metrics
for f in self.find_log_files('multiqc_npm/... |
# -*- coding: utf-8 -*-
#
# 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 copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... |
# USAGE
# python yolo_video.py --input videos/airport.mp4 --output output/airport_output.avi --object_detection object_detection-coco
# import the necessary packages
import numpy as np
import argparse
import imutils
import time
import cv2
import os
# construct the argument parse and parse the arguments
ap = argparse.... |
# Copyright 2016, 2017 IBM Corp.
#
# 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 writin... |
from unittest import TestCase
from unittest import mock
from med2img.med2img import Med2img
class Med2imgTests(TestCase):
"""
Test Med2img.
"""
def setUp(self):
self.app = Med2img()
def test_run(self):
"""
Test the run code.
"""
args = []
if self.ap... |
import numpy as np
from gym import utils
from mjrl.envs import mujoco_env
from mujoco_py import MjViewer
from MPL.MPL_robot.robot import Robot
import os
# TODO: Action normalization is missing
class sallyReachEnv(mujoco_env.MujocoEnv, utils.EzPickle):
def __init__(self, noise_scale=0.0):
# prep
u... |
import os
from collections import defaultdict
import sys
import hashlib
import json
import time
import string
import random
import uuid
from metaflow.exception import MetaflowException, MetaflowInternalError
from metaflow.plugins import ResourcesDecorator, BatchDecorator, RetryDecorator
from metaflow.parameters import... |
import abc
class DBWriter(metaclass=abc.ABCMeta):
@abc.abstractmethod
async def store(self, message_box, message) -> bool:
raise NotImplementedError
@abc.abstractmethod
async def flush(self, flush_all=False) -> None:
raise NotImplementedError |
# -*- coding: utf-8 -*-
"""
Created on Tue Nov 26 09:36:21 2019
@author: kevin
"""
import os
import time
from time import sleep
from datetime import datetime
file = open("E:/test2.csv", "a")
i=0
if os.stat("E:/test2.csv").st_size == 0:
file.write("Time,Sensor1,Sensor2,Sensor3,Sensor4,Sensor5\n")
while True:... |
import collections
from src.importer.known_jobs import KnownJobs
from src.preprocessing import preproc
from src.util import loe_util, jobtitle_util
mw_tokens = ['m/w', 'w/m', 'm/f', 'f/m',
'M/W', 'W/M', 'M/F', 'F/M']
def find_jobs(sentence):
jobs = []
# find known jobs
for hit in find_job_b... |
"""
Django settings for webvep project.
Generated by 'django-admin startproject' using Django 3.0.4.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.0/ref/settings/
"""
import os
# ... |
from zmon_aws_agent.main import main
if __name__ == '__main__':
main() |
"""
****************************************************************************************************
:copyright (c) 2019-2020 URBANopt, Alliance for Sustainable Energy, LLC, and other contributors.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted
... |
import tensorflow as tf
import slim
FLAGS = tf.app.flags.FLAGS
def add_loss_summaries(total_loss):
"""Add summaries for losses in model.
Generates moving average for all losses and associated summaries for
visualizing the performance of the network.
Args:
total_loss: Total loss from loss().
Returns:
... |
"""
The player's AI code
Functions here are called by clock.py to run the AI code
"""
import random
import math
from clientLogic.logging import logPrint
from clientLogic import clientData, commands
def onConnect():
"""
Called when the player initially connects to the server but before the tank first spaw... |
# Copyright 2014 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 required by applicable law or ... |
# Copyright (c) 2020 fortiss GmbH
#
# Authors: Patrick Hart
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
import pickle
class Tracer:
"""The tracer can be used to log certain values during episodes."""
def __init__(self, states=None, trace_... |
# -*- coding: utf-8 -*-
# Django Clone - https://github.com/mohammadroghani/django-clone
# Copyright © 2016 Mohammad Roghani <mohammadroghani43@gmail.com>
# Copyright © 2016 Amir Keivan Mohtashami <akmohtashami97@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this soft... |
# Generated by Django 2.2.3 on 2019-07-27 12:22
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='DepModO2O',
fields=[
('id', models.AutoFiel... |
import os
from discord import Embed
from discord import Intents
from discord.ext import commands
from dotenv import load_dotenv
load_dotenv()
intents = Intents.default()
bot = commands.Bot(command_prefix=os.getenv('PREFIX'))
TOKEN = os.getenv('BOT_TOKEN')
@bot.event
async def on_ready():
print(f'{bot.user} has ... |
# 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 copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
import re
import socket
import sys
import threading
from random import randint
host = 'irc.freenode.org'
port = 6667
nick = 'gabe_the_dog'
real_name = 'Gabe the dog'
channel = '#spbnet'
size = 2048
youtube_prefix = 'https://www.youtube.com/watch?v='
gabe_the_dog_sources = [
'i1H0leZhXcY',
'i11RMG_U3R4',
'... |
# coding=utf-8
def thinningSS(file, max_strain=10, interval=0.1):
'''a function to conduct data thinning of SS curve at range (0, MAX_STRAIN), with INTERVAL
This returns np.series of stress with strain in the index.
FILE should be passed as dictionary containing following:
'name': name of sample l... |
"""Sciencer Expanders"""
from .expander import Expander
from .expand_by_authors import ExpandByAuthors
from .expand_by_references import ExpandByReferences
from .expand_by_citations import ExpandByCitations |
#!/usr/bin/env python3.4
"""This is a script to install git-lfs to a tempdir for use in tests"""
import io
import os.path
import shutil
import tarfile
from urllib.request import urlopen
DOWNLOAD_PATH = (
'https://github.com/github/git-lfs/releases/download/'
'v1.1.0/git-lfs-linux-amd64-1.1.0.tar.gz'
)
PATH_IN_... |
# ############################################################################
#
# Copyright (c) Microsoft Corporation.
#
# This source code is subject to terms and conditions of the Apache License, Version 2.0. A
# copy of the license can be found in the License.html file at the root of this distribution. If
# y... |
#!/usr/bin/env python
r""" Run many simulations with varying :math:`\theta`.
The simulations are run.
Separate script should plot bifurcation diagram.
"""
import argparse
import os
import sys
import shutil
import numpy as np
from mpi4py import MPI
from saf.fm.nonlinear import Config
from saf.action import solve
fr... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2016 Ben Kurtovic <ben.kurtovic@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation ... |
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... |
# Copyright 2017 The TensorFlow 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 applica... |
# coding:utf-8
import logging
from base64 import b64encode
import regex as re
import six
from flanker import _email
from flanker.mime.message import charsets, errors
_log = logging.getLogger(__name__)
_RE_FOLDING_WHITE_SPACES = re.compile(r"(?:\n\r?|\r\n?)")
# This spec refers to http://tools.ietf.org/html/rfc2047... |
# ANTECESSOR E SUCESSOR — Faça um programa que leia um número
# inteiro e mostre na tela o seu antecessor e o seu sucessor.
n = int(input('Digite um número inteiro: '))
a = n - 1
s = n + 1
print('O antecessor de \033[4;33m{}\033[m equivale a \033[4;31m{}\033[m. '.format(n, a), end='')
print('Seu sucessor equivale a ... |
from __future__ import absolute_import, division, print_function, unicode_literals
from six import python_2_unicode_compatible, string_types
import warnings
from canvasapi.calendar_event import CalendarEvent
from canvasapi.canvas_object import CanvasObject
from canvasapi.communication_channel import CommunicationChan... |
#####################################################################################
# MIT License #
# #
# Copyright (C) 2018 Charly Lamothe ... |
# -*- coding: iso-8859-1 -*-
# (c) 2009-2014 Martin Wendt and contributors; see WsgiDAV https://github.com/mar10/wsgidav
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
"""
Benchmark suite for WsgiDAV.
This test suite uses davclient to generate WebDAV requests.
A... |
from django.conf import settings
from django.conf.urls.defaults import patterns, include
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from .examples import urls
from funfactory.monkeypatches import patch
patch()
# Uncomment the next two lines to enable the admin:
# from django.contrib import a... |
# Generated by Django 3.2.7 on 2021-10-27 07:05
import django.core.validators
from django.db import migrations, models
from django.db.transaction import atomic
from sellers.models import Seller
"""
Note: Migrations includes data migration that set to null logo_url field for currently existing records.
Logo_url fi... |
# The rest of this package, but not this __init__.py, is generated by protoc. |
"""
This solution implements glob library in order to 'automatize' task.
Instead of manually processing each image
Reference: https://pymotw.com/2/glob/
"""
import cv2
import glob2
images=glob2.glob("*.jpg")
#images=glob2.glob("Exercise1\*.jpg")
for image in images:
img=cv2.imread(image, 0)
re=cv2.resize(i... |
import requests
sugam = requests.get("http://www.pythonhow.com")
print(rp.text[:100]) |
""" Opening and Reading Files
Syntax to open file.
f = open("Myfile.txt) # assigned to the variable f.
f = open("Myfile.txt","rt") # if in the same directory.
f = open("c:\\MyFolders\Myfile.txt") # if hot in the same directory.
"""
f = open("Quotes.txt")
# print(f.readable())
# print(... |
# -*- coding: utf-8 -*-
import os
import numpy as np
import cv2
import re
from shapely import wkt
from shapely.geometry import box, Polygon
import pandas as pd
import geopandas as gpd
from osgeo import gdal, gdalnumeric, osr, ogr
def ensure_dir(file_path):
directory = os.path.dirname(file_path)
if not os.pat... |
import gym
from gym.utils import seeding
import numpy as np
import json
from gym_let_mpc.simulator import ControlSystem
from gym_let_mpc.controllers import ETMPC, AHMPC
import collections.abc
import matplotlib.pyplot as plt
from gym_let_mpc.utils import str_replace_whole_words
import copy
class LetMPCEnv(gym.Env):
... |
from violas_client.canoser.base import Base
class BoolT(Base):
@classmethod
def encode(self, value):
if value:
return b'\1'
else:
return b'\0'
@classmethod
def decode_bytes(self, value):
if value == b'\0':
return False
elif value == b... |
print("\tWelcome to the Voter Registration App")
#Pedimos nombre y edad para asi registrar su voto
name = input("\nPlease enter your name: ").title()
age = int(input("Please enter your age: "))
partidos = ['Republican','Democratic','Independent','Libertarian','Green']
#Si es mayor de edad, podrá votar
if age >= 18:
... |
"""
Parsing a mtrace log file and append to timeline-footprint format
"""
from numpy import *
import numpy as np
import glob
import os
import linecache
import csv
# 1038 bytes is the size of a heap log file with no heap activity (only heap info)
def ValidHeapFile(fpath):
header_lines=1
with open(fpath) as f:
line... |
#!/usr/bin/env python3
from math import sin, cos, radians
data = []
with open('input12.txt') as f:
for line in f:
data.append(line.strip())
x, y = 10, 1
sx, sy = 0, 0
d = 'E'
c = 'NESW'
for line in data:
insn = line[0]
dist = int(line[1:])
if insn == 'F':
# move to waypoint dist t... |
# -*- coding: utf-8 -*-
import os
class DebugContext(object):
def __init__(self,
debug_port=None,
debugger_path=None,
debug_args=None):
self.debug_port = debug_port
self.debugger_path = debugger_path
self.debug_args = debug_args
... |
import unittest
from alertaclient.api import Client
class AlertTestCase(unittest.TestCase):
def setUp(self):
self.client = Client(endpoint='http://api:8080', key='demo-key')
def test_notes(self):
# add tests here when /notes endpoints are created
pass |
# This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
from cryptography.hazmat.primitives.asymmetric.rsa import (
RSAPrivat... |
class Presenter():
def __init__(self, name):
# 생성자(Constructor)
self.name = name
def say_hello(self):
# 메서드(method)
print('Hello, ' + self.name)
presenter = Presenter('Chris')
presenter.name = 'Christopher'
presenter.say_hello() |
from django.core.checks import messages
from rest_framework import generics
from rest_framework.response import Response
from posts.models import Post
from .serializers import PostSerializer, UpVoteSerializer
class PostList(generics.ListCreateAPIView):
queryset = Post.objects.all()
serializer_class = PostSer... |
from functools import partial
from pathlib import Path
import numpy as np
import pandas as pd
import pytest
from numpy.testing import assert_array_almost_equal as aaae
from pandas.testing import assert_frame_equal
from scipy.optimize._numdiff import approx_derivative
from estimagic.differentiation.derivatives import ... |
from . import ausearch, perfection |
# coding=utf-8
"""
Aaron Buchanan
Nov. 2012
Plug-in for py.test for reporting to TeamCity server
Report results to TeamCity during test execution for immediate reporting
when using TeamCity.
This should be installed as a py.test plugin and will be automatically enabled by running
tests under TeamCity build.
"""
... |
from django.contrib import messages
from django.http import Http404
from django.utils.translation import ugettext_lazy as _
from mayan.apps.common.generics import ConfirmView, SimpleView, SingleObjectListView
from .classes import Statistic, StatisticNamespace
from .permissions import permission_statistics_view
from .... |
import face_recognition
from PIL import Image, ImageDraw
from pathlib import Path
import recognize_face
known_path = Path("data/sample-2/jpeg/picked/known")
known_images = list(known_path.glob('*.jpeg'))
known_face_encodings = []
known_face_names = []
known_faces = [recognize_face.image_to_known_face(str(image_path)... |
#!/usr/bin/env python
"""A script to release a new version of TUI from a git working copy
If run on a unix box it exports the current version of TUI and then zips that.
If run on MacOS X it also tries to build the Mac binary.
Not intended for use on Windows.
To use:
./releaseNewVersion.py
"""
from __future__ impo... |
# Copyright 2017-2020 Siemens AG
#
# 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, merge, publish, distri... |
# Copyright (c) 2020 PaddlePaddle 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 appli... |
# coding: utf-8
"""
FlashArray REST API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: 2.13
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import re
# pyt... |
import grpc
from sea.servicer import ServicerMeta, msg2dict, stream2dict
from sea import exceptions
from sea.pb2 import default_pb2
from tests.wd.protos import helloworld_pb2
def test_meta_servicer(app, logstream):
class HelloContext():
def __init__(self):
self.code = None
self.... |
"""
Generalized Linear Models.
"""
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Fabian Pedregosa <fabian.pedregosa@inria.fr>
# Olivier Grisel <olivier.grisel@ensta.org>
# Vincent Michel <vincent.michel@inria.fr>
# Peter Prettenhofer <peter.prettenhofer@gmail.com>
# Mathieu Blond... |
import os
import psutil
COEFFICIENT = 2 ** 20
def get_other_ram() -> int:
"""Ram used by other processes"""
return get_ram_used() - get_process_ram()
def get_total_ram() -> int:
mem = psutil.virtual_memory()
return mem[0] / COEFFICIENT
def get_process_ram() -> int:
process = psutil.Process(os.getpid())
re... |
"""
Configuration of libweasyl.
libweasyl depends on some global state to be set up in order for e.g. database
access to work correctly. This might be nicer if python had a way of
parameterizing modules, but we can't, so this is what we have. It does mean
that only one libweasyl configuration can exist in a running py... |
# Copyright 2017 reinforce.io. 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 applicable law or... |
#!/usr/bin/env python
"""Provenance post processing script for OSA pipeline."""
import copy
import logging
import shutil
import sys
from pathlib import Path, PurePath
import yaml
from osa.configs import options
from osa.configs.config import cfg
from osa.provenance.capture import get_activity_id, get_file_hash
from... |
################################################################################
# PROJECT : AuShadha
# Description : Patient Models for managing patient
# Author : Dr. Easwar T R
# Date : 16-09-2013
# Licence : GNU GPL V3. Please see AuShadha/LICENSE.txt
######################################... |
# -*- coding: utf-8 -*-
"""
radon.py - Radon and inverse radon transforms
Based on code of Justin K. Romberg
(http://www.clear.rice.edu/elec431/projects96/DSP/bpanalysis.html)
J. Gillam and Chris Griffin.
References:
-B.R. Ramesh, N. Srinivasa, K. Rajgopal, "An Algorithm for Computing
the Discrete Radon Trans... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.