src stringlengths 721 1.04M |
|---|
# -*- coding: utf-8 -*-
###############################################################################
# #
# Copyright (C) 2018 HGSOFT - www.hgsoft.com.br #
# ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
prefs plugin
Plugin read by omero.cli.Cli during initialization. The method(s)
defined here will be added to the Cli class for later use.
The pref plugin makes use of prefs.class from the common component.
Copyright 2007-2013 Glencoe Software, Inc. All... |
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2017
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publis... |
# -*- coding: utf-8 -*-
from pyramid.paster import bootstrap
import psycopg2
from psycopg2.extras import DictCursor
import sys
import getopt
import json
from elasticsearch import helpers
from elasticsearch.helpers import BulkIndexError
from elasticsearch.exceptions import ConnectionTimeout
from geoportailv3_geoportal.... |
import logging
import os
import SimpleHTTPServer
import SocketServer
import subprocess
import threading
from exception import GameException, WebBrowsersMissingException
from file import JSONWriter, FileUtils
from judge import Judge
class LeafSubclassRetriever(object):
def __init__(self, base_class):
... |
"""
This module provides a wrapper around the Helioviewer API.
"""
import json
import codecs
import urllib
from pathlib import Path
from collections import OrderedDict
import parfive
from astropy.utils.decorators import lazyproperty
import sunpy
from sunpy.time import parse_time
from sunpy.util.xml import xml_to_dic... |
"""
raven.handlers.logbook
~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import logbook
import sys
import traceback
from raven.base import Client
from raven.utils.encoding import to_string
from raven.utils import a... |
# This script adds any spend that occurs regularly on a monthly basis.
import datetime
import gspread
import json
import logging
import os
import requests
import smtplib
import sys
from configs import config
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from oauth2client.client im... |
import networkx as nx
from os.path import abspath, isfile, join, dirname, isdir, basename, splitext
from tempfile import TemporaryFile
from snarkx.io import ParseFileError
__all__ = ['GraphReaderG6', 'GraphWriterG6']
class GraphReaderG6(object):
def __init__(self, path: str):
if path is None:
... |
from unittest import TestCase
from mock import Mock, patch, PropertyMock
from mangrove.datastore.database import DatabaseManager
from mangrove.form_model.field import PhotoField, TextField, FieldSet
from mangrove.form_model.form_model import FormModel
from mangrove.transport.services.MediaSubmissionService import Media... |
#!/usr/bin/env python2
from __future__ import division
from __future__ import with_statement
from __future__ import print_function
import time
import numpy
import deepmodels
import json
import os.path
import argparse
import subprocess
import pipes
import alignface
import imageutils
import utils
if __name__=='__main_... |
'''
ui.py
- Create and update the user interface
'''
BLACK = (0,0,0)
WHITE = (255,255,255)
GRAY = (60,60,60)
GRAYtrans = (60,60,60,150)
STROKE = 2
BIGSTROKE = 7
t=l=0
c=1
b=r=2
class UI:
def __init__(self):
self.nbCirclesR = 0
self.nbCirclesL = 0
self.overlay = True
self.info = False
... |
import pytest
import os
from selenium import webdriver
browsers = {
'firefox': webdriver.Firefox,
'chrome': webdriver.Chrome,
}
@pytest.fixture(scope='session', params=browsers.keys())
def driver(request):
''' driver factory, for allowing more than one browser object in a fixture '''
if 'DISPLAY' not in os.en... |
#! /usr/bin/env python
from datetime import datetime, timedelta
import hb_config
import json
import pandas as pd
import requests
from requests_oauthlib import OAuth1
from urllib import parse
rt_header = """== Popular articles {date7} to {date1} ==
Last updated on ~~~~~
{{| class="wikitable sortable"
!Rank
!Article
!... |
from helpers.modules.InternalBaseModule import InternalBaseModule
class BaseModule(InternalBaseModule):
"""This class is a template of methods to be implemented by modules."""
module_path = ''
def cron_day(self):
"""This method has been called one time by day"""
pass
def c... |
#!/usr/bin/env python
##############################################################################
##
## This file is part of Sardana
##
## http://www.sardana-controls.org/
##
## Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
##
## Sardana is free software: you can redistribute it and/or modify
## it und... |
'''
Created on Apr 15, 2016
@author: dj
'''
import json
registry = {}
def register_class(target_class):
print("register_class: class name =", target_class.__name__)
registry[target_class.__name__] = target_class
class Serializable(object):
def __init__(self, *args):
print("Serializable: {0}... |
"""Test the limited signup process
"""
import logging
from urllib.parse import (
quote,
urlencode,
)
import transaction
from bookie.models import DBSession
from bookie.models.auth import Activation
from bookie.models.auth import User
from bookie.models.auth import UserMgr
from bookie.tests import gen_random_... |
# 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... |
import numpy as np
import copy, math
from scipy.spatial import distance, Delaunay
def tri_area(vertices):
u = vertices[0]
v = vertices[1]
w = vertices[2]
return np.linalg.norm(np.cross( v-u, w-u)) / 2.
def tetra_volume(vertices):
u = vertices[0]
v = vertices[1]
w = vertices[2]
x = vertices[3]
re... |
##
# Copyright 2014-2016 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be),
# Flemish Research Foundation (F... |
import re
from thefuck.utils import (cache, for_app, replace_argument, replace_command,
which)
from subprocess import PIPE, Popen
supported_apps = 'goenv', 'nodenv', 'pyenv', 'rbenv'
enabled_by_default = any(which(a) for a in supported_apps)
COMMON_TYPOS = {
'list': ['versions', 'inst... |
#!/usr/bin/env python3
# Copyright (c) 2014-2019 The Fujicoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the listreceivedbyaddress RPC."""
from decimal import Decimal
from test_framework.test_framework... |
# Copyright 2016, Province of British Columbia
# License: https://github.com/bcgov/ckanext-bcgov/blob/master/license
#
# HighwayThree Solutions Inc.
# Author: Jared Smith <jrods@github>
import logging
from functools import wraps
from pprint import pprint, pformat
import requests as reqs
from ckan.common import reque... |
import re
import itertools
from collections import Counter
import xml.etree.ElementTree as xml
from graph import load_xml, dump_xml
def cycle_remove(dmrs_xml, debug=False, cnt=None, realization=False):
"""
Iteratively remove cycles from graph by 1) checking if they match any of the specific patterns and 2) c... |
### common ###
# https://www.python.org/dev/peps/pep-0008/
# Usage: "common.GetPosters" = "from common import GetPosters"
### Imports ### ### Functions used ###
# Python Modules #
import os # path.abspath, join, dirname
import time # datetime.datetime.now()
import r... |
#
# Copyright (C) 2013-2019 The ESPResSo project
#
# This file is part of ESPResSo.
#
# ESPResSo 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... |
r"""ABC Index descriptor.
References
* http://match.pmf.kg.ac.rs/electronic_versions/Match75/n1/match75n1_233-242.pdf
"""
import numpy as np
from ._base import Descriptor
from ._graph_matrix import DistanceMatrix
__all__ = ("ABCIndex", "ABCGGIndex")
class ABCIndexBase(Descriptor):
__slots__ = ()
@cl... |
from __future__ import absolute_import, division, print_function
try:
FileNotFoundError = FileNotFoundError
except NameError: # pragma: no cover
FileNotFoundError = OSError
# Python 2.6 does not have check_output, so we'll backport this just for
# Python 2.6
import subprocess
try:
from subprocess import... |
import re
import time
import isodate
import requests
from cloudbot import hook
from cloudbot.util import timeformat
from cloudbot.util.formatting import pluralize
youtube_re = re.compile(r'(?:youtube.*?(?:v=|/v/)|youtu\.be/|yooouuutuuube.*?id=)([-_a-zA-Z0-9]+)', re.I)
base_url = 'https://www.googleapis.com/youtube... |
import tweepy
from pymongo import MongoClient
class RaffleSlave:
"The class responsbile for a single raffle, a new instance for each individual raffle"
Params = None
api = None
alive = True
def __init__(self, hashtag, max, id, owner ):
self.Params = {}
self.Params['max'] = max
... |
# -*- encoding: utf-8 -*-
"""
stonemason.pyramid.geo.geosys
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Geographic system
"""
__author__ = 'kotaimen'
__date__ = '3/20/15'
import collections
from osgeo import osr
from osgeo import ogr
osr.UseExceptions()
ogr.UseExceptions()
from stonemason.pyramid import Pyramid
fro... |
try:
import tkinter
except ImportError:
import Tkinter as tkinter
# hsmpy is Hierarchical State Machine implementation for Python
# it's used here to implement GUI logic
import quadpy
from quadpy.rectangle import Rectangle
from hsmpy import HSM, State, T, Initial, Internal, Choice, EventBus, Event
# you can e... |
#Copyright (C) 2014 Adrian "APi" Pielech
#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 3 of the License, or
#any later version.
#This program is distributed in the hope that it w... |
# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard 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 t... |
#! /usr/bin/python
import sys
import json
import os
import math
fin = sys.argv[1]
print "Loading from %s" % (fin)
fh = open(fin)
json_data = json.load(fh)
print "Number of rows: %d" % (len(json_data))
fdata = fin + ".dat"
print "Writing data to %s" % (fdata)
data_fh = open(fdata, "w")
host='?'
total=0
total_sd... |
"""
Test functions for pkgselect endpoint
"""
import json
import os
from unittest import TestCase
from unittest.mock import patch
import boto3
import pandas as pd
import responses
from botocore.stub import Stubber
from t4_lambda_shared.utils import buffer_s3response, read_body
from ..index import file_list_to_folde... |
from setuptools import setup, find_packages
# To use a consistent encoding
from os import path
here = path.abspath(path.dirname(__file__))
setup(
name='dsadd',
version='0.0.2',
description='A python package for defensive data analysis.',
long_description='A python package for defensive data analysis... |
# sqlalchemy/naming.py
# Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Establish constraint and index naming conventions.
"""
from .schema import ... |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import base64
import collections
import datetime
import hashlib
import pytz
import threading
import re
import requests
from lxml import etree
from random import randint
from werkzeug import urls
from odoo import api, f... |
#!/usr/bin/env python
# This file is part of tcollector.
# Copyright (C) 2010 The tcollector Authors.
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, o... |
#!/usr/bin/env python2.7
from Tkinter import *
import tkMessageBox
# from RPi.GPIO import *
# # from wiringpi2 import *
from time import sleep
pinesGPIO = [2,3,4,17,27,22,10,9,11,14,15,18,23,24,25,8,7]
pinesGPIO
# setmode(BCM)
# setwarnings(False)
def stp(pin):
setup(pin, OUT)
def on(pin):
output(pin,1)
def... |
#! -*- coding: utf-8 -*-
import errno
import os
import shutil
from StringIO import StringIO
from django.core.files import temp as tempfile
from django.core.files.uploadedfile import SimpleUploadedFile
from django.http.multipartparser import MultiPartParser
from django.test import TestCase, client
from django.utils imp... |
import os
import subprocess
import sys
import numpy
import argparse
import pysam
import vcf
import pybedtools
import logging
from collections import defaultdict, OrderedDict
from utils import makedirs
def uint(value):
if not value.isdigit(): raise argparse.ArgumentTypeError("%s is not digit-only" % value)
ret = in... |
# -*- coding: utf-8 -*-
"""
Common type definitions and constants for edx-dl
The classes in this module represent the structure of courses in edX. The
structure is:
* A Course contains Sections
* Each Section contains Subsections
* Each Subsection contains Units
Notice that we don't represent the full tree structu... |
#!/usr/bin/python3
# Halide tutorial lesson 12.
# This lesson demonstrates how to use Halide to run code on a GPU.
# This lesson can be built by invoking the command:
# make tutorial_lesson_12_using_the_gpu
# in a shell with the current directory at the top of the halide source tree.
# Otherwise, see the platform... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'hashGenerator.ui'
#
# Created: Tue Dec 18 00:25:17 2012
# by: PyQt4 UI code generator 4.9.3
#
# WARNING! All changes made in this file will be lost!
#
# Author:M. Sami GÜRPINAR
# Email :sami.gurpinar@gmail.com
#
from PyQt4 import ... |
"""
Test Microsite filebased backends.
"""
from __future__ import absolute_import
import six
import unittest
from mock import patch
from django.test import TestCase
from django.conf import settings
from django.urls import reverse
from microsite_configuration.backends.base import (
BaseMicrositeBackend,
BaseM... |
import json
from hearthbreaker.agents.basic_agents import RandomAgent
from hearthbreaker.cards.heroes import hero_for_class
from hearthbreaker.constants import CHARACTER_CLASS
from hearthbreaker.engine import Game, Deck, card_lookup
from hearthbreaker.cards import *
import timeit
def load_deck(filename):
cards = ... |
# Copyright (c) 2012 Citrix Systems, Inc.
# 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 ... |
"""
Django settings for django_tdd project.
Generated by 'django-admin startproject' using Django 1.11.6.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
import... |
from lxml.builder import ElementMaker
XSI_NS = 'http://www.w3.org/2001/XMLSchema-instance'
class OAIDC(object):
"""The standard OAI Dublin Core metadata format.
Every OAI feed should at least provide this format.
It is registered under the name 'oai_dc'
"""
def __init__(self, prefix,... |
import os
DEBUG = False
SQLALCHEMY_DATABASE_URI = (
'postgresql://{user}:{password}@{host}:{port}/tagarela'
.format(
user=os.environ['OPENSHIFT_POSTGRESQL_DB_USERNAME'],
password=os.environ['OPENSHIFT_POSTGRESQL_DB_PASSWORD'],
host=os.environ['OPENSHIFT_POSTGRESQL_DB_HOST'],
po... |
#!/usr/bin/python
#
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... |
## Antony Philip - 04/02/2016 - Developed for ACSL teaching
## ACSL 2013-2014 - ACSL NUMBLE
"""
This is an interesting problem which involves backtracking/recursion and greedy approach
First I sort the given n numbers so that we can find the maximum possible sum of given
length r which is a multiple of... |
#http://users.softlab.ntua.gr/~ttsiod/euler31.html
#!/usr/bin/env python
# the 8 coins correspond to 8 columns
coins = [1, 2, 5, 10, 20, 50, 100, 200]
TARGET=200
matrix = {}
for y in xrange(0, TARGET+1):
# There is only one way to form a target sum N
# via 1-cent coins: use N 1-cents!
matrix[y, 0] = 1 ... |
from tkinter import *
from tkinter import ttk
import serial
#
# Data describing rooms blueprint
#
ROOMS = 3 # total number of defined rooms
FLOOR_OFFSET = ('2c', '1c', 0) # displace floor for easier viewing
FLOOR_COLORS = {} # colors for various levels, walls and rooms
FLOOR_SHAPE = {} # polygon coordinates for basic... |
import json
import argparse
import random
import sys
import requests
BIGHUGELABS_API_KEY = 'f79909b74265ba8593daf87741f3c874'
buzzWords = ['alignment','bot', 'collusion', 'derivative', 'engagement', 'focus', 'gathering' ,'housing','liability','management','nomenclature','operation','procedure','reduction','strategic... |
# Auto generated configuration file
# using:
# Revision: 1.19
# Source: /local/reps/CMSSW/CMSSW/Configuration/Applications/python/ConfigBuilder.py,v
# with command line options: step3 --conditions auto:run2_mc_hi -s RAW2DIGI,L1Reco,RECO -n 4 --eventcontent RECODEBUG --runUnscheduled --scenario HeavyIons --datatier G... |
import os.path
import shutil
import copy
import sys
from colors import *
# from cogapp import Cog
join = os.path.join
#--------------------------------------
# Functions
#--------------------------------------
def initEnv(env, name):
env['SNOCSCRIPT_PATH'] = os.path.abspath(os.path.dirname(env['SNOCSCRIPT']))
... |
from typing import Optional, Tuple
import numpy as np
import picwriter.components as pc
import pp
from pp.cell import cell
from pp.component import Component
from pp.components.waveguide_template import strip
from pp.picwriter_to_component import picwriter_to_component
from pp.types import ComponentFactory
@cell
de... |
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2018
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser Public License as published by
#... |
'''
Created on Aug 26, 2017
@author: Raz
'''
import mido
import numpy as np
def midifile_to_dict(mid):
tracks = []
for track in mid.tracks:
tracks.append([vars(msg).copy() for msg in track])
return {
'ticks_per_beat': mid.ticks_per_beat,
'tracks': tracks,
}
def test():
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
pyHurd - A pytonish GNU/Hurd
Copyright (C) 2008 Anatoly A. Kazantsev
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... |
"""
License: GPLv2
Python bindings for Solera DeepSee forensics tool
"""
import requests,sys,math,pprint,time
from datetime import datetime, timedelta
class PyDeepSee:
def __init__(self,server,username,password,verify=True):
self.server=server
self.username=username
self.password=password
self.verify=ver... |
#!/usr/bin/env python
from EPPs.common import GenerateHamiltonInputEPP, InvalidStepError
class GenerateHamiltonInputUCT(GenerateHamiltonInputEPP):
""""Generate a CSV containing the necessary information for the KAPA make libraries method"""
_use_load_config = False # prevent the loading of the config
cs... |
# rotate-backups: Simple command line interface for backup rotation.
#
# Author: Peter Odding <peter@peterodding.com>
# Last Change: May 17, 2020
# URL: https://github.com/xolox/python-rotate-backups
"""
Usage: rotate-backups [OPTIONS] [DIRECTORY, ..]
Easy rotation of backups based on the Python package by the same n... |
"""
mipsy.encoder
Instruction encoder.
See README.md for usage and general information.
"""
# system imports
import bitstring
# application imports
from mipsy.arch import MIPS
from mipsy.util import LabelCache, ParseInfo
class Encoder(object):
"""
Responsible for encoding individual instructions and qu... |
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# ------------------------------------------------------... |
import pytest
import scitbx.matrix
from cctbx import sgtbx
from cctbx.sgtbx import bravais_types
from dxtbx.model import Crystal, Experiment, ExperimentList
from dials.algorithms.indexing import assign_indices, non_primitive_basis
from dials.array_family import flex
@pytest.mark.parametrize("space_group_symbol", br... |
#!/usr/bin/env python
#
# @file generateLatex.py
# @brief function for generating all latex files
# @author Frank Bergmann
# @author Sarah Keating
#
# <!--------------------------------------------------------------------------
#
# Copyright (c) 2013-2015 by the California Institute of Technology
# (California, ... |
import threading
import time
import os
import re
import shlex
import _thread
import sys
import subprocess
alive = True
f = open("list.txt","w")
class myThread(threading.Thread):
def __init__(self,var,ip):
threading.Thread.__init__(self)
self.var = var
self.ip = ip
def run(self):
... |
# Generated by Django 2.2.8 on 2019-12-21 23:27
import c3nav.mapdata.fields
from decimal import Decimal
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('mapdata', '0074_show_labels'),
]
... |
import os
from lizard_ui.settingshelper import setup_logging
from lizard_ui.settingshelper import STATICFILES_FINDERS
DEBUG = True
TEMPLATE_DEBUG = True
# SETTINGS_DIR allows media paths and so to be relative to this settings file
# instead of hardcoded to c:\only\on\my\computer.
SETTINGS_DIR = os.path.dirname(os.pa... |
''' EFES Provider module '''
from karmaserver.modules.selection.provider.evaluator import ObservationEvaluator
from karmaserver.modules.selection.provider.filter import ObservationFilter
from karmaserver.modules.selection.provider.eraser import ObservationEraser
from karmaserver.modules.selection.provider.selector impo... |
from os import makedirs
from os.path import exists, join, dirname, basename
from shutil import rmtree
from ..hideintopng.embedder import Embedder
def test_insert_payload():
_resetResultsFolder()
embedder = Embedder()
containerFilePath = join(dirname(__file__), "mock/ninja.png")
payloadFilePath = join... |
#!/usr/bin/env python3
"""
This tool extracts a pile of settings based on the hierachy of Quickset
"""
import collections
import os
import re
import olefile
import sel_logic_count
LINE_INFO = ['Lines Used (w/ comment lines)', 'Lines Used (w/o comment lines)']
LOGIC_INFO = [ 'PSV', 'PMV', 'PLT', 'PCT', 'PST', 'P... |
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support.select import Select
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.keys import Keys
from colorama import init
from colorama import Fore, Back, Style
im... |
# -*- coding: utf-8 -*-
from dxlparser import DXLPreprocessor
def preprocess(data, expected):
result = DXLPreprocessor().preprocess(data)
if not result == expected:
print ("Expected: |" + expected + "|\nObserved: |" + result + "|\n")
assert result == expected
testdata = [
... |
# -*- coding: utf-8 -*-
from django.conf.urls import patterns, url, include
from wiki.conf import settings
from wiki.core.plugins import registry
from wiki.views import article, accounts
from wiki.core.utils import get_class_from_str
from django.contrib.auth.views import password_reset
class WikiURLPatterns(object):
... |
# -*- coding: utf-8 -*-
# Copyright 2004-2011 Pexego Sistemas Informáticos
# Copyright 2013 Zikzakmedia
# Copyright 2014 Juanjo Algaz
# Copyright 2014 Joaquín Gutierrez <joaquing.pedrosa@gmail.com>
# Copyright 2014-2016 Tecnativa - Pedro M. Baeza
# Copyright 2016 Tecnativa - Vicent Cubells
# License AGPL-3.0 or later (... |
"""Primary application entrypoint.
"""
import locale
import logging
import os
import sys
from typing import List, Optional
from pip._internal.cli.autocompletion import autocomplete
from pip._internal.cli.main_parser import parse_command
from pip._internal.commands import create_command
from pip._internal.exceptions im... |
from PyQt5.QtWidgets import (QApplication, QMessageBox, QDialog, QGridLayout,
QHBoxLayout, QLabel, QPushButton, QLineEdit)
class PasswordDialog(QDialog):
def __init__(self, parent=None):
super(PasswordDialog, self).__init__(parent)
self.password = None
... |
from sys import exit
from pygame import display as pantalla, event
from pygame import init as py_init, quit as py_quit
from azoe.engine import EventHandler
from azoe.widgets import NamedValue
from backend.entidad import Entidad
py_init()
fondo = pantalla.set_mode((400, 400))
event.set_blocked([12, 13])
entit... |
#!/usr/bin/env python
#
# Copyright (c) 2009 Google 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... |
#!/usr/bin/env python
import json
import requests
import logging
import ssl
from datetime import datetime
from os.path import exists, expanduser, dirname
from os import makedirs, remove
from requests.adapters import HTTPAdapter
from requests.packages.urllib3.poolmanager import PoolManager
LOG = logging.getLogger(__n... |
# encoding: utf-8
import csv
import json
import os.path
from time import time
from itertools import chain
from collections import defaultdict
from six.moves import StringIO, xrange
import six
from gevent import wsgi
from flask import Flask, make_response, request, render_template
from . import runners
from .cache im... |
import numpy as np
from matplotlib import pyplot as plt
from scipy.misc import toimage
from collections import defaultdict, Counter
from types import SimpleNamespace
from PIL import ImageDraw
# This color table is sourced from https://github.com/trident01/BioExt-1/blob/master/AlignmentImage.java
LIGHT_GRAY = 196
FIXE... |
"""
Comparison utilities for STIX pattern observation expressions.
"""
from stix2.equivalence.pattern.compare import generic_cmp, iter_lex_cmp
from stix2.equivalence.pattern.compare.comparison import (
comparison_expression_cmp, generic_constant_cmp,
)
from stix2.patterns import (
AndObservationExpression, Foll... |
# coding=utf-8
# Copyright 2020 The HuggingFace Team. 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 requir... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
#!/usr/bin/env python
# coding=utf8
#
# zembu.py 0.1
# Script that checks whether dictionary words are available as domain names.
import subprocess
import datetime
import argparse
import pprint
import time
import sys
import os
# Get current console size.
ROWS, COLS = [int(n) for n in os.popen('stty size', 'r').read()... |
import datetime
import re
from os import path
import json
from django.contrib.gis.geos import Point
from django.core.urlresolvers import reverse
from django.utils import timezone, six
from openpyxl import load_workbook
from rest_framework import status
from main.models import Dataset, Record
from main.tests.api impor... |
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import copy
import collections
from . import chromium_linux
from . import chromium_mac
from . import chromium_win
from . import chromium_webrtc
# GN build... |
import os
import sys
from osgeo import ogr
import ospybook as pb
from ospybook.vectorplotter import VectorPlotter
# Set this variable to your osgeopy-data directory so that the following
# examples will work without editing. We'll use the os.path.join() function
# to combine this directory and the filenames to make a... |
"""
QTScrot is a gui for the scrot screenshot utility.
Written by Alan D Moore, c 2014.
Written by Alan D Moore, c 2014.
Released under the GPL v. 3.0
Requires scrot and QT5.
"""
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from collections import namedtuple
from functools impor... |
from __future__ import print_function
from ast import literal_eval
import copy
import difflib
import sys
try:
from urllib.request import urlopen
from urllib.error import HTTPError
except ImportError:
from urllib2 import urlopen
from urllib2 import HTTPError
from xml.etree import ElementTree
from jenki... |
"""Pydisque makes Disque easy to access in python."""
import redis
from redis.exceptions import ConnectionError
from functools import wraps
try:
# Python 3
from itertools import zip_longest
except ImportError:
from itertools import izip_longest as zip_longest
import logging
logger = logging.getLogger(__name__)
... |
from networkx import DiGraph
from networkx.algorithms.dag import descendants
class LongitudinalRandomDag:
"""This class represents a hierarchical time series of RandomDag objects.
Each node in the hierarchy represents a time rollup. The top level is
'year', the second-lowest level 'hour', and each event ... |
## Copyright (C) 2011 Stellenbosch University
##
## This file is part of SUCEM.
##
## SUCEM 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 v... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.