text stringlengths 2 999k |
|---|
#-*-coding:utf-8-*-
# ์ฃผ์:github ์ ์ฅ์์๋ ๋ณด์์์ ์ด์ ๋ก ํ ํฐ๋ค์ ๋๋ฝํจ.
from flask import Flask, request, jsonify
from urllib.request import urlopen
from bs4 import BeautifulSoup
import urllib, requests, re
import json, sqlite3
import datetime, time
import random, threading
from datetime import date
import sys
import count, bus, get... |
import copy
import json
import unittest
from monty.json import MontyDecoder
from pymatgen.analysis.nmr import NMRChemicalShiftNotation
class TestChemicalShiftNotation(unittest.TestCase):
def test_nmr_chemical_shift_notation(self):
cs1 = NMRChemicalShiftNotation.from_maryland_notation(
195.07... |
'''OpenGL extension NV.stream_sync
This module customises the behaviour of the
OpenGL.raw.EGL.NV.stream_sync to provide a more
Python-friendly API
The official definition of this extension is available here:
http://www.opengl.org/registry/specs/NV/stream_sync.txt
'''
from OpenGL import platform, constant, arrays
fr... |
import discord
class Can:
def __init__(self, discord_member, guild):
self.discord_member = discord_member
self.guild = guild
def channel(self):
if self.discord_member.guild_permissions.manage_guild:
return True
channel_create_role = self._get_role(self.guild.channe... |
"""
Example `exelog` usage
Run on spark, for example as follows:
spark-submit --master local[2] examples/example.py
"""
import logging
import pyspark
from exelog import enable_exelog
logger = logging.getLogger("example")
with_logging = enable_exelog(
level=logging.INFO,
format="[%(process)s/%(name... |
for i in range(int(input())):
n = int(input()) -1
l1 = n - n%3
l2 = n - n%5
l3 = n - n%15
s1 = ((l1)*(3+l1))//6
s2 = ((l2)*(5+l2))//10
s3 = ((l3)*(15+l3))//30
print(s1+s2-s3)
|
from itertools import count
from enum import Enum
from collections import Iterable
import pyflip as flp
from .variable import Variable
class Model:
counter = count()
def __init__(self, name=None):
if name is None:
name = f'Model_{next(Model.counter)}'
flp.util.verify_valid_name(na... |
import logging
import time
from pages import dummy_invalid
import pytest
from selenium.webdriver.remote.remote_connection import LOGGER
LOGGER.setLevel(logging.WARNING)
def test_area_root_available(test_page):
"""Given an area has a root Field set,
Then the root should be accessible.
"""
test_page... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Tests for the attribute container interface."""
from __future__ import unicode_literals
import unittest
from plaso.containers import interface
from tests import test_lib as shared_test_lib
class AttributeContainerIdentifierTest(shared_test_lib.BaseTestCase):
"""... |
from django.db import models
from django.conf import settings
from authentication.models import User
from django.core.validators import RegexValidator
#Employee Table
class Employee(models.Model):
emp_id = models.CharField(max_length=15, unique=True)
email = models.EmailField(max_length=255, unique=True)
f... |
# -*- coding: utf-8 -*-
"""
Created on Wed Apr 10 09:54:08 2019
@author: Casa
"""
import tkinter as tk # python 3.x
# import Tkinter as tk # python 2.x
class Example(tk.Frame):
def __init__(self, parent):
tk.Frame.__init__(self, parent)
# valid percent substitutions (from the Tk entry man page... |
from .one_hot import one_hot
from .grid import create_meshgrid
from .image import tensor_to_image, image_to_tensor
from kornia.utils.metrics import *
__all__ = [
"one_hot",
"create_meshgrid",
"tensor_to_image",
"image_to_tensor",
]
|
#!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... |
#!/usr/bin/env python3
import sys
def ints(itr):
return [int(i) for i in itr]
with open(sys.argv[1], 'r') as f:
file_lines = [l for l in f.read().strip().split('\n')]
in_nums = []
total = 0
result = 0
other = 0
X_MIN = 137
X_MAX = 171
Y_MIN = -98
Y_MAX = -73
# X_MIN = 20
# X_MAX = 30
# Y_MIN = -10
# Y_M... |
#!/home/esteban/Escritorio/noticampus/myvenv/bin/python
from django.core import management
if __name__ == "__main__":
management.execute_from_command_line()
|
import tensorflow as tf
import string
import random
import numpy as np
import pandas as pd
from ..rnn.consts import Const
import os
class Helper:
def __init__(self):
pass
@staticmethod
def dicstr(adict):
return ''.join('{}_{}-'.format(key, val) for key, val in adict.items())
@static... |
import s3fs
import numpy as np
import pandas as pd
import xarray as xr
from glob import glob
from os.path import join, exists
from sklearn.preprocessing import StandardScaler, RobustScaler, MaxAbsScaler, MinMaxScaler
from operator import lt, le, eq, ne, ge, gt
scalers = {"MinMaxScaler": MinMaxScaler,
"MaxAb... |
# -*- coding: utf-8 -*-
"""hasoc.py
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1fsvkdlTo4oxdg8SL4TWqs6vPY3s2lsOn
"""
from nltk.util import pr
import pandas as pd
import numpy as np
from sklearn.feature_extraction.text import CountVectorizer
from s... |
import logging
from cryptography.hazmat.primitives.asymmetric import padding
from cryptography.hazmat.primitives import hashes
from ykman.device import connect_to_device
from yubikit.core.smartcard import SmartCardConnection, ApduError, SW
from yubikit.piv import PivSession, MANAGEMENT_KEY_TYPE, SLOT, OBJECT_ID
clas... |
import collections
import itertools
from typing import List
from cached_property import cached_property
from public import public
from ... import util
from ...common import exceptions as com
from .. import rules as rlz
from .. import schema as sch
from .. import types as ir
from .core import Node, all_equal, distinct... |
'''
n passengers board an airplane with exactly n seats. The
first passenger has lost the ticket and picks a seat
randomly. But after that, the rest of passengers will:
- Take their own seat if it is still available,
- Pick other seats randomly when they find their
seat occupie... |
from synchrophasor.frame import *
from synchrophasor.pmu import Pmu
"""
pyPMU is custom configured PMU simulator. Code below represents
PMU described in IEEE C37.118.2 - Annex D.
"""
if __name__ == "__main__":
pmu = Pmu(ip="0.0.0.", port=9991)
pmu.logger.setLevel("DEBUG")
ph_v_conversion = int(300000.... |
# -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... |
#!/usr/bin/env python3
from __future__ import print_function
import os
import sys
import time
import logging
import tempfile
import traceback
import subprocess
from shutil import disk_usage, rmtree
from base64 import b64decode
try:
import pathlib
import importlib.util
except ImportError:
pass
class GI... |
"""VOC Dataset Classes
Original author: Francisco Massa
https://github.com/fmassa/vision/blob/voc_dataset/torchvision/datasets/voc.py
Updated by: Ellis Brown, Max deGroot
"""
from .config import HOME
import os.path as osp
import sys
import torch
import torch.utils.data as data
import cv2
import numpy as np
if sys.ver... |
import os
from PyCLUE.tasks.run_classifier import user_tasks, configs
# assign GPU devices or CPU devices
os.environ["CUDA_VISIBLE_DEVICES"] = "0"
# default configs: see PyCLUE.utils.classifier_utils.core
# below are some necessary paramters required in running this task
# task_name: default is "user_defined_task"
c... |
# -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modif... |
from collections import OrderedDict
from pddlstream.algorithms.downward import make_action, make_parameters, make_domain
from pddlstream.language.constants import Not
from pddlstream.language.conversion import pddl_from_object, substitute_expression
from pddlstream.language.statistics import check_effort
from pddlstre... |
# Copyright (c) 2018 PaddlePaddle 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 app... |
from django.conf.urls import url
from rest_framework.urlpatterns import format_suffix_patterns
from api import views
urlpatterns = [
url(r'^Person/$', views.PersonAPI.as_view()),
url(r'^Person/(?P<id>[0-9]+)/', views.PersonAPI.as_view()),
]
|
from ambari_agent import Controller
import pprint, json, os, time, sys
import tempfile
from urllib2 import Request, urlopen, URLError
from mock.mock import patch, MagicMock, call
from ambari_agent.AmbariConfig import AmbariConfig
import Queue
import logging
from ambari_agent import PuppetExecutor, PythonExecutor
logg... |
# Frame-filter commands.
# Copyright (C) 2013-2020 Free Software Foundation, Inc.
# This program 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 version 3 of the License, or
# (at your option) any late... |
import requests
import json
import urllib
import pandas as pd
if __name__ == '__main__':
with open('appcreds.txt', 'r') as credfile:
uid, secret = credfile.read().splitlines()
r = requests.post("https://api.intra.42.fr/oauth/token", data={'grant_type': 'client_credentials', 'client_id': uid, 'client_secret': secr... |
# Generated by Django 3.1.5 on 2021-02-25 07:19
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('statistics', '0002_auto_20210223_1813'),
]
operations = [
migrations.CreateModel(
name='Record',
fields=[
... |
import argparse
import os
import re
import numpy as np
import torch
import torch.multiprocessing as _mp
from torch import nn
from torch.nn import functional as F
from torch.utils.tensorboard import SummaryWriter
import environment
import tpu
from models import A3C
from optim import SharedAdam
from utils.helper import... |
class InboxTrackerException(Exception):
pass
class InboxTrackerAPIException(InboxTrackerException):
"""Handle 4xx and 5xx errors from the API"""
def __init__(self, response, *args, **kwargs):
# noinspection PyBroadException
try:
errors = response.json()['errors']
er... |
#!/usr/bin/env python
#
# Copyright 2018 VMware, Inc.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
# BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL... |
#!/usr/bin/python
import numpy as np
import scipy as sp
import scipy.linalg
import sqlite3
import os
unif = np.random.uniform
vocab = 10000
def zero_is_one(a):
a[a==0]=1
return a
l1_norm = lambda x: x / zero_is_one(x.sum(axis=1).reshape(-1, 1))
l2_norm = lambda x: x / zero_is_one(np.sqrt((x*x).sum(axis=1)).re... |
import numpy as np
import pandas as pd
import datetime
#x = AX+B
#Calib matrix
# scales = [0.984, 1.07, 0.995]
# rot = [[0.9716406, 0.1448620, 0.1868945],\
# [-0.1410913, 0.9894332, -0.0333945],\
# [-0.1897572, 0.0060782, 0.9818122]] #EulerXYZ: 0.034, 0.188, -0.148
# skews = np.eye(3)
# A = np.matmul(rot, ... |
from typing import Callable
g: Callable[<error descr="'Callable' must be used as 'Callable[[arg, ...], result]'">(int<caret>, str)</error>, str] |
#!/usr/bin/env python
import sys
import socket
import stat
import os.path
import copy
import time
import pwd
import grp
import py9p
Eunknown = "unknown file"
def _os(func, *args):
try:
return func(*args)
except OSError,e:
raise py9p.ServerError(e.args)
except IOError,e:
raise py... |
# SPDX-FileCopyrightText: 2021 Genome Research Ltd.
#
# SPDX-License-Identifier: MIT
from flask import jsonify, send_from_directory
from sqlalchemy import or_
from main.db_utils import create_new_specimen, \
create_request, notify_requests_pending
from main.model import db, TolidSpecies, TolidSpecimen, \
Tolid... |
from django.urls import path
from . import views
urlpatterns = [
path("", views.index, name="index"),
path("group/<slug:slug>/", views.group_posts, name="group_posts"),
path("new/", views.new_post, name="new"),
]
|
from summer import AgeStratification, Multiply
from math import exp, log
from autumn.model_features.curve import make_linear_curve, scale_up_function, tanh_based_scaleup
from autumn.core.inputs import get_death_rates_by_agegroup
from autumn.core.utils.utils import change_parameter_unit
from autumn.core.inputs.social_... |
import time
import unittest
from datetime import date, datetime
from uuid import uuid4
import mock
import six
from freezegun import freeze_time
from posthog.client import Client
from posthog.request import APIError
from posthog.test.utils import TEST_API_KEY
from posthog.version import VERSION
class TestClient(unit... |
import argparse
import inspect
from . import gaussian_diffusion as gd
from .respace import SpacedDiffusion, space_timesteps
from .unet import SuperResModel, UNetModel, EncoderUNetModel
NUM_CLASSES = 1000
def diffusion_defaults():
"""
Defaults for image and classifier training.
"""
return dict(
... |
import pdf_to_json as p2j
import json
url = "file:data/multilingual/Latn.BIN/Sun-ExtA_12/udhr_Latn.BIN_Sun-ExtA_12.pdf"
lConverter = p2j.pdf_to_json.pdf_to_json_converter()
lConverter.mImageHashOnly = True
lDict = lConverter.convert(url)
print(json.dumps(lDict, indent=4, ensure_ascii=False, sort_keys=True))
|
from __future__ import division
import numpy as np
from utils import accuracy_score
class Loss(object):
def loss(self, y_true, y_pred):
return NotImplementedError()
def gradient(self, y, y_pred):
raise NotImplementedError()
def acc(self, y, y_pred):
return 0
class SquareLoss(Loss... |
import tensorflow as tf
import numpy as np
def conv_relu_pool(input, conv_ker, conv_filters, conv_stride=1, conv_padding='SAME',
conv_ker_init=tf.random_normal_initializer(0.01), conv_bias_init=tf.zeros_initializer(),
pool_size=2, pool_stride=2, pool_padding='same', var_scope='la... |
# coding=utf-8
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
#
# 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/lice... |
#
# PySNMP MIB module RIVERSTONE-INVENTORY-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/RIVERSTONE-INVENTORY-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 20:49:09 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.... |
import logging
import os
import time
from datetime import datetime
from os import path
from protect_archiver.dataclasses import Camera
from protect_archiver.downloader import download_file
from protect_archiver.utils import calculate_intervals, make_camera_name_fs_safe
def download_footage(client, start: datetime, e... |
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
# 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... |
import os
import slicer
import qt, ctk, vtk
import EditorLib
from EditorLib.EditUtil import EditUtil
import slicer
from slicer.ScriptedLoadableModule import *
from slicer.util import VTKObservationMixin
#
# Editor
#
class Editor(ScriptedLoadableModule):
def __init__(self, parent):
ScriptedLoadableModule.__init_... |
from flask import flash, redirect, render_template, url_for, request
from flask_login import login_required, login_user, logout_user
from . import auth
from . forms import RegistrationForm, LoginForm
from .. import db
from app.models import User
@auth.route('/register', methods=['GET', 'POST'])
def register():
'... |
# Rodรญzio de Cavalos e Carruagens
# O rodรญzio de veรญculos de Bravoos รฉ uma restriรงรฃo ร circulaรงรฃo de veรญculos na
# cidade. Com o propรณsito de melhorar as condiรงรตes ambientais reduzindo a carga
# de poluentes na atmosfera, incluindo na regiรฃo de Westeros, se consolidou
# como um instrumento para reduzir congestionament... |
# Generated by Django 2.2.4 on 2019-08-16 08:33
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('logs', '0009_accesslog_import_batch'),
]
operations = [
migrations.AlterModelOptions(
name='importbatch', options={'verbose_name_plural'... |
import os
import logging
import asyncio
from hbmqtt.client import MQTTClient, ClientException
from hbmqtt.mqtt.constants import QOS_0
log = logging.getLogger("mqttwrapper.hbmqtt_backend")
async def mqtt_loop(broker, topics, callback, context_callback, **kwargs):
if context_callback is not None:
kwargs.up... |
class Config:
def __init__(self):
self.basename = 'delta_video'
self.directory = '/home/eleanor/Documents/gcamp_analysis_files_temp/180112-08-bottom-acclimate/data'
self.topics = ['/multi_tracker/1/delta_video',]
self.record_length_hours = 1 |
"""Structural variant detection with the Manta caller from Illumina.
https://github.com/Illumina/manta
"""
import os
import sys
from bcbio import utils
from bcbio.bam import ref
from bcbio.distributed.transaction import file_transaction
from bcbio.heterogeneity import chromhacks
from bcbio.pipeline import config_util... |
# cache.py
import datetime
MAX_CACHE_SIZE = 100 # Maximum number of entries in the cache.
#############################################################################
def init():
global _cache
_cache = {} # Maps key to (timestamp, value) tuple.
def set(key, value):
global _cache
if key not in _ca... |
import numpy as np
import csv
# import tensorflow as tf
# from keras import backend as K
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
from tensorflow.compat.v1.keras import backend as K
from keras.datasets import cifar10
from keras.utils import to_categorical
from controller import Controller, StateSpa... |
'''
Python 3.6
Pytorch >= 0.4
Written by Hongyu Wang in Beihang university
'''
import torch
torch.cuda.empty_cache()
import math
import torch.nn as nn
from torch.autograd import Variable
import torch.nn.functional as F
import numpy
import torch.utils.data as data
from data_iterator import dataIterator
from Densenet_to... |
class DataGridSortingEventHandler(MulticastDelegate, ICloneable, ISerializable):
"""
Represents the method that will handle the System.Windows.Controls.DataGrid.Sorting event of a System.Windows.Controls.DataGrid.
DataGridSortingEventHandler(object: object,method: IntPtr)
"""
def BeginInvoke(se... |
# coding:utf-8
import sys
import time
import json
from ctypes import *
def _args_encode(args_string):
'''Encode by utf-8 in PY3.'''
if sys.version_info >= (3, 0):
args_string = args_string.encode('utf-8')
return args_string
# ๅ ่ฝฝๅจๆ่ฟๆฅๅบ
kunpeng = cdll.LoadLibrary('./kunpeng_c.so')
# ๅฎไนๅบๅ
ฅๅๅ้็ฑปๅ
kun... |
import unittest
import emsa
from elaboo_parser import elaboo_parser, start_logging
import elaboo_methods as em
from Bio import AlignIO
from Bio.Alphabet import generic_dna
from Bio.SeqRecord import SeqRecord
from Bio.Seq import Seq
class TestCALCULATE(unittest.TestCase):
def test_use_external_file(self):
input_al... |
import click
from .main import main
import requests
from prettytable import PrettyTable
from scaleout.studioclient import StudioClient
@click.option('--daemon',
is_flag=True,
help=(
"Specify to run in daemon mode."
)
)
@main.group('create... |
import os
import numpy as np
import pandas as pd
import h5py
from bmtk.utils.sonata.utils import add_hdf5_magic, add_hdf5_version
def create_single_pop_h5():
h5_file_old = h5py.File('spike_files/spikes.old.h5', 'r')
node_ids = h5_file_old['/spikes/gids']
timestamps = h5_file_old['/spikes/timestamps']
... |
from __future__ import unicode_literals
import datetime
import requests
from .exceptions import *
from .models import Model
class Manager(object):
def __init__(self, config, name, url):
self.config = config
self.name = name
self.url = url
# Special plural handling for entities... |
"""Git specific support and addon."""
import argparse
import os
import re
import shlex
import subprocess
from collections import defaultdict, deque
from dataclasses import dataclass
from datetime import datetime
from functools import partial
from itertools import takewhile
from pathspec import PathSpec
from pkgcore.e... |
# Copyright 2021 NVIDIA Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... |
import bitcoin
from ethereum import utils
zfill = lambda s: (32-len(s))*b'\x00' + s
def sign(h, priv):
assert len(h) == 32
V, R, S = bitcoin.ecdsa_raw_sign(h, priv)
return V,R,S
def verify_signature(addr, h, V_R_S):
V, R, S = V_R_S
pub = bitcoin.ecdsa_raw_recover(h, (V,R,S))
pub = bitcoin.en... |
from sstcam_sandbox import get_checs
class Dataset:
def __init__(self, **kwargs):
self.poi = 888
class MC(Dataset):
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.dl1_paths = [
# get_checs("d190312_spectra_fitting/mc/run43490_dl1.h5"),
# get_che... |
#!/usr/bin/env python
import os
import traceback
import sys
import argparse
import subprocess
import re
import fnmatch
import urllib
import json
if sys.version_info >= (3, 0):
import urllib
from urllib.parse import urlencode
from urllib.request import Request, urlopen
else:
from urllib import urlencode
imp... |
def permutation(input_list):
if len(input_list) == 0:
return []
elif len(input_list) == 1:
return [input_list]
else:
result = []
for i in range(len(input_list)):
element = input_list[i]
other_elements = input_list[:i] + input_list[i + 1:]
f... |
# coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... |
import datetime
from typing import Any, Dict, Optional
from django.conf import settings
from django.http import HttpRequest, HttpResponse
from django.utils.timezone import now as timezone_now
from django.utils.translation import gettext as _
from zerver.decorator import human_users_only
from zerver.lib.actions import... |
# -*- coding: utf-8 -*-
# Import flask and template operators
from datetime import timedelta
from flask import Flask, render_template, request
from flask import session
# Define the WSGI application object
app = Flask(__name__)
@app.before_request
def log_request():
app.logger.debug("Request Headers %s", reque... |
import numpy as np
import cv2
from sklearn.externals import joblib
from face_detector import get_face_detector, find_faces
def calc_hist(img):
"""
To calculate histogram of an RGB image
Parameters
----------
img : Array of uint8
Image whose histogram is to be calculated
Returns
--... |
# -*- coding: utf-8 -*-
import json
from os import path
from gluon import current, URL
from gluon.html import *
from gluon.storage import Storage
from gluon.sqlhtml import SQLFORM
from s3 import S3FilterForm, S3CustomController, S3OptionsFilter, S3Request, \
S3SQLCustomForm
THEME = "historic.SSF"
#... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from abc import ABCMeta, abstractmethod
from typing import Any
import torch
class BaseDataProcessor(metaclass=ABCMeta):
@abstractmethod
def processing(self, example: Any, is_train: bool = False):
"""
example --> features
Process... |
from dlms_cosem.protocol.acse.aare import ApplicationAssociationResponse
from dlms_cosem.protocol.acse.aarq import ApplicationAssociationRequest
from dlms_cosem.protocol.acse.base import *
from dlms_cosem.protocol.acse.rlre import ReleaseResponse
from dlms_cosem.protocol.acse.rlrq import ReleaseRequest
from dlms_cosem.... |
# -*- coding: utf-8 -*-
"""
This script performs two tasks:
* It updates the ``requirements.txt`` file with the packages found in the ``Pipfile``.
* It reformats the ``Pipfile`` to my opinionated standards.
"""
from __future__ import absolute_import
import difflib
import os
from itertools import filterfalse, starm... |
class lacusServer:
pass |
import os
import traceback
import uuid
import wtforms
from celery import Celery
from flask import Flask, render_template, request, Blueprint, redirect, url_for, send_file, abort
from werkzeug.utils import secure_filename
from wtforms.validators import DataRequired
from jacks.jacks_io import loadJacksFullResultsFromPi... |
#!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
# This file is only used if you use `make publish` or
# explicitly specify it as your config file.
import os
import sys
sys.path.append(os.curdir)
from pelicanconf import *
# If your site is available via HTTPS, make sure SITEURL... |
#!/usr/bin/env python3
import speedtest
import logging
import check_connection as conn_check
stats = speedtest.Speedtest()
class internetConnection():
def __init__(self):
self.connection = conn_check.internet_conn()
def isvalid(self):
if(self.connection == True):
logging.basicCon... |
from kiteext import __version__
def test_version():
assert __version__ == '0.1.0'
|
from armulator.armv6.opcodes.abstract_opcodes.add_sp_plus_register_thumb import AddSpPlusRegisterThumb
from armulator.armv6.opcodes.opcode import Opcode
from armulator.armv6.shift import decode_imm_shift, SRType
class AddSpPlusRegisterThumbT3(AddSpPlusRegisterThumb, Opcode):
def __init__(self, instruction, setfla... |
from itertools import filterfalse, tee
from .vector2 import vector2
class rpolygon:
def __init__(self, coords: list):
"""[summary]
Args:
coords ([type]): [description]
"""
self._origin = coords[0]
self._vecs = list(c - coords[0] for c in coords[1:])
def _... |
import tempfile
import os
from PIL import Image
from django.contrib.auth import get_user_model
from django.test import TestCase
from django.urls import reverse
from rest_framework import status
from rest_framework.test import APIClient
from core.models import Recipe, Tag, Ingredient
from recipe.serializers import ... |
"""App permissions"""
from rest_framework.permissions import BasePermission, SAFE_METHODS
class IsUpdatingOwnProfileOrAdmin(BasePermission):
"""Check if user is updating own profile"""
def has_object_permission(self, request, view, obj):
if request.method in SAFE_METHODS or request.user.id == obj.id ... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from pkg_resources import get_distribution, DistributionNotFound
try:
__version__ = get_distribution(__name__).version
except DistributionNotFound:
pass # package is not installed
import math
from copy import deepcopy
import astropy.units as u
... |
import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 128 , FREQ = 'D', seed = 0, trendtype = "LinearTrend", cycle_length = 0, transform = "BoxCox", sigma = 0.0, exog_count = 20, ar_order = 0); |
import re
from gensim.parsing.preprocessing import stem_text
'''
stng ="this is 2.3. and this is just.and ?"
exp = "Modification of arginine and lysine in proteins with 2,4-pentanedione.Primary amines react 2,4-pentanedione pH 6-9 form enamines, N-alkyl-4-amino-3-penten-2-ones. The latter compounds readily regenerate ... |
# -*- coding: utf-8 -*-
import entity.cards.LETLT_051.LETLT_051
import entity.cards.LETLT_051.LETLT_051
|
import asyncio
from typing import List
from aioredis import Redis
from services.lib.db import DB
class ManyToManySet:
def __init__(self, db: DB, left_prefix: str, right_prefix: str):
self.db = db
self.left_prefix = left_prefix
self.right_prefix = right_prefix
async def _redis(self) ... |
from os import path
from setuptools import setup
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name='kofiko',
packages=['kofiko'],
version="1.0.7",
license='Apache',
description="Code-First Configuration package for Python",
long_description=long_description,
... |
#
# Execute lockless on a session
#
import argparse
from lib import shellcode
__description__ = "A tool that allows for the enumeration of open file handles and the copying of locked files"
__author__ = "@_batsec_, @harmj0y"
# identify the task as shellcode execute
USERCD_EXEC_ID = 0x3000
# location of lockless bi... |
#!/usr/bin/env python3
# Copyright (c) 2014-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test fee estimation code."""
from test_framework.test_framework import CredditTestFramework
from test_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.