text stringlengths 12 6.59M |
|---|
r"""
Definition
----------
Parameters for this model are the core axial ratio X and a shell thickness,
which are more often what we would like to determine and makes the model
better behaved, particularly when polydispersity is applied than the four
independent radii used in the original parameterization of this model... |
from satchmo_store.shop.models import Config, Cart, CartItem, CartItemDetails, Order, OrderItem, OrderItemDetail, OrderStatus, OrderPayment, OrderPaymentFailure, OrderAuthorization, OrderVariable, OrderTaxDetail
from django.contrib import admin
from django.utils.translation import ugettext_lazy as _
from satchmo_utils.... |
from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
import yawf
yawf.autodiscover()
urlpatterns = patterns('',
url(r'^describe/(?P<workflow_id>\w+)/$', 'yawf.views.describe_workflow',
name='describe'... |
#!/usr/bin/env python
from glob import glob
import os
import re
def make_feedmes():
# Used to convert all the fit*.galfit files to fit*.diff
ids = glob('*/')
for id in ids:
feedmes = glob(id+'fit*diff')
# output starting models
for f in feedmes:
template = r'.*fit(.*)(\... |
# Copyright 2014-2015 ARM Limited
#
# Licensed under the Apache License, Version 2.0
# See LICENSE file for details.
# standard library modules, , ,
import json
import os
import signal
import subprocess
import logging
import string
import traceback
import errno
import itertools
from collections import OrderedDict
# O... |
from django.contrib.auth import get_user_model
from django.core.mail import send_mail
from rest_framework import filters
from rest_framework import status
from rest_framework import viewsets
from rest_framework.decorators import list_route
from rest_framework.permissions import IsAuthenticated, AllowAny, BasePermission... |
"""
flask.ext.restless.search
~~~~~~~~~~~~~~~~~~~~~~~~~
Provides querying, searching, and function evaluation on SQLAlchemy models.
The most important functions in this module are the :func:`create_query`
and :func:`search` functions, which create a SQLAlchemy query object and
execute that que... |
# coding -*- utf-8 -*-
"""Defines some convenience functions that chain some steps from the lexical
analysis of the text, building the abstract syntax tree and interpreting this
tree
"""
from __future__ import unicode_literals
from whispy_lispy import (
parser2, lexer, scopes2, interpreter2)
def get_ast_from_tex... |
# -*- coding: utf-8 -*-
# pylint: disable=missing-docstring
##############################################################################
#
# Copyright (c) 2011, Martín Raúl Villalba
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (... |
from django.views.decorators.csrf import csrf_exempt
from zephyr.models import UserProfile, UserActivity, get_client
from zephyr.lib.response import json_success, json_error
from django.utils.timezone import now
from functools import wraps
import types
class TornadoAsyncException(Exception): pass
class _DefGen_Retu... |
from rest_framework import serializers
from movie.models import Movie, Genre
import six
import re
from django.contrib.auth import get_user_model
User = get_user_model()
def match(field,value):
if not re.match(r'[A-Za-z]', value):
raise serializers.ValidationError({field:"%s should be valid string ch... |
#
# --------------------------------
# reddit-new-post-notify
# notifier.py
# --------------------------------
#
# Author: Jacob Causon
# July 2014
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complian... |
from Gaudi.Configuration import *
from GaudiKernel.SystemOfUnits import *
from Configurables import DaVinci
from Configurables import GaudiSequencer
simulation=True
if simulation:
from Configurables import EventNodeKiller
from StrippingConf.Configuration import StrippingConf, StrippingStream
f... |
""" Multicast DNS Service Discovery for Python, v0.14-wmcbrine
Copyright 2003 Paul Scott-Murphy, 2014 William McBrine
This module provides a framework for the use of DNS Service Discovery
using IP multicast.
This library is free software; you can redistribute it and/or
modify it under the terms of... |
import os.path
from ConfigParser import SafeConfigParser
class Appconfig:
home = os.path.expanduser("~")
#Reading all varibale from eSim config.ini
parser_esim = SafeConfigParser()
parser_esim.read(os.path.join(home, os.path.join('.esim','config.ini')))
try:
src_home = parser_esim.get('eSi... |
from __future__ import division, print_function, absolute_import
import sys
if sys.version_info[0] >= 3:
from io import StringIO
else:
from StringIO import StringIO
import tempfile
import numpy as np
from numpy.testing import assert_equal, \
assert_array_almost_equal_nulp
from scipy.sparse import coo_ma... |
#!/usr/bin/python
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford (jspenguin@jspenguin.org)
# The author disclaims copyright to this source code.
# Quickly and dirtily modified by Mustafa Al-Bassam (mus@musalbas.com) to test
# the Alexa top X.
# Usage example: python ssltest.py top-1m.csv 10
impo... |
# -*- coding: utf-8 -*-
# /***************************************************************************
# Irmt
# A QGIS plugin
# OpenQuake Integrated Risk Modelling Toolkit
# -------------------
# begin : 2014-10-24
# copyright ... |
# by ME
# snoopify.py
# changes comments into snoop dog/lions language
import praw
import re
import pprint
import os
import time
import sys
#gets password
with open('passwords.txt', 'r') as passFile:
password = passFile.read()
with open('user.txt', 'r') as uFile:
userName = uFile.read()
r = praw.Reddit('Snoop ... |
# -*- coding: utf-8 -*-
"""
ZUGBRUECKE
Calling routines in Windows DLLs from Python scripts running on unixlike systems
https://github.com/pleiszenburg/zugbruecke
src/zugbruecke/core/session.py: A user-facing ctypes-drop-in-replacement session
Required to run on platform / side: [UNIX]
Copyright (C) 20... |
#!/usr/bin/python
try:
import dns.update
import dns.query
import dns.tsigkeyring
import dns.message
import dns.resolver
HAVE_DNSPYTHON=True
except:
HAVE_DNSPYTHON=False
class Record(object):
def __init__(self, module):
self.module = module
self.state =... |
from ._utils import *
from ..models import AccessObject, Assignment, Level
from ..widgets import *
from django.forms import ModelForm, ValidationError
from django.forms.models import modelformset_factory, ModelForm
import datetime
class AccessWidgetTestCase(ArmAccessTestCase):
def setUp(self):
super(Acces... |
# -*- coding: utf-8 -*-
"""Clip model."""
from balistos.models.playlist import Playlist
from balistos.models.user import User
from pyramid_basemodel import Base
from pyramid_basemodel import BaseMixin
from pyramid_basemodel import Session
from sqlalchemy import Column
from sqlalchemy import DateTime
from sqlalchemy im... |
"""
Name : Base 64 Encryption, encoder and decoder
Created By : Agus Makmun (Summon Agus)
Blog : bloggersmart.net - python.web.id
License : GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007
Documentation : https://github.com/agusmakmun/Some-Examples-of-Simple-Python-Script/
Po... |
#!/usr/bin/env python
from math import sqrt
import time, sys
src = 0
if len(sys.argv) == 2 and sys.argv[1] == 's':
src = 1
from mkufunc.api import mkufunc
def count_primes(N):
res = 0
for n in xrange(2, N):
for i in xrange(2, min(n, int(sqrt(n)+2.0))):
if n % i == 0:
... |
#!/usr/bin/env python
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford (jspenguin@jspenguin.org)
# The author disclaims copyright to this source code.
# Quickly and dirtily modified by Mustafa Al-Bassam (mus@musalbas.com) to test
# the Alexa top X.
# Usage example: python ssltest.py top-1m.csv 10
... |
# -*- coding: utf-8 -*-
"""Widgets for form fields."""
from __future__ import unicode_literals
from django.forms import PasswordInput
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext as _
class PasswordStrengthInput(PasswordInput):
"""Form widget to show the user how s... |
import numpy.testing as npt
import numpy as np
import nose
from scipy import stats
DECIMAL_meanvar = 0#1 # was 0
distdiscrete = [
['bernoulli',(0.3,)],
['binom', (5, 0.4)],
['boltzmann',(1.4, 19)],
['dlaplace', (0.8,)], #0.5
['geom', (0.5,)],
['hypergeom',(30, 12, 6)],
['hypergeom... |
import re
from troposphere import (
Ref, ec2, Output, GetAtt, Tags
)
from troposphere.rds import (
DBInstance, DBSubnetGroup, DBParameterGroup, OptionGroup,
)
from troposphere.route53 import RecordSetType
from stacker.blueprints.base import Blueprint
from stacker.blueprints.variables.types import CFNString
R... |
#!/usr/bin/env python
# Usage: ./full_test_driver.sh [--just-tests] [--git-branch <branch-name>] [--build-mode (two|all)] [--test-dir <directory location, to be appended to rethinkdb/>]
# Environment variables: SLURM_CONF
#
# Check out the given RethinkDB branch from GitHub and run a full test against
# it. The full t... |
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, print_function, unicode_literals)
from boto3.session import Session
from acli.output.ec2 import (output_ec2_list, output_ec2_info,
output_ami_list, output_ami_info,
output_ec2_summary)
from acli.co... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import argparse
import os
import sys
import timeit
import six
from . import (
hash_password,
DEFAULT_RANDOM_SALT_LENGTH,
DEFAULT_TIME_COST,
DEFAULT_MEMORY_COST,
DEFAULT_PARALLELISM,
DEFAULT_HASH_LENGTH,
... |
#
# Copyright (c) 2015, Neil Webber
# 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 the ... |
"""Astral geocoder is a database of locations stored within the package.
To get the :class:`~astral.LocationInfo` for a location use the
:func:`~astral.geocoder.lookup` function e.g. ::
from astral.geocoder import lookup, database
l = lookup("London", database())
All locations stored in the database can be a... |
"""Visual Attention Based OCR Model."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import random, time, os, shutil, math, sys, logging,ipdb
import numpy as np
from six.moves import xrange # pylint: disable=redefined-builtin
from PIL import Image
impor... |
""" Translates a PWA in a symbolic TS """
# from bmc.pysmt_bmc.ts import TransitionSystem
# from bmc.pysmt_bmc.counter_enc import CounterEnc
# from bmc.pysmt_bmc.helpers import Helper
from ts import TransitionSystem
from counter_enc import CounterEnc
from helpers import Helper
import constraints
import pwa
from cor... |
# Copyright (c) 2009, Daniel Krech 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 and the... |
import csv
import os
from collections import namedtuple
from pyspark.sql import SQLContext
from pyspark import SparkContext
from pyspark.ml.feature import CountVectorizer
from pyspark.ml.feature import StopWordsRemover
from pyspark.mllib.clustering import LDA
from topic_zoomer_functions import *
os.environ['SPARK_HOM... |
#!/usr/bin/python
#
# occi_api.py - common functions, classes, and variables for Vcycle
#
# Andrew McNab, University of Manchester.
# Luis Villazon Esteban, CERN.
# Copyright (c) 2013-5. All rights reserved.
#
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provi... |
from multidb.pinning import pin_this_thread, unpin_this_thread
def real_ip_middleware(get_response):
def middleware(request):
if 'HTTP_X_REAL_IP' in request.META:
request.META['REMOTE_ADDR'] = request.META['HTTP_X_REAL_IP']
return get_response(request)
return middleware
def pin_d... |
#!/usr/bin/python
''' useful supporting functions '''
from settings import API_KEY, DB_PATH, BIOGUIDE_LOOKUP_PATH
from BeautifulSoup import BeautifulSoup
import urllib2, urllib, re
try:
import json
except:
import simplejson as json
def abbr(longname):
''' return the abbreviation for a state'''
sta... |
import math
from heapq import heappush, heappop
from matplotlib import pyplot as plt
class Point:
def __init__(self, x, y):
self.x = x
self.y = y
def __eq__(self, point):
if point == None:
return False
return self.x == point.x and self.y == point.y... |
from urllib.parse import urlparse, parse_qs
from io import StringIO
import json
class MockRequest:
def getmethod(self, path):
apiend = "v2/"
start = path.find(apiend) + len(apiend)
return path[start:]
def urlopen(self, url):
output = StringIO()
parsed = urlparse(url)
... |
from decimal import Decimal
from boto.dynamodb.types import Dynamizer
from boto.dynamodb2.types import (STRING, STRING_SET, BINARY, BINARY_SET,
NUMBER, NUMBER_SET)
class Attribute(object):
"""Declare the attribute of the model as a descriptor."""
# (:class:`str`) The attribu... |
# global:
# # NOTE: Natural Earth 1:50 million used zooms 0,1,2,3,4
# # and only has USA, Canada, Brazil, and Australia
# # all with scalerank of 2 (a documented NE omission).
# # Then 1:10 million NE is selected at zooms 5, 6, 7
# # and includes most all countries, with various scaler... |
"""
Module holds all stuff regarding Gatling tool usage
Copyright 2015 BlazeMeter Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless require... |
# OMX package
# release 1
import tables # requires pytables >= 2.4
from Exceptions import *
class File(tables.File):
def __init__(self, f,m,t,r,f1, **kwargs):
tables.File.__init__(self,f,m,t,r,f1,**kwargs)
self._shape = None
def version(self):
if 'OMX_VERSION' in self.root._v_attr... |
import numpy as np
import tensorflow as tf
import tensor_train
import ops
import initializers
class TTTensorTest(tf.test.TestCase):
def testFullTensor2d(self):
np.random.seed(1)
for rank in [1, 2]:
a = np.random.rand(10, rank).astype(np.float32)
b = np.random.rand(rank, 9).astype(np.float32)
... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2009 Philip Stark
# BSD Style Licence
import math
from pyPdf import PdfFileWriter, PdfFileReader
import sys
import re
from os.path import splitext
#####################################
# Handle all command line arguments #
#####################################
def ... |
import warnings
import numpy as np
import astropy.units as u
from astropy.constants import c
from astropy.coordinates import SkyCoord, ICRS, Distance, GCRS
from astropy.coordinates.baseframe import BaseCoordinateFrame, FrameMeta
from astropy.utils.compat import NUMPY_LT_1_14
from astropy.utils.exceptions import Astro... |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
import itertools
import math
import pandas as pd
DATE = '2014-10-13'
XLS_NAME = 'startup.xls'
SHEET_NAME = 'STARTUP_' + ''.join(reversed(DATE.split('-')))
BUSINESS_NAME = 'denominazione'
BUSINESS_PROV = 'pv'
BUSINESS_TYPE = 'nat.giuridica'
REVENUE_CLASS = 'classe di pr... |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
from collections import Counter
import pandas as pd
XLS_NAME = 'startup.xls'
SHEET_NAME = 'STARTUP_15092014'
BUSINESS_TYPE = 'nat.giuridica'
REVENUE_CLASS = 'classe di valore della produzione ultimo anno (1)'
EMPLOYEE_CLASS = 'classe di addetti ultimo anno (2)'
CLASSES... |
import os, json, unittest, time, shutil, sys
sys.path.extend(['.','..','py'])
import h2o, h2o_cmd, h2o_hosts, h2o_glm
import h2o_browse as h2b
import h2o_import as h2i
import time, random
def infoFromSummary(self,summary):
columnsList = summary['columns']
for columns in columnsList:
N = columns['N']
... |
#!/usr/bin/env python
# encoding: utf-8
# The MIT License (MIT)
# Copyright (c) 2017-2018 CNRS
# 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 limita... |
"""
Script to test writing GW Input for VASP.
Reads the POSCAR_name in the the current folder and outputs GW input to
subfolders name
"""
from __future__ import division
__author__ = "Michiel van Setten"
__copyright__ = " "
__version__ = "0.9"
__maintainer__ = "Michiel van Setten"
__email__ = "mjvansetten@gmail.com"
... |
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... |
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... |
# 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 agreed to in writing, ... |
# -*- coding: utf-8 -*-
#
# Copyright 2018-2019 Data61, CSIRO
#
# 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 applicabl... |
"""
Processes page revision dump data to return revisons for pages and the user who
created the revision.
Usage:
entity_page_views (-h|--help)
entity_page_views <input>... --revisions-output=<location>
[--debug]
[--verbose]
Options:
-h, --help ... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012, Cisco Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import time
import rospy
import math
from raspimouse_ros.msg import LightSensorValues
from sensor_msgs.msg import LaserScan
def range_to_led(range_value):
try:
distance = int(range_value[0]*1000) # distance[mm]
if distance < 4:
distance = ... |
# Copyright CERN, CH-1211 Geneva 23, 2004-2006, All rights reserved.
#
# Permission to use, copy, modify, and distribute this software for any
# purpose is hereby granted without fee, provided that this copyright and
# permissions notice appear in all copies and derivatives.
#
# This software is provided "as is" withou... |
# © 2019 Vauxoo (<http://www.vauxoo.com/>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Attachment Unindex Content",
"summary": "Disable indexing of attachments",
"version": "14.0.1.0.0",
"author": "Vauxoo, Odoo Community Association (OCA)",
"website": "https://g... |
import sys, re, os.path
from IPython import embed
from teafacto.util import argprun, tokenize, ticktock
from teafacto.blocks.memory import LinearGateMemAddr, DotMemAddr
from teafacto.blocks.match import MatchScore
from teafacto.blocks.lang.wordvec import Glove
from teafacto.blocks.basic import VectorEmbed
from teafacto... |
from sqlalchemy import select, and_, asc, desc, func
from flask import Blueprint, render_template, Response
from app import config
import json
import datetime
from datetime import timedelta
import collections
discord_charting = Blueprint(
'discord_charting',
__name__,
)
user_blacklist = [
1291322402391982... |
#import os
#import mygene
from ete3 import NCBITaxa
# NCBITaxa().update_taxonomy_database()
import pandas as pd
from pathlib import Path
#from pandas import ExcelWriter
from Datasnakes.Manager.utils.mana import ProjMana as ProjectManagement
import shutil
import pkg_resources
from Datasnakes.Manager import index
# TODO-... |
# -*- coding: utf-8 -*-
from ckan import model
from ckan.model import PackageRelationship, Session
import ckan.new_authz as new_authz
import ckan.logic as logic
from ckan.lib.helpers import json
from ckanext.harvest.harvesters import CKANHarvester
import utils
import logging
log = logging.getLogger(__name__)
class G... |
"""
<Program Name>
upload_assignment.py
<Started>
Jan, 2008
<Author>
sal@cs.washington.edu
Salikh Bagaveyev
<Purpose>
upload a file using POST to the server (for grading)
<Usage>
provide a file to upload as an argument:
python upload_assignment.py [classcode] [email] [filename]
Notes: server script... |
# -*- coding: utf-8 -*-
"""
Creates a new folder for running SeleniumBase scripts.
Usage:
seleniumbase mkdir [DIRECTORY] [OPTIONS]
OR sbase mkdir [DIRECTORY] [OPTIONS]
Example:
sbase mkdir ui_tests
Options:
-b / --basic (Only config files. No tests added.)
Output:
Creates a new folder for r... |
"""
Telegram API - Provides an iterable
Keeps an internal buffer of updates.
On next, get the next element from the buffer
When the buffer is empty, request more updates to the server.
Also keep track of the offset so we don't get duplicates from the API
"""
import requests
from time import slee... |
###########################################################
#
# Copyright (c) 2005, Southpaw Technology
# All Rights Reserved
#
# PROPRIETARY INFORMATION. This software is proprietary to
# Southpaw Technology, and is not to be reproduced, transmitted,
# or disclosed in any way without written permi... |
# -*- coding: utf-8 -*-
import sys
import os
import sphinx_readable_theme
from pyquickhelper.helpgen.default_conf import set_sphinx_variables
sys.path.insert(0, os.path.abspath(os.path.join(os.path.split(__file__)[0])))
set_sphinx_variables(__file__, "pymyinstall", "Xavier Dupré", 2019,
"readable... |
"""
A command to record system metrics (CUP, Memory, Disk usage). Run this as a
cron job to periodically caputes sysem resource usage. Requires psutil.
Usage:
manage.py system_metric <metric> [device|interface] [category]
Examples:
manage.py system_metric cpu -- Records total CPU usage as a percent
mana... |
import logging
import json
import os.path
from dateutil import relativedelta
from sqlalchemy import and_, not_
from typing import List
import requests
import datetime
from ckan import model
from requests.exceptions import ConnectionError
from requests.adapters import HTTPAdapter
from requests.packages.urllib3.util.r... |
from django.conf import settings
from django.core.cache import cache
from django.db import models
from django.utils.functional import lazy
from django.utils.translation import ugettext_lazy as _
class UserPermissions(models.Model):
"""
User Permissions
"""
user = models.OneToOneField(settings.AUTH_USE... |
# 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, software
# distributed unde... |
"""
awslimitchecker/tests/test_versioncheck.py
The latest version of this package is available at:
<https://github.com/jantman/awslimitchecker>
##############################################################################
Copyright 2015 Jason Antman <jason@jasonantman.com> <http://www.jasonantman.com>
This file... |
"""Provides a set of ingestors based on different file types."""
import logging
from ingestors.manager import Manager
from ingestors.result import Result # noqa
__version__ = '0.3.0'
logging.getLogger('chardet').setLevel(logging.INFO)
logging.getLogger('flanker').setLevel(logging.INFO)
logging.getLogger('PIL').setL... |
#!/usr/bin/env python
import os
import sys
import string
import curses
import platform
import common
class HexDiff(object):
ALL_SAME = 0
ALL_DIFF = 1
SOME_DIFF = 2
DEFAULT_DIFF_SIZE = 0x100
DEFAULT_BLOCK_SIZE = 16
COLORS = {
'red' : '31',
'green' : '32',
'blue' : '34',
}
def __init__(self, binwalk=N... |
#!/usr/bin/python
#
# Mailpile.py (C) Copyright 2011, Bjarni R. Einarsson <http://bre.klaki.net/>
#
# This program maintains and interacts with a high-performance local e-mail
# index. Goals:
#
# - Support GMail-like conversations, filters and searches
# - Sub-200ms search results on single core and single disk, f... |
import json
import logging
import operator
import os
import pickle
import threading
from collections import deque, namedtuple
from functools import reduce
from itertools import chain
from typing import Optional
import numpy as np
from django.conf import settings
from django.core.cache import cache
from django.utils.fu... |
# -*- coding: utf-8 -*-
##############################################################################
#
# Author: Guewen Baconnier
# Copyright 2013 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# pu... |
# -*- coding: utf-8 -*-
from flask import Blueprint, render_template
from flask.ext.login import login_required, current_user
# from flask.ext.login import login_user, login_required, logout_user, current_user
from seoul_serenity.client_committee.models import Client
from seoul_serenity.project.models import Project
f... |
import json
import logging
import sys
import time
import click
import util
from sdk.client import JobAPI
def print_job_log(log_entries):
for entry in log_entries:
logtype = entry['type']
line = '%s %s' % (time.ctime(entry['logTime']/1000).strip(), entry['message'])
if logtype == 'ERROR'... |
#!/usr/bin/env python3
"""
Functionality for accessing wireless network.
Automation of MitM Attack on WiFi Networks
Bachelor's Thesis UIFS FIT VUT
Martin Vondracek
2016
"""
import logging
import os
import re
import subprocess
from typing import Union
from .model import WirelessInterface, WirelessAccessPoint
from .wep... |
#!/usr/bin/python
ABOUT="""\
Mailpile.py a tool Copyright 2011, Bjarni R. Einarsson
for searching and <http://bre.klaki.net/>
organizing piles of e-mail
This program is free software: you can redistribute it and/or modify it under
the terms of the ... |
#!/usr/bin/python
#
# Copyright 2014 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... |
"""Zip Tool.
@see: Cake Build System (http://sourceforge.net/projects/cake-build)
@copyright: Copyright (c) 2010 Lewis Baker, Stuart McMahon.
@license: Licensed under the MIT license.
"""
from cake.library import Tool, getPath, getTask
from cake.engine import BuildError
import cake.filesys
import cake.zipping
import ... |
try:
from . import generic as g
except BaseException:
import generic as g
class IntegralMeanCurvatureTest(g.unittest.TestCase):
def test_IMCsphere(self):
# how close do we need to be - relative tolerance
tol = 1e-3
for radius in [0.1, 1.0, 3.1459, 29.20]:
m = g.trimesh... |
__version__ = "2.2.1"
|
import platform
import sys
import os
# The 'sysconfig' module is only available with Python 2.7 and newer, but
# an equivalent module in 'distutils' is available for Python 2.6.
if sys.version < '2.7':
from distutils import sysconfig
else:
import sysconfig
# The 'imp' module is deprecated since Python 3.4, and t... |
# -- coding: UTF-8 --
# Django settings for tf_arsfest project.
import os, sys
DEBUG = False
TEMPLATE_DEBUG = DEBUG
ADMINS = (
('Oskar Ehnström', 'oskar.ehnstrom@teknolog.fi'),
)
MANAGERS = ADMINS
PROJECT_PATH = os.path.realpath(os.path.dirname(__file__))
DATABASES = {
'default': {
'ENGINE': 'djan... |
'''
This defines the abstract syntax tree for sensitive expressions.
Note(JY): An interesting thing is that we no longer need to define polymorphism
in types explicitly. We might be able to have a much cleaner implementation than
the Scala one!
'''
from abc import ABCMeta, abstractmethod
'''
Abstract class for sensit... |
import hashlib
import re
import urlparse
from flask import g, request
from pyglot import Translator, GTranslatorError
from calloncongress.helpers import get_lang, slugify
from calloncongress import settings
translator = Translator(key=settings.GOOGLE_SERVICES_KEY)
def translate(s, **kwargs):
query = {
... |
from django.http import HttpResponse, HttpResponseBadRequest, HttpResponseNotAllowed, Http404, QueryDict
from django.db.models import DateField, DateTimeField, BooleanField
from django.db.models.fields.related import ForeignKey, ManyToManyField
from django.shortcuts import get_object_or_404, render
from django.urls imp... |
# 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... |
import base64
import webbrowser
from floo.common.handlers import floo_handler
from floo.common import msg, utils, shared as G
class AgentConnection(floo_handler.FlooHandler):
def __init__(self, owner, workspace, emacs_handler, get_bufs=True):
super(AgentConnection, self).__init__(owner, workspace, get_b... |
# -*- coding: utf-8 -*-
"""
Connected components and strongly connected components.
"""
__authors__ = """Eben Kennah (ekenah@t7.lanl.gov)\nAric Hagberg (hagberg@lanl.gov)"""
___revision__ = ""
# Copyright (C) 2004-2007 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <... |
# -*- coding: utf-8 -*-
##############################################################################
#
# Author: Guewen Baconnier
# Copyright 2013 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# pu... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.