text stringlengths 957 885k |
|---|
<reponame>gulshalla/shalla-text-editor<filename>extensions/custom_text_edit.py
import sys
from PyQt5 import QtWidgets, QtPrintSupport, QtGui, QtCore
from PyQt5.QtCore import Qt
class MyTextEdit(QtWidgets.QTextEdit):
def __init__(self, parent = None):
#*args to set parent
QtWidgets.QLineEdit.__in... |
<reponame>JenkoB/resolwe-bio
""".. Ignore pydocstyle D400.
================
Generate Samples
================
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import csv
import gzip
import json
import logging
import os
import random
import shutil
import string
import zipfile
imp... |
<gh_stars>1-10
# -*- encoding: utf-8 -*-
#
# heightmap.py
#
# Copyright 2017 <NAME> <<EMAIL>>
#
# This program is the property of Anasys Instruments, and may not be
# redistributed or modified without explict permission of the author.
import xml.etree.ElementTree as ET
import numpy as np
import matplotlib
matplotl... |
<filename>analysis/geoexchange_proxies.py
import admin_tools.db_reader as db_reader
import datetime
import pandas as pd
def C_to_F(C):
F = (9. / 5) *C + 32.
return F
def rec_calc_prep(df):
df.loc[:, 'ewt'] = C_to_F(df.loc[:, 'ewt_1'])
df.loc[:, 'lwt'] = C_to_F(df.loc[:, 'lwt_1'])
df.loc[:, 'del... |
"""
Module contains functionality that determines whether a vulnerability
causes remote code execution.
"""
from cve_connector.nvd_cve.categorization.helpers import test_incidence
def has_code_execution_as_root(description, cvssv2, cvssv3):
"""
Function determines whether CVE has "Arbitrary code execution as... |
<filename>test/tests/scriptComposer_tests.py
import grp, os, pwd, stat, sys, unittest
from pathlib import Path
from collections import OrderedDict
from pavilion import scriptcomposer
from pavilion.unittest import PavTestCase
from pavilion import utils
class TestScriptWriter(PavTestCase):
script_path = 'testName.b... |
import time
import torch
import numpy as np
from torch import nn
from torch.utils import data as torchData
import sys
from SimpleDataset import SimpleDataset
from SimpleAutoDataset import SimpleAutoDataset
import torch.nn.functional as F
from NetworkRunner import NetworkRunner
#Network runner that Collates ... |
<reponame>colehertz/Stripe-Tester
import stripe
from stripe.test.helper import StripeResourceTest
class AccountTest(StripeResourceTest):
def test_retrieve_account_deprecated(self):
stripe.Account.retrieve()
self.requestor_mock.request.assert_called_with(
'get',
'/v1/accou... |
<filename>Application/index.py
import os
import logging
from flask import Flask, request, render_template
app = Flask(__name__)
def doRender(tname, values={}):
if not os.path.isfile( os.path.join(os.getcwd(), 'templates/'+tname) ):
return render_template('index.htm')
return render_template(tname, **values)
@ap... |
<reponame>gitguige/openpilot0.8.9
import os
import numpy as np
import random
def gen_add_code(trigger_code, trigger, t1, t2, variable, stuck_value, additional_code):
assert(len(variable) == len(stuck_value))
if trigger_code:
code = trigger_code
else:
if len(trigger)>1:
code = 'if %s>=%... |
<reponame>sophiayue1116/sagemaker-debugger
# Standard Library
import calendar
import json
import multiprocessing as mp
import os
import time
from datetime import datetime
from pathlib import Path
# Third Party
import pytest
# First Party
from smdebug.core.tfevent.timeline_file_writer import TimelineFileWriter
from sm... |
<reponame>adam-murray/djangocms-moderation<gh_stars>1-10
from __future__ import unicode_literals
from django import forms
from django.contrib import admin
from django.contrib.admin.widgets import RelatedFieldWidgetWrapper
from django.contrib.auth import get_user_model
from django.forms.forms import NON_FIELD_ERRORS
fr... |
import os.path as osp
from itertools import chain
import json
from torch.utils.data import Dataset
import numpy as np
from PIL import Image
import matplotlib.pyplot as plt
'''
The json metadata for DIODE is laid out as follows:
train:
outdoor:
scene_000xx:
scan_00yyy:
- 000xx_... |
<filename>plesk-xpl.py
#!/usr/bin/python
#############################
# ABOUT #
#############################
##########################################################
# Plesk PHP Inject0r Exploit v1.0 #
# Greets to kingcope for finding orig. bug :3 #
# Author: W... |
<filename>src/jsm/models/streams.py
# Copyright 2021 - <NAME>
# Licensed under the Apache License, Version 2.0 (the "License");
# http://www.apache.org/licenses/LICENSE-2.0
from __future__ import annotations
from datetime import datetime
from enum import Enum
from typing import Any, Dict, List, Optional
from pydantic... |
# Copyright 2021 The Fairseq Authors and The HuggingFace Inc. team. 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
#
#... |
<reponame>javispp/biome-text
"""
Manages vocabulary tasks and fetches vocabulary information
Provides utilities for getting information from a given vocabulary.
Provides management actions such as extending the labels, setting new labels or creating an "empty" vocab.
"""
import logging
from typing import ... |
<reponame>shangz-ai/gluon-nlp
# 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 Licens... |
<reponame>suleymanaslan/obstacle-tower-rl
# adapted from https://github.com/Kaixhin/Rainbow
from collections import deque
import time
import torch
import cv2
import gym
import numpy as np
from gym.wrappers.pixel_observation import PixelObservationWrapper
from obstacle_tower_env import ObstacleTowerEnv as ObstacleTower... |
class AsyncCameraQualityRetentionProfiles:
def __init__(self, session):
super().__init__()
self._session = session
async def getNetworkCameraQualityRetentionProfiles(self, networkId: str):
"""
**List the quality retention profiles for this network**
https://developer... |
<reponame>rootadminWalker/keras-YOLOv3-model-set
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""YOLO_v3 Darknet Model Defined in Keras."""
from tensorflow.keras.layers import Conv2D, Add, ZeroPadding2D, UpSampling2D, Concatenate, MaxPooling2D, GlobalAveragePooling2D, Flatten, Softmax, Reshape, Input
from tensorflow... |
###################################################################################
#
# Copyright (C) 2017 MuK IT GmbH
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, eithe... |
<gh_stars>0
import json
import os
from agent import source
from agent.modules.logger import get_logger
from agent.modules.constants import ROOT_DIR
from agent.pipeline import Pipeline
logger = get_logger(__name__)
class BaseConfigLoader:
BASE_PIPELINE_CONFIGS_PATH = 'base_pipelines'
@classmethod
def lo... |
<gh_stars>10-100
import queue
import sys
import time
import string
import random
import numpy as np
from loguru import logger
from concurrent import futures
import edge_globals
from tools.read_config import read_config
from local.preprocessor import preprocess
from frontend_server.offloading import send_frame
from to... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
""" Create models for *sick* """
from __future__ import division, print_function
__all__ = ("create", )
__author__ = "<NAME> <<EMAIL>>"
import cPickle as pickle
import logging
import os
import yaml
from time import strftime
import numpy as np
from astropy.io import fit... |
<filename>cogs/daymar.py
import discord # noqa
import sheets
import utility
import event
from constants import Constants
from discord.ext import commands
class Daymar(commands.Cog):
def __init__(self, client):
self.client = client
def addParticipant(self, member, memberType='Security'):
rsiC... |
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
import tensorflow as tf
from sklearn.metrics import confusion_matrix
import numpy as np
import load
train_samples, train_labels = load._train_samples, load._train_labels
test_samples, test_labels = load._test_samples, load._test_labels
print('Training set', train_samples.shape, train_labels.shape)
print(' Test set... |
<filename>backend/parky/routes.py
from datetime import datetime
from typing import Optional
from fastapi import Depends, Header, HTTPException, Response
from pydantic import BaseModel
from sqlalchemy.orm import Session
from parky.database import ParkingLot, User, get_db
from parky.services import ParkingLotService, U... |
#!/usr/bin/env python3
### IMPORTS ###
import logging
import uuid
import os
import sys
from string import Template
import yaml
from classic import StepTypeNotSupported
from .eventsource import EventSource
from .sensor import Sensor
from .ingress import Ingress
from .workflow_templ... |
import discord
from discord.ext import commands
from discord_slash import cog_ext, SlashContext
import GlobalData
import random
import StringUtils
from LogData import LogAddedQuote
from Aliases import GetAlias
GlobalData.init()
class Quote():
def __init__( self, speaker, text, tags ):
s... |
# Copyright 2014 Scalyr Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... |
#!/usr/bin/env python
'''
PypeR (PYthon-piPE-R)
PypeR is free software subjected to the GPL license 3.0. and comes with
ABSOLUTELY NO WARRANT. This package provides a light-weight interface to use R
in Python by pipe. It can be used on multiple platforms since it is written in
pure python.
Prerequisites:
... |
<gh_stars>10-100
import time
import os.path
import hashlib
import logging
from piecrust.chefutil import (
format_timed_scope, format_timed)
from piecrust.environment import ExecutionStats
from piecrust.pipelines.base import (
PipelineJobCreateContext, PipelineJobResultHandleContext, PipelineManager,
get_pip... |
<reponame>robertmaynard/hpc-container-maker
# Copyright (c) 2020, 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/licen... |
import numpy as np
from cwFitter import Simulator
class Evaluator(object):
def __init__(self, sampleData, sim_params, bio_params):
self.sampleData = sampleData
self.sim_params = sim_params
self.bio_params = bio_params
if 'protoco_start_I' in sim_params:
self.steps = ... |
#!/usr/bin/env python3
import argparse
import html
import logging
import os
import plistlib
import subprocess
import tempfile
import time
import urllib.parse
import zipfile
from enum import Enum
from io import BytesIO
from pathlib import Path
import requests
import toml
from packaging import version
from telegram imp... |
<filename>SiouxFallNet/BaseNet&PyProcess/process.py
"""
This code is created process the bus network data
"""
import pandas as pd
num_bus_line = 10
max_bus_stops = 11
class LinkClass:
def __init__(self,_a,_b,_t):
self.tail =_a
self.head =_b
self.cost =_t
class ODClass:
def __init_... |
<reponame>trimitri/jokarus
"""The Subsystems class manages the connection to internal subsystems.
This is an interface to the actual things connected to each port of each
subsystem.
SAFETY POLICY: This class silently assumes all passed arguments to be of
correct type. The values are allowed to be wrong, though.
"""
i... |
#
# 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
# "License"); you may not... |
# Use RGBA channel in WebGL2
from typing import Dict, Iterable, List, Optional
import numpy as np
import onnx
from webdnn.optimization_pass_result_webgl import OptimizationPassResultWebGL
from webdnn.optimization_pass import OptimizationPass, OptimizationPassResult
from webdnn.onnx_util import tensor_proto_to_numpy, g... |
from werkzeug.exceptions import HTTPException
class LowballException(HTTPException):
"""
Base exception class for Lowball Exceptions
"""
# Treat all exceptions as 500 unless explicitly overwritten
code = 500
# Handle Generic Exceptions
description = "An Error Occurred. Please Check the Lo... |
<gh_stars>1-10
import sys
if '/opt/ros/kinetic/lib/python2.7/dist-packages' in sys.path:
sys.path.remove('/opt/ros/kinetic/lib/python2.7/dist-packages')
import cv2 as cv
import cv2
import imutils
import numpy as np
def detectAndDescribe(image):
# convert the image to grayscale
gray = cv2.cvtColor(image, cv... |
<filename>roseasy/gui.py
#!/usr/bin/env python2
# encoding: utf-8
"""\
Judge forward-folded candidates in computational protein design pipelines.
Usage:
show_my_designs.py [options] <pdb_directories>...
show_my_designs.py --version
Options:
-F, --no-fork
Do not fork into a background process.
... |
import networkx as nx
import matplotlib.pyplot as plt
import numpy as np
import ot
import time
from scipy.sparse.csgraph import shortest_path
from scipy import sparse
import copy
import matplotlib.colors as mcol
from matplotlib import cm
class NoAttrMatrix(Exception):
pass
class NoPathException(Exception):
pa... |
<filename>src/main.py
from PyQt5.QtWidgets import *
from PyQt5.uic import loadUi
from PyQt5.QtCore import pyqtSlot, Qt
from datetime import datetime
from dateutil.relativedelta import relativedelta
import sys
from detect import detect
import os
from threeD_module import CthreeD
from preferences import Preferences
impor... |
import random
from esper.prelude import *
from rekall.video_interval_collection import VideoIntervalCollection
from rekall.temporal_predicates import *
from esper.rekall import *
import cv2
import pickle
import multiprocessing as mp
from query.models import Video, Shot
from tqdm import tqdm
import django
import sys
imp... |
import os
from definitions import OUTSIDE_ROOT_DIR, INSIDE_ROOT_DIR
from src import _version
from src.utils import Utils
class Path:
"""
This class stores all the path.
"""
DEFAULT_INPUT_PATH = OUTSIDE_ROOT_DIR + "/input/"
DEFAULT_OUTPUT_PATH = OUTSIDE_ROOT_DIR + "/output/"
DEFAULT_LOG_PATH =... |
<gh_stars>100-1000
import os
import glob
from unet3d.data import write_data_to_file, open_data_file
from unet3d.generator import get_training_and_validation_generators
from unet3d.model import unet_model_3d
from unet3d.training import load_old_model, train_model
import argparse
import keras
import time
import sys
p... |
import math
from math import radians as rads, degrees as degs
import re
from configparser import ConfigParser
from ast import literal_eval
from decimal import *
getcontext().prec = 6
import numpy as np
import quaternion
from astropy.coordinates import SkyCoord
from astropy.time import Time
from astropy... |
<reponame>avidit/home-assistant-config
import json
import logging
from homeassistant.core import (
HomeAssistant,
callback,
)
from homeassistant.components.mqtt import (
DOMAIN as ATTR_MQTT,
CONF_STATE_TOPIC,
CONF_COMMAND_TOPIC,
)
import homeassistant.components.mqtt as mqtt
from homeassistant.he... |
import sys
sys.path.append('C:/python scripts/ciecam02 plot')
import Read_Meredith as rm
# from scipy.ndimage import binary_dilation
# from scipy.stats import circstd
# import scipy.fftpack as fftpack
# from scipy.linalg import solve_banded
import vispol
import numpy as np
from scipy.sparse.linalg import spsolve
# from... |
<reponame>noaione/naoTimes
"""
MIT License
Copyright (c) 2019-2021 naoTimesdev
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use,... |
# -*- coding: utf-8 -*-
"""Implementation of early stopping."""
import dataclasses
import logging
from dataclasses import dataclass
from typing import Any, Callable, List, Mapping, Optional, Union
import numpy
from .stopper import Stopper
from ..evaluation import Evaluator
from ..models.base import Model
from ..tra... |
<reponame>hisashi-ito/alexa_lambda<filename>python/anime_talk/lambda_function.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# AnimeTalkEvent Skill Lambda Function
#
# 更新履歴:
# 2018.07.14 新規作成
# 2018.07.21 修正依頼があったので修正します
#
import os
import sys
sys.path.append('./')
from scraping import Scraping
imp... |
import numpy as np
import torch
import torch.optim as optim
import torch.nn as nn
from torch.autograd import Variable
import time
import re
import os
import sys
import cv2
import bdcn
from datasets.dataset import Data
import argparse
import cfg
from matplotlib import pyplot as plt
from os.path import splitext, join
imp... |
import torch
import torch.utils.data as data
import random
import math
import os
import logging
from utils import config
import pickle
from tqdm import tqdm
import pprint
import pdb
pp = pprint.PrettyPrinter(indent=1)
import re
import ast
#from utils.nlp import normalize
import time
from collections import defaultdict... |
<gh_stars>1-10
import time
import asyncio
from typing import Callable, Coroutine, List, Dict, Union, Any
import nonebot
from nonebot import require
from nonebot.log import logger
from nonebot.adapters.onebot.v11 import MessageSegment, Message
# from nonebot.internal.adapter.message import Message
scheduler = require(... |
# TODO: メモリリーク確認
# TODO: __repr__ を書く
code_two_sat = r"""
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include "structmember.h"
// 元のライブラリの private を剥がした
// >>> AtCoder >>>
#ifndef ATCODER_TWOSAT_HPP
#define ATCODER_TWOSAT_HPP 1
#ifndef ATCODER_INTERNAL_SCC_HPP
#define ATCODER_INTERNAL_SCC_HPP 1
#include <algori... |
import asyncio
import discord
import json
import random
import math
import time
import datetime
import os
import shutil
import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib.font_manager as fm
from discord.ext import commands
from discord.ext import tasks
class Stock(commands.Cog)... |
import os
import sys
import pickle
from typing import List
import numpy as np
import pandas as pd
from scipy.optimize import minimize_scalar
os.environ["OPENBLAS_NUM_THREADS"] = "1"
sys.path.append("../../")
from environments.Settings.EnvironmentManager import EnvironmentManager
from environments.Settings.Scenario i... |
from game.utils import config
import os
import logging
import json
import django.core.handlers.wsgi
from django.conf import settings
from tornado import ioloop
import tornado.ioloop
import tornado.web
import tornado.wsgi
import tornado.httpserver
import django.utils.importlib
import django.contrib.auth
from django.con... |
import numpy as np
from .name2idx import C, V
from .set_model import diffeq
from .solver import solveode, get_steady_state
observables = [
'Phosphorylated_MEKc',
'Phosphorylated_ERKc',
'Phosphorylated_RSKw',
'Phosphorylated_CREBw',
'dusp_mRNA',
'cfos_mRNA',
'cFos_Protein',
'Phosphoryla... |
# Copyright 2021 The SODA 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... |
<filename>src/main.py
import sys
from PyQt5 import QtWidgets, uic
from darktheme.widget_template import DarkPalette
import PyQt5.QtCore as QtCore
from PyQt5.QtCore import Qt
import PyQt5.QtWidgets
from PyQt5.QtWidgets import QMessageBox
from PyQt5.QtWidgets import QColorDialog
from PyQt5.QtGui import QColor
from gra... |
import json
import pytest
from oidcmsg.key_jar import build_keyjar
from oidcendpoint.oidc import userinfo
from oidcendpoint.oidc.authorization import Authorization
from oidcendpoint.oidc.provider_config import ProviderConfiguration
from oidcendpoint.oidc.registration import Registration
from oidcendpoint.oidc.token i... |
# Copyright (C) 2012 - 2014 EMC 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
#
# Unle... |
<filename>tests/resources/test_resource_faceting.py
# -*- coding: utf-8 -*-
#
# Copyright (C) 2020 CERN.
# Copyright (C) 2020 Northwestern University.
#
# Invenio-Records-Resources is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see LICENSE file for more
# details.
"""T... |
<reponame>cclauss/episodic-curiosity<filename>episodic_curiosity/train_policy.py
# coding=utf-8
# Copyright 2019 Google LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www... |
'''
Created on Jun 30, 2012
@author: eric
'''
import unittest
import os.path
from testbundle.bundle import Bundle
from sqlalchemy import * #@UnusedWildImport
from ambry.run import get_runconfig, RunConfig
from ambry.library.query import QueryCommand
import logging
import ambry.util
from test_base import TestBase
... |
#!/usr/bin/env python
import requests
from textblob import TextBlob
from twitter import Twitter
import time
import ccxt
from coins import coins
from notifier import Notifier
symbol_name = {}
name_symbol = {}
symbol_exchange = {}
bot = None
notifier = Notifier()
def get_coins_bittrex():
exchange = ccxt.bittrex()
... |
# encoding: UTF-8
import warnings
warnings.filterwarnings("ignore")
from pymongo import MongoClient, ASCENDING
import pandas as pd
import numpy as np
from datetime import datetime
import talib
import matplotlib.pyplot as plt
import scipy.stats as st
from sklearn.model_selection import train_test_split
# LogisticRegress... |
<reponame>gfrancis-ALElab/Arctic_UNet
# -*- coding: utf-8 -*-
"""
Created on Fri Apr 23 10:06:45 2021
Functions for filtering tiles if containing areas of no data
@author: <NAME>
email: <EMAIL>
"""
import os
import numpy as np
import glob
import rasterio
import rasterio.features as features
import pandas as pd
i... |
<reponame>JonasDHomburg/LAMARCK<gh_stars>1-10
import sqlite3 as db
import time
import os
from LAMARCK_ML.individuals import IndividualInterface
from LAMARCK_ML.models.models import GenerationalModel
from LAMARCK_ML.reproduction import AncestryEntity
from LAMARCK_ML.reproduction.Ancestry_pb2 import AncestryProto
from L... |
<reponame>decathloncanada/data-utils<filename>data_utils/df.py
# -*- coding: utf-8 -*-
"""
data_utils.df
~~~~~~~~~~~~~
This module contains the functions related to dataframe manipulation.
"""
import os
import io
import pandas as pd
import numpy as np
import tablib
from .utils import (_clear_model_table,
... |
<gh_stars>1-10
import pickle
import itertools
import numpy as np
import os.path as osp
from tqdm import tqdm
from collections import defaultdict
from .kitti_utils import read_velo
def points_in_convex_polygon(points, polygon, ccw=True):
"""points (N, 2) | polygon (M, V, 2) | mask (N, M)"""
polygon_roll = np.... |
<reponame>LeiSoft/CueObserve<filename>api/anomaly/services/rootCauseAnalyses.py<gh_stars>100-1000
import json
import logging
import traceback
import datetime as dt
import dateutil.parser as dp
from utils.apiResponse import ApiResponse
from ops.tasks import rootCauseAnalysisJob
from app.celery import app
from anomaly.m... |
# <NAME> - 22 March 2018
# Student ID: G00364778
# GMIT 52167 Final Project
"""
The purpose of this python code is to perform three major functions on the iris dataset
* Read is the csv data from a text file and return it in a format for further processing
* Run some basic statistical calculations on the data... |
from collections import Mapping
import copy
import os
import flask
from flask import Flask, jsonify, request, g, render_template, session,\
redirect, url_for, escape, current_app
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext.login import LoginManager
#from flask.ext.cors import CORS
import krispy... |
<filename>django_harmonization/ui/report_views.py<gh_stars>0
#!/usr/bin/env python3
'''
Copyright 2017 The Regents of the University of Colorado
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 Licen... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
''' Align a list of molecules using `super` command in PyMol. The first item
in the list is considered as the reference.
'''
import pymolPy3
import pyrotein as pr
import os
from loaddata import load_gpcrdb_xlsx
## from pmview import view_dict
job_name = "xfam"
... |
<filename>mapping/star/discretized_bath/asymmetric_mean.py
"""
Discretized bath for the generation of direct asymmetric discretization coefficients, where the integrals for
the couplings and energies are evaluated using a heuristic method called mean discretization.
Introduced in: de Vega et al., Phys. Rev... |
<gh_stars>100-1000
#!/usr/bin/env python3
import functools
import operator
import unittest
from migen import *
from migen.fhdl.decorators import CEInserter, ResetInserter
from ..utils.CrcMoose3 import CrcAlgorithm
from ..utils.packet import crc16, encode_data, b
from .shifter import TxShifter
from .tester import mo... |
<reponame>tuxu/soundbridge<filename>soundbridge.py<gh_stars>0
from __future__ import print_function, division
import numpy as np
import sounddevice as sd
import samplerate as sr
from fifo import FIFO
class OutputProcessor(object):
"""Basic output processor.
Passes samples through by multiplying with `input... |
<gh_stars>0
"""
@author <NAME> (github.com/CorentinGoet)
"""
import unittest
from AST import *
from lexer_pkg.lexem import Lexem, LexemTag
from lexer_pkg.lexer import Lexer
from parser_pkg.parser import Parser
class ParserTest(unittest.TestCase):
"""
Test class for the parser_pkg.
"""
def setUp(sel... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import os
import os.path
import shutil
import sys
import re
import socket
from flask import current_app, Flask, jsonify, render_template, request, send_from_directory, redirect, url_for, got_request_exception
from flask.views import MethodView
from PIL import... |
<reponame>rainprob/GibsonEnv<filename>examples/train/train_husky_gibson_flagrun_ppo1.py
# add parent dir to find package. Only needed for source code build, pip install doesn't need it.
import os, inspect
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parentdir = os.path.dirname... |
<reponame>GeotrekCE/Geotrek
import io
import os
import uuid
from unittest import mock
from unittest.mock import MagicMock
from django.core import mail
from django.core.management import call_command
from django.test import TestCase
from django.test.utils import override_settings
from django.urls.base import reverse
fr... |
"""
Copyright (c) 2021 Intel 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 writin... |
from decimal import Decimal
from django.test import TestCase
from swipe.settings import USED_CURRENCY
from article.models import ArticleType, OtherCostType
from article.tests import INeedSettings
from crm.models import User, Person
from logistics.models import SupplierOrder, StockWish
from money.models import Currenc... |
''' Present an interactive function explorer with slider widgets.
Scrub the sliders to change the properties of the ``hrf`` curve, or
type into the title text box to update the title of the plot.
Use the ``bokeh serve`` command to run the example by executing:
bokeh serve sliders.py
at your command prompt. Then nav... |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import utils
from logger import Logger
from replay_buffer import ReplayBufferStorage, make_replay_loader
from video import... |
<reponame>appsembler/edx-figures<filename>tests/conftest.py<gh_stars>0
from __future__ import absolute_import
from datetime import datetime
import pytest
from django.utils.timezone import utc
from six.moves import range
from tests.helpers import organizations_support_sites
from tests.factories import (
CourseEnro... |
import uuid
from collections import OrderedDict, defaultdict
from collections.abc import Sequence
from uuid import uuid4
from django import forms
from django.core.exceptions import NON_FIELD_ERRORS, ValidationError
from django.forms.utils import ErrorList
from django.utils.functional import cached_property
from django... |
# Copyright (c) 2020, eQualit.ie inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
from unittest import mock
import pyspark.sql.functions as F
from datetime import datetime
from dateutil.tz import tzutc
fro... |
import sys
import time
from multiprocessing import Process, Queue
import yaml
import numpy as np
import zmq
import logging
# set up logging to file - see previous section for more details
from datetime import datetime
logging.basicConfig(level=logging.INFO,
format='%(asctime)s - %(message)s',
... |
<reponame>mindspore-ai/models<filename>research/cv/midas/src/utils/pth2ckpt.py
# Copyright 2021 Huawei Technologies Co., Ltd
#
# 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.apa... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# *******************************************************
# ____ _ _
# / ___|___ _ __ ___ ___| |_ _ __ ___ | |
# | | / _ \| '_ ` _ \ / _ \ __| | '_ ` _ \| |
# | |__| (_) | | | | | | __/ |_ _| | | | | | |
# \____\___/|_| |_| |_|\... |
from json import loads
from controller import BaseHandler
from logging import info, exception
from controller import Net
from module import DbManager, add_user, delete_user, update_user, set_api_response, validate_format, get_string, wifi_ap_info
class WiFiInfo(BaseHandler):
tipo_operazione = ['list', '... |
<reponame>FlussuferOrga/ts-gw2-verifyBot
"""
Idea & Base from https://pypi.org/project/connection-pool/ https://github.com/zhouyl/ConnectionPool
Modification by https://github.com/Xyaren
"""
import logging
import queue
import threading
from typing import Callable, ContextManager, Generic, TypeVar
import time
LOG = lo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.