src
stringlengths
721
1.04M
# # Simple test program for the Python Motion SDK. # # @file tools/sdk/python/test.py # @author Luke Tokheim, luke@motionnode.com # @version 2.2 # # Copyright (c) 2015, Motion Workshop # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provide...
import os import uuid import psycopg2 import psycopg2.extras import crypt, getpass, pwd import time import smtplib, json from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart from datetime import date from flask import Flask, redirect, url_for,session, render_template, jsonify, request fro...
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
import os import carbonui.const as uiconst import carbonui.languageConst as languageConst #import carbonui.fontconst as fontconst import blue DEFAULT_FONTSIZE = 10 DEFAULT_LINESPACE = 12 DEFAULT_LETTERSPACE = 0 DEFAULT_UPPERCASE = False STYLE_DEFAULT = 'STYLE_DEFAULT' FONTFAMILY_PER_WINDOWS_LANGUAGEID = {...
# 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 writing, so...
""" Sahana Eden Module Automated Tests - HRM007 Add Staff Participants @copyright: 2011-2016 (c) Sahana Software Foundation @license: MIT 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 th...
from __future__ import absolute_import, print_function import os.path from uuid import uuid4 from functools import wraps import warnings import logging logger = logging.getLogger(__file__) from six import add_metaclass, iteritems from six.moves.urllib.parse import urlsplit from .embed import autoload_static, autolo...
# -*- coding: utf-8 -*- from __future__ import print_function import os import sys import imp import subprocess ## Python 2.6 subprocess.check_output compatibility. Thanks Greg Hewgill! if 'check_output' not in dir(subprocess): def check_output(cmd_args, *args, **kwargs): proc = subprocess.Popen( ...
import Flow,Range from ryu.ofproto import ofproto_v1_3 #This file contains all the logic for populating the fourth table, used for the balancing of traffic #Creates a flow for the table, one for each range, representing the start of a range def createThirdTableFlow(flowRange, datapath): ofproto=ofproto_v1_3 m...
# coding: utf-8 """ Interface to MODELLER (https://salilab.org/modeller/). """ import os import anvio import shutil import argparse import subprocess import pandas as pd import anvio.utils as utils import anvio.fastalib as u import anvio.terminal as terminal import anvio.constants as constants import anvio.filesnpath...
from django.db import models from wagtail.wagtailcore import blocks from wagtail.wagtailcore.models import Page, Orderable from wagtail.wagtailcore.fields import RichTextField, StreamField from wagtail.wagtailimages.edit_handlers import ImageChooserPanel from wagtail.wagtailimages.models import Image from wagtail.wagt...
''' Author: Alex Walter Date: Feb 2, 2015 This file contains the keywords and descriptions for display stack files including image stacks, centroid files, and photometry files. It also has the read and write functions. Description functions: imageStackHeaderDescription() imageStackDataDescription() centro...
#!/usr/bin/env python # Copyright (C) 2006-2016 Music Technology Group - Universitat Pompeu Fabra # # This file is part of Essentia # # Essentia 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 ...
import logging import logging.handlers from multiprocessing import Queue from execution_engine import ExecutionEngine class StateMachine(): def __init__(self, brewView, tempControllerAddress, interfaceLock): self.brewView = brewView self.tempControllerAddress = tempControllerAddress self.qT...
# -*- coding: utf-8 -*- # This file is part of Dyko # Copyright © 2008-2010 Kozea # # This library 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 lat...
# Copyright 2013 Rackspace # # 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 agree...
#!/usr/bin/python from Adafruit_PWM_Servo_Driver import PWM import time ''' LEARN ABSTRACTION WITH THIS. move portion of car, how to move car. car_driver.py This provide some useful class to be used while driving wheels. gordon.yiu@gmail.com ''' #++wheel_drive++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++...
import os import logging import logging.config import define from system import FILE as f from system import DIRECTORY as d CONF_FILE = "logging.conf" BASE_NAME = "Puyopuyo.Owanimo" BASE_LEVEL = logging.DEBUG BASE_FORMAT = '%(processName)s.%(name)s ( PID %(process)d ) : %(asctime)s - %(levelname)s - %(message)s' c...
from octopus.core import app from octopus.lib import plugin import os, shutil, codecs, requests class StoreException(Exception): pass class StoreFactory(object): @classmethod def get(cls): """ Returns an implementation of the base Store class """ si = app.config.get("STOR...
# coding: utf-8 # Obtain all the data for the Master students, starting from 2007. Compute how many months it took each master student to complete their master, for those that completed it. Partition the data between male and female students, and compute the average -- is the difference in average statistically signi...
import requests import logging from fetcher import fetch from os.path import join from urlobj import URLObj from urllib.parse import urljoin, urlsplit, urlunsplit class RobotsParser: def __init__(self, domain): self.domain = domain # Check if the file even exists first. def exists(self): r...
import dbus from feather import Plugin class PidginStatus(Plugin): listeners = set(['songstart', 'songpause', 'songresume']) messengers = set() def songstart(self, payload): #hacky. parts = payload.split('/') artist = parts[-3] album = parts[-2] song = parts[-1] ...
import datetime import pytz from django.test import TestCase from mock import patch from periods import models as period_models from periods.management.commands import email_active_users from periods.tests.factories import FlowEventFactory TIMEZONE = pytz.timezone("US/Eastern") class TestCommand(TestCase): def...
#!/usr/bin/python import optparse import os import shutil import subprocess import sys def num_cpus(): # Use multiprocessing module, available in Python 2.6+ try: import multiprocessing return multiprocessing.cpu_count() except (ImportError, NotImplementedError): pass # Get PO...
# Copyright (c) 2015 kamyu. All rights reserved. # # Google Code Jam 2014 World Finals - Problem F. ARAM # https://code.google.com/codejam/contest/7214486/dashboard#s=p5 # # Time: O(60 * N * R * G) # Space: O(1) # # Can you win at least X fraction of the time? def CanWin(X): A = [] last_G_values = 0 # C ...
#!/usr/bin/python # -*- coding: utf-8 -*-f #Import modules for CGI handling import cgi, cgitb import Cookie, os, time cookie = Cookie.SimpleCookie() cookie_string = os.environ.get('HTTP_COOKIE') def getCookies(): if not cookie_string: return False else: # load() parses the cookie string ...
# Copyright 2015 The Meson development team # 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 ...
''' Strava club information is not publicly available. To get the club information the club owner needs to be logged in. This script takes the HTML file of the strava club page and extracts all the users/athletes. ''' from bs4 import BeautifulSoup import argparse def get_group_members_from_html(html_in): ...
# -*- coding: utf-8 -*- """ Regression tests for the Test Client, especially the customized assertions. """ import os from django.conf import settings from django.test import Client, TestCase from django.test.utils import ContextList from django.core.urlresolvers import reverse from django.core.exceptions import Suspi...
""" The GUI that launches all the subprograms """ from tkinter import * import os, sys, webbrowser class MainGui(Tk): """ Main window of application """ def __init__(self, *args, **kwargs): Tk.__init__(self, *args, **kwargs) self.title('libuseful') old_dir = os....
import json from datetime import datetime, timedelta from dateutil.tz import gettz from scrapy import Request from feeds.exceptions import DropResponse from feeds.loaders import FeedEntryItemLoader from feeds.spiders import FeedsSpider class TvthekOrfAtSpider(FeedsSpider): name = "tvthek.orf.at" http_user =...
from setuptools import setup def read_md(filename): return open(filename).read() def parse_requirements(filename): reqs = [] with open(filename, 'r') as f: reqs = f.read().splitlines() if not reqs: raise RuntimeError("Unable to read requirements from '%s'" % filename) return reqs...
import webiopi import datetime GPIO = webiopi.GPIO #LIGHT = 17 # GPIO pin using BCM numbering VALVE1 = 2 VALVE2 = 3 VALVE3 = 7 VALVE4 = 8 VALVE5 = 9 VALVE6 = 10 VALVE7 = 11 VALVE8 = 18 #HOUR_ON = 8 # Turn Light ON at 08:00 #HOUR_OFF = 18 # Turn Light OFF at 18:00 # setup function is automatically called at WebIOP...
# voter/models.py # Brought to you by We Vote. Be good. # -*- coding: UTF-8 -*- from django.db import models from django.contrib.auth.models import (BaseUserManager, AbstractBaseUser) # PermissionsMixin from django.core.validators import RegexValidator from exception.models import handle_exception, handle_record_foun...
############################################################################ # # OSIS stands for Open Student Information System. It's an application # designed to manage the core business of higher education institutions, # such as universities, faculties, institutes and professional schools. # The core bu...
# third party import pandas as pd # syft relative from ...generate_wrapper import GenerateWrapper from ...lib.python.list import List from ...lib.python.primitive_factory import PrimitiveFactory from ...proto.lib.pandas.categorical_pb2 import ( PandasCategoricalDtype as PandasCategoricalDtype_PB, ) def object2pr...
#!/usr/bin/env python # # gORAnalysis.py # Author: Philip Braunstein # Copyright (c) 2015 BioSeq # # This is the analysis for the BioSeq Genetics of Race Experiment. It uses VCF # files generated from MiSeq to create a FASTA file of what each sample would # have looked like. This output file can be run easily analyzed...
# # Copyright (c) 2015 Red Hat # Licensed under The MIT License (MIT) # http://opensource.org/licenses/MIT # import json from django.contrib.contenttypes.models import ContentType from django.core.urlresolvers import reverse from django.shortcuts import get_object_or_404 from django.utils import six from django.utils....
# Licensed under a 3-clause BSD style license - see LICENSE.rst import numpy as np import astropy.units as u import astropy.constants as const from scipy.interpolate import splrep, splev from .bandpasses import get_bandpass from .utils import integration_grid from .constants import SPECTRUM_BANDFLUX_SPACING, HC_ERG_A...
''' Created on 2015年12月11日 https://leetcode.com/problems/ugly-number/ https://leetcode.com/problems/ugly-number-ii/ https://leetcode.com/problems/super-ugly-number/ @author: Darren ''' ''' Write a program to check whether a given number is an ugly number. Ugly numbers are positive numbers whose prime factors only incl...
# -*- encoding:utf8 -*- try: from jinja2 import Environment, PackageLoader except ImportError: raise ImportError('Scaffolding support requires the Jinja 2 templating library to be installed.') template_environment = Environment(loader=PackageLoader('denim.scaffold')) def single(template_file, output_name, co...
from flask.ext.assets import Bundle js = Bundle( 'bower_components/jquery/dist/jquery.js', 'bower_components/angular/angular.js', 'bower_components/angular-animate/angular-animate.js', 'bower_components/angular-cookies/angular-cookies.js', 'bower_components/angular-sanitize/angular-sanitize.js', ...
import os import random import typing from airports.airport import Airport, AirportType from airports.airportstable import AirportsTable from airports.download import download from airports.runwaystable import RunwaysTable from airports.wikipediahelper import get_wikipedia_articles class DB: def __init__(self) -...
#coding=UTF-8 from pyspark import SparkContext, SparkConf, SQLContext, Row, HiveContext from pyspark.sql.types import * from datetime import date, datetime, timedelta import sys, re, os st = datetime.now() conf = SparkConf().setAppName('PROC_O_LNA_XDXT_CUSTOMER_RELATIVE').setMaster(sys.argv[2]) sc = SparkContext(conf ...
# Copyright 2015-2019 Canonical Ltd. This software is licensed under the # GNU Affero General Public License version 3 (see the file LICENSE). """Tests for `FilesystemGroup`.""" import random import re from unittest import skip from uuid import uuid4 from django.core.exceptions import PermissionDenied, ValidationE...
import os from django.urls import reverse_lazy from django.utils.translation import ugettext_lazy as _ from oscar import get_core_apps, OSCAR_MAIN_TEMPLATE_DIR from oscar.defaults import * # noqa PROJECT_DIR = os.path.dirname(__file__) location = lambda x: os.path.join(os.path.dirname(os.path.dirname(os.path.realpath...
#! /usr/bin/python # # Copyright (c) 2014 IBM, 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 # # ...
# Copyright (C) 2016 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...
# stdlib import atexit import cStringIO as StringIO from collections import namedtuple from functools import partial import glob try: import grp except ImportError: # The module only exists on Unix platforms grp = None import logging import os try: import pwd except ImportError: # Same as above (exi...
from __future__ import print_function from __future__ import division import numpy as np from datetime import datetime from scipy.stats import norm from scipy.optimize import minimize def acq_max(ac, gp, y_max, bounds, random_state): """ A function to find the maximum of the acquisition function It uses ...
# -*- coding: utf-8 -*- # # Copyright (C) 2007-2011 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://babel.edgewall.org/wiki/License. # # This software consists...
#!/usr/bin/python #coding: utf-8 from DiarioTools.Parser import * from DiarioTools.Process import * from DiarioTools.Search import * import re class ParseExoneracaoChefeDeGabinete(GenericParser): def Initialize(self): self.AddExpression("^\s*Exonerar.{0,1000}?(senhora|senhor)([^,]+).{0,400}?Chefe de Gabinete.(.+)",...
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: replicator.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _re...
#!/usr/bin/python print " __ " print " |__|____ ___ __ " print " | \__ \\\\ \/ / " print " | |/ __ \\\\ / " print " /\__| (____ /\_/ " print " \______| \/ " p...
#!/usr/bin/env python3 # -*- coding: utf-8, vim: expandtab:ts=4 -*- ############################################################################### # Copyright (c) 2015 Móréh, Tamás # All rights reserved. This program and the accompanying materials # are made available under the terms of the GNU Lesser Public License v...
# -*- coding: utf-8 -*- """ Created on Tue Jun 30 20:56:07 2015 @author: agiovann """ #% add required packages import h5py import calblitz as cb import time import pylab as pl import numpy as np import cv2 #% set basic ipython functionalities #pl.ion() #%load_ext autoreload #%autoreload 2 #%% filename='ac_001_001.tif...
from pandas import * import numpy as np from pycuda.gpuarray import to_gpu import gpustats import gpustats.util as util from scipy.stats import norm import timeit data = np.random.randn(1000000) mean = 20 std = 5 univ_setup = """ import numpy as np from pycuda.gpuarray import to_gpu k = 8 means = np.random.randn(k)...
# -*- coding: utf-8 -*- # Copyright (C) 2010-2012 Bastian Kleineidam # # 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. #...
# -*- coding: utf-8 -*- """Tests for the Source class.""" from __future__ import unicode_literals import mock import pytest from kuma.scrape.sources import Source from . import mock_requester, mock_storage class FakeSource(Source): """A Fake source for testing shared Source functionality.""" PARAM_NAME = ...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (c) 2008 Spanish Localization Team # Copyright (c) 2009 Zikzakmedia S.L. (http://zikzakmedia.com) # Jordi Esteve <jesteve@zikzakm...
#!/usr/bin/env python # -*- coding: utf-8 -*- # from __future__ import unicode_literals import os AUTHOR = u'John D. Griffiths' SITENAME = u"JDG Lab Notebook" SITEURL = 'https://johngriffiths.github.io/LabNotebook' #SITESUBTITLE = u'Open Notebook Science.' TIMEZONE = 'US/Pacific' DEFAULT_LANG = u'en' # Feed genera...
import json import requests from flask import Flask, render_template, jsonify, url_for # Create a Flask application app = Flask(__name__) # Define some routes @app.route('/') def index(): """Renders the home page with some data.""" data = {} data['title'] = 'Saluton, Mondo!' data['body'] = """<p>Th...
import argparse import torch from tqdm import tqdm import torch.nn.functional as F from torch_geometric.data import ClusterData, ClusterLoader, NeighborSampler from torch_geometric.nn import SAGEConv from ogb.nodeproppred import PygNodePropPredDataset, Evaluator from logger import Logger class SAGE(torch.nn.Modul...
# -*- coding: utf-8 -*- """ Created on Thu Aug 10 08:23:33 2017 @author: xjw1001001 """ #only when PAML in desktop is available,the yeast version only from Bio import Seq, SeqIO, AlignIO from Bio.Phylo.PAML import codeml, baseml import numpy as np paralog_list = [['YLR406C', 'YDL075W'], ['YER131W', 'YGL189C'], ['YML...
#ToDo : Write tests for application interface import pytest import os from PyQt4.QtGui import * from PyQt4.QtCore import * from mp3wav.application import Mp3WavApp from mp3wav.exceptions.fileexception import FileTypeException from mp3wav.exceptions.libraryexception import LibraryException from mp3wav.exceptions.filenot...
############################################################################## # # OSIS stands for Open Student Information System. It's an application # designed to manage the core business of higher education institutions, # such as universities, faculties, institutes and professional schools. # The core ...
import zstackwoodpecker.test_state as ts_header import os TestAction = ts_header.TestAction def path(): return dict(initial_formation="template5", checking_point=8, faild_point=13, path_list=[ [TestAction.create_vm, 'vm1', ], [TestAction.create_volume, 'volume1', 'flag=scsi'], [TestAction.attach_volume, 'vm1...
# -*- coding:utf-8 -*- ''' For friends links. ''' from torcms.model.abc_model import Mabc, MHelper from torcms.model.core_tab import TabLink class MLink(Mabc): ''' For friends links. ''' @staticmethod def get_counts(): ''' The count in table. ''' # adding ``None`` t...
# -*- coding: utf-8 -*- #------------------------------------------------------------ # tvalacarta - XBMC Plugin # Canal para RTVE # http://blog.tvalacarta.info/plugin-xbmc/tvalacarta/ #------------------------------------------------------------ import urlparse, re from core import config from core import logger from...
import requests import io import json import csv from math import floor class finboxRequest: def __init__(self): self.url = "https://api.finbox.io/beta" self.headers = { 'authorization': "Bearer 509e960d5d374b8958f00bd5e977d13f001925fe", 'accept': "application/json", 'c...
#!/usr/bin/env python """ simple example script for running and testing notebooks. Usage: `ipnbdoctest.py foo.ipynb [bar.ipynb [...]]` Each cell is submitted to the kernel, and the outputs are compared with those stored in the notebook. """ from __future__ import print_function import os,sys,time import base64 impo...
# coding: utf-8 # coding: utf-8 from __future__ import absolute_import import ui import dialogs class ElementParameterDictionaryInputView(object): def __init__(self): self.dictionary = {} self.thememanager = None def tableview_did_select(self, tableview, section, row): key = list(self.dictionary.keys())[row]...
from __future__ import unicode_literals from django.views import generic from django.shortcuts import get_object_or_404, redirect from django.contrib import messages from django.contrib.auth.mixins import LoginRequiredMixin from . import forms from . import models import datetime class ShowProfile(LoginRequiredMixin,...
import fnmatch import os import eyed3 import shutil path_to_clean = u'/media/amir/Files/Download/' path_to_move = u'/media/amir/Files/Music/' matches = [] for root, dirnames, filenames in os.walk(path_to_clean): for filename in fnmatch.filter(filenames, u'*.mp3'): matches.append(os.path.join(root, filename)...
import time from django import http from tpasync.resources import BaseAsyncResource from tastypie import fields from tastypie.test import ResourceTestCaseMixin from . import tasks from django.test.testcases import TestCase class EmptyTestResource(BaseAsyncResource): class Meta: resource_name = 'empty' c...
import slugify from flask import request, send_file as flask_send_file from flask_restful import Resource from flask_jwt_extended import jwt_required from zou.app import config from zou.app.mixin import ArgsMixin from zou.app.utils import permissions from zou.app.services import ( entities_service, playlists...
#!/usr/bin/python ''' Extract _("...") strings for translation and convert to Qt4 stringdefs so that they can be picked up by Qt linguist. ''' from subprocess import Popen, PIPE import glob import operator import os import sys OUT_CPP="qt/kzcashstrings.cpp" EMPTY=['""'] def parse_po(text): """ Parse 'po' form...
#!/usr/bin/env python """ Mission 7-Detect and Deliver 1. Random walk with gaussian at center of map until station position is acquired 2. loiter around until correct face seen 3. if symbol seen, move towards symbol perpendicularly 4. if close enough, do move_base aiming task 7: ----------------- Created by ...
#!/usr/bin/env python # Copyright (C) 2014-2017 Shea G Craig # # 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 ...
# Russian Language Test from seleniumbase.translate.russian import ТестНаСелен # noqa class МойТестовыйКласс(ТестНаСелен): def test_пример_1(self): self.открыть("https://ru.wikipedia.org/wiki/") self.подтвердить_элемент('[title="Русский язык"]') self.подтвердить_текст("Википедия", "h2.ma...
""" A simple example consuming messages from RabbitMQ. """ import logging from amqpstorm import Connection logging.basicConfig(level=logging.INFO) def on_message(message): """This function is called on message received. :param message: :return: """ print("Message:", message.body) # Acknowl...
#!/usr/bin/env python # # Copyright (c) 2015 Intel Corporation. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of works must retain the original copyright notice, this # list of conditions and t...
# 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...
#!/usr/local/bin/python2.7 """ sbf2offset.py Reads SBF binary data files and produces plain text file containing PVTGeoblock data Copyright (C) 2013 Paul R. DeStefano This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as publis...
# -*- coding: utf-8 -*- import logging import traceback from datetime import datetime from webob import Response from pyramid.security import authenticated_userid from pyramid.httpexceptions import HTTPFound from pyramid.url import route_url # from pyramid.response import Response from pyramid.settings import asbool ...
"""This module contains the data models""" from django.db import models from django.contrib.auth.models import User class Nationality(models.Model): abbreviation = models.CharField(max_length=5) name = models.CharField(max_length=75) class Division(models.Model): name = models.CharField(max_length=50) ...
############################################################################ # # Copyright (C) 2016 The Qt Company Ltd. # Contact: https://www.qt.io/licensing/ # # This file is part of Qt Creator. # # Commercial License Usage # Licensees holding valid commercial Qt licenses may use this file in # accordance with the co...
# -*- coding: utf-8 -*- ''' 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 program is distributed in...
#!/usr/bin/env python """AFF4 interface implementation. This contains an AFF4 data model implementation. """ import __builtin__ import abc import itertools import StringIO import threading import time import zlib import logging from grr.lib import access_control from grr.lib import config_lib from grr.lib import d...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import smart_selects.db_fields from decimal import Decimal import djmoney.models.fields class Migration(migrations.Migration): dependencies = [ ('restserver', '0009_auto_20150811_1400'), ] o...
# # BitBake 'dummy' Passthrough Server # # Copyright (C) 2006 - 2007 Michael 'Mickey' Lauer # Copyright (C) 2006 - 2008 Richard Purdie # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundatio...
from django.apps import AppConfig from django.utils.translation import gettext_lazy as _ from django.db.models import Q class PrerequisitesAppConfig(AppConfig): name = 'danceschool.prerequisites' verbose_name = _('Class Requirements/Prerequisites') def ready(self): from danceschool.core.models im...
""" Methods to interconvert between json and other (cif, mol, smi, etc.) files """ import imolecule.json_formatter as json from collections import Counter from fractions import gcd from functools import reduce # Open Babel <= '2.4.1' try: import pybel ob = pybel.ob table = ob.OBElementTable() GetAtomi...
# vim: tabstop=8 shiftwidth=4 softtabstop=4 expandtab smarttab autoindent # Altai API Service # Copyright (C) 2012-2013 Grid Dynamics Consulting Services, Inc # All Rights Reserved # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License ...
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import re import subprocess from datetime import datetime class TestSuite(): def __init__(self): self.stdout = 0 def run(self, files): for file_name in files: try: self.set_changed(file_name) except Excepti...
# Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
# -*- coding: utf-8 -*- """ tests.slugify.tests Tests for garage.slugify * created: 2014-08-24 Kevin Chan <kefin@makedostudio.com> * updated: 2015-02-23 kchan """ from __future__ import (absolute_import, unicode_literals) from mock import Mock, patch, call try: from django.test import override_settings except ...
#!/usr/bin/env python from xml.dom.minidom import parse, parseString import getopt import sys class DomHandler(): def __init__(self, file_name): self.dom = parse(file_name) def setValue(self, attr_name, attr_value): result = False for node in self.dom.getElementsByTagName('parameter'): if node.getAttribut...