repo_name
stringlengths
5
104
path
stringlengths
4
248
content
stringlengths
102
99.9k
yugangw-msft/azure-cli
src/azure-cli/azure/cli/command_modules/privatedns/_format.py
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
garygriswold/Bible.js
Versions/Release.2.x.x/py/AudioDBPChapter.py
# This program collects verse meta data for all books and chapters that have this data # import io import sqlite3 import urllib2 import json HOST = "https://dbt.io/"; KEY = "key=b37964021bdd346dc602421846bf5683&v=2"; output = io.open("sql/AudioChapterTable.sql", mode="w", encoding="utf-8") output.write(u"DROP TABLE ...
piotrlewalski/birdstorm
game/utils/config.py
import os import logging logging.basicConfig( format="%(levelname)s:%(name)s: %(message)s", level=logging.DEBUG, ) class Config: def __getattr__(self, item): try: return os.environ[item.upper()] except KeyError: logging.warning("Config variable not set %s" % item)...
tiborsimko/reana-job-controller
tests/test_job_manager.py
# -*- coding: utf-8 -*- # # This file is part of REANA. # Copyright (C) 2019, 2020, 2021 CERN. # # REANA is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. """REANA-Job-Controller Job Manager tests.""" import json import os import uuid ...
Show-Me-the-Code/python
fybhp/practice2/practice2.py
# -*- coding:utf-8 -*- import MySQLdb import MySQLdb.cursors import string import random # 表在workbench中已建好.sql语句见pra2.sql # 该方法较为底层了,有时间再用SQLAlchemy来实现此脚本. map = {} db = MySQLdb.connect(host='localhost',user='root',passwd='501826') curs = db.cursor() db.select_db('activation_code') def id_generator(size=...
jianjunz/online-judge-solutions
leetcode/1731-even-odd-tree.py
# Definition for a binary tree node. # class TreeNode: # def __init__(self, val=0, left=None, right=None): # self.val = val # self.left = left # self.right = right class Solution: def isEvenOddTree(self, root: TreeNode) -> bool: q=collections.deque([root]) level=...
roxyboy/openpyxl
openpyxl/reader/style.py
# file openpyxl/reader/style.py # Copyright (c) 2010 openpyxl # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, m...
xaxa89/mitmproxy
mitmproxy/flow.py
import time import uuid from mitmproxy import controller # noqa from mitmproxy import stateobject from mitmproxy import connections from mitmproxy import version import typing # noqa class Error(stateobject.StateObject): """ An Error. This is distinct from an protocol error response (say, a ...
lmazuel/azure-sdk-for-python
azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/network_watcher_paged.py
# 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 ...
wolvespack/alcor
alcor/services/simulations/grid.py
import logging from itertools import product from typing import (Iterator, Dict, Tuple, List) from alcor.types import (NumericType, GridParametersInfoType) logger = logging.getLogger(__name__) def parameters_values( paramet...
foresterh/slackbot
slackbot/dispatcher.py
# -*- coding: utf-8 -*- from __future__ import absolute_import import logging import re import time import traceback from six import iteritems from slackbot.utils import to_utf8, WorkerPool logger = logging.getLogger(__name__) AT_MESSAGE_MATCHER = re.compile(r'^\<@(\w+)\>:? (.*)$') class MessageDispatcher(object):...
Dioptas/pymatgen
pymatgen/analysis/tests/test_reaction_calculator.py
# coding: utf-8 from __future__ import unicode_literals import unittest from pymatgen import Composition from pymatgen.analysis.reaction_calculator import Reaction, BalancedReaction, \ ReactionError, ComputedReaction from pymatgen.entries.computed_entries import ComputedEntry class ReactionTest(unittest.TestCa...
madhurauti/Map-Polygon
modules/tests/org/create_office.py
""" Sahana Eden Module Automated Tests - ORG002 Create Office @copyright: 2011-2012 (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 the Softwar...
konono/equlipse
openstack-install/charm/trusty/charm-keystone/tests/charmhelpers/contrib/openstack/amulet/deployment.py
# Copyright 2014-2015 Canonical Limited. # # 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 ...
Azure/azure-sdk-for-python
sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/operations/__init__.py
# 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 ...
martbhell/wasthereannhlgamelastnight
src/lib/google/oauth2/_reauth_async.py
# Copyright 2021 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, ...
pombredanne/pycco
pycco/main.py
#!/usr/bin/env python """ "**Pycco**" is a Python port of [Docco](http://jashkenas.github.com/docco/): the original quick-and-dirty, hundred-line-long, literate-programming-style documentation generator. It produces HTML that displays your comments alongside your code. Comments are passed through [Markdown](http://dar...
Southpaw-TACTIC/TACTIC
3rd_party/python2/site-packages/cherrypy/test/test_encoding.py
# coding: utf-8 import gzip import io from unittest import mock from six.moves.http_client import IncompleteRead from six.moves.urllib.parse import quote as url_quote import cherrypy from cherrypy._cpcompat import ntob, ntou from cherrypy.test import helper europoundUnicode = ntou('£', encoding='utf-8') sing = nt...
CZ-NIC/conpot
conpot/protocols/snmp/command_responder.py
# Command Responder (GET/GETNEXT) # Based on examples from http://pysnmp.sourceforge.net/ import logging from pysnmp.entity import config from pysnmp.entity.rfc3413 import context from pysnmp.carrier.asynsock.dgram import udp from pysnmp.entity import engine from pysnmp.smi import builder import gevent from conpot.p...
gstiebler/odemis
src/odemis/cli/test/subscribe_example.py
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 28 Aug 2012 @author: piel ''' from odemis.cli import main def print_speed(speed): print speed def print_res(res): print "%d x %d" % (res[0], res[1]) if __name__ == '__main__': comp = main.get_component("FakePIGCS") comp.speed.subscribe...
sixuanwang/SAMSaaS
wirecloud-develop/src/wirecloud/catalogue/south_migrations/0006_refresh_resource_cache.py
# -*- coding: utf-8 -*- from south.v2 import DataMigration from wirecloud.catalogue.utils import update_resource_catalogue_cache class Migration(DataMigration): def forwards(self, orm): update_resource_catalogue_cache(orm) def backwards(self, orm): update_resource_catalogue_cache(orm) ...
christianurich/VIBe2UrbanSim
3rdparty/opus/src/synthesizer/synthesizer_algorithm/prepare_data.py
# PopGen 1.1 is A Synthetic Population Generator for Advanced # Microsimulation Models of Travel Demand # Copyright (C) 2009, Arizona State University # See PopGen/License import MySQLdb import numpy import adjusting_sample_joint_distribution import drawing_households import psuedo_sparse_matrix import time ...
Nitrate/Nitrate
src/tcms/xmlrpc/api/testcase.py
# -*- coding: utf-8 -*- import itertools from django.contrib.auth.decorators import permission_required from django.core.exceptions import ObjectDoesNotExist from django.forms import EmailField import tcms.comments.models from tcms.core.utils import form_error_messages_to_list, timedelta2int from tcms.issuetracker.m...
msmbuilder/msmbuilder-legacy
Extras/parallel_assign/tests/test_script.py
import sys, os, shutil import subprocess import tempfile import time import numpy.testing as npt from nose.tools import eq_, ok_ import IPython as ip from msmbuilder import io, metrics from common import fixtures_dir from parallel_assign.scripts import AssignParallel def test_setup_logger(): progname = 'TEST PROG...
andrewjss/uftrace
tests/t017_no_libcall.py
#!/usr/bin/env python from runtest import TestBase class TestCase(TestBase): def __init__(self): TestBase.__init__(self, 'abc', """ # DURATION TID FUNCTION [28141] | main() { [28141] | a() { [28141] | b() { 1.430 us [28141] | c(); 1.915 us [2814...
fightforthefuture/idl-members
internetdefense/apps/analytics/migrations/0001_initial.py
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Impression' db.create_table('analytics_impression', ( ('id', self.gf('django.db....
vladimir-ipatov/ganeti
test/py/ganeti.hypervisor.hv_chroot_unittest.py
#!/usr/bin/python # # Copyright (C) 2011 Google 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 2 of the License, or # (at your option) any later version. # # This program...
Nitrate/Nitrate
src/tcms/issuetracker/migrations/0020_update_help_text_verbose_names.py
# Generated by Django 3.1.3 on 2021-03-02 14:05 import django.core.validators from django.db import migrations, models import django.db.models.deletion import tcms.issuetracker.validators class Migration(migrations.Migration): dependencies = [ ("management", "0010_set_auto_now_add_on_attachment_create_d...
eldie1984/Scripts
pg/scripts mios/python/prueba_post.py
# -*- coding: utf-8 -*- import urllib class enviar_datos: def conectar(self,host,campo,valor): self.variables=[] self.valores=[] self.campo = campo self.valor = valor self.host = host self.datos = {} for campo_variables,valor_variables in zip(self.campo.split(":"),self.valor.sp...
christianurich/VIBe2UrbanSim
3rdparty/opus/src/urbansim/gridcell/ln_total_employment_within_walking_distance.py
# Opus/UrbanSim urban simulation software. # Copyright (C) 2005-2009 University of Washington # See opus_core/LICENSE from opus_core.variables.variable import Variable, ln_bounded from variable_functions import my_attribute_label class ln_total_employment_within_walking_distance(Variable): """Natural log ...
sergeLabo/mpff
game_server/labtools/labconfig.py
#! /usr/bin/env python3 # -*- coding: utf-8 -*- ## labconfig.py ############################################################################# # Copyright (C) Labomedia October 2016 # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as p...
fxia22/ASM_xf
PythonD/site_python/MMTK/ForceFields/Amber/AmberForceField.py
# This file provides the Amber force field, using Amber parameter files. # # Written by Konrad Hinsen # last revision: 2000-9-25 # _undocumented = 1 from MMTK.ForceFields import MMForceField import AmberData import os # # Read parameter files # Amber94 = None Amber91 = None OPLS = None this_directory = os.path.spli...
boegel/hanythingondemand
hod/config/writer/_hadoop.py
# # # Copyright 2009-2016 Ghent University # # This file is part of hanythingondemand # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en), # the Hercules foundat...
kaplun/Invenio-OpenAIRE
modules/miscutil/lib/urlutils_tests.py
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2009, 2010, 2011 CERN. ## ## Invenio 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 yo...
kylazhang/virt-test
qemu/tests/rv_clearx.py
""" This restarts the x server on all vms by killing gdm in order to eliminate any side effects and running applications that might interfere with tests. """ import logging from autotest.client.shared import error from virttest.aexpect import ShellCmdError from virttest import utils_misc def is_pid_alive(session, pi...
Araneidae/cothread
old_tests/test-select.py
#!/usr/bin/env python3 # Testing coselect import require from cothread import * import threading import time def ThreadTicker(queue): while True: print('tick',) queue.Signal('tick') time.sleep(1) def Listener(queue, n): while True: x = queue.Wait() print('listener'...
eiinfuva/huffman-algorithm-ac
graphviz/__init__.py
# graphviz - create dot, save, render, view """Assemble DOT source code and render it with Graphviz. >>> dot = Digraph(comment='The Round Table') >>> dot.node('A', 'King Arthur') >>> dot.node('B', 'Sir Bedevere the Wise') >>> dot.node('L', 'Sir Lancelot the Brave') >>> dot.edges(['AB', 'AL']) >>> dot.e...
aglitke/vdsm
vdsm/netconf/iproute2.py
# Copyright 2013 Red Hat, 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 2 of the License, or # (at your option) any later version. # # This program is distributed in the ...
dracos/QGIS
python/plugins/processing/algs/qgis/SpatialJoin.py
# -*- coding: utf-8 -*- """ *************************************************************************** SpatialJoin.py --------------------- Date : October 2013 Copyright : (C) 2013 by Joshua Arnott Email : josh at snorfalorpagus dot net *******************...
lkhomenk/integration_tests
cfme/tests/networks/test_sdn_navigation.py
import pytest from cfme.cloud.provider.azure import AzureProvider from cfme.cloud.provider.ec2 import EC2Provider from cfme.cloud.provider.gce import GCEProvider from cfme.cloud.provider.openstack import OpenStackProvider from cfme.networks.provider import NetworkProvider from cfme.utils.appliance.implementations.ui i...
testcraftsman/testpool
testpool/db/testpool_pool/api.py
# Copyright (c) 2015-2018 Mark Hamilton, All rights reserved """ Holds views for tests results. """ # from django.shortcuts import render import logging from rest_framework.renderers import JSONRenderer from django.http import HttpResponse from django.http import JsonResponse from django.views.decorators.csrf import ...
zhengjue/mytornado
omserver/OMServer/modules/saltstack/Mid_1007.py
# -*- coding: utf-8 -*- from Public_lib import * #重启应用模块进程服务# class Modulehandle(): def __init__(self,moduleid,hosts,sys_param_row): self.hosts = "" self.Runresult = "" self.moduleid = moduleid self.sys_param_array= sys_param_row self.hosts=target_host(hosts,"HN").split(";")...
afourmy/pyNMS
pyNMS/pyQT_widgets/Q_dict_tree_view.py
from PyQt5.QtWidgets import QTreeView from PyQt5.QtGui import QStandardItem, QStandardItemModel class QDictTreeView(QTreeView): def __init__(self, data=None): super().__init__() self.header().hide() self.root_model = QStandardItemModel() self.setModel(self.root_model) i...
kthordarson/CouchPotatoServer
couchpotato/core/plugins/score/main.py.LOCAL.21288.py
# -*- coding: utf-8 -*- from couchpotato.core.event import addEvent from couchpotato.core.helpers.encoding import toUnicode from couchpotato.core.helpers.variable import getTitle, splitString from couchpotato.core.logger import CPLog from couchpotato.core.plugins.base import Plugin from couchpotato.core.plugins.score.s...
jmiserez/pox
pox/core.py
# Copyright 2011 James McCauley # # This file is part of POX. # # POX 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. # # POX is distri...
maliciamrg/xbmc-addon-tvtumbler
resources/lib/transmissionrpc/constants.py
# -*- coding: utf-8 -*- # Copyright (c) 2008-2013 Erik Svensson <erik.public@gmail.com> # Licensed under the MIT license. import logging from six import iteritems LOGGER = logging.getLogger('transmissionrpc') LOGGER.setLevel(logging.ERROR) def mirror_dict(source): """ Creates a dictionary with al...
Pythonify/awesome
venv/lib/python2.7/site-packages/fabric/contrib/project.py
""" Useful non-core functionality, e.g. functions composing multiple operations. """ from __future__ import with_statement from os import getcwd, sep import os.path from tempfile import mkdtemp from fabric.network import needs_host, key_filenames, normalize from fabric.operations import local, run, sudo, put from fab...
alephu5/Soundbyte
environment/lib/python3.3/site-packages/IPython/utils/localinterfaces.py
"""Simple utility for building a list of local IPs using the socket module. This module defines two constants: LOCALHOST : The loopback interface, or the first interface that points to this machine. It will *almost* always be '127.0.0.1' LOCAL_IPS : A list of IP addresses, loopback first, that point to t...
skoslowski/gnuradio
gr-audio/python/audio/__init__.py
# # Copyright 2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-3.0-or-later # # ''' Blocks to connect to audio sources (mic-in) and sinks (speaker-out) ports on a computer. The underlying hardware driver is system and OS dependent and this module should automatic...
DolphinDream/sverchok
nodes/field/scalar_field_eval.py
import numpy as np import bpy from bpy.props import FloatProperty, EnumProperty, BoolProperty, IntProperty, StringProperty from sverchok.node_tree import SverchCustomTreeNode from sverchok.data_structure import updateNode, zip_long_repeat, ensure_nesting_level, match_long_repeat from sverchok.utils.modules.eval_form...
nickhand/nbodykit
nbodykit/io/tpm.py
from .binary import BinaryFile class TPMBinaryFile(BinaryFile): """ Read snapshot binary files from Martin White's TPM simulations. These files are stored column-wise with a format, with a header of size 28 bytes to begin the file. The columns are: * Position : 'f4', 'f8' precision t...
adam-iris/mailman
src/mailman/commands/cli_control.py
# Copyright (C) 2009-2014 by the Free Software Foundation, Inc. # # This file is part of GNU Mailman. # # GNU Mailman 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...
XeCycle/indico
indico/modules/oauth/provider_test.py
# This file is part of Indico. # Copyright (C) 2002 - 2015 European Organization for Nuclear Research (CERN). # # Indico 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 (a...
Chandra-MARX/marxs
marxs/math/tests/test_rotation.py
# Licensed under GPL version 3 - see LICENSE.rst import numpy as np import pytest from transforms3d import axangles from ..rotations import ex2vec_fix, axangle2mat def is_orthogonal(a): '''Return True is a matrix is orthonormal''' try: if (a.ndim == 2) and (a.shape[0] == a.shape[1]): retur...
eort/OpenSesame
libqtopensesame/widgets/color_edit.py
#-*- coding:utf-8 -*- """ This file is part of OpenSesame. OpenSesame 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. OpenSesame is distri...
LA-Toth/dwa
pylintcheckers/unusedimports.py
import ast from pylint.interfaces import IRawChecker from pylint.checkers import BaseChecker from logilab.common.testlib import unittest_main from astroid import test_utils from pylint.testutils import CheckerTestCase, Message MSGS = { 'W1611': ( 'Unused import %s', 'nnx-unused-import', ...
olenz/espresso
config/check_myconfig_complete.py
# Copyright (C) 2014 The ESPResSo project # Copyright (C) 2012,2013 Olaf Lenz # # This file is part of ESPResSo. # # ESPResSo 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...
jonyroda97/redbot-amigosprovaveis
lib/matplotlib/artist.py
from __future__ import (absolute_import, division, print_function, unicode_literals) import six from collections import OrderedDict, namedtuple from functools import wraps import inspect import re import warnings import numpy as np import matplotlib from . import cbook, docstring, rcParams f...
matt-hayden/cutils
internal/unit_testing.py
## INFO ######################################################################## ## ## ## cutils ## ## ====== ...
github4ry/pathomx
pathomx/plugins/nmr/bruker_import.py
import os import pandas as pd import nmrglue as ng import numpy as np import scipy as sp import re def load_bruker_fid(fn, pc_init=None, config={}): try: print("Reading %s" % fn) # read in the bruker formatted data dic, data = ng.bruker.read(fn, read_prog=False) except Exception as e:...
Vagab0nd/SiCKRAGE
lib3/rebulk/chain.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Chain patterns and handle repetiting capture group """ # pylint: disable=super-init-not-called import itertools from .builder import Builder from .loose import call from .match import Match, Matches from .pattern import Pattern, filter_match_kwargs, BasePattern from .r...
michaelgugino/turbo-lister
sqlalchemy/__init__.py
# sqlalchemy/__init__.py # Copyright (C) 2005-2013 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php from .sql import ( alias, and_, asc, between, bindparam, ...
dsibournemouth/autoweka
scripts/table_configurations_latex.py
import argparse import os from config import * from table_configurations import parse_configuration def get_results(dataset): conn = sqlite3.connect(database_file) c = conn.cursor() c.execute('''SELECT dataset, configuration, cast(error as REAL) as error, cast(test_error as REAL) as test_error ...
pyfa-org/Pyfa
graphs/gui/stylePickers.py
# ============================================================================= # Copyright (C) 2010 Diego Duclos # # This file is part of pyfa. # # pyfa 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 ...
cs-au-dk/Artemis
WebKit/Tools/Scripts/webkitpy/tool/steps/update_unittest.py
# Copyright (C) 2011 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
Servir-Mekong/SurfaceWaterTool
lib/google/api_core/gapic_v1/config.py
# Copyright 2017 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, s...
migeruhito/sagenb
sagewui/util/newui.py
# New UI from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from time import strftime from time import time from .templates import prettify_time_ago def extended_wst_basic(wst, nb): d = wst.basic d.update({ ...
IEMLdev/propositions-restful-server
scripts/dictionary_tools.py
import io import boto3 from ieml.dictionary.dictionary import Dictionary from ieml.dictionary.tools import term from ieml.dictionary.version import get_available_dictionary_version, create_dictionary_version, \ DictionaryVersion, latest_dictionary_version from ieml.dictionary.script import script, m, NullScript, ...
mmagnus/rna-pdb-tools
rna_tools/tools/mini_moderna3/moderna/sequence/ModernaAlphabet.py
#!/usr/bin/env python # # ModernaAlphabet.py # # Defines alphabet for RNA including modifications. # # http://iimcb.genesilico.pl/moderna/ # __author__ = "Magdalena Rother, Tomasz Puton, Kristian Rother" __copyright__ = "Copyright 2008, The Moderna Project" __credits__ = ["Janusz Bujnicki"] __license__ = "GPL" __main...
akhileshpillai/treeherder
treeherder/model/migrations/0036_job_details_unique_together.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('model', '0035_job_detail_field_lengths_decrease'), ] operations = [ migrations.RunSQL( # Using ALTER IGNORE so t...
paulrouget/servoshell
python/servo/bootstrap_commands.py
# Copyright 2013 The Servo Project Developers. See the COPYRIGHT # file at the top-level directory of this distribution. # # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or # http://www.apache.org/licenses/LICENSE-2.0> or the MIT license # <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your #...
kaze/paasmaker
paasmaker/common/job/prepare/service.py
# # Paasmaker - Platform as a Service # # 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 json import paasmaker from paasmaker.common.core import constants from...
ESOedX/edx-platform
common/djangoapps/entitlements/utils.py
""" Utility methods for the entitlement application. """ from __future__ import absolute_import import logging from django.utils import timezone from course_modes.models import CourseMode from openedx.core.djangoapps.content.course_overviews.models import CourseOverview from student.models import CourseEnrollment ...
nttks/edx-ora2
openassessment/management/tests/test_create_oa_submissions.py
""" Tests for the management command that creates dummy submissions. """ from submissions import api as sub_api from openassessment.assessment.api import peer as peer_api from openassessment.assessment.api import self as self_api from openassessment.management.commands import create_oa_submissions from django.test imp...
uclouvain/OSIS-Louvain
education_group/tests/ddd/factories/domain/study_domain.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 ...
openaid-IATI/OIPA
OIPA/iati_synchroniser/migrations/0001_initial.py
# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2017-04-24 14:34 from __future__ import unicode_literals import datetime from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('iati_organisation', '0001...
teltek/edx-platform
openedx/core/djangoapps/ace_common/tests/test_templatetags.py
# pylint: disable=missing-docstring from django.template import VariableDoesNotExist from django.test import override_settings from openedx.core.djangoapps.ace_common.templatetags.ace import ( ensure_url_is_absolute, with_link_tracking, google_analytics_tracking_pixel, _get_google_analytics_tracking_ur...
open-synergy/social
mail_tracking_mass_mailing/models/mail_mail.py
# -*- coding: utf-8 -*- # © 2016 Antonio Espinosa - <antonio.espinosa@tecnativa.com> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp import models, api class MailMail(models.Model): _inherit = "mail.mail" @api.model def _tracking_email_prepare(self, mail, partner, email...
tdipisa/ckanext-multilang
ckanext/multilang/model/package_multilang.py
import sys import logging from sqlalchemy import types, Column, Table, ForeignKey from sqlalchemy import orm from ckan.lib.base import config from ckan import model from ckan.model import Session from ckan.model import meta from ckan.model.domain_object import DomainObject from ckan import model log = logging.getL...
gs0510/coala-bears
bears/perl/PerlCriticBear.py
import platform from coalib.bearlib.abstractions.Linter import linter from dependency_management.requirements.DistributionRequirement import ( DistributionRequirement) from coalib.results.RESULT_SEVERITY import RESULT_SEVERITY @linter(executable=('perlcritic.bat' if platform.system() == 'Wind...
slevenhagen/odoomrp-wip-npg
product_pricelist_rules/models/product_pricelist.py
# -*- encoding: 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...
uclouvain/osis
base/forms/learning_unit/entity_form.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 ...
prarthitm/edxplatform
lms/djangoapps/courseware/tests/test_module_render.py
# -*- coding: utf-8 -*- """ Test for lms courseware app, module render unit """ from datetime import datetime import ddt import itertools import json from nose.plugins.attrib import attr from functools import partial from bson import ObjectId from django.http import Http404, HttpResponse from django.core.urlresolvers ...
uclouvain/OSIS-Louvain
base/migrations/0253_message_template_proposal_consolidate.py
# -*- coding: utf-8 -*- # Generated by Django 1.11.2 on 2017-10-31 13:01 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('base', '0252_auto_20180403_1028'), ] operations = [ migrations.RunSQL( ...
FSMaxB/molch
outcome/include/outcome/quickcpplib/include/gsl-lite/example/cmake-pkg/use-gsl-pkg.py
#!/usr/bin/env python # # Copyright 2015-2018 by Martin Moene # # gsl-lite is based on GSL: Guideline Support Library, # https://github.com/microsoft/gsl # # This code is licensed under the MIT License (MIT). # # example/cmake-pkg/use-gsl-pkg.py # from __future__ import print_function import argparse import os # g...
mfherbst/spack
var/spack/repos/builtin/packages/sbt/package.py
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
nirbheek/cerbero
cerbero/bootstrap/site-patch.py
# Originally kept from https://github.com/pypa/setuptools/pull/2166/files def __boot(): import sys import os PYTHONPATH = os.environ.get('PYTHONPATH') if PYTHONPATH is None or (sys.platform == 'win32' and not PYTHONPATH): PYTHONPATH = [] else: PYTHONPATH = PYTHONPATH.split(os.pathse...
ProjectSWGCore/NGECore2
scripts/mobiles/corellia/grassland_slice_hound.py
import sys from services.spawn import MobileTemplate from services.spawn import WeaponTemplate from resources.datatables import WeaponType from resources.datatables import Difficulty from resources.datatables import Options from java.util import Vector def addTemplate(core): mobileTemplate = MobileTemplate() mobi...
lizardsystem/lizard5-apps
lizard_wms/migrations/0020_rename_name.py
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): db.rename_column('lizard_wms_wmssource', 'name', 'layer_name') def backwards(self, orm): db.rename_colu...
lablup/sorna-manager
src/ai/backend/manager/models/alembic/versions/8e660aa31fe3_add_resource_presets.py
"""add-resource-presets Revision ID: 8e660aa31fe3 Revises: 01456c812164 Create Date: 2019-03-30 01:45:07.525096 """ from alembic import op from decimal import Decimal import sqlalchemy as sa from ai.backend.manager.models.base import ResourceSlotColumn from ai.backend.manager.models import keypair_resource_policies f...
studiocoop/maya-coop
scripts/coopRestart.py
''' @name: coopRestart.py @repository: https://github.com/studiocoop/maya @version: 1.0 @license: UNLICENCE @authors: Santiago Montesdeoca [artineering.io] @summary: Script to restart maya after it has been closed @requires: coopLib @run: import coopLib as lib (sugg...
huntxu/fuel-web
nailgun/nailgun/test/unit/test_snapshot_conf.py
# -*- coding: utf-8 -*- # Copyright 2014 Mirantis, 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 requi...
tommyip/zulip
zerver/tests/test_outgoing_webhook_system.py
# -*- coding: utf-8 -*- import ujson import logging import mock import requests from typing import Any, Optional from zerver.lib.outgoing_webhook import ( do_rest_call, GenericOutgoingWebhookService, SlackOutgoingWebhookService, ) from zerver.lib.test_classes import ZulipTestCase from zerver.lib.topic i...
joachimmetz/plaso
tests/storage/reader.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Tests for the storage reader.""" import unittest from plaso.containers import event_sources from plaso.storage import identifiers from plaso.storage import reader from plaso.storage.fake import fake_store from tests.storage import test_lib class StorageReaderTest(t...
annegentle/magnum
magnum/tests/unit/api/utils.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 # d...
caseyrollins/osf.io
api_tests/applications/views/test_application_detail.py
import pytest import mock from website.util import api_v2_url from tests.base import assert_dict_contains_subset from osf_tests.factories import ApiOAuth2ApplicationFactory, AuthUserFactory def _get_application_detail_route(app): path = 'applications/{}/'.format(app.client_id) return api_v2_url(path, base_ro...
cc1-cloud/cc1
src/wi/commontags/__init__.py
# -*- coding: utf-8 -*- # @COPYRIGHT_begin # # Copyright [2010-2014] Institute of Nuclear Physics PAN, Krakow, Poland # # 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.apac...
log2timeline/plaso
plaso/storage/fake/event_heap.py
# -*- coding: utf-8 -*- """Heap to sort events in chronological order.""" import heapq class EventHeap(object): """Event heap.""" def __init__(self): """Initializes an event heap.""" super(EventHeap, self).__init__() self._heap = [] @property def number_of_events(self): """int: number of se...
dragorosson/heat
heat/engine/rsrc_defn.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 # d...
notmyname/swift
test/unit/account/test_backend.py
# Copyright (c) 2010-2012 OpenStack Foundation # # 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...