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 |
|---|---|---|---|---|---|---|
# 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 json
import os
from telemetry.page import page as page_module
from telemetry.page import shared_page_state
from telemetry import story
__location__ ... | Chilledheart/chromium | tools/perf/page_sets/alexa1-10000.py | Python | bsd-3-clause | 1,340 | 0.005224 |
from django.core.cache import cache as cache_impl
from django.utils.encoding import smart_str
import hashlib
class Hashcache(object):
"""
Wrapper for django.core.cache.cache that hashes the keys to avoid key
length errors. Maybe eventually it will do other cool things.
You can optionally pass you... | yola/hashcache | hashcache/hashcache.py | Python | mit | 1,100 | 0.008182 |
default_app_config = '%s.apps.AppConfig' % __name__
| ic-labs/glamkit-sponsors | sponsors/__init__.py | Python | mit | 52 | 0 |
attr = 'parent child three'
| Orav/kbengine | kbe/src/lib/python/Lib/test/test_importlib/namespace_pkgs/project3/parent/child/three.py | Python | lgpl-3.0 | 29 | 0 |
"""
Two diode model equations.
"""
import numpy as np
from pvmismatch.contrib.gen_coeffs import diode
def fdidv(isat1, isat2, rs, rsh, ic, vc, vt):
"""
Derivative of IV curve and its derivatives w.r.t. Isat1, Isat2, Rs, Rsh, Ic,
Vc and Vt.
:param isat1: diode 1 saturation current [A]
:param isat... | SunPower/PVMismatch | pvmismatch/contrib/gen_coeffs/two_diode.py | Python | bsd-3-clause | 11,016 | 0.002179 |
# encoding: utf-8
from yast import import_module
import_module('UI')
from yast import *
class CheckBoxFrame1Client:
def main(self):
UI.OpenDialog(
VBox(
MarginBox(
1,
0.5,
CheckBoxFrame(
"E&xpert Settings",
True,
... | yast/yast-python-bindings | examples/CheckBoxFrame1.py | Python | gpl-2.0 | 729 | 0.00823 |
# -*- coding: utf-8 -*-
from copy import deepcopy
from openprocurement.auctions.dgf.tests.base import (
test_auction_data,
test_features_auction_data,
test_financial_organization,
test_financial_auction_data,
test_bids,
test_financial_bids,
test_organization
)
from openprocurement.api.tests... | prozorro-sale/openprocurement.auctions.dgf | openprocurement/auctions/dgf/tests/blanks/bidder_blanks.py | Python | apache-2.0 | 36,337 | 0.003444 |
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
class PyAzureMgmtAppconfiguration(PythonPackage):
"""Microsoft Azure App Configuration Management Client Library for ... | LLNL/spack | var/spack/repos/builtin/packages/py-azure-mgmt-appconfiguration/package.py | Python | lgpl-2.1 | 985 | 0.00203 |
import os
import sys
import numpy as np
import pandas as pd
import pandas.util.testing as pdt
import unittest
sys.path.insert(0, os.path.abspath("../../"))
from specdal.spectrum import Spectrum
from specdal.collection import Collection
class GroupByTests(unittest.TestCase):
def setUp(self):
# total 36 spe... | EnSpec/SpecDAL | specdal/tests/test_groupby.py | Python | mit | 1,667 | 0.0024 |
#
# Copyright 2015 Red Hat, Inc.
#
# 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 program is distributed in th... | simon3z/virt-deploy | virtdeploy/errors.py | Python | gpl-2.0 | 1,201 | 0 |
# This file is part of pybliographer
#
# Copyright (C) 1998-2004 Frederic GOBRY
# Email : gobry@pybliographer.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 Foundation; either version 2
# of t... | zkota/pyblio-1.3 | Legacy/Iterator.py | Python | gpl-2.0 | 2,270 | 0.01674 |
from build.management.commands.build_drugs import Command as BuildDrugs
class Command(BuildDrugs):
pass | cmunk/protwis | build_gpcr/management/commands/build_drugs.py | Python | apache-2.0 | 109 | 0.009174 |
import logging
from datetime import timedelta
from pajbot.managers.handler import HandlerManager
from pajbot.modules import BaseModule
from pajbot.modules import ModuleSetting
log = logging.getLogger(__name__)
class MaxMsgLengthModule(BaseModule):
ID = __name__.split(".")[-1]
NAME = "Maximum Message Lengt... | pajlada/pajbot | pajbot/modules/maxmsglength.py | Python | mit | 4,608 | 0.002821 |
# -*- coding: utf-8 -*-
# Copyright 2010-2015, Google 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... | takahashikenichi/mozc | src/build_tools/copy_qt_frameworks_mac.py | Python | bsd-3-clause | 4,010 | 0.008229 |
#!/usr/bin/python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import sys
src = open(sys.argv[1])
dst = open(sys.argv[2], 'w')
for ch in src.read():
dst.write('%d,\n' % ord(ch))
src.close()
dst.close()
| ibc/MediaSoup | worker/deps/gyp/test/external-cross-compile/src/tochar.py | Python | isc | 317 | 0.003155 |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | googleapis/python-data-qna | samples/generated_samples/dataqna_generated_dataqna_v1alpha_question_service_create_question_sync.py | Python | apache-2.0 | 1,661 | 0.000602 |
# 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... | kchodorow/tensorflow | tensorflow/contrib/bayesflow/python/kernel_tests/stochastic_variables_test.py | Python | apache-2.0 | 6,122 | 0.00539 |
from django.dispatch import receiver
from signals import sch_create_project
@receiver(project_created)
def project_networking(sender, **kwargs):
return True
| kanellov/openstack_project_create | openstack_project_create/receivers.py | Python | mit | 162 | 0.006173 |
# -*- coding: utf-8 -*-
import os,math
from qgis.core import NULL
from mole import oeq_global
from mole.project import config
from mole.extensions import OeQExtension
from mole.stat_corr import rb_present_wall_uvalue_AVG_by_building_age_lookup, nrb_present_wall_uvalue_by_building_age_lookup, rb_contemporary_wall_uvalu... | UdK-VPT/Open_eQuarter | mole/extensions/eval_present_heritage/oeq_UPH_Wall.py | Python | gpl-2.0 | 2,921 | 0.008216 |
#!/usr/bin/env python
import Tkinter as Tk
root=Tk.Tk()
l=Tk.Label(root,
text="Python\nPerl\nC",
justify="right",
)
l.pack()
root.mainloop()
| teppchan/tkintertips | py/label/align.py | Python | mit | 166 | 0.024096 |
from logging.handlers import BaseRotatingHandler
import string
import time
import datetime
import os
class TimePatternRotatingHandler(BaseRotatingHandler):
def __init__(self, filename, when, encoding=None, delay=0):
self.when = string.upper(when)
self.fname_pat = filename
self.mock_dt = N... | vls/python_utils | log_handlers.py | Python | unlicense | 1,677 | 0.003578 |
#-- GAUDI jobOptions generated on Wed Jun 10 17:31:51 2015
#-- Contains event types :
#-- 11104041 - 117 files - 2010995 events - 432.61 GBytes
#-- Extra information about the data processing phases:
#-- Processing Pass Step-124834
#-- StepId : 124834
#-- StepName : Reco14a for MC
#-- ApplicationName : ... | Williams224/davinci-scripts | kstaretappipig/MC_12_MagDown_kstar_rho_kpipipi.py | Python | mit | 12,721 | 0.027121 |
"""
Brewery Example - merge multiple CSV files
Input: Multiple CSV files with different fields, but with common subset of
fields.
Output: Single CSV file with all fields from all files and with additional
column with origin file name
Run:
$ python merge_multiple_files.py
Afterwards display ... | Stiivi/brewery | examples/merge_multiple_files/merge_multiple_files.py | Python | mit | 2,107 | 0.005695 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
un_numero = 75
otro_numero = -134
| psicobyte/ejemplos-python | cap5/p54.py | Python | gpl-3.0 | 77 | 0 |
from .stopper import EarlyStopper
from .progbar import ProgressBar
from .utils import split_arr
from .data_iterator import SequentialIterator
from tensorflow.python.framework import ops
import tensorflow as tf
import logging
logging.basicConfig(format='%(module)s.%(funcName)s %(lineno)d:%(message)s', level=logging.INF... | hycis/TensorGraph | tensorgraph/trainobject.py | Python | apache-2.0 | 3,080 | 0.003896 |
# system configuration generated and used by the sysconfig module
build_time_vars = {'ABIFLAGS': 'm',
'AC_APPLE_UNIVERSAL_BUILD': 0,
'AIX_GENUINE_CPLUSPLUS': 0,
'AR': 'x86_64-linux-gnu-gcc-ar',
'ARFLAGS': 'rc',
'ASDLGEN': 'python3.5 ../Parser/asdl_c.py',
'ASDLGEN_FILES': '../Parser/asdl.py ../Parser/asdl_c.py',
... | arju88nair/projectCulminate | venv/lib/python3.5/plat-x86_64-linux-gnu/_sysconfigdata_m.py | Python | apache-2.0 | 21,469 | 0.032559 |
#!/usr/bin/python
#
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | dietrichc/streamline-ppc-reports | examples/adwords/v201406/basic_operations/add_ad_groups.py | Python | apache-2.0 | 2,698 | 0.004077 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models
class Channel(models.Model):
_inherit = 'slide.channel'
nbr_certification = fields.Integer("Number of Certifications", compute='_compute_slides_statistics', store=True)
class ... | t3dev/odoo | addons/website_slides_survey/models/slide_channel.py | Python | gpl-3.0 | 488 | 0.004098 |
# This file is part of Indico.
# Copyright (C) 2002 - 2019 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from __future__ import unicode_literals
from indico.core.db import db
from indico.util.string import form... | mvidalgarcia/indico | indico/modules/users/models/suggestions.py | Python | mit | 2,186 | 0.002287 |
from __future__ import print_function, absolute_import
from PySide2 import QtGui,QtCore,QtWidgets
from math import *
import pickle, os, json
import learnbot_dsl.guis.EditVar as EditVar
from learnbot_dsl.learnbotCode.Block import *
from learnbot_dsl.learnbotCode.Language import getLanguage
from learnbot_dsl.learnbotCode... | robocomp/learnbot | learnbot_dsl/learnbotCode/VisualBlock.py | Python | gpl-3.0 | 29,715 | 0.00313 |
from __future__ import with_statement
from nose.tools import (
eq_ as eq,
)
from filesystem.test.util import (
maketemp,
assert_raises,
)
import errno
import os
import filesystem
import filesystem.copyonwrite
def test_mkdir():
tmp = maketemp()
filesystem.copyonwrite.path(filesystem.path... | nailor/filesystem | filesystem/test/test_copyonwrite_mkdir.py | Python | mit | 686 | 0.002915 |
from .utils import DslBase, BoolMixin, _make_dsl_class
from .function import SF, ScoreFunction
__all__ = [
'Q', 'Bool', 'Boosting', 'Common', 'ConstantScore', 'DisMax', 'Filtered',
'FunctionScore', 'Fuzzy', 'FuzzyLikeThis', 'FuzzyLikeThisField',
'GeoShape', 'HasChild', 'HasParent', 'Ids', 'Indices', 'Match... | reflection/elasticsearch-dsl-py | elasticsearch_dsl/query.py | Python | apache-2.0 | 5,587 | 0.00358 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from .version import __version__
from .core import * | barentsen/k2flix | k2flix/__init__.py | Python | mit | 99 | 0.010101 |
"""Test for `maas.client.viscera.boot_sources`."""
import random
from testtools.matchers import Equals, MatchesStructure
from .. import boot_sources
from ...testing import make_name_without_spaces, TestCase
from ..testing import bind
def make_origin():
# Create a new origin with BootSources and BootSource. The... | maas/python-libmaas | maas/client/viscera/tests/test_boot_sources.py | Python | agpl-3.0 | 5,431 | 0.000368 |
# -*- coding: utf-8 -*-
# ***********************************************************************
# Copyright (C) 2014 - 2017 Oscar Gerardo Lazo Arjona *
# <oscar.lazo@correo.nucleares.unam.mx> *
# *... | oscarlazoarjona/fast | fast/config.py | Python | gpl-3.0 | 1,912 | 0 |
# -*- coding: utf-8 -*-
'''
Exodus Add-on
Copyright (C) 2016 Exodus
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 opti... | JamesLinEngineer/RKMC | addons/plugin.video.phstreams/resources/lib/modules/proxy.py | Python | gpl-2.0 | 2,896 | 0.013812 |
from ctypes import *
import json
import ast
NN = CDLL('./libNN.so')
for distance in range(15):
file_rows = open("Data/tecator.csv", 'r').read().split('\n')
file_content = [
float(value)
for row in file_rows
for value in row.split(',')
if value != ''
]
numfil = len(file... | tech-teach/microservice-topology | tasks/core/cmetrics_run_test.py | Python | mit | 878 | 0.003417 |
"""
tests for the models
"""
import json
from datetime import datetime, timedelta
from django.utils.timezone import UTC
from mock import patch
from nose.plugins.attrib import attr
from student.roles import CourseCcxCoachRole
from student.tests.factories import (
AdminFactory,
)
from util.tests.test_date_utils impor... | solashirai/edx-platform | lms/djangoapps/ccx/tests/test_models.py | Python | agpl-3.0 | 10,002 | 0.0007 |
"""Offer time listening automation rules."""
from datetime import datetime
import logging
import voluptuous as vol
from homeassistant.const import CONF_AT, CONF_PLATFORM
from homeassistant.core import callback
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers.event import (
asyn... | titilambert/home-assistant | homeassistant/components/homeassistant/triggers/time.py | Python | apache-2.0 | 4,049 | 0.000247 |
#!/usr/bin/env python
import os
import shutil
import socket
from datetime import datetime
import subprocess as sp
import json
from pymongo import MongoClient
_ctest = '''
set(CTEST_SOURCE_DIRECTORY "{source}")
set(CTEST_BINARY_DIRECTORY "{build}")
include(${{CTEST_SOURCE_DIRECTORY}}/CTestConfig.cmake)
set(CTEST_SI... | dcjohnston/geojs | dashboard/github_service/dashboard.py | Python | bsd-3-clause | 5,762 | 0 |
#!/usr/bin/env python3
from argparse import ArgumentParser
from re import compile
from sys import argv
def get_split(s):
for ch in ('_', '-'):
if ch in s:
return s.split(ch)
return compile('[A-Z]?[^A-Z]+').findall(s)
def get_cases(s):
split = get_split(s)
capital = [w.capitalize(... | bjuvensjo/scripts | vang/misc/s.py | Python | apache-2.0 | 1,135 | 0 |
basedir = '/data/t3serv014/snarayan/deep/v_deepgen_4_akt_small/'
figsdir = '/home/snarayan/public_html/figs/deepgen/v4_akt/'
| sidnarayanan/BAdNet | train/gen/akt/paths.py | Python | mit | 125 | 0 |
# Visualize an annotated image with object sizes
import os
import cv2
import random
import numpy as np
from plantcv.plantcv import params
from plantcv.plantcv import color_palette
from plantcv.plantcv._debug import _debug
def obj_sizes(img, mask, num_objects=100):
"""
Label the size of objects in an image.
... | stiphyMT/plantcv | plantcv/plantcv/visualize/obj_sizes.py | Python | mit | 3,006 | 0.003327 |
import math
def even_numbers_only(thelist):
'''
Returns a list of even numbers in thelist
'''
return [x for x in thelist if x%2 == 0]
def is_perfect_square(x):
'''
Returns True if x is a perfect square, False otherwise
'''
thesqrt = int(math.sqrt(x))
return thesqrt * thesqrt == x
| joequery/joequery.me | joequery/blog/posts/code/python-builtin-functions/simple_functions.py | Python | mit | 319 | 0.009404 |
from ctypes import c_uint, byref
from django.contrib.gis.geos.error import GEOSIndexError
from django.contrib.gis.geos.geometry import GEOSGeometry
from django.contrib.gis.geos.libgeos import get_pointer_arr, GEOM_PTR
from django.contrib.gis.geos.linestring import LinearRing
from django.contrib.gis.geos import pro... | hunch/hunch-gift-app | django/contrib/gis/geos/polygon.py | Python | mit | 6,672 | 0.003447 |
import os
import autosar.rte.partition
import cfile as C
import io
import autosar.base
import autosar.bsw.com
innerIndentDefault=3 #default indendation (number of spaces)
def _genCommentHeader(comment):
lines = []
lines.append('/************************************************************************... | cogu/autosar | autosar/rte/generator.py | Python | mit | 42,335 | 0.023597 |
###############################################################################
##
## Copyright (c) Crossbar.io Technologies GmbH
##
## 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... | crossbario/autobahn-testsuite | autobahntestsuite/autobahntestsuite/case/case9_4_3.py | Python | apache-2.0 | 1,271 | 0.015736 |
__author__ = 'evren kutar'
from django.conf.urls import patterns, url
urlpatterns = patterns('',
url(r'^(?P<cslug>[\w-]+)/$', 'blog.views.post_category', name='category'),
url(r'^(?P<cslug>[\w-]+)/(?P<slug>[\w-]+)/$', 'blog.views.post', name='post')
) | evrenkutar/blog | blog/urls.py | Python | gpl-2.0 | 299 | 0.013378 |
class ReportParser:
"""
Parser with generic functionality for all Report Types (Tabular, Summary, Matrix)
Parameters
----------
report: dict, return value of Connection.get_report()
"""
def __init__(self, report):
self.data = report
self.type = self.data["reportMetadata"]["r... | cghall/salesforce-reporting | salesforce_reporting/parsers.py | Python | mit | 10,296 | 0.003594 |
"""
"""
import imp
import os
import sys
KEY_MAP = {0: [],
1: [],
2: [u'a', u'b', u'c'],
3: [u'd', u'e', u'f'],
4: [u'g', u'h', u'i'],
5: [u'j', u'k', u'l'],
6: [u'm', u'n', u'o'],
7: [u'p', u'q', u'r', u's'],
8: [u't', u'u', u'v']... | twonds/trinine | trinine/t9.py | Python | mit | 4,257 | 0.000235 |
import unittest
"""
Given an array of positive integers, find the maximum sum of a sub-sequence with the
constraint that no two numbers in the sequence should be adjacent in the array.
Input: 3 2 7 10
Output: 13 (3 + 10)
Input 3 2 5 10 7
Output: 15 (3 + 5 + 7)
"""
"""
Approach:
1. Similar to 0-1 Knapsack problem.
2. F... | prathamtandon/g4gproblems | Arrays/max_sum_not_adjacent.py | Python | mit | 2,744 | 0.001093 |
"""This utility aims to provide an easy way to encode text inside of images."""
# TODO Write test cases.
# TODO Write own version of cImage.
# TODO Add interface.
# TODO Add offset.
# TODO Add random seed.
from cImage import FileImage
from cImage import EmptyImage
class Encode:
"""Class"""
def __init__(self... | matttilton/pySteg | pySteg.py | Python | mit | 3,694 | 0.000541 |
# -*- coding: utf-8 -*-
#
# TGiT, Music Tagger for Professionals
# Copyright (C) 2013 Iconoclaste Musique Inc.
#
# 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... | Iconoclasteinc/tgit | tgit/countries.py | Python | gpl-3.0 | 11,846 | 0.000084 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
type 'pytest -v' to run u test series
"""
import codecs
import json
import os
import pytest
import tempfile
import sys
sys.path.insert(1, os.path.join(sys.path[0], '..'))
import core
class TestHelpers:
@staticmethod
def file_read(fd):
"""
fro... | pyseed/objify | objify/test/test_core.py | Python | mit | 13,959 | 0.002651 |
"""
Form widgets for ToscaWidgets.
To download and install::
easy_install twForms
"""
from tw.api import Widget
from tw.forms.core import *
from tw.forms.fields import *
from tw.forms.datagrid import *
from tw.forms.calendars import *
# build all so doc tools introspect me properly
from tw.forms.core import _... | jokajak/itweb | data/env/lib/python2.6/site-packages/tw.forms-0.9.9-py2.6.egg/tw/forms/__init__.py | Python | gpl-3.0 | 578 | 0.00173 |
"""
This page is in the table of contents.
Hop is a script to raise the extruder when it is not extruding.
Note:
Note: In some cases where you have thin overhang this plugin can help solve the problem object being knocked off by the head
The hop manual page is at:
http://fabmetheus.crsndoo.com/wiki/index.php/Skeinf... | tinkerinestudio/Tinkerine-Suite | TinkerineSuite/Cura/cura_sf/skeinforge_application/skeinforge_plugins/craft_plugins/hop.py | Python | agpl-3.0 | 8,736 | 0.025412 |
DOCUMENTATION='''
---
module: win_reboot
short_description: Reboot a windows machine
description:
- Reboot a Windows machine, wait for it to go down, come back up, and respond to commands.
version_added: "2.1"
options:
pre_reboot_delay_sec:
description:
- Seconds for shutdown to wait before requesting re... | welex91/ansible-modules-core | windows/win_reboot.py | Python | gpl-3.0 | 1,679 | 0.00536 |
#!/usr/bin/env python2
# multi-regime.py
# Author: Jonah Miller (jonah.maxwell.miller@gmail.com)
# Time-stamp: <2013-12-14 16:06:28 (jonah)>
# This is a library to plot and fit for omega(rho) variable. We choose
# omega so that we get the three distinct regimes for which we know
# the analytic solution with continuou... | Yurlungur/FLRW | MultiRegime.py | Python | mit | 2,168 | 0.01476 |
# -*- coding: utf-8 -*-
# Copyright(C) 2014 Bezleputh
#
# 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 your opt... | laurent-george/weboob | modules/feedly/browser.py | Python | agpl-3.0 | 4,193 | 0.000954 |
"""
WSGI config for hackathon 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.9/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SET... | python-frederick/hackathon-2016 | hackathon/wsgi.py | Python | bsd-2-clause | 395 | 0 |
'''simpler & deprecated python script controllers'''
import Sofa
import inspect
def deprecated(cls):
# TODO maybe we should print a backtrace to locate the origin?
# or even better, use: https://docs.python.org/2/library/warnings.html#warnings.warn
line = '''class `{0}` from module `{1}` is deprecated. Y... | Anatoscope/sofa | applications/plugins/SofaPython/python/SofaPython/script.py | Python | lgpl-2.1 | 2,609 | 0.010732 |
# Generated by Django 2.2.17 on 2021-02-02 03:43
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0036_fix_reg_invoice_link'),
]
operations = [
migrations.AlterField(
model_name='regis... | django-danceschool/django-danceschool | danceschool/core/migrations/0037_remove_registration_expirationdate.py | Python | bsd-3-clause | 1,183 | 0.002536 |
"""
The :mod:`sklearn.ensemble` module includes ensemble-based methods for
classification and regression.
"""
from .base import BaseEnsemble
from .forest import RandomForestClassifier
from .forest import RandomForestRegressor
from .forest import RandomTreesEmbedding
from .forest import ExtraTreesClassifier
from .fores... | depet/scikit-learn | sklearn/ensemble/__init__.py | Python | bsd-3-clause | 1,055 | 0 |
# -*- test-case-name: twisted.names.test.test_tap -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Domain Name Server
"""
import os, traceback
from twisted.python import usage
from twisted.names import dns
from twisted.application import internet, service
from twisted.names import ser... | skycucumber/Messaging-Gateway | webapp/venv/lib/python2.7/site-packages/twisted/names/tap.py | Python | gpl-2.0 | 4,832 | 0.001863 |
class OrderError(Exception):
pass
class OrderIdentifierError(OrderError):
"""
Order exception that is raised if order identifier was not found.
"""
pass
| druids/django-pyston | pyston/order/exceptions.py | Python | bsd-3-clause | 175 | 0 |
# =============================================================================
# Copyright (C) 2010 Diego Duclos
#
# This file is part of pyfa.
#
# pyfa 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 ... | Ebag333/Pyfa | service/damagePattern.py | Python | gpl-3.0 | 2,873 | 0.000348 |
# This is the Twisted Get Poetry Now! client, version 2.0
import datetime
import optparse
import os
import traceback
from twisted.internet.protocol import Protocol, ClientFactory
def parse_args():
usage = """usage: %prog [options] [hostname]:port ...
This is the Get Poetry Now! client, Twisted version 2.0.
... | GreenJoey/My-Simple-Programs | python/Twisted/krondo Twisted Introduction/twisted-client-2/get-poetry-stack.py | Python | gpl-2.0 | 3,806 | 0.001051 |
#!/usr/bin/python
#
# Created on Aug 25, 2016
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
# Avi Version: 16.3.8
#
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the te... | bjolivot/ansible | lib/ansible/modules/network/avi/avi_analyticsprofile.py | Python | gpl-3.0 | 25,965 | 0.003967 |
VERSION = None
BRANCH = 'master' | julien78910/CouchPotatoServer | version.py | Python | gpl-3.0 | 32 | 0.03125 |
import zstackwoodpecker.test_state as ts_header
import os
TestAction = ts_header.TestAction
def path():
return dict(initial_formation="template5", checking_point=1, faild_point=100000, path_list=[
[TestAction.create_mini_vm, 'vm1', 'cluster=cluster1'],
[TestAction.reboot_vm, 'vm1'],
[TestAction.create_mini_v... | zstackio/zstack-woodpecker | integrationtest/vm/mini/multiclusters/paths/multi_path173.py | Python | apache-2.0 | 2,948 | 0.018996 |
import asyncio
import random
import checks
from TextChecker import TextChecker
from database import Database
from checks import *
from data.rp_texts import *
from data.links import *
from web import Web
from roleplay.Player import Player
import discord
from discord.ext import commands
class Roleplay(commands.Cog):
... | nisanick/Prisma_Machina | cogs/roleplay.py | Python | mit | 45,290 | 0.004455 |
""" Optimzier Tests
These tests were adapted from PyTorch' optimizer tests.
"""
import math
import pytest
import functools
from copy import deepcopy
import torch
from torch.testing._internal.common_utils import TestCase
from torch.autograd import Variable
from timm.scheduler import PlateauLRScheduler
from timm.opti... | rwightman/pytorch-image-models | tests/test_optim.py | Python | apache-2.0 | 24,464 | 0.001635 |
# 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/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_load_balancers_operations.py | Python | mit | 23,464 | 0.004773 |
#!/usr/bin/env python3
# Copyright 2017 The Kubernetes 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 appl... | krzyzacy/test-infra | triage/summarize.py | Python | apache-2.0 | 21,103 | 0.002606 |
# coding: utf-8
import random
from deworld.layers.base_layer import BaseLayer
class VEGETATION_TYPE:
DESERT = 0
GRASS = 1
FOREST = 2
class VegetationLayer(BaseLayer):
MIN = 0.0
MAX = 1.0
HEIGHT_FOREST_BARIER_START = None
HEIGHT_FOREST_BARIER_END = None
HEIGHT_GRASS_BARIER_START ... | Tiendil/deworld | deworld/layers/vegetation_layer.py | Python | bsd-2-clause | 5,066 | 0.003948 |
# stdlib
from collections import namedtuple
# project
from resources import (
agg,
ResourcePlugin,
SnapshotDescriptor,
SnapshotField,
)
from utils.subprocess_output import get_subprocess_output
class Processes(ResourcePlugin):
RESOURCE_KEY = "processes"
FLUSH_INTERVAL = 1 # in minutes
... | huhongbo/dd-agent | resources/processes.py | Python | bsd-3-clause | 3,086 | 0.00162 |
import pycaption
from django import http
from django.shortcuts import get_object_or_404
from airmozilla.closedcaptions.models import ClosedCaptions
class TxtWriter(pycaption.base.BaseWriter):
def write(self, caption_set):
lang = caption_set.get_languages()[0]
captions = caption_set.get_captions(... | blossomica/airmozilla | airmozilla/closedcaptions/views.py | Python | bsd-3-clause | 2,235 | 0 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# exceptions.py
"""PyPhi exceptions."""
class StateUnreachableError(ValueError):
"""The current state cannot be reached from any previous state."""
def __init__(self, state):
self.state = state
msg = "The state {} cannot be reached in the given ... | wmayner/pyphi | pyphi/exceptions.py | Python | gpl-3.0 | 653 | 0 |
from app import application
if __name__=="__main__":
application.run()
| jerrylei98/Dailydos | wsgi.py | Python | mit | 77 | 0.025974 |
from django.contrib.contenttypes.models import ContentType
from django.contrib.auth.models import Permission, Group
from django.contrib.sites.models import Site
from django.db.models.signals import post_save, post_migrate
from django.core.exceptions import ObjectDoesNotExist
from main.models import SiteSettings, UserP... | mattr555/AtYourService-school | main/__init__.py | Python | mit | 1,906 | 0.005771 |
# Generated by Django 3.0.2 on 2020-03-04 20:08
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('files', '0004_image_compressed'),
('userprofile', '0029_auto_20200304_2007'),
]
operations = [
migr... | hackerspace-ntnu/website | userprofile/migrations/0030_skill.py | Python | mit | 955 | 0.004188 |
# -*- coding: utf-8 -*-
# Copyright (C) 2012, Almar Klein
#
# Visvis is distributed under the terms of the (new) BSD License.
# The full license can be found in 'license.txt'.
import visvis as vv
import numpy as np
import os
# Try importing imageio
imageio = None
try:
import imageio
except ImportError:
pass
... | chrisidefix/visvis | functions/volread.py | Python | bsd-3-clause | 1,322 | 0.008321 |
__version__ = '1.0.4'
KERNEL_NAME = 'aimlbot'
LANGUAGE = 'chatbot'
DISPLAY_NAME= 'AIML Chatbot'
| paulovn/aiml-chatbot-kernel | aimlbotkernel/__init__.py | Python | bsd-3-clause | 97 | 0.010309 |
import logging
import os
import re
import subprocess
import time
from ctypes.wintypes import MAX_PATH
from commander import Commander, Response
logger = logging.getLogger(__name__)
class CommanderImpl(Commander):
def __init__(self):
super().__init__()
def call(self, cmd: str) -> Response:
l... | coolman565/blu_two | commander/commander_impl.py | Python | mit | 1,705 | 0.001173 |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 27 12:16:26 2017
@author: Anand A Joshi, Divya Varadarajan
"""
import glob
from os.path import isfile, split
import configparser
config_file = u'/big_disk/ajoshi/ABIDE2/study.cfg'
Config = configparser.ConfigParser()
Config.read(config_file)
Conf... | ajoshiusc/brainsuite-workflows | utility_scripts/main_check_remaining.py | Python | mit | 1,120 | 0.000893 |
import requests
from fdep.backends import StorageBackend
class HTTPBackend(StorageBackend):
"""Implement HTTP/HTTPS."""
SCHEME_NAME = 'http'
def get_to(self, local_path):
r = requests.get(self.url, stream=True)
total_length = int(r.headers.get('content-length', 0))
self.progressba... | checkr/fdep | fdep/backends/http.py | Python | mit | 750 | 0 |
# -*- coding: utf-8 -*-
# -------------------------------------------------------------------------------
# Name: sfp_intfiles
# Purpose: From Spidering and from searching search engines, identifies
# files of potential interest.
#
# Author: Steve Micallef <steve@binarypool.com>
#... | Reality9/spiderfoot | modules/sfp_intfiles.py | Python | gpl-2.0 | 6,481 | 0.003395 |
# -*- coding: utf-8 -*-
from django import forms
class SearchForm(forms.Form):
query = forms.CharField(required=False)
| estebistec/django-get-forms | examples/demo/demo/forms.py | Python | bsd-3-clause | 127 | 0 |
# -*-coding:utf-8 -*-
import re
import json
from bs4 import BeautifulSoup
from page_parse import status
from decorators.decorator import parse_decorator
from db.models import UserRelation
from utils.filters import url_filter
from db.user_relation import save_relations
def get_userid(html):
return status.get_useri... | xtuyaowu/jtyd_python_spider | page_parse/user/public.py | Python | mit | 6,454 | 0.000775 |
# Copyright DataStax, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softwa... | thelastpickle/python-driver | cassandra/io/asyncorereactor.py | Python | apache-2.0 | 13,797 | 0.001667 |
# This file is part of Indico.
# Copyright (C) 2002 - 2015 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... | XeCycle/indico | indico/web/flask/blueprints/event/display/misc.py | Python | gpl-3.0 | 2,063 | 0.005332 |
# Copyright 2013, Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can
# be found in the LICENSE file.
# This is the shard name for when the keyrange covers the entire space
# for unsharded database.
SHARD_ZERO = '0'
# Keyrange that spans the entire space, used
# for ... | ptomasroos/vitess | py/vtdb/keyrange_constants.py | Python | bsd-3-clause | 450 | 0 |
"""Elementwise operators"""
from __future__ import absolute_import as _abs
import tvm
from .. import tag
from ..util import get_const_int
@tvm.tag_scope(tag=tag.ELEMWISE)
def relu(x):
"""Take relu of input x.
Parameters
----------
x : tvm.Tensor
Input argument.
Returns
-------
y :... | mlperf/training_results_v0.6 | Fujitsu/benchmarks/resnet/implementations/mxnet/3rdparty/tvm/topi/python/topi/nn/elemwise.py | Python | apache-2.0 | 1,936 | 0.002066 |
import unittest
from vase.util import MultiDict
class MultiDictTests(unittest.TestCase):
def test_setitem(self):
md = MultiDict()
key = 'hello'
value = 'world'
md[key] = value
self.assertEqual(md[key], value)
self.assertEqual(md.get(key), value)
self.asser... | vkryachko/Vase | tests/test_multidict.py | Python | bsd-2-clause | 640 | 0 |
# -*- coding: utf-8 -*-
#+---------------------------------------------------------------------------+
#| 01001110 01100101 01110100 01111010 01101111 01100010 |
#| |
#| Netzob : Inferring communication protocol... | nagyistoce/netzob | src/netzob/UI/Vocabulary/Views/MessageTableView.py | Python | gpl-3.0 | 29,245 | 0.003112 |
from pupa.scrape import Jurisdiction, Organization
import scrapelib
import lxml.html
from .people import SDLegislatorScraper
from .bills import SDBillScraper
class SouthDakota(Jurisdiction):
division_id = "ocd-division/country:us/state:sd"
classification = "government"
name = "South Dakota"
url = "htt... | cliftonmcintosh/openstates | openstates/sd/__init__.py | Python | gpl-3.0 | 3,672 | 0.000272 |
"""
UTILITIES
"""
def distinct(inlist):
"""
returns a list of distinct values
(no duplicated values)
"""
outlist = []
for elem in inlist:
if not elem in outlist:
outlist.append(elem)
return outlist
def list_evolution(list1,list2):
"""
returns the index evolution ... | dmartin35/pronosfoot | tools/utils.py | Python | mit | 1,623 | 0.02711 |
# coding=utf-8
#
# (c) Copyright 2008 by Daniel J. Rocco
# Licensed under the Creative Commons Attribution-
# Noncommercial-Share Alike 3.0 United States License, see
# <http://creativecommons.org/licenses/by-nc-sa/3.0/us/>
#
"""
Command-module for controlling **TortoiseSVN** from Windows Explorer
==================... | Erotemic/local | depricated/speech/Examples/_tortoisesvn.py | Python | gpl-3.0 | 6,848 | 0.003505 |
from sklearn2sql_heroku.tests.classification import generic as class_gen
class_gen.test_model("AdaBoostClassifier" , "FourClass_100" , "db2")
| antoinecarme/sklearn2sql_heroku | tests/classification/FourClass_100/ws_FourClass_100_AdaBoostClassifier_db2_code_gen.py | Python | bsd-3-clause | 144 | 0.013889 |
'''
Profile Formula Validation is an example of a plug-in to GUI menu that will profile formula execution.
(c) Copyright 2012 Mark V Systems Limited, All rights reserved.
'''
import os
from tkinter import simpledialog, messagebox
def profileFormulaMenuEntender(cntlr, menu):
# Extend menu with an item for the prof... | sternshus/arelle2.7 | svr-2.7/arelle/plugin/profileFormula.py | Python | apache-2.0 | 5,608 | 0.008559 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.