src
stringlengths
721
1.04M
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
#_PYTHON_INSERT_SAO_COPYRIGHT_HERE_(2007)_ #_PYTHON_INSERT_GPL_LICENSE_HERE_ import numpy _ = numpy.seterr(invalid='ignore') from sherpa.utils import NoNewAttributesAfterInit, print_fields, Knuth_close, is_iterable, list_to_open_interval, mysgn, quad_coef, apache_muller, bisection, demuller, zeroin, OutOfBoundErr, fun...
# Copyright 2013 IBM Corp. # # 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 w...
#!user/bin/env python # -*- coding: utf8 -*- ''' Created on Jul 11, 2012 @author: joseph ''' import urllib,urllib2 import mimetypes def uploadfile(fields, files): BOUNDARY = '----------267402204411258' CRLF = '\r\n' L = [] for (key, value) in fields: L.append('--' + BOUNDARY) L.appen...
#!/usr/bin/env python3 # csx.py - Extended Cascading Stylesheets. # Copyright (C) 2009 Zero Piraeus # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at y...
# -*- coding: utf-8 -*- # # This file is part of Inspirehep. # Copyright (C) 2016 CERN. # # Inspirehep 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...
''' Use Case: Exploring the Concept of Serializing and De-Serializing in Python Shortly called as pickling, the needs is to store the object and later resurrect it ----> Use dump for serializing the records into a file ----> Use dumps for serializing the records into a string ---->...
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from __future__ import division from __future__ import absolute_import from telemetry.internal.image_processing import _bitmap def Channels(bitmap): ret...
import unittest from zope.testing.cleanup import cleanUp class SolrSchemaTests(unittest.TestCase): def setUp(self): cleanUp() def tearDown(self): cleanUp() def _getTargetClass(self): from alm.solrindex.schema import SolrSchema return SolrSchema def _makeOne(self, s...
import re import os import sys import flask import base64 import torchvision.transforms as transforms from io import BytesIO from PIL import Image # Append pix2pix filepath to app.py module_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'pix2pix') if module_path not in sys.path: sys.path.append(m...
# # 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 # ...
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2002-2007 Donald N. Allingham # # 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 you...
#!/usr/bin/env python #Note its this is both python2.7 and 3 compatible (other versions may work) #Copyright (c) 2015, Robert Farmer rjfarmer@asu.edu #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 Foundatio...
#!/usr/bin/env python3 # THIS FILE IS PART OF THE CYLC SUITE ENGINE. # Copyright (C) 2008-2019 NIWA & British Crown (Met Office) & Contributors. # # 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...
""" Tokeniser for a checklist DSL. (I was using Ply, but it sucked and this is a *lot* simpler.) (c) 2012 Nicholas H.Tollervey """ import re class Token(object): """ Represents a token matched by the lexer. """ def __init__(self, token, value, roles=None, size=None): """ token - the t...
""" Tests for face.processing module """ import numpy as np import face.processing def test_scale_image_keeping_aspect_ratio_vertial_image(): image = np.zeros(shape=[10, 20]) target_size = 30 # Vertical dimension smaller rescaled_image = face.processing.scale_image_keeping_aspect_ratio(image, targ...
#!/usr/bin/env python # coding: utf-8 from __future__ import ( print_function, unicode_literals, absolute_import ) import argparse import json import os def get_path(): return unicode(os.path.abspath('.')) def parse_args(): _parser = argparse.ArgumentParser() _parser.add_argument('--fixtur...
import unittest import datetime import pandas as pd from simple_ranker import Ranker class RankerTest(unittest.TestCase): def setUp(self): self.current_year = datetime.datetime.now().year def test_rank_by_PE_returns_lowest_first(self): pe_rank = { 'name': 'pe', 'asce...
import requests from rest_framework import renderers, status from rest_framework.authentication import SessionAuthentication, BasicAuthentication from rest_framework.permissions import IsAuthenticated from rest_framework.views import APIView from rest_framework.response import Response from restaurant.models import R...
# # @BEGIN LICENSE # # Psi4: an open-source quantum chemistry software package # # Copyright (c) 2007-2018 The Psi4 Developers. # # The copyrights for code used from other parties are included in # the corresponding files. # # This file is part of Psi4. # # Psi4 is free software; you can redistribute it and/or modify #...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 NovaPoint Group LLC (<http://www.novapointgroup.com>) # Copyright (C) 2004-2010 OpenERP SA (<http://www.openerp.com>) # # This program is f...
#!/usr/local/bin/python3 import math import numpy as np # get prime factors unduplicatedly, optimized def getPrimes( num ): pset = set() if 0 == num % 2: pset.add(2) for i in range(3, num+1, 2): if 0 == num % i: isprime = True for j in range(3, int(math.sqrt(i))+1, ...
# -*- coding: utf-8 -*- # # wyoming documentation build configuration file, created by # sphinx-quickstart on Mon Jan 25 11:12:20 2016. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # A...
#!/usr/bin/env python3 import os import sys import numpy as np from .tagcode import tagcode_to_unicode def samples_from_gnt(f): header_size = 10 # read samples from f until no bytes remaining while True: header = np.fromfile(f, dtype='uint8', count=header_size) if not header.size: break...
# standard libraries import functools import logging import pathlib import typing import uuid import weakref # local libraries from nion.swift.model import Changes from nion.swift.model import Connection from nion.swift.model import DataGroup from nion.swift.model import Symbolic from nion.swift.model import DataItem ...
''' Copyright 2012 Iwan Gabovitch and Jana Wendler This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This...
# Copyright (C) 2004-2016 by # Aric Hagberg <hagberg@lanl.gov> # Dan Schult <dschult@colgate.edu> # Pieter Swart <swart@lanl.gov> # All rights reserved. # BSD license. """ Generators for some classic graphs. The typical graph generator is called as follows: >>> G=nx.complete_graph(100) returning th...
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
''' Copyright (C) 2011 aodbm authors, This file is part of aodbm. aodbm is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your optio...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # This file is part of utext # # Copyright (C) 2012-2016 Lorenzo Carbonell # lorenzo.carbonell.cerezo@gmail.com # # 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 Soft...
#!/usr/bin/python # -*- coding: utf-8 -*- from lib.meos import MEoS from lib import unidades class Benzene(MEoS): """Multiparameter equation of state for benzene""" name = "benzene" CASNumber = "71-43-2" formula = "C6H6" synonym = "" rhoc = unidades.Density(304.79239968) Tc = unidades.Tem...
import subprocess import os import itertools import textwrap import pathlib2 as pathlib import pytest import temporary from .. import test # Compile some bashup and run it against multiple versions of bash. The versions are expected to be found in # $BASH_VERSIONS_DIR. If none are found, or the environment variable...
# -*- coding: utf-8 -*- import wx from outwiker.gui.baseaction import BaseAction from outwiker.core.commands import testreadonly, showError class MovePageUpAction (BaseAction): """ Переместить страницу на одну позицию вверх """ stringId = u"MovePageUp" def __init__(self, application): s...
# -*- coding: utf-8 -*- import requests import json from bs4 import BeautifulSoup import time class CaptchaHelper: def __init__(self): self.headers = { 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari...
from direct.distributed import DistributedObjectAI from direct.directnotify import DirectNotifyGlobal from toontown.toonbase import ToontownGlobals from pandac.PandaModules import * import DistributedPhysicsWorldAI from direct.fsm.FSM import FSM from toontown.ai.ToonBarrier import * from toontown.golf import GolfGlobal...
# This file is part of reddit_api. # # reddit_api 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. # # reddit_api is distributed in the ...
from __future__ import print_function, absolute_import, division import sys import argparse from .. import __version__ from . import dmutinf from . import dtent def main(): help = ('MDEntropy is a python library that allows users to perform ' 'information-theoretic analyses on molecular dynamics (MD...
#!/usr/bin/env python import logging import pandas as pd from libCommon import INI_BASE, INI_WRITE, INI_READ from libNASDAQ import NASDAQ from libBackground import EXTRACT_TICKER from libFinance import TRANSFORM_BACKGROUND from libDecorators import singleton, exit_on_exception, log_on_exception from libDebug import t...
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
#!/usr/bin/env python2.7 # -*- mode: python; coding: utf-8; -*- """Module for generating lexicon using Velikovich's method (2010). """ ################################################################## # Imports from __future__ import unicode_literals, print_function from collections import Counter from copy import...
import numpy as np from quadtree import Quadtree from grslicer.util.np import get_aabb, to_ndarray, euclidean_dist_square, closest_point_on_edge POINT_AABB = to_ndarray([[-10, -10], [10, 10]]) def follow(paths, get_start_func, closed=True): """ Iterate through paths as they follow by closeness. Yields the ...
from rest_framework import serializers class MessageSerializer(serializers.Serializer): sender = serializers.CharField(max_length=32) recipient = serializers.CharField(max_length=32) urgency = serializers.IntegerField() content = serializers.CharField(max_length=256) timestamp = serializers.Intege...
# Copyright (C) 2011 Nippon Telegraph and Telephone Corporation. # # 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 appli...
# -*- coding: utf-8 -*- # This module contains all the osid_error exception classes and can be # used by any python implementations that need to throw an osid error """ Errors are specified in each method specification. Only the specified errors are permitted as error conditions in OSID method contracts with exceptio...
# Copyright 2014 Open vStorage NV # # 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...
from whoosh.index import create_in # from xbmcswift2 import Plugin from kodiswift import Plugin import os import sys import re import json import xbmc import xbmcaddon import xbmcplugin import xbmcgui import threading import glob import shlex from BeautifulSoup import BeautifulSoup as BS from whoosh.filedb.filestore im...
#Stage 2 Update (Python 3) from __future__ import unicode_literals from django.utils.encoding import python_2_unicode_compatible from builtins import range from builtins import str from builtins import object import datetime from django.db import models from django.db.models import Q @python_2_unicode_compatible clas...
def count_neighbours( grid , row , col ) : left = max( 0 , row - 1 ) right = min( row + 2 , len( grid ) ) top = max( 0 , col - 1 ) bottom = min( col + 2 , len( grid[0] ) ) return sum( grid[i][j] for i in range( left , right ) for j in range( top , bottom ) if i != row or j != col ) if __...
# -*- coding: utf-8 -*- from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('core', '0005_auto_20161004_1431'), ] operations = [ migrations.AlterField( model_name='submitformfield', name='choices', field=...
# -*- coding: utf-8 -*- """ This is the common settings file, intended to set sane defaults. If you have a piece of configuration that's dependent on a set of feature flags being set, then create a function that returns the calculated value based on the value of FEATURES[...]. Modules that extend this one can change th...
# Copyright 2013 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
"""Data structures in Foam-Files that can't be directly represented by Python-Structures""" from __future__ import division from copy import deepcopy from collections import OrderedDict import math import re # import FoamFileGenerator in the end to avoid circular dependencies from PyFoam.ThirdParty.six import integ...
""" Make a "broken" horizontal bar plot, i.e., one with gaps """ import csv import matplotlib.pyplot as plt import sys if len(sys.argv) != 2: print("Missing data file\nUsage: makeTimeline.py [datafile.csv]") quit() else: filename = sys.argv[1] # Say, "the default sans-serif font is ..." plt.rcParams['font...
import pandas as pd from sklearn.preprocessing import label_binarize from sklearn.ensemble import RandomForestRegressor, RandomForestClassifier from sklearn.metrics import r2_score, roc_auc_score from learn import utils class Regression(): def __init__(self, time_to_compute=None): self.time_to_compute = t...
#!/usr/bin/env python3 """ Módulo repl: Interfaz de usuario en modo consola (vista). Proyecto de ejemplo - Paradigmas de la Programación Autor: Carlos Zayas (czayas en gmail) """ import sys from traceback import format_exc from collections.abc import Iterable try: # El módulo readline agrega autocompletado e histo...
import os from websocket import create_connection import requests import time wio_link_server = "wss://cn.iot.seeed.cc/v1/node/event" wio_link_key = "efe19ae9752add26d614d87cacd97f45" ws = create_connection(wio_link_server) ws.send(wio_link_key) print "link to pion one sensor." requests.post("https://cn.iot.seeed.cc/...
class Node() : def __init__(self, data): self.data = data self.next = None class LinkedList() : def __init__(self): self.head = None self.tail = None self.ll_length = 0 def appendNode(self, data): new_node = Node(data) self.ll_length += 1 ...
# coding:utf-8 # # Author: BONFY<foreverbonfy@163.com> # Github: https://github.com/bonfy # Repo: https://github.com/bonfy/leetcode # Usage: Leetcode solution downloader and auto generate readme # import requests import configparser import os import json import time import datetime import re import sys import html...
# Copyright (c) 2014, Fundacion Dr. Manuel Sadosky # 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 condit...
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup with open('README.rst') as readme_file: readme = readme_file.read() with open('HISTORY.rst') as history_file: history = history_file.read() requirements = [ # TODO: put package requirements here ] test_requirements = [ # TOD...
import os # Django settings for testproject project. PROJECT_PATH = os.path.abspath(os.path.dirname(__file__)) DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2'...
from django.contrib import admin from models import * class UserResumeEducationInline(admin.StackedInline): model = UserResumeEducation extra = 1 class UserResumeLanguageInline(admin.StackedInline): model = UserResumeLanguage extra = 1 class UserResumeInterestInline(admin.StackedInline): model ...
""" Utilities for the spatial dynamics module. """ __all__ = ['shuffle_matrix', 'get_lower'] import numpy as np def shuffle_matrix(X, ids): """ Random permutation of rows and columns of a matrix Parameters ---------- X : array (k, k), array to be permutated. ids : array ...
# A Linux-only demo, using verify() instead of hard-coding the exact layouts # import sys from cffi import FFI if not sys.platform.startswith('linux'): raise Exception("Linux-only demo") ffi = FFI() ffi.cdef(""" typedef ... DIR; struct dirent { unsigned char d_type; /* type of file; not s...
#!/usr/bin/env python # # Copyright 2007 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 o...
""" This module contains the algorithm for optimizing the costs of energy systems. """ from datetime import datetime from scipy.optimize import fmin_l_bfgs_b import calendar import cProfile import copy from collections import namedtuple import numpy as np from numpy import array from server.devices.base import BaseEn...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2009 Mozilla Corporation, Zuza Software Foundation # # This file is part of Pootle. # # Pootle 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...
# Copyright 2018 The TensorFlow 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 applica...
# Tai Sakuma <tai.sakuma@gmail.com> ##__________________________________________________________________|| import numpy as np import copy ##__________________________________________________________________|| class Scan: def __init__(self, val=None, weight=1, contents=None): if contents is not None: ...
#!/bin/env python3 # https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.least_squares.html """Solve a curve fitting problem using robust loss function to take care of outliers in the data. Define the model function as y = a + b * exp(c * t), where t is a predictor variable, y is an observation and a,...
''' Created on Nov 1, 2013 @summary: this file mostly contains some auxiliary checks for the command line interface to make sure it's handed correct file types @author: holtjma ''' import argparse as ap import glob import os #I see no need for the versions to be different as of now DESC = "A multi-string BWT package ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2015-2015: Alignak team, see AUTHORS.txt file for contributors # # This file is part of Alignak. # # Alignak 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 So...
# This file is part of OtfBot. # # OtfBot is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # OtfBot is distributed in the hope that it...
#!/usr/bin/env python import numpy as np import sys, random, math, pygame from pygame.locals import * from math import sqrt,cos,sin,atan2 # constants DIM, DIM_X, DIM_Y = 2, 640, 480 # range 0 to 640, and 0 to 480 WINSIZE = [DIM_X, DIM_Y] # could be any range for each var # parameters NUMNODES = 2000 D...
# Copyright 2009-2011 Canonical Ltd. This software is licensed under the # GNU Affero General Public License version 3 (see the file LICENSE). """Tests for the safe branch open code.""" __metaclass__ = type from bzrlib.branch import ( Branch, BranchReferenceFormat, BzrBranchFormat7, ) from bzrlib.b...
#!/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...
from testutils import Qit, init init() from qit import Mapping, Range, Enumerate, Sequence, Function, Int class hdict(dict): def __hash__(self): return hash(tuple(sorted(self.items()))) def test_mapping_int_int(): ctx = Qit() r = Range(2) m = Mapping(r, r) result = ctx.run(m.iterate()) ...
# -*- coding: utf-8 -*- # # (DC)² - DataCenter Deployment Control # Copyright (C) 2010, 2011, 2012, 2013, 2014 Stephan Adig <sh@sourcecode.de> # 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; eit...
#!/usr/bin/env python import os from os import path import execjs import io node_modules = path.abspath("node_modules") if "NODE_PATH" not in os.environ: os.environ["NODE_PATH"] = node_modules elif node_modules not in os.environ["NODE_PATH"]: os.pathsep.join((os.environ["NODE_PATH"], node_modules)) class Stylus...
__author__ = 'sathley' from .utilities import http, urlfactory from .utilities import customjson import logging logger = logging.getLogger(__name__) logger.addHandler(logging.NullHandler()) class AppacitiveEmail(object): def __init__(self): pass @staticmethod def send_raw_email(to, subject, bod...
import os import inspect import numpy as np from scipy.sparse import coo_matrix from composites.laminate import read_stack from structsolve import solve from meshless.espim.read_mesh import read_mesh from meshless.espim.plate2d_calc_k0 import calc_k0 from meshless.espim.plate2d_add_k0s import add_k0s THISDIR = os.pa...
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class PpopenApplFdmAt(MakefilePackage): """ppOpen-APPL/FDM with Auto-Tuning""" homepage = "...
#!/usr/bin/env python3 # Copyright (c) 2009, Giampaolo Rodola'. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Show detailed memory usage about all (querable) processes. Processes are sorted by their "USS" (Unique Set Size) memory, which...
'''Provides namespace functionality for Kivy objects. It allows kivy objects to be named and then accessed using the namespace. :class:`KNSpace` instances are the namespaces that store the named objects. Classes need to inherit from :class:`KNSpaceBehavior` so that the class, when named, will be stored in the namespac...
# -*- coding: utf-8 -*- """ Time-lapse with Rasberry Pi controlled camera Copyright (C) 2016-2017 Istvan Z. Kovacs 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...
#!/usr/bin/env python # Bolei added import pdb import torch import torchvision from torch.autograd import Variable as V from torchvision import transforms as trn import os import numpy import glob import shutil import codecs import time import sys os.environ['GLOG_minloglevel'] = '2' import caffe from caffe.proto im...
# -*- coding: utf-8 -*- """ Copyright (C) 2013-2018 Danilo Bargen Copyright (C) 2018 Stephan Helma 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...
# pylint: disable=C0103, C0301, missing-docstring from django.contrib.auth import views as auth_views from django.urls import path, re_path from . import forms, views urlpatterns = [ path('login/', auth_views.LoginView.as_view( template_name='accounts/login.html', authentication...
#!/usr/bin/env python import wx from wx import Config import blam from blamframe import * from multiprocessing import freeze_support class blamapp(wx.App): def OnInit(self): ## wxConfig *config = new wxConfig(wxT("Karnaugh Map Minimizer")); ## ## wxString lang; ## if ( config->Read(wxT("Language"), &lang) ) ##...
from flask import current_app from netaddr import IPNetwork, IPAddress from netaddr.core import AddrFormatError bl_website_ip = [] # array of tuples (network mask, port) def build_website_blacklist(logger): with open("config/blacklist_website_ip.txt") as f: for line in f: network_address = ...
# -*- coding: utf-8 -*- # # doctrine.urwid documentation build configuration file, created by # sphinx-quickstart on Thu Jun 11 19:35:12 2015. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. ...
#!/usr/bin/python """ checks to see if srvy.db exists in ../archive. If not it creates the db and appropriate table """ import sqlite3 from sqlite3 import Error def create_conection(db_file): try: conn = sqlite3.connect(db_file) print(sqlite3.version) except Error as e: print(e) fi...
#!/usr/bin/python from distutils.core import setup, Extension, Command from distutils.command.build import build from distutils.command.clean import clean from distutils.command.sdist import sdist from distutils.dir_util import remove_tree from distutils.util import get_platform from distutils.spawn import spawn from ...
#!/usr/bin/env python __license__ = """ Copyright 2011 Scott A. Dial <scott@scottdial.com> 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 requi...
# Copyright 2017 Speech Lab, EE Dept., IITM (Author: Srinivas Venkattaramanujam) from entry import Entry class EntryManager: __statuses__ = ['PENDING','DONE'] def __init__(self): self.entries=[] def add_entry(self,entry): # Problem: # add new entries to the existing list such that: # 1) the start and end ...
# -*- coding: utf-8 -*- # Simple Bot (SimpBot) # Copyright 2016-2017, Ismael Lugo (kwargs) import time import re from six import string_types from .envvars import ctrl from .envvars import networks from .bottools import text from .bottools import dummy from .bottools import irc global_name = text.randphras() simp = '(...
#!/usr/bin/python # -*- coding: utf-8 -*- """Tests for the CLI tools classes.""" import argparse import io import locale import sys import unittest from plaso.cli import tools from plaso.lib import errors from tests.cli import test_lib class CLIToolTest(test_lib.CLIToolTestCase): """Tests for the CLI tool base c...
# genaf dbmgr script will override both rhombus' and fatools' dbmgr import transaction, sys from rhombus.lib.utils import cout, cerr, cexit, get_dbhandler from rhombus.scripts import setup_settings, arg_parser from fatools.scripts.facmd import ( init_argparser as fatools_init_argparser, ...
# -*- coding: utf-8 -*- # tag: jedi from __future__ import absolute_import import unittest from textwrap import dedent from contextlib import contextmanager from tempfile import NamedTemporaryFile from ..ParseTreeTransforms import NormalizeTree, InterpretCompilerDirectives from .. import Main, Symtab, Visitor from ....
import shutil import logging import traceback import configparser import discord log = logging.getLogger(__name__) class PermissionsDefaults: perms_file = 'config/permissions.ini' CommandWhiteList = set() CommandBlackList = set() IgnoreNonVoice = set() GrantToRoles = set() UserList = set() ...