text
stringlengths
957
885k
import pytest from mock import patch from protean import BaseCommand, BaseCommandHandler, BaseEvent, BaseSubscriber from protean.adapters.broker.inline import InlineBroker from protean.exceptions import ConfigurationError from protean.fields import Auto, Integer, String from protean.infra.eventing import EventLog fro...
from typing import Dict, List, Tuple from bidict import bidict from pynars.Narsese import Term from pynars.utils.IndexVar import IntVar from .Substitution import Substitution class Elimination(Substitution): ''' the substitution of var-to-const ''' def __init__(self, term_src: Term, term_tgt: Term, ...
<filename>tl/candidate_generation/get_kgtk_search_matches.py import requests import pandas as pd from typing import List from concurrent.futures import ThreadPoolExecutor from itertools import repeat from tl.file_formats_validator import FFV from tl.exceptions import UnsupportTypeError from tl.exceptions import Requir...
from PySide2.QtCore import Qt, SIGNAL, QProcess, QByteArray from PySide2.QtWidgets import QDialog, QGridLayout, QTextEdit, QLineEdit, QCompleter from pygments import highlight from pygments.formatters.html import HtmlFormatter from pygments.lexers.data import JsonLexer from node_launcher.logging import log class C...
# # Autogenerated by Thrift Compiler (0.12.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # # options string: py # from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException from thrift.protocol.TProtocol import TProtocolException from thrift.TRecursive impo...
<reponame>dnisbet/python_lcd<filename>lcd/machine_gpio_lcd.py """Implements a HD44780 character LCD connected via pyboard GPIO pins.""" from lcd_api import LcdApi from machine import Pin import time, utime class GpioLcd(LcdApi): """Implements a HD44780 character LCD connected via pyboard GPIO pins.""" def _...
<reponame>krishotte/web_sperky<gh_stars>0 """A DashboardController Module.""" from masonite.request import Request from masonite.view import View from masonite.controllers import Controller from .PortfolioController import get_user from .auth.LoginController import get_caller_path from app.Product import Product from ...
<filename>seq2seq_attention.py<gh_stars>1-10 ''' This is a seq2seq model (hierarchical encoder - decoder) with constrained hierarchical attention (word-level attention + sent-level attention). The constraints are from the results of extractive summarization. ''' import sys import time import os import tensorflow as t...
import numpy as np import tensorflow.keras as keras from sklearn.model_selection import train_test_split from tensorflow.keras.layers import Dense from tensorflow.keras.losses import SparseCategoricalCrossentropy from tensorflow.keras.models import Sequential from tensorflow.keras.optimizers import Adam from tensorflow...
<filename>PythonBaseDemo/WINSOCKdemo/15.3/Senior/server/server_thread.py # coding: utf-8 ######################################################################### # 网站: <a href="http://www.crazyit.org">疯狂Java联盟</a> # # author yeeku.H.lee <EMAIL> # # ...
<filename>starbursts/plots/mpl.smoothing_time.py<gh_stars>0 """ Produces Fig. 2 of Johnson & Weinberg (2019), a 3-column by 2-row plot showing the effect of outflow smoothing time on the 5-Gyr gas- and efficiency-driven starburst models. Infall and star formation histories with SFE timescales are shown in the left-...
<gh_stars>0 import typing as t import warnings import attr from cached_property import cached_property from phd_qmclib.constants import ER from phd_qmclib.qmc_base import vmc as vmc_udf_base from phd_qmclib.qmc_base.jastrow import SysConfDistType from phd_qmclib.qmc_exec import ( exec_logger, proc as proc_base, v...
<gh_stars>1-10 """ Tests for :mod:`greenday_core.models.comment <greenday_core.models.comment>` """ from milkman.dairy import milkman from django.utils import timezone from ..models import ( User, Project, TimedVideoComment, ProjectComment ) from .base import AppengineTestBed class TimedVideoCom...
<gh_stars>0 from pgs_api import app from flask import request, jsonify from pgs_api.models.plan import Plan from pgs_api.models.plan import PlanService from pgs_api.models.country import Country, CountryService from pgs_api.extensions.jsonp import enable_jsonp from pgs_api.extensions.error_handling import ErrorResponse...
<reponame>nilthehuman/Hex import sys import time import copy import math from itertools import chain COPY_COUNTER = 0 class Square: x = -1 y = -1 def __init__(self, x, y): self.x, self.y = x, y #def __init__(self, algebraic): # self.x, self.y = algebraic_to_square(algebraic[0], algeb...
import sqlite3 as sql import cumodoro.config as config from cumodoro.error import DatabaseError from collections import deque import datetime import sys import logging log = logging.getLogger('cumodoro') class Task(): pass class Database(): def __init__(self): self.db = None self.cursor = Non...
# Circle packing in unit square using ADMM # minimize \sum_{i,j} f_{ij}(z_i, z_j) + \sum_i g_i(z_i) # f_{ij}(z_i, z_j) = 0, if ||z_i - z_j|| >= 2R # = infinity, if ||z_i - z_j|| < 2R # g_i(z_i) = 0, if R <= z_i <= 1 - R # = infinity, otherwise import numpy as np import itertools import matplo...
<reponame>chikiuso/vc2 import os import glob from models.cyclegan_vc2 import CycleGAN2 from speech_tools import * dataset = 'vcc2018' src_speaker = 'azure_val' trg_speaker = 'xi_val' model_name = 'cyclegan_vc2' data_dir = os.path.join('datasets', dataset) exp_dir = os.path.join('experiments', dataset) eval_A_dir = ...
<gh_stars>0 from ..broker import Broker class NeighborBroker(Broker): controller = "neighbors" def show(self, **kwargs): """Shows the details for the specified neighbor. **Inputs** | ``api version min:`` None | ``api version max:`` None ...
""" <NAME> License: MIT This is a simple script for creating battleship curves that I created for an archaeology class project. """ from matplotlib.pyplot import * from numpy import * #################### Data ###################### #Plug your values into here start_year = 1910 year_increment = 20 ...
""" Copyright 2021 Nirlep_5252_ 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 d...
# Face alignment demo # <NAME> (<EMAIL>) from __future__ import division import argparse import torch import torch.onnx import torchvision.transforms as transforms import os import cv2 import numpy as np #import dlib from common.utils import BBox,drawLandmark,drawLandmark_multiple from models.basenet import MobileNet_...
<filename>nullaway-eval/common.py import sys if sys.version_info[0] < 3: raise Exception("Must use Python 3!") import os.path, subprocess, configparser, logging, time, atexit repo_prefix = "repos" log_file = "eval.log" stats_file = "result.csv" #--- Do NOT change these --- repo_list = "eval_repos.txt" patch_prefix =...
import matplotlib.pyplot as plt import numpy as np from matplotlib.patches import Patch import sys inputFile=open(sys.argv[1]).readlines() opType=sys.argv[2] inputFile=[list(map(float,x.split("\t"))) for x in inputFile ] def prepare(arr2): arr=arr2.copy() bottoms=[] for l in arr: bottoms.append([...
<gh_stars>0 import psycopg2 as pg from faker import Faker from enum import Enum, IntEnum from typing import NamedTuple, List import random import re import string from tqdm import tqdm from pathlib import Path class TargetOutput(IntEnum): postgresql = 1 csv = 2 class PostgresqlType(Enum): date = "date" ...
import FWCore.ParameterSet.Config as cms ##################### Updated tau collection with MVA-based tau-Ids rerun ####### # Used only in some eras from RecoTauTag.Configuration.loadRecoTauTagMVAsFromPrepDB_cfi import * from RecoTauTag.RecoTau.PATTauDiscriminationByMVAIsolationRun2_cff import * ### MVAIso 2017v2 ## D...
<filename>src/ralph/lib/transitions/models.py # -*- coding: utf-8 -*- import inspect import logging import operator from collections import defaultdict import reversion from django import forms from django.conf import settings from django.contrib.auth.models import Permission from django.contrib.contenttypes.models i...
<gh_stars>0 """ ##### 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
<filename>ddt_python/ddt_tile.py class ddt_tile(): def __init__(self,tileparameters_I = [],specificparameters_I = []): if tileparameters_I:self.tileparameters = tileparameters_I; else: self.tileparameters = []; if specificparameters_I:self.specificparameters = specificparameters_I; e...
<gh_stars>1-10 import warnings from dataclasses import dataclass from typing import Dict, Any, Set, Optional from lucyfer.searchset.fields import BaseSearchField, FieldType from lucyfer.settings import lucyfer_settings @dataclass class SearchSetStorage: """ Class provides availability to use fields in Search...
from Sink import Sink, SinkInfo from pyjamas.ui.HTML import HTML from pyjamas.ui.VerticalPanel import VerticalPanel from SlideLoader import SlideLoader from pyjamas.HTTPRequest import HTTPRequest from pyjamas import Window def esc(txt): return txt def urlmap(txt): idx = txt.find("http://") if idx == -1: ...
from .forms import UserLoginForm from .models import Algorithm, Base, Currency, CurrencyApi, Pool, PoolAddress, PoolApi, User, Wallet, \ System, OperatingSystem, MiningApp, MiningDevice, Miner, MiningOperation from .poolapi import CryptonoteApi from .fixtures.loader import load_json from germine ...
<filename>styleTransfer.py import tensorflow as tf import tensorflow.contrib as contrib import numpy as np import scipy.io as sio import scipy.misc as misc from PIL import Image def conv(inputs, w, b): w = tf.constant(w) b = tf.constant(b) return tf.nn.conv2d(inputs, w, [1, 1, 1, 1], "SAME") + ...
# class User: # _persist_methods = ['get', 'save', 'delete'] # # def __init__(self, persister): # self._persister = persister # # def __getattr__(self, attribute): # if attribute in self._persist_methods: # return getattr(self._persister, attribute) # # # user = User(persister={'...
#!/usr/bin/env python # -*- coding: utf-8 -*- import simplejson as json from alipay.aop.api.constant.ParamConstants import * class KoubeiTradeTicketTicketcodeUseModel(object): def __init__(self): self._code_type = None self._gmt_biz = None self._order_no = None self._quantity = N...
<gh_stars>0 """ Configuration for 'treesync' CLI application """ from cli_toolkit.configuration import ( ConfigurationSection, YamlConfiguration ) from pathlib_tree.tree import SKIPPED_PATHS from .constants import ( DEFAULT_CONFIGURATION_PATHS, DEFAULT_EXCLUDES, DEFAULT_EXCLUDES_FILE, DEFAULT_...
<gh_stars>0 # coding: utf-8 # Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved. # This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2....
<filename>tests/helpers/test_paginator.py """ Tests for the Paginator """ import pytest from unittest.mock import Mock, call from styler_rest_framework.helpers.paginator import \ Paginator, InvalidParameterError class TestInit: """ Tests for constructor """ def test_init_a_paginator(self): p...
<filename>tanjun/conversion.py<gh_stars>0 # -*- coding: utf-8 -*- # cython: language_level=3 # BSD 3-Clause License # # Copyright (c) 2020-2021, Faster Speeding # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditi...
<gh_stars>10-100 """A parser for reading data from igs.snx file based on IGS sitelog files in SINEX format Example: -------- from midgard import parsers p = parsers.parse_file(parser_name='gnss_sinex_igs', file_path='igs.snx') data = p.as_dict() Description: ------------ Reads station information (e.g. ...
from flask import jsonify, abort, Blueprint, request, make_response import os import re import sys import uuid import jwt from datetime import datetime, timedelta build_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) sys.path.append(build_path) from configuration import SECRET_KEY from src.models i...
<gh_stars>1-10 from __future__ import division from sklearn.preprocessing import label_binarize #LINK-Logistic Regression [Zheleva, Getoor, 2009] uses labelled nodes to fit a regularized logistic regression model #(Supplementary Note 2.2) that interprets rows of the adjacency matrix as sparse binary feature vectors, #...
<filename>bigmacs_naive/adam_save_slr.py #!/usr/bin/env python ######################### # # Save slr offsets to the photometry database # ########################## import unittest, sys, os, optparse, re import pyfits, numpy as np sys.path.append('/u/ki/awright/bonnpipeline/') import photometry_db, ldac, adam_utiliti...
import glob, os, shutil, subprocess, re include_dirs = [ "common/tasking", "kernels/bvh", "kernels/builders", "common/sys", "kernels", "kernels/common", "common/math", "common/algorithms", "common/lexers", "common/simd", "common/simd/arm", "include/embree3", "kernels...
<reponame>opencdms/opencdms-api<filename>src/apps/climsoft/services/station_service.py import logging from typing import List from sqlalchemy.orm.session import Session from opencdms.models.climsoft import v4_1_1_core as models from apps.climsoft.schemas import station_schema from fastapi.exceptions import HTTPExceptio...
<gh_stars>0 #!/usr/bin/env python # -*- coding: utf-8 -*- import torch from copy import deepcopy from torch import nn from torch.nn.utils.rnn import pack_padded_sequence class ContextEncoder(nn.Module): """Sinal directional LSTM network, encoding pre- and pos-context. """ def __init__(self, ...
"""Tests local execution of a snapshot simulation.""" import os import shutil import pandas as pd import pytest from jade.result import ResultsSummary from jade.utils.subprocess_manager import run_command from disco.extensions.pydss_simulation.pydss_configuration import PyDssConfiguration from disco.extensions.pyds...
<reponame>pskrunner14/descriptor """ Data Utility Module for Image Captioning CRNN model. """ import os import json import collections import multiprocessing as mp import numpy as np import cv2 from tqdm import tqdm import torch import torchvision as vision import torchtext as text from descriptor.models.cnn_encode...
<reponame>jovi521/swsw import matplotlib.pyplot as plt import numpy as np from mpl_toolkits.basemap import Basemap import sys import os import time from fy4a import FY4A_AGRI_L1 def create_img(file_path, geo_range, save_dir): ''' file_path:需要解析的文件路径 geo_range:需要裁剪的区域范围和粒度,格式:最小纬度,最大纬度,最小经度,最大经度,粒度...
"""Allows user to collect data in a consistent manner.""" import re import subprocess from pylates import utils class PlatformNetworkManager(object): """Base class for platforms to implement. These classes implement methods to interact with the network and collect data. """ def __init__(self): ...
<gh_stars>1-10 """Functions having to do with physical location """ import math import requests from divvy import config def get_lat_lon(addr_string): """Convert an address to lat/lon Use the Google Maps Geocoding API to convert an address string (e.g. 123 North State Street) to a latitude and long...
<reponame>wzhengui/pylibs #!/usr/bin/env python3 ''' Extract SCHISM variable values at (x,y,z) from station.bp. 1). work for both uncombined and combined SCHISM outputs 2). can extract multiple variables at the same time 3). can work in interactive or batch mode 4). output in ACSII or *npz format ''' from py...
<reponame>the-scouts/incognita """Merges ONS postcode data with census data Outputs a file which is contains the original census data, a postcode validity check, and the merged data. The output fields are those in the census and ONS data, and the additional fields 'postcode_is_valid' and 'clean_postcode'. """ import...
<filename>guiMenu.py import sys from PySide2 import QtWidgets, QtCore from gui import GuiDigitalSignature from pki import Pki from RsaPssSignature import RsaPssSignature class GuiMenu: def __init__(self, window): self.pki = Pki() self.rsa = RsaPssSignature() self.rsaReceiver = RsaPssSignature() self...
"""Handle password rules.""" import re import unicodedata from django.contrib.auth.hashers import check_password from django.core.exceptions import ValidationError from django.utils.translation import gettext_lazy as _ from cpovc_access import BasePolicy from cpovc_access.models import PasswordChange def _normalize...
<gh_stars>10-100 from os.path import dirname, realpath, join from torrentool.torrent import Torrent from torrt.base_rpc import BaseRPC from torrt.base_tracker import GenericPublicTracker from torrt.toolbox import bootstrap, TrackerClassesRegistry, NotifierClassesRegistry, RPCClassesRegistry, \ configure_rpc, conf...
<filename>gfsm/fsm_builder/fsm_builder.py import operation_loader import sys from gfsm.transition import Transition from gfsm.event import Event from gfsm.state import State from ..action import fsm_action class FsmBuilder(): def __init__(self, config, definition): self.config = config self.definition = def...
<filename>autogluon/task/tabular_prediction/predictor.py import logging import pandas as pd from .dataset import TabularDataset from ..base.base_predictor import BasePredictor from ...utils import plot_performance_vs_trials, plot_summary_of_models, plot_tabular_models, verbosity2loglevel from ...utils.tabular.ml.cons...
<reponame>AdrianAndersen/TDT4113-Computer-Science-Programming-Project<filename>4-Calculator/Calculator.py<gh_stars>0 import numbers import re import numpy from Function import Function from logger.Logger import Logger from Operator import Operator from Queue import Queue from Stack import Stack class Calculator: ...
<reponame>maserasgroup-repo/pyssian """ One of the two core libraries of pyssian. Contains the Classes that represent Gaussian Files (input and output). """ import io import re from itertools import chain from .chemistryutils import is_method, is_basis from .linkjobparsers import LinkJob, GeneralLinkJob # Pre-Initial...
#!/usr/bin/env python # coding: utf-8 # <b>Python Scraping of Book Information</b> # In[1]: get_ipython().system('pip install bs4') # In[2]: get_ipython().system('pip install splinter') # In[3]: get_ipython().system('pip install webdriver_manager') # In[1]: # Setup splinter from splinter import Browser ...
<gh_stars>1-10 #!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2019 The FATE 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...
from util import Events from PIL import Image import urllib.request import re import os import unicodedata # rudimentary regex match for finding syllables SYLLABLE = "([aeiouyAEIOUY]|[0-9])" class Plugin(object): def __init__(self, pm): self.pm = pm @staticmethod def register_events(): "...
<filename>main.py from enum import Enum, auto import collections import io import json class AddressMode(Enum): Sig8 = auto(), Imm8 = auto(), Imm16 = auto(), ImmX = auto(), ImmM = auto(), Abs = auto(), AbsIdxXInd = auto(), AbsIdxX = auto(), AbsIdxY = auto(), AbsInd = auto(), ...
<filename>moocs/livedu.py<gh_stars>10-100 # -*- coding: utf-8 -*- """北京高校优质课程研究会""" import time from bs4 import BeautifulSoup from moocs.utils import * from utils.crawler import Crawler name = "livedu" need_cookies = True CANDY = Crawler() CONFIG = {} FILES = {} VIDEOS = [] exports = {} __all__ = ["name", "need_coo...
import unittest from offsetbasedgraph import GraphWithReversals as Graph, Block, \ DirectedInterval as Interval from graph_peak_caller import Configuration from graph_peak_caller.sample import get_fragment_pileup from graph_peak_caller.intervals import Intervals from util import from_intervals class Tester(unitte...
import argparse import asyncio import logging import pathlib import sys import yaml from aiohttp import web from app.api.rest_api import RestApi from app.service.app_svc import AppService from app.service.auth_svc import AuthService from app.service.contact_svc import ContactService from app.service.data_svc import D...
<filename>power_planner/graphs/tests/test_ksp.py import unittest import numpy as np from types import SimpleNamespace from power_planner.graphs.weighted_ksp import WeightedKSP from power_planner.graphs.implicit_lg import ImplicitLG from power_planner.ksp import KSP class TestKsp(unittest.TestCase): expl_shape = ...
<filename>packages/plugins/minos-database-aiopg/minos/plugins/aiopg/factories/aggregate/events.py<gh_stars>100-1000 from collections.abc import ( Iterable, ) from datetime import ( datetime, ) from typing import ( Any, Optional, ) from uuid import ( UUID, ) from psycopg2.sql import ( SQL, C...
<gh_stars>0 # Copyright 2019 The Cirq Developers # # 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 a...
<gh_stars>10-100 '''This models is an example for training a classifier on SNLI''' from __future__ import print_function from os.path import join import nltk import numpy as np import os import urllib import zipfile import sys from spodernet.hooks import AccuracyHook, LossHook, ETAHook from spodernet.preprocessing.pi...
<reponame>pyrrrat/moved-ironic # 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...
<gh_stars>1-10 #!/usr/bin/ # -*- coding: utf-8 -*- # #--------------------------------main file------------------------------------ # # # # Copyright (C) 2020 by # # <NAME> (<EMAIL>) # # B # # & # # B # # <NAME> (<EMAIL>) # # # #-------------------------...
"""Unit tests for aws parameter store interactions with boto3""" from __future__ import annotations from typing import Any from typing import Generator from unittest.mock import patch import pytest from secretbox.awsparameterstore_loader import AWSParameterStore boto3_lib = pytest.importorskip("boto3", reason="boto3...
""" The render of the bulldozer consists of four subplots: 1. Local Grid + Grid centered at current position, visualizes agent's micromanagment 2. Global Grid + Whole grid view, visualizes agent's strategy 3. Gauge + Shows time until next CA update 4. Counts + Shows Forest vs No Forest cell counts. Tran...
<reponame>diogo149/doo from __future__ import division, absolute_import from __future__ import print_function, unicode_literals import matplotlib import matplotlib.pyplot as plt try: from .. import utils except ValueError: # if using as a standalone script from d import utils def plot_training_curves( ...
<reponame>nilfoer/mangadb<filename>manga_db/extractor/__init__.py # some of this code is taken from: # https://github.com/mikf/gallery-dl/tree/master/gallery_dl by <NAME> import os import inspect import importlib from typing import List, Iterator, Union, Dict, Type, cast from .base import BaseMangaExtractor from ..ex...
# Copyright (c) 2019-2021, <NAME>, <NAME>, <NAME>, and <NAME>. # # Distributed under the 3-clause BSD license, see accompanying file LICENSE # or https://github.com/scikit-hep/vector for details. """ Defines behaviors for Awkward Array. New arrays created with the .. code-block:: python vector.Array(...) functi...
<gh_stars>0 import tvm from tir_dataset import TIRPrograms import sqlite3_dataset import torch from torch import nn from torch.utils.data import DataLoader import torch.optim as optim import torch.autograd.profiler as profiler import numpy as np import cProfile device = torch.device("cuda") class TokenEmbedding(...
<filename>generalized_lloyd_quantization/demo-dict.py import os import time import pickle import torch import numpy as np from matplotlib import pyplot as plt from null_uniform import compute_quantization as uni from generalized_lloyd_LBG import compute_quantization as gl from optimal_generalized_lloyd_LBG import comp...
from abc import ABC, abstractmethod from enum import Enum import json from bs4 import BeautifulSoup, Tag from flask import render_template from curriculum import model, repository from responses import repository as responses_repository class RenderTarget(Enum): AUTHORING = 1 TEACHING = 2 RESPONDING = 3...
import csv import gzip import os import cv2 from tqdm import tqdm from time import sleep import shutil import matplotlib import matplotlib.pyplot as plt import scipy.io import pandas as pd import numpy as np import projectModels import projectUtilities import torch import torchvision import torch...
<reponame>propyless/openshift-tools<filename>scripts/monitoring/ops-ec2-check-tags.py #!/usr/bin/env python # vim: expandtab:tabstop=4:shiftwidth=4 """ This is a script that gathers tags from instances and reports the status of the tags to zabbix Usage: ops-ec2-check-tags.py --aws-creds-profile profile1 --cluste...
# -*- coding: utf-8 -*- import base64 import datetime as dt import sqlalchemy from celery import Celery from flask import current_app, json from kombu import Exchange, Queue from polylogyx.models import Settings, AlertEmail, Node, ResultLog, StatusLog, db, Alerts, CarveSession, DistributedQueryTask from polylogyx.con...
<gh_stars>0 # -*- coding: utf-8 -*- """ Created on Sun Mar 6 15:27:04 2016 @author: alex """ from AlexRobotics.planning import RandomTree as RPRT from AlexRobotics.dynamic import Hybrid_Manipulator as HM from AlexRobotics.control import RminComputedTorque as RminCTC import numpy as np import matplot...
<gh_stars>1-10 #!/usr/bin/python3 # -*- coding: utf-8 -*- # Developed in Python3 # RUN WITH ROOT USER!!! # Install NETIFACES: 'pip3 install netifaces' """ +-------------------------------------------------------+ | Create BY: <NAME> | | | | [*] ...
<filename>pywebhdfs/webhdfs.py from six.moves import http_client import requests try: from urllib.parse import quote, quote_plus except ImportError: from urllib import quote, quote_plus from pywebhdfs import errors, operations class PyWebHdfsClient(object): """ PyWebHdfsClient is a Python wrapper fo...
# --- # jupyter: # jupytext: # formats: ipynb,py # text_representation: # extension: .py # format_name: light # format_version: '1.5' # jupytext_version: 1.11.1 # kernelspec: # display_name: Python 3 # language: python # name: python3 # --- # ## Cleaning scraped game dat...
import tarfile import requests import shutil import binascii import os import neo import struct import asyncio from contextlib import contextmanager from neo.Utils.NeoTestCase import NeoTestCase from neo.Storage.Implementation.DBFactory import getBlockchainDB from neo.Storage.Interface.DBInterface import DBInterface f...
<gh_stars>1-10 # Copyright (C) 2010, 2011 <NAME> (<EMAIL>) and contributors # # This module is part of GitDB and is released under # the New BSD License: http://www.opensource.org/licenses/bsd-license.php from git.test.lib import rorepo_dir from git.test.db.base import RepoBase from git.util import bin_to_hex from git...
import torch from rdkit import Chem import networkx as nx from seq_graph_retro.molgraph.mol_features import get_atom_features, get_bond_features from seq_graph_retro.molgraph.mol_features import BOND_FDIM, ATOM_FDIM, BOND_TYPES from seq_graph_retro.utils.torch import create_pad_tensor from typing import Any, List, Di...
<reponame>mh0x/twister #!/usr/bin/env python3 # Twister v0.9 # https://github.com/mh0x/twister import argparse import collections import concurrent.futures import copy import itertools import json import os import re import requests import sys __version__ = '0.9' __author__ = 'https://github.com/mh0x' script_name...
from itertools import combinations as combinations from operator import attrgetter import Player as P ### class PokerPool(P.Player): '''Derived class for pool of common cards''' max_cards = 5 def __init__(self, name): P.Player.__init__(self, name) self.hand.max_cards = self.max_cards ### class PokerHand...
''' Project: Predicting movie genres from movie posters Course: COMPSCI 682 Neural Networks: A Modern Introduction File: run_external_test.py Description: Runs test for an external image from its URL on the internet. Author: <NAME> ''' import sys import operator import numpy as np import data_load as dl from os impo...
<filename>app/Populator.py import posixpath from typing import Dict, List from pyairtable import Api, Table from pyairtable.metadata import get_api_bases from pyairtable.formulas import match from Schema import Schema class Populator: base_id: str = None airtable_api: Api = None base_table: Table = None...
# Copyright (c) 2013 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Allows creation of i2c interface for beaglebone devices.""" import logging import subprocess import bbmux_controller import common as c import i2c...
<reponame>metahertz/picobrew_pico import json from .config import brew_active_sessions_path from .model import PicoBrewSession file_glob_pattern = "[!._]*.json" active_brew_sessions = {} active_ferm_sessions = {} def load_brew_session(file): info = file.stem.split('#') # 0 = Date, 1 = UID, 2 = RFID / Sess...
<filename>adaptive_attention.py<gh_stars>1-10 import tensorflow as tf from tensorflow.python.ops import rnn, rnn_cell, seq2seq from utils import get_seq_length, _add_gradient_noise, _position_encoding, _xavier_weight_init, _last_relevant, batch_norm #from https://github.com/DeNeutoy/act-rte-inference/blob/master/Ad...
<reponame>ericazhou7/uSurvey<filename>survey/forms/question.py from django import forms from django.forms import ModelForm import re from django.core.exceptions import ValidationError from django.conf import settings from survey.models import Question, BatchQuestion, QuestionSet from survey.models import (QuestionOptio...
import time import numpy as np from tqdm import trange import scipy.sparse as sp from scipy.linalg import norm from joblib import Parallel, delayed from vezda.math_utils import humanReadable from vezda.svd_utils import load_svd, svd_needs_recomputing, compute_svd from vezda.LinearOperators import asConvolutionalOperato...