src
stringlengths
721
1.04M
# Copyright 2014 Hewlett-Packard Development Company, L.P. # # 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 requir...
class Edge(object): def __init__(self, source, target, data = None): self._source, self._target, self.data = source, target, data def __repr__(self): return "Edge<%s <-> %s>" % (repr(self.source), repr(self.target)) @property def source(self): return self._source @property de...
import numpy as np import theano as theano import theano.tensor as T from theano.gradient import grad_clip import time import operator # Theano implementation of a single-layer LSTM class LSTM: def __init__(self, word_dim, hidden_dim=128, bptt_truncate=-1): # Assign instance variables self.word_di...
#!/usr/bin/python """ 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...
# -*- coding: utf-8 -*- """ ====== HBV-96 ====== Lumped hydrological model. This is the HBV-96 implementation by Juan Chacon at IHE-Delft, NL. This code implements the HBV-96 version, as described in Lindstrom et al (1997) https://doi.org/10.1016/S0022-1694(97)00041-3 @author: Juan Carlos Chacon-Hurtado (jc.chaconh@...
from django.core.management.base import BaseCommand from django.contrib.contenttypes.models import ContentType class Command(BaseCommand): """ Correct the account_number of AcctTran records for the memberships for those that are wrongly assigned with the event's account_number. Usage: python manage.p...
import locale import argparse import os import sys from asciinema import __version__ import asciinema.config as config from asciinema.commands.auth import AuthCommand from asciinema.commands.record import RecordCommand from asciinema.commands.play import PlayCommand from asciinema.commands.cat import CatCommand from a...
from ds.vortex.core import baseNode from ds.vortex.core import plug as plugs class EqualToNode(baseNode.BaseNode): def __init__(self, name): """ :param name: str, the name of the node """ baseNode.BaseNode.__init__(self, name) def initialize(self): baseNode.BaseNode.in...
#!/usr/bin/python # -*- coding: utf-8 -*- ### # Copyright (2016-2017) Hewlett Packard Enterprise Development LP # # 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/licen...
import numpy as np import torch from pytorchrl.distributions.base import Distribution from pytorchrl.misc.tensor_utils import constant class DiagonalGaussian(Distribution): """ Instead of a distribution, rather a collection of distribution. """ def __init__(self, means, log_stds): """ ...
#!/usr/bin/env python # To test domain CPU affinity import os import sys import re import time import commands import math from xml.dom import minidom import libvirt from libvirt import libvirtError from src import sharedmod from utils import utils required_params = ('guestname', 'vcpu',) optional_params = {} def ...
# # 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 us...
#!/usr/bin/env python # -*- coding: utf-8 -*- try: from setuptools import setup, find_packages except ImportError: from distutils.core import setup with open('README.md') as readme_file: readme = readme_file.read() with open('HISTORY.rst') as history_file: history = history_file.read().replace('.. :...
#!/usr/bin/python import socket import sys import time import json node_list={} node_list['cz7644']={'ip':'172.16.164.80', 'port':7777} node_list['cz7645']={'ip':'172.16.164.81', 'port':7777} node_list['cz7646']={'ip':'172.16.164.82', 'port':7777} def send_message(node, message): sock = socket.socket(socket.AF_...
import collections from django import forms from django.core.exceptions import ValidationError from django.forms.utils import ErrorList from django.template.loader import render_to_string from django.utils.functional import cached_property from django.utils.html import format_html, format_html_join from django.utils.s...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import localflavor.us.models class Migration(migrations.Migration): dependencies = [ ('core', '0003_auto_20141130_1044'), ] operations = [ migrations.AlterModelOptions( n...
import os import sys #import time import signal import threading import atexit import queue _interval = 1.0 _times = {} _files = [] _running = False _queue = queue.Queue() _lock = threading.Lock() def _restart(path): _queue.put(True) prefix = 'monitor (pid=%d):' % os.getpid() print('%s Change detected to...
import threading import time from random import choice import socketserver from storage import codes, packet_size, store, time_sleep, time_smoke from utils import _print global smoke smoke = False global smoke_code class MyTCPServer(socketserver.ThreadingMixIn, socketserver.TCPServer): pass class MyTCPServerH...
#!/usr/bin/env python # THIS FILE IS PART OF THE CYLC SUITE ENGINE. # Copyright (C) 2008-2016 NIWA # # 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 you...
import gym import matplotlib.pyplot as plt import pandas as pd import numpy as np import pickle import tensorflow as tf import tf_util import argparse import tqdm def main(): parser = argparse.ArgumentParser() parser.add_argument('env', type=str) args = parser.parse_args() inputs, outputs, evaluations...
# Copyright 2015 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...
# Simple demo of reading each analog input from the ADS1x15 and printing it to # the screen. # Author: Tony DiCola # License: Public Domain import time import os # Import the ADS1x15 module. import Adafruit_ADS1x15 milli_time = lambda: int(round(time.time() * 1000)) # Create an ADS1115 ADC (16-bit) instance. #adc = Ad...
# -*- coding: utf-8 -*- from operator import attrgetter from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType from pyangbind.lib.yangtypes import RestrictedClassType from pyangbind.lib.yangtypes import TypedListType from pyangbind.lib.yangtypes import YANGBool from pyangbind.lib.yangtypes import YANGListTy...
''' Task Coach - Your friendly task manager Copyright (C) 2004-2010 Task Coach developers <developers@taskcoach.org> Task Coach 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 ...
""" This is a set of classes to perform fast (approximate) nearest neighbors searches over Hamming spaces. [1] M. Charikar. Similarity Estimation Techniques from Rounding Algorithms. ACM Symposium on Theory of Computing, 2002. """ __all__ = ["HammingANN", "HammingBrute", "HammingBallTree"] import numpy as np from...
"""Code to handle panels in the mongo database""" import datetime as dt import logging import math from copy import deepcopy import pymongo from bson import ObjectId from scout.build import build_panel from scout.exceptions import IntegrityError from scout.parse.panel import get_omim_panel_genes from scout.utils.date...
""" byceps.blueprints.admin.user_badge.forms ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :Copyright: 2006-2019 Jochen Kupperschmidt :License: Modified BSD, see LICENSE for details. """ import re from wtforms import BooleanField, SelectField, StringField, TextAreaField from wtforms.validators import InputRequired, Lengt...
import socket import json import time import multiprocessing as mp from c3os import utils from c3os import conf from c3os import db from c3os.api.type import APITYPE CONF = conf.CONF def start(): """ Start client service """ mp.Process(target=client).start() def client(): """ client main routine """ ...
# This file is part of MyPaint. # Copyright (C) 2013 by Andrew Chadwick <a.t.chadwick@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 Software Foundation; either version 2 of the License, or # (at your ...
""" Balanced Python client library. See ``README.md`` for usage advice. """ import os import re try: import setuptools except ImportError: import distutils.core setup = distutils.core.setup else: setup = setuptools.setup def _get_version(): path = os.path.join(PATH_TO_FILE, 'balanced', '__init...
# -*- coding: utf-8 -*- # # Bottle documentation build configuration file, created by # sphinx-quickstart on Thu Feb 18 18:09:50 2010. # # 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. # # All ...
# Copyright (c) 2014, Howard Hughes Medical Institute, 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 c...
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # Copyright 2019 Fortinet, Inc. # # 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 Lic...
# -*- coding: utf-8 -*- # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe.model.document import Document from datetime import datetime from frappe.utils import now from frappe import m...
""" Django settings for municipal_finance project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ TESTING = False # Build paths inside the project like this: os....
#!/usr/bin/env python2 # -*- coding: utf-8 -*- import pandas as pd import numpy as np import gc from sklearn.preprocessing import MinMaxScaler from sklearn import linear_model from func import toCategorical, solveNA, Dummies, solveCategorical, moreFeautures import os from IPython import get_ipython ipython = get_ipytho...
import agents as ag def HW2Agent() -> object: def program(percept): bump, status = percept if status == 'Dirty': action = 'Suck' else: lastBump, lastStatus, = program.oldPercepts[-1] lastAction = program.oldActions[-1] if bump == 'None': ...
# Licensed under a 3-clause BSD style license - see LICENSE.rst from __future__ import absolute_import, division, print_function import glob import re import numpy as np from scipy.interpolate import RegularGridInterpolator from scipy.interpolate import UnivariateSpline import healpy as hp from astropy.io import fits ...
import csv import shelve import sys csv.field_size_limit(sys.maxsize) artistmoods = shelve.open('../artistmoods') moods = set() for artist in artistmoods.iterkeys(): artistmood = artistmoods[artist] for mood in artistmood: moods.add(mood['name']) moods = list(moods) moods.sort() # Extended from the User cl...
import gzip try: from io import BytesIO as IO except: import StringIO as IO from flask import request class Compress(object): """ The Compress object allows your application to use Flask-Compress. When initialising a Compress object you may optionally provide your :class:`flask.Flask` applic...
from atomformat import Feed from django.core.urlresolvers import reverse from django.conf import settings from django.contrib.sites.models import Site from django.contrib.auth.models import User from django.contrib.contenttypes.models import ContentType from django.shortcuts import get_object_or_404 from microblog.mode...
import datetime from flask import Flask from flask import g from flask import redirect from flask import request from flask import session from flask import url_for, abort, render_template, flash from functools import wraps from hashlib import md5 from peewee import * # config - aside from our database, the rest is f...
""" The :mod:`stan.proc.proc_parse` module is the proc parser for SAS-like language. """ import re import pkgutil from stan.proc.proc_expr import RESERVED_KEYWORDS, PROC_ import stan.proc_functions as proc_func from stan.proc.proc_sql import proc_sql def proc_parse(cstr): """proc parse converts procedure stateme...
# This file is part of wger Workout Manager. # # wger Workout Manager is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # wger W...
#!/usr/bin/env python # File created on 23 Nov 2011 from __future__ import division __author__ = "Greg Caporaso" __copyright__ = "Copyright 2015, The PICRUSt Project" __credits__ = ["Greg Caporaso", "Morgan Langille", "Daniel McDonald"] __license__ = "GPL" __version__ = "1.1.0" __maintainer__ = "Greg Caporaso" __email...
#! usr/bin/env pyhton # -*- coding: utf-8-*- #1: 打开文件 f = open('/Users/Encore/Desktop/Python3.0/Python/io.txt', 'r') #2: 如果文件存在调用read方法 print f.read() # 3:最后一步是调用 close() 方法关闭文件。文件使用完毕后必须关闭,因为文件对象会占用操作系统的资源,并且操 作系统同一时间能打开的文件数量也是有限的: f.close() #如果文件不存在, open() 函数就会抛出一个 IOError 的错误,并且给出错误码和详细的信息告诉你文件不存在: #f = open...
# # This file is part of HEPData. # Copyright (C) 2021 CERN. # # HEPData 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. # # HEPData is...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.utils.timezone import model_utils.fields import taggit.managers class Migration(migrations.Migration): dependencies = [ ('profiles', '0004_auto_20150305_2200'), ('tags', '0002_a...
# -*- coding: utf-8 -*- from __future__ import print_function from __future__ import unicode_literals import os import sys import unittest import shutil import bots.inmessage as inmessage import bots.outmessage as outmessage import bots.botslib as botslib import bots.node as node import bots.botsinit as botsinit impor...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import wooey.models.mixins class Migration(migrations.Migration): dependencies = [ ('wooey', '0017_wooeyfile_generate_checksums'), ] operations = [ migrations.CreateModel( ...
from typing import Dict import cld2 from mediawords.util.log import create_logger from mediawords.util.perl import decode_object_from_bytes_if_needed # Min. text length for reliable language identification __RELIABLE_IDENTIFICATION_MIN_TEXT_LENGTH = 10 # Don't process strings longer than the following length __MAX_...
import json from django.views.generic.base import View from django.views.generic.detail import SingleObjectMixin from django.views.generic import (ListView, UpdateView, DeleteView, DetailView, CreateView) from django.core.urlresolvers import reverse_lazy, reverse from django.shortcuts...
# _*_ coding:utf-8 _*_ __author__ = 'YaoYong' __date__ = '2017/2/12 上午11:13' from django import forms from captcha.fields import CaptchaField from .models import UserProfile class LoginForm(forms.Form): username = forms.CharField(required=True) password = forms.CharField(required=True, min_length=5) class ...
import sqlite3 import logging DATABASE = '/Users/wcampbell/Library/Application Support/Skype/willcampbell_ha/main.db' unique_participants_sql = 'SELECT DISTINCT(participants) FROM Chats' messages_by_author_sql = 'SELECT from_dispname, body_xml FROM Messages where dialog_partner = ?' def most_common(t): word_coun...
"""Shared functions for the `doorstop.server` package.""" from doorstop import common from doorstop import settings log = common.logger(__name__) class StripPathMiddleware(object): # pylint: disable=R0903 """WSGI middleware that strips trailing slashes from all URLs.""" def __init__(self, app): s...
# -*- coding: utf-8 -*- """\ This is a python port of "Goose" orignialy licensed to Gravity.com under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. Python port was written by Xavier Grangier for Recrutae Gravity.co...
"""Raw representations of every data type in the AWS Budgets service. See Also: `AWS developer guide for Budgets <https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/>`_ This file is automatically generated, and should not be directly edited. """ from attr import attrib from attr import attrs from ...
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. import logging from django import http from pto.apps.dates.decorators import json_view from pto.apps.users.models import...
# Synchronized Lyrics: a Quod Libet plugin for showing synchronized lyrics. # Copyright (C) 2015 elfalem # 2016-17 Nick Boultbee # # 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...
# -*- coding: utf-8 -*- from __future__ import unicode_literals, absolute_import from django.test import TestCase from django.test import RequestFactory from django.template import RequestContext from fancypages.models import Container from fancypages.models.blocks import TwoColumnLayoutBlock from fancypages.test imp...
# -*- coding: utf-8 -*- from __future__ import division, absolute_import, unicode_literals from django.contrib import messages from django.utils.translation import ugettext_lazy, pgettext_lazy from djadmin2 import permissions from djadmin2.actions import BaseListAction class CustomPublishAction(BaseListAction): ...
# -*- Python -*- # # @file ishigami_uc.py # @brief Ishigami use case, probabilistic and functions models # # Copyright (C) 2017 Airbus-IMACS # # Written by Sofiane Haddad, haddad@imacs.polytechnique.fr # Nabil Rachdi, nabil.rachdi@airbus.com # # This progr...
import sys import warnings warnings.filterwarnings("ignore") import argparse import timeit from dejavu import Dejavu from dejavu.timer import Timer from dejavu.recognize import FileRecognizer parser = argparse.ArgumentParser() parser.add_argument("file", help="the file to recognize") parser.add_argument( "-...
from PyQt4.QtGui import * from PyQt4.QtCore import * from pymongo import MongoClient import json class RemoveDocPage(QSplitter): def __init__(self): super(RemoveDocPage,self).__init__() self.dbname='test' self.collname='' #self.toolbar=QToolBar() #self.toolbar.setIconSize(...
# # Coded by: Stefan Badelt <stef@tbi.univie.ac.at> # University of Vienna, Department of Theoretical Chemistry # # -*- Style -*- # Use double quotes or '#' for comments, such that single quotes are available # for uncommenting large parts during testing # # *) do not exceed 80 characters per line # # Python 3 ...
# -*- coding: utf-8 -*- import ddt import json import MySQLdb import unittest import test_data.sql import test_data.db import test_data.model import test_data.config as config from sqlrocks import * class DbTestCase(unittest.TestCase): conn = None cur = None dataset = {} def setUp(self): s...
import json import ckan.plugins.toolkit as toolkit import ckan.model import pylons import dateutil.parser from budgetdatapackage import BudgetDataPackage, BudgetResource import logging log = logging.getLogger(__name__) class BudgetDataPackageController(toolkit.BaseController): def descriptor(self, id, resource_...
#!/sevabot # -*- coding: utf-8 -*- """ Shows what server a site is on """ from __future__ import unicode_literals import re import os import Skype4Py import urllib2 import socket from sevabot.bot.stateful import StatefulSkypeHandler from sevabot.utils import ensure_unicode, get_chat_id class ServerHandler(Stateful...
#!/usr/bin/env python """Fortran 2003 Syntax Rules. """ from __future__ import absolute_import from __future__ import print_function #Author: Pearu Peterson <pearu@cens.ioc.ee> #Created: Oct 2006 import re import logging from .splitline import string_replace_map from . import pattern_tools as pattern from .readfortran...
#!/usr/bin/env python3 # https://theneuralperspective.com/2016/10/04/05-recurrent-neural-networks-rnn-part-1-basic-rnn-char-rnn/ # https://machinelearningmastery.com/text-generation-lstm-recurrent-neural-networks-python-keras/ # Larger LSTM Network to Generate Text for Last Hope LARP import sys import os import numpy ...
from __future__ import division from builtins import range from past.utils import old_div from opentuner.search import technique import math import random #Default interval steps for cooling schedules DEFAULT_INTERVAL = 100 #Pseudo-annealing - no relative energy input into acceptance function class PseudoAnnealingSear...
# coding=utf-8 # Copyright 2021 The Mesh TensorFlow 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 applicab...
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Hub.is_homepage' db.add_column(u'hubs_hub', 'is_homepage'...
# Copyright (c) 2012 NTT DOCOMO, 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 requ...
############################################################################## # Copyright (c) 2013-2017, 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...
# # Copyright (C) 2017 Maha Farhat # # 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, either version 3 of the License, or # (at your option) any later version. # # This program is distribu...
import os import unittest here = os.path.dirname(__file__) class PkgbuildTest(unittest.TestCase): def _get_pkgbuild(self): from aurifere.pkgbuild import PKGBUILD return PKGBUILD(os.path.join(here, 'fixtures/PKGBUILD')) def test_attributes(self): p = self._get_pkgbuild() self....
############################################################################## # Copyright (c) 2013-2017, 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...
import json import pickle import os import random from openerp import models, api, fields, _ class GeneratorInterface(models.AbstractModel): _name = 'builder.ir.model.demo.generator.base' _description = 'Generator Interface' @api.multi def get_generator(self, field): raise NotImplementedErro...
#!/usr/bin/python # -*- coding: utf-8 -*- #************************************************************************* # # This file is part of the UGE(Uniform Game Engine). # Copyright (C) by SanPolo Co.Ltd. # All rights reserved. # # See http://uge.spolo.org/ for more information. # # SanPolo Co.Ltd # http://ug...
#!/usr/bin/env python """ @package mi.dataset.driver.pco2w_abc.imodem @file mi-dataset/mi/dataset/driver/pco2w_abc/imodem/pco2w_abc_imodem_recovered_driver.py @author Mark Worden @brief Driver for the pco2w_abc_imodem instrument Release notes: Initial Release """ from mi.dataset.dataset_parser import DataSetDriverC...
############################################################################### # # Copyright (C) 2001-2014 Micronaet SRL (<http://www.micronaet.it>). # # 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 ...
import unittest import requests import deepl paragraph_text = """This is a text with multiple paragraphs. This is still the first one. This is the second one. This is the third paragraph.""" paragraph_list = [ 'This is a text with multiple paragraphs. This is still the first one.', 'This is the second one.',...
""" merry christmas """ import datetime import argparse def get_args(): parser = argparse.ArgumentParser(description=__doc__) parser.add_argument("nothing", type=str) parser.add_argument("--infinity", action="store_true") return parser.parse_args() xm_form = "{days:02} days, {hours:02} hours, {minute...
# Copyright 2013 IBM Corp. # 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...
# vim:fileencoding=utf-8:noet from __future__ import (unicode_literals, division, absolute_import, print_function) import codecs from powerline.lint.markedjson.error import MarkedError, Mark, NON_PRINTABLE from powerline.lib.unicode import unicode # This module contains abstractions for the input stream. You don't ...
import warnings import numpy as np from numpy.testing import assert_allclose from nose.tools import raises from pathlib import Path import menpo from menpo.image import Image, MaskedImage, BooleanImage from menpo.shape import PointCloud from menpo.transform import UniformScale, Translation def test_image_as_masked(...
#!/usr/bin/python # # plugin.py # # Copyright (C) Ben Van Mechelen 2007-2011 <me@benvm.be> # # This file is part of Garmon # # Garmon 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 ...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file '.\mainwindow.ui' # # Created: Wed Dec 17 21:45:47 2014 # by: pyside-uic 0.2.15 running on PySide 1.2.2 # # WARNING! All changes made in this file will be lost! from PySide import QtCore, QtGui class Ui_MainWindow(object): def setu...
# # 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 # ...
# uncompyle6 version 2.9.10 # Python bytecode 2.7 (62211) # Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10) # [GCC 6.2.0 20161005] # Embedded file name: py_compile.py """Routine to "compile" a .py file to a .pyc (or .pyo) file. This module has intimate knowledge of the format of .pyc files. """ impor...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Example of checking the requirements of bibtext and biblatex.""" import bibpy from bibpy.tools import get_abspath_for def format_requirements_check(required, optional): s = "" if required: s = "required field(s) " + ", ".join(map(str, required)) ...
#!/usr/bin/env python """ Driver for OpenVPN client """ import time import base64 import hashlib import struct import hmac import pollengine # --- class OVDriveData: """OpenVPN authentication data""" def __init__( self ): self.otp_secret = NO_SECRET # --- class ShellAdmin: """Driver for admin ...
from collections import namedtuple from django_iban.utils import clean_iban IBANPartSpecification = namedtuple('IBANPartSpecification', ["length", "data_type"]) class IBANSpecification(object): MASK_DATATYPE_MAP = { 'a':'a', 'n':'9', 'c':'w', } REGEX_DATATYPE_MAP = { 'a'...
#!/usr/bin/env python # # esx_vi_generator.py: generates most of the SOAP type mapping code # # Copyright (C) 2010-2012 Matthias Bolte <matthias.bolte@googlemail.com> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by...
# -*- coding:utf-8 -*- ## src/chat_control.py ## ## Copyright (C) 2006 Dimitur Kirov <dkirov AT gmail.com> ## Copyright (C) 2006-2014 Yann Leboulanger <asterix AT lagaule.org> ## Copyright (C) 2006-2008 Jean-Marie Traissard <jim AT lapin.org> ## Nikos Kouremenos <kourem AT gmail.com> ## ...
############################################################################## # Parte do livro Introdução à Programação com Python # Autor: Nilo Ney Coutinho Menezes # Editora Novatec (c) 2010-2014 # Primeira edição - Novembro/2010 - ISBN 978-85-7522-250-8 # Primeira reimpressão - Outubro/2011 # Segunda reimpressão - ...
import FWCore.ParameterSet.Config as cms from HeavyIonsAnalysis.JetAnalysis.jets.akPu3PFJetSequence_PbPb_mc_cff import * #PU jets with 30 GeV threshold for subtraction akPu3PFmatch30 = akPu3PFmatch.clone(src = cms.InputTag("akPu3PFJets30")) akPu3PFparton30 = akPu3PFparton.clone(src = cms.InputTag("akPu3PFJets30")) ak...
# coding=utf-8 # Copyright 2021 The Google Research 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 applicab...
import os import sys import matplotlib matplotlib.use('svg') import matplotlib.pyplot as plt import pandas as pd import squarify DULL_DIRECTORIES = set(['.git']) def count_lines(path): return sum(1 for line in open(path)) # TODO make configurable def walk_tree(topdir): for root, dirs, files in os.walk(t...