text stringlengths 1 927k |
|---|
#!/usr/bin/env python
"""An implementation of an OSX client builder."""
import logging
import os
import shutil
import StringIO
import subprocess
import zipfile
from grr import config
from grr.lib import build
from grr.lib import config_lib
from grr.lib import utils
class DarwinClientBuilder(build.ClientBuilder):
"... |
# -*- coding: utf-8 -*-
"""Console script for geotiff_reprojector."""
import sys
import os
import click
import rasterio
from rasterio.warp import calculate_default_transform, reproject, Resampling
def reprojector(sourcefile, target_epsg='EPSG:4326', yes=False):
# load file to get epsg info.
dat = rasterio.op... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('django_todos', '0004_auto_20150909_1213'),
]
operations = [
migrations... |
# 03 operator
print(4+3)
print(4-3)
print(4*3)
print(4 ** 3) # 这个小学没学
print(4/3) |
# 定义全局变量和方法
import numpy as np
import math
# import process.process_finger_data as pfd
# 目前选用的图片尺寸
cur_pic_size = [640, 400]
# cur_pic_size = [1280, 800]
# 相机索引对应相机名称
camera_index_to_name = ['A', 'B', 'C', 'D', 'E', 'F']
# 6个相机的外参
camera_a_outer_para = np.mat([[0.574322111, 0.771054881, 0.275006333, 0.93847817],
... |
import nbformat
from notebook.services.contents.tests.test_contents_api import (
APITest, assert_http_error
)
from traitlets.config import Config
from hdfscm import HDFSContentsManager
from hdfscm.utils import to_fs_path
from .conftest import random_root_dir
class HDFSContentsAPITest(APITest):
hidden_dirs =... |
#!/usr/bin/env python
import sys
from setuptools import setup
import versioneer
SETUP_REQUIRES = ['setuptools >= 30.3.0']
SETUP_REQUIRES += ['wheel'] if 'bdist_wheel' in sys.argv else []
if __name__ == "__main__":
setup(name='phys2denoise',
setup_requires=SETUP_REQUIRES,
version=versioneer.ge... |
#Timers
# Execute code at timed intervals
import time
from threading import Timer
def display(msg):
print(msg + ' ' + time.strftime('%H:%M:%S'))
#Basic timer
def run_once():
display('Run Once : ')
t = Timer(5, display, ['Timeout:'])
t.start()
run_once()
print('Waiting ...')
#Interval Timer
# Wrap i... |
from typing import List
from guacamol.distribution_matching_generator import DistributionMatchingGenerator
class MockGenerator(DistributionMatchingGenerator):
"""
Mock generator that returns pre-defined molecules,
possibly split in several calls
"""
def __init__(self, molecules: List[str]) -> No... |
num = int(input('Informe o numero que voce deseja ver a tabuada: '))
print(f'Tabuada de {num}')
for c in range(0, 11):
print(f'{num} X {c} = {num * c}') |
"""
WSGI config for tgBCoinBot 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/1.11/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_S... |
import cStringIO
import sys
from netlib import wsgi, odict
def tflow():
h = odict.ODictCaseless()
h["test"] = ["value"]
req = wsgi.Request("http", "GET", "/", h, "")
return wsgi.Flow(("127.0.0.1", 8888), req)
class TestApp:
def __init__(self):
self.called = False
def __call__(self,... |
import torch
from torch.utils.data import DataLoader
from torch import nn
from pytorch_transformers import AdamW, WEIGHTS_NAME, WarmupLinearSchedule
import csv
import numpy as np
import os
import logging
from fp16 import FP16_Module, FP16_Optimizer
from parallel import DataParallelModel, DataParallelCriterion
from coll... |
"""
=================================================
SVM: Separating hyperplane for unbalanced classes
=================================================
Find the optimal separating hyperplane using an SVC for classes that
are unbalanced.
We first find the separating plane with a plain SVC and then plot
(dashed) the ... |
"""
FUNÇÕES BÁSICAS PARA O PROGRAMA
"""
from time import sleep
# Imprimir caracter especial
def linha(tam=40):
print(f"{'='*tam}")
# Recebe e valida um nome
def ler_nome(txt):
stop = True
while stop:
stop = False
nome = input(txt).strip()
lista_nome = nome.split()
... |
#!/usr/bin/env python
# encoding: utf-8
def run(whatweb, pluginname):
whatweb.recog_from_file(pluginname, "portal/dbportal/popup/popupdiv.js", "'mozilla'") |
from compare_data.compare_gw import Obs_well_hgs
import unittest
import os
file_directory = os.path.join(os.getcwd(), 'test_data')
output_folder = os.path.join(file_directory, "output")
if not os.path.exists(output_folder):
os.mkdir(output_folder)
class TestStringMethods(unittest.TestCase):
def test_reorder_... |
from airflow.models import BaseOperator
from airflow.hooks.S3_hook import S3Hook
from airflow.hooks.mysql_hook import MySqlHook
import dateutil.parser
import json
import logging
class S3ToMySQLOperator(BaseOperator):
"""
NOTE: To avoid invalid characters, it is recommended
to specify the character encodi... |
#!/usr/bin/python
# Copyright (c) 2014 Wladimir J. van der Laan
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Script to generate list of seed nodes for chainparams.cpp.
This script expects two text files in the directory tha... |
"""Check if userbot alive. If you change these, you become the gayest gay such that even the gay world will disown you."""
import asyncio
from telethon import events
from telethon.tl.types import ChannelParticipantsAdmins
from platform import uname
from userbot import ALIVE_NAME
from userbot.utils import admin_cmd
DE... |
from django.core.mail import send_mail
from django.conf import settings
from django.shortcuts import render
from django.http import Http404
from django.http import HttpResponseRedirect
# Create your views here.
def main( request):
return( render( request, 'contacto/main.html', {'Titulo' : 'Contacto'}))
def get_duda(... |
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'smartcity.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise Impo... |
import random
from itertools import product
from queue import SimpleQueue
from typing import Dict, Type, Optional, Tuple, List, Set
from gupb.controller.tup_tup_resources.trained_model import QuartersRelation, MenhirToCentreDistance, Actions, MODEL
from gupb.model import arenas, coordinates, weapons, tiles, characters... |
from singletask_sql.settings import BASE_DIR, dotenv_values
from singletask_sql.engine import create_engine
# todo - config after auth
env_path = [
f'{BASE_DIR}/../.env',
f'{BASE_DIR}/../.env.local'
]
conf = {}
for path in env_path:
conf.update(dotenv_values(path))
sql_engine = create_engine(conf) |
# Generated by Django 3.2.7 on 2021-10-06 07:21
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('common', '0037_alter_profile_org'),
('tasks', '0008_rename_company_task_org'),
]
operations = [
mig... |
from __future__ import division
# (jEdit options) :folding=explicit:collapseFolds=1:
#This module contains the linked_residue class and the functions needed to build
# and access instances of it.
#2012-09-05:
# prunerestype() moved to this module from cablam_training
# linked_residue.id_with_resname() changed to ret... |
"""
Component logic
"""
from bluecat.util import get_password_from_file
from ..cmdb_configuration import cmdb_config
import requests
def raw_table_data(*args, **kwargs):
# pylint: disable=redefined-outer-name
data = {'columns': [{'title': 'Name'},
{'title': 'IP Address'},
... |
# This file is part of the pyMOR project (https://www.pymor.org).
# Copyright 2013-2021 pyMOR developers and contributors. All rights reserved.
# License: BSD 2-Clause License (https://opensource.org/licenses/BSD-2-Clause)
from pathlib import Path
from pymor.core.config import config
from pymor.core.defaults import de... |
import numpy as np
import pickle
import cv2
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
from moviepy.editor import VideoFileClip
from image_thresholding import *
from plotting_helpers import *
from line_fit import *
from Line import *
# *** PIPELINE ***
def pipeline(img):
global error_im, ski... |
import tensorflow as tf
class SR4DFlowNet():
def __init__(self, res_increase):
self.res_increase = res_increase
def build_network(self, u, v, w, u_mag, v_mag, w_mag, low_resblock=8, hi_resblock=4, channel_nr=64):
channel_nr = 64
speed = (u ** 2 + v ** 2 + w ** 2) ** 0.5
mag = ... |
from django import forms
from django.forms import ModelForm
from models import *
from django.forms.models import inlineformset_factory
class ClienteForm(forms.ModelForm):
class Meta:
model = Cliente
class ClienteContactoForm(forms.ModelForm):
class Meta:
model = ClienteContacto
exclude... |
# -*- coding: utf-8 -*-
"""
modules for universal fetcher that gives historical daily data and realtime data
for almost everything in the market
"""
import os
import sys
import time
import datetime as dt
import numpy as np
import pandas as pd
import logging
import inspect
from bs4 import BeautifulSoup
from functools i... |
def can_build(env, platform):
# Thirdparty dependency OpenImage Denoise includes oneDNN library
# and the version we use only supports x86_64.
# It's also only relevant for tools build and desktop platforms,
# as doing lightmap generation and denoising on Android or HTML5
# would be a bit far-fetche... |
wl = ["aah",
"aaron",
"aba",
"ababa",
"aback",
"abase",
"abash",
"abate",
"abbas",
"abbe",
"abbey",
"abbot",
"abbott",
"abc",
"abe",
"abed",
"abel",
"abet",
"abide",
"abject",
"ablaze",
"able",
... |
from test_src.Tests.test07_scroll_list.conftest import PyFix
from test_src.Pages.HomePage import HomePage
from test_src.Pages.LoginPage import LoginPage
from test_src.Pages.MainPage import MainPage
from test_src.Data.test_data import TestData
import time
class TestScrollList(PyFix):
"""this used to check the tit... |
# 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 ... |
# Copyright 2013 OpenStack Foundation
# 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 requ... |
# coding: utf-8
"""
LogicMonitor REST API
LogicMonitor is a SaaS-based performance monitoring platform that provides full visibility into complex, hybrid infrastructures, offering granular performance monitoring and actionable data and insights. logicmonitor_sdk enables you to manage your LogicMonitor account... |
# 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 u... |
#!/usr/bin/env python3
# This script will accept user input as a string.
# Then display this string in left, right, center of a line in title format.
string=input("Enter the string: ") # read input string
string=string.title() # convert string to title format
'''
# in windows cmd, mode command tells us width of a ... |
"""Base Multivariate class."""
import pickle
import numpy as np
from copulas import NotFittedError, get_instance, validate_random_state
class Multivariate(object):
"""Abstract class for a multi-variate copula object."""
fitted = False
def __init__(self, random_state=None):
self.random_state =... |
# -*- coding: utf-8 -*-
import time
import threading
LOADERS = {
'default': {
'interval': 0.1,
'frames': ('/', '-', '|', '\\', '-')
},
'dots': {
'interval': 0.2,
'frames': ('⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏')
},
'dot... |
import torch
import torch.nn as nn
from typing import Dict, List
from functools import partial
from fvcore.common.config import CfgNode
from giung2.layers import *
__all__ = [
"build_resnet_backbone",
]
class IdentityShortcut(nn.Module):
def __init__(
self,
in_planes: int,
... |
import tempfile
import os.path as op
import sys
import os
import numpy.testing as npt
from nibabel.tmpdirs import TemporaryDirectory
import dipy.data.fetcher as fetcher
from dipy.data import SPHERE_FILES
from threading import Thread
if sys.version_info[0] < 3:
from SimpleHTTPServer import SimpleHTTPRequestHandler ... |
from colorama import Fore
from plugin import plugin
@plugin("bmr")
def bmr(jarvis, s):
"""A Jarvis plugin to calculate
your Basal Metabolic Rate (BMR) and
your Active Metabolic Rate(AMR)"""
jarvis.say("Hello there! Ready to count your BMR? \n")
jarvis.say("1. Yes, let's start! \n2. Sorry,"
... |
"""
In this file we visualize the activations of
particular neurons, at different positions
of a provided sample text.
"""
# Standard libraries
import json
import tkinter as tk
# Third-party libraries
import numpy as np
# Project files
from layers import LSTM
# SETUP
MODEL = "saves/ShakespeareNet.json"
LOOKUP_FILE ... |
# -*- coding: UTF-8 -*-
import os
import codecs
import collections
import random
import sys
import tensorflow as tf
import six
from util import *
from vocab import *
import pickle
import multiprocessing
import time
random_seed = 12345
short_seq_prob = 0 # Probability of creating sequences which are shorter than... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-12-16 08:54
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('workfl... |
# --------------------------------------------------------------------------
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the ""Software""), ... |
# -*- coding: utf-8 -*-
def test_word_similarity():
from sematch.semantic.similarity import WordNetSimilarity
wns = WordNetSimilarity()
dog = wns.word2synset('dog')
cat = wns.word2synset('cat')
# Measuring semantic similarity between concepts using Path method
assert wns.similarity(dog[0], cat[... |
# Generated by Django 1.11.3 on 2017-07-07 19:21
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration): # noqa
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Order',
fields=[
... |
from Acquire.Service import create_return_value
from Acquire.Service import get_service_info, get_service_private_key
def run(args):
"""This function return the status and service info"""
status = 0
message = None
service = None
service = get_service_info()
status = 0
message = "Success... |
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
"""
module for PySQL wrapper
functions, for using as a
library
"""
__author__ = "Devansh Singh"
__email__ = "devanshamity@gmail.com"
__license__ = "MIT"
from pysql import *
"""
classes for functions
for initializing object instances,
use (username, password) of
local MySQL server
"""
from pysql.packages.auth impor... |
from distutils.core import setup
setup(
name = 'TimeBetweenBusinessHours',
packages = ['TimeBetweenBusinessHours'],
version = '0.1',
license='MIT',
description = 'Get the Time Between Business Hours',
author = 'AndreJambersi',
author_email = 'andrejambersi@gmail.com',
url = 'https://github.com/AndreJamb... |
# Source: http://pyparsing.wikispaces.com/file/view/simpleSQL.py
# simpleSQL.py
#
# simple demo of using the parsing library to do simple-minded SQL parsing
# could be extended to include where clauses etc.
#
# Copyright (c) 2003, Paul McGuire
#
from pyparsing import Literal, CaselessLiteral, Word, Upcase, delimitedLis... |
"""TexSoup transforms a LaTeX document into a complex tree of various Python
objects, but all objects fall into one of the following three categories:
``TexNode``, ``TexExpr`` (environments and commands), and ``TexGroup`` s.
"""
import itertools
import re
from TexSoup.utils import CharToLineOffset, Token, TC, to_list... |
factor = int(input())
count = int(input())
new_list = []
for num in range (1, count+1):
new_list.append(factor * num)
print(new_list) |
"""
Aqualink API documentation
The Aqualink public API documentation # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import aqualink_sdk
from aqualink_sdk.model.user_location import UserLocation
class TestUserLoc... |
# -*- coding: utf-8 -*-
"""Stacking of some good solutions.
IMPORTANT:
To run this model you need run before the differents models.
"""
import pandas as pd
import numpy as np
df1 = pd.read_csv('submission40.csv') # 0.309812 (public leaderboard)
df2 = pd.read_csv('submission41.csv') # 0.305985 (public leaderboard)
df... |
#=========================================================
# Developer: Vajira Thambawita
# Reference: https://github.com/meetshah1995/pytorch-semseg
#=========================================================
import argparse
from datetime import datetime
import os
import copy
from tqdm import tqdm
import matplotlib.... |
import base64
import pytest
from fido2 import cbor
from fido2.cose import ES256
from app.models.webauthn_credential import RegistrationError, WebAuthnCredential
# noqa adapted from https://github.com/duo-labs/py_webauthn/blob/90e3d97e0182899a35a70fc510280b4082cce19b/tests/test_webauthn.py#L14-L24
SESSION_STATE = {'c... |
"""
Utilities for the :mod:`dicom_parser.utils.bids` module.
"""
from typing import Dict, List
# A summary of the unique parts (key/value) pairs that make up the appropriate
# BIDS-compatible file name by data type.
ANATOMICAL_NAME_PARTS: List[str] = ["acq", "ce", "rec", "inv", "run", "part"]
DWI_NAME_PARTS: List[str]... |
"""User models admin"""
#Django
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
#Project
from cride.users.models import User, Profile
class CustomUserAdmin(UserAdmin):
"""User model admin."""
list_display = ('email', 'username', 'first_name', 'last_name', 'is_staff', 'is_c... |
from .channel import Channel
from .guild import Guild
from .message import Message
from .user import User |
# -*- coding: utf-8 -*-
"""File generated according to PWSlot15/gen_list.json
WARNING! All changes made in this file will be lost!
"""
from pyleecan.GUI.Dialog.DMachineSetup.SWSlot.PWSlot15.Ui_PWSlot15 import Ui_PWSlot15
class Gen_PWSlot15(Ui_PWSlot15):
def setupUi(self, PWSlot15):
"""Abstract class to up... |
# Copyright The PyTorch Lightning team.
#
# 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 i... |
from . import ffi
from .common import _encode_string
from ctypes import c_char_p
def set_option(name, option):
"""
Set the given LLVM "command-line" option.
For example set_option("test", "-debug-pass=Structure") would display
all optimization passes when generating code.
"""
ffi.lib.LLVMPY_S... |
import pyaudio
import wave
from wit import Wit
class Speech2Intent:
def __init__(self, access_token):
self.client = Wit(access_token)
self.headers = {'authorization': 'Bearer '+ access_token, 'Content-Type': 'audio/wav'}
def recognize_speech(self, AUDIO_FILENAME, num_seconds = 4):
... |
from class_car import car
class electrical_car(car):
def __init__(self, make, model,year):
super().__init__(make, model, year)
self.battery_volume = 70 # KWh
def describe_battery(self):
description = 'This car has a '+str(self.battery_volume)+' KWh battery . '
return descripti... |
"""Configurations for Fall 2016."""
from berkeleytime.config.finals.semesters.fall2017 import *
import datetime
CURRENT_SEMESTER = 'fall'
CURRENT_YEAR = '2017'
CURRENT_SEMESTER_DISPLAY = 'Fall 2017'
# SIS API Keys
SIS_TERM_ID = 2178
TELEBEARS = {
'phase1_start': datetime.datetime(2017, 4, 18),
'phase2_start... |
import re
import discord
from commands import set_presence, avatar, erp
from commands.admin import list_user_admin, add_user_admin, rm_user_admin
from commands.birthday import (set_channel_bd, show_channel_bd, set_user_bd, set_notif_time, list_user_bd,
manual_bd_check, show_message_bd, ... |
import itertools as it
def fire(manager_list, salary_list, productivity_list):
acc_list = [val[0] - val[1]
for val in it.chain([(0,0)], zip(productivity_list, salary_list))][-1::-1]
for i, e in it.takewhile(lambda v: v[0] != 0, zip(range(len(acc_list)-1, -1, -1), acc_list)):
acc_list[-... |
# Copyright 2012 NEC 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 ag... |
# model settings
model = dict(
type='TTFNet',
# pretrained='modelzoo://resnet18',
pretrained=None,
backbone=dict(
type='FatNetSimple',
norm_cfg = dict(type='BN', requires_grad=True),
),
neck=None,
bbox_head=dict(
type='TTFHeadFull',
inplanes=16,
planes=64,... |
# -*- coding: utf-8 -*-
from wakatime.main import execute
from wakatime.packages import requests
from wakatime.packages.requests.models import Response
import logging
import os
import shutil
import tempfile
import time
from testfixtures import log_capture
from wakatime.compat import u, open
from wakatime.constants i... |
from flask import (
Blueprint, flash, g, redirect, render_template, request, url_for
)
from werkzeug.exceptions import abort
from flaskr.auth import login_required
from flaskr.db import get_db
bp = Blueprint('blog', __name__)
@bp.route('/')
def index():
db = get_db()
posts = db.execute(
'SELECT p... |
from .base import *
DEBUG = True
ALLOWED_HOSTS = []
# Database
# https://docs.djangoproject.com/en/3.1/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': os.environ.get("POSTGRES_DB"),
'USER': os.environ.get("POSTGRES_USER"),
'P... |
from functools import wraps
from django.http import HttpResponse
from rest_framework.response import Response
from rest_framework import status
from website.constants import WIDGET_NAMES
def user_can_use_web_widget(function):
@wraps(function)
def decorator(request, *a, **k):
if request.user.userprof... |
# Copyright: 2006 Brian Harring <ferringb@gmail.com>
# License: GPL2/BSD
from snakeoil.sequences import iflatten_instance
from snakeoil.test import TestCase
from pkgcore import fetch
class base(TestCase):
def assertUri(self, obj, uri):
uri = list(uri)
self.assertEqual(list(iflatten_instance(obj... |
import pandas as pd
import numpy as np
import torch
print(f"Torch Version: {torch.__version__}")
import transformers
print(f"transformers (Adapter) Version: {transformers.__version__}")
from transformers import RobertaTokenizer
import numpy as np
tokenizer = RobertaTokenizer.from_pretrained("roberta-base")
from tra... |
#!/usr/bin/env python
"""
_RequestInfo_
Class to hold and parse all information related to a given request
"""
# futures
from __future__ import division, print_function
from future.utils import viewitems
# system modules
import datetime
import time
# WMCore modules
from pprint import pformat
from copy import deepcopy... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2019-01-13 04:49
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('database', '0015_auto_20190112_0251'),
]
operation... |
import turtle
t = turtle.Turtle()
turtle.bgcolor('black')
def triangle():
t.forward(100)
t.left(120)
t.forward(100)
t.left(120)
t.forward(100)
t.left(120)
t.forward(100)
t.speed(0)
t.pencolor('red')
t.penup()
t.goto(-350,250)
t.pendown()
for numbers in range(7):
x = 250 - (86*numbers)
... |
from setuptools import setup, find_packages
def readfile(name):
with open(name) as f:
return f.read()
readme = readfile('README.rst')
changes = readfile('CHANGES.rst')
requires = ['zope.interface']
docs_require = ['Sphinx', 'sphinx_rtd_theme']
tests_require = ['pytest', 'pytest-cov', 'venusian', 'syb... |
import argparse
import dateutil.tz
import errno
import io
import json
import logging
import os
import pstats
import random
import re
import shutil
import socket
import stat
import subprocess
import sys
import tempfile
import time
import unittest
from binascii import unhexlify, b2a_base64
from configparser import Config... |
from js9 import j
from .client import Client
JSConfigBase = j.tools.configmanager.base_class_configs
JSBASE = j.application.jsbase_get_class()
class ClientFactory(JSConfigBase):
def __init__(self):
self.__jslocation__ = 'j.clients.ays'
JSConfigBase.__init__(self, Client)
# def get(self, url... |
# Copyright (C) 2020 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 wri... |
from unittest import TestCase
from helper import bit_field_to_bytes, encode_varint, int_to_little_endian, murmur3
from network import GenericMessage
BIP37_CONSTANT = 0xfba4c795
class BloomFilter:
def __init__(self, size, function_count, tweak):
self.size = size
self.bit_field = [0] * (size * 8... |
import os, sys
pwd = os.path.abspath(os.path.abspath(__file__))
father_path = os.path.abspath(os.path.dirname(pwd) + os.path.sep + "..")
sys.path.append(father_path)
from Communication.Modules.Driver_recv import DriverRecv
if __name__ == "__main__":
drv_recv = DriverRecv()
drv_recv.start() |
#!/usr/bin/env python
# __BEGIN_LICENSE__
# Copyright (c) 2006-2013, United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration. All
# rights reserved.
#
# The NASA Vision Workbench is licensed under the Apache License,
# Version 2.0 (the "License"); you may... |
T = input()
hh, mm = map(int, T.split(':'))
mm += 5
if mm > 59:
hh += 1
mm %= 60
if hh > 23:
hh %= 24
print('%02d:%02d' % (hh, mm)) |
# coding: utf-8
"""
Intersight REST API
This is Intersight REST API
OpenAPI spec version: 1.0.9-262
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class HyperflexUcsmConfigPolicyRef(object):
"""
NOT... |
from conda_verify.conda_package_check import CondaPackageCheck
def verify(path_to_package=None, verbose=True, **kwargs):
package_check = CondaPackageCheck(path_to_package, verbose)
package_check.info_files()
package_check.no_hardlinks()
package_check.not_allowed_files()
package_check.index_json()
... |
def batch_iterator(iterable, size=100, filter_expression=None):
current_batch = []
for x in iterable:
if filter_expression:
if filter_expression(x):
current_batch.append(x)
else:
current_batch.append(x)
if len(current_batch) == size:
... |
# coding: utf-8
"""
ExaVault API
See our API reference documentation at https://www.exavault.com/developer/api-docs/ # noqa: E501
OpenAPI spec version: 2.0
Contact: support@exavault.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
i... |
class BaseModel(object):
def create_model(self, unused_model_input, **unused_params):
raise NotImplementedError() |
# https://app.codesignal.com/arcade/code-arcade/lab-of-transformations/vsKRjYKv4SCjzJc8r/
def higherVersion(ver1, ver2):
# Split by dots, convert individual elements to ints.
ver1 = [int(x) for x in ver1.split(".")]
ver2 = [int(x) for x in ver2.split(".")]
# This will do a comparison item-wise of all e... |
from lex import tsymbol_dict
from expression import *
from code_generate_table import *
from code_generate_utils import *
class CodeGenerator(object):
def __init__(self, tree):
self.tree = tree
self.base, self.offset, self.width = 1, 1, 1
self.TERMINAL, self.NONTERMINAL = 0, 1
self... |
# Copyright (c) 2020 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 appli... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.