text stringlengths 2 999k |
|---|
# Generated by Django 2.1.4 on 2019-01-26 15:44
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('Models', '0034_auto_20190123_1640'),
]
operations = [
migrations.AlterField(
model_name='goodsi... |
"""SCons.Tool.tex
Tool-specific initialization for TeX.
Generates .dvi files from .tex files
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, ... |
'''
Project: Search Exploits by CVE-ID Utility
Author: Nimish Shinde
Email: nimish.v.shinde60@gmail.com
Release: 1.0 (01/17/2019)
Reqs: * Python 3.x
* requests
Disclaimer:
This script is a enhancement on cvesearch package by Sujit Ghoshal
(https://pypi.org/project/cvese... |
"""
Copyright (c) 2018 iCyP
Released under the MIT license
https://opensource.org/licenses/mit-license.php
"""
from collections import OrderedDict
from dataclasses import dataclass, field
from typing import Any, Dict, List, Optional, Tuple
class GlbBinCollection:
def __init__(self) -> None:
self.vertex_a... |
# coding=utf8
# Copyright 2018 JDCLOUD.COM
#
# 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 pygame
from pygame.locals import *
import random
from main import *
class Ship(Main):
def __init__(self, ship_img, ship_type):
super().__init__()
self.enemy_x = 2
self.enemy_y = 1
# self.enemy_img = self.ENEMY_SHIPS['blue_ship'][0]
enemy = self.ENEMY_SHIPS[random.... |
import unittest
import six
from datetime import datetime
from generic_encoders import json_encoder
from generic_encoders.encoders.json_encoder import JsonEncoder
class TestJsonEncoder(unittest.TestCase):
def test_json_encoder_mixed_type(self):
string = {'a': 123, 'b': [1,2,{'c': 3}]}
self.assertE... |
#-*-coding:cp949-*-
'''
Created on 2013. 6. 24.
@author: sbs@gabia.com
'''
import wx
import os
import pycurl
import cStringIO
import DialogClass
import json
def progress(download_t, download_d, upload_t, upload_d):
print "Total to download", download_t
print "Total downloaded", download_d
print "Total ... |
from django.conf.urls import patterns, url
from kitsune.customercare import api
# API urls
urlpatterns = patterns(
'',
url(r'^banned$', api.BannedList.as_view(), name='customercare.api.banned'),
url(r'^ban$', api.ban, name='customercare.api.ban'),
url(r'^unban$', api.unban, name='customercare.api.unb... |
import json
import os
from contextlib import contextmanager
import numpy as np
import pytest
import tensorflow as tf
import torch
from google.protobuf.json_format import MessageToDict
from scipy.sparse import coo_matrix, bsr_matrix, csr_matrix, csc_matrix
from jina.proto.jina_pb2 import DocumentProto
from jina.types.... |
# 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 ... |
#
# ec2SSH.py - Implements the Tango VMMS interface to run Tango jobs on Amazon EC2.
#
# This implementation uses the AWS EC2 SDK to manage the virtual machines and
# ssh and scp to access them. The following excecption are raised back
# to the caller:
#
# Ec2Exception - EC2 raises this if it encounters any problem
#... |
from ferromtm.models.coupled2D import *
from ferromtm.visualization.plots import *
n_bulk = tunability(epsilonr_ferroelectric(Ebias), epsilonr_ferroelectric(0))
K_bulk = cqf(epsilonr_ferroelectric(Ebias), epsilonr_ferroelectric(0))
eps_00 = epsilonr_ferroelectric(0).real
tandelta_00 = -epsilonr_ferroelectric(0).imag ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Andre Augusto Giannotti Scota (https://sites.google.com/view/a2gs/)
import sys, os, locale
import requests
WTValidAssets = ['BRL-XBT', 'XBT-BRL']
def printUsage(exec: str):
print('Walltime command line')
print('-mi\t\tMarket info')
print('-ob\t\tOrder book')
prin... |
import os
# Get full directory path for the plot folder.
dir_path = os.path.dirname(os.path.realpath(__file__))
style_dict = {'jetplot': os.path.join(dir_path, 'matplotlib_styles\jetplot.mplstyle') , 'jet-paper': os.path.join(dir_path, 'matplotlib_styles\jet-paper.mplstyle')}
|
token = "your vk token"
# Guide about getting token
# https://bit.ly/2sdI8VQ
|
def main(site):
pass |
# Copyright (C) Jean-Paul Calderone
# Copyright (C) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Helpers for the OpenSSL test suite, largely copied from
U{Twisted<http://twistedmatrix.com/>}.
"""
import shutil
import os, os.path
from tempfile import mktemp
from unittest import TestCase
import sys
from... |
# vim: set fileencoding=<utf-8> :
# Copyright 2018-2021 John Lees and Nick Croucher
'''PopPUNK (POPulation Partitioning Using Nucleotide Kmers)'''
__version__ = '2.4.4'
# Minimum sketchlib version
SKETCHLIB_MAJOR = 1
SKETCHLIB_MINOR = 7
SKETCHLIB_PATCH = 0
|
"""
Django settings for example project.
Generated by 'django-admin startproject' using Django 3.2.9.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""
from pathlib... |
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'rest_peru.settings.local')
try:
from django.core.management import execute_from_command_line
exc... |
import logging
from xero import Xero
from xero.auth import OAuth2Credentials
from xero.constants import XeroScopes
from django.conf import settings
from django.core.cache import caches
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.contrib.admin.views.decorat... |
from __future__ import absolute_import
import itertools
import logging
import random
import time
from contextlib import contextmanager
from django.conf import settings
from redis.exceptions import (
ResponseError,
WatchError,
)
from sentry.digests import (
Record,
ScheduleEntry,
)
from sentry.digests... |
# -*- coding: utf-8 -*-
#
# taser documentation build configuration file, created by
# sphinx-quickstart on Thu Dec 7 15:37:21 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All... |
from uuid import uuid4
from threading import RLock
import time
import logging
from ray.autoscaler.node_provider import NodeProvider
from ray.autoscaler.tags import TAG_RAY_CLUSTER_NAME, TAG_RAY_NODE_NAME
from ray.autoscaler._private.gcp.config import bootstrap_gcp
from ray.autoscaler._private.gcp.config import MAX_POL... |
from django.apps import AppConfig
class UpdateappConfig(AppConfig):
name = 'updateapp'
|
from ._version import get_versions
__version__ = get_versions()["version"]
del get_versions
import erebos.adapters # NOQA
|
print("Hello Nikunj!")
|
from selenium import webdriver
import time
from data import conduit_login, accepting_cookies, conduit_registration
from selenium.webdriver.chrome.options import Options
from webdriver_manager.chrome import ChromeDriverManager
def test_list_data():
browser_options = Options()
browser_options.headless = True
... |
#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2021, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... |
#!/bin/env python
def var( tree, varName, type=float ):
tree.var(varName, type)
def fill( tree, varName, value ):
tree.fill( varName, value )
# event information
def bookEvent(tree):
var(tree, 'run')
var(tree, 'lumi')
var(tree, 'event')
def fillEvent(tree, event):
fill(tree, 'run', event.... |
# -*- coding: utf-8 -*-
"""Control parameters for a MOPAC optimization calculation
"""
import logging
import mopac_step
logger = logging.getLogger(__name__)
class OptimizationParameters(mopac_step.EnergyParameters):
"""The control parameters for optimization in MOPAC"""
parameters = {
"method": {
... |
# qubit number=2
# total number=21
import pyquil
from pyquil.api import local_forest_runtime, QVMConnection
from pyquil import Program, get_qc
from pyquil.gates import *
import numpy as np
conn = QVMConnection()
def make_circuit()-> Program:
prog = Program() # circuit begin
prog += H(0) # number=1
p... |
# -*- coding: utf-8 -*-
"""
Construction of stiffness and flexibility tensors
"""
import sys
import numpy as np
def StiffFlexTensors(P1, P2, StressVector1, StressVector2):
# compute the determinant of the transformation matrix
g = [[0]*2 for _ in range(2)]
g[0][0] = P1[0]
g[0][1] = P2[0]
g[1][0] =... |
# Author: Sayantan Majumdar
# Email: smxnv@mst.edu
import geopandas as gpd
import pandas as pd
import rasterio as rio
import numpy as np
import subprocess
import fiona
import os
import multiprocessing
from joblib import Parallel, delayed
from glob import glob
from Python_Files.hydrolibs.sysops import make_gdal_sys_cal... |
#!/usr/bin/env python2.7
"""Docker From Scratch Workshop - Level 7: Add network namespace.
Goal: Have your own NICs.
"""
from __future__ import print_function
import linux
import tarfile
import uuid
import click
import os
import stat
def _get_image_path(image_name, image_dir, image_suffix='tar'):
return os.pa... |
#!/usr/bin/env python
import sys,os
home = os.environ['NEMO_HOME']
setup = os.environ['NEMO_SETUP']
sys.path.append(os.path.join(home,'scripts'))
from nemo import Makefile
flags = dict(
PP_N_NODES = 8,
PP_KERNEL_DGFV_QMAX = 3,
PP_MESH_PERIODIC = 1,
DO_PROFILING = 0,
... |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from d... |
import subprocess
import sys
from githistorydata.csv import Csv
from githistorydata.expand_commits import expand_authors, expand_lines
from githistorydata.git import Git
from githistorydata.rawgit import RawGit
from githistorydata.settings import Settings
def main( argv, out, err ):
settings = Settings()
tr... |
from django_ixctl.models.ixctl import * # noqa: F401, F403
from django_ixctl.models.tasks import * # noqa: F401, F403
|
#!/usr/bin/env python3
from sys import argv
from hgen import main
if __name__ == "__main__":
main()
|
from __future__ import unicode_literals
from django.conf import settings
from django import forms
from django.utils.safestring import mark_safe
from django.core.urlresolvers import reverse
from taggit.forms import TagField
from taggit.utils import edit_string_for_tags
class TaggitLiveWidget(forms.TextInput):
def ... |
#!/usr/bin/env python3
# Copyright (c) 2017-2018 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 bosscoins-cli"""
from test_framework.test_framework import BitcoinTestFramework
from test_framewor... |
"""Module containing the SpurGear class"""
# I want the variables names to be the same as in AGMA pylint: disable=invalid-name
from math import pi, radians, cos, sin
from me_toolbox.gears import Gear
class SpurGear(Gear):
"""A gear object that contains all of its design parameters (AGMA 2001-D04)"""
# TODO:... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# utils.py --- utils for musicbox
# Copyright (c) 2015-2016 omi & Contributors
"""
定义几个函数 写文件 通知 返回键 创建目录 创建文件
"""
import os
import platform
import subprocess
import hashlib
from collections import OrderedDict
__all__ = [
"utf8_data_to_file",
"notify",
"uniq"... |
"""Provide the VotableMixin class."""
from ....const import API_PATH
class VotableMixin(object):
"""Interface for RedditBase classes that can be voted on."""
def _vote(self, direction):
self._reddit.post(API_PATH['vote'], data={'dir': str(direction),
... |
"""CLI for the Data Delivery System."""
####################################################################################################
# IMPORTS ################################################################################ IMPORTS #
#############################################################################... |
import sys
import os
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from database.database import ma
from models import ItemImage
class ItemImageSchema(ma.SQLAlchemyAutoSchema):
class Meta:
model = ItemImage
# load_instance = True
|
#!/usr/bin/env python3
import argparse
from zorrom import mrom
def run(verbose, rom1_fn, rom2_fn, fn_out):
txt1, w1, h1 = mrom.load_txt(open(rom1_fn, "r"), None, None)
txt2, w2, h2 = mrom.load_txt(open(rom2_fn, "r"), None, None)
# strictly speaking don't need w assert, but keep for now
assert w1 ==... |
def name():
return "Espers"
def parse(parser):
from data.esper import Esper
from data.characters import Characters
espers = parser.add_argument_group("Espers")
esper_spells = espers.add_mutually_exclusive_group()
esper_spells.add_argument("-esrr", "--esper-spells-random-rates", action = "store... |
import numpy as np
from imodels.experimental.bartpy.model import Model
from imodels.experimental.bartpy.node import LeafNode
from imodels.experimental.bartpy.samplers.sampler import Sampler
from imodels.experimental.bartpy.samplers.scalar import NormalScalarSampler
class LeafNodeSampler(Sampler):
"""
Respons... |
import torch
import os
import logging
import glob
import soundfile as sf
import resampy
import torchaudio
from data.data_transformer import FakePitchShift, Compose
from data import register_dataset
torchaudio.set_audio_backend("soundfile") # switch backend
logger = logging.getLogger(__name__)
@register_dataset
clas... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Sep 30 21:44:20 2021
@author: sayedakhan
import requests
import pandas as pd |
""""
Boilerplate Adventure
Author: Ignacio Avas (iavas@sophilabs.com)
"""
import codecs
import io
import sys
import unittest
from story.adventures import AdventureVerificationError, BaseAdventure
from story.translation import gettext as _
class TestOutput(unittest.TestCase):
"""Adventure test"""
def __init_... |
import logging
mpl_logger = logging.getLogger('matplotlib')
mpl_logger.setLevel(logging.WARNING)
import unittest
import pygsti
import numpy as np
from pygsti.modelpacks.legacy import std1Q_XYI
from ..testutils import BaseTestCase
class MyTimeDependentIdle(pygsti.modelmembers.operations.DenseOperator):
"""And id... |
"""
Given an array of integers, 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once.
Find all the elements that appear twice in this array.
Could you do it without extra space and in O(n) runtime?
Example:
Input:
[4,3,2,7,8,2,3,1]
Output:
[2,3]
"""
class Solution:
def fi... |
from rdflib import Graph, Literal
from rdfogm.data_property import DataProperty
from rdfogm.object_property import ObjectProperty
from rdfogm.rdf_type_property import RdfTypeProperty
from rdfogm.property_uri import PropertyUri
from rdfogm.connection import Connection
from rdfogm.settings import Settings
class ModelMet... |
import unittest
if __name__ == "__main__":
all_tests = unittest.TestLoader().discover(".", pattern="*.py")
unittest.TextTestRunner().run(all_tests)
|
from django.shortcuts import render
from django.views import View
import json
from meiduo_mall.utils import meiduo_json
from goods.models import SKU
from meiduo_mall.utils.response_code import RETCODE
from django import http
from . import constants
from django_redis import get_redis_connection
class CartView(View):
... |
#!/usr/bin/env python
# coding=utf-8
from __future__ import (
absolute_import,
print_function
)
import io
from glob import glob
from os.path import (
basename,
dirname,
join,
splitext
)
from setuptools import find_packages, setup
def read(*names, **kwargs):
return io.open(
join(d... |
import py_compile
import traceback
try:
import os
import sys
mods_path = './res_mods/mods'
mods = os.listdir(mods_path + '/packages')
print 'Trying to load following mods:'
print mods
sys.path.insert(0, mods_path + '/packages')
for mod in mods:
try:
path = '%s/packages/%s... |
"""
WSGI config for bbsite project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTIN... |
import logging
import time
from datetime import datetime, timedelta
from django.conf import settings
from django.db import connection, transaction
import cronjobs
from kitsune.questions import config
from kitsune.questions.models import (
Question, QuestionVote, QuestionMappingType, QuestionVisits)
from kitsune.... |
from util import getopt, zeros
from vol import Vol
from math import exp, tanh, log
# Helper functions
def relu(x):
return max(0, x)
def sigmoid(x):
try:
return 1.0 / (1 + exp(-x))
except:
return 0
class ReluLayer(object):
"""
Implements ReLU nonlinearity elementwise
x -> ma... |
#!/usr/bin/env python
import rosbag
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import tf
import os
import sys
from math import cos, sin
goods = [
# '2017-09-11-19-59-24.bag',
'2017-09-11-18-54-21.bag',
'2017-09-11-19-16-41.bag',
'2017-09-11-19-00-42.bag',
'2017-09-11-19-09-02.bag',
'2... |
import speech_recognition
import pyttsx
from os import system
system('say Hello world!')
recognizer = speech_recognition.Recognizer()
keyphrase = "none"
response = "Good afternoon sir"
def weather():
print("blah")
def speak(text):
system('say ' + text)
keywords = ["hi", "bye", "weather"]
def hi():
global respon... |
import urllib.parse
from typing import Optional
from github_api.client import DefaultHttpClient
from requests.models import Response
class GitHubV3(DefaultHttpClient):
"""
GitHubV3 is a class that implements the client for the GitHub API v3.
Examples
--------
>>> from experiments.github import g... |
import os
import sys
import torch
from torch.utils.data import DataLoader
from torch.utils.data.dataset import Dataset
from torchvision import transforms
from datasets.dataset import CustomDataset
from transforms.custom_transforms import InvertColor
def online_mean_and_sd(loader):
"""Compute the mean and sd in a... |
# ---
# jupyter:
# jupytext:
# formats: ipynb,py:percent
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.4.2
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
# %%
import emat
emat... |
config = {'train_data_path': ['D:/luna16/data_subset/subset0/',
'D:/luna16/data_subset/subset1/',
'D:/luna16/data_subset/subset2/',
'D:/luna16/data_subset/subset3/',
'D:/luna16/data_subset/subset4/',
... |
import bz2
from . import _compressor
class Compressor(
_compressor.Compressor,
):
name = 'bzip2'
@staticmethod
def compress(
data,
):
compressed_object = bz2.compress(data)
return compressed_object
@staticmethod
def decompress(
data,
):
decom... |
#################################################################################
#Author: John Martin
#Username: Martinjoh
#
#Assignment: A03homework
#Purpose: To demonstrate my ability using the turtle moduels to create things
#################################################################################
import t... |
# -*- coding: utf-8 -*-
import scrapy
from scrapy.linkextractors import LinkExtractor
from scrapy.spiders import CrawlSpider, Rule
from scrapy_redis_bloomfilter_block_cluster.spiders import RedisCrawlSpider
from MeinvSpider.items import MeinvspiderItem
import os
import traceback
import time
def get_time_stamp(format_... |
from setuptools import setup, find_packages
with open("README.md", "r", encoding="utf8") as fh:
long_description = fh.read()
setup(
name="stocks",
version="0.1.0",
description="Stocks",
author="Adam Rose",
author_email="emanuele.cannizzaro@gmail.com",
url="https://github.com/emanuelecanniz... |
import math
R, d = map(int, input().split())
n = int(input())
ans = 0
for i in range(n):
x, y, r = map(int, input().split())
# check if point lands on crust of the circle
if x**2 + y**2 >= (R-d+r)**2 and x**2 + y**2 <= (R-r)**2:
ans += 1
print(ans)
|
import json
import copy
import logging
from urllib.parse import urlparse, urlencode, parse_qs, urlunparse
import requests
from chibi.atlas import Chibi_atlas, Chibi_atlas_default
from chibi.file import Chibi_path
from chibi.metaphors import Book
from requests import Session
from requests.auth import AuthBase
from chi... |
"""
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.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
di... |
# -*- coding: utf-8 -*-
import os
import sys
sys.path.insert(0, os.path.abspath(".."))
# -- General configuration ------------------------------------------------
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
exten... |
# encoding: UTF-8
import events
import thread, time
from weakboundmethod import WeakBoundMethod as Wbm
import os, sys
lib_path = os.path.abspath(os.path.join(".."))
sys.path.append(lib_path)
from botinfo import bot_info
class Connection:
"""
This class is used make it easier for the listeners to remove themsel... |
#!/usr/bin/env python3
# This script attempts to implement and check arbitrary text against APA
# formatting rules.
#
# Copyright (c) 2017 Keefer Rourke <mail@krourke.org>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the abo... |
#!/usr/bin/env python
from __future__ import unicode_literals
import setuptools
from setuptools import setup, find_packages
import sys
install_requires = [
"Jinja2>=2.7.3",
"boto>=2.36.0",
"boto3>=1.6.16",
"botocore>=1.9.16",
"cookies",
"cryptography>=2.0.0",
"requests>=2.5",
"xmltodic... |
# -----------------------------------------------------------------------------
# Copyright (c) 2012 - 2021, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
# -----------------------------------------------------------------... |
# -*- coding: utf-8 -*-
#
# text_insight documentation build configuration file, created by
# sphinx-quickstart.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values h... |
from z3 import *
s = Solver()
a = Int('a')
b = Int('b')
c = Int('c')
try:
f = open("data.txt","r")
try:
for l in f:
s.add(eval(l))
finally:
f.close()
except IOError:
pass
for c in s.assertions():
print c
print s.check()
try:
m = s.model()
print m
except:
print "CASE FAILED: the constraints were un... |
# -*- coding: utf-8 -*-
# Copyright 2014 Objectif Libre
#
# 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 ... |
import argparse
import os
import runner.runner as runners
import torch
import torch.optim as optim
from typing import Any, List, Tuple, Dict
from utils.config import load_config
from utils.logger import setup_logger
logger = setup_logger(__name__)
def main():
print("main")
parser = argparse.ArgumentParser(de... |
#!/usr/bin/python3.7
########################################################################################
# process_pvt_system_data.py - Module for processing the PVT data files.
#
# Author: Ben Winchester
# Copyright: Ben Winchester, 2021
############################################################################... |
from xparse.regular.automata import Nfa, Dfa
from xparse.regular.regex import match
|
# Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
from botocore.exceptions import ClientError
from concurrent.futures import as_completed
from c7n.actions import BaseAction, ModifyVpcSecurityGroupsAction
from c7n.filters.kms import KmsRelatedFilter
from c7n import query
from c7n.manager im... |
# python3
def compute_min_number_of_refills(d, m, stops):
assert 1 <= d <= 10 ** 5
assert 1 <= m <= 400
assert 1 <= len(stops) <= 300
assert 0 < stops[0] and all(stops[i] < stops[i + 1] for i in range(len(stops) - 1)) and stops[-1] < d
type here
if __name__ == '__main__':
input_d = int(inpu... |
# -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import, unicode_literals
from django.conf.urls import patterns, url
from front import views
urlpatterns = patterns('',
url(r'^$', views.HomeView.as_view(), name='home'),
url(r'^info/$', views.InfoView.as_view(), name='info'),
... |
from WhatsAppManifest.adb.device import Device
def re_open_package(device: Device, package: str) -> tuple:
app_stop = device.adb_utils.app_stop(package)
app_start = device.adb_utils.app_start(package)
return (
app_stop,
app_start
)
|
from simple_NER.annotators import NERWrapper
from simple_NER import Entity
from simple_NER.utils.log import LOG
try:
from quantulum3 import parser
except ImportError:
LOG.error("you need to install quantulum3")
LOG.error("pip install quantulum3")
raise
class UnitsNER(NERWrapper):
def __init__(self... |
from typing import Union
import urllib3
import orjson
def _api_call(api_key: str, url: str) -> urllib3.HTTPResponse:
"""Make API call to cutt.ly
Args:
api_key (str): user API key
url (str): URL you want to shorten
Returns:
urllib3.HTTPResponse: urrlib repsponse
"""
http ... |
from .yaml_config import get_paths, node_from_config, load_minimal_tags, load_all_tags, configure_logging, SignalServerManager |
# Copyright (c) Facebook, Inc. and its affiliates.
import json
import numpy as np
import os
import random
import re
import torch
import torch.utils.data
# import cv2
from iopath.common.file_io import g_pathmgr
from PIL import Image
from torchvision import transforms as transforms_tv
# import slowfast.datasets.transf... |
from collections import namedtuple
Student = namedtuple('Student', ['name', 'age'])
o1 = Student('Vasia', 32)
o2 = Student('Katia', 24)
o3 = Student('Sveta', 13)
o4 = Student('Vasia', 32)
l = [o1, o2, o3, o4]
l2 = filter(lambda obj: obj.name == 'Vasia', l)
print(list(l2)[0])
f = next((obj for obj in enumerate(l) i... |
##############################################################################
#
# Copyright (c) 2001 Zope Foundation and Contributors
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this
# distribution.
# THIS SOFTWARE IS PROVIDED "AS ... |
import os
import importlib
import ssl
from funcy import distinct, remove
from flask_talisman import talisman
from .helpers import (
fix_assets_path,
array_from_string,
parse_boolean,
int_or_none,
set_from_string,
add_decode_responses_to_redis_url,
cast_int_or_default,
)
from .organization i... |
# C0de by H taken from Annie Assistant code
# Importing needed libs
from datetime import datetime
from threading import Timer
import os
import time
# fetching todays date
x=datetime.today()
# defining tomorrow date
y=x.replace(day=x.day+1,hour=7,minute=0,second=0,microsecond=0)
# calculating remaining time
delta_t=y-x... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.