text stringlengths 12 6.59M |
|---|
"""Utility file for utterance generator to work with CX resources."""
# Copyright 2022 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/LICE... |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 - 2021 -- Lars Heuer
# All rights reserved.
#
# License: BSD License
#
"""\
QR Code and Micro QR Code implementation.
"QR Code" and "Micro QR Code" are registered trademarks of DENSO WAVE INCORPORATED.
"""
from __future__ import absolute_import, unicode_literals
import sy... |
# Package: events
# Date: 11th April 2010
# Author: James Mills, prologic at shortcircuit dot net dot au
"""
This module defines the basic event class and common events.
"""
from inspect import ismethod
class EventType(type):
def __init__(cls, name, bases, ns):
super(EventType, cls).__init__(n... |
# Module: sockets
# Date: 04th August 2004
# Author: James Mills <prologic@shortcircuit.net.au>
"""Socket Components
This module contains various Socket Components for use with Networking.
"""
import os
import socket
from errno import *
from collections import defaultdict, deque
from circuits.net.pollers im... |
# Copyright (c) 2016, PerformLine, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditio... |
import sublime
import sublime_plugin
import os
import re
import subprocess
import sys
class SyntaxSettings:
def __init__(self, syntax):
self.syntax = syntax
def get(self, key, default=None):
settings = sublime.load_settings("SendTextPlus.sublime-settings")
ret = None
plat = s... |
# Built-in modules #
import time
from urllib2 import HTTPError
# Internal modules #
# First party modules #
from tqdm import tqdm
# Third party modules #
from Bio import Entrez
from Bio.Entrez.Parser import CorruptedXMLError
# Constants #
Entrez.email = "I don't know who will be running this script"
##############... |
# -*- coding: utf-8 -*-
#
# This file is part of Sequana software
#
# Copyright (c) 2016 - Sequana Development Team
#
# File author(s):
# Thomas Cokelaer <thomas.cokelaer@pasteur.fr>
#
# Distributed under the terms of the 3-clause BSD license.
# The full license is in the LICENSE file, distributed with this s... |
import random
import click
from faker import Faker
from catwatch.app import create_app
from catwatch.extensions import db
from catwatch.blueprints.issue.models import Issue
from catwatch.blueprints.user.models import User
fake = Faker()
app = create_app()
def _log_status(count, model_label):
"""
Log the o... |
__version__ = '2.0.1'
|
# from i2clibraries import i2c_hmc58831
from socket import socket
from socket import AF_INET
from socket import SOCK_STREAM
from socket import error as socket_error
from time import sleep
from time import time
from struct import pack
from datetime import datetime
from threading import Thread
import config
import ParKin... |
from __future__ import unicode_literals
from django.utils import version
__all__ = ['VERSION', '__version__']
VERSION = (1, 0, 7, 'alpha', 0)
__version__ = version.get_version(VERSION)
|
from __future__ import absolute_import
import sys
import os.path
import numpy as np
import scipy.interpolate as interpolate
import datetime
import dateutil
import csv
import copy
from itertools import dropwhile
from sunpy.net import hek
from sunpy.time import parse_time
from sunpy.sun import sun
import sunpy.lightcur... |
from __future__ import absolute_import
from __future__ import division
import sys
import os.path
import numpy as np
import scipy.interpolate as interpolate
import datetime
import dateutil
import csv
import copy
import urllib
from itertools import dropwhile
from sunpy.net import hek
from sunpy.time import parse_time
f... |
#!/usr/bin/python2.5
"""
@bug In update desrcription stuff
"""
import os
import sys
try:
import py2deb
except ImportError:
import fake_py2deb as py2deb
import constants
__appname__ = constants.__app_name__
__description__ = "Touch screen enhanced interface to the GoogleVoice/GrandCentral phone service"
__author... |
"""
THE PUBLIC API
This file is responsible for API endpoints. In here, all
methods should handle:
- web arguments
Parse and "translate" web arguments where need be,
so that models.py can easily generate queries or
perform business logic.
- file formats
Prepare .zip, .csv etc. files.... |
from sklearn import clone, metrics
from sklearn.base import BaseEstimator, RegressorMixin
import sklearn.cross_validation as cv
import numpy as np
from scipy.optimize import fmin_l_bfgs_b, nnls
class SLError(Exception):
"""
Base class for errors in the SupyLearner package
"""
pass
class SuperLearner(... |
#! /usr/bin/python
# The MIT License
#
# Copyright (c) 2008 Joe Beda
#
# 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, ... |
import numpy as np
import pandas as pd
from PyAstronomy import pyasl
from werkzeug.contrib.cache import SimpleCache
cache = SimpleCache()
colors = {
'Blue': '#1f77b4',
'Orange': '#ff7f0e',
'Green': '#2ca02c',
'Red': '#d62728',
'Purple': '#9467bd',
}
def absolute_magnitude(parallax, m):
"""Cal... |
from numpy.core.memmap import memmap as memmap_type
import numpy as N
import scipy.io as SIO
from neuroimaging.utils.odict import odict
from neuroimaging.data_io import DataSource
from neuroimaging.data_io.formats import utils
import neuroimaging.data_io.formats.binary as bin
from neuroimaging.core.reference.axis impo... |
from headerparse import headerError
from proxybase import proxyError
import sys
import html2md
import utils
import datetime
import os
################################################################################
#
def _getProxy(header):
try:
p = header.proxy()
except headerError, err:
print... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2009 Phil Sung, Samson Yeung, Romain Francoise
#
# This file is part of Zeya.
#
# Zeya 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, either version 3 of the L... |
import boto3 as b
import pytz as p
import os
from decimal import Decimal
import datetime as dt
def calculate_compute_cost(start_time, end_time, instance_type, region_name, instance_description='Linux/UNIX',
availability_zone='us-west-2b'):
if (not instance_type):
return ("No ins... |
#!/usr/bin/env python
#
# Copyright 2016 Robert King, Jacky Liang, Troy Mullins, and Thomas Norby
# Licensed under MIT
# (https://github.com/Mullinst/SER-FP/blob/master/LICENSE)
#
# project.py -- Routing for shift trade app
# @author - Troy Mullins
from flask import Flask, render_template, request, redirect, jsonify, ... |
import os
from listtools import *
from collections import namedtuple
import files
ObjectiveCClass = namedtuple("ObjectiveCClass", "publicMethods, className, sloc, semicolons, imports, imported")
class ObjectiveCClass(ObjectiveCClass):
def parseFromString(self, string):
pass
ObjectiveCMethod = namedtuple(... |
#!/usr/bin/env python2.5
#
# Copyright 2009 the Melange 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 applic... |
#!/usr/bin/python3
import os, sys
DIR = os.path.dirname(os.path.realpath(__file__))
sys.path.append(DIR)
import argparse
import hashlib
import yaml
import datetime
import time
import functools
from flask import Flask, g, redirect, abort, render_template, url_for, request, session, send_from_directory
from data import ... |
import json
import requests
from botkey import Key
class DictionaryReader:
def __init__(self):
self.file = 'dictEntries.txt'
self.dictionary = {}
self.loadDict()
self.loop = 0
def loadDict(self):
try:
with open(self.file, 'r') as f:
... |
# Copyright 2011 the Melange 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 wr... |
# -*- coding: ISO-8859-15 -*-
# =================================================================
#
# $Id$
#
# Authors: Tom Kralidis <tomkralidis@hotmail.com>
# Angelos Tzotsos <tzotsos@gmail.com>
#
# Copyright (c) 2011 Tom Kralidis
#
# Permission is hereby granted, free of charge, to any person
# obtain... |
import resource
import cProfile
import pstats
import multiprocessing
import os
import shutil
import sys
import time
import argparse
import plyvel
import ujson as json
from imposm.parser import OSMParser
from shapely.geometry import Polygon
import shapely.speedups
from settings import wantedTags
def prep_args():
... |
__author__ = 'Sean Yu'
'''created @2015/9/14'''
'''
a term is an interface to interoperate with Software/Device Under Test/Used
provides:
1. command sent to software/device
2. show the output, just the updated recently
3. searching given pattern from a given range, e.g. right after last command entered
'''
import trace... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, 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
ANSIBLE_METADATA = {'metadata_version': '1.1',
... |
import matplotlib
matplotlib.use('agg')
from matplotlib import pyplot as plt
plt.rcParams['font.family'] = 'sans-serif'
import numpy as np
import os
css_style = """
html {
font-family: sans-serif;
}
table, th, td {
border: 1px solid black;
}
th, td {
padding: 2px;
}
tr:hover {background-color: #f5f5f5;}
tr:... |
#!/usr/bin/env python3
import lxc
from random import randint
from subprocess import check_call
from time import sleep
import argparse
import os
import sys
GIT_URL = "https://github.com/wlanslovenija/tunneldigger"
GIT_REV = "4e4f13cdc630c46909d47441093a5bdaffa0d67f"
GIT_URL = "https://github.com/lynxis/tunneldigger"
... |
# Copyright 2010 - Participatory Culture Foundation
#
# This file is part of Miro Community.
#
# Miro Community 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, either version 3 of the License, or (at ... |
# Copyright 2009 - Participatory Culture Foundation
#
# This file is part of Miro Community.
#
# Miro Community 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, either version 3 of the License, or (at ... |
# Copyright 2009 - Participatory Culture Foundation
#
# This file is part of Miro Community.
#
# Miro Community 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, either version 3 of the License, or (at ... |
# Miro Community - Easiest way to make a video website
#
# Copyright (C) 2009, 2010, 2011, 2012 Participatory Culture Foundation
#
# Miro Community 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, either... |
"""Module that handles web views."""
from flask import render_template, url_for, request, redirect, session, flash,\
Blueprint
# from datetime import datetime
# from sqlalchemy.orm.exc import NoResultFound
from flask_login import login_required, login_user, logout_user, current_user
from datetime import datetime
fr... |
import hug
import json
import sqlite3
import pandas as pd
conn = sqlite3.connect('check.db')
c = conn.cursor()
@hug.directive()
def cors(support='*', response=None, **kwargs):
'''Returns passed in parameter multiplied by itself'''
response and response.set_header('Access-Control-Allow-Origin', support)
@hug.g... |
import hug
import json
import sqlite3
import pandas as pd
conn = sqlite3.connect('users.db')
c = conn.cursor()
@hug.directive()
def cors(support='*', response=None, **kwargs):
'''Returns passed in parameter multiplied by itself'''
response and response.set_header('Access-Control-Allow-Origin', support)
@hug.g... |
import requests
from contrib import yahooauth
import errors
import importlib
__author__ = 'Josue Kouka'
__email__ = 'josuebrunel@gmail.com'
class LokingYQL(object):
'''Yet another Python Yahoo! Query Language Wrapper
Attributes:
- url : data provider url
- table : default table, so you won't have to specify ... |
###
# Copyright (c) 2002-2005, Jeremiah Fincher
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of co... |
import functools
import logging
import os
import tempfile
import traceback
from collections import namedtuple, defaultdict
from concurrent.futures import ThreadPoolExecutor, FIRST_COMPLETED, wait
from datetime import datetime
from enum import Enum
import decorator
import dill
import matplotlib as mpl
import networkx a... |
from twisted.internet import reactor, task, defer, threads
import heapq
import time
import copy
from twisted.internet.defer import DeferredQueue, DeferredLock
import weakref
import csv
class ProcessQueue():
def __init__(self):
self.queue = []
self.consumers = []
self.target = 0.5
self.Kp = 3.0 #2
self.Ki... |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2012-2015, CRS4
#
# 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, copy, modify... |
"""
Provides the LuminosoClient object, a wrapper for making
properly-authenticated requests to the Luminoso REST API.
"""
from .auth import LuminosoAuth
from .constants import URL_BASE
from .errors import (LuminosoError, LuminosoAuthError, LuminosoClientError,
LuminosoServerError, LuminosoAPIError)
from getpass i... |
#!/usr/bin/env python3
#
# Copyright (C) 2019 VyOS maintainers and contributors
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 or later as
# published by the Free Software Foundation.
#
# This program is distributed in the hope t... |
#!/usr/bin/env python
#
# OmsAgentForLinux Extension
#
# Copyright 2015 Microsoft 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.... |
# Copyright 2015
# 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 la... |
from mock import patch
from django_webtest import WebTest
from .auth import TestUserMixin
from candidates.tests.fake_popit import (
FakePostCollection, FakePersonCollection
)
@patch('candidates.popit.PopIt')
class TestConstituencyLockAndUnlock(TestUserMixin, WebTest):
def test_constituency_lock_unauthorized... |
import random
import places
import items
import money
class Outcome(object):
def __init__(self,
character,
msg,
add_item=False, # USAGE: items.item_name
remove_item=False, # USAGE: items.item_name
remove_all_items=False,
... |
# Copyright 2016 SAS Project 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 requ... |
from csv import DictReader
from datetime import datetime
from django.core.management.base import BaseCommand
from huts.models import Hut, Region, Agency
from huts.utils.countries import lookup_country_code
from huts.utils.null_na import from_csv, DB_NA_POS_NUM, DB_NA_STRING, DB_NA_LIST
class Command(BaseCommand):
a... |
"""Provides interface for training the model."""
import os
from pathlib import Path
import numpy as np
import torch
from matplotlib import pyplot as plt
from tqdm import tqdm
from . import models
from .preprocessing import ImageDataPipeline
def main(train_dir,
label_dict,
steps,
savepath... |
from PySide import QtGui, QtCore
class PayDialog(QtGui.QDialog):
def __init__(self, value, currency_, customer_, disabled=[]):
super(PayDialog, self).__init__()
self.value = value
self.currency = currency_
self.customer = customer_
self.payment = None
... |
#!/usr/bin/env python
from __future__ import print_function
import os
import sys
def run():
custom_settings = 'tardis.settings'
custom_settings_file = custom_settings.replace('.', '/') + '.py'
demo_settings = 'tardis.settings_changeme'
if os.path.isfile(custom_settings_file):
os.environ.setdef... |
import requests, json
from flask import Flask, request, jsonify
app = Flask(__name__)
@app.route("/weather", methods = ['POST'])
def weather():
"""
INPUT BUNDLE: {'0': latitude, '1': longitude, '2': unit (f or c)}
E.G. {'0': 439596, '1': 109551, '2': 'f'}
OUTPUT BUNDLE: {'0': weather condition, '1': ... |
# Django settings for nodeconductor project
from nodeconductor.server.base_settings import *
import os
import warnings
from ConfigParser import RawConfigParser
conf_dir = '/etc/nodeconductor'
data_dir = '/usr/share/nodeconductor'
work_dir = '/var/lib/nodeconductor'
templates_dir = os.path.join(conf_dir, 'templates')... |
#!/usr/bin/python
#
# Copyright (C) 2010, 2012, 2013 Google Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# ... |
"""
ArcGIS Toolbox for integrating the CEA with ArcGIS.
ArcGIS starts by creating an instance of Toolbox, which in turn names the tools to include in the interface.
These tools shell out to ``cli.py`` because the ArcGIS python version is old and can't be updated. Therefore
we would decouple the python version used by... |
import bohrium
import util
import functools
import operator
class test_set_bool_mask_scalar:
def init(self):
for dtype in bohrium._info.numpy_types:
dtype = "np.%s"%dtype.name
for cmd, shape in util.gen_random_arrays("R", 2, min_ndim=1, samples_in_each_ndim=1,
... |
# -*- coding: utf-8 -*-
#
# PADS Std Plus documentation build configuration file, created by
# sphinx-quickstart on Fri Jun 09 15:20:25 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.... |
"""
ArcGIS Toolbox for integrating the CEA with ArcGIS.
ArcGIS starts by creating an instance of Toolbox, which in turn names the tools to include in the interface.
These tools shell out to ``cli.py`` because the ArcGIS python version is old and can't be updated. Therefore
we would decouple the python version used by... |
from __future__ import division
from __future__ import print_function
import matplotlib.pyplot as plt
import networkx as nx
import numpy as np
import pandas as pd
import geopandas
import json
from cea.utilities.standardize_coordinates import get_geographic_coordinate_system
import cea.plots.thermal_networks
__author_... |
from __future__ import print_function
"""
============================
Hydraulic - thermal network
============================
"""
from __future__ import division
import time
import numpy as np
import pandas as pd
from cea.technologies.substation import substation_main
import cea.technologies.substation_matrix as su... |
# -*- coding: UTF-8 -*-
# Copyright 2008-2020 Rumma & Ko Ltd
# License: BSD (see file COPYING for details)
from django.contrib.contenttypes.models import ContentType
from lino.utils.instantiator import Instantiator
from django.utils.translation import ugettext_lazy as _
from lino_xl.lib.notes.choicelists import Speci... |
from sqlalchemy import *
from sqlalchemy.orm import relationship, backref, exc
from sqlalchemy.sql.expression import between
from sqlalchemy.dialects.mysql import INTEGER as Integer
from datetime import datetime
from rfk.database import Base, UTCDateTime
from rfk.types import ENUM, SET
from rfk.helper import now
cl... |
#!/usr/bin/env python3
#
# This file is part of LiteX-Boards.
#
# Copyright (c) 2021 Florent Kermarrec <florent@enjoy-digital.fr>
# SPDX-License-Identifier: BSD-2-Clause
import os
import argparse
from migen import *
from migen.genlib.resetsync import AsyncResetSynchronizer
from litex.soc.cores.clock.gowin_gw1n impo... |
""" API implementation for course-oriented interactions. """
from collections import OrderedDict
import logging
import itertools
from lxml import etree
from StringIO import StringIO
from django.conf import settings
from django.contrib.auth.models import Group, User
from django.core.exceptions import ObjectDoesNotExis... |
import datetime
import json
import logging
from contextlib import contextmanager
import requests
from sqlalchemy import Boolean
from sqlalchemy import Column
from sqlalchemy import Integer
from sqlalchemy import String
from pajbot.exc import FailedCommand
from pajbot.managers.db import Base
from pajbot.managers.db im... |
import os
from mock import Mock, PropertyMock, patch
from moto import mock_ec2
from tornado.testing import AsyncTestCase
class Test_broker(AsyncTestCase):
db_uri = "sqlite:////tmp/loads_test.db"
def _createFUT(self):
from loadsbroker.broker import Broker
from loadsbroker.options import Influ... |
"""pandoc-source-exec is a panflute pandoc filter to execute source code and
add the output to the pandoc document."""
import glob
import os
import re
import subprocess
__version__ = '0.2.0'
try:
from pexpect import replwrap
except ImportError:
pass
try:
import panflute as pf
except ImportError:
pass... |
import base64
import traceback
from abc import abstractmethod, ABCMeta
from concurrent.futures import ThreadPoolExecutor
from functools import wraps
from threading import Event
from typing import List
import backoff
import requests
from . import events
from .errors.exceptions import TokenValidationException
from .rec... |
###############################################################################
#
# Copyright 2011 Stendec <stendec365@gmail.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:... |
from flask import Flask, url_for
from flask.ext.pymongo import PyMongo
from views import *
import os
papertalk = Flask(__name__)
try:
papertalk.config.from_object('config.Config')
except:
papertalk.config["MONGO_HOST"] = os.environ.get("MONGO_HOST")
papertalk.config["MONGO_PORT"] = os.environ.get("MONGO_PO... |
# -*- coding: utf-8 -*-
"""
Custom serializer fields for nested translations.
"""
from __future__ import unicode_literals
from django.core.exceptions import ImproperlyConfigured
from django.utils.translation import ugettext_lazy as _
from rest_framework import serializers
from rest_framework.fields import SkipField
fr... |
import usb
dev = usb.core.find(idVendor=0x0456,idProduct=0xcee2)
dev.set_interface_altsetting(0,1)
for i in range(127):
if dev.ctrl_transfer(0x40|0x80, 0x5C, 0, i, 4)[0]:
print hex(i)
|
import pandas as pd
import logging, os
import IPy as IP
log = logging.getLogger(__name__)
df3 = pd.read_csv('nmap.tsv', delimiter='\t')
df3.columns = ['host_and_fingerprint', 'port']
df3['host_and_fingerprint'] = df3['host_and_fingerprint'].map(lambda x: x.lstrip('Host:').rstrip(''))
df3['port'] = df3['port'].map(l... |
"""The noisemodels module contains all noisemodels available in Pastas.
Author: R.A. Collenteur, 2017
"""
from abc import ABC
from logging import getLogger
import numpy as np
import pandas as pd
from .decorators import set_parameter
logger = getLogger(__name__)
all = ["NoiseModel", "NoiseModel2"]
class NoiseMo... |
import numpy
from chainer import cuda
from chainer.functions.connection import convolution_2d
from chainer import initializers
from chainer import link
class Convolution2D(link.Link):
"""Two-dimensional convolutional layer.
This link wraps the :func:`~chainer.functions.convolution_2d` function and
hold... |
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
from __future__ import absolute_import
from builtins import * # NOQA
from future import standard_library
standard_library.install_aliases() # NOQA
import logging
import multiprocessing as mp
import os
from ... |
from __future__ import unicode_literals, print_function
from cliff.command import Command
class BasePluginCommand(Command):
def get_parser(self, prog_name):
parser = super(BasePluginCommand, self).get_parser(prog_name)
parser.add_argument('-c', '--confirm-default-params', default=True, action='s... |
import os
import sys
import tempfile
import random
from hashlib import sha512
from subprocess import Popen, PIPE
from datetime import datetime
def genkey(secret, salt):
"""
Generate keys for files based on host key and filename.
Nice utility, Bob!
"""
h = sha512()
h.update(":%s:%s:" % (secret,... |
# coding: utf-8
import flask
import auth
import config
import model
import util
from main import app
bitbucket_config = dict(
access_token_url='https://bitbucket.org/api/1.0/oauth/access_token',
authorize_url='https://bitbucket.org/api/1.0/oauth/authenticate',
base_url='https://api.bitbucket.org/1.0/',... |
from paymentwall.base import Paymentwall
from paymentwall.product import Product
import re
try:
from urllib.parse import urlencode
except ImportError:
from urllib import urlencode
class Widget(Paymentwall):
BASE_URL = 'https://api.paymentwall.com/api'
def __init__(self, user_id, widget_code, products=[], extr... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import datetime
import logging
import pprint
import time
from django.conf import settings
from django.forms.models import fields_for_model
from django.http import QueryDict
from django.utils.datastructures import MergeDict
from django.utils.http import urlencode
from six.... |
import logging
import urllib.parse as urllibparse
import requests
import requests.adapters
logger = logging.getLogger("dunya")
HOSTNAME = "https://dunya.compmusic.upf.edu"
TOKEN = None
session = requests.Session()
session.mount('http://', requests.adapters.HTTPAdapter(max_retries=5))
session.mount('https://', reques... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 31 23:25:33 2017
@author: asadm2
"""
from __future__ import division, print_function, absolute_import
from glob import glob
from astropy.io import fits
from astropy.wcs import WCS
import matplotlib.pyplot as plt
import pandas as pd
import numpy as ... |
methods = 'AddAddressType AddAddressTypeToAddress AddBootState AddConfFile AddConfFileToNodeGroup AddConfFileToNode AddKeyType AddMessage AddNetworkMethod AddNetworkType AddNodeGroup AddNodeNetwork AddNode AddNodeToNodeGroup AddNodeToPCU AddPCU AddPeer AddPersonKey AddPerson AddPersonToSite AddPersonToSlice AddRole Add... |
import urlparse
import urllib
import requests
import logging
logger = logging.getLogger("dunya")
HOSTNAME = "dunya.compmusic.upf.edu"
TOKEN = None
class ConnectionError(Exception):
pass
def set_hostname(hostname):
global HOSTNAME
HOSTNAME = hostname
def set_token(token):
global TOKEN
TOKEN = to... |
if __name__ == "__main__":
print("Starting up Discord Harmonbot...")
import discord
from discord.ext import commands
import asyncio
import ctypes
import json
import os
import re
import sys
import traceback
import aiohttp
from aiohttp import web
import pkg_resources # from setuptools
import youtu... |
import pip
import os
import toml
_DEFAULT_DIR = os.path.join(os.path.expanduser("~"), ".boa")
class PackageManager:
def __init__(self, root=_DEFAULT_DIR, load=True, **config):
os.makedirs(root, exist_ok=True)
self.root = root
self.config = config
def path(self, *parts):
return... |
import discord
from discord.ext import commands, menus
from enum import IntEnum
import io
import random
from utilities import checks
from utilities.menu import Menu
def setup(bot):
bot.add_cog(MazeCog())
class Direction(IntEnum):
UP = 0
RIGHT = 1
DOWN = 2
LEFT = 3
@property
def reverse(self):
return {se... |
import discord
from discord.ext import commands, menus
from enum import IntEnum
import io
import random
from utilities import checks
from utilities.menu import Menu
def setup(bot):
bot.add_cog(MazeCog())
class Direction(IntEnum):
UP = 0
RIGHT = 1
DOWN = 2
LEFT = 3
@property
def reverse(self):
return {se... |
#!/usr/bin/env python
import logging
import os
from beepboop import resourcer
from beepboop import bot_manager
from slack_bot import SlackBot
from slack_bot import spawn_bot
logger = logging.getLogger(__name__)
if __name__ == "__main__":
log_level = os.getenv("LOG_LEVEL", "INFO")
logging.basicConfig(form... |
import discord
from discord.ext import commands
from discord.ext.commands.bot import _mention_pattern, _mentions_transforms
import asyncio
import datetime
import copy
import ctypes
import difflib
import inspect
import json
import os
import random
import subprocess
import sys
import traceback
import git
import pkg_re... |
"""Module for Twitch bot and threaded logging."""
from twisted.words.protocols import irc
from twisted.internet import reactor
from collections import defaultdict
from bot.commands import Permission
from threading import Thread
import traceback
import requests
import logging
import bot.commands
import bot.ranking
impo... |
import discord
from discord.ext import commands
import asyncio
import datetime
import copy
import ctypes
import importlib.metadata
import inspect
import os
import random
import subprocess
import sys
import traceback
from typing import Optional
import chess.engine
import git
import psutil
from cogs.chess import STOC... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.