text
stringlengths
6
947k
repo_name
stringlengths
5
100
path
stringlengths
4
231
language
stringclasses
1 value
license
stringclasses
15 values
size
int64
6
947k
score
float64
0
0.34
#!/usr/bin/env python """ unit test for filters module author: Michael Grupp This file is part of evo (github.com/MichaelGrupp/evo). evo 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 Li...
MichaelGrupp/evo
test/test_filters.py
Python
gpl-3.0
6,476
0
# 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...
kevin-zhaoshuai/zun
zun/db/sqlalchemy/alembic/versions/9fe371393a24_create_table_container.py
Python
apache-2.0
1,820
0.001648
import datetime from tracker.models import Member, Report from django.template.defaultfilters import slugify import csv import urllib import simplejson as json from dateutil.parser import * import time def update_twitter(branch='house', official=True, batch=1): if official: screen_names = [x.official_twit...
dwillis/socialcongress
tracker/utils.py
Python
unlicense
6,562
0.006248
""" =============== Clump Match All =============== Merge catalogs based on clump label masks """ import os import numpy as _np import pandas as _pd import catalog from .image import sample_bgps_img def clump_match_water(bgps=[], out_filen='bgps_maser', verbose=False): """ Match maser catalog observations ...
autocorr/besl
besl/clump_match.py
Python
gpl-3.0
37,622
0.000983
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c)2012 Rackspace US, 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.a...
emonty/pyos
pyos/clouddatabases.py
Python
apache-2.0
30,566
0.003991
import pytz from django.apps import apps from django.contrib.auth.models import Group from django.core.exceptions import ObjectDoesNotExist from django.db import models, transaction from django.utils import timezone from django.utils.functional import cached_property from guardian.shortcuts import assign_perm from gua...
binoculars/osf.io
osf/models/mixins.py
Python
apache-2.0
26,369
0.002237
# Copyright 2018 Microsoft Corporation # # 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...
hglkrijger/WALinuxAgent
tests/common/osutil/test_default.py
Python
apache-2.0
36,933
0.002626
# Patchwork - automated patch tracking system # Copyright (C) 2016 Linaro Corporation # # SPDX-License-Identifier: GPL-2.0-or-later from rest_framework.response import Response from rest_framework.reverse import reverse from rest_framework.views import APIView class IndexView(APIView): def get(self, request, *a...
stephenfin/patchwork
patchwork/api/index.py
Python
gpl-2.0
942
0
import unittest from unittest.mock import Mock class Mailer: def send_email(self, email, message): raise NotImplementedError("Not implemented yet") class DB: def insert_user(self, user): raise NotImplementedError("Not implemented yet") class User: def __init__(self, email, name): ...
jordillull/unit-tests-uib-2015
code_sample/python/mock_finished.py
Python
mit
1,336
0.005988
import xbmc, xbmcaddon, xbmcgui, xbmcplugin,os,base64,sys,xbmcvfs import urllib2,urllib import zipfile import extract import downloader import re import time import common as Common import wipe import plugintools from random import randint USERDATA = xbmc.translatePath(os.path.join('special://home/userdata','')) ...
repotvsupertuga/repo
plugin.program.jogosEmuladores/service.py
Python
gpl-2.0
20,151
0.033199
from django.apps import AppConfig class CheckoutAppConfig(AppConfig): name = 'ecommerce.extensions.checkout' verbose_name = 'Checkout' def ready(self): super(CheckoutAppConfig, self).ready() # noinspection PyUnresolvedReferences import ecommerce.extensions.checkout.signals # pyl...
mferenca/HMS-ecommerce
ecommerce/extensions/checkout/apps.py
Python
agpl-3.0
349
0.002865
""" Created on November 20, 2019 This file is subject to the terms and conditions defined in the file 'LICENSE.txt', which is part of this source code package. @author: David Moss """ # Section ID's SECTION_ID_ALERTS = "alerts" SECTION_ID_NOTES = "notes" SECTION_ID_TASKS = "tasks" SECTION_ID_SLEEP = "sleep" SECTION_...
peoplepower/botengine
com.ppc.Bot/utilities/dailyreport.py
Python
apache-2.0
1,792
0.004464
# -*- coding: utf-8 -*- """ Custom model managers for finance. """ from .entity_manager import FinanceEntityManager __all__ = ( 'FinanceEntityManager', )
access-missouri/am-django-project
am/finance/models/managers/__init__.py
Python
bsd-2-clause
159
0.006289
#THIS IS /helicopter_providence/middletown_3_29_11/site1_planes/boxm2_site1_1/boxm2_create_scene.py from boxm2WriteSceneXML import * import optparse from xml.etree.ElementTree import ElementTree import os, sys #Parse inputs parser = optparse.OptionParser(description='Create BOXM2 xml file'); parser.add_opt...
mirestrepo/voxels-at-lems
super3d/boxm2_create_scene.py
Python
bsd-2-clause
1,566
0.030013
from __future__ import absolute_import, unicode_literals from django.http import HttpResponseBadRequest from django.shortcuts import render from django.views.decorators.csrf import csrf_exempt from debug_toolbar.panels.sql.forms import SQLSelectForm @csrf_exempt def sql_select(request): """Returns the output of...
ivelum/django-debug-toolbar
debug_toolbar/panels/sql/views.py
Python
bsd-3-clause
3,971
0.001259
from dcgpy import expression_gdual_double as expression from dcgpy import kernel_set_gdual_double as kernel_set from pyaudi import gdual_double as gdual # 1- Instantiate a random expression using the 4 basic arithmetic operations ks = kernel_set(["sum", "diff", "div", "mul"]) ex = expression(inputs = 1, ...
darioizzo/d-CGP
doc/examples/getting_started.py
Python
gpl-3.0
1,313
0.020564
import _plotly_utils.basevalidators class BorderwidthValidator(_plotly_utils.basevalidators.NumberValidator): def __init__( self, plotly_name="borderwidth", parent_name="histogram2dcontour.colorbar", **kwargs ): super(BorderwidthValidator, self).__init__( pl...
plotly/python-api
packages/python/plotly/plotly/validators/histogram2dcontour/colorbar/_borderwidth.py
Python
mit
555
0
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # KDE, App-Indicator or Qt Systray # Copyright (C) 2011-2018 Filipe Coelho <falktx@falktx.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; e...
falkTX/Cadence
src/systray.py
Python
gpl-2.0
23,718
0.008812
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2018 João Pedro Rodrigues # # 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 # # Unl...
JoaoRodrigues/pdb-tools
pdbtools/pdb_keepcoord.py
Python
apache-2.0
3,212
0
from clickFuUtils import cfAction class osmViewMap(cfAction): def __init__(self,iface): cfAction.__init__(self,self.name(),iface) return None def name(self): return "View OSM map" def desc(self): return "Goto Location on OpenStreetMap" def createURL(self,lat,long): ...
spatialhast/clickfu
osm.py
Python
gpl-3.0
1,309
0.02139
from django.conf import settings # Safe User import for Django < 1.5 try: from django.contrib.auth import get_user_model except ImportError: from django.contrib.auth.models import User else: User = get_user_model() # Safe version of settings.AUTH_USER_MODEL for Django < 1.5 auth_user_model = getattr(sett...
kevindias/django-chalk
chalk/compat.py
Python
bsd-3-clause
358
0
# -*- coding: utf-8 -*- ############################################################################## # # Trading As Brands # Copyright (C) 2015 OpusVL (<http://opusvl.com/>) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # pub...
OpusVL/odoo-trading-as
trading_as/__openerp__.py
Python
agpl-3.0
1,741
0.001723
#-*- coding: utf-8 -*- # # Copyright (C) 2005-2010 TUBITAK/UEKAE # # 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. # # P...
solus-project/package-management
pisi/actionsapi/shelltools.py
Python
gpl-2.0
9,041
0.008185
"""Workaround for formatting issue Source: http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GettingStarted.Python.04.html """ import decimal import json class DecimalEncoder(json.JSONEncoder): def default(self, o): if isinstance(o, decimal.Decimal): if o % 1 > 0: ...
jcolekaplan/WNCYC
src/main/api/decEncoder.py
Python
mit
441
0.004535
# # 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 u...
msonnabaum/thrift
test/crossrunner/run.py
Python
apache-2.0
9,516
0.010824
import sys import pytest from opentracing.ext import tags from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker from opentracing_instrumentation.client_hooks import mysqldb as mysqldb_hooks from opentracing_instrumentation.request_context import span_in_context from .sql_common import metadata...
uber-common/opentracing-python-instrumentation
tests/opentracing_instrumentation/test_mysqldb.py
Python
mit
2,279
0.000878
# # Newfies-Dialer License # http://www.newfies-dialer.org # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. # # Copyright (C) 2011-2013 Star2Billing S.L. # # The Initia...
garyjs/Newfiesautodialer
newfies/api/api_playgrounds/campaign_delete_cascade_playground.py
Python
mpl-2.0
1,138
0.001757
#!/usr/bin/env python3 class Employee: num_of_emps = 0 raise_amount = 1.04 def __init__(self,first,last): self.first = first self.last = last self.email = first + '.' + last + '@kellynoah.com' def fullname(self): return '{} {}'.format(self.first,self.last) def ...
lmascare/utils
python/tutorials/oop6a.py
Python
artistic-2.0
811
0.008631
#第四集(包含部分文件3.py和部分第二集) # courses=['History','Math','Physics','Compsci']#此行代码在Mutable之前都要打开 # print(courses) # courses.append('Art')#在最后添加一个元素 # courses.insert(0,'English')#在0的位置添加一个元素 # courses_2=['Chinese','Education'] # courses.insert(1,courses_2)#看看这条代码与下面两条代码有什么不同 # courses.append(courses_2) # courses.extend(cour...
Tiger-C/python
python教程/第四集.py
Python
mit
3,007
0.006783
#!/usr/bin/python # coding=utf-8 import datetime import mock from test import CollectorTestCase from test import get_collector_config from test import unittest from mock import patch from test import run_only from mock import Mock from diamond.collector import Collector from elb import ElbCollector def run_only_if...
MichaelDoyle/Diamond
src/collectors/elb/test/testelb.py
Python
mit
8,325
0.00024
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz> # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html """ Blei's LDA-C format. """ from __future__ import with_statement import logging from gensim import interfaces, utils from gensim.c...
auduno/gensim
gensim/corpora/bleicorpus.py
Python
gpl-3.0
3,768
0.00345
# 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-eventgrid/azure/eventgrid/models/resource_write_failure_data.py
Python
mit
3,203
0.000312
"""(Re)builds feeds for categories""" import os import datetime import jinja2 from google.appengine.api import app_identity import dao import util def build_and_save_for_category(cat, store, prefix): """Build and save feeds for category""" feed = build_feed(cat) save_feeds(store, feed, prefix, cat.key.id...
notapresent/rutracker_rss
feeds.py
Python
apache-2.0
2,363
0
# Copyright (c) 2012 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. """Functions that deal with local and device ports.""" import contextlib import fcntl import httplib import logging import os import socket import trace...
SummerLW/Perf-Insight-Report
devil/devil/android/ports.py
Python
bsd-3-clause
6,336
0.007418
# coding:utf-8 from urllib import parse as url_parse from logger.log import crawler from apps.celery_init import celery from page_get.basic import get_page from config.conf import get_max_search_page from page_parse import search as parse_search from db.search_words import get_search_keywords from db.keywords_wbdata im...
xtuyaowu/jtyd_python_spider
celery_tasks/weibo/search.py
Python
mit
2,317
0.003021
from distutils.core import setup from ripwrap import __VERSION__ setup( name = 'ripwrap', version = __VERSION__, description = 'A wrapper for ReSTinPeace, for Django applications.', long_description = open('README').read() author = 'P.C. Shyamshankar', packages = ['ripwrap'], url = 'http...
sykora/django-ripwrap
setup.py
Python
gpl-3.0
712
0.025281
""" The tests exercise the casting machinery in a more low-level manner. The reason is mostly to test a new implementation of the casting machinery. Unlike most tests in NumPy, these are closer to unit-tests rather than integration tests. """ import pytest import textwrap import enum import itertools import random i...
simongibbons/numpy
numpy/core/tests/test_casting_unittests.py
Python
bsd-3-clause
29,168
0.000583
from unittest import TestCase from cloudshell.cp.vcenter.network.vlan.factory import VlanSpecFactory class TestVlanSpecFactory(TestCase): def test_get_vlan_spec(self): vlan_spec_factory = VlanSpecFactory() vlan_spec = vlan_spec_factory.get_vlan_spec('Access') self.assertIsNotNone(vlan_sp...
QualiSystems/vCenterShell
package/cloudshell/tests/test_network/vlan/test_factory.py
Python
apache-2.0
324
0
# Austin Jenchi # 1/30/2015 # 8th Period # Paycheck print "Welcome to How to Job" print wage_per_hour = raw_input("How much is your hourly wage? ==> $") if not wage_per_hour == "": try: wage_per_hour = float(wage_per_hour) except: wage_per_hour = 12.00 else: wage_per_hour = 12.00 print "You...
timtim17/IntroToGameProg
Labs/Paycheck.py
Python
gpl-2.0
746
0.002681
""" sentry.web.frontend.generic ~~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import import os import posixpath from django.conf import settings from django.http import HttpRespo...
ifduyue/sentry
src/sentry/web/frontend/generic.py
Python
bsd-3-clause
3,640
0.001099
# 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...
rahulunair/nova
nova/db/sqlalchemy/api_migrations/migrate_repo/versions/016_resource_providers.py
Python
apache-2.0
4,495
0.000222
#!/usr/bin/env python import os import sys from optparse import OptionParser from jobTree.src.bioio import logger, setLoggingFromOptions from jobTree.scriptTree.stack import Stack from margin.mappers.last import Last, LastChain, LastRealign from margin.mappers.bwa import Bwa, BwaChain, BwaRealign from margin.mappers.gr...
isovic/marginAlign
src/margin/marginAlign.py
Python
mit
4,995
0.015816
from ray.rllib.utils.deprecation import deprecation_warning deprecation_warning( old="ray/rllib/examples/recsim_with_slateq.py", new="ray/rllib/examples/recommender_system_with_recsim_and_slateq.py", error=True, )
ray-project/ray
rllib/examples/recsim_with_slateq.py
Python
apache-2.0
227
0
import networkx from yaiep.graph.Node import Node ## # Classe che rappresenta l'intero spazio di ricerca che viene # generato via via che il metodo di ricerca ispeziona nuovi nodi # class SearchGraph(networkx.DiGraph): ## # Crea il grafo di ricerca come un grafo direzionato # il quale ha come nodo inizial...
aleSuglia/YAIEP
yaiep/graph/SearchGraph.py
Python
mit
1,169
0.001714
# -*- coding: utf-8 -*- # # pysdn documentation build configuration file, created by # sphinx-quickstart on Wed Aug 5 08:56:12 2015. # # 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...
brocade/pysdn
docs/source/conf.py
Python
bsd-3-clause
9,179
0.005992
import math def isPrime(num): if num < 2: return False # 0, 1不是质数 # num为100时, 它是不可能有因子是大于50的. 比如说60 * ? = 100, 这是不可能的, 所以这里只要比较sqrt(), 平方根 boundary = int(math.sqrt(num)) + 1 for i in range(2, boundary): if num % i == 0: return False return True def primeSieve(size):...
songzhw/Hello-kotlin
Python101/src/math/PrimeSieve.py
Python
apache-2.0
1,333
0.007048
import unittest from graph_theory.spfa import spfa class GraphTheoryTests(unittest.TestCase): def setUp(self): source = 0 num_nodes = 5 neighbour_list = [[1], # 0 [2], # 1 [3], # 2 [4, 1], # 3 ...
yu-peng/cdru
graph_theory/tests.py
Python
gpl-3.0
1,214
0.014003
# 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...
jxta/cc
vendor/boto/boto/manage/volume.py
Python
apache-2.0
16,328
0.002511
# -*- coding: utf-8 -*- # Generated by Django 1.9.11 on 2017-05-10 15:49 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('sessao', '0001_initial'), ] operations = [ migrations.AddField( ...
cmjatai/cmj
sapl/sessao/migrations/0002_sessaoplenaria_interativa.py
Python
gpl-3.0
518
0.001938
# Copyright (c) 2017 https://github.com/ping # # This software is released under the MIT License. # https://opensource.org/licenses/MIT __version__ = '0.3.9'
ping/instagram_private_api_extensions
instagram_private_api_extensions/__init__.py
Python
mit
159
0
# 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 may ...
Azure/azure-sdk-for-python
sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/operations/_agent_pools_operations.py
Python
mit
40,397
0.004505
''' Created on Jan 27, 2017 @author: montes ''' import bpy from inspect import * import mv import os import math from reportlab.pdfgen import canvas from reportlab.lib.pagesizes import legal,inch,cm from reportlab.platypus import Image from reportlab.platypus import Paragraph,Table,TableStyle from reportlab.platypus ...
Microvellum/Fluid-Designer
win64-vc/2.78/scripts/startup/fluid_operators/fd_api_doc.py
Python
gpl-3.0
10,496
0.0121
# -*- coding: utf-8 -*- # Copyright (C) 2009, 2013-2015 Rocky Bernstein # # 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 ve...
rocky/python2-trepan
trepan/processor/command/edit.py
Python
gpl-3.0
2,860
0.003846
# choco/ui.py # Copyright (C) 2006-2016 the Choco authors and contributors <see AUTHORS file> # # This module is part of Choco and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php import re import os import posixpath from choco import errors from choco import util from choco.ru...
whiteclover/Choco
choco/ui.py
Python
mit
3,191
0
#!/usr/bin/env python # coding=utf-8 # Furry Text Escape 2 main script gamevers = ('v1.0') n = ('null') tprint1 = ('1') tprint2 = ('1') while n.strip()!="4": if tprint1==('1'): t = open('./art/title1.TCR', 'r') tcr_contents = t.read() print (chr(27) + "[2J" + chr(27) + "[H" + tcr_contents) t.close() tprint...
ThomasTheSpaceFox/furry-text-escape-2
TE2.py
Python
gpl-3.0
2,244
0.043226
#!/usr/bin/env python # -*- coding: utf-8 -*- # # GuessIt - A library for guessing information from filenames # Copyright (c) 2011 Nicolas Wack <wackou@gmail.com> # # GuessIt is free software; you can redistribute it and/or modify it under # the terms of the Lesser GNU General Public License as published by # the Free ...
jerbob92/CouchPotatoServer
libs/guessit/language.py
Python
gpl-3.0
13,849
0.003251
# # (c) 2017, Red Hat, Inc. # # 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...
tsdmgz/ansible
lib/ansible/plugins/action/ironware_config.py
Python
gpl-3.0
4,167
0.00072
import scipy.stats as estad from tikon.ecs.aprioris import APrioriDist from tikon.ecs.árb_mód import Parám from tikon.móds.rae.orgs.ecs.repr._plntll_ec import EcuaciónReprCoh class N(Parám): nombre = 'n' líms = (0, None) unids = None apriori = APrioriDist(estad.expon(scale=500)) class A(Parám): ...
julienmalard/Tikon
tikon/móds/rae/orgs/ecs/repr/triang.py
Python
agpl-3.0
857
0
""" WSGI config for Courseware project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/ """ import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "Courseware.settings") from django....
shayan72/Courseware
Courseware/wsgi.py
Python
mit
395
0.002532
import _plotly_utils.basevalidators class TickvalsValidator(_plotly_utils.basevalidators.DataArrayValidator): def __init__(self, plotly_name="tickvals", parent_name="mesh3d.colorbar", **kwargs): super(TickvalsValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_na...
plotly/python-api
packages/python/plotly/plotly/validators/mesh3d/colorbar/_tickvals.py
Python
mit
460
0.002174
#!/usr/bin/python """Updates the timezone data held in bionic and ICU.""" import ftplib import glob import httplib import os import re import shutil import subprocess import sys import tarfile import tempfile regions = ['africa', 'antarctica', 'asia', 'australasia', 'etcetera', 'europe', 'northamerica', '...
s20121035/rk3288_android5.1_repo
bionic/libc/tools/zoneinfo/update-tzdata.py
Python
gpl-3.0
8,075
0.016966
def splice(alists, recycle = True): """ Accepts a list of nonempty lists or indexable objects in argument alists (each element list may not be of the same length) and a keyword argument recycle which if true will reuse elements in lists of shorter length. Any error will result in an empty list...
ActiveState/code
recipes/Python/496684_Splicing_of_lists/recipe-496684.py
Python
mit
1,158
0.025043
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'FacebookProfile.polls' db.add_column(u'socialplatform_facebookprofile', 'polls', ...
tekton/DocuCanvas
socialplatform/migrations/0005_auto__add_field_facebookprofile_polls.py
Python
gpl-3.0
7,753
0.007868
# # 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...
apache/airflow
airflow/migrations/versions/952da73b5eff_add_dag_code_table.py
Python
apache-2.0
2,906
0.001376
# Copyright (C) 2013 Johnny Vestergaard <jkv@unixcluster.dk> # # 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 p...
honeynet/beeswarm
beeswarm/drones/client/baits/pop3.py
Python
gpl-3.0
3,174
0.001575
# Copyright 2015 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...
horance-liu/tensorflow
tensorflow/python/keras/_impl/keras/utils/generic_utils.py
Python
apache-2.0
12,658
0.0079
# -*- coding: utf-8 -*- import mock from nose.tools import * # noqa (PEP8 asserts) import hmac import hashlib from StringIO import StringIO from django.db import IntegrityError import furl from modularodm import Q from modularodm.exceptions import ValidationError from framework.auth import get_or_create_user from ...
cwisecarver/osf.io
tests/test_conferences.py
Python
apache-2.0
25,084
0.000518
# Copyright 2014 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 logging import os import signal import subprocess import sys import tempfile from profile_chrome import controllers from profile_chrome import ui fr...
CTSRD-SOAAP/chromium-42.0.2311.135
tools/profile_chrome/perf_controller.py
Python
bsd-3-clause
6,890
0.00566
# encoding: utf-8 import os import re import shutil import subprocess import tempfile import textwrap import time from test.constant import (ARR_D, ARR_L, ARR_R, ARR_U, BS, ESC, PYTHON3, SEQUENCES) def wait_until_file_exists(file_path, times=None, interval=0.01): while times is None o...
wincent/ultisnips
test/vim_interface.py
Python
gpl-3.0
6,882
0.000436
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'ui/src/calendar_edit.ui' # # Created: Wed Nov 17 12:05:53 2010 # by: PyQt4 UI code generator 4.7.3 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui class Ui_CalendarEntryEdit(object): def se...
ypid/series60-remote
pc/ui/ui_calendar_edit.py
Python
gpl-2.0
14,073
0.003837
# Copyright 2019 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). """Create AWS Lambdas from Python code. See https://www.pantsbuild.org/docs/awslambda-python. """ from pants.backend.awslambda.python import rules as python_rules from pants.backend.awsl...
benjyw/pants
src/python/pants/backend/awslambda/python/register.py
Python
apache-2.0
577
0.001733
""" Author: Dr. John T. Hwang <hwangjt@umich.edu> This package is distributed under New BSD license. Full-factorial sampling. """ import numpy as np from smt.sampling_methods.sampling_method import SamplingMethod class FullFactorial(SamplingMethod): def _initialize(self): self.options.declare( ...
bouhlelma/smt
smt/sampling_methods/full_factorial.py
Python
bsd-3-clause
1,806
0.000554
# -*- coding: utf-8 -*- # Copyright 2009 James Hensman # Licensed under the Gnu General Public license, see COPYING #from numpy import matlib as ml import numpy as np from scipy import linalg class PCA_EM_matrix: def __init__(self,data,target_dim): """Maximum likelihood PCA by the EM algorithm""" self.X = ml.matr...
jameshensman/pythonGPLVM
PCA_EM.py
Python
gpl-3.0
6,841
0.05087
from twisted.internet import error as TxErrors import couchbase._libcouchbase as LCB from couchbase._libcouchbase import ( Event, TimerEvent, IOEvent, LCB_READ_EVENT, LCB_WRITE_EVENT, LCB_RW_EVENT, PYCBC_EVSTATE_ACTIVE, PYCBC_EVACTION_WATCH, PYCBC_EVACTION_UNWATCH, PYCBC_EVACTION_CLEANUP ) cla...
mnunberg/couchbase-python-client
txcouchbase/iops.py
Python
apache-2.0
3,633
0.001376
"""Deprecated import support. Auto-generated by import_shims/generate_shims.sh.""" # pylint: disable=redefined-builtin,wrong-import-position,wildcard-import,useless-suppression,line-too-long from import_shims.warn import warn_deprecated_import warn_deprecated_import('certificates.apps', 'lms.djangoapps.certificates.a...
eduNEXT/edunext-platform
import_shims/lms/certificates/apps.py
Python
agpl-3.0
374
0.008021
# Copyright (c) 2021, CRS4 # # 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, modify, merge, publish, distribu...
crs4/ProMort
promort/reviews_manager/management/commands/build_prediction_reviews_worklist.py
Python
mit
5,988
0.00501
import base64 import os from django.test import Client as TC import datetime import logging import pytz from django.utils.module_loading import import_string from api.directions.sql_func import direction_by_card, get_lab_podr, get_confirm_direction_patient_year, get_type_confirm_direction from api.stationar.stationa...
moodpulse/l2
integration_framework/views.py
Python
mit
76,926
0.002275
import unittest import os import sys import shutil sys.path.append('../lib/') sys.path.append(os.path.dirname(os.path.realpath(__file__))) import alchemy from alchemy.schema import * class TestAlchemy(unittest.TestCase): def setUp(self): # this basically resets our testing database path = config....
yngcan/patentprocessor
test/test_alchemy.py
Python
bsd-2-clause
14,826
0.000742
# -*- coding: utf-8 -*- from __future__ import with_statement import base64 import datetime import json import os from django import http from django.conf import settings from django.conf.urls import url from django.contrib import admin from django.core import urlresolvers from django.core.cache import cache from djan...
Venturi/cms
env/lib/python2.7/site-packages/cms/tests/test_plugins.py
Python
gpl-2.0
79,253
0.002801
# -*- coding: utf-8 -*- """ Unit tests for embargo app admin forms. """ from __future__ import absolute_import import six # Explicitly import the cache from ConfigurationModel so we can reset it after each test from config_models.models import cache from django.test import TestCase from opaque_keys.edx.locator import...
ESOedX/edx-platform
openedx/core/djangoapps/embargo/tests/test_forms.py
Python
agpl-3.0
5,361
0.002425
"""Implementation of allocation API. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import logging from treadmill import discovery from treadmill import context _LOGGER = logging.getLogger(__name__) class AP...
Morgan-Stanley/treadmill
lib/python/treadmill/api/nodeinfo.py
Python
apache-2.0
1,004
0
#---------------------------------------------------------------------- #This utility sets up the python configuration files so as to #allow Python to find files in a specified directory, regardless #of what directory the user is working from. This is typically #used to create a directory where the user will put resou...
CommonClimate/teaching_notebooks
GEOL351/CoursewareModules/setpath.py
Python
mit
5,073
0.013996
import subprocess import os class CommandRunner: HOST_LIST_TO_RUN_LOCAL = ["localhost", "127.0.0.1"] def __init__(self, local_hostname, logger): logger.debug("Creating CommandRunner with Args - local_hostname: {local_hostname}, logger: {logger}".format(**locals())) self.local_hostname = loca...
teamclairvoyant/airflow-scheduler-failover-controller
scheduler_failover_controller/command_runner/command_runner.py
Python
apache-2.0
2,797
0.002503
import logging import ibmsecurity.utilities.tools logger = logging.getLogger(__name__) module_uri = "/isam/felb/configuration/services/" requires_modules = None requires_versions = None requires_model = "Appliance" def add(isamAppliance, service_name, name, value, check_mode=False, force=False): """ Creates...
IBM-Security/ibmsecurity
ibmsecurity/isam/base/network/felb/services/advanced_tuning.py
Python
apache-2.0
6,046
0.004135
# # 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 us...
WindCanDie/spark
python/pyspark/tests/test_util.py
Python
apache-2.0
3,052
0.001311
# -*- coding: utf-8 -*- from harpia.model.connectionmodel import ConnectionModel as ConnectionModel from harpia.system import System as System class DiagramModel(object): # ---------------------------------------------------------------------- def __init__(self): self.last_id = 1 # first block is n1...
llgoncalves/harpia
harpia/model/diagrammodel.py
Python
gpl-2.0
854
0.001171
# -*- coding: UTF-8 -*- # Copyright 2019-2020 Rumma & Ko Ltd # License: GNU Affero General Public License v3 (see file COPYING for details) from django.db import models from lino_xl.lib.ledger.choicelists import VoucherStates from lino.api import dd, _ class OrderStates(VoucherStates): pass add = OrderStates....
lino-framework/xl
lino_xl/lib/orders/choicelists.py
Python
bsd-2-clause
992
0.006048
# 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...
hfp/tensorflow-xsmm
tensorflow/contrib/distribute/python/minimize_loss_test.py
Python
apache-2.0
20,274
0.007695
from django.conf import settings from django.utils.translation import gettext_lazy as _ ASSIGNMENT_ANY = 0 ASSIGNMENT_MATCH = 1 ASSIGNMENT_EXCEPT = 2 ASSIGNMENT_CHOICES = ( (ASSIGNMENT_ANY, _("any")), (ASSIGNMENT_MATCH, _("matches")), (ASSIGNMENT_EXCEPT, _("don't match")), ) DJANGO_ADMIN_SSO_ADD_LOGIN_BU...
matthiask/django-admin-sso
admin_sso/default_settings.py
Python
bsd-3-clause
1,071
0.001867
#!/usr/bin/env python # # Copyright 2005,2007 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 opt...
GREO/GNU-Radio
gr-audio-alsa/src/qa_alsa.py
Python
gpl-3.0
1,240
0.010484
# coding=utf-8 from tornado.wsgi import WSGIContainer from tornado.httpserver import HTTPServer from tornado.ioloop import IOLoop from app import app if __name__ == "__main__": http_server = HTTPServer(WSGIContainer(app)) http_server.listen(5000) IOLoop.instance().start()
levythu/swift-layerC
inapi/httpd.py
Python
gpl-2.0
287
0
"""distutils.command.sdist Implements the Distutils 'sdist' command (create a source distribution).""" import os import string import sys from types import * from glob import glob from warnings import warn from distutils.core import Command from distutils import dir_util, dep_util, file_util, archive_util from distu...
timm/timmnix
pypy3-v5.5.0-linux64/lib-python/3/distutils/command/sdist.py
Python
mit
17,891
0.000391
# -*- coding: utf-8 -*- from __future__ import print_function from __future__ import unicode_literals from __future__ import division import re import waffle from django.conf import settings from django.shortcuts import redirect class SoftLaunchMiddleware(object): def __init__(self): self.redirect_url =...
RickMohr/nyc-trees
src/nyc_trees/nyc_trees/middleware.py
Python
apache-2.0
846
0
# -*- coding: utf-8 -*- from __future__ import unicode_literals from abc import ABCMeta, abstractmethod from django.core.files import File from six import with_metaclass from django.utils.module_loading import import_string from rest_framework_tus import signals from .settings import TUS_SAVE_HANDLER_CLASS class ...
dirkmoors/drf-tus
rest_framework_tus/storage.py
Python
mit
1,346
0.000743
#!/usr/bin/env python3 # Copyright (c) 2018-2019 TurboCoin # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test the scantxoutset rpc call.""" from test_framework.test_framework import TurbocoinTestFramework from test_framework.u...
Phonemetra/TurboCoin
test/functional/rpc_scantxoutset.py
Python
mit
12,820
0.008892
""" Examples of Wavelets -------------------- Figure 10.9 Wavelets for several values of wavelet parameters Q and f0. Solid lines show the real part and dashed lines show the imaginary part (see eq. 10.16). """ # Author: Jake VanderPlas # License: BSD # The figure produced by this code is published in the textbook #...
eramirem/astroML
book_figures/chapter10/fig_wavelets.py
Python
bsd-2-clause
2,201
0.001363
from .inverse import RandomInverseModel from .sciopt import BFGSInverseModel, COBYLAInverseModel from .nn import NNInverseModel from .wnn import WeightedNNInverseModel, ESWNNInverseModel from .cmamodel import CMAESInverseModel from .jacobian import JacobianInverseModel
jgrizou/explauto
explauto/sensorimotor_model/inverse/__init__.py
Python
gpl-3.0
284
0.014085
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import datetime class Migration(migrations.Migration): dependencies = [ ('depot', '0002_lineitem'), ] operations = [ migrations.CreateModel( name='Order', fie...
kwailamchan/programming-languages
python/django/artdepot/artdepot/depot/migrations/0003_auto_20140930_2137.py
Python
mit
942
0.002123
# Plotting performance of string_subst_.py scripts # bar chart of relative comparison with variances as error bars import numpy as np import matplotlib.pyplot as plt performance = [10.3882388499416,1,10.3212281215746] variance = [0.790435196936213,0,0.827207394592818] scripts = ['string_subst_1.py', 'string_subst_2.p...
pswaminathan/python_efficiency_tweaks
plots/plot_string_subst_bar.py
Python
gpl-3.0
686
0.008746
from datetime import datetime, timedelta from django import http from django.conf import settings from django.core.exceptions import PermissionDenied import mock import pytest from olympia.amo.tests import BaseTestCase, TestCase from olympia.amo import decorators, get_user, set_user from olympia.amo.urlresolvers imp...
andymckay/addons-server
src/olympia/amo/tests/test_decorators.py
Python
bsd-3-clause
5,822
0