code
stringlengths
3
1.05M
repo_name
stringlengths
5
104
path
stringlengths
4
251
language
stringclasses
1 value
license
stringclasses
15 values
size
int64
3
1.05M
#!/usr/bin/env python # -*- coding: utf-8 -*- """ This is an exercise for practising socket programming. Learning the basic concept of how a socket send and receive data from a client side. Below are functions that I have implementated in the Ftp Server and Ftp Client script. Ftp Server function: ~~~~~~~~~~~~~~~~~~~...
jcchoiling/learningPython
s13/Day09/ftp_server/ftp_server.py
Python
gpl-3.0
8,848
# -*- coding: utf-8 -*- # Generated by Django 1.9.8 on 2016-08-10 13:45 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('dcim', '0015_rack_add_u_height_validator'), ] opera...
Alphalink/netbox
netbox/dcim/migrations/0016_module_add_manufacturer.py
Python
apache-2.0
595
#!/usr/bin/env python # -*- coding: utf-8 -*- # # get-chromium - A Python script to retrieve the latest Chromium snapshots. # git repository: https://github.com/iceTwy/get-chromium.git # website: https://github.com/iceTwy/get-chromium # # author: ice...
iceTwy/get-chromium
get-chromium.py
Python
unlicense
10,015
# vi: ts=8 sts=4 sw=4 et # # uri.py: various URI related utilties # # This file is part of Draco2. Draco2 is free software and is made available # under the MIT license. Consult the file "LICENSE" that is distributed # together with this file for the exact licensing terms. # # Draco2 is copyright (c) 1999-2007 by the D...
geertj/draco2
draco2/util/uri.py
Python
mit
5,926
from collections import OrderedDict, namedtuple import functools import numpy as np from PyQt4 import QtGui from PyQt4.QtGui import QTreeView, QStandardItemModel, QStandardItem, \ QHeaderView, QItemDelegate from PyQt4.QtCore import Qt, QSize import Orange from Orange.evaluation import * from Orange.widgets impor...
qusp/orange3
Orange/widgets/evaluate/owtestlearners.py
Python
bsd-2-clause
15,291
# -*- coding: utf-8 -*- # This file is part of Shuup. # # Copyright (c) 2012-2021, Shuup Commerce Inc. All rights reserved. # # This source code is licensed under the OSL-3.0 license found in the # LICENSE file in the root directory of this source tree. import pytest from shuup.apps.provides import override_provides f...
shoopio/shoop
shuup_tests/front/test_basket_line_descriptor.py
Python
agpl-3.0
1,512
from jinja2 import Environment, StrictUndefined from pkg_resources import resource_string def load_template(name): template_string = resource_string('cob', f'templates/{name}.j2').decode('utf-8') return Environment(undefined=StrictUndefined).from_string(template_string)
getweber/weber-cli
cob/utils/templates.py
Python
bsd-3-clause
281
import os import sys import unittest import settestpath import logging import yum.logginglevels as logginglevels new_behavior = "NEW_BEHAVIOR" in os.environ.keys() from yum import YumBase from yum import transactioninfo from yum import packages from yum import packageSack from yum.constants import TS_INSTALL_STATES,...
rpm-software-management/yum
test/testbase.py
Python
gpl-2.0
19,405
#!/usr/bin/env python """ books.py reads a list of books from an input file and returns them filtered and sorted features - iterates through records without holding the entire dataset in memory, allowing for large datasets - uses SQLite for storage and retrieval """ import os import argparse import sqlite3 f...
danieltalsky/gp-code-test
books.py
Python
unlicense
1,974
# Copyright 2016 Timothy M. Shead # # This file is part of Pipecat. # # Pipecat 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. # # Pip...
shead-custom-design/pipecat
pipecat/json.py
Python
gpl-3.0
1,738
from __future__ import absolute_import class Difference(object): def __init__(self, path, message): self.path = path self.message = message def __unicode__(self): return u"%s: %s" % (self.path_string, self.message) def __str__(self): return str(unicode(self)) def _...
lomereiter/treecompare
treecompare/difference.py
Python
bsd-2-clause
855
from setuptools import setup, find_packages # Always prefer setuptools over distutils from codecs import open # To use a consistent encoding from os import path here = path.abspath(path.dirname(__file__)) # Get the long description from the relevant file with open(path.join(here, 'README.md'), encoding='utf-8') as ...
joshhanna/ccd-sum
setup.py
Python
mit
3,734
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import fields, models, api class Confirm(models.TransientModel): _name = 'confirm' _description = u'确认放款' def _get_confirm_id(self): return self.env['expense.account'].browse(self._context...
xhair/TopOdoo_Addons
ToproERP_Expense/wizard/expense_wizard.py
Python
agpl-3.0
1,180
""" Test of timeseries ingestion See http://predix01.cloud.answerhub.com/questions/21920/time-series-3.html?childToView=21931#answer-21931 and https://www.predix.io/resources/tutorials/tutorial-details.html?tutorial_id=1549&tag=1613&journey=Exploring%20Security%20services&resources=1594,1593,2105,1544,1549,2255,1951 ""...
mpi-sws-rse/thingflow-python
tests/test_predix.py
Python
apache-2.0
5,967
# -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-04-06 11:21 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('bus', '0016_auto_20170406_1113'), ] operations = [...
warlock57/bus_reservation
bus/migrations/0017_auto_20170406_1121.py
Python
mit
840
#!/usr/bin/env python # This file is part of nexdatas - Tango Server for NeXus data writer # # Copyright (C) 2012-2014 DESY, Jan Kotanski <jkotan@mail.desy.de> # # nexdatas is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the ...
nexdatas/recselector
test/ExDSItem_test.py
Python
gpl-3.0
3,177
# -*- coding: utf-8 -*- import re from app.common.http_methods import get_request from app.common.string_methods import everything_between, get_int_from_regex, get_values_from_regex from app.common.target_parse_strings import PM_NB_REGEX, PM_BOX_PM_IDS_REGEX, PM_BEGIN_MESSAGE_PATTERN, \ PM_END_MESSAGE_PATTERN fro...
egenerat/gae-django
app/pm/pm_parser.py
Python
mit
1,179
# -*- coding: utf-8 -*- """ Component management module for lpm A component definition consists of (at least): - an ID (part number) - a descriptive name - a description - a category - a list of suppliers - a list of manufacturers - a list of revisions consisting of: - a description - a list of files - a 'rele...
h-friederich/lpm
components.py
Python
bsd-3-clause
22,637
# Copyright 2013-2021 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 * class Professor(Package): """Professor Monte-Carlo tuning package""" homepage = "https://pr...
LLNL/spack
var/spack/repos/builtin/packages/professor/package.py
Python
lgpl-2.1
825
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source # & Institut Laue - Langevin # SPDX - License - Identifier: GPL - 3.0 + from __future__ import (absolute_import, divi...
mganeva/mantid
Framework/PythonInterface/test/python/plugins/algorithms/GetEiT0atSNSTest.py
Python
gpl-3.0
1,292
#!/usr/bin/env python # -*- coding: utf-8 -*- # # GuessIt - A library for guessing information from filenames # Copyright (c) 2012 Nicolas Wack <wackou@gmail.com> # # GuessIt is free software; you can redistribute it and/or modify it under # the terms of the Lesser GNU General Public License as published by # the Free ...
Branlala/docker-sickbeardfr
sickbeard/lib/guessit/transfo/guess_weak_episodes_rexps.py
Python
mit
2,126
import _plotly_utils.basevalidators class BordercolorValidator(_plotly_utils.basevalidators.ColorValidator): def __init__( self, plotly_name="bordercolor", parent_name="scattergeo.marker.colorbar", **kwargs ): super(BordercolorValidator, self).__init__( plot...
plotly/python-api
packages/python/plotly/plotly/validators/scattergeo/marker/colorbar/_bordercolor.py
Python
mit
510
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2014, 2015, 2016 Adam.Dybbroe # Author(s): # Adam.Dybbroe <a000680@c14526.ad.smhi.se> # 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 Foun...
adybbroe/pysatsynop-matchup
synop_dwd.py
Python
gpl-3.0
2,593
""" CTF API Configuration File Note this is just a python script. It does config things. """ from api.common import WebException import api import datetime import json import api.app """ FLASK """ #api.app.session_cookie_domain = "0.0.0.0" api.app.session_cookie_path = "/" api.app.session_cookie_name = "flask" #...
picoCTF/picoCTF-web
api/config.py
Python
mit
4,633
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2019, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
numenta/htmresearch
htmresearch/frameworks/pytorch/modules/k_winners.py
Python
agpl-3.0
9,177
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # 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) an...
mitodl/ansible
lib/ansible/constants.py
Python
gpl-3.0
11,103
# encoding: utf-8 from functools import reduce import grid_image_provider from ice.logs import logger class CombinedProvider(grid_image_provider.GridImageProvider): def __init__(self, *args): """ Creates a CombinedProvider out of the providers that were passed in `args` ORDER MATTERS. `image_for_rom...
scottrice/Ice
ice/gridproviders/combined_provider.py
Python
mit
1,232
import _plotly_utils.basevalidators class OpacityValidator(_plotly_utils.basevalidators.NumberValidator): def __init__(self, plotly_name="opacity", parent_name="barpolar", **kwargs): super(OpacityValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, ...
plotly/python-api
packages/python/plotly/plotly/validators/barpolar/_opacity.py
Python
mit
520
#! /usr/bin/env python # -*- coding: utf-8 -*- import os import shutil from lib_apk_shrink.model.DecompileConfig import DecompileConfig __author__ = 'tiantong' class JarDecompile(object): decompile_config = DecompileConfig() output_path_decompile = "" output_path_out = "" def __init__(self, decompi...
wtttc/apkshrink
lib_apk_shrink/instrument/JarDecompile.py
Python
mit
1,608
#!/usr/bin/python # -*- coding: utf-8; tab-width: 4; indent-tabs-mode: t -*- """ Role ==== Defines plugin managers that can handle configuration files similar to the ini files manipulated by Python's ConfigParser module. API === """ from yapsy.IPlugin import IPlugin from yapsy.PluginManagerDecorator import Plugin...
GeoDaCenter/CAST
yapsy/ConfigurablePluginManager.py
Python
gpl-3.0
10,403
def main(): print "hola" print "Como te llmas?" nombre = raw_input() print "Buenos dias", nombre print "Que edad tienes?" edad = raw_input() print "que bien te conservas para tener", edad main()
Djhacker18/Python
Practica1Conver.py
Python
gpl-2.0
202
import unittest from unittest import mock from flumine.markets.middleware import ( Middleware, SimulatedMiddleware, RunnerAnalytics, OrderStatus, OrderTypes, WIN_MINIMUM_ADJUSTMENT_FACTOR, PLACE_MINIMUM_ADJUSTMENT_FACTOR, LIVE_STATUS, ) from flumine.order.ordertype import MarketOnCloseO...
liampauling/flumine
tests/test_middleware.py
Python
mit
21,263
""" Пример: Пусть n = 3, т. е. есть три элемента (1, 2, 3). Пусть k = 2. Все различные сочетания из 3 элементов по 2: (1, 2), (1, 3), (2, 3). Различных сочетаний три, поэтому C(3, 2) = 3. Несложно понять, что C(n, 0) = 1, так как из n элементов выбрать 0 можно единственным образом, а именно, ничего не выбрать. Также н...
RootTeam/pytaskscollect
func/Stepic_1_3_Cnk.py
Python
mit
1,472
""" The `Sitemaps protocol <http://en.wikipedia.org/wiki/Sitemaps>`_ allows a webmaster to inform search engines about URLs on a website that are available for crawling. Django comes with a high-level framework that makes generating sitemap XML files easy. Install the sitemap application as per the `instructions in th...
rmaceissoft/django-photologue
photologue/sitemaps.py
Python
bsd-3-clause
1,809
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P. # 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/LICEN...
VTabolin/networking-vsphere
networking_vsphere/monitor/ovsvapp_monitor.py
Python
apache-2.0
14,206
import base64 import json import os import uuid import threading from multiprocessing.managers import AcquirerProxy, BaseManager, DictProxy class ServerDictManager(BaseManager): shared_data = {} def _get_shared(): return ServerDictManager.shared_data ServerDictManager.register("get_dict", ...
anthgur/servo
tests/wpt/web-platform-tests/tools/wptserve/wptserve/stash.py
Python
mpl-2.0
5,785
#!/usr/bin/python3 from flask import Flask import os import requests from flask import Flask, render_template, request import urllib.request import time from time import sleep import threading # performing multiple tasks at the same time from queue import Queue # " " app = Flask(__name__) # Initialising variables...
Aristocles/coopener
v2/smarthome/webtool.py
Python
gpl-3.0
4,099
widths = {'A': 667, 'AE': 944, 'Aacute': 667, 'Acircumflex': 667, 'Adieresis': 667, 'Agrave': 667, 'Aring': 667, 'Atilde': 667, 'B': 667, 'C': 667, 'Ccedilla': 667, 'D': 722, 'E': 667, 'Eacute': 667, 'Ecircumflex': 667, 'Edieresis': 667, 'Egrave': 667, 'Eth': 722, 'Euro': 500, 'F':...
olivierdalang/stdm
third_party/reportlab/pdfbase/_fontdata_widths_timesbolditalic.py
Python
gpl-2.0
3,897
#!/usr/bin/env python # -*- coding: utf-8 -*- import subprocess import sqlite3 from sys import stderr from os import system, path, makedirs from lm.dbhelper import Configure, ExperimentManager from lm.dbhelper import DEFAULT_CONF_DIR path_variable = 'LM_LOGS_PATH' DEFAULT_PARENT_LOG_DIRECTORY = './logs/' class Execu...
torotoki/lm
lm/run.py
Python
gpl-3.0
3,682
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
skosukhin/spack
var/spack/repos/builtin/packages/xedit/package.py
Python
lgpl-2.1
1,732
SCHEMA = { "type": "object", "properties": { "name": {"type" : "string"}, "amount": {"type" : "number"}, "currency_code": {"type" : "string"}, "interval": {"type" : "string"}, "interval_count": {"type" : "number"}, "trial_days": ...
culqi/culqi-python
culqi/schemas/plan.py
Python
mit
534
# -*- coding: utf-8 -*- from __future__ import print_function from __future__ import unicode_literals from __future__ import division from urlparse import urljoin from django.core.urlresolvers import reverse from django.shortcuts import get_object_or_404 from django.contrib.sites.models import Site from apps.core.mo...
RickMohr/nyc-trees
src/nyc_trees/apps/mail/views.py
Python
apache-2.0
1,504
import math from unittest import TestCase import datetime import plotly.figure_factory as ff import plotly.io as pio from plotly.exceptions import PlotlyError from plotly.tests.test_optional.optional_utils import NumpyTestUtilsMixin from plotly.graph_objs import graph_objs from plotly.tests.utils import TestCaseNoTem...
plotly/python-api
packages/python/plotly/plotly/tests/test_optional/test_tools/test_figure_factory.py
Python
mit
81,949
#! /usr/bin/env python # -*- coding: utf-8 -*- # CKAN-Toolbox -- Various modules that handle CKAN API and data # By: Emmanuel Raviart <emmanuel@raviart.com> # # Copyright (C) 2013 Etalab # http://github.com/etalab/ckan-toolbox # # This file is part of CKAN-Toolbox. # # CKAN-Toolbox is free software; you can redistrib...
etalab/ckan-toolbox
ckantoolbox/texthelpers.py
Python
agpl-3.0
3,182
import asyncio import subprocess import discord from discord.ext import commands from dinnerplate import BaseCog, JsonConfigManager from utils import reaction_menu from utils.errors import UserBlacklisted CONFIG = { "blacklist": [], "additional_statuses": [] } class Admin(BaseCog): def __init__(self, ...
DiNitride/GAFBot
modules/admin.py
Python
mit
9,254
from django.core.management.base import BaseCommand, CommandError from django.core.exceptions import ObjectDoesNotExist from stratosource.admin.models import Branch, Commit, Delta, TranslationDelta, DeployableObject import subprocess import popen2 from datetime import datetime import os class Command(BaseCommand): ...
StratoSource/StratoSource
stratosource/management/commands/fixer.py
Python
gpl-3.0
970
# coding: utf-8 __author__ = 'Paul Cunningham' __copyright = 'Copyright 2017, Paul Cunningham' from sqlalchemy import or_, and_ from flask_select2._compat import as_unicode, string_types from flask_select2.model.ajax import AjaxModelLoader, DEFAULT_PAGE_SIZE from .tools import get_primary_key, has_multiple_pks, is_re...
pjcunningham/Flask-Select2
flask_select2/contrib/sqla/ajax.py
Python
mit
3,339
#!/usr/bin/env python3 import asyncio import aiohttp import sys import requests import json import sys import string def eprint(message): print(message, file=sys.stderr) if len(sys.argv) == 3: base_url = sys.argv[1] apfrom = sys.argv[2] eprint("Restarting '{}' from '{}'".format(base_url, apfrom)) el...
amirouche/AjguDB
examples/wiki/dump.py
Python
gpl-2.0
2,756
from django.test import TransactionTestCase from django.core.files import File from django.contrib.auth.models import User from ...update import ( update_grant_facts_v2, ) from ...utils import import_data from ...models import ( GrantFactsV2, GrantFactsV2Update, ) from ..resources import GrantFactsV2Reso...
Code4SA/municipal-data
municipal_finance/tests/update/test_grant_facts_v2.py
Python
mit
1,824
import json import decimal import datetime from django.utils.timezone import is_aware from bson import objectid class VersatileJSONEncoder(json.JSONEncoder): """ JSONEncoder subclass that knows how to encode date/time, ObjectID and decimal types. """ def default(self, obj): # See "Date Time String Format" in ...
Pancho/failiac
external/encoders.py
Python
mit
960
# -*- coding: utf-8 -*- """ *************************************************************************** doProjection.py --------------------- Date : June 2010 Copyright : (C) 2010 by Giuseppe Sucameli Email : brush dot tyler at gmail dot com ***************...
bstroebl/QGIS
python/plugins/GdalTools/tools/doProjection.py
Python
gpl-2.0
7,359
import core from core import * dmide_objtree_icon_size = 32 class DMIDE_ObjTree(wx.ListCtrl): def __init__(self, parent): wx.ListCtrl.__init__(self, parent, ID_OBJTREE, style = wx.LC_ICON | wx.LC_VIRTUAL | wx.LC_EDIT_LABELS | wx.NO_BORDER) self.last_pos = -1 self.icons = [] self.Bind(wx.EVT_SIZE, self.OnSi...
nyov/dmide
core/panels/objtree2.py
Python
bsd-3-clause
4,575
# -*- 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): # Deleting field 'Boletin.fecha' db.delete_column(u'app_boletin', 'fecha') # Adding field 'Boletin....
henocdz/akdmik
app/migrations/0007_auto__del_field_boletin_fecha__add_field_boletin_date.py
Python
apache-2.0
9,976
import xbmc, xbmcgui, xbmcplugin, xbmcaddon, urllib, re, string, sys, os, buggalo plugin = "ESPN Video" __author__ = 'stacked <stacked.xbmc@gmail.com>' __url__ = 'http://code.google.com/p/plugin/' __date__ = '02-18-2015' __version__ = '2.0.5' settings = xbmcaddon.Addon(id='plugin.video.espn.video') buggalo.SUBMIT_URL...
stacked/plugin.video.espn.video
default.py
Python
gpl-2.0
12,998
import os import shutil import tempfile import vmprof import prof_six as six from _prof_imports import TreeStats, CallTreeStat class VmProfProfile(object): """ Wrapper class that represents VmProf Python profiling backend with API matching the cProfile. """ def __init__(self): self.stats...
siosio/intellij-community
python/helpers/profiler/vmprof_profiler.py
Python
apache-2.0
2,691
#!/usr/bin/env python3 """ The MIT License (MIT) Copyright (c) 2016 davide 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, co...
raspibo/Livello1
var/www/cgi-bin/valori2csv_search_date.py
Python
mit
2,996
"""SQLAlchemy Metadata and Session object""" from sqlalchemy import MetaData from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import scoped_session, sessionmaker __all__ = ['Session', 'metadata'] # SQLAlchemy database engine. Updated by model.init_model() engine = None # SQLAlchemy sessio...
veekun/spline
spline/model/meta.py
Python
mit
607
/* * Copyright (C) 2017 glbrimhall.com * * This file is part of an Elevator Simulator program written in java. * * Elevator Simulator 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, vers...
glbrimhall/elevator
python/src/ParseHelp.py
Python
gpl-3.0
1,255
# -*- coding: utf-8 -*- # Copyright(C) 2014 Romain Bignon # # This file is part of weboob. # # weboob 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 opti...
sputnick-dev/weboob
weboob/browser/filters/standard.py
Python
agpl-3.0
24,256
# coding: utf-8 from qgis.core import QgsMarkerSymbolV2 from qgis.gui import QgsSizeScaleWidget from qgis.utils import iface layer = iface.activeLayer() canvas = iface.mapCanvas() marker_symbol_v2 = QgsMarkerSymbolV2.createSimple({ 'color': 'blue', 'name': 'triangle' }) size_scale_widget = QgsSizeScaleWidget...
webgeodatavore/pyqgis-samples
gui/qgis-sample-QgsSizeScaleWidget.py
Python
gpl-2.0
411
import re from mal_types import (_symbol, _keyword, _list, _vector, _hash_map) class Blank(Exception): pass class Reader(): def __init__(self, tokens, position=0): self.tokens = tokens self.position = position def next(self): self.position += 1 return self.tokens[self.position...
alphaKAI/mal
python/reader.py
Python
mpl-2.0
3,275
# -*- coding: utf-8 -*- from __future__ import unicode_literals from plim.adapters.babelplugin import extract from plim.util import StringIO from .. import TestCaseBase class TestBabelPlugin(TestCaseBase): def test_babel_extractor(self): fileobj = StringIO(self.get_file_contents('babelplugin_test.plim')...
avanov/Plim
tests/adapters/test_babelplugin.py
Python
mit
1,051
# -*- coding: utf-8 -*- # Generated by Django 1.10.6 on 2017-04-05 14:47 from __future__ import unicode_literals from django.db import migrations from django.utils import timezone from temba.utils import chunk_list def apply_as_migration(apps, schema_editor): Flow = apps.get_model('flows', "Flow") FlowRun =...
onaio/rapidpro
temba/flows/migrations/0097_interrupt_runs_for_archived_flows.py
Python
agpl-3.0
1,586
from datetime import datetime from .base import Base __all__ = ["Plan"] class Plan(Base): def __init__(self, attrs={}): super(Plan, self).__init__(attrs) self.initialize_attr("amount", int) self.initialize_attr("created_at", datetime) self.initialize_attr("currency", str) ...
accepton/accepton-python
accepton/plan.py
Python
mit
444
# 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 * class BamReadcount(CMakePackage): """Bam-readcount generates metrics at single nucleotide positi...
iulian787/spack
var/spack/repos/builtin/packages/bam-readcount/package.py
Python
lgpl-2.1
562
class MirrorException(Exception): pass
EndPointCorp/lg_ros_nodes
lg_mirror/src/lg_mirror/__init__.py
Python
apache-2.0
43
#!/usr/bin/env python # -*- coding: utf-8 -*- """ test_geldmaschine ---------------------------------- Tests for `geldmaschine` module. """ import unittest from geldmaschine import main class TestGeldmaschine(unittest.TestCase): def setUp(self): pass def test_something(self): pass d...
elbaschid/geldmaschine
tests/test_geldmaschine.py
Python
mit
400
# Copyright 2017 Capital One Services, 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...
jimmyraywv/cloud-custodian
tests/test_directory.py
Python
apache-2.0
2,198
#!/usr/bin/python3 # Copyright 2014, Oliver Nagy <olitheolix@gmail.com> # # This file is part of Azrael (https://github.com/olitheolix/azrael) # # Azrael 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,...
daviddeng/azrael
viewer/model_import.py
Python
agpl-3.0
6,307
#!/usr/bin/env python """igcollect - Redis Copyright (c) 2018 InnoGames GmbH """ from argparse import ArgumentParser from subprocess import check_output from time import time def parse_args(): parser = ArgumentParser() parser.add_argument('--prefix', default='redis') return parser.parse_args() def mai...
innogames/igcollect
igcollect/redis.py
Python
mit
1,720
class BaseSchemaProvider: def __init__(self, driver): self.driver = driver def refresh(self, schema): raise NotImplementedError
andialbrecht/runsqlrun
rsr/schema/base.py
Python
mit
154
from __future__ import unicode_literals import json from django.test import TestCase, override_settings from django.utils.http import urlquote from django.core.urlresolvers import reverse from django.contrib.auth import get_user_model from django.contrib.auth.models import Permission from django.core.files.uploadedfi...
rv816/wagtail
wagtail/wagtailimages/tests/test_admin_views.py
Python
bsd-3-clause
27,333
# Copyright (c) 2003-2005 Maxim Sobolev. All rights reserved. # Copyright (c) 2006-2007 Sippy Software, Inc. All rights reserved. # # This file is part of SIPPY, a free RFC3261 SIP stack and B2BUA. # # SIPPY is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License a...
hgascon/pulsar
pulsar/core/sippy/SipCCDiversion.py
Python
bsd-3-clause
1,314
import sys def convert(n): if n[0] in ('i', 'o', 'u', 'y', 'e', 'a'): return n + "yay" else: return n[1:] + n[0] + "ay" # main function that calls other functions def main(): while(1): try: try: gottenString = input("Enter a word for vowel counting: ") ...
carlson-erik/ProgrammingExercises
Pig-Latin/pl_converter.py
Python
mit
528
# -*- coding: utf-8 -*- # """ test_abnf.py websocket - WebSocket client library for Python Copyright 2021 engn33r 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...
JonnyWong16/plexpy
lib/websocket/tests/test_abnf.py
Python
gpl-3.0
4,232
# CubiCal: a radio interferometric calibration suite # (c) 2017 Rhodes University & Jonathan S. Kenyon # http://github.com/ratt-ru/CubiCal # This code is distributed under the terms of GPLv2, see LICENSE.md for details """ Handles the interface between measurement sets, CubiCal and Montblanc. """ from __future__ import...
ratt-ru/CubiCal
cubical/data_handler/MBTiggerSim.py
Python
gpl-2.0
9,846
# Original SourceCode # https://github.com/blackducksoftware/ohloh_api/blob/master/examples/account_sample.py """ The MIT License (MIT) Copyright (c) 2013 Thijs Triemstra Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software...
UShan89/ape
scanners/openhub.py
Python
gpl-3.0
10,601
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (C) 2012 Midokura Japan K.K. # Copyright (C) 2013 Midokura PTE LTD # Copyright (C) 2014 Midokura SARL. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the Licen...
midokura/python-neutron-plugin-midonet
midonet/neutron/plugin.py
Python
apache-2.0
35,809
# TuxTruck_OBDlog_GPS.py # # Time-stamp: "2009-08-13 01:04:06 jantman" # # +----------------------------------------------------------------------+ # | TuxTruck Project http://tuxtruck.jasonantman.com | # +----------------------------------------------------------------------+ # | Copyright (c) 2009...
jantman/tuxtruck
obdlog/TuxTruck_OBDlog_GPS.py
Python
gpl-3.0
2,930
from django.urls import path from tickets import views urlpatterns = [ path('', views.last_event, name='last_event'), path('event/<str:ev>/', views.event, name='event'), path('event/<str:ev>/<str:space>/<str:session>/register/', views.register, name='register'), path('ticket/<str:order>/payment/', v...
wadobo/congressus
congressus/tickets/urls.py
Python
agpl-3.0
1,208
# -*- coding: utf-8 -*- """Copyright 2015 Roger R Labbe Jr. Code supporting the book Kalman and Bayesian Filters in Python https://github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Python This is licensed under an MIT license. See the LICENSE.txt file for more information. """ from __future__ import (absolute_imp...
zaqwes8811/micro-apps
self_driving/deps/Kalman_and_Bayesian_Filters_in_Python_master/kf_book/gif_animate.py
Python
mit
1,828
""" This is a DIRAC WMS administrator interface. It exposes the following methods: Site mask related methods: setMask(<site mask>) getMask() Access to the pilot data: getWMSStats() """ __RCSID__ = "$Id$" from types import DictType, ListType, IntType, LongType, StringTypes, StringType, FloatType from D...
marcelovilaca/DIRAC
WorkloadManagementSystem/Service/WMSAdministratorHandler.py
Python
gpl-3.0
23,672
#To treat the current directory as a module
swvist/Ocrn
ocrn/__init__.py
Python
mit
44
from psycopg2._psycopg import adapt class StringUtils(object): @staticmethod def adapt_to_str_for_orm(value): value = (value.replace('%', '') .replace(':', '') ) adapted_value = adapt(value) return adapted_value.getquoted()[1:-1]
LittleRichard/sormtger
server/utils/StringUtils.py
Python
gpl-3.0
305
''' Created on Sep 28, 2016 @author: rtorres ''' AREAS = ('Policies', 'Billing', 'Claims', 'Reports')
rafasis1986/EngineeringMidLevel
flaskiwsapp/projects/snippets/constants.py
Python
mit
104
""" Test lldb data formatter subsystem. """ import os, time import unittest2 import lldb from lldbtest import * import lldbutil class ValueObjectRecursionTestCase(TestBase): mydir = os.path.join("functionalities", "recursion") @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") @...
s20121035/rk3288_android5.1_repo
external/lldb/test/functionalities/recursion/TestValueObjectRecursion.py
Python
gpl-3.0
2,682
#!/usr/bin/python # -*- coding: latin2 -*- import sys class traffic: def __init__(self, rawStr): (self.Down, self.Up) = [ int(x) for x in rawStr.split(":") ] self.Total = self.Down + self.Up def printColumns(columns): print "\t".join([str(x) for x in columns]) data = open(sys.ar...
szabopeter/traff2tsv
traffproc.py
Python
mit
1,218
# coding: UTF-8 from __future__ import absolute_import from unittest import TestCase import six if six.PY2: from StringIO import StringIO else: from io import StringIO from fixedwidthwriter import FixedWidthWriter class TestFixedWidthWriter(TestCase): def setUp(self): self.s = StringIO() ...
HardDiskD/py-fixedwidthwriter
tests/__init__.py
Python
mit
2,435
# -*- coding: utf-8 -*- class Charset(object): common_name = 'NotoSansMyanmar-Regular' native_name = '' def glyphs(self): glyphs = [] glyphs.append(0x0136) #kinzi glyphs.append(0x0119) #hha_khm glyphs.append(0x0198) #lla.sub glyphs.append(0x01C6) #kha_shn.sub2 ...
davelab6/pyfontaine
fontaine/charsets/noto_glyphs/notosansmyanmar_regular.py
Python
gpl-3.0
27,865
#!/usr/bin/env python # -*- coding: utf-8 -*- # vim: ai ts=4 sts=4 et sw=4 nu from __future__ import (unicode_literals, absolute_import, division, print_function) import logging from django.core.management.base import BaseCommand from snisi_core.models.Periods import MonthPeriod from snisi_co...
yeleman/snisi
snisi_maint/management/commands/fix_double_expected.py
Python
mit
2,305
from django.conf import settings from django import template # Depending on your django version, `reverse` and `NoReverseMatch` has been moved. # From django 2.0 they've been moved to `django.urls` try: from django.urls import reverse, NoReverseMatch except ImportError: from django.core.urlresolvers import rev...
django-admin-bootstrap/django-admin-bootstrap
bootstrap_admin/templatetags/bootstrap_admin_template_tags.py
Python
bsd-3-clause
2,390
# -*- coding: UTF-8 -*- # # Copyright 2011-2019 by Dirk Gorissen, Stephen Rauch and Contributors # All rights reserved. # This file is part of the Pycel Library, Licensed under GPLv3 (the 'License') # You may not use this work except in compliance with the License. # You may obtain a copy of the Licence at: # https:/...
dgorissen/pycel
src/pycel/excellib.py
Python
gpl-3.0
12,274
""" Measure resonators, one at a time, with the readout tone centered in the filterbank bin. """ from __future__ import division import time import numpy as np from kid_readout.roach import analog, calculate, hardware_tools, tools from kid_readout.measurement import acquire, basic from kid_readout.equipment import h...
ColumbiaCMB/kid_readout
apps/data_taking_scripts/cooldown/2017-11-23_starcryo/r2h14_test.py
Python
bsd-2-clause
3,665
# CTK: Cherokee Toolkit # # Authors: # Alvaro Lopez Ortega <alvaro@alobbs.com> # # Copyright (C) 2009 Alvaro Lopez Ortega # # This program is free software; you can redistribute it and/or # modify it under the terms of version 2 of the GNU General Public # License as published by the Free Software Foundation. # # ...
chetan/cherokee
admin/CTK/CTK/PropsTable.py
Python
gpl-2.0
4,826
#!/usr/bin/python # -*- coding: utf-8 -*- # # The Qubes OS Project, http://www.qubes-os.org # # Copyright (C) 2015 Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com> # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published b...
adrelanos/qubes-core-admin
tests/dom0_update.py
Python
gpl-2.0
11,230
from blaze import byteproto as proto from . import lldescriptors, llindexers #------------------------------------------------------------------------ # Data Descriptor #------------------------------------------------------------------------ class DataDescriptor(object): """ DataDescriptors are the underlying, l...
davidcoallier/blaze
blaze/sources/descriptors/datadescriptor.py
Python
bsd-2-clause
5,036
# -*- coding: utf-8 -*- """ Test ImageOverlay ----------------- """ from jinja2 import Template import folium from folium import plugins def test_image_overlay(): """Test image overlay.""" data = [[[1, 0, 0, 1], [0, 0, 0, 0], [0, 0, 0, 0]], [[1, 1, 0, 0.5], [0, 0, 1, 1], [0, 0, 1, 1]]] m =...
talespaiva/folium
tests/plugins/test_image_overlay.py
Python
mit
1,170
from __future__ import absolute_import import responses from exam import fixture from django.contrib.auth.models import AnonymousUser from django.test import RequestFactory from sentry.plugins.bases.issue2 import PluginError from sentry.testutils import PluginTestCase from sentry.utils import json from social_auth.mo...
beeftornado/sentry
tests/sentry_plugins/github/test_plugin.py
Python
bsd-3-clause
3,947
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2015-2018 CERN. # Copyright (C) 2022 RERO. # # Invenio is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. """Invenio module that adds administration panel to the sy...
inveniosoftware/invenio-admin
setup.py
Python
mit
2,852
# -*- coding: utf-8 -*- """ Plexus (c) 2015 enen92 This file contains the main menu and the addon directory tree. All the necessary modules are present in ~/resources/plexus directory """ import xbmc import xbmcgui import xbmcplugin import xbmcvfs import os import hashlib import sys from plexusutils.pl...
kanote/TESTE-plexus
resources/plexus/mystreams.py
Python
gpl-2.0
3,389