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
# -*- coding:utf-8 -*- import sys from datetime import datetime from django.template.loader import get_template from django.shortcuts import render,redirect from django.http import HttpResponse from .models import Post reload(sys) sys.setdefaultencoding('utf-8') # Create your views here. def homepage(request): te...
LouisLinY/mblog
mainsite/views.py
Python
apache-2.0
1,203
0.009975
from __future__ import unicode_literals import codecs import datetime from decimal import Decimal import locale try: from urllib.parse import quote except ImportError: # Python 2 from urllib import quote import warnings from django.utils.functional import Promise from django.utils import six class Django...
blaze33/django
django/utils/encoding.py
Python
bsd-3-clause
9,166
0.001855
def foo(a_new, b_new): print(a_new + b_new * 123) def f(): a = 1 b = 1 foo(a, b)
IllusionRom-deprecated/android_platform_tools_idea
python/testData/refactoring/extractmethod/Statement.after.py
Python
apache-2.0
98
0.010204
# vim: tabstop=4 shiftwidth=4 softtabstop=4 from django.conf.urls.defaults import * from django.conf import settings INSTANCES = r'^(?P<tenant_id>[^/]+)/instances/(?P<instance_id>[^/]+)/%s$' IMAGES = r'^(?P<tenant_id>[^/]+)/images/(?P<image_id>[^/]+)/%s$' KEYPAIRS = r'^(?P<tenant_id>[^/]+)/keypairs/%s$' urlpatterns ...
termie/openstack-dashboard
django-openstack/src/django_openstack/dash/urls.py
Python
apache-2.0
1,070
0.002804
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import logging import time from django.db import connection from django_logutils.conf import settings logger = logging.getLogger(__name__) de...
jsmits/django-logutils
django_logutils/middleware.py
Python
bsd-3-clause
4,098
0
# Copyright (c) 2014, Salesforce.com, Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # - Redistributions of source code must retain the above copyright # notice, this list of conditions...
fritzo/distributions
distributions/tests/test_models.py
Python
bsd-3-clause
20,478
0
"""Tests for the Volumio integration."""
jawilson/home-assistant
tests/components/volumio/__init__.py
Python
apache-2.0
41
0
# ##### BEGIN GPL LICENSE BLOCK ##### # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 3 # of the License, or (at your option) any later version. # # This program is distrib...
srgblnch/TangoDeviceWatchdog
tango-ds/dog.py
Python
gpl-3.0
27,005
0.000185
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>, and others # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type import json import shlex impo...
alexlo03/ansible
lib/ansible/modules/utilities/logic/async_wrapper.py
Python
gpl-3.0
10,223
0.002152
# -*- coding: utf-8 -*- """ Sahana Eden Human Resources Management @copyright: 2011-2021 (c) Sahana Software Foundation @license: MIT 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 S...
flavour/eden
modules/s3db/hrm.py
Python
mit
471,286
0.010189
# -*- coding: utf-8 -*- # <Lettuce - Behaviour Driven Development for python> # Copyright (C) <2010-2012> Gabriel Falcão <gabriel@nacaolivre.org> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundatio...
adw0rd/lettuce-py3
tests/functional/test_terrain.py
Python
gpl-3.0
2,378
0.002103
try: from setuptools import setup, Extension except ImportError: from distutils.core import setup, Extension setup(name='peloton_bloomfilters', author = 'Adam DePrince', author_email = 'adam@pelotoncycle.com', url = 'https://github.com/pelotoncycle/peloton_bloomfilters', version='0.0.1'...
pelotoncycle/shared_memory_bloomfilter
setup.py
Python
gpl-3.0
572
0.012238
from django.forms.fields import * from corehq.apps.sms.forms import BackendForm from dimagi.utils.django.fields import TrimmedCharField from django.core.exceptions import ValidationError from django.utils.translation import ugettext as _ class TelerivetBackendForm(BackendForm): api_key = TrimmedCharField() pro...
gmimano/commcaretest
corehq/apps/telerivet/forms.py
Python
bsd-3-clause
825
0.002424
"""Render meshes using OpenDR. Code is from: https://github.com/akanazawa/hmr/blob/master/src/util/renderer.py """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import math import cv2 import numpy as np from opendr.camera import ProjectPoints from...
deepmind/Temporal-3D-Pose-Kinetics
third_party/hmr/renderer.py
Python
apache-2.0
5,948
0.009247
# --coding: utf8-- import requests from django.contrib.gis.db import models from django.contrib.gis.geos import GEOSGeometry class Country(models.Model): """ Модель страны. """ title = models.CharField( u'название', max_length=255) class Meta: verbose_name = u'страна' ver...
minidron/django-geoaddress
django_geoaddress/models.py
Python
gpl-2.0
3,479
0
from distutils.core import setup from distutils.extension import Extension setup( name='wordcloud', version='1.1.3', url='https://github.com/amueller/word_cloud', description='A little word cloud generator', license='MIT', ext_modules=[Extension("wordcloud.query_integral_image", ...
asgeirrr/word_cloud
setup.py
Python
mit
469
0
# Copyright (c) 2015, NVIDIA CORPORATION. All rights reserved. import os.path import sys import tempfile import itertools import unittest try: import flask.ext.autodoc except ImportError as e: raise unittest.SkipTest('Flask-Autodoc not installed') try: import digits except ImportError: # Add path fo...
liyongsea/DIGITS
scripts/test_generate_docs.py
Python
bsd-3-clause
2,056
0.005837
# -*- coding:utf8 -*- a = 3 b = 4 print a+b
LyanJin/J_lyan
New.py
Python
epl-1.0
44
0.022727
# # Copyright 2009 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 option) # any later version. # #...
ffu/DSA-3.2.2
gr-wxgui/src/python/forms/converters.py
Python
gpl-3.0
5,122
0.029871
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
Azure/azure-sdk-for-python
sdk/eventhub/azure-eventhub/azure/eventhub/aio/_eventprocessor/event_processor.py
Python
mit
18,174
0.002531
# 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/managementpartner/azure-mgmt-managementpartner/azure/mgmt/managementpartner/models/_models.py
Python
mit
7,226
0.00083
from django.http.response import HttpResponse from django.shortcuts import render_to_response, render from Browser.models import UserInfo from Browser.views import cellar, administrator def simple_response(request, *args, **kwargs): template_name = kwargs["path"] if kwargs["type"] : template_name = kw...
SonienTaegi/CELLAR
Browser/views/__init__.py
Python
gpl-2.0
672
0.013393
import logging import shlex import subprocess import json from airflow.hooks.aws_emr import EMRHook from airflow.hooks.S3_hook import S3Hook from airflow.models import BaseOperator from airflow.utils.decorators import apply_defaults from airflow.exceptions import AirflowException from slackclient import SlackClient fr...
brandsoulmates/incubator-airflow
airflow/operators/aws_emr_operator.py
Python
apache-2.0
5,997
0.001834
import unittest import chainer from chainer import testing from chainer.testing import attr from chainercv.links.model.deeplab import SeparableASPP class TestSeparableASPP(unittest.TestCase): def setUp(self): self.in_channels = 128 self.out_channels = 32 self.link = SeparableASPP( ...
chainer/chainercv
tests/links_tests/model_tests/deeplab_tests/test_aspp.py
Python
mit
975
0
# Licensed to the StackStorm, Inc ('StackStorm') 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 th...
grengojbo/st2
st2client/st2client/formatters/table.py
Python
apache-2.0
8,219
0.001095
import functools import random from collections import defaultdict from mpmath.libmp.libintmath import ifac from ..core import Basic, Tuple, sympify from ..core.compatibility import as_int, is_sequence from ..matrices import zeros from ..polys import lcm from ..utilities import flatten, has_dups, has_variety from ..u...
diofant/diofant
diofant/combinatorics/permutations.py
Python
bsd-3-clause
72,579
0.000096
# -*- coding: utf-8 -*- """ Created on Fri Dec 18 14:11:31 2015 @author: Martin Friedl """ from datetime import date import numpy as np from Patterns.GrowthTheoryCell import make_theory_cell from Patterns.GrowthTheoryCell_100_3BranchDevices import make_theory_cell_3br from Patterns.GrowthTheoryCell_100_4BranchDevic...
Martin09/E-BeamPatterns
100 Wafers - 1cm Squares/Multi-Use Pattern/v1.2/MembraneDesign_100Wafer_v1.1.py
Python
gpl-3.0
17,018
0.002585
""" Persistence configuration """ PERSISTENCE_BACKEND = 'pypeman.persistence.SqliteBackend' PERSISTENCE_CONFIG = {"path":'/tmp/to_be_removed_849827198746.sqlite'}
jrmi/pypeman
pypeman/tests/settings/test_settings_sqlite_persist.py
Python
apache-2.0
164
0.006098
# -*- coding: utf-8 -*- # Copyright(C) 2010-2011 Romain Bignon # # This file is part of weboob. # # weboob is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at you...
blckshrk/Weboob
modules/minutes20/test.py
Python
agpl-3.0
982
0
# -*- coding: utf-8 -*- # Copyright (C) 2011-2012 Vodafone España, S.A. # Author: Andrew Bird # # 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 o...
andrewbird/wader
plugins/devices/zte_mf180.py
Python
gpl-2.0
1,826
0.001644
from __future__ import absolute_import, unicode_literals import mock import pytest from ddns_zones_updater.configreader import ConfigReader from ddns_zones_updater.core import DDNSZoneUpdater @pytest.fixture def fake_config_reader_with_two_hosts(): host_1 = mock.Mock(do_update=mock.Mock()) host_2 = mock.Moc...
bh/python-ddns-zones-updater
tests/test_core.py
Python
gpl-2.0
1,816
0
#!/usr/bin/env python import unittest from test import support import socket import urllib.request import sys import os import email.message def _open_with_retry(func, host, *args, **kwargs): # Connecting to remote hosts is flaky. Make it more robust # by retrying the connection several times. last_exc...
MalloyPower/parsing-python
front-end/testsuite-python-lib/Python-3.0/Lib/test/test_urllibnet.py
Python
mit
6,937
0.001586
import json with open('data/78mm.json', 'r') as _78mm: polygons78 = json.load(_78mm)["features"][0]["geometry"]["geometries"] with open('data/100mm.json', 'r') as _100mm: polygons100 = json.load(_100mm)["features"][0]["geometry"]["geometries"] with open('data/130mm.json', 'r') as _130mm: polygons130 = json...
HackCigriculture/cigriculture-ml
src/polygon.py
Python
gpl-3.0
2,316
0.002159
## Copyright (C) 2017 Oscar Diaz Barriga ## This file is part of Comp-Process-STPatterns. ## 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 op...
oscardbpucp/Comp-Process-STPatterns
clean_and_pretreatment/datos_total_fase1v3-mod.py
Python
gpl-3.0
13,307
0.007139
# encoding: utf-8 # # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http:# mozilla.org/MPL/2.0/. # from __future__ import absolute_import, division, unicode_literals from jx_base.queries import ...
klahnakoski/TestLog-ETL
vendor/jx_sqlite/schema.py
Python
mpl-2.0
4,659
0.001502
__problem_title__ = "Comfortable distance" __problem_url___ = "https://projecteuler.net/problem=364" __problem_description__ = "There are seats in a row. people come after each other to fill the " \ "seats according to the following rules: We can verify that T(10) = " \ ...
jrichte43/ProjectEuler
Problem-0364/solutions.py
Python
gpl-3.0
808
0.006188
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 Kylin OS, 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 # #...
Havate/havate-openstack
proto-build/gui/horizon/Horizon_GUI/openstack_dashboard/dashboards/admin/instances/forms.py
Python
apache-2.0
3,609
0
# -*- coding: Latin-1 -*- #!/usr/bin/env python """PyUdd, a python module for OllyDbg .UDD files Ange Albertini 2010, Public domain """ __author__ = 'Ange Albertini' __contact__ = 'ange@corkami.com' __revision__ = "$Revision$" __version__ = '0.1 r%d' import struct HDR_STRING = "Mod\x00" FTR_STRING...
foone/3dmmInternals
generate/lib/pyudd.py
Python
unlicense
17,726
0.007221
#!/usr/bin/python import sys, os import select, socket import usbcomm import usb _default_host = 'localhost' _default_port = 23200 _READ_ONLY = select.POLLIN | select.POLLPRI class Stream(object): def __init__(self, host=_default_host, port=_default_port): self.host = host self.port = por...
bewest/glucodump
glucodump/stream.py
Python
gpl-2.0
3,981
0.017332
# -*- coding: utf-8 -*- # Generated by Django 1.10.2 on 2017-02-09 17:08 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('scoping', '0047_auto_20170209_1626'), ] operations...
mcallaghan/tmv
BasicBrowser/scoping/migrations/0048_auto_20170209_1708.py
Python
gpl-3.0
658
0.00152
# 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, software # distributed under t...
datacommonsorg/tools
stat_var_renaming/stat_var_renaming_constants.py
Python
apache-2.0
13,060
0.001914
#!/usr/local/bin/python3 """ Copyright (c) 2015-2019 Ad Schellevis <ad@opnsense.org> All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain th...
opnsense/core
src/opnsense/service/configd_ctl.py
Python
bsd-2-clause
5,598
0.004287
from c2cgeoportal_admin.views.layertree import itemtypes_tables itemtypes_tables.update({ 'lu_int_wms': 'lux_layer_internal_wms', 'lu_ext_wms': 'lux_layer_external_wms', })
Geoportail-Luxembourg/geoportailv3
geoportal/geoportailv3_geoportal/admin/admin.py
Python
mit
178
0
########################################################################### # # Copyright 2021 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/l...
google/starthinker
examples/dcm_run_example.py
Python
apache-2.0
3,107
0.011265
# This file is part of Indico. # Copyright (C) 2002 - 2017 European Organization for Nuclear Research (CERN). # # Indico 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 (a...
nop33/indico
indico/modules/cephalopod/blueprint.py
Python
gpl-3.0
1,345
0.003717
""" @summary: Module contain matrix base classes @author: CJ Grady @version: 1.0 @status: alpha @license: gpl2 @copyright: Copyright (C) 2014, University of Kansas Center for Research Lifemapper Project, lifemapper [at] ku [dot] edu, Biodiversity Institute, 1345 Jayhawk Boulevard, Lawre...
cjgrady/compression
src/matrix/matrix.py
Python
gpl-2.0
3,131
0.023315
from pymuse.pipelinestages.pipeline_stage import PipelineStage from pymuse.utils.stoppablequeue import StoppableQueue from pymuse.signal import Signal from pymuse.constants import PIPELINE_QUEUE_SIZE class PipelineFork(): """ This class is used to fork a Pipeline. Ex.: PipelineFork([stage1, stage2], [stage3])...
PolyCortex/pyMuse
pymuse/pipeline.py
Python
mit
2,987
0.001339
# Copyright 2015 Tesora 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 by a...
openstack/trove
trove/guestagent/common/guestagent_utils.py
Python
apache-2.0
5,574
0
# Copyright (C) 2015-2022 by the RBniCS authors # # This file is part of RBniCS. # # SPDX-License-Identifier: LGPL-3.0-or-later import pytest from numpy import isclose from dolfin import (assemble, dx, FiniteElement, FunctionSpace, inner, MixedElement, split, TestFunction, TrialFunction, UnitSquare...
mathLab/RBniCS
tests/unit/backends/dolfin/test_tensor_io.py
Python
lgpl-3.0
5,343
0.001684
# Generated by Django 2.0.13 on 2019-08-10 20:16 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('profile_manager', '0004_auto_20190729_2101'), ] operations = [ migrations.AddField( model_name='profile', name='get...
timberline-secondary/hackerspace
src/profile_manager/migrations/0005_profile_get_messages_by_email.py
Python
gpl-3.0
484
0.002066
# -*- 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): # Changing field 'RegisteredIndex.query_hash' db.alter_column('djangodocument_registeredindex', 'query_hash...
zbyte64/django-dockit
dockit/backends/djangodocument/migrations/0002_auto__chg_field_registeredindex_query_hash.py
Python
bsd-3-clause
7,475
0.007358
from .local import * DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': 'temp.db', 'USER': '', 'PASSWORD': '', 'HOST': '', 'PORT': '', } } OPBEAT['APP_ID'] = None
pkimber/kbsoftware_couk
settings/dev_test.py
Python
apache-2.0
247
0
# -*- coding: utf-8 -*- # Generated by Django 1.9.2 on 2016-05-23 11:29 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('gestioneide', '0019_auto_20160517_2232'), ] operations = [ migrations.AlterF...
Etxea/gestioneide
gestioneide/migrations/0020_auto_20160523_1329.py
Python
gpl-3.0
471
0
# -*- coding: utf8 -*- # # Created by 'myth' on 2/19/16 import matplotlib as mpl import settings mpl.use('TkAgg')
myth/trashcan
it3708/project3/modules/__init__.py
Python
gpl-2.0
116
0
import json from flask import g, jsonify, request, current_app, url_for from ..models import User from .. import db from . import main from .authentication import auth_user from .errors import bad_request, unauthorized, forbidden, not_found """read all""" @main.route('/<token>/users/', methods=['GET']) ...
andela-bojengwa/team3
monitorbot_api/app/main/users.py
Python
mit
3,988
0.007773
import serial import numpy as np import json from datetime import datetime class ElectronicNose: def __init__(self, devAdd='/dev/ttyUSB0', baudrate=115200/3, \ tmax = 1000, outputFile = '', numSensors = 8): ## Creating the serial object self.Sensor = serial.Serial(devAdd, baud...
VandroiyLabs/FaroresWind
faroreswind/collector/ElectronicNose.py
Python
gpl-3.0
2,352
0.019133
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # no...
1ukash/horizon
horizon/dashboards/project/volumes/tests.py
Python
apache-2.0
14,507
0.001103
# -*- coding: utf-8 -*- # Generated by Django 1.10.4 on 2017-01-20 01:24 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('forum_conversation', '0009_auto_20160925_2126'), ] ...
ellmetha/django-machina
tests/_testsite/apps/forum_conversation/migrations/0010_auto_20170120_0224.py
Python
bsd-3-clause
644
0.001553
""" This GA code creates the gaModel with a circular island model """ from operator import attrgetter # import sys from deap import base, creator, tools import numpy from csep.loglikelihood import calcLogLikelihood as loglikelihood from models.mathUtil import calcNumberBins import models.model import random import arr...
PyQuake/earthquakemodels
code/gaModel/parallelGAModelP_AVR.py
Python
bsd-3-clause
6,277
0.035686
# -*- coding: utf-8 -*- # # Point Tracker documentation build configuration file, created by # sphinx-quickstart on Mon Oct 25 14:10:24 2010. # # 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. #...
PierreBdR/point_tracker
doc/source/conf.py
Python
gpl-2.0
7,170
0.006834
- def __init__(self): -
chris-j-tang/GLS
test/integration/ConstructorStart/simple.py
Python
mit
24
0.083333
# Copyright 2014 Netflix, 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...
odin1314/sketchy
sketchy/controllers/tasks.py
Python
apache-2.0
16,270
0.004856
import json import unittest2 from google.appengine.ext import testbed from consts.media_type import MediaType from helpers.media_helper import MediaParser from helpers.webcast_helper import WebcastParser class TestMediaUrlParser(unittest2.TestCase): def setUp(cls): cls.testbed = testbed.Testbed() ...
jaredhasenklein/the-blue-alliance
tests/suggestions/test_media_url_parse.py
Python
mit
9,927
0.004533
import numpy as np from scipy.special import iv def tapering_window(time,D,mywindow): """ tapering_window returns the window for tapering a WOSA segment. Inputs: - time [1-dim numpy array of floats]: times along the WOSA segment. - D [float]: Temporal length of the WOSA segment. - mywindow [int]: Choice of ...
guillaumelenoir/WAVEPAL
wavepal/tapering_window.py
Python
mit
2,207
0.043045
from ga_starters import *
Drob-AI/music-queue-rec
src/playlistsRecomender/gaPlaylistGenerator/__init__.py
Python
mit
25
0.04
#!/usr/bin/env python # -*- coding: utf-8 -*- """ progress test (count to 1000) """ from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals from ...utils.timing import TimedTestCase from ..progress import together class test_progress(TimedTestCase): de...
Thetoxicarcade/ac
congredi/utils/test/test_progress.py
Python
gpl-3.0
391
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 ...
lmazuel/azure-sdk-for-python
azure-servicefabric/azure/servicefabric/service_fabric_client_ap_is.py
Python
mit
582,969
0.001683
#!/usr/bin/env python class PLUGIN_test_test2: def __init__(self, screensurf, keylist, vartree): self.screensurf=screensurf self.keylist=keylist #best practice to init keyid variables during init, and default them to "0" (the null keyid) self.keyid="0" def fork(self, tagobj): return #core object. should e...
ThomasTheSpaceFox/Desutezeoid
plugins/test2.dzup.py
Python
gpl-3.0
1,889
0.044997
#!/usr/bin/env python # -*- coding: UTF-8 -*- from app import create_app, celery app = create_app()
taogeT/flask-celery
example/celery_run.py
Python
bsd-2-clause
101
0
import collections g=open("depth_29.txt","w") with open('depth_28.txt') as infile: counts = collections.Counter(l.strip() for l in infile) for line, count in counts.most_common(): g.write(str(line)) #g.write(str(count)) g.write("\n")
join2saurav/Lexical-syntax-semantic-analysis-of-Hindi-text-
test10.py
Python
apache-2.0
256
0.019531
from distutils.core import setup setup( name='dkcoverage', version='0.0.0', packages=[''], url='https://github.com/thebjorn/dkcoverage', license='GPL v2', author='bjorn', author_email='bp@datakortet.no', description='Run tests and compute coverage.' )
thebjorn/dkcoverage
setup.py
Python
gpl-2.0
285
0
#### NOTICE: THIS FILE IS AUTOGENERATED #### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY #### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES from swgpy.object import * def create(kernel): result = Creature() result.template = "object/mobile/shared_shear_mite_broodling.iff" result.attribute_template_id = 9 re...
anhstudios/swganh
data/scripts/templates/object/mobile/shared_shear_mite_broodling.py
Python
mit
444
0.047297
#!/usr/bin/env python # # Copyright (C) Citrix Systems Inc. # # This program 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; version 2.1 only. # # This program is distributed in the hope that it will ...
robertbreker/sm
drivers/devscan.py
Python
lgpl-2.1
14,406
0.00833
# test rasl inner loop on simulated data # # pylint:disable=import-error from __future__ import division, print_function import numpy as np from rasl.inner import inner_ialm from rasl import (warp_image_gradient, EuclideanTransform, SimilarityTransform, AffineTransform, ProjectiveTransform) def setup...
welch/rasl
tests/inner_test.py
Python
mit
4,843
0.00351
# -*- coding: utf-8 -*- """ Package of failing integer functions. """ from metaopt.objective.integer.failing.f import f as f from metaopt.objective.integer.failing.g import f as g FUNCTIONS_FAILING = [f, g]
cigroup-ol/metaopt
metaopt/objective/integer/failing/__init__.py
Python
bsd-3-clause
209
0
# Copyright 2015 Hewlett-Packard Development Company, L.P # 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....
coreycb/horizon
openstack_dashboard/test/integration_tests/tests/test_floatingips.py
Python
apache-2.0
4,543
0
# Copyright 2022 UW-IT, University of Washington # SPDX-License-Identifier: Apache-2.0 import logging import traceback from django.http import HttpResponseRedirect, HttpResponse from django.shortcuts import render from django.contrib.auth import logout as django_logout from restclients_core.exceptions import DataFailu...
uw-it-aca/myuw
myuw/views/page.py
Python
apache-2.0
6,010
0
import logging from stubo.ext.xmlutils import XPathValue from stubo.ext.xmlexit import XMLManglerExit log = logging.getLogger(__name__) elements = dict(year=XPathValue('//dispatchTime/dateTime/year'), month=XPathValue('//dispatchTime/dateTime/month'), day=XPathValue('//dispatchTime/dat...
rusenask/stubo-app
stubo/static/cmds/tests/ext/auto_mangle/skip_xml/ignore.py
Python
gpl-3.0
867
0.00692
from django.conf import settings from django.db import migrations, models import mapentity.models import django.contrib.gis.db.models.fields import django.db.models.deletion import geotrek.common.mixins import geotrek.authent.models class Migration(migrations.Migration): dependencies = [ ('authent', '000...
GeotrekCE/Geotrek-admin
geotrek/core/migrations/0001_initial.py
Python
bsd-2-clause
14,022
0.004921
a = 'sdlbapm' b = 'alam' for d in a: print d + b
motealle/python
01.py
Python
gpl-2.0
53
0
import unittest from datetime import datetime import tempfile import os from due.agent import Agent from due.episode import Episode from due.event import Event from due.persistence import serialize, deserialize from due.models.tfidf import TfIdfAgent from due.models.dummy import DummyAgent class TestTfIdfAgent(unitte...
dario-chiappetta/Due
due/models/test_tfidf.py
Python
gpl-3.0
3,631
0.024787
#!/usr/bin/python # -*- coding: utf-8 -*- import unicodedata from urlparse import urlparse from threading import Thread import httplib, sys from Queue import Queue import itertools import codecs import csv import sys import ssl import re if len(sys.argv) < 3: print "Usage: %s <csv database> <out csv>" % (sys.argv...
florence-nocca/spanish-elections
retrieve-accounts/searx.py
Python
mit
4,109
0.004138
#!/usr/local/sci/bin/python # PYTHON2.7 # import TestLeap # TestVal = TestLeap.TestLeap(year) import numpy as np def TestLeap(year): '''function to test if a year is a leap year''' '''returns 0.0 if it is a leap year''' '''returns a non-zero number if it is not a leap year''' '''ONLY WORKS WITH SCAL...
Kate-Willett/HadISDH_Build
TestLeap.py
Python
cc0-1.0
632
0.006329
# coding=utf-8 import time import json import boto3 from botocore.errorfactory import ClientError def lambda_handler(event, context): instance_id = event.get('instance_id') region_id = event.get('region_id', 'us-east-2') image_name = 'beam-automation-'+time.strftime("%Y-%m-%d-%H%M%S", time.gmtime()) ...
colinsheppard/beam
aws/src/main/python/updateBeamAMI/lambda_function.py
Python
gpl-3.0
2,524
0.009113
# -*- coding: utf-8 -*- # # pynag - Python Nagios plug-in and configuration environment # Copyright (C) 2010 Drew Stinnet # # 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 th...
kaji-project/pynag
pynag/Parsers/__init__.py
Python
gpl-2.0
129,457
0.001808
from datetime import datetime, timedelta, timezone from django.shortcuts import render from django.core.management import call_command from django.contrib.auth.models import User from django.contrib.auth.decorators import login_required from django.utils.translation import ugettext_lazy as _ from fly_project import set...
evan-rusin/fly-project
mygoals/views.py
Python
bsd-2-clause
6,398
0.00297
# Copyright 2018 The Cirq Developers # # 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 ...
quantumlib/Cirq
cirq-google/cirq_google/line/placement/optimization.py
Python
apache-2.0
4,663
0.001501
# xVector Engine Client # Copyright (c) 2011 James Buchwald # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This pr...
buchwj/xvector
client/xVClient/ErrorReporting.py
Python
gpl-3.0
4,145
0.002413
from bs4 import BeautifulSoup import xlsxwriter workbook= xlsxwriter.Workbook("data.xlsx") worksheet = workbook.add_worksheet() f = open('rough.html',"r") data=f.read() soup=BeautifulSoup(data) div = soup.find('div', {"class":'dataTables_scroll'}) table=div.find('table') tbody=div.find('tbody') rows=tbody.find_all('tr...
melvin0008/pythoncodestrial
trybs4.py
Python
apache-2.0
697
0.030129
import os import numpy def configuration(parent_package='', top_path=None): from numpy.distutils.misc_util import Configuration config = Configuration('datasets', parent_package, top_path) config.add_data_dir('data') config.add_data_dir('descr') config.add_data_dir('images') config.add_data_d...
DailyActie/Surrogate-Model
01-codes/scikit-learn-master/sklearn/datasets/setup.py
Python
mit
658
0
import json from traceback import format_exception from click.testing import CliRunner import pytest from qypi.__main__ import qypi def show_result(r): if r.exception is not None: return "".join(format_exception(*r.exc_info)) else: return r.output def test_list(mocker): spinstance = mock...
jwodder/qypi
test/test_main.py
Python
mit
30,735
0.000488
# -*- coding: utf-8 -*- """Doctest for method/function calls. We're going the use these types for extra testing >>> from UserList import UserList >>> from UserDict import UserDict We're defining four helper functions >>> def e(a,b): ... print a, b >>> def f(*a, **k): ... print a, t...
wang1352083/pythontool
python-2.7.12-lib/test/test_extcall.py
Python
mit
7,975
0.000251
import os # Django settings for mysite project. DEBUG = True BASE_DIR = os.path.dirname(os.path.abspath(__file__)) ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS SITE_ROOT = os.path.join(os.path.abspath(os.path.dirname(__file__)), '..') DATABASES = { 'default': { 'ENGINE...
sebnorth/extended_user
mysite/settings.py
Python
bsd-3-clause
5,917
0.001183
# Copyright 2014, Rackspace, US, 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 w...
wangxiangyu/horizon
openstack_dashboard/test/api_tests/nova_rest_tests.py
Python
apache-2.0
11,121
0
#!/usr/bin/python3 def sanitize(time_string): if '-' in time_string: splitter = '-' elif ':' in time_string: splitter = ':' else: return(time_string) (mins, secs) = time_string.strip().split(splitter) return(mins + '.' + secs) def get_coach_data(filename): try: with open(filename) as fn: ...
clovemfeng/studydemo
20140617/userlist_data.py
Python
gpl-2.0
657
0.024353
import os def create_peanut(peanut_name): peanut_dir = './peanuts/%s' % peanut_name if os.path.exists(peanut_dir): print('Peanut already exists') return os.mkdir(peanut_dir) os.mkdir(peanut_dir + '/templates') f = open(peanut_dir + '/__init__.py', 'w') f.write('') f.flush()...
donkeysharp/elvispy
elvis/climanager.py
Python
mit
889
0.00225
# -*- coding: utf-8 -*- # Generated by Django 1.10.2 on 2016-11-03 14:52 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('presence', '0001_initial'), ] operations = [ ...
RESTfactory/presence
presence/migrations/0002_session.py
Python
gpl-3.0
830
0.00241
# -*- coding: utf-8 -*- """ Name : multilayers Author : Joan Juvert <trust.no.one.51@gmail.com> Version : 1.0 Description : A class library to simulate light propagation in : multilayer systems. Copyright 2012 Joan Juvert This program is free software: you can redistribute it and...
tortugueta/multilayers
multilayers.py
Python
gpl-3.0
70,824
0.000706
import sys import operator import collections import random import string import heapq # @include def find_student_with_highest_best_of_three_scores(name_score_data): student_scores = collections.defaultdict(list) for line in name_score_data: name, score = line.split() if len(student_scores[na...
meisamhe/GPLshared
Programming/MPI — AMath 483 583, Spring 2013 1.0 documentation_files/average_top_3_scores.py
Python
gpl-3.0
1,767
0.001132
from pathlib import Path import os import structlog log = structlog.get_logger() _config = None def get(): global _config if not isinstance(_config, _build_config): _config = _build_config() return _config class _build_config: def __init__(self): self._config = {} self.dos...
meantheory/dotfiles
dos/src/dos/config.py
Python
mit
2,504
0.000799