content stringlengths 5 1.05M |
|---|
# modules
# dash-related libraries
import dash
from dash.dependencies import Output, Event
from math import log10, floor, isnan
from datetime import datetime
from random import randint
import dash_core_components as dcc
import dash_html_components as html
import colorama
import sys
import getopt
# non-dash-related li... |
#!/usr/bin/env python3
from string import ascii_lowercase
medical = open('medical.txt', 'r').read().splitlines()
positive = open('positive.txt', 'r').read().splitlines()
print('Missing the following initials:')
initials = list(map(lambda s: s[0], medical))
for c in ascii_lowercase:
if c not in initials... |
from dataclasses import dataclass
__NAMESPACE__ = "http://www.opengis.net/fes/2.0"
@dataclass
class LogicalOperators:
class Meta:
namespace = "http://www.opengis.net/fes/2.0"
|
import hashlib
import os
import tempfile
from attic.hashindex import NSIndex, ChunkIndex
from attic.testsuite import AtticTestCase
class HashIndexTestCase(AtticTestCase):
def _generic_test(self, cls, make_value, sha):
idx = cls()
self.assert_equal(len(idx), 0)
# Test set
for x in range(100):
... |
from ansible.utils import parse_kv, template
class ActionModule(object):
"""
TODO: FIXME when upgrading to Ansible 2.x
"""
TRANSFERS_FILES = False
def __init__(self, runner):
self.runner = runner
self.basedir = runner.basedir
def _arg_or_fact(self, arg_name, fact_name, args,... |
# Copyright (c) 2021 Graphcore Ltd. All rights reserved.
import popart.ir as pir
import popart.ir.ops as ops
import popart._internal.ir as _ir
from popart.ir import dtypes
from utils import contains_op_of_type
class TestScatter:
def test_fn(self):
ir = pir.Ir()
g = ir.main_graph()
with g:... |
from lamby.src.config import config
from lamby.src.init import init
def test_init(runner):
with runner.isolated_filesystem():
lamby_dir = './.lamby'
runner.invoke(init)
key = "key"
value = "value"
change_value = "changed value"
compare_line = "{\"key\": \"value\"... |
import json
import os
import shutil
import subprocess
import requests
from string import Template
from osm_export_tool.sql import to_prefix
import shapely.geometry
# path must return a path to an .osm.pbf or .osm.xml on the filesystem
class Pbf:
def __init__(self,path):
self._path = path
def fetch(se... |
#
# Copyright 2014 Shahriyar Amini
#
# 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... |
from pybrain.tools.shortcuts import buildNetwork
from pybrain.datasets import SupervisedDataSet
from pybrain.supervised.trainers import BackpropTrainer
rete = buildNetwork(2, 8, 1)
ds = SupervisedDataSet(2, 1)
f = 1;
ds.addSample((0, 0), (0,))
ds.addSample((0, 1), (0,))
ds.addSample((1, 1), (1,))
ds.addSample((2, 2),... |
import json
# with open("./dataList.json") as f:
# print(json.loads(f.read()))
result = json.loads('{"username":"david.wei","token":"QFIdEKqb71ZLeJyXT0vh3uAVZLQvVRd9"}')
json.dumps()
print(type(result), result["username"])
|
#!/usr/bin/env python
#############################################################################
##
# This file is part of Taurus
##
# http://taurus-scada.org
##
# Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
##
# Taurus is free software: you can redistribute it and/or modify
# it under the terms of t... |
import requests
from bs4 import BeautifulSoup
from services.trackers.exceptions import UnknownPrice
def get_price() -> float:
link = 'https://www.tgju.org/profile/mesghal'
response = requests.get(link)
if response.status_code != 200:
raise UnknownPrice()
soup = BeautifulSoup(response.content... |
from pathlib import Path
from _utils.misc import (
cmd_exec,
)
from conf.conf import IMAGES_MOUNT_BASE_PATH
class MemDisk:
def __init__(self, image_path, unit):
self.image_path = image_path
self.unit = unit
self.md_path = f"/dev/md{self.unit}"
self.mount_path = Path(IMAGES_MO... |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/cloud/monitoring_v3/proto/service.proto
import sys
_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1"))
from google.protobuf import descriptor as _descriptor
from google.protobuf import mess... |
class DataCenter(object):
def __init__(self, history_data):
self.heat_list = history_data['HEAT']
def get_heat(self, t):
return self.heat_list[t]
|
# coding: utf-8
from PIL import Image
import os
import numpy as np
import cv2
''' Some times, the boxes file has been removed accidenly,
but the original images has been saved. We can compare
the two versions (w/o mosaic) of images to get the bound box
'''
# Step1, Find the images, without bound box
files = ... |
from __future__ import print_function
import sys
import os
import argparse
import torch
import torch.nn as nn
import torch.backends.cudnn as cudnn
import torchvision.transforms as transforms
from torch.autograd import Variable
from data import JE_ROOT, JE_CLASSES
from PIL import Image
from data import JEDetection, Base... |
class Message:
def __init__(self, messageType, message):
self.messageType = messageType
self.message = message
if self.messageType != "success" and self.messageType != "error":
self.messageType = "success"
def repr_json(self):
return dict(messageType=self.messageType... |
from awacs import aws, sts
from awacs.aws import Allow, Principal, Statement
from troposphere import Base64, GetAtt, Join, Output, Parameter, Ref, Split, Template
from troposphere.autoscaling import AutoScalingGroup, LaunchConfiguration, Tag
from troposphere.ec2 import BlockDeviceMapping, EBSBlockDevice
from tropospher... |
from brownie import Contract, interface
from brownie.exceptions import ContractNotFound
from cachetools.func import ttl_cache
from yearn.cache import memory
from yearn.multicall2 import fetch_multicall
from yearn.prices.constants import weth, usdc
FACTORIES = {
"uniswap": "0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import time
import reusables
import logging
import platform
from .common_test_data import *
reusables.change_logger_levels(logging.getLogger('reusables'), logging.INFO)
class ExampleSleepTasker(reusables.Tasker):
@staticmethod
def perform_task(task, queue):
... |
import pandas as pd
def calcLatLon(northing, easting):
"""
This function converts northings/eastings to latitude and longitudes.
It is almost entirely based upon a function
written by Tom Neer found in November 2017 at his blog:
http://www.neercartography.com/convert-consus-albers-to-wgs84/
""... |
# Generated by Django 3.1.7 on 2021-04-13 06:30
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Contenido',
fields=[
... |
from storyscript.compiler.semantics.functions.HubMutations import Hub
def test_mutations_empty():
assert len(Hub('').mutations()) == 0
def test_mutations_comment():
assert len(Hub('#comment\n#another comment\n').mutations()) == 0
|
import argparse
from distutils.util import strtobool
import pathlib
import siml
import convert_raw_data
def main():
parser = argparse.ArgumentParser()
parser.add_argument(
'settings_yaml',
type=pathlib.Path,
help='YAML file name of settings.')
parser.add_argument(
'raw_da... |
# coding: utf-8
#
# Copyright 2022 :Barry-Thomas-Paul: Moss
#
# 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... |
# Generated by Django 3.1.7 on 2021-03-28 19:57
import angalabiri.causes.models
from django.db import migrations
import django_resized.forms
class Migration(migrations.Migration):
dependencies = [
('causes', '0003_auto_20210324_0236'),
]
operations = [
migrations.AlterField(
... |
def nswp(n):
if n < 2: return 1
a, b = 1, 1
for i in range(2, n + 1):
c = 2 * b + a
a = b
b = c
return b
n = 3
print(nswp(n))
|
"""
1.Question 1
In this programming problem you'll code up Dijkstra's shortest-path algorithm.
The file (dijkstraData.txt) contains an adjacency list representation of an undirected weighted graph with 200 vertices labeled 1 to 200. Each row consists of the node tuples that are adjacent to that particular vertex ... |
from FundCompanyListCrawler import *
import pandas as pd
#定义基金公司分析数据
class FundCompanyAnalysis:
def __init__(self):
return
#获取成立最久的10家基金公司
@staticmethod
def getMaxBuildFundCompanyList():
fundCompanyInfoList=FundCompanyListCrawler.getFundCompanyDataList()
df=pd.DataFrame(fundCo... |
# Echo client program
import socket
HOST = '192.168.2.3' # The remote host
PORT = 8001 # The same port as used by the server
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
s.connect((HOST, PORT))
s.sendall(b'Hello, Jack')
data = s.recv(1024)
print('Received', repr(data))
|
#!/usr/bin/env python
from tenable.io import TenableIO
from csv import DictWriter
import collections, click, logging
def flatten(d, parent_key='', sep='.'):
'''
Flattens a nested dict. Shamelessly ripped from
`this <https://stackoverflow.com/a/6027615>`_ Stackoverflow answer.
'''
items = []
... |
import torch.optim as optim
from torchvision.utils import save_image
from _datetime import datetime
from libs.compute import *
from libs.constant import *
from libs.model import *
if __name__ == "__main__":
start_time = datetime.now()
learning_rate = LEARNING_RATE
# Creating generator and discriminator
... |
"""
RateCoefficients.py
Author: Jordan Mirocha
Affiliation: University of Colorado at Boulder
Created on: Wed Dec 26 20:59:24 2012
Description: Rate coefficients for hydrogen and helium. Currently using
Fukugita & Kawasaki (1994). Would be nice to include rates from other sources.
"""
import numpy as np
from scip... |
#!/usr/bin/env python
# -- coding: utf-8 --
"""
Copyright (c) 2021. All rights reserved.
Created by C. L. Wang on 19.10.21
"""
import os
import sys
from multiprocessing.pool import Pool
p = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
if p not in sys.path:
sys.path.append(p)
from myutils.make_html... |
#!/usr/bin/env python3
from Crypto.Hash import SHA256
from Crypto.Signature import PKCS1_v1_5
# from Crypto.PublicKey import RSA
def apply_sig(private_key, input):
digest = SHA256.new()
digest.update(input.encode('utf-8'))
signer = PKCS1_v1_5.new(private_key)
return signer.sign(digest)
def verify_sig... |
''' This empty module is a placeholder for identifier management tools and directory management tools.
'''
|
import torch
import torch.nn as nn
import torch.nn.functional as F
import block
class Pairwise(nn.Module):
def __init__(self,
residual=True,
fusion_coord={},
fusion_feat={},
agg={}):
super(Pairwise, self).__init__()
self.residual = residual
... |
#!/usr/bin/python
#
# Copyright 2021, Xcalar 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 ... |
import botocore
import boto3
import os
from os import walk
from tqdm import tqdm
import gzip
if not os.path.exists('cache'):
os.makedirs('cache')
s3 = boto3.resource('s3')
client = boto3.client('s3')
bucket = s3.Bucket('pytorch')
print('Downloading log files')
for key in tqdm(bucket.objects.filter(Prefix='cflogs... |
from django import forms
from django.core.exceptions import ValidationError
from django.core.validators import MinValueValidator
from django.contrib.auth import password_validation, forms as auth_forms
from django.utils.translation import gettext, gettext_lazy as _
from app.models import User
class StringListField(fo... |
"""
project: Load Flow Calculation
author: @魏明江
time: 2020/02/22
attention:readData.py定义了数据类完成了从txt读取文档,然后建立节点导纳矩阵的过程
Data类包含的属性有 :path, input_file_list, admittance_matrix分别是
源文件路径,读取完成并经过数据转换后的输入列表,以及节点导纳矩阵
Data类包含的可用方法有read_data(self), get_admittance_matrix(self)
分别是读取并转换数据... |
import copy
import datetime
import gc
import json
import lmdb
import logging
import math
import matplotlib
import matplotlib.pyplot as plt
import multiprocessing
import numpy as np
import os
import pickle
import pprint
import subprocess
import struct
import sys
import tletools
from .model import DataModel
from .defs i... |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
# file:main.py
# author:Itsuka
# datetime:2021/8/26 14:33
# software: PyCharm
"""
this is function description
"""
import os
from codegen import codegen_layer, metadata, tables, project_dir, target_dir
from utils.common import new_file_or_dir
from . import record_dele... |
current_obj(OBJ_SM, "my_state_machine")
current_obj(OBJ_MP, "EvtPool1")
current_obj(OBJ_AP, "my_object")
current_obj(OBJ_SM_AO, "Philo[2]")
current_obj(OBJ_AP, 0x20001234)
|
import logging
import json
import math
from configparser import NoOptionError
from gi.repository import Gtk, GObject
from lib.videodisplay import VideoDisplay
import lib.connection as Connection
from lib.config import Config
class VideoPreviewsController(object):
"""Displays Video-Previews and selection Buttons... |
from re import split
import joblib
import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.multioutput import MultiOutputClassifier
from sklearn.neighbors import KNeighborsClassifier
from sklearn.metrics import classification_report
from sklearn.tree import DecisionTree... |
import csv
from collections import defaultdict
import StringIO
from google.appengine.ext import blobstore
from google.appengine.ext.webapp import blobstore_handlers
from jinja_template import JinjaTemplating
from google.appengine.ext import db
from google.appengine.api import memcache
from xml.dom import minidom
from g... |
local_variable = 42
print(lo<caret>) |
from lram_reader import get_lram_location_in_frame_data
import re
def set_lram_value_in_bit_file(lutrams, lram_x, lram_y, lram_l, lram_width, lram_value, bit_file, start_byte, start_word_index=0):
word_index, bit_index = get_lram_location_in_frame_data(lutrams, lram_x, lram_y, lram_l, start_word_index)
# Loop on ... |
import pandas as pd
df = pd.read_csv("extracted_vim.txt")
df = df.drop_duplicates()
print(df)
df.to_csv(r'pandas_dropped_duplicates.txt', header=None, index=None, sep=' ', mode='a') |
import numpy as np
import torch
import torch.nn.functional as F
import json
import os
import copy
from sklearn.metrics import average_precision_score, roc_auc_score
from .. import builder
from .. import gloria
from pytorch_lightning.core import LightningModule
class ClassificationModel(LightningModule):
"""Pytor... |
import os.path as osp
import pytest
import pandas as pd
from sqlalchemy import create_engine
from pagai.services.database_explorer import get_sql_url, table_exists
from tests.settings import DATABASES
def get_test_data_path(filename: str) -> str:
this_directory = osp.dirname(osp.realpath(__file__))
return o... |
from django.contrib import admin
from .models import *
# Register your models here.
admin.site.register(Place)
admin.site.register(Cheese) |
from __future__ import absolute_import
import argparse
import logging
import re
from past.builtins import unicode
import apache_beam as beam
from apache_beam import window
from apache_beam.io import ReadFromText
from apache_beam.io import WriteToText
from apache_beam.options.pipeline_options import PipelineOptions
... |
#!/usr/bin/python
# ex:set fileencoding=utf-8:
from __future__ import unicode_literals
from django.apps import apps
from django.apps import AppConfig
from django.conf import settings
from django.core.checks import register
from django.core.checks import Error
from django.core.exceptions import ImproperlyConfigured
fr... |
# coding: utf-8
# Setup Raspberry Pi
#
# Script used on freshly installed raspbrien install on a Raspberry Pi.
# Installs IPython Notebook
# Gets .ssh folder from local server
# Copy folders from local server.
# Home, Github code, sellcoffee,
#
<<<<<<< HEAD
=======
# .gimp-2.8
# .ipython
#
#
>>>>>>> 33339176764b4... |
import logging
import argparse
import os
import sys
from matplotlib import pyplot as plt
import torch
import torch.nn as nn
from pytorchBaselines.a2c_ppo_acktr.envs import make_vec_envs
from pytorchBaselines.evaluation import evaluate
from crowd_sim import *
from pytorchBaselines.a2c_ppo_acktr.model import Policy
d... |
import os
import tempfile
import numpy as np
from matplotlib import pyplot as plt
# For mockfactory installation, see https://github.com/adematti/mockfactory
from mockfactory import EulerianLinearMock, LagrangianLinearMock, utils, setup_logging
# For cosmoprimo installation see https://cosmoprimo.readthedocs.io/en/la... |
#
# Copyright (c) Microsoft. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project.
#
from tests.engine.test_store import get_test_store
from data_wrangling_components.engine.verbs.aggregate import aggregate
from data_wrangling_components.types import FieldAggregateOperation, St... |
from pylab import plot, show, legend
from random import normalvariate
x = [normalvariate(0, 1) for i in range(100)]
plot(x, 'b-', label="white noise")
legend()
show()
|
from django.shortcuts import render
from django import forms
from django.shortcuts import get_object_or_404
from django.http import HttpResponseRedirect
from django.http import HttpResponse
from django.urls import reverse
from .form import RenewPatientsForm,Sortform,Searchform
from django.views import generic
f... |
from ._helper import getAttribute
from ._xfBase import XfBase
class XFindLastIndex(XfBase):
def __init__(self, f, xf):
self.xf = xf
self.f = f
self.idx = -1
self.lastIdx = -1
def result(self, result):
return getAttribute(self.xf, '@@transducer/result')(getAttribute(self.xf, '@@transducer/step... |
from model.address import Address
import re
class AddressHelper:
def __init__(self,app):
self.app = app
def edit(self, address, index):
wd = self.app.wd
self.open_home_page()
self.select_address_by_index(index)
wd.find_elements_by_css_selector("img[alt='Edit']")[index]... |
from views import index, wait_game, add_new_user, login_user, logout_user, get_active_users
from web_socket import websocket_handler
from settings import BASE_DIR
def setup_routes(app):
app.router.add_get('/', index)
app.router.add_get('/wait_game', wait_game)
app.router.add_get('/ws', websocket_handler)
... |
import sys
from html.parser import HTMLParser
from .models import Customer, Account, Statement
from typing import List
class HtmlParserCustomers(HTMLParser):
"""A class used to parse customers html to Customer objects."""
def __init__(self, username: str = '') -> None:
HTMLParser.__init__(self)
... |
import os
import sys
from microbench.benchmarks import BENCHMARKS_TO_RUN
from util.constants import LOG
from microbench.constants import (LAX_TOLERANCE, MIN_TIME, BENCHMARK_THREADS,
BENCHMARK_PATH, BENCHMARK_LOGFILE_PATH, LOCAL_REPO_DIR, JENKINS_REF_PROJECT)
class Config(object):
... |
import csv
from cambio import *
from classes.pokemon import *
from classes.pokemon_planta import *
from classes.pokemon_electrico import *
from classes.pokemon_agua import *
from classes.pokemon_fuego import *
from combate import *
if __name__ == "__main__":
entrenador1_pokemon1 = Pokemon_planta(1, "bulbasaur... |
# Generated by Django 4.0.2 on 2022-02-04 03:18
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('cms', '0001_initial'),
]
operations = [
migrations.RenameField(
model_name='barangay',
old_name='name',
new_name... |
import mx.Tools
import mx.Tools.NewBuiltins
import time, sys
# forall
print ('forall')
t = (3,) * 10; assert forall(lambda x: x==3,t) == 1
t = t + (4,); assert forall(lambda x: x==3,t) == 0
# exists
print ('exists')
t = (3,) * 10; assert exists(lambda x: x==4,t) == 0
t = t + (4,); assert exists(lambda x: x==4,t) == 1... |
# stdlib imports
import os
import numpy as np
import urllib
import json
from datetime import timedelta, datetime
import collections
import matplotlib.pyplot as plt
import matplotlib.patches as patches
# import numpy as np
import sqlite3 as lite
import pandas as pd
# local imports
from mapio.shake import getHeaderData... |
from PyQt4.QtCore import QString
from PyQt4.QtXml import QDomDocument
from random import choice
from urlparse import urljoin
from io import BytesIO
from zipfile import ZipFile
from time import strptime, mktime
from datetime import datetime
import os.path
from src.backends.backend import backend
from src.dataclasses im... |
import json
from django.conf import settings
from django.core.mail import send_mail, BadHeaderError
from django.core.urlresolvers import reverse
from django.db.models import Q
from django.http import HttpResponse
from django.shortcuts import render, redirect
from django.utils.translation import ugettext_lazy as _
from... |
import sys
import numpy as np
import warnings
from ..pakbase import Package
from ..utils import Util2d, MfList, Transient2d
# Note: Order matters as first 6 need logical flag on line 1 of SSM file
SsmLabels = ['WEL', 'DRN', 'RCH', 'EVT', 'RIV', 'GHB', 'BAS6', 'CHD', 'PBC']
class SsmPackage(object):
def __init__(... |
from django.shortcuts import render
from django.contrib.admin.views.decorators import staff_member_required
from database.extract import Extract
from database.transform import Transform
from database.load import Load
from database.utils import DBManage
@staff_member_required(login_url='/users/login/')
def etl(reques... |
import base64
import os
import warnings
from videotoframes import convert
from tests.utilities import get_testfiles_path
def test_convert():
with open(os.path.join(get_testfiles_path(), 'small.mp4'), 'rb') as file:
video_base_64 = base64.b64encode(file.read()).decode()
frames = convert(video_base_64)
assert fr... |
import cv2
import numpy as np
np.set_printoptions(threshold=np.inf)
def increase_brightness(img, value=30):
hsv = cv2.cvtColor(img, cv2.COLOR_BGR2HSV)
h, s, v = cv2.split(hsv)
#print(v.head(5))
print(sum(v))
lim = 255 - value
v[v > lim] = 255
v[v <= lim] += value
final_hsv = cv2.merge... |
# GENERATED BY KOMAND SDK - DO NOT EDIT
import komand
import json
class Component:
DESCRIPTION = "Quarantine (isolate) an endpoint"
class Input:
AGENT = "agent"
QUARANTINE_STATE = "quarantine_state"
WHITELIST = "whitelist"
class Output:
RESULT_CODE = "result_code"
RESULT_CONTENT = "res... |
from twisted.internet.protocol import Factory, ServerFactory, Protocol, DatagramProtocol
from twisted.internet import reactor
class IPBusServerProtocol(DatagramProtocol, Protocol):
def datagramReceived(self, datagram, address):
print("Received udp")
self.transport.write(datagram, address)
def dataReceived... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('djangocms_file', '0009_fixed_null_fields'),
]
operations = [
migrations.AlterField(
model_name='file',
name='file_name',
field=models.CharField(default='... |
# Copyright (C) 2010-2011 Richard Lincoln
#
# 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, merge, publish... |
# %%
import numpy as np
import json
# from nilearn import plotting
import matplotlib.patches as mpatches
import matplotlib.pyplot as plt
from ieeg.auth import Session
import scipy
import csv
import pandas as pd
import os
from scipy.io import savemat, loadmat
from os.path import join as ospj
import sys
import warnings
w... |
import numpy as np
import os
import glob
import argparse
import cv2
import pandas as pd
from metric import spatial_accuracy, temporal_accuracy
from utils import denormalize, normalize, draw_pnt, sample_cnt
IMAGE_FOLDER = 'images'
POINT_FOLDER = 'points'
INDEX_FNAME = 'indices.txt'
if __name__ == "__main__":
arg... |
from .misc import (ProgressDialog, ProjectDialog, AlignmentErrorDialog, SampleExportDialog,
SimulationDialog, ScriptExportDialog, PathLengthPlotter, AboutDialog, CalibrationErrorDialog)
from .preferences import Preferences
from .insert import InsertPrimitiveDialog, InsertPointDialog, InsertVectorDial... |
import logging
from collections import defaultdict, OrderedDict
import gym
from gym import spaces
from rware.utils import MultiAgentActionSpace, MultiAgentObservationSpace
from enum import Enum
import numpy as np
from typing import List, Tuple, Optional, Dict
import networkx as nx
_AXIS_Z = 0
_AXIS_Y = 1
_AXIS_X ... |
# -*- coding: utf-8 -*-
from brian2 import *
defaultclock.dt = 0.01*ms
eq_IB_bd='''
dV/dt=1/C_IB_bd*(-J-Isyn-Igap-Iran-Iapp-IL-INa-IK-IAR-IKM-ICaH) : volt
J : amp * meter ** -2
Isyn=IsynRS_LIP_sup+IsynFS_LIP_sup+IsynSI_LIP_sup+IsynRS_LIP_gran+IsynFS_LIP_gran+IsynIB_LIP+IsynSI_LIP_deep+Isyn_FEF+Isyn_mdPul : amp * me... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2019 pavle <pavle.portic@tilda.center>
#
# Distributed under terms of the BSD-3-Clause license.
from os import environ
DB_URI = environ.get('DB_URI', None)
if DB_URI is None:
DB_ENGINE = environ.get('DB_ENGINE', 'postgresql')
DB_USER = ... |
from .feed_composites import async_get_composite_feed_data
from .feed_data import async_get_feed_data
from .feed_datum import async_get_feed_datum
|
# author: "Finnian Reilly"
# copyright: "Copyright (c) 2001-2012 Finnian Reilly"
# contact: "finnian at eiffel hyphen loop dot com"
# license: "MIT license (See: en.wikipedia.org/wiki/MIT_License)"
# date: "2 June 2010"
# revision: "0.1"
import platform
from os import path
from distutils.dir_util import *
from eiffel... |
# -*- coding: utf-8 -*-
# Scrapy settings for jn_scraper project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# https://doc.scrapy.org/en/latest/topics/settings.html
# https://doc.scrapy.org/en/latest/to... |
def enqueue(self,element):
if(self.rear == self.MAX - 1):
print("Error- queue full")
else:
self.rear += 1
self.queue[self.rear] = element
if self.rear == 0:
self.front = 0;
return; |
# -*- coding: utf-8 -*-
import argparse
import sys
from r2env.tools import print_console, ERROR
from r2env.core import R2Env
HELP_MESSAGE = """
Usage: r2env [-flags] [action] [args...]
Flags:
-h, --help - show this help.
-v, --version - display r2env version.
-m, --meson - use meson instead of acr.
-... |
import datetime as dt
import filecmp
import re
import shutil
import warnings
from copy import deepcopy
from os import listdir
from os.path import basename, dirname, isfile, join
from unittest.mock import patch
import f90nml
import numpy as np
import pandas as pd
import pkg_resources
import pytest
from numpy import tes... |
from django.urls import path
from django.contrib.auth.views import LogoutView
from . import views
urlpatterns = [
path('', views.sign_up, name='user_sign'),
path('dashboard', views.user_dashboard, name='user_dashboard'),
path('login', views.sign_in, name='login_user'),
path('logout', LogoutView.as_vie... |
from __future__ import print_function
import time
import weakref
from resumeback import send_self, StrongGeneratorWrapper, GeneratorWrapper
from . import defer, State
def test_constructors():
def func():
yield # pragma: no cover
generator = func()
wrappers = [StrongGeneratorWrapper(generator),... |
import os
import numpy as np
import torch
import torch.nn as nn
from .pu_net import PUNet
from ..drop_points import SORDefense
class DUPNet(nn.Module):
def __init__(self, sor_k=2, sor_alpha=1.1,
npoint=1024, up_ratio=4):
super(DUPNet, self).__init__()
self.npoint = npoint
... |
from django.db import models
from ordered_model.models import OrderedModel
# Create your models here.
TRUNK_MAX_LENGTH = 100
class Trunk(models.Model):
name = models.CharField(blank=True, max_length=TRUNK_MAX_LENGTH)
sub_title = models.CharField(blank=True, max_length=TRUNK_MAX_LENGTH)
cols = models.Inte... |
# -*- coding: utf-8 -*-
#
# Copyright 2017 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 applicable law or a... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.