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 |
|---|---|---|---|---|---|
# Generated by Django 3.1 on 2020-08-15 10:08
from django.conf import settings
import django.core.serializers.json
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
from ..compat import JSONField
class Migration(migrations.Migration):
initial = True
dep... | pinax/pinax-eventlog | pinax/eventlog/migrations/0001_initial.py | Python | mit | 1,443 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('article', '0001_initial'),
]
operations = [
migrations.AddField(
... | Timurdov/bionicprojectpython | shadrus/article/migrations/0002_comments_comments_date.py | Python | apache-2.0 | 548 |
from telnetlib import Telnet
class JamesHelper:
def __init__(self, app):
self.app = app
def ensure_user_exists(self, username, password):
james_config = self.app.config['james']
session = JamesHelper.Session(james_config['host'], james_config['port'],
... | elaginm/python_training_mantis | fixture/james.py | Python | apache-2.0 | 1,733 |
"""
Views for the course home page.
"""
from django.core.urlresolvers import reverse
from django.template.context_processors import csrf
from django.template.loader import render_to_string
from django.utils.decorators import method_decorator
from django.views.decorators.cache import cache_control
from django.views.dec... | TeachAtTUM/edx-platform | openedx/features/course_experience/views/course_home.py | Python | agpl-3.0 | 9,465 |
#!/usr/bin/env python
"""Tests for grr.client.client_actions.tempfiles."""
import os
import tempfile
import time
from grr.client.client_actions import tempfiles
from grr.lib import config_lib
from grr.lib import flags
from grr.lib import rdfvalue
from grr.lib import test_lib
from grr.lib import utils
class GRRTempF... | ksmaheshkumar/grr | client/client_actions/tempfiles_test.py | Python | apache-2.0 | 6,106 |
from django.db import models
class Property(models.Model):
address = models.CharField(max_length=200)
class Tennant(models.Model):
responded = models.BooleanField()
| oOPa/ReClean | properties/models.py | Python | mit | 169 |
import fnmatch
import os
import re
import shutil
import time
import traceback
from couchpotato import get_db
from couchpotato.api import addApiView
from couchpotato.core.event import addEvent, fireEvent, fireEventAsync
from couchpotato.core.helpers.encoding import toUnicode, ss, sp
from couchpotato.core.helpers.variab... | jeroenj/CouchPotatoServer | couchpotato/core/plugins/renamer.py | Python | gpl-3.0 | 66,983 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Mass mailing on sale orders',
'category': 'Hidden',
'version': '1.0',
'summary': 'Add sale order UTM info on mass mailing',
'description': """UTM and mass mailing on sale orders""",
'de... | t3dev/odoo | addons/mass_mailing_sale/__manifest__.py | Python | gpl-3.0 | 531 |
"""AMQPStorm Connection.IO."""
import logging
import select
import socket
import threading
from errno import EAGAIN
from errno import EINTR
from errno import EWOULDBLOCK
from amqpstorm import compatibility
from amqpstorm.base import MAX_FRAME_SIZE
from amqpstorm.compatibility import ssl
from amqpstorm.exception impor... | eandersson/amqpstorm | amqpstorm/io.py | Python | mit | 9,813 |
#!/usr/env/python
"""
Landlab component that simulates the transport of bed material
sediment through a 1-D river network, while tracking the resulting changes
in bed material grain size and river bed elevation. Model framework
described in Czuba (2018). Additions include: particle abrasion, variable
active layer thic... | amandersillinois/landlab | landlab/components/network_sediment_transporter/network_sediment_transporter.py | Python | mit | 46,917 |
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models
class ResPartner(models.Model):
_inherit = 'res.partner'
payment_token_ids = fields.One2many(
string="Payment Tokens", comodel_name='payment.token', inverse_name='partner_id')
payment_... | jeremiahyan/odoo | addons/payment/models/res_partner.py | Python | gpl-3.0 | 913 |
''' Region views. '''
import json
import re
import gene
from django.contrib import messages
from django.http import Http404
from django.http.response import JsonResponse
from django.views.generic.base import TemplateView
from core.views import SectionMixin
from criteria.helper.region_criteria import RegionCriteria
f... | premanand17/pydgin | pydgin/local_apps/region/views.py | Python | gpl-3.0 | 9,192 |
"""Parallel testing, supporting arbitrary collection ordering
The Workflow
------------
- Master py.test process starts up, inspects config to decide how many slave to start, if at all
- env['parallel_base_urls'] is inspected first
- py.test config.option.appliances and the related --appliance cmdline flag are u... | akrzos/cfme_tests | fixtures/parallelizer/__init__.py | Python | gpl-2.0 | 40,869 |
from lombscargle import *
| MicheleMaris/lombscargle | __init__.py | Python | gpl-2.0 | 26 |
import os
import urllib2
import re
import logging
from subprocess import Popen
from subprocess import PIPE
class Downloader(object):
def __init__(self, config):
self._ctx = config
self._log = logging.getLogger('downloads')
self._init_proxy()
def _init_proxy(self):
handlers = ... | mc500/php-buildpack | lib/build_pack_utils/downloads.py | Python | apache-2.0 | 4,029 |
# Copyright 2012 OpenStack Foundation
# Copyright 2013 IBM Corp.
#
# 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 app... | takeshineshiro/keystone | keystone/tests/unit/test_v3_protection.py | Python | apache-2.0 | 54,801 |
import unittest
from minimum_element_sorted_rotated import minimum_element_sorted_rotated
class TestMinimumElementInSortedRotatedArray(unittest.TestCase):
def test_general_case(self):
arr = [6, 1, 2, 3, 4, 5]
self.assertEqual(minimum_element_sorted_rotated(arr), 1)
def test_first_element_is... | ColeKettler/compusplode-pro | minimum_element_sorted_rotated/py/test_minimum_element_sorted_rotated.py | Python | mit | 886 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | lmazuel/azure-sdk-for-python | azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/route_filter_rule.py | Python | mit | 3,259 |
#!/usr/bin/env python
"""
6809 unittests
~~~~~~~~~~~~~~
Test store and load ops
:created: 2014 by Jens Diemer - www.jensdiemer.de
:copyleft: 2014-2015 by the MC6809 team, see AUTHORS for more details.
:license: GNU GPL v3 or above, see LICENSE for more details.
"""
import logging
import sys... | 6809/MC6809 | MC6809/tests/test_6809_StoreLoad.py | Python | gpl-3.0 | 2,261 |
import asyncio
import os
import pathlib
from unittest import mock
import pytest
from yarl import URL
import aiohttp
from aiohttp import web
@pytest.fixture
def proxy_test_server(aiohttp_raw_server, loop, monkeypatch):
"""Handle all proxy requests and imitate remote server response."""
_patch_ssl_transport(... | arthurdarcet/aiohttp | tests/test_proxy_functional.py | Python | apache-2.0 | 20,934 |
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
try:
from infra_libs.ts_mon.common import standard_metrics
except ImportError: # pragma: no cover
from common import standard_metrics
c... | nicko96/Chrome-Infra | infra_libs/ts_mon/common/test/standard_metrics_test.py | Python | bsd-3-clause | 514 |
# -*- coding: utf-8 -*-
#
# Poio Tools for Linguists
#
# Copyright (C) 2009-2013 Poio Project
# Author: António Lopes <alopes@cidles.eu>
# URL: <http://media.cidles.eu/poio/>
# For license information, see LICENSE.TXT
"""
"""
from __future__ import absolute_import
import re
import xml.etree.ElementTree as ET
impo... | cidles/poio-api | src/poioapi/io/shoebox.py | Python | apache-2.0 | 5,340 |
# coding: utf-8
"""
OpenAPI spec version:
Generated by: https://github.com/swagger-api/swagger-codegen.git
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
... | detiber/lib_openshift | test/test_v1_replication_controller_status.py | Python | apache-2.0 | 1,400 |
# -*- coding: utf-8 -*-
# Dioptas - GUI program for fast processing of 2D X-ray diffraction data
# Principal author: Clemens Prescher (clemens.prescher@gmail.com)
# Copyright (C) 2014-2019 GSECARS, University of Chicago, USA
# Copyright (C) 2015-2018 Institute for Geology and Mineralogy, University of Cologne, Germany
... | erangre/Dioptas | dioptas/controller/integration/OptionsController.py | Python | gpl-3.0 | 5,126 |
import tornado
import base
class ErrorHandler(tornado.web.ErrorHandler, base.BaseHandler):
"""
Default handler gonna to be used in case of 404 error
"""
pass
| bradleygolden/gmail-image-extractor | app/handlers/error.py | Python | mit | 176 |
#!/usr/bin/python3
import time
import os
import sys
#
# setting defaults and blank variables
#
homedir = os.getenv("HOME") #discovers home directory location use in default path generation
#Setting Blank Variables
cam_opt = "uvccapture" # here in case it doesn't get set later.
settings_file = None # this will get turne... | Pragmatismo/Pigrow | scripts/cron/camcap.py | Python | gpl-3.0 | 16,605 |
'''generate n-grams'''
'''Version 1 put all lines into one line for calculating frequency for filtering
Version 2 for n grams, Version 3 do not have any filtering and repeated but memory saving'''
import sys
sys.path.append("D:/uw course/capstone/nltk-3.0a3/")
import nltk
from nltk.collocations import *
from nltk impor... | evazyin/Capstoneproject | ngrams.py | Python | agpl-3.0 | 2,370 |
import os
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '{{ openwisp2_secret_key }}'
# SECURITY WARNING: don't run with debug turned on in p... | ritwickdsouza/ansible-openwisp2 | templates/openwisp2/settings.py | Python | bsd-3-clause | 6,943 |
# coding: utf-8
from __future__ import unicode_literals
import datetime
import json
import hashlib
import hmac
import re
from .common import InfoExtractor
from .anvato import AnvatoIE
from ..utils import (
smuggle_url,
urlencode_postdata,
xpath_text,
)
class ScrippsNetworksWatchIE(InfoExtractor):
IE... | phihag/youtube-dl | youtube_dl/extractor/scrippsnetworks.py | Python | unlicense | 7,053 |
# (C) Copyright 2005 Nuxeo SARL <http://nuxeo.com>
# Author: Florent Guillaume <fg@nuxeo.com>
#
# This program 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.
#
# This program is distributed in the h... | loechel/Products.ZopeHealthWatcher_test | Products/ZopeHealthWatcher/__init__.py | Python | gpl-2.0 | 1,743 |
from django.test import TestCase
from bongo.apps.bongo.tests import factories
class ArticleViewTestCase(TestCase):
def test_by_slug(self):
"""Test that you can route to an article by using its slug"""
post = factories.PostFactory.create()
response = self.client.get("/article/{}/".format(... | BowdoinOrient/bongo | bongo/apps/frontend/tests/view_tests.py | Python | mit | 3,185 |
import time
from datetime import datetime
from pydoc import locate
from unittest import SkipTest
from countries_plus.models import Country
from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Permission
from django.test import override_settings, tag
fro... | ESSolutions/ESSArch_Core | ESSArch_Core/tags/tests/test_search.py | Python | gpl-3.0 | 22,665 |
"""Support for FRITZ!Box routers."""
import logging
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.components.device_tracker import (
DOMAIN,
PLATFORM_SCHEMA,
DeviceScanner,
)
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_USERNAME
_LOGGER... | Cinntax/home-assistant | homeassistant/components/fritz/device_tracker.py | Python | apache-2.0 | 2,975 |
from a10sdk.common.A10BaseClass import A10BaseClass
class Dns64(A10BaseClass):
"""Class Description::
Enable DNS64.
Class dns64 supports CRUD Operations and inherits from `common/A10BaseClass`.
This class is the `"PARENT"` class for this module.`
:param deep_check_rr_disable: {"default": 0,... | amwelch/a10sdk-python | a10sdk/core/cgnv6/cgnv6_template_dns_dns64.py | Python | apache-2.0 | 4,523 |
# -*- coding: utf-8 -*-
# Copyright 2015 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Collection of tools to create sysroots."""
from __future__ import print_function
import os
import sys
from chromite.lib impo... | endlessm/chromium-browser | third_party/chromite/scripts/cros_sysroot_utils.py | Python | bsd-3-clause | 3,433 |
np.random.seed(1234)
fig, ax = plt.subplots(1)
x = 30*np.random.randn(10000)
mu = x.mean()
median = np.median(x)
sigma = x.std()
textstr = '$\mu=%.2f$\n$\mathrm{median}=%.2f$\n$\sigma=%.2f$'%(mu, median, sigma)
ax.hist(x, 50)
# these are matplotlib.patch.Patch properties
props = dict(boxstyle='round', facecolor='wheat... | leesavide/pythonista-docs | Documentation/matplotlib/users/recipes-8.py | Python | apache-2.0 | 493 |
# PyTabs - Simplified music notation DSL, interpreter and player.
# Copyright (C) 2014, Milos Simic
#
# 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... | E2Music/pyTabs | pytabs/gui/window/MainForm.py | Python | gpl-3.0 | 1,837 |
"""
urlresolver XBMC Addon
Copyright (C) 2011 t0mm0
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 later version.
... | kreatorkodi/repository.torrentbr | script.module.urlresolver/lib/urlresolver/plugins/vidup_org.py | Python | gpl-2.0 | 1,232 |
# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*-
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
#
# MDAnalysis --- http://www.mdanalysis.org
# Copyright (c) 2006-2016 The MDAnalysis Development Team and contributors
# (see the file AUTHORS for the full list of names)
#
# Released under th... | kain88-de/mdanalysis | package/MDAnalysis/analysis/legacy/x3dna.py | Python | gpl-2.0 | 35,175 |
class MarketGroup():
def __init__(self):
self.description = None
self.hasTypes = None
self.iconID = None
self.marketGroupID = None
self.marketGroupName = None
self.parentGroupID = None
def setDescription(self, inVar):
self.description = inVar
def se... | WubbaDuck/EveData | marketGroup.py | Python | mit | 664 |
class ClusterDoesNotExist(Exception):
def __init__(self, cluster_name):
self.cluster_name = cluster_name
def __str__(self):
return u'''Cluster '{}' does not exist'''.format(self.cluster_name)
class MBActionCluster(object):
CLUSTERS = {'BASE': {'id': 1},
'FETCH': ... | urlist/urlist | motherbrain/workers/clusters.py | Python | gpl-3.0 | 929 |
#! /usr/bin/env python
import sys
import dendropy
trees = dendropy.TreeList.get_from_path(sys.argv[1], sys.argv[2])
for tidx1 in range(len(trees)-1):
for tidx2 in range(tidx1+1, len(trees)):
fp, fn = trees[tidx1].false_positives_and_negatives(trees[tidx2])
eed = trees[tidx1].euclidean_distance(tre... | jeetsukumaran/pstrudel | test/scripts/calc-splits-distances.py | Python | gpl-2.0 | 411 |
# Copyright (C) 2015 Tobias Brink
#
# 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 later version.
#
# This program is distributed in ... | t-brink/pscic | psciclib/units.py | Python | gpl-3.0 | 1,401 |
import numpy
from scipy.special import erfc
from . import kernels as FKN
def longrange(x, delta_k, split, factor):
""" factor shall be 3 * Omega_M / 2, if delta_k is really 1 + overdensity """
return longrange_batch([x], delta_k, split, factor)[0]
def longrange_batch(x, delta_k, split, factor):
""" like ... | rainwoodman/fastpm-python | fastpm/force/gravity.py | Python | gpl-3.0 | 3,683 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import dialer_cdr.models
import django.utils.timezone
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('dialer_campaign', '0001_initial'),
('country_d... | romonzaman/newfies-dialer | newfies/dialer_cdr/migrations/0001_initial.py | Python | mpl-2.0 | 7,194 |
__author__ = 'Josh Schneier'
__version__ = '0.01'
from .client import TorrentClient
| jschneier/TwistedTorrent | twistedtorrent/__init__.py | Python | mit | 85 |
# Copyright 2016 - Catalyst IT Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | openstack/python-mistralclient | mistralclient/api/v2/members.py | Python | apache-2.0 | 2,331 |
# -*- coding: utf-8 -*-
#
# gPodder - A media aggregator and podcast client
# Copyright (c) 2005-2014 Thomas Perl and the gPodder Team
#
# gPodder 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... | somini/gpodder | src/gpodder/log.py | Python | gpl-3.0 | 3,234 |
import json
import re
from nltk.corpus import stopwords
import myconstants
from myconstants import get_constant, HUNDRED
def del_punctuations(sentence, exception_list=myconstants.DEFAULT_PUNCTS):
regex_list = '[^a-zA-Z' + '^\\'.join(exception_list) + ']'
regex = re.compile(regex_list)
sentence = regex.sub(' '... | craigstar/bigData | ml/functions.py | Python | mit | 2,461 |
#!/usr/bin/env python
"""
Test module for projection scheme
"""
from builtins import range
from builtins import object
from proteus.iproteus import *
from proteus import Comm
comm = Comm.get()
Profiling.logLevel=1
Profiling.verbose=True
import os
import numpy as np
import tables
from . import (parameters,
... | erdc/proteus | proteus/tests/ProjScheme_with_EV/test_ns_convergence.py | Python | mit | 11,854 |
#-
# Copyright (c) 2013-2014 Michael Roe
# All rights reserved.
#
# This software was developed by SRI International and the University of
# Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237
# ("CTSRD"), as part of the DARPA CRASH research programme.
#
# @BERI_LICENSE_HEADER_START@
#
# Licensed t... | 8l/beri | cheritest/trunk/tests/fpu/test_raw_fpu_trunc_l_d64.py | Python | apache-2.0 | 2,571 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2015-12-22 10:59
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('trans', '0050_auto_20151222_1006'),
]
operations = [
... | jitka/weblate | weblate/trans/migrations/0051_auto_20151222_1059.py | Python | gpl-3.0 | 1,125 |
from django.db import models
from django.contrib.auth.models import User
from django.db.models.signals import post_save
class UserProfile(models.Model):
user = models.OneToOneField(User)
is_beneficiary = models.BooleanField(default=False)
is_donor = models.BooleanField(default=False)
class Meta:
... | agiliq/fundraiser | profiles/models.py | Python | bsd-3-clause | 666 |
from sqlalchemy import Column, Integer, String, Date, DateTime, CHAR, \
PrimaryKeyConstraint, ForeignKey, Text
from sqlalchemy.orm import relationship
from backend import db
class Members(db.Model):
__tablename__ = 'members'
id = Column(Integer, primary_key=True)
date_entered = Column(DateTime)
f... | neillc/memberdb-ng | backend/models/members.py | Python | gpl-2.0 | 6,966 |
from cebulany.csv import open_and_parse
from cebulany.models import Transaction
def fill_transactions(data):
from cebulany.app import app, db # cyclic import - sorry guys
with app.app_context():
for record in data:
transaction_query = (
db.session.query(Transaction)
... | hackerspace-silesia/cebulany-manager | cebulany/export_data.py | Python | mit | 1,445 |
from django.db import models
from django.contrib.auth.models import User
import numpy as np
# Create your models here.
class Whisky(models.Model):
name = models.CharField(max_length=200)
def average_rating(self):
all_ratings = [i.rating for i in self.review_set.all()]
return np.mean(all_rati... | DataMorgane/Whisky_Review | reviews/models.py | Python | mit | 1,029 |
from mediawords.key_value_store.amazon_s3 import AmazonS3Store
from .amazon_s3_credentials import (
TestAmazonS3CredentialsTestCase,
get_test_s3_credentials,
)
test_credentials = get_test_s3_credentials()
class TestAmazonS3StoreTestCase(TestAmazonS3CredentialsTestCase):
def _initialize_store(self) -> Ama... | berkmancenter/mediacloud | apps/common/tests/python/mediawords/key_value_store/test_amazon_s3.py | Python | agpl-3.0 | 758 |
# 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 PerlTestMemoryCycle(PerlPackage):
"""Check for memory leaks and circular memory references... | iulian787/spack | var/spack/repos/builtin/packages/perl-test-memory-cycle/package.py | Python | lgpl-2.1 | 718 |
from argparse import ArgumentParser
from typing import Any
from django.core.management import CommandError
from django.core.management.base import BaseCommand
from zerver.lib.queue import SimpleQueueClient
from zerver.worker.queue_processors import get_active_worker_queues
class Command(BaseCommand):
def add_arg... | tommyip/zulip | zerver/management/commands/purge_queue.py | Python | apache-2.0 | 1,653 |
#! /usr/bin/env python2
# encoding:utf-8
# python 2.7 测试通过
# python 3 更换适当的开发库就能使用,在此我们不额外提供
import httplib
import json
import hashlib
import random
import time
import argparse
class SmsSingleSender:
""" 单发类定义"""
appid = 0
appkey = ""
url = "https://yun.tim.qq.com/v5/tlssmssvr/sendsms"
template = ... | TalkingData/owl | src/controller/scripts/actions/send_tencent_sms.py | Python | apache-2.0 | 5,749 |
import tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['Anscombe'] , ['MovingAverage'] , ['Seasonal_WeekOfYear'] , ['LSTM'] ); | antoinecarme/pyaf | tests/model_control/detailed/transf_Anscombe/model_control_one_enabled_Anscombe_MovingAverage_Seasonal_WeekOfYear_LSTM.py | Python | bsd-3-clause | 166 |
#
# Copyright 2014-2015 Universidad Complutense de Madrid
#
# This file is part of Megara DRP
#
# Megara DRP 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 optio... | Pica4x6/megaradrp | megaradrp/loader.py | Python | gpl-3.0 | 889 |
# -*- coding: utf-8 -*-
"""Import NeuroElectrics DataFormat (NEDF) files."""
from copy import deepcopy
from datetime import datetime, timezone
from xml.etree import ElementTree
import numpy as np
from ..base import BaseRaw
from ..meas_info import create_info
from ..utils import _mult_cal_one
from ...utils import war... | kambysese/mne-python | mne/io/nedf/nedf.py | Python | bsd-3-clause | 7,606 |
from setuptools import setup, find_packages
import os
import rsssync
CLASSIFIERS = [
'Development Status :: 4 - Beta',
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
... | ebrelsford/django-rsssync | setup.py | Python | bsd-3-clause | 1,112 |
#!/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... | civisanalytics/ansible | lib/ansible/modules/network/nxos/nxos_command.py | Python | gpl-3.0 | 8,114 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | wrouesnel/ansible | lib/ansible/modules/network/aci/aci_interface_policy_l2.py | Python | gpl-3.0 | 7,145 |
#
# From: KevinL <darius@bofh.net.au>
# A simple dns answer cache - it's author notes:
# "It's probably really bodgy code, tho - it was my early python..."
# So don't send him abusive messages if you hate it.
#
class DNSCache:
"""
Covers the DNS object, keeps a cache of answers. Clumsy as hell.
"... | g-fleischer/wtfy | trackingserver/thirdparty/pydns/tools/caching.py | Python | gpl-3.0 | 1,599 |
#TSTOP
#
#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 later version.
#
#This program is distributed in the hope that it will be useful,
... | gpersistence/tstop | scripts/plots/distance_mds.py | Python | gpl-3.0 | 3,725 |
# Shows how to integrate Spark into RTX
name = "CrowdNav-Spark"
execution_strategy = {
"ignore_first_n_results": 10,
"sample_size": 10,
"type": "step_explorer",
"knobs": {
"route_random_sigma": ([0.0, 1.0], 0.1)
}
}
pre_processors = [{
"type": "spark",
"submit_mode": "client_jar",
... | Starofall/RTX | examples/crowdnav-spark/definition.py | Python | mit | 1,225 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
# Greed is a dice game where you roll up to five dice to accumulate
# points. The following "score" function will be used calculate the
# score of a single roll of the dice.
#
# A greed roll is scored as follows:
#
# * A set of three ones is 100... | jemofthewest/mykoans | python3/koans/about_scoring_project.py | Python | mit | 2,742 |
"""
"""
import os
from flask import Module, url_for, render_template, request, session, redirect, g, current_app
from decorators import login_required, guest_or_login_required, with_lock
from flaskext.babel import Babel, gettext, ngettext, lazy_gettext
_ = gettext
worksheet_listing = Module('flask_version.worksheet_li... | viswimmer1/PythonGenerator | data/python_files/30691815/worksheet_listing.py | Python | gpl-2.0 | 12,679 |
from pyglet import gl
from pyglet import window
from pyglet import app
from pyglet import clock
from pyglet.window import key
from pyglet.window import mouse
import time
from state import *
from random import randrange
update_period = 1
last_update = time.time()
pause = 0
SPEED_MODIFIER_STEP = 0.75
speed_IO = 1
paus... | rgrigoriadi/pyGameOfLife | game.py | Python | gpl-2.0 | 3,342 |
from ..exception import FuzzExceptBadOptions
import re
import collections
from ..facade import BASELINE_CODE
class FuzzResSimpleFilter:
def __init__(self, ffilter=None):
self.hideparams = dict(
regex_show=None,
codes_show=None,
codes=[],
words=[],
... | xmendez/wfuzz | src/wfuzz/filters/simplefilter.py | Python | gpl-2.0 | 3,567 |
#!/usr/bin/env python2
import numpy as np
import matplotlib.pyplot as plt
import argparse
import sys
import os
parser = argparse.ArgumentParser(
prog='plot_qrotor_backstepping_controller')
parser.add_argument('directory', type=str, help='Data directory')
args = parser.parse_args()
controller_data = np.genfromtxt(... | jhu-asco/aerial_autonomy | scripts/analysis/plot_qrotor_backstepping_controller.py | Python | mpl-2.0 | 3,809 |
# -*- coding: utf-8 -*-
class SendyException(Exception): pass
class UserException(SendyException): pass
class HttpRequestException(SendyException): pass
class InvalidEmailAddressException(UserException): pass
class AlreadySubscribedException(UserException): pass
class SomeFieldsAreMissingException(UserException): pass... | thiagofa/pysendy | pysendy/exceptions.py | Python | mit | 765 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2011 Citrix Systems, Inc.
# Copyright 2011 OpenStack 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
#
# htt... | aristanetworks/arista-ovs-nova | nova/virt/vmwareapi/driver.py | Python | apache-2.0 | 15,373 |
#
# Univention Management Console
#
# Copyright 2014 Univention GmbH
#
# http://www.univention.de/
#
# All rights reserved.
#
# The source code of this program is made available
# under the terms of the GNU Affero General Public License version 3
# (GNU AGPL V3) as published by the Free Software Foundation.
#
# Binary ... | spaceone/univention-management-console | univention/umc/server/request.py | Python | agpl-3.0 | 13,915 |
from model.Faction import Faction
class Player:
def __init__(self, id, me, name, strategy_crashed, score, faction: (None, Faction)):
self.id = id
self.me = me
self.name = name
self.strategy_crashed = strategy_crashed
self.score = score
self.faction = facti... | SFURoyal-CodeWizards/CodeWizards | royal-wizard/model/Player.py | Python | gpl-3.0 | 324 |
import pytest
import os
from fontTools.ttLib import TTFont
from fontbakery.checkrunner import (DEBUG, INFO, WARN, ERROR,
SKIP, PASS, FAIL, ENDCHECK)
from fontbakery.codetesting import (assert_results_contain,
assert_PASS,
... | googlefonts/fontbakery | tests/profiles/googlefonts_test.py | Python | apache-2.0 | 173,857 |
# Copyright 2014 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from mock import patch, Mock
import os
import tempfile
import unittest
import common
from naclports.configuration import Configuration
from naclports i... | Schibum/naclports | lib/naclports/tests/test_util.py | Python | bsd-3-clause | 3,881 |
import uuid
u = uuid.uuid1()
print(u)
print(type(u))
print('bytes :', repr(u.bytes))
print('hex :', u.hex)
print('int :', u.int)
print('urn :', u.urn)
print('variant :', u.variant)
print('version :', u.version)
print('fields :', u.fields)
print(' time_low : ', u.time_low)
print(' time_mid ... | jasonwee/asus-rt-n14uhp-mrtg | src/lesson_the_internet/uuid_uuid1.py | Python | apache-2.0 | 641 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import account_analytic_balance_report
import account_analytic_inverted_balance_report
import account_analytic_cost_ledger_report
import account_analytic_cost_ledger_for_journal_report
import account_analytic_chart
| tvtsoft/odoo8 | addons/analytic/wizard/__init__.py | Python | agpl-3.0 | 315 |
import math
import datetime
class Paginator(object):
@staticmethod
def get_pages(current_page, entries_per_page, total_entries):
entries = []
total_pages = math.ceil(float(total_entries) / float(entries_per_page))
# Add the first and previous pages
if current_p... | Matoking/pastebin-django | pastebin/util.py | Python | unlicense | 2,755 |
# -*- coding: utf-8 -*-
###############################################################################
#
# UpdateFoodGoal
# Create or updates a user's current daily calorie consumption goal or Food Plan.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2... | jordanemedlock/psychtruths | temboo/core/Library/Fitbit/Foods/UpdateFoodGoal.py | Python | apache-2.0 | 5,362 |
# 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 Bird(AutotoolsPackage):
"""The BIRD project aims to develop a dynamic IP routing daemon wi... | LLNL/spack | var/spack/repos/builtin/packages/bird/package.py | Python | lgpl-2.1 | 1,198 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-10-08 19:35
# Django
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('crowdsource', '0023_auto_20190718_1424'),
]
operations = [
migrations.AddField(
model_name='c... | MuckRock/muckrock | muckrock/crowdsource/migrations/0024_crowdsourceresponse_public.py | Python | agpl-3.0 | 585 |
import os
path = "/home/jonyroy/Desktop/UVA"
for x in os.listdir(path):
if os.path.isfile(x) and os.access(x,os.X_OK):
print x | abcxyz09/MyCodeLibrary | PYTHON/exerecog.py | Python | gpl-3.0 | 130 |
from __future__ import print_function, division
import os
import serial
import time
import platform
import atexit
import exceptions
import operator
DEBUG = False
class WriteFrequencyError(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
cla... | janelia-idf/fly-sorter | serial_device/src/serial_device/serial_device.py | Python | bsd-3-clause | 8,888 |
# -*- coding: utf-8 -*-
#
# A higher level module for using sockets (or Windows named pipes)
#
# multiprocessing/connection.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#
from __future__ import absolute_import
import errno
import io
import os
import sys
import socket
impo... | ammarkhann/FinalSeniorCode | lib/python2.7/site-packages/billiard/connection.py | Python | mit | 32,849 |
from Vintageous.vi.utils import modes
mappings = {
modes.NORMAL: {},
modes.OPERATOR_PENDING: {},
modes.VISUAL: {},
modes.VISUAL_LINE: {},
modes.VISUAL_BLOCK: {},
modes.SELECT: {},
}
classes = {}
def register(seq, modes, *args, **kwargs):
"""
Registers a 'key sequence' to 'command' mapping... | zhangtuoparis13/Vintageous | plugins/plugins.py | Python | mit | 822 |
# pylint: disable=invalid-name
import cv2
import numpy as np
import json
import requests
path_to_image = "/tmp/data/mnist_png/testing/4/6.png"
img_width, img_height = 28, 28
url = "http://127.0.0.1:32773/score"
img = cv2.imread(path_to_image)
img = cv2.resize(img, (img_width, img_height))
input_array = np.array(img... | vu-h-le/aml-deep-learning-mnist | keras_mnist_client.py | Python | mit | 587 |
from setuptools import setup, find_packages
import os
version = '1.0'
setup(name='meetshaus.jmscontent',
version=version,
description="JMS Site Content",
long_description=open("README.txt").read() + "\n" +
open(os.path.join("docs", "HISTORY.txt")).read(),
# Get more stri... | potzenheimer/buildout.jms | src/meetshaus.jmscontent/setup.py | Python | mit | 1,424 |
from tkinter import *
from tkinter import ttk
from Parser import *
from checker import *
from Area import *
#global Map_File
def map_file_open():
global Map_File
#Map_File = open('sydney250m.txt','r').read()
Map_File = filedialog.askopenfile(mode='r').read()
print("File Load: Done!")
pass#return M... | iwancoppa/1730-PHMP | Main.py | Python | mit | 1,720 |
from django.conf.urls.defaults import *
from django.contrib import admin
admin.autodiscover()
from transparencia.views import index, etiqueta, promesa, personaje
# TEMP
from transparencia.views import *
urlpatterns = patterns('',
url(r'^$', index, name='index'),
url(r'^etiqueta/(?P<slug>[-\w]+)/$', etiqueta... | elhoyos/colombiatransparente | urls.py | Python | gpl-3.0 | 1,127 |
from datetime import date, timedelta
from django.contrib import admin
from django.contrib.admin import SimpleListFilter
from django.utils.translation import ugettext_lazy as _
from django.utils import timezone
from .models import Source, Patient, HappyBirthdayPatient
@admin.register(Source)
class SourceAdmin(admin.M... | edilio/dental | fern/admin.py | Python | mit | 5,332 |
'''
Support package for processing a dbSNP tabix dump from UCSC.
'''
import collections
import sys
import pysam
from ngsutils.support import revcomp
class SNPRecord(collections.namedtuple('SNPRecord', '''bin
chrom
chromStart
chromEnd
name
score
strand
refNCBI
refUCSC
observed
molType
clazz
valid
avHet
avHetSE
func
... | nturaga/tools-iuc | tools/ngsutils/ngsutils/support/dbsnp.py | Python | mit | 3,664 |
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.internet.stdio}.
@var properEnv: A copy of L{os.environ} which has L{bytes} keys/values on POSIX
platforms and native L{str} keys/values on Windows.
"""
from __future__ import absolute_import, division
import os
impo... | Architektor/PySnip | venv/lib/python2.7/site-packages/twisted/test/test_stdio.py | Python | gpl-3.0 | 13,157 |
# Copyright 2017, Google LLC All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | googleapis/python-pubsub | tests/system.py | Python | apache-2.0 | 36,835 |
"""Organization class containing all logic for creating, checking, and updating organizations."""
import logging
from os.path import join
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Union
import hdx.data.dataset
import hdx.data.user as user_module
from hdx.api.configuration import Configuration
from h... | OCHA-DAP/hdx-python-api | src/hdx/data/organization.py | Python | mit | 11,105 |
#!/usr/bin/env python
#
# Copyright 2001-2004 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright n... | MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-2.6/Lib/test/test_logging.py | Python | mit | 28,308 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.