text stringlengths 3.07k 22.1k |
|---|
import torch
import torch.nn as nn
import torch.nn.functional as F
from model.net.backbone import Conv_BN_Act
# from mish_cuda import MishCuda as Mish
# #if mish_cuda is not avalible try whats below
class Mish(nn.Module):
def __init__(self):
super().__init__()
def forward(self, x):
device ... |
# -*- coding:utf-8 -*-
import datetime
from api.lib.database import Model
from api.extensions import db
# template
class RelationType(Model):
__tablename__ = "c_relation_types"
name = db.Column(db.String(16), index=True)
class CITypeGroup(Model):
__tablename__ = "c_ci_type_groups"
name = db.Co... |
# import tvm
import os
import numpy as np
import matplotlib.pyplot as plt
# from flextensor.examples import FUNC_TABLE
class Point(object):
def __init__(self, factor_lst, performance):
self.xs = tuple(factor_lst)
self.y = performance
self.dim = len(factor_lst)
def __str__(self):
... |
import tensorflow as tf
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
from numpy.random import random_integers
import os
import pandas as pd
from math import floor
# Matplotlib fig params
mpl.rcParams['figure.figsize'] = (8, 6)
mpl.rcParams['axes.grid'] = False
# Enable eager for easy t... |
# -*- coding: utf-8 -*-
#
# Copyright © 2017 Spyder Project Contributors
# Licensed under the terms of the MIT License
# (see LICENSE.txt for details)
"""Tests for pytestrunner.py"""
# Standard library imports
import os
import os.path as osp
# Third party imports
import pytest
from qtpy.QtCore import QByteArray
# Lo... |
'''
Created on Jul 17, 2017
@author: gpetrochenkov
'''
#!/usr/bin/env python3
import sys
import csv
import pandas as pd
current_path = sys.path[0]
sys.path.append(''.join([current_path,'\\..']))
sys.path.append(''.join([current_path,'\\..\\netCDF_Utils']))
from netCDF4 import Dataset
import numpy as np
import netCDF_U... |
import blst
import hashlib
from poly_utils import PrimeField
from time import time
import sys
import gmpy2
#
# Proof of concept implementation for Eth1 simple custody
#
# https://notes.ethereum.org/1Rn2MwsoSWuEUHTnaRgLcw
#
# BLS12_381 curve modulus
MODULUS = 0x73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff... |
from __future__ import annotations
import copy
import math
import numpy as np
from matplotlib import animation
from matplotlib import pyplot as plt
MAX_LENGTH = 40
def get_plan() -> list[float]:
"""
TODO: make a plan, which is a list of 40 floats between -1.0 and 1.0.
- The order of nums roughly corre... |
import numpy as np
from tqdm.autonotebook import trange
import torch
import torch.nn as nn
from matgps.segments import WeightedAttention, SimpleNetwork, ResidualNetwork
from matgps.utils import AverageMeter
class ReactionNet(nn.Module):
"""
Create a neural network for predicting elements in product from pr... |
# -*- coding:utf-8 -*-
# by:kracer
import re
import requests
import time
from threading import *
from multiprocessing import Process
from bs4 import BeautifulSoup as bs
import matplotlib.pyplot as plt
url0 = "https://src.sjtu.edu.cn/list/?page="
submitter_index_dic, edu_index_dic = {}, {}
datas = [] #承载爬虫... |
import pandas as pd
import re
from builtins import hasattr
from datetime import datetime, timedelta
import requests
from flask import request, current_app as app
from mongo_orm import MongoDB, AnyField
from oadr_core.exceptions import InvalidReportException
from oadr_core.oadr_payloads.oadr_payloads_general import EL... |
import getopt
import math
import random
import sys
import tsplib95
from tsplib95 import distances
import numpy as np
def matrix(coord, distance):
n = len(coord)
distance_matrix = np.zeros((n, n))
for i in range(0, n):
for j in range(0, n):
distance_matrix[i][j] = int(distance((coord[i][... |
#!/usr/bin/env python
#
# Potaplanje ladjic na vecih racunalnikih!
# Imamo eno vozlisce, ki skrbi za spletni streznik in ostala,
# ki predstavljajo igralce. Ta vozlisca zbirajo tocke (vsak
# potopljen del da vozliscu eno tocko). Zmaga tisto, ki ima
# najvec tock ob koncu igre
#
# Pozeni na clustru:
# mpirun -n 10 -mca... |
from collections import Counter
from datetime import datetime
import gzip
import json
import math
import random
import numpy as np
from scipy.sparse import dok_matrix, csr_matrix
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from src.data.filesystem import fopen
from s... |
##############################################################################
##
# This file is part of Sardana
##
# http://www.sardana-controls.org/
##
# Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
##
# Sardana is free software: you can redistribute it and/or modify
# it under the terms of the GNU Less... |
from bs4 import BeautifulSoup
import requests
import difflib
import re
import datetime
import xmltodict
import myawis
import pywikibot
import pywikibot.xmlreader
from pywikibot.pagegenerators import XMLDumpPageGenerator
secrets = open("secrets").read().split("\n")[0].split(",")
ACCESS_KEY = secrets[0]
SECRET_KEY = sec... |
# -*- coding: utf-8 -*-
import re
import sys
import random
from typing import List, Tuple
import requests
from requests.models import Response
def find_links_in_text(text: str) -> List[str]:
"""Find links in a text and return a list of URLs."""
link_pattern = re.compile(r'((?:https?://|www\d{0,3}[.]|[a-z0-... |
import collections
from distutils.dir_util import copy_tree
import functools
import logging
import inspect
import os
import random
import socket
import string
import sys
import tempfile
import time
from gym.utils import seeding
import hermes.backend.dict
import hermes.backend.redis
import numpy as np
import ray
import... |
# -*- encoding: utf-8 -*-
import discord
from discord.ext import commands
from .utils.dataIO import dataIO
from .utils import checks
from typing import Union
from datetime import datetime,timedelta
import time
import os
import re
try:
import pymysql
except:
print ("Error! pymysql not installed")
raise SystemExit
re... |
import typing as tp
import astropy.io.fits as fits
import astropy.time as astro_time
import astropy.units as u
import h5py
import numpy as np
import scipy.interpolate as interpolate
from astropy.coordinates import get_body, get_moon, get_sun
from gbmgeometry.utils.gbm_time import GBMTime
class PositionInterpolator(... |
# Copyright (c) OpenMMLab. All rights reserved.
import os.path as osp
import mmcv
import numpy as np
from ..builder import HOI_PIPELINES
try:
from panopticapi.utils import rgb2id
except ImportError:
rgb2id = None
@HOI_PIPELINES.register_module()
class LoadImageFromFile:
"""Load an image from file.
... |
""" Functions that extract a Query Object from the GraphQL query
It goes through the Query tree, and:
1. Find every `query` argument and takes the Query Object 'filter', 'sort', etc, from it
2. It walks the selected fields and adds them as Query Object 'select' or 'join'
"""
from typing import Union, Any, Optional
f... |
# -*- coding: utf-8 -*-
#-------------------------------------------------------------------------------
# Name: search.py
# Purpose: Tools for searching analysis
#
# Authors: <NAME>
#
# Copyright: Copyright © 2011 <NAME> and the music21 Project
# License: LGPL or BSD, see license.txt
#-------... |
# -*- coding:utf-8 -*-
# @Time: 2021/11/6 下午5:41
# @Author: Haiton
import numpy as np
import tensorflow as tf
class Encoder(tf.keras.layers.Layer):
def __init__(self, n_layers, d_model, num_heads, middle_units,
max_seq_len, epsilon=1e-6, dropout_rate=0.1, training=False, **kwargs):
super... |
'''
Gui/Views/Crosslink_Discoverer/crosslinkers
___________________________________________
View to select, edit, and add new crosslinkers.
:copyright: (c) 2015 The Regents of the University of California.
:license: GNU GPL, see licenses/GNU GPLv3.txt for more details.
'''
# load modules/submodul... |
# -*- coding: utf-8 -*-
"""Console script for exo."""
import errno
import math
import sys
import click
import numpy as np
# Adapted Java treeview image compression algorithm
def rebin(a, new_shape):
M, N = a.shape
m, n = new_shape
if m >= M:
# repeat rows in data matrix
a = np.repeat(a... |
# Copyright (C) 2021, <NAME>, <NAME> <<EMAIL>>
#
# License: MIT (see COPYING file)
import warnings
import numpy as np
import pandas as pd
from sklearn.preprocessing import MinMaxScaler
# __all__ = ['CytOpT']
from CytOpT.descentAscent import cytoptDesasc
from CytOpT.minmaxSwapping import cytoptMinmax
from CytOpT.plot... |
#!/usr/bin/python -OOBRStt
""""""
from pysec.core import is_int, is_str, is_dict
SPECIAL_CHARS = '\\', '*', '?', '!', '[', ']', '{', '}', '-', ',', '#', '@'
ALPHA = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
DIGITS = '0123456789'
LOWER = 'abcdefghijklmnopqrstuvwxyz'
UPPER = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
A... |
import torch
import torch.nn as nn
import torch.nn.functional as func
def _compute_indices(data, indices, counts, max_count):
offset = max_count - counts
offset = offset.roll(1, 0)
offset[0] = 0
offset = torch.repeat_interleave(offset.cumsum(dim=0), counts, dim=0)
offset = offset.to(data.device)
index = o... |
#!/usr/bin/env python3
# Copyright 2004-present Facebook. All Rights Reserved.
from abc import ABC, abstractmethod
from dataclasses import dataclass, field
from typing import (
Any,
AsyncIterator,
Awaitable,
Callable,
Coroutine,
List,
Optional,
Sequence,
Tuple,
)
from typing_extens... |
from discord.ext.commands import Cog, Greedy
from discord.ext.commands import command,cooldown,BucketType
from discord.ext.commands import MissingRequiredArgument, CheckFailure
from discord.ext.commands import bot_has_permissions, has_permissions
from discord.utils import get
from discord import Member,Embed,Permission... |
# Copyright 2016 <NAME>
#
# 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
__all__ = ['Averager']
import time
import itertools
import numpy as... |
# coding=utf-8
# This is a sample Python script.
from aliyunIoT import Device
import ujson
import network
import utime as time
from driver import GPIO
from driver import UART
t1 = 30
gas_threshold = 5.0
liq_mdcn_alarm = False
gas_alarm = False
version = 'v0.0.1'
uart1 = UART('serail1')
liq_level = GPIO()
gpio = GPIO()... |
import hashlib
import io
import os
import uuid
from functools import lru_cache
from pathlib import Path
import xmltodict
from fastapi import Depends
from pydantic import BaseModel
from .config import Settings
class CheckInfoBasesResponse(BaseModel):
InfoBasesChanged: bool = False
URL: str
location: str
... |
import nltk
import discord
from discord.ext import commands
from nltk.sentiment import SentimentIntensityAnalyzer
import database as db
import variables as var
from functions import get_prefix
from ext.permissions import has_command_permission
nltk.download('vader_lexicon')
sia = SentimentIntensityAnalyzer()
class ... |
from features import Features
from classifiers import Classifiers
import pandas as pd
import numpy as np
from sklearn.model_selection import train_test_split, KFold, cross_val_score, GridSearchCV
from sklearn.metrics import confusion_matrix
from sklearn import decomposition
from sklearn.preprocessing import StandardSc... |
# -*- coding: utf-8 -*-
# Copyright 2016 Resonai Ltd. 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 requir... |
"""File metadata capture and reporting utility."""
import argparse
import datetime
from io import open
import logging
import os
import sys
import unicodecsv as csv
import peewee
import jinja2
"""
MIT License
Copyright (c) 2018 <NAME>, <NAME>
Please share comments and questions at:
https://github.com/PythonForensics/... |
# -*- coding: utf-8 -*-
"""
cctconvert
A Cookiecutter Template Transformer Utility
-------------------------------------------
Convert a version 1 cookiecutter.json file into a version 2 file.
The only external dependency required is:
pip install click
For the User Manual:
python cctconvert.py --help
or ... |
# (c) 2005-2020 <NAME> <<EMAIL>>.
# MIT License. See LICENSE.
# vim: ft=python sw=2 ts=2 sts=2 tw=80
"""The Bominade file browser."""
import os
from gi.repository import Gio, GLib, GObject, Gdk, Gtk, GdkPixbuf, Pango
from b8 import ui
DEFAULT_FILE_ATTRIBUTES = '*'
class FileListItem:
"""Item to go in the file... |
"""
Map View:
1. iterable_view: consists of
a. .__getitem__(item) method that returns the value of the iterable;
b. .iterable() property that refers to the original iterable;
b. .iter_loc(*args, **kwargs) method that generate an iterator of the
iterable.
2. map view itself should... |
# -*- coding: utf-8 -*-
"""
"""
from __future__ import division, print_function, unicode_literals
from ..utilities.future_from_2 import str
import numpy as np
from collections import defaultdict
import declarative
from numbers import Number
import scipy.sparse as scisparse
import scipy.sparse.linalg as scisparselin
fr... |
from path import Path
import json
import numpy as np
#for reoffset
from math import cos,sin,sqrt,pi
roll, pitch, yaw, x, y, z = 0, 1, 2, 3, 4, 5
points_dict = {"point": {"x": 0, "y": 0, "z": 0}, "angle": {"yaw": 0, "pitch": 0, "roll": 0, "fov": 70}}
def aptPath2pose6dof(points):
'''
saved as rpy, zyx seq,
... |
import path_utils
import gym
import numpy as np
import os, json, time
import Agent
import plot_fns
gym.logger.set_level(40)
"""
Sample class
--------------------
Used to run an agent in a gym env over a number (N_samples) of samples. Each
sample, the same agent is run for N_episodes, because for many envs, differe... |
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import astropy.units
__all__ = ['hide_existing_labels', 'calculate_axis_extent', 'calculate_extent', 'class_cmap']
def hide_existing_labels(plot_settings, axes=None, fig=None):
"""Hides labels for each dictionary provided if label alrea... |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 <NAME>
# Copyright 2014 <NAME>
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in com... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
'''
© 2012-2013 eBay Software Foundation
Authored by: <NAME>
Licensed under CDDL 1.0
'''
import sys
from lxml import etree as ET
from xml.sax.saxutils import escape
if sys.version_info[0] >= 3:
unicode = str
long = int
def parse_yaml(yaml_file)... |
from keras.preprocessing.sequence import pad_sequences
from keras.preprocessing.text import Tokenizer
from gensim.models import Word2Vec
from config import EMBEDDING_DIM
import numpy as np
import pickle
import gc
from numpy import array
import numpy as np
# constants for test / train / trial data
TEST = 'TEST'
TRAIN =... |
# -*- coding: utf-8 -*-
# filename : scraper.py
# description : Grabs movie links
# author : LikeToAccess
# email : <EMAIL>
# date : 07-15-2021
# version : v2.0
# usage : python scraper.py
# notes :
# license : MIT
# py versi... |
import numpy as np
import random as rd
import torch
from log import Logger
import torch.nn as nn
from c4Grid import c4Grid
IN_LEN=43
OUT_LEN=7
NUM_IMG=1
DEVICE=torch.device("cpu") if torch.cuda.is_available() else torch.device("cpu")
DTYPE=torch.float
LR=1e-3
NUM_ITERATIONS=401
INF = 1000000
RED = 2
YELLOW = 1
DRAW ... |
import pickle
import random
import torch
from torch.utils.data import Dataset, DataLoader
from torch.utils.data.sampler import Sampler
from wavernn_vocoder.utils.dsp import *
from wavernn_vocoder.utils import hparams as hp
from wavernn_vocoder.utils.text import text_to_sequence
from wavernn_vocoder.utils.paths import P... |
""" mc5005.py
A python module to control Faulhaber motors via the MC5005 Motion Controller and serial interface.
- Setup your motor with Motion Manager first.
- Install pyserial from PyPI
Now you can use this module to control the motor via serial interface (needs setup first of course).
python 3 support only
Copyrig... |
#
# pyip is a Python package offering assembling/disassembling of raw ip packet
# including ip, udp, and icmp. Also it includes 2 utilities based on raw ip,
# traceroute and ping.
#
# pyip is released under PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2, and is
# a project inspired by 'ping' written by <NAME>.
#
# Autho... |
import os
import copy
import yaml
import pandas as pd
from autumn.model_runner import build_model_runner
from autumn.tool_kit.scenarios import Scenario
from autumn.tool_kit.params import update_params
from datetime import date, timedelta
from apps.covid_19 import RegionApp
from apps.covid_19.mixing_optimisation.cons... |
import math
import numpy as np
import pandas as pd
import hashlib
import sys
import os
import shutil
import cv2
import tempfile
from google.cloud import storage
from tqdm import tqdm
import statistics
import torch
import PIL
from PIL import Image, ImageDraw
vis_tmp_path = "/tmp/detect/" #!!!don't spe... |
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... |
import face_model
import argparse
import cv2
import sys
import numpy as np
from model_pytorch import *
import mxnet as mx
# model initialization for PyTorch from MXnet params
class Mxnet2Pytorch(object):
def __init__(self):
pass
def init_model(self, pytorch_model, mxnet_model_path):
sym, param_... |
import torch
import torch.nn as nn
import pandas as pd
from torch.utils.data import DataLoader, Dataset
import jieba
from utils import WVEmbedding
from torch.optim.lr_scheduler import MultiStepLR
from matplotlib import pyplot as plt
import numpy as np
from torch import optim
from utils import WaiMaiDataSet
... |
# -*- coding: utf-8 -*-
"""SAM module models."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.db import models
fr... |
import random
import numpy as np
import pandas as pd
def remove_unlinked_triples(triples, linked_ents):
print("before removing unlinked triples:", len(triples))
new_triples = set()
for h, r, t in triples:
if h in linked_ents and t in linked_ents:
new_triples.add((h, r, t))
print("... |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
# @author Metro
# @time 2021/11/03
import torch
import matplotlib.pyplot as plt
import numpy as np
def soft_update(target, source, tau):
for target_param, param in zip(target.parameters(), source.parameters()):
target_param.data.copy_(target_param.data * (1.0 - tau) + param.data * tau)
def hard_update(... |
"""
Description: cost measurement functions
Contributors: <NAME>, <NAME>, <NAME>
License: The MIT license, https://opensource.org/licenses/MIT
This file is part of the Differentiable Intonation Tools
https://github.com/simonschwaer/differentiable-intonation-tools/
"""
import numpy as np
def tonal(f, K=12, f_ref=440... |
import random
import math
import numpy as np
from environment import Agent, Environment
from planner import RoutePlanner
from simulator import Simulator
class LearningAgent(Agent):
""" An agent that learns to drive in the Smartcab world.
This is the object you will be modifying. """
def __init__(self... |
# coding=utf-8
from __future__ import print_function
import os
from datetime import datetime
from authcode import utils
from authcode._compat import text_type
from sqlalchemy_wrapper import SQLAlchemy
import authcode
import pytest
from helpers import SECRET_KEY
class User(object):
id = 3
password = '<PASSW... |
from datetime import datetime, timedelta
from django.http import request
from rest_framework import generics, permissions, renderers
from rest_framework.generics import GenericAPIView
from rest_framework.mixins import UpdateModelMixin
from rest_framework.parsers import FormParser, JSONParser, MultiPartParser
from rest... |
"""
Utils to handle different jedi versions
"""
from logging import getLogger
from typing import Dict, List, Optional
import jedi.api.classes
try:
# Since 0.17
from jedi.api.classes import ParamName
except ImportError:
try:
# Since 0.15
from jedi.api.classes import ParamDefinition as Param... |
# -*- coding: utf-8 -*-
"""
Created on Sat Jan 16 19:09:17 2021
@author: sarangbhagwat
"""
# %% Imports and chemicals initialization
import numpy as np
import thermosteam as tmo
import biosteam as bst
import copy
from biorefineries.HP.chemicals_data import HP_chemicals
from biorefineries.HP.system_light_lle_vacuum_... |
#
# Copyright (c) 2021, 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 copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... |
'''
This file contains the functions for the groupig/clustering algorithm from Watkins & Yang, J. Phys. Chem. B, vol 109, no 1, 2005
that do the actual work. THis includes
(1) initial hierarchical clustering - InitialClustering
(2) with that clustering as input, Bayesian Inf. Crit. based clustering into m-levels
'''... |
#!/usr/bin/env python3
import os, sys, argparse, time, csv
from gensim.models import Word2Vec, FastText
from sklearn.manifold import TSNE
import matplotlib.pyplot as plt
from tqdm import tqdm
import numpy as np
from dump_w2v import dump_w2v
from wordcloud import WordCloud
import pandas as pd
from gensim.models import ... |
# Copyright 2018 The GamePad 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 applicable... |
# specific to block code
from approximate_assignment_blocks import *
from discrete_measures_blocks import *
import csv
import os
import geopandas as gpd
import time
import threading
import psutil
import time
t0 = time.time()
def discrete_perim_and_area(df_dist, df_units, membership):
'''
This used to be in di... |
import itertools
from collections import defaultdict
from copy import deepcopy
from typing import List, Dict, Any, Tuple, Sequence, Optional, Iterator
from pyfileconf.basemodels.config import ConfigBase
from pyfileconf.logger.logger import logger
from pyfileconf.plugin import manager
from pyfileconf.runner.models.inte... |
#Generates a powershell script from the set of random malicious commands
import random
import string
import pexpect
import os
import sys
import math
import multiprocessing
import glob
def get_random_dest():
path = "/" + "".join([random.choice(string.ascii_letters + string.digits) for _ in range(random.randint(5,10))]... |
from django.contrib.auth.models import User
from django.core.mail import EmailMessage
from api.helper import json_response, json_error_response, json_400_incorrect_use
from api.sms import send_sms
from api.utils import parse_iso, random_letters, random_digits
from customer.sql import get_ranking_results
from employee.... |
import socket
import random
import argparse
import sys
from io import BytesIO
# Referrer: https://github.com/wuyunfeng/Python-FastCGI-Client
PY2 = True if sys.version_info.major == 2 else False
def bchr(i):
if PY2:
return force_bytes(chr(i))
else:
return bytes([i])
def bord(c):
if isins... |
# -*- coding: utf-8 -*-
# Copyright 2021 CERN
#
# 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... |
import asyncio
import mimetypes
import os
import sys
from functools import partial
from pathlib import Path
from typing import Optional
import aiohttp
import discogs_client
import json5
import music_tag
from music_tag import AudioFile
from peewee import IntegrityError, OperationalError
from jukebox import APP_ROOT, C... |
from os import listdir
import os
import shutil
import datetime
import sys
import logging
from buhayra.getpaths import *
import buhayra.utils as utils
from buhayra.utils import getWMinScene, checknclean, geojson2shapely
import sar2watermask.metadata as metadata
import xml.etree.ElementTree
from snappy import Product
fro... |
from sonic_py_common.interface import get_interface_table_name, get_intf_longname, VLAN_SUB_INTERFACE_SEPARATOR
from sonic_py_common.multi_asic import DEFAULT_NAMESPACE
from dump.match_infra import MatchRequest
from dump.helper import create_template_dict, handle_error
from dump.match_helper import fetch_port_oid, fetc... |
import asyncio
import atexit
import concurrent
import logging
import queue
import threading
import time
import typing as t
from funcx.sdk.asynchronous.funcx_future import FuncXFuture
from funcx.sdk.asynchronous.ws_polling_task import WebSocketPollingTask
from funcx.sdk.client import FuncXClient
log = logging.getLogge... |
# Copyright 2012 by <NAME>. All rights reserved.
# This file is part of the Biopython distribution and governed by your
# choice of the "Biopython License Agreement" or the "BSD 3-Clause License".
# Please see the LICENSE file that should have been included as part of this
# package.
"""Bio.SearchIO parser for Inferna... |
# -*- coding: utf-8 -*-
#
# diffoscope: in-depth comparison of files, archives, and directories
#
# Copyright © 2014-2015 <NAME> <<EMAIL>>
#
# diffoscope is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either ... |
import base64
import json
import mimetypes
import re
from dataclasses import dataclass
from datetime import datetime, timedelta
from itertools import chain
from typing import TYPE_CHECKING, Any, AsyncIterable, Dict, List, Optional, Union
from xml.etree import ElementTree
from httpx import URL, AsyncClient
from pydanti... |
# -*- coding: utf-8 -*-
# %% imports
from aux_EcoPG import N, Nd, f, c, mi, mj, qc, qr
from aux_EcoPG import fc_reward_subs, q_subs
from con_Emergence import obtain_conEmergence, m, y, Xg
from agents.detAC import detAC
from aux_QuiverPlot import plot_quiver, plot_trajectory
from aux_EcoPG import R, T
import numpy as... |
"""contains a cache to store router's certificates
Two lists are kept:
- ApprovedCert which contains the certificate of router that provided a valid Certification Path
- TBApprovedCert that temporarily store certificates that can't be yet verified
"""
from __future__ import with_statement
import tempfile
imp... |
import asyncio
import logging
import random
import re
from datetime import datetime
from typing import Any, Callable, List, Optional, Tuple
import discord
from discord.ext import commands
from crimsobot.bot import CrimsoBOT
from crimsobot.data.img import AENIMA, CAPTION_RULES, IMAGE_RULES, LATERALUS, URL_CONTAINS
fro... |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
from __future__ import unicode_literals
import os
import re
from django import forms
from django.utils.datastructures import SortedDict
from crowdflower import default_job_cml_path, price_class_handler
from form_fields import DatetimeField, ListField
from models import Dial... |
#Pluginname="WhatsApp (Android)"
#Filename="msgstore.db"
#Type=App
import struct
import tempfile
import shutil
def extractwadatabase():
ctx.gui_setMainLabel("Status: Trying to attach wa database")
result={}
for datadir in ["/data/com.whatsapp/databases/wa.db","/com.whatsapp/databases/wa.db","/d... |
import modeli
def izberi_moznost(moznosti):
"""
Funkcija, ki izpiše seznam možnosti in vrne indeks izbrane možnosti.
Če na voljo ni nobene možnosti, izpiše opozorilo in vrne None.
Če je na voljo samo ena možnost, vrne 0.
>>> izberi_moznost(['jabolko', 'hruška', 'stol'])
1) jabolko
... |
import pytest
from dataclasses import dataclass
from typing import Optional
from gemma import Course, PORT, Item, Fallback, Attr, Call, NullNameError
class TestBasicAPI:
def test_init_basic(self, course_basic):
assert str(course_basic) == "a/b/c/d"
def test_repr(self, course_basic):
assert r... |
"""
GTableUnparser: Base class for reading binary GSUB/GPOS tables
==============================================================
"""
from collections import OrderedDict
from fontTools.misc.xmlWriter import XMLWriter
import fontFeatures
from io import BytesIO
def glyph(x):
"""Helper routine to document that a gly... |
import sys
import os
from typing import Any, Dict
import yaml
import gzip
import time
import logging
# noinspection PyCompatibility
from pathlib import Path
from datetime import datetime, date
from optparse import OptionParser
from uuid import uuid1
from xml.dom.minidom import Document, Element
import umapi_client
... |
import os
import traceback
import pandas as pd
from igf_data.illumina.basesMask import BasesMask
from igf_data.utils.sequtils import rev_comp
from igf_data.illumina.samplesheet import SampleSheet
from igf_data.utils.fileutils import get_temp_dir,copy_local_file,check_file_path,remove_dir
from igf_data.process.singlecel... |
import os
import shutil
import tempfile
from django import forms
from django.conf import settings
from django.core.files.uploadedfile import SimpleUploadedFile
from django.test import Client, TestCase
from django.urls import reverse
from posts.models import Comment, Follow, Group, Post, User
class TemplatesTest(Tes... |
#!/usr/bin/env python
"""Provide a GUI application for solving linear programming problems.
This module provides a basic interface by which the user
maximizes or minimizes an objective function subject to
a number of secondary constraints.
For more information, see the README at
https://github.com/ivan-guerra/simple... |
# -*- coding: utf-8 -*-
"""
Created on Thu Sep 13 11:39:30 2018
Obj: processing geotags on tweets to locate tweets to states; handle geotags at different geographies: CITY, ADMIN, POI, NEIGHBORHOOD, and COUNTRY
@author: <NAME>
"""
# 0:tw_id, user_id, timestamp, country_code, place_full_name, place_name, place_ty... |
import numpy as np
import math
from numpy import linalg as LA
import utilities
from sklearn.svm import SVC
from sklearn.cluster import KMeans
from sklearn.metrics.cluster import adjusted_rand_score
# Features as columns
# Samples as rows
def compute_matrix_phi(samples, samples_copy, alpha):
result = 0
z_phi... |
from dataclasses import dataclass
from datetime import datetime, timedelta, date, time
from collections import OrderedDict
from typing import List, Optional
from helpers.timing import (
day_str,
get_hour_short_str,
short_day_str,
to_french_short_weekday,
)
@dataclass
class Schedule:
date_time: dat... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.