text stringlengths 957 885k |
|---|
"""This script plots IVCV files together for files generated by QTC
Data must be """
import logging
import holoviews as hv
from forge.tools import convert_to_df, rename_columns
from forge.tools import plot_all_measurements, convert_to_EngUnits
from forge.specialPlots import *
class Stripscan:
def __init__(self,... |
#!/usr/bin/env python
# Copyright (c) 2015 by <NAME>. All Rights Reserved.
"""The test grid:
0 2 5
1 1 3
2 1 1
"""
import unittest
import walk_grid
GRID = [[0, 2, 5], [1, 1, 3], [2, 1, 1]]
FOOD = 12
STEPS = 18
SMALL_GRID = [[0, 2], [1, 3]]
SMALL_COSTS = set([4, 5])
SMALL_STEPS = 4
class _BadDirect... |
# Project 2 for AERO 351 Fall 2021
# Texas A&M University
# <NAME>
# UIN: 627005116
# Professor <NAME>
from math import *
import matplotlib.pyplot as plt
import numpy as np
# Problem Statement:
# A scramjet engine flies at altitude H = 10, 000 + A m. The inlet diffuser losses are
# σ0d = 70 + B%, the comb... |
import getopt, sys
import uno
from unohelper import Base, systemPathToFileUrl, absolutize
from os import getcwd
from os.path import splitext
from com.sun.star.beans import PropertyValue
from com.sun.star.uno import Exception as UnoException
from com.sun.star.io import IOException, XOutputStream
class OutputStream( Ba... |
<reponame>TinBane/python-magento<filename>magento/sales.py
# -*- coding: UTF-8 -*-
'''
magento.sales
Allows to export/import sales orders from/into Magento,
to create invoices, shipments, credit memos
:license: BSD, see LICENSE for more details
'''
from .api import API
class Order(API):
"""
... |
<filename>baseclasses/problems/pyMission_problem.py
"""
pyMission_problem
Holds the Segment, Profile and Problem classes for the mission solvers.
"""
import sys
import numpy
import copy
from .ICAOAtmosphere import ICAOAtmosphere
from .FluidProperties import FluidProperties
from ..utils import Error
class MissionPr... |
import datetime
import json
import os
from typing import Any, Dict, List
from sauce_searcher_server.constants import (
DOUJIN_BASE_IMAGE,
DOUJIN_BASE_URL,
VISUAL_NOVEL_BASE_URL,
VISUAL_NOVEL_LENGTHS,
VISUAL_NOVEL_TAGS_FILE,
)
from sauce_searcher_server.models import (
Anime,
Doujin,
Dou... |
<reponame>andreabradpitto/turtlex
#!/usr/bin/env python3
# Import necessary libraries
import os
import torch
import onnx
import pynever.strategies.conversion as conv
import pynever.networks as networks
import pynever.nodes as nodes
import torch.nn.functional as F
from torch.distributions import Normal
class PolicyNe... |
import sympy as sym
from scipy.interpolate import CubicSpline, PPoly
import math
import typing
class Segwise(sym.Function):
"""Piecewise function for sequential linear segments.
arguments: Segwise(argument, (equation (in Segwise.s), upper_bound), (equation_2, upper_bound_2))"""
nargs=None
s = sym.Symb... |
<reponame>bigbitbus/opta
import base64
from typing import Any, Dict, List
import pytest
from click.testing import CliRunner
from pytest_mock import MockFixture
from opta.cli import cli
from opta.commands.push import (
get_acr_auth_info,
get_ecr_auth_info,
get_gcr_auth_info,
get_registry_url,
push_... |
<gh_stars>10-100
#
# PySNMP MIB module ENTERASYS-MIB-NAMES (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ENTERASYS-MIB-NAMES
# Produced by pysmi-0.3.4 at Mon Apr 29 18:48:40 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python versi... |
import argparse
import numpy as np
import os
from keras import backend as K
from keras.models import load_model
import pdb
import sys
import traceback
import matplotlib.pyplot as plt
import numpy as np
from keras import layers, models, optimizers
from keras import backend as K
from keras.utils import to_c... |
import json
import numpy as np
import pandas as pd
import streamlit as st
from PIL import Image
from run_deployment import run_main
from zenml.services import load_last_service_from_step
def main():
st.title("End to End Customer Satisfaction Pipeline with ZenML")
high_level_image = Image.open("_assets/high_... |
import logging
import threading
from typing import Iterable, Optional
from cv2 import cv2
import werkzeug.serving
from flask import Flask, Blueprint
from flask.helpers import url_for
from flask.wrappers import Response
from layered_vision.utils.image import rgb_to_bgr, apply_alpha
from layered_vision.utils.image impo... |
import os
import pylast
import matplotlib.pyplot as plt
import logging
from slack_bolt import App
from slack_bolt.adapter.socket_mode import SocketModeHandler
from dotenv import load_dotenv
load_dotenv()
SLACK_BOT_TOKEN = os.environ['SLACK_BOT_TOKEN']
SLACK_APP_TOKEN = os.environ['SLACK_APP_TOKEN']
SLACK_SIGNING_SECR... |
from django.core.validators import MaxValueValidator, MinValueValidator
from django.contrib.auth.models import User
from django.db import models
from django.db.models.signals import post_save, pre_save
from django.dispatch import receiver
from django.core.exceptions import ObjectDoesNotExist
MAX_DAYS_PER_PLAN = 6
MAX_... |
<reponame>ssashita/ml_work
#!/usr/bin/env python
# coding: utf-8
# In[136]:
get_ipython().run_line_magic('run', 'preproc.ipynb')
get_ipython().system('jupyter kernelspec list')
import pandas as pd
import numpy as np
from sklearn.preprocessing import LabelEncoder
import sys
print('Python3 executable is ',sys.executab... |
"""
Cubes
=====
Tools to deal with spectroscopic data cubes.
Some features in Cubes require additional packages:
* smoothing - requires agpy_\'s smooth and parallel_map routines
* `pyregion <git://github.com/astropy/pyregion.git>`_
The 'grunt work' is performed by the :py:mod:`cubes` module
"""
from __futu... |
# -*- coding: utf-8 -*-
#
# PySceneDetect: Python-Based Video Scene Detector
# ---------------------------------------------------------------
# [ Site: http://www.scenedetect.scenedetect.com/ ]
# [ Docs: http://manual.scenedetect.scenedetect.com/ ]
# [ Github: https://github.c... |
# -*- coding: utf-8 -*-
'''
Created on 2021-05-17
@author: p19992003
'''
import numpy as np
from turtle import Turtle
class Turtle(object):
'''
海龟法则
《金融评论》曾发表过一篇论文,里面刊载了十年间对二十多种技术型交易系统的测试和研究,最终得出了结论,周规则名列榜首,仅随其后的是移动平均线。同时期,理查德·丹尼斯(<NAME>)创办了举世轰动的“海龟交易班”,“龟儿”们创造了四年年均复利八十的收益,而《海龟交易法则》中的具体操作信号正是周规则。对于移动平均线,... |
<filename>run_science.py
import krpc
import time
from loguru import logger
from typing import Set
conn = krpc.connect(name="Run science experiments to gather science")
vessel = conn.space_center.active_vessel
# Create connection streams, about 20 times faster than just calling them directly
vessel_experiments = conn.... |
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import os
from scipy.optimize import curve_fit
from textwrap import wrap
def AbsErrorROCPerPoint(scores, mode='mean', draw=True):
# INPUT: n x 2, cols: conf, abs error
n = scores.shape[0]
scores = scores[(-scores[:, 0]).argsort()] # s... |
<filename>chainer/functions/connection/convolution_2d.py
import ctypes
import math
import numpy
from six import moves
from chainer import cuda
from chainer import function
from chainer.utils import conv
from chainer.utils import type_check
if cuda.cudnn_enabled:
cudnn = cuda.cudnn
libcudnn = cuda.cudnn.cudnn... |
<reponame>wuyuehang/crosswalk-webdriver-python
__all__ = ["ExecuteWindowCommand", \
"ExecuteGetTitle", \
"ExecuteRefresh", \
"ExecuteGetCurrentUrl", \
"ExecuteGetPageSource", \
"ExecuteIsBrowserOnline", \
"ExecuteGet", \
"ExecuteGoBack", \
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os, sys, re
from os.path import isfile, join
from subprocess import call
import subprocess
from pprint import pprint
import argparse
class coverageRanking():
tests_by_class = {}
file_coverage = {}
file_line_representations = {}
num_smoke_tests = 5
... |
import hashlib
import stat
import tempfile
import time
from pathlib import Path
import requests
import typer
from python_on_whales import docker
from sultan.api import Sultan
from controller import SUBMODULES_DIR, log, print_and_exit
from controller.app import Application, Configuration
from controller.packages impor... |
<reponame>Govexec/django-forms-builder
from django.conf import settings
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.contrib.sites.models import Site
from django.core.mail import EmailMessage
from django.core.urlresolvers import reverse
try:
import jinja2
from coffin.shortcuts import get_obj... |
# Author: <EMAIL>, 2015
import unittest
from tester import Tester
class TestTester(unittest.TestCase):
def setUp(self):
self.tester = Tester()
self.customers1 = [['1 0', '2 0'], ['1 1'], ['3 0']]
self.customers2 = [['1 0', '2 1'], ['1 1'], ['3 1']]
self.customers3 = [['2 0', '1 0'], ['2 1', '1 0']]
self.c... |
### Code written for STDP tutorial @ CAMP 2016
### Adapted from Song et al 2000 (Competitive Hebbian Learning through spike-timing-dependent synaptic plasticity
### With independent Poisson inputs (relevant figures : Fig 2e)
### Author: <NAME>
### Date: June 15, 2016
#######################################
from bria... |
# -*- encoding: utf-8 -*-
def _complain_about_matplotlib(*args, **kwargs):
raise ImportError("Plotting functionality requires matplotlib. Please install matplotlib.")
def _register_dummy_methods():
import h2o.model
import h2o.automl._base # NOQA
h2o.model.H2ORegressionModel.residual_analysis_plot =... |
#!BPY
"""
Name: 'Follow Active (quads)'
Blender: 242
Group: 'UVCalculation'
Tooltip: 'Follow from active quads.'
"""
__author__ = "<NAME>"
__url__ = ("blender", "blenderartists.org")
__version__ = "1.0 2006/02/07"
__bpydoc__ = """\
This script sets the UV mapping and image of selected faces from adjacent unselected fa... |
# -*- coding: utf-8 -*-
import re
from datetime import datetime
import requests
from bs4 import BeautifulSoup
from secrets import (
deviceheight, devicename, devicewidth, os_version, token,
user_agent, uuid
)
QUERY_URL = "https://mob1.processotelematico.giustizia.it/proxy/index_mobile.php"
BASE_PAYLOAD = dic... |
# -*- coding: utf-8 -*-
# Copyright 2012 Viewfinder Inc. All Rights Reserved.
"""Base class for service request handler tests.
ServiceBaseTestCase
"""
__authors__ = ['<EMAIL> (<NAME>)',
'<EMAIL> (<NAME>)']
import logging
import mock
import shutil
import time
import tempfile
from collections import... |
#
#
#
import json
from gzip import GzipFile
from io import BytesIO
from typing import MutableSequence
from typing import Union
from ._exceptions import CompressionFull
from ._exceptions import SingleCompressionOnGoing
class CompressedJsonList:
"""
Creates an json array of compressed json messages.
[<co... |
<reponame>ap9272/CSE246-project
import numpy as np
from scipy.stats import truncnorm
# get values from a truncated normal distribution for age sampling
def get_truncated_normal(mean=0, sd=1, low=0, upp=10):
return truncnorm(
(low - mean) / sd, (upp - mean) / sd, loc=mean, scale=sd)
# class for human
class... |
import sublime
import sublime_plugin
import os
from ..lib import log, setup_log_panel, yte_setting, dotty
from ..lib import select_video, select_playlist, select_tag, select_timecode
from ..lib import Request, NetworkManager, stored_credentials_path, video_sort
# TODO:
# - Hit the keyword in the first few lines and... |
<reponame>apmoore1/target-extraction<filename>tests/analysis/dataset_statistics_test.py
from pathlib import Path
import math
import re
import pytest
import pandas as pd
from target_extraction.data_types import TargetTextCollection, TargetText
from target_extraction.data_types_util import Span
from target_extraction.a... |
<gh_stars>10-100
from kivy.app import App
from kivy.properties import ObjectProperty, OptionProperty
from kivy.uix.behaviors import ButtonBehavior
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.button import Button
from kivy.uix.checkbox import CheckBox
from kivy.uix.label import Label
from kivy.uix.popup impor... |
# -*- coding: utf-8 -*-
import pytest
from test.helper import check_evaluation, session
from mathics_scanner.errors import IncompleteSyntaxError
str_test_set_with_oneidentity = """
SetAttributes[SUNIndex, {OneIdentity}];
SetAttributes[SUNFIndex, {OneIdentity}];
SUNIndex[SUNFIndex[___]]:=
(Print["This error shouldn'... |
<reponame>v-hill/gpu-price-tracker
"""
Main script for running the scraper.
"""
import datetime
import logging
import logging.config
import os
import re
import shutil
from django.utils.timezone import make_aware
from scraper.models import URL, BrandMenu, EbayGraphicsCard, Log, Sale
from scraper.src.product import E... |
<filename>automation_orchestrator/orchestrator/admin.py
import os
import csv
import pytz
import datetime
import subprocess
from tzlocal import get_localzone
from django import forms
from django.db import models
from django.contrib import admin, messages
from django.http import HttpResponse
from django.utils.html import... |
<gh_stars>0
# Copyright 2014 OpenStack Foundation
#
# 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 app... |
<reponame>juddcraft12/liamappelbe.github.io<gh_stars>0
from collections import OrderedDict
import random
import sys
#################
### CONSTANTS ###
#################
kFreqDictSize = 30000
kTargetCadence = [1, 0, -1, -1, 1, 0, 1]
kTargetPhonemes = [] # ["AO", "L", "Z"]
kIgnoreSecondaryPoS = True
##############... |
<reponame>pulumi/pulumi-alicloud<gh_stars>10-100
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, O... |
import unittest
import os
from unittest import TestCase
from dispatcher.aota.aota import AOTA
from dispatcher.aota.aota_command import Docker, DockerCompose
from dispatcher.aota.aota_command import DirectoryRepo
from dispatcher.aota.aota_error import AotaError
from dispatcher.aota.constants import SupportedDriver
from... |
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions o... |
<gh_stars>0
import math
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from function import FakeQuantize
# 1/11,按照uint,计算scale和zeropoint,都是浮点
# min_val, max_val需要根据具体情况专门统计,但是符号非符号的距离都一样
def calcScaleZeroPoint(min_val, max_val, num_bits=8, si... |
<reponame>mcv-m6-video/mcv-m6-2018-team7<filename>Week2/backgroundEstimationAdaptive.py
import numpy as np
import cv2
import os
import pickle
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from sklearn.model_selection import GridSearchCV
from AdaptiveClassifier import AdaptiveClassifier
from re... |
<reponame>adamancer/imagery_accessor
"""Tests for propagating metadata when using ImageryAccessor"""
from earthpy.plot import plot_rgb, _stretch_im
from earthpy.io import path_to_example
import numpy as np
import matplotlib.pyplot as plt
import pytest
import xarray as xr
import imagery_accessor as ixr
plt.show = la... |
import json
from django.urls import reverse
from rest_framework import status
from authors.apps.authentication.tests.test_base import BaseTestClass
class TestUserProfile(BaseTestClass):
def test_retrieve_profile_without_logging_in_fails(self):
response = self.client.get(f'/api/profiles/{self.test_user.... |
# -*- coding: utf-8 -*-
"""
Basic layers implemented by keras
"""
from keras import backend as K
from keras.layers import Layer
from keras.layers import Conv2D
from keras.layers import Dense
from keras.layers import ReLU
from keras.layers import LeakyReLU
from keras.layers import PReLU
from keras.layers import Softmax... |
#!/usr/bin/env python
#
# vm_description.py - Abstract class for reading, editing, and writing VMs
#
# September 2013, <NAME>
# Copyright (c) 2013-2017, 2019 the COT project developers.
# See the COPYRIGHT.txt file at the top-level directory of this distribution
# and at https://github.com/glennmatthews/cot/blob/master... |
<gh_stars>0
#
# This file is part of the FFEA simulation package
#
# Copyright (c) by the Theory and Development FFEA teams,
# as they appear in the README.md file.
#
# FFEA is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Fr... |
<filename>autoscalingsim/scaling/policiesbuilder/scaling_policy.py
import pandas as pd
from .adjustmentplacement.adjustment_policy import AdjustmentPolicy
from .scaling_policy_conf import ScalingPolicyConfiguration
from autoscalingsim.infrastructure_platform.platform_model import PlatformModel
from autoscalingsim.sca... |
import unittest
import numpy as np
import pandas as pd
from cbsyst.MyAMI_V2 import MyAMI_params, MyAMI_K_calc, MyAMI_pK_calc, MyAMI_K_calc_multi
class MyAMIConsistency(unittest.TestCase):
"""Compare MyAMI_V2 with MyAMI_V1"""
def test_CompareToMyAMI_V1(self):
# parameters calculated by MyAMI_V1.py
... |
<filename>acoustics/testing_detailed_sound_propagation.py
# -*- coding: utf-8 -*-
"""Tests for the detailed sound propagation module
Created on Tue Jun 18 11:37:57 2019
@author: tbeleyur
"""
import unittest
import numpy as np
np.random.seed(82319)
import pandas as pd
import scipy.spatial as spatial
import statsmodel... |
import pytest
from sqlalchemy.exc import IntegrityError
from sqlalchemy.orm.exc import NoResultFound
from src.minerva_db.sql.models import User, Group, Membership
from src.minerva_db.sql.api.utils import to_jsonapi
from .factories import GroupFactory, UserFactory, MembershipFactory
from . import sa_obj_to_dict, stateme... |
import numpy as np
import matplotlib.pyplot as plt
from sklearn.decomposition import PCA
from sklearn.cluster import SpectralClustering
from umap import UMAP
from multidr.tdr import TDR
from multidr.cl import CL
def plot_results(results):
plt.figure(figsize=(8, 6))
for i, Z in enumerate(
['Z_n_dt', '... |
<filename>src/app/beer_garden/api/http/handlers/v1/garden.py<gh_stars>0
# -*- coding: utf-8 -*-
import json
from brewtils.errors import ModelValidationError
from brewtils.models import Operation
from brewtils.schema_parser import SchemaParser
from beer_garden.api.authorization import Permissions
from beer_garden.api.... |
# -*- coding: utf-8 -*-
#================================================================
# Copyright (C) 2020 * Ltd. All rights reserved.
# Time : 2020/3/15 18:01
# Author : Xuguosheng
# contact: <EMAIL>
# File : character_5.py
# Software: PyCharm
# Description :图像分类 fashsion_minist
#==================================... |
# Copyright 2021 Huawei Technologies Co., Ltd
#
# 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... |
# -*- coding: utf-8 -*-
"""
The MIT License
Copyright (c) 2018 <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, ... |
import plotly.express as px
if __name__ == '__main__':
# logs on 50 epochs, from /docs/logs/ae_training.txt
# plots are located in /docs/plots/gae training loss.png, and gae link prediction error.png
training_losses = [
-0.6715881810951391,
-0.7151892182838857,
-0.7224757316891431,
... |
#!/usr/bin/env python
#===============================================================================
import os, sys, json, time
import shutil, glob, zipfile, tempfile
import datetime as dt
import xml.etree.ElementTree as et
import logging
LOG_FILENAME = 'brac_sync.log'
logging.basicConfig(filename=LOG_FILENAME,lev... |
# Copyright 2018 Ocean Protocol Foundation
# SPDX-License-Identifier: Apache-2.0
import time
import pytest
from oceandb_driver_interface.oceandb import OceanDb
from oceandb_driver_interface.search_model import FullTextModel, QueryModel
from oceandb_elasticsearch_driver.utils import query_parser
from .ddo_example imp... |
import sys
import os
import os.path as osp
import argparse
import numpy as np
import cv2
import torch
import torchvision.transforms as transforms
from torch.nn.parallel.data_parallel import DataParallel
import torch.backends.cudnn as cudnn
from tqdm import tqdm
sys.path.insert(0, osp.join('..', 'main'))
sys.path.insert... |
<reponame>ravi-mosaicml/ravi-composer<filename>tests/loggers/test_file_logger.py
# Copyright 2021 MosaicML. All Rights Reserved.
import os
import pathlib
import sys
import pytest
from torch.utils.data import DataLoader
from composer import Callback, Event, State, Trainer
from composer.loggers import FileLogger, File... |
import ast
import uuid
import etcd
import json
import requests
import logging
import logging.config
from datetime import datetime
from pengrixio.database import etcdc
from pengrixio.k8s.node import kube_list_node
from pengrixio.k8s.pod import kube_list_pod
from pengrixio.k8s.namespace import kube_list_namespace
from... |
from pathlib import Path
import math
import sys
import time
from PIL import Image
import numpy as np
import torch
from . import utils
from ..data_utils import (
to_coco, from_coco, get_image_path, SEG_FP, scale_boxes)
from ..utils import print_metrics
from ..viz import visualize_boxes
from ..metric import score_b... |
import logging
import ray
from ray.rllib.agents.ddpg.ddpg_tf_policy import build_ddpg_models, \
get_distribution_inputs_and_class, validate_spaces
from ray.rllib.agents.dqn.dqn_tf_policy import postprocess_nstep_and_prio, \
PRIO_WEIGHTS
from ray.rllib.models.torch.torch_action_dist import TorchDeterministic, \... |
"""
"""
import os
import numpy as np
import pandas as pd
import gams
import logging
import builtins
import time
from copy import deepcopy
from .utility import index_from_symbol, symbol_is_scalar, is_iterable, map_lowest_level, index_names_from_symbol, \
all_na, map_to_int_where_possible
import gams2numpy
logger = l... |
<filename>population_gravity/data_prep.py
import os
import logging
import pkg_resources
import rasterio
import numpy as np
import pandas as pd
from rasterio.io import MemoryFile
import population_gravity.downscale_utilities as utils
def mask_raster(metadata, file_name, raster_object, source_window):
"""Subset... |
<reponame>Sloth6/plant_growth<gh_stars>10-100
""" Evolution utilties shared by the 3 evolution modules (local, neat & novelty)
"""
from __future__ import print_function
import os, time, math, json
from os.path import join as pjoin
import MultiNEAT as NEAT
import numpy as np
from cymesh.shape_features import d2_features... |
<filename>src/abaqus/Interaction/ConcentratedRadiationToAmbient.py
from abaqusConstants import *
from .Interaction import Interaction
from ..Region.Region import Region
class ConcentratedRadiationToAmbient(Interaction):
"""The ConcentratedRadiationToAmbient object defines radiant heat transfer between a point
... |
"""
API operations on User objects.
"""
import copy
import json
import logging
import re
from collections import OrderedDict
from markupsafe import escape
from sqlalchemy import (
false,
or_,
true
)
from galaxy import (
exceptions,
util,
web
)
from galaxy.exceptions import ObjectInvalid
from g... |
#!/usr/bin/env python
import os, sys, re
from optparse import OptionParser
from jobTree.scriptTree.target import Target
from jobTree.scriptTree.stack import Stack
from jobTree.src.bioio import getTempFile
from sonLib.bioio import logger
from sonLib.bioio import system
from sonLib.bioio import nameValue
from sonLib.b... |
<reponame>sivaprakashniet/push_pull
from __future__ import absolute_import
from kombu import Exchange, Queue
from mock import Mock
from celery.app.amqp import Queues, TaskPublisher
from celery.five import keys
from celery.tests.case import AppCase
class test_TaskProducer(AppCase):
def test__exit__(self):
... |
"""Final experiments, trained on the full training set.
This uses hyperparameters chosen by cross-validation from exp_* """
import os
import dill
import pickle
import numpy as np
from marseille.datasets import get_dataset_loader, load_embeds
from marseille.custom_logging import logging
from marseille.argrnn import ... |
import time
import argparse
import nonRedundantResolver
import overlapResolver
import gapFiller
import twoRepeatOneBridgeSolver
import houseKeeper
import IORobot
###################################################### Starting point
def mainFlow(folderName , mummerLink, pickupname, mapcontigsname):
print "G... |
from datetime import timedelta
from operator import methodcaller
import itertools
import math
import pytest
sa = pytest.importorskip('sqlalchemy')
pytest.importorskip('psycopg2')
import os
import numpy as np
import pandas as pd
import pandas.util.testing as tm
from datashape import dshape
from odo import odo, drop... |
<filename>Yellow_Pages_Angleterre/unit_tests.py
import time
from bs4 import BeautifulSoup
import requests
import pymysql.cursors
import unittest
class UnitTestsDataMinerYellowPagesAngleterre(unittest.TestCase):
def test_extract_one_email_from_one_result(self):
url = "https://www.scoot.co.uk/England/-/Lond... |
<filename>data_conversion/hapmap2vcf.py<gh_stars>10-100
#!/usr/bin/python
#!/usr/bin/env python
import sys
import random
import os.path
import subprocess
tmpath = sys.argv[0][:-13] + "../tmp/"
def printusage():
print("Usage python hapmap2vcf.py -i [input hapmap path] -o [output vcf path]")
if len(sys.argv) < 5 ... |
# -*- coding: utf-8 -*-
# Copyright(C) 2014 Bezleputh
#
# This file is part of a woob module.
#
# This woob module is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, ... |
# -*- coding: utf-8 -*-
# pylint: disable=invalid-name,too-many-locals,too-many-arguments,too-many-lines
import pytest
from raiden.utils import publickey_to_address
from raiden.transfer import channel
from raiden.transfer.events import ContractSendChannelClose
from raiden.transfer.mediated_transfer import mediator
fro... |
<filename>visgeom/plot.py
import visgeom.utils
from mpl_toolkits.mplot3d.art3d import Poly3DCollection
import numpy as np
def axis_equal(ax):
"""Emulate ax.axis('equal') for 3D axes, which is currently not supported in matplotlib.
:param ax: Current axes
"""
ax.set_box_aspect([1, 1, 1])
limits =... |
<reponame>ssavrim/curator
import elasticsearch
import curator
import os
import json
import click
import string, random, tempfile
from click import testing as clicktest
from mock import patch, Mock, MagicMock
from . import CuratorTestCase
from . import testvars as testvars
import logging
logger = logging.getLogger(__n... |
"""A setuptools based setup module.
See:
https://packaging.python.org/guides/distributing-packages-using-setuptools/
https://github.com/pypa/sampleproject
"""
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
import os
import re
import ast
from os import path
# io.open is needed fo... |
# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# 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 us... |
<filename>script_utils.py
from math import hypot, inf
import math
import time
import cv2
import numpy
import mss
from colors import BANK_TEXT_COLOR, get_mask
from auto_gui import click
from settings import MONITOR, INVENTORY_SLOT_RECTS_ABSOLUTE, CENTER_OF_SCREEN_RELATIVE, DEBUG
from script_random import rsleep, rando... |
<reponame>Kenny-Z/IOT-Message-Board-with-Face-Recognition
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'display.ui'
#
# Created by: PyQt5 UI code generator 5.13.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Form(object... |
# Copyright (c) 2020 Graphcore Ltd. 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... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
##############################
# import dependencies
##############################
import os
import csv
import argparse
import datetime
import numpy as np
from glob import glob
from keras import backend
from keras import layers, models
from keras.models import Model
fro... |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
# @Author : ningchao
# @Time : 20/11/7 15:58
import utils
import logging
import numpy as np
from typing import *
from tqdm import tqdm
from category import Category
from sklearn.feature_extraction.text import CountVectorizer
def preliminary_labeling(category_tree: Cate... |
<reponame>ghsecuritylab/mini-client<filename>mbed-client/factory-configurator-client/devenv/update-license/replace_license_header.py
#!/usr/local/bin/python3
# ----------------------------------------------------------------------------
# Copyright 2016-2017 ARM Ltd.
#
# Licensed under the Apache License, Version 2.0... |
<reponame>khooi8913/imagetagger_model
from typing import Set
from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.postgres.fields import JSONField
from django.db import models
import os
from imagetagger.users.models import Team
class Image(models.Model):
image_set ... |
r"""
================
Error Middleware
================
.. versionadded:: 0.2.0
Middleware to handle errors in aiohttp applications.
.. versionchanged:: 1.0.0
Previosly, ``error_middleware`` required ``default_handler`` to be passed
on initialization. However in **1.0.0** version ``aiohttp-middlewares`` ships
defau... |
<reponame>pulumi/pulumi-alicloud
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequenc... |
from enum import Enum
from utils.wavefront import Loader as load_wavefront
from pyglet.image import load as load_image
# Animation speed for 3D cube
class Speed(Enum):
Slow = 5
Medium = 15
Fast = 30
Immediate = 90
# Side length of the cube
CubeSize = 90
PieceScale = 0.995
FaceSize = 0.85
AnimationT... |
from datetime import datetime
from . import db, api
from .consts import API_HOSTNAME
class CommonModel(object):
def _serialize(self):
"""Jsonify the sql alchemy query result."""
convert = dict()
d = dict()
# noinspection PyUnresolvedReferences
for c in self.__class__.__tab... |
"""Bump versions in files for release.
Requirements:
- tomlkit: Format preserving TOML parser.
"""
import pathlib
import sys
import re
import argparse
import fileinput
from packaging.version import parse as parse_version
import tomlkit
"""The base oso directory."""
BASE = pathlib.Path(__file__).parent.parent
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.