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 |
|---|---|---|---|---|---|
from .base_endpoint import BaseEndpoint
class ContactList(BaseEndpoint):
"""
Class representation of the ContactList endpoint.
Examples:
If you want to use contact lists' methods through an instance of the Emarsys
client:
>>> from pymarsys import SyncConnection, Emarsys
>>> connection = S... | transcovo/pymarsys | pymarsys/contact_list.py | Python | apache-2.0 | 3,259 |
from listenbrainz_spark.tests import SparkTestCase
from listenbrainz_spark import utils, path, config
import listenbrainz_spark.utils.mapping as mapping_utils
from pyspark.sql import Row
class MappingUtilsTestCase(SparkTestCase):
mapping_path = path.MBID_MSID_MAPPING
@classmethod
def setUpClass(cls):
... | Freso/listenbrainz-server | listenbrainz_spark/utils/tests/test_mapping.py | Python | gpl-2.0 | 2,305 |
from django.core import validators
from django.db import models
from django.contrib.sites.models import Site
from django.utils.translation import ugettext_lazy as _
class FlatPage(models.Model):
url = models.CharField(_('URL'), max_length=100, validator_list=[validators.isAlphaNumericURL], db_index=True,
... | pelle/talk.org | django/contrib/flatpages/models.py | Python | gpl-3.0 | 1,630 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2014 Therp BV (<http://therp.nl>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of t... | savoirfairelinux/OpenUpgrade | openerp/openupgrade/openupgrade_loading.py | Python | agpl-3.0 | 7,021 |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.6.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
im... | skuda/client-python | kubernetes/test/test_v1_env_var.py | Python | apache-2.0 | 803 |
r"""Implementation of SPINN in TensorFlow eager execution.
SPINN: Stack-Augmented Parser-Interpreter Neural Network.
Ths file contains model definition and code for training the model.
The model definition is based on PyTorch implementation at:
https://github.com/jekbradbury/examples/tree/spinn/snli
which was rel... | jwlawson/tensorflow | third_party/examples/eager/spinn/spinn.py | Python | apache-2.0 | 29,639 |
import os
import pickle
from django.shortcuts import render
from django.http import HttpResponse
from django.db.models import Q
from models import Disease, SubmatrixData
def navigation_autocomplete(request,
template_name='autocomplete.html'):
q = request.GET.get('q', '')
context = {'q': q}
queries = ... | transcranial/diseasegraph | main/views.py | Python | mit | 8,086 |
# coding=utf-8
# Copyright 2019 Google LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | google-research/episodic-curiosity | episodic_curiosity/generate_r_training_data.py | Python | apache-2.0 | 15,050 |
# -*- coding: utf-8 -*-
from pCMS.pcomments.forms import pCMSCommentForm
def get_form():
return pCMSCommentForm
| sv1jsb/pCMS | pCMS/pcomments/__init__.py | Python | bsd-3-clause | 118 |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
Use genetic map to break chimeric scaffolds, order and orient scaffolds onto
chromosomes.
"""
import os.path as op
import sys
import logging
import numpy as np
from collections import Counter
from functools import lru_cache
from itertools import combinations, groupby
... | tanghaibao/jcvi | jcvi/assembly/geneticmap.py | Python | bsd-2-clause | 20,122 |
import json
import urllib
from django.core.mail import EmailMultiAlternatives
from django.core.serializers.json import DjangoJSONEncoder
from django.db import transaction, connection
from django.http import HttpResponse
from django.shortcuts import render_to_response
from library.f_lib import *
from library.models imp... | artbart/DistributedLibrary | library/pac_views/v_messages.py | Python | mit | 3,107 |
from browser import ajax
class FileIO:
def __init__(self, data):
self._data=data
def read(self):
return self._data
def urlopen(url, data=None, timeout=None):
global result
result=None
def on_complete(req):
global result
result=req
_ajax=ajax.ajax()
_ajax.bind('co... | andresmrm/brython-experiment | static/brython/Lib/urllib/request.py | Python | agpl-3.0 | 703 |
# -*- coding: utf-8 -*-
from Scraping4blog import Scraping4blog
import sys,os
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../util')
from settings import SettingManager
def main():
conf = SettingManager()
instance = Scraping4blog(conf)
instance.run()
if __name__ == "__main__":
main... | yamanakahirofumi/mokobot | Scraping4blog/run.py | Python | mit | 323 |
import sys
import time
import math
import random
from modules import *
from psychopy import visual, core, data, event, logging, sound, gui, misc, monitors
from psychopy.constants import *
import numpy as np
import os
import Image
import ctypes
MONITOR_NAME = 'tomimac'
def display_grid(population, goal, grid_size):
... | Chippers255/bugs | old_source/test_psychopy.py | Python | mit | 5,397 |
import __builtin__
import json
from requests import post, get
import maps
from tendrl.monitoring_integration.grafana import utils
from tendrl.monitoring_integration.grafana import exceptions
HEADERS = {"Accept": "application/json",
"Content-Type": "application/json"
}
''' Create new organi... | rishubhjain/monitoring-integration | tendrl/monitoring_integration/grafana/grafana_org_utils.py | Python | lgpl-2.1 | 3,039 |
# setup.py
from distutils.core import setup
import py2exe
setup(name='WrestlingNerd',
version='3.2',
author='Peter Parente',
author_email='parente@cs.unc.edu',
url='http://wnerd.sourceforge.net',
description='Wrestling Nerd: Wrestling tournament management software',
options = {'py2... | parente/wnerd | setup.py | Python | mit | 762 |
# -*- coding: utf-8 -*-
##############################################################################
#
# This file is part of mozaik_mandate, an Odoo module.
#
# Copyright (c) 2015 ACSONE SA/NV (<http://acsone.eu>)
#
# mozaik_mandate is free software:
# you can redistribute it and/or
# modify it u... | acsone/mozaik | mozaik_mandate/tests/test_electoral_results_wizard.py | Python | agpl-3.0 | 14,966 |
from mrjob.job import MRJob
from mrjob.protocol import JSONValueProtocol
import re
WORD_RE = re.compile(r"[\w']+")
class ReviewWordCount(MRJob):
INPUT_PROTOCOL = JSONValueProtocol
def extract_words(self, _, record):
"""Extract words using a regular expression. Normalize the text to
ignore ... | shngli/Data-Mining-Python | MapReduce Yelp analysis/review_word_count.py | Python | gpl-3.0 | 945 |
import os
import sys
import time
import traceback
from multiprocessing.dummy import Pool
# self-defined module
import parser
import image_downloader
import uploader
import source_map
# third party module
import yaml
import updater
import click
from google.api_core.exceptions import GoogleAPICallError
class UfileTra... | sillygod/my-travel-in-learning-python | ufile_transfer/main.py | Python | gpl-2.0 | 8,700 |
from __future__ import unicode_literals
from django.conf import settings
# thx to @wullerot https://gist.github.com/wullerot/9fe3151101e57a9ee6fadb3cababb619
class LanguageTabsMixin(object):
change_form_template = 'admin/djangocms_misc/modeltranslation_lang_tabs_change_form.html'
def change_view(self, reque... | bnzk/djangocms-misc | djangocms_misc/basic/admin.py | Python | mit | 960 |
# Copyright 2018 The TensorFlow Authors. 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 applica... | pair-code/what-if-tool | tensorboard_plugin_wit/wit_plugin.py | Python | apache-2.0 | 19,439 |
class TestOpenIDRelyingPartyMiddleware(object):
'''Test Application for the Authentication handler to protect'''
response = "Test Authentication redirect application"
def __init__(self, app_conf, **local_conf):
self.beakerSessionKeyName = app_conf['beakerSessionKeyName']
def __call_... | philipkershaw/ndg_security_server | ndg/security/server/test/integration/openidrp_and_sslauthn/securedapp.py | Python | bsd-3-clause | 1,756 |
from django import template
from django.utils.translation import ugettext
register = template.Library()
@register.filter
def get_item(d, key):
return d.get(key, None)
@register.filter(name='translate')
def translate(text):
return ugettext(text)
| yourlabs/django-permissions-widget | permissions_widget/templatetags/permissions_widget_tags.py | Python | mit | 258 |
import numpy as np
import tensorflow as tf
def _xavier_init(fan_in, fan_out, constant=1):
"""
Xavier initialization of network weights.
For some explanations see:
- http://andyljones.tumblr.com/post/110998971763/an-explanation-of-xavier-initialization
- http://jmlr.org/proceedings/papers/v... | jotterbach/dstk | DSTK/AutoEncoder/autoencoder.py | Python | mit | 12,799 |
# Copyright 2013 OpenStack Foundation
# 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 requ... | fengbeihong/tempest_automate_ironic | tempest/api/network/test_routers_negative.py | Python | apache-2.0 | 5,998 |
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 |
from __future__ import absolute_import
import unittest
from variantmethod import variantmethod
class Testvariantmethod(unittest.TestCase):
def setUp(self):
class MyClass(object):
def __init__(self):
pass
@variantmethod
def variant(self, first):
... | OaklandPeters/clsdescriptor | clsdescriptor/test_variantmethod.py | Python | mit | 853 |
from optparse import make_option
from urlparse import urlparse
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from treeherder.client import PerfherderClient, PerformanceTimeInterval
from treeherder.perfalert import PerfDatum, TalosAnalyzer
class Command(BaseComman... | vaishalitekale/treeherder | treeherder/model/management/commands/test_analyze_perf.py | Python | mpl-2.0 | 5,596 |
"""
I came up with this the first try. So, that's why this is posted in duplicate.
"""
import sys
try:
columns = int(input("How many columns? "))
rows = int(input("How many rows? "))
tall = int(input("How tall should the boxes be? "))
wide = int(input("How wide should the boxes be? "))
except Excepti... | MattD830/Python-INFO1-CE9990 | graphpaper2.py | Python | gpl-3.0 | 968 |
from sqlalchemy.dialects.mssql.pyodbc import MSDialect_pyodbc
class BigQueryDialect_pyodbc(MSDialect_pyodbc):
pass
| cpdean/sqlalchemy-bigquery | sqlalchemy_bigquery/pyodbc.py | Python | mit | 121 |
# -*- coding: utf-8 -*-
# Copyright 2014 Google Inc. 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 require... | endlessm/chromium-browser | third_party/catapult/third_party/gsutil/gslib/utils/translation_helper.py | Python | bsd-3-clause | 38,303 |
# -*- coding: utf-8 -*-
'''
custimized seq2seq(https://github.com/farizrahman4u/seq2seq)
'''
from __future__ import absolute_import
from seq2seq.layers.encoders import LSTMEncoder
from seq2seq.layers.decoders import LSTMDecoder, LSTMDecoder2, AttentionDecoder
from seq2seq.layers.bidirectional import Bidirectional
from... | masterkeywikz/seq2graph | amr2seq/seq2seq_util/seq2seq_models.py | Python | mit | 3,705 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('mig_main', '0005_remove_memberprofile_edu_bckgrd_form'),
]
operations = [
migrations.AddField(
model_name='userp... | tbpmig/mig-website | mig_main/migrations/0006_userprofile_maiden_name.py | Python | apache-2.0 | 487 |
'''
Created on 10 Aug 2016
@author: bcraenen
'''
import sys
from sklearn.tree import _tree
from root.main.ArffHandler import Arffhandler
from sklearn.ensemble.forest import RandomForestClassifier
from root.other import Fragment.KnowledgeFragment
class ForestHandler(object):
def _get_tree_paths(self, tree, node_i... | bcraenen/KFClassifier | other/handlers/ForestHandler.py | Python | gpl-3.0 | 7,770 |
# pylint: disable=W0611
'''
Kivy Base
=========
This module contains the Kivy core functionality and is not intended for end
users. Feel free to look through it, but bare in mind that calling any of
these methods directly may result in an unpredictable behavior as the calls
access directly the event loop of an applica... | inclement/kivy | kivy/base.py | Python | mit | 19,012 |
##Copyright 2011-2014 Thomas Paviot (tpaviot@gmail.com)
##
##This file is part of pythonOCC.
##
##pythonOCC is free software: you can redistribute it and/or modify
##it under the terms of the GNU Lesser General Public License as published by
##the Free Software Foundation, either version 3 of the License, or
##(at your... | sven-hm/pythonocc-core | src/addons/Display/WebGl/threejs_renderer.py | Python | lgpl-3.0 | 12,135 |
from .SignalDataCanvas import SignalDataCanvas
from .SignalDataCanvas import SignalDataCanvasFast
| peace098beat/pyside_cookbook | 10_MatplotlibVSPygraph/mplcanvas/__init__.py | Python | gpl-3.0 | 104 |
import logging
from django.conf import settings
from django.core.management.base import NoArgsCommand
from django.db import connection
from mailer.engine import send_all
# allow a sysadmin to pause the sending of mail temporarily.
PAUSE_SEND = getattr(settings, "MAILER_PAUSE_SEND", False)
class Command(NoArgsComm... | richardbarran/django-mailer | mailer/management/commands/send_mail.py | Python | mit | 759 |
from ..errors import *
from .core import BoundObject, Type
from .stats import ScopeStats
class VoidType(Type, BoundObject):
def __init__(self, name:str = ""):
BoundObject.__init__(self, name)
def verify(self):
self._stats = ScopeStats(self.parent)
self.stats.static = True
self... | CameronLonsdale/jam | compiler/lekvar/void_type.py | Python | mit | 746 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2005 Ole André Vadla Ravnås <oleavr@gmail.com>
# Copyright (C) 2006-2007 Ali Sabil <ali.sabil@gmail.com>
# Copyright (C) 2007 Johann Prieur <johann.prieur@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Gene... | Kjir/papyon | papyon/gnet/io/tcp.py | Python | gpl-2.0 | 1,708 |
#! /usr/bin/python
'''
@author: Alister Maguire
Given a counts file and a taxa file, condense
repeated genus' and their counts, and output
a file that maps genus names to their counts
for each experiment.
'''
import argparse
def is_number(s):
try:
float(s)
return True
except ValueError:
... | aowen87/PhyloViewer | src/condense.py | Python | gpl-3.0 | 3,122 |
# Copyright 2016 The Switch Authors. All rights reserved.
# Licensed under the Apache License, Version 2, which is in the LICENSE file.
"""
This module defines hydroelectric system components. It creates a hydraulic
system that works in parallel with the electric one. They are linked through
the power generation proc... | bmaluenda/switch | switch_mod/generators/hydro_system.py | Python | apache-2.0 | 23,261 |
""" This module sets up django environment so that other scripts need not worry about these mundane tasks.
"""
def main():
try:
from pysis.settings import settings
except ImportError:
try:
from pysis import settings
except ImportError:
import sys
sys... | sramana/pysis | scripts/bootstrap_django.py | Python | unlicense | 527 |
"""Library generic utils."""
| lucasrodes/whatstk | whatstk/utils/__init__.py | Python | gpl-3.0 | 29 |
#!/usr/bin/python3
import os
import glob
import RPi.GPIO as GPIO
import time
import datetime
GPIO.setmode(GPIO.BCM) # set board mode to broadcom
GPIO.setwarnings(False)
#GPIO.setup(6, GPIO.OUT) # set up pins for output mode
#GPIO.setup(6, GPIO.HIGH) # set pin states to high
#GPIO.setup(13, GPIO.OUT) # set up pin 13 ... | dragonbeard/calvin | calvin.py | Python | gpl-3.0 | 1,854 |
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | googleapis/python-aiplatform | samples/snippets/job_service/create_batch_prediction_job_video_object_tracking_sample.py | Python | apache-2.0 | 2,379 |
# Copyright (C) 2020 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import os
import psycopg2
from processing.main import (
get_latest_id,
connect,
PROCESSED_VIEW,)
LAST_PROCESSED = """
CREATE OR REPLACE VIEW {} AS
SELECT MAX(id) AS last_id FROM records WHERE processed = True
""".format(PROCE... | alexjch/telemetrics-backend | deployments/services/processing/entrypoint.py | Python | apache-2.0 | 1,043 |
# -*- coding: utf-8 -*-
import re
import os
from datetime import datetime
from lxml import etree, html
from django import db
from eduskunta.importer import Importer, ParseError
from parliament.models.session import *
from parliament.models.member import Member
from .member import fix_mp_name
VOTE_MAP = {
'Jaa': 'Y... | kansanmuisti/kamu | Attic/eduskunta/vote.py | Python | agpl-3.0 | 8,603 |
from flask import render_template, redirect, request, url_for, flash
from . import auth
from ..models import User
from .forms import LoginForm, RegistrationForm
from flask_login import login_user, logout_user, login_required, current_user
from .. import db
from ..email import send_email
@auth.route('/login', methods=... | bobbyxuy/flask_web | app/auth/views.py | Python | mit | 1,344 |
# Copyright 2014 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | axbaretto/beam | sdks/python/.tox/py27gcp/lib/python2.7/site-packages/google/cloud/_testing.py | Python | apache-2.0 | 3,140 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# ==============================================================================
# author :Ghislain Vieilledent
# email :ghislain.vieilledent@cirad.fr, ghislainv@gmail.com
# web :https://ecology.ghislainv.fr
# python_version :>=2.7
# license... | ghislainv/deforestprob | forestatrisk/validate/model_validation.py | Python | gpl-3.0 | 7,618 |
__author__ = 'jitrixis'
from TCP import * | Jitrixis/2ARC-Network-stack | TVpy/Layers/Segment/all.py | Python | mit | 42 |
"""IPython terminal interface using prompt_toolkit"""
from __future__ import print_function
import os
import sys
import warnings
from warnings import warn
from IPython.core.interactiveshell import InteractiveShell, InteractiveShellABC
from IPython.utils import io
from IPython.utils.py3compat import PY3, cast_unicode_... | pacoqueen/ginn | extra/install/ipython2/ipython-5.10.0/IPython/terminal/interactiveshell.py | Python | gpl-2.0 | 21,375 |
'''
NetNS
=====
A NetNS object is IPRoute-like. It runs in the main network
namespace, but also creates a proxy process running in
the required netns. All the netlink requests are done via
that proxy process.
NetNS supports standard IPRoute API, so can be used instead
of IPRoute, e.g., in IPDB::
# start the main... | little-dude/pyroute2 | pyroute2/netns/nslink.py | Python | apache-2.0 | 9,894 |
import random
import pytz
from users.tests.factories import UserFactory
from ksg_nett import settings
from factory import Faker, SubFactory
from factory.django import DjangoModelFactory
from factory import post_generation
from quotes.models import Quote, QuoteVote
class QuoteFactory(DjangoModelFactory):
class M... | KSG-IT/ksg-nett | quotes/tests/factories.py | Python | gpl-3.0 | 1,122 |
"""
Django settings for bheemboy project.
Generated by 'django-admin startproject' using Django 1.9.6.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
import os
... | s-gv/bheemboy | bheemboy/settings.py | Python | mit | 4,587 |
# -*- coding: utf-8 -*-
#
# deepnlp documentation build configuration file, created by
# sphinx-quickstart on Tue Nov 1 18:26:22 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated fi... | rockingdingo/deepnlp | docs/conf.py | Python | mit | 9,634 |
from sqlalchemy import create_engine, and_
from datetime import datetime
import numpy as np
from models import (ActionMixin, UserMixin, ItemMixin, ComputationMixin,
COMPUTATION_SK_NAME,
ACTION_UPVOTE, ACTION_DOWNVOTE,
ACTION_FLAG_SPAM, ACTION_FLAG_HAM)
impor... | mshavlovsky/mannord | mannord/api.py | Python | bsd-2-clause | 8,226 |
# Copyright (C) 2013-2020 Internet Systems Consortium.
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET ... | isc-projects/forge | tests/config.py | Python | isc | 3,628 |
# This file is a part of MediaDrop (http://www.mediadrop.net),
# Copyright 2009-2015 MediaDrop contributors
# For the exact contribution history, see the git revision log.
# The source code contained in this file is licensed under the GPLv3 or
# (at your option) any later version.
# See LICENSE.txt in the main project ... | jobsafran/mediadrop | mediadrop/model/tags.py | Python | gpl-3.0 | 5,446 |
import fiona
import os
from shapely.geometry import shape
from shapely.geometry import mapping
import arcpy
import os
def select_tiles(country, footprint):
tile_list = []
with fiona.open(footprint, 'r') as grid:
with fiona.open(country, 'r') as country:
# compare each feature in dataset 1 a... | elizabethgoldman/emerging_hotspots | utilities.py | Python | apache-2.0 | 2,694 |
# -*- coding: utf-8 -*-
#
# Neural Monkey documentation build configuration file, created by
# sphinx-quickstart on Wed Aug 31 14:49:25 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.... | ufal/neuralmonkey | docs/source/conf.py | Python | bsd-3-clause | 10,109 |
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Ericsson AB
#
# 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 ... | EricssonResearch/calvin-base | calvin/actorstore/systemactors/io/Knob.py | Python | apache-2.0 | 1,570 |
# -*- python -*-
#
# This file is part of the cinapps.tcell package
#
# Copyright (c) 2012-2014 - EMBL-EBI
#
# File author(s): Thomas Cokelaer (cokelaer@ebi.ac.uk)
#
# Distributed under the GLPv3 License.
# See accompanying file LICENSE.txt or copy at
# http://www.gnu.org/licenses/gpl-3.0.html
#
# website: w... | cellnopt/cellnopt | cno/io/sbmlqual.py | Python | bsd-2-clause | 19,177 |
'''
Copyright 2013 Mark Dredze. All rights reserved.
This software is released under the 2-clause BSD license.
Mark Dredze, mdredze@cs.jhu.edu
'''
# Input- a whitelist for each area, a list of submissions per area, csv file with reviewer signups
# The area must add people to their whitelist that they approve of by usin... | mdredze/automated_reviewer_assigner | python/acl_greedy_assign_reviewers.py | Python | bsd-2-clause | 24,923 |
"""Storage for pytest objects during test runs
The objects in the module will change during the course of a test run,
so they have been stashed into the 'store' namespace
Usage:
# imported directly (store is pytest.store)
from cfme.fixtures.pytest_store import store
store.config, store.pluginmanager, sto... | anurag03/integration_tests | cfme/fixtures/pytest_store.py | Python | gpl-2.0 | 6,454 |
"""
FormWizard class -- implements a multi-page form, validating between each
step and storing the form's state as HTML hidden fields so that no state is
stored on the server side.
"""
import cPickle as pickle
from django import forms
from django.conf import settings
from django.contrib.formtools.utils impo... | rimbalinux/MSISDNArea | django/contrib/formtools/wizard.py | Python | bsd-3-clause | 12,391 |
#!/usr/bin/env /usr/bin/python
#
# Copyright 2004 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your... | trnewman/VT-USRP-daughterboard-drivers_python | gr-atsc/src/python/interp.py | Python | gpl-3.0 | 2,405 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import diaper
import fauxfactory
import hashlib
import iso8601
import random
import re
import command
import yaml
from contextlib import closing
from django.core.cache import cache
from django.core.exceptions import ObjectDoesNotExist
from django.core.mail... | psav/cfme_tests | sprout/appliances/tasks.py | Python | gpl-2.0 | 91,308 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Contains functions for running analysis tasks
"""
# ~~~~~ LOGGING ~~~~~~ #
import logging
logger = logging.getLogger(__name__)
# ~~~~~ LOAD MORE PACKAGES ~~~~~ #
import os
import json
from sns_classes.classes import SnsWESAnalysisOutput
import mail
import sns_tasks
imp... | NYU-Molecular-Pathology/snsxt | snsxt/run_tasks.py | Python | gpl-3.0 | 8,751 |
if __name__ == '__main__':
asking = True
print("Juan Questions")
print("Presione 1 para salir")
while asking == True:
response = input("Pregunta algo: ")
if response == "1":
print("Salir")
asking = False
break
if response.endswi... | arauzoliver/uip-iiig2016-prog3 | JuanQuestion/Juan.py | Python | mit | 580 |
# This file is part of BurnMan - a thermoelastic and thermodynamic toolkit for the Earth and Planetary Sciences
# Copyright (C) 2012 - 2015 by the BurnMan team, released under the GNU
# GPL v2 or later.
from __future__ import absolute_import
import numpy as np
import scipy.integrate as integrate
from . import geother... | ian-r-rose/burnman | burnman/main.py | Python | gpl-2.0 | 4,969 |
from __future__ import absolute_import
#
# This is an extension to the Nautilus file manager to allow better
# integration with the Subversion source control system.
#
# Copyright (C) 2006-2008 by Jason Field <jason@jasonfield.com>
# Copyright (C) 2007-2008 by Bruce van der Kooij <brucevdkooij@gmail.com>
# Copyright (C... | rabbitvcs/rabbitvcs | rabbitvcs/ui/import.py | Python | gpl-2.0 | 3,606 |
import urllib.request
import urllib.error
import urllib.parse
from urllib.request import HTTPHandler, HTTPSHandler
from wsgi_intercept import InterceptedHTTPConnection
class InterceptedHTTPHandler(HTTPHandler):
"""
Override the default HTTPHandler class with one that uses the
WSGI_HTTPConnection class to ... | pumazi/wsgi_intercept2 | wsgi_intercept/urllib2_intercept/wsgi_urllib2.py | Python | mit | 1,255 |
# -*- coding: utf-8 -*-
from plone.indexer import indexer
from zope.interface import Interface
import plone.api
@indexer(Interface)
def customer_role(obj):
"""Index users and groups with ``Customer`` role directly on the context.
Don't index inherited `Customer` role. Groups are prefixed with ``group:``
... | TheVirtualLtd/bda.plone.orders | src/bda/plone/orders/indexer.py | Python | bsd-3-clause | 493 |
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
from numpy import sqrt
import operator
BASIC_CUBE = [(0, 0, 0), # 0
(0.5, 0, 0.5), # 1
(0.25, 0.25, 0.25), # 2
(0.75, 0.25, 0.75), # 3
(0, 0.5, 0.5), ... | reuk/wayverb | scripts/python/iterative_tetrahedral.py | Python | gpl-2.0 | 4,819 |
# Copyright (c) 2018 PaddlePaddle Authors. 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 ... | luotao1/Paddle | python/paddle/fluid/tests/unittests/sequence/test_sequence_last_step.py | Python | apache-2.0 | 1,807 |
# implemented with list comprehension with side-effects and a global variable
# there's a simpler way to do it with list appends that's probably no less efficient, since Python arrays are dynamic, but I wanted to try this out instead
from collections import Counter
c = Counter()
# for use in list comprehensions with... | SelvorWhim/competitive | Codewars/DeleteOccurrencesOfElementOverNTimes.py | Python | unlicense | 646 |
#!/usr/bin/env python
class BytesIO:
def __init__(self, buffer):
self._data = buffer
if not self._data:
self._data = str()
self._pos = 0
def getvalue(self):
return self._data
def close(self):
pass
def readline(self):
return self.read(self._... | silenceli/oga-windows | ovirt-guest-agent/bytesio.py | Python | apache-2.0 | 914 |
"""
stubo.model
~~~~~~~~~~~
The Model?
:copyright: (c) 2015 by OpenCredo.
:license: GPLv3, see LICENSE for more details.
""" | rusenask/stubo-app | stubo/model/__init__.py | Python | gpl-3.0 | 155 |
import inspect
import math
import pprint
from collections.abc import Iterable
from collections.abc import Mapping
from collections.abc import Sized
from decimal import Decimal
from itertools import filterfalse
from numbers import Number
from types import TracebackType
from typing import Any
from typing import Callable
... | JoelMarcey/buck | third-party/py/pytest/src/_pytest/python_api.py | Python | apache-2.0 | 28,612 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('djstripe', '0006_auto_20150602_1934'),
]
operations = [
migrations.AddField(
model_name='customer',
... | mthornhill/dj-stripe | djstripe/migrations/0007_auto_20150625_1243.py | Python | bsd-3-clause | 609 |
# Copyright 2014 Objectif Libre
# Copyright 2015 Dot Hill Systems Corp.
# Copyright 2016 Seagate Technology or one of its affiliates
#
# 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 Lic... | eharney/cinder | cinder/volume/drivers/dothill/dothill_client.py | Python | apache-2.0 | 24,559 |
import re
import sys
from codecs import open # To use a consistent encoding
from os import path
from setuptools import setup # Always prefer setuptools over distutils
def requirements_from_file(filename):
"""Parses a pip requirements file into a list."""
return [line.strip() for line in open(filename, 'r')... | MechanicalSoup/MechanicalSoup | setup.py | Python | mit | 2,758 |
#!/usr/bin/env python
#=========================================================================
# Copyright (c) 2014 Geoscience Australia
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# *... | alex-ip/geophys2netcdf | geophys2netcdf/thredds_catalog/__init__.py | Python | apache-2.0 | 15,718 |
# -*- coding: utf-8 -*-
'''
State module to manage Elasticsearch indices
.. versionadded:: 2015.8.0
'''
# Import python libs
from __future__ import absolute_import
import logging
# Import salt libs
log = logging.getLogger(__name__)
def absent(name):
'''
Ensure that the named index is absent
'''
r... | smallyear/linuxLearn | salt/salt/states/elasticsearch_index.py | Python | apache-2.0 | 2,188 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('lists', '0005_item_list'),
]
operations = [
migrations.AlterModelOptions(
name='item',
options={'ord... | gyrodecl/tddsuperlists | lists/migrations/0006_list_item_unique_together.py | Python | gpl-3.0 | 484 |
"""Validators for media app"""
from django.core.exceptions import ValidationError
def validate_unique_url(value):
"""Validate a shortened URL is unique"""
from open_connect.media.models import ShortenedURL
if ShortenedURL.objects.filter(url=value).exists():
raise ValidationError(
'URLs... | lpatmo/actionify_the_news | open_connect/media/validators.py | Python | mit | 368 |
# Copyright 2016 Cloudbase Solutions Srl
# 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 r... | hanlind/nova | nova/policies/simple_tenant_usage.py | Python | apache-2.0 | 1,162 |
# coding: utf-8
# © 2015 David BEAL @ Akretion
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
'name': 'Project Model to issue',
'version': '8.0.0.5.0',
'category': 'project',
'author': 'Akretion, Odoo Community Association (OCA)',
'depends': [
'project',
],
'... | sl2017/campos | project_model_to_issue/__openerp__.py | Python | agpl-3.0 | 435 |
#! /usr/bin/python
import time
import os
import sys
import cPickle
import Configuration.epistasisconfiguration as configuration
import Gridinterface.migsession as migsession
from Gridinterface.mylogger import log
from misc.jobfragmentation import fragment_epistasis, get_job_specs, create_epistasis_jobs
########### U... | heromod/migrid | user-projects/EpistasisOnGrid/gridepistasis.py | Python | gpl-2.0 | 6,112 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2014 The ProteinDF development team.
# see also AUTHORS and README if provided.
#
# This file is a part of the ProteinDF software package.
#
# The ProteinDF is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Publ... | ProteinDF/ProteinDF_pytools | scripts/pdf-test-h5.py | Python | gpl-3.0 | 4,651 |
from vsg.vhdlFile.extract import utils
from vsg.vhdlFile.extract import tokens
def get_line_which_includes_tokens(lTokens, lAllTokens, oTokenMap):
lReturn = []
lTokenIndexes = utils.get_indexes_of_token_list(lTokens, oTokenMap)
for iIndex in lTokenIndexes:
iStart = oTokenMap.get_index_of_carr... | jeremiah-c-leary/vhdl-style-guide | vsg/vhdlFile/extract/get_line_which_includes_tokens.py | Python | gpl-3.0 | 767 |
#!/usr/bin/env python
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "L... | leezu/mxnet | python/mxnet/numpy/multiarray.py | Python | apache-2.0 | 408,331 |
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | cschnei3/forseti-security | google/cloud/security/common/data_access/instance_template_dao.py | Python | apache-2.0 | 1,775 |
"""
Por eliminar
"""
# from .models import Categoria,SubCategoria,Establecimiento
# from selectable.base import ModelLookup
# from selectable.registry import registry
# class EstablecimientoLookUp(ModelLookup):
# model = Establecimiento
# search_fields = ('nombre__icontains','email', )
# class SubCategoriaL... | camilortte/RecomendadorUD | apps/establishment_system/lookup.py | Python | mit | 1,055 |
from __future__ import absolute_import
import datetime
import json
import pytz
import six
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from django.http import HttpResponse
from django.shortcuts import redirect
from django.views.decorators.csrf import ensure_csr... | jolyonb/edx-platform | common/djangoapps/track/views/__init__.py | Python | agpl-3.0 | 7,220 |
import sqlite3
persons = [
("Hugo", "Boss"),
("Calvin", "Klein")
]
con = sqlite3.connect(":memory:")
# Create the table
con.execute("create table person(firstname, lastname)")
# Fill the table
con.executemany("insert into person(firstname, lastname) values (?, ?)", persons)
# Print the table contents
f... | MicroTrustRepos/microkernel | src/l4/pkg/python/contrib/Doc/includes/sqlite3/shortcut_methods.py | Python | gpl-2.0 | 565 |
class Duck:
def quack(self):
print("Quaaack!")
def walk(self):
print("*waddles*")
def bark(self):
print("The duck can't bark.")
def fur(self):
print("The duck has feathers")
class Dog:
def bark(self):
print("Woof!")
def fur(self):
print("The ... | Safuya/python_3_essential_training | 12 Classes/classes_polymorphism2.py | Python | gpl-3.0 | 696 |
#!/usr/bin/env python
import os
import sys
PROJECT_ROOT = os.path.dirname(os.path.abspath(os.path.dirname(__file__)))
sys.path.insert(0, PROJECT_ROOT)
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tests.settings")
# if len(sys.argv) > 1 and sys.argv[1] == 'runserver':
# ... | genialis/django-rest-framework-reactive | tests/manage.py | Python | apache-2.0 | 505 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.