text stringlengths 2 999k |
|---|
from pymc import *
from numpy import *
from numpy.testing import *
import nose
import sys
from pymc import utils
from pymc import six
xrange = six.moves.xrange
class test_logp_of_set(TestCase):
A = Normal('A',0,1)
B = Gamma('B',1,1)
C = Lambda('C',lambda b=B: sqrt(b))
D = Gamma('D',C,1)
@stochasti... |
import asyncio
from appdaemon.appdaemon import AppDaemon
class AdminLoop:
def __init__(self, ad: AppDaemon):
self.AD = ad
self.stopping = False
self.logger = ad.logging.get_child("_admin_loop")
def stop(self):
self.logger.debug("stop() called for admin_loop")
self.sto... |
import numpy as np
import runner
class Sprinter:
@staticmethod
def createfulltable(dataset, originalsize, runs, verbose=False):
print('\\textbf{'+dataset+'} & '+str(np.round(originalsize/1000000.,2))+'M\\\\')
for r in runs.keys():
selector = runs[r][0]
rest = {r:runs[r][1:]}
Sprinter... |
"""
Django settings for TechReviewProj project.
Generated by 'django-admin startproject' using Django 2.2.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
""... |
"""
sphinx.testing.util
~~~~~~~~~~~~~~~~~~~
Sphinx test suite utilities
:copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import os
import re
import sys
import warnings
from typing import Any, Dict, Generator, IO, List, Pattern
from xml.et... |
# -*- coding: utf-8 -*-
import os
import pkg_resources
from .installer.utils import execute
VERSION = ['2014', '2']
OS_RELEASE = 'Juno'
RESERVE_STR = None
def vr_from_git():
"""Returns VR string calculated from GIT repo."""
proj_dir = os.path.dirname(os.path.dirname(__file__))
rc, tag = execute(
... |
import os
import time
import numpy as np
import tensorflow as tf
import cv2
import sys
sys.path.append('../')
from model.lat_net import *
from model.loss import *
from model.lattice import *
from utils.experiment_manager import *
from tqdm import *
FLAGS = tf.app.flags.FLAGS
# get restore dir
RESTORE_DIR = make_... |
import gettext
#ja = gettext.translation('messages', localedir='/tmp/0/ja/LC_MESSAGES', languages=['ja'])
#print(ja('This is a translatable string.'))
gettext.bindtextdomain('messages')
gettext.textdomain('messages')
_ = gettext.gettext
# ...
print(_('This is a translatable string.'))
|
# 039 - Faça um programa que leia o ano de nascimento de um jovem e informe, de acordo com a sua idade, se ele ainda vai se alistar ao serviço
#militar, se é a hora de se alistar ou se já passou da hora de se alistar. Seu programa também deverá mostrar o tempo que falta ou que passou do prazo:
from datetime import da... |
"""suraj_30223 URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-b... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
##################################################
# GNU Radio Python Flow Graph
# Title: Uniflex Wifi Transceiver
# Generated: Fri Mar 10 14:30:08 2017
##################################################
import os
import sys
sys.path.append(os.environ.get('GRC_HIER_PATH',... |
import csv
import requests
df = open("bridgeData3.csv",'r').readlines()
fin = open('final.csv','r').readlines()
# url = https://b2ptc.herokuapp.com/bridges
finalCsv = df[1:]
obj = {}
for i in finalCsv:
x = i.split(',')
obj[x[1]] = {'bridge_name':x[0],'proj_code':x[1],'before_img':x[2],'after_img':x[3]}
print(f... |
#!/usr/bin/env python
"""Implementation of a router class that has approvals-based ACL checks."""
from typing import Optional, Text
from grr_response_core.lib import registry
from grr_response_core.lib import utils
from grr_response_core.lib.rdfvalues import structs as rdf_structs
from grr_response_core.lib.util impo... |
# -*- coding: utf-8 -*-
import torch
import numpy as np
import unittest
import itertools
import warnings
import math
from math import inf, nan, isnan
import random
from random import randrange
from itertools import product
from functools import reduce
from torch.testing._internal.common_utils import \
(TestCase, ... |
# 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 ... |
"""
Tests for the Openstack Cloud Provider
"""
import logging
import os
import shutil
from time import sleep
from salt.config import cloud_config, cloud_providers_config
from salt.utils.yaml import safe_load
from tests.support.case import ShellCase
from tests.support.helpers import expensiveTest, random_string
from ... |
# -*- coding: utf-8 -*-
"""
Created on Wed Jun 24 00:23:30 2020
@author: mahda
# =============================================================================
#
# Copyright (c) 2020 Mahdad Jafarzadeh
#
# Zzzscoring: A GUI-based package for sleep scoring!
# ===========================================================... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import click
import pymongo
from pymongo import MongoClient
from tabulate import tabulate
VCF_FILES = [
"vcf_snv",
"vcf_sv",
"vcf_str",
"vcf_cancer",
"vcf_cancer_sv",
"vcf_snv_research",
"vcf_sv_research",
"vcf_cancer_research",
"vcf_cancer_... |
# -*- coding: utf-8 -*-
# Copyright 2022 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
"""Tests of session module"""
import pytest
try:
from unittest import mock
except ImportError:
import mock
from rasterio.session import DummySession, AWSSession, Session, OSSSession, GSSession, SwiftSession
def test_base_session_hascreds_notimpl():
"""Session.hascreds must be overridden"""
assert S... |
import os
import math
import glob
import pytest
import shutil
import re
import yaml
import pele_platform.constants.constants as cs
import pele_platform.main as main
test_path = os.path.join(cs.DIR, "Examples")
OUT_IN_ARGS = os.path.join(test_path, "out_in/input.yaml")
INDUCED_EX_ARGS = os.path.join(test_path, "indu... |
import workos
from workos.utils.request import (
RequestHelper,
REQUEST_METHOD_DELETE,
REQUEST_METHOD_GET,
REQUEST_METHOD_POST,
REQUEST_METHOD_PUT,
)
from workos.utils.validation import ORGANIZATIONS_MODULE, validate_settings
ORGANIZATIONS_PATH = "organizations"
RESPONSE_LIMIT = 10
class Organiza... |
#!/usr/bin/python
#
# Compares vmstate information stored in JSON format, obtained from
# the -dump-vmstate QEMU command.
#
# Copyright 2014 Amit Shah <amit.shah@redhat.com>
# Copyright 2014 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Pu... |
from attendees.occasions.models import Meet
from rest_framework import serializers
class MeetSerializer(serializers.ModelSerializer):
assembly_name = serializers.CharField()
schedule_rules = serializers.JSONField(read_only=True)
class Meta:
model = Meet
fields = [f.name for f in model._me... |
import torch
from torch import nn
from transformers import BertTokenizer, VisualBertModel, VisualBertConfig
import numpy as np
class VisualBertClassifier(nn.Module):
def __init__(self,
visual_bert_model,
num_classes: int = 8,
initial_visual_embedding_dim: int = 9... |
#!/usr/bin/env python
import os
try:
from http.server import HTTPServer #python3
from socketserver import ThreadingMixIn
except ImportError:
from BaseHTTPServer import HTTPServer,BaseHTTPRequestHandler #python2
from SocketServer import ThreadingMixIn
class MyHTTPServer(ThreadingMixIn,H... |
# coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. 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 cop... |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: v1.16.14
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
f... |
# -*- coding: utf-8 -*-
"""
sphinx.search.en
~~~~~~~~~~~~~~~~
English search language: includes the JS porter stemmer.
:copyright: Copyright 2007-2017 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from sphinx.search import SearchLanguage
from sphinx.util.stemmer imp... |
from flask import request
from config.database import db
from models.UserToConversation import UserToConversation
from models.Conversation import Conversation
from models.User import User as UserModel
from config.sockets import sockets
from exceptions import conversation as e_conversation
from exceptions import ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Usage: ./im2bmp.py <img> <out>
Options:
-h --help Show this message
"""
import struct
def write(img, out):
H, W = img.shape
with open(out, 'wb') as f:
f.write(struct.pack('2i', H, W))
for i in range(H):
for j in range(W):
... |
from brownie import *
from .settings import *
from .contracts import *
from .contract_addresses import *
import time
def main():
load_accounts()
# Create Uniswap Liquidity Zap
uniswap_zap = deploy_uniswap_zap()
|
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 Citrix System.
# 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/... |
# -*- coding: utf-8 -*-
'''
Module for managing disks and blockdevices
'''
from __future__ import absolute_import, print_function, unicode_literals
# Import python libs
import logging
import os
import subprocess
import re
import collections
import decimal
# Import 3rd-party libs
from salt.ext import six
from salt.ext... |
"""macostools - Various utility functions for MacOS.
mkalias(src, dst) - Create a finder alias 'dst' pointing to 'src'
copy(src, dst) - Full copy of 'src' to 'dst'
"""
from Carbon import Res
from Carbon import File, Files
import os
import sys
import MacOS
import time
try:
openrf = MacOS.openrf
except AttributeErr... |
from .binomial_distribution import BinomialDistribution
from .custom_discrete_distribution import CustomDiscreteDistribution
from .discrete_distribution import DiscreteDistribution
from .uniform_discrete_distribution import UniformDiscreteDistribution
from .random_discrete_distribution import RandomDiscreteDistribution... |
from unittest import mock
import pytest
from cognite.client.data_classes import DataSet, DataSetFilter, DataSetUpdate
from cognite.client.exceptions import CogniteNotFoundError
from tests.utils import set_request_limit
@pytest.fixture(scope="class")
def new_dataset(cognite_client):
dataset = cognite_client.data... |
import torch as tc
import torch.nn as nn
import torch.nn.init as init
from config import NROW,NCOL
from core import DEVICE
class Conv(nn.Module):
def __init__(self, chn_in, chn_out, ker_sz=3):
super().__init__()
self.c=nn.Conv2d(chn_in,chn_out,ker_sz,padding=ker_sz//2,padding_mode="circular",bias=False)
self.b=... |
from streamlink.plugins.egame import Egame
from tests.plugins import PluginCanHandleUrl
class TestPluginCanHandleUrlEgame(PluginCanHandleUrl):
__plugin__ = Egame
should_match = [
'https://egame.qq.com/497383565',
]
should_not_match = [
'https://egame.qq.com/',
'https://egame.... |
#!/usr/bin/env python3
import os.path
import tensorflow as tf
import helper
import warnings
from distutils.version import LooseVersion
import project_tests as tests
from glob import glob
from tqdm import tqdm
COLLECTION_ASSERTS = 'ASSERTS'
COLLECTION_METRICS = 'METRICS'
COLLECTION_METRICS_UPDATES = 'METRICS_UPDATES'
... |
# coding: utf-8
import json
import tornado
from tornado.gen import coroutine
from tornado_opensearch.api_requestor import APIRequestor
from tornado_opensearch import util
API_VERSION = "v2"
class APIResource(object):
def __init__(self, **kwargs):
self.api_baseurl = kwargs.get("api_baseurl")
se... |
# https://www.hackerrank.com/challenges/write-a-function/problem
def is_leap(year):
return year % 4 == 0 and (year % 100 != 0 or year % 400 == 0)
# leap = False
# if year % 4 == 0:
# leap = True
# if year % 100 == 0:
# leap = False
# if year % 400 == 0:
# ... |
import functools
import re
from django.conf import settings
from django.contrib.auth import hashers
from django.core.exceptions import ObjectDoesNotExist, ValidationError
def validate_password_rule(regex, password,
password_field, failure_message='invalid password'):
if not re.search(r... |
algumtexto = input('Digite algo: ')
print('{} é alfabético: {}.'.format(algumtexto, algumtexto.isalpha()))
print('{} é numérico: {}.'.format(algumtexto, algumtexto.isnumeric()))
print('{} é caixa alta: {}.'.format(algumtexto, algumtexto.isupper()))
print('{} é caixa baixa: {}'.format(algumtexto, algumtexto.islower()))
... |
import tensorflow as tf
import os
from PIL import Image
import numpy as np
import logging
import time
from goods.models import ProblemGoods
from dl.step1_cnn import Step1CNN
from dl.step2_cnn import Step2CNN
from dl.step3_cnn import Step3CNN
from dl.tradition_match import TraditionMatch
from dl.util import visualize_bo... |
from extras.plugins import PluginConfig
class NextBoxUIConfig(PluginConfig):
name = 'nextbox_ui_plugin'
verbose_name = 'NextBox UI'
description = 'A topology visualization plugin for Netbox powered by NextUI Toolkit.'
version = '0.9.1'
author = 'Igor Korotchenkov'
author_email = 'iDebugAll@gmai... |
from torch import nn
from torch.autograd import grad
import torch
from model_utils import *
class conv3x3(nn.Module):
'''
3x3 Conv utility class
'''
def __init__(self, input_dim, output_dim = None, bias = False):
super(conv3x3, self).__init__()
if output_dim == None:
... |
"""
Use the py:mod:`cea.utilities.dbf` module to convert an excel file to a dbf file.
"""
from __future__ import division
import os
import cea.config
import cea.inputlocator
import cea.utilities.dbf
def main(config):
"""
Convert an Excel file (*.xls) to a DBF file (*.dbf). The configuration uses the section ... |
"""
WSGI config for projectkasir project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO... |
#!/usr/bin/python
"""
Zombie monitor - looks to see if the system is "working", but not actually accepting data from various sources, processing etc.
Kills/restarts the bookmarks code if it's dead.
"""
import os
import sys
import time
import cjson
import MySQLdb
from Kamaelia.Apps.SocialBookmarks.Print import Print... |
from .tensor_core import (
set_contract_path_cache,
get_contract_strategy,
set_contract_strategy,
contract_strategy,
get_contract_backend,
set_contract_backend,
contract_backend,
get_tensor_linop_backend,
set_tensor_linop_backend,
tensor_linop_backend,
tensor_contract,
te... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2012 Jérémie DECOCK (http://www.jdhp.org)
# 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 witho... |
"""
lice gives a wooden board composed of M X N wooden square pieces to Bob and asks him to find the minimal cost of
breaking the board into square wooden pieces. Bob can cut the board along horizontal and vertical lines, and each cut
divides the board in smaller parts. Each cut has a cost depending on whether the cut ... |
import torch
from torch import nn
import torch.nn.functional as F
from math import exp
import numpy as np
from segmentl.utils import get_activation_fn
from skimage.feature import masked_register_translation
from skimage import data, img_as_float
from skimage.metrics import structural_similarity as ssim
from skimage im... |
import functools
import torch
from torch import nn
class Optimizers():
def __init__(self):
self._modules = {}
def set(self, k, model, lr=3e-3, betas=(0.9, 0.999)):
self._modules[k] = torch.optim.Adam(model.parameters(), lr=lr, betas=betas)
def step(self, k_list=[], zero=True):
if... |
import re
from tabulate import tabulate
def format_table(data, fields=None, margin=None, sep=None, border=None):
if not fields or not isinstance(fields, list):
field_order = sorted(data[0].keys())
fields = {f: {} for f in field_order}
else:
field_order = [f['field'] for f in fields]
... |
# from typing import Optional
# from fastapi import APIRouter, Body, Depends, Path, Query
# from slugify import slugify
# from starlette.exceptions import HTTPException
# from starlette.status import (
# HTTP_201_CREATED,
# HTTP_204_NO_CONTENT,
# HTTP_400_BAD_REQUEST,
# HTTP_404_NOT_FOUND,
# HTTP_4... |
import os.path
from pythoscope.astbuilder import EmptyCode
from pythoscope.execution import Execution
from pythoscope.store import Project
from .helper import MemoryCodeTreesManager
class TestingProject(Project):
"""Project subclass useful during testing.
It contains handy creation methods, which can all b... |
#! /usr/bin/env python
""" crypto.keyedHash.tkip_key_mixing
Tests for TKIP key mixing function
Paul Lambert
November 4, 2002
"""
import unittest
from crypto.keyedHash.tkip_key_mixing import TKIP_Mixer
from struct import pack, unpack
from binascii_plus import a2b_p, b2a_p, b2a_hex
class TKIP_Mixer_Know_Answ... |
from snook.data.dataset import (
ClDataset,
RandomLinearMotionBlur,
ReMaHeDataset,
ResizeSquare,
TemporalReHeDataset,
)
from snook.data.generator import COLORS, Scene
from snook.data.generator import (
cDistances,
cFiles,
cProbas,
cRender,
cSampling,
cSensor,
cTable,
) |
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.contrib.auth.forms import PasswordChangeForm
from django.http import Http404
from django.shortcuts import get_object_or_404, render
from django.views.generic import DetailView
from braces.views import SuperuserRe... |
import asyncio
import logging
from typing import Dict, List, Optional, Tuple
from chaingreen.types.blockchain_format.sized_bytes import bytes32
from chaingreen.types.header_block import HeaderBlock
from chaingreen.util.ints import uint32
log = logging.getLogger(__name__)
class WalletSyncStore:
# Whether or not ... |
from setuptools import setup, find_packages
version = "2.4.8"
setup(
include_package_data=True,
name="metaflow",
version=version,
description="Metaflow: More Data Science, Less Engineering",
author="Machine Learning Infrastructure Team at Netflix",
author_email="help@metaflow.org",
license... |
from motor.motor_asyncio import AsyncIOMotorDatabase
class BaseRepository:
def __init__(self, client: AsyncIOMotorDatabase) -> None:
self._client = client
@property
def client(self) -> AsyncIOMotorDatabase:
return self._client
|
# -*- coding: utf-8 -*-
# Copyright 2021 ProjectQ-Framework (www.projectq.ch)
#
# 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
#
# ... |
import pytest
from thesis.users.models import User
pytestmark = pytest.mark.django_db
def test_user_get_absolute_url(user: User):
assert user.get_absolute_url() == f"/users/{user.username}/"
|
# (C) Datadog, Inc. 2018-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
import os
import time
import pytest
import redis
from datadog_checks.dev import LazyFunction, RetryError, docker_run
from datadog_checks.redisdb import Redis
from .common import DOCKER_COMPOSE_PATH, HER... |
import os
import docutils.core
from django.contrib.auth.models import User
from django.db import models
from django.core.urlresolvers import reverse
from django.utils.html import escape
from model_utils import Choices
from model_utils.fields import AutoCreatedField, AutoLastModifiedField
from localshop.apps.packages.... |
#!/usr/bin/env
from setuptools import setup
setup(
name='vstring',
version='0.0.1',
description='Python library for supporting processing Vietnamese',
author='Viet Hung Nguyen',
author_email='hvn@familug.org',
py_modules=['dwc'],
url='https://github.com/hvnsweeting/vstring'
)
|
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Test HTTP support.
"""
from __future__ import absolute_import, division
import random, cgi, base64
try:
from urlparse import urlparse, urlunsplit, clear_cache
except ImportError:
from urllib.parse import urlparse, urlunsplit, clear_... |
# Copyright 2015 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 applica... |
import pglet
from pglet import Text, Stack, Textbox, Button, Checkbox, Tabs, Tab
class Task():
def __init__(self, app, name):
self.app = app
self.display_task = Checkbox(value=False, label=name, on_change=self.status_changed)
self.edit_name = Textbox(width='100%')
self.display_view... |
import scrape
import mongo
import datetime
import argparse
def get_args():
parser = argparse.ArgumentParser()
parser.add_argument('--dbhost', help='hostname to connect a mongodb')
parser.add_argument('--port',
help='port number to connect a mongodb',
type=in... |
# Copyright (c) 2011-2016 Rackspace US, 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 ... |
#
# Copyright (c) 2022 Airbyte, Inc., all rights reserved.
#
from unittest.mock import MagicMock
from airbyte_cdk.sources.streams.http.auth.core import NoAuth
from pytest import fixture
from source_trello.source import Boards, Cards, TrelloStream
from .helpers import NO_SLEEP_HEADERS, read_all_records
@fixture
de... |
from __future__ import absolute_import, division, print_function
from .common import Benchmark
import numpy as np
class Core(Benchmark):
def setup(self):
self.l100 = range(100)
self.l50 = range(50)
self.l = [np.arange(1000), np.arange(1000)]
self.l_view = [memoryview(a) for a in ... |
# Copyright (c) 2015 Ian Stapleton Cordasco
# 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 ... |
"""
Entrypoint module, in case you use `python -mprotean`.
Why does this file exist, and why __main__? For more info, read:
- https://www.python.org/dev/peps/pep-0338/
- https://docs.python.org/2/using/cmdline.html#cmdoption-m
- https://docs.python.org/3/using/cmdline.html#cmdoption-m
"""
# Protean
from protean.cli ... |
# -*- test-case-name: twisted.conch.test.test_transport -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
The lowest level SSH protocol. This handles the key negotiation, the
encryption and the compression. The transport layer is described in
RFC 4253.
Maintainer: Paul Swartz
"""
imp... |
import torch
import torch.nn as nn
import sys, os
script_dir = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(0,script_dir+'/../../equivariant_attention/')
from equivariant_attention.modules import get_basis_and_r, GSE3Res, GNormBias
from equivariant_attention.modules import GConvSE3, GNormSE3
from equiva... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# michael a.g. aïvázis
# orthologue
# (c) 1998-2018 all rights reserved
#
"""
Exercise the simple filesystem explorer
"""
def test():
import pyre.filesystem
# make a filesystem
fs = pyre.filesystem.virtual()
# create a few nodes and insert them into ... |
"""
"""
from MDSplus import *
import sys
import numpy as np
import matplotlib.pyplot as plt
s=int(sys.argv[1])
myTree=Tree("spectroscopy",s)
for i in range(1,33):
if i<10:
node_sig=myTree.getNode("GPI.APD_ARRAY.HARDWARE:ACQ196.INPUT_0"+str(i))
else:
node_sig=myTree.getNode("GPI.APD_ARRAY.HARDW... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# mk-check-ints.py (c) myke 2015-11-07
# check first integer predefined refs
for i in range (-10, 300):
a = i+0
b = i+0
if a is b:
print (i, "equals")
else:
print (i, "not equals")
#~ -10 not equals
#~ -9 not equals
#~ -8 not equals
#~ -7 ... |
import socket
class ChooyanHttpClient:
def request(host, port=80):
response = ChooyanResponse()
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((host, port))
request_str = 'GET / HTTP/1.1\nHost: %s\r\n\r\n' % (host)
s.send(request_str.encode('utf-8'))
... |
#!/usr/bin/env python2
import requests as r
from base64 import b64decode as b
import json
import sys
import os
assert(len(sys.argv) >= 3)
quesId = sys.argv[1]
cnt = 0
for line in os.listdir(sys.argv[2]):
if cnt > 1000:
break
with open(sys.argv[2] + "/" + line) as f:
body = {
"... |
from os import path
from setuptools import setup, find_packages
# from setuptools.command.develop import develop
# from setuptools.command.install import install
# from subprocess import check_call
here = path.abspath(path.dirname(__file__))
build_script = path.join(here, "build.sh")
with open('README.rst') as f:
... |
"""Utilities for all Certbot."""
import argparse
import atexit
import collections
# distutils.version under virtualenv confuses pylint
# For more info, see: https://github.com/PyCQA/pylint/issues/73
import distutils.version # pylint: disable=import-error,no-name-in-module
import errno
import logging
import os
import p... |
mapping = {
1001:'I_ScGetCurrentGroupStateW',
1005:'AbortSystemShutdownA',
1006:'AbortSystemShutdownW',
1007:'AccessCheck',
1008:'AccessCheckAndAuditAlarmA',
1009:'AccessCheckAndAuditAlarmW',
1010:'AccessCheckByType',
1011:'AccessCheckByTypeAndAuditAlarmA',
1012:'AccessCheckByTypeAndAuditAlarmW',
1013:'AccessCheckByTyp... |
'''
############################################################################
## GRETA REPOSITORY ##
############################################################################
repository name: Greta
repository version: 1.0
repository link: https://github.com/... |
#!/usr/bin/env python3
import subprocess
import os
import sys
import json
sys.path.append("../")
sys.path.append("../../system/lib/")
sys.path.append("../array/")
import json_parser
import pos
import cli
import api
import CREATE_VOLS_ON_TWO_RAID0_ARRAYS
VOL1_NAME = CREATE_VOLS_ON_TWO_RAID0_ARRAYS.VOL1_NAME
VOL2_NAME ... |
# Generated by Django 3.1.4 on 2021-03-20 13:11
from django.db import migrations, models
import django.db.models.query
import wagtail.core.blocks
import wagtail.core.fields
class Migration(migrations.Migration):
dependencies = [
('home', '0040_auto_20210320_1241'),
]
operations = [
migr... |
# - initialize to steady state
# - apply perturbation to inputs
# - fix all algebraic variables (requires preciese knowledge of the
# algebraic variables) to their steady state values
# - deactivate all algebraic equations
# - solve single finite element (should be a dynamic problem, because inputs reach
# differ... |
from django.urls import path, include
urlpatterns = [
# path('telegrambot/', telegram.MeninoDeRecadoBot.as_view()),
]
|
from typing import Any, Dict, Generic, List, Optional, Type, TypeVar, Union
from fastapi.encoders import jsonable_encoder
from pydantic import BaseModel
from sqlalchemy.orm import Session
from db.base_class import Base
ModelType = TypeVar("ModelType", bound=Base)
CreateSchemaType = TypeVar("CreateSchemaType", bound=... |
# Copyright 2021 The Brax 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 wri... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
This example show you how to train an LSTM for text generation.
"""
import numpy as np
import yadll
import logging
logging.basicConfig(level=logging.DEBUG, format='%(message)s')
alphabet = 'abcdefghijklmnopqrstuvwxyz'
sequence_length = 2
number_of_chars = len(alphab... |
# -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# https://doc.scrapy.org/en/latest/topics/items.html
import scrapy
class LeconomisteComItem(scrapy.Item):
# define the fields for your item here like:
# name = scrapy.Field()
pass
|
"""
Pyparsing grammar for argument type doc lines.
"""
from pyparsing import (
Forward,
SkipTo,
Literal,
LineEnd,
LineStart,
Word,
alphanums,
indentedBlock,
Optional,
White,
ParserElement,
)
class TypeDocGrammar:
"""
EOL ::= ["\r"] "\n"
SOL ::= LINE_START
li... |
# Copyright 2010 New Relic, 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 writ... |
# VMware vCloud Director Python SDK
# Copyright (c) 2014 VMware, 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
#... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.