text stringlengths 17 737k |
|---|
import os
import yaml
import pandas as pd
from .store import get_store, VALID_NAME_RE, StoreException
from .const import TARGET
class BuildException(Exception):
"""
Build-time exception class
"""
pass
def _build_file(build_dir, store, name, rel_path, target='file'):
path = os.path.join(build_dir,... |
# This file is part of QuTiP.
#
# QuTiP 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 3 of the License, or
# (at your option) any later version.
#
# QuTiP is distributed in the ... |
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.home, name='home'),
url(r'^(?P<post_id>[0-9]+)/single/$', views.single_post, name='single_post'),
url(r'^(?P<category_id>[0-9]+)/posts/$', views.post_by_category, name='post_by_category'),
] |
import asyncio
import discord
import importlib
import os
import json
import random
import sys
import aiohttp
from discord.ext import commands
import pprint
import logging
import json
import math
import time
def _setup_logging(log):
if len(logging.getLogger(__package__).handlers) > 1:
log.d... |
import collections
import copy
import datetime
import hashlib
import json
import logging
import os
import re
import shutil
import sys
import time
import urllib.parse as parse
import uuid
import Bio.SeqIO
from Bio.Data import CodonTable
from Bio.Data.CodonTable import TranslationError
from Bio.Seq import Seq
from Geno... |
import os
from string import maketrans
import sys
import shutil
import uuid
import time
import json
import hashlib
import collections
import datetime
import re
import copy
import urlparse as parse
# KBase imports
from DataFileUtil.DataFileUtilClient import DataFileUtil
from AssemblyUtil.AssemblyUtilClient import Assem... |
#!/usr/bin/env python
# png.py - PNG encoder/decoder in pure Python
#
# Copyright (C) 2006 Johann C. Rocholl <johann@browsershots.org>
# Portions Copyright (C) 2009 David Jones <drj@pobox.com>
# And probably portions Copyright (C) 2006 Nicko van Someren <nicko@nicko.org>
#
# Original concept by Johann C. Rocholl.
#
# ... |
"""
Codechef Unofficial API.
Parses all the user data in JSON.
Author: Shaurya Chaturvedi
shauryachats@gmail.com
"""
import requests
from BeautifulSoup import BeautifulSoup
import os
import datetime
from collections import OrderedDict
import json
import zlib
import logging
# To convert text int... |
import random
import discord
from discord.ext import commands
from utils.messages import ColoredEmbed
class Fun(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.command()
async def xkcd(self, ctx):
"""See the latest XKCD comic.
"""
async with self.bot.sessi... |
"""
Tracks devices by sending a ICMP echo request (ping).
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/device_tracker.ping/
"""
import logging
import subprocess
import sys
from datetime import timedelta
import voluptuous as vol
import homeassistant.h... |
#!/usr/bin/python -u
#
# pagekite.py, Copyright 2010, 2011, the Beanstalks Project ehf.
# and Bjarni Runar Einarsson
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Softwa... |
# -*- coding: utf-8 -*-
from model.contact import Contact
def test_add_contact(app, json_contacts):
contact=json_contacts
app.open_home_page()
old_contacts = app.contact.get_contact_list()
app.contact.create(contact)
assert len(old_contacts) + 1 == app.contact.count()
new_contacts = app.conta... |
# -*- coding: iso-8859-1 -*-
# Copyright (C) 2004-2005 Tristan Seligmann and Jonathan Jacobs
# Copyright (C) 2012-2013 Bastian Kleineidam
from re import compile, escape
from ..scraper import _BasicScraper
from ..helpers import bounceStarter, indirectStarter
from ..util import tagre
class Caggage(_BasicScraper):
... |
# SPDX-License-Identifier: MIT
# Copyright (C) 2004-2008 Tristan Seligmann and Jonathan Jacobs
# Copyright (C) 2012-2014 Bastian Kleineidam
# Copyright (C) 2015-2020 Tobias Gruetzmacher
# Copyright (C) 2019-2020 Daniel Ring
import os
from re import compile, IGNORECASE
from ..helpers import bounceStarter, indirectStart... |
"""Queryset for the redirects app."""
from django.db import models
from django.db.models import Value, CharField, IntegerField, Q, F, ExpressionWrapper
from django.db.models.functions import Substr, Length
from readthedocs.core.utils.extend import SettingsOverrideObject
class RedirectQuerySetBase(models.QuerySet):
... |
from __future__ import absolute_import, unicode_literals
from django import forms
from django.http import HttpResponseForbidden, HttpResponseRedirect
from django.shortcuts import get_object_or_404, reverse
from django.utils.translation import ugettext_lazy as _
from wagtail.contrib.modeladmin.options import ModelAdmin... |
#!/usr/bin/env python3
import tornado.ioloop
from tornado.ioloop import IOLoop
import tornado.web
import tornado.websocket
import sys
import time
from networktables import NetworkTable
from tornado.websocket import WebSocketHandler
from tornado.websocket import WebSocketClosedError
from tornado.options import define, ... |
from atom.ext.crispy_forms.forms import BaseTableFormSet
from atom.views import DeleteMessageMixin
from braces.views import FormValidMessageMixin, PrefetchRelatedMixin, SelectRelatedMixin, UserFormKwargsMixin
from cached_property import cached_property
from django.contrib.auth.mixins import PermissionRequiredMixin, Log... |
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2018, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... |
from typing import Iterator, List, Optional, Tuple
from ._loop import loop_first, loop_last
from .console import Console, ConsoleOptions, RenderableType, RenderResult
from .jupyter import JupyterMixin
from .measure import Measurement
from .segment import Segment
from .style import Style, StyleStack, StyleType
from .st... |
from datetime import timedelta
import re
from django.utils import timezone
from django.db import transaction
from django.contrib.sessions.models import Session
from froide.helper.email_sending import (
send_mail, mail_middleware_registry, mail_registry
)
from . import account_canceled, account_merged, account_ma... |
from schevo.release import setup_meta
# Use branch name if git information is available; otherwise, use
# version number from setup_meta.
try:
git_head_path = path('.git/HEAD')
contents = git_head_path.open('rU').readline().strip()
name, value = contents.split()
branch_or_version = value.split('/')[-1... |
"""
Building a fancy dmg from scratch
=================================
Clone the numpy-macosx-installer git repo from on github into the source tree
(numpy-macosx-installer should be in the same directory as setup.py). Then, do
as follows::
paver clean clean_bootstrap
paver bootstrap && source boostrap/bin/a... |
"""
Django settings for open_humans project.
For more information on this file, see
https://docs.djangoproject.com/en/dev/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/dev/ref/settings/
"""
import logging
import os
import sys
from distutils import util # pyl... |
"""The backbone of pax - the Processor class
"""
import glob
import logging
import importlib
from io import StringIO
import itertools
import os
from configparser import ConfigParser, ExtendedInterpolation
try:
import ROOT # noqa
except ImportError:
pass
except SyntaxError:
pass
import numpy as np
fro... |
# -*- coding=utf-8 -*-
"""
Original code by RegardsCitoyen (https://github.com/RegardsCitoyens) for the-law-factory-parser
(https://github.com/regardscitoyens/the-law-factory-parser).
"""
import sys, re, html5lib
from bs4 import BeautifulSoup
from alinea_parser import word_to_number, month_to_number
bister = '(un|du... |
import urlparse
import cgi
import time
from openid import cryptutil, dh, oidutil, kvform
from openid.consumer.discover import OpenIDServiceEndpoint
from openid.consumer.consumer import \
AuthRequest, GenericConsumer, SUCCESS, FAILURE, CANCEL, SETUP_NEEDED
from openid import association
from openid.server.server i... |
# -*- coding: utf-8 -*-
# Copyright (c) 2010-2011, GEM Foundation.
#
# OpenQuake is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License version 3
# only, as published by the Free Software Foundation.
#
# OpenQuake is distributed in the hope that it will be... |
import fnmatch
import os
from os import path
import sys
import re
import lxml.html
import lxml.etree
# Get all missing images on FS from nav's htmls
# =================================
# just some fancy colors for output
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[... |
#!/usr/bin/env python
# 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, softwar... |
from django.conf import settings
VPS_PROTOCOL = getattr(settings, 'OSCAR_SAGEPAY_VPS_PROTOCOL', '3.0')
VENDOR = settings.OSCAR_SAGEPAY_VENDOR
TEST_MODE = getattr(settings, 'OSCAR_SAGEPAY_TEST_MODE', True)
if TEST_MODE:
VPS_REGISTER_URL = 'https://test.sagepay.com/Simulator/VSPDirectGateway.asp'
VPS_AUTHORISE... |
#!/usr/bin/python
"""Utilities to facilitate out-of-core learning in sklearn"""
import collections
import numpy as np
import scipy
import sklearn.base
class GeneratorSeed(object):
'''A wrapper class for reusable generators.
:usage:
>>> # make a generator
>>> def my_generator(n):
... |
#
# ovirt-engine-setup -- ovirt engine setup
# Copyright (C) 2013-2015 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unl... |
"""Tools which both CherryPy and application developers may invoke."""
import inspect
import mimetools
import mimetypes
mimetypes.init()
mimetypes.types_map['.dwg']='image/x-dwg'
mimetypes.types_map['.ico']='image/x-icon'
import os
import sys
import time
import cherrypy
import httptools
from cherrypy.filters.wsgiap... |
from __future__ import absolute_import
from logging import getLogger
from .simple_flock import SimpleFlock
Logger = getLogger('chime.view_functions')
from os.path import join, isdir, realpath, basename, exists, sep, split, splitext
from datetime import datetime
from os import listdir, environ, walk
from urllib impor... |
"""
Color space objects
===================
"""
from abc import ABC, abstractmethod
from typing import Union, Iterable, Tuple, Any, Type, Dict, Callable
import numpy as np
import chromathicity.space_names as names
from chromathicity.chromadapt import (
get_default_chromatic_adaptation_algorithm,
Chromat... |
# 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... |
# 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... |
from .base import BaseProcessorTestCase
class GencoverProcessorTestCase(BaseProcessorTestCase):
def prepair_genome(self):
inputs = {'src': 'genome.fasta.gz'}
genome = self.run_processor('import:upload:genome-fasta', inputs)
self.assertDone(genome)
self.assertFiles(genome, 'fasta', ... |
import logging
import re
import serial
import threading
# Serial communication with Arduino
SERIAL_NAME = '/dev/ttyUSB0'
# Regex for a message
REGEX_MSG = '^#[0-9]+ [0-9]$'
MSG_TRUE = '1'
class PositionFetcher(object):
def __init__(self):
self.serial_port = None
self.fetcher_thread = None
... |
import random
import json
import requests
import subprocess
import re
from time import sleep, time
from datetime import datetime
from hashlib import sha256
from StringIO import StringIO
from libcloud.compute.providers import get_driver
from libcloud.compute.base import Node, NodeSize, NodeImage, NodeLocation
from libc... |
# -*- coding: utf-8 -*-
import random
import datetime
import re
from CommandInterface import CommandInterface
from IRCMessage import IRCMessage
from IRCResponse import ResponseType, IRCResponse
from Data import ignores
class Responses(CommandInterface):
acceptedTypes = ['PRIVMSG', 'ACTION']
help = 'Talkwords... |
# -*- coding: utf-8 -*-
from django.http import HttpResponse
from django.shortcuts import render_to_response
from django.template import RequestContext
import datetime
from fst_web.fs_doc.models import Myndighetsforeskrift, Forfattningssamling, Amnesord, AtomEntry
from django.utils.feedgenerator import rfc3339_date
fro... |
from mongoengine import *
from datetime import datetime
from configparser import ConfigParser
from utils import CHARACTER_COLLECTION
from .model_mixin import ModelMixin
from .historical import Historical
class Character(Document, ModelMixin):
DB_COLUMNS = [
'rank',
'fam_name',
'char_name'... |
#!/usr/bin/env python
# encoding: utf-8
"""
An pprof.experiment defines a series of phases that constitute a pprof
compatible experiment. This is the default implementation of an experiment.
Clients can derive from class class::pprof.experiment.Experiment and override
the methods relvant to their experiment.
An expe... |
import sqlite3
import trueskill as ts
from random import shuffle
from datetime import datetime
from ranking import Ranking
from flask import *
app = Flask(__name__)
DATABASE = 'pingpong.sqlite'
SCHEMA = '''
PRAGMA foreign_keys = ON;
CREATE TABLE IF NOT EXISTS player (
id INTEGER PRIMARY KEY,
expo... |
#! /usr/bin/env python3
# vim:ts=4:sw=4:ai:et:si:sts=4
import logging
from flask import Flask, request
from flask_jsonrpc import JSONRPC
import os
import sys
import shutil
from subprocess import check_output, STDOUT, CalledProcessError
from bs4 import BeautifulSoup
FORMAT = "%(asctime)s: %(name)s:%(lineno)d (%(thread... |
#!/usr/bin/env python
#########################################################################################
#
# Extract metrics within spinal labels as defined by the white matter atlas and the
# template
# The folder atlas should have a .txt file that lists all tract files with labels.
#
# ------------------------... |
import filecontainer
import files
import package
import string
import versions
import os
class ChangeSet:
def validate(self):
for pkg in self.getPackageList():
# if this is abstract, we can't have any removed or changed files
if not pkg.getOldVersion():
assert(not pkg.getChangedFiles())
assert(not ... |
#!/usr/bin/env python3
import os, re
from prjxray import util
def noprefix(tag):
n = tag.find('.')
assert n > 0
return tag[n + 1:]
def getprefix(tag):
n = tag.find('.')
assert n > 0
return tag[0:n]
def load_pipfile(pipfile, verbose=False):
'''Returns a set of tags containing real tile... |
def read_text():
movies = open("curse_movies.txt")
contents_of_file = movies.read()
length_of_file = len(contents_of_file)
print ("length of movie string is " + length_of_file)
print (contents_of_file)
movies.close()
read_text() |
from distutils.version import StrictVersion
import datetime
import hashlib
import os
import random
import re
import socket
import shutil
import time
import sys
import seesaw
from seesaw.config import realize, NumberConfigValue
from seesaw.externalprocess import WgetDownload, ExternalProcess
from seesaw.item import Ite... |
# encoding=utf8
import datetime
from distutils.version import StrictVersion
import hashlib
import os.path
import random
from seesaw.config import realize, NumberConfigValue
from seesaw.item import ItemInterpolation, ItemValue
from seesaw.task import SimpleTask, LimitConcurrent
from seesaw.tracker import GetItemFromTrac... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# this is a script generating *.docx Word document with PKUP report
from __future__ import unicode_literals
from docx import Document
from docx.shared import Inches
from datetime import date, datetime, timedelta
import sys, getopt
def generate_report():
create_docum... |
# Copyright 2015, Province of British Columbia
# License: https://github.com/bcgov/ckanext-bcgov/blob/master/license
from ckan.common import c, _
import logging
import pylons.config as config
import ckan.lib.base as base
import ckan.plugins as plugins
import ckan.plugins.toolkit as toolkit
from paste.deploy.convert... |
"""
classes.py - Base classes for PyLink IRC Services.
This module contains the base classes used by PyLink, including threaded IRC
connections and objects used to represent IRC servers, users, and channels.
Here be dragons.
"""
import threading
import time
import socket
import ssl
import hashlib
from copy import de... |
from netCDF4 import Dataset
from numpy.random import seed, randint
from numpy.testing import assert_array_equal, assert_equal
import tempfile, unittest, os, random
import numpy as np
"""
Bug note
There seems to be a bug when two unlimited dimensions are used,
ie ('x', 'y', 'time'), where x and time are unlimited dime... |
# -*- coding: utf-8 -*-
import itertools
import os
import re
import urllib
import logging
import datetime
import urlparse
from collections import OrderedDict
import warnings
import pytz
from flask import request
from django.core.urlresolvers import reverse
from modularodm import Q
from modularodm import fields
from m... |
from datetime import datetime
from optparse import make_option
from go.billing.models import Account
from go.billing.tasks import month_range, generate_monthly_statement
from go.base.command_utils import BaseGoCommand, get_user_by_email
class Command(BaseGoCommand):
help = "Generate monthly billing statements fo... |
# -*- coding: utf-8 -*-
# vim-hackernews
# --------------
# Browse Hacker News (news.ycombinator.com) inside Vim.
#
# Author: ryanss <ryanssdev@icloud.com>
# Website: https://github.com/ryanss/vim-hackernews
# License: MIT (see LICENSE file)
# Version: 0.3-dev
from __future__ import print_function
import bin... |
import os
from luigi import Task, WrapperTask, Parameter, LocalTarget
from util import PostgresTarget, shell
from meta import CurrentSession
OBSERVATORY_SCHEMA = 'observatory'
DEFAULT_GEOMFIELD = 'the_geom'
TMP_DIRECTORY = 'tmp'
SIMPLIFICATION_DIRECTORY = 'simplification'
SIMPLIFIED_SUFFIX = '_simpl'
SKIPFAILURES_NO =... |
import os
import re
import ipaddress
import tempfile
import hashlib
import datetime
import math
import time
import functools
class IPsSaturatedError(Exception): pass
class DuplicateClientError(Exception): pass
SERVER = '/etc/openvpn/server.conf'
CCD = '/etc/openvpn/clients'
def lock(func):
'''
Return a... |
# 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
from ParKingP... |
# ==========================================================================
#
# Copyright NumFOCUS
#
# 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/... |
#!/usr/bin/env python3
# Copyright 2017 Patrick Laughrea
# Licensed under the Apache License, Version 2.0
local_path = None
local_path_line = 4 # for local set and reset, 0-based index
online_path = 'https://raw.githubusercontent.com/github/gitignore/master/'
import sys, os, urllib.request, re
from enum import Enum
... |
# -*- coding: utf-8 -*-
##
##
## This file is part of CDS Indico.
## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 CERN.
##
## CDS Indico 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 o... |
import sys
import copy
from logging import getLevelName, DEBUG, INFO, WARNING, ERROR, CRITICAL
class Concern(Exception):
"""There was an error validating data.
Only `logging.ERROR` (and above) validation concerns should be treated as actual errors.
"""
def __init__(self, level=ERROR, message="Unspecified err... |
import abc
class WebException(Exception):
"""Base for all exceptions which render error code (and page) to client"""
@abc.abstractmethod
def default_response(self):
pass
class Forbidden(WebException):
def default_response(self):
return (403,
[('Content-Type', 'text/... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import json
from grapheneapi import GrapheneWebsocket, GrapheneWebsocketProtocol
import time
import config
import subprocess
from time import gmtime, strftime
from producer1 import producer1
from producer2 import producer2
#
#
#
rpc = GrapheneWebsocket("loca... |
# -*- coding: utf-8 -*-
##
##
## This file is part of Indico.
## Copyright (C) 2002 - 2012 European Organization for Nuclear Research (CERN).
##
## Indico 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; eith... |
from collections import namedtuple
import numpy as np
import networkx as nx
from matplotlib import cm
from geomm.free_energy import free_energy
from wepy.reporter.reporter import ProgressiveFileReporter
from wepy.analysis.network_layouts.tree import ResamplingTreeLayout
from wepy.analysis.network_layouts.layout_grap... |
"""
Media Player component to integrate TVs exposing the Joint Space API.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/media_player.philips_js/
"""
from datetime import timedelta
import logging
import voluptuous as vol
from homeassistant.components.m... |
# -*- coding: utf-8 -*-
__version__ = '0.0.14'
|
"""Support for MQTT lights."""
import logging
import voluptuous as vol
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
ATTR_COLOR_MODE,
ATTR_COLOR_TEMP,
ATTR_EFFECT,
ATTR_HS_COLOR,
ATTR_RGB_COLOR,
ATTR_RGBW_COLOR,
ATTR_RGBWW_COLOR,
ATTR_WHITE_VALUE,
ATTR_XY_COLOR,... |
# coding: utf-8
import os
import os.path
import mimetypes
import time
import random
import string
import datetime
import collections
from contextlib import closing
import pytz
import requests
from requests.models import urlencode
import dateutil
import dateutil.parser
import re
import copy
import threading
import sys
... |
# Copyright (C) 2019 Renato Lima - Akretion <renato.lima@akretion.com.br>
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
import json
import logging
from datetime import timedelta
from erpbrasil.base import misc
from lxml import etree
from odoo import _, api, fields, models
from .ibpt.taxes import... |
#!/usr/bin/env python
# -*- set coding: utf-8 -*-
import os, glob
import markdown
from flask import Flask, Markup, render_template, url_for, make_response, abort
from config import *
import utils
import db
application = Flask(__name__, template_folder=PARERGA_TEMPLATE_DIR)
app = application
app.debug = True
# db mana... |
# coding: utf-8
import os
import os.path
import mimetypes
import time
import random
import string
import datetime
import collections
from contextlib import closing
import pytz
import requests
from requests.models import urlencode
import dateutil
import dateutil.parser
import re
import copy
import threading
import sys
... |
# -*- coding: utf-8 -*-
u"""
.. module:: test_organizations
"""
from django.test import Client
from django.test import TestCase
from apps.volontulo.models import Organization
from apps.volontulo.tests import common
class TestOrganizations(TestCase):
u"""Class responsible for testing organization specific views.... |
"""Zwave discovery schemas."""
from . import const
DEFAULT_VALUES_SCHEMA = {
'power': {
const.DISC_COMMAND_CLASS: [const.COMMAND_CLASS_SENSOR_MULTILEVEL,
const.COMMAND_CLASS_METER],
const.DISC_LABEL: ['Power'],
const.DISC_OPTIONAL: True,
},
}
DISC... |
#
# Copyright 2018 Analytics Zoo 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... |
#!/usr/bin/python
#
# -*- coding: utf-8 -*-
# vim: set ts=4 sw=4 et sts=4 ai:
import atexit
import sys
import os
import platform
import pprint
import argparse
parser = argparse.ArgumentParser()
parser.add_argument(
"-b", "--browser", type=str, required=True,
choices=['Firefox', 'Chrome', 'Ie', 'PhantomJS', 'R... |
# coding=utf-8
import os
import json
from elasticsearch import Elasticsearch
from fabric.api import env
from fabric.api import task
from .utils import jsonprint
from .utils import request
import cat
import cluster
import helpers
import indices
import nodes
env.elasticsearch_alias = "default"
env.elasticsearch_dest_... |
#
# This file is part of Hawaii.
#
# Copyright (C) 2015 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
#
# 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
# (... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# SMT documentation build configuration file, created by
# sphinx-quickstart on Sun Aug 6 19:36:14 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
# autoge... |
import logging
import json
import csv
import sys
import os
import osf
import modgrammar
from django.core.management.base import BaseCommand, CommandError
from django.db import transaction
import snotes20.models as models
import snotes20.editors as editors
import snotes20.contenttypes as contenttypes
logger = logging... |
# """EasyEngine site controller."""
from cement.core.controller import CementBaseController, expose
from cement.core import handler, hook
from ee.core.variables import EEVariables
from ee.core.domainvalidate import ValidateDomain
from ee.core.fileutils import EEFileUtils
from ee.cli.plugins.site_functions import *
from... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import socket
import struct
import select
import os
import connection_manager
# we import PollingObserver instead of Observer because the deleted event
# is not capturing https://github.com/gorakhargosh/watchdog/issues/46
from watchdog.observers.polling imp... |
# -*- coding: utf-8 -*-
#!/usr/bin/python
"""
cat2cohort.py
The aim of this script is to allow program leaders to export a category
filled with User pages into a WikiMetrics cohort CSV file in order to
perform their evaluation analysis.
Test:
python cat2cohort.py -l fr -c "Utilisateur participant au projet Afri... |
import discord
from discord import app_commands
from discord.ext import commands, menus
import io
import textwrap
from typing import Optional
import urllib.error
from bs4 import BeautifulSoup
from google.api_core.exceptions import InvalidArgument
import spellchecker
from utilities import checks
from utilities.pagin... |
from django.contrib import admin
from import_export import fields, resources
from import_export.admin import ExportMixin
from models import (Attendance, Event, EventGoal, EventMetric,
EventMetricOutcome)
class AttendanceInline(admin.StackedInline):
"""Attendance Inline."""
model = Attenda... |
import psycopg2
import urllib.parse
import os
import datetime
class Database:
"""Database module for BotMod"""
def __init__(self, create_tables=True):
urllib.parse.uses_netloc.append("postgres")
self.url = urllib.parse.urlparse(os.environ['DATABASE_URL'])
self.conn = psycopg2.conne... |
#!/bin/env python
# -*- coding: utf-8 -*-
"""
This file is part of the web2py Web Framework
Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu>
License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)
Thanks to
* Niall Sweeny <niall.sweeny@fonjax.com> for MS SQL support
* Marcel Leuthi <mluethi@mlsystem... |
from __future__ import division
import abc
import collections
import contextlib
import copy
import ctypes
import datetime
import inspect
import itertools
import logging
import math
import os
import StringIO
import struct
from . import ext
logger = logging.getLogger(__name__)
class RTPHeader(ctypes.BigEndianStruct... |
# -*- coding: utf-8 -*-
#
# Morepath documentation build configuration file, created by
# sphinx-quickstart on Tue Aug 6 12:47: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.
#
# Al... |
VERSION = (0, 2, 0, 'dev')
def version_str():
if len(VERSION) == 3:
return "%s.%s.%s" % VERSION
elif len(VERSION) == 4:
return "%s.%s.%s-%s" % VERSION
else:
raise IndexError("Incorrect format for the VERSION tuple")
|
# -*- coding: utf-8 -*-
""" License
Copyright (C) 2013 YunoHost
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any l... |
"""Sheets for Mercator proposals."""
import colander
from adhocracy_core.interfaces import ISheet
from adhocracy_core.interfaces import ISheetReferenceAutoUpdateMarker
from adhocracy_core.sheets import add_sheet_to_registry
from adhocracy_core.sheets import sheet_metadata_defaults
from adhocracy_core.schema import Adh... |
import unittest
if __name__ == '__main__':
tests = unittest.TestLoader().discover('tests', pattern='test_*.py')
unittest.TextTestRunner().run(tests)
|
import os
import time
from cffi import FFI
ffi = FFI()
LIBMARQUISE_SRC_PATH = '/home/barney/git/libmarquise/src'
def marquise_file(filename=''):
return os.path.join(LIBMARQUISE_SRC_PATH, filename)
# This kinda beats dragging the header file in here manually, assuming you can
# clean it up suitably.
def get_libmar... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.