text stringlengths 1 927k |
|---|
from setuptools import setup, find_packages
setup_args=dict(
name="PyNodeJS",
version='1.0',
author="Sancho Godinho",
description="A Module to Use Some Node JS Keywords In Python!",
long_description="Please See Docs on: https://github.com/sancho1952007/PyNodeJS",
packages=["pynodejs"],
keywo... |
from conan.tools.microsoft import msvc_runtime_flag
from conans import ConanFile, AutoToolsBuildEnvironment, tools, MSBuild
from conans.errors import ConanInvalidConfiguration
import os
required_conan_version = ">=1.43.0"
class LibsodiumConan(ConanFile):
name = "libsodium"
description = "A modern and easy-to... |
import torch
import numpy as np
import torch.nn.functional as F
from scipy.signal import get_window
from librosa.util import pad_center, tiny
from .util import window_sumsquare
import librosa
class STFT(torch.nn.Module):
def __init__(self, filter_length=1724, hop_length=130, win_length=None,
window... |
# coding: utf-8
import pprint
import re
import six
class RestLockSiteViewReqBody:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the ... |
# -*- coding: utf-8 -*-
"""
@author: Emilio Moretti
Copyright 2013 Emilio Moretti <emilio.morettiATgmailDOTcom>
This program is distributed under the terms of the GNU Lesser General Public License.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public ... |
def realpath(path: str) -> str:
"""Return the canonical path of the specified filename, eliminating any symbolic links encountered in the path (if they are supported by the operating system)."""
pass |
# Copyright 2016-2017 Capital One Services, 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://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... |
#!/usr/bin/env python3
import rospy
from std_msgs.msg import ColorRGBA, Float64
rospy.init_node("battery_led")
pub = rospy.Publisher("/led2", ColorRGBA, queue_size=1)
led_full = ColorRGBA()
led_full.a = 1.0
led_full.r = 0
led_full.g = 0
led_full.b = 1
led_mid = ColorRGBA()
led_mid.a = 1.0
led_mid.r = 0
led_mid.g =... |
import bpy # Imports the bpy module
from math import radians
# Creates a variable called my_cursor_location that stores the location of the 3D cursor
my_cursor_location = bpy.context.scene.cursor.location
# Creates a variable called x_cursor and stores the x location of the 3d cursor
x_cursor = my_cursor_location.x
y... |
'''
File name: common/__init__.py
Author: Frank Zalkow
Date: 2020
License: MIT
This file is part of the following repository:
https://github.com/fzalkow/music_indexing
'''
import numpy as np
import librosa
CHROMA_DIMS = 12
def compute_features(fn_audio):
Fs = 22050
H = 2205
smooth = 41
downsample ... |
def wins(board):
r_5 = range(5)
for r in r_5:
if all([board[(r, j)] for j in r_5]):
return True
for c in r_5:
if all([board[(i, c)] for i in r_5]):
return True
def sum_board(board, called):
s = 0
for i in range(5):
for j in range(5):
if... |
from flask import Flask
from config import config_options
from flask_sqlalchemy import SQLAlchemy
from flask_login import LoginManager
from flask_bcrypt import Bcrypt
#creating app configuration
login_manager= LoginManager()
login_manager.login_view= 'signIn'
db = SQLAlchemy()
bcrypt = Bcrypt()
def create_app(config_... |
# Generated by Django 3.1.4 on 2020-12-29 18:50
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('portapp', '0003_work_bolumu_work_alt_baslik'),
]
operations = [
migrations.AddField(
model_name='wo... |
import click
import logging
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
import numpy as np
from sklearn.externals import joblib
from ..configuration import AICTConfig
import fact.io
from ..plotting import (
plot_roc,
plot_probabilities,
plot_regressor_confusion,
... |
def aiomas_parse_url(url):
"""Parse the agent *url* and return a ``((host, port), agent)`` tuple.
Raise a :exc:`ValueError` if the URL cannot be parsed.
This function is taken from the aiomas library (https://bitbucket.org/ssc/aiomas).
"""
try:
proto, addr_aid = url... |
import tensorflow as tf
import numpy as np
from layers.utils import variable_summaries, variable_with_weight_decay
from utils.misc import timeit
from utils.misc import _debug
# import torchfile
import pickle
import pdb
class RESNET18:
"""
RESNET 18 Encoder class
"""
def __init__(self, x_input,
... |
import PIL.Image
import PIL.ImageEnhance
import PIL.ImageOps
import numpy as np
import os
import random
import torch
import unittest
from transforms import *
class TransformsTest(unittest.TestCase):
def setUp(self):
self.pil_img = PIL.Image.open('test_img.jpeg')
self.np_img = np.array(self.pil_img... |
import ast
from pathlib import PurePath
import textwrap
from typing import Optional, Sequence
import traceback
import pytest # type: ignore
from pegen.grammar_parser import GeneratedParser as GrammarParser
from pegen.testutil import parse_string, generate_parser_c_extension, generate_c_parser_source
def check_inpu... |
import logging
import pytest
import random
import time
from tests.integration.aurorabridge_test.client import api
from tests.integration.aurorabridge_test.util import (
assert_keys_equal,
get_job_update_request,
get_update_status,
start_job_update,
wait_for_rolled_forward,
wait_for_update_statu... |
import math
import numpy as np
import pybullet as p
from scipy.spatial.transform import Rotation
from gym_pybullet_drones.control.BaseControl import BaseControl
from gym_pybullet_drones.envs.BaseAviary import DroneModel, BaseAviary
class DSLPIDControl(BaseControl):
"""PID control class for Crazyflies.
Based ... |
# -*- coding: utf-8 -*-
import sys
import os
import valhalla
import json
import re
def has_cyrillic(text):
"""
This is ensuring that the given text contains cyrllic characters
:param text: The text to validate
:return: Returns true if there are cyrillic characters
"""
# Note: The character r... |
import pandas as pd
import requests
import re
from bs4 import BeautifulSoup
from timeit import default_timer
import asyncio
from concurrent.futures import ThreadPoolExecutor
from threading import Thread
from queue import Empty, Queue
import signal
import sys
START_TIME = default_timer()
CLEANR = re.compile('<.*?>')
q... |
""" Dataframe optimizations """
import operator
from dask.base import tokenize
from .. import config, core
from ..blockwise import Blockwise, fuse_roots, optimize_blockwise
from ..highlevelgraph import HighLevelGraph
from ..optimization import cull, fuse
from ..utils import ensure_dict
def optimize(dsk, keys, **kwa... |
"""Illustrates the "materialized paths" pattern.
Materialized paths is a way to represent a tree structure in SQL with fast
descendant and ancestor queries at the expense of moving nodes (which require
O(n) UPDATEs in the worst case, where n is the number of nodes in the tree). It
is a good balance in terms of perform... |
# -*- coding: utf-8 -*-
"""Identity Services Engine getCSRs data model.
Copyright (c) 2021 Cisco and/or its affiliates.
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, includ... |
# -*- coding: utf-8 -*-
from django.shortcuts import get_object_or_404, render_to_response
from django.views.generic.simple import direct_to_template
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from Aluno.models import Aluno
@login_required
def minhasAva... |
import django_filters
from django.db import transaction
from django.db.models import ProtectedError, Q
from django.utils.timezone import now
from django_filters.rest_framework import DjangoFilterBackend, FilterSet
from django_scopes import scopes_disabled
from rest_framework import filters, viewsets
from rest_framework... |
from __future__ import print_function, absolute_import, division # makes KratosMultiphysics backward compatible with python 2.6 and 2.7
from KratosMultiphysics import *
from KratosMultiphysics.ContactStructuralMechanicsApplication import *
from sympy import *
from custom_sympy_fe_utilities import *
import operator
... |
from telegram.ext import Updater
from data import label_menu_data, get_label, get_korean_menu
from menu_recommend import recommend_menu
import logging
from telegram.ext import MessageHandler, Filters
from telegram.ext import CommandHandler, CallbackQueryHandler
from telegram import InlineKeyboardButton, InlineKeybo... |
#!/usr/bin/python
DOCUMENTATION = '''
module: bgp_facts
version_added: "2.0"
author: John Arnold (johnar@microsoft.com)
short_description: Retrieve BGP neighbor information from Quagga
description:
- Retrieve BGP neighbor information from Quagga, using the VTYSH command line
- Retrieved facts ... |
class Device(object):
'''
This is an object that provides information about the device making the
request.
'''
def __init__(self, device_id, supported_interfaces):
self._device_id = device_id
self._supported_interfaces = supported_interfaces
@classmethod
def create_from_jso... |
# coding: utf-8
"""
DocuSign REST API
The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign. # noqa: E501
OpenAPI spec version: v2.1
Contact: devcenter@docusign.com
Generated by: https://github.com/swagger-api/swagger-codegen.gi... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-09-11 19:06
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('customer', '0009_auto_20170911_1844'),
]
operations = [
migrations.AlterFie... |
''' index '''
from flask import Flask, render_template, redirect, url_for
from .webwarrior import Webwarrior
import pprint
app = Flask(__name__)
app.config.update(dict(
Warrior = Webwarrior(),
DEBUG = True,
))
def format_date(date):
pass
def format_tags(tags):
pass
@app.route("/")
def index():
... |
# -*- encoding: utf-8 -*-
"""
Created by eniocc at 11/10/2020
"""
import ctypes
from py_dss_interface.models import Bridge
from py_dss_interface.models.Base import Base
class RelaysV(Base):
"""
This interface can be used to read/write certain properties of the active DSS object.
The structure of the in... |
"""
Stocks API For Digital Portals
The stocks API features a screener to search for equity instruments based on stock-specific parameters. Parameters for up to three fiscal years might now be used in one request; data is available for the ten most recent completed fiscal years. Estimates are available for the... |
# Generated by Django 2.1.1 on 2018-09-13 09:00
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUT... |
# Get a package's version as a string
# https://stackoverflow.com/a/32965521/5353461
def package_version(package_name):
import pkg_resources
return pkg_resources.get_distribution(package_name).version |
__version__ = "0.5.5"
from .core import StatsForecast |
# This code is part of Qiskit.
#
# (C) Copyright IBM 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... |
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from embed_regularize import embedded_dropout
from locked_dropout import LockedDropout
from weight_drop import WeightDrop
class RNNModel_v2(nn.Module):
"""Container module with an encoder, a recurren... |
# coding: utf8
"""
题目链接: https://leetcode.com/problems/binary-tree-postorder-traversal/description.
题目描述:
Given a binary tree, return the postorder traversal of its nodes' values.
For example:
Given binary tree [1,null,2,3],
1
\
2
/
... |
# 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 ... |
#!/usr/bin/python3
"""
WARNING: The code you are about to view is DISGUSTING
I wrote most of it months ago, so don't ask me what it's doing, or why.
"""
import struct
import sys
from ctypes import *
# BEGIN ZIP FILE STRUCTURES
class LocalFileHeader(Structure):
_pack_ = 1
_fields_ = [
("magic", c_uint32),
("... |
import sqlite3
import pywikibot
import re
con = sqlite3.connect('C:/Users/nizar/Downloads/demosaurus.sqlite')
cur = con.cursor()
cur.execute("Select DISTINCT(Wikipedia.ppn), Wikipedia.identifier, Wikipedia.language from NTA inner join Wikipedia on Wikipedia.ppn = NTA.ppn inner join authorship_ggc on NTA.ppn = authorsh... |
# 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 ... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('finaid', '0009_auto_20150917_1629'),
]
operations = [
migrations.RemoveField(
model_name='financialaidapplicatio... |
from django.core.urlresolvers import reverse
from rest_framework.test import APIRequestFactory
from rest_framework_friendly_errors import settings
from tests import BaseTestCase
from tests.models import Snippet
from tests.views import SnippetList, Snippet2List, SnippetDetail
class ListViewTestCase(BaseTestCase):
... |
from flask import Flask, jsonify, request
from flask_jwt_simple import JWTManager, jwt_required, create_jwt
app = Flask(__name__)
app.config['JWT_SECRET_KEY'] = 'super-secret' # Change this!
jwt = JWTManager(app)
# Using the expired_token_loader decorator, we will now call
# this function whenever an expired but o... |
##########################################################################
# Testing of display and capture & storage thread combined.
# Scan for camera
# Aquire 14 images
# Convert to b/w
# Save hdf5 files
##########################################################################
# Results
#
#
########################... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-06-23 03:14
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('wl_applications', '0002_auto_20160610_1647'),
]
operations = [
migrations.Cr... |
import abc
from datetime import datetime
from pathlib import Path
from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Union
import pandas
import pyarrow
from tqdm import tqdm
from feast import errors, importer
from feast.entity import Entity
from feast.feature_table import FeatureTable
from feast... |
# Importing Django Models:
from django.contrib import admin
# Importing Database Base Models:
from social_media_api.model_views_seralizers.reddit_api.reddit_models import RedditPosts, RedditDevApps, RedditDevAppForm, Subreddits, RedditLogs, RedditPipeline
from .models.indeed.indeed_models import IndeedJobPosts
from .m... |
products = [
{"id":1, "name": "Chocolate Sandwich Cookies", "department": "snacks", "aisle": "cookies cakes", "price": 3.50},
{"id":2, "name": "All-Seasons Salt", "department": "pantry", "aisle": "spices seasonings", "price": 4.99},
{"id":3, "name": "Robust Golden Unsweetened Oolong Tea", "department": "bev... |
#!/usr/bin/python
from nagioscheck import NagiosCheck, UsageError
from nagioscheck import PerformanceMetric, Status
import urllib2
import optparse
try:
import json
except ImportError:
import simplejson as json
class ESNodesCheck(NagiosCheck):
def __init__(self):
NagiosCheck.__init__(self)
... |
# -*- coding: utf-8 -*-
#
# Copyright (C)2006-2009 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://trac.edgewall.org/wiki/TracLicense.
#
# This software consis... |
"""CmdStan method generate_quantities tests"""
import os
import unittest
from pandas.testing import assert_frame_equal
from cmdstanpy.cmdstan_args import Method
from cmdstanpy.model import CmdStanModel
HERE = os.path.dirname(os.path.abspath(__file__))
DATAFILES_PATH = os.path.join(HERE, 'data')
class GenerateQuant... |
"""Titiler middlewares."""
import logging
import re
import time
from typing import Optional, Set
from fastapi.logger import logger
from starlette.middleware.base import BaseHTTPMiddleware
from starlette.requests import Request
from starlette.types import ASGIApp
class CacheControlMiddleware(BaseHTTPMiddleware):
... |
from typing import Annotated
import cv2 as cv
def track_motion(frame, mask, initial_track_window = ()):
'''
This module takes frame and mask arguments.
Frame is a frame from a video src.
The mask is the area of a motion on the video frame.
From these information, the module will track the object on... |
#!/usr/bin/env python
# Copyright 2017 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.
"""//testing/scripts wrapper for the network traffic annotations checks.
This script is used to run check_annotations.py on the trybots... |
# -*- coding: UTF-8 -*-
import requests
import config
import json
class Crawl(object):
def _transparent(self, page=1):
raise NotImplementedError
def _anonymous(self, page=1):
raise NotImplementedError
def _http(self):
raise NotImplementedError
def _https(self):
raise... |
"""
box_text_line_instances.py
"""
population = [
# SE Simple data boxes
{'Metadata': 'Title', 'Box': 5, 'Title block pattern': 'SE Simple', 'Order': 1},
{'Metadata': 'Organization', 'Box': 3, 'Title block pattern': 'SE Simple', 'Order': 1},
{'Metadata': 'Author', 'Box': 6, 'Title block pattern': 'SE Si... |
# coding=utf-8
stock_list = ['000839', '', '', ''] |
from block_viewer.utils import decode_uint64
from block_viewer.utils import decode_varint
from block_viewer.script import Script
from binascii import b2a_hex
class Output(object):
def __init__(self,
value=None,
txout_script_length=None,
script_pubkey=None):
... |
import argparse
import io
import sys
from ghapi.all import GhApi
import pylint.lint
from pylint.__pkginfo__ import __version__ as pl_version
def run_pylint(directory):
saved_stdout = sys.stdout
sys.stdout = io.StringIO()
result = pylint.lint.Run([directory], exit=False)
output = sys.stdout.getvalue()... |
#!/usr/bin/python
import smtplib, ssl, email,os,socket
from email import encoders
from email.mime.base import MIMEBase
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
import re
def sendBatchEmail(password):
smtp_server = "smtp.gmail.com" ##dont touch
port = 587 ##dont touch
... |
import numpy as np
import collections
def _xv_from_uni(xi,zmax,gct):
"""
Generate a z vertex displacement from a uniform random variable
both zmax and gct should be in cm
"""
if xi > 0.:
return gct*np.log(xi) + zmax
else:
return -100.*zmax
xv_from_uni = np.vectorize(_xv_fr... |
from airflow import DAG
from airflow.operators.bash_operator import BashOperator
from airflow.operators.python_operator import PythonOperator, BranchPythonOperator
from datetime import datetime, timedelta
import zipfile
import random
import pandas as pd
default_args = {
'owner': 'Neylson Crepalde',
"depends_on... |
try: import ijson.backends.yajl2_c as ijson
except: import ijson
from datetime import datetime, timedelta, date
from warnings import warn
from bs4 import BeautifulSoup
from copy import copy
from tempfile import TemporaryDirectory
import pykakasi
import requests
import iso8601
import json
import csv
import io
import os... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# This material is part of "The Fuzzing Book".
# Web site: https://www.fuzzingbook.org/html/Intro_Testing.html
# Last change: 2019-10-19 14:04:52+02:00
#
#!/
# Copyright (c) 2018-2019 Saarland University, CISPA, authors, and contributors
#
# Permission is hereby granted, ... |
import string
import random
symbols=[]
symbols=list(string.ascii_letters)
card1=[0]*5
card2=[0]*5
pos1=random.randint(0,4)
pos2=random.randint(0,4)
samesymbol=random.choice(symbols)
symbols.remove(samesymbol)
if(pos1==pos2):
card2[pos1]=samesymbol
card1[pos1]=samesymbol
else:
card1[pos1]=samesymbol
card... |
# Copyright 2018, The TensorFlow Federated 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 applicable law o... |
import os
import json
import gramex.ml
import pandas as pd
import gramex.cache
import gramex.data
from gramex.handlers import BaseHandler
import tornado.escape
class ModelHandler(BaseHandler):
'''
Allows users to create API endpoints to train/test models exposed through Scikit-Learn.
TODO: support Scikit-... |
from __future__ import unicode_literals
import datetime
from boto.ec2.elb.attributes import (
LbAttributes,
ConnectionSettingAttribute,
ConnectionDrainingAttribute,
AccessLogAttribute,
CrossZoneLoadBalancingAttribute,
)
from boto.ec2.elb.policies import Policies, OtherPolicy
from moto.compat import... |
# Generated by Django 2.2.5 on 2020-09-24 01:41
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='BookInfo',
fields=[
... |
# Functions performing various input/output operations for the ChaLearn AutoML challenge
# Main contributors: Arthur Pesah and Isabelle Guyon, August-October 2014
# ALL INFORMATION, SOFTWARE, DOCUMENTATION, AND DATA ARE PROVIDED "AS-IS".
# ISABELLE GUYON, CHALEARN, AND/OR OTHER ORGANIZERS OR CODE AUTHORS DISCLAIM
# A... |
# coding: utf-8
# Python libs
from __future__ import absolute_import, print_function, unicode_literals
import os
import shutil
import tempfile
import time
# Salt libs
import salt.utils.files
import salt.utils.platform
from salt.beacons import watchdog
from salt.ext.six.moves import range
from tests.support.mixins im... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import json
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from .. import utilities, tables
class Virtua... |
# -----------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# -----------------------------------------------------------------------------
# ... |
from typing import Generator, Optional, Sequence, List, Iterable
try:
import spacy
from spacy.language import Language
from spacy.tokens import Doc
from spacy.tokens import Span
except ImportError as e:
if e.name == "spacy":
raise ImportError(
"Could not find module 'spacy'. If ... |
# Copyright (c) 2016-2021, Thomas Larsson
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions... |
#!/usr/bin/env python3
from vosk import Model, KaldiRecognizer
import os
import pyaudio
import requests
import json
voice_model = "medium_model_nl"
if not os.path.exists(voice_model):
print(
f"Please download the model from https://alphacephei.com/vosk/models and unpack as {voice_model} in the current fo... |
import unittest
import numpy as np
from nlpatl.sampling.certainty import MostConfidenceSampling
class TestSamplingConfidence(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.data = np.array(
[
[0.01689184, 0.02989921, 0.92348951, 0.0158317, 0.01388775],
... |
import unittest
class TestRunnable(unittest.TestCase):
def test_almeq(self):
#(first, second, places=7, msg=None, delta=None)
self.assertAlmostEqual(1.0, 1.00000001, 7)
self.assertAlmostEqual(1.0, 1.00000001, 7, '''comment test''')
self.assertAlmostEqual(1.0, 1.00000001, msg='''com... |
import os
import sys
import gym
import numpy as np
import torch
from gym.spaces.box import Box
from baselines import bench
from baselines.common.atari_wrappers import make_atari, wrap_deepmind
from baselines.common.vec_env import VecEnvWrapper
from baselines.common.vec_env.dummy_vec_env import DummyVecEnv
from baselin... |
#!/usr/bin/env python2
# Copyright (c) 2016 Bitcoin Core Developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# This script will locally construct a merge commit for a pull request on a
# github repository, inspect it, sign ... |
import sys
import copy
from enum import IntEnum, auto
import tkinter as tk
from tkinter import simpledialog, Label
import itertools
import cv2.cv2 as cv
import numpy as np
from PIL import Image, ImageTk
from shapely import geometry
from simulator import image_tools, win32_tools
from notebook.azurlane import *
import... |
from collections import namedtuple
import numpy as np
from jesse.helpers import get_candle_source, np_shift, slice_candles
AG = namedtuple('AG', ['jaw', 'teeth', 'lips'])
def alligator(candles: np.ndarray, source_type: str = "close", sequential: bool = False) -> AG:
"""
Alligator
:param candles: np.nd... |
#!/usr/bin/env python
# Author: Sergey Trofimovsky <troff@paranoia.ru>
# (c) 2016
#
# License: BSD
"""Maintain rolling snapshots for EBS volumes
Usage::
$ makesnap3.py {hour|day|week|month|year}
"""
import argparse
import boto3
import sys
import re
import os
import time
import json
import logging
from datetime i... |
# -*- coding: utf-8 -*-
from django.conf.urls import url
from .views import (activity_details, activity_details_filtered, competition_details, forfeit, join,
lan_compos, lan_list, leave, main, register_score, schedule, start_compo, submit_score)
urlpatterns = [
# Main comp oversight
url(... |
import json
import random
from time import sleep
import uuid
from django.conf import settings
from django.contrib.postgres.fields import ArrayField, JSONField
from django.db import models
from django.utils import timezone
from requests.exceptions import HTTPError
from TwitterAPI import TwitterPager
from .constants impo... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from __future__ import print_function
import os
import sys
import json
import numpy
import pandas as pd
from elasticsearch_dsl import Search, Q
from elasticsearch import Elasticsearch
import spacy
try:
nlp
except NameError:
nlp = spacy.load('en_c... |
#!/usr/bin/python3
import willie
@willie.module.commands('helloworld')
def helloworld(bot, trigger):
bot.say('Hello, world!') |
import time
from HABAppTests.test_rule._rest_patcher import RestPatcher
from HABAppTests.test_rule.test_case import TestResult, TestResultStatus
class TestCase:
def __init__(self, name: str, func: callable, args=[], kwargs={}):
self.name = name
self.func = func
self.args = args
se... |
"""
Module for 'server-side' state during testing. This module should contain
methods for altering said server-side state, which then are responsible for triggering
a ``parse_*`` call in the configured client state to inform the bot of the change.
This setup matches discord's actual setup, where an HTT... |
import numpy as np
from jbdl.experimental.contact import calc_contact_jacobian_core
from jbdl.experimental.contact.calc_contact_jacobian import calc_contact_jacobian_core_jit_flag
from jbdl.experimental.contact.calc_contact_jdot_qdot import calc_contact_jdot_qdot_core
from jbdl.experimental.contact.calc_contact_jdot_qd... |
# Copyright 2021 Tianmian Tech. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... |
import router
class CacheConfig(object):
ALL = 'all'
return_all = False
def __init__(self, values, instance_values):
self.values = values and values or []
self.instance_values = instance_values and instance_values or []
class CacheGroup(object):
"""
Tracks versions for a collecti... |
"""
Reportes genéricos, preconfigurados para su uso.
"""
from django import forms
from django.utils.translation import gettext as _
from django.urls import reverse_lazy
from fuente import var
from fuente.report.base import (Report, ModelReport, ReportDoesNotExist,
ReportLocked, Total, TotalFor)
from fuente.report... |
# encoding: utf-8
"""
Utilities for working with strings and text.
Inheritance diagram:
.. inheritance-diagram:: IPython.utils.text
:parts: 3
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2008-2011 The IPython Development Team
#
# Distributed under the terms... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.