repo_name
stringlengths
5
104
path
stringlengths
4
248
content
stringlengths
102
99.9k
yourcelf/btb
printing/print_mail.py
import os import sys import glob import json import subprocess from collections import defaultdict from utils import UnicodeReader, slugify, count_pages, combine_pdfs, parser import addresscleaner from click2mail import Click2MailBatch parser.add_argument("directory", help="Path to downloaded mail batch") parser.add_...
sqs/freequery
freequery/index/job.py
from disco.core import Disco, result_iterator from disco.settings import DiscoSettings from disco.func import chain_reader from discodex.objects import DataSet from freequery.document import docparse from freequery.document.docset import Docset from freequery.index.tf_idf import TfIdf class IndexJob(object): def...
sch3m4/intelmq
intelmq/bots/parsers/malwaregroup/parser_ips.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals import sys from intelmq.lib import utils from intelmq.lib.bot import Bot from intelmq.lib.message import Event class MalwareGroupIPsParserBot(Bot): def process(self): report = self.receive_message() if not report: self....
blab/nextstrain-db
download_all.py
# Simple script to run required operations to # 1. Download FASTAs from database # 2. Copy FASTAs to nextflu directory # 3. Download titer tables from database # 4. Copy titer tables to nextflu directory # Run from base fauna directory with python flu/download_all.py # Assumes that nextflu/, nextflu-cdc/ and nextflu-cd...
Gebesa-Dev/Addons-gebesa
product_code_unique/__openerp__.py
# -*- coding: utf-8 -*- # © <YEAR(S)> <AUTHOR(S)> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { "name": "Product Code Unique", "summary": "Add the unique property to default_code field", "version": "9.0.1.0.0", "category": "Product", "website": "https://odoo-community.org/",...
open-craft/django-lti-tool-provider
django_lti_tool_provider/tests/test_views.py
import ddt from django.contrib.auth import login, authenticate from importlib import import_module from django_lti_tool_provider import AbstractApplicationHookManager from mock import patch, Mock from oauth2 import Request, Consumer, SignatureMethod_HMAC_SHA1 from django.contrib.auth.models import User from django.te...
liqd/a4-meinberlin
tests/topicprio/dashboard_components/test_views_module_topics.py
import pytest from django.urls import reverse from adhocracy4.dashboard import components from adhocracy4.test.helpers import assert_template_response from adhocracy4.test.helpers import redirect_target from adhocracy4.test.helpers import setup_phase from meinberlin.apps.topicprio.models import Topic from meinberlin.a...
openmotics/gateway
testing/unittests/api_tests/serializers/sensor_test.py
# Copyright (C) 2020 OpenMotics BV # # 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...
iw3hxn/LibrERP
stock_picking_extended/models/inherit_stock_location.py
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2010-2012 Associazione OpenERP Italia # (<http://www.openerp-italia.org>). # Copyright (C) 2014 Didotech srl # (<http://www.didotech.com>). # # This program is free software: you can r...
cloudbase/coriolis
coriolis/endpoints/api.py
# Copyright 2016 Cloudbase Solutions Srl # All Rights Reserved. from coriolis import utils from coriolis.conductor.rpc import client as rpc_conductor_client from coriolis.minion_manager.rpc import client as rpc_minion_manager_client class API(object): def __init__(self): self._rpc_conductor_client = rpc_...
lkundrak/scraperwiki
web/global_settings.py
""" Global settings file. Everything in here is imported *before* everything in settings.py. This means that this file is used for default, fixed and global varibles, and then settings.py is used to overwrite anything here as well as adding settings particular to the install. Note that there are no tuples h...
edx/edxanalytics
src/util/playback.py
import logging, logging.handlers import sys logging.handlers.HTTPHandler('','',method='GET') logger = logging.getLogger('simple_example') # http_handler = logging.handlers.HTTPHandler('127.0.0.1:9022', '/event', method='GET') http_handler = logging.handlers.HTTPHandler('127.0.0.1:9999', '/httpevent', method='GET') ...
uclouvain/osis
infrastructure/shared_kernel/entite/dtos.py
# ############################################################################## # # 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 cor...
ser/topitup
siema.py
# Flask modules from flask import ( Blueprint, render_template, redirect, url_for, request, flash, current_app, g, ) # FLask Login from flask_login import ( current_user, ) # WTForms from flask_wtf import Form from wtforms import ( SubmitField, BooleanField, DecimalFiel...
uclouvain/osis_louvain
assessments/signals/subscribers.py
############################################################################## # # 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 ...
jardiacaj/finem_imperii
account/tests.py
from django.contrib import auth from django.contrib.auth.models import User from django.test import TestCase from django.urls.base import reverse class TestAccountRegistration(TestCase): def setUp(self): # create one user for convenience response = self.client.post( reverse('account:re...
HelloLily/hellolily
lily/cases/api/serializers.py
import analytics import anyjson from channels import Group from django.conf import settings from django.utils.translation import ugettext_lazy as _ from rest_framework import serializers from lily.accounts.api.serializers import RelatedAccountSerializer from lily.api.fields import SanitizedHtmlCharField from lily.api....
Daniel-CA/odoo-addons
__unported__/avanzosc_module_doc/wizard/create_module_documentation.py
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2008-2013 AvanzOSC S.L. All Rights Reserved # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
opendata-swiss/ckanext-geocat
ckanext/geocat/harvester.py
# -*- coding: utf-8 -*- import traceback from ckan.lib.helpers import json from ckanext.harvest.model import HarvestObject, HarvestObjectExtra from ckanext.harvest.harvesters import HarvesterBase from ckanext.geocat.utils import search_utils, csw_processor, ogdch_map_utils, csw_mapping # noqa from ckanext.geocat.uti...
odoo-arg/odoo_l10n_ar
l10n_ar_account_check_sale/__manifest__.py
# -*- coding: utf-8 -*- ############################################################################## # # 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 L...
uclouvain/osis
ddd/logic/learning_unit/use_case/read/get_effective_class_service.py
############################################################################## # # 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 ...
pdehaye/theming-edx-platform
common/lib/xmodule/xmodule/combined_open_ended_module.py
import logging from lxml import etree from pkg_resources import resource_string from xmodule.raw_module import RawDescriptor from .x_module import XModule from xblock.core import Integer, Scope, String, List, Float, Boolean from xmodule.open_ended_grading_classes.combined_open_ended_modulev1 import CombinedOpenEndedV...
OCA/website
website_legal_page/hooks.py
# Copyright 2020 Tecnativa - Alexandre Díaz # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from copy import deepcopy from xml.sax.saxutils import escape from lxml import etree as ElementTree from odoo import SUPERUSER_ID, api def _merge_views(env, xmlids): old_view_ids = env["ir.ui.view"].searc...
qtproject/pyside-pyside
tests/QtMultimediaWidgets/qmultimediawidgets.py
############################################################################# ## ## Copyright (C) 2017 The Qt Company Ltd. ## Contact: https://www.qt.io/licensing/ ## ## This file is part of the test suite of PySide2. ## ## $QT_BEGIN_LICENSE:GPL-EXCEPT$ ## Commercial License Usage ## Licensees holding valid commercial ...
brgl/libgpiod
bindings/python/examples/gpioset.py
#!/usr/bin/env python3 # SPDX-License-Identifier: LGPL-2.1-or-later # # This file is part of libgpiod. # # Copyright (C) 2017-2018 Bartosz Golaszewski <bartekgola@gmail.com> # '''Simplified reimplementation of the gpioset tool in Python.''' import gpiod import sys if __name__ == '__main__': if len(sys.argv) < 3...
antong/ldaptor
ldaptor/protocols/ldap/proxy.py
"""LDAP protocol proxy server""" from twisted.internet import reactor, defer from ldaptor.protocols.ldap import ldapserver, ldapconnector, ldapclient from ldaptor.protocols import pureldap class Proxy(ldapserver.BaseLDAPServer): protocol = ldapclient.LDAPClient client = None waitingConnect = [] unbou...
sshuttle/sshuttle
sshuttle/ssyslog.py
import sys import os import subprocess as ssubprocess _p = None def start_syslog(): global _p with open(os.devnull, 'w') as devnull: _p = ssubprocess.Popen( ['logger', '-p', 'daemon.notice', '-t', 'sshuttle'], stdin=ssubprocess.PIPE, stdout=devnull, st...
hdweiss/qt-creator-visualizer
tests/system/shared/workarounds.py
import urllib2 import re JIRA_URL='https://bugreports.qt-project.org/browse' class JIRA: __instance__ = None # Helper class class Bug: CREATOR = 'QTCREATORBUG' SIMULATOR = 'QTSIM' SDK = 'QTSDK' QT = 'QTBUG' QT_QUICKCOMPONENTS = 'QTCOMPONENTS' # constructor of ...
lzhang10/maxent
python/setup.py
#!/bin/env python # This is the building script for Python maxent extension module. # Simply type "python setup.py build" at command line to build the extension. # After that you can type "python setup.py install" to install the extension # module. # # The script assume you use gcc on unix and msvc on win32 platform. ...
gesellkammer/pyliblo
test/unit.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # pyliblo - Python bindings for the liblo OSC library # # Copyright (C) 2007-2011 Dominic Sacré <dominic.sacre@gmx.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 F...
giuserpe/leeno
src/Ultimus.oxt/python/pythonpath/LeenoUtils.py
''' Often used utility functions Copyright 2020 by Massimo Del Fedele ''' import sys import uno from com.sun.star.beans import PropertyValue from datetime import date import calendar import PyPDF2 ''' ALCUNE COSE UTILI La finestra che contiene il documento (o componente) corrente: desktop.CurrentFrame.Container...
Tendrl/monitoring-integration
tendrl/monitoring_integration/grafana/datasource_utils.py
import json import maps import traceback from requests import get from requests import post from requests import put from tendrl.commons.utils import log_utils as logger from tendrl.monitoring_integration.grafana import constants from tendrl.monitoring_integration.grafana import exceptions from tendrl.monitoring_int...
rspavel/spack
var/spack/repos/builtin/packages/xbraid/package.py
# 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 * import glob import os.path class Xbraid(MakefilePackage): """XBraid: Parallel time integration w...
dwlehman/blivet
blivet/devices/md.py
# devices/md.py # # Copyright (C) 2009-2014 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # the GNU General Public License v.2, or (at your option) any later version. # This program is distributed in the...
cstbox/devel
bin/cbx-2to3.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Data filter converting CSTBox v2 event logs to v3 format. Usage: ./cbx-2to3.py < /path/to/input/file > /path/to/output/file """ __author__ = 'Eric Pascual - CSTB (eric.pascual@cstb.fr)' import fileinput import json for line in fileinput.input(): ts, var_type, v...
AlexandreDecan/sismic
sismic/interpreter/listener.py
from typing import Callable, Any from ..model import MetaEvent, Event from ..exceptions import PropertyStatechartError __all__ = ['InternalEventListener', 'PropertyStatechartListener'] class InternalEventListener: """ Listener that filters and propagates internal events as external events. """ de...
consultit/Ely
setup.py
#!/usr/bin/env python ''' Created on Jan 6, 2018 @author: consultit ''' from panda3d.core import Filename import sys, os from subprocess import call ### NOTE: currently this script works only on GNU/Linux currdir = os.path.abspath(sys.path[0]) builddir = Filename.from_os_specific(os.path.join(currdir, '/ely/')).get...
voipir/python-sii
src/sii/lib/printing/barcode/Barcode.py
""" Barcode Creation (PDF417) """ import os basedir = os.path.split(__file__)[0] bcdelib = os.path.join(basedir, 'psbcdelib.ps') class Barcode(object): __lib__ = open(bcdelib, 'r').read() @property def ps(self): raise NotImplementedError @property def eps(self): raise NotImplem...
evangelistalab/forte
tests/pytest/hf/test_df_hf.py
import pytest from forte.solvers import solver_factory, HF def test_df_rhf(): """Test DF-RHF on HF.""" ref_energy = -100.04775218911111 # define a molecule xyz = """ H 0.0 0.0 0.0 F 0.0 0.0 1.0 """ # create a molecular model input = solver_factory(molecule=xyz, basis='cc-pVTZ',...
JuniorJPDJ/pyChomikBox
ChomikBox/utils/FileTransferProgressBar.py
import time import sys def sizeof_fmt(num, unit='B'): # source: http://stackoverflow.com/questions/1094841/reusable-library-to-get-human-readable-version-of-file-size for uprexif in ['', 'Ki', 'Mi', 'Gi', 'Ti', 'Pi', 'Ei', 'Zi']: if abs(num) < 1024.0: return "{:3.2f} {}{}".format(num, upre...
cbuahin/SWMMOpenMIComponent
Source/SWMMOpenMINoGlobalsPythonTest/SWMMOpenMINoGlobalsPythonTest.py
from ctypes import* import math lib = cdll.LoadLibrary("Z:\\Documents\Projects\\SWMMOpenMIComponent\\Source\\SWMMOpenMIComponent\\bin\\Debug\\SWMMComponent.dll") print(lib) print("\n") finp = b"Z:\\Documents\\Projects\\SWMMOpenMIComponent\\Source\\SWMMOpenMINoGlobalsPythonTest\\test.inp" frpt = b"Z:\\Documents\\Pr...
spectralDNS/spectralDNS
tests/test_MHD.py
import pytest import importlib from mpi4py import MPI from spectralDNS import config, get_solver, solve from TGMHD import initialize, regression_test, pi comm = MPI.COMM_WORLD if comm.Get_size() >= 4: params = ('uniform_slab', 'nonuniform_slab', 'uniform_pencil', 'nonuniform_pencil') else: param...
mschuurman/FMSpy
nomad/initconds/explicit.py
""" Sample a specific geometry or set of geometries. """ import numpy as np import nomad.core.glbl as glbl import nomad.core.trajectory as trajectory import nomad.core.log as log def set_initial_coords(wfn): """Takes initial position and momentum from geometry specified in input""" coords = glbl.properties['i...
popoyz/charts
base/chart_b.py
# -*- coding: utf-8 -*- from common.db_sum import _metric_meta_db '''get the data from table by name''' def get_data_by_name(name, status=[1], other=0): result = [] where = '' if status: status = ",".join([str(x) for x in status]) where += ' and status in ({}) '.format(status) if othe...
takinbo/rapidsms-borno
apps/bednets/tests.py
from rapidsms.tests.scripted import TestScript from apps.form.models import * from apps.reporters.models import * import apps.reporters.app as reporter_app import apps.supply.app as supply_app import apps.form.app as form_app import apps.default.app as default_app from app import App from django.core.management.command...
miquelcampos/GEAR_mc
gear/xsi/curve.py
''' This file is part of GEAR_mc. GEAR_mc is a fork of Jeremie Passerin's GEAR project. GEAR 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...
Readon/mvpsample
src/gtkcustom.py
""" Created on 2013-12-16 @author: readon @copyright: reserved @note: CustomWidget example for mvp """ from gi.repository import Gtk from gi.repository import GObject class CustomEntry(Gtk.Entry): """ custom widget inherit from gtkentry. """ def __init__(self): Gtk.Entry.__init__(self) ...
AlessandroZ/LaZagne
Windows/lazagne/softwares/memory/libkeepass/hbio.py
# -*- coding: utf-8 -*- import hashlib import io import struct # default from KeePass2 source BLOCK_LENGTH = 1024 * 1024 try: file_types = (file, io.IOBase) except NameError: file_types = (io.IOBase,) # HEADER_LENGTH = 4+32+4 def read_int(stream, length): try: return struct.unpack('<I', stream.r...
muk-it/muk_dms
muk_dms_access/models/access_groups.py
################################################################################### # # Copyright (c) 2017-2019 MuK IT GmbH. # # This file is part of MuK Documents Access # (see https://mukit.at). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Le...
laz2/sc-core
bindings/python/sc_core/pm_test.py
 """ ----------------------------------------------------------------------------- This source file is part of OSTIS (Open Semantic Technology for Intelligent Systems) For the latest info, see http://www.ostis.net Copyright (c) 2010 OSTIS OSTIS is free software: you can redistribute it and/or modify it under the ter...
