code stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 226 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k |
|---|---|---|---|---|---|
# Generated by Django 2.2 on 2019-04-22 16:27
from django.db import migrations
import model_utils.fields
class Migration(migrations.Migration):
dependencies = [
('schedules', '0008_auto_20180208_1946'),
]
operations = [
migrations.AlterField(
model_name='shiftslotdayrule',
... | KSG-IT/ksg-nett | schedules/migrations/0009_auto_20190422_1627.py | Python | gpl-3.0 | 489 |
from django.contrib import admin
from .models import Batch, Event, PreClaim, Claim, Department, Student
from django.contrib.admin.models import LogEntry
# Register your models here.
def js_approve(modeladmin, request, queryset):
queryset.update(js_approved = True)
js_approve.short_description = 'Joint Sec Approve... | tornadoalert/kmcoffice | attendance/admin.py | Python | gpl-3.0 | 1,936 |
# dialog_add.py.in - dialog to add a new repository
#
# Copyright (c) 2004-2005 Canonical
# 2005 Michiel Sikkes
#
# Authors:
# Michael Vogt <mvo@debian.org>
# Michiel Sikkes <michiels@gnome.org>
# Sebastian Heinlein <glatzor@ubuntu.com>
#
# This program is free softw... | ruibarreira/linuxtrail | usr/lib/python3/dist-packages/softwareproperties/gtk/DialogAdd.py | Python | gpl-3.0 | 3,128 |
"""Handy XML processing utility functions.
Various XML processing utilities, using minidom, that are used in
various places throughout the code.
"""
"""
============================== License ========================================
Copyright (C) 2008, 2010-12 University of Edinburgh, Mark Granroth-Wilding
This ... | markgw/jazzparser | src/jazzparser/utils/domxml.py | Python | gpl-3.0 | 3,282 |
#!/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 distribut... | cmelange/ansible | lib/ansible/modules/network/eos/eos_user.py | Python | gpl-3.0 | 11,890 |
from tweepy import API
from tweepy import Cursor
from tweepy.streaming import StreamListener
from tweepy import OAuthHandler
from tweepy import Stream
from textblob import TextBlob
import twitter_credentials
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import re
# # # # TWITTER CLIENT #... | vprusso/youtube_tutorials | twitter_python/part_5_sentiment_analysis_tweet_data/sentiment_anaylsis_twitter_data.py | Python | gpl-3.0 | 4,622 |
"""//***********************************************************************
* Exp6_LineFollowing_IRSensors -- RedBot Experiment 6
*
* This code reads the three line following sensors on A3, A6, and A7
* and prints them out to the Serial Monitor. Upload this example to your
* RedBot and open up the Serial Monitor ... | Rosebotics/pymata-aio | examples/sparkfun_redbot/sparkfun_experiments/Exp6_LineFollowing_IRSensors.py | Python | gpl-3.0 | 2,131 |
#!/usr/bin/python
import sys
from LAPS.MsgBus.Bus import Bus
# Create queue with a unique name
# insert message
# receive msg
# delete queue
if __name__ == "__main__":
# If invoked directly, parse command line arguments for logger information
# and pass the rest to the run() metho... | jjdmol/LOFAR | SubSystems/LAPS_CEP/test/startPythonFromMsg.py | Python | gpl-3.0 | 725 |
import sys
from PyQt4 import QtGui, QtCore
class InitialDock1(QtGui.QWidget):
def __init__(self, parent=None, message=None, speciesDefault=None, contBtnFn=None, addBtnFn=None, speciesFn=None):
QtGui.QWidget.__init__(self,parent)
self.setWindowTitle('Data Processing')
vbox = QtGui.QVBoxLayo... | ajrichards/GenesDI | genesdi/qtlib/InitialDock1.py | Python | gpl-3.0 | 3,606 |
"""A setuptools based setup module.
See:
https://packaging.python.org/en/latest/distributing.html
https://github.com/pypa/tk_nosy
"""
# Always prefer setuptools over distutils
try:
from setuptools import setup, find_packages
except ImportError:
from distutils.core import setup, find_packages
# To use a consi... | sonofeft/Tk_Nosy | setup.py | Python | gpl-3.0 | 4,543 |
import json
import datetime
from django.http import HttpResponse
from django.core import serializers
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.shortcuts import render, get_object_or_404
from alarm.forms import UserProfileForm, AlarmStateConfigurationForm
fro... | Silvian/alarm-service | alarm/views.py | Python | gpl-3.0 | 3,883 |
from .plot_widget import PlotWidget
from .filter_popup import FilterPopup
from .filterable_kw_list_model import FilterableKwListModel
from .data_type_keys_list_model import DataTypeKeysListModel
from .data_type_proxy_model import DataTypeProxyModel
from .data_type_keys_widget import DataTypeKeysWidget
from .plot_cas... | joakim-hove/ert | ert_gui/tools/plot/__init__.py | Python | gpl-3.0 | 555 |
from otree.api import (
models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer,
Currency as c, currency_range
)
from random import randint
author = 'Your name here'
doc = """
Your app description
"""
class Constants(BaseConstants):
name_in_url = 'T1'
players_per_group = None
num_... | anthropo-lab/XP | normscheating_project/normscheating_T1desc/models.py | Python | gpl-3.0 | 2,682 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2011 Cédric Krier
# 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 opt... | kret0s/gnuhealth-live | tryton/server/trytond-3.8.3/trytond/modules/health_nursing/setup.py | Python | gpl-3.0 | 3,333 |
import cbor
import hashlib
import logging
import zlib
from .common import * # NOQA
LOG = logging.getLogger(__name__)
default_hashalgo = 'sha256'
state_bos = 0
state_metadata = 1
state_data = 2
state_eos = 3
class MuxError(Exception):
pass
class InvalidState(MuxError):
pass
class StreamWriter(object):... | larsks/muxdemux | muxdemux/writer.py | Python | gpl-3.0 | 4,581 |
# -*- coding: utf-8 -*-
# Resource object code
#
# Created by: The Resource Compiler for PyQt5 (Qt v5.15.0)
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore
qt_resource_data = b"\
\x00\x00\x23\x1c\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x80\x... | olielvewen/QDvGrab | qdvgrab/images/qdvgrabressources_rc.py | Python | gpl-3.0 | 599,843 |
# -*- coding: utf-8 -*-
# Copyright (C) 2013 Canonical
#
# Authors:
# Didier Roche
#
# 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; version 3.
#
# This program is distributed in the hope that ... | didrocks/cupstream2distro | cupstream2distro/utils.py | Python | gpl-3.0 | 904 |
#!/usr/bin/env python
# python-gphoto2 - Python interface to libgphoto2
# http://github.com/jim-easterbrook/python-gphoto2
# Copyright (C) 2015-19 Jim Easterbrook jim@jim-easterbrook.me.uk
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License ... | jim-easterbrook/python-gphoto2 | examples/read-exif-exifread.py | Python | gpl-3.0 | 3,776 |
"""empty message
Revision ID: ded3fd1d7f9d
Revises: b70e85abec53
Create Date: 2020-12-30 22:46:59.418950
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = 'ded3fd1d7f9d'
down_revision = 'b70e85abec53'
branch_labels = None
depe... | hashview/hashview | migrations/versions/ded3fd1d7f9d_.py | Python | gpl-3.0 | 850 |
from gi.repository import Gtk, Gdk,GObject,Pango
import commands
import time
import sys,os
import threading
import sqlite3
from config_note import Config
config_note = Config()
path = "/usr/share/gnome-shell/extensions/turbonote@iksws.com.br/turbonote-adds/"
path_icon = "/usr/share/gnome-shell/extensions/turbonote@iks... | iksws/GnomeTurboNoteExtension | turbonote-adds/notestyle.py | Python | gpl-3.0 | 10,601 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright © 2014 Daniel Tschan <tschan@puzzle.ch>
#
# This file is part of Weblate <https://weblate.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 Foun... | dontnod/weblate | openshift/wsgi_install.py | Python | gpl-3.0 | 3,281 |
from enum import Enum, EnumFactory
__all__ = ["Enum", "EnumFactory"]
| mkaluza/python-enum | enum/__init__.py | Python | gpl-3.0 | 70 |
# This file is part of PARPG.
# PARPG 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.
# PARPG is distributed in the hope ... | parpg/parpg | parpg/behaviours/npc.py | Python | gpl-3.0 | 4,169 |
"""
Add UUIDs to workflows
"""
from sqlalchemy import *
from sqlalchemy.orm import *
from migrate import *
from migrate.changeset import *
from galaxy.model.custom_types import UUIDType, TrimmedString
import logging
log = logging.getLogger( __name__ )
metadata = MetaData()
"""
Because both workflow and job reques... | mikel-egana-aranguren/SADI-Galaxy-Docker | galaxy-dist/lib/galaxy/model/migrate/versions/0121_workflow_uuids.py | Python | gpl-3.0 | 1,498 |
from collections import defaultdict
from six import iteritems
def invert_mapping(mapping):
""" Invert a mapping dictionary
Parameters
----------
mapping: dict
Returns
-------
"""
inverted_mapping = defaultdict(list)
for key, value in mapping.items():
if isinstance(value,... | JuBra/GEMEditor | GEMEditor/base/functions.py | Python | gpl-3.0 | 8,494 |
# Copyright (C) 2014 Pierre de Buyl
# Copyright (C) 2012,2013
# Max Planck Institute for Polymer Research
# Copyright (C) 2008,2009,2010,2011
# Max-Planck-Institute for Polymer Research & Fraunhofer SCAI
#
# This file is part of ESPResSo++.
#
# ESPResSo++ is free software: you can redistribute it and... | capoe/espressopp.soap | src/analysis/TotalVelocity.py | Python | gpl-3.0 | 2,733 |
from enum import Enum
class Direction(Enum):
invalid = (0.0, 0.0)
up = (0.0, -1.0)
down = (0.0, 1.0)
left = (-1.0, 0.0)
right = (1.0, 0.0)
def x(self):
return self.value[0]
def y(self):
return self.value[1]
def __str__(self):
return str(self.... | Daarknes/Gadakeco | src/util/directions.py | Python | gpl-3.0 | 328 |
from django.db import models
class TimeStampedModel(models.Model):
'''
Ab abstract base class model that provides self-
updating 'created' and 'modified' fields.
'''
created = models.DateTimeField(auto_now_add=True)
modified = models.DateTimeField(auto_now =True)
clas... | sjaa/scheduler | sched_core/models.py | Python | gpl-3.0 | 352 |
import numpy as np
def test_prepare_abi_connectivity_maps():
from samri.fetch.local import prepare_abi_connectivity_maps
prepare_abi_connectivity_maps('Ventral_tegmental_area',
invert_lr_experiments=[
"127651139",
"127796728",
"127798146",
"127867804",
"156314762",
"160539283",
"160540751",
... | IBT-FMI/SAMRI | samri/fetch/test/test_local.py | Python | gpl-3.0 | 2,202 |
import multiprocessing
import logging
class Experimenter(object):
"""
Coordinated, parallel execution of Experiments with logging.
"""
def __init__(self, log_name, experiments, cpu_limit=2**16):
"""
:param experiments: A list of pypuf.experiments.experiment.base.Experiment
:pa... | nicostephan/pypuf | pypuf/experiments/experimenter.py | Python | gpl-3.0 | 1,942 |
from .hu_psi_constraints import HuPsiConstraints
| simvisage/oricreate | oricreate/hu/__init__.py | Python | gpl-3.0 | 50 |
#!/usr/bin/env python
desc="""Report distance matrix between proteins.
Dependencies:
- Biopython, numpy & scipy
"""
epilog="""Author: l.p.pryszcz@gmail.com
Bratislava, 28/04/2016
"""
import os, sys, gzip
import numpy as np
from datetime import datetime
from Bio import SeqIO
from multiprocessing import Pool
from scip... | lpryszcz/rclups | rclups0.py | Python | gpl-3.0 | 9,729 |
from django.urls import path, include
from .routers import router
from . import views
app_name = "milage"
urlpatterns = [
path("api/", include(router.urls), name="api_router"),
path("class-based/", views.ClassBasedView.as_view(), name="class_based_drf"),
path(
"class-based-detail/<int:pk>",
... | GarrettArm/TheDjangoBook | mysite_project/milage/urls.py | Python | gpl-3.0 | 452 |
#!/usr/bin/env python
import unittest
from SDDetector.Entities.Gene import Gene
from SDDetector.Entities.Transcript import Transcript
from SDDetector.Entities.CDS import CDS
from SDDetector.Parser.Gff.GffGeneParser import GffGeneParser
class TestGffGeneParser(unittest.TestCase):
def setUp(self):
pass
... | nlapalu/SDDetector | tests/test_GffGeneParser.py | Python | gpl-3.0 | 1,549 |
# THIS FILE IS PART OF THE CYLC WORKFLOW ENGINE.
# Copyright (C) NIWA & British Crown (Met Office) & Contributors.
#
# 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 Licen... | hjoliver/cylc | cylc/flow/workflow_files.py | Python | gpl-3.0 | 70,188 |
#!/usr/bin/python
# inbuild - Exception - python exception - parent clas
# InvalidAgeException - Child class
class InvalidAgeException(Exception):
def __init__(self,age):
self.age = age
def validate_age(age):
if age > 18:
return "welcome to the movie!!!"
else:
raise InvalidAgeException(age)
if __name__ == ... | tuxfux-hlp-notes/python-batches | archieves/batch-62/oop/movie.py | Python | gpl-3.0 | 538 |
from test_support import check_output_file, prove_all
prove_all()
check_output_file(sort=True)
| AdaCore/spark2014 | testsuite/gnatprove/tests/Q217-039__assume/test.py | Python | gpl-3.0 | 96 |
"""Module to access all emailing campagins."""
import datetime
from typing import Any, Dict
from urllib import parse
from bob_emploi.frontend.api import job_pb2
from bob_emploi.frontend.api import project_pb2
from bob_emploi.frontend.api import user_pb2
from bob_emploi.frontend.server import auth
from bob_emploi.fron... | bayesimpact/bob-emploi | frontend/server/mail/all_campaigns.py | Python | gpl-3.0 | 25,058 |
# Copyright 2010-2021 Kurt McKee <contactme@kurtmckee.org>
# Copyright 2002-2008 Mark Pilgrim
# All rights reserved.
#
# This file is a part of feedparser.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistrib... | rembo10/headphones | lib/feedparser/util.py | Python | gpl-3.0 | 6,490 |
# encoding: utf8
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('infrastructure', '0012_auto_20140209_0400'),
]
operations = [
migrations.AddField(
model_name='module_list',
name='widget',
field=mo... | SingularityHA/WebUI | infrastructure/migrations/0013_module_list_widget.py | Python | gpl-3.0 | 411 |
from django.shortcuts import render
def index(request):
return render(request, 'common/index.html', {}) | eike-welk/clair | src/clairweb/common/views.py | Python | gpl-3.0 | 109 |
from typing import Union
from brown import constants
from brown.core import brown
from brown.core.music_font import MusicFont
from brown.core.object_group import ObjectGroup
from brown.core.path import Path
from brown.core.pen import Pen
from brown.core.pen_pattern import PenPattern
from brown.core.staff import Staff
... | ajyoon/brown | examples/feldman_projections_2/score.py | Python | gpl-3.0 | 5,802 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('training', '0006_auto_20160627_1620'),
]
operations = [
migrations.RemoveField(
model_name='trainesscourserecord... | akademikbilisim/ab-kurs-kayit | abkayit/training/migrations/0007_auto_20160628_1243.py | Python | gpl-3.0 | 617 |
# -*- coding: utf-8 -*-
from __future__ import division
from math import sqrt, floor, ceil, sin, cos, tan, radians, asin, acos, atan, atan2, degrees
import numpy as np
import copy
from .utils import array_from_function, almost_zero
from array_utils import point_solution, formula_to_grid
from .errors i... | mauroalberti/simSurf | geosurf_pure/spatial.py | Python | gpl-3.0 | 67,189 |
"""
Application-class that implements pyFoamChangeGGIBoundary.py
Modification of GGI and cyclicGGI interface parameters in
constant/polymesh/boundary file.
Author:
Martin Beaudoin, Hydro-Quebec, 2009. All rights reserved
"""
from PyFoam.Applications.PyFoamApplication import PyFoamApplication
from PyFoam.RunDicti... | Unofficial-Extend-Project-Mirror/foam-extend-foam-extend-3.2 | ThirdParty/LocalDev/Hydro-Quebec/PyFoam/ChangeGGIBoundary.py | Python | gpl-3.0 | 7,040 |
from __future__ import print_function, division
import os
import sys
import time
import h5py
import torch
from torch import nn
from torch.autograd import Variable
import torch.nn.functional as F
import torch.utils.data as Data
import numpy as np
import json
from sklearn.metrics import mean_squared_error
from obspy.sign... | wjlei1990/EarlyWarning | nn.linear/nn_cuda.py | Python | gpl-3.0 | 9,359 |
# coding: utf-8
#Created on 05.06.2012
#Copyright (C) 2013 Fabian Hachenberg
#This file is part of EcstaticaLib.
#EcstaticaLib 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... | fHachenberg/pyecstaticalib | Ecstatica/PixelEncoding.py | Python | gpl-3.0 | 6,356 |
import redmodel.containers
class Error(Exception):
pass
class NotFoundError(Error):
pass
class BadArgsError(Error):
pass
UniqueError = redmodel.containers.UniqueError
| beatmax/redmodel | redmodel/models/exceptions.py | Python | gpl-3.0 | 183 |
from flask import render_template, redirect, request, url_for, flash
from flask_login import login_user, logout_user, login_required, current_user
from . import auth
from .. import db
from ..models import User
from ..email import send_email
from .forms import LoginForm, RegistrationForm, ChangePasswordForm,\
Passwo... | haup/totoro | totoro/app/auth/views.py | Python | gpl-3.0 | 6,038 |
from django.contrib.contenttypes.models import ContentType
from rules import Predicate
from core.permissions.models import Rule
class HasPermission(object):
"""
Class generator which return a predicate function parametrized by a
permission name.
"""
def __new__(cls, permission_name, foreign_key... | thetoine/eruditorg | erudit/core/permissions/predicates.py | Python | gpl-3.0 | 1,112 |
"""
We are playing the Guess Game. The game is as follows:
I pick a number from 1 to n. You have to guess which number I picked.
Every time you guess wrong, I'll tell you whether the number I picked is higher or lower.
However, when you guess a particular number x, and you guess wrong, you pay $x. You win the game w... | dichen001/Go4Jobs | JackChen/minimax/375. Guess Number Higher or Lower II.py | Python | gpl-3.0 | 1,292 |
#!/usr/bin/env python2
"""Parses multiple blast files (for the same target) and print table
combining best matches to all target sequences from all query file.
Author:
l.p.pryszcz+git@gmail.com
Barcelona, 24/05/2012
"""
import os, sys
from optparse import OptionParser
from datetime import datetime
from genome_annota... | lpryszcz/bin | blast2matrix.py | Python | gpl-3.0 | 3,556 |
"""
mediatum - a multimedia content repository
Copyright (C) 2007 Arne Seifert <seiferta@in.tum.de>
Copyright (C) 2007 Matthias Kramm <kramm@in.tum.de>
Copyright (C) 2013 Iryna Feuerstein <feuersti@in.tum.de>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Gene... | mediatum/mediatum | core/metatype.py | Python | gpl-3.0 | 13,830 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys, traceback, Ice, threading, time, os
import IceStorm
# Ctrl+c handling
import signal
signal.signal(signal.SIGINT, signal.SIG_DFL)
# Qt interface
from PySide.QtCore import *
from PySide.QtGui import *
from PySide.QtSvg import *
# Check that RoboComp has been ... | robocomp/robocomp-ursus-rockin | components/comprehension/comprehension.py | Python | gpl-3.0 | 4,066 |
# -*- coding: utf-8 -*-
import requests
import json
from yamlns import namespace as ns
from .. import persons
class AreaVoip(object):
@staticmethod
def defaultQueue():
import dbconfig
return dbconfig.tomatic.get('areavoip',{}).get('queue', None)
def __init__(self):
import dbconfi... | Som-Energia/somenergia-tomatic | tomatic/pbx/pbxareavoip.py | Python | gpl-3.0 | 5,174 |
#-*- coding: utf-8 -*-
#+---------------------------------------------------------------------------+
#| 01001110 01100101 01110100 01111010 01101111 01100010 |
#| |
#| Netzob : Inferring communication protocols... | dasbruns/netzob | src/netzob/Common/Models/Grammar/States/PrismaState.py | Python | gpl-3.0 | 5,647 |
"""Test for Remote Execution
:Requirement: Remoteexecution
:CaseAutomation: Automated
:CaseLevel: Acceptance
:CaseComponent: RemoteExecution
:Assignee: pondrejk
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
import pytest
from nailgun import client
from nailgun.entity_mixins import TaskFailedErro... | rplevka/robottelo | tests/foreman/api/test_remoteexecution.py | Python | gpl-3.0 | 3,759 |
# encoding: utf-8
from __future__ import absolute_import, division, print_function
import numpy as np
import tables
from liam2.data import merge_arrays, get_fields, index_table_light, merge_array_records
from liam2.utils import timed, loop_wh_progress, merge_items
__version__ = "0.4"
def get_group_fiel... | liam2/liam2 | liam2/merge_h5.py | Python | gpl-3.0 | 4,745 |
# -*- coding: utf-8 -*-
"""
/***************************************************************************
vector_selectbypoint
A QGIS plugin
Select vector features, point and click.
-------------------
begin : 2014-04-07
copy... | OregonWalks/qgis_vector_selectbypoint | vector_selectbypoint.py | Python | gpl-3.0 | 4,244 |
#! /usr/bin/env python3
from collections import OrderedDict
import datetime
import os
import sys
import textwrap
from plaid import Client
from plaid import errors as plaid_errors
import plaid2text.config_manager as cm
from plaid2text.interact import prompt, clear_screen, NullValidator
from plaid2text.interact import... | madhat2r/plaid2text | src/python/plaid2text/online_accounts.py | Python | gpl-3.0 | 2,305 |
import sys
import time
import ldap
url, binddn, bindpw, basedn, nconns, niters = sys.argv[1:]
conns = []
for ii in xrange(0, int(nconns)):
conn = ldap.initialize(url)
conns.append(conn)
for conn in conns:
conn.simple_bind(binddn, bindpw)
for ii in xrange(0, int(niters)):
for conn in conns:
e... | richm/389-perf-test | nconns.py | Python | gpl-3.0 | 504 |
import matplotlib.pyplot as plt
import matplotlib.colors as clr
import matplotlib
import warnings
from skill_metrics import add_legend
def plot_pattern_diagram_markers(X,Y,option):
'''
Plots color markers on a pattern diagram.
Plots color markers on a target diagram according their (X,Y)
location... | PeterRochford/SkillMetrics | skill_metrics/plot_pattern_diagram_markers.py | Python | gpl-3.0 | 4,916 |
import asterix
import unittest
class AsterixParseTest(unittest.TestCase):
def test_ParseCAT048(self):
sample_filename = asterix.get_sample_file('cat048.raw')
with open(sample_filename, "rb") as f:
data = f.read()
packet = asterix.parse(data)
self.maxDiff = None
... | nabilbendafi/asterix | asterix/test/test_parse.py | Python | gpl-3.0 | 30,268 |
# SConsBuildFramework - Copyright (C) 2013, Nicolas Papier.
# Distributed under the terms of the GNU General Public License (GPL)
# as published by the Free Software Foundation.
# Author Nicolas Papier
import os
from src.sbfRsync import createRsyncAction
from src.SConsBuildFramework import stringFormatter
... | npapier/sbf | src/sbfDoxygen.py | Python | gpl-3.0 | 6,169 |
# Author: Ahmed Husam Elsers
# Email: ahmed.elsersi@gmail.com
# This is a Python3 script to install/upgrade Atom for Linux (Fedora, Ubuntu)
# Check The Host Linux Distro (Fedora/Ubuntu)
# Check if Atom installed or Not
# If Installed:
# check the latest version on Atom web page
# then compare it to inst... | ahmedelsers/atom-installer | atom_installer.py | Python | gpl-3.0 | 4,389 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Demo of class data.ExperimentHandler
"""
from psychopy import data, logging
from numpy import random
logging.console.setLevel(logging.DEBUG)
exp = data.ExperimentHandler(name='testExp',
version='0.1',
extraInfo={'participant':'jwp', 'o... | psychopy/psychopy | psychopy/demos/coder/experiment control/experimentHandler.py | Python | gpl-3.0 | 1,926 |
'''
test.backend.svrtools.crypto.__init__
'''
import unittest
from my.backend import Backend
# from my.backend.crypto import is_this_the_correct_dollhouse_password
from my.globals.exceptions import WrongDollhousePasswordError
from my.miscellany import random_alphanum_string
class Test_is_this_the_correct_dollhouse... | HugoMMRabson/fonsa | src/test/old/backend/svrtools/crypto/__init__.py | Python | gpl-3.0 | 2,949 |
#task_5
def y1(x):
return 1 + x * x
def y2(x):
return -2 - x * x
x, y = tuple(map(float, input().split()))
if y1(x) < y or y2(x) > y:
print('YES')
else:
print('NO') | Senbjorn/mipt_lab_2016 | test_on_python/task_5.py | Python | gpl-3.0 | 168 |
# -*- coding: utf-8 -*-
#
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)
"""Utilities for version control systems"""
from __future__ import print_function
import sys
import os.path as osp
import subprocess
# Local imports
... | bgris/ODL_bgris | lib/python3.5/site-packages/spyder/utils/vcs.py | Python | gpl-3.0 | 5,011 |
import json
from urllib.parse import unquote
from gi.repository import Totem
from Controllers.BaseController import BaseController
from OpenSubtitleHasher import *
class PlayerController(BaseController):
def __init__(self, server, request):
BaseController.__init__(self, server, request)
self.playe... | clzola/totem-remote-http | TotemRemoteHttp/Controllers/PlayerController.py | Python | gpl-3.0 | 3,219 |
#!/usr/bin/env python3
import optparse
class RcpLogValidator(object):
MAX_ERRORS = 25
MAX_INTERVAL_STEP_MS = 3000
MIN_INTERVAL_STEP_MS = 1
def __init__(self):
self.interval = 0
self.columns = 0
def _count_commas(self, line):
return line.count(',')
def _validate_colum... | autosportlabs/RaceCapture-Pro_firmware | bin/rcp_log_linter.py | Python | gpl-3.0 | 3,639 |
# This file is part of Pimlico
# Copyright (C) 2020 Mark Granroth-Wilding
# Licensed under the GNU LGPL v3.0 - https://www.gnu.org/licenses/lgpl-3.0.en.html
from builtins import str
from builtins import zip
from pimlico.core.external.java import Py4JInterface, JavaProcessError
from pimlico.core.modules.execute import ... | markgw/pimlico | src/python/pimlico/old_datatypes/modules/opennlp/coreference_pipeline/execute.py | Python | gpl-3.0 | 3,946 |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# 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 distrib... | cschenck/blender_sim | fluid_sim_deps/blender-2.69/2.69/scripts/startup/bl_ui/properties_render_layer.py | Python | gpl-3.0 | 5,639 |
# coding: utf-8
#
# drums-backend a simple interactive audio sampler that plays vorbis samples
# Copyright (C) 2009 C.D. Immanuel Albrecht
#
# 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 Fou... | immo/pyTOM | df/df_interpreter.py | Python | gpl-3.0 | 1,707 |
# coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_urlparse
from ..utils import (
HEADRequest,
KNOWN_EXTENSIONS,
sanitized_Request,
str_to_int,
urlencode_postdata,
urlhandle_detect_ext,
)
class HearThisAtIE(InfoExtractor):
_VALID_UR... | valmynd/MediaFetcher | src/plugins/youtube_dl/youtube_dl/extractor/hearthisat.py | Python | gpl-3.0 | 4,347 |
# -*- coding: utf-8 -*-
from BJFinanceLib.instruments.swapleg import SwapLegFixed, SwapLegFloating
from BJFinanceLib.objects.cashflowschedule import CashflowSchedule
from numbers import Number
class IRS():
pass
class IRSFixedForFloat():
@staticmethod
def payerReceiver(payerReceiverFlag):
if isi... | bramjochems/BJFinanceLib | BJFinanceLib/instruments/irs.py | Python | gpl-3.0 | 3,360 |
# -*- coding: utf-8 -*-
# Copyright (c) 2007 - 2015 Detlev Offenbach <detlev@die-offenbachs.de>
#
"""
Module implementing the Ruby debugger interface for the debug server.
"""
from __future__ import unicode_literals
import os
from PyQt5.QtCore import QObject, QTextCodec, QProcess, QProcessEnvironment, \
QTimer... | paulmadore/Eric-IDE | 6-6.0.9/eric/Debugger/DebuggerInterfaceRuby.py | Python | gpl-3.0 | 35,952 |
# 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
import json
import frappe.utils
from frappe.utils import cstr, flt, getdate, comma_and, cint
from frappe import _
from frappe.model.utils ... | mbauskar/erpnext | erpnext/selling/doctype/sales_order/sales_order.py | Python | gpl-3.0 | 26,900 |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2016 Carmelo Mordini
#
# 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 la... | carmelom/sisview-bec-tn | sisview.py | Python | gpl-3.0 | 10,034 |
#!/bin/false
# This file is part of Espruino, a JavaScript interpreter for Microcontrollers
#
# Copyright (C) 2013 Gordon Williams <gw@pur3.co.uk>
#
# 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 h... | AlexanderBrevig/Espruino | boards/MINISTM32_STRIVE.py | Python | mpl-2.0 | 4,266 |
#
# Newfies-Dialer License
# http://www.newfies-dialer.org
#
# 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/.
#
# Copyright (C) 2011-2014 Star2Billing S.L.
#
# The primar... | tarikgwa/nfd | newfies/frontend/forms.py | Python | mpl-2.0 | 2,873 |
# 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/.
from unittest import mock
from configman import Namespace, ConfigurationManager
from configman.dotdict import DotDict
i... | lonnen/socorro | socorro/unittest/external/test_crashstorage_base.py | Python | mpl-2.0 | 13,509 |
class BundleConfiguration(object):
def PIPELINE_CSS(self):
return {
'client': {
'source_filenames': [
'font-awesome/css/font-awesome.css',
'css/client.less',
],
'output_filename': 'css/client.css',
... | mythmon/edwin | edwin/bundles.py | Python | mpl-2.0 | 584 |
# -*- coding: utf-8 -*-
# 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/.
from __future__ import absolute_import
PROJECT_NAME = 'releng-treestatus'
APP_NAME = 'releng_t... | srfraser/services | src/releng_treestatus/releng_treestatus/config.py | Python | mpl-2.0 | 331 |
def break_words(stuff):
""" This funciton will break up words for us."""
word = stuff.split(' ')
return word
def sort_words(words):
return sorted(words)
def print_last_word(words):
word = words.pop(-1)
print word
def sort_sentence(sentence):
words = break_words(sentence)
return sor... | Simon9398/PythonByHardWay | function.py | Python | mpl-2.0 | 337 |
# encoding: utf-8
#
#
# 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/.
#
# Author: Kyle Lahnakoski (kyle@lahnakoski.com)
#
from __future__ import unicode_literals
from __... | klahnakoski/cloc | cloc/util/queries/es_query_aggop.py | Python | mpl-2.0 | 3,106 |
# -*- coding: utf-8 -*-
# Copyright 2015 Antiun Ingeniería S.L. - Antonio Espinosa
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
'name': "Manage model export profiles",
'category': 'Personalization',
'version': '10.0.1.0.0',
'depends': [
'web',
],
'data': [
... | ovnicraft/server-tools | base_export_manager/__manifest__.py | Python | agpl-3.0 | 808 |
# -*- coding: utf-8 -*-
"""
flaskbb.forum.models
~~~~~~~~~~~~~~~~~~~~
It provides the models for the forum
:copyright: (c) 2014 by the FlaskBB Team.
:license: BSD, see LICENSE for more details.
"""
from datetime import datetime, timedelta
from flask import url_for, abort
from sqlalchemy.orm impor... | nathanhilbert/FPA_Core | openspending/forum/forum/models.py | Python | agpl-3.0 | 34,388 |
from flow.commands.service import ServiceCommand
from flow.configuration.inject.broker import BrokerConfiguration
from flow.configuration.inject.redis_conf import RedisConfiguration
from flow.configuration.inject.service_locator import ServiceLocatorConfiguration
from flow.shell_command.fork.handler import ForkShellCom... | genome/flow-core | flow/shell_command/fork/commands/service.py | Python | agpl-3.0 | 747 |
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
from . import models
from . import wizard
| OCA/purchase-workflow | purchase_order_approval_block/__init__.py | Python | agpl-3.0 | 113 |
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com>
# 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 F... | Zaneh-/bearded-tribble-back | taiga/base/api/__init__.py | Python | agpl-3.0 | 1,205 |
# -*- coding: utf-8 -*-
"""
Discussion XBlock
"""
import logging
import six
from six.moves import urllib
from six.moves.urllib.parse import urlparse # pylint: disable=import-error
from django.contrib.staticfiles.storage import staticfiles_storage
from django.urls import reverse
from django.utils.translation import ge... | edx-solutions/edx-platform | openedx/core/lib/xblock_builtin/xblock_discussion/xblock_discussion/__init__.py | Python | agpl-3.0 | 12,281 |
from __future__ import print_function, absolute_import, division
import os
import theano
from theano.gof import Op, Apply
from theano.gof.type import Generic
from .basic_ops import (infer_context_name, as_gpuarray_variable)
from .type import GpuArrayType
try:
import pygpu
except ImportError as e:
pass
class... | Weihonghao/ECM | Vpy34/lib/python3.5/site-packages/theano/gpuarray/reduction.py | Python | agpl-3.0 | 6,187 |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Course.riw_style'
db.add_column(u'core_course', 'riw_styl... | mupi/tecsaladeaula | core/migrations/0039_auto__add_field_course_riw_style.py | Python | agpl-3.0 | 19,646 |
#!/usr/bin/env python
#coding=utf-8
from twisted.python import log
from toughradius.radiusd.settings import *
import logging
import datetime
def process(req=None,user=None,radiusd=None,**kwargs):
if not req.get_acct_status_type() == STATUS_TYPE_STOP:
return
runstat=radiusd.runstat
store = ra... | davislidaqing/Mcoderadius | toughradius/radiusd/plugins/acct_stop_process.py | Python | agpl-3.0 | 1,514 |
"""
A misc set of utilities useful in the data-import domain.
"""
import logging
from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned
from open_municipio.people.models import Person, municipality
from open_municipio.data_import.models import LookupInstitutionCharge, LookupCompanyCharge, Lookup... | openpolis/open_municipio | open_municipio/data_import/utils.py | Python | agpl-3.0 | 9,167 |
# -*- coding:utf-8 -*-
#
#
# Copyright (C) 2015 Clear ICT Solutions <info@clearict.com>.
# All Rights Reserved.
#
# 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 ver... | Clear-ICT/odoo-addons | fleet_department/models/fleet.py | Python | agpl-3.0 | 1,289 |
# -*- coding: utf-8 -*-
# Akvo RSR is covered by the GNU Affero General Public License.
# See more details in the license.txt file located at the root folder of the Akvo RSR module.
# For additional details on the GNU license please see < http://www.gnu.org/licenses/agpl.html >.
from django.core.exceptions import Va... | akvo/akvo-rsr | akvo/rsr/models/organisation_document.py | Python | agpl-3.0 | 6,312 |
import re
from django.core import urlresolvers
from django.db import IntegrityError
from cl.citations import find_citations, match_citations
from cl.custom_filters.templatetags.text_filters import best_case_name
from cl.search.models import Opinion, OpinionsCited
from celery import task
def get_document_citations(opi... | brianwc/courtlistener | cl/citations/tasks.py | Python | agpl-3.0 | 5,964 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-07-03 18:56
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.manager
class Migration(migrations.Migration):
dependencies = [
('wiblog', '0003_auto_20160325_1441'),
]
operations =... | lo-windigo/fragdev | wiblog/migrations/0004_auto_20170703_1156.py | Python | agpl-3.0 | 1,015 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.