text stringlengths 957 885k |
|---|
<filename>architect/examples/multi_agent_manipulation/mam_plotting.py
import jax.numpy as jnp
import matplotlib.pyplot as plt
import matplotlib.patches as patches
import matplotlib.transforms as transforms
from celluloid import Camera
def make_box_patches(
box_state, alpha: float, box_side_length: float, ax, hatc... |
# -------------算数运算符-----------------------
# Python里支持很多算数运算符
# + - * / **幂运算 //除数 %余数
print(1 + 1) # 2
print(4 - 1) # 3
print(3 * 2) # 6
# Python3里,两个整数相除,得到的结果
print(6 / 2) # 3.0
print(9 / 2) # 4.5
print(10 / 3) # 3.3333333333333335
print(3 ** 3) # 27
print(81 ** (1 / 2)) # 9.0
# 字符串中里有限度的支持加法和乘法运算符
# ... |
<filename>cms_test2/migrations/0012_auto_20180412_1206.py
# -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2018-04-12 12:06
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('c... |
from django.forms import BaseForm
from django.forms.forms import BoundField
from django.forms.widgets import TextInput, CheckboxInput, CheckboxSelectMultiple, RadioSelect
from django.template import Context
from django.template.loader import get_template
from django import template
from django.conf import settings
BOO... |
<gh_stars>0
# FileName: Lesson 16
# Insurance Company Program
# Author: <NAME>
# Date: October 26, 2021
#Constants
HOME_POLICY = 400
AUTO_POLICY = 700
BOTH_POLICY = 1000
RENEWAL_DIS = .10 # 10% for renewed policies
EXTRA_LIABILITY = 75
EXTRA_PERSON = 90
CONTENT_INSURANCE = 110
TAX_RATE = .15
INTEREST_RATE = 0.054
P... |
# Copyright 2018 Xanadu Quantum Technologies Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agre... |
<filename>pretraining/train_vocab/train_vocab.py<gh_stars>1-10
"""
Author: bugface https://github.com/bugface
The script is based on Google's SentencePiece to train a vocab from local corpous
see more details at https://github.com/google/sentencepiece
note: training with a large corpus may take TB-level of RAM; sente... |
import pass_pipeline as ppipe
import passes as p
def diagnostic_passlist():
return ppipe.PassList([
p.CapturePromotion,
p.AllocBoxToStack,
p.InOutDeshadowing,
p.NoReturnFolding,
p.DefiniteInitialization,
p.PredictableMemoryOptimizations,
p.DiagnosticConstant... |
<reponame>heurezjusz/Athena
"""
Dataset - set (list) of configs given to algorithm as an input.
"datasets" is a dictionary from algorithm shortcut to list of available
datasets.
Do not forget to update help message after changing!
"""
datasets = {
"sender": [[(0.3, 0.75)],
[(0.02, 1... |
<filename>ResoFit/data/IPTS_20784/ipts_20784_AgI.py
from ResoFit.calibration import Calibration
from ResoFit.fitresonance import FitResonance
from ResoFit.experiment import Experiment
import matplotlib.pyplot as plt
import numpy as np
import pprint
from ResoFit._utilities import get_foil_density_gcm3
from ResoFit._util... |
<filename>test/pytorch_backend/pytorch_tensor.py<gh_stars>1000+
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import torch
from crypten import CrypTensor, register_... |
"""
Plot the performance on the test set as in Figures 6, 12, 18.
"""
# Author: <NAME> <<EMAIL>>
# License: BSD 3 clause
import config
import utils
import matplotlib
from matplotlib import pyplot
import numpy as np
from matplotlib.ticker import FixedLocator, NullFormatter
preamble = (
r'\usepackage{amsmath}'
... |
<filename>will/sockets.py
#!/usr/bin/env python
#
# Courtesy of https://blog.miguelgrinberg.com/post/easy-websockets-with-flask-and-gevent
#
from flask_socketio import SocketIO, emit, join_room, leave_room, \
close_room, rooms, disconnect
from flask import Flask, render_template, session, request
import settings
im... |
<filename>timemap/models.py
import uuid
import datetime
from django.db import models
from django.core.exceptions import ValidationError
from django.contrib.auth.models import User
from taggit.managers import TaggableManager
from preferences.models import Preferences
from epl.custommodels import IntegerRangeField, Floa... |
import numpy as np
import matplotlib.pyplot as plt
from scipy.signal import freqz
fs = 1000 # mintavételezési frekvencia (Hz)
fc = 400 # vágási frekvencia (Hz)
Ts = 1 / fs
Ns = 17 # FIR szűrő súlyfüggvényének nem nulla elemeinek száma
f1 = 10 # az első jel 100 Hz-es
f2 = 470 # a második jel 2 kHz-es
t = np.... |
import torch
import torchvision.models as models
import torch.optim as optim
import argparse
import matplotlib.pylab as plt
from network.deeplabv3.deeplabv3 import *
from build_data import *
from module_list import *
parser = argparse.ArgumentParser(description='Supervised Segmentation with Partial Labels')
parser.... |
import math
from typing import Dict, List, Mapping, Optional, Tuple, Union
import pandas
class Ancestry:
""" Holds the possible ancestry candidates as well as the confidance score for each.
Parameters
----------
initial_background: pandas.Series
The genotype which reached the maximum relative frequency wit... |
<reponame>42cc/dashr-gw
import logging
import socket
from datetime import timedelta
from mock import patch
from ripple_api.models import Transaction as RippleTransaction
from django.db.utils import OperationalError
from django.test import TestCase
from apps.core import models, tasks, utils
from gateway import celery... |
<reponame>pzaffino/SlicerLungDensitySegmentation
import os
import unittest
import vtk, qt, ctk, slicer
from slicer.ScriptedLoadableModule import *
import logging
from slicer.util import setSliceViewerLayers
import numpy as np
import SimpleITK as sitk
import sitkUtils
import scipy.ndimage
#
# LungCTGMMSegmentation
#
... |
<reponame>phatollie/MQTT
# -*- coding: utf-8 -*-
###############################################
# Authored by <NAME> in the year 2021 #
###############################################
"""
Description: MQTT client script to help reduce the massive options to connect to a MQTT broker and publishing TOPICS. The optiona... |
from django.test import TestCase
from django.contrib.auth.models import User
from django.utils import timezone
from datetime import timedelta
from dynamic_preferences.registries import global_preferences_registry
from danceschool.core.models import DanceRole, DanceType, DanceTypeLevel, ClassDescription, Pricin... |
<filename>geotrek/signage/forms.py
from django import forms
from django.conf import settings
from django.contrib.gis.forms.fields import GeometryField
from django.db.models import Max
from django.forms.models import inlineformset_factory
from django.utils.translation import gettext_lazy as _
from leaflet.forms.widgets... |
<reponame>kasper190/Simple-TMS-server
from datetime import datetime
import os
from osgeo import (
gdal,
osr,
)
from PIL import Image
from shutil import rmtree
import sqlite3
import subprocess
import sys
from time import (
gmtime,
strftime
)
input_path = 'TIF_FILES/'
output_path = 'static/img/maps/'
... |
<filename>cnt4713-computer-networking-projects/script.py
# <NAME>
# Dr. Bou-Harb
# 2017F - CNT 4713: Computer Networking Projects
# Final Project
import pyshark
import requests
import math
import pprint
import itertools, sys
import time
import json
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as ... |
<gh_stars>0
import copy
import functools
import itertools
import logging
import posixpath
import urllib.parse
import xml.etree.ElementTree as etree
from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple, Union
import markdown
import markdown.extensions
import markdown.postprocessors
import markdown.pr... |
<reponame>iacobo/continual
"""
Functions for plotting results and descriptive analysis of data.
"""
#%%
import time
import json
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from pathlib import Path
from datetime import datetime
from collections import defaultdict
ROOT... |
<gh_stars>0
import uiautomator2 as u2
import time
from utils import *
from cv import *
from Automator import *
import matplotlib.pylab as plt
# plt.ion()
# fig, ax = plt.subplots(1)
# plt.show()
a = Automator()
a.start()
def login_auth(ac,pwd):
need_auth = a.login(ac=ac,pwd=pwd)
if need_auth:
auth_n... |
<reponame>MRCIEU/ewascatalog<filename>database/zenodo.py
# script to upload a file to zenodo sandbox via api
# seperate sandbox- and real-zenodo accounts and ACCESS_TOKENs each need to be created
# to adapt this script to real-zenodo (from sandbox implementation):
# update urls to zenodo.org from sandbox.zenodo.or... |
<reponame>tbsd/hehmda
#!/usr/bin/env python3
"""
Documentation
See also https://www.python-boilerplate.com/flask
"""
import os
import json
import pymongo
import dns
import time
import hashlib
import cgi
from flask import Flask, jsonify, render_template, send_from_directory, request, make_response, redirect, url_for... |
<reponame>GuyLewin/plaso<gh_stars>0
# -*- coding: utf-8 -*-
"""The storage media CLI tool."""
from __future__ import unicode_literals
import getpass
import os
import sys
from dfdatetime import filetime as dfdatetime_filetime
from dfvfs.analyzer import analyzer as dfvfs_analyzer
from dfvfs.analyzer import fvde_analyz... |
#!/usr/bin/python3.4
# -*-coding:Utf-8 -*
'''module to manage list of all know version of Blender in the system'''
import xml.etree.ElementTree as xmlMod
import re, os
from usefullFunctions import XML
class VersionList:
'''class dedicated to Blender version managing'''
def __init__(self, xml= None):
'''initial... |
<gh_stars>10-100
from __future__ import print_function
import argparse
import sys
import os
import time
import numpy as np
import mxnet as mx
from mxnet import ndarray as nd
import cv2
from rcnn.logger import logger
from rcnn.config import config, default, generate_config
#from rcnn.tools.test_rcnn import test_rcnn
#fr... |
<filename>botogram/shared.py
# Copyright (c) 2015-2019 The Botogram Authors (see AUTHORS)
#
# 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 t... |
#(C) Copyright <NAME> 2017-2020
#(C) Copyright Thousand Smiles Foundation 2017-2020
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#
#You may obtain a copy of the License at
#http://www.apache.org/licenses/LICENSE-2.0
#
#Unless requir... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# ==================================================
# Honeywell HMC5883L Magnetometer
# Datasheet : http://www51.honeywell.com/aero/common/documents/myaerospacecatalog-documents/Defense_Brochures-documents/HMC5883L_3-Axis_Digital_Compass_IC.pdf
# ==============================... |
<filename>tests/tasks/test_extract_relevance_period.py
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import unittest
import datetime
from data_quality import exceptions
from data_quality.tasks... |
import pickle
import time
from tkinter import Tk, filedialog
import ipywidgets as widgets
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import numpy.matlib
import pandas as pd
import traitlets
from IPython.display import display
import functools
from tail_extrap import multivariate
debug_view ... |
<reponame>OBITORASU/tomato-timer<filename>tests.py<gh_stars>0
import unittest
import requests
import json
import os
import shutil
from app import server
from app.helpers import Timer
def send_get_to_room_url(root_endpoint: str, room_name: str) -> requests.Response:
'''sends GET to <root_endpoint>/room/<name>, r... |
<gh_stars>0
from collections import OrderedDict
import logging
import time
import sys
import pandas as pd
import pyprind
from joblib import Parallel, delayed
import cloudpickle as cp
import pickle
from py_entitymatching.blocker.blocker import Blocker
import py_entitymatching.catalog.catalog_manager as cm
from py_enti... |
<gh_stars>0
import os
from google.cloud import language
from google.cloud.language import enums
from google.cloud.language import types
os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = "/.json"
client = language.LanguageServiceClient()
class Sentiment:
"""
A class containing the returned sentiment values and e... |
<filename>playlistcast/api/query.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Query"""
import os
from pathlib import Path
from typing import List
import graphene
from graphql_relay import from_global_id
from graphql.execution.base import ResolveInfo
from playlistcast import util, db, config, error
from playlistc... |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: v2ray.com/core/transport/internet/tls/config.proto
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobu... |
# Modules by me
import carnatic_util
import mohanam
import markov_analyser
import sys
import optparse
from pydub import AudioSegment
_standard_length = 4
def GetOptions():
usage = "usage: %prog [options] [music score(s)]"
parser = optparse.OptionParser(usage)
parser.add_option("-q"
... |
<reponame>bruce1408/detectron2_modify
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import argparse
import glob
import logging
import os
import pickle
import sys
from typing import Any, ClassVar, Dict, List
import torch
from detectron2.config import get_cfg
from detectr... |
#!/usr/bin/env python3
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.animation import FuncAnimation
from copy import deepcopy
import cv2
from cv2 import VideoWriter, VideoWriter_fourcc
import sys
import math
r = 0.038*20
L = 0.354*20
# node class that each spot in the map will occupy
# cell lo... |
<filename>analysis/str_parser.py
from ipaddress import ip_address
from typing import List
from scipy.spatial import distance
import analysis.p_types as p_types
from analysis.ip_base import IPv6_or_IPv4_obj
from analysis.itxyek_base import ITXYEK
POINT_SPLITTER = ":"
COORDINATE_SPLITTER = ","
class ITXYStrToArray:
... |
#!/usr/bin/env python
"""
Common utility functions
"""
import os
import re
import sys
import gzip
import bz2
import numpy
def init_gene():
"""
Initializing the gene structure
"""
gene_det = [('id', 'f8'),
('anno_id', numpy.dtype),
('confgenes_id', numpy.dtype),
... |
import asyncio
import json
import os
from crypt import Bcrypt
from datetime import datetime
import numpy as np
import pandas as pd
import cherrypy
def convert(o):
if isinstance(o, np.int64):
return int(o)
if isinstance(o, np.float64):
return float(o)
class HomePage(object):
@cherrypy.e... |
# Copyright 2016-2018 Hortonworks Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... |
<reponame>HumanCellAtlas/ingest-common
#!/usr/bin/env python
"""
Class encapsulating implementation details on the Descriptor classes. Descriptors represent a portion of a metadata
schema.
"""
import re
IDENTIFIABLE_PROPERTIES = ["biomaterial_id", "process_id", "protocol_id", "file_name"]
class Descriptor():
""... |
<reponame>pulumi/pulumi-kubernetes-crds
# coding=utf-8
# *** WARNING: this file was generated by crd2pulumi. ***
# *** 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, Sequence, Union
from ... impor... |
from CrossRatio import *
from CrossRadonTransform import *
from HoughTransform import *
from ShapeDescriptor import *
from MatchRaysPairs import *
from Plotter import *
#from ransac import *
from LineEstimation import *
from HorizonLine import *
from VanishPencilsTable import *
from Image import *
from Scanner import *... |
<filename>timetomodel/tests/test_series_specs.py<gh_stars>0
from datetime import datetime, timedelta
import pytest
import pandas as pd
import numpy as np
import pytz
from timetomodel.speccing import ObjectSeriesSpecs, CSVFileSeriesSpecs
from timetomodel.transforming import Transformation
from timetomodel.tests.utils ... |
<filename>sos_trades_core/tools/post_processing/spider_charts/instantiated_spider_chart.py
'''
Copyright 2022 Airbus SAS
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/li... |
<gh_stars>0
'''
File name: NavMerge_test.py
Programmed by: <NAME>
Date: 2019-11-05
Unit tests for NavMerge.py.
'''
from numpy import array, allclose
from numpy.linalg import norm
from nav.NavMerge import *
from nav.utils.common_utils import unit_test
from nav.utils.constants import PASS, FAIL
def merge_accel_test_n... |
<filename>prune/stats.py<gh_stars>1-10
#!/usr/bin/env python
# encoding: utf-8
"""
Gets stats and plots stuff given a protocol
Usage:
stats.py <database.task.protocol> [--set=<set> --filter_unk --crop=<crop> --hist --verbose --save]
stats.py -h | --help
Common options:
<database.task.protocol> Experimental pr... |
<gh_stars>1-10
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import logging
import json
from threathunter_common.util import json_dumps
from nebula.views.base import BaseHandler
from nebula.dao.user_dao import authenticated
from nebula.dao.user_dao import UserDao
from nebula.dao... |
<reponame>binary-signal/newsapi.org<filename>newsapi/client.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from .objects import Source, Article
from .exceptions import *
import requests
import json
import logging
module_logger = logging.getLogger('news-api')
class Client:
api = 'https://newsapi.org/v2/'
... |
import h5py
import numpy as np
import sys
import os
def join(path, key):
if path[-1] != '/':
path += '/'
return path + key
#def build_mocap_models(rootdir, h5file):
# sgrp_root = 'mocap/models'
# sds_wb = join(sgrp_root, 'wb.vsk')
#
# print 'creating group: ' + sgrp_root
# #h5file.create_group(sgrp_root)
... |
import logging
from argparse import ArgumentParser
from collections import OrderedDict
import numpy as np
import pandas as pd
from ampligraph.datasets import load_wn18
from ampligraph.latent_features import ComplEx, HolE, TransE
from ampligraph.evaluation import evaluate_performance, mrr_score, hits_at_n_score
from amp... |
<reponame>HarshCasper/mergify-engine<filename>mergify_engine/branch_updater.py
# -*- encoding: utf-8 -*-
#
# Copyright © 2018–2021 Mergify SAS
#
# 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
... |
# Copyright 2020
# Author: <NAME> <<EMAIL>>
import time
import random
import gym
from datetime import datetime
from gym import wrappers
import numpy as np
import os
from collections import deque
from torch.utils.tensorboard import SummaryWriter
import torch
from agent import TD3
from memory import ReplayBuffer
def... |
<filename>kme/extern/senn/datasets/dataloaders.py
import os
import shutil
import urllib.request
from pathlib import Path
import numpy as np
import pandas as pd
import torch
import torchvision.transforms as transforms
from torch.utils.data import Dataset, DataLoader, random_split
from torch.utils.data.sampler import Su... |
<gh_stars>0
import time
import logging.config
from scapy.all import get_if_hwaddr, sendp, sniff, UDP, BOOTP, IP, DHCP, Ether
logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
logger = logging.getLogger(name="elchicodepython.honeycheck")
def apply_controls(control_modules, **kwargs):
for control_object... |
################################################################################
# This module calculates the PMI of n-grams
# Parameters df_ac_ngram_q: input pandas.DataFrame of n-grams, it should have,
# at least, n-gram count columns with the 'AC_Doc_ID's
# as the index of th... |
<gh_stars>1-10
#!/usr/bin/env python
from JumpScale import j
import time
import os
import netaddr
class Lxc:
def __init__(self):
self.__jslocation__ = "j.sal.lxc"
self._prefix = "" # no longer use prefixes
self._basepath = None
def execute(self, command):
"""
Execute... |
<reponame>mehdirezaie/LSSutils<filename>lssutils/stats/smoother.py
""" Kernel Smoother SN Hubble Diagram
"""
import matplotlib.pyplot as plt
import numpy as np
from sklearn.model_selection import train_test_split
from scipy.interpolate import InterpolatedUnivariateSpline as IUS
from lssutils.utils import Cosmology
de... |
<reponame>Unique-Divine/test-repo<gh_stars>0
"""Module that defines custom grid environment with an API similar to AI Gym.
An agent moves around in the grid. The agent is...
1. Rewarded for reaching a goal.
2. Punished for falling in a hole.
3. Punished for taking too many scenes to solve.
Classes:
Env: A custom... |
<reponame>ysBach/astropy<gh_stars>1-10
# -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module defines the `Quantity` object, which represents a number with some
associated units. `Quantity` objects support operations like ordinary numbers,
but will deal with unit convers... |
<reponame>jiahfong/alr<filename>alr/training/pl_mixup_cyclic.py<gh_stars>1-10
from typing import Optional, Tuple
import torch
import numpy as np
import math
import torch.utils.data as torchdata
from ignite.engine import Engine, Events, create_supervised_evaluator
from ignite.metrics import Accuracy, Loss
from torch.nn... |
""" Roomba simulation curses"""
import argparse
import curses
from random import randint
from random import choice
from time import sleep
from typing import List
from typing import Tuple
ROOMBA = "@"
DUST1 = "."
DUST2 = ":"
DUST3 = "&"
BASE = "["
OPPOSITE_DIRECTION = {"N": "S", "NE": "SW", "E": "W", "SE": "NW",
... |
<gh_stars>0
import numpy as np
import numpy.linalg as linalg
import sys
from scipy.misc import derivative
from math import isnan
from tqdm import tqdm as tqdm
from multiprocessing import cpu_count
from multiprocessing.dummy import Pool as Pool
from numpy.polynomial import legendre as leg
def gsection(func, a, b, a_ls... |
"""
Copyright (c) 2019 <NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublice... |
"""The basic grid class."""
from bempp.helpers import timeit as _timeit
import collections as _collections
import numba as _numba
import numpy as _np
EDGES_ID = 2
VERTICES_ID = 1
_EDGE_LOCAL = _np.array([[0, 1], [2, 0], [1, 2]])
class Grid(object):
"""The Grid class."""
@_timeit
def __init__(
... |
from django.contrib.auth.models import User
from django.http import Http404
from django_filters.rest_framework import DjangoFilterBackend
from rest_framework import filters
from rest_framework import permissions, viewsets, status
from rest_framework.decorators import action
from rest_framework.response import Res... |
"""Unit tests to test lsf configuration """
# pylint: disable=W0703
# pylint: disable=R0904
import os
import sys
import unittest
import ConfigParser
import logging
# setup system library path
pathname = os.path.realpath('../')
sys.path.insert(0, pathname)
from osg_configure.configure_modules import lsf
from osg_co... |
import model.attention as attention
from model.language_model import WordEmbedding, QuestionEmbedding
from model.classifier import SimpleClassifier
from utilities import config
from torch.nn.functional import binary_cross_entropy_with_logits as bce_loss
from model.vqa_debias_loss_fuctions import *
from model.fc import ... |
import os
import pulleffect
import unittest
import tempfile
import json
import flask
import requests
from mock import patch
from mock import MagicMock
import pulleffect.lib.timeclock
from pulleffect.lib.utilities import Widgets
import logging
class TestCases(unittest.TestCase):
def setUp(self):
"""Before ... |
import os
import sys
from glob import glob
import setuptools
from setuptools import setup, Extension
from setuptools.command.build_ext import build_ext as _build_ext
from distutils.sysconfig import get_config_var, get_python_inc
from distutils.version import LooseVersion
import versioneer
assert LooseVersion(setupt... |
<gh_stars>100-1000
import FlowCal
import json
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn import manifold, datasets
from time import time
from MulticoreTSNE import MulticoreTSNE as TSNE
from sklearn.decomposition import PCA
from sklearn.datasets import make_swiss_roll, make_s_c... |
#!/usr/bin/env python
# Copyright (C) 2017 Udacity Inc.
#
# This file is part of Robotic Arm: Pick and Place project for Udacity
# Robotics nano-degree program
#
# All Rights Reserved.
# Author: <NAME>
# import modules
import rospy
import tf
from kuka_arm.srv import *
from trajectory_msgs.msg import JointTrajectory,... |
<gh_stars>10-100
# =============================================================================== #
# #
# This file has been generated automatically!! Do not change this manually! #
# ... |
# -*- coding: utf-8 -*-
"""install_data.py
Provides a more sophisticated facility to install data files
than distutils' install_data does.
You can specify your files as a template like in MANIFEST.in
and you have more control over the copy process.
Copyright 2000 by <NAME>, Germany.
Permission is hereby granted, fr... |
#!/usr/bin/env python3
import sys
import argparse
import asyncio
from mobnet import Nameservice, Network
try:
import signal
except ImportError:
signal = None
class mobnet_server(asyncio.Protocol):
length_header = 4
encoding = 'JSON'
clients = []
topics = {}
verbose = False
ip = None
... |
<gh_stars>0
#!/usr/bin/env python
import argparse
import os
import skelconf
import adios
import skel_bpy
import skel_settings
# To produce submit scripts, we'll work from a template. There will
# be two types of replacement, simple variables, and macros (for the
# tests)
def generate_submit_scripts_from_xml (params... |
<reponame>rpartsey/habitat-pointnav-aux
"""
Using this eval script
- modify cell 2 definitions as desired (load in the appropriate folders)
- get values in last cell, plots in second to last cell
- modify plot key to see given metric
"""
#%%
import math
import os
import matplotlib.pyplot as plt
from scipy import interp... |
"""Cleans the US Census TIGER Shapefile data.
This code is based almost entirely on open source code written by @jamesturk
at OpenStates, which can be found here --> is.gd/1K0YAy
"""
import re
import geojson
import zipfile
import subprocess
from pathlib import Path
from utils import print_cr
from app.models import Reg... |
#CopyRight: Please take permission before using this script. Most importantly, please cite this work if you use this script.
#
#Citation: <NAME>, DMLWAS: Deep & Machine Learning Wide Association Studies with ExhaustiveDNN such as for genome variations linked to phenotype or drug repositioning
#
#++++++++++++++++ Author... |
<gh_stars>1-10
# ==============================================================================
# MIT License
#
# Copyright 2021 Institute for Automotive Engineering of RWTH Aachen University.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentatio... |
import logging
import re
from mythril.analysis import solver
from mythril.analysis.ops import *
from mythril.analysis.report import Issue
from mythril.exceptions import UnsatError
from mythril.laser.ethereum.taint_analysis import TaintRunner
from z3 import Z3Exception
'''
MODULE DESCRIPTION:
This module finds what co... |
import sys
sys.path.insert(0,'../')
import unittest
import os
import crawl
from crawl_test import FIXTURE_ROOT,TestBase
class SharedTests(object):
def new_crawl(self,callback=None):
search_path = crawl.Crawl(FIXTURE_ROOT)
search_path.append_paths("app/views","vendor/plugins/signal_id/app/views",".")... |
###############################################################################
#
# ptrelpos.py - find relative positions to place protein cartoon elements
#
# File: ptrelpos.py
# Author: <NAME>
# Created: October 2007
#
# $Id: ptrelpos.py 1482 2008-06-21 08:32:24Z astivala $
#
#
###################################... |
<reponame>PICT-ACM-Student-Chapter/OJ_API
# Create your views here.
from functools import cmp_to_key
from django.conf import settings
from django.core.cache import cache
from django.http import HttpResponse, JsonResponse
from rest_framework import permissions
from rest_framework.generics import ListAPIView, RetrieveAP... |
<gh_stars>100-1000
import os
import typing
import numpy
import pandas
from d3m import container, exceptions, utils as d3m_utils
from d3m.metadata import base as metadata_base, hyperparams
from d3m.base import primitives
__all__ = ('FixedSplitDatasetSplitPrimitive',)
class Hyperparams(hyperparams.Hyperparams):
... |
# -*- coding: utf-8 -*-
import numpy as np
import networkx as nx
from scipy import sparse
from scipy.linalg import eig
from itertools import product
def get_base_modularity_matrix(network):
'''
Obtain the modularity matrix for the whole network
Parameters
----------
network : nx.Graph or nx.DiGrap... |
# -*- coding: utf-8 -*-
import os
from config import *
import numpy as np
import time
import libxml2 as lx
class XMLTemplate(object):
def __init__(self, fname):
assert(os.path.isfile(fname))
self._fname = fname
self._load()
def _load(self):
f = open(self._fname, 'r')
... |
"""
/*
* Copyright (c) 2021, salesforce.com, inc.
* All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
"""
from builtins import zip, str, range
import pdb, os, csv, re, io, json
import urll... |
<gh_stars>0
import argparse
import csv
import os
import re
import sys
from pathlib import Path
from src import data_loader
from src.dataset_classes.DAST_datasets import DastDataset
from src.dataset_classes.datasets import DataSet
from src.feature_extraction.feature_extractor import FeatureExtractor
punctuation = re.c... |
<reponame>ashwinipokle/deq<gh_stars>100-1000
import torch
import torch.nn.functional as F
import torch.nn as nn
import torch.autograd as autograd
import sys
import copy
import numpy as np
from termcolor import colored
import os
sys.path.append('../../')
from lib.optimizations import weight_norm, VariationalDropout, V... |
<gh_stars>1-10
from __future__ import annotations
import datetime
from typing import List, Optional, Tuple, Union, TYPE_CHECKING
from .image import Image
if TYPE_CHECKING:
from .media import Manga, Anime
__all__ = (
'CharacterName',
'CharacterBirthdate',
'Character'
)
class CharacterName:
"""
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.