yelizariev/addons-yelizariev
ir_attachment_url/tests/test_product_tmpl_image.py
# Copyright 2019 Rafis Bikbov <https://it-projects.info/team/RafiZz> # Copyright 2019 Alexandr Kolushov <https://it-projects.info/team/KolushovAlexandr> # Copyright 2019 Eugene Molotov <https://it-projects.info/team/em230418> # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). import logging from odo...
marcelnicolay/pycompressor
compressor/cli.py
# coding: utf-8 # <pycompressor - compress and merge static files (css,js) in html files> # Copyright (C) <2012> Marcel Nicolay <marcel.nicolay@gmail.com> # # This program 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 So...
xahhy/Django-vod
epg/models.py
from django.db import models class Channel(models.Model): channel_id = models.CharField(max_length=50, unique=True) channel_name = models.CharField(max_length=50, null=True, blank=True) rtmp_url = models.CharField(max_length=100, null=True, blank=True) active = models.IntegerField(null=True, blank=Tru...
lablup/sorna-manager
tests/manager/test_scheduler.py
from __future__ import annotations from decimal import Decimal from typing import ( Any, Mapping, Sequence, ) import uuid from pprint import pprint import pytest from ai.backend.common.docker import ImageRef from ai.backend.common.types import ( AccessKey, AgentId, KernelId, ResourceSlot, Session...
DarthMaulware/EquationGroupLeaks
Leak #5 - Lost In Translation/windows/Resources/Python/Core/Lib/hotshot/stats.py
# 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: stats.py """Statistics analyzer for HotShot.""" import profile import pstats import hotshot.log from hotshot.log import ENTER, EXIT def load(filenam...
DarthMaulware/EquationGroupLeaks
Leak #5 - Lost In Translation/windows/Resources/Python/Core/Lib/email/charset.py
# 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: charset.py __all__ = [ 'Charset', 'add_alias', 'add_charset', 'add_codec'] import codecs import email.base64mime import email.quoprimime from ema...
dmulholland/ivy
ivy/ext/ivy_jinja.py
# ------------------------------------------------------------------------------ # This extension adds support for Jinja templates. # ------------------------------------------------------------------------------ import sys from ivy import hooks, site, templates try: import jinja2 except ImportError: jinja2 =...
ashutosh-mishra/youtube-dl
youtube_dl/extractor/arte.py
# encoding: utf-8 import re import json import xml.etree.ElementTree from .common import InfoExtractor from ..utils import ( ExtractorError, find_xpath_attr, unified_strdate, determine_ext, get_element_by_id, compat_str, ) # There are different sources of video in arte.tv, the extraction proce...
razvanm/fs-expedition
heatmap.py
#!/usr/bin/env python import sys line = sys.stdin.readline() # skip the header line = sys.stdin.readline() all = {} while line: v = line.split() if v[0] not in all: all[v[0]] = set() all[v[0]].add(v[1]) line = sys.stdin.readline() s = [k for (_, k) in sorted([(len(v), k) for (k,v) in all.item...
DarthMaulware/EquationGroupLeaks
Leak #5 - Lost In Translation/windows/Resources/Python/Core/Lib/unittest/suite.py
# 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: suite.py """TestSuite""" import sys from . import case from . import util __unittest = True def _call_if_exists(parent, attr): func = getattr(pa...
googleapis/python-analytics-data
samples/generated_samples/analyticsdata_v1beta_generated_beta_analytics_data_batch_run_pivot_reports_async.py
# -*- coding: utf-8 -*- # Copyright 2022 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...
utarsuno/urbtek
universal_code/debugging.py
#!/usr/bin/env python3 # coding=utf-8 """ This module, debugging.py, will contain code related to debugging (such as printing error messages). """ #import sys #sys.path.insert(0, '/home/dev_usr/urbtek') #from universal_code import system_operations as so class MyException(Exception): """ Just something useful to ...
lukas-hetzenecker/home-assistant
tests/components/kraken/test_sensor.py
"""Tests for the kraken sensor platform.""" from datetime import timedelta from unittest.mock import patch from pykrakenapi.pykrakenapi import KrakenAPIError from homeassistant.components.kraken.const import ( CONF_TRACKED_ASSET_PAIRS, DEFAULT_SCAN_INTERVAL, DEFAULT_TRACKED_ASSET_PAIR, DOMAIN, ) from ...
RedHatInsights/insights-core
insights/parsers/pluginconf_d.py
""" pluginconf.d configuration file - Files ======================================= Shared mappers for parsing and extracting data from ``/etc/yum/pluginconf.d/*.conf`` files. Parsers contained in this module are: PluginConfD - files ``/etc/yum/pluginconf.d/*.conf`` ---------------------------------------------------...
lyoniionly/django-cobra
src/cobra/core/configure/user_config.py
from cobra.core.loading import get_model from cobra.core import json class UserConfig(object): default_config = { 'guide.task.participant': '1', 'guide.document.share': '1', 'guide.customer.share': '1', 'guide.workflow.operation': '1', 'guide.workflow.createform': '1', ...
hl475/vispek
examples/run_raw_file_io.py
# Copyright 2017 The Vispek 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 applicable ...
Turksat/pns
pns/models.py
# -*- coding: utf-8 -*- import datetime from sqlalchemy import UniqueConstraint from sqlalchemy.dialects.postgresql import JSONB from pns.app import app, db class SerializationMixin(): """serialization mixin for sqlalchemy model object """ def to_dict(self, *exceptions, **extra_payload): """get d...
jelovirt/dita-generator
src/ditagen/dita/v1_2.py
# -*- coding: UTF-8; indent-tabs-mode:nil; tab-width:4 -*- # This file is part of DITA DTD Generator. # # Copyright 2009 Jarno Elovirta <http://www.elovirta.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 cop...
Nikita1710/ANUFifty50-Online-Mentoring-Platform
project/fifty_fifty/webcore/migrations/0017_remove_profile_emails.py
# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2017-04-30 12:24 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('webcore', '0016_profile_emails'), ] operations = [ migrations.RemoveField( ...
quarkslab/irma
common/setup.py
from distutils.core import setup from src import __version__ setup( name="irma.common", version=__version__, author="Quarkslab", author_email="irma@quarkslab.com", description="The common component of the IRMA software", packages=["irma.common", "irma.common.base", "...
Fabfm4/Sita-BackEnd
src/sita/authentication/serializers.py
# -*- coding: utf-8 -*- import hashlib import random from rest_framework import serializers from sita.users.models import User from sita.subscriptions.models import Subscription from sita.utils.refresh_token import create_token from hashlib import md5 from datetime import datetime, timedelta import pytz class LoginSe...
opiethehokie/march-madness-predictions
ml/util.py
# Copyright 2016-2018 Michael Peters # # 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 ag...
gophronesis/smlib
smlib/keras_vectorizer.py
import sys import numpy as np from normalization import tokenize from helpers import ahash class KerasVectorizer(): ''' Convert list of documents to numpy array for input into Keras model ''' def __init__(self, n_features=100000, maxlen=None, maxper=100, hash_function=ahash): self.maxlen = ...
stackforge/os-ansible-deployment
playbooks/library/git_requirements.py
#!/usr/bin/python # -*- coding: utf-8 -*- from ansible.module_utils.basic import AnsibleModule import git import itertools import multiprocessing import os import signal import time DOCUMENTATION = """ --- module: git_requirements short_description: Module to run a multithreaded git clone options: repo_info: d...
openstack/rally
rally/verification/utils.py
# 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 agreed to in...
movicha/dcos
gen/test_template.py
import pytest import gen.template from gen.template import (For, Replacement, Switch, Tokenizer, UnsetParameter, parse_str) just_text = "foo" more_complex_text = "foo {" def get_tokens(str): return Tokenizer(str).tokens def test_lex(): assert(get_tokens("foo") == [("blob", "foo")...
memphis-iis/gluten
gluten/auth.py
"""Flask Blueprint adding login functionality to our app. Note that we expect gluten model and db config to be handled elsewhere """ import sys import traceback from functools import partial, wraps from flask import redirect, request, flash, session, abort, g, url_for from flask.globals import LocalProxy, _lookup_ap...
googleapis/python-area120-tables
google/area120/tables_v1alpha1/types/__init__.py
# -*- coding: utf-8 -*- # Copyright 2022 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...
leotrubach/sourceforge-allura
ForgeGit/forgegit/tests/functional/test_controllers.py
import json import re import tg import pkg_resources import pylons pylons.c = pylons.tmpl_context pylons.g = pylons.app_globals from pylons import c from ming.orm import ThreadLocalORMSession from datadiff.tools import assert_equal from allura import model as M from allura.lib import helpers as h from allura.tests im...
apporc/neutron
neutron/extensions/quotasv2.py
# Copyright 2011 OpenStack Foundation. # 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 req...
mencattini/ideal-pancake
adt/tests/prog_test.py
from adt.util.prog import Prog from adt.util.literal import Literal from adt.util.expr import Expr from adt.util.unary_op import Unary_op from adt.util.binary_op import Binary_op from adt.util.block import Block from adt.util.context import Context from adt.util.instr import Instr from adt.types.bool import Bool from ...
hanlind/nova
nova/tests/unit/virt/xenapi/image/test_glance.py
# Copyright 2013 OpenStack Foundation # 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...
Juniper/py-space-platform
jnpr/space/connection.py
# # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER # # Copyright (c) 2015 Juniper Networks, Inc. # All rights reserved. # # Use is subject to license terms. # # 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...
bytejive/lazy-docker
CommandBuilder.py
import Utils from Utils import printe class CommandBuilder(object): def __init__(self, *command_args): self.command_args = list(command_args) def append(self, *args): for arg in args: if isinstance(arg, str): self.command_args += [arg] elif isinstance(...
projectcalico/calico
calicoctl/tests/st/utils/utils.py
# Copyright (c) 2015-2016 Tigera, 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 applicabl...
GoogleCloudPlatform/psq
psq/psqworker.py
#!/usr/bin/env python # Copyright 2015 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
openstack/os-collect-config
os_collect_config/tests/test_cfn.py
# Copyright (c) 2013 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 required by applica...
kedz/cuttsum
trec2015/sbin/reports/raw-stream-count.py
import streamcorpus as sc import cuttsum.events import cuttsum.corpora from cuttsum.trecdata import SCChunkResource from cuttsum.pipeline import ArticlesResource, DedupedArticlesResource import os import pandas as pd from datetime import datetime from collections import defaultdict import matplotlib.pylab as plt plt.st...
Tesora/tesora-tempest
tempest/api/compute/servers/test_create_server.py
# Copyright 2012 OpenStack Foundation # 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...
verilylifesciences/classifaedes
classifaedes/hparams_lib_test.py
# Copyright 2019 Verily Life Sciences 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed t...
giorgioladu/Rapa
portal.py
# -*- coding: utf-8 -*- # # portal.py # # # # # # # # # # # # # Copyright 2016 Giorgio Ladu <giorgio.ladu >at< gmail.com> # # # # ...
stafur/pyTRUST
paypal-rest-api-sdk-python/samples/subscription/billing_agreements/suspend_and_re_activate.py
from paypalrestsdk import BillingAgreement import logging BILLING_AGREEMENT_ID = "I-HT38K76XPMGJ" try: billing_agreement = BillingAgreement.find(BILLING_AGREEMENT_ID) print("Billing Agreement [%s] has state %s" % (billing_agreement.id, billing_agreement.state)) suspend_note = { "note": "Suspendin...
sebrandon1/nova
nova/tests/unit/api/openstack/placement/test_util.py
# # 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 # ...
quarkslab/irma
probe/tests/modules/antivirus/test_avg.py
from .test_antivirus import AbstractTests import modules.antivirus.avg.avg as module import modules.antivirus.base as base from mock import patch from pathlib import Path class TestAvg(AbstractTests.TestAntivirus): name = "AVG AntiVirus Free (Linux)" scan_path = Path("/usr/bin/avgscan") scan_args = ('--he...
tartavull/google-cloud-python
datastore/tests/unit/test_query.py
# Copyright 2014 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
odyssey4me/monitoring-scripts
check_virsh_domains.py
#!/usr/bin/python # # Script to determine the performance statistics and other information # related to libvirt guests # https://github.com/odyssey4me/monitoring-scripts # # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may o...
SauloAislan/ironic
ironic/api/app.py
# -*- encoding: utf-8 -*- # Copyright © 2012 New Dream Network, LLC (DreamHost) # 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....
bswartz/manila
manila/tests/conf_fixture.py
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a ...
e0ne/cinder
cinder/tests/test_smbfs.py
# Copyright 2014 Cloudbase Solutions Srl # # 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 ...
google/tink
python/tink/_keyset_reader_test.py
# 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, ...