text stringlengths 1 927k |
|---|
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import math
from functools import partial
__all__ = [
'ResNet', 'resnet10', 'resnet18', 'resnet34', 'resnet50', 'resnet101',
'resnet152', 'resnet200'
]
def conv3x3x3(in_planes, out_planes, stride=1):
# ... |
from itertools import chain
from AnkiTools import AnkiConnect as ac
import re
from analyze.user_db import User
from analyze.tag import HskVocab, Category, HanziLevelProject
from analyze.lookup import Cedict, SpoonFed
class AnkiConnect():
def __init__(self):
self.user = User()
self.hsk = HskVocab(... |
import FWCore.ParameterSet.Config as cms
from PhysicsTools.PatAlgos.slimming.packedPFCandidates_cff import *
from PhysicsTools.PatAlgos.slimming.isolatedTracks_cfi import *
from PhysicsTools.PatAlgos.slimming.lostTracks_cfi import *
from PhysicsTools.PatAlgos.slimming.offlineSlimmedPrimaryVertices_cfi import *
from Ph... |
from datetime import datetime
from django.conf import settings
from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager
from django.db import models
from django.utils.dateparse import parse_datetime
from rest_framework.authtoken.models import Token
from utils.auth import encrypt_email, many_hashes
... |
#!/usr/bin/python
import sys
from mininet.net import Mininet
from mininet.node import Controller, RemoteController, OVSController
from mininet.node import CPULimitedHost, Host, Node
from mininet.node import OVSKernelSwitch, UserSwitch
from mininet.node import IVSSwitch
from mininet.cli import CLI
from mininet.log impor... |
# -*- coding: utf-8 -*-
"""The arguments helper for the VirusTotal analysis plugin."""
from plaso.lib import errors
from plaso.cli.helpers import interface
from plaso.cli.helpers import manager
from plaso.analysis import virustotal
class VirusTotalAnalysisHelper(interface.ArgumentsHelper):
"""CLI arguments helper ... |
from sklearn import tree
from sklearn.datasets import load_wine
from sklearn.model_selection import train_test_split
from sklearn.metrics import classification_report
wine = load_wine()
data = wine.data
target = wine.target
X_train, X_test, Y_train, Y_test = train_test_split(data, target, test_size=0.2, random_state=0... |
# coding: utf-8
import os
import sys
import xbmc
import xbmcgui
import xbmcplugin
import xbmcaddon
import urllib
import urllib2
import re
from stats import *
import HTMLParser
import xml.etree.ElementTree as ET
import email.utils as eut
import time
import json
reload(sys)
sys.setdefaultencoding("utf-8")
_rssUrl_ = 'h... |
# Copyright (C) 2018 [SD]RSiX Project
#
# 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 writ... |
from typing import List
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
sns.set(style="whitegrid")
from compare_forecasting_methods import pred_lengths
def to_query(
elements: List[str],
):
if len(elements) == 1:
return elements[0]
else:
return '(' + ' or '.join(... |
#!/usr/bin/env python
import sys
import argparse
import multiprocessing
import logging
import vcf
import random
import math
import pysam
def annotate_vcfs(bam, chromosomes, vcfs):
func_logger = logging.getLogger("%s-%s" % (annotate_vcfs.__name__, multiprocessing.current_process()))
random.seed(0)
# Load ... |
class Planner(object):
"""
Base class for path planning algorithms.
"""
def plan(self, start, goal, env):
"""Plan path from start to goal in given environment.
This method needs to be implemented in the specific path planner.
Args:
start (gennav.utils.common.R... |
import os
import logging
from interspeechmi.standalone_utils import full_path
from pathlib import Path
REPO_DIR = Path(os.path.dirname(full_path(__file__))).parent.parent.parent
WANDB_LOGS_DIR_PARENT_DIR = str(REPO_DIR)
INTERSPEECHMI_CODE_DIR = os.path.join(REPO_DIR, "interspeechmi")
TMP_FILES_DIR = os.path.join(REPO_... |
# 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 ... |
# SPDX-License-Identifier: Apache-2.0
#
# The OpenSearch Contributors require contributions made to
# this file be licensed under the Apache-2.0 license or a
# compatible open source license.
import logging
from ci_workflow.ci_check_package import CiCheckPackage
class CiCheckNpmPackageVersion(CiCheckPackage):
@... |
# -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.base.exchange import Exchange
import hashlib
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import ArgumentsReq... |
# 1. Strange Zoo
# You are at the zoo and the meerkats look strange. You will receive 3 strings: (tail, body, head).
# You have to re-arrange the elements in a list, so that the animal looks normal again: (head, body, tail)
tail = input()
body = input()
head = input()
zoo = [head, body, tail]
print(zoo) |
# -*- coding: utf-8 -*-
#
# pynsq documentation build configuration file, created by
# sphinx-quickstart on Sun Jun 16 16:18:30 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All c... |
from . import AnimClip
from . import AnimClips
from . import BackpackLights
from . import BodyMotion
from . import Event
from . import FaceAnimation
from . import HeadAngle
from . import Keyframes
from . import LiftHeight
from . import ProceduralFace
from . import RecordHeading
from . import RobotAudio
from . import Tu... |
# Copyright 2020 The Kubeflow 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 or agreed to in... |
#!/usr/bin/env python3
"""Install WordPress plugins and themes from various locations."""
import atexit
import getopt
import io
import json
import os
import re
import requests
import shutil
from six import string_types
import subprocess
import sys
import tempfile
import yaml
from zipfile import ZipFile
import operato... |
class Config(object):
DEBUG = False
TESTING = False
class ProductionConfig(Config):
HOST = "MartinChan.mysql.pythonanywhere-services.com"
USER = "MartinChan"
PASSWORD = "Aweki2235zxc"
DATABASE = "MartinChan$cookbook"
class DevelopmentConfig(Config):
DEBUG = True
HOST = "localhost"
USER = "root"
PASSWORD = "... |
import numpy as np
import torch
import torch.nn.functional as F
import torch.nn as nn
# check if gpu is available
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
class Flatten(nn.Module):
"""
performs the flatten operation
"""
def forward(self, input):
return input.view... |
"""Utilities for loading computed diagnostics
"""
import json
from typing import Iterable, Hashable, Sequence, Tuple, Any, Set, Mapping
import os
import xarray as xr
import numpy as np
import fsspec
import pandas as pd
from pathlib import Path
from dataclasses import dataclass
import tempfile
from .metrics import met... |
from elasticsearch_sdk.elasticsearcher import ElasticSearcher
from pusher_push_notifications import PushNotifications
from configparser import ConfigParser
import os
import logging
class Module:
def __init__(self):
self.elk_controler = self.init_elastic()
self.init_pusher()
self.logger =... |
from geomeppy import IDF
IDF.setiddname('/Applications/EnergyPlus-8-8-0/Energy+.idd')
idf = IDF('/Users/soroush/Desktop/Noumena/bcn-energy/src/gh_template.idf')
idf.epw = '/Users/soroush/Desktop/Noumena/bcn-energy/src/ESP_Barcelona.081810_IWEC.epw'
constructions = idf.getobject("CONSTRUCTION",
... |
"""
Django settings for mwach project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# This is the name of the application shown in the title and on login and va... |
import pytest
import numpy as np
from numpy.testing import assert_array_almost_equal, assert_array_equal, assert_allclose
from sklearn.datasets import load_linnerud
from sklearn.cross_decomposition._pls import (
_center_scale_xy,
_get_first_singular_vectors_power_method,
_get_first_singular_vectors_svd,
... |
class ExportError(Exception):
"""Raised when export fails"""
class TableNotFoundError(Exception):
"""Raised when configured table doesn't exist in source"""
class MongoDBInvalidDatetimeError(Exception):
"""Raised when a bson datetime is invalid and cannot be serialized"""
class UnsupportedKeyTypeExceptio... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import base64
import io
import os
import sys
try:
from mock import patch
except ImportError:
from unittest.mock import patch # noqa
from unittest import skipIf, skipUnless
from django.conf import settings
from django.test import TestCase
from ... |
"""
Evolves two stars dynamically (hermit, nbody code) each star will
lose mass during the evolution (evtwin, stellar evolution code)
We start with two stars, one 10.0 and one 1.0 solar mass star. These
stars start orbiting with a stable kepler orbit.
After 2 orbital periods the stars will begin to lose mass and the... |
import random
from turtle import Turtle, Screen
screen = Screen()
screen.setup(width=500, height=400)
screen.title("Welcome to the Turtle Game")
colors = ["red", "blue", "green", "yellow", "orange", "purple"]
y_pos = [-70, -40, -10, 20, 50, 80]
all_turtles = []
is_race_on = True
for i in range(len(colors)):
ne... |
import cv2
def take_picture(filePath):
# Camera 0 is the integrated web cam on my netbook
camera_port = 0
#Number of frames to throw away while the camera adjusts to light levels
ramp_frames = 30
# Now we can initialize the camera capture object with the cv2.VideoCapture class.
# ... |
"""Device tracker support for OPNSense routers."""
import logging
from homeassistant.components.device_tracker import DeviceScanner
from homeassistant.components.opnsense import CONF_TRACKER_INTERFACE, OPNSENSE_DATA
_LOGGER = logging.getLogger(__name__)
async def async_get_scanner(hass, config, discovery_info=None)... |
# Copyright 2017-present Kensho Technologies, LLC.
"""Front-end for GraphQL to database queries compiler.
High-level overview of the GraphQL ingestion process that outputs the compiler's
internal representation (IR) via the graphql_to_ir() function:
- The function receives a GraphQL string and a GraphQL schema.
... |
from abc import abstractmethod
from functools import reduce
from itertools import combinations, accumulate, repeat, product, chain
from networkx import has_path
from typing import List, Union, Tuple, cast, Any, Dict, Set
from math import ceil
from sweetpea.backend import BackendRequest
from sweetpea.internal import ge... |
#!/usr/bin/env python
# Lint as: python3
"""This is the GRR client for thread pools."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import base64
import logging
import threading
import time
from absl import app
from absl import flags
# pylint: disabl... |
# coding: utf-8
import io
import os
import sys
import unittest
import copy
import pickle
from itertools import permutations
from ast import literal_eval
from monty.serialization import dumpfn, loadfn
from networkx.readwrite import json_graph
from pymatgen.util.testing import PymatgenTest
from pymatgen.core.structure ... |
from yaaredis.utils import bool_ok, dict_merge, list_keys_to_dict, nativestr, NodeFlag
SENTINEL_STATE_TYPES = {
'can-failover-its-master': int,
'config-epoch': int,
'down-after-milliseconds': int,
'failover-timeout': int,
'info-refresh': int,
'last-hello-message': int,
'last-ok-ping-reply':... |
# !/usr/bin/python
"""
Copyright ©️: 2020 Seniatical / _-*™#7519
License: Apache 2.0
A permissive license whose main conditions require preservation of copyright and license notices.
Contributors provide an express grant of patent rights.
Licensed works, modifications, and larger works may be distributed under differe... |
from .call import call |
# %%
import os
import numpy as np
import pandas as pd
import flask
from flask import Flask, jsonify, request, make_response
import tensorflow as tf
from evprediction import convert_to_array
# %%
# Load saved model
# model_path = os.path.abspath(os.path.join(os.getcwd(), 'models'))
model_name = 'evmodel.h5'
model = t... |
# Bayesian Binary logistic regression in 2d for iris flwoers
# Code is based on
# https://github.com/aloctavodia/BAP/blob/master/code/Chp4/04_Generalizing_linear_models.ipynb
import superimport
import pymc3 as pm
import numpy as np
import pandas as pd
import theano.tensor as tt
#import seaborn as sns
import scipy.s... |
# Copyright (c) 2019 Microsoft Corporation
# Distributed under the MIT software license
from ..internal import Native, NativeEBMBooster
import numpy as np
import ctypes as ct
from contextlib import closing
def test_booster_internals():
with closing(
NativeEBMBooster(
model_type="classificatio... |
#!/usr/local/bin/python3
"""
Copyright (c) 2019-2020 Ad Schellevis <ad@opnsense.org>
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 th... |
import numpy as np
import theano
import theano.tensor as T
# import matplotlib
# matplotlib.use('Agg')
import matplotlib.pyplot as plt
B = 10
F = 110 * 110 * 3
C = 20
# shape: C x F/2
permutations = []
indices = np.arange(F / 2)
for i in range(C):
np.random.shuffle(indices)
permutations.append(np.concatenate(... |
#!/usr/bin/env python
"""
TCP Windows sockets with netstat
"""
# Many advantages compared to psutil:
# The Python module psutil is not needed
# psutil gives only sockets if the process is accessible.
# It is much faster.
# On the other it is necessary to run netstat in the shell.
import re
import sys
import so... |
import configparser
from adapter_entity_typing.network_classes.classifiers import EarlyStoppingWithColdStart
from torch.utils.data.dataloader import DataLoader
from adapter_entity_typing.network import load_model
from collections import defaultdict
import torch
import json
import numpy as np
from tqdm import tqdm
impo... |
import os
import imagebot as imgbot
from cv2 import *
# initialize the camera
cam = VideoCapture(0) # 0 -> index of camera
s, img = cam.read()
if s: # frame captured without any errors
# namedWindow("cam-test",CV_WINDOW_AUTOSIZE)
imshow("cam-test",img)
waitKey(0)
destroyWindow("cam-test")
imwrit... |
#
# Copyright 2016 Dohop hf.
#
# 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, ... |
import sys
sys.path.insert(0, '../linked_list')
from link_list import LinkList # noqa E402
import json # noqa E402
class HashTable():
# Big O time == O(1)
# :: worst case is O(n), if small hash array or terrible collisions
# storage for HashTable
_data = []
def __init__(self, hashtableSize=102... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib.auth.mixins import LoginRequiredMixin, PermissionRequiredMixin
from django.core.urlresolvers import reverse_lazy
from django.http import HttpResponseRedirect
from django.utils import timezone
from django.utils.encoding import force_tex... |
import asyncio
import time
"""
"""
async def main():
def consuming(delay):
time.sleep(delay)
print("time consuming....")
# 在不同一线程中, 执行 blocking code
# TODO: 这里也可以直接使用 Thread 对象执行任务。
ft = loop.run_in_executor(None, consuming, 5)
ft1 = loop.run_in_executor(None, consuming, 5)
... |
'''
Defines the set of symbols used in text input to the model.
The default is a set of ASCII characters that works well for English or text that has been run
through Unidecode. For other data, you can modify _characters. See TRAINING_DATA.md for details.
'''
from . import cmudict
_pad = '_'
_eos = '~'
... |
#!/usr/bin/env python
import io
import os.path
import glob
from enum import IntEnum
from typing import *
import struct
import sys
# Primal metadata parser that simply shreds into regions for analysis
# this likely wont be useful beyond the reverse engineering of this format or
# when new variations occur, you probably... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Jun 3 19:06:31 2019
@author: sercangul
"""
import math
import os
def factorial(n):
return math.factorial(n)
if __name__ == '__main__':
fptr = open(os.environ['OUTPUT_PATH'], 'w')
n = int(input())
result = factorial(n)
fptr.writ... |
import PyPDF2
def getTextFromPDF(PDFIn):
pdfReader = PyPDF2.PdfFileReader(PDFIn)
s = ""
for i in range(0, pdfReader.numPages):
page = pdfReader.getPage(i)
s += page.extractText()
return PDFIn |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: yandex/cloud/apploadbalancer/v1/tls.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _re... |
import pytest
from service.common.login import LoginPage
"""
function:每一个函数或方法都会调用
class:每一个类调用一次,一个类可以有多个方法
module:每一个.py文件调用一次,该文件内又有多个function和class
session:是多个文件调用一次,可以跨.py文件调用,每个.py文件就是module
"""
@pytest.fixture()
def session(page):
return LoginPage(page).login(
username='18886885',
password... |
"""
This file is part of spinsys.
Spinsys is free software: you can redistribute it and/or modify
it under the terms of the BSD 3-clause license. See LICENSE.txt
for exact terms and conditions.
"""
import numpy as np
class TimeMachine():
def __init__(self, eigvs, eigvecs, psi):
"""
Time evolves... |
import matplotlib
import sys
import json
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
import matplotlib.axes as axes
import numpy as np
import sklearn.decomposition
import sklearn.preprocessing
from sklearn.manifold import TSNE
COLOR_MAP = plt.cm.gist_rainbow
SEED = 0x37255c25
USE_TSNE = True... |
#jogo da velha para terminal
import random
def drawBoard(board):
# Esta funcao imprime o tabuleiro do jogo
#"board" e uma lista de 12 strings representando o tabuleiro (ignorando o indice 0)
print(' ' + board[7] + ' | ' + board[8] + ' | ' + board[9])
print('===========')
print(' ' + board[4] + ' |... |
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the wallet."""
from test_framework.test_framework import BitcoinTestFramework
from test_framework.... |
# pylint: disable=R1732
"""
Tests for cumulus-message-adapter
"""
import os
import json
import unittest
from mock import patch
from jsonschema.exceptions import ValidationError
from message_adapter import aws, message_adapter
class Test(unittest.TestCase): # pylint: disable=too-many-public-methods
# pylint: disa... |
"""syntaxhighlighters module.
contains some custom syntax highlighers
"""
from .highlightrule import HighlightRule
from .jsonhighlighter import JsonHighlighter
from .pythonhighlighter import PythonHighlighter
from .yamlhighlighter import YamlHighlighter
from .xmlhighlighter import XmlHighlighter
from .regexmatchhighl... |
# Generated by Django 2.2.6 on 2019-11-03 17:14
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Buyer',
fields=[
('id', models.AutoField(au... |
import os
import sys
import stat
import select
import time
import errno
try:
InterruptedError
except NameError:
# Alias Python2 exception to Python3
InterruptedError = select.error
if sys.version_info[0] >= 3:
string_types = (str,)
else:
string_types = (unicode, str)
def is_executable_file(path)... |
#!/usr/bin/python
#-----------------------------------------------------
# This program find median per key using
# the reduceByKey() transformation.
#
# To find median(values), we use Python's statistics package:
#
# >>> # Import statistics Library
# >>> import statistics
# >>>
# >>> # Calculate middle values
# >>> pr... |
import os
import sys
from django.apps import AppConfig
class AppConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'app'
def ready(self):
from app.models import AlertScheme, MAX_MINUTES_NO_METADATA, MAX_TERMINATED_CONNECTIONS_PER_HOUR, \
MAX_MINUTES_NO_IN... |
# Time: O(1)
# Space: O(1)
#
# Determine whether an integer is a palindrome. Do this without extra space.
#
# Some hints:
# Could negative integers be palindromes? (ie, -1)
#
# If you are thinking of converting the integer to string, note the restriction of using extra space.
#
# You could also try reversing an int... |
# Copyright (c) Facebook, Inc. and its affiliates.
import unittest
import tests.test_utils as test_utils
import torch
from VisualBERT.mmf.common.sample import Sample, SampleList
from VisualBERT.mmf.models.mmbt import MMBT
from VisualBERT.mmf.modules.encoders import (
ImageEncoderFactory,
ImageEncoderTypes,
... |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
OpenAPI spec version: v1.13.5
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import unittest
import kube... |
# For each of the following expressions, select the order of growth class that
# best describes it from the following list: O(1) O(log(n)), O(n), O(n log (n)),
# O(nc) or O(cn. Assume c is some constant.
# 0.0000001n + 1000000
# O(n)
# 0.0001n2 + 20000n - 90000
# O(n^c)
# 20n + 900log(n) + 100000
# O(n)
# (log(n))2... |
from hc.api.models import Channel, Check
from hc.test import BaseTestCase
class ApiAdminTestCase(BaseTestCase):
def setUp(self):
super(ApiAdminTestCase, self).setUp()
self.check = Check.objects.create(user=self.alice, tags="foo bar")
# Set Alice to be staff and superuser
self.ali... |
import gym
from gym import spaces
import numpy as np
from gym.envs.wlan import env_simulated as env
from gym.envs.wlan import thought_out as tho
from gym.utils import seeding
class ApEnv(gym.Env):
def __init__(self):
self.Num_AP = 1
self.Num_UE = 50
self.channel = [1]
self.oriTHO =... |
#!/usr/bin/env python3
"""
helpers.py
Helpers functions for analyze_pahs.py
"""
import errno
import os
import pickle
import matplotlib.gridspec as gridspec
import matplotlib.pyplot as plt
import numpy as np
from gaussfitter import onedgaussian, multigaussfit
from scipy.integrate import simps
from mattpy.utils impor... |
# -*- coding: utf-8 -*-
# Copyright (c) 2010 Mark Sandstrom
# Copyright (c) 2011-2013 Raphaël Barrois
#
# 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 ... |
"""
Copyright (c) 2022 Huawei Technologies Co.,Ltd.
openGauss is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, W... |
# -*- encoding: utf-8 -*-
"""图算法
Some of description...
""" |
from setuptools import setup, find_packages
setup(
name='file_separator',
version='0.1.0',
license='mit',
description='Separate python mudule',
author='Tomoya Yoshikawa',
author_email='yoshikawat.64m@gmail.com',
url='None.com',
packages=find_packages(where='src'),
package_dir={'':... |
#!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Exercise API with -disablewallet.
#
from test_framework.test_framework import BTSTestFramework
from ... |
"""
``KnowledgeGraphField`` is a ``Field`` which stores a knowledge graph representation.
"""
from typing import Callable, Dict, List, Set
from collections import defaultdict
import editdistance
from overrides import overrides
import torch
from allennlp.common import util
from allennlp.common.checks import Configurat... |
#!/usr/bin/env python3
"""
See http://www.guidetopharmacology.org/webServices.jsp
"""
import sys,os,re,argparse,time,logging,urllib.parse,json
#
from .. import iuphar
#
API_HOST='www.guidetopharmacology.org'
API_BASE_PATH='/services'
#
#############################################################################
if __n... |
import hashlib
m = hashlib.md5()
m.update(b"message for cryptographic signature")
print(m.digest()) |
import io
import re
from setuptools import setup
import os
import shutil
try:
os.remove(os.path.join('make_colors', '__version__.py'))
except:
pass
shutil.copy2('__version__.py', 'make_colors')
with io.open("README.rst", "rt", encoding="utf8") as f:
readme = f.read()
# with io.open("__version__.py", "rt"... |
"""
Unit tests for the wavefunction simulator device.
"""
import logging
import pytest
import pennylane as qml
from pennylane import numpy as np
from conftest import BaseTest
from conftest import I, Z, H, U, U2, SWAP, CNOT, U_toffoli, H, test_operation_map
import pennylane_forest as plf
log = logging.getLogger(__... |
import itertools
import json
from itertools import product
import networkx as nx
import pandas as pd
from networkx.algorithms.dag import topological_sort
from pybbn.graph.dag import Bbn
from pybbn.graph.edge import Edge, EdgeType
from pybbn.graph.node import BbnNode
from pybbn.graph.variable import Variable
class F... |
from ctypes import POINTER, c_char_p, c_double, c_int, c_void_p
from django.contrib.gis.gdal.envelope import OGREnvelope
from django.contrib.gis.gdal.libgdal import lgdal
from django.contrib.gis.gdal.prototypes.errcheck import check_envelope
from django.contrib.gis.gdal.prototypes.generation import (
const_string_... |
#!/usr/bin/python3
import tkinter as tk
from tkinter import messagebox as msg
from tkinter.ttk import Notebook
from tkinter import ttk
import tkinter.font as font
import requests
class LanguageTab(tk.Frame):
def __init__(self, master, lang_name, lang_code):
super().__init__(master)
# fonts for ... |
import os
import re
import base64
import json
from collections import OrderedDict
from pathlib import Path
from setup_app.pylib.pyDes import triple_des, ECB, PAD_PKCS5
from setup_app import paths
from setup_app import static
from setup_app.config import Config
class Crypto64:
def get_ssl_subject(self, ssl_fn):... |
from collections import defaultdict, namedtuple
import logging
import numpy as np
import queue
import threading
import time
from ray.util.debug import log_once
from ray.rllib.evaluation.episode import MultiAgentEpisode, _flatten_action
from ray.rllib.evaluation.rollout_metrics import RolloutMetrics
from ray.rllib.eval... |
#!/usr/bin/python
# encoding: utf-8
#pylint: disable=R0904
""" The eaglexml parser test class """
# upconvert - A universal hardware design file format converter using
# Format: upverter.com/resources/open-json-format/
# Development: github.com/upverter/schematic-file-converter
#
# Copyright 2011 Upverter, Inc.... |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals, print_function
import frappe, os, json
from frappe.modules import get_module_path, scrub_dt_dn
from frappe.utils import get_datetime_str
from frappe.model.base_document import g... |
import unittest
from dataclasses import dataclass
from typing import Dict, List, Optional, Tuple
from melati.util.ints import uint8
from melati.util.type_checking import is_type_List, is_type_SpecificOptional, strictdataclass
class TestIsTypeList(unittest.TestCase):
def test_basic_list(self):
a = [1, 2, ... |
#!/usr/bin/env python
import json, sys
from vive_provider import *
from vive_bullet import BulletViewer
from utils import rigid_transform_3D
vp = Vive_provider(enableButtons=True)
# Loading field positions to use for calibration
fileName = 'fieldPositions.json'
if len(sys.argv) > 1:
fileName = sys.argv[1]
f = ope... |
import torch
import torch.nn as nn
from torch.optim import Adam
from torch.utils.data import DataLoader
from ..model import BERTLM, BERT
from .optim_schedule import ScheduledOptim
import tqdm
import numpy
def hook(arr, l, iNo):
def trace(module, input, output):
if iNo:
cid = input[0].get_devi... |
#!/home/randomizer/PycharmProjects/monKeyLinux/venv/bin/python
# $Id: rst2odt.py 5839 2009-01-07 19:09:28Z dkuhlman $
# Author: Dave Kuhlman <dkuhlman@rexx.com>
# Copyright: This module has been placed in the public domain.
"""
A front end to the Docutils Publisher, producing OpenOffice documents.
"""
import sys
try... |
"""
Potential Field based path planner
author: Atsushi Sakai (@Atsushi_twi)
Ref:
https://www.cs.cmu.edu/~motionplanning/lecture/Chap4-Potential-Field_howie.pdf
"""
import numpy as np
import matplotlib.pyplot as plt
# Parameters
KP = 5.0 # attractive potential gain
ETA = 100.0 # repulsive potential gain
AREA_WID... |
import random
import math
class Annealing:
def __init__(self, rectangles):
self.rectangles = rectangles
self.temperature = 1.0
# TODO how to set/configure these parameters in a smarter way
self.magnitude = 10
self.rounds = 5000
# Energy measure is the total area of ove... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.