text stringlengths 957 885k |
|---|
<gh_stars>0
import bpy
from mathutils import Vector
from ...utils import copy_bone, flip_bone, put_bone, org
from ...utils import strip_org, make_deformer_name, connected_children_names
from ...utils import create_circle_widget, create_sphere_widget, create_widget
from ...utils import MetarigError, make_mechanism_name... |
<filename>feasability_study/odslib.py
#!/usr/bin/env python
"""
Access ASAM Ods server via python using omniorb.
Copyright (c) 2015, <NAME>
License: Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0.html)
"""
__author__ = "<NAME>"
__license__ = "Apache 2.0"
__version__ = "0.0.1"
__maintainer__ = "<NAME>"
__emai... |
<reponame>fuliucansheng/UniTorch
# Copyright (c) FULIUCANSHENG.
# Licensed under the MIT License.
import torch
import torch.nn as nn
from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Union
from unitorch.score import (
accuracy_score,
recall_score,
f1_score,
bleu_score,
voc_map_sco... |
from pyradioconfig.calculator_model_framework.interfaces.iphy import IPhy
class PHYS_IEEE802154_WiSUN_Ocelot(IPhy):
### EU Region ###
# Owner: <NAME>
# JIRA Link: https://jira.silabs.com/browse/PGOCELOTVALTEST-166
def PHY_IEEE802154_WISUN_868MHz_2GFSK_50kbps_1a_EU(self, model, phy_name=None):
... |
# Copyright 2015 Canonical Limited.
#
# 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 writi... |
import cluster_generator as cg
import unyt as u
from numpy.random import RandomState
import numpy as np
# Note that cluster_generator does not use unyt units for speed and simplicity,
# so mass units are Msun, length units are kpc, and time units are Myr
# Put the two clusters at a redshift z = 0.1
z = 0.1
# M200 ... |
<reponame>zeroSteiner/protocon
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# protocon/utilities.py
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above c... |
from unittest import TestCase, mock
from basketball_reference_web_scraper.data import OutputWriteOption
from basketball_reference_web_scraper.writers import JSONWriter
class TestJSONWriter(TestCase):
def setUp(self):
self.mock_encoder = mock.Mock()
self.mock_data = ["some data"]
self.writ... |
# Generated by Django 3.0.8 on 2020-07-08 22:03
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import jobs.models
class Migration(migrations.Migration):
initial = True
dependencies = [
('accounts', '0001_initial'),
('django_celery_bea... |
from neuromp.preprocessing.tree import AST
from enum import IntEnum
from itertools import product
import subprocess
import time
import numpy as np
from copy import deepcopy
from neuromp.preprocessing.convertCToCuda import constroiCuda
class VarStates(IntEnum):
# PONTEIR = 1
SHARED = 1
PRIVATE = 2
# RE... |
#=================================================================================================================================================@
#Chapter 2 - Creating a simple first model
#===========================================================================================================================... |
import os
import nltk
from typemap import type_map
import contextnet_api as cnapi
from logger import print_edges
import words
from cache import set_cache, string_cache, set_global_root
import cache
import secondary_functions
import cache
import loop
from json_socket import make_socket, send_json
i... |
import tensorflow as tf
print(tf.__version__)
from models.official.bert import modeling
from models.official.bert import tokenization
bert_pretrained_path = "/Users/Qba/Downloads/cased_L-12_H-768_A-12/bert_model.ckpt"
bert_vocab = "/Users/Qba/Downloads/cased_L-12_H-768_A-12/vocab.txt"
bert_config = modeling.BertConfi... |
import sys
import re
import os
import time
import traceback
from ast import literal_eval
import six
from six.moves import configparser
from ply import lex, yacc
import click
import cchardet as chardet
from pygments import highlight
from pygments.lexers import get_lexer_by_name
from pygments.formatters import HtmlForma... |
#!/usr/bin/env python
import os, sys
sys.path.insert(0, "..")
import matplotlib.pyplot as plt
import numpy as np
import pprint
import time
import torch
from diff_gpmp2.env.env_2d import Env2D
from diff_gpmp2.robot_models import PointRobot2D
from diff_gpmp2.gpmp2.diff_gpmp2_planner import DiffGPMP2Planner
from diff_gpmp... |
# the np.std function does 1/N not 1/N-1
import numpy as np
def mc_polyfit1d(x,y,order,yunc=None,silent=None):
'''
Fits a polynomial of a given order to a set of 1-D data.
Input Parameters:
x - A numpy array of independent values.
y - A numpy array of dependent values.
order - Th... |
# OpenFace API tests.
#
# Copyright 2015-2016 Carnegie Mellon University
#
# 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... |
import numpy as np
import copy
import matplotlib.pyplot as plt
class Environment:
# considering uniform policy i.e., probability of taking an action in a current state
# actions are deterministic, i.e., resulting state of the agent on an action is deterministic
def __init__(self , discount_factor = 1):
... |
# MIT License
# Copyright (c) 2021 <NAME>, <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,... |
# -*- coding: utf-8 -*-
"""One line description.
Authors:
<NAME> - <EMAIL>
Todo:
"""
import numpy as np
import pandas as pd
import click
def rename(data_cleaned):
"""Rename columns for the annotated task data exported from LabelStudio
in order to be fed into the entailment model.
Args:
TODO... |
from aoc import AOC
aoc = AOC(year=2018, day=13)
data = aoc.load()
path_ids = set(["|", "-"])
curve_ids = set(["\\", "/"])
intersection_ids = set(["+"])
cart_ids = set(["<", ">", "^", "v"])
paths = {}
carts = {}
cart_last_turn = {}
y = 0
next_cart_id = 0
for line in data.lines():
for index, c in enumerate(lin... |
<gh_stars>0
"""Based on https://github.com/reiinakano/neural-painters-pytorch/blob/master/neural_painters/gan_painter.py"""
import os
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch import autograd
from torch.utils.tensorboard import SummaryWriter
# custom weig... |
# coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# 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 applicab... |
# -*- coding: utf-8 -*-
# 设计模式:过程式编程
# Form implementation generated from reading ui file 'test3.ui'
# Created by: PyQt5 UI code generator 5.15.4
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
import time
impo... |
"""
author: <NAME> & <NAME>
code to generate synthetic data from stock-model SDEs
"""
# ==============================================================================
from math import sqrt, exp
import numpy as np
import matplotlib.pyplot as plt
import copy, os
# =====================================================... |
<filename>miniserver_gateway/connectors/shelly/api/gen1parser.py
#!/usr/bin/python3
# Copyright 2021. FastyBird s.r.o.
#
# 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
#
# ... |
<filename>qasm2image/svg/_constants.py
# ======================================================================
# Copyright CERFACS (February 2018)
# Contributor: <NAME> (<EMAIL>)
#
# This software is governed by the CeCILL-B license under French law and
# abiding by the rules of distribution of free software. You c... |
<reponame>Kwounsu/Winee<filename>mysite/myapp/views.py
import csv, io
from django.shortcuts import render, redirect, get_object_or_404
from django.http import HttpResponse, JsonResponse
from django.views.decorators.csrf import csrf_exempt
from django.contrib.auth.decorators import login_required, permission_required
f... |
"""
Various statistical and plotting utilities
"""
from numpy import *
from scipy.optimize import leastsq,fminbound
from scipy.special import erf
import distributions as dists
import numpy as np
import emcee
import numpy.random as rand
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import plot... |
<filename>src/tagger/__init__.py<gh_stars>0
import typing as t
import warnings
from collections import namedtuple, OrderedDict
import numpy as np
from numpy.lib.recfunctions import unstructured_to_structured
__all__ = [
'Tagger',
]
def _parse_spec(spec: t.List[str]) -> t.OrderedDict[str, int]:
"""Parse a sp... |
<reponame>nik849/Odds<gh_stars>1-10
import atexit
import time
from apscheduler.scheduler import Scheduler
from flask import Flask, render_template, request, send_file, session
from odds.api import telegram, totalcorner
from odds.config import (CONFIG, HOST_URL, configs, telegram_id, test_token,
... |
<reponame>Christophe-Foyer/tracking_turtlebot
#!/usr/bin/env python3
import rospy
from geometry_msgs.msg import Twist
from nav_msgs.msg import Odometry
from std_msgs.msg import Float64
from tf.transformations import euler_from_quaternion
import math
from tracking_turtlebot import clamp, makeSimpleProfile, PID
# Min... |
<gh_stars>0
"""
Functions used for distorting images for training
"""
# Import the necessary libraries
import numpy as np
import torch
from scipy.ndimage.filters import gaussian_filter
from PIL import Image
# Import the necessary source codes
from Preprocessing.utils import dct_2d
from Preprocessing.utils import... |
# -*- coding: utf-8 -*-
"""
@author: <NAME>
"""
import gym
from gym import Envs, spaces
from gym.utils import seeding
from gym.envs.registration import register
import numpy as np
import random as rd
import math
class HRI_StationaryEnv(gym.Env):
metadata = {
'render.modes': ['human', 'rgb_array'],
... |
"""
htmlx.webapi.fetch
====================================
https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API
"""
# TODO - untested. moving these over from javascript module
# TODO - check if promise also needs to come to this package
# @staticmethod
def fetch(url: str, **kwargs):
# undocumen... |
import torch
import torch.nn as nn
import torch.optim as optim
import torch.optim.lr_scheduler as lr_scheduler
from dgl import model_zoo
from torch.utils.data import DataLoader
import math, random, sys
import argparse
from collections import deque
import rdkit
from jtnn import *
torch.multiprocessing.set_sharing_str... |
<gh_stars>0
#!/usr/bin/env python
from wand.image import Image
from wand.drawing import Drawing
from wand.color import Color
# http://www.imagemagick.org/Usage/draw/#arcs
w = 100
h = 60
bgcolor = Color('skyblue')
# original imagemagick command:
# Elliptical Arcs : A radius_x,y angle large,sweep x,y
# convert... |
<filename>tests/test_peering_service.py
from typing import AsyncGenerator
from unittest import mock
from asyncio.exceptions import TimeoutError
import pytest
from async_timeout import timeout
from sarafan.events import NewPeer, DiscoveryRequest, DiscoveryFinished, DiscoveryFailed
from sarafan.models import Peer
from ... |
import logging
import string
import freetype
import numpy as np
from ..geometry import Size
from .core import TilesSource
log = logging.getLogger(__name__)
class TrueTypeFont(TilesSource):
"""Generate tiles from True Type Font."""
DEFAULT_DPI = 96
MONOSPACE_REFERENCE_CHARS = ['@', ]
PROPORTION... |
# This Python file uses the following encoding: utf-8
"""autogenerated by genpy from deepracer_msgs/SetVisualColorRequest.msg. Do not edit."""
import codecs
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct
import std_msgs.msg
class SetVisualColorRequest(genpy.Message):
... |
import numpy as np
import fitsio
from astropy.table import Table,unique
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("--version", help="catalog version; use 'test' unless you know what you are doing!",default='test')
args = parser.parse_args()
print(args)
version = args.version
mtld = Tab... |
<reponame>msoltysik/innovativeproject-health-care
from flask import jsonify, Response, abort, request
from flask_restful import Resource
from sqlalchemy import exc
from backend.app import db
from backend.common.permissions import roles_allowed
from backend.models import User
class EditorsRes(Resource):
"""Editor... |
<filename>ex_bary10.py
# Finds the E-LPIPS barycenter of ten perturbed versions of an input image.
#
# The supported perturbations include additive Gaussian noise and small shifts.
#
#
# Runs the iteration for 100 000 steps. Outputs are generated by default into directory out_bary10,
# but this directory may be changed... |
#!/usr/bin/env python
###############################################################################
#
# $Author$
# $Date$
# $Id$
#
# PNFS agend client
# Author: <NAME> (<EMAIL>) 08/05
#
###############################################################################
# system imports
import sys
import pprint
import st... |
<filename>trajetoria/aula7_modelos_cinematicos.py<gh_stars>0
try:
import sim
except:
print ('--------------------------------------------------------------')
print ('"sim.py" could not be imported. This means very probably that')
print ('either "sim.py" or the remoteApi library could not be found.')
... |
<filename>icefall/decode.py<gh_stars>100-1000
# Copyright 2021 Xiaomi Corp. (authors: <NAME>)
#
# See ../../../../LICENSE for clarification regarding multiple authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You... |
<gh_stars>10-100
# Copyright 2021 Google LLC. 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... |
<filename>fiubar/facultad/migrations/0001_initial.py
# Generated by Django 2.0.4 on 2018-05-04 14:39
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable... |
<reponame>pierky/mrtparse
#!/usr/bin/env python
'''
slice.py - This script slices MRT format data.
Copyright (C) 2016 greenHippo, 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
http://ww... |
<filename>memegen/domain/template.py
import os
import hashlib
import shutil
from pathlib import Path
from contextlib import suppress
import tempfile
import requests
from PIL import Image
import log
from .text import Text
DEFAULT_REQUEST_HEADERS = {
'User-Agent': "Googlebot/2.1 (+http://www.googlebot.com/bot.htm... |
<reponame>archimarkGit/compas
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import importlib
import itertools
import os
import sys
import compas_rhino
import compas._os
import compas.plugins
__all__ = ['install']
def install(version=None, packages=Non... |
<filename>Code/odooerp/odoo-8.0/openerp/addons/analytic/analytic.py
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you ... |
'''
Copyright 2016 <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, software distributed... |
<reponame>SimonBiggs/platipy<filename>platipy/imaging/augment/defaug.py
from abc import ABC, abstractmethod
from collections.abc import Iterable
import random
import SimpleITK as sitk
from platipy.imaging.deformation_fields.deformation_field_operations import (
generate_field_shift,
generate_field_expand,
... |
<gh_stars>10-100
# Copyright (c) Nanjing University, Vision Lab.
# Last update:
# 2020.11.26
# 2019.11.13
# 2019.10.27
# 2019.10.07
# 2019.10.08
import os
import argparse
import numpy as np
import tensorflow as tf
import time
import importlib
import subprocess
tf.enable_eager_execution()
import models.model_voxcep... |
<filename>psydac/mapping/analytical.py
# coding: utf-8
#
# Copyright 2018 <NAME>
import numpy as np
import sympy as sym
from abc import ABCMeta
from psydac.mapping.basic import Mapping
__all__ = ['IdentityMapping','SymbolicMapping','AnalyticalMapping']
#==============================================================... |
<reponame>Stilwell-Git/Randomized-Return-Decomposition
import copy
import numpy as np
class Episode_FrameStack:
def __init__(self, info):
self.common_info = [
'obs', 'obs_next', 'frame_next',
'acts', 'rews', 'done'
]
self.ep = {
'obs': [],
'ac... |
<reponame>Nowasky/PerfKitBenchmarker<filename>tests/linux_benchmarks/cuda_memcpy_benchmark_test.py
# Copyright 2021 PerfKitBenchmarker 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 c... |
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals
import pickle
import math
import copy
import numpy as np
import pandas as pd
import sklearn.linear_model as linear_model
import sklearn.preprocessing as preprocessing
i... |
#!/usr/bin/env python3
from distutils.spawn import find_executable
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import plotly.express as px
import seaborn as sns
from math import log, ceil, floor
import pandas as pd
import numpy as np
import statistics
import subprocess
import logomaker
impor... |
import numpy as np
from rlkit.torch.core import eval_np
def marollout(
env,
agent_n,
max_path_length=np.inf,
render=False,
render_kwargs=None,
shared_obs=False,
shared_encoder=None,
shared_groups=None,
collect_raw_actions=False,
):
"""
The... |
# SPDX-FileCopyrightText: 2022 <NAME> <<EMAIL>>
#
# SPDX-License-Identifier: MIT
from pathlib import Path
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject... |
<filename>utils.py
import os
import numpy as np
import matplotlib.colors as colors
from scipy.io import loadmat
import json
from xml.dom import minidom
import rasterio
import subprocess
from osgeo import ogr, osr
from geojson import Polygon
from datetime import datetime
def clip_tiff_by_shapefile(tiff_file, shapefil... |
<filename>ptt_crawler/ptt_crawler_utils.py
import requests
from bs4 import BeautifulSoup as bs
from datetime import datetime
from datetime import timedelta
import copy
import time
import re
import sys
import urllib.parse
from hashlib import md5
cookies = {'over18': '1'}
ARTICLE_SCHEMA = {
'url': '',
"bo... |
"""Tools for polynomial factorization routines in characteristic zero. """
from sympy.polys.rings import ring, xring
from sympy.polys.domains import FF, ZZ, QQ, RR, EX
from sympy.polys import polyconfig as config
from sympy.polys.polyerrors import DomainError
from sympy.polys.polyclasses import ANP
from sympy.polys.s... |
# coding=utf-8
# *** WARNING: this file was generated by the 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, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from... |
<filename>report_crawler/report_crawler/pipelines.py
# -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
import re
import o... |
import utils
import os
import unittest
import sys
from test_format_bcif import MockMsgPack, MockFh
if sys.version_info[0] >= 3:
from io import StringIO, BytesIO
else:
from io import BytesIO
StringIO = BytesIO
TOPDIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
utils.set_search_paths(TO... |
<filename>app/blockchain/updateBlockHeightState.py
'''
idea of this script is to each time:
determine bolck height of main chain
save relative height of tracked nodes
save overall statistics about heights of nodes in network
see config.py for more info abou config values
'''
#app imports
from app import ap... |
<filename>pynn/rnn.py
"""
Recurrent neural networks.
TODO: this is not a complete implementation.
<NAME>, 05/2015
"""
import nn
import layer
import learner
import numpy as np
import gnumpy as gnp
import math
import struct
class RNN(nn.BaseNeuralNet):
def __init__(self, in_dim=None, out_dim=None, nonlin_type=lay... |
#!/usr/bin/env python3
# vimspector - A multi-language debugging system for Vim
# Copyright 2019 <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/L... |
<reponame>shashanksen/beam-nuggets<filename>beam_nuggets/io/kafkaio.py
from __future__ import division, print_function
from apache_beam import PTransform, ParDo, DoFn, Create
from kafka import KafkaConsumer, KafkaProducer
class KafkaConsume(PTransform):
"""A :class:`~apache_beam.transforms.ptransform.PTransform`... |
<filename>rmexp/dataset/fileutils.py<gh_stars>1-10
#! /usr/bin/env python
import functools
import glob
import importlib
import multiprocessing
import os
import shutil
import fire
from logzero import logger
def rename_files_in_directory_to_sequence(dir_path, ext='jpg'):
"""Rename files to be the format of 000000... |
import json
import urllib.parse
from unittest.mock import Mock, patch
from urllib.parse import parse_qs, urlparse
from django.contrib.sites.models import Site
from django.test import RequestFactory, override_settings
from microsoft_auth.client import MicrosoftClient
from . import TestCase
STATE = "test_... |
<filename>datumaro/tests/test_transforms.py
import logging as log
import numpy as np
from unittest import TestCase
from datumaro.components.project import Dataset
from datumaro.components.extractor import (Extractor, DatasetItem,
Mask, Polygon, PolyLine, Points, Bbox, Label,
LabelCategories, MaskCategories, An... |
"""
Filtering and dataset mapping methods based on training dynamics.
By default, this module reads training dynamics from a given trained model and
computes the metrics---confidence, variability, correctness,
as well as baseline metrics of forgetfulness and threshold closeness
for each instance in the training data.
I... |
<gh_stars>0
import os
import sys
import bpy
import math
from mathutils import Euler, Matrix, Vector
sys.dont_write_bytecode = 1
dir = os.path.dirname(bpy.data.filepath)
if not dir in sys.path:
sys.path.append(dir)
from hyperparameters import f, r, h, p, e, trig_h, \
clip_depth, clip_thickness, clip_height, cl... |
import asyncio
import logging
import pickle
from dataclasses import dataclass
from datetime import datetime, timedelta
from operator import itemgetter
from typing import Any, Dict, List, Optional, Union
from uuid import uuid4
import aioredis
from aioredis import MultiExecError, Redis
from .constants import job_key_pr... |
import os
import sys
import pygame
import random
from code.tools.mixer import BGMixer
from code.controllers.intervalcontroller import IntervalController
from code.constants.sound import *
# load_sound just quickly loads a sound file and returns it.
def load_sound(path):
class NoneSound:
def play(sel... |
#@title Quick_CNN { display-mode: "both" }
# # coding: utf-8
import numpy as np
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
from functools import reduce
def weight_variable(shape):
initial = tf.truncated_normal(shape, stddev=0.1)
# initial = tf.random_normal(shape, stddev=0.1)
... |
<reponame>souravrhythm/opendp
def test_sized_bounded_float_sum():
"""known-n bounded float sum (assuming n is public)"""
from opendp.trans import make_split_dataframe, make_select_column, \
make_cast, make_impute_constant, \
make_clamp, make_bounded_resize, make_sized_bounded_sum
from open... |
<gh_stars>0
from SPARQLWrapper import SPARQLWrapper, JSON
from collections import defaultdict
def get_games_based_on_genre(genre,sparql):
sparql.setQuery('''
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3... |
<filename>cyberradiodriver/CyberRadioDriver/log.py
#!/usr/bin/env python
###############################################################
# \package CyberRadioDriver.log
#
# Logging support for objects within the driver.
#
# \author NH
# \author DA
# \author MN
# \copyright Copyright (c) 2014-2021 CyberRadio Solution... |
<reponame>juanjtov/Twitter_PNL_PUBLIC
import pandas as pd
import plotly
import re
import nltk
nltk.download('punkt')
nltk.download('stopwords')
from nltk.probability import FreqDist
from nltk.tokenize import word_tokenize
from nltk.corpus import stopwords
import itertools
import math
import time
import datetime
from c... |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# -------------------------------------------------------------------... |
# importing required packages for this section
from urllib.parse import urlparse,urlencode
import ipaddress
import re
import re
from bs4 import BeautifulSoup
import whois
import urllib
import urllib.request
from datetime import datetime
import requests
class Extractor():
def __init__(self):
self.feature_n... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''tfidf处理器,对分词后的文本进行统计词频和计算tfidf值,输出文本特征.
init:初始化tfidf流程
fit:初始化模型内部参数
transform:将数据代入模型进行转换
'''
import logging
from sklearn.pipeline import Pipeline, FeatureUnion
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.feature_extraction.... |
import random, math
import numpy as np
from rlpy.util import CallbackList
class Agent(object):
def __init__(self, brain, alpha=0.001):
self.Brain = brain
self.RunningReward = None
self.Alpha = alpha
self.EpisodeReward = 0.0
self.resetRunningReward()
def resetRunningRew... |
import ipaddress
import unittest
from lib.Ipam import *
from docker_plugin_api.Plugin import InputValidationException
class PoolInvalidCreateTest(unittest.TestCase):
def test_noargs(self):
with self.assertRaises(InputValidationException):
Pool()
def test_subpool_only(self):
with ... |
<gh_stars>0
__author__ = 'Jwely'
from py.utils.get_rel_humidity import get_rel_humidity
import json
class Experiment:
def __init__(self, experiment_id, n_samples, z_location, v_nominal, dt, test_date,
v_fs_mean, v_fs_sigma, q, pres_atm, temp_tunnel, wet_bulb, dry_bulb, eta_p):
"""
... |
import logging
import requests
import xml.etree.ElementTree
import re
from urllib.parse import urljoin
from datetime import datetime, timedelta, timezone
DEFAULT_STATUS_PATH = 'DI_S_.xml'
DEFAULT_LINE_PATH = 'PI_FXS_1_Stats.xml'
DEFAULT_CALL_STATUS_PATH = 'callstatus.htm'
_LOGGER = logging.getLogger(__name__)
class ... |
<gh_stars>0
"""
User Interface part of nuqql
"""
#######################
# USER INTERFACE PART #
#######################
import curses
import curses.ascii
import datetime
import nuqql.config
import nuqql.conversation
import nuqql.history
def handle_message(backend, acc_id, tstamp, sender, msg):
"""
Handle ... |
<reponame>blueyed/multidict<filename>setup.py
import codecs
import pathlib
from itertools import islice
import os
import platform
import re
import sys
from setuptools import setup, Extension
from distutils.errors import (CCompilerError, DistutilsExecError,
DistutilsPlatformError)
from dist... |
<reponame>joshua-gould/anndata
from __future__ import annotations
from os import PathLike
from collections.abc import Mapping
from functools import partial
from typing import Union
from types import MappingProxyType
from warnings import warn
import h5py
import numpy as np
import pandas as pd
from scipy import sparse
... |
""" Extra function: annot2vector, annot2frames, unroll and roll.
Transformating the annots a song into different representations.
They are disconnected to the class because they can be
applyied to a subsection i.e. for transforming only one indivual level
to a vector representation.
<NAME> 2018
"""
import copy
impor... |
<reponame>baajur/PALM<gh_stars>100-1000
# coding=utf-8
import paddlepalm as palm
import json
if __name__ == '__main__':
max_seqlen = 512
batch_size = 4
num_epochs = 2
lr = 1e-3
vocab_path = './pretrain/ernie/vocab.txt'
train_file = './data/cls4mrqa/train.tsv'
predict_file = './data/cls4mr... |
import copy
import itertools
import json
import logging
import os
from collections import OrderedDict
import numpy as np
from PIL import Image, ImageDraw
import pycocotools.mask as mask_util
import torch
from detectron2.data import MetadataCatalog
from detectron2.evaluation import DatasetEvaluator
from detectron2.mod... |
import inflection
from pampy import match, _, TAIL
from copier import copy
from horn.path import TPL_PATH, get_location
from horn.tpl import get_proj_info, merge_fields, validate_type, validate_attr, validate_opts
TYPES = {
'integer': 'Integer',
'float': 'Float',
'numeric': 'Numeric',
'boolean': 'Boo... |
"""
map2psql.py - convert maf formatted file to a psl formatted file
================================================================
:Tags: Python
Purpose
-------
convert a maf file to a psl file.
Usage
-----
Type::
python <script_name>.py --help
for command line help.
Command line options
-----------------... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'tools/TranslateTool/translatetoolgui.ui'
#
# Created by: PyQt5 UI code generator 5.5.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_TranslateToolGUI(object):
def setupUi(s... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.