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
# 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...
alsrgv/tensorflow
tensorflow/python/keras/layers/kernelized_test.py
Python
apache-2.0
16,217
from django import forms from django.conf import settings from django.core.mail import EmailMessage from django.utils.translation import ugettext_lazy as _ from django_select2.forms import Select2MultipleWidget from smtplib import SMTPException from .models import SentMail, MailDelivery from .tracking import new_trac...
helfertool/helfertool
src/mail/forms.py
Python
agpl-3.0
7,086
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2013 The Plaso Project Authors. # Please see the AUTHORS file for details on individual authors. # # 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 L...
iwm911/plaso
plaso/formatters/skydrivelog.py
Python
apache-2.0
1,134
import urllib,urllib2 url = 'http://www.uniprot.org/uniparc/' params = { 'from':'P_GI', 'to':'ACC', 'format':'tab', 'query':'590650093' } data = urllib.urlencode(params) request = urllib2.Request(url, data) contact = "" # Please set your email address here to help us debug in case of problems. request.add_header('Us...
thomasvangurp/epiGBS
Annotation/get_database_seq.py
Python
mit
427
#!/usr/bin/env python from __future__ import print_function, division import unittest import sys try: import efuse_table_gen except ImportError: sys.path.append("..") import efuse_table_gen ''' To run the test on local PC: cd ~/esp/esp-idf/components/efuse/test_efuse_host/ ./efuse_tests.py ''' class P...
krzychb/rtd-test-bed
components/efuse/test_efuse_host/efuse_tests.py
Python
apache-2.0
16,074
"""This module contains all the request handlers for the crawls request queue sync service. """ import logging import tornado.web import tor_async_util from . import __api_version__ from .. import request_handlers _logger = logging.getLogger(__name__) class RequestHandler(request_handlers.RequestHandler): pa...
simonsdave/cloudfeaster_infrastructure
cloudfeaster_services/queues/request_handlers.py
Python
mit
561
# -*- coding: utf-8 -*- # Generated by Django 1.10.6 on 2017-07-07 11:03 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion def add_profile(apps, schema_editor): User = apps.get_model('auth', 'User') Profile = app...
MTG/freesound-datasets
datasets/migrations/0025_profile.py
Python
agpl-3.0
1,173
import unittest import urllib from datetime import datetime, timedelta from flask import url_for from app import current_app as app from app.helpers.data import save_to_db from app.helpers.flask_ext.helpers import slugify from tests.unittests.object_mother import ObjectMother from tests.unittests.utils import OpenEve...
Achint08/open-event-orga-server
tests/unittests/views/guest/test_search.py
Python
gpl-3.0
5,392
from __future__ import unicode_literals import logging import django.db.models import django.core.cache import django.template.defaultfilters import django.urls import shortuuidfield logger = logging.getLogger(__name__) class CobrandCompany(django.db.models.Model): created_on = django.db.models.DateTimeField...
ORGAN-IZE/register
cobrand/models.py
Python
gpl-3.0
1,439
from office365.sharepoint.base_entity import BaseEntity class Form(BaseEntity): """A form provides a display and editing interface for a single list item.""" @property def form_type(self): """ Gets the type of the form. :rtype: str or None """ return self.properti...
vgrem/Office365-REST-Python-Client
office365/sharepoint/forms/form.py
Python
mit
560
from __future__ import division, print_function, absolute_import import numpy as np import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec # for unequal plot boxes from linfit import linfit # data set for linear fitting x = np.array([2.3, 4.7, 7.1, 9.6, 11.7, 14.1, 16.4, 18.8, 21.1, 23.0]) y = np.arr...
djpine/linfit
example.py
Python
lgpl-2.1
2,219
# 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 ...
AutorestCI/azure-sdk-for-python
azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_scale_set_vm_instance_view.py
Python
mit
4,022
from django.contrib import admin from .models import Post, Comment class PostAdmin(admin.ModelAdmin): list_display = ('title', 'slug', 'author', 'publish', 'status') list_filter = ('status', 'created', 'publish', 'author') search_fields = ('title', 'body') prepopulated_fields = {'slug': ('title',)} ...
LucasHelal/blog-es
blog/admin.py
Python
gpl-3.0
701
from __future__ import division import numpy as np from numpy.testing import run_module_suite from scipy.sparse import csr_matrix from sklearn.feature_selection.mutual_info_ import ( mutual_info_regression, mutual_info_classif, _compute_mi) from sklearn.utils.testing import (assert_array_equal, assert_almost_equal...
DailyActie/Surrogate-Model
01-codes/scikit-learn-master/sklearn/feature_selection/tests/test_mutual_info.py
Python
mit
6,291
messageString = ( 'OPTIONS sip:user@example.com SIP/2.0\r\n' 'To: sip:user@example.com\r\n' 'From: caller<sip:caller@example.com>;tag=323\r\n' 'Max-Forwards: 70\r\n' 'Call-ID: lwsdisp.1234abcd@funky.example.com\r\n' 'CSeq: 60 OPTIONS\...
bobjects/BobStack
open-test-data/rfc4475-sip-torture-test/lwsdisp.dat.py
Python
apache-2.0
455
from datetime import datetime, timedelta from django import forms from haystack.forms import FacetedSearchForm from models import Delibera format_facet_field = lambda x: '{{!ex={0}_tag}}{0}'.format(x) class DelibereSearchForm(FacetedSearchForm): RANGES = { 'decennio': { '00-2010': { ...
guglielmo/mosic2-db-delibere
project/delibere/forms.py
Python
bsd-3-clause
4,286
# pylint: disable-msg=W0402,W0231,W0141,R0903,C0321,W0701,R0904,C0103,W0201,W0102,R0913,W0622,E1101,C0111,C0121,R0901 # DAV client library # # Copyright (C) 1998-2000 Guido van Rossum. All Rights Reserved. # Written by Greg Stein. Given to Guido. Licensed using the Python license. # # This module is maintained by Greg ...
antont/tundra
src/Application/PythonScriptModule/pymodules_old/lib/davlib.py
Python
apache-2.0
12,292
#!/usr/bin/python # # Copyright 2015 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 required b...
richardfergie/googleads-python-lib
examples/adwords/v201506/campaign_management/promote_experiment.py
Python
apache-2.0
1,897
import mock from twisted.python.failure import Failure from twisted.web.http_headers import Headers from twisted.web.client import ResponseDone, ResponseFailed from twisted.web.http import PotentialDataLoss from treq.test.util import TestCase from treq import collect, content, json_content, text_content from treq.c...
FxIII/treq
treq/test/test_content.py
Python
mit
4,586
#coding=utf-8 from base import BaseApi import settings class ShowApi(BaseApi): """ 节目API """ FD = ['showid', 'pk_odshow', 'showname', 'showsubtitle', 'deschead', 'showdesc', 'show_thumburl', 'show_vthumburl', 'show_bannerurl', 'showlength', 'copyright_status', 'paid', 'pay_type', 'onlinetim...
edisonlz/fruit
web_project/base/youkuapi/show.py
Python
apache-2.0
2,122
# 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, software # d...
liucode/tempest-master
tempest/services/network/json/subnets_client.py
Python
apache-2.0
1,381
# # Licensed to Intel Corporation under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # Intel Corporation licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use this fi...
zhichao-li/BigDL
dl/src/main/python/models/lenet/lenet5.py
Python
apache-2.0
3,725
# # 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, software # ...
jamesyli/solum
solum/cmd/db_manage.py
Python
apache-2.0
3,270
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.shortcuts import render from django.views.generic import TemplateView class Home(TemplateView): template_name = 'dist/index.html'
cymushier/djangoangularboilerplate
djangoangularboilerplate/views.py
Python
mit
210
from django.conf import settings def get_settings(request): return dict(settings=settings)
SimplyCo/cityproblems
cityproblems/site/context_processors.py
Python
mit
96
from GenericRequest import GenericRequest class BootClanMemberRequest(GenericRequest): def __init__(self, session, userId): super(BootClanMemberRequest, self).__init__(session) self.url = session.serverURL + "clan_members.php" self.requestData['pwd'] = session.pwd self.requestData['...
ijzer/cwbot-ndy
kol/request/BootClanMemberRequest.py
Python
bsd-3-clause
475
""" 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 "License"); you may not use this ...
keedio/keedio-stacks
KEEDIO/1.1/services/YARN/package/scripts/yarn_conf.py
Python
apache-2.0
8,102
"""Tests suite for Period handling. Parts derived from scikits.timeseries code, original authors: - Pierre Gerard-Marchant & Matt Knox - pierregm_at_uga_dot_edu - mattknow_ca_at_hotmail_dot_com """ from datetime import datetime, date, timedelta from numpy.ma.testutils import assert_equal from pandas import Timesta...
kelseyoo14/Wander
venv_2_7/lib/python2.7/site-packages/pandas/tseries/tests/test_period.py
Python
artistic-2.0
153,010
"""HTTP Headers constants.""" # After changing the file content call ./tools/gen.py # to regenerate the headers parser from multidict import istr METH_ANY = '*' METH_CONNECT = 'CONNECT' METH_HEAD = 'HEAD' METH_GET = 'GET' METH_DELETE = 'DELETE' METH_OPTIONS = 'OPTIONS' METH_PATCH = 'PATCH' METH_POST = 'POST' METH_PU...
gnmiller/craig-bot
craig-bot/lib/python3.6/site-packages/aiohttp/hdrs.py
Python
mit
3,449
# -*- coding: utf-8 -*- # # DPark documentation build configuration file, created by # sphinx-quickstart on Mon Jan 25 17:28:47 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. # # All...
douban/dpark
docs/cn/conf.py
Python
bsd-3-clause
9,255
"""GUI support for the IPython ZeroMQ kernel - GTK toolkit support. """ #----------------------------------------------------------------------------- # Copyright (C) 2010-2011 The IPython Development Team # # Distributed under the terms of the BSD License. The full license is in # the file COPYING.txt, distribute...
unnikrishnankgs/va
venv/lib/python3.5/site-packages/ipykernel/gui/gtkembed.py
Python
bsd-2-clause
3,131
# coding: utf-8 from flask import Flask, send_from_directory, request, redirect, render_template, session, make_response import random import math import os # init.py 為自行建立的起始物件 import init import users.a.g2.ag2_40323120 # 確定程式檔案所在目錄, 在 Windows 有最後的反斜線 _curdir = os.path.join(os.getcwd(), os.path.dirname(__file__)) # 設...
40323120/2016springcd_aG2
myflaskapp.py
Python
agpl-3.0
14,710
# 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 ...
AutorestCI/azure-sdk-for-python
azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine.py
Python
mit
7,512
""" Support for controlling the PiFace Digital I/O module on a RPi. For more details about this component, please refer to the documentation at https://home-assistant.io/components/rpi_pfio/ """ import logging from homeassistant.const import ( EVENT_HOMEASSISTANT_START, EVENT_HOMEASSISTANT_STOP) REQUIREMENTS = [...
PetePriority/home-assistant
homeassistant/components/rpi_pfio/__init__.py
Python
apache-2.0
1,701
# Copyright 2015 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 applicable law or agree...
rakeshmi/cinder
cinder/objects/base.py
Python
apache-2.0
34,775
import os, sys, json sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) import util def main(request, response): policyDeliveries = json.loads(request.GET.first('policyDeliveries', '[]')) worker_type = request.GET.first('type', 'classic') commonjs_url = '%s://%s:%s/common/security-features/resource...
DominoTree/servo
tests/wpt/web-platform-tests/common/security-features/scope/worker.py
Python
mpl-2.0
1,383
import os import click from click.shell_completion import CompletionItem @click.group() def cli(): pass @cli.command() @click.option("--dir", type=click.Path(file_okay=False)) def ls(dir): click.echo("\n".join(os.listdir(dir))) def get_env_vars(ctx, param, incomplete): # Returning a list of values is...
mitsuhiko/click
examples/completion/completion.py
Python
bsd-3-clause
1,353
from enum import Enum from flask import current_app JS_ENUMS = {} JINJA_ENUMS = {} class RawEnum(Enum): """ This is a customized enum class which should be used with a mixin. The mixin should define the types of each member. For example: class Colors(str, RawEnum): RED = "red" ...
LosFuzzys/CTFd
CTFd/constants/__init__.py
Python
apache-2.0
1,797
# -*- coding: utf-8 -*- #------------------------------------------------------------ import urlparse,urllib2,urllib,re import os, sys from platformcode import config, logger from core import scrapertools from core.item import Item from core import servertools from core import httptools host = 'https://hclips.com' d...
alfa-jor/addon
plugin.video.alfa/channels/hclips.py
Python
gpl-3.0
3,942
# Copyright (c) 2014 Rackspace Hosting # 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 req...
eharney/nova
nova/tests/virt/xenapi/client/test_objects.py
Python
apache-2.0
4,272
#!/usr/bin/env python #encoding=utf8 ''' Module describing multilayer neural network's functionality. @author Miroslav Hlavacek <mira.hlavackuj@gmail.com> ''' from __future__ import division import numpy as np import cPickle as pickle # project modules import layer import sectors class MLMVN(object): ''' MLMVN ...
MiraHead/mlmvn
src/network/network.py
Python
gpl-2.0
18,807
# -*- coding: utf-8 -*- def check_mixing_randomness(cards): mix_state = 'B' for card1, card2 in zip(cards, cards[1:]): if card1[0] == card2[0] or card1[1] == card2[1]: mix_state = 'M' break return mix_state
ssebastianj/taip-2014
random_cards/solution.py
Python
mit
255
############################################################################### # # The MIT License (MIT) # # Copyright (c) Tavendo GmbH # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software with...
sampathweb/game-server
pybot_game_autobahn.py
Python
mit
5,481
# -*- python -*- # # Copyright (C) 2008, 2009 Francesco Salvestrini # # 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. #...
salvestrini/serdes
src/Configuration.py
Python
gpl-2.0
3,051
#!/usr/bin/env python # # Migration Stream Analyzer # # Copyright (c) 2015 Alexander Graf <agraf@suse.de> # # This library 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 2 of the Lic...
hinesmr/qemu
scripts/analyze-migration.py
Python
gpl-2.0
20,304
#!/usr/bin/env python2.4 # # Test for the DepCache code # import apt_pkg import sys def main(): apt_pkg.init() cache = apt_pkg.Cache() depcache = apt_pkg.DepCache(cache) depcache.init() i = 0 all = cache.package_count print("Running DepCache test on all packages") print("(trying to in...
mvo5/python-apt
tests/old/pkgproblemresolver.py
Python
gpl-2.0
2,306
DEBUG = True DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. 'NAME': 'db.sqlite3', # Or path to database file if using sqlite3. } } # Make this unique, and don't share it with anybody. SECRET_K...
jpintado/django-hostproof-auth
hostproof_auth/tests/settings.py
Python
mit
1,031
import unittest from pywps.app import Process, Service, xpath_ns, WPS, OWS from tests.common import client_for import lxml.etree class ExceptionsTest(unittest.TestCase): def setUp(self): self.client = client_for(Service(processes=[])) def test_invalid_parameter_value(self): resp = self.clie...
doclements/pywps-4
tests/test_exceptions.py
Python
mit
1,743
# Copyright 2012, Nachi Ueno, NTT MCL, 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 # # Unles...
miyakz1192/neutron
neutron/tests/unit/agent/linux/test_iptables_firewall.py
Python
apache-2.0
72,072
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2014 CERN. # # Invenio 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...
CERNDocumentServer/invenio
modules/bibindex/lib/bibindex_termcollectors.py
Python
gpl-2.0
8,231
# -*- coding: utf-8 - from datetime import timedelta from faker import Factory from munch import munchify from uuid import uuid4 from tempfile import NamedTemporaryFile from .local_time import get_now from op_faker import OP_Provider import os import random fake = Factory.create('uk_UA') fake_ru = Factory.create('ru'...
mykhaly/robot_tests
op_robot_tests/tests_files/initial_data.py
Python
apache-2.0
13,310
# Copyright (c) 2019 Dubalu LLC # Copyright (c) 2017 Elasticsearch # # 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 unde...
Kronuz/Xapiand
contrib/python/xapiand-py/xapiand/transport.py
Python
mit
15,871
#!/bin/python3 from collections import Counter input() socks, pairs = Counter(map(int,input().strip().split())), 0 for s in socks: pairs += socks[s]//2 print(pairs)
vipmunot/HackerRank
Algorithms/Sock Merchant.py
Python
mit
166
from util import utils import os import numpy as np from mpl_toolkits.mplot3d import * from sklearn import linear_model F = None #num of features N = None #num of training samples T = None #num of test samples def readData(filename): filePath = os.path.join(utils.getResourcesPath(), filename) ...
5agado/intro-ai
src/test/housePricing.py
Python
apache-2.0
2,178
from microbit import * compass.calibrate() while True: sleep(100) irany = compass.heading() print(irany) #a // operátor kombinálja az osztást és a legkisebb egészre kerekítést. #pl: 5 // 2 = 2, míg 5 / 2 = 2.5 mutato = ((15 - irany) // 30) % 12 display.show(Image.ALL_CLOCKS[mutato])
webmaster442/prog-elektonikak
Kodok/microbit/iranytu.py
Python
bsd-2-clause
311
# Copyright 2017-2018 Capital One Services, LLC # Copyright The Cloud Custodian Authors. # SPDX-License-Identifier: Apache-2.0 import itertools import jmespath from c7n.exceptions import PolicyExecutionError, PolicyValidationError from c7n import utils from .core import Action class ModifyVpcSecurityGroupsAction(Ac...
capitalone/cloud-custodian
c7n/actions/network.py
Python
apache-2.0
8,960
import json import logging import os import re import shutil import string import sqlalchemy.orm.exc from galaxy import util from galaxy.web import url_for from galaxy.datatypes import checkers from galaxy.model.orm import and_ from galaxy.model.orm import or_ from tool_shed.util import basic_util from tool_shed.util...
mikel-egana-aranguren/SADI-Galaxy-Docker
galaxy-dist/lib/tool_shed/util/shed_util_common.py
Python
gpl-3.0
67,170
def mini_maxi(lista, c, menor, maior): maximo = maior minimo = menor if (c == len(lista)): return minimo, maximo if(maximo < lista[c]): maximo = lista[c] if(minimo > lista[c]): minimo < lista[c] return mini_maxi(lista, c + 1, minimo, maximo) def listaDados...
VCarnaval/Estrutura-de-Dados
Menor_Maior.py
Python
mit
527
# -*- coding: utf-8 -*- import falcon from objectstore.api import buckets from test_objectstore import ObjectStoreTestBase class TestBucket(ObjectStoreTestBase): def test_bucket_metadata(self): error_raised = False bucket = buckets.Bucket('metadata-check', storage_path=self.storage_path) ...
ownport/objectstore
tests/test_buckets.py
Python
apache-2.0
889
from django.db import models from django.contrib.auth.models import User from building.models import Building, Unit # Create your models here. class Listing(models.Model): """ An option to lease, rent, or sublease a specific Unit """ CYCLE_CHOICES = ( ('year', 'Year'), ('month', 'Mo...
City-of-Bloomington/green-rental
listing/models.py
Python
agpl-3.0
2,921
# Copyright (c) 2012 ARM Limited # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implementation of the functionality ...
Dexhub/MTX
configs/example/se.py
Python
bsd-3-clause
7,527
# Copyright 2013-2016 Jaap Karssenberg <jaap.karssenberg@gmail.com> '''This module defines the L{main()} function for executing the zim application. It also defines a number of command classes that implement specific commandline commands and an singleton application object that takes core of the process life cycle. '...
jaap-karssenberg/zim-desktop-wiki
zim/main/__init__.py
Python
gpl-2.0
28,210
# -*- coding: utf-8 -*- # Copyright 2015 Alex Comba - Agile Business Group # Copyright 2016 Andrea Cometa - Apulia Software # Copyright 2016-2017 Lorenzo Battistini - Agile Business Group # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). from openerp import models, api, fields import collections c...
linkitspa/l10n-italy
account_invoice_report_ddt_group/models/account_invoice.py
Python
agpl-3.0
3,206
import logging import re import os import signal from avocado.utils import path from avocado.utils import process from avocado.utils import linux_modules from .compat_52lts import results_stdout_52lts from .versionable_class import VersionableClass, Manager, factory from . import utils_misc # Register to class mana...
lmr/avocado-vt
virttest/openvswitch.py
Python
gpl-2.0
17,049
from django.views.generic import ListView from django.shortcuts import render, get_object_or_404 from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from django.http import HttpResponseRedirect from django.http import HttpResponse from django.core.mail import send_mail from django.db.models import ...
crasker/mysite
blog/views.py
Python
bsd-2-clause
2,213
# Django settings for testproject project. import os PROJECT_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) DEBUG = True TEMPLATE_DEBUG = DEBUG DEBUG_PROPAGATE_EXCEPTIONS = True ALLOWED_HOSTS = ['*'] ADMINS = () MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.back...
iekadou/django-pjaxr
django_pjaxr/test_settings.py
Python
mit
4,024
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.conf.urls import url from . import views urlpatterns = [ url(r'^$', views.LetterListView.as_view(), name="list"), url(r'^~create$', views.LetterCreateView.as_view(), name="create"), url(r'^list-(?P<slug>[\w-]+)$', ...
ad-m/foundation-manager
foundation/letters/urls.py
Python
bsd-3-clause
775
import os import sys import socket from unipath import Path from config.installed_apps import DJANGO_APPS, THIRD_PARTY_APPS, EDC_APPS, LIS_APPS, LOCAL_APPS from config.databases import TESTING_SQLITE DEBUG = True TEMPLATE_DEBUG = DEBUG APP_NAME = 'hnscc' PROJECT_NUMBER = 'BHP065' PROJECT_IDENTIFIER_PREFIX = '065' ...
botswana-harvard/bhp065_project
bhp065/config/settings.py
Python
gpl-2.0
4,191
import random t = 20 for i in range(t): with open(str(i + 1) + '.in', 'w') as f: f.write(str(random.randint(1, 10000)))
acmiut/contests
2019-feb-28/Problems/A- Settlers of Catan/in_out_gen/generator.py
Python
apache-2.0
134
''' Created on 17/04/2013 @author: julia ''' from StringIO import StringIO from colorama import Fore, Back, Style import logging.handlers from logging import Formatter import os DEBUG = 0 INFO = 1 WARN = 2 ERROR = 3 LEVEL = {DEBUG: 'DEBUG', INFO: 'INFO', WARN: 'WARN', ERROR: 'ERROR'} class Color(object): RED = F...
hithwen/py-execute
py_execute/outputstream_wrapper.py
Python
mit
5,052
from django.test import TestCase from bulbs.campaigns.models import Campaign, CampaignPixel from bulbs.utils.test import BaseIndexableTestCase class CampaignModelCase(BaseIndexableTestCase): def test_model(self): campaign = Campaign.objects.create(sponsor_name='Sponsor', ...
pombredanne/django-bulbs
tests/campaigns/test_campaign_model.py
Python
mit
397
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('posts', '0007_auto_20151110_0413'), ] operations = [ migrations.AlterField( model_name='post', name=...
tuanquanghpvn/bideox
apps/posts/migrations/0008_auto_20151110_0419.py
Python
mit
412
from urlparse import urljoin from django import http, shortcuts from django.conf import settings from django.core.urlresolvers import reverse from django.shortcuts import render from django.views.decorators.cache import never_cache from django.views.decorators.csrf import csrf_exempt from django.views.decorators.http ...
shahbaz17/zamboni
mkt/files/views.py
Python
bsd-3-clause
6,444
""" Django settings for ownmusicweb project. Generated by 'django-admin startproject' using Django 1.11.7. For more information on this file, see https://docs.djangoproject.com/en/1.11/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.11/ref/settings/ """ impor...
Lightshadow244/OwnMusicWeb
ownmusicweb/ownmusicweb/settings.py
Python
apache-2.0
3,917
#! /usr/bin/env python from __future__ import print_function import openturns as ot ot.TESTPREAMBLE() ot.RandomGenerator.SetSeed(0) # First, compute the volume of the unit ball in R^n a = -1.0 b = 1.0 formula = "1.0" lower = list() upper = list() algo = ot.IteratedQuadrature( ot.GaussKronrod(20, 1.0e-6, ot.Gauss...
aurelieladier/openturns
python/test/t_IteratedQuadrature_std.py
Python
lgpl-3.0
1,285
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.utils.translation import ugettext_lazy as _ __author__ = 'heilniem' # These static choice lists were moved here from dictionary/models # In the current implementation these are not used, but I decided to keep them for reference. # 2017-09-27...
Signbank/FinSL-signbank
signbank/dictionary/choicelists.py
Python
bsd-3-clause
17,106
import logging import threading import time import os import hashlib import traceback import scheduler.constants import scheduler.config.services.jobs import scheduler.registry import scheduler.services.service import scheduler.services.bus import scheduler.email_template _LOGGER = logging.getLogger(__name__) _CONFI...
dsoprea/PythonScheduler
scheduler/services/jobs.py
Python
gpl-2.0
7,433
# Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/ # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modi...
linkedin/indextank-service
storefront/boto/__init__.py
Python
apache-2.0
9,335
# -*- coding: utf-8 -*- """ End-to-end tests for the main LMS Dashboard (aka, Student Dashboard). """ import datetime import re import six from six.moves.urllib.parse import unquote # pylint: disable=import-error from common.test.acceptance.fixtures.course import CourseFixture, XBlockFixtureDesc from common.test.acc...
cpennington/edx-platform
common/test/acceptance/tests/lms/test_lms_dashboard.py
Python
agpl-3.0
21,201
# Copyright 2013 the Melange authors. # # 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 wr...
rhyolight/nupic.son
tests/app/melange/logic/test_organization.py
Python
apache-2.0
16,812
from setuptools import setup def readme(): with open('README.md') as f: return f.read() setup(name='intbuffer', version='0.1', description='Generate integer buffer read/write code via text markup.', long_description = readme(), classifiers=[ 'Development Status :: 3 - Alpha', ...
johnoneil/intbuffer
setup.py
Python
gpl-2.0
948
import os, subprocess, types, sys, re def check_output_for_error(output, match, error_in_first_match): success = re.findall(match, output) if len(success) > 0: if (error_in_first_match): print "[ERROR] %s" % success[0] sys.exit(1) else: return True else: return False def check_and_print_err(err, war...
arnaudsj/titanium_mobile
support/android/run.py
Python
apache-2.0
1,560
# -*- coding: utf-8 -*- ########################################################################## # Copyright 2013-2021 Aerospike, 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 # # ...
aerospike/aerospike-client-python
benchmarks/keygen.py
Python
apache-2.0
4,563
#!/usr/bin/env python ################################################################ # <bsn.cl fy=2013 v=onl> # # Copyright 2013, 2014, 2015 Big Switch Networks, Inc. # # Licensed under the Eclipse Public License, Version 1.0 (the # "License"); you may not use this file except in compliance # with the Licen...
opennetworklinux/ONLP
tools/infra.py
Python
epl-1.0
1,680
from dateutil.parser import parse as parse_date import pytest from urlparse import urlparse from api.base.settings.defaults import API_BASE from api.nodes.serializers import NodeSerializer from api.registrations.serializers import RegistrationSerializer from framework.auth import Auth from osf_tests.factories import (...
HalcyonChimera/osf.io
api_tests/nodes/serializers/test_serializers.py
Python
apache-2.0
5,603
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' @author: Joseph @email:liseor@gmail.com Created on 2012-7-20 ''' from riakClient.document import Document from config.settings import globalSetting from models.board import Board from models.user import User from models.userinfo import UserInfo from models.pic import P...
ptphp/PyLib
src/tornado/demos/lihuashu/models/userFollow.py
Python
apache-2.0
1,516
# Copyright 2016 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...
natanielruiz/android-yolo
jni-build/jni/include/tensorflow/contrib/distributions/python/ops/transformed_distribution.py
Python
apache-2.0
8,143
""" <name>dictyExpress</name> <description>Access to data in dictyExpress database.</description> <icon>icons/DictyExpress.svg</icon> <priority>40</priority> """ from __future__ import absolute_import from collections import defaultdict import sys import Orange from Orange.orng import orngEnviron from Orange.OrangeW...
tomazc/orange-bio
orangecontrib/bio/widgets/OWDicty.py
Python
gpl-3.0
7,487
import logging from pip._vendor.packaging.utils import canonicalize_name from pip._internal.exceptions import ( DistributionNotFound, InstallationError, UnsupportedPythonVersion, UnsupportedWheel, ) from pip._internal.models.wheel import Wheel from pip._internal.req.req_install import InstallRequireme...
foobarbazblarg/stayclean
stayclean-2020-december/venv/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/factory.py
Python
mit
17,098
"""Setuptools entry point.""" import codecs import os.path from setuptools import setup, find_packages install_requires = [ 'kallithea', 'requests-oauthlib', ] long_description = [] for text_file in ['README.rst', 'CHANGES.rst']: with codecs.open(os.path.join(os.path.dirname(os.path.abspath(__file__)), t...
andrewshadura/kallithea-auth-google
setup.py
Python
mit
986
""" WSGI config for Eisenhower Dashboard project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_A...
mooja/eisenhower_dashboard
config/wsgi.py
Python
mit
1,965
import logging from subprocess import PIPE from npactflask import app from path import path from pynpact import capproc logger = app.logger CLEANUP_PATHS = [path(app.config['UPLOADS']).realpath()] def cleanup_old_files(days): days = int(days) err = False for p in CLEANUP_PATHS: err = err or 0 ...
NProfileAnalysisComputationalTool/npact
npactflask/npactflask/cleanup.py
Python
bsd-3-clause
834
import sys sys.path.insert(1,'/galaxy-central') sys.path.insert(1,'/galaxy-central/lib') from scripts.db_shell import * from galaxy.util.bunch import Bunch from galaxy.security import GalaxyRBACAgent from sqlalchemy.orm import sessionmaker from sqlalchemy import * import argparse bunch = Bunch( **globals() ) engine = ...
shiltemann/docker-galaxy-stable
galaxy/create_galaxy_user.py
Python
mit
1,909
import os from setuptools import ( find_packages, setup, ) from setuptools.command.test import test PACKAGE_DIR = 'src' class PyTest(test): def finalize_options(self): test.finalize_options(self) self.test_args = [] self.test_suite = True def run_tests(self): import ...
disqus/psycopg2-managed-connection
setup.py
Python
apache-2.0
971
""" Utilities. """ import codecs import configparser import glob import os.path import re import pkg_resources # We only accept ASCII or ACE-encoded domain names. IDNs must be converted # to ACE first. FQDN_PATTERN = re.compile(r"^([-a-z0-9]{1,63})(\.[-a-z0-9]{1,63}){1,}$") class ConfigParser(configparser.ConfigP...
kgaughan/uwhoisd
uwhoisd/utils.py
Python
mit
3,856
import bobo @bobo.query("/text", content_type="text/plain") def text(): return "Hello, world!" app = bobo.Application(bobo_resources=__name__)
timothycrosley/hug
benchmarks/http/bobo_test.py
Python
mit
151
#!/usr/bin/env python3 # author: @netmanchris """ Copyright 2018 Hewlett Packard Enterprise Development LP. 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/li...
HPENetworking/HPEIMCUtils
PythonUtilities/Interface_Vlan_Reports/get_all_trunk_interfaces.py
Python
apache-2.0
3,721
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
krafczyk/spack
var/spack/repos/builtin/packages/libxext/package.py
Python
lgpl-2.1
1,776
# -*- coding: utf-8 -*- # # Configuration file for the Sphinx documentation on 2019-12-05 08:37:34 # # This file does only contain a selection of the most common options. For a # full list see the documentation: # http://www.sphinx-doc.org/en/master/config # -- Path setup ----------------------------------------------...
antoniov/tools
docs/conf.py
Python
agpl-3.0
5,054
from frappe import _ def get_data(): return { 'graph': True, 'graph_method': "frappe.utils.goal.get_monthly_goal_graph_data", 'graph_method_args': { 'title': _('Sales'), 'goal_value_field': 'monthly_sales_target', 'goal_total_field': 'total_monthly_sales', 'goal_history_field': 'sales_monthly_histor...
ESS-LLP/erpnext-medical
erpnext/setup/doctype/company/company_dashboard.py
Python
gpl-3.0
896