code
stringlengths
3
1.05M
repo_name
stringlengths
5
104
path
stringlengths
4
251
language
stringclasses
1 value
license
stringclasses
15 values
size
int64
3
1.05M
# -*- coding: utf-8 -*- from lutefiskdemo.settings import * DEBUG = True TEMPLATE_DEBUG = DEBUG SITE_ID = 1 MAINTENANCE_MODE = 'DEVELOPMENT' EMAIL_PORT = 1025 INSTALLED_APPS += ( 'debug_toolbar', ) MIDDLEWARE_CLASSES += ( 'debug_toolbar.middleware.DebugToolbarMiddleware', ) INTERNAL_IPS = ( ...
rentalita/django-lutefiskdemo
src/python/lutefiskdemo/development.py
Python
mit
475
# -*- coding: utf-8 -*- # Copyright (C) 1999-2002 Joel Rosdahl # Portions Copyright © 2011-2012 Jason R. Coombs """ Simple IRC bot library. This module contains a single-server IRC bot class that can be used to write simpler bots. """ from __future__ import absolute_import import sys import irc.client import irc...
sonoprob/0x56
bot/py/py-irc-8.5.1/irc/bot.py
Python
artistic-2.0
12,255
# -*- coding: utf-8 -*- import re import json import traceback import sys import time import datetime import random # 这段代码是用于解决中文报错的问题 reload(sys) sys.setdefaultencoding("utf8") from datetime import date from scrapy.selector import Selector from dateutil.relativedelta import relativedelta if __name__ == '__main__': ...
Svolcano/python_exercise
dianhua/worker/crawler/china_telecom/neimenggu/main.py
Python
mit
17,659
"""Support for Huawei LTE router notifications.""" import logging import time from typing import Any, Dict, List, Optional import attr from huawei_lte_api.exceptions import ResponseErrorException from homeassistant.components.notify import ATTR_TARGET, BaseNotificationService from homeassistant.const import CONF_REC...
tboyce021/home-assistant
homeassistant/components/huawei_lte/notify.py
Python
apache-2.0
1,964
from django.core.exceptions import PermissionDenied from django.contrib.auth.models import User from django.contrib.auth.decorators import login_required from django.views.decorators.http import require_http_methods from django.utils.translation import ugettext as _ from django.views.decorators.http import require_POST...
UXE/local-edx
cms/djangoapps/contentstore/views/user.py
Python
agpl-3.0
7,211
#!/usr/bin/env python # vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2012 Cisco Systems, 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 # # ...
liqin75/vse-vpnaas-plugin
quantum/plugins/linuxbridge/agent/linuxbridge_quantum_agent.py
Python
apache-2.0
27,238
#!/usr/bin/env python # -*- coding: utf-8 -*- # TODO: add options to the tests #options = fetch_options(args.config) import tests.engine import tests.handlers
johnpap96/Hurricane
tests/__init__.py
Python
mit
159
from sqlalchemy import Table, Column, Integer, String from sqlalchemy.orm import mapper from app.models import metadata, db_session class Users(object): query = db_session.query_property() def __init__(self, username=None, email=None, passwd=None): self.username = username self.passwd = passwd self...
TaggingAlong/TagAlong
app/models/users.py
Python
mit
587
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
twalpole/selenium
py/test/unit/selenium/webdriver/opera/opera_options_tests.py
Python
apache-2.0
2,867
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "homelessness.settings") try: from django.core.management import execute_from_command_line except ImportError: # The above import may fail for some other reason. Ensure that...
rdubrock/hackOregonHomelessness
manage.py
Python
mit
810
#!/usr/bin/env python3 """Python library and CLI to search in multiple torrent sources. Uses torrentmirror to get the first open mirror for any of the supported sites. """ import os import xdg import warnings import shutil import subprocess import asyncio import urllib.parse from configparser import ConfigParser imp...
XayOn/katcr
katcr/__init__.py
Python
gpl-3.0
5,363
# 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...
Laurawly/tvm-1
python/tvm/topi/mali/conv2d.py
Python
apache-2.0
23,182
from sys import stdin, stdout trie = {} def buildTrie(s): for i in range(0, len(s)): if(trie.get(s[i]-48) == None): trie[s[i]-48] = s[i] - 48 def main(): main()
mua-uniandes/weekly-problems
uva/uva11362.py
Python
gpl-3.0
188
#! /usr/bin/env python import sys from miasm2.os_dep.win_api_x86_32_seh import fake_seh_handler, build_teb, \ set_win_fs_0, return_from_exception, EXCEPTION_PRIV_INSTRUCTION, \ return_from_seh, DEFAULT_SEH from miasm2.os_dep.win_32_structs import ContextException from asm_test import Asm_Test_32 from pdb imp...
rom1sqr/miasm
test/arch/x86/unit/mn_seh.py
Python
gpl-2.0
2,594
from setuptools import setup # flake8: noqa VERSION = '0.0.4' NAME = 'goodscloud_api_client' tests_require = ['nose', 'coverage', 'responses'] setup( name = NAME, version = VERSION, description = "GoodsCloud API client", long_description = "", author = "GoodsCloud Inc.", author_email = 'dev@...
goodscloud/goodscloud-python
setup.py
Python
bsd-3-clause
1,015
queries = []
lamby/swordfish
client/django/django_swordfish/__init__.py
Python
gpl-3.0
13
''' Created on Nov 13, 2014 @author: ayan ''' # pylint: disable=C0301 EMAIL_RESPONSE = """This is an auto-generated email from the USGS Publications Warehouse. Below is copy of the message you {contact_str} submitted. If you feel you have received this message erroneously, please contact servicedesk@usgs.gov. {origi...
mbucknell/PubsWarehouse_UI
server/pubs_ui/pubswh/canned_text.py
Python
unlicense
353
# -*- coding: utf-8 -*- # # This file is part of the jabber.at homepage (https://github.com/jabber-at/hp). # # This project 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 (...
debalance/hp
hp/bootstrap/templatetags/bootstrap.py
Python
gpl-3.0
2,066
""" 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 from django.views.generic import TemplateView as BaseTemplateView from sentry.web.helpers imp...
nicholasserra/sentry
src/sentry/web/frontend/generic.py
Python
bsd-3-clause
1,354
""" Load a pretrained Transformer Tagger Its pretrained with TensorFlow using TPUs. Here is the model definition: ``` class TransformerTagger(tf.keras.Model): def __init__( self, num_labels: int, embeddings: tf.keras.layers.Layer, num_heads=8, num_layers=8, d_model=512, d_ff=None...
dpressel/baseline
addons/pretrained_transformer_tagger.py
Python
apache-2.0
7,114
import re import sys def sanitize(string): return re.sub('[^0-9a-zA-Z]+', '', string) def sanitize_name(string): return re.sub('[^0-9a-zA-Z]+', '', string) def multireplace(string, replacements): substrs = sorted(replacements, key=len, reverse=True) regexp = re.compile('|'.join(map(re.escape, substrs...
mmcdermo/RedLeader
redleader/util.py
Python
apache-2.0
731
# 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...
noironetworks/neutron
neutron/agent/l2/l2_agent_extensions_manager.py
Python
apache-2.0
2,311
'''Tools for the lazy amongst us: automation of common HANDE analysis tasks.''' import collections import math from os import path import pkgutil import sys import warnings import matplotlib.pyplot as plt import pandas as pd if pkgutil.find_loader('pyblock'): sys.path.append(path.join(path.abspath(path.dirname(__f...
hande-qmc/hande
tools/pyhande/pyhande/lazy.py
Python
lgpl-2.1
35,213
from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException import logging, time, pickle, urllib2, json from socket import error as socket_error from django.conf import settings # Debug settings debug = False if debug: logging.basicConfig() logging.getLogger("BitcoinRPC").setLevel(logging.DE...
alaniz3/Radium-IonCloud-UI
app/stats.py
Python
mit
1,241
"""This file is free software under the GPLv3 license""" import renpy.parser as parser import renpy.ast as ast from modloader import modinfo, modast from modloader.modgame import base as ml from modloader.modclass import Mod, loadable_mod @loadable_mod class AWSWMod(Mod): """The core mod. This mod is respons...
scrlys/AWSW-Modtools
mods/core/__init__.py
Python
gpl-3.0
2,640
quantidade = int(input("quantas notas você já tem = ")) notas = [] for c in range (0, quantidade): notas.append(float(input("entre com sua nota = "))) print(notas) //https://pt.stackoverflow.com/q/461346/101
maniero/SOpt
Python/Collection/Loop.py
Python
mit
215
import os os.environ['DJANGO_SETTINGS_MODULE']='settings' import webapp2 as webapp from google.appengine.ext.webapp.util import run_wsgi_app from google.appengine.ext.webapp import template import numpy as np import cgi import cgitb cgitb.enable() class genericQaqcPage(webapp.RequestHandler): def get(self): ...
puruckertom/poptox
poptox/generic/generic_qaqc.py
Python
unlicense
1,264
from Components.config import config from Renderer import Renderer from enigma import eLabel, eTimer from boxbranding import getMachineProcModel from Components.VariableText import VariableText class RollerCharLCD(VariableText, Renderer): def __init__(self): Renderer.__init__(self) VariableText.__init__(self) i...
n3wb13/OpenNfrGui-5.0-1
lib/python/Components/Renderer/RollerCharLCD.py
Python
gpl-2.0
1,909
'''Common functions.''' # # Copyright 2015 CityGrid Media, 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 ...
CityGrid/logwatcher
logwatcher/common.py
Python
apache-2.0
2,187
#!/usr/bin/env python from app import app app.run(debug=True, port=5000)
MITPERG/oilsands-mop
run.py
Python
mit
74
from defode.variable import ODESet class Compartment(object): """ Represent a compartment for compartmental modelling. Don't instantiate this class directly: the compartmental_model function is what you need. """ def __init__(self, name=None, odeset=None): if odeset is None: ...
pdmetcalfe/defode
defode/compartments.py
Python
bsd-2-clause
1,564
from src.Product import Product import unittest class TestProduct(unittest.TestCase): """These tests are derived from the sample inputs and outputs in "Problem 2"'s definition. """ def test_book_sample(self): self.product = Product("1 book at 12.49") result = self.product.saleOutpu...
Gerasim-Stan/SalesTaxesProblem
TestProduct.py
Python
gpl-3.0
2,230
# # Copyright (c) SAS Institute 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...
sassoftware/mint
mint/scripts/postgres_auto_update.py
Python
apache-2.0
7,720
# lexer.py # # author: Christopher S. Corley from swindle.lexeme import Lexeme from swindle.types import (Types, get_type, PUNCTUATION) from io import TextIOWrapper class Lexer: def __init__(self, fileptr): # fileptr is generally a TextIOWrapper when reading from a file self.fileptr = fileptr ...
cscorley/swindle
swindle/lexer.py
Python
mit
6,465
import itertools from time import time import Errors import DebugFlags import Options from Visitor import CythonTransform from Errors import CompileError, InternalError, AbortError # # Really small pipeline stages # def dumptree(t): # For quick debugging in pipelines print t.dump() return t def abort_on_...
larsmans/cython
Cython/Compiler/Pipeline.py
Python
apache-2.0
12,686
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, Ravi Bhure <ravibhure@gmail.com> # 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 ANSIBLE_METADATA = {'metadata_version': '1.1', ...
valentin-krasontovitsch/ansible
lib/ansible/modules/net_tools/haproxy.py
Python
gpl-3.0
16,304
import os import pytest from PIL import Image from keras_retinanet.utils import image import numpy as np _STUB_IMG_FNAME = 'stub-image.jpg' @pytest.fixture(autouse=True) def run_around_tests(tmp_path): """Create a temp image for test""" rand_img = np.random.randint(0, 255, (3, 3, 3), dtype='uint8') Image...
delftrobotics/keras-retinanet
tests/preprocessing/test_image.py
Python
apache-2.0
742
# # # 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 applicable law or agreed t...
windskyer/k_nova
paxes_nova/virt/ibmpowervm/ivm/driver.py
Python
apache-2.0
53,847
# Copyright 2015: Mirantis 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...
vishnu-kumar/PeformanceFramework
rally_os/plugins/openstack/scenarios/ironic/nodes.py
Python
apache-2.0
3,608
# -*- coding: utf-8 -*- ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> # # Copyright 2012 Zearin <zearin@gonk.net> ...
fernandog/Medusa
ext/github/IssueComment.py
Python
gpl-3.0
8,222
#!/usr/bin/env python # -*- coding: utf-8 -*- # # internal.py # # Copyright 2017 notna <notna@apparat.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 the Lice...
not-na/peng3dnet
peng3dnet/packet/internal.py
Python
gpl-2.0
7,803
#!/usr/bin/env python3 import shutil import sys from tools import impl parser = impl.argparser() (options, args) = parser.parse_known_args() impl.log(args) # ranlib just gets a single argument and is expected to run in-place archive = args[0] assert archive.endswith(".static") # Buck requires that our output at...
facebook/buck
test/com/facebook/buck/cxx/testdata/cxx_toolchain/tools/ranlib.py
Python
apache-2.0
673
""" Copyright 2014-2021 Vincent Texier <vit@free.fr> DuniterPy 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. DuniterPy is distributed in...
ucoin-io/ucoin-python-api
tests/grammars/test_output.py
Python
gpl-3.0
6,910
#!/usr/bin/python # -*- coding: utf-8 -*- DOCUMENTATION = ''' --- module: typetalk version_added: "1.6" short_description: Send a message to typetalk description: - Send a message to typetalk using typetalk API ( http://developers.typetalk.in/ ) options: client_id: description: - OAuth2 client ID req...
mapennell/ansible
notification/typetalk.py
Python
gpl-3.0
2,877
from collections import defaultdict import numpy as np import random import tree # pip install dm_tree from typing import Any, Callable, Dict, List, Optional, TYPE_CHECKING from ray.rllib.env.base_env import _DUMMY_AGENT_ID from ray.rllib.policy.policy_map import PolicyMap from ray.rllib.utils.annotations import Depr...
ray-project/ray
rllib/evaluation/episode.py
Python
apache-2.0
18,276
"""The tests for the automation component.""" import unittest from blumate.bootstrap import _setup_component import blumate.components.automation as automation from blumate.const import ATTR_ENTITY_ID from tests.common import get_test_home_assistant class TestAutomation(unittest.TestCase): """Test the event aut...
bdfoster/blumate
tests/components/automation/test_init.py
Python
mit
11,623
import datetime import pytest import server from flask import url_for from webhook_sender import CFG, ses, eng, models, sender MULTIPLIER = int(CFG.get('webhook', 'MULTIPLIER')) RETRIES = int(CFG.get('webhook', 'RETRIES')) @pytest.mark.usefixtures('live_server') class TestLiveServer: def test_send(self): ...
GitGuild/webhook-sender
test/test_send.py
Python
mit
2,904
#!/usr/bin/env python # fibaro_motion_sensor_a.py # Copyright (C) ContinuumBridge Limited, 2014-2015 - All Rights Reserved # Written by Peter Claydon # ModuleName = "fibaro_motion_sensor" BATTERY_CHECK_INTERVAL = 10800 # How often to check battery (secs) = 3 hours SENSOR_POLL_INTERVAL = 600 ...
ContinuumBridge/fibaro_motion_sensor
fibaro_motion_sensor_a.py
Python
mit
13,739
#!/usr/bin/python2.7 import sys import os import socket import subprocess import libvirt from operator import itemgetter import logging import logging.handlers from xml.etree import ElementTree as ET import os.path import subprocess import signal import commands from nova.network import linux_net from nova import paths...
dbryson/serial_debug
serial_debug.py
Python
gpl-2.0
8,693
# -*- coding: UTF-8 -*- # Copyright 2012-2015 Rumma & Ko Ltd # License: BSD (see file COPYING for details) """ Adds demo data for :mod:`lino_welfare.modlib.newcomers`. """ from builtins import range from lino.utils.instantiator import Instantiator from lino.utils import Cycler from lino.api.dd import babel_values ...
lsaffre/lino-welfare
lino_welfare/modlib/newcomers/fixtures/demo.py
Python
agpl-3.0
3,086
"""Word cloud is ungraded xblock used by students to generate and view word cloud. On the client side we show: If student does not yet answered - `num_inputs` numbers of text inputs. If student have answered - words he entered and cloud. """ import json import logging from pkg_resources import resource_string from x...
TsinghuaX/edx-platform
common/lib/xmodule/xmodule/word_cloud_module.py
Python
agpl-3.0
7,907
import wx class CustomDialog(wx.Dialog): # class CustomSpinCtrl(wx.Window): """ A custom class that replicates some of the functionalities of wx.SpinCtrl """ def __init__(self, parent, title=""): wx.Dialog.__init__(self, ...
swprojects/PyRoboToolTimer
wxsw/dialogs/dialog.py
Python
gpl-3.0
1,508
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2016-2019 Matt Hostetter. # # This 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. # # Thi...
mhostetter/gr-adsb
python/framer.py
Python
gpl-3.0
8,268
#!/usr/bin/env python # -*- coding: utf-8 -*- import unittest from libnmap.parser import NmapParser from libnmap.diff import NmapDiffException service1 = """ <port protocol="tcp" portid="22"> <state state="open" reason="syn-ack" reason_ttl="0"/> <service name="ssh" method="table" conf="3"/> </port> """ servi...
pyphrb/myweb
app/plugin/nmap/libnmap/test/test_service.py
Python
apache-2.0
9,056
#!/usr/bin/python # Copyright 2015 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. """Runs unit tests on host_info.py. Usage: ./host_info_test.py """ import unittest from slave.ios import host_info class ExtractXcod...
eunchong/build
scripts/slave/ios/host_info_test.py
Python
bsd-3-clause
3,152
# -*- coding: utf8 -*- import subprocess import os from pathlib import Path cwd = os.getcwd() try: print(os.getcwd()) subprocess.call(['make']) # res = subprocess.check_output('uname -a',shell=True) res = subprocess.check_output( r"./darknet detector test cfg/coco.data cfg/yolo.cfg yolo.weight...
umyuu/Sample
src/Python3/Q113190/exsample.py
Python
mit
512
# 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...
dmlc/tvm
tests/python/unittest/test_meta_schedule_postproc_rewrite_parallel_vectorize_unroll.py
Python
apache-2.0
3,907
from .ela import * from .ela_widget import * from .mapping import *
DIRECT-Energy-Storage/Final-Project
ela/__init__.py
Python
mit
68
# @Author: Manuel Rodriguez <valle> # @Date: 09-Mar-2018 # @Email: valle.mrv@gmail.com # @Last modified by: valle # @Last modified time: 09-Mar-2018 # @License: Apache license vesion 2.0 from django.shortcuts import render from django.contrib.auth.decorators import login_required from ventas.models import Pedido...
vallemrv/tpvB3
cloud/ventas/views/pedidos.py
Python
apache-2.0
593
__all__ = ['mutation_to_uid'] import argparse import hashlib from ruamel.yaml import YAML DESCRIPTION = """ Adds unique identifiers to each mutant within a ground truth database file. """.strip() def mutation_to_uid(diff: str) -> str: m = hashlib.sha512() m.update(diff.encode()) uid = m.hexdigest()[:24...
squaresLab/Houston
experiments/hash_mutants.py
Python
mit
991
# -*- Mode: python; coding: utf-8; tab-width: 4; indent-tabs-mode: nil; -*- # # IMPORTANT - WHILST THIS MODULE IS USED BY SEVERAL OTHER PLUGINS # THE MASTER AND MOST UP-TO-DATE IS FOUND IN THE COVERART BROWSER # PLUGIN - https://github.com/fossfreedom/coverart-browser # PLEASE SUBMIT CHANGES BACK TO HELP EXPAND THIS AP...
TheBigW/ParametricEQ
ParametricEQ_rb3compat.py
Python
gpl-3.0
28,758
# Copyright (C) 2012,2015 Codethink Limited # # 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; version 2 of the License. # # This program is distributed in the hope that it will be useful, # but...
nuxeh/morph
morphlib/savefile.py
Python
gpl-2.0
2,263
import datetime from dateutil import parser from flask import g, render_template from app.decorators import store_query_parameters from app.main.pages.telescope.seeing.seeing import update from app.main.seeing_form import SeeingForm def title(): return 'Seeing' def content(): return seeing_content(default_s...
saltastro/salt-data-quality-site
app/main/pages/telescope/seeing/__init__.py
Python
mit
2,240
# 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...
jamielennox/tempest
tempest/scenario/test_volume_boot_pattern.py
Python
apache-2.0
8,184
# -*- coding: utf-8 -*- from datetime import datetime __author__ = u"Tomas Holub" __email__ = u"tomas.holub@olc.cz" class Message(object): u"""Basic class for Messages that goes into the Queue""" MESSAGE_TYPE = u"basic" STATUS_NEW = u"new" STATUS_QUEUED = u"queued" STATUS_DEQUEUED = u"dequeued...
HolubTom/Queue
pCore/module/queue/messages/Message.py
Python
mit
1,342
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Django File Chooser documentation build configuration file, created by # sphinx-quickstart on Thu Mar 26 20:35:58 2015. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present ...
martinvw/django-filechooser
docs/conf.py
Python
mit
9,307
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('orb', '0048_userprofile_survey'), ] operations = [ migrations.AddField( model_name='resourcetracker', ...
mPowering/django-orb
orb/migrations/0049_survey_questions.py
Python
gpl-3.0
1,035
# -*- coding: utf-8 -*- # Generated by Django 1.11.29 on 2020-03-05 14:48 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('partner', '0016_auto_20191115_2151'), ] operations = [ migrations.AlterField( model_name='historicalp...
eduNEXT/edunext-ecommerce
ecommerce/extensions/partner/migrations/0017_auto_20200305_1448.py
Python
agpl-3.0
887
# Copyright (c) 2010-2017 Samuel Abels # # 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, d...
knipknap/Gelatin
Gelatin/parser/Parser.py
Python
mit
2,301
# # generates pngs from the aligned fits files # do not forget to # - change the pngkey, # - the region and cutoffs # - the resizing # - the sorting and naming of the images # execfile("../config.py") from kirbybase import KirbyBase, KBError from variousfct import * import star import shutil import f2n from datetime ...
COSMOGRAIL/COSMOULINE
pipe/1_character_scripts/5a_fac_makepngs_NU.py
Python
gpl-3.0
5,189
''' Copyright (C) 2017-2019 Vanessa Sochat. This program 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 option) any later version. This program is distribute...
vsoch/singularity-python
singularity/views/trees.py
Python
agpl-3.0
11,488
import logging import uuid import gevent from lymph.utils.gpool import NonBlockingPool logger = logging.getLogger(__name__) def get_trace(greenlet=None): greenlet = greenlet or gevent.getcurrent() if not hasattr(greenlet, '_lymph_trace'): greenlet._lymph_trace = {} return greenlet._lymph_trace...
lyudmildrx/lymph
lymph/core/trace.py
Python
apache-2.0
1,047
# -*- coding: utf-8 -*- # Copyright 2022 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-automl
google/cloud/automl_v1/types/dataset.py
Python
apache-2.0
6,186
from typing import Any, List import numpy as np import pytest import pandas as pd import pandas._testing as tm from pandas.core.arrays import ExtensionArray # integer dtypes arrays = [pd.array([1, 2, 3, None], dtype=dtype) for dtype in tm.ALL_EA_INT_DTYPES] scalars: List[Any] = [2] * len(arrays) # floating dtypes ar...
jreback/pandas
pandas/tests/arrays/masked/test_arithmetic.py
Python
bsd-3-clause
5,147
""" Code for deep Q-learning as described in: Playing Atari with Deep Reinforcement Learning NIPS Deep Learning Workshop 2013 and Human-level control through deep reinforcement learning. Nature, 518(7540):529-533, February 2015 Author of Lasagne port: Nissan Pow Modifications: Nathan Sprague """ import lasagne imp...
codeaudit/deep_q_rl
deep_q_rl/q_network.py
Python
bsd-3-clause
15,963
# -*- coding: utf-8 -*- '''twoq active ordering queues''' from twoq.queuing import SLOTS from twoq.ordering import RandomMixin, OrderingMixin, CombineMixin from twoq.active.mixins import AutoResultMixin, ManResultMixin class randomq(AutoResultMixin, RandomMixin): '''auto-balanced randomizing queue''' __sl...
lcrees/twoq
twoq/active/ordering.py
Python
bsd-3-clause
908
#!/usr/bin/env python # Manual script to issue MySQL queries to the DB import cgi, cgitb import sys cgitb.enable() from common import * # Output HTML header print "Content-type:text/html" print # THIS BLANK LIKE IS MANDATORY print '<!DOCTYPE html>' print '<html lang="en">' print '<head></head><body>' # Import M...
meithan/NFL_website
cgi-bin/query.py
Python
gpl-3.0
2,717
""" Methods for sensor selection optimization algorithms .. note:: The words *sensor* and *channel* are used as synonyms. .. todo:: Adapt to new subflow concept for speed up via parallelization. """ import os import random from operator import itemgetter from copy import deepcopy import numpy try: if map(int, _...
pyspace/test
pySPACE/missions/nodes/spatial_filtering/sensor_selection.py
Python
gpl-3.0
52,321
"""Leetcode 46. Permutations Medium URL: https://leetcode.com/problems/permutations/ Given a collection of distinct integers, return all possible permutations. Example: Input: [1,2,3] Output: [ [1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], [3,2,1] ] """ class SolutionBacktrack(object): def _backtrack...
bowen0701/algorithms_data_structures
lc0046_permutations.py
Python
bsd-2-clause
1,340
# -*- coding: utf-8 -*- # This file is part of beets. # Copyright 2016, Adrian Sampson. # # 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 t...
clinton-hall/nzbToMedia
libs/common/beets/autotag/hooks.py
Python
gpl-3.0
22,310
# -*- coding: utf-8 -*- import os,math from qgis.core import NULL from mole3 import oeq_global from mole3.project import config from mole3.extensions import OeQExtension from mole3.stat_corr import rb_contemporary_base_uvalue_by_building_age_lookup def calculation(self=None, parameters={},feature = None): from sc...
UdK-VPT/Open_eQuarter
mole3x/extensions/prop_buildings/oeq_ACHL.py
Python
gpl-2.0
1,245
#!/usr/bin/env python from distutils.core import setup setup(name='my_package', version='0.1dev', description='DSFP session 3, day 1', author='Nora Shipp', author_email='norashipp@uchicago.edu', packages=['my_package','my_package/tests'], )
norashipp/DSFP_repo
setup.py
Python
mit
278
# Licensed to Elasticsearch B.V. under one or more contributor # license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright # ownership. Elasticsearch B.V. licenses this file to you under # the Apache License, Version 2.0 (the "License"); you may # not use ...
elastic/elasticsearch-py
elasticsearch/_async/client/license.py
Python
apache-2.0
11,277
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Fabian Pedregosa <fabian.pedregosa@inria.fr> # Olivier Grisel <olivier.grisel@ensta.org> # Gael Varoquaux <gael.varoquaux@inria.fr> # # License: BSD 3 clause import sys import warnings from abc import ABCMeta, abstractmethod import n...
liberatorqjw/scikit-learn
sklearn/linear_model/coordinate_descent.py
Python
bsd-3-clause
76,767
from CommandableSprite import CommandableSprite import pygame import pygame.font class TextSprite(CommandableSprite): """ A class for displaying fonts. Most of the image/surface processing is done at initialization, rather than in .draw(), in order to make drawing faster (for RSVP, etc) """ def __init__(...
piantado/kelpy
kelpy/TextSprite.py
Python
gpl-3.0
869
import requests from django.conf import settings from django.http import HttpResponse, HttpResponseBadRequest from django.views.decorators.csrf import csrf_exempt from django.views.decorators.http import require_http_methods @csrf_exempt @require_http_methods(["POST"]) def post_service_request(request): payload =...
City-of-Helsinki/smbackend
services/views.py
Python
agpl-3.0
1,229
#!/usr/bin/env python # -*- coding: utf-8 -*- """Middleware classes for johnny cache.""" from django.middleware import transaction as trans_middleware from django.db import transaction from johnny import cache, settings class QueryCacheMiddleware(object): """ This middleware class monkey-patches django's OR...
underlost/GamerNews
gamernews/vendor/johnny/middleware.py
Python
mit
2,091
""" Copyright 2015 BlazeMeter 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, software...
Nefry/taurus
bzt/__init__.py
Python
apache-2.0
2,009
# -*- coding: utf-8 -*- from django.template.loader import get_template from django.template.context import Context from dndtools.dnd.dnd_paginator import DndPaginator class DndMobilePaginator(DndPaginator): def print_navigation(self): template = get_template('dnd/mobile/dndpaginator_navigation.html') ...
gregpechiro/dndtools
dndtools/dnd/mobile/dnd_paginator.py
Python
mit
751
"""Setuid backdoor handler SYNOPSIS: suidroot --create <SUIDROOT_BACKDOOR> suidroot "<COMMAND>" DESCRIPTION: Provide a simple way to install persistent setuid(2) backdoor from previously obtained root access. SUIDROOT_BACKDOOR file should be carefully chosen to not look suspicious. Our goal i...
nil0x42/phpsploit
plugins/system/suidroot/plugin.py
Python
gpl-3.0
4,838
import datetime from django_filters.rest_framework import DjangoFilterBackend, FilterSet, NumberFilter from rest_framework import permissions, viewsets from rest_framework.filters import OrderingFilter from catalog.rest_serializers import MediaSerializer, MSerializer from storage.models import Media class ReadOnlyPe...
askoretskiy/private-photo-cloud
backend/catalog/rest_views.py
Python
gpl-3.0
1,595
""" This module gathers tree-based methods, including decision, regression and randomized trees. Single and multi-output problems are both handled. """ # Code is originally adapted from MILK: Machine Learning Toolkit # Copyright (C) 2008-2011, Luis Pedro Coelho <luis@luispedro.org> # License: MIT. See COPYING.MIT file...
GbalsaC/bitnamiP
venv/lib/python2.7/site-packages/sklearn/tree/tree.py
Python
agpl-3.0
27,669
"""Tests for the GCE ``compute_resource`` paths. A full API reference for compute resources can be found here: http://www.katello.org/docs/api/apidoc/compute_resources.html :Requirement: Computeresource GCE :CaseAutomation: Automated :CaseLevel: Acceptance :CaseComponent: ComputeResources-GCE :Assignee: lvrtelov ...
jyejare/robottelo
tests/foreman/api/test_computeresource_gce.py
Python
gpl-3.0
13,030
import socket import sys file = open("info.json") pack = file.read() HOST, PORT = "localhost", 9090 #data = " ".join(sys.argv[1:]) data = pack # Create a socket (SOCK_STREAM means a TCP socket) sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # Connect to server and send data sock.connect((HOST, PORT)) sock....
enorenio/test
dsm/src/client.py
Python
mit
573
# -*- coding: utf-8 -*- """ Various i18n functions. Helper functions for both the internal translation system and for TranslateWiki-based translations. By default messages are assumed to reside in a package called 'scripts.i18n'. In pywikibot 2.0, that package is not packaged with pywikibot, and pywikibot 2.0 does ...
TridevGuha/pywikibot-core
pywikibot/i18n.py
Python
mit
21,938
""" Returns the array of survival function values for the Weibull probability distribution using the given arrays for the abscissa or template values and each of the parameters values. """ import numpy import pyferret import pyferret.stats DISTRIB_NAME = "Weibull" FUNC_NAME = "sf" def ferret_init(id): """ In...
NOAA-PMEL/PyFerret
pyfermod/stats/stats_weibull_sf.py
Python
unlicense
724
try: import slacker # noqa F401 except ImportError: from PokeAlarm.Utils import pip_install pip_install('slacker', '0.9.24') from SlackAlarm import SlackAlarm # noqa 401
neskk/PokeAlarm
PokeAlarm/Alarms/Slack/__init__.py
Python
agpl-3.0
186
from wordfreq import ( word_frequency, available_languages, cB_to_freq, top_n_list, random_words, random_ascii_words, tokenize ) from nose.tools import ( eq_, assert_almost_equal, assert_greater, raises ) def test_freq_examples(): # Stopwords are most common in the correct language assert_greater(...
dragon788/wordfreq
tests/test.py
Python
mit
5,277
# Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # Copyright (c) 2012 X.commerce, a business unit of eBay Inc. # # Licensed under the Apache License, Version 2.0 (the "License")...
zouyapeng/horizon-newtouch
openstack_dashboard/test/api_tests/nova_tests.py
Python
apache-2.0
10,232
import os import unittest import nmthreadingerror import nmrestrictionsprocessor class TestRestrictionsProcessor(unittest.TestCase): def setUp(self): self.contentStr = "resource cpu .10\nresource events 100\n" self.contentStr2 = "resource cpu .05\nresource events 50\n" self.contentArr = ["resource cpu ...
sburnett/seattle
nodemanager/tests/testnmthreadingerror.py
Python
mit
4,647