text stringlengths 17 737k |
|---|
#!/usr/bin/env python
# coding=utf-8
from __future__ import unicode_literals
from __future__ import absolute_import
__author__ = "Clare Corthell"
__copyright__ = "Copyright 2015, summer.ai"
__date__ = "2015-11-25"
__email__ = "clare@summer.ai"
import os
import logging
import shutil
import zipfile
import datetime
imp... |
#!/usr/bin/env python
import os
import sys
import django
from django.conf import settings
from django.test.utils import get_runner
def runtests():
os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.test_settings'
django.setup()
TestRunner = get_runner(settings)
test_runner = TestRunner()
failures = te... |
# -*- coding: utf-8 -*-
from collections import Counter
import logging
from django import template
from django.conf import settings
from django.utils import timezone
from django.utils.safestring import mark_safe
from django.template.defaultfilters import linebreaksbr
from django.core.cache import cache
from django.con... |
#!/usr/bin/env python
"""
Analyze results of mechanical measurements by applying filters, plots, and save
commands to data files.
The commands can be specified using the command line options, and using a
command file. As the command line commands are applied after the command file
commands, they can be used for overri... |
from string import ascii_letters, digits
from django.shortcuts import get_object_or_404
from random import choice
from _sha256 import sha224
from datetime import datetime
from uuid import uuid4
from django.core.validators import validate_email
from django.core.exceptions import ValidationError
from django.contrib.auth... |
#!/usr/bin/env python
#
# Copyright 2001 Google 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 require... |
import dataset
import random
import sys
import re
from tabulate import tabulate
from IOHelper import parseDic
db = dataset.connect('sqlite:///words.db')
phonemes = {}
# Transcribe from orthographic representation to phonetic representation
def transcribePhonemes(word):
for current, new in phonemes.i... |
from django.db import transaction
from django import forms
from django.utils.translation import ugettext as _
from gasistafelice.gas.models import GASMemberOrder, GASSupplierOrderProduct
from gasistafelice.exceptions import DatabaseInconsistent
import logging
log = logging.getLogger(__name__)
#----------------------... |
#!/usr/bin/env python
from __future__ import print_function
import argparse
import os
import sys
from collections import defaultdict
_CONSOLE_COLORS = {
"c-end": "\033[0m",
"c-bold": "\033[1m",
"c-underline": "\033[4m",
"c-red": "\033[31m",
"c-green": "\033[32m",
"c-ye... |
# -*- coding: utf-8 -*-
from __future__ import print_function
import collections
import os
from . import topics
from clare import common
class DownloadBot(object):
def __init__(self, replay_downloader, download_validator):
"""
Parameters
----------
replay_downloader : clare.ap... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from urllib.request import urlopen
import requests
class RepoScanner:
def __init__(self, owner, repo):
self.owner = owner
self.repo = repo
self.contents = None
def get_contents(self):
# FIXME: find a better way to handle getting c... |
p = 0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff
a = 0xffffffff00000001000000000000000000000000fffffffffffffffffffffffc
b = 0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b
xG = 0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296
yG = 0x4fe342e2fe1a7f9b8ee7eb4a7... |
# -*- Mode: Python -*-
# vi:si:et:sw=4:sts=4:ts=4
#
# Flumotion - a video streaming server
# Copyright (C) 2004 Fluendo
#
# http.py: a consumer that streams over HTTP
#
# 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 Fre... |
# coding: utf-8
# Der WSGI-Server auf PythonAnywhere verwendet diese Datei
import sqlite3
import os
import time
import bottle
from bottle import default_app, route, view
from bottle import request
from bottle_utils.i18n import I18NPlugin
from bottle_utils.i18n import lazy_gettext as _
import input_number as ip
from... |
# coding: utf-8
# Der WSGI-Server auf PythonAnywhere verwendet diese Datei
import sqlite3
import os
import time
import bottle
from bottle import default_app, route, view
from bottle import request
from bottle_utils.i18n import I18NPlugin
from bottle_utils.i18n import lazy_gettext as _
import input_number as ip
"""... |
import ROOT
import os
import re
import PyAnalysisTools.PlottingUtils.PlottingTools as pt
import PyAnalysisTools.PlottingUtils.Formatting as fm
from PyAnalysisTools.PlottingUtils.PlotConfig import PlotConfig
from PyAnalysisTools.base.OutputHandle import OutputFileHandle
from PyAnalysisTools.base.YAMLHandle import YAMLLo... |
# Copyright (C) 2008 The Android Open Source Project
#
# 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 ... |
# -*- coding: utf-8 -*-
'''
The Salt Key backend API and interface used by the CLI. The Key class can be
used to manage salt keys directly without interfacing with the CLI.
'''
# Import python libs
from __future__ import absolute_import, print_function
import os
import copy
import json
import stat
import shutil
import... |
# coding=utf8
from subprocess import Popen, PIPE
from threading import Thread
try:
from queue import Queue, Empty
except ImportError:
from Queue import Queue, Empty
import sublime
import os
import time
from .Settings import SETTINGS
from .Liste import LISTE
from ..display.Message import MESSAGE
from ..Utils import... |
#!/usr/bin/env python
"""
Generic Tornado Application Controller
Copyright (c) 2009, Gavin M. Roy
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 co... |
"""
fs.contrib.davfs
================
FS implementation accessing a WebDAV server.
This module provides a relatively-complete WebDAV Level 1 client that exposes
a WebDAV server as an FS object. Locks are not currently supported.
Requires the dexml module:
http://pypi.python.org/pypi/dexml/
"""
# Copyright (... |
#! /usr/bin/env python
"""Further iterator tools.
"""
import itertools
from ..itertools_compat import ifilter, imap, ifilterfalse
from .. import pairs
import functools
import warnings
def itercons(new_head, tail):
"""Cons a value onto the beginning of an iterator.
Like itertools.chain([new_head], tail)
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
#
#######################################################################################
# GEF - Multi-Architecture GDB Enhanced Features for Exploiters & Reverse-Engineers
#
# by @_hugsy_
#
###############################################################################... |
# 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 use ... |
#!/usr/bin/env python
import getopt, hashlib, os, shutil, sys
import ConfigParser, pickle
class File(object):
def __init__(self, path, filename):
self.path = path
self.filename = filename
self.localModified = None
self.remoteModified = None
self.hash = None
self.removed = False
def calculateHash(self, ... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
import os
import io
import json
import logging
import binascii
import webbrowser
import pkg_resources
try:
from urllib import urlencode
except ImportError:
from urllib.parse impor... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import with_statement
import threading
__author__ = 'Alberto Paro'
__all__ = ['ES', 'file_to_attachment', 'decode_json']
try:
# For Python >= 2.6
import json
except ImportError:
# For Python < 2.6 or people using a newer version of simplejson
... |
#!/usr/bin/python
# Copyright 2013 Google, 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 required by ... |
# -*- coding: utf-8 -*-
from __future__ import print_function
class BaseRenderer(object):
def __init__(self, table):
self.table = table
self.output = []
def p(self, val):
self.output.append(val)
def __str__(self):
return ''.join(self.output)
class FancyRenderer(BaseRen... |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2009 EduSense BV (<http://www.edusense.nl>).
# (C) 2011 - 2013 Therp BV (<http://therp.nl>).
#
# All other contributions are (C) by their respective contributors
#
# ... |
import gscommon as gs
import threading
import Queue
import sublime
DOMAIN = 'GsQ'
class Launcher(threading.Thread):
def __init__(self, domain, f):
threading.Thread.__init__(self)
self.daemon = True
self.domain = domain
self.f = f
def run(self):
try:
self.f()
except Exception:
gs.notice(self.domai... |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import babel.dates
import collections
from datetime import datetime, timedelta
from dateutil import parser
from dateutil import rrule
from dateutil.relativedelta import relativedelta
import logging
from operator import i... |
# -*- coding: utf-8 -*-
import argparse
import binascii
import datetime
import hashlib
import os
import re
import requests
import time
import urllib
from evernote.api.client import EvernoteClient
from evernote.edam.type import ttypes as Types
from BeautifulSoup import BeautifulSoup
try:
from ConfigParser import Saf... |
#!/usr/bin/python
'''
Copyright 2016, Xun Jiang
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law o... |
from __future__ import (
unicode_literals,
absolute_import,
print_function,
division,
)
import uuid
import struct
from .utils import (int_from_bytes, bytes_from_int)
MOBID_STRUCT = struct.Struct(''.join(( '<',
'12B', # UInt8Array12 SMPTELabel
'B', # UInt8 length
'B', # U... |
import json
#from .data_types import (
# Header, FileControl, BatchHeader,
# BatchControl, EntryDetail, AddendaRecord
#)
class Parser(object):
'''
Parser for ACH files
'''
FILE_HEADER = '1'
FILE_CONTROL = '9'
BATCH_HEADER = '5'
BATCH_CONTROL = '8'
ENTRY_DETAIL = '6'
ADDENDA... |
#!/usr/bin/env python
"""schtex V0.4
Copyright (c) 2014--2020 Michael P. Hayes, UC ECE, NZ
Usage: schtex infile.sch [outfile.tex|pdf|png|svg|sch|pgf]
"""
from __future__ import print_function
from matplotlib.pyplot import show
from argparse import ArgumentParser
import sys
import os
def schtex_exception(type, value,... |
import os
import boto.swf
import json
import random
import datetime
import importlib
import calendar
import time
import zipfile
import requests
import urlparse
import glob
import shutil
import re
import activity
import boto.s3
from boto.s3.connection import S3Connection
import provider.simpleDB as dblib
"""
Publis... |
from __future__ import unicode_literals
import argparse
import logging
import os
import sys
import uuid
logger = logging.getLogger('Environment')
def _get_chrome_path():
if sys.platform == 'win32':
# First path includes fallback for Windows XP, because it doesn't have
# LOCALAPPDATA variable.
... |
from __future__ import division
from base64 import b64decode
from datetime import datetime
import logging
import re
import socket
from urllib import urlencode
from urlparse import urlparse, urlunparse
from xml.etree import ElementTree
from BeautifulSoup import BeautifulSoup
from django.conf import settings
import htt... |
#!/usr/bin/env python
# -*- coding: utf-8
from datetime import datetime
from pymongo.connection import Connection
import gridfs
from bson.objectid import ObjectId
import os.path
import tornado.auth
import tornado.template
import tornado.escape
import tornado.httpserver
import tornado.ioloop
import tornado.options
i... |
# Copyright (C) 2013 - The MITRE Corporation
# For license information, see the LICENSE.txt file
# Contributors:
# * Alex Ciobanu - calex@cert.europa.eu
# * Mark Davidson - mdavidson@mitre.org
# * Bryan Worrell - bworrell@mitre.org
# * Benjamin Yates - byates@dtcc.com
"""
Creating, handling, and parsing TAXII 1.1 mes... |
#-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# d$
#
# This program is free software: you can redistribute it and/or modify
# it ... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
from django import template
from django.utils import html
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext as _
register = template.Library()
EMPTY_LABEL = '<span class="label label-info">Empty</span>'
@register.simple_tag
def translate(t, lang, langs=None):
langs = la... |
import urllib
import re
from webhelpers.text import truncate
from unicodedata import normalize, category
from adhocracy.forms import FORBIDDEN_NAMES
#INVALID_CHARS = re.compile(u"[\?#\&]", re.U)
def chr_filter(ch):
""" Filter by unicode character category. """
if ch == u'_':
return ch
cat = categ... |
#!/usr/bin/env python
# KIF: Kill It with Fire (or a depressed space alien)
# Requires: python-psutil, python-yaml
# Initial module imports
from __future__ import print_function
import os
import sys
import psutil
import yaml
import re
import subprocess
import argparse
import socket
import smtplib
import email.mime.tex... |
#!/usr/bin/python2
# -*- coding: utf-8 -*-
# Author: Alessandro Guazzi
import numpy as np
import matplotlib.pyplot as plt
class LDA:
def __init__(self):
self.sigma_inv = 0
self.const = 0
self.coeff = 0
def train(self, train_input, train_class):
# Input matrix with values as... |
#ipc_lista2.1
#Professor: Jucimar Junior
#Any Mendes Carvalho - 1615310044
#
#
#
#
#Faça um programa que peça dois números e imprima o maior deles.
num1 = float(input("Informe um número: "))
num2 = float(input("Informe outro número: "))
if (num1 > num2):
print ("O maior número é: ",num1)
else:
print ("O maior
|
#! /usr/bin/env python
# Python script for the Interoute Virtual Data Centre API:
# Name: loadbased-autoscaler.py
# Purpose: Perform autoscaling of webserver virtual machines in VDC based on loading of an HAProxy frontend loadbalancer
# Requires: class VDCApiCall in the file vdc_api_call.py
# See the repo: https:... |
# Copyright 2014, Doug Wiegley (dougwig), A10 Networks
#
# 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 b... |
import activity
import json
from provider.execution_context import Session
import provider.lax_provider as lax_provider
from provider.storage_provider import StorageContext
import time
import provider.glencoe_check as glencoe_check
"""
activity_VerifyGlencoe.py activity
"""
class ValidationException(RuntimeError):
... |
# -*- coding: utf-8 -*-
{
'name': 'Maintenance',
'version': '1.0',
'sequence': 125,
'category': 'Human Resources',
'description': """
Track equipment and manage maintenance requests.""",
'depends': ['mail'],
'summary': 'Equipments, Assets, Internal Hardware, Allocation Tracking',
... |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import base64
import datetime
import json
import os
import logging
import pytz
import requests
import werkzeug.utils
import werkzeug.wrappers
from itertools import islice
from xml.etree import ElementTree as ET
import o... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compli... |
#!/usr/bin/env python
#coding=utf8
"""
Usage:
mov create [options] DIRECTORY ...
mov update [options] DIRECTORY ...
mov destroy [options]
mov ls [options] [PATTERN ...]
mov play [options] [PATTERN ...]
mov -h | --help
mov --version
Commands:
create Create a new database with information ... |
import os
import time
try:
from . import shared as G
assert G
unicode = str
python2 = False
except ImportError:
python2 = True
import shared as G
LOG_LEVELS = {
'DEBUG': 1,
'MSG': 2,
'WARN': 3,
'ERROR': 4,
}
LOG_LEVEL = LOG_LEVELS['MSG']
LOG_FILE = os.path.join(G.BASE_DIR, 'm... |
import itertools
import llvmlite.llvmpy.core as lc
from .cudadrv import nvvm
from .api import current_context
def declare_atomic_cas_int(lmod, isize):
fname = '___numba_atomic_i' + str(isize) + '_cas_hack'
fnty = lc.Type.function(lc.Type.int(isize),
(lc.Type.pointer(lc.Type.int(isi... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
import logging
import json
import re
import time
from functools import wraps
from pymongo import MongoClient
import signal
from multiprocessing import Pool
import concurrent
from concurrent.futures import ThreadPoolExecutor
import redis
_LOG_FILE = 'l... |
#! /usr/bin/env python
import os.path
import time
from time import strftime
import os
import sys
import shutil
FILE = 'todo.md'
def date_to_append():
return strftime("%m-%d-%Y", time.gmtime(os.path.getctime(FILE)))
def rename_file(the_file):
base = os.path.basename(the_file)
split_up = os.path.splitext(b... |
# Copyright 2016 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 agreed to in writing, s... |
# Copyright (C) 2003 John Goerzen
# <jgoerzen@complete.org>
#
# 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... |
from __future__ import division
import logging; _L = logging.getLogger('openaddr.ci.webhooks')
from functools import wraps
from operator import itemgetter, attrgetter
from collections import OrderedDict
from datetime import datetime
from dateutil.tz import tzutc
from csv import DictWriter
import hashlib, hmac
import ... |
import os
import shutil
import logging
from distutils.spawn import find_executable
try:
from subprocess import getoutput # If python 3
except ImportError:
from commands import getoutput # If python 2
import parmed
logger = logging.getLogger(__name__)
logging.basicConfig(level=logging.DEBUG, format="LOG: %(me... |
# -*- 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... |
# -*- coding: utf-8 -*-
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.core.exceptions import ValidationError, ObjectDoesNotExist
from mptt.models import MPTTModel, TreeForeignKey
from mptt.managers import TreeManager
from opps.core.models import Publishable, BaseConf... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2009, 2010 Amit Saha
#
# 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 License, or (at your option... |
from time import time
import datetime
from lxml import etree
from threading import Thread
import requests
import shortuuid
import re
import random
import json
from sqlalchemy.dialects.postgresql import JSONB
from sqlalchemy.orm.attributes import flag_modified
from sqlalchemy import orm
from collections import Counter
f... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
#
# Reference:
# https://www.anip.gob.pa/documentos/DV_RUC.pdf
_arrval = {
'00': '00',
'10': '01',
'11': '02',
'12': '03',
'13': '04',
'14': '05',
'15': '06',
'16': '07',
'17': '08',
'18': '09... |
from flask import Flask, request, jsonify
import json
import requests
from urllib2 import URLError
from random import randint
app = Flask(__name__)
app.debug = True
@app.route('/test', methods=['POST'])
def test():
content = request.get_json()
access_token = content['originalRequest']['data']['user']['access... |
#!/usr/bin/env python3
import argparse
import os
import shutil
import nibabel
from glob import glob
from subprocess import Popen, PIPE
from shutil import rmtree
import subprocess
def run(command, env={}, ignore_errors=False):
merged_env = os.environ
merged_env.update(env)
# DEBUG env triggers freesurfer to... |
#!/usr/bin/env python
# Standard libraries
import json
import os
import random
import smtplib
import hashlib
# downloaded
from flask import Flask, render_template, request, make_response, redirect, session
# files
from settings import PER_PAGE
import scheduler
import secrets
app = Flask(__name__)
app.secret_key = s... |
#!/usr/bin/env python3
import logging
import os
import sys
from logging.handlers import RotatingFileHandler
from home import settings
from home.core.parser import parse
from home.web.models import db_init
from home.web.web import socketio, app
sys.path.append(os.path.dirname(os.path.realpath(__file__)))
db_init()
tr... |
"""
Reads index.json file containing plugins versions and descriptions, and
test them against current python version and pytest version selected by
$PYTEST_VERSION environment variable.
The plugins are tested using tox. If a plugin provides a tox.ini file,
that is used to test the plugin compatibility, otherwise we pr... |
# Some utilities for speaking s3g
import struct
import time
from array import array
host_query_command_dict = {
'GET_VERSION' : 0,
'INIT' : 1,
'GET_AVAILABLE_BUFFER_SIZE' : 2,
# 'CLEAR_BUFFER' : 3,
'GET_POSITION' : 4,
'ABORT_IMMEDIATELY' :... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
#
# The MIT License (MIT)
#
# Copyright (c) 2014 Develer S.r.L.
#
# 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, includin... |
# -*- coding:utf-8 -*-
#fix path
import os
import sys
sys.path.append(os.sep.join(
os.path.dirname(os.path.abspath(__file__)).split(os.sep)[:-1]))
from werkzeug.serving import run_simple
import werkzeug
from gevent.monkey import patch_all
from gevent import wsgi
from libcloud_rest.application import LibcloudRest... |
from django.shortcuts import render_to_response
from django.contrib.auth.models import *
from django.template.loader import get_template
from django.template import Context
from django.http import HttpResponse, Http404
from lingcod.common import mimetypes
from lingcod.common import utils
from lingcod.mpa.models import... |
""" Copyright 2012, 2013 UW Information Technology, University of Washington
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 r... |
# -*- coding: utf-8 -*-
import os
import subprocess
import time
import traceback
import eyed3
from django.conf import settings
from django.core.files.base import ContentFile
from django.utils.encoding import smart_text, DjangoUnicodeDecodeError
from django.utils.timezone import now
from eyed3 import id3
from lxml.etre... |
#ipc_lista1.10
#Faça um programa que peça a temperatura em graus Celsius, transforme e mostre em graus farenheit.
c = input("Entre com a temperatura em graus Celsius: ")
vt = c * 1.8
f = vt + 32
print "
|
#! /usr/local/bin/env python
class Individual:
def __init__(self, idn):
self._id = idn
@property
def id(self):
return(self._id)
class Population:
def __init__(self, population_n):
self._individuals = []
for i in range(population_n):
self._individuals.appe... |
#! /usr/bin/python
# -*- coding: utf8 -*-
import tensorflow as tf
import time
from . import visualize
from . import utils
from . import files
from . import cost
from . import iterate
from . import ops
import numpy as np
from six.moves import xrange
import random, warnings
import copy
# __all__ = [
# "Layer",
# ... |
# coding:utf-8
import traceback
from contextlib import contextmanager
try:
from abc import ABCMeta, abstractmethod
except ImportError:
ABCMeta = type
abstractmethod = lambda x: x
class AbstractFormatter(object):
"""Optional base for formatters, serves as documentation and improves
errors for inco... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django import forms
from django.contrib.sites.models import Site
from django.core.exceptions import PermissionDenied
from django.utils.encoding import smart_text
from django.utils.translation import (
ugettext,
ugettext_lazy as _,
get_la... |
# Copyright (c) 2015, UT-BATTELLE, LLC
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and... |
# -*- coding: utf-8 -*-
from django.conf import settings
from django.http import HttpRequest
from django.template import TemplateDoesNotExist
from django.contrib.auth.models import User
from cms.tests.base import CMSTestCase, URL_CMS_PAGE, URL_CMS_PAGE_ADD,\
URL_CMS_PLUGIN_ADD, URL_CMS_PLUGIN_EDIT, URL_CMS_PAGE_CHA... |
# Miro - an RSS based video player application
# Copyright 2009 - Participatory Culture Foundation
#
# This file is part of vidscraper.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of sour... |
from datetime import datetime
import os
import shutil
import subprocess
from urllib import parse, request
from djcelery.models import PeriodicTask
from django.conf import settings
from django.contrib.gis.geos import Point
from django.db import transaction
from django.db.utils import IntegrityError
from .models import... |
# -*- coding: utf-8 -*-
# This file is part of Teres.
#
# Copyright (C) 2016 Peter Kotvan
#
# This library 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 2.1 of the License, or (at you... |
from bs4 import BeautifulSoup
import csv
import os
import re
import json
import pprint
from django.core.management.base import BaseCommand
from programs.models import Program, ProgramModules, LearningPlan
from disciplines.models import Discipline
from modules.models import Module
pp = pprint.PrettyPrinter(indent=4)
... |
"""
fuzz string constants.
Many of these were gleaned from the fuzzdb project and the big list of naughty
strings. Their respective project pages are here:
https://github.com/fuzzdb-project/fuzzdb
https://github.com/minimaxir/big-list-of-naughty-strings
"""
# These are formatted as follows:
# ("description",... |
import sys
import time
import curses
import threading
import signal
import copy
try:
from urllib.parse import urlencode
except ImportError:
from urllib import urlencode
from datetime import datetime
from alerta.api import ApiClient
from alerta.alert import AlertDocument
SCREEN_REDRAW_INTERVAL = 2
lock = th... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import evdev
from evdev import ecodes
from evdev.device import InputDevice
from select import select
from datetime import datetime
class EdgeSwipeDetect:
def __init__(self, argv):
self.dev = None
self.running = False
self.counter = 0
... |
# -*- coding: utf-8 -*-
# Copyright 2014 David Marin
#
# 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 app... |
"""
This script attempts to solve the model with unknown variables
"""
import numpy as np
import pandas as px
import socket
import atexit
import keyring
from statsmodels.tsa.api import VAR
from statsmodels.tsa.filters import hpfilter
from scipy import stats
from util import pickle_file, success_mail, fail_mail, to_mt... |
__author__ = 'foxcarlos-TeamCreed'
from os import getcwd
from os.path import expanduser, join, isfile
import ConfigParser
PROTOCOL_VERSION = 10
dataFolderPath = expanduser('~')
currentPath = getcwd()
myFileConfig = 'ob.cfg'
finalFileConfig = join(currentPath, myFileConfig)
fc = ConfigParser.ConfigParser(allow_no_valu... |
# coding=utf-8
# Copyright (c) 2001-2014, Canal TP and/or its affiliates. All rights reserved.
#
# This file is part of Navitia,
# the software to build cool stuff with public transport.
#
# Hope you'll enjoy and contribute to this project,
# powered by Canal TP (www.canaltp.fr).
# Help us simplify mobility a... |
# Copyright (C) 2006-2007 Red Hat, Inc.
#
# This library 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 2 of the License, or (at your option) any later version.
#
# This library is dis... |
#
# 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.