code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
"""Clean up notifications schema, some other parts.
Revision ID: 2979a1322381
Revises: 2b478162b2b7
Create Date: 2020-03-03 07:32:54.113550
"""
from alembic import op
# revision identifiers, used by Alembic.
revision = "2979a1322381"
down_revision = "2b478162b2b7"
def upgrade():
op.drop_index("ix_notification_... | pudo/aleph | aleph/migrate/versions/2979a1322381_cleanup.py | Python | mit | 712 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Intangible()
result.template = "object/draft_schematic/space/capacitor/shared_heavy_battery_mk5.iff"
result.attri... | anhstudios/swganh | data/scripts/templates/object/draft_schematic/space/capacitor/shared_heavy_battery_mk5.py | Python | mit | 462 |
import json
import numpy as np
import matplotlib.pyplot as plt
file = raw_input('File to read: ')
sn = file.split('.')[0]
f = open(file,'r')
data=json.load(f)
f.close()
lc = []
for i in data[sn]['photometry']:
try:
time = i['time']
mag = i['magnitude']
try: err = i['e_magnitude']
... | astrocatalogs/supernovae | scripts/json_to_phot.py | Python | mit | 1,197 |
"""
Set up the plot figures, axes, and items to be done for each frame.
This module is imported by the plotting routines and then the
function setplot is called to set the plot parameters.
"""
import os
import numpy as np
import matplotlib.pyplot as plt
import datetime
from clawpack.geoclaw.util import fetch... | mandli/surge-examples | michael/setplot.py | Python | mit | 11,195 |
from django.test import TestCase
from mock import NonCallableMock
from silk.collector import DataCollector
from silk.middleware import SilkyMiddleware
from .util import delete_all_models
from silk.config import SilkyConfig
from silk.models import Request
def fake_get_response():
def fake_response():
retu... | mtford90/silk | project/tests/test_config_meta.py | Python | mit | 1,493 |
""" import the necessary modules """
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy.sql import text
# Create a class that will give us an object that we can use to connect to a database
class MySQLConnection(object):
def __init__(self, app, db):
config = {
'host': 'localhost',
... | jiobert/python | Quintana_Jerrod/Assignments/f+sql_projects/full_friends/mysqlconnection.py | Python | mit | 2,239 |
"""
The controller base class
"""
from .routes import Route
from .view import View
class Controller(object):
def __init__(self, entity, env):
"""Instantiate a controller with the name of the entity and the
environment dict.
"""
self.entity = entity.strip('/^$')
if not self.... | bis12/yapwaf | yapwaf/controller.py | Python | mit | 2,107 |
"""Handle nice names"""
import base64
from pysyte.oss import platforms
def nice(data):
return base64.b64encode(bytes(data, 'utf-8'))
def name(data):
return base64.b64decode(data).decode('utf-8')
def chmod(data, *_):
platforms.put_clipboard_data(name(data))
return ''
| jalanb/jab | src/python/site/οs.py | Python | mit | 291 |
# -*- coding: utf-8 -*-
'''
flixnet Add-on
Copyright (C) 2016 flixnet
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... | repotvsupertuga/repo | script.module.stream.tvsupertuga.addon/resources/lib/indexers/episodes.py | Python | gpl-2.0 | 65,914 |
from geoalchemy2.elements import WKTElement
from osmnames.prepare_data.prepare_data import merge_corresponding_linestrings
def test_touching_linestrings_with_same_name_and_parent_id_get_merged(session, tables):
session.add(
tables.osm_linestring(
id=1,
osm_id=1111,
... | philippks/OSMNames | tests/prepare_data/test_merge_corresponding_linestrings.py | Python | gpl-2.0 | 7,141 |
from __future__ import print_function
# Listen to hotplug events. Can be used to listen for hotplug events and
# similar things, like network connections being (un)plugged.
import os
import socket
import six
class NetlinkSocket(socket.socket):
def __init__(self):
NETLINK_KOBJECT_UEVENT = 15 # hasn't landed in sock... | openatv/enigma2 | lib/python/Components/Netlink.py | Python | gpl-2.0 | 951 |
# -*- coding: utf-8 -*-
#
# This file is a plugin for EventGhost.
# Copyright © 2005-2020 EventGhost Project <http://www.eventghost.net/>
#
# EventGhost 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 v... | tfroehlich82/EventGhost | plugins/CyberlinkUniversalRemote/__init__.py | Python | gpl-2.0 | 4,075 |
import logging, time, os, sys, re
from autotest.client.shared import error
from autotest.client import utils
from autotest.client.shared.syncdata import SyncData
from virttest import data_dir, env_process, utils_test, aexpect
@error.context_aware
def run_floppy(test, params, env):
"""
Test virtual floppy of g... | sathnaga/virt-test | qemu/tests/floppy.py | Python | gpl-2.0 | 18,545 |
# -*- coding: utf-8 -*-
"""
:created: 27 Aug 2014
:author: Éric Piel
:copyright: © 2014 Éric Piel, Delmic
This file is part of Odemis.
.. license::
Odemis 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 ... | delmic/odemis | src/odemis/gui/conf/test/conf_test.py | Python | gpl-2.0 | 6,386 |
# Copyright (C) 2007 Canonical Ltd
#
# 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 ... | Distrotech/bzr | bzrlib/bisect_multi.py | Python | gpl-2.0 | 2,731 |
#
# Brian C. Lane <bcl@redhat.com>
#
# Copyright 2012 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. This program is distributed in the hope that it
# will be useful,... | dashea/pykickstart | tests/commands/reboot.py | Python | gpl-2.0 | 2,617 |
"""
Custom model managers.
"""
from django.db import models
import json
class DocumentQuerySet(models.QuerySet):
def _to_feature(self, obj):
return {
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [obj.get('locations__location__lon... | upconsulting/jhb-explorer | explorer/managers.py | Python | gpl-2.0 | 1,722 |
# Rekall Memory Forensics
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# 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 v... | google/rekall | rekall-core/rekall/plugins/overlays/windows/tcpip_vtypes.py | Python | gpl-2.0 | 26,975 |
#
# Python class library loaded when the interpreter
# is installed by PythonEmbed
#--------------------------------------------------
# API for accessing GC data
#--------------------------------------------------
# basic activity data
def __GCactivity(join="repeat", activity=None):
rd={}
for x in range(0,GC.s... | amtriathlon/GoldenCheetah | src/Resources/python/library.py | Python | gpl-2.0 | 3,658 |
"""
BoxDotNet Module
"""
import os, sys
import traceback
import md5
import logging
log = logging.getLogger("modules.BoxDotNet")
import conduit
import conduit.utils as Utils
import conduit.Web as Web
import conduit.dataproviders.DataProvider as DataProvider
import conduit.Exceptions as Exceptions
from conduit.datatypes... | GNOME/conduit | conduit/modules/BoxDotNetModule/BoxDotNetModule.py | Python | gpl-2.0 | 11,179 |
# -*- coding: utf-8 -*-
# coding: UTF-8
#
# Copyright 2010-2015 The pygit2 contributors
#
# This file 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 Foundation.
#
# In addition to the permissions in the GNU G... | Sheeo/pygit2 | setup.py | Python | gpl-2.0 | 6,812 |
# -*- coding: utf-8 -*-
"""
Copyright (C) 2018-2018 plugin.video.youtube
SPDX-License-Identifier: GPL-2.0-only
See LICENSES/GPL-2.0-only for more information.
"""
import xbmc
if __name__ == '__main__':
xbmc.executebuiltin("Container.Refresh")
| jdf76/plugin.video.youtube | resources/lib/youtube_plugin/refresh.py | Python | gpl-2.0 | 263 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
LTTng User Space Tracing backend.
"""
__author__ = "Lluís Vilanova <vilanova@ac.upc.edu>"
__copyright__ = "Copyright 2012-2016, Lluís Vilanova <vilanova@ac.upc.edu>"
__license__ = "GPL version 2 or (at your option) any later version"
__maintainer__ = "Stefan ... | palmer-dabbelt/riscv-qemu | scripts/tracetool/backend/ust.py | Python | gpl-2.0 | 804 |
import attr
from navmazing import NavigateToAttribute
from cfme.common import Taggable
from cfme.exceptions import ItemNotFound
from cfme.modeling.base import BaseCollection, BaseEntity, parent_of_type
from cfme.networks.views import SecurityGroupDetailsView, SecurityGroupView
from cfme.utils import version
from cfme.... | lkhomenk/integration_tests | cfme/networks/security_group.py | Python | gpl-2.0 | 2,621 |
# -*- coding: utf-8 -*-
import wx
from outwiker.gui.testeddialog import TestedDialog
class OverwriteDialog(TestedDialog):
def __init__(self, *args, **kwds):
super(OverwriteDialog, self).__init__(*args, **kwds)
self.textLabel = wx.StaticText(self,
-1,
... | unreal666/outwiker | src/outwiker/gui/dialogs/overwritedialog.py | Python | gpl-3.0 | 3,191 |
# -*- coding: utf-8 -*-
# ####################################################################
# Copyright (C) 2005-2009 by the FIFE team
# http://www.fifengine.de
# This file is part of FIFE.
#
# FIFE is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# ... | parpg/parpg | tools/map_editor/scripts/gui/input.py | Python | gpl-3.0 | 1,824 |
import pygame
import os, sys
from pygame.locals import *
import socketserver
import socket
def min(a, b):
return a if a < b else b
''' Load an animation strip.'''
def load_strip(filename, nframes, width=None, height=None, colorkey=None):
full_image, full_rect = load_image(filename, width=width, height=height)... | mokuki082/EggDrop | code/helper.py | Python | gpl-3.0 | 1,600 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# This file is part of Ansible
#
# Ansible 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.
#... | supertom/ansible-modules-core | cloud/digital_ocean/digital_ocean_block_storage.py | Python | gpl-3.0 | 11,293 |
#
# rtlsdr_scan
#
# http://eartoearoak.com/software/rtlsdr-scanner
#
# Copyright 2012 - 2015 Al Brown
#
# A frequency scanning GUI for the OsmoSDR rtl-sdr library at
# http://sdr.osmocom.org/trac/wiki/rtl-sdr
#
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Gene... | mvdroest/RTLSDR-Scanner | src/misc.py | Python | gpl-3.0 | 6,123 |
# -*- coding: utf-8 -*-
from module.plugins.internal.DeadCrypter import DeadCrypter
class FilebeerInfoFolder(DeadCrypter):
__name__ = "FilebeerInfoFolder"
__type__ = "crypter"
__pattern__ = r"http://(?:www\.)?filebeer\.info/(\d+~f).*"
__version__ = "0.02"
__description__ = """Filebeer.info Folder... | chaosmaker/pyload | module/plugins/crypter/FilebeerInfoFolder.py | Python | gpl-3.0 | 413 |
# Copyright 2008-2018 Davide Alberani <da@erlug.linux.it>
# 2008-2018 H. Turgut Uyar <uyar@tekir.org>
#
# 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,... | Vagab0nd/SiCKRAGE | lib3/imdb/parser/http/searchCompanyParser.py | Python | gpl-3.0 | 2,406 |
import argparse
import json
import pymongo
from bson.objectid import ObjectId
from pprint import pprint
from os import path
parser = argparse.ArgumentParser(description='Load Variant Effect Prediction JSON file to MongoDB.')
parser.add_argument('--url', default='mongodb://localhost:27017/', help="MongoDB URL, default... | INMEGEN/MCAC | vep_etl/vep_etl_mongo.py | Python | gpl-3.0 | 818 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# === This file is part of Calamares - <https://calamares.io> ===
#
# SPDX-FileCopyrightText: 2014 Anke Boersma <demm@kaosx.us>
# SPDX-FileCopyrightText: 2015 Philip Müller <philm@manjaro.org>
# SPDX-FileCopyrightText: 2016 Teo Mrnjavac <teo@kde.org>
# SPDX-FileC... | calamares/calamares | src/modules/localecfg/main.py | Python | gpl-3.0 | 6,225 |
import time
from cloudbot import hook
@hook.command(autohelp=False)
def beats(text):
"""beats -- Gets the current time in .beats (Swatch Internet Time). """
if text.lower() == "wut":
return "Instead of hours and minutes, the mean solar day is divided " \
"up into 1000 parts called \".... | nidhididi/CloudBot | plugins/time_plugin.py | Python | gpl-3.0 | 1,073 |
# (C) British Crown Copyright 2010 - 2013, Met Office
#
# This file is part of Iris.
#
# Iris is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option) any l... | kwilliams-mo/iris | lib/iris/tests/test_pp_to_cube.py | Python | gpl-3.0 | 10,648 |
#@+leo-ver=5-thin
#@+node:lee.20141223114246.40: * @file example2.py
#@@language python
#@@tabwidth -4
import cherrypy
import random
from std.asciisymbol import asciiImage
#@+others
#@+node:lee.20141223114246.41: ** class Application
class Application(object):
#@+others
#@+node:lee.20141223114246.42: *3* def i... | Openandgit/2014cpb_final_project- | std/b40323208.py | Python | gpl-3.0 | 9,435 |
#!/usr/bin/env python
"""
@file districtMapper.py
@author Daniel Krajzewicz
@date 2007-07-26
@version $Id: districtMapper.py 12567 2012-08-20 10:01:44Z dkrajzew $
<documentation missing>
SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
Copyright (C) 2007-2012 DLR (http://www.dlr.de/) and co... | rudhir-upretee/SUMO_Src | tools/district/districtMapper.py | Python | gpl-3.0 | 5,678 |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
import matplotlib.pyplot as plt
def plot_diagram(plot_data, x, y, size='Size'):
fig, ax = plt.subplots()
ax = plot_data.plot.scatter(
x,
y,
s=plot_data[size] * 100,
alpha=0.7,
title="Portfolio-Analyse",
figsi... | feststelltaste/software-analytics | demos/20180731_Munich/ausi/portfolio.py | Python | gpl-3.0 | 1,400 |
"""Config file for coverage.py"""
import os, re, sys
from .backward import string_class, iitems
# In py3, # ConfigParser was renamed to the more-standard configparser
try:
import configparser # pylint: disable=F0401
except ImportError:
import ConfigParser as configparser
class Ha... | davy39/eric | DebugClients/Python/coverage/config.py | Python | gpl-3.0 | 7,122 |
# -*- coding: utf-8 -*-
import os, sys, time, multiprocessing, re
from .processes import ForkedProcess
from .remoteproxy import ClosedError
from ..python2_3 import basestring, xrange
class CanceledError(Exception):
"""Raised when the progress dialog is canceled during a processing operation."""
pass
class Pa... | SpaceGroupUCL/qgisSpaceSyntaxToolkit | esstoolkit/external/pyqtgraph/multiprocess/parallelizer.py | Python | gpl-3.0 | 12,494 |
import os
from .utils import exec_cmd, get_frappe, check_git_for_shallow_clone, get_config, build_assets, restart_supervisor_processes, get_cmd_output, run_frappe_cmd
import logging
import requests
import semantic_version
import json
import re
import subprocess
logger = logging.getLogger(__name__)
class MajorVersio... | plakesr/bench | bench/app.py | Python | gpl-3.0 | 5,892 |
#!/usr/bin/env python
# pylint: disable=C0103,W0622
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015 Leandro Toledo de Souza <leandrotoeldodesouza@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser Public ... | AndrewSamokhvalov/python-telegram-bot | telegram/user.py | Python | gpl-3.0 | 2,099 |
###############################################################################
# Name: errdlg.py #
# Purpose: Error Reporter Dialog #
# Author: Cody Precord <cprecord@editra.org> #
... | ezequielpereira/Time-Line | libs/wx/tools/Editra/src/eclib/errdlg.py | Python | gpl-3.0 | 11,900 |
#===============================================================================
# Copyright (C) 2014-2019 Anton Vorobyov
#
# This file is part of Phobos.
#
# Phobos 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 ... | DarkFenX/Phobos | miner/fsd_lite.py | Python | gpl-3.0 | 3,930 |
from entity_reader import EntityReader
import textract
from dataset_importer.utils import HandleDatasetImportException
class RTFReader(EntityReader):
@staticmethod
def get_features(**kwargs):
directory = kwargs['directory']
for file_path in RTFReader.get_file_list(directory, 'rtf'):
try:
features = R... | texta-tk/texta | dataset_importer/document_reader/readers/entity/rtf_reader.py | Python | gpl-3.0 | 750 |
# This file is part of PRAW.
#
# PRAW 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.
#
# PRAW is distributed in the hope that it will ... | dmarx/praw | praw/errors.py | Python | gpl-3.0 | 14,656 |
# coding: utf8
# Copyright 2014-2017 CERN. This software is distributed under the
# terms of the GNU General Public Licence version 3 (GPL Version 3),
# copied verbatim in the file LICENCE.md.
# In applying this licence, CERN does not waive the privileges and immunities
# granted to it by virtue of its status as an I... | blond-admin/BLonD | __EXAMPLES/main_files/EX_07_Ions.py | Python | gpl-3.0 | 6,437 |
# -*- 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):
# Changing field 'OutboundMessage.status'
db.alter_column(u'nuntium_outboundmessage', 'status', self.gf('dj... | TEDICpy/write-it | nuntium/migrations/0010_auto__chg_field_outboundmessage_status.py | Python | gpl-3.0 | 4,921 |
from __future__ import division
import StringIO
import json
import random
import sys
from twisted.internet import defer
import p2pool
from p2pool.bitcoin import getwork
from p2pool.util import expiring_dict, jsonrpc, variable
class _Provider(object):
def __init__(self, parent, long_poll):
self.parent = ... | boinggg/p2pool | p2pool/bitcoin/worker_interface.py | Python | gpl-3.0 | 4,275 |
import bpy
from fashion_project.modules.draw.detail_tool.detail_tool import ToolDetail
class FP_DetailTool(bpy.types.Operator):
'''
Инструмент деталь:
создает замкнутый контур
'''
bl_idname = "fp.detail_tool"
bl_label = "FP_DetailTool"
@classmethod
def poll(cls, context):
return ToolDetail().poll... | TriumphLLC/FashionProject | modules/operators/tools/detail_tool/detail_tool.py | Python | gpl-3.0 | 579 |
"""A collection of tokenizers for use with ankura import pipelines"""
import re
import bs4
# Note: Each tokenizer takes in a string, and returns a list of tokens
def split(data):
"""A tokenizer which does nothing but splitting"""
return data.split()
def simple(data, splitter=split):
"""A basic tokeni... | nOkuda/ankura | ankura/tokenize.py | Python | gpl-3.0 | 1,360 |
import serial
import time
ser = serial.Serial(
port = "/dev/ttyACM0",
baudrate = 9600,
bytesize = serial.EIGHTBITS
)
time.sleep(2)
ser.write("\x36\x20\x00")
print(hex(ord(ser.read(1))))
print(hex(ord(ser.read(1))))
print(hex(ord(ser.read(1))))
print(hex(ord(ser.read(1))))
print(hex(o... | DelusionalLogic/TAS-100 | python/test.py | Python | gpl-3.0 | 571 |
d = {"k1":1, "k2":"valore", 3:"val3", "quattro":4}
for x in d.values():
print(x)
print(" ")
for x in d.keys():
print(x)
print(" ")
for x in d.items():
print(x)
print(x[0], x[1])
| lstorchi/teaching | xyzviewer/datastr/diz2.py | Python | gpl-3.0 | 194 |
#!/usr/bin/python
# This file is part of Ansible
#
# Ansible 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.
#
# Ansible is distributed... | az7arul/ansible-modules-core | cloud/amazon/cloudformation.py | Python | gpl-3.0 | 13,418 |
# -*- coding: utf-8 -*-
"""Get the pollen count for a UK postcode."""
import dave.module
from bs4 import BeautifulSoup
from requests import get
from twisted.words.protocols.irc import assembleFormattedText, attributes as A
import dave.config
@dave.module.help("Syntax: pollen [first part of postcode]. Get the forecast... | w4/belle | dave/modules/pollen.py | Python | gpl-3.0 | 1,618 |
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2016-2020 Florian Bruhin (The-Compiler) <me@the-compiler.org>
# Copyright 2016-2018 Anna Kobak (avk) <awerk@onet.eu>:
#
# This file is part of qutebrowser.
#
# qutebrowser is free software: you can redistribute it and/or modify
# it under the terms of the ... | t-wissmann/qutebrowser | tests/unit/misc/test_pastebin.py | Python | gpl-3.0 | 3,668 |
# -*- coding: utf-8 -*-
"""
Created on Wed Aug 17 05:52:09 2016
@author: hclqaVirtualBox1
"""
from object_test import session
import random
import string
import model
test_page = model.Page()
N = 5
test_page.title = ''.join(random.SystemRandom().choice(string.ascii_uppercase + string.digits) for _ in range(N))
test... | mayankjohri/LetsExplorePython | Section 2 - Advance Python/Chapter S2.04 - Database/code/sqlalchemy/runbook.py | Python | gpl-3.0 | 2,255 |
import os
import sys
from django.conf import settings
if not settings.configured:
settings_dict = dict(
INSTALLED_APPS=(
#'django.contrib.contenttypes',
'inspector_panel',
'inspector_panel.tests',
),
DATABASES={
"default": {
... | NESCent/feedingdb | debug-inspector-panel/runtests.py | Python | gpl-3.0 | 808 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
other property
"""
import copy
from rebulk import Rebulk, Rule, RemoveMatch, RenameMatch, POST_PROCESS, AppendMatch
from rebulk.remodule import re
from ..common import dash
from ..common import seps
from ..common.pattern import is_disabled
from ..common.validators imp... | Vagab0nd/SiCKRAGE | lib3/guessit/rules/properties/other.py | Python | gpl-3.0 | 16,391 |
from allauth.socialaccount.forms import SignupForm as BaseSignupForm
from django import forms
from django.core import validators
from django.utils.translation import gettext_lazy as _
USERNAME_REQUIRED = _("Username is required.")
USERNAME_SHORT = _(
"Username is too short (%(show_value)s characters). "
"It m... | Elchi3/kuma | kuma/users/signup.py | Python | mpl-2.0 | 1,747 |
#
# 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 logging
import paasmaker
from apirequest import APIRequest, APIRespons... | kaze/paasmaker | paasmaker/common/api/application.py | Python | mpl-2.0 | 4,363 |
# coding: utf-8
from django import forms
from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy as _
from registration import forms as registration_forms
from kobo.static_lists import SECTORS, COUNTRIES
USERNAME_REGEX = r'^[a-z][a-z0-9_]+$'
USERNAME_MAX_LENGTH = 30
USERNAME_INV... | onaio/kpi | kpi/forms.py | Python | agpl-3.0 | 1,879 |
# -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in module root
# directory
##############################################################################
import re
from openerp import netsvc
from openerp.... | adhoc-dev/odoo-nautical | nautical/partner.py | Python | agpl-3.0 | 957 |
# -*- encoding: utf-8 -*-
################################################################################
# #
# Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol #
# ... | odoousers2014/odoo_addons-2 | clv_batch/history/__init__.py | Python | agpl-3.0 | 1,429 |
# -*- coding: utf-8 -*-
"""
sphinx.quickstart
~~~~~~~~~~~~~~~~~
Quickly setup documentation source to work with Sphinx.
:copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import sys, os, time, re
from os import path
from codecs import open... | superdesk/Live-Blog | documentor/libraries/Sphinx-1.1.3-py3.2/sphinx/quickstart.py | Python | agpl-3.0 | 35,318 |
# -*- coding: utf-8 -*-
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import date_diff, getdate, formatdate, cint, month_diff, flt
from frappe.model.docu... | gsnbng/erpnext | erpnext/hr/doctype/payroll_period/payroll_period.py | Python | agpl-3.0 | 4,141 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import flt, get_datetime, format_datetime
class StockOverReturnError(frappe.ValidationError): pass... | grupozeety/CDerpnext | erpnext/controllers/sales_and_purchase_return.py | Python | agpl-3.0 | 7,916 |
# -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2016, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import unicode_literals
from django import forms
from djang... | hrayr-artunyan/shuup | shuup/front/apps/auth/views.py | Python | agpl-3.0 | 4,411 |
"""Tests of email marketing signal handlers."""
import logging
import ddt
from django.test import TestCase
from django.test.utils import override_settings
from mock import patch
from util.json_request import JsonResponse
from email_marketing.signals import handle_unenroll_done, \
email_marketing_register_user, \
... | waheedahmed/edx-platform | lms/djangoapps/email_marketing/tests/test_signals.py | Python | agpl-3.0 | 8,373 |
"""
Asset compilation and collection.
"""
from __future__ import print_function
import argparse
import glob
import os
import traceback
from datetime import datetime
from functools import wraps
from threading import Timer
from paver import tasks
from paver.easy import call_task, cmdopts, consume_args, needs, no_help,... | procangroup/edx-platform | pavelib/assets.py | Python | agpl-3.0 | 34,154 |
# coding=utf-8
import logging
from urllib import urlencode
import datetime
import mimetypes
import cgi
from ckan.common import config
from paste.deploy.converters import asbool
import paste.fileapp
import ckan.logic as logic
import ckan.lib.base as base
import ckan.lib.i18n as i18n
import ckan.lib.maintain as maint... | dadosgovbr/ckanext-dadosabertos | ckanext/dadosgovbr/controllers/scheming.py | Python | agpl-3.0 | 12,430 |
"""
Tests for Discussion API views
"""
from datetime import datetime
import json
from urlparse import urlparse
import ddt
import httpretty
import mock
from nose.plugins.attrib import attr
from openedx.core.djangoapps.user_api.accounts.image_helpers import get_profile_image_storage
from pytz import UTC
from django.cor... | waheedahmed/edx-platform | lms/djangoapps/discussion_api/tests/test_views.py | Python | agpl-3.0 | 70,488 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-09-02 14:39
from __future__ import unicode_literals
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('reference', '0004_educationinstitution'),
]
operation... | uclouvain/osis | reference/migrations/0005_auto_20160902_1639.py | Python | agpl-3.0 | 5,965 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | grap/OCB | addons/project/project.py | Python | agpl-3.0 | 77,400 |
'''
Tests for student activation and login
'''
import json
import unittest
from django.test import TestCase
from django.test.client import Client
from django.test.utils import override_settings
from django.conf import settings
from django.contrib.auth.models import User
from django.core.cache import cache
from django.... | devs1991/test_edx_docmode | common/djangoapps/student/tests/test_login.py | Python | agpl-3.0 | 26,838 |
#!/usr/bin/env python3
# This Source Code Form is licensed MPL-2.0: http://mozilla.org/MPL/2.0
"""
Generate C source code from a binary file.
"""
import sys, re, zlib
zformat = False
with_resource_entry = False
prefix = ''
class Printer:
def print_data (self, data):
self.pad = False
self.lines = []
self... | swesterfeld/beast | misc/packres.py | Python | lgpl-2.1 | 2,957 |
"""SCons.Tool.suncc
Tool-specific initialization for Sun Solaris (Forte) CC and cc.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004 The SCons Foundation
#
# Permission... | bilke/OpenSG-1.8 | SConsLocal/scons-local-0.96.1/SCons/Tool/suncc.py | Python | lgpl-2.1 | 1,732 |
import errno
import os
import tempfile
from contextlib import contextmanager
from shutil import rmtree
def mkdir_p(d):
"""Python 3.2 has an optional argument to os.makedirs called exist_ok. To
support older versions of python we can't use this and need to catch
exceptions"""
try:
os.makedirs(... | martynjarvis/stb-tester | _stbt/utils.py | Python | lgpl-2.1 | 986 |
##############################################################################
# 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... | tmerrick1/spack | var/spack/repos/builtin/packages/py-psyclone/package.py | Python | lgpl-2.1 | 2,637 |
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... | ProjectSWGCore/NGECore2 | scripts/mobiles/endor/gondula_shaman.py | Python | lgpl-3.0 | 3,133 |
# coding=utf-8
from __future__ import absolute_import
__author__ = "Gina Häußge <osd@foosel.net>"
__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
__copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms of the AGPLv3 License"
import logging
import os
im... | rossonet/RAM | OctoPrint/src/octoprint/filemanager/storage.py | Python | lgpl-3.0 | 35,942 |
from ajenti.ui import *
from ajenti.com import implements
from ajenti.app.api import ICategoryProvider
from ajenti.app.helpers import *
from ajenti.utils import *
import backend
class UsersPlugin(CategoryPlugin):
text = 'Users'
icon = '/dl/users/icon_small.png'
folder = 'system'
platform =['Ubuntu', ... | Shanto/ajenti | plugins/users/main.py | Python | lgpl-3.0 | 10,193 |
"""
Amazon MWS Finances API
"""
from __future__ import absolute_import
from ..mws import MWS
# from .. import utils
from ..decorators import next_token_action
class Finances(MWS):
"""
Amazon MWS Finances API
Docs:
http://docs.developer.amazonservices.com/en_US/finances/Finances_Overview.html
"""... | Bobspadger/python-amazon-mws | mws/apis/finances.py | Python | unlicense | 2,941 |
#!/usr/bin/python -u
from __future__ import print_function
import json
import optparse
import sys
import subprocess
parser = optparse.OptionParser()
parser.add_option('--buck-test-info')
(options, args) = parser.parse_args()
if options.buck_test_info is not None:
with open(options.buck_test_info) as f:
... | Dominator008/buck | test/com/facebook/buck/cli/testdata/external_test_runner/test_runner.py | Python | apache-2.0 | 425 |
import os
import sys
#PYTHON_DIR = join(dirname(__file__), '/opt/ofelia/vt_manager/src/python/')
PYTHON_DIR = os.path.join(os.path.dirname(__file__), "../..")
# This is needed because wsgi disallows using stdout
sys.stdout = sys.stderr
os.environ['DJANGO_SETTINGS_MODULE'] = 'vt_manager.settings.settingsLoader'
sys.... | dana-i2cat/felix | vt_manager/src/python/vt_manager/tests/deleteVM.py | Python | apache-2.0 | 538 |
#!/usr/bin/env python
import sys
import copy
import rospy,sys
import moveit_commander
import actionlib
import roslib; roslib.load_manifest('ur_modern_driver')
import tf
from control_msgs.msg import *
from trajectory_msgs.msg import *
from sensor_msgs.msg import JointState
from geometry_msgs.msg import PoseStamped,Pos... | robotic-ultrasound-image-system/ur5 | universal_robot-kinetic-devel/ur_modern_driver-master/planvios.py | Python | apache-2.0 | 3,473 |
#!/usr/bin/env python
# Copyright 2012, Julius Seporaitis
#
# 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 ... | mbrossard/yum-s3-iam | s3iam.py | Python | apache-2.0 | 9,027 |
from dvc.prompt import confirm
def test_confirm_in_tty_if_stdin_is_closed(mocker):
mock_input = mocker.patch("dvc.prompt.input", side_effect=EOFError)
mock_isatty = mocker.patch("sys.stdout.isatty", return_value=True)
ret = confirm("message")
mock_isatty.assert_called()
mock_input.assert_called()
... | dmpetrov/dataversioncontrol | tests/unit/test_prompt.py | Python | apache-2.0 | 339 |
# coding: utf-8
"""
Kubeflow Pipelines API
This file contains REST API specification for Kubeflow Pipelines. The file is autogenerated from the swagger definition.
Contact: kubeflow-pipelines@google.com
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import ... | kubeflow/pipelines | backend/api/python_http_client/test/test_api_run_storage_state.py | Python | apache-2.0 | 1,436 |
# -*- coding: utf-8 -*-
from django.urls import path
from search.views import SearchPageView, SearchProjectView
urlpatterns = [
path(
route='',
view=SearchProjectView.as_view(),
name='index'
),
path(
route='pages/',
view=SearchPageView.as_view(),
name='pages... | srtab/alexandriadocs | alexandriadocs/search/urls.py | Python | apache-2.0 | 331 |
import sys
sys.path.insert(1,"../../../")
import h2o
from tests import pyunit_utils
import numpy as np
def glrm_arrests_miss():
missing_ratios = np.arange(0.1, 1, 0.1).tolist()
print "Importing USArrests.csv data and saving for validation..."
arrests_full = h2o.upload_file(pyunit_utils.locate("smal... | pchmieli/h2o-3 | h2o-py/tests/testdir_algos/glrm/pyunit_DEPRECATED_arrests_missingGLRM.py | Python | apache-2.0 | 3,136 |
# Copyright 2014 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
"""Versioned singleton entity with global application configuration.
Example usage:
from components.datastore_utils import config
class MyCo... | luci/luci-py | appengine/components/components/datastore_utils/config.py | Python | apache-2.0 | 4,914 |
#
# Copyright (c) SAS Institute 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 w... | sassoftware/rmake | rmake/messagebus/envelope.py | Python | apache-2.0 | 14,277 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""Tests for the CLI tools classes."""
import argparse
import io
import sys
import unittest
from plaso.cli import tools
from tests.cli import test_lib
class CLIToolTest(test_lib.CLIToolTestCase):
"""Tests for the CLI tool base class."""
_EXPECTED_BASIC_OPTIONS = u'\n'... | ostree/plaso | tests/cli/tools.py | Python | apache-2.0 | 10,715 |
'''
This case can not execute parallelly
@author: Youyk
'''
import os
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.test_state as test_state
import zstackwoodpecker.operations.host_operations as host_ops
import zstackwoodpecker.operations.re... | zstackorg/zstack-woodpecker | integrationtest/vm/virt_plus/qos/test_net_outbound_inbound_qos2.py | Python | apache-2.0 | 2,786 |
"""
WSGI config for hoaxdetector project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_... | barliant/fnc-id | django_project/old/hoaxdetector/hoaxdetector/wsgi.py | Python | apache-2.0 | 401 |
# -*- coding: utf-8 -*-
from django.core.exceptions import ValidationError
from nose.tools import * # flake8: noqa (PEP8 asserts)
from modularodm.exceptions import NoResultsFound, ValidationValueError
from tests.base import OsfTestCase
from osf_tests.factories import SubjectFactory, PreprintFactory, PreprintProviderF... | hmoco/osf.io | tests/test_subjects.py | Python | apache-2.0 | 7,079 |
from time import sleep
from datetime import datetime
import rethinkdb as r
import cryptoconditions as cc
from decorator import contextmanager
import bigchaindb
import bigchaindb.util
import bigchaindb.crypto
@contextmanager
def take_at_least_seconds(amount_in_seconds):
t_issued = datetime.now()
yield
... | bigchaindb/bigchaindb-examples | server/lib/models/assets.py | Python | apache-2.0 | 10,725 |
# 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, ... | firebase/firebase-ios-sdk | scripts/lib/checker.py | Python | apache-2.0 | 3,057 |
#!/usr/bin/env python2.7
# Copyright 2015 Cisco Systems, 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 applicabl... | tbarrongh/cosc-learning-labs | src/learning_lab/05_acl_list.py | Python | apache-2.0 | 1,742 |