content stringlengths 5 1.05M |
|---|
"""Unit test package for ramachandran."""
|
from typing import Any, Dict, List, Tuple
from keras.layers import Layer
from overrides import overrides
from .tokenizer import Tokenizer
from ..data_indexer import DataIndexer
class CharacterTokenizer(Tokenizer):
"""
A CharacterTokenizer splits strings into character tokens.
"""
def __init__(self, p... |
"""
name ordered changeable duplicate indexed
list + + +
tuple + - +
set - add only - -
dictionary - + - +
"""
my_list = [1, 2, 3]
print(my_list[1])
print(my_list[-1])
print(my_list[1:-1])
print(my_list[:5])
print(my_list[2:... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
.. _module_mc_ssl:
mc_ssl / ssl registry
============================================
If you alter this module and want to test it, do not forget
to deploy it on minion using::
salt '*' saltutil.sync_modules
Documentation of this module is available with::
s... |
import inspect
from marcher.variable import Var
from marcher.vector import make_param, vec3
class Function:
registry = {}
partials = {}
class Call:
def __init__(self, name, args):
self.name = name
self.args = list(args)
def get_args(self):
return self... |
import tensorflow as tf
import os
import warnings
import time
warnings.simplefilter(action='ignore', category=FutureWarning)
def get_folder_name(path: str) -> str:
path = path.split("/")
folder_name = path[-1]
return folder_name
def get_name(path):
name = path.split("/")
return name[-1]
def ... |
from .Build import Build
__all__ = [Build]
|
#!/usr/bin/python
#### IMPORTS #####################################################################
import agentframework as af
import random
random.seed(100)
import numpy as np
import tkinter
import matplotlib
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
plt.set_cmap('YlGn')
import matplotlib.animatio... |
import unittest
import jwt
from requests import Request
from atlassian_jwt_auth.tests import utils
from atlassian_jwt_auth.contrib.requests import create_jwt_auth
class RequestsTest(unittest.TestCase, utils.RS256KeyTestMixin):
""" tests for the contrib.requests.JWTAuth class """
def setUp(self):
se... |
"""
Energy Quantified Time Series API client
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
# Add a default void log handler to avoid "No handler found" warnings
import logging
from logging import NullHandler
logging.getLogger(__name__).addHandler(NullHandler())
# Package info
from .__version__ import (
__title... |
from .run import ProfileComponent as BaseProfileComponent
class ProfileComponent(BaseProfileComponent):
pass
|
# -*- coding: utf-8 -*-
from setuptools import find_packages, setup
def get_all_pkg(lib_name: str) -> list:
all_sub_pkg = find_packages('JackFramework')
all_pkg = [lib_name + '.' + i for i in all_sub_pkg]
all_pkg.insert(0, lib_name)
return all_pkg
def install_lib(lib_name: str, all_pkg: list,
... |
# coding=utf-8
import json
from datetime import datetime
import re
import six
from tornkts.base.server_response import ServerError
class ArgumentsMixin(object):
EMAIL_REGEX = re.compile(
r"(^[-!#$%&'*+/=?^_`{}|~0-9A-Z]+(\.[-!#$%&'*+/=?^_`{}|~0-9A-Z]+)*" # dot-atom
r'|^"([\001-\010\013\014\016-\0... |
# -*- coding: utf-8 -*-
def checkio(words_set):
for w1 in words_set:
for w2 in words_set:
if (w1 != w2) and (w1.endswith(w2)):
return True
return False
#These "asserts" using only for self-checking and not necessary for auto-testing
if __name__ == '__main__':
print("Ex... |
# This script implements the agent reinforcement learning by Q-learning algorithm (off-policy TD control)
# + agent plays against a random agent (eps = 1)
# + first player is switched at the beginning of any new episode
# + eps and alpha agent parameters decrease every NUMBER_EPISODE_TO_DECREASE episodes
imp... |
import threading
import queue
class Routine(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
self.queue = queue.Queue()
self.mission = None
self.no_wait = False
self.is_stopping = False
self.sleeper = threading.Event()
def run(self):
... |
from parser import parameter_parser
from utils import tab_printer
from gam import GAMTrainer
def main():
"""
Parsing command line parameters, processing graphs, fitting a GAM.
"""
args = parameter_parser()
tab_printer(args)
model = GAMTrainer(args)
model.fit()
model.score()
model.sa... |
import logging
from .connectors import SocketConnector
from .connectors import ProjectFileConnector
from .connectors import FilesConnector
from .tracks import TrackContainer
logger = logging.getLogger("rocket")
class Rocket:
def __init__(self, controller, track_path=None, log_level=logging.ERROR):
"""Cre... |
import torch
class Boxes3D:
"""Convenience wrapper for 3D-boxes."""
def __init__(self, tensor):
self._tensor = tensor
@property
def wlh(self):
"""Return dims in wlh order."""
return self.tensor[..., 3:6]
@property
def center(self):
"""Return dims in wlh order... |
# Author: Yi Jiang, <jiangyi14@mails.ucas.ac.cn>, Institute of Physics, Chinese Academy of Sciences
# Adapted from the kdotp-symmetry package by: Dominik Gresch <greschd@gmx.ch> © 2017-2018, ETH Zurich, Institut für Theoretische Physik
"""A tool for computing k.p effective Hamiltonians with couplings to external field... |
from abc import ABCMeta, abstractmethod
# DataSourceUseCaseInputPort is the input port for DataSource API
class DataSourceUseCaseInputPort(metaclass=ABCMeta):
# handle is the method to handle each data source api
@abstractmethod
def handle(self, req): # req is the input source. It is nearly request data ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Jul 30 16:02:28 2019
@author: aaboyles
"""
from math import *
import numpy as np
import pandas as pd
import skbio
from plotnine import *
with open('HXB2.txt', 'r') as file:
hxb2 = file.read().upper()
nchar = len(hxb2)
#inputFile = "Indiana_KY_pol_a... |
#! /usr/bin/env python
# coding: utf-8
#
# Copyright (c) 2019 JR Oakes
#
# 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,... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import configparser
import html
import os
import selenium
import selenium.webdriver.chrome.options
import sentry_sdk
import sqlite3
import time
import twitter
import urllib
class Twitter2Facebook(object):
def post(self, text):
url = 'https://mbasic.facebook.c... |
class Solution:
from sortedcontainers.sortedlist import SortedList
# nums = [2, 3, 6, 7], target = 7, ans = [[2, 2, 3], [7]]
# start with 7:
# target - nums[len-1] = 0 => got 0, return [[7]]
# now to 6
# target - nums[len-2] = 1. nums.lbisect(1) == [], False
# now to 3
# target - n... |
import pytest
from src.cards import Card
@pytest.mark.parametrize(
"value, suit",
[
("2", "SPADES"),
("3", "HEARTS"),
("4", "DIAMONDS"),
("5", "CLUBS"),
("J", "SPADES"),
("Q", "HEARTS"),
("K", "DIAMONDS"),
("ACE", "CLUBS"),
],
)
def test_car... |
def check(a, x):
|
"""
Created on Sat Jul 7 00:40:00 2018
@author: Peter M. Clausen, pclausen
MIT License
Copyright (c) 2018 pclausen
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, includin... |
#!/usr/bin/env python3
"""
Denormalize strings or files with pretrained models.
"""
import argparse
import sys
from fairseq.models.transformer import TransformerModel
from fairseq.models.transformer import base_architecture
import scripts.custom_arch
def denormalize_file(DENORMALIZER, file, beam, outfile):
"""... |
from django.urls import path
from authors.apps.articles import views
app_name = "articles"
urlpatterns = [
path('articles/', views.ArticleViewSet.as_view(
{'get': 'list', "post": "create"}), name='articles-all'),
path('articles/<pk>/', views.ArticleViewSet.as_view(
{"get": "retrieve", "put": ... |
# Dictionary storing network parameters.
params = {
'num_epochs': 100,# Number of epochs to train for.
'learning_rate': 2e-4,# Learning rate.
'beta1': 0.5,
'beta2': 0.999,
'save_epoch' : 10,# After how many epochs to save checkpoints and generate test output.
}
|
import logging
logger = logging.getLogger(__name__)
from database.Database import LocalDatabaseServer, DatabaseManager
server = LocalDatabaseServer()
server.LoadDatabase()
manager = DatabaseManager(server)
manager.AddCourse(name="Differential Equations", crn="13756", credits=5, code="MAT 210", grade_letter="DD",... |
from django.apps import AppConfig
APP_NAME='transport'
class TransportConfig(AppConfig):
name = 'transport'
|
class PaginaWeb:
#Variable de la clase
Page = 'Necesito aprender a programar pero me aburre'
def _init_(self, URL, Ruta, Formato, Contenido, Titulo, Slug,Meta_tags):
##variables de instancia
self.URL=URL
self.Ruta=Ruta
self.Formato = Formato
self.Contenido = Contenido... |
#!/usr/bin/env python
# -*- coding: utf-8 -*--
# Copyright (c) 2022 Oracle and/or its affiliates.
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
import os
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
import numpy as np
import pandas as... |
from ocdskingfisher import util
from ocdskingfisher.base import Source
class ColombiaSource(Source):
"""
API documentation and bulk downloads: https://www.colombiacompra.gov.co/transparencia/gestion-documental/datos-abiertos
"""
publisher_name = 'Colombia'
url = 'https://api.colombiacompra.gov.co... |
import datetime
import os
import logging
import traceback
from bilibiliuploader.bilibiliuploader import BilibiliUploader
from bilibiliuploader.core import VideoPart
from BiliLive import BiliLive
import utils
def upload(uploader: BilibiliUploader, parts: list, cr: int, title: str, tid: int, tags: list, desc: str, so... |
from ows_refactored.ows_reslim_cfg import reslim_wms_min_zoom_15_cache_rules
from ows_refactored.fc.style_fc_cfg import (
style_fc_simple,
style_fc_simple_rgb,
styles_fc_bare_list,
styles_fc_gv_list,
style_fc_rgb,
styles_fc_ngv_list,
)
bands_fc_percentile = {
"PV_PC_10": [],
"PV_PC_50":... |
from os import path, makedirs
from appdirs import user_config_dir
from . import mdns
def get_cache_directory():
import picfota
version = picfota.__version__.split('.')[0]
return user_config_dir(appname='picfota', version=version)
class Hosts(dict):
_filename = None
@property
def filename(... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2019-04-24 13:48
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('issue_order', '0023_auto_20190424_1432'),
]
operations = [
migrations.RenameField(
... |
import cv2
import os
import tensorflow as tf
from object_detection.utils import label_map_util
from object_detection.utils import visualization_utils as viz_utils
from object_detection.builders import model_builder
from object_detection.utils import config_util
import numpy as np
from matplotlib import pyplot as plt
im... |
# 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 applicable law or a... |
#!/usr/bin/env python
# -*- coding: utf8 -*-
# *****************************************************************
# ** PTS -- Python Toolkit for working with SKIRT **
# ** © Astronomical Observatory, Ghent University **
# *****************************************************************
# ... |
"""
- 集爬取、清洗、分类与测试为一体的STAFF采集队列自动化更新组件
- 需要本机启动系统全局代理,或使用“国外”服务器部署
"""
from .common import exceptions
from .support.staff_checker import StaffChecker, IdentifyRecaptcha, StaffEntropyGenerator
from .support.staff_collector import StaffCollector
__version__ = 'v0.1.1'
__all__ = ['StaffCollector', 'IdentifyRecap... |
# -*- coding: utf-8 -*-
#
# Copyright 2017-2019 Spotify AB.
#
# 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 applicabl... |
from typing import Any, Dict, List, Type, TypeVar
import attr
from ..models.metadata_count import MetadataCount
T = TypeVar("T", bound="DocumentFacets")
@attr.s(auto_attribs=True)
class DocumentFacets:
""" """
facets: List[MetadataCount]
metadata: str
def to_dict(self) -> Dict[str, Any]:
... |
#import util, iputil, img
#import img as ig, iputil, util as ut, pyxmod, vlfeat, imtable, areload
__all__ = ['util', 'iputil', 'iplocal', 'pyxmod', 'vlfeat', 'imtable', 'areload', 'img']
|
import geopandas as gpd
import adampy as adam
import ipywidgets as widgets
import glob
import fiona
from meeo_sso_cli import login
import matplotlib.pyplot as plt
import pandas as pd
from bokeh.plotting import figure, output_file, show
from bokeh.io import push_notebook, show,output_notebook
import numpy as np
from IPy... |
"""
Computes FID on cifar mini-batches using old and new algorithm.
This should give the same values up to small numerical errors.
Expected output:
> python test_fid.py
Loading inception... DONE! 2.6870s
Files already downloaded and verified
| Batch Size | Prev ... |
"""This module contaiins unit tests for models used in application."""
from app.api.v1.models.user_model import Users
from .base_test import BaseTestCase
class TestUser(BaseTestCase):
def test_create_user(self):
new_user = Users()
new_user.create_user('larry','karani', 'kubende', 'karanilarry@gmail... |
# noinspection PyShadowingBuiltins,PyUnusedLocal
def compute(x, y):
return int(x+y)
|
from pathlib import Path
from fhir.resources.codesystem import CodeSystem
from oops_fhir.utils import CodeSystemConcept
__all__ = ["TaskStatus"]
_resource = CodeSystem.parse_file(Path(__file__).with_suffix(".json"))
class TaskStatus:
"""
TaskStatus
The current status of the task.
Status: draft ... |
import numpy as np
from scipy.sparse import csr_matrix
import xgboost
def test_ranking_with_unweighted_data():
Xrow = np.array([1, 2, 6, 8, 11, 14, 16, 17])
Xcol = np.array([0, 0, 1, 1, 2, 2, 3, 3])
X = csr_matrix((np.ones(shape=8), (Xrow, Xcol)), shape=(20, 4))
y = np.array([0.0, 1.0, 1.0, 0.0, 0.... |
import json
with open("E:/CAIL2020/qat_entity_n.json", 'r', encoding='utf-8') as reader:
full_data = json.load(reader)
for key in full_data:
paras = full_data[key]
for pk in paras:
new_entities = []
para = paras[pk]
for entity in para:
if entity not in new_entities:
... |
#!/usr/bin/python3
# coding=utf-8
'''
测试时mongodb数据库测试文件
'''
import pymongo
myclient = pymongo.MongoClient("mongodb://localhost:27017/")
db = myclient.voice_finger
myquery = {"name":"first_est"}
mydb = myclient.voice_finger
mycol = mydb.voice_finger
namecount = mycol.find()
# if namecount != None:
# print("the so... |
"""
Our utility for evaluating LiTS dataset
"""
import os
import argparse
import numpy as np
import re
parser = argparse.ArgumentParser()
parser.add_argument('-m', '--model_name', type=str, default='1casLDR_ALDK_Liver')
args = parser.parse_args()
eval_results = os.listdir('evaluate')
full_metrics = list()
for eval_... |
# coding=utf-8
import pytest
def test_params(params):
print('asdas:{}'.format(params)) |
import bpy
from .. utils.timing import prettyTime
from .. draw_handler import drawHandler
from .. utils.blender_ui import getDpi, getDpiFactor
from .. graphics.drawing_2d import drawText, setTextDrawingDpi
@drawHandler("SpaceNodeEditor", "WINDOW")
def drawNodeEditorHud():
tree = bpy.context.getActiveAnimationNodeT... |
import pandas as pd
import numpy as np
import os
import datetime as dt
from .database_structures import *
from .. import fileleaf as fl
class Database:
"""
The 'Database' is the center of the Databranch module, it aggregates all other structures,
and makes sure they work together.
A Database should b... |
# Copyright (c) 2015-2021 Agalmic Ventures LLC (www.agalmicventures.com)
#
# 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... |
# import nonebot
from nonebot import require
from nonebot import get_driver
import nonebot
import pymysql
import csv
import datetime
import os
from .config import Config
from . import data_source
global_config = get_driver().config
config = Config(**global_config.dict())
scheduler = require("nonebot_plugin_apschedu... |
#!/usr/bin/env python
# Simple listener that subscribes to aruco tags
import rospy
from std_msgs.msg import String
from std_msgs.msg import Header
from geometry_msgs.msg import Pose
from duckietown_msgs.msg import BoolStamped
# Runs when tag 1 is detected (tag 1 = obstacle blocking lane)
def pose(data):
global m... |
# Generated by Django 3.0.4 on 2020-05-05 09:52
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0002_author'),
]
operations = [
migrations.CreateModel(
name='Affiliation',
... |
from ..base import *
from ..button import *
from ..dialog import *
from .list_dialog import ListEntry, ListPane, ListDialog
from .message_dialog import MessageDialog
class TransformDialog(Dialog):
def __init__(self):
transf_type = GD["active_transform_type"]
on_cancel = lambda: Mgr.update_remote... |
from tkinter import ttk
TITLE_FONT = ('tkdefaultfont', 16, 'bold')
SUBTITLE_FONT = ('tkdefaultfont', 11, 'bold')
def configure_styles():
style = ttk.Style()
style.configure('Title.TLabel', font=TITLE_FONT)
style.configure('Subtitle.TLabel', font=SUBTITLE_FONT)
style.configure('Action.TButton', width=... |
from flask import Flask, render_template, url_for, redirect, request, flash
from app import app
from utils_database import *
@app.route('/')
def index():
all_anime = get_all_anime_from_database()
return render_template("index.html", all_anime=all_anime)
@app.route('/add-anime', methods=["GET", "POST"])
def... |
import tvm
def test_attrs_equal():
x = tvm.make.node("attrs.TestAttrs", name="xx", padding=(3, 4))
y = tvm.make.node("attrs.TestAttrs", name="xx", padding=(3, 4))
z = tvm.make.node("attrs.TestAttrs", name="xx", padding=(3,4,1))
assert tvm.ir_pass.AttrsEqual(x, y)
assert not tvm.ir_pass.AttrsEqual(x... |
# -*- coding: utf-8 -*-
import os.path as op
import re
def test_dictionary_formatting():
"""Test that all dictionary entries are valid."""
err_dict = dict()
ws = re.compile(r'.*\s.*') # whitespace
comma = re.compile(r'.*,.*') # comma
with open(op.join(op.dirname(__file__), '..', 'data',
... |
import os
import datetime
from .get_met_info import GetMet
from .util import (bool_to_yesno, render_template, get_times,
sanitise_name, sanitise_description)
from .paths import get_paths
def create_inputs(paths, params):
"""
Creates the input file for the NAME met extract run, and return... |
import sys
sys.path.append('..')
sys.path.append('../..')
sys.path.append('../../..')
import coplot.plots as pl
import coplot.plot_settings as pls
import cmbnncs.simulator as simulator
import cmbnncs.utils as utils
import cmbnncs.spherical as spherical
import loader
import numpy as np
import matplotlib.pyplot as plt
im... |
from django.contrib.auth import get_user_model
from rest_framework.generics import RetrieveUpdateAPIView
from rest_framework.permissions import IsAuthenticated
from ..serializers import ProfileSerializer
User = get_user_model()
class ProfileViewSet(RetrieveUpdateAPIView):
queryset = User.objects.all()
seria... |
#!/usr/bin/env python3
# encoding: utf-8
import numpy as np
import tensorflow as tf
from abc import abstractmethod
from typing import (Union,
List,
Callable,
Tuple,
Any,
Dict,
NoReturn,... |
import math
import os
import random
import re
import sys
a = [6, 4, 1]
# Complete the countSwaps function below.
def countSwaps(a):
n = len(a)
swapcount = 0
for i in range(n):
for j in range(0, n-i-1):
if a[j] > a[j+1]:
swapcount += 1
a[j], a[j+1] = a[... |
# coding: utf-8
"""Backend management system classes
Used to communicate with providers without using CFME facilities
"""
from __future__ import absolute_import
import fauxfactory
import pytz
from ovirtsdk4 import Connection, Error, types
from wait_for import wait_for, TimedOutError
from .base import WrapanapiAPIBase... |
script = b'''
<script>
function fetchCachedFileTest() {
return fetch('appcache-data.py?type=cached')
.then(res => res.text(),
_ => { throw new Error('Failed to fetch cached file'); })
.then(text => {
if (text != 'cached') {
throw new Error('cached file missmatch');
}
});
}
f... |
import os
p_path = '/scratch4/keisaito/visda/train'
dir_list = os.listdir(p_path)
write_name = open('/scratch4/keisaito/visda/all_images_train.txt','w')
for direc in dir_list:
if not '.txt' in direc:
files = os.listdir(os.path.join(p_path,direc))
for file in files:
class_name = d... |
# -*- coding: utf-8 -*-
def start(api):
core = api.core
monitor = core.kodi.xbmc.Monitor()
has_done_subs_check = False
while not monitor.abortRequested():
if monitor.waitForAbort(1):
break
if not core.kodi.get_bool_setting('general', 'auto_search'):
continue
... |
from data_science_layer.pipeline.basic_regressor_pipeline import \
BasicRegressorPipeline
from data_science_layer.machine_learning.pytorch_rnn_regressor import \
PytorchRnnRegressor
from data_science_layer.data_split.dataframe_seq_split import\
DataFrameSequenceSplitter
import numpy as np
class DataFrameS... |
"""
Contains possible interactions with the Galaxy Jobs
"""
import logging
import time
from typing import (
List,
Optional,
)
from bioblend import TimeoutException
from bioblend.galaxy.client import Client
log = logging.getLogger(__name__)
JOB_TERMINAL_STATES = {'deleted', 'error', 'ok'}
# Job non-terminal s... |
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
import torch
import matplotlib.pyplot as plt
import torchvision
from torchvision import datasets, models, transforms
class DoubleConv(nn.Module):
def __init__(self,input_channels, output_channels):
super(DoubleConv,self).__init__()
... |
from utils.constants import * # noqa: F401, F403
from utils.formatting import * # noqa: F401, F403
|
from time import sleep
from aiohttp import web
from av import VideoFrame
from aiortc import RTCPeerConnection, RTCSessionDescription, VideoStreamTrack, RTCIceServer, RTCConfiguration
from aiohttp_basicauth import BasicAuthMiddleware
class RTCVideoStream(VideoStreamTrack):
def __init__(self, camera_device):
... |
"""
ceph_objectstore_tool - Simple test of ceph-objectstore-tool utility
"""
from io import BytesIO
import contextlib
import json
import logging
import os
import six
import sys
import tempfile
import time
from tasks import ceph_manager
from tasks.util.rados import (rados, create_replicated_pool, create_ec_pool)
from t... |
from ceph_deploy.lib import remoto
from ceph_deploy.hosts.centos.install import repo_install, mirror_install # noqa
from ceph_deploy.hosts.util import install_yum_priorities
def install(distro, version_kind, version, adjust_repos, **kw):
# note: when split packages for ceph land for Fedora,
# `kw['components... |
class Queue:
def __init__(self):
self.queue = [] #list
def add(self,item):
self.queue.insert(0,item)
def size(self):
return len(self.queue)
def remove(self):
if len(self.queue) > 0:
return self.queue.pop()
else:
return False
def prin... |
import numpy as np
from sys import argv
# One argument must be given
if len(argv) != 2:
print("Usage: {} SIM_NUM".format(argv[0]))
exit(2)
# This part of the input is the same for all simulations in this suite
base_string = """
output-directory = proliferation-regime-1
simulation-time = 100000
dt = 0.005
sam... |
#!/usr/bin/env python3.5
import csv
def read(f, cols):
r = csv.reader(f)
# r = csv.reader(f, delimiter='~')
for row in r:
print([row[col-1] for col in cols])
if __name__ == '__main__':
import sys
args = sys.argv[1:]
if (len(args) >= 1):
cols = [int(val) for val in args]
f = sys.stdin
read... |
# -*- coding: utf-8 -*-
from __future__ import print_function
import sys
import logging
import itertools
from itertools import chain
import vcf
from cyvcf2 import VCF, Writer
from collections import defaultdict
import collections
from collections import deque
from operator import itemgetter
import customcon... |
# Generated by Django 2.2.1 on 2019-05-19 16:12
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('forum', '0003_post_likes'),
]
operations = [
migrations.AlterField(
model_name='post',
name='likes',
fie... |
#!/usr/bin/python
#
# Copyright 2008, 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 b... |
for i in range(1, 10+1):
if i%3 == 0:
print('hello')
elif i%5 == 0:
print('world')
else:
print(i)
|
# -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-05-14 00:20
from __future__ import unicode_literals
from django.db import migrations
from ..constants import foChar, foInteger, foDecimal, foFloat, foBoolean, foForeignKey
def insert_field_types(apps, schema_editor):
# We can't import the Person model ... |
__all__ = ["RDFXMLParser", "NTParser"]
|
from model.group import Group
def test_modify_first_group_name(app):
old_groups = app.group.get_group_list()
if app.group.count() == 0:
app.group.create(Group(name="test"))
app.group.modify_first_group(Group(name="New_group"))
new_groups = app.group.get_group_list()
assert len(old_groups) ... |
# Copyright 2018-2022 Streamlit Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... |
#!/usr/bin/env python3
import sys
import json
import itertools
import argparse
import logging
import textwrap
from os import path
from craigslist import search
from craigslist.data import get_areas, get_categories, DATA_FOLDER
from craigslist.exceptions import CraigslistException
from craigslist._search import make_ex... |
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
import numpy as np
import keras
import h5py
import tensorflow as tf
from keras.models import Sequential, model_from_yaml, load_model
from tensorflow.keras.optimizers import Adam
import cv2
detector = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
img_h,... |
# Copyright 2017 The TensorFlow 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 copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
from setuptools import setup
current_version = '0.6'
# convert from github markdown to rst
try:
import pypandoc
long_description = pypandoc.convert('README.md', 'rst')
except(IOError, ImportError):
long_description = open('README.md').read()
setup(
name = 'rbcz',
packages = [ 'rbcz', 'rbcz.test' ... |
# -*- coding: utf-8 -*-
from django.contrib import admin
from models import Config
admin.site.register(Config)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.