text stringlengths 957 885k |
|---|
<reponame>g-k/addons-server<gh_stars>0
# -*- coding: utf-8 -*-
import json
from olympia import amo
from olympia.amo.tests import APITestClient, ESTestCase, reverse_ns
class TestRankingScenarios(ESTestCase):
client_class = APITestClient
def _check_scenario(self, query, expected, no_match=None):
# Mak... |
<reponame>zwrankin/vivarium_examples<filename>src/vivarium_examples/boids/visualization.py
import matplotlib.pyplot as plt
from matplotlib import animation
import os
import shutil
import imageio
def plot_birds(simulation, plot_velocity=False):
width = simulation.configuration.location.width
height = simulatio... |
import os
import argparse
import numpy as np
import torch
from torch.utils.data import DataLoader
from model import get_rnn_model, DNN
from util import *
from manager import Manager
torch.manual_seed(1004)
parser = argparse.ArgumentParser()
parser.add_argument('mode', choices= ['train', 'predict', 'ensemble', 'bow'])
... |
<reponame>COVID-IWG/epimargin-studies
from itertools import chain, product
from functools import lru_cache
import epimargin.plots as plt
from studies.age_structure.TN_CMIE.commons import *
from studies.age_structure.TN_CMIE.epi_simulations import *
# data loading
N_jk_dicts = districts_to_run.filter(like = "N_", axis ... |
<filename>demos/kam_harmonic_SS.py
# in this script a mixture of harmonic sources will be analyzed for separation uisng KAM
# along with harmonic kernels
import matplotlib.pyplot as plt
plt.interactive('True')
import numpy as np
from nussl.separation.KAM import AudioSignal,kam
import time
# close all figure windows... |
<filename>python_modules/dagster/dagster/core/types/config.py
from collections import namedtuple
import six
from dagster import check
from .builtin_enum import BuiltinEnum
class ConfigTypeAttributes(namedtuple('_ConfigTypeAttributes', 'is_builtin is_system_config')):
def __new__(cls, is_builtin=False, is_syste... |
# coding: utf-8
from zeit.cms.workflow.interfaces import IPublish, IPublishInfo
from zeit.cms.testcontenttype.testcontenttype import ExampleContentType
import fb
import os
import time
import unittest
import zeit.push.facebook
import zeit.push.interfaces
import zeit.push.testing
import zope.component
class FacebookTes... |
from hstest.stage_test import *
from hstest.test_case import TestCase
CheckResult.correct = lambda: CheckResult(True, '')
CheckResult.wrong = lambda feedback: CheckResult(False, feedback)
test1_input = '''remaining
buy
2
buy
2
fill
1000
0
0
0
buy
2
take
remaining
exit
'''
test2_input = '''remaining
fill
3000
3000
30... |
<gh_stars>0
import numpy as np
import sklearn
from sklearn import model_selection
import logistic_regressor as lr
from sklearn import linear_model
import scipy.io
from sklearn.model_selection import KFold
######################################################################################
# The sigmoid function ... |
<gh_stars>0
# -*- coding: utf-8 -*-
# Django settings for mds_website project.
import os
DEBUG = True
TEMPLATE_DEBUG = DEBUG
PROJECT_DIR = os.path.dirname(__file__)
ADMINS = (
# ('<NAME>', '<EMAIL>'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.contrib.gis.db.backends.postgis',... |
<filename>scitbx/tests/tst_cubicle_neighbors.py
from __future__ import absolute_import, division, print_function
from six.moves import zip
def exercise_cubicles_max_memory():
import scitbx.cubicle_neighbors as cn
assert cn.cubicles_max_memory_allocation_get() != 0
mm = cn.cubicles_max_memory_allocation_get()
cn... |
<filename>Linux/PurePursuit/pure_pursuit.py
#!/usr/bin/env python
# ======================================================
# Copyright (C) 2020 repa1030
# This program and the accompanying materials
# are made available under the terms of the MIT license.
# ======================================================
'''
Cor... |
<filename>stream/clients/python/tests/unit/bookkeeper/test_futures.py
# 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 a... |
<reponame>ourcolour/sobookscrawler
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
+-------------------------------------------------
@Author: cc
@Contact: <EMAIL>
@Site: http://www.xjh.com
@Project: sobookscrawler
@File: configs.py
@Version:
@Time: 2019/5/24 12... |
<filename>ddpg_agent.py
import torch
import torch.optim as opt
from torch.autograd import Variable
from torch import FloatTensor as FT
import agent
from replay_buffer import ExperienceReplay
import numpy as np
from torch.utils.serialization import load_lua
import importlib.util
# import model_defs.ddpg_models.mountain_... |
# coding=utf-8
# Copyright 2020 The HuggingFace Inc. team. 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 ... |
#!/usr/bin/env python
#
# Copyright 2007 <NAME> <<EMAIL>>
#
# 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... |
"""
Created on Feb 27, 2018
@author: nhan.nguyen
This module contains class "TesterSimulateTraffic" that simulates the real time
traffic.
"""
import threading
import random
import time
import utils
import os
import asyncio
import argparse
import requests_sender
import requests_builder
import perf_add_requests
from ... |
# ----------------------------------------------------------------------------
# Copyright (c) 2013--, scikit-bio development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
# --------------------------------------------... |
print("STONK:D")
# bot.py
from operator import truediv
import os
import discord
from discord import embeds
from discord import member
#from dotenv import load_dotenv
from discord.ext import commands
import discord
from io import BytesIO
import json
import random
#from utils.useful import Embed
import DiscordUtils
#fro... |
from __future__ import with_statement
import os, posixpath
from StringIO import StringIO
import unittest
from mozunit import main, MockedOpen
import ConfigStatus
from ConfigStatus import FileAvoidWrite
class ConfigEnvironment(ConfigStatus.ConfigEnvironment):
def __init__(self, **args):
ConfigStatus.ConfigE... |
import os
import re
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import style
from util import stats, game_info as gi
from configparser import ConfigParser
from scipy.interpolate import spline
PROJECT_ROOT = str(__file__).replace("util/graphs/offline_graphs.py", "")
TEMP_DIR = PROJECT_ROOT + "uti... |
<reponame>rra94/maskmatrix
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from .py_utils.loss_utils import _regr_loss, _neg_loss
from torch.autograd import Variable
from .resnet_features import resnet152_features, resnet50_features, resnet18_features, resnet101_features, resnext101_32x8d... |
"""
k nearest neighbors
欧式距离 distance = sqrt((x1 - x2)^2 + (y1 - y2)^2 + (z1 - z3)^2)
k太小, 容易受到异常点影响
k太大, 容易受到样本不均衡的影响
优点是无需训练, 简单易用
缺点是计算量大, 内存开销大, 不易确定k的精度
"""
from sklearn.datasets import load_iris
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
from sklearn.n... |
<reponame>romybompart/Image-Processing-in-Sublime-Text-3<filename>Activity_11_0_Rotation_Dectection.py<gh_stars>1-10
import skimage
from skimage.color import rgb2gray
from skimage import data, io
import matplotlib.pyplot as plt
import matplotlib
matplotlib.rcParams['font.size'] = 18
import numpy as np
import os
def ke... |
import sys
import theano
import theano.tensor as T
import numpy as np
from scipy.misc import imread, imsave, imresize
from scipy.ndimage.filters import median_filter
from keras.applications import VGG16, VGG19, ResNet50
floatX = theano.config.floatX
models_table = {
"vgg16": VGG16,
"vgg19": VGG19,
"resnet... |
from math import floor, ceil
from time import time
from pathlib import Path
from zipfile import ZipFile
from urllib.request import urlretrieve
from contextlib import contextmanager
import random
from pprint import pprint
import json
import numpy as np
import pandas as pd
import joblib
from sklearn.model_selection impo... |
#!/usr/bin/env python3
# Copyright 2018 Datawire. 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 b... |
from __future__ import division
from mmtbx import monomer_library
from mmtbx.geometry_restraints.torsion_restraints.reference_model import \
reference_model, reference_model_params
from mmtbx.geometry_restraints.torsion_restraints import utils
from mmtbx.validation.rotalyze import rotalyze
import mmtbx.model
from c... |
import numpy as np
from base import selective_loss
import regreg.api as rr
class logistic_Xrandom(selective_loss):
def __init__(self, X, y,
coef=1.,
offset=None,
quadratic=None,
initial=None):
selective_loss.__init__(self, X.shape[1],
... |
"""Utilities for generating data for track identity models."""
import sleap
import tensorflow as tf
import attr
from typing import List, Text
def make_class_vectors(class_inds: tf.Tensor, n_classes: int) -> tf.Tensor:
"""Make a binary class vectors from class indices.
Args:
class_inds: Class indices... |
from io import StringIO
from pathlib import Path
import time
from typing import Optional
import os
import warnings
import requests
try:
import pandas as pd
except ImportError as ie:
pd = None
from cs_kit.exceptions import APIException
class ComputeStudio:
"""
Python client for the ComputeStudio web... |
"""Utils for Updating state/progress and results to WebServices
"""
from builtins import object
import base64
import json
import logging
import pprint
import time
import datetime
import warnings
import os
import pytz
import requests
from requests import RequestException
# To disable the ssl cert check warning
from ... |
<reponame>berquist/sgr_analysis
"""sapt_vs_almo.py: Parse a set of ALMO output files for their
interaction energy components, writing to a CSV file."""
from glob import glob
import csv
import os.path
import numpy as np
from sgr_analysis.sapt.helpers import (BIN_TO_WEIGHT_MAP, read_psi4_sapt0_with_snapnum_and_weight... |
<reponame>Didero/DideRobot<filename>commands/MediaWikiLookup.py
import re
import requests
from CommandTemplate import CommandTemplate
from IrcMessage import IrcMessage
from CommandException import CommandException, CommandInputException
import Constants
class Command(CommandTemplate):
# 'Fandom.com' used to be cal... |
<filename>modules/RPN.py
'''
Function:
region proposal net
Author:
Charles
'''
import torch
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
from modules.utils import *
from modules.losses import *
from libs.nms.nms_wrapper import nms
'''
Function:
define the proposal layer for rpn
Init Inp... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import json
from collections import OrderedDict
import mock
import pytest
from thriftpy2.protocol.binary import read_list_begin
from thriftpy2.protocol.binary import TBinaryProtocol
from thriftpy2.transport import TMemoryBuffer
from py_zipkin import Enc... |
<reponame>mattttime/ECM1400-Covid-Dashboard
'''this module handles all the data in csv/json files containing the covid information to be shown on the dashboard'''
import logging
#aquires modules for scheduling events
import sched
import time
#aquires modules for accessing APIs and processing their data
import req... |
<reponame>innat/BraTS-MGMT-Classification
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
import warnings
warnings.filterwarnings("ignore")
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.model_selection import StratifiedKFold
import tensorflow as tf
import config
# For reproducible results ... |
"""
Differentiable Programming Quantum Control
Example: Preparation of cat states in a quantum parametric oscillator
"""
import os, sys
sys.path.append('..')
# import common parameters
import parameters_para
import numpy as np
import qutip as qu
import argparse
import pickle # to store and visual... |
<filename>api/openai_api.py
# copied from https://github.com/minimaxir/gpt-3-experiments/blob/master/openai_api.py
import yaml
import json
import logging
import os
import asyncio
import fire
import httpx
import time
from tqdm import trange
logger = logging.getLogger("gpt3-experiments")
logger.setLevel(logging.INFO)
... |
# coding: utf-8
from __future__ import absolute_import
from . import BaseTestCase
from six import BytesIO
from flask import json
class TestGradoDeOcupacinPorPlazasEnFinDeSemanaINEController(BaseTestCase):
""" GradoDeOcupacinPorPlazasEnFinDeSemanaINEController integration test stubs """
def test_obtener_gra... |
from objects.CSCG._2d.mesh.domain.inputs.base import DomainInputBase
import numpy as np
from screws.decorators.classproperty.main import classproperty
class CircleHolePlate2(DomainInputBase):
""" """
def __init__(self, hx=2, hy=None, r=0.5):
"""
The DomainInput describes such a domain:
... |
#!/usr/bin/env python3
# Copyright (c) 2021 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
#
# U... |
# -*- coding: utf-8 -*-
"""This file contains the Task Scheduler Registry keys plugins."""
import construct
from plaso.events import windows_events
from plaso.events import time_events
from plaso.parsers import winreg
from plaso.parsers.winreg_plugins import interface
class TaskCacheEvent(time_events.FiletimeEvent)... |
#! /usr/bin/env python3
import os
import sys
import json
import datetime
import subprocess
from cprint import *
from threading import Thread, Lock, Event
from multiprocessing.pool import ThreadPool
def llist (dest):
os.system("ls -l {}".format(dest))
def rmf (dest):
os.system("rm -f {}".format(dest))
def rmrf ... |
"""Command line entry point to the application using the application CLI.
"""
__author__ = 'plandes'
from typing import Dict, Any, List, Type, Union
from dataclasses import dataclass, field
from enum import Enum, auto
import logging
import gc
import sys
import itertools as it
import copy as cp
from io import TextIOBa... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Thu Feb 6 14:19:32 2020
@author: adele
"""
import cPickle as cpk
from os.path import join as joinP
from collections import Counter
from copy import deepcopy
import numpy as np
import pandas as pd
from sklearn.ensemble import RandomForestClassifier
from sk... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@date: 2018-Today
@author: <EMAIL>
"""
import numpy as np
from TreeModelLib.BelowgroundCompetition.OGSLargeScale3D import OGSLargeScale3D
from lxml import etree
from os import path
import os
## OGS integration for belowground competition concept. This case is
# usin... |
<reponame>pauloprojject/projectED
# -*- coding: utf-8 -*-
"""ProjetoED2.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1m7cjca9CLUc5wNSFW2zfVq_KRzRYlhgW
# Tree Exception
"""
class BinaryTreeException(Exception):
def __init__(self, mensagem):
... |
"""
Using open_spiel dark_hex implementation
to calculate best response value for a given player strategy.
"""
import typing
from collections import defaultdict
import pydot
from decimal import Decimal
import pyspiel
from darkhex.utils.util import (get_open_spiel_state, save_file)
class Node:
"""Best response st... |
import sys
sys.path.append('/net/wujial/py-R-FCN/caffe/python')
sys.path.append('/net/wujial/py-R-FCN/lib')
import caffe
import numpy as np
import scipy.io as sio
from plot_fig import *
from fast_rcnn.test import _get_blobs
from fast_rcnn.bbox_transform import clip_boxes, bbox_transform_inv
import cv2
from fast_rcnn.co... |
from pyramid.response import Response
from pyramid.request import Request
from pyramid.view import view_config
from pyramid.httpexceptions import (
HTTPNotFound,
HTTPInternalServerError,
HTTPForbidden,
HTTPUnauthorized
)
import logging
log = logging.getLogger(__name__)
import sys
import time
from lxml... |
#!/usr/bin/env python3
#
# Copyright (c) Contributors to the Open 3D Engine Project.
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
#
# SPDX-License-Identifier: Apache-2.0 OR MIT
#
#
"""
Package builder for vcpkg-based packages
"""
from pathlib import Path
import... |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import os, sys, platform, time
import re
import chardet
import logging
import subprocess
from logging.handlers import RotatingFileHandler
from fastapi import FastAPI
from starlette.responses import FileResponse, RedirectResponse, PlainTextResponse
from starlette.staticfiles imp... |
<reponame>AbeySr/pywinda
import numpy as np
import pandas as pd
def cAngle(i):
x=i % 360
return x
class environment:
"""
Creates the stand-alone environment with the given unique ID. Some generic conditions are added by default. See example below.
:param uniqueID: [*req*] the given unique I... |
<gh_stars>1-10
from __future__ import absolute_import
import platform
import unittest
from ..constant import CANCEL, NO, OK, YES
from ..toolkit import toolkit_object
from ..window import Window
is_qt = toolkit_object.toolkit == 'qt4'
if is_qt:
from pyface.qt import qt_api
GuiTestAssistant = toolkit_object('util... |
<gh_stars>0
# -*- coding: utf-8 -*-
"""
Created on Sat Nov 13 09:38:08 2021
@author: thedi
"""
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
from climlib import *
#Do you want to plot the vanilla results, or the ones showing the vippepunkt?
#name = 'predicts.npy'
year_list = [2036, 2043, 20... |
<gh_stars>0
# -*- coding: utf-8 -*-
"""
Application to find icebergs and their towing ability
Author: <NAME>
Created on Wed Jan 9 00:01:25 2019
"""
""" Modules imported for the application"""
import csv # to read radar and lidar data
import matplotlib.pyplot as plt #to display radar and lidar data
import numpy as np... |
#
# Copyright 2019-2020 <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 agreed to in writing... |
<filename>admix/fix.py
import os
import time
import shutil
from argparse import ArgumentParser
import admix.helper.helper as helper
from admix import DEFAULT_CONFIG, __version__
from admix.interfaces.rucio_summoner import RucioSummoner
from admix.interfaces.database import ConnectMongoDB
from admix.utils.naming import ... |
import logging
from datetime import timedelta
from homeassistant.components.sensor import SensorEntity
from homeassistant.const import (ATTR_IDENTIFIERS, ATTR_MANUFACTURER,
ATTR_MODEL, ATTR_NAME)
from homeassistant.util.dt import utcnow
from .const import CONF_REGION_ID, DOMAIN
ATTR_... |
# -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2012 <NAME> <<EMAIL>> #
# Copyright 2012 Zearin <<EMAIL>> #
# Copyri... |
# -*- coding: UTF-8 -*-
"""
An unofficial implementation of DenseNet with pytorch
@<NAME> 2020_09_15
"""
import torch
import torch.nn as nn
import torch.nn.functional as F
from torchsummary import summary
from models.blocks.conv_bn import BN_Conv2d
from models.blocks.dense_block import DenseBlock, CSP_DenseBlock
cla... |
<gh_stars>0
from flask import render_template,request,redirect,url_for
from . import main
from ..requests import get_news,get_article,search_news,source_news
from ..models import Article,News
@main.route('/')
def index():
'''
view root function that return the index page
'''
news = get_article('busines... |
<filename>create_sentence_representation.py<gh_stars>1-10
import torch
import sys
import numpy as np
import scipy.io
import pickle
import os
from get_dict import get_missing, get_missing_counts, find_missing_sentences, update_dict
import argparse
def process_sentence(vocab, typ, num_layers):
nsentences = len(vocab)
... |
"""Simulation script for assignment 2.
The script uses the control defined in file `aer1216_fall2020_hw2_ctrl.py`.
Example
-------
To run the simulation, type in a terminal:
$ python aer1216_fall2020_hw2_sim.py
"""
import time
import random
import numpy as np
import pybullet as p
#### Uncomment the following 2... |
from pprint import pprint
from math import floor
from math import sqrt
from uuid import uuid4
### CHANGE THESE VARIABLES TO CHANGE GRID GENERATION
# digits = each point is placed in a box generated from the lat/lon coordinates,
# by rounding down to the nearest digit specified by digits.
# If ... |
import os
import re
from datetime import datetime, timedelta
import docx
import csv
from docx import Document
from docx.enum.dml import *
from docx.enum.table import *
from docx.enum.text import *
from docx.oxml.ns import qn
from docx.oxml import OxmlElement
from docx.enum.section import WD_ORIENT
from docx.enum.sectio... |
# Copyright 2021 Google LLC
#
# 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://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
<filename>sdk/python/pulumi_kubernetes_ingress_nginx/_inputs.py<gh_stars>1-10
# coding=utf-8
# *** WARNING: this file was generated by Pulumi SDK Generator. ***
# *** 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, M... |
<filename>lib/symbioticpy/symbiotic/witnesses/witnesses.py
#!/usr/bin/python
from os.path import basename
from hashlib import sha256 as hashfunc
import datetime
import re
# no_lxml = False
# try:
# from lxml import etree as ET
# except ImportError:
# no_lxml = True
no_lxml = True
if no_lxml:
# if this fai... |
import numpy as np
import pandas as pd
from sklearn.metrics import log_loss
import matplotlib.pyplot as plt
# def manual_train_split(df, train_sample_size=80):
# """input dataframe of shots, return train_test_split by game_id
# input dataframe -> get unique game ids -> take sample of 80/159 (may be some r... |
import datetime
from dateutil.parser import parse as dtparse
import discord
import requests
import pickle
import bs4
import time
import re
import os.path
from googleapiclient.discovery import build
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.transport.requests import Request
import google.oa... |
from datetime import date, datetime, timedelta
from itertools import count
import numpy as np
import os
import pandas as pd
import psutil
# countPerDay = 85 # one quote data every 5 minutes, total it is 85 quotes per day per symbol
countPerDay = 29 # as it is resampled every 15 minutes, the countPerDay was changed fro... |
<reponame>MC-kit/mckit-meshes
from typing import Any, Generator, List, NamedTuple, Optional, TextIO, Tuple, Union
import sys
from dataclasses import dataclass
from enum import IntEnum
import mckit_meshes.mesh.geometry_spec as gs
import mckit_meshes.utils as ut
import numpy as np
GeometrySpec = Union[gs.CartesianGeo... |
import h5py;
import os;
import argparse;
import numpy as np;
import torch;
from tqdm import tqdm;
from hourglass.hg_files.test import inference;
from hourglass.hg_files import dp;
import utils.utils as ut;
import config as cf;
parts = {'mpii':['rank', 'rkne', 'rhip',
'lhip', 'lkne', 'lank',
... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
# ___ ___ ___ __ _____ ___ __ __ __ __
# / _/ | _ \ | __| / \ |_ _| | __| | _\ | \ \ `v' / ()
#| \__ | v / | _| | /\ | | | | _| | v | | -< `. .'
# \__/ |_|_\ |___| |_||_| |_| |___| |__/ |__/ !_! ()
# ___ __ _____ ___ __ _ _ _ _ ... |
#!/usr/bin/python
# Copyright 2016 Google Inc.
#
# This file is part of Ansible
#
# Ansible 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, either version 3 of the License, or
# (at your option) any later vers... |
# Copyright (c) 2012 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.
from fnmatch import fnmatch
import logging
import mimetypes
import traceback
import os
from api_data_source import APIDataSource
from api_list_data_sour... |
import os
import glob
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib as mpl
import matplotlib.pyplot as plt
mpl.rcParams['font.family'] = "sans-serif"
mpl.rcParams['font.sans-serif'] = "Arial"
import modules.read_process_data as data_reader
import modules.plot_heatmap as heatmap_maker
... |
<reponame>Ritik19/Cloud-Computing-Project
from flask import Flask, jsonify, request, abort
from flask import Response
import sqlite3
import requests
import hashlib
import json
from flask_cors import CORS
import base64
import datetime
import string
import re
app = Flask(__name__)
CORS(app)
app.config["CORS_SUPPORTS_CRE... |
# -*- coding: utf-8 -*-
"""Entities, the base of all complex MUD objects."""
# Part of Clockwork MUD Server (https://github.com/whutch/cwmud)
# :copyright: (c) 2008 - 2017 <NAME>
# :license: MIT (https://github.com/whutch/cwmud/blob/master/LICENSE.txt)
from copy import deepcopy
from weakref import WeakValueDictionary
... |
from dataclasses import dataclass
from typing import List
from gui import generated
from formats.event import Event
from formats.gds import GDSCommand
import wx
import wx.propgrid
from gui.PygamePreviewer import PygamePreviewer
from previewers.event.EventPlayer import EventPlayer
class ButtonNoTab(wx.Button):
d... |
<reponame>Crunch-io/crunch-cube<filename>tests/integration/test_smoothing.py
# encoding: utf-8
"""Integration-test suite for smoothing feature."""
import numpy as np
import pytest
from cr.cube.cube import Cube
from ..fixtures import CR, NA
from ..util import load_python_expression
class DescribeSliceSmoothing:
... |
<gh_stars>1-10
import numpy as np
import torch
import torch.nn as nn
from SRL4RL.utils.nn_torch import MLP_mdn, MLP_Module, import_weight_init, pytorch2numpy
from SRL4RL.utils.utils import get_hidden
class QNetwork(nn.Module):
def __init__(self, env_params, config):
super(QNetwork, self).__init__()
... |
import requests
import os.path
import pickle
import pyzmail
import subprocess
from bs4 import BeautifulSoup
# Shout-out to the very helpful Sergeant <NAME> of the SLO County Sheriff's Office for
# his help decoding the agency codes.
AGENCIES = {
"AGPD": "Arroyo Grande PD",
"ASHP": "??",
"ATPD": "Atascadero... |
<filename>src/pygaps/characterisation/area_lang.py
"""This module contains Langmuir area calculations."""
import textwrap
import numpy
from scipy import constants
from scipy import stats
from pygaps import logger
from pygaps.core.adsorbate import Adsorbate
from pygaps.core.modelisotherm import ModelIsotherm
from pyg... |
"""
Entry point for the program.
"""
from __future__ import print_function
from es_insanity_checker import ESInsanityChecker
from es_logs_reloader import ESLogsReloader
from es_duplicates_handler import ESDuplicatesHandler
from es_logger import ESLogger
from traceback import print_exc
from optparse import OptionParser
... |
import glob
import json
from base64 import b64encode
from collections import defaultdict
from app.objects.c_planner import Planner
from app.service.base_service import BaseService
from app.utility.rule import RuleAction
class DataService(BaseService):
def __init__(self, dao):
self.dao = dao
self... |
import os
import random
from struct import unpack
from subprocess import call, PIPE
import numpy as np
import tensorflow as tf
from utils import utils
from pathlib import Path
class BaseInputData():
def __init__(self,
hparams,
mode,
batch_size,
... |
<reponame>zhguokai/PythonStudy
# -*- coding: utf-8 -*-
"""
公司层级间的组合模式应用
Created by 相濡HH on 3/19/15.
"""
class Company(object):
"""
公司接口
"""
def __init__(self, name):
"""
初始化方法
:param name:
:return:
"""
self._name = name
def add(self, company):
... |
<reponame>ParsaVahidi/Deep-Reinforcent-Learning-for-openAI-car-racing-game
# This code is originated from https://github.com/andywu0913/OpenAI-GYM-CarRacing-DQN
import os
import sys
import argparse
import gym
import DQNAgent
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from datetime import datet... |
<gh_stars>1-10
"""
Methods for calculating the direct and indirect dependencies of an
OpenFlow 1.3 ruleset.
Indirect dependencies refer to all rules which shadow or goto another, directly
or indirectly. This includes across multiple tables.
For consistency, by default all functions use the headerspace implementation... |
<filename>code/simplegene_tt_convergence.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Sep 9 10:01:49 2020
@author: ion
"""
import tensorflow as tf
import t3f
import numpy as np
import matplotlib.pyplot as plt
from CME import CME
import timeit
import scipy.integrate
import numba
import scipy.s... |
# Copyright 2022 Sony Semiconductors Israel, 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 b... |
<reponame>hosang/ransac-tutorial-2020-data
# select the data
import numpy as np
import matplotlib.pyplot as plt
import h5py
import cv2
from utils import *
from tqdm import tqdm
import os
from metrics import *
import argparse
def evaluate_results(IN_DIR, seq, models, inliers):
ang_errors = {}
match... |
<filename>tests/zookeeper/test_download_center.py
import hashlib
import io
import json
import os
import responses
import sys
import unittest
import zipfile
from data_mine import Collection
from data_mine.utils import datamine_cache_dir
from data_mine.zookeeper import download_dataset
from pyfakefs.fake_filesystem_unit... |
<reponame>raphaelsulzer/shape_as_points
import torch
import trimesh
import shutil, argparse, time, os, glob
import numpy as np; np.set_printoptions(precision=4)
import open3d as o3d
from torch.utils.tensorboard import SummaryWriter
from torchvision.utils import save_image
from torchvision.io import write_video
from s... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.