text stringlengths 2 999k |
|---|
#!/usr/bin/env python
# encoding: utf-8
from django.conf.urls import url, include
from rest_framework.routers import DefaultRouter
from v1.recipe_groups import views
# Create a router and register our viewsets with it.
router = DefaultRouter()
router.register(r'cuisine-count', views.CuisineCountViewSet, base_name='c... |
import os
import lit.formats
config.name = "Binaryen lit tests"
config.test_format = lit.formats.ShTest()
config.suffixes = ['.wat', '.wast', '.test']
config.test_source_root = os.path.dirname(__file__)
config.test_exec_root = os.path.join(config.binaryen_build_root, 'test')
config.environment = dict(os.environ)
#... |
import os, random, re, math, time
import numpy as np
import pandas as pd
import tensorflow as tf
import tensorflow.keras.backend as K
import efficientnet.tfkeras as efn
from kaggle_datasets import KaggleDatasets
import argparse
parser = argparse.ArgumentParser()
parser = parser.add_argument('--num_networks', type... |
#!/usr/bin/python
from numpy import pi
from numpy import sqrt
def dx(ne=0,dt=0):
'returns dx [lambda] for given *ne* [ncr] and *dt* [lambda]'
if dt==0:
return 1/(pi*sqrt(ne))
else:
return dt/(1-ne*dt*dt*4*pi*pi/4.04)
ne = 75.7659
dt = 0.014
print 'dt_crit = ',dx(ne)
print 'dx = ',dx(ne,dt)
print '1/dx ... |
"""
========
Tab UI
========
This example shows how to use the Tab UI. We will demonstrate how to
create Tabs for:
1. Slider controls for a Cube
2. Checkboxes for Cylinder and Sphere
3. Color combobox for Fury.
First, some imports.
"""
from fury import ui, window, actor
import numpy as np
from fury.data import fetch... |
from functools import partial
from graphql.utilities import build_schema
from graphql.validation import ProvidedRequiredArgumentsRule
from graphql.validation.rules.provided_required_arguments import (
ProvidedRequiredArgumentsOnDirectivesRule,
)
from .harness import assert_validation_errors, assert_sdl_validation... |
import os
import pymongo
import json
import time
from twilio.rest import Client
def dummy(request):
"""Responds to any HTTP request.
Args:
request (flask.Request): HTTP request object.
Returns:
The response text or any set of values that can be turned into a
Response object using
... |
from myproject import app
if __name__ == "__main__":
app.run()
|
# -*- coding: utf-8 -*-
#
# Copyright (C) 2020 mojib wali.
#
# invenio-theme-tugraz is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see LICENSE file for more
# details.
"""invenio module for TUGRAZ theme."""
from .ext import inveniothemetugraz
from .version import __ve... |
"""
XGB ts log_loss SKFold 10 top 50 features
"""
import os
from datetime import datetime
from timeit import default_timer as timer
import pandas as pd
import numpy as np
from sklearn.model_selection import StratifiedKFold
import src.common as common
import src.config.constants as constants
import src.modeling as m... |
from tkinter import (Frame, Canvas, ttk, HORIZONTAL, VERTICAL, IntVar, Scale, Button, Label, PhotoImage, BOTH, LEFT, Y,
X, TOP, messagebox)
from numpy import int_
from gamestate import GameState
from meta import GameMeta
from rave_mctsagent import (RaveMctsAgent, LGRMctsAgent, PoolRaveMctsAgent, ... |
#!/usr/bin/env python3
import sys
import ipaddress
from netboxers import netboxers_cli
from netboxers import netboxers_helpers
from netboxers import netboxers_queries
from netboxers.models.dnsmasq_dhcp import *
from netboxers.models.dns_zonefile import *
# This function will create a DNSMasq formatted DHCP config ... |
import click
from ecostake.util.keychain import supports_keyring_passphrase
@click.command("init", short_help="Create or migrate the configuration")
@click.option(
"--create-certs",
"-c",
default=None,
help="Create new SSL certificates based on CA in [directory]",
type=click.Path(),
)
@click.optio... |
#!/usr/bin/env python
import os
import sys
from decouple import config
if __name__ == "__main__":
settings_module = config("DJANGO_SETTINGS_MODULE", default=None)
if sys.argv[1] == "test":
if settings_module:
print(
"Ignoring config('DJANGO_SETTINGS_MODULE') because it's... |
# -*- coding: utf-8 -*-
import glob
import json
import os
import re
import subprocess
import tempfile
from ddt import ddt, idata, unpack
from unittest2 import TestCase
from i18n.utils import I18nFileWrapper
# Of the top twenty words in the initial curriculumbuilder data set, take out
# all those like "r" that repre... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... |
# CSAV program
# Version 1.0 (16.Nov.2020)
# written by Chul Lee (e-mail: chul.bioinfo@gmail.com)
# This code was developed and conducted in Python 3.7.1 (v3.7.1:260ec2c36a, Oct 20 2018, 14:57:15) [MSC v.1915 64 bit (AMD64)]
# OS for development and analysis: Windows 10 Education
# Libraries
import scipy.stats as stat... |
import pytz
from flask import render_template
from google.cloud import datastore
import os
from datetime import timezone
LINKS_SEARCH = 'links'
CHILDREN_SEARCH = 'children'
def utc_to_local(utc_dt):
return utc_dt.replace(tzinfo=timezone.utc).astimezone(tz=pytz.timezone('Europe/London'))
def search(request):
... |
"""empty message
Revision ID: 9a07e1252019
Revises:
Create Date: 2022-01-30 10:20:31.612416
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '9a07e1252019'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto gene... |
# Generated by Django 4.0.3 on 2022-04-15 21:23
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('checks', '0028_auto_20220401_2301'),
]
operations = [
migrations.AlterField(
model_name='checkresult',
name='alert_s... |
'''OpenGL extension OES.compressed_paletted_texture
This module customises the behaviour of the
OpenGL.raw.GLES2.OES.compressed_paletted_texture to provide a more
Python-friendly API
The official definition of this extension is available here:
http://www.opengl.org/registry/specs/OES/compressed_paletted_texture.txt... |
import numpy as np
from .state_space_model import StateSpaceModel
class Kalman(StateSpaceModel):
"""
A class to perform kalman filtering or smoothing
"""
def __init__(
self,
transition,
observation,
process_noise,
measurement_noise,
init_state_mean,
... |
import requests
import sys
from testscripts.const import MSB_BASE_URL
id = sys.argv[1]
requests.packages.urllib3.disable_warnings()
resp = requests.get(MSB_BASE_URL + '/api/nsd/v1/ns_descriptors/' + id, verify=False)
print(resp.status_code, resp.json())
|
import torch
from detector.yolov4v5.models.experimental import attempt_load
from detector.yolov4v5.utils import torch_utils
from detector.yolov4v5.utils.utils import non_max_suppression, scale_coords
from detector.yolov4v5.utils.datasets import *
class YoloModel(object):
def __init__(self, use_cuda = False, weigh... |
# Copyright 2020 The TensorFlow Probability 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... |
# 贵港论坛
TASK_NAME = 'bbs_gg163'
# 起始URL
START_URL = 'http://bbs.gg163.net/'
# 控制域,必须为list格式
DOMAIN = ['gg163']
# 请求头
HEADERS = {
'Host': 'bbs.gg163.net',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:53.0) Gecko/20100101 Firefox/53.0',
'Accept': 'text/html,application/xhtml+xml,application/xm... |
#!/usr/bin/env python
# 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... |
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="increc", # Replace with your own username
version="0.0.16",
author="Fernando André Fernandes",
author_email="fernandoandre49@gmail.com",
description="Software library on stream based reco... |
#!/usr/bin/env python3
import json
import os
import sys
from kubernetes.client.models.v1_object_meta import V1ObjectMeta
from kubernetes.client.models.v1_node import V1Node
from kubernetes.client.models.v1_node_spec import V1NodeSpec
from kubernetes.client.models.v1_node_status import V1NodeStatus
from kubernetes.cli... |
"""
MIT License
Copyrights © 2020, Philippe-Henri Gosselin.
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, m... |
import queue
import requests
import sys
import threading
AGENT = "Mozilla/5.0 (X11; Linux x86_64; rv:19.0) Gecko/20100101 Firefox/19.0"
EXTENSIONS = ['.php', '.bak', '.orig', '.inc']
TARGET = "http://testphp.vulnweb.com"
THREADS = 50
WORDLIST = "/home/tim/Downloads/all.txt"
def get_words(resume=None):
def extend... |
"""
The MIT License (MIT)
Copyright (c) 2015-2021 Rapptz 2021-present CuzImSyntax
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 u... |
from typing import Any
from datetime import datetime
def to_utc(dt: datetime) -> datetime:
return datetime.fromtimestamp(dt.timestamp())
def backoff_handler(details: Any) -> None:
from src.log import logger
logger.warning(
f"backing off after {details.get('tries', '???')} tries, waiting {detail... |
#=======================================================================
#Using Keras with tensorflow backend
#=======================================================================
import sys, csv
import numpy as np
import keras
from keras import models
from keras import layers
from keras.utils.np_utils import to_cat... |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/mobile/shared_horned_rasp_hue.iff"
result.attribute_template_id = 9
result.... |
# coding=utf-8
import six
from django.test import TestCase
from .testapp.models import (
ShortUUIDTestAgregateModel, ShortUUIDTestManyToManyModel,
ShortUUIDTestModel_field, ShortUUIDTestModel_pk,
)
class ShortUUIDFieldTest(TestCase):
def test_UUID_field_create(self):
j = ShortUUIDTestModel_field.... |
import numpy as np
import scipy.signal
from gym.spaces import Box, Discrete
import torch
import torch.nn as nn
from torch.distributions.normal import Normal
from torch.distributions.categorical import Categorical
def combined_shape(length, shape=None):
if shape is None:
return (length,)
return (length... |
from django.conf.urls import include, url
from regulations.urls import urlpatterns
urlpatterns = [
url(r'^comments/', include('notice_comment.urls')),
] + urlpatterns
|
# -*- coding: utf-8 -*-
from mock import patch
from tests import TestCase
from yarn_api_client.history_server import HistoryServer
from yarn_api_client.errors import IllegalArgumentError
@patch('yarn_api_client.history_server.HistoryServer.request')
class HistoryServerTestCase(TestCase):
def setUp(self):
... |
""" Test functions for stats module
WRITTEN BY LOUIS LUANGKESORN <lluang@yahoo.com> FOR THE STATS MODULE
BASED ON WILKINSON'S STATISTICS QUIZ
http://www.stanford.edu/~clint/bench/wilk.txt
Additional tests by a host of SciPy developers.
"""
from __future__ import division, print_function, absolute_impo... |
import numpy as np
def analyze_luminance(image, average=True):
"""Image Luminance
Compute the average luminance of an image.
- Linear Luminance (L): linear measure of light, spectrally weighted for normal vision but not adjusted for the non-linear perception of lightness.
- Perceived Luminance (L*):... |
from django.db import connections
from django.db.utils import OperationalError
from django.http import JsonResponse
class TestDbConnecton:
def __init__(self,):
pass
def check(self,server):
db_conn = connections[server]
try:
c = db_conn.cursor()
except OperationalE... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Sep 9 23:22:02 2017
@author: jmmauricio
"""
from pydgrid import grid
from pydgrid.pf import pf_eval,time_serie
from pydgrid.electric import bess_vsc, bess_vsc_eval
from pydgrid.simu import simu, f_eval, ini_eval, run_eval
import matplotlib.pyplot as p... |
import pygame,sys
from math import *
pygame.init()
screen=pygame.display.set_mode((800,700),0,32)
missile=pygame.image.load('element/pointer.png').convert_alpha()
x1,y1=100,600 #导弹的初始发射位置
velocity=800 #导弹速度
time=1/1000 #每个时间片的长度
clock=pygame.time.Clock()
old_angle=0
while True... |
# ---------------------------------------------------------------------
# Migrate audit trail
# ---------------------------------------------------------------------
# Copyright (C) 2007-2020 The NOC Project
# See LICENSE for details
# ---------------------------------------------------------------------
# Python modu... |
# -*- coding: utf-8 -*-
from datetime import datetime
import logging
import hashlib
import json
import jwt
import requests
import time
from urllib.parse import urlencode
import uuid
class UpbitApi():
"""
UPbit Api\n
https://docs.upbit.com/reference
https://api.upbit.com/v1
"""
#################... |
from phycas.utilities.PhycasCommand import *
from phycas.utilities.CommonFunctions import CommonFunctions
from phycas import model, partition, randomtree, P
from phycas.commands.MCMCImpl import MCMCImpl
#from phycas.probdist import Beta, Exponential, InverseGamma
import copy
class MCMC(PhycasCommand):
def __init__... |
"""Derivation of variable `clltkisccp`."""
from iris import Constraint
from ._baseclass import DerivedVariableBase
from ._shared import cloud_area_fraction
class DerivedVariable(DerivedVariableBase):
"""Derivation of variable `clltkisccp`."""
# Required variables
required = [{'short_name': 'clisccp'}]
... |
import os
import time
import numpy as np
import pytest
from daemon.models.id import DaemonID
from jina import Document, Client, __default_host__
from jina.logging.logger import JinaLogger
from daemon.clients import JinaDClient
cur_dir = os.path.dirname(os.path.abspath(__file__))
compose_yml = os.path.join(cur_dir, '... |
from __future__ import print_function
import os
import os.path as osp
import numpy as np
ROOT_DIR = osp.abspath(osp.join(osp.dirname(__file__), '..'))
def get_output_dir(imdb_name, net_name=None,output_dir='output'):
"""Return the directory where experimental artifacts are placed.
If the directory does not e... |
# Copyright 2013-2018 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class OntAlbacore(Package):
"""Albacore is a software project that provides an entry point to th... |
#!/usr/bin/env python2.7
# Copyright 2017 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import argparse
import os
import subprocess
import sys
FUCHSIA_ROOT = os.path.dirname( # $root
os.path.dirname( # b... |
import numpy as np
import urllib.request, json, time, os, copy, sys
from scipy.optimize import linprog
global penguin_url, headers
penguin_url = 'https://penguin-stats.io/PenguinStats/api/'
headers = {'User-Agent':'ArkPlanner'}
class MaterialPlanning(object):
def __init__(self,
filter_freq=... |
#!flask/bin/python
from flask import Flask, jsonify
import numpy as np, sys
sys.path.insert(0, "/home/rakshit/Desktop/Academic/ms_codefundo/News_Recommender/policy/")
sys.path.insert(0, "/home/rakshit/Desktop/Academic/ms_codefundo/News_Recommender/environment/")
import utilities as utils
from glmUCB import GLMUCB
from ... |
# Copyright © 2013-2016 Jakub Wilk <jwilk@jwilk.net>
#
# 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, mer... |
from keras import backend as K
# from: https://github.com/kentaroy47/frcnn-from-scratch-with-keras
class Config:
def __init__(self):
self.verbose = True
self.network = 'resnet50'
# setting for data augmentation
self.use_horizontal_flips = False
self.use_vertical_flips = F... |
print("Calculadora\n")
n1 = float(input("Ingresa el primer número: "))
n2 = float(input("Ingresa el segundo número: "))
op = input("Escoge una operación: (+, -, *, /, %): ")
def selector(n1, n2, op):
if op == '+':
return n1 + n2
elif op == '-':
return n1 - n2
elif op == '*':
retu... |
#Creating and Manipulating PDFs with pdfrw
# https://www.blog.pythonlibrary.org/2018/06/06/creating-and-manipulating-pdfs-with-pdfrw/
# Extract certain types of information from a PDF
# Splitting PDFs
# Merging / Concatenating PDFs
# Rotating pages
# Creating overlays or watermarks
# Scaling pages
# Combining the use o... |
import csv
import datetime
import time
from colorama import Fore, Back, Style
class Dataset:
def __init__(self):
self.__head = []
self.__element_num = 0
def createone(self, element):
self.__head.append(element)
def auto_create(self, element_num):
self.__element_num = element_num
for i in range(self.__ele... |
def name():
return "Starting Gold/Items"
def parse(parser):
starting_gold_items = parser.add_argument_group("Starting Gold/Items")
starting_gold_items.add_argument("-gp", "--gold", default = 0, type = int, choices = range(0, 1000000), metavar = "COUNT",
help = "Start g... |
#!/usr/bin/env python
# Copyright (c) 2013 The Machinecoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Use the raw transactions API to spend machinecoins received on particular addresses,
# and send any chan... |
# Copyright 2021 Huawei Technologies Co., Ltd
#
# 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 agree... |
from unittest import TestCase
from tempfile import mkdtemp
from pathlib import Path
from shutil import rmtree
from gramtools.tests.mocks import _MockVcfRecord
from gramtools.commands.genotype.seq_region_map import (
SeqRegion,
SeqRegionMapper,
SearchableSeqRegionsMap,
BisectTarget,
)
class TestRegion... |
import os
from ajenti.api import *
from ajenti.plugins.main.api import SectionPlugin
from ajenti.ui import on
from ajenti.ui.binder import Binder
from ajenti.util import platform_select
from reconfigure.configs import BIND9Config
from reconfigure.items.bind9 import ZoneData
@plugin
class BIND9Plugin (SectionPlugin)... |
import urllib2
import simplejson as json
OUTPUT = './data/'
def getip():
return urllib2.urlopen('http://ip.42.pl/raw').read()
def get_faroo_news(q, start=1, length=10):
url = 'http://www.faroo.com/api?l=en&src=news&f=json&q=%s&start=%d&length=%d' % (q, start, length)
def get_google_news(q):
data = []
... |
'''
build-rare.py
Reads data, and outputs a list of rare words from the data.
Leon Cheung, lcheung@isi.edu
'''
import argparse, sys, os, time
import logging as log
from collections import Counter
from data import read_sentence_data
log.basicConfig(stream=sys.stderr, level=log.DEBUG)
def least_common(counter):
retu... |
# First we define an n-digit number as a number beginning with the digit 1 to 9 (i.e. not 0) and having (n-1)
# of any digit thereafter. For example, 10652 is a 5-digit number, but 08913 = 8913 is a 4-digit number.
#
# Lucky for us, the problem bound of 10^9 means that we examine all 1-to-9-digit numbers and not need
... |
from unittest import mock
from django.contrib.auth.models import AnonymousUser
from django.core import mail
from django.test import TestCase
from django.urls import reverse
from django_webtest import WebTest
from oscar.apps.customer.alerts.utils import (
send_alert_confirmation, send_product_alerts)
from oscar.ap... |
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... |
##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
## Created by: Yaoyao Liu
## Modified from: https://github.com/hshustc/CVPR19_Incremental_Learning
## Max Planck Institute for Informatics
## yaoyao.liu@mpi-inf.mpg.de
## Copyright (c) 2021
##
## This source code is licensed under the MIT-style... |
"""URLS for event pages."""
from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name="events_index"),
path('<int:pk>/', views.show, name='events_show'),
path('<int:pk>/ical', views.ical, name='events_ical'),
]
|
# Copyright 2020 MONAI Consortium
# 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, s... |
from flask import current_app, render_template, request, Response, redirect, url_for
from json import dumps, loads
# import blueprint
from app.main import bp
|
from django.conf import settings
from django.core.exceptions import ValidationError
from post_office.models import Email
import pytest
from unittest.mock import patch
from tests.factories import AuthorFactory, NotificationFactory, UserFactory
from unicef_notification.models import Notification
from unicef_notificati... |
"""
Settings for REST framework are all namespaced in the REST_FRAMEWORK setting.
For example your project's `settings.py` file might look like this:
REST_FRAMEWORK = {
'DEFAULT_RENDERER_CLASSES': (
'rest_framework.renderers.JSONRenderer',
'rest_framework.renderers.YAMLRenderer',
)
'DEFAULT... |
# GIS Lab Autonomous Bot
# Graeme and Will
import bot_moco as moco
import bot_conv as bcon
import bot_io as bio
# Main Bot Class
class Bot(object):
def __init__(self ):
print("Initializing a Bot")
name = None
proc_type = "tx2"
bot_type = "ground" # ground, flying
mode = "indoor"... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
网易云音乐 Entry
'''
from __future__ import (
print_function, unicode_literals, division, absolute_import
)
import curses
import traceback
import argparse
from future.builtins import str
from .menu import Menu
from .__version__ import __version__ as version
def start... |
import unittest
import numpy as np
import ms2pip.match_spectra
from operator import itemgetter
class TestMatchSpectra(unittest.TestCase):
def test_get_intense_mzs(self):
mzs = np.array([72.04435, 143.08147, 214.11859, 285.1557, 414.19827, 527.28235, 598.31946, 697.3879, 147.11276, 246.18117, 317.21826, 43... |
import pandas as pd
import numpy as np
from os import path
from path_service import LOG_DIR, DATA_DIR
from sklearn.metrics import log_loss
import re
prob_columns = list(map(lambda x: f"prob{x}", range(8)))
prob_columns_without_end = list(map(lambda x: f"prob{x}", range(7)))
def row_check(df: pd.DataFrame):
df.loc... |
""" Config class for search/augment """
import argparse
import os
import genotypes as gt
from functools import partial
import torch
def get_parser(name):
""" make default formatted parser """
parser = argparse.ArgumentParser(name, formatter_class=argparse.ArgumentDefaultsHelpFormatter)
# print default val... |
# Copyright 2008-2015 Nokia Networks
# Copyright 2016- Robot Framework Foundation
#
# 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
... |
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
import copy
import random
from collections import deque
from typing import Any, Deque, Dict, List, Set
import gevent
import structlog
from eth_utils import to_checksum_address
from gevent import Greenlet
from gevent.event import Event
from gevent.lock import BoundedSemaphore
from gevent.queue import Queue
from gevent.... |
# Copyright (c) 2021 AccelByte Inc. All Rights Reserved.
# This is licensed software from AccelByte Inc, for limitations
# and restrictions contact your company contract manager.
#
# Code generated. DO NOT EDIT!
# template file: justice_py_sdk_codegen/__main__.py
# pylint: disable=duplicate-code
# pylint: disable=li... |
import glycowork
from glycowork.alignment.glysum import *
glycan = 'Man(a1-3)Man(a1-4)Glc(b1-4)Man(a1-5)Kdo'
print("Test Alignment")
print(pairwiseAlign(glycan))
|
# coding: utf-8
"""
LUSID API
FINBOURNE Technology # noqa: E501
The version of the OpenAPI document: 0.11.3648
Contact: info@finbourne.com
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import re # noqa: F401
# python 2 and python 3 compatibility lib... |
import psutil, os, ntpath
import PyQt5.QtGui as qtg
from datetime import timedelta
import qimage2ndarray
class Utilities:
# Correctly format seconds to HH:MM:SS
def format_seconds(self, s):
return str(timedelta(seconds=s))
# Get only filename from file's path
def get_file_name(self, path):
... |
"""SunPy configuration file functionality"""
import os
import configparser
from pathlib import Path
import sunpy
from sunpy.extern.appdirs import AppDirs
__all__ = ['load_config', 'print_config', 'CONFIG_DIR']
# This is to avoid creating a new config dir for each new dev version.
# We use AppDirs to locate and crea... |
import logging
import os
import subprocess
import sys
import tempfile
import shutil
from pathlib import Path
from typing import List
import pandas as pd
from mutester.data_crawler import DataCrawler
class DataAnalysis:
def __init__(self, base_repository_path: str, virtual_environment_path: str, timeout=0):
... |
# Copyright 2016-2017 The Meson development team
# 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 agree... |
# -*- coding: utf-8 -*-
"""`sphinx_rtd_theme` lives on `Github`_.
.. _github: https://www.github.com/snide/sphinx_rtd_theme
"""
from setuptools import setup
from sphinx_rtd_theme import __version__
setup(
name='sphinx_rtd_theme',
version=__version__,
url='https://github.com/rtfd/sphinx_rtd_theme/',
... |
from distutils.core import setup
setup(
name='timeline_bot',
version='1.1.0.dev1',
packages=['timeline_bot',
'timeline_bot.components',
'timeline_bot.components.commands',
],
url='',
license='BSD',
author='Robert Robinson',
author_email='rerobins@me... |
"""
Script for getting access and refresh tokens for YouTube API OAuth credentials
"""
import os
from google_auth_oauthlib.flow import InstalledAppFlow
from django.core.management import BaseCommand
from django.conf import settings
script_path = os.path.dirname(os.path.realpath(__file__))
class Command(BaseComman... |
import torch
# %%
x = torch.arange(12)
# %%
x
X = x.reshape(3, -1)
# %%
X
# %%
torch.randn(3, 4)
# %%
y = torch.tensor([[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12]])
y.shape
# %%
X
# %%
y
# %%
torch.cat((X, y), dim=0)
# %%
torch.cat((X, y), dim=1)
# %%
X < y
# %%
y[1:3]
# %%
print('id(y): ', id(y))
y = y + X... |
#!/usr/bin/env python3
# Copyright (c) 2018 The BitsCoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Verify commits against a trusted keys list."""
import argparse
import hashlib
import os
import subprocess
i... |
import logging
from typing import Type
from protocol_controller.config import Config
def configure_logger(config: Type[Config]):
logging.basicConfig(level=config.LOG_LEVEL)
|
""" This function loads the trained model and we can give text as input and
get the classification result """
import nltk
import numpy as np
import scipy as sp
from sklearn.utils import shuffle
from sklearn.svm import LinearSVC
from sklearn.metrics import classification_report
from sklearn.feature_extraction import Di... |
"""
Evolve a population of N stars.
initial mass function between Mmin and Mmax and with stellar evolution with
metalicity z.
"""
from __future__ import print_function
import sys
import numpy
from amuse.lab import *
from amuse.units.optparse import OptionParser
from matplotlib import pyplot
from amuse.plot imp... |
import torch
import torch.nn as nn
class ResidualBlock(nn.Module):
def __init__(self):
super().__init__()
self.layers = nn.Sequential(
nn.Conv2d(64, 64, kernel_size=3, stride=1, padding=1),
nn.BatchNorm2d(64),
nn.PReLU(),
nn.Conv2d(64, 64, kernel_siz... |
"""
MIT License
Copyright (c) 2020 Christoph Kreisl
Copyright (c) 2021 Lukas Ruppert
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.