text stringlengths 1 927k |
|---|
# Credits ;- @mrconfused
from geopy.geocoders import Nominatim
from userbot.utils import admin_cmd
from telethon.tl import types
from userbot import CMD_HELP
@borg.on(admin_cmd(pattern="gps ?(.*)"))
async def gps(event):
if event.fwd_from:
return
reply_to_id = event.message
if event.reply_to_msg_... |
#This rule is an example for a jvm rule that doesn't support Jars2Labels
def _custom_jvm_impl(ctx):
# TODO(#8867): Migrate away from the placeholder jar hack when #8867 is fixed.
jar = ctx.file.jar
provider = JavaInfo(
output_jar = jar,
compile_jar = jar,
deps = [target[JavaInfo] for... |
class CannotOverwriteExistingCassetteException(Exception):
def __init__(self, *args, **kwargs):
message = self._get_message(kwargs["cassette"], kwargs["failed_request"])
super(CannotOverwriteExistingCassetteException, self).__init__(message)
def _get_message(self, cassette, failed_request):
... |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.12.4
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
i... |
import sys
import pytest
from pydantic import ConfigError, ValidationError
skip_pre_37 = pytest.mark.skipif(sys.version_info < (3, 7), reason='testing >= 3.7 behaviour only')
@skip_pre_37
def test_postponed_annotations(create_module):
module = create_module(
# language=Python
"""
from __future_... |
# Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... |
import collector_utils
movies_urls = [collector_utils.get_urls(i) for i in range(1,3)]
#%%
movies_urls[0].update(movies_urls[1])
movies_urls = movies_urls[0].copy()
collector_utils.scraping(movies_urls, 1) |
import binascii
from Crypto.Cipher import AES
s=binascii.unhexlify("140b41b22a29beb4061bda66b6747e14")
print(s) |
__author__ = 'Matthew Badger' |
# Copyright 2014-2016 OpenMarket Ltd
# Copyright 2017 Vector Creations Ltd
# Copyright 2018-2019 New Vector Ltd
# Copyright 2019 The Matrix.org Foundation C.I.C.
#
# 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... |
{
'targets': [
{
'target_name': 'sqlserver',
'sources': [
'src/Column.cpp',
'src/Connection.cpp',
'src/OdbcConnection.cpp',
'src/OdbcError.cpp',
'src/OdbcOperation.cpp',
'src/ResultSet.cpp',
'src/stdafx.cpp',
'src/Utility.cpp',
],... |
from .checkers import redis
from .checkers import base
def add_health_route(app, name="Application Name", checkers=[], version=1.0):
async def health_route():
checks = []
for checker in checkers:
checks.append(await checker.check())
status = True
... |
# -*- coding: utf-8 -*-
# Copyright (c) 2020 Kumagai group.
# standard Dash imports
# import for this example
import argparse
import sys
# standard Crystal Toolkit import
import crystal_toolkit.components as ctc
import dash
import dash_html_components as html
from pydefect.analyzer.dash_components.supercell_componen... |
print("-----Output-----")
# * Number 1 answers
# a. [1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5]
# b. [1, 2, 3, 4, 5, 11, 12, 13, 14, 15]
# c. TypeError
# d. 2
# e. 1
# f. 5
# g. [1, 2, 3, 4, 5]
# h. [3, 4]
# i. [2, 4]
# j. [1, 2]
# k. [1, 3, 5]
# * Number 2
items = []
def num2(items):
items.append(67)
ite... |
# Uses python3
import sys
# def fibonacci_sum_naive(n):
# if n <= 1:
# return n
#
# previous = 0
# current = 1
# sum = 1
#
# for _ in range(n - 1):
# previous, current = current, (previous + current)%10
# sum += current
#
# return sum % 10
memo = {}
def calc_fib(n):
... |
# Copyright 2021 The Kubeflow Authors
#
# 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... |
import numpy as np
import sympy
from zquantum.core.circuit import Circuit, Qubit, Gate, create_layer_of_gates
from zquantum.core.interfaces.ansatz import Ansatz
from zquantum.core.interfaces.ansatz_utils import (
ansatz_property,
invalidates_parametrized_circuit,
)
from typing import Optional, List
from .ansatz... |
import pyaf.Bench.TS_datasets as tsds
import pyaf.tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 32 , FREQ = 'D', seed = 0, trendtype = "Lag1Trend", cycle_length = 12, transform = "None", sigma = 0.0, exog_count = 100, ar_order = 0); |
import numpy as np
from kinematics.dhparameters import DHParameters
class Kinematics:
def __init__(self):
self.joint1_dh = DHParameters(0, 0.1625, 0)
self.joint2_dh = DHParameters(0, 0, np.pi / 2)
self.joint3_dh = DHParameters(-0.425, 0, 0)
self.joint4_dh = DHParameters(-0.39225, ... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... |
# Copyright (c) The Diem Core Contributors
# SPDX-License-Identifier: Apache-2.0
"""LIP-4 Transaction Metadata Utilities
This module implements utility functions for application to create transaction metadata and metadata signature.
See https://dip.diem.com/dip-4 for more details
"""
from dataclasses import datacl... |
import re
from aiohttp.web_exceptions import HTTPMovedPermanently
from aiohttp.web_urldispatcher import SystemRoute
__all__ = (
'middleware',
'normalize_path_middleware',
)
async def _check_request_resolves(request, path):
alt_request = request.clone(rel_url=path)
match_info = await request.app.ro... |
"""Tests for distutils.command.bdist."""
import os
import unittest
from test.support import run_unittest
from distutils.command.bdist import bdist
from distutils.tests import support
class BuildTestCase(support.TempdirManager,
unittest.TestCase):
def test_formats(self):
# let's creat... |
class Node:
def __init__(self, data):
self.data = data
self.next = None
class LinkedList:
def __init__(self):
self.head = None
def add(self, data):
node = Node(data)
# if list is empty
if not self.head:
self.head = node
else:
... |
import urllib.request
import feedparser
import ujson
from centrifuge.domain import document as ad
class CrawlerArxivRepo:
"""
This is a helper class to parse arxiv.org site.
It uses the arxiv.org REST API to search for articles.
based on karpathy's arxiv-sanity:
https://github.com/karpathy/arxiv-... |
# Copyright 2015 gRPC authors.
#
# 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... |
# -*- coding: utf-8 -*-
from werobot.messages.entries import StringEntry, IntEntry, FloatEntry
from werobot.messages.base import WeRoBotMetaClass
class EventMetaClass(WeRoBotMetaClass):
pass
class WeChatEvent(object, metaclass=EventMetaClass):
target = StringEntry('ToUserName')
source = StringEntry('Fr... |
class Solution:
def fairCandySwap(self, A: List[int], B: List[int]) -> List[int]:
Sa, Sb = sum(A), sum(B)
setB = set(B)
for x in A:
if x + (Sb-Sa)/2 in setB:
return [x, x + (Sb-Sa)/2] |
import joblib
import pandas as pd
class ExtraTreesClassifier:
def __init__(self):
path_to_artifacts = "../../research/"
self.values_fill_missing = joblib.load(path_to_artifacts +
"train_mode.joblib")
self.encoders = joblib.load(path_to_artifac... |
# -*- coding: utf-8 -*-
# Copyright 2017, IBM.
#
# This source code is licensed under the Apache License, Version 2.0 found in
# the LICENSE.txt file in the root directory of this source tree.
"""
Composite gate, a container for a sequence of unitary gates.
"""
from ._gate import Gate
from ._qiskiterror import QISKit... |
def map_label(df, column, mapping):
df[column] = df[column].replace(mapping)
return df
def map_mult_labels(df, columns, labels):
for column in columns:
df = map_label(df, labels[column][0], labels[column][1])
return df
#https://stackoverflow.com/questions/26886653/pandas-create-new-column... |
cpu = str(4)
memory = "60G"
pept_len_range = "11:30" ## For MHC-II prediction
home = "C:/Repitope"
target_peptide_file = home + "/peptide_test.txt"
tcr_frag_file = home + "/FragmentLibrary.fst"
mhcii_feature_file = home + "/FeatureDF_MHCII_Weighted.10000.fst"
import pyper
r = pyper.R()
command = "options(java.parame... |
'''
Class define IP protocol
'''
import socket
import struct
from common import checksum
class layer(object):
pass
class IP(object):
def __init__(self, src, dst, proto=socket.IPPROTO_TCP):
self.version = 4
self.ihl = 5 # Internet Header Length
self.tos = 0 # Type of Service
... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2018, F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
module: bigip_asm_policy_signat... |
from tkinter import *
def avg():
a = int(e1.get()) + int(e2.get()) + int(e3.get())
a = a/3
l4['text'] = a
root = Tk()
l1 = Label(root, text='Math')
l1.grid(row=0, column=0)
l2 = Label(root, text='Science')
l2.grid(row=1, column=0)
l3 = Label(root, text='History')
l3.grid(row=2, column=0)
e1 = Entry(r... |
from django.utils.translation import ugettext_lazy as _
from mayan.apps.permissions import PermissionNamespace
namespace = PermissionNamespace(
label=_('Announcements'), name='announcements'
)
permission_announcement_create = namespace.add_permission(
label=_('Create announcements'), name='announcement_creat... |
import time
import functools
import warnings
from pandaharvester.harvestercore import core_utils
from pandaharvester.harvestercore.plugin_base import PluginBase
from pandaharvester.harvesterconfig import harvester_config
warnings.simplefilter("ignore")
class MysqlFifo(PluginBase):
# constructor
def __init__... |
# coding=utf-8
# Copyright 2020 The TensorFlow Datasets Authors and the HuggingFace Datasets Authors.
#
# 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/LI... |
# coding: utf-8
"""
ELEMENTS API
The version of the OpenAPI document: 2
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from elements_sdk.configuration import Configuration
class AWSAccountPartialUpdate(object):
"""NOTE: This class is auto genera... |
import logging
from functools import wraps
from socket import gaierror
from time import sleep
from typing import Union, Optional, Dict
import pandas as pd
from pandas.tseries.offsets import YearBegin, YearEnd
import pytz
import requests
from bs4 import BeautifulSoup
from entsoe.exceptions import InvalidPSRTypeError, ... |
"""
OpenAPI Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
import re # noq... |
# pylint: disable=C0111,R0902,R0904,R0912,R0913,R0915,E1101
# Smartsheet Python SDK.
#
# Copyright 2018 Smartsheet.com, 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.... |
import db_con
class write_db:
def __init__(self):
self.db = db_con.connect_DB()
def write_db(self, sql_query, vals):
self.db.query(sql_query, vals)
self.db.commit() |
'''
Vowels -- A E I O U Y
Consonants -- B C D F G H J K L M N P Q R S T V W X Z
You are given a block of text with different words. These words are separated by white-spaces and punctuation marks. Numbers are not considered words in this mission (a mix of letters and digits is not a word either). You should count the ... |
#
# 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 us... |
# -*- coding: utf-8 -*-
"""
Class for the results of an optimisation with BELLA
with several ply-drop layout
"""
__version__ = '2.0'
__author__ = 'Noemie Fedon'
import numpy as np
#import sys
#sys.path.append(r'C:\BELLA')
#from src.divers.pretty_print import print_lampam, print_ss, print_list_ss
class BELLA_Results(... |
# coding: utf-8
import os
import mxnet as mx
import numpy as np
import math
import cv2
from multiprocessing import Pool
from itertools import repeat
try:
from itertools import izip
except ImportError:
izip = zip
from helper import nms, adjust_input, generate_bbox, detect_first_stage_warpper
class MtcnnDetecto... |
"""
Defines base FacePP resource manager class and it's infrastructure.
"""
from .. import exceptions, resultsets, utilities
class ResourceManager(object):
"""
Manages given FacePP resource class with the help of facepp object.
"""
def __init__(self, facepp, resource_class):
"""
:para... |
class ScannerException(Exception):
def __init__(self, message, token=None):
self.message = message
self.token = token |
from django.db import models
# class Example(models.Model):
# text = models.TextField(blank=True, null=True) |
from yaaf.agents.Agent import Agent
from yaaf.agents.GreedyMDPAgent import GreedyMDPAgent
from yaaf.agents.HumanAgent import HumanAgent
from yaaf.agents.QLearningAgent import QLearningAgent
from yaaf.agents.SARSAAgent import SARSAAgent
from yaaf.agents.RandomAgent import RandomAgent
DummyAgent = RandomAgent
OptimalAge... |
import re
import json
import random
random.seed(1)
from Config import get_config
_,db,r = get_config()
stopwords_en = db.event_metadata.find_one({'name':'stopwords_en'})['data']
def get_stopwords():
return stopwords_en[random.randint(0,len(stopwords_en)-1)]
def get_task():
for item in db.dataset.find({},{'_id':1... |
"""
Ory APIs
Documentation for all public and administrative Ory APIs. Administrative APIs can only be accessed with a valid Personal Access Token. Public APIs are mostly used in browsers. # noqa: E501
The version of the OpenAPI document: v0.0.1-alpha.187
Contact: support@ory.sh
Generated by: ht... |
import unittest
import re
import subprocess
class TestCompilers(unittest.TestCase):
def test_latest_kubos_installed(self):
bashCommand = "vagrant ssh -c 'mspdebug --version'"
process = subprocess.Popen(bashCommand.split())
output, error = process.communicate()
regex = re.compile(r"M... |
import sys
import os
__appname = 'letmein'
__path_to_app = os.path.abspath(os.path.join(os.path.dirname(os.path.dirname(__file__)), __appname))
sys.path.insert(0, __path_to_app) |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'fun.ui'
#
# Created by: PyQt5 UI code generator 5.12
#
# WARNING! All changes made in this file will be lost!
from PyQt5.QtWidgets import (QWidget , QHBoxLayout , QVBoxLayout , QApplication,
QPushButton, QLineE... |
#!/usr/bin/env python
# Copyright (c) 2019 Daniel Hammer. 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 re... |
# Linked List implementation
class Queue:
def __init__(self):
self._privateList = []
def enqueue(self, newElement):
self._privateList.append(newElement)
def dequeue(self):
if len(self._privateList) == 0:
return None
first = self._privateList[0]
del self._privateList[0]
return first
def peek(self... |
from .cog import Debug
from . import config
def setup(bot):
bot.add_cog(Debug(bot, name=config.name))
def configure(name="Debug"):
config.name = name |
# Copyright (c) 2019 ISP RAS (http://www.ispras.ru)
# Ivannikov Institute for System Programming of the Russian Academy of Sciences
#
# 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
#
# htt... |
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Gtacoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import GtacoinTestFramework
from test_framework.util import *
class ... |
from .WordTokenizer import WordTokenizer
from .SentenceTokenizer import SentenceTokenizer
from .HamshahriReader import HamshahriReader
from .PersicaReader import PersicaReader
from .BijankhanReader import BijankhanReader
from .PeykareReader import PeykareReader
from .VerbValencyReader import VerbValencyReader
from .Dad... |
"""zz2 URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based ... |
# Android Device Testing Framework ("dtf")
# Copyright 2013-2017 Jake Valletta (@jake_valletta)
#
# 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
... |
from variables import *
def printAt(x, y, text):
print(f"\033[{y};{x}H{text}")
def printCube():
for z in range(len(cube)):
for y in range(len(cube[z])):
row = ""
for x in range(len(cube[z][y])):
if cube[z][y][x] == 6:
row += f"🔳"
... |
from parsl.config import Config
from parsl.executors import WorkQueueExecutor
from parsl.data_provider.http import HTTPInTaskStaging
from parsl.data_provider.ftp import FTPInTaskStaging
from parsl.data_provider.file_noop import NoOpFileStaging
from parsl.providers import LocalProvider
config = Config(executors=[Work... |
"""
fritzcall.py
Module to inspect the FritzBox phone API.
CLI interface.
This module is part of the FritzConnection package.
https://github.com/kbr/fritzconnection
License: MIT (https://opensource.org/licenses/MIT)
Author: Klaus Bremer
"""
from ..lib.fritzcall import FritzCall
from . utils import get_cli_arguments,... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import subprocess
import numpy
from Cython.Build import cythonize
from setuptools import find_packages, setup
from setuptools.extension import Extension
EXTENSIONS = [
Extension(
"ax.utils.stats.sobol",
... |
# Copyright (c) Microsoft Corporation and Fairlearn contributors.
# Licensed under the MIT License.
import pytest
import numpy as np
import fairlearn.metrics as metrics
# ======================================================
y_true = [0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1]
y_pred = [1, 0, 1, 0, 1, 0... |
#!/usr/bin/env python
'''
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")... |
"""
Open the file romeo.txt and read it line by line. For each line, split the line into a list of words using the split() method.
The program should build a list of words. For each word on each line check to see if the word is already in the list and if not append it to the list.
When the program completes, sort and... |
# Copyright 2018, The TensorFlow Federated Authors.
#
# 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 o... |
from django.db import models
from pathlib import Path
import os
BASE_DIR = Path(__file__).resolve().parent.parent
DEFAULT_IMAGE = os.path.join(BASE_DIR, "media/assets/default_image.png")
def get_image_path(instance, filename):
return os.path.join('images', str(instance.id), filename)
def get_image_path_streamd... |
# -*- coding: utf-8 -*-
"""
Global configuration file for TG2-specific settings in pyjobsweb.
This file complements development/deployment.ini.
"""
from tg.configuration import AppConfig
import pyjobsweb
from pyjobsweb import model
base_config = AppConfig()
base_config.renderers = []
# True to prevent dispatcher f... |
# Copyright 2018, The TensorFlow Federated Authors.
#
# 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 o... |
#!/usr/bin/env python2
# Copyright (c) 2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
import socket
import traceback, sys
from binascii import hexlify
import time, os
from socks5 import Socks5Conf... |
"""Business Logic for Rate Limiter Status API"""
from core.common.constants import RateLimitPer as Per
from core.common.utils import data_not_found
from http import HTTPStatus
class RateLimitStatus:
"""Business Logic for Rate Limit Status API"""
def __init__(self, namespace=None, datastore=None):
se... |
from . import backbones
from . import heads
from . import blocks
from . import customs
from . import detectors
from . import necks
from . import losses
from . import cyclesrbodys |
import json
import os
import platform
from conan.tools.cmake.layout import get_build_folder_vars_suffix
from conan.tools.cmake.utils import is_multi_configuration
from conans.errors import ConanException
from conans.util.files import save, load
def _add_build_preset(conanfile, multiconfig):
build_type = conanfil... |
#! /usr/bin/python3.6
import pytest
from pycatia import CATIADocHandler
from pycatia.mec_mod_interfaces.part import Part
from pycatia.exception_handling.exceptions import CATIAApplicationException
from tests.source_files import cat_part_measurable
from tests.source_files import cat_product
def test_activation():
... |
import argparse
import logging
import time
import falcon
from falcon_cors import CORS
import json
import waitress
import re
import pandas
logging.basicConfig(level=logging.INFO, format='%(asctime)-18s %(message)s')
logger = logging.getLogger()
cors_allow_all = CORS(allow_all_origins=True,
allo... |
#!/usr/bin/env python3
import socket
from sys import argv, exit
from time import sleep
UDP_IP = "127.0.0.1"
UDP_PORT = 5005
MESSAGE = "Hello, World!\n"
if __name__ == '__main__':
print("UDP target IP:", UDP_IP)
print("UDP target port:", UDP_PORT)
print("message:", MESSAGE)
sock = socket.socket(socke... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import taiga.users.models
class Migration(migrations.Migration):
dependencies = [
('users', '0004_auto_20140913_1914'),
]
operations = [
migrations.AlterField(
model_name... |
#
# Copyright European Organization for Nuclear Research (CERN),
# National Research Centre "Kurchatov Institute" (NRC KI)
#
# 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
#
# ht... |
#!/usr/bin/env python
"""
File holds the module of Migration database manager and decide to connect with
multiple databases using the configuration parameters.
URI of database handled automatically for multiple databases using SQLAlchemy
"""
import os
import logging
import traceback
from urllib.parse import quote_plu... |
import urllib
import urllib.request
import os
import json
import re
import PyRSS2Gen
import datetime
from os import path,system
headers = {"Cookie": "appver=1.5.0.75771",
"Referer":"http://music.163.com/",
"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.... |
import autocalendar as autocalendar
# Set up Oauth to access Google API
service = autocalendar.setup_oath(token_path='token.pkl',
client_path='client_secret.json')
# Read and tidy excel sheet
participants = autocalendar.preprocess_file('participant_schedules.xlsx', header_row=2)
###... |
#!/usr/bin/python
"""
ARDrone3 autonomous landing on ARDrone2 box with Orinted Roundel
usage:
!!! WORK IN PROGRESS !!!
./navbox.py <task> [<metalog> [<F>]] | --test <image|video> [<stopAt index>]
"""
import sys
import math
import cv2
import os
import numpy as np
import inspect
BEBOP_ROOT = os.path.rea... |
import argparse
import os
import random
import numpy as np
import torch
import torch.nn.functional as fun
import utils
from dataloader import DataLoader
parser = argparse.ArgumentParser(fromfile_prefix_chars='@')
parser.add_argument('-dataset', type=str, default='i80')
parser.add_argument('-debug', action='store_tru... |
#!/usr/bin/env python
###############################################################################
# src/$RCSfile$ $Revision$
#
try:
#Sometime after python 2.2.3 but before 2.4.3 this python library was
# added. It causes a problem with freeze if not imported explicitly.
# The problem being that the ex... |
# -*- coding: utf-8 -*-
#
# Django Rocket documentation build configuration file, created by
# sphinx-quickstart on Sat Nov 16 17:35:25 2013.
#
# 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.
#... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# 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 (... |
# -*- coding: utf-8 -*-
"""
(c) 2018 - Copyright Red Hat Inc
Authors:
Pierre-Yves Chibon <pingou@pingoured.fr>
"""
from __future__ import unicode_literals, absolute_import
import datetime
import unittest
import shutil
import sys
import os
import json
import pagure_messages
from fedora_messaging import api, t... |
from collections import namedtuple
from decimal import Decimal as D
from oscar.core.loading import get_class
Unavailable = get_class('partner.availability', 'Unavailable')
Available = get_class('partner.availability', 'Available')
StockRequiredAvailability = get_class('partner.availability', 'StockRequired')
Unavaila... |
"""
SymPy statistics module
Introduces a random variable type into the SymPy language.
Random variables may be declared using prebuilt functions such as
Normal, Exponential, Coin, Die, etc... or built with functions like FiniteRV.
Queries on random expressions can be made using the functions
======================... |
from distutils.core import setup
setup(name='zss',
version='1.0',
description='Tree edit distance using the Zhang Shasha algorithm',
author='Tim Henderson',
author_email='tim.tadh@gmail.com',
url='https://www.github.com/timtadh/sleepytree',
packages=['zss'],
requires=['editdis... |
# Generated by Django 3.1.12 on 2021-06-30 18:52
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('questionnaires', '0003_quiz_quizformfield'),
]
operations = [
migrations.AddField(
model_name='poll',
name='direct_... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
class Response():
def __init__(self, server):
self._server = server
self.response_code = 200
self.content_type = None
self.content = ""
self.headers = {}
self.cookies = {} |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
from __future__ import print_function
import warnings
import numpy as np
import pytest
import librosa
from test_core import load, srand
# Disable cache
import os
try:
os.environ.pop('LIBROSA_CACHE_DIR')
except KeyError:
pass
__EXAMPLE_FILE = os.path.join('te... |
import xml.etree.ElementTree as ET
from itoolkit import iSqlParm
DATA = "Hello, world!"
def test_sql_query():
key = 'dmmyeozq'
element = ET.fromstring(iSqlParm(key, DATA).xml_in())
assert(element.tag == 'parm')
assert(element.text == DATA)
assert(len(element.attrib) == 2)
assert('io' in e... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.