code stringlengths 1 1.72M | language stringclasses 1
value |
|---|---|
import os
def startup():
os.system("brctl addbr br0")
os.system("brctl stp br0 off")
os.system("brctl addif br0 eth1")
os.system("brctl addif br0 eth2")
os.system("ifconfig eth1 down")
os.system("ifconfig eth2 down")
os.system("ifconfig eth1 0.0.0.0 up")
os.system("ifconfig eth2 0.0.0.0 up")
os.system("ifconf... | Python |
import os
def startup():
_cmd("iptables -F")
_cmd("iptables -t nat -F")
_cmd("iptables -t nat -N CATEGORIES")
_cmd("iptables -t nat -N BLOCKED_ACTIONS")
_cmd("iptables -t nat -A PREROUTING -p TCP --dport 80 -j CATEGORIES")
_cmd("iptables -t nat -A PREROUTING -p TCP --dport 443 -j CATEGORIES")
... | Python |
import commands, os
import cherrypy
from genshi.core import Stream
from genshi.output import encode, get_serializer
from genshi.template import Context, TemplateLoader
loader = TemplateLoader(
os.path.join(os.path.dirname(__file__), '..', 'templates'),
auto_reload=True
)
def theme(filename, method='xhtml', e... | Python |
import adns, time
_dbg = False # Enable/disable debugging messages.
easyadns_sleep = 2 # Seconds to sleep when no queries are completed
def lookup(namelist):
"""
Takes a list of domain names (items starting with a # will be ignored) and
returns a set of IPs.
"""
resolver = adns.init()
dat... | Python |
import cherrypy
import model
from allowlist import AllowList
from denylist import DenyList
from firewalladmin.lib import template, http, iptables
class FirewallAdmin:
""" Put List Controllers in their own files/modules/classes """
allowlist = AllowList()
denylist = DenyList()
@cherrypy.expos... | Python |
#!/usr/bin/python
import cherrypy
import firewalladmin.auth
from firewalladmin.controller import FirewallAdmin
if __name__ == "__main__":
cherrypy.quickstart(FirewallAdmin(), '/', 'firewalladmin.config') | Python |
#!/usr/bin/python
import cherrypy
import firewalladmin.auth
from firewalladmin.controller import FirewallAdmin
if __name__ == "__main__":
cherrypy.quickstart(FirewallAdmin(), '/', 'firewalladmin.config') | Python |
#!/usr/bin/python
from firewalladmin import model
from firewalladmin.lib import iptables, bridge
#bridge.startup()
iptables.startup()
for category in model.Blacklists.select():
iptables.create(category.category)
iptables.update(category.category, category.ips)
if not category.enabled:
iptables.toggle(category.ca... | Python |
#!/usr/bin/env python
from firewalladmin import model
model.create_database()
| Python |
# Django settings for mysite project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
#('griff', 'pochtolyon@gmail.com'),
)
MANAGERS = ADMINS
DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
DATABASE_NAME = 'django_app' # Or path to database file if using s... | Python |
import datetime
from django.db import models
class Poll(models.Model):
question = models.CharField(max_length=200)
pub_date = models.DateTimeField('date published')
def __unicode__(self):
return self.question
def was_published_today(self):
return self.pub_date.date() == datetime.date.today()
was_pu... | Python |
"""
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
from django.test import TestCase
class SimpleTest(TestCase):
def test_basic_addition(self):
"""
Tests that 1 + 1 a... | Python |
from django.conf.urls.defaults import patterns, include, url
from django.views.generic import DetailView, ListView
from polls.models import Poll
urlpatterns = patterns('',
(r'^$',
ListView.as_view(
queryset=Poll.objects.order_by('-pub_date')[:5],
context_object_name='latest_poll_lis... | Python |
from django.http import HttpResponse, HttpResponseRedirect
from django.template import Context, loader
from django.http import Http404
from django.shortcuts import render_to_response, get_object_or_404
from django.template import RequestContext
from django.core.urlresolvers import reverse
from polls.models import Poll,... | Python |
from polls.models import Poll
from django.contrib import admin
from polls.models import Choice
class ChoiceInline(admin.TabularInline):
model = Choice
extra = 3
class PollAdmin(admin.ModelAdmin):
fieldsets = [
(None, {'fields':['question']}),
('Date information',{'fields':['pub_date'], 'c... | Python |
from django.conf.urls.defaults import patterns, include, url
from django.contrib import admin
admin.autodiscover()
admin.autodiscover()
urlpatterns = patterns('',
(r'^polls/', include('polls.urls')),
url(r'^admin/', include(admin.site.urls)),
)
| Python |
#!/usr/bin/env python
from django.core.management import execute_manager
try:
import settings # Assumed to be in the same directory.
except ImportError:
import sys
sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to ... | Python |
from django.db import models
class Publisher (models.Model):
name = models.CharField(max_length=30)
address = models.CharField(max_length=50)
city = models.CharField(max_length=60)
state_province = models.CharField(max_length=30)
country = models.CharField(max_length=50)
website = models.URLFie... | Python |
"""
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
from django.test import TestCase
class SimpleTest(TestCase):
def test_basic_addition(self):
"""
Tests that 1 + 1 a... | Python |
# Create your views here.
| Python |
from django.contrib import admin
from models import Publisher, Author, Book
class AuthorAdmin (admin.ModelAdmin):
list_display = ("first_name", "last_name", "email")
search_fields = ("first_name", "last_name")
class BookAdmin (admin.ModelAdmin):
list_display = ("title", "publisher", "publication_date")
... | Python |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "firstdjango.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| Python |
# Django settings for firstdjango project.
from os.path import join as pjoin, dirname
DEBUG = True
TEMPLATE_DEBUG = DEBUG
BASE_DIR = dirname(dirname(__file__)) # hax hax hax
ADMINS = (
('Steve Foley', 'sfoley1988@gmail.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.back... | Python |
from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
from firstdjango.views import root, hello, current_datetime, hours_ahead, authors
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'firstdjango.views.home', name='home'),
# url(r'^firstdjango/', i... | Python |
"""
WSGI config for firstdjango project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATIO... | Python |
from django.shortcuts import render_to_response
from django.http import HttpResponse, Http404
import datetime
from books.models import Author
def root (request):
uri_paths = [
(r"/admin/",) * 2,
(r"/hello/",) * 2,
(r"/time/",) * 2,
(r"/time/plus/(\d{1,3})/", "/time/plus/2/"),
... | Python |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "firstdjango.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| Python |
#!/usr/bin/python
#
# Copyright (C) 2012 Google 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 required by applicable law ... | Python |
#!/usr/bin/python
#
# Copyright (C) 2012 Google 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 required by applicable law ... | Python |
#!/usr/bin/env python
#
# Copyright (c) 2002, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this ... | Python |
#!/usr/bin/env python
# Copyright (c) 2010, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this l... | Python |
# Copyright (C) 2010 Google 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 required by applicable law or agreed to in writ... | Python |
#!/usr/bin/python2.4
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011 Google 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 ... | Python |
# Copyright 2011 Google Inc. All Rights Reserved.
"""Locked file interface that should work on Unix and Windows pythons.
This module first tries to use fcntl locking to ensure serialized access
to a file, then falls back on a lock file if that is unavialable.
Usage:
f = LockedFile('filename', 'r+b', 'rb')
f.... | Python |
# Copyright 2011 Google Inc. All Rights Reserved.
"""Multi-credential file store with lock support.
This module implements a JSON credential store where multiple
credentials can be stored in one file. That file supports locking
both in a single process and across processes.
The credential themselves are keyed off o... | Python |
# Copyright (C) 2010 Google 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 required by applicable law or agreed to in writ... | Python |
# Copyright (C) 2010 Google 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 required by applicable law or agreed to in writ... | Python |
# Copyright (C) 2010 Google 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 required by applicable law or agreed to in writ... | Python |
# Copyright (C) 2011 Google 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 required by applicable law or agreed to in writ... | Python |
# Copyright (C) 2010 Google 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 required by applicable law or agreed to in writ... | Python |
__version__ = "1.0c2"
| Python |
# Copyright (C) 2010 Google 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 required by applicable law or agreed to in writ... | Python |
# Copyright (C) 2012 Google 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 required by applicable law or agreed to in writ... | Python |
# Copyright (C) 2007 Joe Gregorio
#
# Licensed under the MIT License
"""MIME-Type Parser
This module provides basic functions for handling mime-types. It can handle
matching mime-types against a list of media-ranges. See section 14.1 of the
HTTP specification [RFC 2616] for a complete explanation.
http://www.w3.o... | Python |
# Copyright (C) 2010 Google 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 required by applicable law or agreed to in writ... | Python |
# Copyright (C) 2010 Google 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 required by applicable law or agreed to in writ... | Python |
# Copyright (C) 2010 Google 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 required by applicable law or agreed to in writ... | Python |
# Copyright (C) 2010 Google 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 required by applicable law or agreed to in writ... | Python |
# Copyright (C) 2010 Google 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 required by applicable law or agreed to in writ... | Python |
# Copyright (C) 2010 Google 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 required by applicable law or agreed to in writ... | Python |
# Copyright (C) 2010 Google 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 required by applicable law or agreed to in writ... | Python |
# Copyright (C) 2010 Google 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 required by applicable law or agreed to in writ... | Python |
__version__ = "1.0c2"
| Python |
#!/usr/bin/python2.4
#
# Copyright (C) 2010 Google 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 required by applicable l... | Python |
#!/usr/bin/python2.4
#
# Copyright (C) 2010 Google 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 required by applicable l... | Python |
"""
iri2uri
Converts an IRI to a URI.
"""
__author__ = "Joe Gregorio (joe@bitworking.org)"
__copyright__ = "Copyright 2006, Joe Gregorio"
__contributors__ = []
__version__ = "1.0.0"
__license__ = "MIT"
__history__ = """
"""
import urlparse
# Convert an IRI to a URI following the rules in RFC 3987
#
# The characte... | Python |
from __future__ import generators
"""
httplib2
A caching http interface that supports ETags and gzip
to conserve bandwidth.
Requires Python 2.3 or later
Changelog:
2007-08-18, Rick: Modified so it's able to use a socks proxy if needed.
"""
__author__ = "Joe Gregorio (joe@bitworking.org)"
__copyright__ = "Copyright... | Python |
"""SocksiPy - Python SOCKS module.
Version 1.00
Copyright 2006 Dan-Haim. 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
... | Python |
import Cookie
import datetime
import time
import email.utils
import calendar
import base64
import hashlib
import hmac
import re
import logging
# Ripped from the Tornado Framework's web.py
# http://github.com/facebook/tornado/commit/39ac6d169a36a54bb1f6b9bf1fdebb5c9da96e09
#
# Tornado is licensed under the Apache Licen... | Python |
# This is the version of this source code.
manual_verstr = "1.5"
auto_build_num = "211"
verstr = manual_verstr + "." + auto_build_num
try:
from pyutil.version_class import Version as pyutil_Version
__version__ = pyutil_Version(verstr)
except (ImportError, ValueError):
# Maybe there is no pyutil insta... | Python |
"""
The MIT License
Copyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel
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 ... | Python |
"""
The MIT License
Copyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel
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 ... | Python |
"""
The MIT License
Copyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel
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 ... | Python |
# Early, and incomplete implementation of -04.
#
import re
import urllib
RESERVED = ":/?#[]@!$&'()*+,;="
OPERATOR = "+./;?|!@"
EXPLODE = "*+"
MODIFIER = ":^"
TEMPLATE = re.compile(r"{(?P<operator>[\+\./;\?|!@])?(?P<varlist>[^}]+)}", re.UNICODE)
VAR = re.compile(r"^(?P<varname>[^=\+\*:\^]+)((?P<explode>[\+\*])|(?P<part... | Python |
#!/usr/bin/env python
from __future__ import division
import matplotlib
matplotlib.use("Agg")
import numpy as np
from pylab import *
# Read in exp. data for each test
fds = np.genfromtxt('FDS_Output_Files/heat_flux_devc.csv', delimiter=',', names=True, skip_header=1)
fig = figure()
plot(fds['Time'], fds['INERTNET'... | Python |
#!/usr/bin/env python
from __future__ import division
import matplotlib
matplotlib.use("Agg")
import numpy as np
from pylab import *
# Read in exp. data for each test
fds = np.genfromtxt('FDS_Output_Files/heat_flux_devc.csv', delimiter=',', names=True, skip_header=1)
fig = figure()
plot(fds['Time'], fds['INERTNET'... | Python |
#!/home/koverholt/anaconda/bin/python
# LICENSE
#
# Copyright (c) 2012 Kristopher Overholt
#
# 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 limitatio... | Python |
#!/home/koverholt/anaconda/bin/python
# LICENSE
#
# Copyright (c) 2012 Kristopher Overholt
#
# 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 limitatio... | Python |
#!/home/koverholt/anaconda/bin/python
# LICENSE
#
# Copyright (c) 2012 Kristopher Overholt
#
# 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 limitatio... | Python |
#!/home/koverholt/anaconda/bin/python
# LICENSE
#
# Copyright (c) 2012 Kristopher Overholt
#
# 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 limitatio... | Python |
#!/home/koverholt/anaconda/bin/python
# LICENSE
#
# Copyright (c) 2012 Kristopher Overholt
#
# 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 limitatio... | Python |
#!/home/koverholt/anaconda/bin/python
# LICENSE
#
# Copyright (c) 2012 Kristopher Overholt
#
# 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 limitatio... | Python |
#!/home/koverholt/anaconda/bin/python
# LICENSE
#
# Copyright (c) 2011 Kristopher Overholt
#
# 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 limitatio... | Python |
#!/home/koverholt/anaconda/bin/python
# LICENSE
#
# Copyright (c) 2011 Kristopher Overholt
#
# 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 limitatio... | Python |
#!/home/koverholt/anaconda/bin/python
# LICENSE
#
# Copyright (c) 2011 Kristopher Overholt
#
# 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 limitatio... | Python |
#!/home/koverholt/anaconda/bin/python
# LICENSE
#
# Copyright (c) 2011 Kristopher Overholt
#
# 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 limitatio... | Python |
#!/home/koverholt/anaconda/bin/python
# LICENSE
#
# Copyright (c) 2011 Kristopher Overholt
#
# 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 limitatio... | Python |
#!/home/koverholt/anaconda/bin/python
# LICENSE
#
# Copyright (c) 2011 Kristopher Overholt
#
# 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 limitatio... | Python |
#!/home/koverholt/anaconda/bin/python
# LICENSE
#
# Copyright (c) 2011 Kristopher Overholt
#
# 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 limitatio... | Python |
#!/home/koverholt/anaconda/bin/python
# LICENSE
#
# Copyright (c) 2011 Kristopher Overholt
#
# 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 limitatio... | Python |
#!/home/koverholt/anaconda/bin/python
# LICENSE
#
# Copyright (c) 2012 Kristopher Overholt
#
# 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 limitatio... | Python |
#!/home/koverholt/anaconda/bin/python
# LICENSE
#
# Copyright (c) 2012 Kristopher Overholt
#
# 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 limitatio... | Python |
#!/home/koverholt/anaconda/bin/python
# LICENSE
#
# Copyright (c) 2012 Kristopher Overholt
#
# 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 limitatio... | Python |
#!/home/koverholt/anaconda/bin/python
# LICENSE
#
# Copyright (c) 2012 Kristopher Overholt
#
# 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 limitatio... | Python |
#!/home/koverholt/anaconda/bin/python
# LICENSE
#
# Copyright (c) 2012 Kristopher Overholt
#
# 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 limitatio... | Python |
#!/home/koverholt/anaconda/bin/python
# LICENSE
#
# Copyright (c) 2012 Kristopher Overholt
#
# 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 limitatio... | Python |
#!/usr/bin/env python
import os
os.chdir('Scripts/')
print 'Running cfast_monte_carlo ...'
os.system('python cfast_monte_carlo.py')
print 'Running generate_figures ...'
os.system('python generate_figures.py')
| Python |
#!/usr/bin/env python
import os
os.chdir('Scripts/')
print 'Running cfast_monte_carlo ...'
os.system('python cfast_monte_carlo.py')
print 'Running generate_figures ...'
os.system('python generate_figures.py')
| Python |
#!/usr/bin/env python
"""Module for CFAST functions"""
import numpy as np
import platform
import subprocess
# Detect operating system
op_sys = platform.system()
def gen_input(x, y, z, tmp_a, hoc, time_ramp, hrr_ramp, wall,
simulation_time, dt_data):
"""
Generate CFAST input file and initializ... | Python |
#!/usr/bin/env python
"""
Run CFAST Monte Carlo Simulation
Case 1: Only model bias/uncertainty
Case 2: Only input uncertainty
Case 3: Combined model bias/uncertainty and input uncertainty
"""
import matplotlib
matplotlib.use("Agg")
from pylab import *
import numpy as np
import scipy as sp
from scipy import stats
n... | Python |
#!/usr/bin/env python
"""
Run CFAST Monte Carlo Simulation
Case 1: Only model bias/uncertainty
Case 2: Only input uncertainty
Case 3: Combined model bias/uncertainty and input uncertainty
"""
import numpy as np
import external_cfast
# =====================
# = BEGIN USER INPUTS =
# =====================
# ====... | Python |
#!/usr/bin/env python
"""Module for CFAST functions"""
import numpy as np
import platform
import subprocess
# Detect operating system
op_sys = platform.system()
def gen_input(x, y, z, tmp_a, hoc, time_ramp, hrr_ramp, wall,
simulation_time, dt_data):
"""
Generate CFAST input file and initializ... | Python |
#!/usr/bin/env python
"""
Run CFAST Monte Carlo Simulation
Case 1: Only model bias/uncertainty
Case 2: Only input uncertainty
Case 3: Combined model bias/uncertainty and input uncertainty
"""
import matplotlib
matplotlib.use("Agg")
from pylab import *
import numpy as np
import scipy as sp
from scipy import stats
n... | Python |
#!/usr/bin/env python
"""
Run CFAST Monte Carlo Simulation
Case 1: Only model bias/uncertainty
Case 2: Only input uncertainty
Case 3: Combined model bias/uncertainty and input uncertainty
"""
import numpy as np
import external_cfast
# =====================
# = BEGIN USER INPUTS =
# =====================
# ====... | Python |
#!/usr/bin/python
import os
import nltk
import sys
import string
#from nltk.corpus import gutenberg, genesis, inaugural,\
# nps_chat, webtext, treebank, wordnet
#from nltk.text import Text
from nltk.probability import FreqDist
#from nltk.util import bigrams
from nltk.corpus import stopwords
from nltk.corpus i... | Python |
#!/usr/bin/python
import os
import nltk
import sys
import string
#from nltk.corpus import gutenberg, genesis, inaugural,\
# nps_chat, webtext, treebank, wordnet
#from nltk.text import Text
from nltk.probability import FreqDist
#from nltk.util import bigrams
from nltk.corpus import stopwords
from nltk.corpus i... | Python |
#Project moved to github, February 2013 -
https://github.com/malcprentice/Text-Tools | Python |
#Prueba Threads
import thread
import time
def Leer():
while 1:
Archivo = open("PhpToPython.txt")
Lineas = Archivo.readlines();
for Palabra in Lineas:
Pal = Palabra.split('-')
if Pal[0] == "ON":
print "Encendida la salida" + Pal[1] + "\n"
if Pal[0] == "OFF":
print "Apagada la salida" + Pal[1] + ... | Python |
import sqlite3
import sys
import os
from datetime import datetime
| Python |
class Script:
def __init__(self)
def Ejecutar():
| Python |
Subsets and Splits
SQL Console for ajibawa-2023/Python-Code-Large
Provides a useful breakdown of language distribution in the training data, showing which languages have the most samples and helping identify potential imbalances across different language groups.